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 |
---|---|---|---|---|---|---|
Remove the specified resource from storage. | public function destroy($id)
{
management::find($id)->delete();
return response()->json(['Member Record deleted successfully.']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }",
"public function destroy(Resource $resource)\n {\n //\n }",
"public function removeResource($resourceID)\n\t\t{\n\t\t}",
"public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }",
"public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }",
"public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }",
"public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }",
"protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }",
"public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }",
"public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }",
"public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }",
"public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}",
"public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}",
"public function delete(): void\n {\n unlink($this->getPath());\n }",
"public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }",
"public function remove($path);",
"function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}",
"public function delete(): void\n {\n unlink($this->path);\n }",
"private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }",
"public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }",
"public function remove() {}",
"public function remove() {}",
"public function remove();",
"public function remove();",
"public function remove();",
"public function remove();",
"function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}",
"public function deleteImage(){\n\n\n Storage::delete($this->image);\n }",
"public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }",
"public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}",
"public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }",
"public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }",
"public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}",
"public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }",
"public function deleteImage(){\n \tStorage::delete($this->image);\n }",
"public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }",
"public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }",
"public function destroy($id)\n {\n Myfile::find($id)->delete();\n }",
"public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }",
"public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }",
"public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }",
"public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }",
"public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }",
"public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }",
"public function delete($path);",
"public function delete($path);",
"public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }",
"public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }",
"public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }",
"public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }",
"public function delete($path, $data = null);",
"public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }",
"public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }",
"public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }",
"public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }",
"public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }",
"public function del($path){\n\t\treturn $this->remove($path);\n\t}",
"public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }",
"public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}",
"public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }",
"public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }",
"public function revoke($resource, $permission = null);",
"public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }",
"function delete($path);",
"public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}",
"public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }",
"public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }",
"public function remove($filePath){\n return Storage::delete($filePath);\n }",
"public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }",
"public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }",
"public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }",
"public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }",
"function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }",
"public function remove($id);",
"public function remove($id);",
"public function deleted(Storage $storage)\n {\n //\n }",
"public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }",
"public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }",
"public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }",
"public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }",
"function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}",
"public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }",
"public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}",
"public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }",
"public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }"
] | [
"0.6672584",
"0.6659381",
"0.6635911",
"0.6632799",
"0.6626075",
"0.65424126",
"0.65416265",
"0.64648265",
"0.62882507",
"0.6175931",
"0.6129922",
"0.60893893",
"0.6054415",
"0.60428125",
"0.60064924",
"0.59337646",
"0.5930772",
"0.59199584",
"0.5919811",
"0.5904504",
"0.5897263",
"0.58962846",
"0.58951396",
"0.58951396",
"0.58951396",
"0.58951396",
"0.5880124",
"0.58690923",
"0.5863659",
"0.5809161",
"0.57735413",
"0.5760811",
"0.5753559",
"0.57492644",
"0.5741712",
"0.57334286",
"0.5726379",
"0.57144034",
"0.57096",
"0.5707689",
"0.5705895",
"0.5705634",
"0.5703902",
"0.5696585",
"0.5684331",
"0.5684331",
"0.56780374",
"0.5677111",
"0.5657287",
"0.5648262",
"0.5648085",
"0.5648012",
"0.5640759",
"0.5637738",
"0.5629985",
"0.5619264",
"0.56167465",
"0.5606877",
"0.56021434",
"0.5601949",
"0.55992156",
"0.5598557",
"0.55897516",
"0.5581397",
"0.5566926",
"0.5566796",
"0.55642897",
"0.55641",
"0.5556583",
"0.5556536",
"0.5550097",
"0.5543172",
"0.55422723",
"0.5540013",
"0.5540013",
"0.55371785",
"0.55365825",
"0.55300397",
"0.552969",
"0.55275744",
"0.55272335",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.5525997",
"0.5525624",
"0.5523911",
"0.5521122",
"0.5517412"
] | 0.0 | -1 |
// add your own arguments here | protected function configure()
{
// $this->addArguments(array(
// new sfCommandArgument('my_arg', sfCommandArgument::REQUIRED, 'My argument'),
// ));
$this->addOptions(array(
new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name', 'doctrine'),
new sfCommandOption('env', null, sfCommandOption::PARAMETER_OPTIONAL, 'The environment', 'all'),
));
$this->namespace = 'shakmyth';
$this->name = 'verifyMythsIsActive';
$this->briefDescription = 'Verify the is_active status of each myth';
$this->detailedDescription = <<<EOF
The [verifyMythsIsActive|INFO] task does things.
Call it with:
[php symfony verifyMythsIsActive|INFO]
EOF;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __construct()\n {\n $this->arguments = func_get_args();\n }",
"abstract public static function args();",
"abstract protected function get_args();",
"public function initializeArguments() {}",
"public function initializeArguments() {}",
"public function initializeArguments() {}",
"public function initializeArguments() {}",
"public function prepareArguments() {}",
"abstract protected function arguments(): array;",
"function change_arguments( $args ) {\n //$args['dev_mode'] = true;\n\n return $args;\n }",
"private function setArgs(){\n\t\t$this->args = array(\n\t\t\t'label' => $this->label,\n\t\t\t'labels' => $this->labels,\n\t\t\t'description' => $this->description,\n\t\t\t'public' => $this->public,\n\t\t\t'exclude_from_search' => $this->excludeSearch,\n\t\t\t'publicly_queryable' => $this->publiclyQueryable,\n\t\t\t'show_ui' => $this->show_ui ,\n\t\t\t'show_in_nav_menus' => $this->showInNavMenus,\n\t\t\t'show_in_menu' => $this->showInMenu,\n\t\t\t'show_in_admin_bar' => $this->showInAdminBar,\n\t\t\t'menu_position' => $this->menuPosition,\n\t\t\t'menu_icon' => $this->menuIcon,\n\t\t\t'capability_type' => $this->capabilityType,\n\t\t\t'map_meta_cap' => $this->mapMetaCap,\n\t\t\t'hierarchical' => $this->hierarchical,\n\t\t\t'supports' => $this->supports,\n\t\t\t'register_meta_box_cb' => $this->registerMetaBoxCb,\n\t\t\t'taxonomies' => $this->taxonomies,\n\t\t\t'has_archive' => $this->hasArchive,\n\t\t\t'permalink_epmask' => $this->permalinkEpmask,\n\t\t\t'rewrite' => $this->rewrite,\n\t\t\t'query_var' => $this->queryVar,\n\t\t\t'can_export' => $this->canExport,\n\t\t\t'_builtin' => $this->builtin\n\t\t);\n\t}",
"function __construct($arguments){\n\t\t}",
"function change_arguments( $args ) {\n //$args['dev_mode'] = true;\n\n return $args;\n }",
"public function getAdditionalArguments() {}",
"public function getAdditionalArguments() {}",
"function prepare_args($args)\n {\n }",
"public function __construct(array $arguments = array()) {\n\n\t}",
"function getArguments() ;",
"public function arguments(): array;",
"public function __construct($args = '')\n {\n }",
"protected function getArguments()\n {\n\n }",
"function get_args($request)\n {\n }",
"function get_args($request)\n {\n }",
"protected function initializeCommandMethodArguments() {}",
"public function withArguments(array $args);",
"function add_query_arg(...$args)\n {\n }",
"public static function connectionArgs()\n {\n }",
"public static function connectionArgs()\n {\n }",
"public function __construct($args = array())\n {\n }",
"public function __construct($args = array())\n {\n }",
"public function __construct($args = array())\n {\n }",
"public function __construct($args = array())\n {\n }",
"private function prepareArgs(){\n\t\t$nro_arguments \t = $this->webPathNumber + 3;\n\t\t$this->argsArray = array_slice(explode('/',$this->uri), $nro_arguments);\n\t}",
"function acf_request_args($args = array())\n{\n}",
"public function __construct($argv)\n {\n }",
"abstract protected function main(array $arguments);",
"protected function wrong_arguments() {\n\t\t\twp_die();\n\t\t}",
"protected function setCliArguments() {}",
"private function parse_args() {\n\t\t//exit;\t\t\n\t}",
"function training_menu_arguments($arg1 = NULL, $arg2 = NULL) {\n $output = '';\n if (!empty($arg1)) {\n $output .= t('Argument 1=%arg', array('%arg' => $arg1)) . '</br>';\n }\n if (!empty($arg2)) {\n $output .= t('Argument 2=%arg', array('%arg' => $arg2));\n }\n\n return $output;\n}",
"public function __construct($args = null)\n\t{\n\t\t//self::$absolute_execute = \\Cli::option('absolute_execute', false);\n\t}",
"public function getArgs();",
"public function getArgs();",
"function ee() {\n\t\techo \"<pre>\";\n\t\t$args = func_get_args();\n\n\t\tforeach ( $args as $arg ) {\n\t\t\tprint_r( $arg );\n\t\t}\n\n\t\texit();\n\t}",
"function modify_nav_arguments($arguments){\n\n $arguments['walker'] \t\t\t\t= new accesspress_mag_walker();\n //$arguments['container_class'] \t\t= $arguments['container_class'] .= 'mega-menu-wrapper';\n $arguments['menu_class']\t\t\t= 'menu accesspress_mag_mega_menu';\n\n return $arguments;\n }",
"static function register_args(): array { return ['rewrite' => false]; }",
"function drush_boilerplate_callback() {\n // Default argument values.\n $arg1 = 'default argument 1';\n $arg2 = 'default argument 2';\n\n // Get the arguments from CLI.\n $args = func_get_args();\n if (!empty($args[0])) $arg2 = $args[0];\n if (!empty($args[1])) $arg2 = $args[1];\n\n drush_log(dt('This is a custom Drush command. Argument 1: @arg1. Argument 2: @arg2.', [\n '@arg1' => $arg1,\n '@arg2' => $arg2,\n ]), 'ok');\n}",
"protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}",
"protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}",
"protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}",
"protected function getArguments()\n\t{\n\t\treturn array(\n\t\t\t\n\t\t);\n\t}",
"private function __construct() {\n $args = func_get_args();\n $this->name = $args[0];\n $this->title = $args[1];\n $this->email = $args[2];\n $this->valediction = $args[3];\n }",
"public function __construct($argument1)\n {\n }",
"private function constructArguments()\r\n\t{\r\n\t\t$arguments = \"-q on \";\r\n\r\n\t\tif ($this->title)\r\n\t\t{\r\n\t\t\t$arguments.= \"-ti \\\"\" . $this->title . \"\\\" \";\r\n\t\t}\r\n\r\n\t\tif ($this->destdir)\r\n\t\t{\r\n\t\t\t$arguments.= \"-t \\\"\" . $this->destdir . \"\\\" \";\r\n\t\t}\r\n\r\n\t\tif ($this->sourcepath !== NULL)\r\n\t\t{\r\n\t\t\t$arguments.= \"-d \\\"\" . $this->sourcepath->__toString() . \"\\\" \";\r\n\t\t}\r\n\r\n\t\tif ($this->output)\r\n\t\t{\r\n\t\t\t$arguments.= \"-o \" . $this->output . \" \";\r\n\t\t}\r\n\r\n\t\tif ($this->linksource)\r\n\t\t{\r\n\t\t\t$arguments.= \"-s on \";\r\n\t\t}\r\n\r\n\t\tif ($this->parseprivate)\r\n\t\t{\r\n\t\t\t$arguments.= \"-pp on \";\r\n\t\t}\r\n\r\n\t\treturn $arguments;\r\n\t}",
"public function __invoke($arguments)\n {\n\n }",
"function __construct($argument_order)\n {\n $this->argument_order = $argument_order;\n }",
"public function moveAllOtherUserdefinedPropertiesToAdditionalArguments() {}",
"protected function vedConstructArg(array $args = array()) {\n }",
"function a() {\n\t\t$args = func_get_args();\n\t\treturn $args;\n\t}",
"public function setArguments(array $args);",
"public function buildArgs($options)\n {\n /**if (!empty($options['tests_path'])) {\n $this->tests_path = $options['tests_path'];\n }\n\n if (!empty($options['x_unit_file_path'])) {\n $this->x_unit_file_path = $options['x_unit_file_path'];\n }\n\n if (!empty($options['arguments'])) {\n $this->arguments= $options['arguments'];\n }*/\n }",
"public function initializeArgumentsAndRender() {}",
"public function initializeArgumentsAndRender() {}",
"public function __construct(){\n\t\tglobal $GLANG;\n\t\t$this->arguments = func_get_args();\n\t\t$this->lang = $GLANG;\n\t\t}",
"public function __construct($arg = null)\n {\n }",
"abstract public function getArguments(): array;",
"function caldol_hook_widget_tag_cloud_args($args = array()){\n\n\n$newArgs = array(\n'smallest' => 8,\n'largest' => 15,\n'number' => 20,\n\n);\nreturn array_merge($args, $newArgs);\n}",
"public function args()\n {\n return [];\n }",
"private function getArg($arguments){\n $list=[];\n foreach($arguments as $key=>$value){\n if($key==\"pull\" || $key==\"push\"){\n $list['project']=$value;\n $list['migration']=$key;\n }\n else{\n $list[$key]=$value;\n }\n }\n\n return $list;\n\n }",
"public function setArguments($args) {\n $this->args= $args;\n }",
"function init_args()\r\n{\r\n $_REQUEST = strings_stripSlashes($_REQUEST);\r\n\r\n // if any piece of context is missing => we will display nothing instead of crashing WORK TO BE DONE\r\n $args = new stdClass();\r\n $args->tplan_id = isset($_REQUEST['tplan_id']) ? $_REQUEST['tplan_id'] : $_SESSION['testplanID'];\r\n $args->tproject_id = isset($_REQUEST['tproject_id']) ? $_REQUEST['tproject_id'] : $_SESSION['testprojectID'];\r\n $args->tcase_id = isset($_REQUEST['tcase_id']) ? $_REQUEST['tcase_id'] : 0;\r\n $args->tcversion_id = isset($_REQUEST['tcversion_id']) ? $_REQUEST['tcversion_id'] : 0;\r\n return $args; \r\n}",
"public function getArguments() {}",
"public function getArguments() {}",
"public function getArguments() {}",
"public function getArguments() {}",
"function more_args()\n\t{\n\t\tfor ($i=0; $i < func_num_args() ; $i++) { \n\t\t\techo \"第\".$i.\"个参数是\".func_get_arg($i).\"\\n\";\n\t\t}\n\t}",
"protected\n function getArguments() {\n return array();\n }",
"public function setup( $args = array() ) {\n\t\t\t$this->args = $args;\n\t\t}",
"public function __construct($argv = array()){\n\t\t\n\t\t$this->setParameter($argv);\t\t\t\n\t\t$this->run();\t\t\n\t}",
"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}",
"public function get_args(){ \n\t\n\t\t$args = $this->get_default_args();\n\t\t\n\t\tforeach( $this->args as $key => $value ){\n\t\t\t\n\t\t\t$args[ $key ] = $value;\n\t\t\t\n\t\t} // end foreach\n\t\n\t\treturn $args;\n\t\t \n\t}",
"private function _setArgsRegister( $args )\n\t{\t\t\n\t\t$this->argsRegister\t= $args;\t\t\n\t}",
"function get_results($args)\n {\n }",
"function get_results($args)\n {\n }",
"public function __construct(array $arguments)\n {\n $this->arguments = $arguments;\n }",
"public function havingArguments();",
"public function cli_validateArgs() {}",
"function ola(){\n\n$argumentos = func_get_args();// recupera todos os argumentos da variavel que é um array \nreturn $argumentos;\n}",
"function apply_default_args($args) {\r\n\t\t$defaults = array(\r\n\t\t\t'width'=>'',\r\n\t\t\t'height'=>'',\r\n\t\t\t'placeholder'=>'',\r\n\t\t\t'description'=>''\r\n\t\t);\r\n\t\t$args = wp_parse_args( $args, $defaults );\r\n\t\treturn $args;\t\r\n\t}",
"public function validateArguments() {}",
"public function __construct()\n {\n if (8 == func_num_args()) {\n $this->title = func_get_arg(0);\n $this->sortOrder = func_get_arg(1);\n $this->sampleType = func_get_arg(2);\n $this->id = func_get_arg(3);\n $this->sampleFile = func_get_arg(4);\n $this->sampleFileContent = func_get_arg(5);\n $this->sampleUrl = func_get_arg(6);\n $this->extensionAttributes = func_get_arg(7);\n }\n }",
"public abstract function pass($tags, $arguments);",
"public function getArgs() : array\n {\n }",
"function shell_comments_args( $args ) {\r\n\t$args['avatar_size'] = 40;\r\n\treturn $args;\r\n}",
"public function setArguments(array $arguments);",
"function new_parameters() {\r\n\r\n }",
"protected function specifyParameters()\n {\n $this->addOption('account', 'a', InputOption::VALUE_OPTIONAL, '');\n $this->addOption('type', 't', InputOption::VALUE_OPTIONAL, '');\n $this->addOption('start-date', 's', InputOption::VALUE_OPTIONAL, '');\n }",
"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}"
] | [
"0.70940304",
"0.6904754",
"0.6904368",
"0.68834805",
"0.68834805",
"0.68834805",
"0.6882865",
"0.6789838",
"0.6717955",
"0.66987836",
"0.6692978",
"0.66922987",
"0.6610921",
"0.6588356",
"0.6586563",
"0.65716714",
"0.65672183",
"0.65581787",
"0.65541995",
"0.6550152",
"0.6496989",
"0.6409941",
"0.6409941",
"0.64005107",
"0.63945585",
"0.6368448",
"0.6341458",
"0.6341458",
"0.6325354",
"0.63241476",
"0.63225836",
"0.63225836",
"0.6318405",
"0.6304914",
"0.62977606",
"0.6293467",
"0.6269873",
"0.62602556",
"0.6181179",
"0.6139972",
"0.6126686",
"0.6119326",
"0.6119326",
"0.6118458",
"0.61075515",
"0.6107008",
"0.61038554",
"0.61023724",
"0.61023724",
"0.61023724",
"0.61023724",
"0.60845685",
"0.6079982",
"0.60697",
"0.60659486",
"0.6034474",
"0.60275644",
"0.6021227",
"0.6005553",
"0.6000311",
"0.5995913",
"0.5986217",
"0.5983295",
"0.5956041",
"0.595484",
"0.5951282",
"0.5946534",
"0.59397316",
"0.5937851",
"0.5930905",
"0.59213644",
"0.5913042",
"0.5913042",
"0.5913042",
"0.5913042",
"0.59116626",
"0.5907098",
"0.59018356",
"0.58805245",
"0.58795726",
"0.58795726",
"0.58770543",
"0.5872574",
"0.5856597",
"0.5856597",
"0.58515906",
"0.5846507",
"0.5844705",
"0.58436984",
"0.5839577",
"0.58353335",
"0.5830897",
"0.5822361",
"0.5820622",
"0.5819356",
"0.5816232",
"0.5808319",
"0.5796719",
"0.5782334",
"0.5782334",
"0.5782334"
] | 0.0 | -1 |
initialize the database connection | protected function execute($arguments = array(), $options = array())
{
$databaseManager = new sfDatabaseManager($this->configuration);
$connection = $databaseManager->getDatabase($options['connection'] ? $options['connection'] : null)->getConnection();
// add your code here
$counter = 0;
$myths = Doctrine::getTable('Myth')->findAll();
foreach ($myths as $myth)
{
$is_active = $myth->getIsActive();
$myth->changeIsActive();
($is_active == $myth->getIsActive()) ? null : $this->logSection($myth->getName().' =>', 'toggle'.$myth->getIsActive());
$counter++;
}
$this->logSection('Verify Myth =>', 'All ('.$counter.') myths are verify.');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function init()\n {\n $this->_db = Instance::ensure($this->_db, Connection::class);\n }",
"private function initDatabase() {\n \n \n \n }",
"protected function _initDbConnection() {\n\t\tif (!empty($this->db)) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\t// Create a new connection\n\t\tif (empty($this->config['datasource'])) {\n\t\t\tdie(\"FeedAggregatorPdoStorage: no datasource configured\\n\");\n\t\t}\n\n\t\t// Initialise a new database connection and associated schema.\n\t\t$db = new PDO($this->config['datasource']); \n\t\t$this->_initDbSchema();\n\t\t\n\t\t// Check the database tables exist\n\t\t$this->_initDbTables($db);\n\n\t\t// Database successful, make it ready to use\n\t\t$this->db = $db;\n\t}",
"protected function initDatabase() {\n\t\t$this->config\t\t= new Config();\n\t\tDatabase::$host\t\t= $this->config->host;\n\t\tDatabase::$username\t= $this->config->username;\n\t\tDatabase::$password\t= $this->config->password;\n\t\tDatabase::$dbname\t= $this->config->dbname;\n\t}",
"function dbInit()\n {\n if ( $this->IsConnected == false )\n {\n $this->Database = eZDB::globalDatabase();\n $this->IsConnected = true;\n }\n }",
"public function initializeObject() {\r\r\n\t\t$this->connectDatabase();\r\r\n\t}",
"function dbInit()\n {\n if ( $this->IsConnected == false )\n {\n $this->Database =& eZDB::globalDatabase();\n $this->IsConnected = true;\n }\n }",
"function init() {\n if ( empty( $this->hostname ) ) {\n $this->hostname = $this->gCI->gPZ['db_config'][\"hostname\"];\n }\n if ( empty( $this->username ) ) {\n $this->username = $this->gCI->gPZ['db_config'][\"username\"];\n }\n if ( empty( $this->password ) ) {\n $this->password = $this->gCI->gPZ['db_config'][\"password\"];\n }\n if ( strstr( $this->hostname, \":\" ) ) {\n list( $this->hostname, $this->port ) = explode( \":\", $this->gCI->gPZ['db_config']['hostname'] );\n } else {\n $this->port = 0;\n }\n $this->database = ( empty( $this->database ) ? $this->gCI->gPZ['db_config'][\"database\"] : $this->database );\n $this->db_conn = new mysqli( $this->hostname, $this->username, $this->password, $this->database, $this->port );\n\n if ( mysqli_connect_errno() ) {\n\n $this->gCI->fatal_error( \"Database Connect failed: %s\\n\", mysqli_connect_error()) ;\n }\n }",
"public function initialize()\n {\n $this->setConnectionService('db');\n\n }",
"public function init()\n {\n $this->logger->info('DBService : init');\n\n $this->connect();\n $this->createTable( $this->pdo );\n }",
"private static function initDatabase() {\n\t\t\tif (self::Config('use_db')) {\n\t\t\t\t$host = self::Config('mysql_host');\n\t\t\t\t$user = self::Config('mysql_user');\n\t\t\t\t$pass = self::Config('mysql_password');\n\t\t\t\t$name = self::Config('mysql_dbname');\n\t\t\t\tDBManager::init($host, $user, $pass, $name);\n\t\t\t}\n\t\t}",
"public function initialize() : void\n {\n // Use to initialise member variables.\n $this->app->db->connect();\n }",
"abstract protected function initDB();",
"private function init(){\n //initialize the connection\n try {\n $this->CONNECTION = new \\PDO(\"mysql:host=$this->ADDRESS;dbname=$this->DATABASE\", $this->USER, $this->PASSWORD);\n if($this->DEBUG)\n $this->CONNECTION->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n else\n $this->CONNECTION->setAttribute(\\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_SILENT);\n } catch(\\PDOException $e) {\n \\bmca\\exception\\Handler::fatalException('ERROR: ' . $e->getMessage());\n }\n\n $this->initialized = true;\n }",
"function __construct() {\n $this->open_db_connection();\n }",
"private function initDB(){\n $sql = \"\n CREATE SCHEMA IF NOT EXISTS `\".$this->_database.\"` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci ;\n USE `\".$this->_database.\"` ;\n \";\n try {\n $dbh = new PDO(\"mysql:host=$this->_host\", $this->_username, $this->_password,array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));\n $dbh->exec($sql)\n or die(print_r($dbh->errorInfo(), true));\n } catch (PDOException $e) {\n $err_data = array('stmt'=>'on init');\n Helper_Error::setError( Helper_Error::ERROR_TYPE_DB , $e->getMessage() , $err_data , $e->getCode() );\n die(\"DB init ERROR: \". $e->getMessage());\n }\n }",
"public function initialize(){\n\t\t $db_params = OpenContext_OCConfig::get_db_config();\n\t\t $db = new Zend_Db_Adapter_Pdo_Mysql($db_params);\n\t\t $db->getConnection();\n\t\t $this->setUTFconnection($db);\n\t\t $this->db = $db;\n\t\t $this->checkTableIndex();\n\t\t $this->solrDocArray = false;\n\t\t $this->toDoList = false;\n\t\t $this->toDoCount = 0;\n\t\t $this->errors = array();\n\t\t $this->totalIndexed = 0;\n }",
"public function initialize()\n {\n $this->setSchema(\"smsgw_engine_db\");\n }",
"function __construct() {\n $this->open_db_connection();\n }",
"public function __construct() {\n $this->_db = DB::connect();\n }",
"public function initDatabaseStructure( );",
"public function __construct()\n\t{\n\t\tDBConnectionHelper::initialize();\n\t}",
"public function connect_db() {\n }",
"private function init()\n {\n // connessione al mysql server\n if (!$this->link = mysql_connect( $this->hostname\n , $this->user_name\n , $this->user_pswd))\n {\n $this->set_error( 'Could not connect to mysql' );\n return;\n }\n\n // seleziona il database\n if (!mysql_select_db($this->user_db, $this->link))\n {\n $this->set_error( 'Could not select database' );\n return;\n }\n }",
"public function init_connection() {\n $this->connection = mysql_connect($this->host, $this->name, $this->password);\n if(!$this->connection) {\n die('Could not connect: ' . mysql_error());\n }\n mysql_select_db($this->databaseName, $this->connection);\n mysql_query(\"set names 'utf8'\");\n }",
"function __construct(){\r\n\t\t\t$this->open_db_connection();\r\n\t\t}",
"public function __construct()\n {\n $this->db = ConnectionClass::conn();\n }",
"public function __construct()\n {\n $this -> connection = $this ->connecdatabase();\n }",
"static function init(){\n if (!self::$conn) {\n $KEYS = new Keys();\n $hostname = $KEYS->DATABASE_HOST;\n $dbname = $KEYS->DATABASE_NAME;\n $username = $KEYS->DATABASE_USERNAME;\n $password = $KEYS->DATABASE_PASSWORD;\n $db = $db = ($KEYS->DATABASE_TYPE == \"\")? \"mysql\": $KEYS->DATABASE_TYPE;\n $port = $port = ($KEYS->DATABASE_PORT == \"\")? \"\": \"port={$KEYS->DATABASE_PORT};\";\n \n self::$conn = null;\n \n try {\n self::$conn = new PDO(\"{$db}:host={$hostname};{$port}dbname={$dbname}\", $username, $password);\n self::$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n } catch(PDOException $exception) {\n Response::send(null, 500, \"Connection error: \" . $exception->getMessage());\n }\n }\n }",
"private function init_db()\n {\n /**\n * If we've set that we want to use the database, initialize it.\n * Or we may use our parent's\n *\n * Inicializa a base de dados se esse app estiver configurado pra usar a base\n * de dados. Ou usa do nosso parent\n */\n\n if (isset($this->parent->db)) {\n $this->db = $this->parent->db;\n } else {\n $this->load->db('mysql');\n }\n\n }",
"public static function init() {\n\t\tself::$_db = Storage::get('objects.database');\n\t}",
"public function initialize()\n {\n // Intentionally blank as this will be overloaded by DBAL\n }",
"public function __construct()\n {\n $this->db = DataBase::dbConnect();\n }",
"public function initialize()\n {\n $this->_db = new Fplanillassal();\n }",
"public function __construct() {\n $db = new Connection();\n $this->conn = $db->connect();\n }",
"protected function _initDb()\r\n { \r\n if ( $this->_db === null ) {\r\n $file = APPLICATION_PATH . '/configs/database.php';\r\n if(file_exists($file) && filesize($file) > 100) {\r\n $database = require_once($file);\r\n $this->_db = Zend_Db::factory($database['database']['adapter'], \r\n $database['database']['params']);\r\n Zend_Db_Table::setDefaultAdapter($this->_db);\r\n } else {\r\n //Go to install script url\r\n header('Location: /install');\r\n }\r\n }\r\n }",
"private function _set_connection()\n {\n isset($this->_database_connection) ? $this->load->database($this->_database_connection) : $this->load->database();\n $this->_database = $this->db;\n }",
"public function __construct()\n {\n $this->_dbInstance = Database::getInstance();\n $this->_dbHandle = $this->_dbInstance->getConnection();\n }",
"public function __construct() {\n $this->connection = $this->create_connection();\n }",
"function __construct() {\n\n\t\t$this->open_db_connection();\n\n\t}",
"public function __construct() {\n\t\t$this->db = getDatabase();\n\t}",
"private function init()\n {\n //create a connection to the database.\n if (!$this->IsConnected()) {\n //get the database settings.\n require(GEO_BASE_DIR . 'config.default.php');\n $this->db_info = [\n 'db_host' => $db_host,\n 'db_name' => $database\n ];\n try {\n $this->db = ADONewConnection($db_type);\n\n if (isset($persistent_connections) && $persistent_connections) {\n if (!$this->db->PConnect($db_host, $db_username, $db_password, $database)) {\n echo 'Could not connect to database.';\n exit;\n }\n } else {\n if (!$this->db->Connect($db_host, $db_username, $db_password, $database)) {\n echo \"Could not connect to database.\";\n exit;\n }\n }\n } catch (exception $e) {\n echo 'Could not connect to database.';\n exit;\n }\n if (defined('IAMDEVELOPER') && self::ADODB_DEBUG) {\n //This is to show stats from adoDB to help optimize\n //queries. Should not ship with the ADODB_DEBUG on.\n\n session_start(); //session variables required for monitoring\n $this->db->LogSQL();\n $this->perf =& NewPerfMonitor($this->db);\n }\n //See if we need to turn off sql strict mode. $strict_mode to be set in config.php.\n if (isset($strict_mode) && $strict_mode) {\n //10/19/2016 -- strict_mode=1 is now a config.php default, so this always happens unless explicitly\n //turned off\n $this->Execute('SET SESSION sql_mode=\\'\\'');\n }\n //Manually force the database connection to use a different charset than what\n //is set in the server's configuration.\n if (isset($force_db_connection_charset) && strlen(trim($force_db_connection_charset))) {\n $this->db->Execute(\"SET NAMES '$force_db_connection_charset'\");\n //$this->db->Execute(\"SET CHARACTER SET $force_db_connection_charset\");\n }\n //If we ever get to the point where no scripts rely on result set to be\n //returned numerically, un-comment this (requires huge massive across the board\n //testing)\n $this->db->SetFetchMode(ADODB_FETCH_ASSOC) ;\n }\n //should be connected to the database at this point.\n }",
"public function __construct()\n {\n $this->db = \\Config\\Database::connect();\n }",
"public function __construct() {\t\tif(enable_database == true) {\n\t\t\t$this->db = database::instance();\n\t\t\t$this->db->connect();\n\t\t}\n\t}",
"public function connectToDB() {}",
"public static function init($db){\r\n self::$conn = $db;\r\n }",
"protected function setupDatabaseConnection()\n {\n $db = DBConnection::getInstance($this->config);\n\n $enc = property_exists($this->config, 'dbEncoding') ? $this->config->dbEncoding : 'utf8';\n $tz = property_exists($this->config, 'dbTimezone') ? $this->config->dbTimezone : '00:00';\n\n $db->query(\n sprintf('SET NAMES \"%s\"', $enc)\n );\n\n $db->query(\n sprintf('SET time_zone = \"%s\"', $tz)\n );\n }",
"private function open_db() {\n\n\t\t//var_dump($this->connection); exit;\n\n\t\t\n\n\t}",
"private function __construct(){\n\t\t$this->connection = new Connection();\n\t\t$this->connection\n\t\t\t->setHost(Stack::getInstance()->get('db_host'))\n\t\t\t->setUser(Stack::getInstance()->get('db_user'))\n\t\t\t->setPassword(Stack::getInstance()->get('db_pass'))\n\t\t\t->setDatabase(Stack::getInstance()->get('db_table'))\n\t\t\t->connect();\n\t}",
"public function __construct(){\n $this->connectToDatabase();\n }",
"public function __construct() {\n $dsn = \"mysql:host=\".Configuration::DATABASE_HOST.\";dbname=\".Configuration::DATABASE_NAME;\n self::connect($dsn, Configuration::DATABASE_USER, Configuration::DATABASE_PASSWORD);\n }",
"private function initDatabase()\n {\n $defaults = [\n 'user' => 'root',\n 'password' => '',\n 'prefix' => '',\n 'options' => [\n \\PDO::ATTR_PERSISTENT => true,\n \\PDO::ATTR_ERRMODE => 2,\n \\PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8',\n \\PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => 1,\n \\PDO::ATTR_EMULATE_PREPARES => false\n ]\n ];\n\n if (empty($this->settings['db'])) {\n error_log('No DB data set in Settings.php');\n Throw new FrameworkException('Error on DB access');\n }\n\n if (empty($this->settings['db']['default'])) {\n error_log('No DB \"default\" data set in Settings.php');\n Throw new FrameworkException('Error on DB access');\n }\n\n foreach ($this->settings['db'] as $name => &$settings) {\n\n $prefix = 'db.' . $name;\n\n // Check for databasename\n if (empty($settings['dsn'])) {\n Throw new \\PDOException(sprintf('No DSN specified for \"%s\" db connection. Please add correct DSN for this connection in Settings.php', $name));\n }\n\n // Check for DB defaults and map values\n foreach ($defaults as $key => $default) {\n\n // Append default options to settings\n if ($key == 'options') {\n\n if (empty($settings['options'])) {\n $settings['options'] = [];\n }\n\n foreach ($defaults['options'] as $option => $value) {\n\n if (array_key_exists($option, $settings['options'])) {\n continue;\n }\n\n $settings[$key][$option] = $value;\n }\n }\n\n if (empty($settings[$key])) {\n $settings[$key] = $default;\n }\n }\n\n foreach ($settings as $key => $value) {\n $this->di->mapValue($prefix . '.conn.' . $key, $value);\n }\n\n $this->di->mapService($prefix . '.conn', '\\Core\\Data\\Connectors\\Db\\Connection', [\n $prefix . '.conn.dsn',\n $prefix . '.conn.user',\n $prefix . '.conn.password',\n $prefix . '.conn.options'\n ]);\n $this->di->mapFactory($prefix, '\\Core\\Data\\Connectors\\Db\\Db', [\n $prefix . '.conn',\n $settings['prefix']\n ]);\n }\n }",
"protected function _initDb()\n {\n $this->bootstrap('configs');\n \n // combine application.ini & config.ini database settings\n $options = $this->getOptions();\n $dbSettings = $options['resources']['db'];\n $dbParams = Zend_Registry::get('config.config')->db->toArray();\n $dbSettings['params'] = array_merge($dbSettings['params'], $dbParams);\n \n $db = Zend_Db::factory($dbSettings['adapter'], $dbSettings['params']);\n if(!empty($dbSettings['isDefaultTableAdapter'])\n && (bool)$dbSettings['isDefaultTableAdapter']\n ) {\n Zend_Db_Table::setDefaultAdapter($db);\n }\n }",
"function __construct() {\n $this->createConnection();\n }",
"function __construct(){\n\t\t$this->open_db_connection();\n\t}",
"public function initialize() {\r\n if (!$this->persistent) {\r\n $this->connect();\r\n } else {\r\n $this->pconnect();\r\n }\r\n }",
"protected function createDatabaseConnection()\r\n\t{\r\n\t\t$this->dbConnectionPool = new \\Bitrix\\Main\\Db\\DbConnectionPool();\r\n\t}",
"public function __construct() {\n $this->_db = DB::getInstance();\n }",
"function init_db_connection()\n\t{\n\t\t$_pre_load = $this->memory_debug_make_flag();\n\t\t\n\t\t$this->vars['sql_driver'] = ! $this->vars['sql_driver'] ? 'mysql' : strtolower($this->vars['sql_driver']);\n\t\t\n\t\tif ( ! class_exists( 'db_main' ) )\n\t\t{ \n\t\t\trequire_once( KERNEL_PATH.'class_db.php' );\n\t\t\trequire_once( KERNEL_PATH.'class_db_'.$this->vars['sql_driver'].\".php\" );\n\t\t}\n\t\t\n\t\t$classname = \"db_driver_\".$this->vars['sql_driver'];\n\t\t\n\t\t$this->DB = new $classname;\n\t\t\n\t\t$this->DB->obj['sql_database'] = $this->vars['sql_database'];\n\t\t$this->DB->obj['sql_user'] = $this->vars['sql_user'];\n\t\t$this->DB->obj['sql_pass'] = $this->vars['sql_pass'];\n\t\t$this->DB->obj['sql_host'] = $this->vars['sql_host'];\n\t\t$this->DB->obj['sql_tbl_prefix'] = $this->vars['sql_tbl_prefix'];\n\t\t$this->DB->obj['force_new_connection'] = isset($this->vars['sql_force_new_connection']) ? $this->vars['sql_force_new_connection'] : 0;\n\t\t$this->DB->obj['use_shutdown'] = USE_SHUTDOWN;\n\t\t# Error log\n\t\t$this->DB->obj['error_log'] = ROOT_PATH . 'cache/sql_error_log_'.date('m_d_y').'.cgi';\n\t\t$this->DB->obj['use_error_log'] = IN_DEV ? 0 : 1;\n\t\t# Debug log - Don't use this on a production board!\n\t\t$this->DB->obj['debug_log'] = ROOT_PATH . 'cache/sql_debug_log_'.date('m_d_y').'.cgi';\n\t\t$this->DB->obj['use_debug_log'] = 0;\n\t\t\n\t\t//-----------------------------------\n\t\t// Load query file\n\t\t//-----------------------------------\n\t\t\n\t\tif ( defined( 'IPB_LOAD_SQL' ) )\n\t\t{\n\t\t\t$this->DB->obj['query_cache_file'] = ROOT_PATH.'sources/sql/'.$this->vars['sql_driver'].'_'. IPB_LOAD_SQL .'.php';\n\t\t}\n\t\telse if ( IPB_THIS_SCRIPT == 'admin' )\n\t\t{\n\t\t\t$this->DB->obj['query_cache_file'] = ROOT_PATH.'sources/sql/'.$this->vars['sql_driver'].'_admin_queries.php';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->DB->obj['query_cache_file'] = ROOT_PATH.'sources/sql/'.$this->vars['sql_driver'].'_queries.php';\n\t\t}\n\t\t\t\n\t\t//-----------------------------------\n\t\t// Required vars?\n\t\t//-----------------------------------\n\t\t\n\t\tif ( is_array( $this->DB->connect_vars ) and count( $this->DB->connect_vars ) )\n\t\t{\n\t\t\tforeach( $this->DB->connect_vars as $k => $v )\n\t\t\t{\n\t\t\t\t$this->DB->connect_vars[ $k ] = isset($this->vars[ $k ]) ? $this->vars[ $k ] : '';\n\t\t\t}\n\t\t}\n\t\t\n\t\t//--------------------------------\n\t\t// Backwards compat\n\t\t//--------------------------------\n\t\t\n\t\tif ( !isset($this->DB->connect_vars['mysql_tbl_type']) OR !$this->DB->connect_vars['mysql_tbl_type'] )\n\t\t{\n\t\t\t$this->DB->connect_vars['mysql_tbl_type'] = 'myisam';\n\t\t}\n\t\t\n\t\t//--------------------------------\n\t\t// Make CONSTANT\n\t\t//--------------------------------\n\t\t\n\t\tdefine( 'SQL_PREFIX' , $this->DB->obj['sql_tbl_prefix'] );\n\t\tdefine( 'SQL_DRIVER' , $this->vars['sql_driver'] );\n\t\tdefine( 'IPS_MAIN_DB_CLASS_LOADED', TRUE );\n\t\t\n\t\t//--------------------------------\n\t\t// Get a DB connection\n\t\t//--------------------------------\n\t\t\n\t\t$this->DB->connect();\n\t\t\n\t\t//-----------------------------------------\n\t\t// IPS DB LOADED\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( ! defined( 'IPSCLASS_DB_LOADED' ) )\n\t\t{\n\t\t\tdefine( 'IPSCLASS_DB_LOADED', 1 );\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Clean up\n\t\t//-----------------------------------------\n\t\t\n\t\tunset( $classname );\n\t\t\n\t\t$this->memory_debug_add( \"CORE: DB Connection Made\", $_pre_load );\n\t}",
"public function initialize()\n {\n try {\n $this->configure()\n ->initDB();\n\n\n Dweet_Router::resolve();\n\n } catch (Exception $e) {\n Dweet_Logger::log('error', $e->getMessage() . ' ' . $e->getTraceAsString());\n\n echo 'Dweet failed to initialize. Aborting...';\n\n die();\n }\n\n }",
"function initDb()\n {\n global $database_host, $database_name, $database_user,$database_pass;\n\n $global=Frd::getGlobal();\n\n $db_config=array(\n 'host'=>$database_host,\n 'username'=>$database_user,\n 'password'=>$database_pass,\n 'dbname'=>$database_name\n );\n\n $db = Zend_Db::factory('pdo_mysql',$db_config);\n $db->query('set names utf8');\n Zend_Db_Table::setDefaultAdapter($db);\n $global->db=$db;\n\n $registry = Zend_Registry::getInstance();\n $registry->set(\"db_default\",$global->db);\n }",
"public function initialize() : void\n {\n // Use to initialise member variables.\n $this->db = \"active\";\n }",
"public function initialize() : void\n {\n // Use to initialise member variables.\n $this->db = \"active\";\n }",
"public function initialize() : void\n {\n // Use to initialise member variables.\n $this->db = \"active\";\n }",
"function _getConnection()\n {\n $this->_con = Pluf::db();\n }",
"private function connectDB()\n\t{\n\t\t$this->db = ECash::getMasterDb();\n\t\t\n\t//\t$this->dbconn = $this->db->getConnection();\n\t}",
"function __construct()\n {\n $this->createConnection();\n\n }",
"protected function initDatabaseRecord() {}",
"private function initConnection() {\n\t\ttry {\n\t\t\t$this->m_Connection = new PDO(\"mysql:host=\".$this->m_DbHost.\";dbname=\".$this->m_DbName, $this->m_DbUserName, $this->m_DbPassword);\n\t\t\t$this->m_Connection-> exec(\"SET NAMES 'utf8';\");\n\t\t\t$this->m_Connection-> setAttribute(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY, true);\n\t\t\t$this->m_Connection-> setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t\t$this->m_Connection-> setAttribute(PDO::ATTR_EMULATE_PREPARES, 1);\n\t\t\t$this->m_Connection-> setAttribute(PDO::ATTR_FETCH_TABLE_NAMES, true);\n\t\t\t\n\t\t} catch(PDOException $e) {\n\t\t\t$this->m_Response->SetMsg(\"ERROR, Could not connect to DB: \".$e->getMessage());\n\t\t\t$this->m_Response->SetFlag(false);\n\t\t\t$this->m_Response->SetData($e);\n\t\t\texit();\n\t\t}\t\t\n\t}",
"public function __construct() {\n // Making a connection with the database\n $database = new Database();\n $this->conn = $database->getConnection();\n }",
"private function databaseConnection()\n {\n // Les connexions sont établies en créant des instances de la classe de base de PDO\n $options = array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_OBJ, PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING);\n $this->db = new PDO(DB_TYPE . ':host=' . DB_HOST . ';dbname=' . DB_NAME, DB_USER, DB_PASS, $options);\n }",
"public function initDBConnections(): void\n {\n $this->addConnectionsToConfig();\n $this->testConnections();\n }",
"public function connectDB() {}",
"public function __construct() {\n $this->db = new Database();\n $this->con = $this->db->connect();\n }",
"protected function initConnection()\n {\n parent::initConnection();\n $this->enableSlaves = false;\n\n if($this->isISeries === null){\n try {\n $stmt = $this->pdo->query('SELECT * FROM QSYS2.SYSTABLES FETCH FIRST 1 ROW ONLY');\n $this->isISeries = boolval($stmt);\n } catch (\\Exception $ex) {\n $this->isISeries = false;\n }\n }\n if($this->defaultSchema && !$this->isISeries){\n $this->pdo->exec('SET CURRENT SCHEMA ' . $this->defaultSchema);\n }\n\n }",
"function __construct()\r\n {\r\n $this->_dbh = $this->connect();\r\n }",
"function __construct()\n {\n $this->_dbh = $this->connect();\n }",
"public function __construct()\n\t{\n\t\t$this->db = MySQLdb::getInstance()->getDatabase();\n\t}",
"public function setConnection()\r\n {\r\n $this->con = $this->db->getConnection();\r\n }",
"function __construct(){\n $this->_db = (new DataBaseServices())->connect();\n }",
"public function __construct(){\n // connect to database using pre-configured globals\n $this->connection = mysql_connect(CONF_DB,\n CONF_DB_USER,\n CONF_DB_PASSWORD)\n or die(W_DB_ERROR);\n // auto-check database environment\n $this->autoCheck();\n }",
"public function __construct() {\r\n $this->conn = PersistentManager::getInstance()->get_connection();\r\n }",
"public function __construct()\r\n\t\t{\r\n\t\t\t$this->Connec = DBConnexion::getInstance();\r\n\t\t}",
"static private function init()\n {\n\t\tself::$_mysqlErrorInfo = NULL;\n\t\t\n try\n {\n self::$_dbh = new PDO('mysql:host='.DBHOST.';dbname='.DBNAME, DBUSERNAME, DBPASSWORD);\n }\n catch( PDOException $e )\n {\n throw new PDOException(\"Database::init() error: \" . $e);\n }\n }",
"function __construct()\n\t\t{\n\t\t\t$this->connection = Connection::database();\n\t\t}",
"public function __construct() {\n\t\t$this->db = DB::getInstance();\n\t}",
"public function __construct(){\n\t\t$this->db = new Connection();\n\t\t$this->db = $this->db->dbConnect();\n\t}",
"function __construct(){\n $this->open_db_connection();\n }",
"public function __construct(){\n\t\t$database = new Database();\n\t\t$db = $database->getConnection();\n $this->conn = $db;\n }",
"public function __construct() {\n $this->db = database::getInstance();\n }",
"function __construct()\n {\n $this->databaseConnection();\n }",
"public function __construct()\n\t{\n\t\t$this->config = Config::getInstance();\n\t\tself::setupDb();\n\t}",
"public function __construct(){\n $database = new Database();\n $db = $database->getConnection();\n \n $this->conn = $db;\n }",
"public function __construct()\n\t\t{\n\t\t\t$this->_db = new Database();\n\t\t}",
"private function openDatabaseConnection()\n {\n\n // set the (optional) options of the PDO connection. in this case, we set the fetch mode to\n // \"objects\", which means all results will be objects, like this: $result->user_name !\n // For example, fetch mode FETCH_ASSOC would return results like this: $result[\"user_name] !\n // @see http://www.php.net/manual/en/pdostatement.fetch.php\n $options = array(\\PDO::ATTR_DEFAULT_FETCH_MODE => \\PDO::FETCH_OBJ, \\PDO::ATTR_ERRMODE => \\PDO::ERRMODE_WARNING);\n\n // generate a database connection, using the PDO connector\n // @see http://net.tutsplus.com/tutorials/php/why-you-should-be-using-phps-pdo-for-database-access/\n $this->db = new \\PDO(DB_TYPE . ':host=' . DB_HOST . ';dbname=' . DB_NAME . ';charset=' . DB_CHARSET, DB_USER, DB_PASS, $options);\n }",
"public function __construct()\n {\n $dbInstance= Database::getInstance();\n $this->db= $dbInstance->getdbConnection();\n }",
"function __construct() {\n\t\t$this->connect();\n\t\t\t$this->select_db($this->g_dbname);\n\t\t}",
"private function connectToDB()\n {\n $this->handler = new DBConnect();\n $this->handler = $this->handler->startConnection();\n }",
"public function __construct(){\r\n\r\n // Create connection with data base\r\n $this->_db = DB::get_Instance();\r\n }",
"public static function init() {\n\t\t\n\t\t// get various user info\n\t\t$defaultUser = Config::getOption(\"user\");\n\t\t$defaultPass = Config::getOption(\"pass\");\n\t\t$readwriteUser = Config::getOption(\"readwrite.user\");\n\t\t$readwritePass = Config::getOption(\"readwrite.pass\");\n\t\t\n\t\t// set-up the database connection info\n\t\t$name = Config::getOption(\"name\");\n\t\t$host = Config::getOption(\"host\");\n\t\t$user = (!$readwriteUser || empty($readwriteUser)) ? $defaultUser : $readwriteUser;\n\t\t$pass = (!$readwritePass || empty($readwritePass)) ? $defaultPass : $readwritePass;\n\t\t$port = Config::getOption(\"port\");\n\t\tPheasant::setup(\"mysql://\".$user.\":\".$pass.\"@\".$host.\":\".$port.\"/\".$name);\n\t\t\n\t}",
"public function __construct() {\n\t\t$this->_db = Database::getInstance();\n\t}"
] | [
"0.8190012",
"0.8090096",
"0.8049853",
"0.8044886",
"0.79507047",
"0.7940469",
"0.7825467",
"0.77728605",
"0.7688879",
"0.7682012",
"0.76634866",
"0.76477814",
"0.7642274",
"0.76049155",
"0.75472486",
"0.7537571",
"0.7495337",
"0.74828774",
"0.74501574",
"0.74490535",
"0.74431884",
"0.7436024",
"0.7414812",
"0.7409534",
"0.7407189",
"0.73887265",
"0.73875767",
"0.7382685",
"0.7350488",
"0.7346649",
"0.7316098",
"0.7314248",
"0.7301261",
"0.73002803",
"0.72909313",
"0.7287606",
"0.7286616",
"0.7283526",
"0.7282197",
"0.7282184",
"0.7273299",
"0.7270655",
"0.7267124",
"0.7256745",
"0.72430515",
"0.7234573",
"0.72135836",
"0.7207569",
"0.7198739",
"0.718507",
"0.71707994",
"0.716395",
"0.7159281",
"0.71553344",
"0.7153136",
"0.7152948",
"0.7149326",
"0.7144207",
"0.7128033",
"0.7114308",
"0.71100473",
"0.71033144",
"0.71033144",
"0.71033144",
"0.70975024",
"0.7097208",
"0.7094286",
"0.70887995",
"0.70818365",
"0.70803833",
"0.7075123",
"0.70739836",
"0.7069485",
"0.7067329",
"0.7061171",
"0.7059419",
"0.7052981",
"0.7047347",
"0.7042755",
"0.7037985",
"0.70373887",
"0.7036983",
"0.7034165",
"0.70326865",
"0.70274615",
"0.70268714",
"0.70247996",
"0.70233",
"0.701447",
"0.7000394",
"0.69992757",
"0.69958967",
"0.6988092",
"0.69852316",
"0.6985179",
"0.69820374",
"0.6979379",
"0.6977765",
"0.6971293",
"0.6963421",
"0.69570225"
] | 0.0 | -1 |
Installer for File Manager Extplorer Module for Sentora 1.0.0 Version : 100 | function UnZip(){
global $controller;
$zip = new ZipArchive;
$res = $zip->open(getcwd()."/filemanager.zip");
if ($res === TRUE) {
$zip->extractTo("/etc/sentora/panel/etc/apps");
$zip->close();
chmod ("/etc/sentora/panel/etc/apps/filemanager", 0777);
chmod ("/etc/sentora/panel/modules/filemanager", 0777);
chmod ("/etc/sentora/panel/modules/filemanager/module.xml", 0777);
chmod ("/etc/sentora/panel/modules/filemanager/module.zpm", 0777);
chmod ("/etc/sentora/panel/modules/filemanager/end.php", 0777);
chmod ("/etc/sentora/panel/modules/filemanager/code", 0777);
chmod ("/etc/sentora/panel/modules/filemanager/code/controller.ext.php", 0777);
chmod ("/etc/sentora/panel/modules/filemanager/assets", 0777);
chmod ("/etc/sentora/panel/modules/filemanager/assets/icon.png", 0777);
copy("/etc/sentora/panel/modules/filemanager/auth.class1.php" , "/etc/sentora/panel/dryden/ctrl/auth.class1.php");
unlink("/etc/sentora/panel/dryden/ctrl/auth.class.php");
copy("/etc/sentora/panel/modules/filemanager/auth.class2.php" , "/etc/sentora/panel/dryden/ctrl/auth.class.php");
chmod ("/etc/sentora/panel/dryden/ctrl/auth.class.php", 0777);
chmod ("/etc/sentora/panel/dryden/ctrl/auth.class1.php", 0777);
return true;
} else {
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function pageInstall() {\n\t//expect $_FILE['install']\n\t//extract file to /tmp/\n\t//read module information file\n\t//put files into modules/$module/\n\t//run install class in modules/$module/install.php\n\t//install class may have a custom install form and should return information if install is done.\n\t}",
"public function export_addFilesFromSysFilesRecords() {}",
"public function install()\n {\n $logger = $this->container->get('logger');\n $userName = $this->container->get('zikula_users_module.current_user')->get('uname');\n \n // Check if upload directories exist and if needed create them\n try {\n $container = $this->container;\n $uploadHelper = new \\MU\\FilesModule\\Helper\\UploadHelper(\n $container->get('translator.default'),\n $container->get('filesystem'),\n $container->get('session'),\n $container->get('logger'),\n $container->get('zikula_users_module.current_user'),\n $container->get('zikula_extensions_module.api.variable'),\n $container->getParameter('datadir')\n );\n $uploadHelper->checkAndCreateAllUploadFolders();\n } catch (\\Exception $exception) {\n $this->addFlash('error', $exception->getMessage());\n $logger->error('{app}: User {user} could not create upload folders during installation. Error details: {errorMessage}.', ['app' => 'MUFilesModule', 'user' => $userName, 'errorMessage' => $exception->getMessage()]);\n \n return false;\n }\n // create all tables from according entity definitions\n try {\n $this->schemaTool->create($this->listEntityClasses());\n } catch (\\Exception $exception) {\n $this->addFlash('error', $this->__('Doctrine Exception') . ': ' . $exception->getMessage());\n $logger->error('{app}: Could not create the database tables during installation. Error details: {errorMessage}.', ['app' => 'MUFilesModule', 'errorMessage' => $exception->getMessage()]);\n \n return false;\n }\n \n // set up all our vars with initial values\n $this->setVar('allowedExtensions', 'pdf,doc,docx,odt');\n $this->setVar('maxSize', '200k');\n $this->setVar('onlyParent', false);\n $this->setVar('specialCollectionMenue', false);\n $this->setVar('collectionEntriesPerPage', 10);\n $this->setVar('linkOwnCollectionsOnAccountPage', true);\n $this->setVar('fileEntriesPerPage', 10);\n $this->setVar('linkOwnFilesOnAccountPage', true);\n $this->setVar('showOnlyOwnEntries', false);\n $this->setVar('moderationGroupForCollections', 2);\n $this->setVar('moderationGroupForFiles', 2);\n $this->setVar('allowModerationSpecificCreatorForCollection', false);\n $this->setVar('allowModerationSpecificCreationDateForCollection', false);\n $this->setVar('allowModerationSpecificCreatorForFile', false);\n $this->setVar('allowModerationSpecificCreationDateForFile', false);\n $this->setVar('enabledFinderTypes', 'collection###file');\n \n // add default entry for category registry (property named Main)\n $categoryHelper = new \\MU\\FilesModule\\Helper\\CategoryHelper(\n $this->container->get('translator.default'),\n $this->container->get('request_stack'),\n $logger,\n $this->container->get('zikula_users_module.current_user'),\n $this->container->get('zikula_categories_module.category_registry_repository'),\n $this->container->get('zikula_categories_module.api.category_permission')\n );\n $categoryGlobal = $this->container->get('zikula_categories_module.category_repository')->findOneBy(['name' => 'Global']);\n if ($categoryGlobal) {\n $categoryRegistryIdsPerEntity = [];\n $entityManager = $this->container->get('doctrine.orm.default_entity_manager');\n \n $registry = new CategoryRegistryEntity();\n $registry->setModname('MUFilesModule');\n $registry->setEntityname('CollectionEntity');\n $registry->setProperty($categoryHelper->getPrimaryProperty('Collection'));\n $registry->setCategory($categoryGlobal);\n \n try {\n $entityManager->persist($registry);\n $entityManager->flush();\n } catch (\\Exception $exception) {\n $this->addFlash('warning', $this->__f('Error! Could not create a category registry for the %entity% entity. If you want to use categorisation, register at least one registry in the Categories administration.', ['%entity%' => 'collection']));\n $logger->error('{app}: User {user} could not create a category registry for {entities} during installation. Error details: {errorMessage}.', ['app' => 'MUFilesModule', 'user' => $userName, 'entities' => 'collections', 'errorMessage' => $exception->getMessage()]);\n }\n $categoryRegistryIdsPerEntity['collection'] = $registry->getId();\n }\n \n // initialisation successful\n return true;\n }",
"public function createModuleInstalls() {\n $strReturn = \"\";\n $strInstallLog = \"\";\n\n $objManager = new class_module_packagemanager_manager();\n\n //module-installs to loop?\n if(isset($_POST[\"moduleInstallBox\"]) && is_array($_POST[\"moduleInstallBox\"])) {\n $arrModulesToInstall = $_POST[\"moduleInstallBox\"];\n foreach($arrModulesToInstall as $strOneModule => $strValue) {\n\n //search the matching modules\n foreach($this->arrMetadata as $objOneMetadata) {\n if($strOneModule == \"installer_\".$objOneMetadata->getStrTitle()) {\n $objHandler = $objManager->getPackageManagerForPath($objOneMetadata->getStrPath());\n $strInstallLog .= $objHandler->installOrUpdate();\n }\n }\n\n }\n\n }\n\n class_objectfactory::getInstance()->flushCache();\n class_carrier::getInstance()->getObjDB()->flushQueryCache();\n class_module_system_module::flushCache();\n $this->loadInstaller();\n\n\n $this->strLogfile = $strInstallLog;\n $strReturn .= $this->getLang(\"installer_modules_found\");\n\n $strRows = \"\";\n $strTemplateID = $this->objTemplates->readTemplate(\"/core/module_installer/installer.tpl\", \"installer_modules_row\", true);\n $strTemplateIDInstallable = $this->objTemplates->readTemplate(\"/core/module_installer/installer.tpl\", \"installer_modules_row_installable\", true);\n\n //Loading each installer\n\n foreach($this->arrMetadata as $objOneMetadata) {\n\n //skip samplecontent\n if($objOneMetadata->getStrTitle() == \"samplecontent\")\n continue;\n\n $objHandler = $objManager->getPackageManagerForPath($objOneMetadata->getStrPath());\n\n $arrTemplate = array();\n $arrTemplate[\"module_name\"] = $objHandler->getObjMetadata()->getStrTitle();\n $arrTemplate[\"module_nameShort\"] = $objHandler->getObjMetadata()->getStrTitle();\n $arrTemplate[\"module_version\"] = $objHandler->getObjMetadata()->getStrVersion();\n\n //generate the hint\n $arrTemplate[\"module_hint\"] = \"\";\n\n if($objHandler->getVersionInstalled() !== null) {\n $arrTemplate[\"module_hint\"] .= $this->getLang(\"installer_versioninstalled\", \"system\").$objHandler->getVersionInstalled().\"<br />\";\n }\n\n //check missing modules\n $arrModules = $objHandler->getObjMetadata()->getArrRequiredModules();\n foreach($arrModules as $strOneModule => $strVersion) {\n if(trim($strOneModule) != \"\" && class_module_system_module::getModuleByName(trim($strOneModule)) === null) {\n\n //check if a corresponding module is available\n $objPackagemanager = new class_module_packagemanager_manager();\n $objPackage = $objPackagemanager->getPackage($strOneModule);\n\n if($objPackage === null || $objPackage->getBitProvidesInstaller() || version_compare($strVersion, $objPackage->getStrVersion(), \">\")) {\n $arrTemplate[\"module_hint\"] .= $this->getLang(\"installer_systemversion_needed\", \"system\").$strOneModule.\" >= \".$strVersion.\"<br />\";\n }\n\n }\n\n else if(version_compare($strVersion, class_module_system_module::getModuleByName(trim($strOneModule))->getStrVersion(), \">\")) {\n $arrTemplate[\"module_hint\"] .= $this->getLang(\"installer_systemversion_needed\", \"system\").$strOneModule.\" >= \".$strVersion.\"<br />\";\n }\n }\n\n\n\n\n if($objHandler->isInstallable()) {\n $strRows .= $this->objTemplates->fillTemplate($arrTemplate, $strTemplateIDInstallable);\n }\n else {\n $strRows .= $this->objTemplates->fillTemplate($arrTemplate, $strTemplateID);\n }\n\n }\n\n //wrap in form\n $strTemplateID = $this->objTemplates->readTemplate(\"/core/module_installer/installer.tpl\", \"installer_modules_form\", true);\n $strReturn .= $this->objTemplates->fillTemplate(array(\"module_rows\" => $strRows), $strTemplateID);\n\n $this->strOutput .= $strReturn;\n $this->strBackwardLink = $this->getBackwardLink(_webpath_.\"/installer.php?step=modeSelect\");\n $this->strForwardLink = $this->getForwardLink(_webpath_.\"/installer.php?step=samplecontent\");\n }",
"protected function executeExtTablesAdditionalFile() {}",
"public function install(){\r\n\t\t\r\n\t}",
"public static function createInstallToolEnableFile() {}",
"function insta_f_install(){\n}",
"function createBaseFiles( $moduleManager ) \n {\n \n $templatePath = $this->values[ ModuleCreator::KEY_PATH_RAD_ROOT ] . 'data/';\n $modulePath = $this->values[ ModuleCreator::KEY_PATH_MODULE_ROOT ];\n \n $moduleName = $moduleManager->getModuleName();\n \n // get app_Module template and save in new Module\n $appFileName = $templatePath.ModuleCreator::FILE_APP_MODULE;\n $appFileContents = file_get_contents( $appFileName );\n if ($appFileContents) {\n \n $appFileContents = $this->replaceCommonTags( $appFileContents );\n \n // Replace Module Description\n $tagModuleDesc = ModuleCreator::TAG_MODULE_DESCRIPTION;\n $moduleDesc = $moduleManager->getModuleDescription();\n $appFileContents = str_replace($tagModuleDesc, $moduleDesc, $appFileContents );\n \n \n // Check for is common look and fill in options\n if ($moduleManager->isCommonLook()) {\n \n $clObjectCreation = ' /** protected $pageCommonDisplay [OBJECT] The display object for the common page layout. */\n protected $pageCommonDisplay;' . \"\\n\\n\".ModuleCreator::TAG_MODULE_OBJECT_VAR;\n $clObjectLoading = ' // load the common page layout object\n $this->pageCommonDisplay = new CommonDisplay( $this->modulePathRoot, $this->pathToRoot, $this->viewer);' ; //.\"\\n\\n\".ModuleCreator::TAG_MODULE_OBJECT_LOAD;\n $clObjectDisplay = ' // wrap current page\\'s html in the common html of the module\n $content = $this->pageCommonDisplay->getHTML( $content );';\n \n } else {\n \n $clObjectCreation = ModuleCreator::TAG_MODULE_OBJECT_VAR;\n $clObjectLoading = ModuleCreator::TAG_MODULE_OBJECT_LOAD;\n $clObjectDisplay = '';\n \n }\n \n // Replace Common Look Object Declaration\n $tagCreationObject = ModuleCreator::TAG_MODULE_OBJECT_VAR;\n $appFileContents = str_replace($tagCreationObject, $clObjectCreation, $appFileContents );\n \n // Replace Common Look Object creation\n $tagObjectLoad = ModuleCreator::TAG_MODULE_OBJECT_LOAD;\n $appFileContents = str_replace($tagObjectLoad, $clObjectLoading, $appFileContents );\n \n // Replace Common Look HTML wrapping\n $tagCommonHTML = ModuleCreator::TAG_MODULE_COMMON_HTML;\n $appFileContents = str_replace($tagCommonHTML, $clObjectDisplay, $appFileContents );\n \n \n $name = $this->values[ ModuleCreator::KEY_PATH_APP_NAME ];\n file_put_contents( $name, $appFileContents);\n \n } else {\n \n echo \"Couldn't Open [\".$appFileName.\"]<br>\";\n exit;\n }\n \n \n /*\n * Create Include File\n */\n $inclFileName = $templatePath.ModuleCreator::FILE_INCL_MODULE;\n $inclFileContents = file_get_contents( $inclFileName );\n if ($inclFileContents) {\n \n $inclFileContents = $this->replaceCommonTags( $inclFileContents );\n \n // if module shares a CommonLook then\n if ($moduleManager->isCommonLook()) {\n \n $clInclude = '// Common Display Object:\n// ----------------------\n// This object provides a common layout for the pages in this module. The \n// related templated file is stored in /'.ModuleCreator::PATH_TEMPLATES.'obj_CommonDisplay.php\nrequire_once( \\''.ModuleCreator::PATH_OBJECT_BL.'obj_CommonDisplay.php\\');';\n \n } else {\n \n $clInclude = '';\n \n }\n \n // Replace CommonDisplay Tag\n $tagCommonDisplay = ModuleCreator::TAG_INCLUDE_COMMON;\n $inclFileContents = str_replace($tagCommonDisplay, $clInclude, $inclFileContents );\n \n $name = $this->values[ ModuleCreator::KEY_PATH_INCLUDE_NAME ];\n file_put_contents( $name, $inclFileContents);\n \n } else {\n \n echo \"Couldn't Open [\".$inclFileName.\"]<br>\";\n exit;\n } \n \n \n \n /*\n * Now if Module uses a Common Look, then add CommonDisplay \n * objects.\n */\n // if module shares a CommonLook then\n if ($moduleManager->isCommonLook()) {\n \n \n /*\n * Create CommonDisplay Object\n */\n $cdFileName = $templatePath.ModuleCreator::PATH_OBJECT_BL.ModuleCreator::FILE_COMMON_OBJ;\n $cdFileContents = file_get_contents( $cdFileName );\n if ($cdFileContents) {\n \n $cdFileContents = $this->replaceCommonTags( $cdFileContents );\n \n $name = $modulePath.ModuleCreator::PATH_OBJECT_BL.'obj_CommonDisplay.php';\n file_put_contents( $name, $cdFileContents);\n \n\n } else {\n echo \"Couldn't Open [\".$cdFileName.\"]<br>\";\n exit;\n } \n \n \n /*\n * Create CommonDisplay Template\n */\n $cdtFileName = $templatePath.ModuleCreator::PATH_TEMPLATES.ModuleCreator::FILE_COMMON_OBJ;\n $cdtFileContents = file_get_contents( $cdtFileName );\n if ($cdtFileContents) {\n \n $cdtFileContents = $this->replaceCommonTags( $cdtFileContents );\n \n $name = $modulePath.ModuleCreator::PATH_TEMPLATES.'obj_CommonDisplay.php';\n file_put_contents( $name, $cdtFileContents);\n \n\n } else {\n echo \"Couldn't Open [\".$cdtFileName.\"]<br>\";\n exit;\n }\n \n \n } // end if common look\n \n \n /*\n * Create Tool_Setup File\n */\n $toolFileName = $templatePath.ModuleCreator::FILE_TOOL_SETUP;\n $toolFileContents = file_get_contents( $toolFileName );\n if ($toolFileContents) {\n \n $toolFileContents = $this->replaceCommonTags( $toolFileContents);\n \n // Replace Module Root Path\n $tagModuleRootPath = ModuleCreator::TAG_PATH_MODULE_ROOT;\n $path = ModuleCreator::PATH_MODULE_ROOT;\n $toolFileContents = str_replace($tagModuleRootPath, $path, $toolFileContents );\n \n $preName = 'app_';\n if ($moduleManager->isCore() ) {\n $preName = '';\n }\n \n $tag = ModuleCreator::TAG_TOOL_CORE_PRE;\n $toolFileContents = str_replace($tag, $preName, $toolFileContents );\n \n \n // if module shares a CommonLook then\n if ($moduleManager->isCommonLook()) {\n\n $clInclude = '// Create CommonDisplay labels \n $labelManager->addPage( CommonDisplay::MULTILINGUAL_PAGE_KEY );\n/*\n //\n // Use this section to create your common page label information:\n //\n $labelManager->addLabel( \"[Title]\", \"Title\", \"en\" );\n $labelManager->addLabel( \"[Instr]\", \"Instructions\", \"en\" );\n*/';\n $clInclude .= \"\\n\\n\\n\".ModuleCreator::TAG_TOOL_PAGE_LABEL; \n \n } else {\n \n $clInclude = ModuleCreator::TAG_TOOL_PAGE_LABEL;\n \n }\n \n // Replace CommonDisplay Tag\n $tagPageLabel = ModuleCreator::TAG_TOOL_PAGE_LABEL;\n $toolFileContents = str_replace($tagPageLabel, $clInclude, $toolFileContents );\n \n $name = $this->values[ ModuleCreator::KEY_PATH_SETUP_NAME ];\n file_put_contents( $name, $toolFileContents);\n \n \n } else {\n \n echo \"Couldn't Open [\".$toolFileName.\"]<br>\";\n exit;\n } \n \n \n \n \n \n \n \n //////////////////\n //////////////////\n \n \n \n \n /*\n * Create db_backup.sh File\n */\n $dbFileName = $templatePath.ModuleCreator::FILE_DB_BACKUP;\n $dbFileContents = file_get_contents( $dbFileName );\n if ($dbFileContents) {\n \n $dbFileContents = $this->replaceCommonTags( $dbFileContents);\n \n // Replace [USERID] tag\n $tagUserID = '[USERID]';\n $user = SITE_DB_USER;\n $dbFileContents = str_replace($tagUserID, $user, $dbFileContents );\n \n \n // Replace [DATABASE] tag\n $tagDatabase = '[DATABASE]';\n $dbName = SITE_DB_NAME;\n $dbFileContents = str_replace($tagDatabase, $dbName, $dbFileContents );\n \n \n $moduleID = $moduleManager->getModuleID();\n $daObjList = new DAObjList( $moduleID );\n \n $nameList = '';\n \n $daObjList->setFirst();\n while( $daObj = $daObjList->getNext() ) {\n \n $nameList .= $daObj->getDBTableName().' ';\n }\n \n // Replace [TABLELIST] tag\n $tagTableList = '[TABLELIST]';\n $dbFileContents = str_replace($tagTableList, $nameList, $dbFileContents );\n \n $name = $this->values[ ModuleCreator::KEY_PATH_MODULE_ROOT ].'db_backup.sh';\n file_put_contents( $name, $dbFileContents);\n \n \n } else {\n \n echo \"Couldn't Open [\".$dbFileName.\"]<br>\";\n exit;\n } \n \n \n }",
"public function installFilesystems()\n\t{\n\t\t$T_SELINSTPART[0]=\"ext2\";\n\t\t$T_SELINSTPART[1]=\"ext3\";\n\t\t$T_SELINSTPART[2]=\"ext4\";\n\t\t$T_SELINSTPART[3]=\"reiserfs\";\n\n\t\treturn($T_SELINSTPART);\n\t}",
"public function runSetupScripts()\n\t\t{\n\t\t\t$xmlResources = \\Z::getConfig()->getResources();\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$installedResources = \\Z::getModel('core/extension')->getCollection()->load();\n\t\t\t}\n\t\t\tcatch (\\Sys\\Exception $e)\n\t\t\t{\n\t\t\t\t$this->initialInstall();\n\t\t\t\t$installedResources = \\Z::getModel('core/extension')->getCollection()->load();\n\t\t\t}\n\t\t\tforeach ($xmlResources as $name => $resource)\n\t\t\t{\n\t\t\t\t// this is the version we should have installed on our system\n\t\t\t\t$latestVersion = $resource['requiredVersion'];\n\t\t\t\t// this is the version we currently have on our system, if the\n\t\t\t\t// extension is installed at all\n\t\t\t\t$installedExtension = $installedResources->isInstalled($name);\n\t\t\t\tif ($installedExtension)\n\t\t\t\t\t$installedVersion = $installedExtension->getVersion();\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$installedVersion = '0.0.0';\n\t\t\t\t\t$installedExtension = \\Z::getModel('core/extension');\n\t\t\t\t}\n\t\t\t\t$end = 'install-'.$latestVersion.'.php';\n\t\t\t\t$start = 'install-'.$installedVersion.'.php';\n\t\t\t\tif ($latestVersion != $installedVersion)\n\t\t\t\t{\n\t\t\t\t\t$installerFilesLocation = \\Z::getConfig()->getModule($resource['module'])->getPath('sql/'.$name.'/');\n\t\t\t\t\t$handle = opendir($installerFilesLocation);\n\t\t\t\t\tif ($handle)\n\t\t\t\t\t{\n\t\t\t\t\t\twhile (FALSE !== ($file = readdir($handle)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif (strpos($file, '.php') > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif (($file > $start) && ($file <= $end))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$this->_executedFiles[] = $installerFilesLocation.$file;\n\t\t\t\t\t\t\t\t\t//echo $installerFilesLocation.$file.'<br/>';\n\t\t\t\t\t\t\t\t\tinclude $installerFilesLocation.$file;\n\t\t\t\t\t\t\t\t\t// after the script is executed, set the\n\t\t\t\t\t\t\t\t\t// current version in the extension table\n\t\t\t\t\t\t\t\t\tif ($installedExtension->getCode() != '')\n\t\t\t\t\t\t\t\t\t\t$installedExtension->setVersion($latestVersion);\n\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t$installedExtension->setVersion($latestVersion)\n\t\t\t\t\t\t\t\t\t\t\t->setCode($name);\n\t\t\t\t\t\t\t\t\t$installedExtension->save();\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// execute the install script for $file\n\t\t\t\t\t\t\t\t// update the version in the table\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tclosedir($handle);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\tthrow new \\Sys\\Exception('Cannot open the location => %s of the setup install scripts',\n\t\t\t\t\t\t\t$installerFilesLocation);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $this;\n\t\t}",
"function mediawikiinstall($o){\n\t\n\t\t//$o->extract(\"confirmaccount\", \"extensions/\");\n\t\t$o->sr(\"LocalSettings.php\", \"#Add\\s*more\\s*configuration\\s*options\\s*below.#\", \"End of automatically generated settings. \\n\\n \\$wgGroupPermissions['*']['edit'] = false; \\n\\n \\$wgGroupPermissions['*']['createpage'] = false; \\n\\n \\$wgEmailConfirmToEdit = true;\");\n\t}",
"function InstallFiles() {\n\t\n\t\treturn true;\n\t}",
"public function installSamplecontent() {\n $strReturn = \"\";\n $strInstallLog = \"\";\n\n $objManager = new class_module_packagemanager_manager();\n\n //Is there a module to be installed or updated?\n if(isset($_GET[\"update\"])) {\n foreach($this->arrMetadata as $objOneMetadata) {\n if($objOneMetadata->getStrTitle() != \"samplecontent\")\n continue;\n\n $objHandler = $objManager->getPackageManagerForPath($objOneMetadata->getStrPath());\n $strInstallLog .= $objHandler->installOrUpdate();\n }\n }\n\n //module-installs to loop?\n if(isset($_POST[\"moduleInstallBox\"]) && is_array($_POST[\"moduleInstallBox\"])) {\n foreach($this->arrMetadata as $objOneMetadata) {\n if($objOneMetadata->getStrTitle() != \"samplecontent\")\n continue;\n\n $objHandler = $objManager->getPackageManagerForPath($objOneMetadata->getStrPath());\n $strInstallLog .= $objHandler->installOrUpdate();\n }\n }\n\n $this->strLogfile = $strInstallLog;\n $strReturn .= $this->getLang(\"installer_samplecontent\");\n\n //Loading each installer\n $strRows = \"\";\n $strTemplateID = $this->objTemplates->readTemplate(\"/core/module_installer/installer.tpl\", \"installer_modules_row\", true);\n $strTemplateIDInstallable = $this->objTemplates->readTemplate(\"/core/module_installer/installer.tpl\", \"installer_modules_row_installable\", true);\n\n $bitInstallerFound = false;\n foreach($this->arrMetadata as $objOneMetadata) {\n\n if($objOneMetadata->getStrTitle() != \"samplecontent\")\n continue;\n\n $bitInstallerFound = true;\n\n $objHandler = $objManager->getPackageManagerForPath($objOneMetadata->getStrPath());\n\n $arrTemplate = array();\n $arrTemplate[\"module_nameShort\"] = $objOneMetadata->getStrTitle();\n $arrTemplate[\"module_name\"] = $objOneMetadata->getStrTitle();\n $arrTemplate[\"module_version\"] = $objOneMetadata->getStrVersion();\n\n //generate the hint\n $arrTemplate[\"module_hint\"] = \"\";\n\n if($objHandler->getVersionInstalled() !== null) {\n $arrTemplate[\"module_hint\"] = $this->getLang(\"installer_versioninstalled\", \"system\").$objHandler->getVersionInstalled();\n }\n else {\n //check missing modules\n $strRequired = \"\";\n $arrModules = $objHandler->getObjMetadata()->getArrRequiredModules();\n foreach($arrModules as $strOneModule => $strVersion) {\n if(trim($strOneModule) != \"\" && class_module_system_module::getModuleByName(trim($strOneModule)) === null)\n $strRequired .= $strOneModule.\", \";\n }\n\n if(trim($strRequired) != \"\")\n $arrTemplate[\"module_hint\"] = $this->getLang(\"installer_modules_needed\", \"system\").substr($strRequired, 0, -2);\n }\n\n if($objHandler->isInstallable())\n $strRows .= $this->objTemplates->fillTemplate($arrTemplate, $strTemplateIDInstallable);\n else\n $strRows .= $this->objTemplates->fillTemplate($arrTemplate, $strTemplateID);\n\n }\n\n if(!$bitInstallerFound)\n header(\"Location: \"._webpath_.\"/installer.php?step=finish\");\n\n //wrap in form\n $strTemplateID = $this->objTemplates->readTemplate(\"/core/module_installer/installer.tpl\", \"installer_samplecontent_form\", true);\n $strReturn .= $this->objTemplates->fillTemplate(array(\"module_rows\" => $strRows), $strTemplateID);\n\n $this->strOutput .= $strReturn;\n $this->strBackwardLink = $this->getBackwardLink(_webpath_.\"/installer.php?step=install\");\n $this->strForwardLink = $this->getForwardLink(_webpath_.\"/installer.php?step=finish\");\n }",
"public function afterInstall()\r\n {\r\n\r\n // $test = $this::getInstance();\r\n//print_r(Yii::getAlias('@'.($this->id)));\r\n\r\n\r\n // $fileName2 = (new \\ReflectionClass(new \\panix\\engine\\WebModule($this->id)))->getFileName();\r\n\r\n // $fileName = (new \\ReflectionClass(get_called_class()))->getFileName();\r\n // print_r($fileName2);\r\n\r\n\r\n /// print_r($reflectionClass->getNamespaceName());\r\n //die;\r\n\r\n // if ($this->uploadAliasPath && !file_exists(Yii::getPathOfAlias($this->uploadAliasPath)))\r\n // CFileHelper::createDirectory(Yii::getPathOfAlias($this->uploadAliasPath), 0777);\r\n //Yii::$app->cache->flush();\r\n // Yii::app()->widgets->clear();\r\n return true;\r\n }",
"function INSTALL($e) { $s=$im='';\n\n\nif($GLOBALS['admin']) {\n\n$GLOBALS['article']['template']='blank';\n\n\nSTYLES(\"mod\",\"\n.iDIR,.iYES,.iNON,.iDEL,.iUPD,.iADD { cursor:pointer; clear:left;float:left; }\n.iNON {color: #aaa}\n.iDEL {color: red}\n.iYES,.iUPD {color: green}\n.iADD {color: rgb(0,255,0)}\n.iNON,.iSS {text-decoration:line-through}\n.iNON:before,.iNON:after,.iSS:before,.iSS:after {content:' '}\n.iYES,.iOK {text-decoration:none}\n\n.iDIR {font-weight: bold; float:left; valign:top; }\n.iT {float:left;margin-top:20pt;}\n\n.p1 { color: #3F3F3F; text-decoration: line-through; background: #DFDFDF; } /* вычеркнутый */\n.p2 { background: #FFD0C0; } /* вставленный */\n\n\");\n\n $upgrade=gglob($GLOBALS['host_module'].\"install/*.php\");\n foreach($upgrade as $l) { $xi=explode('/',$l); $m=array_pop($xi);\n\t\t$im.=\"'$m',\";\n\t\t$s.=\"<div class='mod' id='module__$m'>\".$m.\"</div>\";\n\t}\n\nSCRIPTS(\"mod\",\"\nvar install_modules_n=0;\nfunction check_mod_do() { if(typeof install_modules[install_modules_n] == 'undefined') { install_modules_n=0; return; }\n\tvar m=install_modules[install_modules_n++];\n\tzabil('module__'+m,'<img src='+www_design+'img/ajax.gif>'+vzyal('module__'+m));\n\tmajax('module.php',{mod:'INSTALL',a:'testmod',module:m});\n}\nvar install_modules=[\".trim($im,',').\"];\n\nvar timestart;\nfunction dodo(module,allwork,time,skip,aram) {\n\tif(skip) {\n\t\tvar timenow = new Date();\n\t\tvar t=timenow.getTime()-timestart.getTime();\n\t\tvar e=parseInt((t/skip)*allwork)-t;\n\t\tzabilc('timet',' осталось: '+pr_time(e)+' сек');\n\t} else { timestart = new Date(); }\n\tvar ara={mod:'INSTALL',a:'do',module:module,allwork:allwork,time:time,skip:skip};\n\tif(typeof(aram)=='object') for(var i in aram) ara[i]=aram[i];\n\tmajax('module.php',ara);\n}\n\nfunction pr_time(t) { var N=new Date(); N.setTime(t); var s=pr00(N.getUTCSeconds());\n\tif(N.getUTCMinutes()) s=pr00(N.getUTCMinutes())+':'+s;\n\tif(N.getUTCHours()) s=pr00(N.getUTCHours())+':'+s;\n\treturn s;\n} function pr00(n){return ((''+n).length<2?'0'+n:n)}\n\n\npage_onstart.push('check_mod_do()');\n\n\");\n\n}\n\nreturn \"<table width=100% style='border: 1px dotted red'>\n<tr valign=top>\n\t<td>\n\t\t\n\t\t<div id='mesto_module'>$s</div>\n\t</td>\n\t<td width='100%'><div id='mesto_otvet'>\".admin_login().\"</div></td>\n</tr></table>\";\n\n}",
"public function execute() {\n\t\t\t// Check extension configuration\n\t\tif (empty($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['ter'])) {\n\t\t\tthrow new Exception('No extension configuration found in $TYPO3_CONF_VARS', 1303220916);\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t\t// Check extension repository path\n\t\t$extensionConfig = unserialize($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf']['ter']);\n\t\tif (empty($extensionConfig['repositoryDir'])) {\n\t\t\tthrow new Exception('No repository path found in extension configuration', 1303220917);\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t\t// Write new extensions xml file\n\t\t$repositoryDir = rtrim($extensionConfig['repositoryDir'], '/') . '/';\n\t\t$dummyObject = new stdClass();\n\t\t$dummyObject->repositoryDir = $repositoryDir;\n\t\t$terHelper = t3lib_div::makeInstance('tx_ter_helper', $dummyObject);\n\t\t$terHelper->writeExtensionIndexFile();\n\n\t\t\t// Clear page cache to force reload of the extension list\n\t\t$pageIds = t3lib_div::intExplode(',', $this->clearCachePages, TRUE);\n\t\tif (!empty($pageIds)) {\n\t\t\t$terHelper->loadBackendUser(1, '_ter_', TRUE);\n\t\t\t$terHelper->loadLang();\n\t\t\t$tce = t3lib_div::makeInstance('t3lib_TCEmain');\n\t\t\t$tce->admin = 1;\n\t\t\t$tce->start(array(), array());\n\t\t\tforeach ($pageIds as $pageId) {\n\t\t\t\t$tce->clear_cacheCmd($pageId);\n\t\t\t}\n\t\t}\n\n\t\treturn TRUE;\n\t}",
"public function install_OSF()\n {\n $this->span(\"You are about to install the Open Semantic Framework.\");\n $this->span(\"This installation process installs all the software components that are part of the OSF stack. It will take 10 minutes of your time, but the process will go on for a few hours because of the many pieces of software that get compiled.\\n\");\n $this->span(\"The log of this installation is available here: \".$this->log_file);\n $this->span(\"\\n\\nCopyright 2008-15. Structured Dynamics LLC. All rights reserved.\\n\\n\");\n\n $this->h1(\"General Settings Initialization\");\n $this->prepareDistro();\n\n // Dependency chain:\n // PHP stack for OSF\n $this->installApache();\n $this->installPHP();\n // Java stack for Solr, Owl and Scones\n $this->installJava();\n $this->installTomcat();\n // Backends\n $this->installVirtuoso();\n $this->installSolr();\n $this->installMemcached();\n\n // Generate some OSF API key is none has been defined by the user\n if(empty($this->api_key) || $this->api_key == \"some-key\") \n {\n $this->span(\"Generating a OSF API Key...\", 'info');\n $this->api_key = strtoupper(bin2hex(openssl_random_pseudo_bytes(16)));\n $this->span(\"The generated API Key is {$this->api_key}\", 'notice');\n }\n\n // OSF Tools, Components and Web Service\n $this->switch_OSF_PermissionsManagementTool('install');\n $this->switch_OSF_DatasetsManagementTool('install');\n $this->switch_OSF_OntologiesManagementTool('install');\n $this->switch_OSF_DataValidatorTool('install');\n $this->switch_OSF_TestsSuites('install');\n $this->switch_OSF_WSPHPAPI('install');\n $this->switch_OSF_WebServices('install');\n\n $this->install_OSF_vhost();\n $this->setupSolr();\n $this->installARC2();\n $this->installOWLAPI();\n $this->setupVirtuoso();\n $this->load_OSF_OntologiesManagementTool();\n\n $this->installPHPUnit();\n $this->runOSFTestsSuites($this->osf_web_services_folder);\n\n $this->span(\"Now that the OSF instance is installed, you can install OSF for Drupal on the same server using this command:\\n\\n\", 'notice');\n $this->span(\" ./osf-installer -d --install-osf-drupal\\n\\n\", 'notice');\n }",
"function exportXmlFile($prefs,$tables,$package=FALSE,$debug=FALSE)\n{\n\t$xml = e107::getXml();\n\t$tp = e107::getParser();\n\t$mes = e107::getMessage();\n\n\tif(vartrue($package))\n\t{\n\n\t\t$xml->convertFilePaths = TRUE;\n\t\t$xml->modifiedPrefsOnly = true;\n\t\t$xml->filePathDestination = EXPORT_PATH;\n\t\t$xml->filePathPrepend = array(\n\t\t\t'news_thumbnail'\t=> \"{e_IMAGE}newspost_images/\"\n\t\t);\n\n\n\t\t$desinationFolder = $tp->replaceConstants($xml->filePathDestination);\n\n\t\tif(!is_writable($desinationFolder))\n\t\t{\n\t\t\t$message = str_replace('[folder]', $desinationFolder, DBLAN_107);\n\t\t\t$mes->add($message, E_MESSAGE_ERROR);\n\t\t\treturn ;\n\t\t}\n\t}\n\n\n\tif($xml->e107Export($prefs,$tables,$debug))\n\t{\n\t\t$mes->add(DBLAN_108.\" \".$desinationFolder.\"install.xml\", E_MESSAGE_SUCCESS);\n\t\tif(varset($xml->fileConvertLog))\n\t\t{\n\t\t\tforeach($xml->fileConvertLog as $oldfile)\n\t\t\t{\n\t\t\t\t$file = basename($oldfile);\n\t\t\t\t$newfile = $desinationFolder.$file;\n\t\t\t\tif($oldfile == $newfile || (copy($oldfile,$newfile)))\n\t\t\t\t{\n\t\t\t\t\t$mes->add(DBLAN_109.\" \".$newfile, E_MESSAGE_SUCCESS);\n\t\t\t\t}\n\t\t\t\telseif(!file_exists($newfile))\n\t\t\t\t{\n\t\t\t\t\t$mes->add(DBLAN_110.\" \".$newfile, E_MESSAGE_ERROR);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n}",
"public static function install(){\n\t}",
"public function Install() {\n $modules = new CMModules();\n $results = $modules->Install();\n $allModules = $modules->ReadAndAnalyse();\n $this->views->SetTitle('Install Modules')\n ->AddInclude(__DIR__ . '/install.tpl.php', array('modules'=>$results), 'primary')\n ->AddInclude(__DIR__ . '/sidebar.tpl.php', array('modules'=>$allModules), 'sidebar');\n }",
"public function install(){\r\n\r\n\t\t$this->load->library('module_installer');\r\n\r\n\t\t$lang_avail = $this->config->item('lang_avail');\r\n\t\t\r\n\t\t$data['dbprefix'] = $this->db->dbprefix;\r\n\t\t\t\r\n\t\t\r\n\t\t//echo \" FLAG1 \";\r\n\t\t\t\t\r\n\t\tforeach($lang_avail AS $langcode=>$language){ \r\n\t\t\r\n\t\t\t$data['langcode'] = $langcode;\r\n\t\t\r\n\t\t\t$this->module_installer->process_file(dirname(dirname(__FILE__)) . \"/install/mydata.sql\",$data);\r\n\t\t\t\r\n\t\t}\r\n\r\n\t\t// now copy any required css or js fles to the assets folder\r\n\t\t$this->module_installer->copy_assets(\"/custom_modules/\" . $this->router->class);\r\n\r\n\t\t\r\n\t}",
"public function install() {\n $strReturn = \"\";\n\n $strReturn .= \"Creating picture upload folder\\n\";\n if(!is_dir(_realpath_._filespath_.\"/images/upload\"))\n mkdir(_realpath_._filespath_.\"/images/upload\", 0777, true);\n\n $strReturn .= \"Creating new picture repository\\n\";\n $objRepo = new class_module_mediamanager_repo();\n\n if($this->strContentLanguage == \"de\")\n $objRepo->setStrTitle(\"Hochgeladene Bilder\");\n else\n $objRepo->setStrTitle(\"Picture uploads\");\n\n $objRepo->setStrPath(_filespath_.\"/images/upload\");\n $objRepo->setStrUploadFilter(\".jpg,.png,.gif,.jpeg\");\n $objRepo->setStrViewFilter(\".jpg,.png,.gif,.jpeg\");\n $objRepo->updateObjectToDb();\n $objRepo->syncRepo();\n\n $strReturn .= \"ID of new repo: \".$objRepo->getSystemid().\"\\n\";\n\n $strReturn .= \"Setting the repository as the default images repository\\n\";\n $objSetting = class_module_system_setting::getConfigByName(\"_mediamanager_default_imagesrepoid_\");\n $objSetting->setStrValue($objRepo->getSystemid());\n $objSetting->updateObjectToDb();\n\n $strReturn .= \"Creating file upload folder\\n\";\n if(!is_dir(_realpath_._filespath_.\"/public\"))\n mkdir(_realpath_._filespath_.\"/public\", 0777, true);\n\n $strReturn .= \"Creating new file repository\\n\";\n $objRepo = new class_module_mediamanager_repo();\n\n if($this->strContentLanguage == \"de\")\n $objRepo->setStrTitle(\"Hochgeladene Dateien\");\n else\n $objRepo->setStrTitle(\"File uploads\");\n\n $objRepo->setStrPath(_filespath_.\"/downloads\");\n $objRepo->setStrUploadFilter(\".zip,.pdf,.txt\");\n $objRepo->setStrViewFilter(\".zip,.pdf,.txt\");\n $objRepo->updateObjectToDb();\n $objRepo->syncRepo();\n $strReturn .= \"ID of new repo: \".$objRepo->getSystemid().\"\\n\";\n\n $strReturn .= \"Setting the repository as the default files repository\\n\";\n $objSetting = class_module_system_setting::getConfigByName(\"_mediamanager_default_filesrepoid_\");\n $objSetting->setStrValue($objRepo->getSystemid());\n $objSetting->updateObjectToDb();\n\n\n return $strReturn;\n }",
"public function actionIndexFiles()\n {\n $manager = new Manager(['module' => $this->module]);\n $manager->indexAll();\n }",
"private function packFiles()\n {\n // load core\n $this->builder->putVehicle($this->builder->createVehicle('xPDOFileVehicle', [\n 'vehicle_class' => 'xPDOFileVehicle',\n 'object' => [\n 'source' => __DIR__ . '/../core/components/' . self::PKG_NAME,\n 'target' => \"return MODX_CORE_PATH . 'components/';\"\n ]\n ]));\n\n // load assets\n $this->builder->putVehicle($this->builder->createVehicle('xPDOFileVehicle', [\n 'vehicle_class' => 'xPDOFileVehicle',\n 'object' => [\n 'source' => __DIR__ . '/../assets/components/' . self::PKG_NAME,\n 'target' => \"return MODX_ASSETS_PATH . 'components/';\"\n ]\n ]));\n }",
"function xmldb_assignsubmission_cle_install() {\r\n global $CFG;\r\n\r\n // do the install\r\n\r\n require_once($CFG->dirroot . '/mod/assign/adminlib.php');\r\n // set the correct initial order for the plugins\r\n $pluginmanager = new assign_plugin_manager('assignsubmission');\r\n\r\n \r\n \r\n // do the upgrades\r\n return true;\r\n\r\n}",
"function action_rapide_sauve_pack() {\r\n\t$titre0 = $titre = _T('couteauprive:pack_actuel', array('date'=>cs_date())); $n=0;\r\n\tif(isset($GLOBALS['cs_installer'][$titre]))\r\n\t\twhile(isset($GLOBALS['cs_installer'][\"$titre (\".++$n.')']));\r\n\tif($n) $titre = \"$titre ($n)\";\r\n\tinclude_spip(_DIR_CS_TMP.'config');\r\n\t$pack = \"\\n# Le Couteau Suisse : pack de configuration du \".date(\"d M Y, H:i:s\").\"\\n\\$GLOBALS['cs_installer']['$titre'] = \" . var_export($GLOBALS['cs_installer'][$titre0], true) . \";\\n\";\r\n\t$fo = strlen(_FILE_OPTIONS)? _FILE_OPTIONS:false;\r\n\t$t='';\r\n\tif ($fo) {\r\n\t\tif (lire_fichier($fo, $t) && strlen($t)) {\r\n\t\t\t$t = preg_replace(',\\?'.'>\\s*$,m', $pack.'?'.'>', $t, 1);\r\n\t\t\tif(ecrire_fichier($fo, $t)) return;\r\n\t\t\telse cs_log(\"ERREUR : l'ecriture du fichier $fo a echoue !\");\r\n\t\t} else cs_log(\" -- fichier $fo illisible. Inclusion non permise\");\r\n\t\tif(strlen($t)) return;\r\n\t}\r\n\t// creation\r\n\t$fo = defined('_SPIP19100')?_DIR_RESTREINT.'mes_options.php':_DIR_RACINE._NOM_PERMANENTS_INACCESSIBLES._NOM_CONFIG.'.php';\r\n\t$ok = ecrire_fichier($fo, '<?'.\"php\\n\".$pack.\"\\n?\".'>');\r\ncs_log(\" -- fichier $fo absent \".($ok?'mais cree avec l\\'inclusion':' et impossible a creer'));\r\n}",
"function files_upgrade($oldversion)\n{\n /* Upgrade dependent on old version number */\n $dbconn = xarDBGetConn();\n $xartable = xarDBGetTables();\n switch ($oldversion) {\n case '0.6.0':\n xarRegisterMask('SubmitFiles', 'All', 'Files', 'Item', '', 'ACCESS_COMMENT');\n xarRegisterMask('ModerateFiles', 'All', 'Files', 'Item', '', 'ACCESS_MODERATE');\n case '0.6.1':\n xarModSetVar('files','max_upload',3);\n xarModSetVar('files','allow_multiple',true);\n xarModSetVar('files','filetypes','jpg,jpeg,png,gif,pdf,txt,zip,gz');\n case '0.6.2':\n break;\n }\n /* Update successful */\n return true;\n}",
"function pre_install()\n\t{\n\t\t//-----------------------------------------\n\t\t// Installing, or uninstalling?\n\t\t//-----------------------------------------\n\t\t\n\t\t$type = ( $this->ipsclass->input['un'] == 1 ) ? 'uninstallation' : 'installation';\n\t\t$text = ( $this->ipsclass->input['un'] == 1 ) ? 'Uninstalling' : 'Installing';\n\t\t\n\t\t//-----------------------------------------\n\t\t// Page Info\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->admin->page_title = \"(FSY23) Universal Mod Installer: XML Analysis\";\n\t\t$this->ipsclass->admin->page_detail = \"The mod's XML file has been analyzed and the proper {$type} steps have been determined.\";\n\t\t$this->ipsclass->admin->nav[] = array( $this->ipsclass->form_code.'&code=view', 'Manage Mod Installations' );\n\t\t$this->ipsclass->admin->nav[] = array( '', $text.\" \".$this->xml_array['mod_info']['title']['VALUE'] );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Show the output\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( $this->xml_array['mod_info']['title']['VALUE'] );\n\t\t\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic( \"<span style='font-size: 12px;'>Click the button below to proceed with the mod $type.<br /><br /><input type='button' class='realbutton' value='Proceed...' onclick='locationjump(\\\"&{$this->ipsclass->form_code}&code=work&mod={$this->ipsclass->input['mod']}&un={$this->ipsclass->input['un']}&step=0&st={$this->ipsclass->input['st']}\\\")' /></span>\", \"center\" );\n\t\t\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\t\t\n\t\t$this->ipsclass->admin->output();\n\t}",
"function Xmldb_itfileupdate_uninstall() \n{\n return true;\n}",
"public function install() {\n\n\n }",
"public function install() {\r\n \r\n }",
"function plugin_autoinstall_nexcontent($pi_name)\r\n{\r\n global $CONF_SE,$_CONF;\r\n @require ($_CONF['path'] . 'plugins/nexcontent/nexcontent.php');\r\n\r\n $pi_name = $CONF_SE['pi_name'];\r\n $pi_display_name = $CONF_SE['pi_display_name'];\r\n $pi_admin = $pi_display_name . ' Admin';\r\n\r\n $info = array(\r\n 'pi_name' => $pi_name,\r\n 'pi_display_name' => $pi_display_name,\r\n 'pi_version' => $CONF_SE['version'],\r\n 'pi_gl_version' => $CONF_SE['gl_version'],\r\n 'pi_homepage' => 'http://www.nextide.ca/'\r\n );\r\n\r\n $groups = array(\r\n $pi_admin => 'Has full access to ' . $pi_display_name . ' features'\r\n );\r\n\r\n $features = array(\r\n $pi_name . '.edit' => 'Plugin Admin',\r\n $pi_name . '.user' => 'Plugin User'\r\n );\r\n\r\n $mappings = array(\r\n $pi_name . '.edit' => array($pi_admin),\r\n $pi_name . '.user' => array($pi_admin),\r\n );\r\n\r\n $tables = array(\r\n 'nxcontent',\r\n 'nxcontent_pages',\r\n 'nxcontent_images'\r\n );\r\n\r\n $inst_parms = array(\r\n 'info' => $info,\r\n 'groups' => $groups,\r\n 'features' => $features,\r\n 'mappings' => $mappings,\r\n 'tables' => $tables\r\n );\r\n\r\n return $inst_parms;\r\n}",
"protected static function extendInstallToolEnableFileLifetime() {}",
"function main() {\n\t\t// Initializes the module. Done in this function because we may need to re-initialize if data is submitted!\n\t\tglobal $SOBE,$BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;\n\t\t\n\t\t\n\t\t\n\t\tif (t3lib_div::_GP('submit')=='') {\n\t\t\t\n\t\t\t$extList = $this->getExtList();\n\t\t\t\n\t\t\t$option = '<option value=\"\">Select:</option>';\n\t\t\tforeach($extList AS $extItem){\n\t\t\t\t$option .= '<option value=\"'.$extItem.'\">'.$extItem.'</option>';\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t$content='<form>';\n\t\t\t$content.='<input type=\"hidden\" name=\"SET[function]\" value=\"tx_disckickstarter_modfunc1\">';\n\t\t\t$content.='<select name=\"actualkey\">';\n\t\t\t$content.=$option;\n\t\t\t$content.='</select>';\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t$content.='Copy to key:<input name=\"newkey\">';\n\t\t\t$content.='<input type=\"submit\" name=\"submit\" value=\"do it\"></form>';\n\t\t\t\n\t\t\t$content .='<h3>What it does</h3><ul><li>All files and folders are copied to the new extension folder: typo3conf/ext/****</li>';\n\t\t\t$content .='<li>In every file the appearance of the extensionname is replaced:<ul><li>old_key -> new_key</li><li>tx_oldkey -> tx_newkey</li></ul></ul>';\n\t\t\t\n\t\t}\n\t\telse {\n\t\t\t$actualkey=t3lib_div::_GP('actualkey');\n\t\t\t$newkey=t3lib_div::_GP('newkey');\n\t\t\tif (strcmp($newkey,'') && strcmp($actualkey,''))\t{\n\t\t\t\t//$from=t3lib_extMgm::extPath($actualkey);\n\t\t\t\t$from=PATH_site.'typo3conf/ext/'.$actualkey.'/';\n\t\t\t\t$to=PATH_site.'typo3conf/ext/'.$newkey.'/';\n\t\t\t\t$renames=array();\n\t\t\t\t$renames['tx_'.str_replace('_','',$actualkey)]='tx_'.str_replace('_','',$newkey);\n\t\t\t\t$renames[$actualkey]=$newkey;\n\t\t\t\t\n\t\t\t\t$content.='From: '.$from.' To:'.$to;\n\t\t\t\t\n\t\t\t\t$content.=$this->copyAllFilesWithRename($from,$to,$renames);\n\t\t\t\t$content.='<hr>';\n\t\t\t\tforeach($this->debug as $debug) {\n\t\t\t\t\t$content.=$debug.'<br>';\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$content.='Please enter two valid Extensionkeys, and be sure that the actual extension is installed';\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\t\n\t\t\n\t\t$theOutput.=$this->pObj->doc->spacer(5);\n\t\t$theOutput.=$this->pObj->doc->section($LANG->getLL(\"title\"),$content,0,1);\n\t\t\n\t\t\n\t\t/*\n\t\t$menu=array();\n\t\t$menu[]=t3lib_BEfunc::getFuncCheck($this->wizard->pObj->id,\"SET[tx_disckickstarter_modfunc1_check]\",$this->wizard->pObj->MOD_SETTINGS[\"tx_disckickstarter_modfunc1_check\"]).$LANG->getLL(\"checklabel\");\n\t\t$theOutput.=$this->pObj->doc->spacer(5);\n\t\t$theOutput.=$this->pObj->doc->section(\"Menu\",implode(\" - \",$menu),0,1);\n\t\t*/\n\t\t\n\t\t\n\t\treturn $theOutput;\n\t}",
"private function _module()\n\t{\n\t\t$sCacheModules = PHPFOX_DIR_FILE . 'log' . PHPFOX_DS . 'installer_modules.php';\n\t\tif (!file_exists($sCacheModules))\n\t\t{\n\t\t\t// Something went wrong...\n\t\t}\t\t\n\t\trequire_once($sCacheModules);\n\n\t\t$sModuleLog = PHPFOX_DIR_CACHE . 'installer_completed_modules.log';\n\t\t$aInstalled = array();\n\t\tif (file_exists($sModuleLog))\n\t\t{\n\t\t\t$aLines = file($sModuleLog);\n\t\t\tforeach ($aLines as $sLine)\n\t\t\t{\n\t\t\t\t$sLine = trim($sLine);\n\t\t\n\t\t\t\tif (empty($sLine))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$aInstalled[$sLine] = true;\n\t\t\t}\n\t\t}\n\n\t\t$bInstallAll = (defined('PHPFOX_INSTALL_ALL_MODULES') ? true : false);\n\t\t$oModuleProcess = Phpfox::getService('admincp.module.process');\n\t\t$hFile = fopen($sModuleLog, 'a+');\t\n\t\t$iCnt = 0;\n\t\t$sMessage = '';\n\t\t$sInstalledModule = '';\n\t\tforeach ($aModules as $sModule)\n\t\t{\n\t\t\tif (isset($aInstalled[$sModule]))\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\t$iCnt++;\t\t\t\n\t\t\t$sInstalledModule .= $sModule . \"\\n\";\n\t\t\t$sMessage .= \"<li>\" . $sModule . \"</li>\";\n\n\t\t\t$oModuleProcess->install($sModule, array('insert' => true));\n\t\t\n\t\t\tif ($bInstallAll === false && $iCnt == 5)\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\tfwrite($hFile, $sInstalledModule);\n\t\tfclose($hFile);\n\t\t\n\t\tif ($this->_bUpgrade)\n\t\t{\n\t\t\treturn ($iCnt === 0 ? true : false);\n\t\t}\n\n\t\t// No more modules to install then lets send them to the final step\n\t\tif ($iCnt === 0 || defined('PHPFOX_INSTALL_ALL_MODULES'))\n\t\t{\n\t\t\t$this->_pass();\n\t\t\t\n\t\t\tunlink($sModuleLog);\n\t\t\t\n\t\t\t$this->_oTpl->assign(array(\n\t\t\t\t\t'sMessage' => 'All modules installed...',\n\t\t\t\t\t'sNext' => $this->_step('post')\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\telse \n\t\t{\t\t\n\t\t\t$this->_oTpl->assign(array(\n\t\t\t\t\t'sMessage' => 'Installed Module(s): <div class=\"label_flow\" style=\"height:200px;\"><ul>' . $sMessage . '</ul></div>',\n\t\t\t\t\t'sNext' => $this->_step('module')\n\t\t\t\t)\n\t\t\t);\t\n\t\t}\n\t}",
"function main() {\n\t\t// Initializes the module. Done in this function because we may need to re-initialize if data is submitted!\n\t\tglobal $SOBE,$BE_USER,$LANG,$BACK_PATH,$TCA_DESCR,$TCA,$CLIENT,$TYPO3_CONF_VARS;\n\n\t\t// set the path for navigation bar\n\t\t$infoPath = $this->pObj->getFolderNavBar($this->pObj->pathInfo);\n\n\t\t// create a instance of dam object\n\t\t$damObj = &t3lib_div::getUserObj('tx_dam');\n\n\t\t// create a html table with the informations from local server\n\t\t$table = '';\n\t\t$table .= '<table class=\"typo3-dblist typo3-filelist\" cellspacing=\"0\" border=\"0\" style=\"width:100%\">';\n\t\t$table .= '<tr>';\n\t\t$table .= '<td class=\"c-headLine\" nowrap=\"nowrap\" valign=\"top\" align=\"left\" style=\"border-bottom: 1px solid #888888; padding-left: 5px;\">'.$LANG->getLL(\"filename\").'</td>';\n\t\t$table .= '<td class=\"c-headLine\" nowrap=\"nowrap\" valign=\"top\" align=\"left\" style=\"border-bottom: 1px solid #888888; padding-left: 5px;\">'.$LANG->getLL(\"size\").'</td>';\n\t\t$table .= '<td class=\"c-headLine\" nowrap=\"nowrap\" valign=\"top\" align=\"left\" style=\"border-bottom: 1px solid #888888; padding-left: 5px;\">'.$LANG->getLL(\"status\").'</td>';\n\t\t$table .= '</tr>';\n\n\n\t\t$dh = dir($this->pObj->pathInfo['dir_path_absolute']);\n\t\t$count = 0;\n\t\twhile (false !== ($entry = $dh->read()))\n\t\t{\n\t\t\tif($entry!=='.' and $entry!=='..' and is_file($this->pObj->pathInfo['dir_path_absolute'].$entry))\n\t\t\t{\n\t\t\t\tif(($count%2) == 0)\n\t\t\t\t\t$rowColor = '#FAFAFA';\n\t\t\t\telse\n\t\t\t\t\t$rowColor = '#F5F5F5';\n\n\t\t\t\t$fieldList = 'uid,pid,file_name, file_path, file_size,tx_damivsvideobasic_encode,tx_damivsvideobasic_status';\n\t\t\t\t$meta = $damObj->meta_getDataForFile($this->pObj->pathInfo['dir_path_absolute'].$entry, $fieldList);\n\t\t\t\t//t3lib_div::devLog('File Meta', 'dam_ivs_videobasic', 1, array('result' => $meta));\n\t\t\t\t$table .= '<tr style=\"background-color:'.$rowColor.';\">';\n\t\t\t\t$table .= '<td class=\"typo3-dblist-item\" style=\"padding-left:5px;\">'.$meta['file_name'].'</td>';\n\t\t\t\t$table .= '<td class=\"typo3-dblist-item\" style=\"padding-left:5px;\">'.$meta['file_size'].'</td>';\n\n\t\t\t\tif($meta['tx_damivsvideobasic_status']=='0')\n\t\t\t\t\t$meta['tx_damivsvideobasic_status'] = $LANG->getLL(\"notsubmitted\");\n\t\t\t\tif($meta['tx_damivsvideobasic_status']=='1')\n\t\t\t\t\t$meta['tx_damivsvideobasic_status'] = $LANG->getLL(\"wait\");\n\t\t\t\tif($meta['tx_damivsvideobasic_status']=='2')\n\t\t\t\t\t$meta['tx_damivsvideobasic_status'] = $LANG->getLL(\"encodingerror\");\n\t\t\t\tif($meta['tx_damivsvideobasic_status']=='3')\n\t\t\t\t\t$meta['tx_damivsvideobasic_status'] = $LANG->getLL(\"ready\");\n\n\t\t\t\t$table .= '<td class=\"typo3-dblist-item\" style=\"padding-left:5px;\">'.$meta['tx_damivsvideobasic_status'].'</td>';\n\t\t\t\t$table .= '</tr>';\n\n\t\t\t\t$count++;\n\t\t\t}\n\t\t}\n\n\t\t$table .= '</table>';\n\n\n\t\t$theOutput.=$this->pObj->doc->spacer(5);\n\t\t$theOutput.=$this->pObj->doc->section($LANG->getLL(\"title\"),$table,0,1);\n\n\t\t$theOutput.=$this->pObj->doc->divider(5);\n\n\t\t$menu=array();\n\t\t$menu[]=t3lib_BEfunc::getFuncCheck($this->pObj->id,\"SET[tx_dam_ivs_videobasic_modfunc_status_check]\",$this->pObj->MOD_SETTINGS[\"tx_dam_ivs_videobasic_modfunc_status_check\"]).$LANG->getLL(\"checklabel\");\n\t\t$theOutput.=$this->pObj->doc->spacer(5);\n\t\t$theOutput.=$this->pObj->doc->section(\"Menu\",implode(\" - \",$menu),0,1);\n\n\t\treturn $theOutput;\n\t}",
"function pm_demo_install() {\t\t\n\t\t//create llog\n\t\t$array = array();\n\t\t//add log to database\n\t\tself::createLog($array);\n }",
"public function executeGenerarfile(sfWebRequest $request)\n {\n\n // Variables\n $sqlUpdate='';\n\n // Redirige al inicio si no tiene acceso\n if (!$this->getUser()->getGuardUser()->getIsSuperAdmin())\n $this->redirect('ingreso');\n\n $archivo = Doctrine_Core::getTable('Actualizacionestrat')->find(array($request['id']));\n // $archivo = Doctrine_Core::getTable('Actualizaciones')->find(array(2));\n\n $arr = explode(\".\", $archivo->getImagefile(), 2);\n $first = $arr[0];\n\n $nombre_archivo_upd = sfConfig::get('app_pathfiles_folder').\"/../actualizacionestrat\".'/upd_'.$first.\".sql\";\n\n // DATOS conexion\n /*$dbhost = 'localhost';$dbname = 'circulo'; $dbuser = 'root'; $dbpass = 'root911';\n\n $pdo = new \\PDO('mysql:host=' . $dbhost . ';dbname=' . $dbname, $dbuser, $dbpass, array(\n \\PDO::MYSQL_ATTR_LOCAL_INFILE => true\n ));*/\n\n\n // PRIMER PASO : ACTUALIZACION DE REGISTROS\n\n // SI existe el archivo previamente, lo borro\n if (file_exists($nombre_archivo_upd)) unlink($nombre_archivo_upd);\n\n // CONSULTA por registros a ACTUALIZAR (ya existe el email en la tabla de Pacientes)\n //$datoss = $archivo = Doctrine_Core::getTable('Actualizaciones')->obtenerRegistrosAActualizar();\n\n $fp=fopen($nombre_archivo_upd,\"w+\");\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('nombre','nombre','T');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('abreviacion','abreviacion','T');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('idgrupotratamiento','idgrupotratamiento','N');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('idobrasocial','idobrasocial','N');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('idplan','idplan','N');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('idontologia','idontologia','N');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('garantia','garantia','N');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('importe','importe','N');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('coseguro','coseguro','N');\n fwrite($fp,$sqlUpdate);\n\n $sqlUpdate = $archivo = Doctrine_Core::getTable('Actualizacionestrat')->obtenerRegistrosAActualizar('importeos','importeos','N');\n fwrite($fp,$sqlUpdate);\n\n\n\n fclose ($fp);\n\n return true;\n\n }",
"function setup(){\n\t\tglobal $session;\n\t\tswitch($this->act){\n\t\tcase ACT_SAVE://when act is save, write configuration to database\n\t\t\t$this->name='System file editor';\n\t\t\t$this->ctrl |= array_sum($_POST['ctrl']);\n\t\t\tif($_POST['more']) $_POST['f'] += array($_POST['more']=>1);\n\t\t\t$this->data=serialize($_POST['f']);\n\t\t\t$this->access=0;//require access developper to run\n\t\t\t$this->save();\n\t\t\tredirect($this->makeUrl(NULL,NULL,'setup'));\n\t\tdefault:\n\t\t\t$this->cfg=unserialize($this->data);\n\t\t\tif(!$this->cfg) $this->cfg=array();\n\t\t\t$this->startPage('Root file editor setup');\n\t\t\t$this->startForm(ACT_SAVE);\n\t\t\techo '<fieldset style=\"width:800px;margin:60px auto 20px auto; \"><legend>Enable users to edit following files</legend>\n<div>PATH_ROOT: <strong>'.PATH_ROOT.'</strong></div>\n<div><input type=\"checkbox\" name=\"f['.PATH_ROOT.'robots.txt]\" value=\"1\" '.($this->cfg[PATH_ROOT.'robots.txt'] ? 'checked':'').' /> robots.txt</div>';\n\t\t\tunset($this->cfg[PATH_ROOT.'robots.txt']);\n\t\t\tforeach($this->cfg as $file=>$value)\n\t\t\t\techo '<div><input type=\"checkbox\" class=\"input\" name=\"f['.$file.']\" value=\"1\" checked />'.str_replace(PATH_ROOT,'',$file).'</div>';\n\t\t\tif($session->getAccess(SESSION_CTRL_ADMIN,MODULE_SYS,ACCESS_DEVELOPPER))\techo '<div>Other file <input type=\"text\" name=\"more\" class=\"input\" size=\"80\" value=\"\" /></div>'; \n\t\t\techo '<div><input type=\"hidden\" value=\"1\" name=\"ctrl[]\" /><input type=\"checkbox\" value=\"',0x40000000,'\" name=\"ctrl[]\" '; if($this->ctrl & 0x40000000) echo 'checked'; echo ' />Show on system menu</div>';\n\t\t\t$this->endForm();\n\t\t\techo '</fieldset><script type=\"text/javascript\">function doSave(){document.forms[0].submit();}</script>';\n\t\t\t$this->endPage();\n\t\t}\n\t}",
"function updateMantisCustomFiles() {\n\n $mantisPath = Constants::$mantisPath;\n\n // --- check mantis version (config files have been moved in v1.3)\n if (is_dir($mantisPath.DIRECTORY_SEPARATOR.'config')) {\n // mantis v1.3 or higher\n $path_mantis_config = $mantisPath.DIRECTORY_SEPARATOR.'config';\n } else {\n // mantis 1.2\n $path_mantis_config = $mantisPath;\n }\n\n if(!is_writable($path_mantis_config)) {\n throw new Exception(\"Path to mantis config \". $path_mantis_config.\" is NOT writable\");\n }\n\n appendToFile($path_mantis_config.'/custom_constants_inc.php',\n Install::FILENAME_CUSTOM_CONSTANTS_CODEVTT,\n 'BUG_CUSTOM_RELATIONSHIP_CONSTRAINED_BY');\n\n appendToFile($path_mantis_config.'/custom_strings_inc.php',\n Install::FILENAME_CUSTOM_STRINGS_CODEVTT,\n 's_rel_constrained_by');\n\n appendToFile($path_mantis_config.'/custom_relationships_inc.php',\n Install::FILENAME_CUSTOM_RELATIONSHIPS_CODEVTT,\n 'BUG_CUSTOM_RELATIONSHIP_CONSTRAINED_BY');\n return NULL;\n}",
"function writeInstall() \n {\n $file = new CodeGen_Tools_Outbuf($this->dirpath.\"/INSTALL\");\n\n $title = $this->archivePrefix.\"-\".$this->name.\" \".$this->release->getVersion();\n\n echo \"$title\\n\";\n echo str_repeat(\"=\", strlen($title)).\"\\n\";\n\n echo \"\\n== Configuration ==\\n\\n\";\n\n if ($this->needSource) {\n?>\nThis user defined function module relies on information only \navailable in the MySQL source code, it can't be compiled if\nyou've only installed MySQL binary packages.\n\nTo compile this package you need to first tell configure \nwhere to find the MySQL source directory you want to compile\nagainst using the --with-mysql-src configure option, e.g:\n\n configure --with-mysql-src=/home/username/src/mysql-5.0.37\n\n<?php\n } else {\n?>\nYou can configure this package as usual, in the simplest case\nyou just need to invoke \n\n configure \n\nwithout options. This requires that the \"mysql_config\" binary \nof the server installation you want to compile this UDF module\nfor is in your environments $PATH\n\nYou may specify an explicit mysql installation to compile \nagainst by using the\n\n --with-mysql=...\n\noption, this option expects either the path of this installations\n\"mysql_config\" binary or the installations base dir (assuming\nthat \"mysql_config\" is in the \"$prefix/bin\" directory) as argument.\n\nSo any of the following may be used to configure the package\nagainst a server installed in a \"/usr/local/mysql\" prefix \n(the default if you compiled mysql yourself or used one of the\ntar.gz distribution packages provided by mysql.com):\n\n configure --with-mysql=/usr/local/mysql\n\n configure --with-mysql=/usr/local/mysql/bin/mysql_config\n\n<?php\n }\n?>\n\nFor a full list of configure options see \n\n configure --help\n\nBy default the UDF library created by this package will install\ninto /usr/local/lib. The mysql server may not be able to load\nit from there though as this directory may not be in its\nlibrary search path. \n\nYou may solve this by:\n\n - adding /usr/local/lib to the LD_LIBRARY_PATH before\n invoking the mysql server\n\n - changing the UDF install prefix by using either the\n --prefix or --libdir configure option so that the\n UDF library gets installed into a directory that is\n in the servers load path\n\n - or both of the above\n\n== Compilation ==\n\nOnce you have successfully configured the package \nyou should be able to compile it by simply typing\n\n make\n \n== Testing ==\n\nThis package includes test cases that can be invoked using\n \n mysql test\n\nThis relies on the following mysql binaries being available\nin your environments search $PATH to function as the tests\nrely on the mysql server test framework:\n\n * mysql - the mysql command line client\n * mysqld - the mysql server\n * mysqladmin - the mysql administration command line tool\n * mysql_install_db - the database server initialisation tool\n * mysqltest - the actual test framework tool\n\n== Installing the library ==\n\nTo install the generated UDF library you simply need to invoke\n\n make install\n\nDepending on the target directories user permissions you might\nneed to do this as superuser though, eg. by using \"sudo\":\n\n sudo make install\n\nRemember that the mysql server will only be able to load the\nlibrary if it is installed in a directory in its library load\npath, you may modify this search path by invoking the server\nwith the $LD_LIBRARY_PATH environment variable set appropriately\nbefore starting.\n\n== Installing the actual functions ==\n\nTo actually enable the functions provided by this UDF module\nyou need to make them known to the MySQL server using \n\"CREATE FUNCTION\" SQL commands:\n\n<?php\n echo \"Register the functions provided by this UDF module using\\n\";\n foreach ($this->functions as $function) {\n echo $function->createStatement($this).\"\\n\";\n }\n echo \"\\n\"; \n echo \"Unregister the functions provided by this UDF module using\\n\"; \n foreach ($this->functions as $function) {\n echo $function->dropStatement($this).\"\\n\";\n }\n?>\n\n== Changing the source ==\n\nChanges applied to any of the files in this project may be \noverwritten by further invocations of the udf-gen tool so\nyou should always try to apply all necessary changes to the\nXML specification file the project was generated from instead\nand then regenerate the project from the spec file instead.\n\nThe udf-gen tool will only overwrite files that actually \nchanged, so preserving file system time stamps of unmodified\nfiles, to play nice with \"make\" and to avoid unnecessary\nrecompilation of source files.\n\n<?php\n\n $file->write();\n }",
"public function installKeTabel() {\n\t\t$countModulesFile = count($this->getModulesDirOnDisk());\n\t\t$toBeInstalled = array();\n\n\t\tif($countModulesFile > $this->getTotalModuleFromDb()) {\n\t\t\t$cacheModule = file(Yii::getPathOfAlias('application.config').'/cache_module.php');\n\t\t\t$installedModule = $this->getModulesDirOnDisk();\n\t\t\t$toBeInstalled = array();\n\t\t\t$caches = array();\n\t\t\tforeach($cacheModule as $val) {\n\t\t\t\t$caches[] = trim(strtolower($val));\n\t\t\t}\n\n\t\t\t// Cari nama modul yang belum masuk database.\n\t\t\tif(count($cacheModule) == 0 || count($cacheModule) < 1) {\n\t\t\t\tif($installedModule) {\n\t\t\t\t\tforeach($installedModule as $val) {\n\t\t\t\t\t\t$toBeInstalled[] = $val;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t}else {\n\t\t\t\tif($installedModule) {\n\t\t\t\t\tforeach($installedModule as $val) {\n\t\t\t\t\t\t$val = trim($val);\n\t\t\t\t\t\tif(!in_array(strtolower($val), $caches)) {\n\t\t\t\t\t\t\t$toBeInstalled[] = $val;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$sql = \"INSERT INTO {$this->_moduleTableName}(id, name, enabled) VALUES\";\n\t\t\t$id = $this->getIdMax('id', 'swt_com_modules');\n\t\t\tfor($i = 0; $i < count($toBeInstalled); $i++) {\n\t\t\t\tif(isset(Yii::app()->getModule($toBeInstalled[$i])->active))\n\t\t\t\t\t$active = Yii::app()->getModule($toBeInstalled[$i])->active;\n\t\t\t\telse\n\t\t\t\t\t$active = 0;\n\n\t\t\t\t$desc = Yii::app()->getModule($toBeInstalled[$i])->description;\n\n\t\t\t\tif($i == (count($toBeInstalled) - 1)) {\n\t\t\t\t\t$sql .= '(' . $id . ', \"' . $toBeInstalled[$i] . '\", ' . $active . ')';\n\t\t\t\t}else\n\t\t\t\t\t$sql .= '(' . $id . ', \"' . $toBeInstalled[$i] . '\", ' . $active . '),';\n\n\t\t\t\t$id++;\n\t\t\t}\n\n\t\t\t//Check if module already inserted to table.\n\t\t\t$conn = Yii::app()->db;\n\n\t\t\tif(count($toBeInstalled) > 0) {\n\t\t\t\t$result = $conn->createCommand($sql)->execute();\n\t\t\t\tif($result)\n\t\t\t\t\treturn true;\n\t\t\t\telse\n\t\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}",
"function xh_install($db_name)\r\n\t{\r\n\t}",
"function procMenuAdminMakeXmlFile()\n\t{\n\t\t// Check input value\n\t\t$menu_srl = Context::get('menu_srl');\n\t\t// Get information of the menu\n\t\t$oMenuAdminModel = getAdminModel('menu');\n\t\t$menu_info = $oMenuAdminModel->getMenu($menu_srl);\n\t\t$menu_title = $menu_info->title;\n\t\t// Re-generate the xml file\n\t\t$xml_file = $this->makeXmlFile($menu_srl);\n\t\t// Set return value\n\t\t$this->add('menu_title',$menu_title);\n\t\t$this->add('xml_file',$xml_file);\n\t}",
"private static function defaultFiles($dir){\n\n //gerando o model\n $model = \"<?php\\nnamespace modules\\\\\".strtolower(self::$pathName).\"\\\\model;\\n\\nclass \".self::$pathName.\"s implements \\\\libs\\\\database\\\\model\\n{\\n\\tpublic function create()\\n\\t{\\n\\t\\treturn array(\\n\\n);\\t\\n}\\n}\\n\";\n \\libs\\kernel\\File::newFile($dir.\"/model/\".self::$pathName.\"s.php\", $model);\n \n \n //gerando o controller\n $controller = \"<?php\\nnamespace modules\\\\\".strtolower(self::$pathName).\"\\\\controller;\\nuse \\\\libs\\\\kernel\\\\ControllerBase as CB;\\n\\nclass Controller\".self::$pathName.\" extends CB{\\n\\n\\tpublic function index(\\$app, \\$response){\\n // resposta que vem do servidor => \\$response. \\n // url onde esta o arquivo que vai ser renderizado. \\n // argumento a serem passados para a pagina. => \\$args \\n\\n return \\$app->view->render(\\$response, \\\"/\".ucfirst(self::$pathName).\"/index.php\\\");\\n\\t}\\n}\";\n \\libs\\kernel\\File::newFile($dir.\"/controller/Controller\".self::$pathName.\".php\", $controller);\n\n //gerando o manifest json\n $manifestJson = \"{\\n\\\"dad\\\": \\\"this\\\",\\n\\\"dadsName\\\": \\\"master\\\",\\n\\\"acessLevel\\\": \\\"0\\\",\\n\\\"title\\\": \\\"\".self::$pathName.\"\\\",\\n\\\"url\\\": \".strtolower(self::$pathName).\"\\\",\\n\\\"submenu\\\": []\\n}\";\n \\libs\\kernel\\File::newFile($dir.\"/manifest.json\", $manifestJson);\n \n \n //gerando o index\n \\libs\\kernel\\File::newFile($dir.\"/index.php\", \"\");\n }",
"public function install()\r\n {\r\n //----------------------------------------\r\n // EXP_MODULES\r\n //----------------------------------------\r\n $module = ee('Model')->make('Module');\r\n $module->module_name = ucfirst($this->module_name);\r\n $module->module_version = $this->version;\r\n $module->has_cp_backend = 'y';\r\n $module->has_publish_fields = 'n';\r\n $module->save();\r\n\r\n //----------------------------------------\r\n // EXP_TAGGER\r\n //----------------------------------------\r\n $tagger = array(\r\n 'tag_id' => array('type' => 'INT', 'unsigned' => true, 'auto_increment' => true),\r\n 'tag_name' => array('type' => 'VARCHAR', 'constraint' => 255),\r\n 'site_id' => array('type' => 'TINYINT', 'unsigned' => true, 'default' => 1),\r\n 'author_id' => array('type' => 'INT', 'unsigned' => true, 'default' => 1),\r\n 'entry_date' => array('type' => 'INT', 'unsigned' => true, 'default' => 1),\r\n 'edit_date' => array('type' => 'INT', 'unsigned' => true, 'default' => 1),\r\n 'hits' => array('type' => 'INT', 'unsigned' => true, 'default' => 0),\r\n 'total_entries' => array('type' => 'INT', 'unsigned' => true, 'default' => 1),\r\n );\r\n\r\n ee()->dbforge->add_field($tagger);\r\n ee()->dbforge->add_key('tag_id', true);\r\n ee()->dbforge->add_key('tag_name');\r\n ee()->dbforge->create_table('tagger', true);\r\n\r\n //----------------------------------------\r\n // EXP_TAGGER_LINKS\r\n //----------------------------------------\r\n $tagger = array(\r\n 'rel_id' => array('type' => 'INT', 'unsigned' => true, 'auto_increment' => true),\r\n 'site_id' => array('type' => 'TINYINT', 'unsigned' => true, 'default' => 1),\r\n 'entry_id' => array('type' => 'INT', 'unsigned' => true, 'default' => 0),\r\n 'channel_id' => array('type' => 'SMALLINT', 'unsigned' => true, 'default' => 0),\r\n 'field_id' => array('type' => 'MEDIUMINT', 'unsigned' => true, 'default' => 0),\r\n// 'item_id' => array('type' => 'INT', 'unsigned' => true, 'default' => 0),\r\n 'tag_id' => array('type' => 'INT', 'unsigned' => true, 'default' => 0),\r\n 'author_id' => array('type' => 'INT', 'unsigned' => true, 'default' => 1),\r\n 'type' => array('type' => 'SMALLINT', 'unsigned' => true, 'default' => 1),\r\n 'tag_order' => array('type' => 'SMALLINT', 'unsigned' => true, 'default' => 0),\r\n );\r\n\r\n ee()->dbforge->add_field($tagger);\r\n ee()->dbforge->add_key('rel_id', true);\r\n ee()->dbforge->add_key('tag_id');\r\n ee()->dbforge->add_key('entry_id');\r\n ee()->dbforge->create_table('tagger_links', true);\r\n\r\n //----------------------------------------\r\n // EXP_TAGGER_GROUPS\r\n //----------------------------------------\r\n $tagger = array(\r\n 'group_id' => array('type' => 'INT', 'unsigned' => true, 'auto_increment' => true),\r\n 'group_title' => array('type' => 'VARCHAR', 'constraint' => 255),\r\n 'group_name' => array('type' => 'VARCHAR', 'constraint' => 255),\r\n 'group_desc' => array('type' => 'VARCHAR', 'constraint' => 255),\r\n 'parent_id' => array('type' => 'INT', 'unsigned' => true, 'default' => 0),\r\n 'site_id' => array('type' => 'TINYINT', 'unsigned' => true, 'default' => 1),\r\n '`order`' => array('type' => 'MEDIUMINT', 'unsigned' => true, 'default' => 1),\r\n );\r\n\r\n ee()->dbforge->add_field($tagger);\r\n ee()->dbforge->add_key('group_id', true);\r\n ee()->dbforge->create_table('tagger_groups', true);\r\n\r\n //----------------------------------------\r\n // EXP_TAGGER_GROUPS_ENTRIES\r\n //----------------------------------------\r\n $tagger = array(\r\n 'rel_id' => array('type' => 'INT', 'unsigned' => true, 'auto_increment' => true),\r\n 'tag_id' => array('type' => 'INT', 'unsigned' => true, 'default' => 0),\r\n 'group_id' => array('type' => 'INT', 'unsigned' => true, 'default' => 0),\r\n '`order`' => array('type' => 'INT', 'unsigned' => true, 'default' => 1),\r\n );\r\n\r\n ee()->dbforge->add_field($tagger);\r\n ee()->dbforge->add_key('rel_id', true);\r\n ee()->dbforge->add_key('group_id');\r\n ee()->dbforge->add_key('tag_id');\r\n ee()->dbforge->create_table('tagger_groups_entries', true);\r\n\r\n //----------------------------------------\r\n // EXP_ACTIONS\r\n //----------------------------------------\r\n $action = ee('Model')->make('Action');\r\n $action->class = ucfirst($this->module_name);\r\n $action->method = $this->module_name . '_router';\r\n $action->csrf_exempt = 0;\r\n $action->save();\r\n\r\n //----------------------------------------\r\n // EXP_MODULES\r\n // The settings column, Ellislab should have put this one in long ago.\r\n // No need for a seperate preferences table for each module.\r\n //----------------------------------------\r\n if (ee()->db->field_exists('settings', 'modules') == false) {\r\n ee()->dbforge->add_column('modules', array('settings' => array('type' => 'TEXT') ) );\r\n }\r\n\r\n return true;\r\n }",
"public function install() {\n $this->load->model('extension/module/export_yml');\n $this->model_extension_module_export_yml->installPromCategoryTable();\n $this->model_extension_module_export_yml->installPromProductTable();\n }",
"abstract public function installVirtuoso();",
"public function install();",
"public function install();",
"public function manageAction()\n {\n $mimeProperty = $this->_privateConfig->mime->property;\n $fileClass = $this->_privateConfig->class;\n $fileModel = $this->_privateConfig->model;\n $store = $this->_owApp->erfurt->getStore();\n\n $query = new Erfurt_Sparql_SimpleQuery();\n $query->setProloguePart('SELECT DISTINCT ?mime_type ?uri')\n ->addFrom((string)$this->_getConfigModelUri())\n ->setWherePart(\n 'WHERE\n {\n ?uri a <' . $fileClass . '>.\n ?uri <' . $fileModel . '> <' . (string)$this->_owApp->selectedModel . '>.\n ?uri <' . $mimeProperty . '> ?mime_type.\n }'\n )\n ->setOrderClause('?uri')\n ->setLimit(10); // TODO: paging\n\n if ($result = $store->sparqlQuery($query, array('use_ac' => false))) {\n $files = array();\n foreach ($result as $row) {\n if (is_readable($this->getFullPath($row['uri']))) {\n array_push($files, $row);\n }\n }\n $this->view->files = $files;\n } else {\n $this->view->files = array();\n }\n\n $this->view->placeholder('main.window.title')->set($this->_owApp->translate->_('File Manager'));\n OntoWiki::getInstance()->getNavigation()->disableNavigation();\n\n $toolbar = $this->_owApp->toolbar;\n\n $filePath = _OWROOT\n . rtrim($this->_privateConfig->path, '/')\n . DIRECTORY_SEPARATOR;\n\n $url = new OntoWiki_Url(array('controller' => 'files', 'action' => 'upload'), array());\n\n if (is_writable($filePath)) {\n\n $toolbar->appendButton(\n OntoWiki_Toolbar::DELETE,\n array('name' => 'Delete Files', 'class' => 'submit actionid', 'id' => 'filemanagement-delete')\n );\n\n $toolbar->appendButton(\n OntoWiki_Toolbar::ADD,\n array('name' => 'Upload File', 'class' => 'upload-file', 'url' => (string)$url)\n );\n\n $this->view->placeholder('main.window.toolbar')->set($toolbar);\n } else {\n $msgString = sprintf(\n $this->_owApp->translate->_('Directory \"%s\" is not writeable. To upload files set it writable.'),\n rtrim($this->_privateConfig->path, '/') . DIRECTORY_SEPARATOR\n );\n $this->_owApp->appendMessage(\n new OntoWiki_Message($msgString, OntoWiki_Message::INFO)\n );\n }\n\n if (!defined('ONTOWIKI_REWRITE')) {\n $this->_owApp->appendMessage(\n new OntoWiki_Message('Rewrite mode is off. File URIs may not be accessible.', OntoWiki_Message::WARNING)\n );\n return;\n }\n\n $url->action = 'delete';\n $this->view->formActionUrl = (string)$url;\n $this->view->formMethod = 'post';\n $this->view->formClass = 'simple-input input-justify-left';\n $this->view->formName = 'filemanagement-delete';\n }",
"function com_install() {\n\n\tjimport( 'joomla.filesystem.folder' )\n?>\n\n<center>\n<table cellpadding=\"4\" cellspacing=\"0\" border=\"0\" width=\"100%\" class=\"adminlist\">\n\t<tr>\n\t\t<td valign=\"top\">\n \t \t<strong>RS-Monials</strong> <font class=\"small\">by <a href=\"http://www.rswebsols.com\" target=\"_blank\">RS WEB SOLUTIONS</a><br/>\n \tReleased under the terms and conditions of the <a href=\"http://www.gnu.org/licenses/gpl-2.0.html\" target=\"_blank\">GNU General Public License</a>.</font>\t\t</td>\n\t</tr>\n</table>\n\n</center>\n<?php\n}",
"public function install() {\n $this->load->model($this->module_path);\n\n $this->helper_pricealert->createTables();\n\n $this->__registerEvents();\n }",
"function install($parent) \n\t{\n\t\t$msg = '';\n\t\t\n\t\t$db =& JFactory::getDbo();\n\t\t$sql = \"UPDATE #__extensions \n\t\t\t\tSET enabled='1' \n\t\t\t\tWHERE element='asikart_easyset' ;\" ;\n\t\t$db->setQuery( $sql );\n\t\t$db->query();\n\t\t\n\t\t$this->_createTable();\n\t\t\n\t\t//JFolder::copy( JPATH_PLUGINS.DS.'system'.DS.'asikart_easyset' , JPATH_ROOT.DS.'easyset' , '' , true );\n\t\tJFolder::create( JPATH_ROOT.DS.'easyset' );\n\t\tJFolder::create( JPATH_ROOT.DS.'easyset'.DS.'cmd' );\n\t\t\n\t\t/*\n\t\t$array = array();\n\t\t$array[] = 'onAfterInitialise';\n\t\t$array[] = 'onAfterRoute';\n\t\t$array[] = 'onAfterDispatch';\n\t\t$array[] = 'onAfterRender';\n\t\t$array[] = 'onContentPrepare';\n\t\t$array[] = 'onContentBeforeDisplay';\n\t\t$array[] = 'onContentAfterDisplay';\n\t\t$array[] = 'onContentBeforeTitle';\n\t\t$array[] = 'onContentBeforeSave';\n\t\t$array[] = 'onContentAfterSave';\n\t\t$array[] = 'onContentBeforeDelete';\n\t\t$array[] = 'onContentAfterDelete';\n\t\t$array[] = 'onContentChangeState';\n\t\t\n\t\t$content = \"<\".\"?php \\n\\n\\n?\".\">\" ;\n\t\t\n\t\t$libpath = JPATH_ROOT.DS.'easyset'.DS.'lib'.DS.'events' ;\n\t\tJPath::setPermissions( $libpath , 755 );\n\t\t\n\t\tforeach( $array as $file ) {\n\t\t\tif( JFile::exists( $libpath.DS.$file.'.php' ) )\n\t\t\t\tJFile::write( $libpath.DS.$file.'.php' , $content );\n\t\t}*/\n\t\t\n\t\t$file_list = $this->_copyIncludeFiles();\n\t\tif( $file_list ) $msg .= \"<h3>成功複製檔案</h3><ul>{$file_list}</ul><br /><br />\" ;\n\t\t\n\t\t// direct link\n\t\t$sql = \"SELECT * FROM #__extensions WHERE element='asikart_easyset' ;\" ;\n\t\t$db->setQuery( $sql );\n\t\t$plugin = $db->loadObject() ;\n\t\t$link = 'index.php?option=com_plugins&task=plugin.edit&extension_id='.$plugin->extension_id ;\n\t\t\n\t\t$msg .= \"<p>Easy set 安裝成功。</p>\n\t\t\t\t<h3><a href=\\\"{$link}\\\">進入外掛管理</a></h3>\";\n\t\techo $msg ;\n\t}",
"public function installAction() {\r\n try {\r\n\r\n $db = \\Zend_Db::factory($this->getParam(\"mysql_adapter\"),array(\r\n 'host' => $this->getParam(\"mysql_host\"),\r\n 'username' => $this->getParam(\"mysql_username\"),\r\n 'password' => $this->getParam(\"mysql_password\"),\r\n 'dbname' => $this->getParam(\"mysql_database\"),\r\n \"port\" => $this->getParam(\"mysql_port\")\r\n ));\r\n\r\n $db->getConnection();\r\n\r\n // check utf-8 encoding\r\n $result = $db->fetchRow('SHOW VARIABLES LIKE \"character\\_set\\_database\"');\r\n if ($result['Value'] != \"utf8\") {\r\n $errors[] = \"Database charset is not utf-8\";\r\n }\r\n }\r\n catch (\\Exception $e) {\r\n $errors[] = \"Couldn't establish connection to mysql: \" . $e->getMessage();\r\n }\r\n\r\n // check username & password\r\n if (strlen($this->getParam(\"admin_password\")) < 4 || strlen($this->getParam(\"admin_username\")) < 4) {\r\n $errors[] = \"Username and password should have at least 4 characters\";\r\n }\r\n\r\n if (empty($errors)) {\r\n\r\n $setup = new Tool\\Setup();\r\n\r\n // check if /website folder already exists, if not, look for /website_demo & /website_example\r\n // /website_install is just for testing in dev environment\r\n if(!is_dir(PIMCORE_WEBSITE_PATH)) {\r\n foreach([\"website_install\", \"website_demo\", \"website_example\"] as $websiteDir) {\r\n $dir = PIMCORE_DOCUMENT_ROOT . \"/\" . $websiteDir;\r\n if(is_dir($dir)) {\r\n rename($dir, PIMCORE_WEBSITE_PATH);\r\n break;\r\n }\r\n }\r\n }\r\n\r\n $setup->config(array(\r\n \"database\" => array(\r\n \"adapter\" => $this->getParam(\"mysql_adapter\"),\r\n \"params\" => array(\r\n \"host\" => $this->getParam(\"mysql_host\"),\r\n \"username\" => $this->getParam(\"mysql_username\"),\r\n \"password\" => $this->getParam(\"mysql_password\"),\r\n \"dbname\" => $this->getParam(\"mysql_database\"),\r\n \"port\" => $this->getParam(\"mysql_port\"),\r\n )\r\n ),\r\n ));\r\n\r\n\t\t\t// look for a template dump\r\n\t\t\t// eg. for use with demo installer\r\n\t\t\t$dbDataFile = PIMCORE_WEBSITE_PATH . \"/dump/data.sql\";\r\n\t\t\t$contentConfig = array(\r\n\t\t\t\t\"username\" => $this->getParam(\"admin_username\"),\r\n\t\t\t\t\"password\" => $this->getParam(\"admin_password\")\r\n\t\t\t);\r\n\r\n\t\t\tif(!file_exists($dbDataFile)) {\r\n $setup->database();\r\n \\Pimcore::initConfiguration();\r\n\t\t\t\t$setup->contents($contentConfig);\r\n\t\t\t} else {\r\n\t\t\t\t$setup->insertDump($dbDataFile);\r\n \\Pimcore::initConfiguration();\r\n\t\t\t\t$setup->createOrUpdateUser($contentConfig);\r\n\t\t\t}\r\n\r\n $this->_helper->json(array(\r\n \"success\" => true\r\n ));\r\n }\r\n\r\n else {\r\n echo implode(\"<br />\", $errors);\r\n die();\r\n }\r\n\r\n }",
"function restaurer($rep_sauvegarde,$rep_installation)\n{\n\t/*\n\t* Installation\n\t*/\n\t$cmd = 'cp -rpf '.$rep_sauvegarde.'/* '.$rep_installation;\n\t\n\texec($cmd,$output,$return);\n\tif($return)\n\t\tthrow new Exception('La restauration des fichiers n\\'a pas aboutie ! problème lors de la copie. ');\n}",
"public function install()\n {\n }",
"public function install()\n {\n }",
"public function extProc_init() {}",
"public function extProc_init() {}",
"public function postInstallCmd(){\n\n \\Disco\\manage\\Manager::install();\n\n }",
"public function loadInstaller() {\n\n $objManager = new class_module_packagemanager_manager();\n $arrModules = $objManager->getAvailablePackages();\n\n $this->arrMetadata = array();\n foreach($arrModules as $objOneModule)\n if($objOneModule->getBitProvidesInstaller())\n $this->arrMetadata[] = $objOneModule;\n\n $this->arrMetadata = $objManager->sortPackages($this->arrMetadata, true);\n\n }",
"function on_install_module($module_name) {\n include('application.setup.php');\n return true;\n }",
"public function manualInstallAction()\r\n\t{\r\n\t $helper = Mage::helper('manager');\r\n // initialize the channel model\r\n $chn = Mage::getModel('manager/channel');\r\n // load by given channel_id if there is an id\r\n if ($channel_id = $this->getRequest()->getParam('channel_id')) {\r\n \t$chn->load($channel_id);\r\n \t// set channel name\r\n \t$channelName = $chn->getUrl();\r\n \t// get package name from post data\r\n \t$packageName = $this->getRequest()->getParam('package_name');\r\n \t// try to get package information for given package_name\r\n \t$package = $this->_service->packageInfo(\r\n \t\t$packageName,\r\n \t $channelName\r\n \t);\r\n \tif ($package) {\r\n\t \t// initialize the package model\r\n\t $pkg = Mage::getModel('manager/package');\r\n\t // try to load the package from the database by its name\r\n\t $id = $pkg->loadByName($packageName)->getId();\r\n\t if (empty($id)) {\r\n\t // if the package is new, create it\r\n\t $pkg->setChannelIdFk($chn->getId());\r\n\t $pkg->setName($packageName);\r\n\t $pkg->setSummary($package['summary']);\r\n\t $pkg->setVersionInstalled($package['installed']);\r\n\t if (is_array($package['releases'])) {\r\n\t $pkg->setVersionLatest(\r\n\t reset(\r\n\t array_keys($package['releases'])\r\n\t )\r\n\t );\r\n\t }\r\n\t $pkg->setCreatedTime(now());\r\n\t \t\t\t$pkg->setUpdateTime(now());\r\n\t } else {\r\n\t // if the package already exists update it\r\n\t $pkg->setSummary($package['summary']);\r\n\t $pkg->setVersionInstalled($package['installed']);\r\n\t if (is_array($package['releases'])) {\r\n\t $pkg->setVersionLatest(\r\n\t reset(\r\n\t array_keys($package['releases'])\r\n\t )\r\n\t );\r\n\t }\r\n\t \t\t\t$pkg->setUpdateTime(now());\r\n\t }\r\n\t // set the package state\r\n $pkg->setState($helper->getPackageState($pkg));\r\n // save the package\r\n \t $pkg->save();\r\n \t // set package id to request params\r\n \t $this->getRequest()->setParam('id', $pkg->getId());\r\n \t $this->_forward('install');\r\n \t}\r\n } else {\r\n \tMage::getSingleton('adminhtml/session')->addError(\r\n $helper->__(\r\n '201.error.package-no-id'\r\n )\r\n );\r\n }\r\n // redirect to the licence overview\r\n $this->_redirect('*/*/');\r\n\t}",
"protected static function _processModule()\n {\n //Pour la ligne de commandes\n global $argv;\n\t\t\n // Nom du module à installer\n $module_name = Tools::getValue('module_name');\n\n // Action à effectuer : Par défaut installation\n $action = Tools::getValue('action', 'install');\n\n // Flag pour permettre d'installer le module via github\n $github = Tools::getValue('github', false);\n\n //Gestion via la ligne de commande\n if ($argv) {\n $endOfLine = \"\\n\";\n $allowsKeys = array('module_name','action','github');\n\n foreach ($argv as $arg) {\n $arguments = explode('=', $arg);\n if (in_array($arguments[0], $allowsKeys)) {\n ${$arguments[0]} = $arguments[1];\n }\n }\n\t\t\t\n\t\t\tif ( self::$verbose )\n\t\t\t\techo 'Lancement via la ligne de commande '.self::$endOfLine;\n }\n\n // Si l'action demandéé n'est pas autorisée , on affiche un message d'erreur\n if (!in_array($action, self::$modulesActionsAllowed)) {\n exit('Erreur : action demandée non autorisée'.self::$endOfLine);\n }\n\n //Si le module est disponible sur github\n if ($github) {\n echo 'Tentative de récupération du module depuis github'.self::$endOfLine;\n echo 'Url du dépôt : '.$github.$endOfLine;\n //@ToDO : Récupérer les messages d'erreur + vérifier que shell_exec est autorisé\n shell_exec('git clone '.$github.' '._PS_MODULE_DIR_.$module_name);\n }\n\n if ($module = Module::getInstanceByName($module_name)) {\n\n // Pour les actions enable / disable : il faut s'assurer que le module est installé\n if (($action == 'enable' || $action == 'disable') && !Module::isInstalled($module->name)) {\n exit('Erreur : le module '.$module_name.' n\\'est pas installé. Il ne peut pas être activé / désactivé '.self::$endOfLine);\n }\n\t\t\t\n\t\t\t//Affichage du statut du module (Installé ou non )\n\t\t\tif ( $action =='status' ) {\n\t\t\t\tif ( Module::isInstalled($module->name) )\n\t\t\t\t{\n\t\t\t\t\tif ( self::$verbose )\n\t\t\t\t\t\techo 'Le module '.$module->name.' est bien installé'.self::$endOfLine;\n\t\t\t\t\telse\n\t\t\t\t\t\techo 1;\n\t\t\t\t} else {\n\t\t\t\t\tif ( self::$verbose )\n\t\t\t\t\t\techo 'Le module '.$module->name.' n\\'est pas installé'.self::$endOfLine;\n\t\t\t\t\telse\n\t\t\t\t\t\techo 0;\n\t\t\t\t}\n\t\t\t\texit();\t\n\t\t\t}\n\n // Exécution de l'action du module\n try {\n $module->$action();\n } catch (PrestashopException $e) {\n echo $e->getMessage();\n exit();\n }\n\t\t\t\n\t\t\tif ( self::$verbose )\n\t\t\t\techo 'Module '.$module_name.' action : '.$action.' effectuée avec succès'.self::$endOfLine;\n\t\t\t\t\n } else {\n echo 'Erreur le module '.$module_name.' n\\'existe pas'.self::$endOfLine;\n }\n }",
"function dest_path_and_file()\r\n{ \r\n global $xoopsDB, $xoopsUser;\r\n \r\n // Initialize magic_number. This number is used to create unique file names in order to guarantee that 2 file names\r\n // will not be identical if 2 users upload a file at the exact same time. 100000 will allow almost 100000 users to use\r\n // this system. Ok, the odds of this happening are slim; but, I want the odds to be zero.\r\n $magic_number = 100000; \r\n \r\n // Get the location of the document repository\r\n $query = \"SELECT data from \".$xoopsDB->prefix(\"dms_config\").\" WHERE name='doc_path'\";\r\n $file_sys_root = mysql_result(mysql_query($query),'data');\r\n \r\n // Get the current value of max_file_sys_counter\r\n $query = \"SELECT data from \".$xoopsDB->prefix(\"dms_config\").\" WHERE name='max_file_sys_counter'\";\r\n $max_file_sys_counter = (integer) mysql_result(mysql_query($query),'data');\r\n \r\n // Determine the path and filename of the new file\r\n $query = \"SELECT * from \".$xoopsDB->prefix(\"dms_file_sys_counters\");\r\n $dms_file_sys_counters = mysql_fetch_array(mysql_query($query));\r\n \r\n $file_sys_dir_1 = $dms_file_sys_counters['layer_1'];\r\n $file_sys_dir_2 = $dms_file_sys_counters['layer_2'];\r\n $file_sys_dir_3 = $dms_file_sys_counters['layer_3'];\r\n $file_sys_file = $dms_file_sys_counters['file'];\r\n $file_sys_file_name = ($file_sys_file * $magic_number) + $xoopsUser->getVar('uid');\r\n \r\n $dir_path_1 = $file_sys_root.\"/\".$file_sys_dir_1;\r\n $dir_path_2 = $file_sys_root.\"/\".$file_sys_dir_1.\"/\".$file_sys_dir_2;\r\n $dir_path_3 = $file_sys_root.\"/\".$file_sys_dir_1.\"/\".$file_sys_dir_2.\"/\".$file_sys_dir_3;\r\n \r\n //$doc_path = $file_sys_root.\"/\".$file_sys_dir_1.\"/\".$file_sys_dir_2.\"/\".$file_sys_dir_3;\r\n $path_and_file = $file_sys_dir_1.\"/\".$file_sys_dir_2.\"/\".$file_sys_dir_3.\"/\".$file_sys_file_name;\r\n //$dest_path_and_file = $doc_path.\"/\".$file_sys_file_name;\r\n \r\n //print $path_and_file;\r\n //exit(0);\r\n \r\n // Determine the next file system counter values and save them for future use.\r\n $file_sys_file++;\r\n if ($file_sys_file > $max_file_sys_counter) \r\n {\r\n\t$file_sys_file = 1;\r\n\t$file_sys_dir_3++;\r\n\t} \r\n \r\n if ($file_sys_dir_3 > $max_file_sys_counter)\r\n {\r\n\t$file_sys_dir_3 = 1;\r\n\t$file_sys_dir_2++;\r\n\t}\r\n\t\r\n if ($file_sys_dir_2 > $max_file_sys_counter)\r\n {\r\n\t$file_sys_dir_2 = 1;\r\n\t$file_sys_dir_1++;\r\n\t}\r\n\t\r\n $query = \"UPDATE \".$xoopsDB->prefix(\"dms_file_sys_counters\").\" SET \";\r\n $query .= \"layer_1 = '\".(integer) $file_sys_dir_1.\"', \";\r\n $query .= \"layer_2 = '\".(integer) $file_sys_dir_2.\"', \";\r\n $query .= \"layer_3 = '\".(integer) $file_sys_dir_3.\"', \";\r\n $query .= \"file = '\".(integer) $file_sys_file. \"' \";\r\n \r\n mysql_query($query); \r\n\r\n // Ensure that the final destination directories exist...if not, then create the directory or directories.\r\n if (!is_dir($dir_path_1)) \r\n {\r\n\tmkdir($dir_path_1,0775);\r\n chmod($dir_path_1,0777);\r\n\t}\r\n \r\n if (!is_dir($dir_path_2))\r\n {\r\n\tmkdir($dir_path_2,0775); \r\n chmod($dir_path_2,0777);\r\n }\r\n\t\r\n if (!is_dir($dir_path_3)) \r\n {\r\n\tmkdir($dir_path_3,0775);\r\n chmod($dir_path_3,0777);\r\n\t}\r\n\t\r\n return($path_and_file);\r\n}",
"public function installAction()\r\n\t{\r\n\t try {\r\n \t // run the install command\r\n \t $packageName = $this->_runCommand(\r\n \t $command = Faett_Core_Interfaces_Service::COMMAND_INSTALL\r\n \t );\r\n // attach a message to the session\r\n \t\tMage::getSingleton('adminhtml/session')->addSuccess(\r\n \t\t Mage::helper('adminhtml')->__(\r\n \t\t '201.success.package-install', $packageName\r\n \t\t )\r\n \t\t);\r\n\t } catch(Faett_Manager_Exceptions_InvalidCommandException $ice) {\r\n Mage::getSingleton('adminhtml/session')->addError(\r\n \t\t $ice->getMessage()\r\n \t\t);\r\n\t } catch(Exception $e) {\r\n Mage::getSingleton('adminhtml/session')->addError(\r\n \t\t Mage::helper('manager')->__(\r\n \t\t '900.pear.exception',\r\n \t\t $e->getMessage()\r\n \t\t )\r\n \t\t);\r\n\t }\r\n // redirect to the licence overview\r\n $this->_redirect('*/*/');\r\n\t}",
"public function initialInstall()\n\t\t{\n\t\t\t$installer = $this->getInstaller();\n\t\t\t$installer->newTable($installer->getResourceTable('core/extension'))\n\t\t\t->addColumn('code', $installer::TYPE_TEXT, 50, array(\n\t\t\t\t'nullable' => FALSE,\n\t\t\t\t'default' => '',\n\t\t\t\t'primary' => TRUE,\n\t\t\t\t),'Extension identifier')\n\t\t\t->addColumn('version', $installer::TYPE_TEXT, 50, array(\n\t\t\t\t'nullable' => FALSE,\n\t\t\t\t'default' => '',\n\t\t\t\t),'The currently installed version of this extension')\n\t\t\t->setComment('List of ZeroG installed extensions and their version number');\n\t\t\t$installer->run();\n\t\t}",
"public function install()\n {\n // Set up module config variables\n $this->setVar('ztools_backupsdir', 'userdata/Ztools/backups');\n $this->setVar('ztools_scriptsdir', 'userdata/Ztools/scripts');\n $this->setVar('ztools_scriptssort', '0');\n $this->setVar('ztools_scriptseditor', '1');\n $this->setVar('ztools_showphpinfo', '1');\n $this->setVar('ztools_downloaduseranges', '0');\n $this->setVar('ztools_url_cpanel', '');\n $this->setVar('ztools_url_phpmyadmin', '');\n $this->setVar('ztools_exportmethod', '2');\n $this->setVar('ztools_exportcompress', '0');\n $this->setVar('ztools_expmethodshow', '1');\n $this->setVar('ztools_mysqldumpexe', '');\n\n // Register hooks\n HookUtil::registerSubscriberBundles($this->version->getHookSubscriberBundles());\n\n return true;\n }",
"public static function installToolEnableFileExists() {}",
"public function actionGenerateAllFile() {\n\t\t\n\t\tDhcp::generateFileAll();\n\t}",
"public function tinymceFileManagerAction()\n {\n $view = $this->init();\n $view->setTemplate('el-finder/index/tinymce-file-manager.phtml');\n return $view;\n }",
"protected function install(){ return true;}",
"abstract public function install_OSF_Drupal();",
"private function makePackage($files, $sword_metadata, $arr, $userid,$assigid ) \n {\n global $CFG,$DB;\n require_once('api/packager_mets_swap.php');\n \n $user=$DB->get_record('user', array('id' => $userid));\n $assignment=$DB->get_record('assignment',array('id'=> $assigid ));\n \n \n // add context metadata \n \n $datos=array(\n \"author\" => $user->firstname . ' '. $user->lastname,\n \"title\" => $assignment->name . ' ' . $user->lastname,\n \"rootin\" => sys_get_temp_dir(), \n \"dirin\" => 'moodle',\n \"rootout\" => sys_get_temp_dir().'/moodle',\n\t\"fileout\" => basename(tempnam(sys_get_temp_dir(), 'sword_').'.zip')\n\t);\n \n $filesdata=array();\n foreach ($files as $file){\n\t $filesdata[] = array (\n\t \"filename\" => $file->get_filename(),\n\t \"mimetype\" => $file->get_mimetype(),\n\t );\n \n }\n \n $datos[\"files\"]=$filesdata;\n \n \n // add default metadata\n \n \n if (($arr!=NULL) && ($sword_metadata->subject != NULL)) { \n $arr[]=$sword_metadata->subject; \n $datos[\"subject\"]=$arr;\n } else {\n if ($arr!=NULL) {\n\t $datos[\"subject\"]=array($arr);\n }\n if ($sword_metadata->subject != NULL) {\n\t $datos[\"subject\"]=array($sword_metadata->subject);\n }\n\t \n }\n \n if($sword_metadata->rights != NULL) {\n $datos[\"rights\"]=$sword_metadata->rights;\n\t error_log(\"hasta aca bien\");\n }\n\telse{\n\t\terror_log(\"no se tomo el campo rights del formulario\");\t\n\t}\n \n if($sword_metadata->language != NULL) {\n $datos[\"language\"]= $sword_metadata->language;\n }\n\telse{\n\t\terror_log(\"no se tomo el campo lenguaje del formulario\");\t\n\t}\n \n if($sword_metadata->publisher != NULL) {\n $datos[\"publisher\"]=$sword_metadata->publisher;\n }\n\t else{\n\t\terror_log(\"no se tomo el campo publicador del formulario\");\t\n\t}\n \n \n $this->makeMets($datos);\n \n return $datos[\"rootout\"].'/'.$datos[\"fileout\"];\n }",
"function tools($hyphaServer) {\n\t\tglobal $errorMessage;\n\t\tswitch($_POST['command']) {\n\t\t\tcase 'add':\n\t\t\t\t$data = gzdecode(base64_decode(file_get_contents($hyphaServer.'?file='.$_POST['argument'])));\n\t\t\t\tif ($data) {\n\t\t\t\t\tfile_put_contents($_POST['argument'], $data);\n\t\t\t\t\tchmod($_POST['argument'], 0664);\n\t\t\t\t}\n\t\t\t\telse $errorMessage.= 'file transfer failed<br/>';\n\t\t\t\tbreak;\n\t\t\tcase 'remove':\n\t\t\t\tunlink($_POST['argument']);\n\t\t\t\tbreak;\n\t\t}\n\t\t$localIndex = index();\n\t\t$serverIndex = unserialize(file_get_contents($hyphaServer.'?file=index'));\n\t\tksort($serverIndex);\n\t\tob_start();\n?>\n\t\t\t<div style=\"width:600px;\">\n\t\t\t\t<input type=\"submit\" name=\"command\" value=\"back\" style=\"float:right;\" />\n\t\t\t\t<h1>hypha system tools</h1>\n\t\t\t\tHere you can manage the files of your hypha configuration.\n\t\t\t\t<ul>\n\t\t\t\t\t<li><b>install</b> install a (datatype) module that available on the hypha server but is currently not installed on your system.</li>\n\t\t\t\t\t<li><b>remove</b> remove a (datatype) module that is currently installed on your system.</li>\n\t\t\t\t\t<li><b>update</b> update a file on your system with a newer version available from the hypha server.</li>\n\t\t\t\t\t<li><b>reset</b> your file is newer than the version on the hypha server. You can use this option to revert to the older version. This can be useful when a file got broken or some css code was messed up.</li>\n\t\t\t\t</ul>\n\t\t\t</div>\n\t\t\t<table class=\"section\">\n\t\t\t\t<tr><th style=\"text-align:left\">file</th><th colspan=\"2\">action</th></tr>\n<?php\n\t\tforeach ($serverIndex as $file => $info) {\n\t\t\techo '<tr><td style=\"white-space:nowrap;\">'.$file.'</td>';\n\t\t\tif (array_key_exists($file, $localIndex)) {\n\t\t\t\techo '<td><input type=\"button\" value=\"'.($localIndex[$file] < $serverIndex[$file] ? 'update' : 'reset').'\" onclick=\"hypha(\\'add\\', \\''.$file.'\\');\" /></td>';\n\t\t\t\t$path = pathinfo($file);\n\n\t\t\t\t$dir = explode('/', $path['dirname']);\n\t\t\t\twhile (isset($dir[0]) && $dir[0] == '.') array_shift($dir);\n\t\t\t\t$level0 = isset($dir[0]) ? $dir[0] : false;\n\t\t\t\t$level1 = isset($dir[1]) ? $dir[1] : false;\n\t\t\t\tif ($level0 == 'system' && ($level1=='datatypes' || $level1=='languages') && $path['basename']!='settings.php')\n\t\t\t\techo '<td><input type=\"button\" value=\"remove\" onclick=\"hypha(\\'remove\\', \\''.$file.'\\');\" /></td>';\n\t\t\t\telse echo '<td></td>';\n\t\t\t}\n\t\t\telse echo '<td></td><td><input type=\"button\" value=\"install\" onclick=\"hypha(\\'add\\', \\''.$file.'\\');\" /></td>';\n\t\t\techo '</tr>';\n\t\t}\n\t\techo '</table>';\n\t\treturn ob_get_clean();\n\t}",
"function install(){}",
"public function actionProductUpdateUsingFile()\n\t{\n\t\t$filePath = Yii::getAlias('@webroot').'/frontend/modules/walmart/filestorage/product/update';\n\t\t$files = scandir($filePath);\n\t\tforeach($files as $file){\n\t\t\t$fullFilePath = $filePath.'/'.$file;;\n\t\t\tif(!is_dir($fullFilePath)){\n\t\t\t\t$storedData = require $fullFilePath;\n\t\t\t\t$merchant_id = str_replace('.php','',$file);\n\t\t\t\t$xmlDir = $filePath.'/xml/'.$merchant_id;\n\t\t\t\tif (!file_exists($xmlDir)) {\n\t\t mkdir($xmlDir, 0775, true);\n\n\t\t }\n\t\t $xmlFile = $xmlDir. '/MPProduct-' . time() . '.xml';\n\t\t $xml = new Generator();\n $xml->arrayToXml($storedData)->save($xmlFile);\n Walmartapi::unEscapeData($xmlFile);\n $walmartConfig = Data::sqlRecords(\"SELECT `consumer_id`,`secret_key`,`consumer_channel_type_id` FROM `walmart_configuration` WHERE merchant_id='\".$merchant_id.\"'\",'one','select');\n $walmartApi = new Walmartapi($walmartConfig['consumer_id'],$walmartConfig['secret_key']);\n $response = $walmartApi->postRequest(Walmartapi::GET_FEEDS_ITEMS_SUB_URL, ['file' => $xmlFile]);\n $response = str_replace('ns2:', \"\", $response);\n\n $responseArray = [];\n $responseArray = Walmartapi::xmlToArray($response);\n if (isset($responseArray['FeedAcknowledgement'])) {\n $result = [];\n unlink($fullFilePath);\n $feedId = isset($responseArray['FeedAcknowledgement']['feedId']) ? $responseArray['FeedAcknowledgement']['feedId'] : '';\n if ($feedId != '') {\n $result = $walmartApi->getFeeds($feedId);\n if (isset($results['results'][0], $results['results'][0]['itemsSucceeded']) && $results['results'][0]['itemsSucceeded'] == 1) {\n $result = ['feedId' => $feedId, 'feed_file' => $xmlFile];\n }\n $result = ['feedId' => $feedId, 'feed_file' => $xmlFile];\n }\n } elseif ($responseArray['errors']) {\n $error['feedError'] = $responseArray['errors'];\n }\n\t\t \n\t\t\t}\n\t\t\t\n\t\t}\n\t\tdie;\n\t}",
"function com_install() {\n\tglobal $mosConfig_absolute_path;\n\tmkdir($mosConfig_absolute_path . '/mambots/ajax');\n}",
"function execModule() {\n if ($this->hasPerm(1, TRUE)) {\n include_once(dirname(__FILE__).\"/papaya_calendar.php\");\n $calendar = new papaya_calendar;\n $calendar->module = &$this;\n $calendar->images = &$this->images;\n $calendar->msgs = &$this->msgs;\n $calendar->authUser = &$this->authUser;\n $calendar->layout = &$this->layout;\n $calendar->showEdit = TRUE;\n $calendar->initialize('cal', $this->authUser->userId);\n $calendar->execute();\n $calendar->getXML();\n }\n }",
"abstract public function installPhp();",
"public function code_pack_install()\n\t{\n\t\t$prefix = trim((string) ee()->input->get_post('prefix'));\n\n\t\tif ($prefix === '')\n\t\t{\n\t\t\tee()->functions->redirect($this->base . '&method=code_pack');\n\t\t}\n\n\t\t// -------------------------------------\n\t\t//\tload lib\n\t\t// -------------------------------------\n\n\t\t$lib_name = str_replace('_', '', $this->lower_name) . 'codepack';\n\t\t$load_name = str_replace(' ', '', ucwords(str_replace('_', ' ', $this->lower_name))) . 'CodePack';\n\n\t\tee()->load->library($load_name, $lib_name);\n\t\tee()->$lib_name->autoSetLang = true;\n\n\t\t// -------------------------------------\n\t\t//\t¡Las Variables en vivo! ¡Que divertido!\n\t\t// -------------------------------------\n\n\t\t$variables = array();\n\n\t\t$variables['code_pack_name']\t= $this->lower_name . '_code_pack';\n\t\t$variables['code_pack_path']\t= $this->addon_path . 'code_pack/';\n\t\t$variables['prefix']\t\t\t= $prefix;\n\n\t\t// -------------------------------------\n\t\t//\tinstall\n\t\t// -------------------------------------\n\n\t\t$details = ee()->$lib_name->getCodePackDetails($this->addon_path . 'code_pack/');\n\n\t\t$this->cached_vars['code_pack_name'] = $details['code_pack_name'];\n\t\t$this->cached_vars['code_pack_label'] = $details['code_pack_label'];\n\n\t\t$return = ee()->$lib_name->installCodePack($variables);\n\n\t\t$this->cached_vars = array_merge($this->cached_vars, $return);\n\n\t\t//--------------------------------------\n\t\t// menus and page content\n\t\t//--------------------------------------\n\n\t\t$this->cached_vars['module_menu_highlight'] = 'module_demo_templates';\n\n\t\t$this->add_crumb(lang('demo_templates'), $this->base . '&method=code_pack');\n\t\t$this->add_crumb(lang('install_demo_templates'));\n\n\t\t//$this->cached_vars['current_page'] = $this->view('code_pack_install.html', NULL, TRUE);\n\n\t\t//---------------------------------------------\n\t\t// Load Homepage\n\t\t//---------------------------------------------\n\n\t\treturn $this->ee_cp_view('code_pack_install.html');\n\t}",
"public function setSqlFileToInstall() {\n\t\t$this->aSqlFileToInstall = array(\n\t\t\t'1.0' => 'install.sql'\n\t\t);\n\t}",
"private function load_OSF_OntologiesManagementTool()\n {\n // Get package info\n $dataPath = \"{$this->data_folder}\";\n $cwdPath = rtrim($this->currentWorkingDirectory, '/');\n $tmpPath = \"/tmp/osf/omt\";\n\n // Download\n $this->span(\"Downloading the core OSF ontologies...\", 'info');\n $this->mkdir(\"{$tmpPath}/\");\n $this->wget(\"https://raw.github.com/structureddynamics/Ontologies-Open-Semantic-Framework/master/aggr/aggr.owl\", \"{$tmpPath}/\");\n $this->wget(\"https://raw.github.com/structureddynamics/Ontologies-Open-Semantic-Framework/master/iron/iron.owl\", \"{$tmpPath}/\");\n $this->wget(\"https://raw.github.com/structureddynamics/Ontologies-Open-Semantic-Framework/master/owl/owl.rdf\", \"{$tmpPath}/\");\n $this->wget(\"https://raw.github.com/structureddynamics/Ontologies-Open-Semantic-Framework/master/rdf/rdf.xml\", \"{$tmpPath}/\");\n $this->wget(\"https://raw.github.com/structureddynamics/Ontologies-Open-Semantic-Framework/master/rdf/rdfs.xml\", \"{$tmpPath}/\");\n $this->wget(\"https://raw.github.com/structureddynamics/Ontologies-Open-Semantic-Framework/master/sco/sco.owl\", \"{$tmpPath}/\");\n $this->wget(\"https://raw.github.com/structureddynamics/Ontologies-Open-Semantic-Framework/master/wgs84/wgs84.owl\", \"{$tmpPath}/\");\n $this->wget(\"https://raw.github.com/structureddynamics/Ontologies-Open-Semantic-Framework/master/wsf/wsf.owl\", \"{$tmpPath}/\");\n $this->wget(\"https://raw.github.com/structureddynamics/Ontologies-Open-Semantic-Framework/master/drupal/drupal.owl\", \"{$tmpPath}/\");\n\n // Install\n $this->span(\"Installing the core OSF ontologies...\", 'info');\n $this->cp(\"{$tmpPath}/.\", \"{$dataPath}/ontologies/files/\", TRUE);\n $this->cp(\"{$cwdPath}/resources/osf-web-services/classHierarchySerialized.srz\", \"{$dataPath}/ontologies/structure/\");\n $this->cp(\"{$cwdPath}/resources/osf-web-services/propertyHierarchySerialized.srz\", \"{$dataPath}/ontologies/structure/\");\n $this->cp(\"{$cwdPath}/resources/osf-web-services/ontologies.lst\", \"{$dataPath}/ontologies/\");\n $this->sed(\"file://localhost/data\", \"file://localhost/\".trim($dataPath, '/').\"/\",\n \"{$dataPath}/ontologies/ontologies.lst\", \"g\");\n $this->span(\"Loading the core OSF ontologies...\", 'info');\n $this->exec(\"omt --load-advanced-index=\\\"true\\\" --load-all --load-list=\\\"{$dataPath}/ontologies/ontologies.lst\\\" --osf-web-services=\\\"http://{$this->osf_web_services_domain}/ws/\\\"\");\n $this->span(\"Creating underlying ontological structures...\", 'info');\n $this->exec(\"omt --generate-structures=\\\"{$dataPath}/ontologies/structure/\\\" --osf-web-services=\\\"http://{$this->osf_web_services_domain}/ws/\\\"\");\n\n // Cleanup\n $this->span(\"Cleaning...\", 'info');\n $this->rm(\"{$tmpPath}/\", TRUE);\n }",
"function Stock_toolkit_files(){\n \n \n \n}",
"function view_mods()\n\t{\n\t\t//-----------------------------------------\n\t\t// Page Info\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->admin->page_title = \"(FSY23) Universal Mod Installer: Manage Mod Installations\";\n\t\t$this->ipsclass->admin->page_detail = \"Install, upgrade, and uninstall all compatible mods\";\n\t\t$this->ipsclass->admin->nav[] = array( '', 'Manage Mod Installations' );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Instantiate some arrays\n\t\t//-----------------------------------------\n\t\t\n\t\t$installable_mods = array();\n\t\t$installed_names = array();\n\t\t$installed_info = array();\n\t\t\n\t\t//-----------------------------------------\n\t\t// Page jump stuff\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $this->ipsclass->input['st'] > 0 )\n\t\t{\n\t\t\t$first = intval( $this->ipsclass->input['st'] );\n\t\t}\n\t\t\n\t\t$this->ipsclass->vars['umi_mods_perpage'] = ( $this->ipsclass->vars['umi_mods_perpage'] ) ? $this->ipsclass->vars['umi_mods_perpage'] : 10;\n\t\t\n\t\t//-----------------------------------------\n\t\t// Does PHP have CURL available?\n\t\t//-----------------------------------------\n\t\t\n\t\t$can_curl = function_exists( 'curl_init' );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Make sure we have a mod_install directory\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( !file_exists( ROOT_PATH.\"mod_install/\" ) )\n\t\t{\n\t\t\tif ( !@mkdir( ROOT_PATH.\"mod_install/\", 0755 ) )\n\t\t\t{\n\t\t\t\t$this->ipsclass->admin->error( \"You have no ./mod_install directory. Please create this directory using your FTP program, and ensure the CHMOD is set to 755.\" );\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Look for any installer files\n\t\t//-----------------------------------------\n\t\t\n\t\t$path = ROOT_PATH.\"mod_install/\";\n\t\t$files = array();\n\t\t\n\t\tif ( $handle = opendir( $path ) )\n\t\t{\n\t\t\twhile ( false !== ( $file = readdir( $handle ) ) )\n\t\t\t{\n\t\t\t\t$ext = preg_replace( \"/^.*\\.(\\S+)$/\", \"\\\\1\", $file );\n\t\t\t\t\n\t\t\t\tif ( $ext == \"xml\" )\n\t\t\t\t{\n\t\t\t\t\t$files[] = $file;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tclosedir( $handle );\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Do we have any files to look at?\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( count( $files ) )\n\t\t{\n\t\t\tforeach ( $files as $k => $v )\n\t\t\t{\n\t\t\t\t$this->ipsclass->xml->xml_parse_document( file_get_contents( ROOT_PATH.\"mod_install/\".$v ) );\n\t\t\t\t\n\t\t\t\tif ( !is_array( $this->ipsclass->xml->xml_array['mod_data'] ) )\n\t\t\t\t{\n\t\t\t\t\t$this->ipsclass->admin->error( \"There was an error reading the XML file '$v' in your mod_install directory. Please correct the problem before continuing.\" );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$themod = array();\n\t\t\t\t$temp = $this->ipsclass->xml->xml_array['mod_data']['mod_info'];\n\t\t\t\t\n\t\t\t\t$themod['title'] = $temp['title']['VALUE'];\n\t\t\t\t$themod['version'] = $temp['version']['VALUE'];\n\t\t\t\t$themod['author'] = $temp['author']['VALUE'];\n\t\t\t\t$themod['website'] = $temp['website']['VALUE'];\n\t\t\t\t$themod['file'] = str_replace( \".xml\", \"\", $v );\n\t\t\t\t$themod['ipbver'] = $temp['ipbver']['VALUE'];\n\t\t\t\t$themod['version_file'] = $temp['version_file']['VALUE'];\n\t\t\t\t\n\t\t\t\t$key = strtolower( $temp['title']['VALUE'] );\n\t\t\t\t$key = str_replace( \" \", \"_\", $key );\n\t\t\t\t\n\t\t\t\tif ( $themod['title'] != \"\" && in_array( $themod['ipbver'], array( '2.2', '2.3' ) ) )\n\t\t\t\t{\n\t\t\t\t\t$installable_mods[str_replace( '.', '', $themod['ipbver'])][ $key ] = $themod;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tforeach ( $installable_mods as $ver => $mods )\n\t\t\t{\n\t\t\t\tksort( $installable_mods[ $ver ] );\n\t\t\t}\n\t\t\t\n\t\t\t$new_mods = $installable_mods;\n\t\t\tunset( $installable_mods );\n\t\t\t$installable_mods = array();\n\t\t\t\n\t\t\tforeach ( $new_mods as $version => $itsmods )\n\t\t\t{\n\t\t\t\t$new_index = 0;\n\t\t\t\t\n\t\t\t\tforeach ( $itsmods as $key => $mod )\n\t\t\t\t{\n\t\t\t\t\t$installable_mods[ $version ][ $new_index++ ] = $mod;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Let's find what the latest mods are\n\t\t//-----------------------------------------\n\t\t\n\t\t$latest_mods = array();\n\t\t$latest_umi = 0;\n\t\t$link = base64_decode( \"aHR0cDovL3d3dy5pbnZpc2lvbm1vZGRpbmcuY29tL3VtaS9tb2RzLnhtbA==\" );\n\t\t$mod_files = array();\n\t\t$file_contents = \"\";\n\t\t\n\t\tif ( $this->ipsclass->vars['umi_do_callbacks'] )\n\t\t{\n\t\t\tif ( $can_curl )\n\t\t\t{\n\t\t\t\t$ch = curl_init();\n\t\t\t\t\n\t\t\t\tcurl_setopt( $ch, CURLOPT_URL, $link );\n\t\t\t\tcurl_setopt( $ch, CURLOPT_HEADER, 0 );\n\t\t\t\tcurl_setopt( $ch, CURLOPT_TIMEOUT, 3 );\n\t\t\t\t\n\t\t\t\tob_start();\n\t\t\t\t\n\t\t\t\tcurl_exec( $ch );\n\t\t\t\tcurl_close( $ch );\n\t\t\t\t$file_contents = ob_get_contents();\n\t\t\t\t\n\t\t\t\tob_end_clean();\n\t\t\t}\n\t\t\t\n\t\t\tif ( !$file_contents )\n\t\t\t{\n\t\t\t\t$handle = @fopen( $link, \"r\" );\n\t\t\t\t\t\n\t\t\t\tif ( $handle !== false )\n\t\t\t\t{\n\t\t\t\t\t@fclose( $handle );\n\t\t\t\t\t$file_contents = @file_get_contents( $link );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ( $file_contents )\n\t\t{\n\t\t\t$this->ipsclass->xml->xml_parse_document( $file_contents );\n\t\t\t\n\t\t\tif ( is_array( $this->ipsclass->xml->xml_array['mods']['ipb22']['mod'] ) )\n\t\t\t{\n\t\t\t\tforeach ( $this->ipsclass->xml->xml_array['mods']['ipb22']['mod'] as $k => $v )\n\t\t\t\t{\n\t\t\t\t\t$latest_mods[22][ $v['file']['VALUE'] ] = $v['version']['VALUE'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\tif ( is_array( $this->ipsclass->xml->xml_array['mods']['ipb23']['mod'] ) )\n\t\t\t{\n\t\t\t\tforeach ( $this->ipsclass->xml->xml_array['mods']['ipb23']['mod'] as $k => $v )\n\t\t\t\t{\n\t\t\t\t\t$latest_mods[23][ $v['file']['VALUE'] ] = $v['version']['VALUE'];\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$latest_umi = $this->ipsclass->xml->xml_array['mods']['umi']['VALUE'];\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Build the mods table\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Mod Title\" , \"40%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Version\" , \"10%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Author\" , \"15%\" );\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Installed?\" , \"10%\" );\n\t\t\n\t\tif ( $this->ipsclass->vars['umi_do_callbacks'] )\n\t\t{\n\t\t\t$this->ipsclass->adskin->td_header[] = array( \"Up To Date?\" , \"15%\" );\n\t\t}\n\t\t\n\t\t$this->ipsclass->adskin->td_header[] = array( \"Options\" , \"10%\" );\n\t\t\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Available Modifications\" );\n\t\t\n\t\t//-----------------------------------------\n\t\t// What mods are we displaying?\n\t\t//-----------------------------------------\n\t\t\n\t\t$to_display = array();\n\t\t$i = 0;\n\t\t\n\t\tforeach ( $installable_mods as $a => $b )\n\t\t{\n\t\t\tforeach ( $b as $c => $d )\n\t\t\t{\n\t\t\t\t$to_display[ $i++ ] = $d;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Get the latest info for these mods\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( count( $to_display ) )\n\t\t{\n\t\t\tforeach ( $to_display as $idx => $mod )\n\t\t\t{\n\t\t\t\tif ( $idx < $first )\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( $idx >= $first + $this->ipsclass->vars['umi_mods_perpage'] )\n\t\t\t\t{\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( $mod['version_file'] && !in_array( $mod['version_file'], $mod_files ) )\n\t\t\t\t{\n\t\t\t\t\t$mod_files[] = $mod['version_file'];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ( $this->ipsclass->vars['umi_do_callbacks'] && count( $mod_files ) )\n\t\t{\n\t\t\tforeach ( $mod_files as $mod_file )\n\t\t\t{\n\t\t\t\tif ( $can_curl )\n\t\t\t\t{\n\t\t\t\t\t$ch = curl_init();\n\t\t\t\t\t\n\t\t\t\t\tcurl_setopt( $ch, CURLOPT_URL, $mod_file );\n\t\t\t\t\tcurl_setopt( $ch, CURLOPT_HEADER, 0 );\n\t\t\t\t\tcurl_setopt( $ch, CURLOPT_TIMEOUT, 3 );\n\t\t\t\t\t\n\t\t\t\t\tob_start();\n\t\t\t\t\t\n\t\t\t\t\tcurl_exec( $ch );\n\t\t\t\t\tcurl_close( $ch );\n\t\t\t\t\t$version_contents = ob_get_contents();\n\t\t\t\t\t\n\t\t\t\t\tob_end_clean();\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( !$version_contents )\n\t\t\t\t{\n\t\t\t\t\t$handle = @fopen( $mod_file, \"r\" );\n\t\t\t\t\t\n\t\t\t\t\tif ( $handle !== false )\n\t\t\t\t\t{\n\t\t\t\t\t\t@fclose( $handle );\n\t\t\t\t\t\t$version_contents = @file_get_contents( $mod_file );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ( $version_contents )\n\t\t\t\t{\n\t\t\t\t\t$this->ipsclass->xml->xml_parse_document( $version_contents );\n\t\t\t\t\t\n\t\t\t\t\tif ( !is_array( $this->ipsclass->xml->xml_array['mods']['ipb22']['mod'][0] ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$tmp = $this->ipsclass->xml->xml_array['mods']['ipb22']['mod'];\n\t\t\t\t\t\tunset( $this->ipsclass->xml->xml_array['mods']['ipb22']['mod'] );\n\t\t\t\t\t\t$this->ipsclass->xml->xml_array['mods']['ipb22']['mod'][0] = $tmp;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tif ( !is_array( $this->ipsclass->xml->xml_array['mods']['ipb23']['mod'][0] ) )\n\t\t\t\t\t{\n\t\t\t\t\t\t$tmp = $this->ipsclass->xml->xml_array['mods']['ipb23']['mod'];\n\t\t\t\t\t\tunset( $this->ipsclass->xml->xml_array['mods']['ipb23']['mod'] );\n\t\t\t\t\t\t$this->ipsclass->xml->xml_array['mods']['ipb23']['mod'][0] = $tmp;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tforeach ( $this->ipsclass->xml->xml_array['mods']['ipb22']['mod'] as $kk => $vv )\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( !in_array( $vv['file']['VALUE'], array_keys( $latest_mods ) ) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$latest_mods[22][ $vv['file']['VALUE'] ] = $vv['version']['VALUE'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\tforeach ( $this->ipsclass->xml->xml_array['mods']['ipb23']['mod'] as $kk => $vv )\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( !in_array( $vv['file']['VALUE'], array_keys( $latest_mods ) ) )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$latest_mods[23][ $vv['file']['VALUE'] ] = $vv['version']['VALUE'];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// What mods do we have installed?\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->DB->build_query( array( 'select' => '*',\n\t\t\t\t\t\t\t\t\t\t\t\t 'from' => 'installed_mods',\n\t\t\t\t\t\t\t\t\t\t\t\t 'order' => 'm_name',\n\t\t\t\t\t\t\t\t\t\t)\t );\n\t\t$this->ipsclass->DB->exec_query();\n\t\t\n\t\tif ( $this->ipsclass->DB->get_num_rows() )\n\t\t{\n\t\t\twhile ( $r = $this->ipsclass->DB->fetch_row() )\n\t\t\t{\n\t\t\t\t$installed_names[] = $r['m_name'];\n\t\t\t\t$installed_info[ str_replace( \" \", \"_\", $r['m_name'] ) ] = $r;\n\t\t\t}\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// OK, let's show some mods\n\t\t//-----------------------------------------\n\t\t\n\t\tforeach ( $to_display as $k => $v )\n\t\t{\n\t\t\t//-----------------------------------------\n\t\t\t// Page jump stuff\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tif ( $k < $first )\n\t\t\t{\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tif ( $k >= $first + $this->ipsclass->vars['umi_mods_perpage'] )\n\t\t\t{\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Possible row entries\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$title = \"<strong>{$v['title']}</strong>\";\n\t\t\t$version = \"<div align='center'>v{$v['version']}</div>\";\n\t\t\t$author = \"<div align='center'><a href='{$v['website']}' target='_blank'>{$v['author']}</a></div>\";\n\t\t\t$outdated = \"<div align='center'><img src='{$this->ipsclass->skin_acp_url}/images/memsearch_delete.gif' border='0' title='Out of Date, you have v<!--VERSION--> installed' /></div>\";\n\t\t\t$installed = \"<div align='center'><img src='{$this->ipsclass->skin_acp_url}/images/aff_tick.png' border='0' title='Installed' /></div>\";\n\t\t\t$problem = \"<div align='center'><img src='{$this->ipsclass->skin_acp_url}/images/acp_trashcan.gif' border='0' title='There was a problem completing a previous installation, it is recommended that you uninstall this mod' /></div>\";\n\t\t\t$not_ins = \"<div align='center'><img src='{$this->ipsclass->skin_acp_url}/images/aff_cross.png' border='0' title='Not Installed' /></div>\";\n\t\t\t$upd_avail = \"<div align='center'><img src='{$this->ipsclass->skin_acp_url}/images/aff_cross.png' border='0' title='An update to this mod is available!' /></div>\";\n\t\t\t$uptodate = \"<div align='center'><img src='{$this->ipsclass->skin_acp_url}/images/aff_tick.png' border='0' title='You have the latest version of this mod installed!' /></div>\";\n\t\t\t$unknown = \"<div align='center'><img src='{$this->ipsclass->skin_acp_url}/images/memsearch_delete.gif' border='0' title='Unknown' /></div>\";\n\t\t\t$options = \"<div align='center'><img id='menu{$v['file']}' src='{$this->ipsclass->skin_acp_url}/images/filebrowser_action.gif' border='0' title='Options' class='ipd' /></div>\";\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Possible install options\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$opts = \"\";\n\t\t\t$opts_1 = \"img_add + \\\" <a href='{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=install&mod={$v['file']}&st={$this->ipsclass->input['st']}'>Upgrade...</a>\\\",\nimg_delete + \\\" <a href='{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=install&mod={$v['file']}&un=1&st={$this->ipsclass->input['st']}'>Uninstall...</a>\\\"\";\n\t\t\t$opts_2 = \"img_add + \\\" <a href='{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=install&mod={$v['file']}&st={$this->ipsclass->input['st']}'>Reinstall...</a>\\\",\nimg_delete + \\\" <a href='{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=install&mod={$v['file']}&un=1&st={$this->ipsclass->input['st']}'>Uninstall...</a>\\\"\";\n\t\t\t$opts_3 = \"img_delete + \\\" <a href='{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=install&mod={$v['file']}&un=1&st={$this->ipsclass->input['st']}'>Uninstall...</a>\\\"\";\n\t\t\t$opts_4 = \"img_add + \\\" <a href='{$this->ipsclass->base_url}&{$this->ipsclass->form_code}&code=install&mod={$v['file']}&st={$this->ipsclass->input['st']}'>Install...</a>\\\"\";\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Our different possibilities\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tif ( in_array( $v['title'], $installed_names ) )\n\t\t\t{\n\t\t\t\t$mod_info = $installed_info[ str_replace( \" \", \"_\", $v['title'] ) ];\n\t\t\t\t\n\t\t\t\tif ( $mod_info['m_started'] == 1 )\n\t\t\t\t{\n\t\t\t\t\tif ( $mod_info['m_finished'] == 1 )\n\t\t\t\t\t{\n\t\t\t\t\t\tif ( $mod_info['m_version'] < $v['version'] )\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$opts = $opts_1;\n\t\t\t\t\t\t\t$outdated = str_replace( \"<!--VERSION-->\", $mod_info['m_version'], $outdated );\n\t\t\t\t\t\t\t$data = ( $this->ipsclass->vars['umi_do_callbacks'] ) ? array( $title, $version, $author, $outdated, $upd_avail, $options ): array( $title, $version, $author, $outdated, $options );\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$ipbver = str_replace( '.', '', $v['ipbver'] );\n\t\t\t\t\t\t\tif ( isset( $latest_mods[ $ipbver ][ $v['file'] ] ) )\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tif ( $latest_mods[ $ipbver ][ $v['file'] ] > $v['version'] )\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$uptodate = $upd_avail;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$uptodate = $unknown;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$opts = $opts_2;\n\t\t\t\t\t\t\t$data = ( $this->ipsclass->vars['umi_do_callbacks'] ) ? array( $title, $version, $author, $installed, $uptodate, $options ) : array( $title, $version, $author, $installed, $options );\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$opts = $opts_3;\n\t\t\t\t\t\t$data = ( $this->ipsclass->vars['umi_do_callbacks'] ) ? array( $title, $version, $author, $problem, $unknown, $options ) : array( $title, $version, $author, $problem, $options );\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\tif ( $mod_info['m_finished'] == 1 )\n\t\t\t\t\t{\n\t\t\t\t\t\t$opts = $opts_3;\n\t\t\t\t\t\t$data = ( $this->ipsclass->vars['umi_do_callbacks'] ) ? array( $title, $version, $author, $problem, $unknown, $options ) : array( $title, $version, $author, $problem, $options );\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$opts = $opts_4;\n\t\t\t\t\t\t$data = ( $this->ipsclass->vars['umi_do_callbacks'] ) ? array( $title, $version, $author, $not_ins, $not_ins, $options ) : array( $title, $version, $author, $not_ins, $options );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$opts = $opts_4;\n\t\t\t\t$data = ( $this->ipsclass->vars['umi_do_callbacks'] ) ? array( $title, $version, $author, $not_ins, $not_ins, $options ) : array( $title, $version, $author, $not_ins, $options );\n\t\t\t}\n\t\t\t\n\t\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( $data );\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Add the file options\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\t$this->ipsclass->html .=\"<script type=\\\"text/javascript\\\">\n menu_build_menu(\n \\\"menu{$v['file']}\\\",\n new Array( \".$opts.\"\n\t\t ) );\n </script>\n\";\n\t\t}\n\t\t\n\t\t//-----------------------------------------\n\t\t// Page Jump\n\t\t//-----------------------------------------\n\t\t\n\t\t$pages = $this->ipsclass->adskin->build_pagelinks( array( 'TOTAL_POSS' => count( $to_display ),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'PER_PAGE' => $this->ipsclass->vars['umi_mods_perpage'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'CUR_ST_VAL' => $first,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'L_SINGLE' => \"\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'L_MULTI' => \"Pages: \",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'BASE_URL' => $this->ipsclass->base_url.\"&\".$this->ipsclass->form_code.\"&code=view\",\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t ) );\n\t\t\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_basic( $pages, 'right', 'tablerow2' );\n\t\t\n\t\t//-----------------------------------------\n\t\t// Finish the table\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\t\t\n\t\t//-----------------------------------------\n\t\t// Make sure UMI is up to date\n\t\t//-----------------------------------------\n\t\t\n\t\tif ( $this->ipsclass->vars['umi_do_callbacks'] )\n\t\t{\n\t\t\t$this->ipsclass->html .= $this->ipsclass->adskin->start_table( \"Update Checker\" );\n\t\t\t\t\n\t\t\tif ( $latest_umi > 0 )\n\t\t\t{\n\t\t\t\t$latest_text = ( $latest_umi != $this->umi_ver ) ? \"<span style='font-weight: bold; color: red;'>OUT OF DATE</span>\" : \"<span style='font-weight: bold; color: green;'>UP TO DATE</span>\";\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$latest_text = \"<span style='font-weight: bold; color: red;'>UNKNOWN</span>\";\n\t\t\t}\n\t\t\t\n\t\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_td_row( array( \"<div align='center'>Your copy of (FSY23) Universal Mod Installer is $latest_text!</div>\" ) );\n\t\t\t\n\t\t\t$this->ipsclass->html .= $this->ipsclass->adskin->end_table();\n\t\t}\n\t\t\n\t\t$this->ipsclass->html .= $this->ipsclass->adskin->add_standalone_row( \"(FSY23) Universal Mod Installer v{$this->umi_ver}, by <a href='http://www.invisionmodding.com/' target='_blank'>Invision Modding</a>, © \".date(\"Y\"), 'center', 'tablefooter' );\n\t\t\n\t\t//-----------------------------------------\n\t\t// All done, output it!\n\t\t//-----------------------------------------\n\t\t\n\t\t$this->ipsclass->admin->output();\n\t}",
"function install() {}",
"private function updateServers($mode,$servers=Array()){\n \n switch ($mode){\n case \"typo3conf\":{\n $dest=PATH_site.\"typo3temp/__\".time().\"typo3conf.tar.gz\";\n $src=\"typo3conf/\";\n break;\n }\n \n case \"localconf\":{\n $dest=PATH_site.\"typo3temp/__\".time().\"localconf.tar.gz\"; \n $src=\"typo3conf/localconf.php\";\n break;\n }\n \n case \"fileadmin\":{\n $dest=PATH_site.\"typo3temp/__\".time().\"fileadmin.tar.gz\"; \n $src=\"fileadmin/\";\n break;\n }\n \n \n \n }\n \n $cmd=\"tar -C\".PATH_site.\" -zcvf $dest $src\";\t \n exec($cmd,$out,$retVal); \n \n if (isset($retVal)&&$retVal==0){\n $params[\"action\"]=\"uploadBackup\";\n $params[\"file\"]=\"@$dest\";\n $params[\"destination\"]=PATH_site.\"typo3temp/localconf.tar.gz\";\n\t\t $params['typo3_cluster_execute']=1;\n $results=$this->sendRequestToNodes($params,$this->distributedServiceUrl,$servers);\n if ($results){\n foreach($results as $srv=>$res){\n $this->content.=\"Error in $srv: \".$res;\n }\n }else{\n $this->content.=\"All files updated successfully on all servers\";\n $this->content.=$this->getUpdateform();\n }\n unlink($dest);\n }else{\n echo \"Error in zip process\";\n }\n \n }",
"function install($data='') {\r\n @umask(0);\r\n if (!Is_Dir(ROOT.\"./cms/products/\")) {\r\n mkdir(ROOT.\"./cms/products/\", 0777);\r\n }\r\n parent::install();\r\n }",
"function wrmp_install()\n{\n\tglobal $lang;\n\n\tif(!$lang->wrmp)\n\t{\n\t\t$lang->load('wrmp');\n\t}\n\n\tif(!class_exists('WildcardPluginInstaller'))\n\t{\n\t\trequire_once MYBB_ROOT . 'inc/plugins/wrmp/classes/installer.php';\n\t}\n\t$installer = new WildcardPluginInstaller(MYBB_ROOT . 'inc/plugins/wrmp/install_data.php');\n\t$installer->install();\n}",
"public function code_pack_install()\n\t{\n\t\t$prefix = trim((string) ee()->input->get_post('prefix'));\n\n\t\tif ($prefix === '')\n\t\t{\n\t\t\tee()->functions->redirect($this->base . '&method=code_pack');\n\t\t}\n\n\t\t// -------------------------------------\n\t\t//\tload lib\n\t\t// -------------------------------------\n\n\t\t$lib_name = str_replace('_', '', $this->lower_name) . 'codepack';\n\t\t$load_name = str_replace(' ', '', ucwords(str_replace('_', ' ', $this->lower_name))) . 'CodePack';\n\n\t\tee()->load->library($load_name, $lib_name);\n\t\tee()->$lib_name->autoSetLang = true;\n\n\t\t// -------------------------------------\n\t\t//\t¡Las Variables en vivo! ¡Que divertido!\n\t\t// -------------------------------------\n\n\t\t$variables = array();\n\n\t\t$variables['code_pack_name']\t= $this->lower_name . '_code_pack';\n\t\t$variables['code_pack_path']\t= $this->addon_path . 'code_pack/';\n\t\t$variables['prefix']\t\t\t= $prefix;\n\n\t\t// -------------------------------------\n\t\t//\tinstall\n\t\t// -------------------------------------\n\n\t\t$details = ee()->$lib_name->getCodePackDetails($this->addon_path . 'code_pack/');\n\n\t\t$this->cached_vars['code_pack_name'] = $details['code_pack_name'];\n\t\t$this->cached_vars['code_pack_label'] = $details['code_pack_label'];\n\n\t\t$return = ee()->$lib_name->installCodePack($variables);\n\n\t\t$this->cached_vars = array_merge($this->cached_vars, $return);\n\n\t\t//--------------------------------------\n\t\t// menus and page content\n\t\t//--------------------------------------\n\n\t\t$this->cached_vars['module_menu_highlight'] = 'module_demo_templates';\n\n\t\t$this->add_crumb(lang('demo_templates'), $this->base . '&method=code_pack');\n\t\t$this->add_crumb(lang('install_demo_templates'));\n\n\t\t$this->cached_vars['current_page'] = $this->view('code_pack_install.html', NULL, TRUE);\n\n\t\t//---------------------------------------------\n\t\t// Load Homepage\n\t\t//---------------------------------------------\n\n\t\treturn $this->ee_cp_view('index.html');\n\t}",
"public function getLocalExtListFile() {}",
"public function import($addProducts, $updateProducts, $processFullFile, $processUpdateFile, $getNewFiles, $deleteFiles, $sendSucessLog)\n {\n \tMage::app()->setCurrentStore(Mage_Core_Model_App::ADMIN_STORE_ID);\n \t$startTime = time();\n \t$successCount = 0;\n \t$errorCount = 0;\n \t$myEditionTypes = array();\n\t\t$myAnswerCodes = array();\n\t\t$taxClassIds = array();\n\t\t$inventoryFiles = array();\n \t$logFile = 'Vista_Inventory_Update.log';\n \t$errorFile = 'Vista_Inventory_Error'.date(\"YmdHis\", time()).'.log';\n $isSaoEnabled = Mage::getStoreConfig('vistainventory_section/vistainventory_group/vistainventory_enablesao');\n if ($isSaoEnabled) $saoCodes = $this->getSaoCodes();\n\n $inventoryDir = Mage::getBaseDir() . '/var/importexport/vista_inventory';\n\n\t\t//create folders\n\t\t$baseDir = Mage::getBaseDir() . '/var/importexport';\n\t\tif (!file_exists($baseDir)) mkdir($baseDir, 0777);\n \t\n $inventoryDir = $baseDir . '/vista_inventory';\n if (!file_exists($inventoryDir)) mkdir($inventoryDir, 0777);\n \n $inventoryExecutedDir = $inventoryDir.'/executed';\n if (!file_exists($inventoryExecutedDir)) mkdir($inventoryExecutedDir, 0777);\n \n //DOWNLOAD Inventory Files from VISTA Ftp server\n if($getNewFiles == true)\n {\n \ttry \n\t {\n\t \t$this->getInventoryUpdateFiles($processFullFile, $processUpdateFile, $deleteFiles, $errorFile);\n\t } \n\t catch (Exception $e) \n\t {\n\t\t\t\tMage::log('FTP Error: '.$e,null,$errorFile);\n\t\t\t\t$errorCount++;\n\t }\n }\n \n $this->initGlobals($myEditionTypes,$myAnswerCodes, $taxClassIds);\n $this->initInventoryFiles($inventoryDir, $inventoryFiles);\n\n\t //data[1] = sku\n \t//data[2] = edition type\n \t//data[3] = answer code\n \t//data[4] = quantity\n \t//data[5] = price\n \t//data[6] = publication date \n \t//data[7] = isbn 12\n \t//data[8] = isbn 10\n \t//data[9] = weight\n \t//data[10] = number of pages\n \t//data[11] = warehouse availability date\n \t//data[12] = Short Name ==> used for new products\n \t//data[13] = Magento Flag\n \t//data[14] = Cost\n\t //data[18] = Taxware Taxcode\n //data[19] and up = SAO code\n \t\n\t //Process each found file\n\t\tforeach ($inventoryFiles AS $inventoryFile) \n { \n\n \t//Open the Sku tracking file for this specific update file\n \tunset($processedSkus); \n \t$slashPosition = strripos($inventoryFile,'/');\n \t\n \tif($slashPosition == false)\n \t{\n \t\t$slashPosition = strripos($inventoryFile,'\\\\');\n \t}\n \t\n \t$fileName = substr($inventoryFile, $slashPosition + 1);\n \t$fileName = str_replace('.DWF', '.log', $fileName); \n \t$processedSkuFile = $inventoryDir.'/Processed_'.$fileName;\n \t\n \t$deadLockfileName = substr($inventoryFile, $slashPosition + 1);\n \t$deadLockSkuFile = $inventoryDir.'/DEADLOCK_'.$deadLockfileName;\n \t\n \tif(file_exists($processedSkuFile))\n \t{\n \t\tif (($handle = fopen($processedSkuFile, \"r\")) !== FALSE)\n\t\t\t\t{\n\t\t\t\t\twhile (($data = fgetcsv($handle, 10000, \",\")) !== FALSE)\n\t\t\t\t\t{\n\t\t\t\t\t\t$processedSkus[$data[0]] = $data[0];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tfclose($handle);\n \t}\n\t \n \tMage::log(\"Processing File:\".$inventoryFile.\"\\r\\n\",null,$logFile);\n \tif (($handle = fopen($inventoryFile, \"r\")) !== FALSE) \n \t{\n\t\t\t\twhile (($data = fgetcsv($handle, 100000, \"|\")) !== FALSE) \n\t\t\t\t{\n\t\t\t\t\t$sku = $data[1];\n\t\t\t\t\t\n\t\t\t\t\tif(!isset($processedSkus[$sku]))\n\t\t\t\t\t{\n\t\t\t \ttry \n\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\tif($sku != \"\")\n\t\t\t\t\t\t\t{\n //Might be able to just remove this if block, since both \"V\" and \"D\" will be considered non managed and the qty will get set to one in that check.\n\t\t\t\t\t\t\t\tif($data[13] == \"V\" || $data[13] == \"D\")//for virtual/download products this qty has to always be at least 1 even for products that we dont manage the stock for bundled products will function correctly on front end\n\t\t\t\t\t \t{\n //Overwrite $data[4] = 1 as that is where the inventory is stored\n $data[4] = 1;\n\t\t\t\t\t \t}\n\t\t\t\t\n\t\t\t\t\t\t\t\t$inventoryProduct = Mage::getModel('catalog/product')->loadByAttribute('sku',$sku);\n\n //Check SAO Codes\n if(!empty($saoCodes) && $data[13] != \"N\" && $data[13] != \"\") {\n $productSaoCodes = array_filter(array_slice($data, 19), 'trim');\n $match = array_intersect($productSaoCodes, $saoCodes);\n\n if (empty($productSaoCodes) && empty($inventoryProduct)) {\n Mage::log(\"No SAO codes on new product. Sku:\".$sku.\"\\r\\n\", null, $logFile);\n } elseif (empty($productSaoCodes) && !empty($inventoryProduct)) {\n Mage::log(\"No SAO codes on existing product. Sku:\".$inventoryProduct->getsku().\"\\r\\n\", null, $logFile);\n } elseif (!empty($productSaoCodes) && !empty($inventoryProduct) && empty($match)) {\n Mage::log(\"Existing product does not have SAO codes that match those set in admin. Sku:\".$inventoryProduct->getsku().\"\\r\\n\", null, $logFile);\n }\n\n if (empty($match)) { //Product does not have SAO codes matching those set in Magento Admin, skip product\n continue;\n }\n }\n\n\t\t\t\t\t\t\t\tif(!$inventoryProduct)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\tif(isset($data[13]))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tif($addProducts == true && $data[13] != \"N\" && $data[13] != \"\")//dont add non-magento products if the magento field is populated, the add products flag was included and the field value is not N\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$inventoryProduct = $this->createNewProduct($data, $taxClassIds, $logFile);\n\t\t\t\t\t\t\t\t\t\t\t$newProduct = true;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$newProduct = false;\n\t\t\t\t\t\t\t\t}\n\t\t\n\t\t\t\t\t\t\t\tif($inventoryProduct)\n\t\t\t\t\t\t\t\t{\t\n\t\t\t\t\t\t\t\t\tif($newProduct || ($newProduct == false && $updateProducts == true))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t//Product Update\n\t\t\t\t\t\t\t\t\t\t$this->updateProduct($inventoryProduct, $myEditionTypes, $myAnswerCodes, $data);\n\n\t\t\t\t\t\t\t\t\t\t//Stock Update\n\t\t\t\t\t\t\t\t\t\tif(isset($data[15]) && $data[15] == \"N\")\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$manageStock = 0;\n //Force qty to be 1 on a product where stock isn't managed.\n $data[4] = 1;\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\t$manageStock = 1;\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$this->updateStockItem($inventoryProduct,$data[3], $data[4], $manageStock, $logFile);\n\t\t\t\t\t \t\t\t\t\n\t\t\t\t\t\t\t\t\t\t$fh = fopen($processedSkuFile, 'a'); \n\t\t\t\t\t\t\t\t\t\tfwrite($fh, $sku.\"\\r\\n\"); \n\t\t\t\t\t\t\t\t\t\tfclose($fh);\n\t\t\t\t\t\t\t\t\t\t$successCount++;\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\tMage::log(\"Updated sku:\".$inventoryProduct->getsku().\"\\r\\n\",null,$logFile);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\t\t\n\t\t\t\t\t\tcatch (Exception $e)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tMage::log($sku.\":\".$e->getMessage(),null,$errorFile);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tif(strstr($e->getMessage(), \"1205 Lock wait timeout exceeded\"))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$fh2 = fopen($deadLockSkuFile, 'a'); \n\t\t\t\t\t\t\t\t\tforeach($data as $field)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tfwrite($fh2, $field.\"|\"); \n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\tfwrite($fh2, PHP_EOL); \n\t\t\t\t\t\t\t\t\tfclose($fh2);\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$errorCount++;\n\t\t\t\t\t\t\t\tif($errorCount > 0)\n\t\t\t\t\t\t \t{\n\t\t\t\t\t\t\t\t\t$this->sendEmail(\"Vista Inventory Update Error\", \"There was an error(s) in the Vista Inventory Update process\", Mage::getBaseDir().\"/var/log/\", $errorFile);\n\t\t\t\t\t\t \t}\n\t\t\t\t\t\t \t\n\t\t\t\t\t\t\t\tif($sendSucessLog && $successCount > 0)\n\t\t\t\t\t\t \t{\n\t\t\t\t\t\t\t\t\t$this->sendEmail(\"Vista Inventory Update\", \"Metrics for the Vista Inventory Update process\", Mage::getBaseDir().\"/var/log/\", $logFile);\n\t\t\t\t\t\t \t}\n\t\t\t\t\t\t \tfclose($handle);\n\t\t\t\t\t\t \treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\tunset($inventoryProduct,$sku, $data);\n\t\t\t\t\t} \n\t\t\t\t}\n\t \t}\n\t \tfclose($handle);\n\t \tunset($handle);\n\t \t$fileNameExecuted= str_replace('.dwf', '.executed.' . date('Ymd-His') . '.dwf', $inventoryFile);\n\t \t$fileNameExecuted= str_replace('.DWF', '.executed.' . date('Ymd-His') . '.DWF', $inventoryFile);\n $fileNameExecuted = str_replace($inventoryDir, $inventoryExecutedDir, $fileNameExecuted);\n rename($inventoryFile, $fileNameExecuted);\n \n unlink($processedSkuFile); \n }\n \n\t\tMage::log(\"************************ Inventory Completed ************************\\r\\n\",null,$logFile);\n\t\tMage::log(\"Time Elapsed :\".round(abs(time() - $startTime) /60,2).\" minutes\\r\\n\",null,$logFile);\n\t\tMage::log(\"Successes : \".$successCount.\"\\r\\n\",null,$logFile);\n\t\tMage::log(\"Errors : \".$errorCount.\"\\r\\n\",null,$logFile);\n\t\tMage::log(\"*********************************************************************\\r\\n\",null,$logFile);\n\n \tif($errorCount > 0)\n \t{\n\t\t\t$this->sendEmail('Vista Inventory Update Error', 'There was an error(s) in the Vista Inventory Update process', Mage::getBaseDir().'/var/log/', $errorFile);\n \t}\n \t\n \tif($sendSucessLog && $successCount > 0)\n \t{\n\t\t\t$this->sendEmail('Vista Inventory Update', 'Metrics for the Vista Inventory Update process', Mage::getBaseDir().'/var/log/', $logFile);\n \t}\n \t\n \tif(count($inventoryFiles) == 0)\n \t{\n\t\t\t$this->sendEmail('Vista Inventory Update - NO FILES FOUND', 'There were no inventory files found to process', Mage::getBaseDir().'/var/log/', null);\n \t}\n }",
"public function install()\n\t{\n\t\t$filename = cms_join_path($this->get_module_path(), 'method.install.php');\n\t\tif (@is_file($filename))\n\t\t{\n\t\t\t{\t\t\t\t\n\t\t\t\t$gCms = cmsms(); //Backwards compatibility\n\t\t\t\t$db = cms_db();\n\t\t\t\t$config = cms_config();\n\t\t\t\t$smarty = cms_smarty();\n\n\t\t\t\tinclude($filename);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"function TS_VCSC_FilesRegistrations() {\r\n\t\t\trequire_once($this->registrations_dir . 'ts_vcsc_registrations_files.php');\r\n\t\t}",
"function ExportarMX( $fullpath){\r\n global $mx_path,$db_path,$arrHttp,$msgstr;\r\n $strINV = $mx_path.\" db=\".$db_path.$arrHttp[\"base\"].\"/data/\".$arrHttp[\"base\"];\r\n $strINV.= \" iso=\".$fullpath;\r\n //$strINV.= \" cipar=\".$db_path.\"par/\".$arrHttp[\"base\"].\".par\";\r\n // Enter the range\r\n if (isset($arrHttp[\"Mfn\"]) and trim($arrHttp[\"Mfn\"]) !=\"\") {\r\n $strINV.=\" from=\".$arrHttp[\"Mfn\"].\" to=\".$arrHttp[\"to\"];\r\n }\r\n // Enter the marc special\r\n if (isset($arrHttp[\"usemarcformat\"]) and $arrHttp[\"usemarcformat\"]==\"on\") {\r\n $strINV.=\" outisotag1=3000\";\r\n }\r\n //\r\n if (isset($arrHttp[\"Expresion\"]) and trim($arrHttp[\"Expresion\"]) !=\"\") {\r\n $expresion=str_replace('\"','' ,trim($arrHttp[\"Expresion\"]));\r\n $strINV.= \" bool=\\\"\".$expresion.\"\\\"\";\r\n }\r\n $strINV.= \" -all now 2>&1\";\r\n echo \"Command line: \".$strINV.\"<br>\";\r\n\r\n // Execute the command\r\n exec($strINV, $output,$status);\r\n // collect regular and error output\r\n $straux=\"\";\r\n for($i=0;$i<count($output);$i++){\r\n $straux.=$output[$i].\"<br>\";\r\n }\r\n // If nothing was found we have an error\r\n if($status==0) {\r\n clearstatcache();\r\n if ( !file_exists($fullpath) or filesize($fullpath)==0) {\r\n echo \"<div><font color=red>The export action did not result in any data</font></div>\";\r\n echo \"<div><font color=red>File <b>\".$fullpath.\"</b> does not exist or is empty</font></div>\";\r\n echo \"<a href='javascript:Regresar()'>Try again</a>\";\r\n return 1;\r\n }\r\n ?>\r\n <div align=center><br><br>\r\n <h4><?php echo $fullpath ?> <?php echo $msgstr[\"okactualizado\"] ?> \r\n <a href=javascript:Download()> <?php echo $msgstr[\"download\"]?></a>\r\n </h4>\r\n </div>\r\n <?php\r\n if ( $straux != \"\") echo \"<hr>\".$straux;\r\n } else {\r\n echo (\"<h3><font color='red'><br>Process NOT EXECUTED or FAILED</font></h3><hr>\");\r\n echo \"<font color='red'>\".$straux.\"</font>\";\r\n return 1;\r\n }\r\n return 0;\r\n}",
"function ui_title() {\n return t('Managed files');\n }",
"function jbInstall($step){\n\t}",
"function customs()\n\t{\n\t\t$custom = $this->ipsclass->load_class( ROOT_PATH.'mod_install/'.$this->xml_array['customs_group']['custom'][0]['script_name']['VALUE'].'.php', $this->xml_array['customs_group']['custom'][0]['script_name']['VALUE'] );\n\t\t$custom->xml_array =& $this->xml_array;\n\t\t\n\t\tif ( $this->ipsclass->input['un'] )\n\t\t{\n\t\t\t$custom->uninstall();\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$custom->install();\n\t\t}\n\t}"
] | [
"0.5856864",
"0.58448607",
"0.5831132",
"0.57981324",
"0.57818866",
"0.5638754",
"0.56363577",
"0.5614855",
"0.55780894",
"0.5561047",
"0.55593556",
"0.5548429",
"0.55468404",
"0.55131024",
"0.5505031",
"0.5487783",
"0.5471581",
"0.5456339",
"0.5380684",
"0.53454375",
"0.52849126",
"0.5280651",
"0.52713",
"0.52611077",
"0.52521235",
"0.52471215",
"0.5236742",
"0.5224175",
"0.52182364",
"0.5215801",
"0.5192965",
"0.5187994",
"0.51712686",
"0.5169404",
"0.5164167",
"0.5160001",
"0.51575583",
"0.5154755",
"0.5148302",
"0.5146818",
"0.5133406",
"0.5130598",
"0.5117225",
"0.5105395",
"0.5101813",
"0.5096901",
"0.5091518",
"0.50887585",
"0.50871354",
"0.5082613",
"0.5082613",
"0.50825804",
"0.50716376",
"0.50654984",
"0.5059334",
"0.50456405",
"0.5045001",
"0.50376",
"0.50376",
"0.5036142",
"0.5035958",
"0.50328594",
"0.5030394",
"0.50251555",
"0.5013205",
"0.50101364",
"0.5003452",
"0.49966767",
"0.49858642",
"0.4981828",
"0.49760628",
"0.49746326",
"0.49726814",
"0.49695167",
"0.4964552",
"0.4961938",
"0.49520275",
"0.49468756",
"0.49235314",
"0.49016204",
"0.48998523",
"0.48966563",
"0.48899493",
"0.4886216",
"0.48822945",
"0.4877493",
"0.48769766",
"0.48763952",
"0.48681223",
"0.486686",
"0.48650563",
"0.4862465",
"0.48580986",
"0.4857832",
"0.48573145",
"0.4853199",
"0.4847678",
"0.4846272",
"0.48392323",
"0.4839128"
] | 0.5214119 | 30 |
Executed after processing extension.json | public static function registerExtension() {
global $wgDonationInterfaceTest,
$wgDonationInterfaceTemplate,
$wgDonationInterfaceErrorTemplate,
$IP;
// Test mode (not for production!)
// Set it if not defined
if ( !isset( $wgDonationInterfaceTest ) || $wgDonationInterfaceTest !== true ) {
$wgDonationInterfaceTest = false;
}
/**
* Default top-level template file.
*/
$wgDonationInterfaceTemplate = __DIR__ . '/gateway_forms/mustache/index.html.mustache';
/**
* Default top-level error template file.
*/
$wgDonationInterfaceErrorTemplate = __DIR__ . '/gateway_forms/mustache/error_form.html.mustache';
// Load the default form settings.
require_once __DIR__ . '/DonationInterfaceFormSettings.php';
// Include composer's autoload if the vendor directory exists. If we have been
// included via Composer, our dependencies should already be autoloaded at the
// top level.
$vendorAutoload = __DIR__ . '/vendor/autoload.php';
if ( file_exists( $vendorAutoload ) ) {
require_once $vendorAutoload;
} else {
require_once __DIR__ . '/gateway_common/WmfFramework.php';
}
if ( defined( 'MEDIAWIKI' ) ) {
// If we're the top-level application, initialize the SmashPig context
$spConfig = GlobalConfiguration::create();
Context::init( $spConfig );
$context = Context::get();
$context->setSourceName( 'DonationInterface' );
$context->setSourceType( 'payments' );
$context->setVersionFromFile( "$IP/.version-stamp" );
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _extensionLoaded() {}",
"public function postProcess()\n\t\t{\n\t\t\tforeach ($this->m_activeExtensions as $extension)\n\t\t\t{\n\t\t\t\t$extension->postProcess();\n\t\t\t}\n\t\t}",
"public function processJsonFiles(){\n $filesList = $this->getFileList();\n foreach ($filesList as $key => $file) {\n //do this at your will\n if( !preg_match('/.json/', $file['Key'] ) ){\n continue;\n }\n $fileContents = $this->getFile($file['Key']);\n $fileProcessed = $this->processFile($fileContents);\n $this->saveFile($file['Key'], $fileProcessed);\n }\n }",
"protected function initializeExtensionFiles() {}",
"public function update_extension(){}",
"protected function _loadExtensions()\n {\n }",
"public static function post_process() {}",
"protected function updateExtensionAction() {}",
"protected function afterProcess() {\n }",
"protected function afterFind()\n \t{\n \t\t$this->jsonArray_extra = json_decode($this->json_extra);\n \t\t$this->jsonArray_payload = json_decode($this->json_payload);\n\n \t\tparent::afterFind();\n \t}",
"public function postLoad() {}",
"protected function runExtTablesPostProcessingHooks() {}",
"public function boot()\n {\n UploadedFile::macro('parseJson', function (bool $associative = true) {\n return parse_file_as_json($this->getRealPath(), $associative);\n });\n }",
"public function afterLoad() { }",
"protected function setAvailableExtensions() {}",
"public function onLoad() {\n $this->addFileNameHook(array($this, 'parseFileName'));\n }",
"public function after_run() {}",
"public function postLoad() { }",
"protected function getExtensionsToLoad() {}",
"protected function _process() {}",
"protected function _process() {}",
"protected function _process() {}",
"protected function _process() {}",
"protected function assignExtensionSettings() {}",
"public function reloadAvailableExtensions() {}",
"public function reloadAvailableExtensions() {}",
"protected function after_execute() {\n // Add iadlearning related files, no need to match by itemname (just internally handled context).\n $this->add_related_files('mod_iadlearning', 'intro', null);\n }",
"public function afterLoad(){\n $this->getType()->afterLoadProcess($this);\n return parent::afterLoad();\n }",
"public function extension() {}",
"public function handle(): void\n {\n $this->getExtensions();\n }",
"public function after_run(){}",
"protected function preProcess() {}",
"public function run()\n\t{\n\t\t$method = $this->method;\n\t\t\n\t\tif(!$this->extension_ran)\n\t\t{\n\t\t\t$this->$method();\n\t\t}\n\t\t\n\t\tif ($this->EE->extensions->active_hook('export_it_api_end') === TRUE)\n\t\t{\n\t\t\t$this->EE->extensions->call('export_it_api_end', $this);\n\t\t\tif ($this->EE->extensions->end_script === TRUE) return;\n\t\t}\t\t\n\t\texit;\n\t}",
"public function updateJson()\n {\n $ExtensionData = ExtensionData::get()->filter(array(\"Title\" => $this->latestReleasePackage->getPrettyName()))->First();\n\n if ($ExtensionData) {\n $result = $this->dataFields($ExtensionData);\n return $result ;\n } else {\n return ;\n }\n }",
"private function sortExtensions()\n {\n // Ensure extensions are loaded in order\n $this->sortedExtensions = array();\n foreach ($this->extensions as $extension) {\n $this->addExtensionToSorted($extension);\n }\n }",
"private function getExtensions(): void\n {\n\n $localExtensionFiles = glob(base_path('extensions/*/*/composer.json'));\n $localExtensions = collect();\n\n $localCache = resolve('extensions')->getCache();\n\n foreach ($localExtensionFiles as $file) {\n $composer = json_decode(file_get_contents($file));\n\n if (!$composer) {\n continue;\n }\n\n $nameEx = explode('/', $composer->name);\n $author = $nameEx[0];\n $packageName = $nameEx[1];\n\n $slug = \\Str::kebab(str_replace('\\\\', '', $composer->extra->titan->namespace));\n\n $temp = collect();\n $temp->put('name', $composer->extra->titan->name);\n $temp->put('description', $composer->description);\n $temp->put('version', '1.0.0');\n $temp->put('authors', $composer->authors);\n $temp->put('slug', $slug);\n $temp->put('rating', '4.0');\n $temp->put('ratings', 20);\n $temp->put('installs', 3237);\n $temp->put('local', true);\n $temp->put('enabled', $localCache->where('name', $composer->extra->titan->name)->first()['enabled'] ?? false);\n $temp->put('namespace', $composer->extra->titan->namespace);\n $localExtensions[] = $temp;\n\n $this->info(\"Found new extension {$composer->extra->titan->name}\");\n\n }\n\n\n cache()->put('local_extensions', json_encode($localExtensions));\n $this->info('Local extension cache refreshed');\n\n\n try {\n\n $http = new Client([\n 'timeout' => 3\n ]);\n $res = $http->get('https://titan.pbbg.io/api/extensions')->getBody()->getContents();\n $extensions = json_decode($res);\n\n $this->schema['date'] = new Carbon();\n $this->schema['remote_extensions'] = $extensions;\n $this->schema['local_extensions'] = $localExtensions;\n\n cache()->put('remote_extensions', json_encode($extensions));\n\n \\Storage::disk('local')->put('extensions.json', json_encode($this->schema));\n $this->info(\"Extensions have been reloaded\");\n } catch (\\Exception $exception) {\n $this->warn(\"Unable to retrieve remote extension cache, falling back to previous version\");\n dump($exception);\n }\n }",
"function on_add_extra()\r\n\t{\r\n\t}",
"protected function after_execute() {\n $this->add_related_files('mod_glossary', 'intro', null);\n // Add entries related files, matching by itemname (glossary_entry)\n $this->add_related_files('mod_glossary', 'entry', 'glossary_entry');\n $this->add_related_files('mod_glossary', 'attachment', 'glossary_entry');\n }",
"public function activate_extension(){}",
"public function _afterSave()\n {\n Mage::getResourceModel('bpost_shm/tablerates_international')->uploadAndImport($this);\n }",
"protected function after_execute() {\n $this->add_related_files('block_file', 'intro', null);\n $this->add_related_files('block_file', 'file', null);\n }",
"public function custom_definition_after_data() {}",
"protected function after_execute() {\n $this->add_related_files('mod_ableplayer', 'intro', null);\n $this->add_related_files('mod_ableplayer', 'poster', null);\n $this->add_related_files('mod_ableplayer', 'media', 'ableplayer_media');\n $this->add_related_files('mod_ableplayer', 'desc', 'ableplayer_desc');\n $this->add_related_files('mod_ableplayer', 'caption', 'ableplayer_caption');\n }",
"public static function pre_process() {}",
"protected function addInitialExtensionInformation()\n {\n $repository = ExtensionInformationRepositoryFactory::create();\n $packages = $this->packageManager->getAvailablePackages();\n $repository->addExtensionInformation($packages);\n }",
"protected function afterLoad()\n {\n }",
"protected function after_execute() {\n// \t$this->add_related_files('mod_vcubeseminar', 'intro', null);\n// \t$this->add_related_files('mod_vcubeseminar', 'vcubeseminar', null);\n }",
"private function installCustomPostTypesFromJSON()\n {\n if (! file_exists($this->rootPath.'/config/types.json')) {\n return;\n }\n\n $types = JSONParser::parse(file_get_contents($this->rootPath.'/config/types.json'));\n\n foreach ($types as $cpt => $details) {\n register_post_type($cpt, $details);\n }\n }",
"public function postLoadCallback()\n {\n $this->performPostLoadCallback();\n }",
"public function postLoadCallback()\n {\n $this->performPostLoadCallback();\n }",
"function _wp_theme_json_webfonts_handler()\n {\n }",
"public function apply()\n {\n\n\n $files = 'start';\n //$load is empty as we will use the .default file to select the data directory\n $load = '';\n $reload = 1;\n \n $this->process->loadFiles($this->helper->getModuleName(),$load,explode(\",\",$files),$reload);\n \n }",
"public function processExtension(SmtpClient $client, $extension) { }",
"function wcfmos_plugins_loaded_callback() {\n\trun_wcfm_order_splitter();\n}",
"protected function beforeProcess() {\n }",
"protected function _afterInit() {\n\t}",
"protected function registerExtensions()\n {\n $apiResult = Event::fire('editor.extension.register');\n\n if (!is_array($apiResult)) {\n return;\n }\n\n foreach ($apiResult as $extensionClassName) {\n if (!is_string($extensionClassName)) {\n continue;\n }\n\n $this->extensionClassNames[] = $extensionClassName;\n }\n }",
"private function hooks(): void {\n\t\t// Steps loader hooks.\n\n\t\tadd_filter(\n\t\t\t'learndash_breezy_localize_script_data',\n\t\t\t$this->container->callback( Steps\\Loader::class, 'add_scripts_data' )\n\t\t);\n\t\tadd_action(\n\t\t\t'wp_ajax_' . Steps\\Loader::$sub_steps_ajax_action_name,\n\t\t\t$this->container->callback( Steps\\Loader::class, 'handle_sub_steps_ajax_request' )\n\t\t);\n\t\tadd_action(\n\t\t\t'wp_ajax_nopriv_' . Steps\\Loader::$sub_steps_ajax_action_name,\n\t\t\t$this->container->callback( Steps\\Loader::class, 'handle_sub_steps_ajax_request' )\n\t\t);\n\t}",
"public function it_works_with_json_configuration()\n {\n $this->test_process('json');\n }",
"public function fileNeedsProcessing() {}",
"protected function processUpdates()\n {\n $this->importStaticData();\n }",
"protected function executeExtTablesAdditionalFile() {}",
"protected function afterExtensionLoaded($callback): void\n {\n $this->app->make('orchestra.extension')->after($callback);\n }",
"public function collectComposerJsonFile()\r\n {\r\n\r\n $files_found = $this->findSpecificFile($this->site_root, \"composer.json\");\r\n if($files_found)\r\n $this->file_list = array_merge($this->file_list, $files_found);\r\n }",
"public static function import_process() {}",
"public function setUp() {\n $this->transformation = new Convert(array('type' => $this->extension));\n }",
"public function parse(): void\n {\n $this->template->assign('page_title', BL::getLabel($this->url->getModule()));\n $this->cssFiles->parse($this->template, 'cssFiles');\n $this->jsFiles->parse($this->template, 'jsFiles');\n\n $this->jsData->add('site', 'domain', SITE_DOMAIN);\n $this->jsData->add('editor', 'language', $this->getCKEditorLanguage());\n $this->jsData->add('Core', 'session_timeout', $this->getFirstPossibleSessionTimeout());\n\n if (!empty($this->get('fork.settings')->get('Core', 'theme'))) {\n $this->jsData->add('theme', 'theme', $this->get('fork.settings')->get('Core', 'theme'));\n $themePath = FRONTEND_PATH . '/Themes/' . $this->get('fork.settings')->get('Core', 'theme');\n $this->jsData->add('theme', 'path', $themePath);\n $this->jsData->add('theme', 'has_css', is_file($themePath . '/Core/Layout/Css/screen.css'));\n $this->jsData->add('theme', 'has_editor_css', is_file($themePath . '/Core/Layout/Css/editor_content.css'));\n }\n $this->template->assign('jsData', $this->jsData);\n }",
"public function postProcess();",
"function after_update() {}",
"function _ext_scripts()\n\t{\n\t\t$str = '';\n\n\t\t/* -------------------------------------------\n\t\t/* 'cp_js_end' hook.\n\t\t/* - Add Javascript into a file call at the end of the control panel\n\t\t/* - Added 2.1.2\n\t\t*/\n\t\t\t$str = $this->extensions->call('cp_js_end');\n\t\t/*\n\t\t/* -------------------------------------------*/\n\n\t\t$this->output->out_type = 'cp_asset';\n\t\t$this->output->set_header(\"Content-Type: text/javascript\");\n\t\t$this->output->set_header(\"Cache-Control: no-cache, must-revalidate\");\n\t\t$this->output->set_header('Content-Length: '.strlen($str));\n\t\t$this->output->set_output($str);\n\t}",
"public function _postSetup()\n {\n }",
"protected function executeRenderPostTransformHook() {}",
"function fileNeedsProcessing() ;",
"protected function after(){}",
"protected function after(){}",
"protected function after(){}",
"public function after_update() {}",
"public function loadExtensions(): void\n {\n /**\n * @var ConfigStorageInterface $configStorage\n */\n $configStorage = $this->di->get(ConfigStorageInterface::class);\n $modules = $this->config->__toArray();\n\n if (empty($modules)) {\n return;\n }\n\n $autoLoadPaths = [];\n $autoLoadPathsPsr4 = [];\n $configPaths = [];\n\n $dependencyPaths = [];\n\n $extensionsDir = $this->extensionsConfig['path'];\n\n foreach ($modules as $index => $config) {\n if (!$config['enabled'] || isset($this->loadedExtensions[$index]['loaded'])) {\n continue;\n }\n\n $path = $extensionsDir . File::fillEndSep($config['dir']);\n\n if (!empty($config['paths']['src'])) {\n $autoLoadPaths[] = $path . $config['paths']['src'];\n }\n\n if (!empty($config['paths']['configs'])) {\n $configPaths[] = $path . $config['paths']['configs'] . '/';\n }\n\n if (!empty($config['paths']['dependency'])) {\n $dependencyPaths[] = $path . $config['paths']['dependency'];\n }\n\n /*\n * @todo implement extension locales and templates\n\n if (!empty($modCfg['autoloader-psr-4'])) {\n foreach ($modCfg['autoloader-psr-4'] as $ns =>$classPath) {\n $autoLoadPathsPsr4[$ns] = str_replace('./', $path, $classPath);\n }\n }\n\n */\n $this->loadedExtensions[$index]['load'] = true;\n }\n\n // Add autoloader paths\n if (!empty($autoLoadPaths)) {\n $autoloaderConfig = $configStorage->get('autoloader.php');\n $autoloaderCfg = $autoloaderConfig->__toArray();\n $newChain = $autoloaderCfg['priority'];\n\n foreach ($autoLoadPaths as $path) {\n $newChain[] = $path;\n }\n $currentAutoloadPaths = $this->autoloader->getRegisteredPaths();\n foreach ($currentAutoloadPaths as $path) {\n if (!in_array($path, $newChain, true)) {\n $newChain[] = $path;\n }\n }\n\n $autoloaderCfg['psr-4'] = array_merge($autoLoadPathsPsr4, $autoloaderCfg['psr-4']);\n $autoloaderCfg['paths'] = $newChain;\n\n // update autoloader paths\n $this->autoloader->setConfig(['paths' => $autoloaderCfg['paths'], 'psr-4' => $autoloaderCfg['psr-4']]);\n // update main configuration\n $autoloaderConfig->setData($autoloaderCfg);\n }\n // Add Config paths\n if (!empty($configPaths)) {\n $writePath = $configStorage->getWrite();\n $applyPath = $configStorage->getApplyTo();\n\n $paths = $configStorage->getPaths();\n $resultPaths = [];\n\n foreach ($paths as $path) {\n if ($path !== $writePath && $path !== $applyPath) {\n $resultPaths[] = $path;\n }\n }\n foreach ($configPaths as $path) {\n \\array_unshift($resultPaths, $path);\n }\n\n \\array_unshift($resultPaths, $applyPath);\n $resultPaths[] = $writePath;\n $configStorage->replacePaths($resultPaths);\n }\n // register dependencies\n if (!empty($dependencyPaths)) {\n foreach ($dependencyPaths as $file) {\n if ($this->di instanceof DependencyContainer || method_exists($this->di, 'bindArray')) {\n $this->di->bindArray(include $file);\n }\n }\n }\n }",
"protected function MetaAfterLoad() {\n\t\t}",
"function OnAfterApply(){\n }",
"public function postProcessDownload()\n {\n }",
"public function processApi()\n\t\t{\n\t\t\t$this->createEntry();\n\t\t}",
"private function plugins(){\n $all_plugins = explode(',', json_decode(file_get_contents($this->pluginsJson))->all->names);\n debug($all_plugins);\n die;\n }",
"protected function after_load(){\n\n\n }",
"protected function processChangedAndNewFiles() {}",
"private function _saveExt() {\r\n\r\n }",
"public function execute()\n {\n\t $composer = $this->composer;\n\n\t $composer->extra = isset($composer->extra) ? $composer->extra : array('fof' => new \\stdClass());\n\t $composer->extra->fof = isset($composer->extra->fof) ? $composer->extra->fof : new \\stdClass();\n\n\t $info = $composer->extra->fof;\n\n\t if (!is_object($info))\n\t {\n\t\t if (empty($info))\n\t\t {\n\t\t\t $info = new \\stdClass();\n\t\t }\n\t\t else\n\t\t {\n\t\t\t $info = (object) $info;\n\t\t }\n\t }\n\n\t\t// Component Name (default: what's already stored in composer / composer package name)\n\t\t$info->name = $this->getComponentName($composer);\n\n\t\t$files = array(\n\t\t\t'backend' => 'component/backend',\n\t\t\t'frontend' => 'component/frontend',\n\t\t\t'media' => 'component/media',\n\t\t\t'translationsbackend' => 'translations/component/backend',\n\t\t\t'translationsfrontend' => 'translations/component/frontend'\n\t\t);\n\n\t if (!isset($info->paths) || empty($info->paths) || is_null($info->paths))\n\t {\n\t\t $info->paths = array();\n\t }\n\n\t if (is_object($info->paths))\n\t {\n\t\t $info->paths = (array) $info->paths;\n\t }\n\n\t $files = array_merge($files, $info->paths);\n\n\t\tforeach ($files as $key => $default)\n {\n\t\t\t$info->paths[$key] = $this->getPath($composer, $key, $default);\n\t\t}\n\n\t\t// Now check for fof.xml file\n\t\t$fof_xml = getcwd() . '/' . $info->paths['backend'] . '/fof.xml';\n\n\t\tif (file_exists($fof_xml))\n {\n // @todo Read the XML?\n\t\t}\n\n\t // @todo Maybe ask for namespaces?\n\n\t\t// Store back the info into the composer.json file\n\t $composer->extra->fof = $info;\n\t \\JFile::write(getcwd() . '/composer.json', json_encode($composer, JSON_PRETTY_PRINT));\n\n\t\t$this->setDevServer(false);\n\t}",
"public function afterCallActionHandler()\n {\n $envIsAllowed = Director::isDev() && Config::inst()->get(DataObjectAnnotator::class, 'enabled');\n $skipAnnotation = $this->owner->getRequest()->getVar('skipannotation');\n \n // Only instatiate things when we want to run it, this is for when the module is accidentally installed\n // on non-dev environments for example\n if ($skipAnnotation === null && $envIsAllowed) {\n $this->setUp();\n\n $this->displayMessage(\"<div class='build'><p><b>Generating class docblocks</b></p><ul>\\n\\n\");\n\n $modules = $this->permissionChecker->enabledModules();\n foreach ($modules as $module) {\n $this->annotator->annotateModule($module);\n }\n\n $this->displayMessage(\"</ul>\\n<p><b>Docblock generation finished!</b></p></div>\");\n }\n }",
"public function process()\n {\n $this->minifier = AssetMinifier::createObjet($this->minifier, Minifier::className());\n foreach (Yii::$app->view->assetBundles as $key => $assetBundle) {\n if ($this->minifyJs && $assetBundle->js) {\n Yii::$app->view->assetBundles[$key] = $this->minifier->minifyJs($assetBundle);\n }\n\n if ($this->minifyCss && $assetBundle->css) {\n Yii::$app->view->assetBundles[$key] = $this->minifier->minifyCss($assetBundle);\n }\n }\n\n if ($this->combine) {\n $this->combiner = AssetMinifier::createObjet($this->combiner, Combiner::className());\n $this->combiner->process($this->minifyJs, $this->minifyCss);\n }\n }",
"public function updateExtList() {}",
"function import_json_file() {\n\t\t// Export requested.\n\t\tif ( !empty( $_POST ) && isset( $_POST['action'] ) && 'import' == sanitize_text_field( $_POST['action'] ) && check_admin_referer( 'widgeopts_import', 'widgeopts_nonce_import' ) ) {\n\n\t\t\t//allow .json upload\n\t\t\tadd_filter( 'upload_mimes', array( &$this, 'add_mime_types' ) );\n\t\t\t\n\t\t\t$uploaded_file = $_FILES['widgeopts_file'];\n\t\t\t$wp_filetype \t= wp_check_filetype_and_ext( $uploaded_file['tmp_name'], $uploaded_file['name'], false );\n\t\t\t\n\t\t\tif ( 'json' !== $wp_filetype['ext'] && ! wp_match_mime_types( 'json', $wp_filetype['type'] ) ) {\n\n\t\t\t\twp_die(\n\t\t\t\t\twp_kses(\n\t\t\t\t\t\t__( 'Invalid File! Please upload Widget Options exported data.' . $wp_filetype['ext'], 'widget-options' ),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'b' => array(),\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n\t\t\t\t\t'',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'back_link' => true,\n\t\t\t\t\t)\n\t\t\t\t);\n\n\t\t\t}\n\n\t\t\t// Check and move file to uploads directory\n\t\t\t$file_data = wp_handle_upload( $uploaded_file, array(\n\t\t\t\t'test_form' => false,\n\t\t\t) );\n\n\t\t\tif ( isset( $file_data['error'] ) ) {\n\t\t\t\twp_die(\n\t\t\t\t\tesc_html( $file_data['error'] ),\n\t\t\t\t\t'',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'back_link' => true,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Check if file exists?\n\t\t\tif ( ! file_exists( $file_data['file'] ) ) {\n\t\t\t\twp_die(\n\t\t\t\t\tesc_html__( 'Import file could not be found. Please try again.', 'widget-options' ),\n\t\t\t\t\t'',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'back_link' => true,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Get file contents and decode.\n\t\t\t$data = implode( '', file( $file_data['file'] ) );\n\t\t\t$data = json_decode( $data, true );\n\n\t\t\t// Delete import file.\n\t\t\tunlink( $file_data['file'] );\n\n\t\t\tif ( !is_array( $data ) || !isset( $data['widgetopts_exported'] ) ) {\n\t\t\t\twp_die(\n\t\t\t\t\tesc_html__( 'Imported file invalid and not generated by Widget Options Plugin.', 'widget-options' ),\n\t\t\t\t\t'',\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'back_link' => true,\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t//assign to variable to be able to used on frontend\n\t\t\t$this->imported = $this->organized_imported_data( $data );\n\t\t}\n\t}",
"protected function _postExec()\n {\n }",
"public function process(): void {\n if($this->shouldCache() && $this->hasCache()) {\n $this->restoreCache();\n\n return;\n }\n\n $folders = [];\n foreach($this->sources_to_parse as $source_to_parse) {\n $folder = $source_to_parse->getFolderToParse();\n if(!isset($folders[$folder])) {\n $folders[$folder] = [\n 'extensions' => [],\n 'flags' => [],\n ];\n }\n $folders[$folder]['extensions'] = [...$folders[$folder]['extensions'], ...$source_to_parse->getExtensions()];\n $folders[$folder]['flags'] = [...$folders[$folder]['flags'], ...$source_to_parse->getFlags()];\n }\n\n foreach($folders as $folder => $folder_sources) {\n $folder_sources['extensions'] = array_values(array_unique($folder_sources['extensions']));\n $folder_sources['flags'] = array_values(array_unique($folder_sources['flags']));\n $code_data = $this->analyzer->parseFolder($folder, $folder_sources);\n $this->info_data[] = $code_data;\n $i = count($this->info_data) - 1;\n foreach($folder_sources['flags'] as $flag) {\n if(!isset($this->info_data_flag_refs[$flag])) {\n $this->info_data_flag_refs[$flag] = [];\n }\n $this->info_data_flag_refs[$flag][] = $i;\n }\n $this->flags = [...$this->flags, ...$folder_sources['flags']];\n }\n $this->flags = array_values(array_unique($this->flags));\n\n if($this->shouldCache()) {\n file_put_contents(\n $this->file_cache,\n \"<?php\\n\\nreturn \" .\n var_export([\n 'info_data' => $this->info_data,\n 'info_data_flag_refs' => $this->info_data_flag_refs,\n ], true) . ';',\n );\n }\n }",
"protected function loadBaseExtensions() {}",
"public function onRun()\n {\n $this->prepareVars();\n\n // Exceptions\n $this->populateFilters();\n\n $this->tags = $this->listTags();\n }",
"function _ext_scripts()\r\n\t{\r\n\t\t$str = '';\r\n\r\n\t\t/* -------------------------------------------\r\n\t\t/* 'cp_js_end' hook.\r\n\t\t/* - Add Javascript into a file call at the end of the control panel\r\n\t\t/* - Added 2.1.2\r\n\t\t*/\r\n\t\t\t$str = $this->extensions->call('cp_js_end');\r\n\t\t/*\r\n\t\t/* -------------------------------------------*/\r\n\t\t\r\n\t\t$this->output->out_type = 'cp_asset';\r\n\t\t$this->output->set_header(\"Content-Type: text/javascript\");\r\n\t\t$this->output->set_header(\"Cache-Control: no-cache, must-revalidate\"); \r\n\t\t$this->output->set_header('Content-Length: '.strlen($str));\r\n\t\t$this->output->set_output($str);\r\n\t}",
"protected function postLoad(){\n\t\t\t\n\t\t}",
"protected function _afterLoad()\n {\n return parent::_afterLoad();\n }",
"public function onRun()\n {\n try {\n $api = new PluginApi($this->secret, $this->dataFolder);\n $this->setResult($api->basicGet(\"/information\"));\n } catch (\\Exception $e) {\n $this->setResult($e);\n }\n }",
"private function generatePluginJsonFile()\n {\n $path = $this->pluginRepository->getPluginPath($this->getName()).'plugin.json';\n\n if (! $this->filesystem->isDirectory($dir = dirname($path))) {\n $this->filesystem->makeDirectory($dir, 0775, true);\n }\n\n $this->filesystem->put($path, $this->getStubContents('json'));\n\n $this->console->info(\"Created : {$path}\");\n }",
"private function loadJson(){\n if(file_exists($this->fullPath.$this->jsonFile)) {\n $arCfg = get_object_vars(json_decode(file_get_contents($this->fullPath.$this->jsonFile)));\n $this->loadConfigs($arCfg);\n }\n }"
] | [
"0.697109",
"0.6882445",
"0.6381743",
"0.6233389",
"0.6082552",
"0.60496193",
"0.5937959",
"0.59204483",
"0.57706773",
"0.57621235",
"0.57584834",
"0.5691561",
"0.56665313",
"0.5618304",
"0.559693",
"0.55778044",
"0.55732644",
"0.555422",
"0.5551745",
"0.55359304",
"0.55359304",
"0.55359304",
"0.55359304",
"0.55190074",
"0.5517306",
"0.5517306",
"0.55088127",
"0.5507608",
"0.5495495",
"0.54659176",
"0.5464423",
"0.5456834",
"0.5450008",
"0.54428095",
"0.54329693",
"0.5432819",
"0.54188365",
"0.54154116",
"0.54029375",
"0.53854644",
"0.53834665",
"0.53522176",
"0.5338839",
"0.53280497",
"0.5320801",
"0.5318071",
"0.5294739",
"0.52903205",
"0.52767754",
"0.52767754",
"0.52674043",
"0.52598965",
"0.5259386",
"0.52505887",
"0.52381676",
"0.5228181",
"0.5224212",
"0.52213264",
"0.52180916",
"0.5216267",
"0.52068114",
"0.52014685",
"0.52001816",
"0.5186172",
"0.51783425",
"0.5178082",
"0.5178024",
"0.5177721",
"0.5173122",
"0.51692814",
"0.5168996",
"0.5166954",
"0.51565766",
"0.5147801",
"0.5147801",
"0.5147801",
"0.514298",
"0.5131946",
"0.5126113",
"0.51218885",
"0.5116398",
"0.51096636",
"0.5109242",
"0.51079696",
"0.51026434",
"0.5096657",
"0.5090005",
"0.5082133",
"0.5080029",
"0.5075017",
"0.507345",
"0.5067298",
"0.50670993",
"0.5062635",
"0.50530416",
"0.5047404",
"0.50443226",
"0.5041776",
"0.50300443",
"0.5022216",
"0.5018562"
] | 0.0 | -1 |
Initialize SmashPig context and return configuration object | public static function setSmashPigProvider( $provider ) {
$ctx = Context::get();
$spConfig = ProviderConfiguration::createForProvider(
$provider,
$ctx->getGlobalConfiguration()
);
// FIXME: should set a logger prefix here, but we've got a chicken
// and egg problem with the Gateway constructor
$ctx->setProviderConfiguration( $spConfig );
return $spConfig;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function configure();",
"abstract public function configure();",
"public function configure() {}",
"public function configure() {}",
"protected function initializeConfiguration() {}",
"function __construct() {\n //invoke the init method of the config object in context\n $this->init();\n }",
"abstract protected function configure();",
"abstract protected function configure();",
"public static function config();",
"public function init ()\n\t{\n\t\t$objApplicationOptions = new Zend_Config($this->getInvokeArg('bootstrap')->getOptions());\n\t\t$this->_options = $objApplicationOptions->catalog;\n\t}",
"public function configure() {\r\n\t\r\n\t}",
"public function __construct()\n {\n $this->params['config'] = config('app');\n }",
"public function __construct()\n {\n require_once(dirname(__FILE__).'/../../../behat4eve2Plugin/vendor/autoload.php');\n require_once(dirname(__FILE__).'/../../../../config/ProjectConfiguration.class.php');\n\n $configuration = ProjectConfiguration::getApplicationConfiguration('default', 'dev', true);\n sfContext::createInstance($configuration);\n }",
"function __construct() {\n $this->conf = new Conf();\n }",
"public function it_can_be_configured()\n {\n $this->beConstructedWith(self::CONFIG_BASIC);\n $this->getWrappedObject();\n }",
"function __construct()\r\n\t{\r\n\t\trequire './configs/configs.php';\r\n\t}",
"private function initConfig()\n {\n return $this->config = [\n 'api' => 'https://api.gfycat.com/v1',\n ];\n }",
"public function configure() {\n\t\t}",
"protected function addSPLConfigs()\n {\n\n $this['queue'] = $this->factory(\n function () {\n return new \\SplQueue();\n }\n );\n\n $this['objectStorage'] = $this->factory(\n function () {\n return new \\SplObjectStorage();\n }\n );\n\n }",
"public function init() {\n //TODO override and put config intialization code here\n }",
"public function init($config);",
"public function configure()\n {\n $this->container = require __DIR__ . '/../../config/configure-services.php';\n $this->scratchSpace = vfsStream::setup('scratch')->url();\n }",
"protected function _initPhpConfig()\n {\n }",
"function initialize()\n {\n if (isset($this->key)) {\n $key = common_config('contextio', 'key');\n if (empty($key)) {\n Config::save(\n 'contextio',\n 'key',\n $this->key\n );\n }\n }\n\n if (isset($this->secret)) {\n $secret = common_config('contextio', 'secret');\n if (empty($secret)) {\n Config::save('contextio', 'secret', $this->secret);\n }\n }\n }",
"abstract public function init(array $config);",
"function __construct() {\n $this->getSystemConfig();\n }",
"public function __construct()\n {\n\n // $configuration = $this->get('configuration');\n\n\n }",
"public function __construct()\n {\n $this->_config = sspmod_janus_DiContainer::getInstance()->getConfig();\n }",
"public function __construct()\n {\n $this->config = include(dirname(__FILE__). '/../config/config.php');\n }",
"public function configure()\n {\n }",
"protected function configureGSheetProcessingConsoleParameters()\n {\n $this->doConfigureDataSourceOptions();\n $this->doConfigureGApiConnectionOptions();\n //->doConfigureConfigFilename(); //@todo This is not being used by the parser, currently.\n\n return $this;\n }",
"public function _construct()\n {\n $this->_init('signifymap/config', 'id');\n }",
"public function config()\n {\n }",
"abstract public function __construct( $config );",
"public function __construct()\n {\n $this->_config = request('_config');\n }",
"public function __construct()\n {\n $this->smarty = smartyConfiguration::configuration();\n }",
"public function __construct() {\n\n $this->loadConfig();\n\n }",
"public function init($gp, $tsConfig)\n {\n parent::init($gp, $tsConfig);\n $this->setEmailAndSubject();\n }",
"public function __construct()\n {\n \tglobal $psp;\n\n \t$this->the_plugin = $psp;\n\t\t\t$this->module_folder = $this->the_plugin->cfg['paths']['plugin_dir_url'] . 'modules/smushit/';\n\n\t\t\t$this->settings = $this->the_plugin->get_theoption( 'psp_smushit' );\n\t\t\t\n\t\t\t$this->init();\n }",
"protected function configure()\n {\n }",
"protected function configure()\n {\n }",
"public function __construct()\n\t{\n\t\tglobal $appconf;\n\t\t$this->appconf = $appconf;\n\t\tunset($appconf);\n\t}",
"public function createConfig()\n\t{\n\t}",
"protected function configure()\n {\n\n \n }",
"protected static function init() {\r\n\t\tif (self::$cfg == null)\r\n\t\t\tself::$cfg = new config(factory::loadCfg(__CLASS__));\r\n\t}",
"public function __construct()\n {\n // initialize the default configuration\n $this->initDefaultDirectories();\n $this->initDefaultLoggers();\n $this->initDefaultScanners();\n $this->initDefaultExtractors();\n $this->initDefaultProvisioners();\n $this->initDefaultInitialContext();\n }",
"protected function setup() \n {\n if (!isset($this->ini['log'])) {\n $this->fatal_error('The configuration does not define the \\'log\\' setting.');\n }\n\n if (!isset($this->ini['ttl'])) {\n $this->fatal_error('The configuration does not define the \\'ttl\\' setting.');\n }\n\n if (isset($this->ini['redis'])) {\n $this->_redis = new RedisFunctions(\n $this->ini['ttl'], $this->ini['redis']['host'], \n $this->ini['redis']['port'], $this->ini['redis']['timeout']);\n } else {\n $this->fatal_error('The configuration does not define a redis section.');\n }\n\n if ($this->is_parent()) {\n $emails = array();\n if (isset($this->ini['emails'])) {\n foreach ($this->ini['emails'] as $email) {\n $emails[] = $email;\n $this->log(\"Adding $email to notification list.\");\n }\n }\n $this->email_distribution_list = $emails;\n }\n\n $this->_startTime = microtime(true);\n }",
"protected function setUp()\n { \n $settings = require __DIR__ . '/../../../config/settings.php';\n $container = new \\Slim\\Container($settings);\n $container['stockconfig'] = function ($config) {\n $stockconfig =$config['settings']['stockconfig']; \n return $stockconfig;\n };\n $dependencies = new Dependencies($container);\n $dependencies->registerLogger();\n $dependencies->registerDatabase();\n $this->object = new ScoringResource($container);\n \n }",
"public function __construct() {\n $this->config();\n parent::__construct();\n }",
"abstract public function generateConfiguration();",
"protected function setup_config() {\n\t\t\t// TODO: Implement setup_config() method.\n\t\t}",
"public function __construct(){\n\t\t\n\t\t$this->config = Zend_Registry::get('config');\n\n\t}",
"protected function configure()\n {\n try {\n $this->config = require_once PROJECT_ROOT . '/app/config/config.php';\n } catch (Exception $e) {\n Dweet_Logger::log('error', $e->getMessage() . ' ' . $e->getTraceAsString());\n }\n\n return $this;\n }",
"public function setup() {\n global $CFG;\n\n // Set plugin as enabled in config for this module type.\n set_config('turnitinapiurl', 'http://www.example.com', 'plagiarism_turnitinsim');\n set_config('turnitinapikey', 1234, 'plagiarism_turnitinsim');\n set_config('turnitinenablelogging', 0, 'plagiarism_turnitinsim');\n\n $CFG->mtrace_wrapper = 'plagiarism_turnitinsim_mtrace';\n }",
"private function initConfig() {\n\t\t$configLoader = new ConfigLoader($this->_env);\n\n /** set config to Di container */\n $this->_di->set('config', $configLoader, TRUE);\n $this->_config = $configLoader;\n\t}",
"protected function _initConfig()\n\t{\n\t\tZend_Registry::set('config', new Zend_Config($this->getOptions()));\n\t}",
"public function configure()\n {\n //\n }",
"abstract protected function defineConfiguration();",
"public function __construct()\n\t{\n\t\t$this->ses = SesClient::factory(Config::get('aws.ses'));\n\t\t$this->default = Config::get('email');//gets default values for data initilization\n\t}",
"public function _initBootstrap(){\n $this->_config = $this->getOptions();\n }",
"public function initConfig() {\r\n\t$config = array();\r\n\tinclude($this->name . '/config.php');\r\n\t\\app::$config = array_merge(\\app::$config, $config);\r\n }",
"public function __construct()\n {\n parent::__construct();\n $this->config = config($this->configName);\n }",
"public static function init() {\n\t\t\n\t\t// get various user info\n\t\t$defaultUser = Config::getOption(\"user\");\n\t\t$defaultPass = Config::getOption(\"pass\");\n\t\t$readwriteUser = Config::getOption(\"readwrite.user\");\n\t\t$readwritePass = Config::getOption(\"readwrite.pass\");\n\t\t\n\t\t// set-up the database connection info\n\t\t$name = Config::getOption(\"name\");\n\t\t$host = Config::getOption(\"host\");\n\t\t$user = (!$readwriteUser || empty($readwriteUser)) ? $defaultUser : $readwriteUser;\n\t\t$pass = (!$readwritePass || empty($readwritePass)) ? $defaultPass : $readwritePass;\n\t\t$port = Config::getOption(\"port\");\n\t\tPheasant::setup(\"mysql://\".$user.\":\".$pass.\"@\".$host.\":\".$port.\"/\".$name);\n\t\t\n\t}",
"public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->hconfig = Config::get('heartbeat');\n\t}",
"public function __construct()\n\t{\n\t\t//GSMS::$config =& get_config();\n\t\tGSMS::$class['system_log']->log('debug', \"Config Class Initialized\");\n\n\t\t// Set the base_url automatically if none was provided\n\t\tif (GSMS::$config['base_url'] == '')\n\t\t{\n\t\t\tif (isset($_SERVER['HTTP_HOST']))\n\t\t\t{\n\t\t\t\t$base_url = isset($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off' ? 'https' : 'http';\n\t\t\t\t$base_url .= '://'. $_SERVER['HTTP_HOST'];\n\t\t\t\t$base_url .= str_replace(basename($_SERVER['SCRIPT_NAME']), '', $_SERVER['SCRIPT_NAME']);\n\t\t\t}\n\n\t\t\telse\n\t\t\t{\n\t\t\t\t$base_url = 'http://localhost/';\n\t\t\t}\n\t\t\tGSMS::$siteURL=$base_url;\n\t\t\t$this->set_item('base_url', $base_url);\n\t\t\t\n\t\t}\n\t}",
"public function __construct()\n {\n include(DOC_ROOT.'/plugins/wikipal/_plugin_config.inc.php');\n\n // load config into the object\n $this->config = $pluginConfig;\n }",
"public function __construct()\n {\n // since this class extends Mage_Core_Model_Config we have access to that classes protected properties\n $this->_xml = \\Mage::getConfig()->_xml;\n }",
"protected function addConfiguration()\n {\n $this['config'] = $this->share(\n function () {\n $user_config_file = (file_exists('phpdoc.xml'))\n ? 'phpdoc.xml'\n : 'phpdoc.dist.xml';\n\n return \\Zend\\Config\\Factory::fromFiles(\n array(\n __DIR__.'/../../data/phpdoc.tpl.xml',\n $user_config_file\n ), true\n );\n }\n );\n }",
"public function __construct() {\n $iniPath=\"/etc/lxd_sync.conf\";\n if(!file_exists($iniPath)) die(\"LXD-SYNC:[FATAL] Configuration File not Found : {$iniPath}\");\n $this->_CONFIG = parse_ini_file($iniPath, true);\n}",
"public function __construct($config)\n {\n }",
"public function initialize(array $config);",
"protected function __construct() {\n $this->hacConfig = false;\n $config = new FacebookConfig();\n $this->loadConfig($config->getConfig());\n }",
"protected function init($config)\n {\n if (self::$conn) {\n return;\n }\n\n require_once(Director::getAbsFile(\"messagequeue/thirdparty/stomp-php-1.0.0/Stomp.php\"));\n\n $conf = $config[\"stomp\"];\n self::$conn = new Stomp($conf[\"server\"]);\n\n if (isset($conf[\"durableClientId\"])) {\n self::$conn->clientId = $conf[\"durableClientId\"];\n }\n\n // @TODO: handle authentication and any other connection properties\n self::$conn->connect();\n }",
"public function __construct(array $config = array());",
"public function __construct() {\n\n // Loading module configuration file data\n $this->_config = Kohana::config('modulename')->as_array();\n\n // Say hi! usign date entered in the config file\n echo 'Hello Modulename! '.$this->_config['some_config_value'];\n\n }",
"protected function _initConfig()\n\t{\n\t\tZend_Registry::set('config', $this->getOptions());\n\t}",
"protected function getConfiguration() {}",
"protected function __construct() {\n\t\tglobal $conf, $DB;\n\t\tself::$_conf = $conf;\n\t\tself::$_DB = $DB;\n\t}",
"public function __construct() {\n\t\t$this->autoSetConfigurationFolder();\n\t}",
"public static function configuration(): ArrayObject\n {\n //====================================================================//\n // Configuration Array Already Exists\n //====================================================================//\n if (isset(self::core()->conf)) {\n return self::core()->conf;\n }\n\n //====================================================================//\n // Load Module Core Configuration\n //====================================================================//\n\n //====================================================================//\n // Initialize Empty Configuration\n self::core()->conf = new ArrayObject(array(), ArrayObject::ARRAY_AS_PROPS);\n $config = &self::core()->conf;\n\n //====================================================================//\n // Load Module Core Configuration from Definition File\n //====================================================================//\n // Translations Parameters\n $config->DefaultLanguage = SPLASH_DF_LANG;\n\n //====================================================================//\n // WebService Core Parameters\n $config->WsMethod = SPLASH_WS_METHOD;\n $config->WsTimout = SPLASH_TIMEOUT;\n $config->WsCrypt = SPLASH_CRYPT_METHOD;\n $config->WsEncode = SPLASH_ENCODE;\n $config->WsHost = 'www.splashsync.com/ws/soap';\n $config->WsPostCommit = true;\n\n //====================================================================//\n // Activity Logging Parameters\n $config->Logging = SPLASH_LOGGING;\n $config->TraceIn = SPLASH_TRACE_IN;\n $config->TraceOut = SPLASH_TRACE_OUT;\n $config->TraceTasks = SPLASH_TRACE_TASKS;\n $config->SmartNotify = SPLASH_SMART_NOTIFY;\n\n //====================================================================//\n // Custom Objects Extensions\n $config->ExtensionsPath = null;\n\n //====================================================================//\n // Custom Parameters Configurator\n $config->Configurator = JsonConfigurator::class;\n\n //====================================================================//\n // Server Requests Configuration\n $config->server = array();\n\n //====================================================================//\n // Load Module Local Configuration (In Safe Mode)\n //====================================================================//\n try {\n $localConf = self::local()->parameters();\n } catch (Exception $e) {\n $localConf = array();\n }\n //====================================================================//\n // Complete Local Configuration with ENV Variables\n SplashUrlHelper::completeParameters($localConf);\n //====================================================================//\n // Validate Local Parameters\n if (self::validate()->isValidLocalParameterArray($localConf)) {\n //====================================================================//\n // Import Local Parameters\n foreach ($localConf as $key => $value) {\n $config->{$key} = is_scalar($value) ? trim((string) $value) : $value;\n }\n }\n\n //====================================================================//\n // Load Module Local Custom Configuration (from Configurator)\n //====================================================================//\n $customConf = self::configurator()->getParameters();\n //====================================================================//\n // Import Local Parameters\n foreach ($customConf as $key => $value) {\n $config->{$key} = is_scalar($value) ? trim((string) $value) : $value;\n }\n\n return self::core()->conf;\n }",
"public function __construct() {\n $this->configs = new ArrayCollection();\n }",
"protected function configure()\n {\n $this->addArguments(array(\n new sfCommandArgument('application', sfCommandArgument::REQUIRED, 'The application name.'),\n new sfCommandArgument('source_path', sfCommandArgument::REQUIRED, 'The absolute source directory path, e.g. /path/to/my/images'),\n ));\n\n $this->addOptions(array(\n new sfCommandOption('env', null, sfCommandOption::PARAMETER_REQUIRED, 'The environment, default dev', 'dev'),\n new sfCommandOption('connection', null, sfCommandOption::PARAMETER_REQUIRED, 'The connection name, default doctrine.', 'doctrine'),\n new sfCommandOption('file_mode', null, sfCommandOption::PARAMETER_REQUIRED, 'The file mode, default to 0777', 0777),\n // add your own options here\n ));\n\n $this->namespace = 'sfFilebase';\n $this->name = 'import';\n $this->briefDescription = 'Imports files and directories into your filebase application database.';\n $this->detailedDescription = <<<EOF\nThe [sfFilebase:import|INFO] imports files and directories into your filebase application database.\nCall it with:\n [php symfony sfFilebase:import|INFO]\nEOF;\n }",
"public function __construct()\n {\n $this->tpl = new \\Phalcon\\Config($this->tpl);\n self::$instance = $this;\n }",
"public static function getConfiguration();",
"function initializer() {\n init_env();\n }",
"protected function initConfig()\n {\n $this->di->setShared('config', function () {\n $path = BASE_DIR . 'app/config/';\n\n if (!is_readable($path . 'config.php')) {\n throw new RuntimeException(\n 'Unable to read config from ' . $path . 'config.php'\n );\n }\n\n $config = include $path . 'config.php';\n\n if (is_array($config)) {\n $config = new Config($config);\n }\n\n if (!$config instanceof Config) {\n $type = gettype($config);\n if ($type == 'boolean') {\n $type .= ($type ? ' (true)' : ' (false)');\n } elseif (is_object($type)) {\n $type = get_class($type);\n }\n\n throw new RuntimeException(\n sprintf(\n 'Unable to read config file. Config must be either an array or Phalcon\\Config instance. Got %s',\n $type\n )\n );\n }\n\n if (is_readable($path . APPLICATION_ENV . '.php')) {\n $override = include_once $path . APPLICATION_ENV . '.php';\n\n if (is_array($override)) {\n $override = new Config($override);\n }\n\n if ($override instanceof Config) {\n $config->merge($override);\n }\n }\n\n return $config;\n });\n }",
"private function initialize() {\n // Lecture de la config du batch\n $this->load_config();\n $GLOBALS['config'] = $this->config;\n // Initialisation du logger\n if (strcasecmp(\"DEBUG\", $this->config->debug_level) == 0) {\n $debug_const = KLogger::DEBUG;\n }\n else if(strcasecmp(\"INFO\", $this->config->debug_level) == 0) {\n $debug_const = KLogger::INFO;\n }\n else if(strcasecmp(\"WARN\", $this->config->debug_level) == 0) {\n $debug_const = KLogger::WARN;\n }\n else if(strcasecmp(\"ERROR\", $this->config->debug_level) == 0) {\n $debug_const = KLogger::ERROR;\n }\n else if(strcasecmp(\"FATAL\", $this->config->debug_level) == 0) {\n $debug_const = KLogger::FATAL;\n }\n else if(strcasecmp(\"OFF\", $this->config->debug_level) == 0) {\n $debug_const = KLogger::OFF;\n }\n $this->log = new KLogger ( $this->config->log_file , $debug_const );\n $GLOBALS['logger'] = $this->log;\n $this->check_conf();\n $this->log->LogDebug(\"Init...OK\");\n\n }",
"public function run()\n {\n Config::create(['igdb_key' => '1234test']);\n }",
"protected function setUp()\n { \n $settings = require __DIR__ . '/../../../config/settings.php';\n $container = new \\Slim\\Container($settings);\n $container['stockconfig'] = function ($config) {\n $stockconfig =$config['settings']['stockconfig']; \n return $stockconfig;\n };\n $dependencies = new Dependencies($container);\n $dependencies->registerLogger();\n $dependencies->registerDatabase();\n $this->object = new StockResource($container);\n \n }",
"protected function _initConfig()\n {\n // Retrieve configuration from file\n $config = new Zend_Config_Ini(APPLICATION_PATH . '/config/application.ini', APPLICATION_ENV);\n\n // Add config to the registry so it is available globally\n $registry = Zend_Registry::getInstance();\n $registry->set('config', $config);\n \n // Return it, so that it can be stored by the bootstrap\n return $config;\n }",
"protected function _initConfig()\n {\n $config = new Zend_Config_Ini(\n APPLICATION_PATH . \"/configs/application.ini\",\n $this->getEnvironment()\n );\n Zend_Registry::set('config', $config);\n return $config;\n }",
"public function processConfiguration() {}",
"protected function __construct() {\n \t// Set the configuration file\n \t$this->setConfigFile(APPLICATIONPATH.'/configurations/config.ini');\n \t// Load the configuration\n \t// into the system\n \t$this->readConfig();\n // Setup the database\n // $this->setDatabase();\n // Setup our caching system\n // $this->setCache();\n \t// Return instance\n \treturn $this;\n }",
"public function __construct()\n {\n $this->queue = new Pheanstalk('localhost', '11300', null, true);\n }",
"public function init($config)\n\t{\n\t}",
"public function setup()\n {\n $this->config = new Config($this->emailOrMobileNumber, $this->merchantKey);\n }",
"public function __construct() {\n require_once(dirname(__FILE__).DIRECTORY_SEPARATOR.'Config'.DIRECTORY_SEPARATOR.'Main.php');\n }",
"public function getConfiguration() {}",
"public function getConfiguration() {}",
"public function __construct() {\n $this->configuration = new Database_Configuration();\n }"
] | [
"0.5714789",
"0.5712379",
"0.5621134",
"0.5621134",
"0.5573061",
"0.5556468",
"0.5543287",
"0.5543287",
"0.5530572",
"0.54214585",
"0.53707373",
"0.53609705",
"0.53600633",
"0.53128165",
"0.5301196",
"0.5293151",
"0.52765054",
"0.5258332",
"0.52520496",
"0.5249621",
"0.52357864",
"0.5234303",
"0.5221839",
"0.5218032",
"0.5184425",
"0.51646256",
"0.5137452",
"0.513503",
"0.5132518",
"0.51219004",
"0.5118248",
"0.51169986",
"0.51149917",
"0.5105313",
"0.51052403",
"0.51022625",
"0.51007795",
"0.5097599",
"0.50871617",
"0.5086273",
"0.5086273",
"0.5079563",
"0.5055135",
"0.50451535",
"0.5038107",
"0.5035092",
"0.5025259",
"0.5022253",
"0.5021375",
"0.5016097",
"0.49990866",
"0.49889964",
"0.49773023",
"0.49770737",
"0.49740487",
"0.49697873",
"0.49671024",
"0.4960613",
"0.49593458",
"0.49572828",
"0.49479184",
"0.49437097",
"0.49383923",
"0.49332324",
"0.49279416",
"0.49260658",
"0.4901304",
"0.49009338",
"0.48989454",
"0.48978373",
"0.48896974",
"0.48866883",
"0.48738047",
"0.48703748",
"0.48695526",
"0.486924",
"0.48658654",
"0.4864992",
"0.4864755",
"0.48587742",
"0.48576578",
"0.48501682",
"0.48489594",
"0.48477745",
"0.48468977",
"0.484616",
"0.48446375",
"0.4844513",
"0.48425192",
"0.48410508",
"0.48335898",
"0.48270243",
"0.48263267",
"0.48244256",
"0.48213655",
"0.48200062",
"0.481944",
"0.4815376",
"0.4814585",
"0.48133382"
] | 0.5848287 | 0 |
This function checks the user's login details and matches with the DB. | function loginCheck() {
if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (isset($_POST['submit'])) {
global $name, $emailErr, $passwd, $pwdErr, $found, $verify_id;
if (empty($_POST["email"])) {
$emailErr = "email is required";
}
else {
$name = test_input($_POST["email"]);
// check if e-mail address syntax is valid or not
if (!preg_match("/([\w\-]+\@[\w\-]+\.[\w\-]+)/",$name)) {
$emailErr = "Invalid email";
return false;
}
}
if (empty($_POST['pwd'])) {
$pwdErr = "password is required";
}
else {
$passwd = test_input($_POST["pwd"]);
$pass_md = md5($passwd);
}
if (empty($emailErr) && empty($pwdErr)) {
require 'database_connection.php';
$sql = "SELECT user_id,user_name, email_id, password FROM signup";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
while($row = $result->fetch_assoc()) {
$uname = $row["user_name"];
$email = $row["email_id"];
$pass = $row["password"];
$user_id = $row["user_id"];
if (($name == $uname || $name == $email) && $pass_md == $pass) {
$_SESSION["user"] = $uname;
$_SESSION["uid"] = $user_id;
$found = 1;
return true;
break;
}
}
}
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function checkLogin() {\r\n\t\t$post = $this -> sanitize();\r\n\t\textract($post);\r\n\t\t// Hash the password that was entered into the form (if it was correct, it will match the hashed password in the database)\r\n\t\t$password = sha1($password);\r\n\t\t// Query\r\n\t\t$query = \"SELECT username, userID, profilePic, access, email FROM users WHERE username='$username' AND password='$password'\";\r\n\t\t$data = $this -> singleSelectQuery($query);\r\n\t\tif($data){\r\n\t\t\t//set up the session\r\n\t\t\t$_SESSION['userID'] = $data['userID'];\r\n\t\t\t$_SESSION['username'] = $data['username'];\r\n\t\t\t$_SESSION['profilePic'] = $data['profilePic'];\r\n\t\t\t$_SESSION['userType'] = $data['userType'];\r\n\t\t\t$_SESSION['access'] = $data['access'];\r\n\t\t\t//redirects to their profile\r\n\t\t\theader('location: index.php?page=profile&userID='.$_SESSION['userID']);\r\n\t\t} else {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t}",
"private function compare_with_login()\n {\n }",
"public function is_logged_user_in_db() \n {\n $conn = $this->conn;\n $login = $this->login;\n \n $params = array($login);\n $query = 'SELECT * FROM users WHERE login = ?';\n \n $rs = $conn->Execute($query, $params);\n \n if (!$rs) \n {\n Av_exception::write_log(Av_exception::DB_ERROR, $conn->ErrorMsg());\n \n return FALSE;\n }\n \n if (!$rs->EOF) \n {\n return TRUE;\n } \n }",
"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 id_matches_db($username, $password)\n{\n global $idStore;\n\n if($idStore->authenticate($username, $password))\n {\n return true;\n }else{\n return false;\n }\n}",
"function validateUser($username,$password,$db){\n $query = $db->query(\"SELECT * FROM users WHERE `username`='$username'\");\n \n if($query->num_rows != 1){\n echo('invalid');\n }else{\n $array = $query->fetch_assoc();\n if($password == $array['password']){\n $auth = $array['authorization'];\n logUserIn($username,$auth);\n echo(\"valid\");\n //header(\"Location: /employee/\");\n }else{\n echo 'notFound';\n }\n }\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}",
"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 }",
"function checkLogin() {\n /* Check if user has been remembered */\n if (isset($_COOKIE['cook_VenusetP_UserEmail']) && isset($_COOKIE['cook_Venueset_UserPassword'])) {\n $varUserEmail = $_COOKIE['cook_VenusetP_UserEmail'];\n $varUserPassword = $_COOKIE['cook_Venueset_UserPassword'];\n /* Confirm that username and password are valid */\n $arrUserFlds = array('pkUserID', 'UserEmail', 'UserPassword', 'UserFirstName');\n $varUserWhere = ' 1 AND UserEmail = \\'' . $varUserEmail . '\\' AND UserPassword = \\'' . md5(trim($varUserPassword)) . '\\'';\n //echo '<pre>';print_r($varUserWhere);exit;\n $arrUserList = $this->select(TABLE_USERS, $arrUserFlds, $varUserWhere);\n if (count($arrUserList) > 0) {\n /* $_SESSION['VenusetP_UserEmail'] = $arrUserList[0]['UserEmail'];\n $_SESSION['VenusetP_UserID'] = $arrUserList[0]['pkUserID'];\n $_SESSION['VenusetP_UserName'] = $arrUserList[0]['UserFirstName']; */\n }\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}",
"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}",
"function _isMatch()\n {\n if (isset($_POST['login'])) {\n if ($this->name_post == $this->name_db && password_verify($this->pass_post, $this->pass_db)) {\n return true;\n }\n $this->mismatch = true;\n }\n return false;\n }",
"public function loginCheck()\n\t{\n\t}",
"function check_login($data){\n /* Codify the password */\n $sha1_password = sha1($data['password']);\n /* Check the login data at the DB table users */\n $this->db->from('users');\n $this->db->where('username', $data['username']);\n $this->db->where('password',$sha1_password);\n $result = $this->db->get();\n if($result->num_rows() > 0){\n /* If it works return the user's id */\n return true;\n } else {\n return false;\n } \n }",
"public function validate_login() {\n\t\t$userid=$_POST['user_id'];\n\t\t$password=$_POST['password'];\n\t\t$compid=$_POST['company_id'];\n\t\t\n\n\t\t$sql=\"SELECT u.id, u.user_name FROM users u, hmz_cust_info ci where ci.id=u.cust_id\n\t\t\tand u.user_id='$userid' and u.password='$password' and ci.cust_id='$compid';\";\n\t\t$result=$this->runQuery(\"getAll\",$sql);\n\t\tif(count($result)>0) {\n\t\t\t$_SESSION['user_id']=$result[0];\n\t\t\t$_SESSION['user_name']=$result[1];\n\t\t\theader('location: ?a=P&b=dashboard');\n\t\t}\n\t\telse\n\t\t\theader('location: ?a=login&b=f');\n\n\t}",
"public function loginUserConditionMatchesSingleLoggedInUser() {}",
"public function loginUserConditionMatchesSingleLoggedInUser() {}",
"function validate_cred($email_local = null, $password_local = null){\n global $email;\n global $pwd;\n if ($email_local != null && $password_local != null){\n \n }\n else{\n $email_local = isset($_REQUEST[$email]) ? $_REQUEST[$email] : null;\n $password_local = isset($_REQUEST[$pwd]) ? $_REQUEST[$pwd] : null;\n \n }\n\n if ($email_local != null && $password_local != null){\n $conn = open_db_connection('localhost', ['new_user','Redbirdp1'], 'login');\n if ($conn ->connect_errno){\n echo('connection failed: ' . $conn->connect_error);\n }\n $statement = new Statement();\n // $statement->select([\"*\"])->from()->table(\"members\")->where(\"username\")->equals($email_local);\n $statement->select([\"*\"])->from()->table(\"members\");\n //echo $statement->get_statement();\n $result = query_db($conn, $statement);\n \n if ($result != null)\n {\n if ($result->num_rows > 0) {\n // output data of each row\n $flag = false;\n while($row = $result->fetch_row()) {\n //echo \"<br>\". $row;\n //echo \"<br>\" . $email_local . \" \" . $password_local;\n //echo \"<br>\" . $row[0];\n //echo \"<br>\" . $row[1];\n if ($row[0] == $email_local && $row[1] == $password_local){\n $flag = true;\n break;\n }\n }\n if ($flag){\n return true;\n }\n else{\n return false;\n }\n } else {\n echo \"0 results\";\n }\n return true;\n }\n echo '<br>Authentificaiton failed not a valid user';\n return true;\n }\n\n return false;\n\n}",
"public function DB_checkLogin($data){\n\t\ttry {\n\t\t\t\n\t\t\tparent::__construct(DB_DRIVER.':dbname='.DB_NAME.';host='.DB_HOST, DB_USERNAME, DB_PASSWORD);\n\t\t\t$this->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); \n\n\t\t\t$query = $this->prepare('SELECT email,password,first_name,last_name,date_of_birth,time_stamp FROM '.DB_TABLE.' WHERE email = :email');\n\t\t\t$query->execute(array(\n\t\t\t':email' => $data['email']\n\t\t\t));\n\n\t\t\tif($query->rowCount() === 1){\n\t\t\t\twhile ($row = $query->fetch(PDO::FETCH_OBJ)){\n\t\t\t\t\tif (password_verify($data['password'], $row->password)) {\t\t\n\t\t\t\t\t\tsetcookie('user', $row->first_name.'|'.$row->last_name.'|'.$row->date_of_birth.'|'.$row->time_stamp, time()+3600, \"/reg_form/\");\t\t\t\t\t\t\n\t\t\t\t\t\treturn true;\t\t\t\t\t\n\t\t\t\t\t} else {\n\t\t\t\t\t\theader('Refresh: 2; url='.BASEPATH.'user/');\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t} else {\n\t\t\t\tdie('Incorrect details.');\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} catch(PDOException $e){\n\t\t\techo 'ERROR: '.$e->getMessage();\n\t\t}\n\t}",
"public function check() {\n $check = $this->mysqli->query(\"SELECT * FROM user_info WHERE email='$this->email' && password ='$this->password' LIMIT 1\") or die($this->mysqli->error);\n $count = $check->num_rows;\n\n if ($count) {\n while($rows = $check->fetch_array(MYSQLI_ASSOC)){\n $this->loginID = $rows['loginID'];\n $_SESSION['loginID'] = $this->loginID;\n }\n $_SESSION['email'] = $this->email;\n $this->result .= \"Successfully Logged In\";\n } else {\n $this->result .= \"Sign In error!! Please try again\";\n }\n }",
"public function check_user()\n {\n global $_user;\n $loginFailed = false;\n //change the way we recover the cookie depending on how it is formed\n $sso = $this->decode_cookie($_GET['sso_cookie']);\n\n //error_log('check_user');\n //error_log('sso decode cookie: '.print_r($sso,1));\n\n //lookup the user in the main database\n $user_table = Database::get_main_table(TABLE_MAIN_USER);\n $sql = \"SELECT user_id, username, password, auth_source, active, expiration_date, status\n FROM $user_table\n WHERE username = '\".trim(Database::escape_string($sso['username'])).\"'\";\n $result = Database::query($sql);\n if (Database::num_rows($result) > 0) {\n //error_log('user exists');\n $uData = Database::fetch_array($result);\n //Check the user's password\n if ($uData['auth_source'] == PLATFORM_AUTH_SOURCE) {\n //This user's authentification is managed by Chamilo itself\n // check the user's password\n // password hash comes already parsed in sha1, md5 or none\n\n /*\n error_log($sso['secret']);\n error_log($uData['password']);\n error_log($sso['username']);\n error_log($uData['username']);\n */\n global $_configuration;\n // Two possible authentication methods here: legacy using password\n // and new using a temporary, session-fixed, tempkey\n if (($sso['username'] == $uData['username']\n && $sso['secret'] === sha1(\n $uData['username'].\n Session::read('tempkey').\n $_configuration['security_key']\n )\n )\n or (\n ($sso['secret'] === sha1($uData['password']))\n && ($sso['username'] == $uData['username'])\n )\n ) {\n //error_log('user n password are ok');\n //Check if the account is active (not locked)\n if ($uData['active']=='1') {\n // check if the expiration date has not been reached\n if (empty($uData['expiration_date'])\n or $uData['expiration_date'] > date('Y-m-d H:i:s')\n or $uData['expiration_date']=='0000-00-00 00:00:00') {\n\n //If Multiple URL is enabled\n if (api_get_multiple_access_url()) {\n //Check the access_url configuration setting if\n // the user is registered in the access_url_rel_user table\n //Getting the current access_url_id of the platform\n $current_access_url_id = api_get_current_access_url_id();\n // my user is subscribed in these\n //sites: $my_url_list\n $my_url_list = api_get_access_url_from_user($uData['user_id']);\n } else {\n $current_access_url_id = 1;\n $my_url_list = array(1);\n }\n\n $my_user_is_admin = UserManager::is_admin($uData['user_id']);\n\n if ($my_user_is_admin === false) {\n if (is_array($my_url_list) && count($my_url_list) > 0) {\n if (in_array($current_access_url_id, $my_url_list)) {\n // the user has permission to enter at this site\n $_user['user_id'] = $uData['user_id'];\n $_user = api_get_user_info($_user['user_id']);\n $_user['uidReset'] = true;\n Session::write('_user', $_user);\n Event::event_login($_user['user_id']);\n // Redirect to homepage\n $sso_target = '';\n if (!empty($sso['ruri'])) {\n //The referrer URI is *only* used if\n // the user credentials are OK, which\n // should be protection enough\n // against evil URL spoofing...\n $sso_target = api_get_path(WEB_PATH) . base64_decode($sso['ruri']);\n } else {\n $sso_target = isset($sso['target']) ? $sso['target'] : api_get_path(WEB_PATH) . 'index.php';\n }\n header('Location: '. $sso_target);\n exit;\n } else {\n // user does not have permission for this site\n $loginFailed = true;\n Session::erase('_uid');\n header('Location: '.api_get_path(WEB_PATH).'index.php?loginFailed=1&error=access_url_inactive');\n exit;\n }\n } else {\n // there is no URL in the multiple\n // urls list for this user\n $loginFailed = true;\n Session::erase('_uid');\n header('Location: '.api_get_path(WEB_PATH).'index.php?loginFailed=1&error=access_url_inactive');\n exit;\n }\n } else {\n //Only admins of the \"main\" (first) Chamilo\n // portal can login wherever they want\n if (in_array(1, $my_url_list)) {\n //Check if this admin is admin on the\n // principal portal\n $_user['user_id'] = $uData['user_id'];\n $_user = api_get_user_info($_user['user_id']);\n $is_platformAdmin = $uData['status'] == COURSEMANAGER;\n Session::write('is_platformAdmin', $is_platformAdmin);\n Session::write('_user', $_user);\n Event::event_login($_user['user_id']);\n } else {\n //Secondary URL admin wants to login\n // so we check as a normal user\n if (in_array($current_access_url_id, $my_url_list)) {\n $_user['user_id'] = $uData['user_id'];\n $_user = api_get_user_info($_user['user_id']);\n Session::write('_user', $_user);\n Event::event_login($_user['user_id']);\n } else {\n $loginFailed = true;\n Session::erase('_uid');\n header(\n 'Location: '.api_get_path(WEB_PATH)\n .'index.php?loginFailed=1&error=access_url_inactive'\n );\n exit;\n }\n }\n }\n } else {\n // user account expired\n $loginFailed = true;\n Session::erase('_uid');\n header(\n 'Location: '.api_get_path(WEB_PATH)\n .'index.php?loginFailed=1&error=account_expired'\n );\n exit;\n }\n } else {\n //User not active\n $loginFailed = true;\n Session::erase('_uid');\n header('Location: '.api_get_path(WEB_PATH).'index.php?loginFailed=1&error=account_inactive');\n exit;\n }\n } else {\n //SHA1 of password is wrong\n $loginFailed = true;\n Session::erase('_uid');\n header('Location: '.api_get_path(WEB_PATH).'index.php?loginFailed=1&error=wrong_password');\n exit;\n }\n } else {\n //Auth_source is wrong\n $loginFailed = true;\n Session::erase('_uid');\n header(\n 'Location: '.api_get_path(WEB_PATH)\n .'index.php?loginFailed=1&error=wrong_authentication_source'\n );\n exit;\n }\n } else {\n //No user by that login\n $loginFailed = true;\n Session::erase('_uid');\n header('Location: '.api_get_path(WEB_PATH).'index.php?loginFailed=1&error=user_not_found');\n exit;\n }\n return $loginFailed;\n }",
"function login_check($pdo) {\n\n // First check for all variable sessions being set.\n if (isset($_SESSION['user_id'], $_SESSION['username'], $_SESSION['login_string'])) {\n $user_id = $_SESSION['user_id'];\n $username = $_SESSION['username'];\n $login_string = $_SESSION['login_string'];\n\n // Get string of browser.\n $user_browser = $_SERVER['HTTP_USER_AGENT'];\n\n $sqlLogin = \"SELECT user_id, login_id, password\n FROM user\n WHERE user_id = \" . $user_id . \";\";\n\n $loginList = $pdo->query($sqlLogin);\n\n // Check if result is returned.\n while ($loginRow = $loginList->fetch()) {\n $login_check = hash('sha512', $loginRow['password'] . $user_browser);\n\n // If match, then credentials are valid. User is logged in.\n if (hash_equals($login_check, $login_string)) {\n return true;\n } else {\n return false;\n }\n }\n } else {\n return false;\n }\n\n }",
"function validateLogin($user,$pass,$database)\n{\n $sql_query = 'SELECT * FROM USER WHERE user_id = \"'.$user.'\" AND password = \"'.$pass.'\"';\n return mysql_query($sql_query,$database);\n}",
"function login_check($pdo) {\n\t // Check if all session variables are set\n\t if(isset($_SESSION['user_id'], $_SESSION['username'], $_SESSION['login_string'])) {\n\t $user_id = $_SESSION['user_id'];\n\t $login_string = $_SESSION['login_string'];\n\t $username = $_SESSION['username'];\n\t \n\t $user_browser = $_SERVER['HTTP_USER_AGENT']; // Get the user-agent string of the user.\n\t \n\t if ($stmt = $pdo->prepare(\"SELECT u_password FROM App_User WHERE u_id = ? LIMIT 1\")) { \n\t $stmt->bindParam(1, $user_id, PDO::PARAM_INT); // Bind \"$user_id\" to parameter.\n\t $stmt->execute(); // Execute the prepared query.\n\t //$stmt->store_result();\n\t \n\t if($stmt->rowCount() == 1) { // If the user exists\n\t $result = $stmt->fetch(PDO::FETCH_OBJ);\n\t \t\t$password = $result->u_password;\n\n\t // $stmt->bind_result($password); // get variables from result.\n\t // $stmt->fetch();\n\t $login_check = hash('sha512', $password.$user_browser);\n\t if($login_check == $login_string) {\n\t // Logged In!!!!\n\t return true;\n\t } else {\n\t // Not logged in\n\t return false;\n\t }\n\t } else {\n\t // Not logged in\n\t return false;\n\t }\n\t } else {\n\t // Not logged in\n\t return false;\n\t }\n\t } else {\n\t // Not logged in\n\t return false;\n\t }\n\t}",
"public function can_log_in()\n\t{\n\t\t$salt = \"Qx-g0Yb.g>)8457!y%AX:?,,u.j93I\";\n\n\t\t// Compares the username and password with the db\n\t\t$this->db->where('username', $this->input->post('username'));\n\t\t//$this->db->where('password', \n\t\t//\tmd5($this->input->post('password').$salt));\n\t\t$this->db->where('password',$this->input->post('password')); \n\t\t$query = $this->db->get('registration');\n\t\t$data =$query->result_array();\n\t\t// If the query returns one row then the user exists\n\t\tif ($query->num_rows() == 1) {\n\t\t\treturn $data[0]['id'];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"function process_login ( $ls_user_name, $ls_user_password ) {\n\n\t\t// Connect to MySQL database.\n\n\t\techo \"I'm in model::process_login()\";\n\n\t\t$link = $this->connect_db();\n\n\t\tif ( $this->username_in_db( $ls_user_name, $link ) ) {\n\n\t\t\techo \"username $ls_user_name was in database, try checking password<br>\";\n\n\t\t\tif ( $this->password_matches_username( $ls_user_name, $ls_user_password, $link ) ) {\n\n\t\t\t\tmysqli_close( $link );\n\n\t\t\t\treturn true; // LOG USER IN!!!\n\n\t\t\t} else {\n\n\t\t\t\t$errors[ 'process_login' ] = 'error: invalid password';\n\n\t\t\t}\n\n\t\t} else {\n\n\t\t\t$errors[ 'process_login' ] = 'error: invalid username';\n\n\t\t}\n\n\t\tmysqli_close( $link );\n\n\t\treturn false;\n\n\t}",
"function check_login() {\n\t\t$pdo = new PDO(DB_PATH);\n\n\t\tif (!isset($_SESSION[\"user_id\"]) || !isset($_SESSION[\"nonce\"])) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$stmt = $pdo->prepare(\"SELECT ID, username, password, type FROM users WHERE ID = :userId\");\n\t\t$stmt->bindValue(\":userId\", $_SESSION[\"user_id\"], PDO::PARAM_INT);\n\n\n\t\tif (!$stmt->execute()) {\n\t\t\tthrow new PDOException($stmt->errorInfo()[2]);\n\t\t}\n\n\t\t$user_data = $stmt->fetch();\n\n\n\t\treturn $_SESSION[\"nonce\"] == md5(serialize($user_data)) && intval($_SESSION['user_id']) == intval($user_data['ID']);\n\t}",
"public function validateLogin() {\n if (isset($_POST['submit'])) {\n $errors = array();\n\n $required_fields = array('username', 'password');\n $errors = array_merge($errors, checkRequiredFields($required_fields));\n\n $username = trim($_POST['username']);\n $password = trim($_POST['password']);\n\n if (empty($errors)) {\n $conn = CTSQLite::connect();\n\n\n //check database if user and password exist\n $query = \"SELECT id, username ,role \";\n $query .= \"FROM ic_user \";\n $query .= \"WHERE username = '{$username}' \";\n $query .= \"password = '{$password}' \";\n $query .= \"LIMIT 1\";\n\n $result = $conn->query($query);\n confirm_query($result);\n\n if (sqlite_num_rows($result) == 1) {\n $user = $result->fetchArray();\n $role = $user['role'];\n CT::user()->setRole($role);\n }\n } else {\n if (count($errors) == 1) {\n // 1 error ocurred\n $message = \"There was 1 error in the form\";\n } else {\n //more than 1 error occured\n $message = \"There were\" . count($errors) . \"errors in the form\";\n }\n }\n } else {\n //form has not been submitted\n }\n }",
"function login() {\n\n // Validate user input\n $this->s_email = testInput($this->s_email);\n $this->s_password = testInput($this->s_password);\n\n // Fetch data from db with given email\n $result = $this->conn->query(\"SELECT * FROM $this->tableName WHERE s_email LIKE '$this->s_email'\");\n\n // Check that student exists in database\n if ($result->rowCount() === 1) {\n\n // Fetch user record from result\n $user = $result->fetch();\n\n // Check password match\n if (password_verify($this->s_password, $user[\"s_password\"])) {\n return true;\n }\n // Passwords do not match\n else {\n return false;\n }\n }\n // User with given email not in database\n else {\n return false;\n }\n }",
"function validateLogin($data)\r\n\t{\r\n\t\t$user = $this->find(array('username' => $data['username'], 'password' => sha1($data['password'])), array('id', 'username'));\r\n\t\tif(empty($user) == false)\r\n\t\t\treturn $user['User'];\r\n\t\treturn false;\r\n\t}",
"function checkLogin($username, $password)\n\t{\n\t\t\n\t\t//set an empty userId variable\n\t\t$userId = null;\n\t\t\n\t\t//make a call to grab the user id of the row that has a username AND password that match the specified ones\n\t\t$stmt = $this->db -> prepare(\"SELECT user_id FROM user WHERE username=? && password=?\");\n\t\t\n\t\t$stmt -> execute(array($username, $password));\n\t\t\n\t\t$userIdToCheck = $stmt->fetch(PDO::FETCH_ASSOC);\n\t\t\n\t\t//var_dump($userIdToCheck);\n\t\t\n\t\t\n\t\t//if the username and password do not match up, no rows will be found, and userIdToCheck will equal false\n\t\t//if username and password do not match up, put out error\n\t\tif($userIdToCheck == false)\n\t\t{\n\t\t\t$this->errors['password'] = \"Username and password do not match\";\n\t\t\t\n\t\t\t//var_dump($password, $userIdToCheck);\n\t\t\t//echo \"NOOOO!!!\";\n\t\t}\n\t\t//else, if the username and password do match up, set the user id to the $userId variable\n\t\t else\n\t\t{\n\t\t\t$userIdToCheck = $userIdToCheck['user_id'];\n\t\t} \n\t\t\n\t\t//return the user ID associated with the username and password\n\t\treturn $userIdToCheck;\n\t}",
"function checkLogin($db, $email, $password){\n\n\t\t// Prepare a query.\n\t\t$salt_query = $db->prepare(\"SELECT salt FROM user WHERE Email = :email\");\n\t\t$params = array(\":email\" => htmlspecialchars($email));\n\t\t$salt_query->execute($params);\n\t\n\t\t// See if anything was returned. Display an error if anything is.\n\t\tif($salt = $salt_query->fetch()){\n\t\t\n\t\t\t// Generate a hash to compare to what's in the database.\n\t\t\t$hash = hash('sha256', $salt[0] . htmlspecialchars($_POST['password']));\n\t\t\t\n\t\t\t// Compare the generated hash to the one in the database.\n\t\t\t$login_query = $db->prepare(\"\n\t\t\t\tSELECT Username FROM user\n\t\t\t\tWHERE\n\t\t\t\t\tEmail = :email\n\t\t\t\tAND\n\t\t\t\t\thash = :hash\n\t\t\t\");\n\t\t\t\n\t\t\t$params = array(\":email\" => htmlspecialchars($email),\n\t\t\t\t\t\t\t\":hash\" => $hash);\n\t\t\t\n\t\t\t// Retrieve the username.\n\t\t\t$login_query->execute($params);\n\t\t\tif($username = $login_query->fetch()){\n\t\t\t\treturn $username;\n\t\t\t}\n\t\t\t// Incorrect password.\n\t\t\telse{\n\t\t\t\t$returnInfo[\":code\"] = 1;\n\t\t\t\t$returnInfo[\":data\"] = \"Password is incorrect.\";\n\t\t\t\tdie(json_encode($returnInfo));\n\t\t\t}\n\t\t}\n\t\t// User doesn't exist.\n\t\telse{\n\t\t\t$returnInfo[\":code\"] = 1;\n\t\t\t$returnInfo[\":data\"] = \"There is no user associated with that email.\";\n\t\t\tdie(json_encode($returnInfo));\n\t\t}\n\t}",
"function checkLogin(){\n global $database; //The database connection\n\n /* Username and userid have been set and not guest */\n if(isset($_SESSION['username'])){\n return true;\n }\n /* User not logged in */\n else{\n return false;\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}",
"public function _check_login()\n {\n\n }",
"public function log_in() {\n\n // Check if the user exists on the database\n if (!$this->does_exist('username')) {\n return \"Username does not exist\";\n }\n\n $user = User::find($this->username, 'username');\n\n // If password matches\n if ($user->password !== $this->password) {\n return \"Sorry, password does not match\";\n }\n\n return true;\n }",
"public function hasUser($_login,$_password);",
"private function checkFirstLogin() {\n\n $count = DB::table('users')->count();\n\n if ($count == 0) {\n\n $password = Hash::make('cciadminpassword');\n\n // insert in users table\n $id = DB::table('users')->insertGetId([\n 'username' => 'admin',\n 'name' => 'Administrator',\n 'password' => $password,\n 'created_at' => \\Carbon\\Carbon::now()\n ]);\n\n // insert in roles table\n DB::table('user_roles')->insert([\n 'user_id' => $id,\n 'role' => 'administrator',\n 'created_at' => \\Carbon\\Carbon::now()\n ]);\n\n // insert project status codes\n DB::table('project_status')->insert([\n [ 'status' => 'New' ],\n [ 'status' => 'Quoted' ],\n [ 'status' => 'Sold' ],\n [ 'status' => 'Engineered' ],\n [ 'status' => 'Lost']\n ]);\n\n return;\n }\n\n else { return; }\n }",
"function check_database($password) {\n\t\t$username = $this -> input -> post('username');\n\n\t\t//query the database\n\t\t$result = $this -> login_model -> login($username, $password);\n\n\t\tif ($result) {\n\t\t\t$sess_array = array();\n\t\t\tforeach ($result as $row) {\n\n\t\t\t\t$sess_array = array('id' => $row -> jelyAdminID, 'username' => $row -> jelyAdminName);\n\t\t\t\t$this -> session -> set_userdata('logged_in', $sess_array);\n\t\t\t}\n\t\t\treturn TRUE;\n\t\t} else {\n\t\t\t$this -> form_validation -> set_message('check_database', 'Invalid username or password');\n\t\t\treturn false;\n\t\t}\n\t}",
"private function checkLogIn(){\n $query = \"SELECT etpay_01_all_users.user_id, etpay_01_all_users.FirstName, etpay_02_registered.User_name, etpay_01_all_users.ATM_number,\n etpay_02_registered.password_hashed FROM etpay_02_registered JOIN etpay_01_all_users \n ON etpay_01_all_users.user_id = etpay_02_registered.User_id\n WHERE etpay_02_registered.User_name =:userName && etpay_01_all_users.ATM_number=:ATM\";\n $this->status =$this->conn->prepare($query);\n $this->status->bindParam(':userName', $this->username, PDO::PARAM_STR, 15);\n $this->status->bindParam(':ATM', $this->atm_num, PDO::PARAM_STR, 17);\n try{\n $execute_success = $this->status->execute();\n }catch(PDOException $e){\n echo \"something went wrong\".$e->getMessage();\n }\n if(!$execute_success){\n $this->count = -1;\n $this->loginStatus = false;\n $error_type = 5;\n include_once('../includes/error/00sign_up_err.php');\n die();\n }else{\n $this->count = $this->status->rowCount();\n if ($this->status->rowCount()>0){\n $this->dataBaseContent = $this->status->fetchAll();\n $this->checkPasswordandATM();\n }else if ($this->status->rowCount()==0){\n $this->loginStatus = false;\n }\n \n }\n }",
"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 }",
"private function login() {\n //Look for this username in the database\n $params = array($this->auth_username);\n $sql = \"SELECT id, password, salt \n FROM user \n WHERE username = ? \n AND deleted = 0\";\n //If there is a User with this name\n if ($row = $this->db->fetch_array($sql, $params)) {\n //And if password matches\n if (password_verify($this->auth_password.$row[0] ['salt'], $row[0] ['password'])) {\n $params = array(\n session_id(), //Session ID\n $row[0] ['id'], //User ID\n self::ISLOGGEDIN, //Login Status\n time() //Timestamp for last action\n );\n $sql = \"INSERT INTO user_session (session_id, user_id, logged_in, last_action) \n VALUES (?,?,?,?)\";\n $this->db->query($sql, $params);\n header('Location: ' . $_SERVER['HTTP_REFERER']);\n //User now officially logged in\n }\n //If password doesn't match\n else {\n //Send user back to login with error\n $this->login_form(self::ERR_NOUSERFOUND);\n }\n }\n //If there isn't a User with this name\n else {\n //Send user back to login with error\n $this->login_form(self::ERR_NOUSERFOUND);\n }\n }",
"public function authenticate() {\n\t\t \n\t\t$db = db_connect();\n $query= \"SELECT * FROM users WHERE username=:username AND password=:password\";\n $statement=$db->prepare($query);\n $statement->execute(array(\n 'username' => $_POST['username'],'password' => $_POST['password']\n ));\n $count=$statement->rowCount();\n if($count>0){\n $_SESSION['username']=$_POST['username'];\n $_SESSION['is authenticated']= true;\n\t\t}\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}",
"private function verifyAccount()\n {\n $check = $this->db->query('SELECT users.password, users.id FROM users WHERE username = ?', $this->username)->fetchArray();\n //Check of de user in de database staat.\n if (isset($check['password'])) {\n //Check of de password matched\n if (password_verify($this->password, $check['password'])) {\n echo \"AUTH verify complete\";\n $this->setLoggedinUser($check['id']);\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }",
"public function signInUser($db) {\n $sqlPassword = \"SELECT passwd FROM users WHERE username = :username\";\n $stmtPassword = $db->prepare($sqlPassword);\n $stmtPassword->bindValue(':username', $this->username, PDO::PARAM_STR);\n $stmtPassword->execute();\n $userData = $stmtPassword->fetch(PDO::FETCH_ASSOC);\n $resCount = count($userData);\n\n if ($resCount != 1) {\n return False;\n }\n \n $hashedPassword = password_verify($this->passwd, $userData['passwd']);\n if (!$hashedPassword) {\n return False;\n } \n\n return True;\n }",
"public function authenticate()\n {\n /* authenticate if the login credentials are correct */\n $db = Sweia::getInstance()->getDB();\n $args = array(\n \":email\" => $this->getEmail(),\n \":password\" => $this->password\n );\n $sql = \"SELECT email,uid FROM \" . SystemTables::DB_TBL_USER . \" WHERE email = ':email' AND password = ':password' AND status != 4 LIMIT 1\";\n $res = $db->query($sql, $args);\n if ($res && $db->resultNumRows($res) == 1)\n {\n $data = $db->fetchObject($res);\n $this->uid = 1;\n return true;\n }\n\n return false;\n }",
"public function checkLogin(){\n $dbQuery = new DBQuery(\"\", \"\", \"\");\n $this->email = $dbQuery->clearSQLInjection($this->email);\n $this->senha = $dbQuery->clearSQLInjection($this->senha);\n \n // Verificar quantas linhas um Select por Email e Senha realiza \n $resultSet = $this->usuarioDAO->select(\" email='\".$this->email.\"' and senha='\".$this->senha.\"' \");\n $qtdLines = mysqli_num_rows($resultSet);\n \n // Pegar o idUsuario da 1ª linha retornada do banco\n $lines = mysqli_fetch_assoc($resultSet);\n $idUsuario = $lines[\"idUsuario\"];\n \n\n \n // retorna aonde a função foi chamada TRUE ou FALSE para se tem mais de 0 linhas\n if ( $qtdLines > 0 ){\n // Gravar o IdUsuario e o Email em uma Sessão\n session_start();\n $_SESSION[\"idUsuario\"] = $idUsuario;\n $_SESSION[\"email\"] = $this->email;\n return(true);\n }else{\n // Gravar o IdUsuario e o Email em uma Sessão\n session_start();\n unset($_SESSION[\"idUsuario\"]);\n unset($_SESSION[\"email\"]);\n return(false);\n }\n }",
"public function authUser()\n {\n //я не знаю почему, что эти функции возвращают пустые строки...\n //$login = mysql_real_escape_string($_POST['login']);\n //$password = mysql_real_escape_string($_POST['password']);\n $login = $_POST['login'];\n $password = $_POST['password'];\n if(DBunit::checkLoginPassword($login, $password)){\n DBunit::createUserSession(DBunit::getUser($login, $password));\n return true;\n }\n else {\n return false;\n }\n }",
"public function checkLogin()\n\t{\n\t\t$sql = sprintf\n\t\t\t('\n\t\t\t\tSELECT id FROM adminner WHERE username = \"%s\" AND password = \"%s\"',\n\t\t\t\t$this->getUsername(),\n\t\t\t\t$this->getPassword()\n\t\t\t);\n\t\t\t\n\t\t\t$query = $this->db->query($sql);\n\n\t\treturn $query->num_rows();\n\t}",
"private function loginWithPostData() {\n \n $this->user_name = $this->connection->real_escape_string($_POST['user_name']); \n $checklogin = $this->connection->query(\"SELECT user_name, user_email, user_password_hash FROM users WHERE user_name = '\".$this->user_name.\"';\");\n \n if($checklogin->num_rows == 1) {\n \n $result_row = $checklogin->fetch_object();\n \n if (crypt($_POST['user_password'], $result_row->user_password_hash) == $result_row->user_password_hash) {\n \n /**\n * write user data into PHP SESSION [a file on your server]\n */\n $_SESSION['user_name'] = $result_row->user_name;\n $_SESSION['user_email'] = $result_row->user_email;\n $_SESSION['user_logged_in'] = 1;\n $_SESSION['user_name'] = $result_row->user_name;\n \n\t\t\t\t\t// session security\n $_SESSION['agent'] = $_SERVER['HTTP_USER_AGENT'] ;\n\t\t\t\t\t$_SESSION['ip'] = $_SERVER['REMOTE_ADDR'];\n\t\t\t\t\t$_SESSION['count'] = 0; \n\t\t\t\t\t\t\t\t\t\t \n /**\n * write user data into COOKIE [a file in user's browser]\n */\n setcookie(\"user_name\", $result_row->user_name, time() + (3600*24*100));\n setcookie(\"user_email\", $result_row->user_email, time() + (3600*24*100));\n $this->user_is_logged_in = true;\n return true; \n \n } else {\n $this->errors[] = \"Wrong password or username. Try again.\";\n $this->login_delay();\n return false; \n } \n \n } else {\n $this->errors[] = \"Wrong password or username. Try again.\";\n $this->login_delay();\n return false;\n } \n }",
"function checkUserLoginInfo($db, $username, $password)\r\n{\r\n\t//Fetch the account ID for the user in the current session\r\n\t$userID = \"SELECT `acc_id` FROM `account` WHERE(`acc_name`='\" .$username. \"')\";\r\n\t$id = mysqli_query($db, $userID);\r\n\t$accID = mysqli_fetch_assoc($id);\r\n\t\r\n\t// Set session variables\r\n\t$_SESSION[\"accountID\"] = $accID[\"acc_id\"];\r\n\t$_SESSION[\"username\"] = \"\".$username.\"\";\r\n\t$_SESSION[\"password\"] = \"\".$password.\"\";\r\n\t\r\n\t//Check if the entered info is correct\r\n\t$inQuery = \"SELECT `acc_name`, `password` FROM `account` WHERE (`acc_name`='\" .$username. \"' AND `password`='\" .$password .\"')\";\r\n\t\r\n\t$runQuery = mysqli_query($db, $inQuery);\r\n\t\r\n\tif(mysqli_num_rows($runQuery) == false)\r\n\t{\r\n\t\t//Window.alert(\"<p style=\".\"position:relative;left:250px;top:250px;\".\"> Invalid username or password</p>\");\r\n\t\techo \"<p style=\".\"position:relative;left:250px;top:250px;\".\"> Invalid username or password</p>\";\r\n\t\t\r\n\t}\r\n\telse\r\n\t{\r\n\t\t//Goes to the next page.\r\n\t\theader(\"Location: mainPage.php\");\r\n\t\t\r\n\t}\r\n}",
"private function checkLogin()\n {\n if ($this->verifySession()) {\n $this->userId = $this->session['id'];\n }\n if ($this->userId === 0) {\n if ($this->verifyCookie()) {\n $this->userId = $this->cookie['userid'];\n $this->createSession();\n }\n }\n }",
"public function validate_user( $username, $password ) {\n // based on the received username and password\n\n\n // The results of the query are stored in $login.\n // If a value exists, then the user account exists and is validated\n if ($username==\"adminHelena\" && $password==\"adminHelena99\") {\n // Call set_session to set the user's session vars via CodeIgniter\n $this->set_session();\n return true;\n }\n\n return false;\n}",
"function dbCheckLogin($login, $password)\n {\n $rs = null;\n /* Query the database for the login and password tuple. */\n $args = [\n 'login' => $login,\n 'password%sql' => array('MD5(%s)', $password)\n ];\n $result = dibi::query('SELECT * FROM `user` WHERE %and', $args);\n\n Debug::barDump($result, 'StudentBean login check after db query');\n\n /* In case that the LDAP server is down for some reason, we have the\n possibility to skip the LDAP check. */\n if (empty ($result) && (LDAPConnection::isActive($this->_smarty)))\n {\n /* As a last resort, try to contact the LDAP server and verify\n the user. */\n $result = dibi::query('SELECT * FROM `student` WHERE `login`=%s', $login);\n if (!empty ($result))\n {\n /* Login exists, check the password. */\n $valid = $this->ldapCheckLogin($login, $password);\n /* If the password check failed, clear the contents of $rs. */\n if (!$valid) $result = null;\n }\n }\n\n /* Empty $result now signals that the student could not be verified. */\n if (!empty ($result))\n {\n Debug::barDump($result, 'StudentBean result after ldap check');\n\n /* If the verification succeeded, we have to update the information\n about the student so that the student's home page gets displayed\n correctly. */\n $row = $result->fetch();\n $this->id = $row['id'];\n $this->dbQuerySingle();\n /* Set the returned record. */\n $rs = $this->rs;\n }\n\n return $rs;\n }",
"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}",
"function check_database($password)\r\n\t{\r\n\t\t$email = $this->input->post('email');\r\n\t\r\n\t\t//query the database\r\n\t\t$result = $this->users_model->login($email, $password);\r\n\t\tif($result)\r\n\t\t{\r\n\t\t\t//session\r\n\t\t\t$sess_array = array();\r\n\t\t\tforeach($result as $row)\r\n\t\t\t{\r\n\t\t\t\t$sess_array = array(\r\n\t\t\t\t\t\t'users_id' => $row->users_id,\r\n\t\t\t\t\t\t'firstname' => $row->firstname\r\n\t\t\t\t\t\t\r\n\t\t\t\t);\r\n\t\t\t\t$this->session->set_userdata('logged_in', $sess_array);\r\n\t\t\t}\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->form_validation->set_message('check_database', 'Invalid email or password');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"function validateLogin($data) {\r\n\t\t$sessionAdmin = $this->query('SELECT * FROM \r\n\t\t\t\t\t\t\t admins WHERE username=\"'. $data['username'] . '\" AND password=md5(\"'. $data['password'] .'\");' );\r\n\t\tif(empty($sessionAdmin) == false) //If the $sessionAdmin array isn't empty return the results\r\n\t\t return $sessionAdmin;\r\n\t\treturn false;\r\n\t}",
"public function checkLoggedIn()\n\t\t{\n\t\t\t\n\t\t\ttry {\n\t\t\t \n\t\t\t\t$query = $this->_db->prepare( \"SELECT username FROM login WHERE username=:username\" );\n \n \n\t\t\t\t$query->bindParam( \":username\", $_SESSION[ 'username' ], PDO::PARAM_STR );\n\n\t\t\t\t$query->execute();\n\t\t\t\n\t\t\t} catch ( PDOException $e ) {\n\n\t\t\t\techo $e->getMessage();\n\n\t\t\t}\n\n\t\t\t$row = $query->fetch();\n\t\t\t\n \n\t\t\t$loggedInUser = $row[ 'username' ];\n \n //if the user is not logged in\n\t\t\tif( !isset( $loggedInUser ) )\n\t\t\t{\n //head to the log in page\n\t\t\t\theader( 'Location: login.php' );\n\n\t\t\t}\n\t\t\t\n\t\t}",
"public function loginTrainer(){\r\n\t\t\t$objDBConn = DBManager::getInstance();\t\r\n\t\t\tif($objDBConn->dbConnect()){\r\n\t\t\t\t$result = mysql_query(\"SELECT * from trainer where username='\".$_REQUEST[\"username\"].\"' and password='\".$_REQUEST[\"pass\"].\"'\");\r\n\t\t\t\t$row = mysql_fetch_array($result);\r\n\t\t\t\tif($row == false){\r\n\t\t\t\t\t//echo \"No records\";\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}else{\r\n\t\t\t\t\t$_SESSION['trainer'] = $row;\r\n\t\t\t\t\t$objDBConn->dbClose();\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\t//echo 'Something went wrong ! ';\r\n\t\t\t\t$objDBConn->dbClose();\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}",
"public function login ($USName, $PWord){\n\n\t\t$this->mysqlconnect();\n\n\n\n\n//if databse found continue to check if name in table\n\n\n\n\t$query = \"SELECT * FROM user_table WHERE username = '$USName' AND password ='$PWord'\";\n\n\n\t$result = $this->mysqli->query ( $query ) or die('SELECT query failed: ' . mysql_error());\n\t$answer= \"\";\n\n\n\n\n\tfor ( $row = $result->fetch_assoc(); $row != FALSE;\n\t\t\t$row = $result->fetch_assoc() )\n\t{\n\n\n\n\t\t$usernamez = stripslashes($row[\"username\"]);\n\t\t$passwordez = stripslashes($row[\"password\"]);\n\t\t\n\n\t\tif ($usernamez==$USName && $passwordez==$PWord){\n\n\t\t\t$answer= \"Login Succesful!\";\n\n}\nelse{\n\n$answer= \"Login Error!\";\n\n}\n\n\n\n\n\n\n\t}\n\treturn $answer;\n}",
"function checkLogin () {\r\n //check is session has user\r\n if (isset($_SESSION['user'])) {\r\n //check if the credentials match\r\n if (verifyUser($_SESSION['user']['name'], $_SESSION['user']['hash'])) {\r\n return true;\r\n }\r\n }\r\n //returns false by default\r\n return false;\r\n}",
"function authenticate(){\n global $db;\n if(isset($_POST['my_login']) && ($_POST['my_login']==\"logged_in\")){\n $query = \"SELECT `u_name`, `pass`\n FROM users\n WHERE `u_name` = \\\"{$_POST['u_name']}\\\" AND\n `pass` = \\\"{$_POST['pass']}\\\"\";\n if((mysqli_num_rows(mysqli_query($db,$query))) == 1){\n \n $_SESSION['u_name'] = $_POST['u_name'];\n $_SESSION['logged_in'] = true;\n header('Location: index.php');\n exit;\n }\n else {\n echo \"Username or Password is incorrect!\";\n }\n }\n }",
"private function checkLogin()\n {\n // save the user's destination in case we direct them to authenticate\n\n // whitelist authentication mechanisms\n if($this->_controller == \"authenticate\")\n return;\n\n // whitelist database reload\n if($this->_controller == \"populatetestdata\")\n return;\n\n if(!isset($_SESSION['userid']))\n {\n // Don't redirect the user to an error page just in principle\n // @todo possible @bug why would it do this?\n if($this->_controller != \"error\" && $this->_controller != \"undefined\")\n {\n $this->slogger->slog(\"saving destination to \" . $this->_controller, SLOG_DEBUG);\n $_SESSION['destination'] = $this->_controller;\n }\n redirect('authenticate');\n\n }\n\n }",
"public function tryLogIn(){\n if(count(self::$loginErrors) === 0){\n $password = md5(self::$loginPassword);\n $query = self::$connection->db->prepare(\"SELECT * FROM users WHERE email = ? AND password = ?\");\n $query->bind_param(\"ss\", self::$loginEmail, $password);\n $query->execute();\n $user = mysqli_fetch_assoc( $query->get_result());\n //Send to Profile page if correct credentials; otherwise, stay on authentication page\n if($user){\n $this->prepareSession($user['name'], self::$loginEmail);\n $_POST = array();\n Auth::CreateView('Profile');\n }else{\n self::addError(\"login\", \"Incorrect credentials!\");\n Auth::CreateView('Auth');\n }\n }\n self::$connection->closeConnection();\n }",
"function can_login($username, $password) \n {\n $this->db->where('adminNumber', $username);\n //$this->db->where('password', $password); \n $query = $this->db->get('user'); \n $db_hash_password = $query->row()->password;\n \n if(($query->num_rows() > 0) && (password_verify($password ,$db_hash_password)))\n {\n return true; \n } \n else \n { \n return false; \n } \n }",
"function checkLoginDetails($email, $password) {\r\n\t\t\t$sql = \"SELECT * FROM `users` WHERE UPPER(email)=UPPER('%s') AND password='%s'\";\r\n\t\t\t$result = $this->query($sql, $email, sha1($password));\r\n\t\t\tif (mysql_num_rows($result) == 0)\r\n\t\t\t\treturn false;\r\n\t\t\treturn true;\r\n\t\t}",
"public function checkLogin()\r\n\t{\r\n\t\tif (isset($_SESSION['loggedIn']))\r\n\t\t{\r\n\t\t\t$password = $_SESSION['loggedIn'];\r\n\t\t\t$result = self::$db->getDataSecured(\"SELECT * FROM \".$this->dbTable.\" WHERE $this->userPasswordClmn = :password ;\", array(\":password\" => $password));\r\n\t\t\t\r\n\t\t\tif(!empty($result) && ($_SESSION['lastActive'] + $this->maxLifeTime > time()))\r\n\t\t\t{\r\n\t\t\t\t$_SESSION['lastActive'] = time();\r\n\t\t\t\treturn $result[0];\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t\treturn false;\r\n\t}",
"private function check_login()\n {\n if (self::exists('user_id')) {\n $this->user_id = self::get('user_id');\n $this->logged_in = true;\n } else {\n unset($this->user_id);\n $this->logged_in = false;\n }\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 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 checklogin($userName,$password) {\n\n $db = DB::getInstance();\n\n $stmt = $db->prepare(\"SELECT * FROM User WHERE userName=?\");\n $stmt->bind_param('s', $userName);\n $stmt->execute();\n $result = $stmt->get_result();\n\n if(!$result || $result->num_rows !== 1) {\n return array('verified' => false, 'userId' => null, 'isAdmin' => null);\n }\n $row = $result->fetch_assoc();\n\n return array('verified' => password_verify($password, $row[\"password\"]), 'userId' => $row[\"id\"], 'isAdmin' => $row['admin'],'firstName' => $row['firstName']);\n}",
"public function canLogin()\n {\n $email = $this->getEmail();\n $password = $this->getPassword();\n $conn = Db::getInstance();\n $statement = $conn->prepare(\"SELECT * FROM users WHERE email = :email\");\n $statement->bindValue(\":email\", $email);\n $statement->execute();\n $user = $statement->fetch();\n $hash = $user[\"password\"];\n\n if (!$user) {\n return false;\n }\n\n // use password_verify() to verify your user\n // this function should return true or false and nothing else\n if (password_verify($password, $hash)) {\n return true;\n } else {\n return false;\n }\n }",
"function check_database($password)\n {\n $mail = $this->input->post('mail');\n\n //query the database\n $result = $this->user->login($mail, $password);\n var_dump(\"result : \", $result);\n\n if($result)\n {\n $sess_array = array();\n foreach($result as $row)\n {\n $sess_array = array(\n 'id' => $row->id,\n 'username' => $row->username\n );\n $this->session->set_userdata('logged_in', $sess_array);\n }\n return TRUE;\n }\n else\n {\n $this->form_validation->set_message('check_database', 'Invalid username or password');\n return false;\n }\n }",
"public function check_login(){\n\t\tsession_start();\n\t\t$user = new InterfacePersonRepo;\n\t\t$tmp = $user->getRepository(Input::get('txtUsername'));\n\t\tif($tmp==NULL){\n\t\t\treturn View::make('alert/authen/alertLogin');\n\t\t}else{\n\t\t\tif (Hash::check(Input::get('txtPassword'), $tmp->getPassword())){\n\t\t\t\t$_SESSION[\"id\"] = $tmp->getUserID();\n\t\t\t\t$_SESSION[\"Username\"] = $tmp->getUsername();\n\t\t\t\t$_SESSION[\"Name\"] = $tmp->getName();\n\t\t\t\t$_SESSION[\"Surname\"] = $tmp->getSurname();\n\t\t\t\t$_SESSION[\"Address\"] = $tmp->getAddress();\n\t\t\t\t$_SESSION[\"Email\"] = $tmp->getEmail();\n\t\t\t\t$_SESSION[\"Phone\"] = $tmp->getPhone();\n\t\t\t\t$_SESSION[\"Status\"] = $tmp->getStatus();\n\t\t\t\t$_SESSION[\"Filename\"] = $tmp->getPath_file();\n\t\t\t\t$_SESSION[\"Fine\"] = $tmp->getFine();\n\n\t\t\t\tsession_write_close();\n\t\t\t\treturn Redirect::to(\"/main\");\n\t\t\t}else{\n\t\t\t\treturn View::make('alert/authen/alertLogin');\n\t\t\t}\n\t\t}\n\t}",
"function validation($userName, $password){\r\n // $query .=\" WHERE userName = '\" . $userName .\"' AND password = '\" . $password . \"'\";\r\n\r\n if(empty($userName) && empty($password)){\r\n $emptyfield = \"Field cannot be empty</br>\";\r\n echo $emptyfield;\r\n echo \"Redirecting to login screen...\";\r\n header( \"Refresh:1; url=index.php\", true, 303);\r\n }\r\n\r\n // $query = \"SELECT * FROM user\";\r\n // $query .=\" WHERE userName = '\" . $userName .\"'\";\r\n\r\n // $result = $connection ->prepare($query);\r\n // $result->execute();\r\n // $result = $result->fetchAll();\r\n\r\n // if(count($result) > 0){\r\n // echo \"Username already exist\";\r\n // //sleep(3);\r\n // header( \"Refresh:1; url=index.php\", true, 303);\r\n // } else {\r\n // inDatabase();\r\n // }\r\n // die;\r\n}",
"function check_login($user, $pass) {\n // But not use '$this->' and use $ci = &get_instance()\n // to be able to get helper, library everywhere.\n\n // md5 encryption\n $md5_pass = md5($pass);\n\n // Make query\n $sql = \"SELECT *\n FROM scrum_user\n WHERE user_id = '$user'\n AND user_password = '$md5_pass'\";\n $query = $this->db->query($sql);\n\n if($query->num_rows()) {\n foreach($query->result() as $row)\n return $row;\n }\n return NULL;\n }",
"function AuthUsers($username) {\r\n //Can user login?\r\n global $dbUser;\r\n global $dbPass;\r\n global $dbName;\r\n global $connection;\r\n $huser=hash(\"SHA256\",strip_tags($username));\r\n $result=$connection->query(\"select * from users where aduser='$huser'\") or die(mysqli_error($connection));\r\n if($result->num_rows>0) return 1; \r\n else return 0;\r\n}",
"function checkLogin($username,$txtpassword){\n\n $result= $this->db->query(\"SELECT * FROM cck_user WHERE user_name='$username' AND user_password='$txtpassword' \");\n $row = $result->row();\n $count = $result->num_rows();\n\n if($count==1){\n return true;\n }else{\n return false;\n }\n }",
"function verify_credentials($user, $pwd) {\n global $db;\n\n // query for admin users first\n $query = \"SELECT * FROM admin\n WHERE admin_user = :user\n AND admin_password = :pwd\";\n\n $statement = $db->prepare($query);\n $statement->bindValue(':user', $user);\n $statement->bindValue(':pwd', $pwd);\n $statement->execute();\n\n $result = $statement->fetch();\n\n $retval = $statement->closeCursor();\n\n if (isset($result['admin_user'])) {\n if (isset($result['admin_name'])) setcookie('name', $result['admin_name'], time() + 3600);\n $_SESSION['admin'] = true;\n $_SESSION['id'] = $result['admin_id'];\n return $retval;\n }\n\n // if no admin found, query for players\n $query = \"SELECT * FROM player\n WHERE player_user = :user\n AND player_password = :pwd\";\n\n $statement = $db->prepare($query);\n $statement->bindValue(':user', $user);\n $statement->bindValue(':pwd', $pwd);\n $statement->execute();\n\n $result = $statement->fetch();\n\n $retval = $statement->closeCursor();\n\n if (isset($result['player_user']) > 0) {\n if (isset($result['player_name'])) setcookie('name', $result['player_name'], time() + 3600);\n $_SESSION['id'] = $result['player_id'];\n return $retval;\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}",
"public function check(){ \r\n $username = $this->validate($_POST['username']);\r\n $password = md5($this->validate($_POST['password']));\r\n \r\n $query = $this->admin->selectWhere(array('username'=>$username, 'password'=>$password));\r\n \r\n $data = $this->admin->getResult($query);\r\n $jml = $this->admin->getRows($query);\r\n \r\n if($jml>0){\r\n $data = $data[0];\r\n $_SESSION['username'] = $data['username'];\r\n $_SESSION['password'] = $data['password'];\r\n \r\n $this->redirect('admin');\r\n }else{\r\n $view = $this->view('admin/login');\r\n $view->bind('msg', 'Username atau Password salah!');\r\n }\r\n \r\n }",
"public function check_login($username, $password) {\n $conn = db();\n //$password = md5($password);\n $sql = \"SELECT id FROM user WHERE username='$username' AND password='$password'\";\n//checking if the username is available in the table\n $result = $conn->query($sql);\n $user_data = $result->fetch_assoc();\n $count_row = $result->num_rows;\n if ($count_row == 1) {\n// this login variable will use for the session \n $_SESSION['login'] = true;\n $_SESSION['id'] = $user_data['id'];\n return true;\n } else {\n return false;\n }\n }",
"public static function checkLogin()\n {\n global $cont;\n $email = $_POST['email'];\n $password = SHA1($_POST['password']);\n $user = $cont->prepare(\"SELECT `email` FROM `users` WHERE `email` = ? AND `password` = ? LIMIT 1\"); \n $user->execute([$email , $password]);\n $adminData = $user->fetchObject();\n\n session_start();\n if(empty($adminData))\n {\n $_SESSION['error'] = \"Email or Password is Invaliad\";\n header(\"location:../login.php\");\n }\n else\n {\n $_SESSION['email'] = $adminData->email; \n header(\"location:../index.php\");\n }\n }",
"function check_database($password)\n {\n $username = $this->input->post('username');\n \n //query the database\n $result = $this->Products->login($username, $password);\n \n if($result)\n {\n $sess_array = array();\n foreach($result as $row)\n {\n $sess_array = array(\n 'id' => $row->id,\n 'username' => $row->email\n );\n $this->session->set_userdata('logged_in', $sess_array);\n }\n return TRUE;\n }\n else\n {\n $this->form_validation->set_message('check_database', 'Invalid username or password - or account has not been activated');\n return false;\n }\n }",
"public function doLogin($data){\n\n $this->where('username',$data['username']);\n $this->where('password',sha1( $data['password']) );\n $result = $this->search();\n\n if ($result){\n return $result;\n }\n\n return false;\n\n }",
"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 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 auth($uname, $upass) {\n // SELECT query\n $usel = \"SELECT salt FROM users WHERE username=? LIMIT 1\";\n $usel = dbQuery($usel, $uname);\n $urow = $usel->fetch();\n\n if (empty($urow)) {\n return false;\n } else {\n $salt = $urow['salt'];\n }\n\n // SELECT query\n $usel = \"SELECT id FROM users WHERE (username=? OR email=?) AND password=? LIMIT 1\";\n $usel = dbQuery($usel, $uname, $uname, hash('sha256', $upass . $salt));\n $urow = $usel->fetch();\n // check credentials\n if (empty($urow)) {\n return false;\n } else {\n return true;\n }\n}",
"function check_database($password) {\n $nis = $this->input->post('username');\n //query ke database\n $result = $this->user->login($nis, $password);\n \n if($result) {\n $sess_array = array();\n foreach($result as $row) {\n $sess_array = array(\n 'username' => $row->nis,\n 'password' => $row->password\n );\n $this->session->set_userdata('logged_in', $sess_array);\n }\n return TRUE;\n }\n else {\n $this->form_validation->set_message('check_database', 'Invalid username or password');\n return false;\n }\n }",
"function checkLogin($myusername,$mypassword)\n\t{\n\t\tmysql_connect(DB_HOST, DB_USER, DB_PASSWORD)or die(\"Failed to connect to MySQL: \" . mysql_error());\n\t\tmysql_select_db(DB_NAME)or die(\"Failed to connect to MySQL: \" . mysql_error());\n\n\t\t// To protect MySQL injection (more detail about MySQL injection)\n\t\t$myusername = stripslashes($myusername);\n\t\t$mypassword = stripslashes($mypassword);\n\t\t$myusername = mysql_real_escape_string($myusername);\n\t\t$mypassword = mysql_real_escape_string($mypassword);\n\n\t\t//$sql=\"SELECT * FROM $table_name WHERE userName='$myusername' and password='$mypassword'\";\n\t\t$result = mysql_query(\"SELECT * FROM websiteusers WHERE userName='$myusername' AND pass='$mypassword'\") or die(mysql_error()); //db is hardcoded to reduce number of variables\n\n\t\t// Mysql_num_row is counting table row\n\t\t$count = mysql_num_rows($result);\n\n\t\t// If result matched $userName and $password, table row must be 1 row\n\n\t\tif($count == 1)\n\t\t{\n\t\t\t// Register $userName, $password and redirect to file \"login_success.php\"\n\t\t\t$_SESSION['myusername'] = $myusername;\n\t\t\treturn true;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"private function checkLogin() {\n if (!$this->checkConfig()) return;\n $config = $this->getConfig();\n\n if (isset($_SESSION['signin/twitter/status']) && $_SESSION['signin/twitter/status']=='verified') {\n\n $screenname = $_SESSION['signin/twitter/request_vars']['screen_name'];\n $twitterid = $_SESSION['signin/twitter/request_vars']['user_id'];\n $oauth_token = $_SESSION['signin/twitter/request_vars']['oauth_token'];\n $oauth_token_secret = $_SESSION['signin/twitter/request_vars']['oauth_token_secret'];\n\n $connection = new TwitterOAuth($config['consumer_key'], $config['consumer_secret'], $oauth_token, $oauth_token_secret);\n\n // check if we already have this Twitter user in our database\n $user = UserQuery::create()->findOneByOAuthSignIn('twitter::' . $twitterid);\n if (!$user) {\n // if not we create a new one\n $user = new User();\n $user->setCreatedAt(time());\n $user->setOAuthSignIn('twitter::' . $twitterid);\n // we use the email field to store the twitterid\n $user->setEmail('');\n $user->setRole(UserPeer::ROLE_EDITOR); // activate user rigth away\n $user->setName($screenname);\n $user->setSmProfile('https://twitter.com/'.$screenname);\n $user->save();\n }\n DatawrapperSession::login($user);\n }\n }",
"function login() {\n $username = Slim::getInstance()->request()->post('username');\n $password = Slim::getInstance()->request()->post('password');\n\n try {\n $db = getConnection();\n\n\t$sql = \"SELECT userId FROM users WHERE username=:username\";\n\t$stmt = $db->prepare($sql);\n\t$stmt->bindParam(\"username\", $username);\n\t$stmt->execute();\n\t$username_test = $stmt->fetchObject();\n\tif(empty($username_test)) {\n\t\techo \"error_username_doesnt_exists\";\n\t\treturn;\n\t}\n\n\t$sql = \"SELECT password FROM users WHERE username=:username\";\n $stmt = $db->prepare($sql);\n $stmt->bindParam(\"username\", $username);\n $stmt->execute();\n $storedPassword = $stmt->fetchObject()->password;\n\n if(empty($storedPassword)) {\n echo \"null\";\n } else if(strcmp($password, $storedPassword) == 0) {\n\t\t $query = \"SELECT userId FROM users WHERE username=:username\";\n\t\t $stmt2 = $db->prepare($query);\n\t\t $stmt2->bindParam(\"username\", $username);\n\t\t $stmt2->execute();\n \t echo '{\"Username\": \"' . $username . '\", \"ID\": ' . $stmt2->fetchObject()->userId . '}'; \n } else {\n\t\techo \"null\";\n\t}\n\n $db = null;\n } catch(PDOException $e) {\n echo '{\"error\":{\"text\":'. $e->getMessage() .'}}'; \n }\n}",
"function loginUser($user,$password){\n if($this->connection){\n $table = $this->getTableConstant();\n $query_selectUser = \"SELECT * FROM $table WHERE user=?\";\n $statement = $this->connection->prepare($query_selectUser);\n $statement->bind_param('s', $user);\n $statement->execute();\n $result = $statement->get_result();\n while($row = $result->fetch_assoc()){\n $hash = $row['password'];\n $userID = $row['id'];\n if(password_verify($password, $hash)){\n $_SESSION['loggedIn'] = true;\n $_SESSION['userName'] = $user;\n $_SESSION['userID'] = $userID;\n return true;\n }\n }\n }\n return false;\n }",
"public function login() {\n $this->db->sql = 'SELECT * FROM '.$this->db->dbTbl['users'].' WHERE username = :username LIMIT 1';\n\n $user = $this->db->fetch(array(\n ':username' => $this->getData('un')\n ));\n\n if($user['hash'] === $this->hashPw($user['salt'], $this->getData('pw'))) {\n $this->sessionId = md5($user['id']);\n $_SESSION['user'] = $user['username'];\n $_SESSION['valid'] = true;\n $this->output = array(\n 'success' => true,\n 'sKey' => $this->sessionId\n );\n } else {\n $this->logout();\n $this->output = array(\n 'success' => false,\n 'key' => 'WfzBq'\n );\n }\n\n $this->renderOutput();\n }",
"function userLogin($email, $pass)\n\t{\n\t\t$password = md5($pass);\n\t\t$stmt = $this->con->prepare(\"SELECT id FROM users WHERE email = ? AND password = ?\");\n\t\t$stmt->bind_param(\"ss\", $email, $password);\n\t\t$stmt->execute();\n\t\t$stmt->store_result();\n\t\treturn $stmt->num_rows > 0;\n\t}",
"public function verify() {\n // Compare session_id as a binary safe string.\n if (strcmp($this->session_id, '0') !== 0) {\n // Session id cookie is set, build the SQL to validate the session id.\n $sql = \"SELECT A.id FROM Users U INNER JOIN Administrators A ON U.id = A.id WHERE session_id = '$this->session_id'\";\n } else {\n // Session id cookie is not set, build the SQL to check the email and password.\n $sql = \"SELECT A.id FROM Users U INNER JOIN Administrators A ON U.id = A.id WHERE email = '$this->email' AND password = '$this->password'\";\n }\n\n // Query the database.\n $results = parent::queryDatabase($sql);\n\n // There should only be one result to the query. If there are any more,\n // something else has failed, default to to fail status - do not grant\n // user access.\n if ($results->num_rows === 1) {\n return True;\n } else {\n return False;\n }\n }",
"function find_user() //функция авторизации пользователя\n\t{\n\t\t//echo \"Hello <br/>\";\n\t\t$sth = $this->db->prepare(\"SELECT id, username FROM accounts WHERE username = :username AND password = :password\");\n \t\t$sth->execute(array(\n\t\t\t\t\t\t\t':username'=>$_POST['username'], \n\t\t\t\t\t\t\t':password' =>Hash::create('sha256', $_POST['password'], 'cats do not fliing')\n \t\t\t\t\t));\n\n \t/*$result = $sth->fetchAll();\n\t\tprint_r($result);*/\n\t\t$data = $sth->fetch();\n\t\t//print_r($data);\n\n\t\t$count = $sth->rowCount();\n\t\tif($count > 0)\n\t\t{\n\t\t\t//logged in\n\t\t\tSession::init();\n\t\t\tSession::set('username', $data['username'] );\n\t\t\tSession::set('loggedIn', true);\n\t\t\theader('location: ../dashboard');\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader('location: ../login');\n\t\t}\n\t\t\n\t}",
"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}",
"function check_database($password)\n {\n $username = $this->input->post('username');\n \n //query the database\n $result = $this->Products->login($username, $password);\n \n if($result)\n {\n $sess_array = array();\n foreach($result as $row)\n {\n $sess_array = array(\n 'id' => $row->id,\n 'username' => $row->email\n );\n $this->session->set_userdata('logged_in', $sess_array);\n }\n return TRUE;\n }\n else\n {\n $this->form_validation->set_message('check_database', 'Invalid username or password');\n return false;\n }\n }"
] | [
"0.72394574",
"0.72030115",
"0.71856934",
"0.7177519",
"0.7161466",
"0.71586186",
"0.71303",
"0.7108942",
"0.71080065",
"0.71070373",
"0.70705056",
"0.7055901",
"0.70543987",
"0.7051655",
"0.7037782",
"0.70009124",
"0.70007306",
"0.69806457",
"0.69743615",
"0.69551414",
"0.69539136",
"0.69329613",
"0.69313973",
"0.6931016",
"0.69276345",
"0.6913899",
"0.6884482",
"0.688154",
"0.686832",
"0.6852869",
"0.6847272",
"0.6832804",
"0.6829483",
"0.68292993",
"0.6823294",
"0.68171537",
"0.68115467",
"0.6810767",
"0.6805166",
"0.68047047",
"0.6801815",
"0.6800922",
"0.6796828",
"0.67865294",
"0.6785113",
"0.6765832",
"0.6762494",
"0.67469466",
"0.6746766",
"0.67412806",
"0.6724843",
"0.67156565",
"0.6711025",
"0.6703796",
"0.66998816",
"0.6698074",
"0.6692553",
"0.66912323",
"0.66903317",
"0.66848",
"0.66658527",
"0.6664359",
"0.66643",
"0.6662614",
"0.66620463",
"0.6658966",
"0.66586477",
"0.66547966",
"0.6651894",
"0.66495645",
"0.6644261",
"0.6641245",
"0.6633612",
"0.6633385",
"0.6626806",
"0.66258204",
"0.66239136",
"0.661997",
"0.66178036",
"0.6615075",
"0.6609814",
"0.6609646",
"0.6608998",
"0.6608088",
"0.6606103",
"0.65964735",
"0.6593667",
"0.6591447",
"0.65908676",
"0.6585254",
"0.65833336",
"0.6577767",
"0.6570742",
"0.6563861",
"0.6563249",
"0.65588707",
"0.6556279",
"0.6548882",
"0.6548839",
"0.65473574"
] | 0.6589936 | 89 |
Maybe this is empty on form submit | public function setTitelAttribute($value)
{
$this->attributes['titel'] = $value ?: null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function has_submit() {\n\t\treturn false;\n\t}",
"public function emptyForm() {\n\t\techo '<div class=\"alert fail\"><span class=\"btnclose\">×</span><strong>Tous les champs sont obligatoires !</strong></div>';\n\t}",
"protected function onSubmit()\r {\r }",
"public function is_empty()\r\n {\r\n if( $this->is_submit() && ($this->taintedInputs->length()=== 0))\r\n return true; \r\n else\r\n return false;\r\n }",
"public function is_form_submit() {\n\n\t if (isset($_POST['foodbakery_restaurant_title'])) {\n\t\treturn true;\n\t }\n\t return false;\n\t}",
"public function fetchSubmitAdditionnalInfo() {\n return '';\n }",
"public function is_submit()\r\n {\r\n if( $this->taintedInputs->isAutogenerated()){\r\n return false;\r\n }\r\n else{\r\n return true;\r\n }\r\n }",
"function formSubmitted()\n\t{\n\t\t// Do we have a form name? If so, if we have this form name, then this\n\t\t// particular form has been submitted.\n\t\tif ($this->formName) {\n\t\t\treturn (isset($_POST['update']) && $_POST['update'] == $this->formName);\t\n\t\t} \n\t\t// No form name, just detect our hidden field.\n\t\telse {\n\t\t\treturn (isset($_POST['update']));\n\t\t}\n\t}",
"function check_form_submitted()\n {\n $query = $this->recruitment_model->get_faculty_info($this->user_id);\n if($query->num_rows()==1)\n {\n if($query->row()->final_submission==1)\n {\n return 1;\n }\n else\n {\n return 0;\n }\n }\n return 0;\n }",
"function isSubmitted()\r\n\t\t{\r\n\t\t\tif( isset($_POST[$this->form_id.'-issubmitted'] ) )\r\n\t\t\t\treturn TRUE;\r\n\t\t\telse\r\n\t\t\t\treturn FALSE;\r\n\r\n\t\t}",
"protected function OnSubmit()\n {\n //tu codigo aqui\n }",
"function existingQueryForm () { return \"\"; }",
"public function getSubmitVar() { return $this->_submitVar; }",
"public function formSubmitted() {\n return $_SERVER[\"REQUEST_METHOD\"] == 'POST';\n }",
"public function isSubmitted();",
"public function isPostLeeg()\n {\n return empty($_POST);\n }",
"protected abstract function fetchSubmitValue();",
"public function isSubmitted()\n\t{\n\t\tif( $this->method == 'post' )\n\t\t{\n\t\t\treturn $this->request->getMethod() == 'post';\n\t\t}\n\n\t\t$arr = $this->request->getQueryString();\n\t\treturn ! empty( $arr );\n\t}",
"public static function form(){\n\t\treturn \"\";\n\t}",
"public function isSubmit() {\n return Tools::isSubmit($this->key());\n }",
"function check_submit_form()\n {\n }",
"static function all_Empty()\r\n {\r\n echo PageBuilder::printError(\"Please enter valid data in all the fields, nothing can not be empty.\");\r\n }",
"protected function renderHiddenFieldForEmptyValue() {}",
"public function getSubmittedValue() {\n return isset($_REQUEST[$this->name]) ? $_REQUEST[$this->name] : FALSE;\n }",
"public function needForm()\n {\n return true;\n }",
"function form_submitted()\n{\n return isset($_POST['Submit']);\n}",
"function script_on_submit()\n\t{\n\t\treturn '';\n\t}",
"function validate()\n {\n // @hack FIXME @todo\n return true;\n /*\n if (empty($this->POST['subject'])) {\n return false;\n }\n return true;\n */\n }",
"public function valiteForm();",
"public function isPosted()\n\t{\n\t\treturn (! empty($_POST['change_password']));\n\t}",
"public function isSubmitted()\n\t{\n\t\tif ($this->http_method == 'get') {\n\t\t\t// GET form is always submitted\n\t\t\treturn TRUE;\n\t\t} else if (isset($this->raw_input['__'])) {\n\t\t\t$__ = $this->raw_input['__'];\n\t\t} else {\n\t\t\treturn FALSE;\n\t\t}\n\t\tforeach ((array) $__ as $token => $x) {\n\t\t\t$t = static::validateFormToken($token, $this->id);\n\t\t\tif ($t !== FALSE) {\n\t\t\t\t// Submitted\n\t\t\t\tif ($this->form_ttl > 0 && time() - $t > $this->form_ttl) {\n\t\t\t\t\t$this->form_errors[self::E_FORM_EXPIRED] = array(\n\t\t\t\t\t\t'message' => _('The form has expired, please check entered data and submit it again.')\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\t\treturn FALSE;\n\t}",
"public function onSubmit();",
"public function get_login_input_field_empty_form() {\n $this->do_login_input_field_empty_form();\n return $this->c_arr_login_field_empty_form;\n }",
"public function fetchSubmit($submitted_values = array()) {\n return '';\n }",
"public function getSubmitValue(): string\n {\n return $this->submitValue;\n }",
"public function isSubmitted() {\n return $this->submitted;\n }",
"public function getSubmittedValue();",
"public function getSubmittedValue();",
"function checkEmpty(){\n\t\tif(!empty($_POST)){\n\t\t\treturn true;\n\t\t}else{\n\t\t\treturn false;\n\t\t}\n\t}",
"public static function renderSubmit();",
"protected function processForm(){\n if(Tools::isSubmit('saveBtn')){ // save data\n $settings = array(\n 'user' => Tools::getValue('user'),\n 'widget_id' => Tools::getValue('widget_id'),\n 'tweets_limit' => Tools::getValue('tweets_limit'),\n 'follow_btn' => Tools::getValue('follow_btn')\n );\n Configuration::updateValue($this->name.'_settings', serialize($settings));\n \n // display success message\n return $this->displayConfirmation($this->l('The settings have been successfully saved!'));\n }\n \n return '';\n }",
"public function testFormSubmitWithoutAnyValue()\n {\n $this->actingAs($this->user)\n ->visit('/employees/create')\n ->see('Create a new Employee')\n ->dontSee('Create a new Company')\n ->press('Create')\n ->seePageIs('/employees/create')\n ->see('The First Name field is required.')\n ->see('The Last Name field is required.');\n }",
"public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }",
"public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }",
"function fieldsEmpty() {\n if(empty($_POST['title']) || empty($_POST['date']) || empty($_POST['location'])) {\n return true;\n } else {\n return false;\n }\n}",
"function check()\n {\n if (trim($this->monto) == '') {\n $this->setError(JText::_('Debe Ingresar Un Monto a Pagar'));\n return false;\n }\n\n return true;\n }",
"function process_form()\n {\n }",
"public function IsSubmitted() {\n\n if ($this->HttpValues === null) {\n // HTTP submision's data are not imported? import them now from Request service.\n $this->SetHttpValues();\n }\n return isset($this->HttpValues['_FormName'])\n && $this->HttpValues['_FormName'] === $this->Name;\n }",
"public function afterSubmit() {\n\t\t$this->setValue($this->serializeData($this->getValue()));\n\t}",
"protected static function form_csrf () {\n\t\treturn '';\n\t}",
"function FormPosted()\n{\n //en return true of false\n\n}",
"public static function trySubmit() {\n\t}",
"public function get_register_input_field_empty_form() {\n $this->do_register_input_field_empty_form();\n return $this->c_arr_register_field_empty_form;\n }",
"public function isSubmitted() {\n return $this->submitted;\n }",
"public function validate() {\n if (!empty($this->value)) {\n parent::validate();\n }\n }",
"function readOnSubmit() {return $this->_onsubmit;}",
"public function isVoid()\n {\n return empty($this->fields);\n }",
"public function cleanseFields() {\n $this->dictionary->remove('nospam');\n $this->dictionary->remove('blank');\n $submitVar = $this->controller->getProperty('submitVar');\n if (!empty($submitVar)) {\n $this->dictionary->remove($submitVar);\n }\n }",
"function on_submit_button($button, $form) {\n\t\tif ($form['id'] != $this->form_id) {\n\t\t\treturn $button;\n\t\t}\n\t\treturn '';\n\t}",
"function isSubmittedBy();",
"public function isSubmitted()\n {\n return $this->isSubmitted;\n }",
"public function isSubmitted()\n {\n return $this->isSubmitted;\n }",
"function filled_out($form_vars)\r\n{\r\n foreach ($form_vars as $key => $value)\r\n {\r\n if (!isset($key) || ($value == \"\"))\r\n return true;\r\n }\r\n return true;\r\n}",
"public function registrationForm(){\n self::$signUpName = $_POST['signup-name'];\n self::$signUpEmail = $_POST['signup-email'];\n self::$signUpPassword = $_POST['signup-password'];\n\n self::sanitize();\n if(self::checkIfAvailable()){\n self::$signUpName =\"\";\n self::$signUpEmail = \"\";\n self::$signUpPassword = \"\";\n }\n }",
"protected function Form_Run() {}",
"function emptyPost() {\n\t\t$_POST = array();\n\t}",
"public function callbackSubmit()\n {\n // Get values from the submitted form\n $text = $this->form->value(\"text\");\n\n if (!$this->di->get('session')->has(\"user\")) {\n $this->form->addOutput(\"Du behöver logga in\");\n return false;\n }\n\n $user = new User($this->di->get(\"db\"));\n if ($user->controlAuthority($this->di->get('session')->get(\"user\"), $this->post->user) != true) {\n $this->form->addOutput(\"Du får inte redigera denna.\");\n return false;\n }\n\n if ($text == \"\") {\n $this->form->addOutput(\"Du skrev aldrig något. Skriv gärna något.\");\n return false;\n }\n\n $this->post->text = $text;\n $this->post->save();\n $this->form->addOutput(\"Du har uppdaterat inlägget\");\n return true;\n }",
"protected function ValidateForm()\n {\n return true;\n }",
"function protectForm() {\n\t\techo \"<input type=\\\"hidden\\\" name=\\\"spack_token\\\" value=\\\"\".$this->token.\"\\\" />\";\n\t}",
"public function getLegalForm(): ?string;",
"public static function is_submitting(){\n\t\treturn (strcasecmp('POST', $_SERVER['REQUEST_METHOD'] ) == 0);\n\t}",
"protected function validatePOST() {\n return true;\n }",
"public function cleanFormData()\n {\n parent::cleanFormData();\n\n // You can only save data for the current user\n $this->formData['gsf_id_user'] = $this->currentUser->getUserId();\n }",
"function getFormNoValidate()\n {\n return $this->getAttribute(\"formnovalidate\");\n }",
"public function checkDataSubmission() {\n\t\t$this->main('', array());\n }",
"public static function did_you_know_slide_node_form_submit($form, &$form_state) {\n $body = $form_state['values']['body'][LANGUAGE_NONE][0]['value'];\n $title = substr($body, 0, 150);\n $title = substr($title, 0, strrpos($title, ' ') - 1);\n if (strlen($body) > 150) {\n $title .= '...';\n }\n $form_state['values']['title'] = $title;\n }",
"function testInputRemplis($fichier){\n if (empty($_POST[$fichier])) {\n return \"<span class='text-danger'>\" .\"Le champ \" .$fichier. \" est vide <br>\" . \"</span>\";\n }\n}",
"public function getShowSubmit()\n {\n return $this->showSubmit;\n }",
"public function oldInputIsEmpty()\n {\n return (isset($this->session) && count($this->session->getOldInput()) == 0);\n }",
"public function submit_form()\n\t{\n\t\tDisplay::message('user_profil_submit', ROOT . 'index.' . PHPEXT . '?p=profile&module=contact', 'forum_profil');\n\t}",
"function hasForm() {\n\t\t\t$form = $this->getForm( );\n\n\t\t\tif (!empty( $$form )) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\treturn false;\n\t\t}",
"static function all_Empty()\r\n {\r\n echo PageBuilder::printError(\"Please enter Email and Password, nothing can not be empty.\");\r\n return false;\r\n }",
"private function validateForm(): void\n { if ($this->form->isSubmitted()) {\n // get the status\n $status = $this->getRequest()->request->has('saveAsDraft') ? 'draft' : 'active';\n\n // cleanup the submitted fields, ignore fields that were added by hackers\n $this->form->cleanupFields();\n\n // validate fields\n $this->form->getField('title')->isFilled(BL::err('TitleIsRequired'));\n $this->form->getField('text')->isFilled(BL::err('FieldIsRequired'));\n $this->form->getField('publish_on_date')->isValid(BL::err('DateIsInvalid'));\n $this->form->getField('publish_on_time')->isValid(BL::err('TimeIsInvalid'));\n $this->form->getField('category_id')->isFilled(BL::err('FieldIsRequired'));\n if ($this->form->getField('category_id')->getValue() == 'new_category') {\n $this->form->getField('category_id')->addError(BL::err('FieldIsRequired'));\n }\n\n // validate meta\n $this->meta->validate();\n\n if ($this->form->isCorrect()) {\n // build item\n $item = [\n 'id' => (int) BackendBlogModel::getMaximumId() + 1,\n 'meta_id' => $this->meta->save(),\n 'category_id' => (int) $this->form->getField('category_id')->getValue(),\n 'user_id' => $this->form->getField('user_id')->getValue(),\n 'language' => BL::getWorkingLanguage(),\n 'title' => $this->form->getField('title')->getValue(),\n 'introduction' => $this->form->getField('introduction')->getValue(),\n 'text' => $this->form->getField('text')->getValue(),\n 'publish_on' => BackendModel::getUTCDate(\n null,\n BackendModel::getUTCTimestamp(\n $this->form->getField('publish_on_date'),\n $this->form->getField('publish_on_time')\n )\n ),\n 'created_on' => BackendModel::getUTCDate(),\n 'hidden' => $this->form->getField('hidden')->getValue(),\n 'allow_comments' => $this->form->getField('allow_comments')->getChecked(),\n 'num_comments' => 0,\n 'status' => $status,\n ];\n $item['edited_on'] = $item['created_on'];\n\n // insert the item\n $item['revision_id'] = BackendBlogModel::insert($item);\n\n if ($this->imageIsAllowed) {\n // the image path\n $imagePath = FRONTEND_FILES_PATH . '/Blog/images';\n\n // create folders if needed\n $filesystem = new Filesystem();\n $filesystem->mkdir([$imagePath . '/source', $imagePath . '/128x128']);\n\n // image provided?\n if ($this->form->getField('image')->isFilled()) {\n // build the image name\n $item['image'] = $this->meta->getUrl()\n . '-' . BL::getWorkingLanguage()\n . '-' . $item['revision_id']\n . '.' . $this->form->getField('image')->getExtension();\n\n // upload the image & generate thumbnails\n $this->form->getField('image')->generateThumbnails($imagePath, $item['image']);\n\n // add the image to the database without changing the revision id\n BackendBlogModel::updateRevision($item['revision_id'], ['image' => $item['image']]);\n }\n }\n\n // save the tags\n BackendTagsModel::saveTags($item['id'], $this->form->getField('tags')->getValue(), $this->url->getModule());\n\n // active\n if ($item['status'] == 'active') {\n // add search index\n BackendSearchModel::saveIndex($this->getModule(), $item['id'], ['title' => $item['title'], 'text' => $item['text']]);\n\n // everything is saved, so redirect to the overview\n $this->redirect(BackendModel::createUrlForAction('Index') . '&report=added&var=' . rawurlencode($item['title']) . '&highlight=row-' . $item['revision_id']);\n } elseif ($item['status'] == 'draft') {\n // draft: everything is saved, so redirect to the edit action\n $this->redirect(BackendModel::createUrlForAction('Edit') . '&report=saved-as-draft&var=' . rawurlencode($item['title']) . '&id=' . $item['id'] . '&draft=' . $item['revision_id'] . '&highlight=row-' . $item['revision_id']);\n }\n }\n }\n }",
"function formularioRelleno($numCampos){\n \n //Si la variable %_POST tiene menos de 8 campos es que el form no esta relleno\n if(count($_POST)<$numCampos){\n return false;\n }\n else{\n foreach ($_POST as $valor) {\n //Si alguno de los campos esta vacio tampoco cuenta como relleno,\n //esto es para evitar que se manden campos de texto vacios\n if (empty($valor)){\n return false;\n }\n }\n }\n \n return true;\n}",
"public function noForm()\n\t{\n\t\treturn $this->db->query(\"SELECT no_formulir FROM `wajib_pajak` ORDER BY no_formulir DESC LIMIT 1\");\n\t}",
"public function isPostSubmit(){\n if( strtolower($this->__method) == \"post\" ){\n return true;\n }\n return false;\n }",
"public function refreshFormSubmission(){\r\n\t\t\t$this->load->model('gs_admission/ajax_base_model', 'AB');\r\n\t\t\t$data[\"school_lists\"] = $this->AB->school_id();\r\n\t\t\t$data[\"grade_lists\"] = $this->AB->grade_id();\r\n\t\t\t$this->load->view('gs_admission/submission/empty_form',$data);\r\n\t\t}",
"function form_action()\r\n {\r\n $success = true ;\r\n\r\n $swimmeet = new SwimMeet() ;\r\n $swimmeet->PurgeSwimMeets() ;\r\n\r\n $this->set_action_message(html_div(sprintf('ft-%s-msg',\r\n $swimmeet->getAffectedRows() == 0 ? 'warning' : 'note'),\r\n sprintf('%d record%s purged from Swim Meets database.',\r\n $swimmeet->getAffectedRows(),\r\n $swimmeet->getAffectedRows() == 1 ? '' : 's'))) ;\r\n\r\n unset($swimmeet) ;\r\n\r\n return $success ;\r\n }",
"public function preferenceForm()\r\n\t{\r\n\t\treturn null;\r\n\t}",
"public function valid()\n {\n return !empty($this->name);\n }",
"function _field_submit($fval) \n {\n $res = \"\";\n if (isset($this->attribs['disable_self_onclick'])) {\n $this->extra_attribs .= 'onclick=\"this.disabled=true; this.value=\\'please wait...\\'\"';\n }\n\n if (isset($this->attribs['show_reset_button'])) {\n $res .= sprintf(\"<div style=\\\"float:left\\\"><input type=\\\"reset\\\" name=\\\"reset_op\\\" value=\\\"reset form\\\" class=\\\"%s\\\" /></div>\\n\", \n (isset($this->attribs['class']))? $this->attribs['class'] : $this->element_class);\n }\n $res .= sprintf(\"<input type=\\\"submit\\\" name=\\\"%s\\\" id=\\\"%s\\\" value=\\\"%s\\\" class=\\\"%s\\\" %s />\\n\",\n $this->fname,\n $this->fname,\n $this->_htmlentities($this->descrip),\n (isset($this->attribs['class']))? $this->attribs['class'] : $this->element_class,\n $this->extra_attribs);\n return $res;\n }",
"public function formAction() {}",
"public function posted()\n {\n if (empty($this->post)) {\n return false;\n }\n\n return true;\n }",
"public static function form_action_insert () \n {\n global $wpdb;\n\n $prefix = $wpdb->prefix;\n\n $inputs = input::post_is_object();\n \n $title = $inputs->title;\n $image= $inputs->image;\n $sub_title = $inputs->sub_title;\n $sub_two = $inputs->sub_two;\n $status = $inputs->status;\n $desc = $inputs->desc;\n\n \n $validate[] = self::form_action_empty_validate( 'title', 'empty' );\n $validate[] = self::form_action_empty_validate( 'image', 'empty' );\n $validate[] = self::form_action_empty_validate( 'sub_title', 'empty' );\n $validate[] = self::form_action_empty_validate( 'sub_two', 'empty' );\n $validate[] = self::form_action_empty_validate( 'status', 'empty' );\n\n if( isset( $inputs->submit_monitor ) ) \n {\n \n if( ! in_array( false, $validate ) ) \n {\n \n self::inserts( config::$tbls['table1'], \n array( 'title' => $title, 'image' => $image, 'sub_title' => $sub_title, 'sub_title_two' => $sub_two, 'status' => $status, 'desc' => $desc ), \n array( '%s', '%s', '%s', '%s', '%s', '%s' ) \n );\n\n $page = page_rounter::url( 'manage_wp_monitoring', false );\n\n redirect::filter( $page );\n\n }\n }\n }",
"public function populateForm() {}",
"public function formSuccess() {\n return $this->_formSuccess;\n }",
"function renderForm()\n{\n ?>\n <form method=\"POST\">\n <label>Nome <input name=\"name\" value=\"<?php echo $_POST['name'] ?? '' ?>\"></label><br/>\n <label>Messaggio <input name=\"message\" value=\"<?php echo $_POST['message'] ?? '' ?>\"></label><br/>\n <input type=\"submit\" value=\"Invia\">\n </form>\n <?php\n}",
"function form_action()\r\n {\r\n $success = true ;\r\n\r\n $sdifqueue = new SDIFResultsQueue() ;\r\n $cnt = $sdifqueue->ProcessQueue() ;\r\n\r\n $c = container() ;\r\n $msgs = $sdifqueue->get_status_message() ;\r\n\r\n foreach ($msgs as $msg)\r\n $c->add(html_div(sprintf('ft-%s-msg', $msg['severity']), $msg['msg'])) ;\r\n $c->add(html_div('ft-note-msg',\r\n sprintf(\"%d record%s processed from SDIF Queue.\",\r\n $cnt, $cnt == 1 ? \"\" : \"s\"))) ;\r\n\r\n $this->set_action_message($c) ;\r\n\r\n unset($sdifqueue) ;\r\n\r\n return $success ;\r\n }",
"function submit_current_job()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\t\n\t\t#User has posted their current job details\n\t\tif(!empty($_POST['schoolid']))\n\t\t{\n\t\t\t$result = $this->_job->submit_current_job($this->input->post(NULL, TRUE));\n\t\t\t$data['msg'] = $result? \"Your job has been submitted for approval\": \"ERROR: Your job could not be submitted for approval.\";\n\t\t}\n\t\t\n\t\t$data['area'] = \"submit_current_job\";\n\t\t$this->load->view('job/addons', $data);\n\t}",
"function form_backend_validation()\r\n {\r\n return true ;\r\n }",
"public function submit() {\n\tparent::submit();\n\tif( $this->notify() ) {\n\t echo '<div class=\"alert alert-success\">' . $this->message_form_send . '</div>';\n\t}\n }"
] | [
"0.6820928",
"0.6710881",
"0.6626044",
"0.6501099",
"0.64248735",
"0.63099515",
"0.62430865",
"0.62242407",
"0.62117916",
"0.6174912",
"0.61709094",
"0.6168855",
"0.6147136",
"0.61183125",
"0.6102977",
"0.6053826",
"0.6049809",
"0.60445607",
"0.6029926",
"0.597602",
"0.59597355",
"0.5950255",
"0.59344715",
"0.5929624",
"0.59257334",
"0.58944875",
"0.58837366",
"0.5878577",
"0.587475",
"0.58628315",
"0.5852538",
"0.5836965",
"0.5810784",
"0.5806005",
"0.5799398",
"0.5796284",
"0.57825714",
"0.57825714",
"0.5782033",
"0.5767754",
"0.5734771",
"0.57178587",
"0.57097757",
"0.57097757",
"0.5709202",
"0.5702785",
"0.56910396",
"0.5684214",
"0.5676736",
"0.566256",
"0.5653909",
"0.5653304",
"0.5651414",
"0.5636422",
"0.56291115",
"0.5627516",
"0.5619191",
"0.5611799",
"0.56079394",
"0.55758005",
"0.55714273",
"0.55714273",
"0.5570964",
"0.5559052",
"0.5542176",
"0.55406827",
"0.5540288",
"0.5537979",
"0.55361825",
"0.55344373",
"0.55312467",
"0.5529395",
"0.5528869",
"0.5527276",
"0.5525329",
"0.55151725",
"0.55144244",
"0.55038244",
"0.54924524",
"0.5489716",
"0.5487562",
"0.54868025",
"0.54741395",
"0.54711664",
"0.5470706",
"0.5464426",
"0.5462566",
"0.54544616",
"0.54542226",
"0.5449307",
"0.5446388",
"0.54410714",
"0.54378676",
"0.5430142",
"0.5426828",
"0.5426005",
"0.5425436",
"0.54235977",
"0.5420253",
"0.5419866",
"0.5398796"
] | 0.0 | -1 |
Hash the password on every save, no need for controller Hash::make | public function setPasswordAttribute($value)
{
$this->attributes['password'] = Hash::make($value);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function hashPassword()\t{\n\t\t$fields = $this->_settings['fields'];\n\t\tif (!isset($this->model->data[$this->model->name][$fields['username']])) {\n\t\t\t$this->model->data[$this->model->name][$fields['password']] = Security::hash($this->model->data[$this->model->name][$fields['password']], null, true);\n\t\t}\n\t}",
"protected function hashPassword() {\n\t\t$this->password = Password::hash($this->password);\n\t}",
"function save() {\r\n if(strlen($this->password) != 40) {\r\n $this->password = sha1($this->password);\r\n }\r\n // Call the parent save() method.\r\n return parent::save();\r\n }",
"public function setPasswordAttribute($value)\n {\n $this->attributes['password'] = Hash::make($value);\n \n }",
"public function setPasswordAttribute($pass){\n $this->attributes['password'] = Hash::make($pass);\n }",
"public function setPasswordAttribute($pass){\n $this->attributes['password'] = Hash::make($pass);\n }",
"public function hash_passwd() {\n $this->passwd = sha1($this->passwd);\n return $this;\n }",
"public function afterValidationOnCreate()\n {\n $this->hash = $this->getDI()->getSecurity()->hash($this->hash);\n }",
"public function setPasswordAttribute($value) {\n \t$this->attributes['password'] = Hash::make($value);\n\t}",
"public function password() {\n return Hash::make('MonsterRXBOCS');\n }",
"function _hash_password($password)\n {\n //return altered pw\n\n }",
"function hashPassword($data) { \r\n if (!$this->id && !isset($this->data[$this->name]['id'])) {\r\n if (!isset($this->data[$this->name]['FilterChar'])) {\r\n $this->data[$this->name]['FilterChar'] = self::createFilterChar();\r\n }\r\n if (isset($this->data[$this->name]['Username']) && isset($this->data[$this->name]['Password']) && isset($this->data[$this->name]['FilterChar'])) {\r\n\r\n $this->data[$this->name]['Password'] = sha1($this->data[$this->name]['Username'] . \"+\" . $this->data[$this->name]['Password'] . \"+\" . $this->data[$this->name]['FilterChar']);\r\n\r\n $this->data[$this->name]['FirstPass'] = $this->data[$this->name]['Password'];\r\n\r\n return $data;\r\n }\r\n }\r\n }",
"public function GetPasswordHash ();",
"public function setPasswordAttribute( $value ) {\n $this->attributes['password'] = Hash::make( $value );\n }",
"public function action()\n {\n $user = $this->user();\n $data = $this->validated();\n \n $user->forceFill([\n 'password' => Hash::make($data['password']),\n ])->save();\n }",
"public function store(Request $request){\n $request->validate([\n 'current_password' => ['required', 'min:8', 'password'],\n 'password' => ['required', 'min:8', 'confirmed', Rules\\Password::defaults()],\n ]);\n \n $user = Auth::user();\n\n /* if (Hash::check($request->current_password, $user->password)) {\n $request->user()->fill([\n 'password' => Hash::make($request->password)\n ])->save();\n }else{\n ;\n } */\n\n $request->user()->fill([\n 'password' => Hash::make($request->password)\n ])->save();\n\n //TODO success message\n\n\n return redirect(route('changepass.index'));\n }",
"public function makePassword($pw)\n\t\t{\n\t\t\treturn $this->useHash ? sha1($pw . $this->salt) : $pw;\n\t\t}",
"public function actualizar_password(Request $request){\n $user=User::where('email','=',$request->email)\n ->first();\n\n $user->password=Hash::make($request->password);\n\n $user->save();\n\n return $user->email;\n }",
"public function setPasswordAttribute($value) {\n $this->attributes['password'] = Hash::make($value);\n }",
"public function setPasswordAttribute($value) {\n $this->attributes['password'] = Hash::make($value);\n }",
"public function hash_pword($hashme){\n return password_hash($hashme, PASSWORD_BCRYPT);/* md5(sha1($hashme)) */;\n\n}",
"public function setPasswordAttribute($password) {\n $this->attributes['password'] = Hash::make($password);\n }",
"protected function afterValidate()\n {\n parent::afterValidate();\n if (!$this->hasErrors()) {\n $this->password = $this->hashPassword($this->password);\n }\n }",
"protected function afterValidate()\n {\n parent::afterValidate();\n if (!$this->hasErrors()) {\n $this->password = $this->hashPassword($this->password);\n }\n }",
"protected function afterValidate()\n {\n \tparent::afterValidate();\n \tif(!$this->hasErrors())\n \t\t$this->password = $this->hashPassword($this->password);\n }",
"public function savePasswordToUser($user, $password);",
"public function setpasswordAction(){\n $req=$this->getRequest();\n $cu=$this->aaac->getCurrentUser();\n $password=$this->getRequest()->getParam('password');\n $record=Doctrine_Query::create()->from('Users')->addWhere('ID=?')->fetchOne(array($req->getParam('id'))); \n $record->password=md5($password);\n if(!$record->trySave()){\n $this->errors->addValidationErrors($record);\n }\n $this->emitSaveData(); \n }",
"public function setPassword() {\n if ($this->Password) {\n $this->Password = \\app\\components\\Utilities::setHashedValue($this->Password);\n }\n }",
"function save_psw_hash( $user, $pass = '' ) { \n\t\tglobal $wpdb;\n\n\t\tif ( !isset($user->ID) ) return;\n\n\t\tif ( !isset( $user->user_pass ) ) return;\n\n\t\t$oh = get_user_meta( $user->ID, 'll_old_hashes', true);\n\n\t\t$oh[] = wp_hash_password( $user->user_pass ); // cleartext, so hash it\n\n\t\t$c = count($oh); \n\n\t\tif ( $c > 5 ) { \n\t\t\t$removed = array_splice($oh, 0, ($c - 5) );\n\t\t}\n\n\t\tupdate_user_meta( $user->ID, 'll_old_hashes', $oh );\n update_user_meta( $user->ID, 'll_password_changed_date', time() );\n\n\t}",
"public function savePassword(Request $request) {\n $validator = Validator::make($request->all(), [\n 'password' => ['required', 'string', 'min:8', 'max:191', 'confirmed'],\n ]);\n\n if ($validator->fails()) {\n return back()->withErrors($validator);\n }\n\n Auth::user()->update([\n 'password' => Hash::make($request['password']),\n ]);\n\n return Redirect::to('/myprofile/password')->withSuccessMessage(trans('messages.password_updated'));\n }",
"public function beforeSave() {\n if ($this->isNewRecord) {\n if (isset($this->passwordSave, $this->repeatPassword) && ($this->passwordSave === $this->repeatPassword)) {\n $this->password = $this->hash($this->passwordSave);\n }\n $this->password_expiry_date = new CDbExpression(\"DATE_ADD(NOW(), INTERVAL \" . self::PASSWORD_EXPIRY . \" DAY) \");\n } else\n if (isset($this->passwordSave) && isset($this->repeatPassword) && ($this->passwordSave === $this->repeatPassword)) {\n //if it's not a new password, save the password only if it not empty and the two passwords match\n $this->password = $this->hash($this->passwordSave);\n $this->password_expiry_date = new CDbExpression(\"DATE_ADD(NOW(), INTERVAL \" . self::PASSWORD_EXPIRY . \" DAY) \");\n }\n $this->password_strategy = $this->encrypt_text(strtolower($this->email));\n if (!in_array(Lookup::item('AccessRole', $this->default_role), Lookup::items('AccessRole'))) {\n $this->default_role = 'member';\n }\n $this->roles = $this->roles_encrypt();\n return parent::beforeSave();\n }",
"public function setPasswordAttribute($password)\n {\n $this->attributes['password'] = Hash::make($password);\n }",
"function hashit($password){\n\t$salt = config('password.salt');\n\t$salt = sha1( md5($password.$salt) );\n\treturn md5( $password.$salt );\n}",
"public function hashPassword(UserInterface $user);",
"function updatePassword(){\n\t\tglobal $recoverPasswordInputs, $pdo;\n\t\t$newPass = createNewPassword();\n\t\t$updatePassword = $pdo->prepare('UPDATE `USER` SET `hash` = :newHash WHERE email = :email AND firstName = :firstName AND lastName = :lastName');\n\t\t$updatePassword->bindValue(':newHash', md5($newPass));\n\t\t$updatePassword->bindValue(':email', $recoverPasswordInputs['email']);\n\t\t$updatePassword->bindValue(':firstName', $recoverPasswordInputs['fname']);\n\t\t$updatePassword->bindValue(':lastName', $recoverPasswordInputs['lname']);\n\t\t$updatePassword->execute();\n\t\treturn $newPass;\n\t}",
"static function password_forgot() {\n $model = \\Auth::$model;\n\n # hash GET param exists\n if (!$hash = data('hash'))\n go('/');\n\n # user hash exists\n $user = $model::first(array(\n 'fields' => 'id, email, name',\n 'where' => \"hash_password_forgot = '$hash'\"\n ));\n\n if (empty($user))\n go('/');\n\n # POST passwords sent\n if ($model::data()) {\n $user->password = $model::data('password');\n $user->password_confirm = $model::data('password_confirm');\n\n # validate passwords\n if ($user->validate()) {\n $user->password = auth_encrypt($user->password);\n $user->hash_password_forgot = '';\n\n $user->edit() ?\n flash('Sua senha foi alterada com sucesso.') :\n flash('Algo ocorreu errado. Entre em contrato com a empresa.', 'error');\n\n go('/');\n }\n }\n\n globals('user', $user);\n }",
"public function setPasswordAttribute($value) {\n $this->attributes['password'] = \\Hash::make($value);\n }",
"public function hashPass($str)\n {\n // Phalcon's hashing system\n //return $this->_security->hash($str);\n\n // Using PHP5.5's built in system\n return password_hash($str, PASSWORD_DEFAULT, ['cost' => \\Phalcon\\DI::getDefault()->getShared('config')->auth->hash_workload]);\n }",
"public function setPasswordAttribute ($pass)\n\t{\n\t\t$this->attributes['password'] = Hash::make($pass);\n\t}",
"public function setPasswordAttribute($password)\n\t{\n\t\t$this->attributes['password'] = Hash::make($password);\n\t}",
"public function setPasswordAttribute($password)\n\t{\n\t\t$this->attributes['password'] = Hash::make($password);\n\t}",
"public function generatePasswordHash($password)\n {\n $this->password_hash = Yii::$app->security->generatePasswordHash($password);\n }",
"public function setPasswordAttribute($pass)\n {\n $this->attributes['password'] = app('hash')->make($pass);\n }",
"private function setEncryptPassword(){\n // Encode the new users password\n $encrpyt = $this->get('security.password_encoder');\n $password = $encrpyt->encodePassword($this->user, $this->user->getPassword());\n $this->user->setPassword($password);\n }",
"function makeHash($password) {\r\n return crypt($password, makeSalt());\r\n}",
"public function store(Request $request)\n {\n $request->validate([\n 'password' => 'bail|required|min:8|confirmed',\n ]);\n\n\n $pass = DB::table('users')\n ->where('id', Auth::user()->id)\n ->update([\n 'password' => Hash::make($request->input('password')),\n\n ]);\n\n return redirect('user_security');\n }",
"public static function hashPassword($password){\n $config = App_DI_Container::get('ConfigObject');\n $module = strtolower(CURRENT_MODULE);\n return sha1($config->{$module}->security->passwordsalt . $password);\n //return sha1($password);\n }",
"public function setPasswordAttribute($value)\n {\n $this->attributes['password'] = \\Hash::make($value);\n }",
"public function setPasswordAttribute($value)\n {\n $this->attributes['password'] = \\Hash::make($value);\n }",
"public function setPasswordAttribute($value)\n {\n $this->attributes['password'] = \\Hash::make($value);\n }",
"public function userPasswordUpdate() {\n $password = Hash::make($this->request->input(\"new_password\"));\n $updateArray = [\n \"password\" => $password\n ];\n $whereArray = [\n [\"user_id\", '=', $this->request->input(\"user_id\")]\n ];\n $this->usersModel->setTableName(\"cvd_users\");\n $this->usersModel->setInsertUpdateData($updateArray);\n $this->usersModel->setWhere($whereArray);\n $this->usersModel->updateData();\n }",
"public function beforeSave() {\n if(($this->getScenario() === 'register') || ($this->getScenario() === 'changePassword')) \n $this->password = md5($this->password);\n return true;\n }",
"public function store(PasswoedValidation $request)\n {\n $user_id = Auth::id();\n $from_db = User::find($user_id)->password;\n if (Hash::check($request->old_password, $from_db )) {\n User::find($user_id)->update([\n 'password' => Hash::make($request->new_password)\n ]);\n }\n return back()->with('status', 'Password Change Successfully!');\n }",
"private static function _password($password, $hash)\n\t{\n\t\treturn md5(md5(md5($password)));\n\t}",
"public function setPasswordAttribute( $value )\n {\n $this->attributes[ 'password' ] = Hash::make( $value );\n }",
"public function beforeSave() {\t\t\n\t\t// Password hashing is no longer automatic since CakePHP 2.0.0\n\t if (isset($this->data[$this->alias]['password'])) {\n\t $this->data[$this->alias]['password'] = AuthComponent::password($this->data[$this->alias]['password']);\n\t }\n \n unset($this->data[$this->alias]['confirm_password']);\n \n\t return true;\n\t}",
"function hash_password($cleartext_password) {\n if (config\\HASHING_ALGORITHM == \"crypt\") {\n return crypt($cleartext_password, \"$1$\" . \\melt\\string\\random_hex_str(8) . \"$\");\n } else if (config\\HASHING_ALGORITHM == \"sha1\") {\n $salt = \\melt\\string\\random_hex_str(40);\n return $salt . sha1($salt . $cleartext_password, false);\n } else if (config\\HASHING_ALGORITHM == \"md5\") {\n $salt = \\melt\\string\\random_hex_str(32);\n return $salt . \\md5($salt . $cleartext_password, false);\n } else\n trigger_error(\"The configured hashing algorithm '\" . config\\HASHING_ALGORITHM . \"' is not supported.\", \\E_USER_ERROR);\n}",
"function wp_hash_password( $password ) {\n\t\t$cost = apply_filters( 'wp_hash_password_cost', 10 );\n\n\t\treturn password_hash( $password, PASSWORD_DEFAULT, [ 'cost' => $cost ] );\n\t}",
"public function setPasswordAttribute($password) {\n if (!empty($password) AND !is_null($password)) {\n $this->attributes['password'] = Hash::make($password);\n } \n }",
"protected function changePassword() {}",
"public function setPasswordAttribute($pass)\n {\n $this->attributes['password'] = bcrypt($pass);\n }",
"public function setPasswordAttribute($old){\n $this->attributes['password'] = bcrypt($old);\n }",
"public function setPassword(){\n\t}",
"private function hashPass($password) {\n\t\t// Hash that password\n $hashed_password = password_hash(\"$password\", PASSWORD_DEFAULT);\n return $hashed_password;\n }",
"public function store(ForgetPasswordRequest $request)\n {\n $user =User::where('mobile_number' , $request->mobile_number)->first();\n // ToDo to change the new password to be rand text\n $user->update([\n 'password' => 'password'\n ]);\n // ToDo to SendEmail with new password to this user\n\n flash(trans('auth.forget password done'))->success();\n\n return back();\n }",
"function password($password)\n {\n // Generate a random 22 character salt.\n $salt_alphabet = './0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';\n $salt_alphabet_length = strlen($salt_alphabet);\n $salt = '';\n for($i = 0; $i < 22; $i++) {\n $salt .= $salt_alphabet[mt_rand(0, $salt_alphabet_length - 1)];\n }\n // BCrypt the password with salt.\n $pwhash = crypt($password, '$2a$10$' . $salt);\n\n if ($this->password != $pwhash)\n $this->update['password'] = $pwhash;\n\n $this->password = $pwhash;\n\n return true;\n }",
"public function getHashedPassword()\n {\n return $this->password;\n }",
"public function onUserPostHashPassword(ViewEvent $event): void\n {\n $result = $event->getControllerResult();\n $method = $event->getRequest()->getMethod();\n\n if ($result instanceof User === false || $method !== 'POST') {\n return;\n }\n\n $user = $result;\n\n $user->setPassword(\n $this->passwordEncoder->encodePassword($result, $user->getPassword())\n );\n }",
"function hashPasswords($data, $enforce=false) {\n\t\tif($enforce && isset($this->data[$this->alias]['password'])) {\n\t\t\tif(!empty($this->data[$this->alias]['password'])) {\n\t\t\t\t$this->data[$this->alias]['password'] = Security::hash($this->data[$this->alias]['password'], null, true);\n\t\t\t}\n\t\t}\n\t\treturn $data;\n }",
"public function cambia_password(Request $request)\n {\n $input = $request->all();\n $user = User::where('email', '=', $request->email)->first();\n if ($user != null) {\n if (Hash::check('UserPass', $user->password)) {\n $validator = Validator::make($input, [\n 'email' => 'required',\n 'password' => 'required',\n 'password_di_controllo' => 'required|same:password',\n ]);\n if ($validator->fails()) {\n return redirect('change')\n ->withErrors($validator)\n ->withInput();\n }\n\n $user->update(['password' => bcrypt($request->password)]);\n return redirect('login');\n }else{ \n return back()->withErrors([\"Hai già cambiato la password. Utilizza Ho dimenticato la password\"])->withInput();\n }\n\n \n } else {\n return back()->withErrors([\"L'indirizzo email inserito è errato\"])->withInput();\n }\n }",
"public function setPasswordAttribute($password)\n\t{\n\t\t$this->attributes['password'] = \\Hash::make($password);\n\t}",
"public static function setNewPassword($password = NULL)\r\n {\r\n return Yii::$app->security->generatePasswordHash($password);\r\n }",
"function password_update($password) {\n\t\t$hash = hash_password($password);\n\t\tlgi_mysql_query(\"UPDATE %t(users) SET `passwd_hash`='%%' WHERE `name`='%%'\",$hash, $this->userid);\n\t}",
"public function SetPasswordHash ($passwordHash);",
"function regiomino_user_change_password($account, $password) {\r\n\t//watchdog('pwdaction', '@password', array('@password' => $password));\r\n $edit['pass'] = $password;\r\n user_save($account, $edit);\r\n}",
"public function setPassword($password)\n {\n $this->pwd_hash = Yii::$app->security->generatePasswordHash($password);\n }",
"public function setPasswordAttribute($value) {\n if (\\Hash::needsRehash($value))\n $this->attributes['password'] = bcrypt($value);\n else\n $this->attributes['password'] = $value;\n }",
"public function setNewPassword($password) {\n $this->password_hash = Yii::$app->security->generatePasswordHash($password);\n }",
"public function getHashedPassword(){\n\n // query the database to get the users password\n // database instance\n $db = database::getPDOobject();\n\n // query\n $checkUser = $db->prepare('SELECT `password` FROM `users` WHERE BINARY `user_name` = BINARY :userName LIMIT 1');\n $checkUser->bindParam(':userName',$this->username);\n $checkUser->execute();\n $encyptedPassword = $checkUser->fetch()['password'];\n\n return $encyptedPassword;\n}",
"function hashPassword($password){\r\n\r\n\t$hash =password_hash($password,PASSWORD_DEFAULT);\r\n\treturn $hash;\r\n}",
"public function hash_user_pass($password) {\n\n $salt = sha1(rand());\n $salt = substr($salt, 0, 10);\n\n//PASSWORD_DEFAULT is a default function in PHP it contains BCRYPT algo at backend PHP is using BCRYPT currently\n//as it is most secure password hashing algorithm using today the term DEFAULT means that if another hashing algorithm is introduced in\n//future it will automatically updated to the library ny PHP so the developer has no need to update in the code.\n $hashing = password_hash($password.$salt, PASSWORD_DEFAULT);\n $hash = array(\"salt\" => $salt, \"hashing\" => $hashing);\n\n return $hash;\n\n}",
"protected function configureSaltedPasswords() {}",
"private function newHash()\n {\n $salt = hash('sha256', uniqid(mt_rand(), true) . 't33nh4sh' . strtolower($this->email));\n\n // Prefix the password with the salt\n $hash = $salt . $this->password;\n \n // Hash the salted password a bunch of times\n for ( $i = 0; $i < 100000; $i ++ ) {\n $hash = hash('sha256', $hash);\n }\n \n // Prefix the hash with the salt so we can find it back later\n $hash = $salt . $hash;\n \n return $hash;\n }",
"public function createHash($password){\r\n $options = [\r\n 'cost' => 10,\r\n ];\r\n $hash = password_hash($password, PASSWORD_DEFAULT, $options);\r\n return $hash;\r\n}",
"public function password()\n {\n }",
"public function setPassword($password)\r\n {\r\n $this->password_hash = Yii::$app->getSecurity()->generatePasswordHash($password);\r\n }",
"public function setPassword($password)\r\n {\r\n $this->password_hash = Yii::$app->security->generatePasswordHash($password);\r\n }",
"public function setPassword($password)\r\n {\r\n $this->password_hash = Yii::$app->security->generatePasswordHash($password);\r\n }",
"protected function beforeSave() {\n\t\tif (!empty($this->newPassword))\n\t\t\t$this->password = UtilHelper::encryptPwd($this->newPassword, $this->salt);\n\t\treturn true;\n\t}",
"public function setPassword($newPassword);",
"function hashPassword($data, $enforce=false) {\n if($enforce && isset($this->data[$this->alias]['password']) && isset($this->data[$this->alias]['password']) ) {\n if(!empty($this->data[$this->alias]['password']) && !empty($this->data[$this->alias]['username']) ) {\n $stringToHash = $this->data[$this->alias]['username'].$this->data[$this->alias]['password'];\n $hasher = new SimplePasswordHasher(array('hashType' =>'sha1'));\n $this->data[$this->alias]['password'] = $hasher->hash($stringToHash);\n }\n }\n\n return $data;\n }",
"public function setPasswordAttribute($value)\n {\n $this->attributes['password'] = Hash::needsRehash($value) ? Hash::make($value) : $value;\n }"
] | [
"0.815711",
"0.78428984",
"0.76629037",
"0.70761925",
"0.7037126",
"0.7037126",
"0.6928852",
"0.6924011",
"0.6903809",
"0.6897981",
"0.6873381",
"0.6835683",
"0.683096",
"0.6813082",
"0.6789955",
"0.67718154",
"0.67669815",
"0.675719",
"0.67551816",
"0.67551816",
"0.6741653",
"0.6705122",
"0.66919124",
"0.66919124",
"0.66537726",
"0.6651544",
"0.6644236",
"0.664169",
"0.6628964",
"0.6625985",
"0.66179293",
"0.66027784",
"0.66000104",
"0.6582923",
"0.65750486",
"0.6573171",
"0.65727895",
"0.6540961",
"0.65343523",
"0.648288",
"0.648288",
"0.64816976",
"0.64705855",
"0.64479446",
"0.6444643",
"0.64309955",
"0.6421398",
"0.6418342",
"0.6418342",
"0.6418342",
"0.6408793",
"0.6402828",
"0.63946706",
"0.6392145",
"0.63659316",
"0.6359088",
"0.6357851",
"0.6344733",
"0.63338155",
"0.6324875",
"0.6320726",
"0.6319205",
"0.6315967",
"0.6315671",
"0.63150746",
"0.63080573",
"0.6305999",
"0.6304033",
"0.6302541",
"0.63014704",
"0.6298919",
"0.62980396",
"0.62964714",
"0.62937653",
"0.6281033",
"0.6276484",
"0.6276308",
"0.6264831",
"0.62604004",
"0.6256897",
"0.62536556",
"0.6245647",
"0.62449276",
"0.6243962",
"0.6243687",
"0.62374264",
"0.6237087",
"0.6237087",
"0.62338585",
"0.62321407",
"0.62318474",
"0.62289554"
] | 0.66238004 | 38 |
Does the user have a particular role? | public function hasRole($name)
{
foreach ($this->roles as $role)
{
if ($role->name == $name) return true;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function hasRole(string $role): bool;",
"public function hasRole($user, string $role = 'login'): bool {}",
"function hasRole($role)\n{\n\treturn $this->loggedUser? $this->loggedUser->hasRole($role) : false;\n}",
"public function hasRole() {\n return $this->_has(2);\n }",
"function hasRole($role, $userId = null);",
"public function roleExists(string $role): bool;",
"public function hasRole($name);",
"public function roleInUse(string $role): bool;",
"function is_user_in_role( $user_id, $role ) {\r\n $user = new WP_User( $user_id );\r\n\treturn ( ! empty( $user->roles ) && is_array( $user->roles ) && in_array( $role, $user->roles ) );\r\n}",
"public function hasRole($role){\n return null !== $this->role()->where('name', $role)->first();\n }",
"function tsg_user_has_role( $role = '', $user = null )\n{\n $user = $user ? new WP_User( $user ) : wp_get_current_user();\n\n if ( empty( $user->roles ) )\n return;\n\n if ( in_array( $role, $user->roles ) )\n return true;\n\n return;\n}",
"public function is_role($role)\n {\n }",
"public function hasRole($role){\n if($this->roles()->where('name', $role)->first()){\n return true;\n }\n return false;\n }",
"public function is($role);",
"public function isRole(){\n $r=Cache::get('role');\n if ((int)$r ==2)\n {\n return true;\n }\n else\n return false;\n }",
"function pilau_user_has_role( $user, $role ) {\n\t\treturn in_array( $role, pilau_get_user_role( $user, false, true ) );\n\t}",
"function is($role_name){\n $this->CI->load->model('role');\n $role = $this->CI->role->getRoleOnUserByName($this->username(), $role_name);\n if(!empty($role)) return $role;\n else return false;\n }",
"public function hasRole(): bool\n {\n return isset($this->role);\n }",
"public function isHasRole($userId, $role) {\n\t}",
"public function hasRole($role)\n {\n return $this->isGranted($role); \n }",
"function has_role($user, $role_name) {\n\n\tswitch ($role_name) {\n\t\tcase 'editor' :\n\t\t\tif (is_callable('hj_approve_is_editor')) {\n\t\t\t\treturn call_user_func('hj_approve_is_editor', $user);\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase 'supervisor' :\n\t\t\tif (is_callable('hj_approve_is_supervisor')) {\n\t\t\t\treturn call_user_func('hj_approve_is_supervisor', $user);\n\t\t\t}\n\t\t\tbreak;\n\t\tcase 'observer' :\n\t\t\tif (is_callable('hj_observer_is_observer')) {\n\t\t\t\treturn call_user_func('hj_observer_is_observer', $user);\n\t\t\t}\n\t\t\tbreak;\n\t}\n\n\tif (is_callable('roles_has_role')) {\n\t\treturn call_user_func('roles_has_role', $user, $role_name);\n\t}\n\n\treturn false;\n}",
"function user_role_need ($role) {\r\n\t$info = user_info();\r\n\treturn ($info[3] == $role ? true : false);\r\n}",
"private function isUser($role = 'user') : bool\n {\n return $this->user->hasRole('user');\n }",
"function check_role( $role_in ) {\n global $_SESSION;\n\n // read the permissions database\n $d = loadDB();\n\n // check if the current user\n $user_name = $_SESSION[\"logged\"];\n // has a specified role\n $roles = array(); // collect all roles for this user\n foreach ( $d[\"users\"] as $key => $value ) {\n if ($value[\"name\"] == $user_name) {\n $roles = array_merge($roles, $value[\"roles\"]);\n }\n }\n \n foreach ( $roles as $role ) {\n if ($role == $role_in) {\n audit( \"check_role\", $role_in.\" as \".$user_name);\n return true;\n }\n }\n audit( \"check_role failed\", $role_in.\" as \".$user_name);\n return false;\n }",
"public function userHasRole($role_name){\n foreach($this->roles as $role){\n if(Str::lower($role_name) == Str::lower($role->name))\n return true;\n }\n\n return false;\n }",
"public function HasRole ($roleName = NULL, $idRole = NULL);",
"function checkRole($role) {\n\n return in_array($role, $this->listRoleCurUser);\n }",
"abstract public function hasRole($roleName);",
"function user_is_role($role, $user_id = null) {\n\tif ($user_id == null)\n\t\t// defaults to the current user\n\t\t$user_id = $_SESSION['user_id'];\n\n\treturn get_user_role_weight($user_id) === get_role_weight($role);\n}",
"function user_is_role($role, $user_id = null) {\n\tif ($user_id == null)\n\t\t// defaults to the current user\n\t\t$user_id = $_SESSION['user_id'];\n\n\treturn get_user_role_weight($user_id) === get_role_weight($role);\n}",
"function auth_role($role)\n {\n if (auth_isAnonymous()) {\n return false;\n }\n\n $auth = auth_prerequisite();\n $field = $auth['fields']['role'];\n $session = auth_get();\n\n return $session->$field == $role;\n }",
"public function hasRole(): bool\n {\n return $this->has(AttributeType::OID_ROLE);\n }",
"function hasRole($user, $role){\n\n if(ucfirst($user->role) == 'Root'){\n return true;\n }\n else {\n if($user->role == ucwords($role)){\n return true;\n }\n else {\n return false;\n }\n }\n }",
"public function isRole(): bool\n {\n return $this->getType() === static::TYPE_ROLE;\n }",
"public function HasRole($role)\n {\n if ($this->isConnected()) {\n $reflector = new Reflector($this->user);\n if (!method_exists($this->user,'getRoles')) {\n throw new MazeoException(\"Class {$reflector->getName()} must have an \\\"getRoles\\\" method for perform role access check\");\n }\n return in_array($role, $this->user->getRoles()) ? true : false;\n } else return false;\n }",
"function auth_roles()\n {\n if (auth_isAnonymous()) {\n return false;\n }\n\n $auth = auth_prerequisite();\n $field = $auth['fields']['role'];\n $session = auth_get();\n $roles = func_get_args();\n\n return in_array($session->$field, $roles);\n }",
"public function hasRole($role)\n {\n return $this->role == $role;\n }",
"public function hasRoleAccess()\n {\n $roles = $this->map[$this->uri]['roles'];\n\n if ($roles === self::ROLE_PUBLIC) {\n\n return true;\n }\n\n $this->isArray($roles);\n\n $this->collectMissingRoles($roles);\n\n return count(array_intersect($this->currentUserRoles, $roles)) > 0;\n }",
"function role_exists($role)\n{\n\n if (!empty($role))\n {\n return $GLOBALS['wp_roles']->is_role($role);\n }\n\n return false;\n}",
"public function userIs( $role ) {\n\n\t\treturn $this->loggedIn( )\n\t\t\t? in_array( $this->user( $this->roleField ), ( array )$role )\n\t\t\t: false;\n\t}",
"function isAdmin(){\n $user = $this->loadUser(Yii::app()->user->id);\n return intval($user->role) == 1;\n }",
"function isAdmin(){\n $user = $this->loadUser(Yii::app()->user->id);\n return intval($user->role) == 1;\n }",
"function checkSingleRole($roleToCheck) {\n //Ensure user is logged in\n if(Auth::guest()) {\n return false;\n }\n $roleToCheck = strtolower($roleToCheck);\n //Ensure that the user is an admin or an owner\n $roles = Auth::user()->roles;\n //Loop through roles and check for permission\n foreach($roles as $role) {\n if($role->name == $roleToCheck) {\n return true;\n }\n }\n //User is not an admin\n return false;\n}",
"function userRoleCheck($user_data) {\n if(!empty($user_data['email'])){\n $user_email = $user_data['email'];\n $userTable = TableRegistry::get('Users');\n $query = $userTable->find('all')->where(['email' => $user_email]);\n if(!empty($query->first()->role_id) and ($query->first()->role_id == 2 or $query->first()->role_id == 1) ){ // Doctor = 2 and Admin = 1\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }",
"public function hasRole($role)\n {\n $user = $this->view->user();\n if ($user && in_array($role, $user->roles)) {\n return TRUE;\n }\n return FALSE;\n }",
"function check_user_role($roles, $user_id = null) {\n\tif ($user_id) $user = get_userdata($user_id);\n\telse $user = wp_get_current_user();\n\tif (empty($user)) return false;\n\tforeach ($user->roles as $role) {\n\t\tif (in_array($role, $roles)) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}",
"public function has_role($role)\n\t{\n\t\t// Check what sort of argument we have been passed\n\t\tif ($role instanceof Sprig)\n\t\t{\n\t\t\t$key = 'id';\n\t\t\t$val = $role->id;\n\t\t}\n\t\telseif (is_string($role))\n\t\t{\n\t\t\t$key = 'name';\n\t\t\t$val = $role;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$key = 'id';\n\t\t\t$val = (int) $role;\n\t\t}\n\n\t\t$values = $this->refresh('roles')->as_array(NULL,$key);\n\t\treturn (in_array($val, $values));\n\t}",
"public function checkRoleAndRedirect()\n {\n $roles = Auth::user()->getRoles();\n if (in_array('admin', $roles->toArray()) || in_array('shop-manager', $roles->toArray())) {\n return true;\n }\n return false;\n }",
"public function hasRole($role)\n {\n return in_array($role, $this->getRoles());\n }",
"public function hasRole($role)\n {\n return null !== $this->roles()->where('name', $role)->first();\n }",
"public function has_role($params) {\n global $DB;\n\n if($params['role'] == 'teacher') {\n $roles = $this->get_teacher_roles();\n } elseif($params['role'] == 'student') {\n $roles = $this->get_student_roles();\n }\n\n $rolefilter = new in_filter($roles, \"role\");\n\n return $DB->record_exists_sql(\n \"SELECT ra.*\n FROM {role_assignments} ra\n WHERE ra.userid = :userid AND\n ra.roleid \". $rolefilter->get_sql(),\n array_merge(['userid' => $params['userid']], $rolefilter->get_params())\n );\n\n }",
"public function hasRole($role) {\n return in_array((string)$role, $this->roles);\n }",
"function checkRole($role)\n{\n return (Auth::check())?Auth::user()->checkRole($role):false;\n}",
"public function hasRole($role)\n {\n return $this->hakAksesPengguna()\n ->where('nama', strtolower($role))\n ->where('status_request', RequestStatus::APPROVED)->count() > 0;\n }",
"public function hasRole($role)\n {\n return $this->session->hasRole($role);\n }",
"function isRole($role)\n{\n return ($role == $_SESSION['role']);\n}",
"function frame_user_role($role, $user_id = null)\n{\n if (is_numeric($user_id))\n $user = get_userdata($user_id);\n else\n $user = wp_get_current_user();\n\n if (empty($user))\n return false;\n\n $intersection = array_intersect((array) $role, (array) $user->roles);\n\n return !empty($intersection) ? true : false;\n}",
"private function role_exists( $role ) {\n global $wp_roles;\n\n return $wp_roles->is_role( $role );\n }",
"public function isGranted($role)\n {\n return in_array($role, $this->getRoles());\n }",
"public function has_role($role_name)\n {\n $role = role_active_record::search()\n ->where('name', $role_name)\n ->execOne();\n $user_role = user_role_active_record::search()\n ->where('uid', $this->uid)\n ->where('rid', $role->rid)\n ->execOne();\n if ($user_role instanceof user_role_active_record) {\n return true;\n } else {\n return false;\n }\n }",
"public function authorize()\n {\n $user = User::findOrFail($this->route('id'));\n\n return $user->hasRole('admin') || $user->hasRole('teacher');\n }",
"function isAdmin() {\n $user = $this->loadUser(Yii::app()->user->id);\n return intval($user->role) == 1;\n }",
"public function hasRole(string $role, FilterInterface $filter = null):bool;",
"private function isOnlyRole($role = 'user') : bool\n {\n return $this->maxRole() === $role;\n }",
"public function hasRole($roles)\n {\n return $this->roles ? in_array($roles, $this->roles->pluck('id')->toArray()) : false;\n }",
"protected function hasRole($role)\n {\n $right = session()->get(\"role\");\n $result = in_array($right, (array)$role);\n return $result;\n }",
"public function valid_input_role() {\n $role = $this->ci->input->post(\"role\");\n\n if ($role == USER_CATI || $role == USER_CID || $role == USER_FINANCE ||\n $role == USER_MP || $role == USER_DIV_MARKETEERS || $role == USER_DIV_CONSULTING ||\n $role == USER_DIV_INSTITUTE || $role == USER_DIV_INSIGHT\n ) {\n return TRUE;\n } else {\n return FALSE;\n }\n }",
"function checkRole($RoleName){\n\t\tif( in_array($RoleName,$this->user_roles) == true ){\n\t\t\treturn 1;\n\t\t}else{\n\t\t\treturn 0;\n\t\t}\n\t}",
"public function hasRole($name, $requireAll = false);",
"public function authorize()\n {\n return request()->loggedin_role === 1;\n }",
"public function authorize() {\n\t\treturn $this->user()->hasPermission('edit.roles');\n\t}",
"function userHasRole($id_utente, $id_ruolo) {\n if ($this->connectToMySql()) {\n $query = sprintf(\"SELECT id_ruoli_granted, id_utente, id_ruolo, ruolo FROM scuola.ruoli_granted_to_utenti\n WHERE id_utente= '%s' and id_ruolo = '%s'\", mysql_real_escape_string($id_utente, $GLOBALS['link']), mysql_real_escape_string($id_ruolo, $GLOBALS['link']));\n\n // Perform Query\n $result = mysql_query($query);\n //$array = mysql_fetch_assoc($result);\n }\n $this->closeConnection();\n return mysql_num_rows($result) == 1;\n }",
"private function isRole($userId, $role) {\n $assignments = self::getAssignments(($userId));\n foreach($assignments as $assignment){\n if($assignment->roleName === Yii::$app->params[$role])\n return true;\n }\n return false;\n }",
"public function isSetRole()\n {\n return count ($this->_fields['Role']['FieldValue']) > 0;\n }",
"public function has_role($id){\n $encontrado=false;\n foreach ($this->roles as $role){\n if($role->id==$id || $role->slug==$id){\n $encontrado=true;\n }\n\n }\n return $encontrado;\n }",
"public function logged_in($role = null)\n {\n // Get the user from the session\n $user = $this->get_user();\n if (!$user) {\n return false;\n }\n\n // If user exists in session\n if ($user) {\n\n // check session in database\n $sdb = UserSessions::findFirstBySessionId($this->_session->getId());\n if($sdb){\n $thisAgent = \\Phalcon\\DI::getDefault()->getShared('request')->getUserAgent();\n if($sdb->user_agent != $thisAgent || $sdb->user_id != $user->id){\n // user agent or user IDs do not match\n return FALSE;\n }\n }else{\n // Session not found in DB\n return FALSE;\n }\n\n // refresh the user session if needs be\n if( ! $this->refresh_session()){\n return FALSE;\n }\n\n // If we don't have a roll no further checking is needed\n if (!$role) {\n return true;\n }\n\n // Check if user has the role\n if ($this->_config['session_roles'] && $this->_session->has($this->_config['session_roles'])) {\n // Check in session\n $roles = $this->_session->get($this->_config['session_roles']);\n $role = isset($roles[$role]) ? $roles[$role] : null;\n } else {\n // Check in db\n $role = $user->hasRole($role);\n }\n\n\n\n // Return true if user has role\n return $role ? true : false;\n }\n }",
"public function hasRole($roles) {\n return RoleHelper::userHasRole($this, $roles);\n }",
"public function canView(IdentityInterface $user, Role $role)\n {\n return $user->role_id == 1; // 'super_admin'\n }",
"public function hasRole(Role $role)\n {\n return $this->role == $role;\n }",
"public function isGranted($role) {\n $granted = false;\n $user = $this->getUser();\n\n if ($user) {\n $granted = in_array($role, $user->getRoles());\n }\n\n return $granted;\n }",
"public function hasRole($role)\n {\n return in_array(strtoupper($role), $this->getRoles(), true);\n }",
"public function hasRole($role)\n {\n return in_array(strtoupper($role), $this->getRoles(), true);\n }",
"public function hasRole($role)\n {\n return in_array(strtoupper($role), $this->getRoles(), true);\n }",
"public function has_role($role)\n\t{\n\t\t// Don't mess with these calls, they are too complex\n\t\tif (is_object($role))\n\t\t\treturn parent::has_role($role);\n\n\t\t// Make sure the role name is a string\n\t\t$role = (string) $role;\n\n\t\tif (ctype_digit($role))\n\t\t{\n\t\t\t// Find by id\n\t\t\treturn isset($this->roles[$role]);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Find by name\n\t\t\treturn in_array($role, $this->roles);\n\t\t}\n\t}",
"public function authorize()\n {\n $user = Auth::user();\n return $user && $user->rol == 'admin';\n }",
"function checkUserRole($userId, $roleToCheck) {\n //Ensure user is logged in\n\n $user = User::find($userId);\n if (is_null($user)) {\n return false; //User dose not exist\n }\n $roleToCheck = strtolower($roleToCheck);\n //Ensure that the user is an admin or an owner\n $roles = $user->roles;\n //Loop through roles and check for permission\n foreach($roles as $role) {\n if($role->name == $roleToCheck) {\n return true;\n }\n }\n //User is not an admin\n return false;\n}",
"public function authorize()\n {\n return Auth::user()->hasRole('employee');\n }",
"public function hasRole($role)\n {\n return $this->cached_roles->where('slug', $role)->count() > 0;\n }",
"public function hasRole(string $role): bool\n {\n return getApp()->security()->hasRole($role);\n }",
"public function authorize()\n {\n return auth()->user()->can('role@create') || auth()->user()->can('role@edit');\n }",
"public static function usersRoleIs( $role = false, $current_user = false )\n\t\t{\n\n\t\t\t// Simple sanitization\n\t\t\t$role = sanitize_text_field( $role );\n\n\t\t\t// Must be passed a role\n\t\t\tif( !$role ){\n\t\t\t\treturn new WP_Error( '1', 'usersRoleIs() was not passed a role' );\n\t\t\t}\n\n\t\t\t// Ensure they're logged in, otherwise we can't tell\n\t\t\tif( !is_user_logged_in() ){\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t// OK, we can check this user, use WP's globalized $curent_user\n\t\t\tif( !$current_user )\n\t\t\t{\n\n\t\t\t\tglobal $current_user; \n\t\t\t\tget_currentuserinfo();\n\t\t\t\t\n\t\t\t}\n\n\t\t\tif( $current_user && isset( $current_user->caps ) && is_array( $current_user->caps ) && isset( $current_user->caps[ $role ] ) && $current_user->caps[ $role ] == 1 ){\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t}",
"public static function is_role($user, $role_name)\n\t{\n\t\t$menu = Menu::factory('Team', $user);\n\t\treturn $menu->is_allowed($user->username, $role_name);\n\t}",
"protected function _getRole(){\n\t$user = new Pas_User_Details();\n $person = $user->getPerson();\n if($person){\n \treturn $person->role;\n } else {\n \treturn false;\n }\n }",
"public function isMember()\n {\n return $this->role == 3;\n }",
"public function authorize()\n {\n $user = Sentinel::getUser();\n $admin = Sentinel::findRoleByName('Admin');\n if ( $user->inRole( $admin ) ) { //lets make sure its an admin\n return true;\n }\n return false;\n }",
"public function es_admin(){\n\t\t$user = $this->getUser();\n\t\tif ($user != null) {\n\t\t\t$roles = $user->getRoles();\n\t\t\treturn in_array('ROLE_ADMIN', $roles);\n\t\t}\n\t\treturn false;\n\t}",
"function user_is_at_least_role($role, $user_id = null) {\n\tif ($user_id == null)\n\t\t// defaults to the current user\n\t\t$user_id = $_SESSION['user_id'];\n\n\treturn get_user_role_weight($user_id) >= get_role_weight($role);\n}",
"function user_is_at_least_role($role, $user_id = null) {\n\tif ($user_id == null)\n\t\t// defaults to the current user\n\t\t$user_id = $_SESSION['user_id'];\n\n\treturn get_user_role_weight($user_id) >= get_role_weight($role);\n}",
"public function isInRole( $rolename ) {\n\t}",
"public function hasRoles()\n {\n return ! empty($this->roles);\n }",
"public function authorize()\n {\n $user = Auth::user();\n\n return ($user->getRole() == 'admin');\n }"
] | [
"0.846877",
"0.82410717",
"0.8213779",
"0.81345016",
"0.80232525",
"0.8012697",
"0.8003828",
"0.7960044",
"0.7944947",
"0.7892998",
"0.78712577",
"0.7857028",
"0.7839148",
"0.78221345",
"0.781494",
"0.7811899",
"0.78098303",
"0.78036857",
"0.779677",
"0.77737105",
"0.7758718",
"0.7737184",
"0.7709273",
"0.7705993",
"0.7675279",
"0.7662454",
"0.7657684",
"0.76559085",
"0.7652937",
"0.7652937",
"0.7645763",
"0.76426685",
"0.7594375",
"0.7587778",
"0.75702024",
"0.75687766",
"0.7552051",
"0.75395316",
"0.75218683",
"0.7496139",
"0.74768037",
"0.74768037",
"0.74729127",
"0.7471378",
"0.74700403",
"0.7445389",
"0.7427718",
"0.7424633",
"0.74196",
"0.74182534",
"0.74148667",
"0.7411947",
"0.73630154",
"0.735933",
"0.73561865",
"0.73280156",
"0.73263466",
"0.7321522",
"0.73168904",
"0.7288896",
"0.7288592",
"0.72859526",
"0.7280362",
"0.7258872",
"0.72573674",
"0.72495437",
"0.72318965",
"0.7231823",
"0.72239745",
"0.7223171",
"0.7220185",
"0.72125196",
"0.7210162",
"0.720948",
"0.7198725",
"0.71893585",
"0.7183826",
"0.71790344",
"0.7164558",
"0.7164243",
"0.7155578",
"0.7155578",
"0.7155578",
"0.7155449",
"0.7154365",
"0.7151875",
"0.71464306",
"0.71455294",
"0.71361613",
"0.71341693",
"0.71321416",
"0.71180034",
"0.71072817",
"0.7091707",
"0.7086024",
"0.7083602",
"0.7080931",
"0.7080931",
"0.70805717",
"0.70784867",
"0.7074543"
] | 0.0 | -1 |
Assign a role to the user | public function assignRole($role)
{
return $this->roles()->attach($role);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function assignRole ($name);",
"public function addRole($username, $role);",
"public function attachRole($role);",
"public function attachRole($role);",
"public function setUserRole(User $user, Role $role);",
"public function setRole($role);",
"function SetUserRole ($userRoleId = null, $data = array()) {\n $answer = $this->answer;\n\n if ($userRoleId) {\n // update user role\n $this->db\n ->where('role_id', $userRoleId)\n ->update('user_role', $data);\n // here must be notification email function\n }\n else {\n // create user role\n $this->db->insert('user_role', $data);\n $userRoleId = $this->db->insert_id();\n\n // here must be notification email function, new id is for it\n }\n\n $answer['success'] = true;\n $answer['result'] = $userRoleId;\n return $answer;\n }",
"public function assignUser(Request $request, Role $role)\n {\n if(Auth::user()->can('assign-role-to-user')){\n if($request->ids){\n $ids = $request->ids;\n foreach ($ids as $id) {\n $user = User::find($id);\n $user->assignRole($role->name);\n ActivityLogger::activity(\"Le collaborateur ID:\".$user->id.'('.$user->name.') a désormais le role id:'.$role->id.'('.$role->name.') donné par l\\'utilisateur ID:'.Auth::id());\n }\n $message = sizeof($ids).' collaborateur(s) assigné(s) au role '.$role->name.' avec succès';\n }\n else{\n $message = \"Aucune action n'a été effectuée.\";\n }\n // Envoyer un mail à la personne qui a recu le role avec la liste des permissions possibles\n return redirect()->route(\"roles.show\", compact('role'))->with('success',$message);\n }else{\n return back()->with('error',\"Vous n'avez pas ce droit\");\n } \n }",
"public function add_role($role)\n {\n }",
"function set_user_role($role, $user_id = null) {\n\tglobal $db;\n\tif ($user_id == null)\n\t\t// defaults to the current user\n\t\t$user_id = $_SESSION['user_id'];\n\n\t$prepared = $db->prepare(\"\n UPDATE users\n\t\t\tSet role_id = (SELECT role_id FROM roles WHERE name = ?)\n\t\t\tWhere user_id = ?\n \");\n\n\t$prepared->bind_param('si', $role, $user_id);\n\n\tif (!$prepared->execute()) {\n\t\t$message['error'][] = ERROR;\n\t\treturn false;\n\t}\n\n\treturn true;\n}",
"public function setRole($userId, $roleId);",
"public function setAuthenticatedRole($role);",
"public function assignRole($role)\n {\n $roles = is_array($role) ? $role : [$role];\n $roles = array_map(function($role) {\n return is_string($role) ? Role::find($role) : $role;\n }, $roles);\n $this->set('roles', $roles);\n $result = TableFactory::getUserModel()\n ->save($this) !== false;\n RolesTableTrait::refreshCache($this->id);\n\n return $result;\n }",
"function assign_user_role($userId, $roleId) {\n\t\tglobal $database;\n\t\t$assignrolequery = \"INSERT INTO user_in_rules (user_id, role_id) VALUES (:userId, :roleId)\";\n\n\t\t$stmt = $database->prepare($assignrolequery);\n\n\t\t$stmt->bindParam(':userId', $userId);\n\t\t$stmt->bindParam(':roleId', $roleId);\n\n\t\t$stmt->execute();\n\t}",
"function roleCreate(Role $role);",
"public function assignRole($role)\n {\n return $this->role()->save(\n Role::whereName($role)->firstOrFail()\n );\n }",
"public function assign($role, $permission);",
"public function assignRole($role)\n {\n return $this->roles()->save(\n Role::whereName($role)->firstOrFail()\n );\n }",
"public function assignRole($role)\n {\n return $this->roles()->save(\n Role::whereName($role)->firstOrFail()\n );\n }",
"public function actionCreateRole($role_name, $user_id_or_name){\n $user_id = $this->getUserId($user_id_or_name);\n\n $auth = Yii::$app->authManager;\n $role = $auth->createRole($role_name . '-user-id-' . $user_id);\n $auth->add($role);\n }",
"public function assignRole($role)\n {\n if (!Yii::$app->authManager->checkAccess($this->id, $role)) {\n $authRole = Yii::$app->authManager->getRole($role);\n Yii::$app->authManager->assign($authRole, $this->id);\n\n return true;\n }\n\n return false;\n }",
"public function set_role($role)\n {\n }",
"public function assignRole($role)\n {\n return $this->roles()->sync([$role]);\n }",
"public function actionRole()\n {\n foreach (USER::getRoleOptions() as $key => $val) {\n\n self::log(\"\\n\" . $val . ' Role-id is ' . $key . \"\\n\");\n }\n\n if (is_null($this->email)) {\n\n self::log('Email required ! (Hint -e=)');\n\n return ExitCode::DATAERR;\n }\n\n $model = User::findOne([\n 'email' => $this->email\n ]);\n\n if (is_null($model)) {\n\n self::log('User not found');\n\n return ExitCode::NOUSER;\n }\n\n if (is_null($this->role_id)) {\n\n self::log('Current Role Id is ' . $model->role_id . \"\\n\");\n self::log('Add correct Role id (Hint -r=)');\n\n return ExitCode::DATAERR;\n }\n\n if (is_null(ArrayHelper::getValue(USER::getRoleOptions(), $this->role_id))) {\n\n self::log('Please enter correct role id :');\n\n return ExitCode::DATAERR;\n }\n\n $model->role_id = $this->role_id;\n\n if (! $model->save()) {\n\n self::log('Please enter valid Role Id ');\n\n return ExitCode::DATAERR;\n }\n\n self::log($this->email . ' = Role Id successfully Updated !');\n\n return ExitCode::OK;\n }",
"function set_role( $user_id, $new_role = '' ) {\r\n\t\t\t// Validate user id\r\n\t\t\t$user = get_userdata( $user_id );\r\n\r\n\t\t\t// User exists\r\n\t\t\tif ( ! empty( $user ) ) {\r\n\t\t\t\t// Get users old UM role\r\n\t\t\t\t$role = UM()->roles()->get_um_user_role( $user_id );\r\n\r\n\t\t\t\t// User already has this role so no new role is set\r\n\t\t\t\tif ( $new_role === $role || ( ! $this->is_role_custom( $new_role ) && user_can( $user, $new_role ) ) ) {\r\n\t\t\t\t\t$new_role = false;\r\n\t\t\t\t} else {\r\n\t\t\t\t\t// Users role is different than the new role\r\n\r\n\t\t\t\t\t// Remove the old UM role\r\n\t\t\t\t\tif ( ! empty( $role ) && $this->is_role_custom( $role ) ) {\r\n\t\t\t\t\t\t$user->remove_role( $role );\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t// Add the new role\r\n\t\t\t\t\tif ( ! empty( $new_role ) ) {\r\n\t\t\t\t\t\t$user->add_role( $new_role );\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t/**\r\n\t\t\t\t\t * UM hook\r\n\t\t\t\t\t *\r\n\t\t\t\t\t * @type action\r\n\t\t\t\t\t * @title um_when_role_is_set\r\n\t\t\t\t\t * @description Action before user role changed\r\n\t\t\t\t\t * @input_vars\r\n\t\t\t\t\t * [{\"var\":\"$user_id\",\"type\":\"int\",\"desc\":\"User ID\"}]\r\n\t\t\t\t\t * @change_log\r\n\t\t\t\t\t * [\"Since: 2.0\"]\r\n\t\t\t\t\t * @usage add_action( 'um_when_role_is_set', 'function_name', 10, 1 );\r\n\t\t\t\t\t * @example\r\n\t\t\t\t\t * <?php\r\n\t\t\t\t\t * add_action( 'um_when_role_is_set', 'my_when_role_is_set', 10, 1 );\r\n\t\t\t\t\t * function my_when_role_is_set( $user_id ) {\r\n\t\t\t\t\t * // your code here\r\n\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\tdo_action( 'um_when_role_is_set', $user_id );\r\n\t\t\t\t\t/**\r\n\t\t\t\t\t * UM hook\r\n\t\t\t\t\t *\r\n\t\t\t\t\t * @type action\r\n\t\t\t\t\t * @title um_before_user_role_is_changed\r\n\t\t\t\t\t * @description Action before user role changed\r\n\t\t\t\t\t * @change_log\r\n\t\t\t\t\t * [\"Since: 2.0\"]\r\n\t\t\t\t\t * @usage add_action( 'um_before_user_role_is_changed', 'function_name', 10 );\r\n\t\t\t\t\t * @example\r\n\t\t\t\t\t * <?php\r\n\t\t\t\t\t * add_action( 'um_before_user_role_is_changed', 'my_before_user_role_is_changed', 10 );\r\n\t\t\t\t\t * function my_before_user_role_is_changed() {\r\n\t\t\t\t\t * // your code here\r\n\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\tdo_action( 'um_before_user_role_is_changed' );\r\n\r\n\t\t\t\t\tUM()->user()->profile['role'] = $new_role;\r\n\r\n\t\t\t\t\t/**\r\n\t\t\t\t\t * UM hook\r\n\t\t\t\t\t *\r\n\t\t\t\t\t * @type action\r\n\t\t\t\t\t * @title um_member_role_upgrade\r\n\t\t\t\t\t * @description Action on user role changed\r\n\t\t\t\t\t * @input_vars\r\n\t\t\t\t\t * [{\"var\":\"$user_id\",\"type\":\"int\",\"desc\":\"User ID\"},\r\n\t\t\t\t\t * {\"var\":\"$role\",\"type\":\"string\",\"desc\":\"User role\"}]\r\n\t\t\t\t\t * @change_log\r\n\t\t\t\t\t * [\"Since: 2.0\"]\r\n\t\t\t\t\t * @usage add_action( 'um_member_role_upgrade', 'function_name', 10, 2 );\r\n\t\t\t\t\t * @example\r\n\t\t\t\t\t * <?php\r\n\t\t\t\t\t * add_action( 'um_member_role_upgrade', 'my_member_role_upgrade', 10, 2 );\r\n\t\t\t\t\t * function my_member_role_upgrade( $old_role, $new_role ) {\r\n\t\t\t\t\t * // your code here\r\n\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\tdo_action( 'um_member_role_upgrade', $role, UM()->user()->profile['role'] );\r\n\r\n\t\t\t\t\tUM()->user()->update_usermeta_info( 'role' );\r\n\t\t\t\t\t/**\r\n\t\t\t\t\t * UM hook\r\n\t\t\t\t\t *\r\n\t\t\t\t\t * @type action\r\n\t\t\t\t\t * @title um_after_user_role_is_changed\r\n\t\t\t\t\t * @description Action after user role changed\r\n\t\t\t\t\t * @change_log\r\n\t\t\t\t\t * [\"Since: 2.0\"]\r\n\t\t\t\t\t * @usage add_action( 'um_after_user_role_is_changed', 'function_name', 10 );\r\n\t\t\t\t\t * @example\r\n\t\t\t\t\t * <?php\r\n\t\t\t\t\t * add_action( 'um_after_user_role_is_changed', 'my_after_user_role_is_changed', 10 );\r\n\t\t\t\t\t * function my_after_user_role_is_changed() {\r\n\t\t\t\t\t * // your code here\r\n\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\tdo_action( 'um_after_user_role_is_changed' );\r\n\t\t\t\t\t/**\r\n\t\t\t\t\t * UM hook\r\n\t\t\t\t\t *\r\n\t\t\t\t\t * @type action\r\n\t\t\t\t\t * @title um_after_user_role_is_updated\r\n\t\t\t\t\t * @description Action after user role changed\r\n\t\t\t\t\t * @input_vars\r\n\t\t\t\t\t * [{\"var\":\"$user_id\",\"type\":\"int\",\"desc\":\"User ID\"},\r\n\t\t\t\t\t * {\"var\":\"$role\",\"type\":\"string\",\"desc\":\"User role\"}]\r\n\t\t\t\t\t * @change_log\r\n\t\t\t\t\t * [\"Since: 2.0\"]\r\n\t\t\t\t\t * @usage add_action( 'um_after_user_role_is_updated', 'function_name', 10, 2 );\r\n\t\t\t\t\t * @example\r\n\t\t\t\t\t * <?php\r\n\t\t\t\t\t * add_action( 'um_after_user_role_is_updated', 'my_after_user_role_is_updated', 10, 2 );\r\n\t\t\t\t\t * function my_after_user_role_is_updated( $user_id, $role ) {\r\n\t\t\t\t\t * // your code here\r\n\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\tdo_action( 'um_after_user_role_is_updated', $user_id, $role );\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t// User does don exist so return false\r\n\t\t\t\t$new_role = false;\r\n\t\t\t}\r\n\r\n\t\t\t/**\r\n\t\t\t * UM hook\r\n\t\t\t *\r\n\t\t\t * @type filter\r\n\t\t\t * @title um_set_user_role\r\n\t\t\t * @description User role was changed\r\n\t\t\t * @input_vars\r\n\t\t\t * [{\"var\":\"$new_role\",\"type\":\"string\",\"desc\":\"New role\"},\r\n\t\t\t * {\"var\":\"$user_id\",\"type\":\"int\",\"desc\":\"User ID\"},\r\n\t\t\t * {\"var\":\"$user\",\"type\":\"array\",\"desc\":\"Userdata\"}]\r\n\t\t\t * @change_log\r\n\t\t\t * [\"Since: 2.0\"]\r\n\t\t\t * @usage\r\n\t\t\t * <?php add_filter( 'um_set_user_role', 'function_name', 10, 1 ); ?>\r\n\t\t\t * @example\r\n\t\t\t * <?php\r\n\t\t\t * add_filter( 'um_set_user_role', 'my_set_user_role', 10, 1 );\r\n\t\t\t * function my_set_user_role( $new_role ) {\r\n\t\t\t * // your code here\r\n\t\t\t * return $new_role;\r\n\t\t\t * }\r\n\t\t\t * ?>\r\n\t\t\t */\r\n\t\t\treturn apply_filters( 'um_set_user_role', $new_role, $user_id, $user );\r\n\t\t}",
"public function giveRole($role)\n {\n return Role::whereName($role)\n ->firstOrFail()\n ->assignRoleTo($this);\n }",
"function add_user_role_leadership(){\r\n\tif(isset($_GET['addrole']) && ($_GET['addrole'] == 'do')){\r\n\t\tadd_role( 'quote_manager', 'Quote Manager', array( 'read' => true, 'level_2' => true ) );\r\n\r\n//\t\tremove_role( 'tow_company' );\r\n\t}\r\n}",
"public function AddRole ($roleName = NULL, $idRole = NULL);",
"function setRole($value)\n\t{\n\t\t$this->setState('__role', $value);\n\t}",
"public function assignRole(\n string $username,\n string $role,\n ColumnInterface $column = null\n ):bool;",
"public function actionUserRole ()\n\t\t{\n\t\t\t$userClass = $this->module->modelUser;\n\t\t\t$post = Yii::$app->request->post();\n\t\t\t$user = $userClass::findOne($post[ 'id' ]);\n\t\t\tif (!is_null($user))\n\t\t\t{\n\n\t\t\t\tLogManager::info(Yii::tr('Пользователю {user} забрали права {roles}', [ 'user' => Html::a($user->name, Url::toRoute([ 'user/view', 'id' => $user->id ])), 'roles' => implode(',', $user->getRolesNames()) ]));\n\t\t\t\t$user->revokeAllRoles();\n\t\t\t\tif (is_array($post[ 'roles' ]))\n\t\t\t\t{\n\t\t\t\t\tforeach ($post[ 'roles' ] as $item)\n\t\t\t\t\t{\n\t\t\t\t\t\t$user->assignRole($item);\n\t\t\t\t\t}\n\t\t\t\t\tLogManager::info(Yii::tr('Пользователю {user} добавили права {roles}', [ 'user' => Html::a($user->name, Url::toRoute([ 'user/view', 'id' => $user->id ])), 'roles' => implode(',', $post[ 'roles' ]) ]));\n\t\t\t\t}\n\t\t\t}\n\t\t\tYii::$app->end();\n\t\t}",
"public function setRole() {\n\n $res= $_POST['link']->query(\"SELECT t2.perm_name FROM role_perm as t1\n JOIN permissions as t2 ON t1.perm_id = t2.perm_id\n WHERE t1.role_id = $this->rol_id\");\n\n\n foreach($res as $item)\n $this->role_perm[]= $item['perm_name'];\n }",
"function add_role($role, $display_name, $capabilities = array())\n {\n }",
"public function run()\n {\n //\n User::findOrFail(1)->assignRole('procurer');\n User::findOrFail(2)->assignRole('bidder');\n User::findOrFail(3)->assignRole('super-admin');\n }",
"public function setRole($role)\n {\n return wp_update_user([\n 'ID' => $this->ID,\n 'role' => $role,\n ]);\n }",
"public function role_assignment(Request $request, User $user)\n {\n $this->authorize('assign_role', $user);\n $user->role_assignment($request);\n return redirect()->route('backoffice.user.show', $user);\n }",
"public function run()\n {\n $user = User::find(1);\n\n $role = Role::find(1);\n\n $user->attachRole($role);\n }",
"public function set_role($role) {\n $this->role = $role;\n }",
"public static function assign_user_role($user_id, $role_id)\n\t{\n\t\t$result = DB::update(self::TABLE_USER_ROLES)\n\t\t\t->set(array(\n\t\t\t\t\"active\" => 1\n\t\t\t))\n\t\t\t->where(\"user_id\", \"=\", $user_id)\n\t\t\t->and_where(\"role_id\", \"=\", $role_id)\n\t\t\t->execute();\n\t\t\t\n\t\treturn $result;\n\t}",
"function set_roles( $user_id, $roles ) {\r\n\r\n\t\t}",
"public function assignRole(Role $role)\n {\n return $this->role()->associate($role);\n }",
"public function assignRole(Request $request, User $user)\n {\n $this->authorize('role', $user);\n\n if ($request->isMethod('post')) {\n\n $this->service->assignRole($user, $request->roles);\n\n return redirect()->route('users.index');\n }\n\n $this->error(405001);\n\n return back();\n }",
"function lb_subscription_grant_role($account, $subscription) {\n user_multiple_role_edit(array($account->uid), 'add_role', $subscription->field_assign_role[LANGUAGE_NONE][0]['rid']);\n}",
"function ihc_switch_role_for_user($uid=0){\n\t$do_switch = get_option('ihc_automatically_switch_role');\n\tif ($do_switch && $uid){\n\t\t$data = get_userdata($uid);\n\t\tif ($data && isset($data->roles) && isset($data->roles[0])){\n\t\t\t$role = get_option('ihc_automatically_new_role');\n\t\t\tif (empty($role)){\n\t\t\t\t$role = 'subscriber';\n\t\t\t}\n\t\t\t$arr['role'] = $role;\n\t\t\t$arr['ID'] = $uid;\n\t\t\twp_update_user($arr);\n\t\t}\n\t}\n}",
"public function assign_role_to_user(Request $request): void\n {\n try {\n $request->validate([\n 'user_id' => 'required',\n '',\n ], []);\n } catch (\\Exception $e) {\n }\n }",
"public function setRole($role)\n {\n $this->_role = $role;\n }",
"public function addUserRole($role)\r\n {\r\n if($this->userRoleModel->isExistUserRole($role['id']))\r\n {\r\n $this->userRoleModel->updateExistingUserRole($role);\r\n }\r\n else\r\n {\r\n //IF role not exist then add new role\r\n $this->userRoleModel->addNewUserRole($role);\r\n }\r\n }",
"public function setIdRole($value)\n {\n $this->_id_role = $value;\n }",
"public function setRole($var)\n {\n GPBUtil::checkString($var, True);\n $this->role = $var;\n\n return $this;\n }",
"public function addRoleToUser() {\n\t\tif (self::userHasRole($this->user_id, $this->role_id)) {\n\t\t\treturn \"user already has the role\";\n\t\t}\n\t\t$this->init_database('a+');\n\t\tfwrite(self::$db, \"\\n\".$this->user_id . \",\". $this->role_id);\n\t\tfclose(self::$db);\n\t\treturn \"\\nadded successfully\\n\";\n\t}",
"public function actionCreate_role() { \n //redirect a user if not super admin\n if (!Yii::$app->CustomComponents->check_permission('user_role')) {\n return $this->redirect(['site/index']);\n }\n $model = new DvUsersRole();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', 'New User Role Created Successfully');\n return $this->redirect(['dv-users/create_role']);\n } else {\n return $this->render('create_role', [ 'model' => $model]);\n }\n }",
"public static function attachRole($user, $role)\n\t{\n\t\ttry {\n\t\t\t$user_role = UserRole::create(['user_id' => $user->id, 'role_id' => $role->id]);\n\t\t\treturn $user_role;\n\t\t} catch (\\Throwable $th) {\n\t\t\tLog::error('error on userRole in CommanHelper '. $th->getMessage());\n\t\t}\n\t}",
"public function assignRole(string $slug, string $role)\n {\n $user = $this->getBy('slug', $slug);\n\n switch ($role) {\n case 'admin':\n $user->privilege = 4;\n break;\n\n case 'author':\n $user->privilege = 2;\n break;\n\n case 'regular':\n $user->privilege = 1;\n break;\n\n case 'banned':\n $user->privilege = 0;\n break;\n\n default:\n # we fall in a black hole\n return;\n }\n\n $user->save();\n }",
"function assign($Role, $UserID = null)\n\t{\n $databaseManager = Rbac::getInstance()->getDatabaseManager();\n \n\t if ($UserID === null)\n {\n throw new RbacUserNotProvidedException('$UserID is a required argument.');\n } \n $RoleID = Rbac::getInstance()\n ->getRbacManager()\n ->getRoleManager()\n ->getId($Role)\n ;\n\n return $databaseManager->request(\n 'INSERT INTO ' . $databaseManager->getTablePrefix() . 'userroles\n (UserID,RoleID,AssignmentDate) VALUES (?,?,?)'\n , [$UserID, $RoleID, time()]) >= 1;\n\t}",
"public function creating(Role $role)\n {\n $role->created_by = $this->userId;\n }",
"public function setRole($value)\n {\n return $this->set('Role', $value);\n }",
"public function giveRole($role)\n {\n if($role instanceof Role) {\n return $role->assignRoleTo($this);\n }\n\n return Role::whereName($role)\n ->firstOrFail()\n ->assignRoleTo($this);\n }",
"public function testShouldAddRoleToUser()\n {\n $userAdmin = factory(User::class)->create();\n\n $role = Role::where(\"name\", \"admin\")->first();\n $userAdmin->attachRole($role);\n\n $this->actingAs($userAdmin);\n\n $user = factory(User::class)->create();\n\n $updatedRole = (new UpdateUserRoleService())->execute([\n \"userId\" => $user->id,\n \"roleId\" => $role->id,\n ]);\n\n $this->assertTrue(is_numeric($updatedRole->roles[0]->id));\n }",
"public function setUserRole(CrmUser $user, $role=null)\n {\n if (!$role) $role = User::ROLE_USER;\n\n $user->role = $role;\n $this->trackerService->track('set-role', $role.'_user-'.$user->id.'_by-'.za()->getUser()->getId());\n $this->dbService->updateObject($user);\n }",
"public function setRole($role)\n {\n $this->role = $role;\n }",
"public static function assignRole($userId, $roleName)\n {\n try\n {\n Yii::$app->db->createCommand()\n ->insert(Yii::$app->getModule('user-management')->auth_assignment_table, [\n 'user_id' => $userId,\n 'item_name' => $roleName,\n 'created_at' => time(),\n ])->execute();\n\n AuthHelper::invalidatePermissions();\n\n return true;\n }\n catch (\\Exception $e)\n {\n throw $e;\n }\n }",
"public function setRole(int $role): void\n {\n $this->role = $role;\n }",
"public static function createRole()\n {\n add_action('init', __NAMESPACE__ . '\\DigitalWebmaster::renameAdministratorRole');\n }",
"static function setRole(&$rsData, $role)\n {\n $rsData['role'] = $role;\n }",
"public function assign_role(User $user)\n {\n $this->authorize('assign_role', $user);\n return view('theme.backoffice.pages.user.assign_role', [\n 'user' => $user,\n 'roles' => Role::all()\n ]);\n }",
"public function testUpdateRole()\n {\n }",
"public function testUpdateRole()\n {\n }",
"public function create($roleName);",
"public function assignRole(string $roleName)\n {\n $roleId = Role::getIdByName($roleName);\n\n UserRole::create([\n 'user_id' => $this->id,\n 'role_id' => $roleId,\n ]);\n }",
"public function assignRole($role)\n {\n if (count($this->roles))\n {\n return $this->roles()->sync($role);\n }\n\n return $this->roles()->attach($role);\n }",
"function wv_create_user_roles($roleName, $roleKey, $capability_Arr) {\n add_role($roleKey, $roleName, $capability_Arr);\n }",
"public function addRole($role)\n {\n $this->roles[] = $role;\n }",
"public function to($role);",
"public function setUserRole(FormEvent $e)\n {\n $form = $ev->getParam('form'); // Form object\n $entity = $ev->getParam('entity');\n if ($entity instanceof \\ZendCommerce\\User\\Entity\\User){\n // add Role 'User' after registration\n $objectManager = $e->getApplication()->getServiceManager()->get('Doctrine\\ORM\\EntityManager');\n $role = $objectManager->getRepository('\\ZendCommerce\\User\\Entity\\Role')->findBy(array('roleId' => 'User'));\n $user->addRoles(new \\Doctrine\\Common\\Collections\\ArrayCollection($role));\n $objectManager->flush(); \n } \n \n }",
"function assignRoles($uName, $roleList) {\n\n Util::throwExceptionIfNullOrBlank($uName, \"User Name\");\n Util::throwExceptionIfNullOrBlank($roleList, \"RoleList\");\n $objUtil = new Util($this->apiKey, $this->secretKey);\n\n try {\n $params = null;\n $headerParams = array();\n $queryParams = array();\n $signParams = $this->populateSignParams();\n $metaHeaders = $this->populateMetaHeaderParams();\n $headerParams = array_merge($signParams, $metaHeaders);\n $body = null;\n if (is_array($roleList)) {\n $body = '{\"app42\":{\"user\":{\"userName\":\"' . $uName . '\",\"roles\": { \"role\": ' . json_encode($roleList) . '}}}}';\n } else {\n $body = '{\"app42\":{\"user\":{\"userName\":\"' . $uName . '\",\"roles\": { \"role\": \"' . $roleList . '\"}}}}';\n }\n $signParams['body'] = $body;\n $signature = urlencode($objUtil->sign($signParams));\n $headerParams['signature'] = $signature;\n $contentType = $this->content_type;\n $accept = $this->accept;\n $baseURL = $this->url;\n $baseURL = $baseURL . \"/assignrole\";\n $response = RestClient::post($baseURL, $params, null, null, $contentType, $accept, $body, $headerParams);\n $userResponseObj = new UserResponseBuilder();\n $userObj = $userResponseObj->buildResponse($response->getResponse());\n } catch (App42Exception $e) {\n throw $e;\n } catch (Exception $e) {\n throw new App42Exception($e);\n }\n\n return $userObj;\n }",
"public function SetRole($roleId)\r\n {\r\n $queryUpdateRole = \"UPDATE users SET user_role=:user_role WHERE user_id=:user_id\";\r\n $updateRole = $this->sqlDataBase->prepare($queryUpdateRole);\r\n $updateRole->execute(array(':user_role'=>$roleId,':user_id'=>$this->userId));\r\n }",
"function group_change_role($groupid, $userid, $role) {\n // group_can_change_role checks whether the group and user parameters are valid\n if (!group_can_change_role($groupid, $userid, $role)) {\n throw new AccessDeniedException(get_string('usercannotchangetothisrole', 'group'));\n }\n\n set_field('group_member', 'role', $role, 'group', $groupid, 'member', $userid);\n}",
"public function prepareUserAndRole() : void\n {\n if ($this->option(\"refresh\") != \"false\") {\n $this->cleanRoleAndPermissionTables();\n }\n\n $this->role = Role::find(config('system.roles.admin.id'));\n if (!$this->role) {\n $this->role = Role::create([\n 'id' => config('system.roles.admin.id'),\n 'name' => config('system.roles.admin.name')\n ]);\n $this->info('Role Created Successfully');\n }\n\n $user = User::find(1);\n\n if (!$user) {\n $user = User::create([\n 'name' => config('system.company.name'),\n 'email' => config('system.company.email'),\n 'password' => Hash::make(config('system.company.password')),\n 'lang' => 'en',\n 'admin_theme' => null,\n 'agent_type' => 1,\n 'image' => null,\n 'remember_token' => null,\n 'type' => 'admin',\n 'agents_can_assign' => null,\n 'agent_status_id' => null,\n 'whats_app_text' => config('system.company.description'),\n 'update_dashboard' => '0',\n 'created_at' => '2019-01-01 00:00:00',\n 'updated_at' => '2019-01-01 00:00:00',\n ]);\n\n $user->assignRole($this->role);\n\n $this->info('User Created Successfully And Role assign to him');\n } else {\n if (!$user->hasRole(config('system.roles.admin.id'))) {\n $user->assignRole($this->role);\n $this->info('Role Added Successfully');\n }\n }\n }",
"function set_user_role_woocommerce( $args ) {\n\t$args['role'] = 'subscriber';\n\treturn $args;\n}",
"public function run()\n {\n $role_user = Role::where('name','user')->first();\n $role_admin = Role::where('name','admin')->first();\n\n $user = new User();\n $user->name =\"User\";\n $user->email =\"[email protected]\";\n $user->password =bcrypt('abc123');\n $user->save();\n $user->roles()->attach($role_user);\n\n $user = new User();\n $user->name =\"admin\";\n $user->email =\"[email protected]\";\n $user->password =bcrypt('abc123');\n $user->save();\n $user->roles()->attach($role_admin);\n }",
"public function setRole($role) {\n\n $this->role = $role;\n }",
"public static function SetRole( string $role, int $id )\n {\n if ( is_null($role) || empty($role) )\n return false;\n\n if ( is_null($id) || empty($id) )\n return false;\n\n # Check if the user exists into the system\n $user = self::where('id', $id)->first();\n if( is_null($user) ){\n return false;\n }\n\n # Check if the role exists into the system\n $role = Role::where('name', $role)->first();\n if( is_null($role) ){\n return false;\n }\n\n # Try to set the role for the user\n $roleUser = RoleUser::firstOrNew([\n \n 'role_id' => $role->id, \n 'user_id' => $user->id\n \n ]);\n\n if ( $roleUser->exists === true )\n return null;\n\n if ( $roleUser->save() === false )\n return false;\n\n return true;\n\n }",
"function associateRolesToUser()\n {\n $retObj = array();\n try {\n\n if (isset($_POST['user_id']))\n {\n $role_ids = json_decode($_POST['role_ids']);\n $params = array(\n 'user_id' => $_POST['user_id'],\n 'role_ids' => $role_ids\n );\n\n $objAcl = new AclManager();\n $retObj['completed'] = false;\n $response = $objAcl->associateRolesToUser($params);\n $retObj['completed'] = true;\n\n } else {\n\n throw new \\Exception('Unsupported Request: missing critical parameter(s).');\n\n }\n\n\n } catch (\\Exception $e) {\n\n Api::invalidResponse(\n $e->getMessage(),\n 400,\n Constants::STATUS_INVALID,\n $e,\n true,\n true\n );\n\n }\n\n return Api::apiResponse($retObj, Constants::STATUS_SUCCESSFUL);\n }",
"public function setUserRole(int $userRole)\n {\n $this->userRole = $userRole;\n }",
"protected function addRole()\n\t{\n\t\tglobal $rbacadmin, $rbacreview, $rbacsystem,$ilErr,$ilCtrl;\n\n\t\t$form = $this->initRoleForm();\n\t\tif($form->checkInput())\n\t\t{\n\t\t\t$new_title = $form->getInput(\"title\");\n\t\t\t\n\t\t\tinclude_once './Services/AccessControl/classes/class.ilObjRole.php';\n\t\t\t$role = new ilObjRole();\n\t\t\t$role->setTitle($new_title);\n\t\t\t$role->setDescription($form->getInput('desc'));\n\t\t\t$role->create();\n\t\t\t\n\t\t\t$GLOBALS['rbacadmin']->assignRoleToFolder($role->getId(),$this->getCurrentObject()->getRefId());\n\t\t\t\n\t\t\t// protect\n\t\t\t$rbacadmin->setProtected(\n\t\t\t\t$this->getCurrentObject()->getRefId(),\n\t\t\t\t$role->getId(),\n\t\t\t\t$form->getInput('pro') ? 'y' : 'n'\n\t\t\t);\n\n\t\t\t// copy rights \n\t\t\t$right_id_to_copy = $form->getInput(\"rights\");\n\t\t\tif($right_id_to_copy)\n\t\t\t{\n\t\t\t\t$parentRoles = $rbacreview->getParentRoleIds($this->getCurrentObject()->getRefId(),true);\n\t\t\t\t$rbacadmin->copyRoleTemplatePermissions(\n\t\t\t\t\t$right_id_to_copy,\n\t\t\t\t\t$parentRoles[$right_id_to_copy][\"parent\"],\n\t\t\t\t\t$this->getCurrentObject()->getRefId(),\n\t\t\t\t\t$role->getId(),\n\t\t\t\t\tfalse);\n\n\t\t\t\tif($form->getInput('existing'))\n\t\t\t\t{\n\t\t\t\t\tif($form->getInput('pro'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$role->changeExistingObjects(\n\t\t\t\t\t\t\t$this->getCurrentObject()->getRefId(),\n\t\t\t\t\t\t\tilObjRole::MODE_PROTECTED_KEEP_LOCAL_POLICIES,\n\t\t\t\t\t\t\tarray('all')\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$role->changeExistingObjects(\n\t\t\t\t\t\t\t$this->getCurrentObject()->getRefId(),\n\t\t\t\t\t\t\tilObjRole::MODE_UNPROTECTED_KEEP_LOCAL_POLICIES,\n\t\t\t\t\t\t\tarray('all')\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// add to desktop items\n\t\t\tif($form->getInput(\"desktop\"))\n\t\t\t{\n\t\t\t\tinclude_once 'Services/AccessControl/classes/class.ilRoleDesktopItem.php';\n\t\t\t\t$role_desk_item_obj = new ilRoleDesktopItem($role->getId());\n\t\t\t\t$role_desk_item_obj->add(\n\t\t\t\t\t\t$this->getCurrentObject()->getRefId(),\n\t\t\t\t\t\tilObject::_lookupType($this->getCurrentObject()->getRefId(),true));\n\t\t\t}\t\t\n\n\t\t\tilUtil::sendSuccess($this->lng->txt(\"role_added\"),true);\n\t\t\t$this->ctrl->redirect($this,'perm');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$form->setValuesByPost();\n\t\t\t$this->tpl->setContent($form->getHTML());\n\t\t}\n\t}",
"public function assignPermission(Request $request, Role $role)\n {\n if(Auth::user()->can('assign-permission-to-role')){\n if($request->ids){\n $ids = $request->ids;\n foreach ($ids as $id) {\n $permission = Permission::find($id);\n $role->givePermissionTo($permission->name);\n ActivityLogger::activity(\"Le role ID:\".$role->id.'('.$role->name.') a désormais la permission id:'.$permission->id.'('.$permission->name.') donnée par l\\'utilisateur ID:'.Auth::id());\n }\n $message = sizeof($ids).' role(s) assigné(s) à la permission '.$permission->name.' avec succès';\n }\n else{\n $message = \"Aucune action n'a été effectuée.\";\n }\n // Envoyer un mail à la personne qui a recu le role avec la liste des permissions possibles\n return redirect()->route(\"roles.show\", compact('role'))->with('success',$message);\n }else{\n return back()->with('error',\"Vous n'avez pas ce droit\");\n } \n }",
"public function makeAdministrator()\n {\n $this->setRole('administrator');\n }",
"public function assignPermissionToRole(Request $request)\n {\n $role_id = $request->get(\"role_id\");\n $permission_id = $request->get(\"permission_id\");\n $permissionName = Permission::findById($permission_id)->name;\n return response(Role::findById($role_id)->givePermissionTo($permissionName),HTTP_OK);\n }",
"function updateUser($userID, $role)\n{\n}",
"public function putRole($role)\n {\n if ( is_string($role) )\n {\n $role = Role::whereRoleName($role)->first();\n }\n return $this->roles()->attach($role);\n }",
"public function create()\n {\n $this->authorize('create', Role::class);\n }",
"public function set($role)\n {\n try {\n $exists = $this->get($role);\n return true;\n\n } catch (NotFoundException $ex) {\n // role does not exist so create it\n }\n\n try {\n $sql = \"INSERT INTO roles (name) VALUES('$role');\";\n $this->db->exec($sql);\n } catch (PDOException $ex){\n throw new UnavailableException($ex->getMessage(), null, $ex);\n }\n }",
"public function setRoles($roles) {\n foreach ($roles as $role) {\n $this->addRole($role);\n }\n }",
"function after_switch_theme() {\n \\add_role('demo', __('Demo', 'theme-piber'), get_role('administrator')->capabilities);\n \\wp_insert_user(array(\n 'user_login' => 'demo',\n 'user_pass' => 'demo',\n 'role' => 'demo',\n ));\n}",
"public function run()\n {\n $firstUser = User::where('id', 1)->first();\n $secondUser = User::where('id', 2)->first();\n\n $firstUser->assignRole('admin');\n $secondUser->assignRole('guest');\n }",
"public function changeUserRole($user_id, Request $request) {\n $user = RoleUser::find($user_id);\n $user->role_id = $request->input('role');\n $user->save();\n $email = User::find($user_id)->email;\n $message = 'User '.$email.' has been granted admin rights!';\n if ( $user->role_id == 2) {\n $message = 'User '.$email.' has had admin rights revoked!';\n }\n return redirect('/manageUsers')->with('message', $message);\n }",
"public function addRole($role)\n {\n $role = strtoupper($role);\n if ($role === static::ROLE_DEFAULT) {\n return;\n }\n if (!in_array($role, $this->roles, true)) {\n $this->roles[] = $role;\n }\n }",
"public function add_role(){\n// $admin->name = 'admin';\n// $admin->display_name = 'User Administrator';\n// $admin->description = 'User is allowed to manage and edit other users';\n// $admin->save();\n\n// $user = User::where('name','admin')->first();\n// $user->attachRole(2);\n //这个添加方法也可以\n// $user->roles()->attach($admin->id); //只需传递id即可\n\n// $editUser = new Permission();\n// $editUser->name = 'edit-user';\n// $editUser->display_name = 'Edit Users';\n// $editUser->description = 'edit existing users';\n// $editUser->save();\n\n //给角色添加权限\n// $owner = Role::where('name','admin')->first();\n// $owner->attachPermission(1);\n //另一种写法,多权限\n// $admin = Role::where('name','admin')->first();\n// $admin->perms()->sync([1,2]);\n\n //检查权限角色\n $user = User::find(2);\n//\n// if($user->hasRole('owner')){\n// echo 'yes';\n// }else{\n// echo 'no';\n// }\n\n if($user->hasRole('admin')){\n echo 'yes';\n }else{\n echo 'no';\n }\n if($user->can('edit-user')){\n echo 'yes permission';\n }else{\n echo 'no permission';\n }\n\n// $user->hasRole(['owner', 'admin'], true); //同时具有角色的时候,才显示true\n// $user->can(['edit-user', 'create-post'], true); // false //同时具有多个权限的时候才显示true\n echo \"<br/>\".Auth::user()->name.\"<br/>\";\n if(Auth::user()->can('create-post')){\n echo 'i have perms';\n }else{\n\n echo 'i don.t have';\n }\n }",
"public function run()\n {\n $role = new Role();\n $role->type = Role::ROLE_USER;\n $role->save();\n\n $role = new Role();\n $role->type = Role::ROLE_ADMINISTRATOR;\n $role->save();\n }",
"public function testCreateRole()\n {\n }"
] | [
"0.79158795",
"0.7518824",
"0.73441774",
"0.73441774",
"0.7329653",
"0.7238251",
"0.71622765",
"0.708678",
"0.70859766",
"0.7076988",
"0.7076078",
"0.70510787",
"0.7037427",
"0.7026698",
"0.7020039",
"0.7019141",
"0.7006399",
"0.7003977",
"0.7003977",
"0.6982611",
"0.6979493",
"0.69095033",
"0.689022",
"0.68687093",
"0.6829632",
"0.6803672",
"0.6788293",
"0.6781628",
"0.6779755",
"0.67771554",
"0.6742041",
"0.6700334",
"0.6690584",
"0.6652557",
"0.6652039",
"0.6627858",
"0.6609813",
"0.6608009",
"0.6597759",
"0.659024",
"0.65764564",
"0.65596503",
"0.6557524",
"0.65245414",
"0.6505518",
"0.64864665",
"0.64859015",
"0.6462767",
"0.64619535",
"0.6458467",
"0.6455527",
"0.6448058",
"0.6440765",
"0.64338285",
"0.6427195",
"0.6417672",
"0.6408885",
"0.64074093",
"0.6400488",
"0.63958985",
"0.6386139",
"0.63834864",
"0.63773197",
"0.6375126",
"0.6368749",
"0.63637376",
"0.63637376",
"0.6360917",
"0.63576037",
"0.6343613",
"0.6331356",
"0.6321173",
"0.6320869",
"0.6320232",
"0.6311061",
"0.6291923",
"0.62861687",
"0.6285267",
"0.6265054",
"0.6259727",
"0.62407357",
"0.62388825",
"0.6228269",
"0.6210937",
"0.6197949",
"0.619393",
"0.6191922",
"0.6176602",
"0.6174244",
"0.61713785",
"0.6168274",
"0.61618125",
"0.6160463",
"0.61581135",
"0.6154762",
"0.61516374",
"0.61422896",
"0.6132238",
"0.6122153",
"0.6117784"
] | 0.6741372 | 31 |
Remove a role from a user | public function removeRole($role)
{
return $this->roles()->detach($role);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function removeRole($username, $role);",
"function remove_role($role)\n {\n }",
"public function remove_role($role)\n {\n }",
"public function remove_role($role)\n {\n }",
"public function removing_user_from_role_works()\n {\n $this->withoutExceptionHandling();\n\n $user = $this->createAdminUser();\n $admin = $this->createAdminUser();\n\n $response = $this->actingAs($admin)->get(route('remove-role', ['id' => $user->id, 'role' => 1]));\n\n $response->assertStatus(200);\n $response->assertViewIs('site.confirm');\n\n $See[] = $user->name;\n $See[] = __('user.confirm_remove_button');\n\n $response->assertSeeInOrder($See);\n\n $response = $this->actingAs($admin)->post(route('remove-role', ['id' => $user->id, 'role' => 1]), ['confirm' => true]);\n\n $data['user_id'] = $user->id;\n $data['role_id'] = 1;\n\n $this->assertDatabaseMissing('user_role', $data);\n\n $response->assertRedirect(route('profile', $user->id));\n }",
"static public function remove()\n {\n remove_role(self::ROLE_KEY);\n }",
"function roleDelete(Role $role);",
"public function RemoveRole ($roleName = NULL, $idRole = NULL);",
"static public function remove()\n {\n remove_role(self::ROLE_KEY);\n }",
"public function actionDeleteRole ()\n\t\t{\n\n\t\t\t$auth = Yii::$app->getAuthManager();\n\t\t\t$role = $auth->getRole(Yii::$app->request->get('id'));\n\t\t\t$auth->remove($role);\n\t\t\t$url = Yii::$app->request->referrer . '#roles';\n\t\t\tYii::$app->response->redirect($url);\n\n\t\t\tYii::$app->end();\n\t\t}",
"public function testRemoveUserRole()\n {\n $data = ['role' => 'administrator'];\n\n $this->removeUserRole($this->user->id, $data)\n ->assertRedirect();\n\n $this->assertNull(\n $this->user->roles()->where('name', $data['role'])->first()\n );\n }",
"public function detachRole($role);",
"public function removeUserRole(Request $request, User $user)\n {\n if ($request->role_id) {\n $user->roles()->detach($request->role_id);\n }\n return $this->successResponse('Deleted successfully');\n }",
"public function destroy(UserRole $userRole)\n {\n //\n }",
"public function removeRole($role)\n {\n $this->roles()->detach($this->getStoredRole($role));\n }",
"public function destroy(rbacRoleUser $rbacRoleUser)\n {\n //\n }",
"public function revokeUser(Request $request, Role $role)\n {\n if(Auth::user()->can('revoke-role-to-user')){\n if($request->ids){\n $ids = $request->ids;\n foreach ($ids as $id) {\n $user = User::find($id);\n $user->removeRole($role->name);\n ActivityLogger::activity(\"Le collaborateur ID:\".$user->id.'('.$user->name.') a désormais perdu le role id:'.$role->id.'('.$role->name.') donné par l\\'utilisateur ID:'.Auth::id());\n }\n $message = sizeof($ids).' collaborateur(s) révoqué(s) au role '.$role->name.' avec succès';\n }\n else{\n $message = \"Aucune action n'a été effectuée.\";\n }\n // Envoyer un mail à la personne qui a recu le role\n return redirect()->route(\"roles.show\", compact('role'))->with('success',$message);\n }else{\n return back()->with('error',\"Vous n'avez pas ce droit\");\n } \n }",
"function delete_user_role($id)\n {\n return $this->db->delete('user_role',array('id'=>$id));\n }",
"function removeRole( $name ) {\n $d = loadDB();\n \n $found = false;\n foreach ($d['roles'] as $key => $role) {\n if ($name == $role['name']) {\n unset($d['roles'][$key]);\n $found = true;\n }\n }\n if ($found) {\n audit( \"removeRole\", $name );\n saveDB( $d );\n }\n }",
"public function unassign($role, $permission);",
"public function removeRoles() {\n $this->roles()->detach();\n }",
"public function deleting(Role $role)\n {\n }",
"function revokeRole($userName, $role) {\n\n Util::throwExceptionIfNullOrBlank($userName, \"User Name\");\n Util::throwExceptionIfNullOrBlank($role, \"Role\");\n $encodedUserName = Util::encodeParams($userName);\n $encodedRole = Util::encodeParams($role);\n $responseObj = new App42Response();\n $objUtil = new Util($this->apiKey, $this->secretKey);\n try { \n\t\t $params = null;\n $headerParams = array();\n $queryParams = array();\n $signParams = $this->populateSignParams();\n $metaHeaders = $this->populateMetaHeaderParams();\n $headerParams = array_merge($signParams, $metaHeaders);\n $signParams['userName'] = $userName;\n $signParams['role'] = $role;\n $signature = urlencode($objUtil->sign($signParams)); //die();\n $headerParams['signature'] = $signature;\n $contentType = $this->content_type;\n $accept = $this->accept;\n $baseURL = $this->url;\n $baseURL = $baseURL . \"/\" . $encodedUserName . \"/revoke/\" . $encodedRole;\n $response = RestClient::delete($baseURL, $params, null, null, $contentType, $accept, $headerParams);\n $responseObj->setStrResponse($response->getResponse());\n $responseObj->setResponseSuccess(true);\n } catch (App42Exception $e) {\n throw $e;\n } catch (Exception $e) {\n throw new App42Exception($e);\n }\n return $responseObj;\n }",
"public function postDelete()\n {\n self::getConnection()->delete('@system_user_role', ['user_id' => $this->getId()]);\n }",
"function unassign($Role, $UserID = null)\n\t{\n $databaseManager = Rbac::getInstance()->getDatabaseManager();\n \n\t if ($UserID === null)\n {\n throw new RbacUserNotProvidedException('$UserID is a required argument.');\n }\n $RoleID = Rbac::getInstance()\n ->getRbacManager()\n ->getRoleManager()\n ->getId($Role)\n ;\n \n\t return $databaseManager->request(\n 'DELETE FROM ' . $databaseManager->getTablePrefix() . 'userroles'\n . ' WHERE UserID=? AND RoleID=?'\n , [$UserID, $RoleID]) >= 1;\n\t}",
"public function removeRole($role)\n {\n $role = is_string($role) ? Role::find($role) : $role;\n $result = TableFactory::getUserModel()\n ->association('Roles')\n ->unlink($this, [$role]);\n RolesTableTrait::refreshCache($this->id);\n\n return $result;\n }",
"function delete_role ($role_id) {\r\n $conn = db_connect();\r\n $query = \"delete from roles where role_id = '\".$role_id.\"'\";\r\n $result = $conn->query($query);\r\n $query = \"delete from role_priv where role_id = '\".$role_id.\"'\";\r\n $result1 = $conn->query($query);\r\n\r\n // change the users` priv to default\r\n $result2 = $conn->query(\"update users set role_id = '1' where role_id = '\".$role_id.\"'\");\r\n\r\n if (!$result || !$result1 || !$result2) {\r\n throw new Exception(\"Could not connect to the db!\");\r\n } else {\r\n return true;\r\n }\r\n }",
"public function roles_destroy($user_id, $role_id)\n {\n $user = User::find($user_id);\n $user->roles()->detach($role_id);\n\n return response()->json([ 'message' => 'Rol del usuario eliminado']);\n }",
"function delete_user_role($id,$table){\n $this->db->delete($table, array('user_id' => $id));\n return;\n }",
"function delete_user_role($id,$table){\n $this->db->delete($table, array('user_id' => $id));\n return;\n }",
"public function destroy($id)\n {\n $user = User::find($id);\n if($user->id != 1){\n\n if($user->role_id != 4){\n\n $user->role_id = 4;\n $user->save();\n return back()->withSuccess('User Role Has been Removed');\n\n }else{\n return back()->withErrors('The User already in Pending Mode');\n }\n }else{\n return back()->withErrors('Super Admin Undeletable');\n }\n\n\n\n\n }",
"public static function deassign_user_role($user_id, $role_id)\n\t{\n\t\t$result = DB::update(self::TABLE_USER_ROLES)\n\t\t\t->set(array(\n\t\t\t\t\"active\" => 0\n\t\t\t))\n\t\t\t->where(\"user_id\", \"=\", $user_id)\n\t\t\t->and_where(\"role_id\", \"=\", $role_id)\n\t\t\t->execute();\n\t\t\t\n\t\treturn $result;\n\t}",
"public function removeRole($id) {\n $where['role'] = $id;\n $existe = $this->db->get_where($this->tables['users'], $where)->row();\n if (!$existe) {\n $this->db->delete($this->tables['role_permissions'], array('role' => $id));\n $this->db->delete($this->tables['roles'], array('id' => $id));\n return true;\n }\n return false;\n \n \n }",
"private function deleteRoleUser($department_id, $role_id){\n \n $user_role = DB::table('role_user')->where('department_id', $department_id)->where('role_id', $role_id)->delete(); \n }",
"public function testShouldDeleteRoleToUser()\n {\n $userAdmin = factory(User::class)->create();\n\n $role = Role::where(\"name\", \"admin\")->first();\n $userAdmin->attachRole($role);\n\n $this->actingAs($userAdmin);\n\n $user = factory(User::class)->create();\n\n $updatedRole = (new RemoveUserRoleService())->execute([\n \"userId\" => $user->id,\n \"roleId\" => $role->id,\n ]);\n\n $this->assertTrue(count($updatedRole->roles) < 1);\n }",
"public function deleteUserRole(int $userId): bool;",
"function lb_subscription_revoke_role($account, $subscription) {\n user_multiple_role_edit(array($account->uid), 'remove_role', $subscription->field_assign_role[LANGUAGE_NONE][0]['rid']);\n}",
"public function delete_role($role_id){\n\t\treturn ORM::delete($role_id);\n\t}",
"public function destroy(Role $role)\n {\n //\n }",
"public function destroy(Role $role)\n {\n //\n }",
"public function destroy(Role $role)\n {\n //\n }",
"public function remove(AccountDomainModels\\Role $entity)\n {\n $id = $entity->id()->value();\n\n $this->model->destroy($id);\n }",
"public function revoke(Role $role, User $user)\n\t{\n\t\t$user->removeRole($role);\n\n\t\tactivity()->on($role)->withProperties(['user' => $user->full_name])->log('RoleRevoked');\n\n\t\t$response = ['message' => __('auth::roles.revoked')];\n\n\t\tif($user->id == auth()->user()->id) $response['event'] = 'user-updated';\n\n\t\treturn $response;\n\t}",
"public static function removeRole(Request $request)\n {\n\n if (!method_exists($request->user(), \"removeRole\"))\n return response(['message' => \"Method not defined. Add trait [\\Kolgaev\\Users\\Models\\UsersRoleAndPermission] to the user model\"], 500);\n\n if (!$user = Users::getUserModel($request->id))\n return response()->json(['message' => \"User not found\"], 400);\n\n if (Users::getRoleModel()->find($request->role_id))\n return response()->json(['message' => \"Role not found\"], 400);\n\n $user->removeRole($request->role_id);\n\n return response()->json([\n 'message' => \"Role removed to user\",\n ]);\n\n }",
"public function destroy(Role $role)\n {\n //\n if($role->name ==\"app-admin\"){\n\n }else{\n $role->delete();\n }\n return redirect('roles');\n }",
"public function destroy(Role $role)\n {\n if(Auth::user()->can('destroy-roles')){\n ActivityLogger::activity(\"Suppression du role ID:\".$role->id.'('.$role->name.') par l\\'utilisateur ID:'.Auth::id().\"(\".Auth::user()->name.\")\");\n $role->delete();\n return redirect()->route(\"roles.index\")->with('success', 'Role supprimé avec succès'); \n }else{\n return back()->with('error',\"Vous n'avez pas ce droit\");\n } \n }",
"public function deleting(Role $role)\n {\n $role->syncPermissions();\n }",
"public function deletePermissionRoleByRoleID($id);",
"public function deleteRolesAction(){\n \n $request = $this->getRequest();\n \n if(! isset($request->id)) {\n // TODO Massege (Helper bauen??!)\n $this->_helper->messenger('error', \n Zend_Registry::get('config')->messages->role->invalid);\n return $this->_redirect('/admin/role');\n }\n \n $entity = 'Jbig3\\Entity\\RolesEntity';\n $repositoryFunction = 'findOneById';\n \n $role = $this->em->getRepository($entity)->$repositoryFunction($request->id);\n \n if($role !== null) {\n // TODO Cascade - hier anders gelöst (Kinder vorher manuell löschen)\n if(count($role->rules)) {\n // Masseges\n $this->_helper->messenger('error', \n 'Unable to remove group. Please remove dependencies first (Manual)');\n return $this->_redirect('/admin/role');\n }\n \n $roleName = $role->name;\n \n $this->em->remove($role);\n $this->em->flush();\n \n // TODO Masseges\n $this->_helper->messenger('success', \n sprintf(Zend_Registry::get('config')->messages->role->delete, $roleName));\n return $this->_redirect('/admin/role');\n } else {\n // TODO Masseegs\n $this->_helper->messenger('success', \n Zend_Registry::get('config')->messages->role->invalid);\n return $this->_redirect('/admin/role');\n }\n }",
"public function removeUser(UserInterface $user);",
"public function admin_remove($id){\n\t\t\t$user = User::find($id);\n\t\t\t$role_id = $user->role_id;\n\t\t\tif($user->is_deleted==1){\n\t\t\t\t$user->is_deleted = 0;\n\t\t\t\t}else {\n\t\t\t\t$user->is_deleted = 1;\n\t\t\t}\n\t\t\t\n\t\t\tif($user->save()){\n\t\t\t\tSession::flash('message', 'Company account has been deleted successfully.');\n\t\t\t\treturn Redirect::to('admin/users/'.$role_id);\n\t\t\t}\n\t\t\t\n\t\t}",
"public static function RoleDelete($id) {\n $role = Roles::find($id);\n $role->status = 0;\n $role->save(); \n }",
"public function destroy($id)\n {\n $role = Role::find($id);\n $role->syncPermissions([]);\n \n $users = User::whereHas(\"roles\", function($q) use ($id){ $q->where(\"id\", $id); })->get();\n foreach($users as $user){\n $user->removeRole($role->name); \n } \n \n $role->delete();\n \n return redirect()->route('roles.index')\n ->with('success','Role deleted successfully!');\n }",
"public function destroy(Role $role)\n {\n //dd($role->toArray());\n $role->detachAllPermissions();\n $role->delete();\n writeLog('刪除 角色',$role->toArray());\n Session::flash('flash_message', '刪除成功!');\n // flash()->overlay('刪除成功!','系統訊息:');\n return redirect('/admin/role');\n }",
"public function destroy(Role $role)\n {\n $deleted = ($role->users()->count()) ? FALSE : $role->delete();\n if ($deleted) {\n sweet_alert()->success('Role Deleted', 'Role and all its permissions has been deleted successfully');\n return redirect(route('listRoles'));\n }\n sweet_alert()->overlay('Error', \"role could not deleted because it's assigned to one or more admin\",'error');\n return redirect(route('listRoles'));\n\n }",
"public function destroy(Role $role)\n {\n //\n DB::beginTransaction();\n try{\n $role->delete();\n DB::commit();\n return redirect('roles');\n }catch(\\Exception $e){\n DB::rollBack();\n return redirect('roles');\n }\n }",
"function urt_deactivate() {\n remove_role( 'urt_secretary' );\n}",
"public function revokeUsersAccess(Request $request, Role $role)\n {\n $this->authorize('delete', User::class);\n\n $users = $role->users()\n ->whereNull('expires_at')\n ->orWhereDate('expires_at', '>', Carbon::now())\n ->orWhere('user_id', '!=', $request->user()->id)\n ->get();\n\n $users->each(function ($user, $key) use ($role) {\n $user->roles()->updateExistingPivot($role->id, ['expires_at' => Carbon::now()]);\n });\n\n return back()->withSuccess(\"{$role->name} role revoked from assigned users.\");\n }",
"public function destroy(Role $role)\n {\n //check if role has users\n if ($role->users->count() > 0) {\n return back()->withError('Role has users assigned to it. You can only disable it.');\n }\n\n //delete\n if ($role->delete()) {\n return back()->withSuccess('Role deleted successfully.');\n }\n }",
"public function destroy(RoleUserRequest $request, $role, $id)\n {\n try {\n $this->model->delete($id);\n\n return $this->success(trans('message.success.deleted', ['Module' => trans('user::role.name')]), 200);\n } catch (Exception $e) {\n return $this->error($e->getMessage());\n }\n }",
"public function deleteRole($roleID)\n {\n $result = $this->sdb->query(\n 'select appuser.username from appuser,appuser_role_link as arl where arl.rid=$1 and arl.uid=appuser.id',\n array($roleID));\n $usernames = \"\";\n while($row = $this->sdb->fetchrow($result))\n {\n $usernames .= $row['username'] . \" \";\n }\n if ($usernames)\n {\n throw new \\snac\\exceptions\\SNACDatabaseException(\"Tried to delete role still used by users: $usernames\");\n }\n else\n {\n $this->sdb->query(\n 'delete from privilege_role_link where rid=$1',\n array($roleID));\n $this->sdb->query(\n 'delete from role where id=$1 and id not in (select distinct(rid) from appuser_role_link)',\n array($roleID));\n }\n }",
"public function delete($role_id)\r\n {\r\n $this->checkIfDemo();\r\n $this->AdminRoleModel->remove($role_id);\r\n }",
"public function destroy(Role $role)\n {\n $role->permissions()->detach();\n $role->delete();\n return redirect(\\Config::get(\"admin\").\"/roles/\");\n }",
"public function destroy(Role $role) {\n\t\t$this->authorize('hasaccess', 'roles.destroy');\n\t\t$role->delete();\n\t\treturn redirect()->route('role.index')->with('status_success', 'Role successfully removed');\n\t}",
"public function deleteUser($role,$id)\n {\n // $delete_user_role = DB::table('user_roles')->where('user_id',$id)->delete();\n $delete_from_user_table = DB::table('users')->where('user_id',$id)->delete();\n $user = UserInformation::find($id);\n $user->delete();\n return redirect(route('admin.list_user',['role'=>$role]))->with('success','Delete user successfully.');\n\n }",
"public static function deleteUser($user_id , $role){\n $user_id ;\n $user = User::where(\"id\",$user_id)->where(\"role_id\",$role)->first();\n $user_id = $user->user_id ;\n if(User::destroy($user->id)){\n return $user_id;\n }\n else{\n return \"false\";\n }\n }",
"public static function delete(Role $role)\n {\n $role->delete();\n }",
"public function remove_roles() {\n global $wp_roles;\n\n if ( ! class_exists( 'WP_Roles' ) ) {\n return;\n }\n\n if ( ! isset( $wp_roles ) ) {\n $wp_roles = new WP_Roles();\n }\n\n if ( $this->role_exists( 'customer' ) ) {\n remove_role( 'customer' );\n }\n\n if ( $this->role_exists( 'shop_manager' ) ) {\n remove_role( 'shop_manager' );\n }\n }",
"function delete_role($roleid) {\n $success = true;\n\n// mdl 10149, check if this is the last active admin role\n// if we make the admin role not deletable then this part can go\n \n $systemcontext = get_context_instance(CONTEXT_SYSTEM);\n \n if ($role = get_record('role', 'id', $roleid)) {\n if (record_exists('role_capabilities', 'contextid', $systemcontext->id, 'roleid', $roleid, 'capability', 'moodle/site:doanything')) {\n // deleting an admin role\n $status = false;\n if ($adminroles = get_roles_with_capability('moodle/site:doanything', CAP_ALLOW, $systemcontext)) {\n foreach ($adminroles as $adminrole) {\n if ($adminrole->id != $roleid) {\n // some other admin role\n if (record_exists('role_assignments', 'roleid', $adminrole->id, 'contextid', $systemcontext->id)) {\n // found another admin role with at least 1 user assigned \n $status = true;\n break;\n }\n }\n } \n } \n if ($status !== true) {\n error ('You can not delete this role because there is no other admin roles with users assigned'); \n }\n } \n }\n\n// first unssign all users\n if (!role_unassign($roleid)) {\n debugging(\"Error while unassigning all users from role with ID $roleid!\");\n $success = false;\n }\n\n// cleanup all references to this role, ignore errors\n if ($success) {\n delete_records('role_capabilities', 'roleid', $roleid);\n delete_records('role_allow_assign', 'roleid', $roleid);\n delete_records('role_allow_assign', 'allowassign', $roleid);\n delete_records('role_allow_override', 'roleid', $roleid);\n delete_records('role_allow_override', 'allowoverride', $roleid);\n delete_records('role_names', 'roleid', $roleid);\n }\n\n// finally delete the role itself\n // get this before the name is gone for logging\n $rolename = get_field('role', 'name', 'id', $roleid);\n \n if ($success and !delete_records('role', 'id', $roleid)) {\n debugging(\"Could not delete role record with ID $roleid!\");\n $success = false;\n }\n \n if ($success) {\n add_to_log(SITEID, 'role', 'delete', 'admin/roles/action=delete&roleid='.$roleid, $rolename, '', $USER->id);\n }\n\n return $success;\n}",
"public function destroy(User $user)\n {\n $user->roles()->detach();\n $user->destroy();\n return redirect()->route('moderate.users.index')->with(Session::flash('success','item has been deleted!'));\n }",
"public function del_role(){\n\t\textract($_POST);\n\n\t\t//Connection establishment to get data from REST API\n\t\t$path=base_url();\n\t\t$url = $path.'api/manageRoles_api/del_role?role_id='.$role_id;\t\t\n\t\t$ch = curl_init($url);\n\t\tcurl_setopt($ch, CURLOPT_HTTPGET, true);\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\t\t$response_json = curl_exec($ch);\n\t\tcurl_close($ch);\n\t\t$response=json_decode($response_json, true);\n\t\t//api processing ends\n\n\t\tif($response['status']==0){\n\t\t\techo '<div class=\"alert alert-danger\">\n\t\t\t<strong>'.$response['status_message'].'</strong> \n\t\t\t</div>\t\t\t\t\t\t\n\t\t\t';\t\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\techo '<div class=\"alert alert-warning\">\n\t\t\t<strong>'.$response['status_message'].'</strong> \n\t\t\t</div>\t\t\t\t\t\t\n\t\t\t';\t\t\t\t\n\t\t\t\n\t\t}\t\n\t\t\n\t}",
"public function removeRole(string $roleName)\n {\n $roleId = Role::getIdByName($roleName);\n\n \\DB::table('user_roles')->where([\n 'user_id' => $this->id,\n 'role_id' => $roleId,\n ])->delete();\n }",
"public function removeRoleCommand($username, $role, $authenticationProvider = 'DefaultProvider') {\n\t\t$account = $this->accountRepository->findByAccountIdentifierAndAuthenticationProviderName($username, $authenticationProvider);\n\t\tif (!$account instanceof \\TYPO3\\Flow\\Security\\Account) {\n\t\t\t$this->outputLine('User \"%s\" does not exist.', array($username));\n\t\t\t$this->quit(1);\n\t\t}\n\n\t\t$role = new \\TYPO3\\Flow\\Security\\Policy\\Role($role);\n\n\t\tif (!$account->hasRole($role)) {\n\t\t\t$this->outputLine('User \"%s\" does not have the role \"%s\" assigned.', array($username, $role));\n\t\t\t$this->quit(1);\n\t\t}\n\n\t\t$account->removeRole($role);\n\t\t$this->accountRepository->update($account);\n\t\t$this->outputLine('Removed role \"%s\" from user \"%s\".', array($role, $username));\n\t}",
"public function destroy(Role $role)\n {\n\n // $role->delete();\n // return ResponseHelper::success();\n }",
"public function destroy($id)\n {\n // Gate::authorize('haveaccess', 'rol.destroy');\n $user= Role::find($id);\n $user->delete();\n\n return redirect('sistema/iniciorole')->with('success','Haz eliminado un rol con exito');\n }",
"public function destroy(Role $role)\n {\n\n //Si es un rol permiso administrativo no permitir eliminarlo\n if ($role->name=='admin') {\n return response()->json(['data' => 'Acceso denegado'], 403);\n }\n\n $role->delete();\n return response()->json(['data' => $role], 200);\n\n }",
"public function destroy($id)\n {\n $oRole = Sentinel::findRoleById($id);\n $oRole->users()->detach();\n $oRole->delete();\n \n return redirect($this->sPath)->withOk(\"L'objet a été supprimé.\");\n }",
"public function uninstall() {\n\t\t$this->load->model( 'user/user_group' );\n\t\t// access - modify pavomenu edit\n\t\t$this->model_user_user_group->removePermission( $this->user->getId(), 'access', 'extension/module/pavomenu/menu' );\n\t\t$this->model_user_user_group->removePermission( $this->user->getId(), 'modify', 'extension/module/pavomenu/menu' );\n\t\t// END REMOVE USER PERMISSION\n\t}",
"public function destroy(Role $role)\n {\n $role->delete();\n\n return redirect()->route('admin.user_managment.role.index');\n }",
"public function destroy($id)\n {\n $user = User::find($id); \n $this->authorize('delete', $user);\n $user->delete();\n // Delete the associated roles\n DB::table('role_user')->where('user_id',$id)->delete();\n return redirect('/users')->with('success', 'User Deleted');\n }",
"public function destroy(User $user)\n {\n $user->roles()->detach();\n return redirect()->route('level.index');\n }",
"public function detachRole($role)\n {\n if (is_object($role)) {\n $role = $role->getKey();\n }\n\n if (is_array($role)) {\n $role = $role['id'];\n }\n\n $this->roles()->detach($role);\n }",
"public function destroy ($id) {\n permiss ( 'role.delete' );\n\n $role = $this->entity->find($id);\n \n if ( $role->cascade && $role->delete() ) {\n return response()->json([\n 'code' => 204,\n 'data' => 'deleted user'\n ]);\n }\n\n return response()->json([\n 'code' => 500,\n 'data' => 'Error to deleted role'\n ]);\n }",
"public function destroy(Role $role)\n {\n try{\n $role->delete();\n return redirect()->back()\n ->with('success', 'Role Deleted successfully.');\n }catch(\\Exception $e){\n DB::rollback();\n return Redirect::back()->with('error',$e->getMessage());\n }\n }",
"public function dropUser( $user )\n {\n \n $person = $this->db->select( 'SELECT id_person from wbfsys_role_user where upper(name) = upper(\\''.$user.'\\') ', 'id_person', true );\n \n $this->db->delete( 'DELETE FROM wbfsys_role_user WHERE upper(name) = upper(\\''.$user.'\\') ' );\n \n if( $person )\n $this->db->delete( 'DELETE FROM core_person WHERE rowid = '.$person );\n \n }",
"public function forgetRole()\n {\n // if (is_string($role))\n // {\n // $role = Role::whereRoleName($role)->first();\n // }\n $roles = Role::get();\n\n return $this->roles()->detach($roles);\n }",
"public function destroyRole($role_id) {\n $conn = DBConnection::getInstance();\n $role = $this->getRoleData($role_id)['name'];\n if ($role == 'staff') {\n return false;\n }\n $conn->startTransaction();\n if (!$this->DeleteRole($role_id)){\n $conn->rollback();\n return false;\n }\n if (!$this->deleteRoleProp($role)){\n $conn->rollback();\n return false;\n }\n $this->destroyXML($role);\n if (!$this->destroySchema($role)){\n $conn->rollback();\n return false;\n }\n $conn->commit();\n return $role;\n }",
"public function removeUserFromRoleByName(User $user, string $roleName)\n {\n if (! $role = $this->roleRepository->findOneByName($roleName)) {\n return;\n }\n\n $this->removeUserFromRole($user, $role);\n }",
"public function delete($id)\n {\n $role = $this->findById($id);\n\n \n $role->delete();\n }",
"public static function removeMemberRole($guild_id, $user_id, $role_id)\r\n {\r\n $result = Api::delete(\r\n '/guilds/' . $guild_id . '/members/' . $user_id . '/roles/' . $role_id\r\n );\r\n\r\n return $result->getStatus() === 204;\r\n }",
"public function deleteRoles( Role $role ): ?RedirectResponse {\n\t\tif ( $role->name !== 'super-admin' ) {\n\t\t\ttry {\n\t\t\t\t$role->delete();\n\n\t\t\t\treturn redirect()->back()->with( 'success', 'Role deleted successfully.' );\n\t\t\t} catch ( \\Exception $e ) {\n\t\t\t\treturn redirect()->back()->withErrors( [ 'Could not delete role.' ] );\n\t\t\t}\n\t\t}\n\n\t\treturn redirect()->back()->withErrors( [ 'Cannot delete super-admin role.' ] );\n\t}",
"public function destroy($id)\n {\n //\n $user = User::where('id',$id)->with('roles')->first();\n foreach($user->roles as $role){\n if ($role['slug'] == 'superadmin') {\n Session::flash('warning', 'Failed! Unable to delete a User');\n return Redirect::back();\n }\n }\n $user->delete();\n Session::flash('message', 'Success! You have deleted a User');\n return Redirect::back();\n }",
"function delete_role($roles_id)\n {\n return $this->db->delete('roles',array('roles_id'=>$roles_id));\n }",
"public function destroy(Role $role)\n {\n \n $this->authorize('delete', $role);\n $role->delete();\n return redirect()->route('admin.roles.index')->withFlash('Role eliminado correctamente');\n \n }",
"public function destroy(Role $role)\n {\n if ($role->name == 'super-admin') {\n return redirect()->route('role.index');\n }\n\n $role->delete();\n\n return redirect()->route('role.index');\n }",
"public function destroy(Role $role)\n {\n $role->delete();\n\n return 'Success';\n }",
"public function destroy($id)\n {\n //\n $delete = Role::destroy($id);\n }",
"public function removeListener($user, $role) {\n\t\t$sql = \"UPDATE `char_players` SET `terminated`=CURRENT_TIMESTAMP WHERE `charFK`=$this->uid AND `userFK`=$user AND `role`=$role LIMIT 1\";\n\t\t$this->mysqli->query($sql);\n\t\tif ($this->mysqli->affected_rows==1) return 1;\n\t\telse return -1;\n\t}",
"public function remove_user() { return $this->STOR->remove_user(); }",
"public function destroy(Role $role)\n {\n $this->authorize('delete', $role);\n $role->delete();\n }"
] | [
"0.8328603",
"0.8047605",
"0.80001885",
"0.79981226",
"0.7838622",
"0.77902114",
"0.77600473",
"0.7727452",
"0.7659778",
"0.74432653",
"0.7421057",
"0.7352167",
"0.73409647",
"0.7229905",
"0.721011",
"0.70708543",
"0.69848835",
"0.6951225",
"0.6941198",
"0.6930036",
"0.691814",
"0.6912397",
"0.6892073",
"0.686641",
"0.68452865",
"0.68442756",
"0.6837468",
"0.6831878",
"0.6829044",
"0.6829044",
"0.6816721",
"0.6807378",
"0.6801878",
"0.6784896",
"0.67810655",
"0.6758634",
"0.674744",
"0.6741337",
"0.6705632",
"0.6705632",
"0.6705632",
"0.6698911",
"0.6694",
"0.6667203",
"0.6649775",
"0.6649027",
"0.66390914",
"0.66297865",
"0.6604356",
"0.6547388",
"0.6546219",
"0.6533294",
"0.6530875",
"0.6516949",
"0.6500774",
"0.6500441",
"0.6495",
"0.6490873",
"0.64849615",
"0.64819854",
"0.64533615",
"0.6430042",
"0.64241165",
"0.64183795",
"0.641511",
"0.640991",
"0.64022017",
"0.6400228",
"0.6391417",
"0.6383972",
"0.6383477",
"0.63757205",
"0.6370081",
"0.63674164",
"0.6353643",
"0.63508064",
"0.6345778",
"0.6340357",
"0.6336512",
"0.6329979",
"0.6314081",
"0.6313875",
"0.6293104",
"0.62905294",
"0.6289715",
"0.6285142",
"0.6257433",
"0.62519485",
"0.62503934",
"0.6249364",
"0.62448645",
"0.62305427",
"0.6229347",
"0.622778",
"0.6218329",
"0.62143826",
"0.6212213",
"0.6208977",
"0.61947757",
"0.61910814"
] | 0.6813221 | 31 |
Remove all roles from a user | public function removeRoles()
{
return $this->roles()->detach();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function revokeAllRoles ();",
"public function removeRoles() {\n $this->roles()->detach();\n }",
"public function remove_roles() {\n global $wp_roles;\n\n if ( ! class_exists( 'WP_Roles' ) ) {\n return;\n }\n\n if ( ! isset( $wp_roles ) ) {\n $wp_roles = new WP_Roles();\n }\n\n if ( $this->role_exists( 'customer' ) ) {\n remove_role( 'customer' );\n }\n\n if ( $this->role_exists( 'shop_manager' ) ) {\n remove_role( 'shop_manager' );\n }\n }",
"public function detachAllRoles()\n {\n $this->roles()->detach();\n\n $this->clearCache();\n }",
"public function detachRoles($roles);",
"static public function remove()\n {\n remove_role(self::ROLE_KEY);\n }",
"public function detachUserAll(User $user)\n\t\t{\n\t\t\t\tif ($user->id == Auth::user()->id) {\n\t\t\t\t\t\treturn response()->json('Not allowed', 422);\n\t\t\t\t}\n\t\t\t\t$user->roles()->detach();\n\n\t\t\t\treturn redirect()\n\t\t\t\t\t->back()\n\t\t\t\t\t->with('message', 'User Detached all Roles');\n\t\t}",
"static public function remove()\n {\n remove_role(self::ROLE_KEY);\n }",
"public function detachAllRoles()\n {\n DB::table('role_user')->where('user_id', $this->id)->delete();\n return $this;\n }",
"function egsr_remove_wp_roles(){\n $wp_roles = new WP_Roles();\n // $wp_site_roles = egsr_custom_site_roles();\n $wp_site_roles = egsr_default_wp_site_roles();\n foreach ($wp_site_roles as $key => $value) {\n $role = get_role($key);\n if(isset($role->name) == $key){ // Check if Role exists already\n $wp_roles->remove_role($key); // Remove role + capabilities\n }\n }\n}",
"public function deleteAllUserRoles(array $users): bool;",
"public function removeRole($username, $role);",
"public static function deleteUserRoles($user_id) {\n $sql = \"DELETE FROM user_role WHERE user_id = $user_id\";\n $res = $_POST['link']->query($sql);\n return $res;\n }",
"public function clear() {\r\n\r\n \t\r\n \t\tunset ( $this->__sesionStorage->role );\r\n \t\t\r\n }",
"public function destroyRoles()\n {\n $model_type = get_class($this->model);\n $model_id = $this->model->getKey();\n\n return Role::where('model_type', $model_type)\n ->where('model_id', $model_id)\n ->delete();\n }",
"function remove_role($role)\n {\n }",
"public function rolesForUser();",
"public function revokeAllPermissions()\n {\n $this->permissions()->sync([]);\n\n if (config('permissionsHandler.seeder') == true) {\n Seeder::revokeAllRolePermissions($this);\n }\n\n $this->clearRelatedCache();\n }",
"public function removing_user_from_role_works()\n {\n $this->withoutExceptionHandling();\n\n $user = $this->createAdminUser();\n $admin = $this->createAdminUser();\n\n $response = $this->actingAs($admin)->get(route('remove-role', ['id' => $user->id, 'role' => 1]));\n\n $response->assertStatus(200);\n $response->assertViewIs('site.confirm');\n\n $See[] = $user->name;\n $See[] = __('user.confirm_remove_button');\n\n $response->assertSeeInOrder($See);\n\n $response = $this->actingAs($admin)->post(route('remove-role', ['id' => $user->id, 'role' => 1]), ['confirm' => true]);\n\n $data['user_id'] = $user->id;\n $data['role_id'] = 1;\n\n $this->assertDatabaseMissing('user_role', $data);\n\n $response->assertRedirect(route('profile', $user->id));\n }",
"public function destroy(User $user)\n {\n $user->roles()->detach();\n return redirect()->route('level.index');\n }",
"public function clear()\n {\n $this->missingRoles = [];\n }",
"function UnassignUsers($ID)\n\t{\n\t\treturn jf::SQL ( \"DELETE FROM {$this->TablePrefix()}rbac_userroles WHERE\n\tRoleID=?\", $ID );\n\t}",
"function mrpu_save_multiple_user_roles( $user_id ) {\n\t// Not allowed to edit user - bail\n\tif ( ! current_user_can( 'edit_user', $user_id ) || ! wp_verify_nonce( $_POST['_mrpu_roles_nonce'], 'mrpu_set_roles' ) ) {\n\t\treturn;\n\t}\n\n\t$user = new WP_User( $user_id );\n\t$roles = get_editable_roles();\n\t$new_roles = isset( $_POST['mrpu_user_roles'] ) ? (array) $_POST['mrpu_user_roles'] : array();\n\t// Get rid of any bogus roles\n\t$new_roles = array_intersect( $new_roles, array_keys( $roles ) );\n\t$roles_to_remove = array();\n\t$user_roles = array_intersect( array_values( $user->roles ), array_keys( $roles ) );\n\tif ( ! $new_roles ) {\n\t\t// If there are no roles, delete all of the user's roles\n\t\t$roles_to_remove = $user_roles;\n\t} else {\n\t\t$roles_to_remove = array_diff( $user_roles, $new_roles );\n\t}\n\tforeach ( $roles_to_remove as $_role ) {\n\t\t$user->remove_role( $_role );\n\t}\n\tif ( $new_roles ) {\n\t\t// Make sure that we don't call $user->add_role() any more than it's necessary\n\t\t$_new_roles = array_diff( $new_roles, array_intersect( array_values( $user->roles ), array_keys( $roles ) ) );\n\t\tforeach ( $_new_roles as $_role ) {\n\t\t\t$user->add_role( $_role );\n\t\t}\n\t}\n}",
"static function removeRolesAction($roles, $em) {\n foreach ($roles as $role) {\n $em->remove($role);\n $em->flush();\n }\n }",
"public function postDelete()\n {\n self::getConnection()->delete('@system_user_role', ['user_id' => $this->getId()]);\n }",
"public function removeUserRole(Request $request, User $user)\n {\n if ($request->role_id) {\n $user->roles()->detach($request->role_id);\n }\n return $this->successResponse('Deleted successfully');\n }",
"public function uninstall()\r\n {\r\n // Remove Roles\r\n $objRole = new Partner($this->conf, $this->lang, $this->conf->getExtensionPrefix().'partner');\r\n $objRole->remove(); // Remove roles if exist - Launch only on first time activation\r\n\r\n $objRole = new Assistant($this->conf, $this->lang, $this->conf->getExtensionPrefix().'assistant');\r\n $objRole->remove(); // Remove roles if exist - Launch only on first time activation\r\n\r\n $objRole = new Manager($this->conf, $this->lang, $this->conf->getExtensionPrefix().'manager');\r\n $objRole->remove(); // Remove roles if exist - Launch only on first time activation\r\n\r\n $objSingleSiteInstall = new Install($this->conf, $this->lang, $this->blogId);\r\n $objSingleSiteInstall->dropTables();\r\n }",
"public function destroy(UserRole $userRole)\n {\n //\n }",
"public function testRemoveUserRole()\n {\n $data = ['role' => 'administrator'];\n\n $this->removeUserRole($this->user->id, $data)\n ->assertRedirect();\n\n $this->assertNull(\n $this->user->roles()->where('name', $data['role'])->first()\n );\n }",
"function removeRole( $name ) {\n $d = loadDB();\n \n $found = false;\n foreach ($d['roles'] as $key => $role) {\n if ($name == $role['name']) {\n unset($d['roles'][$key]);\n $found = true;\n }\n }\n if ($found) {\n audit( \"removeRole\", $name );\n saveDB( $d );\n }\n }",
"private function remove_old_roles(){\n\t\t// If empty return true\n\t\tif( empty( $this->old_roles ) ) return true;\n\t\t/**\n\t\t * Loop through and remove the old roles\n\t\t * We are dropping them all, even if they are in the New Roles list\n\t\t * So that we can keep our capabilities up to date\n\t\t **/\n\t\tarray_walk( $this->old_roles, function( $role ){\n\t\t\tif( $role !== 'administrator' ) $this->wp_roles->remove_role( $role );\n\t\t});\n\t}",
"public function detachRoles($roles, $column = 'name', $user = null)\n {\n if(!$this->checkUser($user)){\n throw new Exception(\"Invalid user instance\");\n }\n\n if(is_array($roles)) {\n $array = [];\n foreach($roles as $key=>$role) {\n if($role instanceof Role) {\n array_push($array, $role->id);\n }\n elseif(is_integer($role)) {\n array_push($array, $role);\n }\n elseif(is_string($role)) {\n array_push($array, Role::where($column, $role)->firstOrFail()->id);\n }\n else {\n throw new \\Exception(\"argument roles must be integer|string|\\Panoscape\\Access\\Role\");\n }\n }\n $user->roles()->detach($array);\n }\n elseif($roles instanceof Role) {\n $user->roles()->detach($roles->id);\n }\n elseif(is_integer($roles)) {\n $user->roles()->detach($roles);\n }\n elseif(is_string($roles)) {\n $user->roles()->detach(Role::where($column, $roles)->firstOrFail()->id);\n }\n else {\n throw new \\Exception(\"argument roles must be array|integer|string|\\Panoscape\\Access\\Role\");\n }\n }",
"public static function deassign_user_role($user_id, $role_id)\n\t{\n\t\t$result = DB::update(self::TABLE_USER_ROLES)\n\t\t\t->set(array(\n\t\t\t\t\"active\" => 0\n\t\t\t))\n\t\t\t->where(\"user_id\", \"=\", $user_id)\n\t\t\t->and_where(\"role_id\", \"=\", $role_id)\n\t\t\t->execute();\n\t\t\t\n\t\treturn $result;\n\t}",
"function editable_roles( $roles ){\n if( isset( $roles['administrator'] ) && !current_user_can('administrator') ){\n unset( $roles['administrator']);\n }\n return $roles;\n }",
"public function destroy(User $user)\n {\n $user->roles()->detach();\n $user->destroy();\n return redirect()->route('moderate.users.index')->with(Session::flash('success','item has been deleted!'));\n }",
"public function destroy(Roles $roles)\n {\n //\n }",
"public function remove_caps_from_roles(): void {\n\t\t$all_capabilities_raw = $this->get_all_capabilities();\n\t\t$all_capabilities = array_values( $all_capabilities_raw );\n\t\t$all_capabilities = array_filter(\n\t\t\t$all_capabilities,\n\t\t\tstatic fn( $value ) => 'read' !== $value\n\t\t);\n\t\t$all_roles = wp_roles();\n\t\t$roles = array_values( (array) $all_roles->role_objects );\n\t\tforeach ( $roles as $role ) {\n\t\t\tif ( $role instanceof WP_Role ) {\n\t\t\t\tforeach ( $all_capabilities as $cap ) {\n\t\t\t\t\t$role->remove_cap( $cap );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Fires when removing the custom capabilities from existing roles.\n\t\t *\n\t\t * Can be used to remove the capabilities from other, custom roles.\n\t\t *\n\t\t * @since 1.0.0\n\t\t *\n\t\t * @param array $all_capabilities List of all post type capabilities, for reference.\n\t\t */\n\t\tdo_action( 'web_stories_remove_capabilities', $all_capabilities );\n\t}",
"function delete_user_role($id,$table){\n $this->db->delete($table, array('user_id' => $id));\n return;\n }",
"function delete_user_role($id,$table){\n $this->db->delete($table, array('user_id' => $id));\n return;\n }",
"public function destroy($id)\n {\n //\n $user = User::where('id',$id)->with('roles')->first();\n foreach($user->roles as $role){\n if ($role['slug'] == 'superadmin') {\n Session::flash('warning', 'Failed! Unable to delete a User');\n return Redirect::back();\n }\n }\n $user->delete();\n Session::flash('message', 'Success! You have deleted a User');\n return Redirect::back();\n }",
"function _muckypup_database_get_roles () {\n\n\t$roles = array ();\n\t$user_roles = user_roles();\n\t\n\tunset ($user_roles[1]); // Deleting anonymous role. By default at index 1.\n\tunset ($user_roles[2]); // Deleting authenticated role. By default at index 2.\n\t\n\tforeach ($user_roles as $rid=>$user_role) {\n\t\t$roles[$rid] = $user_role;\n\t}\n\n\treturn $roles;\n}",
"public function destroy($id)\n {\n $role = Role::find($id);\n $role->syncPermissions([]);\n \n $users = User::whereHas(\"roles\", function($q) use ($id){ $q->where(\"id\", $id); })->get();\n foreach($users as $user){\n $user->removeRole($role->name); \n } \n \n $role->delete();\n \n return redirect()->route('roles.index')\n ->with('success','Role deleted successfully!');\n }",
"public function listRoles($user) {\n return $user->roles;\n }",
"function egsr_deactivation(){\n egsr_add_default_wp_roles();\n}",
"public function forgetRole()\n {\n // if (is_string($role))\n // {\n // $role = Role::whereRoleName($role)->first();\n // }\n $roles = Role::get();\n\n return $this->roles()->detach($roles);\n }",
"function exchange_remove_user_management_for_editors() {\n\t$role = get_role( 'editor' );\n\t$caps = exchange_get_user_caps();\n\tforeach ( $caps as $cap ) {\n\t\t$role->remove_cap( $cap );\n\t}\n}",
"public function actionDeleteRole ()\n\t\t{\n\n\t\t\t$auth = Yii::$app->getAuthManager();\n\t\t\t$role = $auth->getRole(Yii::$app->request->get('id'));\n\t\t\t$auth->remove($role);\n\t\t\t$url = Yii::$app->request->referrer . '#roles';\n\t\t\tYii::$app->response->redirect($url);\n\n\t\t\tYii::$app->end();\n\t\t}",
"public function detachRoles($roles)\n {\n foreach ($roles as $role) {\n $this->detachRole($role);\n }\n }",
"function delete_user_role($id)\n {\n return $this->db->delete('user_role',array('id'=>$id));\n }",
"private function addAllRolesToUser($user)\n {\n $roles = Role::all()->pluck('keyword', 'id')->values();\n\n $user->syncRoles($roles);\n }",
"public function uninstall() {\n\t\t$this->load->model( 'user/user_group' );\n\t\t// access - modify pavomenu edit\n\t\t$this->model_user_user_group->removePermission( $this->user->getId(), 'access', 'extension/module/pavomenu/menu' );\n\t\t$this->model_user_user_group->removePermission( $this->user->getId(), 'modify', 'extension/module/pavomenu/menu' );\n\t\t// END REMOVE USER PERMISSION\n\t}",
"function get_user_roles()\n{\n $roles = get_acl()->getRoles();\n foreach ($roles as $key => $val) {\n $roles[$val] = __(Inflector::humanize($val));\n unset($roles[$key]);\n }\n return $roles;\n}",
"function revokeAllRoles($userName) {\n\n Util::throwExceptionIfNullOrBlank($userName, \"User Name\");\n $encodedUserName = Util::encodeParams($userName);\n $responseObj = new App42Response();\n $objUtil = new Util($this->apiKey, $this->secretKey);\n try {\n\t\t $params = null;\n $headerParams = array();\n $queryParams = array();\n $signParams = $this->populateSignParams();\n $metaHeaders = $this->populateMetaHeaderParams();\n $headerParams = array_merge($signParams, $metaHeaders);\n $signParams['userName'] = $userName;\n $signature = urlencode($objUtil->sign($signParams)); //die();\n $headerParams['signature'] = $signature;\n $contentType = $this->content_type;\n $accept = $this->accept;\n $baseURL = $this->url;\n $baseURL = $baseURL . \"/\" . $encodedUserName . \"/revoke\";\n $response = RestClient::delete($baseURL, $params, null, null, $contentType, $accept, $headerParams);\n $responseObj->setStrResponse($response->getResponse());\n $responseObj->setResponseSuccess(true);\n } catch (App42Exception $e) {\n throw $e;\n } catch (Exception $e) {\n throw new App42Exception($e);\n }\n return $responseObj;\n }",
"public function setRoles($roles = [])\n {\n\n $rolesPermissionsToUpdate = Role::whereIn('name',$roles);\n $rolesPermissionsToDelete = $this->roles()->whereNotIn('role_id',$rolesPermissionsToUpdate->pluck('id')->toArray())->where('user_id',$this->id);\n\n UserRole::whereIn('role_id',$rolesPermissionsToDelete->pluck('id')->toArray())->where('user_id',$this->id)->delete();\n\n $diff = array_intersect($rolesPermissionsToUpdate->pluck('name')->toArray(),$roles);\n\n if (sizeOf($diff) > 0)\n {\n collect($diff)->each(function($roleName) use ($rolesPermissionsToUpdate){\n\n $role = Role::where('name',$roleName)->first();\n\n UserRole::create([\n 'user_id' => $this->id,\n 'role_id' => $role->id\n ]);\n\n });\n }\n\n }",
"public function saveRoles()\n {\n Yii::$app->authManager->revokeAll($this->getId()); \n\n if (is_array($this->roles)) {\n foreach ($this->roles as $roleName) {\n if ($role = Yii::$app->authManager->getRole($roleName)) {\n Yii::$app->authManager->assign($role, $this->getId());\n }\n }\n }\n }",
"public function destroy($id)\n {\n $user = User::findOrFail($id);\n $roles = $user->roles()->get();\n\n foreach($roles as $role){\n $role->users()->detach($id);\n }\n\n $user->delete();\n\n return redirect('users')->with('message', 'Потребитялят бе изтрит!');\n }",
"public function remove_role($role)\n {\n }",
"public function remove_role($role)\n {\n }",
"public function destroy(rbacRoleUser $rbacRoleUser)\n {\n //\n }",
"function urt_deactivate() {\n remove_role( 'urt_secretary' );\n}",
"function pilau_editable_roles( $roles ) {\n\n\t// Only admins should be able to update_core, and only admins can edit admins\n\tif ( ! current_user_can( 'update_core' ) && array_key_exists( 'administrator', $roles ) ) {\n\t\tunset( $roles['administrator'] );\n\t}\n\n\treturn $roles;\n}",
"public function editRoles(array $roles){\n unset($this->roles);\n $connection = new Connection();\n $link = $connection->connect();\n $link->exec(\"DELETE FROM user_has_role WHERE user_id = '$this->id'\");\n $newRoles = new UserRoles;\n foreach ($roles as $role){\n $newRoles[] = new Role('id', $role);\n $link->exec(\"INSERT INTO user_has_role (user_id, role_id) VALUES ('$this->id', '$role')\");\n }\n $this->setRoles($newRoles);\n $connection = null;\n }",
"private function processRolesForUpdate(Request $request, $user)\n\t{\n\t\t/* Detach all existing roles */\n\t\t$old_roles = Util::copyArray($user->roles); /* This is for auditing */\n\t\t$user->roles()->detach();\n\t\n\t\t/* Add new roles */\n\t\t$this->processRoles($request, $user, $old_roles);\n\t}",
"public function detachRole($role);",
"public function revokeUser(Request $request, Role $role)\n {\n if(Auth::user()->can('revoke-role-to-user')){\n if($request->ids){\n $ids = $request->ids;\n foreach ($ids as $id) {\n $user = User::find($id);\n $user->removeRole($role->name);\n ActivityLogger::activity(\"Le collaborateur ID:\".$user->id.'('.$user->name.') a désormais perdu le role id:'.$role->id.'('.$role->name.') donné par l\\'utilisateur ID:'.Auth::id());\n }\n $message = sizeof($ids).' collaborateur(s) révoqué(s) au role '.$role->name.' avec succès';\n }\n else{\n $message = \"Aucune action n'a été effectuée.\";\n }\n // Envoyer un mail à la personne qui a recu le role\n return redirect()->route(\"roles.show\", compact('role'))->with('success',$message);\n }else{\n return back()->with('error',\"Vous n'avez pas ce droit\");\n } \n }",
"public function remove_authorized_users() {\n\t\t$authorized_users = $this->get_authorized_users();\n\n\t\tforeach ( $authorized_users as $user_id ) {\n\t\t\t$this->remove_user_token( $user_id );\n\t\t}\n\n\t\tdelete_option( 'livechat_authorized_users' );\n\t}",
"public function revokeAllPermissions();",
"public function revokeAllPermissions();",
"public function testShouldDeleteRoleToUser()\n {\n $userAdmin = factory(User::class)->create();\n\n $role = Role::where(\"name\", \"admin\")->first();\n $userAdmin->attachRole($role);\n\n $this->actingAs($userAdmin);\n\n $user = factory(User::class)->create();\n\n $updatedRole = (new RemoveUserRoleService())->execute([\n \"userId\" => $user->id,\n \"roleId\" => $role->id,\n ]);\n\n $this->assertTrue(count($updatedRole->roles) < 1);\n }",
"public function testRemoveUserRoleWithEmptyData()\n {\n $this->removeUserRole($this->user->id, [])\n ->assertJsonStructure([\n 'message',\n 'errors' => [\n 'role'\n ]\n ]);\n }",
"public function removeUserRolePermissions(User $user, array $permissions): void\n {\n foreach ($permissions as $permissionName) {\n /** @var RolePermission $permission */\n $permission = RolePermission::query()\n ->where('name', '=', $permissionName)\n ->firstOrFail();\n\n $roles = $user->roles()->whereHas('permissions', function ($query) use ($permission) {\n $query->where('id', '=', $permission->id);\n })->get();\n\n /** @var Role $role */\n foreach ($roles as $role) {\n $role->detachPermission($permission);\n }\n\n $user->clearPermissionCache();\n }\n }",
"function give_bc_1817_cleanup_user_roles( $caps ) {\n\n\tif (\n\t\t! give_has_upgrade_completed( 'v1817_cleanup_user_roles' ) &&\n\t\t! isset( $caps['view_give_payments'] )\n\t) {\n\t\tgive_v1817_process_cleanup_user_roles();\n\t}\n\n\treturn $caps;\n}",
"public function destroy($id)\n {\n $user = User::find($id);\n if($user->id != 1){\n\n if($user->role_id != 4){\n\n $user->role_id = 4;\n $user->save();\n return back()->withSuccess('User Role Has been Removed');\n\n }else{\n return back()->withErrors('The User already in Pending Mode');\n }\n }else{\n return back()->withErrors('Super Admin Undeletable');\n }\n\n\n\n\n }",
"public function roles_destroy($user_id, $role_id)\n {\n $user = User::find($user_id);\n $user->roles()->detach($role_id);\n\n return response()->json([ 'message' => 'Rol del usuario eliminado']);\n }",
"public function testDeleteUserRoles()\n {\n }",
"public function RemoveRole ($roleName = NULL, $idRole = NULL);",
"public function destroy(User $user)\n {\n if (Gate::denies('delete-users')) {\n return redirect()->route('home');\n }\n\n $postGroups = User::where('id_technicien', $user->id_technicien)->get();\n foreach ($postGroups as $postGroup) {\n DB::table('techniciens')->where('id', $postGroup->id)->delete();\n }\n \n Technicien::where('id', $user->id_technicien)->delete();\n \n $user->roles()->detach();\n \n emotify('error', 'Utilisateur supprimé');\n return redirect()->route('admin.users.index');\n }",
"function populate_roles()\n {\n }",
"public function destroy(User $user)\n {\n if(Gate::denies('delete-users')){\n return redirect(route('admin.users.index'));\n }\n $user->roles()->detach();\n\n $user->delete();\n return redirect()->route('admin.users.index');\n }",
"function roleDelete(Role $role);",
"public static function delete_data_for_all_users_in_context(\\context $context) {\n global $DB;\n\n // When we process user deletions and expiries, we always delete from the user context.\n // As a result the cohort role assignments would be deleted, which has a knock-on effect with courses\n // as roles may change and data may be removed earlier than it should be.\n\n $allowedcontextlevels = [\n CONTEXT_SYSTEM,\n CONTEXT_COURSECAT\n ];\n\n if (!in_array($context->contextlevel, $allowedcontextlevels)) {\n return;\n }\n\n $cohortids = $DB->get_fieldset_select('cohort', 'id', 'contextid = :contextid',\n ['contextid' => $context->id]);\n\n // Delete the tool_cohortroles records created in the specific context.\n $DB->delete_records_list('tool_cohortroles', 'cohortid', $cohortids);\n }",
"protected function removeAllUsers() {\n global $DB;\n\n if ($this->mayI(EDIT)) {\n $DB->query(\"TrunCATE TABLE `\".self::$DBTable.\"`;\");\n }\n }",
"public function userRoles()\n {\n return $this->hasMany('userroles');\n }",
"function set_roles( $user_id, $roles ) {\r\n\r\n\t\t}",
"public function testPostDeleteUserPageWithMultipleRoles()\n\t{\n\t\t$this->be($this->user);\n\n\t\t$user = Orchestra\\Model\\User::create(array(\n\t\t\t'email' => '[email protected]',\n\t\t\t'fullname' => 'Mior Muhammad Zaki',\n\t\t\t'password' => '123456',\n\t\t));\n\t\t$user->roles()->sync(array(2, 1));\n\n\t\t$this->assertGreaterThan(0, $user->id);\n\n\t\t$user_id = $user->id;\n\t\t\n\t\t$response = $this->call('orchestra::users@delete', array($user_id));\n\n\t\t$this->assertInstanceOf('Laravel\\Redirect', $response);\n\t\t$this->assertEquals(302, $response->foundation->getStatusCode());\n\t\t$this->assertEquals(handles('orchestra::users'), \n\t\t\t$response->foundation->headers->get('location'));\n\n\t\t$user = Orchestra\\Model\\User::find($user_id);\n\n\t\t$this->assertTrue(is_null($user));\n\t}",
"public function deleteRolesAction(){\n \n $request = $this->getRequest();\n \n if(! isset($request->id)) {\n // TODO Massege (Helper bauen??!)\n $this->_helper->messenger('error', \n Zend_Registry::get('config')->messages->role->invalid);\n return $this->_redirect('/admin/role');\n }\n \n $entity = 'Jbig3\\Entity\\RolesEntity';\n $repositoryFunction = 'findOneById';\n \n $role = $this->em->getRepository($entity)->$repositoryFunction($request->id);\n \n if($role !== null) {\n // TODO Cascade - hier anders gelöst (Kinder vorher manuell löschen)\n if(count($role->rules)) {\n // Masseges\n $this->_helper->messenger('error', \n 'Unable to remove group. Please remove dependencies first (Manual)');\n return $this->_redirect('/admin/role');\n }\n \n $roleName = $role->name;\n \n $this->em->remove($role);\n $this->em->flush();\n \n // TODO Masseges\n $this->_helper->messenger('success', \n sprintf(Zend_Registry::get('config')->messages->role->delete, $roleName));\n return $this->_redirect('/admin/role');\n } else {\n // TODO Masseegs\n $this->_helper->messenger('success', \n Zend_Registry::get('config')->messages->role->invalid);\n return $this->_redirect('/admin/role');\n }\n }",
"public static final function destroy_all_for_all_users()\n {\n }",
"public function deleteUserRole(int $userId): bool;",
"public function detachAllRoles($id)\n {\n return $this->handleAllRoles('detach', $id);\n }",
"public function destroy($id)\n {\n $user = User::find($id); \n $this->authorize('delete', $user);\n $user->delete();\n // Delete the associated roles\n DB::table('role_user')->where('user_id',$id)->delete();\n return redirect('/users')->with('success', 'User Deleted');\n }",
"public function removeRole($id) {\n $where['role'] = $id;\n $existe = $this->db->get_where($this->tables['users'], $where)->row();\n if (!$existe) {\n $this->db->delete($this->tables['role_permissions'], array('role' => $id));\n $this->db->delete($this->tables['roles'], array('id' => $id));\n return true;\n }\n return false;\n \n \n }",
"protected static function boot() {\n parent::boot();\n\n static::deleting(function($user) { // before delete() method call this\n $user->roles()->detach();\n // do the rest of the cleanup...\n });\n }",
"function reset_role( $role ) {\n $default_roles = array(\n 'administrator' => array(\n 'switch_themes' => 1,\n 'edit_themes' => 1,\n 'activate_plugins' => 1,\n 'edit_plugins' => 1,\n 'edit_users' => 1,\n 'edit_files' => 1,\n 'manage_options' => 1,\n 'moderate_comments' => 1,\n 'manage_categories' => 1,\n 'manage_links' => 1,\n 'upload_files' => 1,\n 'import' => 1,\n 'unfiltered_html' => 1,\n 'edit_posts' => 1,\n 'edit_others_posts' => 1,\n 'edit_published_posts' => 1,\n 'publish_posts' => 1,\n 'edit_pages' => 1,\n 'read' => 1,\n 'level_10' => 1,\n 'level_9' => 1,\n 'level_8' => 1,\n 'level_7' => 1,\n 'level_6' => 1,\n 'level_5' => 1,\n 'level_4' => 1,\n 'level_3' => 1,\n 'level_2' => 1,\n 'level_1' => 1,\n 'level_0' => 1,\n 'edit_others_pages' => 1,\n 'edit_published_pages' => 1,\n 'publish_pages' => 1,\n 'delete_pages' => 1,\n 'delete_others_pages' => 1,\n 'delete_published_pages' => 1,\n 'delete_posts' => 1,\n 'delete_others_posts' => 1,\n 'delete_published_posts' => 1,\n 'delete_private_posts' => 1,\n 'edit_private_posts' => 1,\n 'read_private_posts' => 1,\n 'delete_private_pages' => 1,\n 'edit_private_pages' => 1,\n 'read_private_pages' => 1,\n 'delete_users' => 1,\n 'create_users' => 1,\n 'unfiltered_upload' => 1,\n 'edit_dashboard' => 1,\n 'update_plugins' => 1,\n 'delete_plugins' => 1,\n 'install_plugins' => 1,\n 'update_themes' => 1,\n 'install_themes' => 1,\n 'update_core' => 1,\n 'list_users' => 1,\n 'remove_users' => 1,\n 'add_users' => 1,\n 'promote_users' => 1,\n 'edit_theme_options' => 1,\n 'delete_themes' => 1,\n 'export' => 1,\n ),\n \n 'editor' => array(\n 'moderate_comments' => 1,\n 'manage_categories' => 1,\n 'manage_links' => 1,\n 'upload_files' => 1,\n 'unfiltered_html' => 1,\n 'edit_posts' => 1,\n 'edit_others_posts' => 1,\n 'edit_published_posts' => 1,\n 'publish_posts' => 1,\n 'edit_pages' => 1,\n 'read' => 1,\n 'level_7' => 1,\n 'level_6' => 1,\n 'level_5' => 1,\n 'level_4' => 1,\n 'level_3' => 1,\n 'level_2' => 1,\n 'level_1' => 1,\n 'level_0' => 1,\n 'edit_others_pages' => 1,\n 'edit_published_pages' => 1,\n 'publish_pages' => 1,\n 'delete_pages' => 1,\n 'delete_others_pages' => 1,\n 'delete_published_pages' => 1,\n 'delete_posts' => 1,\n 'delete_others_posts' => 1,\n 'delete_published_posts' => 1,\n 'delete_private_posts' => 1,\n 'edit_private_posts' => 1,\n 'read_private_posts' => 1,\n 'delete_private_pages' => 1,\n 'edit_private_pages' => 1,\n 'read_private_pages' => 1,\n ),\n \n 'author' => array(\n 'upload_files' => 1,\n 'edit_posts' => 1,\n 'edit_published_posts' => 1,\n 'publish_posts' => 1,\n 'read' => 1,\n 'level_2' => 1,\n 'level_1' => 1,\n 'level_0' => 1,\n 'delete_posts' => 1,\n 'delete_published_posts' => 1,\n ),\n \n 'contributor' => array(\n 'edit_posts' => 1,\n 'read' => 1,\n 'level_1' => 1,\n 'level_0' => 1,\n 'delete_posts' => 1,\n ),\n \n 'subscriber' => array(\n 'read' => 1,\n 'level_0' => 1,\n ),\n \n 'display_name' => array(\n 'administrator' => 'Administrator',\n 'editor'\t=> 'Editor',\n 'author'\t=> 'Author',\n 'contributor' => 'Contributor',\n 'subscriber'\t=> 'Subscriber',\n ),\n \n );\n \n $role = strtolower( $role );\n \n remove_role( $role );\n \n return add_role( $role, $default_roles['display_name'][$role], $default_roles[$role] );\n}",
"function delete_role ($role_id) {\r\n $conn = db_connect();\r\n $query = \"delete from roles where role_id = '\".$role_id.\"'\";\r\n $result = $conn->query($query);\r\n $query = \"delete from role_priv where role_id = '\".$role_id.\"'\";\r\n $result1 = $conn->query($query);\r\n\r\n // change the users` priv to default\r\n $result2 = $conn->query(\"update users set role_id = '1' where role_id = '\".$role_id.\"'\");\r\n\r\n if (!$result || !$result1 || !$result2) {\r\n throw new Exception(\"Could not connect to the db!\");\r\n } else {\r\n return true;\r\n }\r\n }",
"function delete_role($roleid) {\n $success = true;\n\n// mdl 10149, check if this is the last active admin role\n// if we make the admin role not deletable then this part can go\n \n $systemcontext = get_context_instance(CONTEXT_SYSTEM);\n \n if ($role = get_record('role', 'id', $roleid)) {\n if (record_exists('role_capabilities', 'contextid', $systemcontext->id, 'roleid', $roleid, 'capability', 'moodle/site:doanything')) {\n // deleting an admin role\n $status = false;\n if ($adminroles = get_roles_with_capability('moodle/site:doanything', CAP_ALLOW, $systemcontext)) {\n foreach ($adminroles as $adminrole) {\n if ($adminrole->id != $roleid) {\n // some other admin role\n if (record_exists('role_assignments', 'roleid', $adminrole->id, 'contextid', $systemcontext->id)) {\n // found another admin role with at least 1 user assigned \n $status = true;\n break;\n }\n }\n } \n } \n if ($status !== true) {\n error ('You can not delete this role because there is no other admin roles with users assigned'); \n }\n } \n }\n\n// first unssign all users\n if (!role_unassign($roleid)) {\n debugging(\"Error while unassigning all users from role with ID $roleid!\");\n $success = false;\n }\n\n// cleanup all references to this role, ignore errors\n if ($success) {\n delete_records('role_capabilities', 'roleid', $roleid);\n delete_records('role_allow_assign', 'roleid', $roleid);\n delete_records('role_allow_assign', 'allowassign', $roleid);\n delete_records('role_allow_override', 'roleid', $roleid);\n delete_records('role_allow_override', 'allowoverride', $roleid);\n delete_records('role_names', 'roleid', $roleid);\n }\n\n// finally delete the role itself\n // get this before the name is gone for logging\n $rolename = get_field('role', 'name', 'id', $roleid);\n \n if ($success and !delete_records('role', 'id', $roleid)) {\n debugging(\"Could not delete role record with ID $roleid!\");\n $success = false;\n }\n \n if ($success) {\n add_to_log(SITEID, 'role', 'delete', 'admin/roles/action=delete&roleid='.$roleid, $rolename, '', $USER->id);\n }\n\n return $success;\n}",
"public function editable_roles($roles)\n {\n if (isset($roles['administrator']) && !current_user_can('administrator')) {\n unset($roles['administrator']);\n }\n return $roles;\n }",
"public function remove() {\n\n // Updates DB (data & metadata)\n $this->attributes->removeAll($this->get(\"id\"));\n $this->db->delete(XCMS_Tables::TABLE_USERS, array(\n \"id\" => $this->get(\"id\")\n ));\n\n }",
"public static function RoleDelete($id) {\n $role = Roles::find($id);\n $role->status = 0;\n $role->save(); \n }",
"function roles(){\n\t\t$this->pageauth->setPrivileges('roles');\n\t\t\n\t\t// see if user has delete privileges\n\t\tif (!$this->pageauth->loginHasPrivileges('delete')) :\n\t\t\n\t\t\t$json['error'] = \"You do not have access to add or edit these records\";\n\t\t\techo json_encode($json);\n\t\t\texit();\n\t\t\n\t\telse:\n\t\t\t\n\t\t\t$id = $this->input->post('id');\n\t\t\n\t\t\t$response = $this->platform->post('apadmin/role/delete',array('id'=>$id));\n\t\t\t\n\t\t\tif($response['success']) :\n\t\t\t\t\n\t\t\t\t$json['success'] = $response['success'];\n\t\t\t\techo json_encode($json);\n\t\t\t\t\n\t\t\t\telse:\n\t\t\t\t\n\t\t\t\t$json['error'] = $response['error'];\n\t\t\t\techo json_encode($json);\n\t\t\t\t\n\t\t\tendif;\n\t\tendif;\n\t}",
"public function eliminar($id)\n {\n $empleado = Empleados::find($id);\n \n foreach($empleado->roles as $rol){\n $empleado->roles()->detach($rol);\n }\n\n $empleado->delete();\n\n return redirect()->route('listar.empleados')->with('mensaje', 'Empleado eliminado');\n }"
] | [
"0.77424335",
"0.7733552",
"0.70346934",
"0.7008251",
"0.6859416",
"0.68380576",
"0.67755985",
"0.6739006",
"0.67386967",
"0.67248344",
"0.65176946",
"0.6516138",
"0.64672655",
"0.6457231",
"0.641038",
"0.63459575",
"0.63134104",
"0.631302",
"0.6309296",
"0.63036364",
"0.6298759",
"0.6294585",
"0.6263268",
"0.62534654",
"0.62486726",
"0.62292874",
"0.6212157",
"0.619213",
"0.61852026",
"0.61495703",
"0.61412084",
"0.6130055",
"0.61286193",
"0.61269385",
"0.610351",
"0.60889816",
"0.608596",
"0.6077611",
"0.6077611",
"0.6076617",
"0.606494",
"0.6040807",
"0.6039129",
"0.6038826",
"0.6037109",
"0.60329",
"0.6031697",
"0.6017587",
"0.6004828",
"0.5995417",
"0.5993497",
"0.5989687",
"0.5983326",
"0.59363174",
"0.59359586",
"0.5935708",
"0.59327304",
"0.5928934",
"0.5919431",
"0.5914937",
"0.58966273",
"0.5891198",
"0.5870187",
"0.5862084",
"0.58566135",
"0.5856017",
"0.5849597",
"0.5849597",
"0.58435",
"0.5841566",
"0.5840414",
"0.58370954",
"0.58368796",
"0.5823766",
"0.5806212",
"0.5805798",
"0.57741064",
"0.57712424",
"0.5764465",
"0.5762507",
"0.5760612",
"0.57542926",
"0.5753748",
"0.57522124",
"0.574914",
"0.5735119",
"0.5732848",
"0.5729543",
"0.5708996",
"0.5708671",
"0.57072014",
"0.57024574",
"0.56963813",
"0.5666782",
"0.5661833",
"0.5661101",
"0.5660632",
"0.56537294",
"0.5647891",
"0.56473875"
] | 0.68509376 | 5 |
Run the database seeds. | public function run()
{
$houses = new HousesModel();
$houses->name = 'Ha Noi hotel';
$houses->id_address = 1;
$houses->room = 'khách sạn';
$houses->number_room = '4';
$houses->number_bathroom = '2';
$houses->describe = 'VIP';
$houses->price = 10000000;
$houses->id_kind_house = 1;
$houses->id_user = 1;
$houses->month = 1;
$houses->status = 0;
$houses->save();
$houses = new HousesModel();
$houses->name = 'HCM hotel';
$houses->id_address = 2;
$houses->room = 'khách sạn';
$houses->number_room = '5';
$houses->number_bathroom = '2';
$houses->describe = 'VIP';
$houses->price = 10000000;
$houses->id_kind_house = 1;
$houses->id_user = 1;
$houses->month = 1;
$houses->status = 0;
$houses->save();
$houses = new HousesModel();
$houses->name = "Khách sạn";
$houses->id_address = 3;
$houses->room = 'khách sạn';
$houses->number_room = '3';
$houses->number_bathroom = '2';
$houses->describe = 'VIP';
$houses->price = 5000000;
$houses->id_kind_house = 1;
$houses->id_user = 1;
$houses->month = 1;
$houses->status = 1;
$houses->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 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 |
Finds the path to the file where the class is defined. | public function find($class)
{
$classpath = get_object_vars($this->container->getParameter($this->classpath_key));
krsort($classpath);
$current_md5 = md5(RokCommon_Utils_ArrayHelper::toString($classpath));
if ($this->last_md5 != $current_md5) {
$this->last_md5 = $current_md5;
$found_maps = array();
foreach ($classpath as $priority => $priority_paths) {
foreach ($priority_paths as $path) {
if (!in_array($path, $this->checked_paths)) {
$this->checked_paths[] = $path;
if (is_dir($path)) {
$path = $path . DIRECTORY_SEPARATOR . self::MAP_FILE_DEFAULT_NAME;
}
if (!in_array($path, $this->checked_paths) && is_file($path)) {
if (($path_map = @include($path)) && is_array($path_map)) {
$found_maps[] = $path_map;
} else {
if (defined('ROKCOMMON_CORE_DEBUG') && ROKCOMMON_CORE_DEBUG) {
error_log(sprintf('%s: Unable to load map file %s as a valid class map', get_class($this), $path));
}
}
}
}
}
if (isset($this->maps[$priority]) && !empty($found_maps)) {
$this->maps[$priority] = array_merge($this->maps[$priority], (array)$found_maps);
} elseif (!empty($found_maps)) {
$this->maps[$priority] = (array)$found_maps;
}
}
krsort($this->maps);
}
if ('\\' === $class[0]) {
$class = substr($class, 1);
}
foreach ($this->maps as $priority_maps) {
foreach ($priority_maps as $map) {
if (isset($map[$class])) {
return $map[$class];
}
}
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function findFile($class);",
"public static function getClassPath();",
"public function myFileLocation()\r\n {\r\n $reflection = new ReflectionClass($this);\r\n\r\n return dirname($reflection->getFileName());\r\n }",
"abstract public function getClassPath();",
"public static function getClassPath ()\n\t{\n\n\t\treturn self::$path;\n\t}",
"function getClassPath (string $file): string {\n\treturn _ROOT_PATH.'classes/'.$file.'.php';\n}",
"public static function detectPath(): string\n {\n $oReflect = new \\ReflectionClass(get_called_class());\n return dirname($oReflect->getFileName()) . '/';\n }",
"public function findFile($class)\n {\n if (!function_exists('drupal_get_path')) {\n return;\n }\n $class = ltrim($class, '\\\\');\n\n $expl = explode('\\\\', $class);\n\n // Convert CamelCase to camel_case\n $module = strtolower(preg_replace('/(?<=\\\\w)(?=[A-Z])/', '_$1', reset($expl)));\n\n if (2 === count($expl)) {\n // Locate Foo\\Bar in foo/class/bar.class.inc (for BC purposes)\n foreach (array($module, strtolower(reset($expl))) as $mod) {\n $className = strtolower(end($expl));\n $file =\n DRUPAL_ROOT.\n DIRECTORY_SEPARATOR.\n drupal_get_path('module', $mod).\n DIRECTORY_SEPARATOR.\n 'class'.\n DIRECTORY_SEPARATOR.\n \"{$className}.class.inc\";\n\n if (file_exists($file)) {\n return $file;\n }\n }\n }\n\n if (1 !== count($expl)) {\n // Locate FooBar\\Crux\\Class in foo_bar/FooBar/Crux/Class.php\n $classPath = str_replace('_', DIRECTORY_SEPARATOR, array_pop($expl));\n $file =\n DRUPAL_ROOT.\n DIRECTORY_SEPARATOR.\n drupal_get_path('module', $module).\n DIRECTORY_SEPARATOR.\n implode(DIRECTORY_SEPARATOR, $expl).\n DIRECTORY_SEPARATOR.\n \"{$classPath}.php\"\n ;\n\n if (file_exists($file)) {\n return $file;\n }\n }\n }",
"public static function findFileForClass($class)\n {\n $classManifest = ClassLoader::inst()->getManifest();\n return $classManifest->getItemPath($class);\n }",
"public function findFile($class)\n{\n\tif ('\\\\' == $class[0]) {\n\t\t$class = substr($class, 1);\n\t}\n\n\t// class map lookup\n\tif (isset($this->classMap[$class])) {\n\t\treturn $this->classMap[$class];\n\t}\n\n\t$file = $this->findFileWithExtension($class, '.php');\n\n\t// Search for Hack files if we are running on HHVM\n\tif ($file === null && defined('HHVM_VERSION')) {\n\t\t$file = $this->findFileWithExtension($class, '.hh');\n\t}\n\n\tif ($file === null) {\n\t\t// Remember that this class does not exist.\n\t\treturn $this->classMap[$class] = false;\n\t}\n\n\treturn $file;\n}",
"public function get_usable_full_class_path() {\n\n\t\t$full_path = $this->get_called_class();\n\n\t\treturn strtolower( str_replace( '\\\\', '_', str_replace( '\\\\\\\\', '_', $full_path ) ) );\n\n\t}",
"function getClassFile($className) {\n\tglobal $_CLASS_MANIFEST;\n\tif(($pos = strpos($className,'_')) !== false) $className = substr($className,0,$pos);\n\tif($_CLASS_MANIFEST[$className]) return $_CLASS_MANIFEST[$className];\n}",
"public static function classPath($class)\n {\n if (is_object($class)) {\n $class = get_class($class);\n }\n $file = '';\n try {\n $rc = new \\ReflectionClass($class);\n $file = $rc->getFileName();\n } catch (\\ReflectionException $e) {\n \\Tk\\Log::warning($e->__toString());\n }\n return $file;\n }",
"protected static function find($class)\n\t{\n\t\t$file = str_replace('\\\\', '/', $class);\n\n\t\t$namespace = substr($class, 0, strpos($class, '\\\\'));\n\n\t\t// If the namespace has been detected as a PSR-0 compliant library,\n\t\t// we will load the library according to those naming conventions.\n\t\tif (array_key_exists($namespace, static::$libraries))\n\t\t{\n\t\t\treturn str_replace('_', '/', $file).EXT;\n\t\t}\n\n\t\tforeach (static::$paths as $path)\n\t\t{\n\t\t\tif (file_exists($path = $path.strtolower($file).EXT))\n\t\t\t{\n\t\t\t\treturn $path;\n\t\t\t}\n\t\t}\n\n\t\t// If the file exists according to the PSR-0 naming conventions,\n\t\t// we will add the namespace to the array of libraries and load\n\t\t// the class according to the PSR-0 conventions.\n\t\tif (file_exists($path = str_replace('_', '/', $file).EXT))\n\t\t{\n\t\t\tstatic::$libraries[] = $namespace;\n\n\t\t\treturn $path;\n\t\t}\n\t}",
"public function findFile($class)\n\t{\n\t\tif('\\\\' == $class[0])\n\t\t{\n\t\t\t$class = \\substr($class, 1);\n\t\t}\n\n\t\tif(false !== $pos = \\strrpos($class, '\\\\'))\n\t\t{\n\t\t\t// namespaced class name\n\t\t\t$namespace = \\substr($class, 0, $pos);\n\n\t\t\tforeach($this->namespaces as $ns => $dirs)\n\t\t\t{\n\t\t\t\tif(0 !== \\strpos($namespace, $ns))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tforeach($dirs as $dir)\n\t\t\t\t{\n\t\t\t\t\t$className = \\substr($class, $pos + 1);\n\t\t\t\t\t$file = $dir.\\DIRECTORY_SEPARATOR.\\str_replace('\\\\', \\DIRECTORY_SEPARATOR, $namespace).\\DIRECTORY_SEPARATOR.\\str_replace('_', \\DIRECTORY_SEPARATOR, $className).'.php';\n\n\t\t\t\t\tif(\\file_exists($file))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn $file;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach($this->namespaceFallbacks as $dir)\n\t\t\t{\n\t\t\t\t$file = $dir.\\DIRECTORY_SEPARATOR.\\str_replace('\\\\', \\DIRECTORY_SEPARATOR, $class).'.php';\n\n\t\t\t\tif(\\file_exists($file))\n\t\t\t\t{\n\t\t\t\t\treturn $file;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// PEAR-like class name\n\t\t\tforeach($this->prefixes as $prefix => $dirs)\n\t\t\t{\n\t\t\t\tif(0 !== \\strpos($class, $prefix))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\tforeach($dirs as $dir)\n\t\t\t\t{\n\t\t\t\t\t$file = $dir.\\DIRECTORY_SEPARATOR.\\str_replace('_', \\DIRECTORY_SEPARATOR, $class).'.php';\n\n\t\t\t\t\tif(\\file_exists($file))\n\t\t\t\t\t{\n\t\t\t\t\t\treturn $file;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tforeach($this->prefixFallbacks as $dir)\n\t\t\t{\n\t\t\t\t$file = $dir.\\DIRECTORY_SEPARATOR.\\str_replace('_', \\DIRECTORY_SEPARATOR, $class).'.php';\n\n\t\t\t\tif(\\file_exists($file))\n\t\t\t\t{\n\t\t\t\t\treturn $file;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function findFile($class)\n\t{\n\t\t// work around for PHP 5.3.0 - 5.3.2 https://bugs.php.net/50731\n\t\tif ('\\\\' == $class[0])\n\t\t{\n\t\t\t$class = substr($class, 1);\n\t\t}\n\n\t\t// FEFHelper lookup\n\t\tif (substr($class, 0, 9) == 'FEFHelper')\n\t\t{\n\n\t\t\tif (file_exists($file = realpath(__DIR__ . '/..') . '/Utils/FEFHelper/' . strtolower(substr($class, 9)) . '.php'))\n\t\t\t{\n\t\t\t\treturn $file;\n\t\t\t}\n\t\t}\n\n\t\t// PSR-4 lookup\n\t\t$logicalPath = strtr($class, '\\\\', DIRECTORY_SEPARATOR) . '.php';\n\n\t\t$first = $class[0];\n\n\t\tif (isset($this->prefixLengths[$first]))\n\t\t{\n\t\t\tforeach ($this->prefixLengths[$first] as $prefix => $length)\n\t\t\t{\n\t\t\t\tif (0 === strpos($class, $prefix))\n\t\t\t\t{\n\t\t\t\t\tforeach ($this->prefixDirs[$prefix] as $dir)\n\t\t\t\t\t{\n\t\t\t\t\t\tif (file_exists($file = $dir . DIRECTORY_SEPARATOR . substr($logicalPath, $length)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\treturn $file;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// PSR-4 fallback dirs\n\t\tforeach ($this->fallbackDirs as $dir)\n\t\t{\n\t\t\tif (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPath))\n\t\t\t{\n\t\t\t\treturn $file;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"public function find( &$className ) {\n\t\n\t\tif (empty( self::$paths ))\n\t\t\tthrow new aop_exception( \"path list is empty\" );\n\t\n\t\tforeach( self::$paths as $element ) {\n\t\t\n\t\t\t$liste = explode( PATH_SEPARATOR, $element );\n\t\t\tforeach( $liste as $path ) {\n\t\t\t\n\t\t\t\t// case 1\n\t\t\t\t$p = $path . DIRECTORY_SEPARATOR . $className . '.php';\n\t\t\t\t#echo \"1- Trying path: $p \\n\";\n\t\t\t\tif ( file_exists( $p ) )\n\t\t\t\t\treturn $p;\n\t\t\t\t\t\n\t\t\t\t// case 2\n\t\t\t\t$p = $path . DIRECTORY_SEPARATOR . $className . DIRECTORY_SEPARATOR . $className . '.php';\n\t\t\t\t#echo \"2- Trying path: $p \\n\";\t\t\n\t\t\t\tif ( file_exists( $p ) )\n\t\t\t\t\treturn $p;\n\t\t\t\t\t\n\t\t\t\t// case 3\n\t\t\t\t$bits = explode( \"_\", $className );\n\t\t\t\t$fragment_list = implode( DIRECTORY_SEPARATOR, $bits );\n\t\t\t\t$last_fragment = $bits[ count( $bits ) - 1 ];\n\t\t\t\t$p = $path . DIRECTORY_SEPARATOR . $fragment_list . '.php';\n\t\t\t\t#echo \"3- Trying path: $p \\n\";\t\t\t\n\t\t\t\tif ( file_exists( $p ) )\n\t\t\t\t\treturn $p;\n\t\t\t\t\n\t\t\t\t// case 4\n\t\t\t\t$p = $path . DIRECTORY_SEPARATOR . $fragment_list . DIRECTORY_SEPARATOR.$last_fragment.'.php';\n\t\t\t\t#echo \"4- Trying path: $p \\n\";\t\t\t\n\t\t\t\tif ( file_exists( $p ) )\n\t\t\t\t\treturn $p;\n\t\t\t\t\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn null;\n\t}",
"public function getTestClassPath($className);",
"private function fixturePath($class_file = NULL) {\n if (is_null($class_file)) {\n $class = new \\ReflectionClass(get_called_class());\n $class_file = $class->getFileName();\n }\n\n return dirname($class_file)\n . '/fixtures/'\n . basename($class_file);\n }",
"public static function path()\n {\n return class_basename(get_called_class());\n }",
"public static function get_path_to_class($class_name)\n\t{\n\t\t$class_info = new ReflectionClass($class_name);\n\t\treturn dirname($class_info->getFileName());\n\t}",
"public function findFile($class)\n {\n if (!$this->isFinder) {\n return null;\n }\n\n $file = $this->decorated->findFile($class);\n\n if (is_string($file)) {\n $correctFile = $this->getCorrectFile($file);\n $this->loadedFiles->addFile($correctFile);\n }\n\n return $file;\n }",
"public function getUserClassFileName()\n {\n }",
"public static function getPath\n\t(\n\t\t$class\t\t\t// <str> The name of the class to retrieve the path of\n\t)\t\t\t\t\t// RETURNS <str> Path to the class if found, or \"\" on failure.\n\t\n\t// $classPath = Classes_Meta::getPath($class);\n\t{\n\t\t// Prepare Values\n\t\t$class = Sanitize::variable($class);\n\t\t$slashClass = str_replace(\"_\", \"/\", $class);\n\t\t\n\t\t// Attempt to load an application class\n\t\tif(is_file(APP_PATH . \"/classes/\" . $slashClass . \"/\" . $class . \".config.php\"))\n\t\t{\n\t\t\treturn APP_PATH . \"/classes/\" . $slashClass;\n\t\t}\n\t\t\n\t\t// Attempt to load a core class\n\t\tif(is_file(SYS_PATH . \"/core-classes/\" . $slashClass . \"/\" . $class . \".config.php\"))\n\t\t{\n\t\t\treturn SYS_PATH . \"/core-classes/\" . $slashClass;\n\t\t}\n\t\t\n\t\t// Attempt to load an plugin class\n\t\tif(is_file(SYS_PATH . \"/plugin-classes/\" . $slashClass . \"/\" . $class . \".config.php\"))\n\t\t{\n\t\t\treturn SYS_PATH . \"/plugin-classes/\" . $slashClass;\n\t\t}\n\t\t\n\t\treturn \"\";\n\t}",
"protected function getClassPath() {\r\n\t\t$directories = array();\r\n\t\t$components = preg_split('~(?<=[a-z])(?=[A-Z])~', $this->actionClass);\r\n\t\t\r\n\t\tforeach ($components as $part) {\r\n\t\t\t$directories[] = StringUtil::toLowerCase($part);\r\n\t\t}\r\n\t\t\r\n\t\t$path = WCF_DIR . 'lib/data/' . implode('/', $directories);\r\n\t\treturn FileUtil::addTrailingSlash($path);\r\n\t}",
"public function getClassPath($class)\n {\n $class = strtolower($class);\n\n return isset($this->classes[$class]) ? $this->classes[$class] : null;\n }",
"public function getClassPath($class)\n {\n $class = strtolower($class);\n\n return isset($this->classes[$class]) ? $this->classes[$class] : null;\n }",
"public function getClassLocation()\n {\n return $this->_sClassLocation;\n }",
"public function guessPackagePath()\n\t{\n\t\t$path = with(new \\ReflectionClass($this))->getFileName();\n\n\t\treturn realpath(dirname($path).'/../');\n\t}",
"protected static function find($class)\n\t{\n\t\t// After PHP namespaces were introduced, most libaries ditched underscores for\n\t\t// namespaces to indicate the class directory hierarchy. We will check for the\n\t\t// presence of namespace slashes to determine the directory separator.\n\t\t$separator = (strpos($class, '\\\\') !== false) ? '\\\\' : '_';\n\n\t\t$library = substr($class, 0, strpos($class, $separator));\n\n\t\t$file = str_replace('\\\\', '/', $class);\n\n\t\t// If the namespace has been registered as a PSR-0 compliant library, we will\n\t\t// load the library according to the PSR-0 naming standards, which state that\n\t\t// namespaces and underscores indicate the directory hierarchy of the class.\n\t\tif (isset(static::$libraries[$library]))\n\t\t{\n\t\t\treturn LIBRARY_PATH.str_replace('_', '/', $file).EXT;\n\t\t}\n\n\t\t// Next we will search through the common Laravel paths for the class file.\n\t\t// The Laravel framework path, along with the libraries and models paths\n\t\t// will be searched according to the Laravel class naming standard.\n\t\t$lower = strtolower($file);\n\n\t\tforeach (static::$paths as $path)\n\t\t{\n\t\t\tif (file_exists($path = $path.$lower.EXT))\n\t\t\t{\n\t\t\t\treturn $path;\n\t\t\t}\n\t\t}\n\n\t\t// If we could not find the class file in any of the auto-loaded locations\n\t\t// according to the Laravel naming standard, we will search the libraries\n\t\t// directory for the class according to the PSR-0 naming standard.\n\t\tif (file_exists($path = LIBRARY_PATH.str_replace('_', '/', $file).EXT))\n\t\t{\n\t\t\tstatic::$libraries[] = $library;\n\n\t\t\treturn $path;\n\t\t}\n\n\t\t// Since not all controllers will be resolved by the controller resolver,\n\t\t// we will do a quick check in the controller directory for the class.\n\t\t// For instance, since base controllers would not be resolved by the\n\t\t// controller class, we will need to resolve them here.\n\t\tif (strpos($class, '_Controller') !== false)\n\t\t{\n\t\t\t$controller = str_replace(array('_Controller', '_'), array('', '/'), $class);\n\n\t\t\tif (file_exists($path = strtolower(CONTROLLER_PATH.$controller.EXT)))\n\t\t\t{\n\t\t\t\treturn $path;\n\t\t\t}\n\t\t}\n\t}",
"function getFile($base_dir, $class){\n if (!(strpos($class, '//') !== false)) $class = $class.'\\\\'.$class;\n $relative_class = ($class);\n $file = $base_dir . str_replace('\\\\', '/', $relative_class). '.php';\n return $file;\n }",
"public static function getFilePath()\n\t{\n\t\treturn __FILE__;\n\t}",
"public static function getFilePath()\n\t{\n\t\treturn __FILE__;\n\t}",
"function getInterfacePath (string $file): string {\n\treturn _ROOT_PATH.'classes/interfaces/'.$file.'.php';\n}",
"public function getClassPath($classname)\n {\n return sfSimpleAutoload::getInstance()->getClassPath($classname);\n }",
"function macro_convert_class_name_to_path($class)\n{\n return LC_DIR_CLASSES . str_replace('\\\\', DIRECTORY_SEPARATOR, ltrim($class, '\\\\')) . '.php';\n}",
"public static function getFileLocation()\n {\n $config = Yaml::parseFile(__DIR__.'/../../config.yaml');\n return (isset($config[\"log\"][\"file\"])) ? __DIR__.\"/\".$config[\"log\"][\"file\"] : __DIR__.\"/app.log\";\n }",
"function get_class_name($realName)\n{\n $file_components = explode(\"\\\\\", $realName);\n $to_search = end($file_components);\n return $to_search;\n}",
"function includePath() {\n\t$self = __FILE__;\n\t$lastSlash = strrpos($self, \"/\");\n\treturn substr($self, 0, $lastSlash);\n}",
"public static function get_file_path_for_class( $class_path ) {\n\t\t$file_path = null;\n\t\t$file_prefixes = self::get_file_prefixes();\n\n\t\t// Convert the class path to the file format.\n\t\t$class_path = str_replace( '_', '-', strtolower( $class_path ) );\n\n\t\t// Break the class down into parts.\n\t\t$file_path_array = explode( '\\\\', $class_path );\n\n\t\t// Remove the plugin local namespace.\n\t\tarray_shift( $file_path_array );\n\n\t\t// Determine the file suffix.\n\t\t$file_suffix = array_pop( $file_path_array );\n\n\t\t// Reconstruct the array into the file path.\n\t\t$file_path = implode( '/', $file_path_array );\n\n\t\t// Loop through each of the file prefixes looking for an existing file.\n\t\tforeach ( $file_prefixes as $file_prefix ) {\n\t\t\t$possible_file_path = Plugin_Name::get_plugin_path( $file_path . '/' . $file_prefix . $file_suffix . '.php' );\n\n\t\t\t// Check if the file exists.\n\t\t\tif ( file_exists( $possible_file_path ) ) {\n\t\t\t\t$file_path = $possible_file_path;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $file_path;\n\t}",
"protected function get_dir() {\r\n return dirname( ( new \\ReflectionClass( static::class ) )->getFileName());\r\n }",
"protected function filePath($className) {\n $file = null;\n\n $path = explode('_', $className);\n $namespace = $path[0];\n\n if (isset($this->namespaces[$namespace])) {\n $fileMethod = $this->namespaces[$namespace];\n $file = $this->{$fileMethod}($path);\n }\n\n return $file;\n }",
"function get_class_folder() {\n $path = '';\n\n $split = explode('/', filter_input(INPUT_SERVER, 'PHP_SELF'));\n for ($i = 0; $i < count($split) - 2; $i++)\n if ($split[$i])\n $path .= \"/\" . $split[$i];\n if ($path[0] == '/')\n return substr($path, 1);\n return $path;\n}",
"public function getFoundPath() {}",
"function getSqlPath()\n \t{\n \treturn dirname(__FILE__).'/sql/'.__CLASS__;\n \t}",
"public function myFilename()\r\n {\r\n $reflection = new ReflectionClass($this);\r\n\r\n return $reflection->getFileName();\r\n }",
"protected function getResourceModelFile() : string\n {\n return $this->getResourceModelDirectory(). DIRECTORY_SEPARATOR . $this->data['class_name'] .'.php';\n }",
"protected function determinedFullPath()\n {\n // TODO: See why windows cannot use the the full path\n /*return dirname((new ReflectionClass($this))->getFileName()) .\n DIRECTORY_SEPARATOR .\n '..' .\n DIRECTORY_SEPARATOR .*/\n return $this->getWebRoot() .\n DIRECTORY_SEPARATOR .\n $this->path;\n }",
"public function get_just_class_name() {\n\n\t\t$full_path = $this->get_called_class();\n\n\t\treturn substr( strrchr( $full_path, '\\\\' ), 1 );\n\n\t}",
"function getSqlPath()\n {\n return dirname(__FILE__).'/sql/'.__CLASS__;\n }",
"function getSqlPath()\n {\n return dirname(__FILE__).'/sql/'.__CLASS__;\n }",
"function getSqlPath()\n {\n return dirname(__FILE__).'/sql/'.__CLASS__;\n }",
"function getTraitPath (string $file): string {\n\treturn _ROOT_PATH.'classes/traits/'.$file.'.php';\n}",
"function getClassPath($fullclassname, $class = true)\n{\n\treturn atkClassLoader::getClassPath($fullclassname, $class);\n}",
"function fileWithClass($file, $relativeClassName);",
"public function getSourceFilePath(): string\n {\n $basePath = 'app/DataTransferObjects';\n if ($this->getDir()) {\n $basePath = $basePath.'/'.$this->getDir();\n }\n return base_path($basePath).'/'.$this->name.'.php';\n }",
"public function getClassPath()\n {\n return $this->controllerPath;\n }",
"public static function getFilePath($sFile): ?string\n {\n // Look for the file in the [potential] class hierarchy\n $aClasses = array_filter(\n array_merge(\n [get_called_class()],\n array_values(class_parents(get_called_class()))\n )\n );\n\n foreach ($aClasses as $sClass) {\n $sPath = $sClass::detectPath();\n if (is_file($sPath . $sFile)) {\n return $sPath . $sFile;\n }\n }\n\n return null;\n }",
"public function get_called_class() {\n\n\t\tif ( false !== static::$class_path ) {\n\t\t\treturn static::$class_path;\n\t\t}\n\n\t\t$class_path = get_called_class();\n\t\tstatic::$class_path = $class_path;\n\t\treturn $class_path;\n\n\t}",
"public static function file() {\r\n\t\treturn __FILE__;\r\n\t}",
"protected function get_file() {\n\n\t\treturn __FILE__;\n\t}",
"private static function getChildClassDirectory()\n {\n $className = get_called_class();\n $reflector = new ReflectionClass($className);\n\n return dirname($reflector->getFileName());\n }",
"function f( $dir, $file ) {\n\treturn SMP_PATH . 'includes/classes/' . $dir .'/class-' . $file;\n}",
"public function getPath()\n {\n if (null === $this->reflected) {\n $this->reflected = new \\ReflectionObject($this);\n }\n\n return dirname($this->reflected->getFileName());\n }",
"function autoloaderCurrentFolder($className)\n{\n if (file_exists($className . '.php')) {\n include $className . '.php';\n }\n}",
"public function get_file() {\n\t\treturn __FILE__;\n\t}",
"function readNamePath()\r\n {\r\n $result=$this->className();\r\n\r\n if ($this->readOwner()!=null)\r\n {\r\n $s=$this->readOwner()->readNamePath();\r\n\r\n if ($s!=\"\") $result = $s . \".\" . $result;\r\n\r\n }\r\n\r\n return($result);\r\n }",
"public function findClass($class);",
"protected function getPath($class)\n {\n return '\\\\League\\CLImate\\\\TerminalObject\\\\' . $class;\n }",
"protected function getCurrentAbsolutePath() {\n\t\treturn dirname(SS_ClassLoader::instance()->getManifest()->getItemPath(get_class($this)));\n\t}",
"function macro_check_class_file_path($path)\n{\n macro_check_file_path($path);\n\n if (0 !== strcmp(LC_DIR_CLASSES, $path, strlen(LC_DIR_CLASSES))) {\n macro_error('Path \\'' . $path . '\\' is not LC class repository!!');\n }\n}",
"private function instanceDirectory () : string {\n return dirname((new ReflectionClass(static::class))->getFileName());\n }",
"public function fullPath(){\n if ( strpos( $this->template, DIRECTORY_SEPARATOR ) === 0 ) {\n return $this->template . '.php';\n } else {\n return $this->path . DIRECTORY_SEPARATOR . $this->template . '.php';\n }\n }",
"public function getResourceClass();",
"protected function getClassPath(string $classname): string\n {\n $class_path = $classname . '.php';\n if (!empty(self::$ns_map)) {\n foreach (self::$ns_map as $ns => $path) {\n $lookup_pattern = sprintf('/^%s/', $ns);\n if (preg_match($lookup_pattern, $classname)) {\n $class_path = preg_replace($lookup_pattern, $path, $class_path);\n break;\n }\n }\n }\n\n return realpath(str_replace('\\\\', DIRECTORY_SEPARATOR, $class_path));\n }",
"protected function getDir()\n {\n $reflectionClass = new \\ReflectionClass(get_class($this));\n return dirname($reflectionClass->getFileName());\n }",
"protected function getCurrentAbsolutePath() \n\t{\n\t\t$filename = self::$test_class_manifest->getItemPath(get_parent_class($this));\n\t\tif(!$filename) throw new LogicException(\"getItemPath returned null for \" . get_parent_class($this));\n\t\treturn dirname($filename);\n\t}",
"public function getClass() {\n\t\t$classPath = explode('\\\\', get_class());\n\t\treturn end($classPath);\n\t}",
"public function getClass() {\n\t\t$classPath = explode('\\\\', get_class());\n\t\treturn end($classPath);\n\t}",
"public function className()\n {\n $full_path = explode('\\\\', get_called_class());\n return end($full_path);\n }",
"public static function getFilePath(): string\n {\n return static::getInstance()->getFilePath();\n }",
"private function find_in_namespaces($class)\n\t{\n\t\tif (empty($this->namespaces_dirs)) return false;\n\t\t$pos = strrpos($class, '\\\\');\n\t\tif ($pos!==false)\n\t\t{\n\t\t\t$namespace = substr($class, 0, $pos+1);\n\t\t\t$class_name = str_replace('_', DIRECTORY_SEPARATOR, substr($class, $pos+1));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$class_name = str_replace('_', DIRECTORY_SEPARATOR, $class);\n\t\t\t$pos = strrpos($class_name, DIRECTORY_SEPARATOR);\n\t\t\t$namespace = str_replace(DIRECTORY_SEPARATOR, '\\\\', substr($class_name, 0, $pos+1));\n\t\t\t$class_name = substr($class_name, $pos+1);\n\t\t}\n\t\tif (count($this->namespaces_dirs) > 1)\n\t\t{\n\t\t\tforeach ($this->namespaces_dirs as $ns => $dir)\n\t\t\t{\n\t\t\t\tif (stripos($namespace, $ns)===0)\n\t\t\t\t{\n\t\t\t\t\t$filepath = $this->lookFileInNamespaceDir($namespace, $ns, $class_name, $dir);\n\t\t\t\t\tif (!empty($filepath)) return $filepath;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$dir = $this->namespaces_dirs[''];\n\t\t$filepath = $this->lookFileInNamespaceDir($namespace, '', $class_name, $dir);\n\t\tif (!empty($filepath)) return $filepath;\n\t\treturn false;\n\t}",
"public function getPath()\n {\n return $this->getBasePath() . '/Repositories/' . $this->getClass() . 'RepositoryEloquent.php';\n }",
"public static function find($type, $file)\n\t{\n\t\t$filePath = $type . DIRECTORY_SEPARATOR . $file;\n\t\tforeach (self::$modules as $module => $path) {\n\t\t\tif (\\file_exists($path . $filePath)) {\n\t\t\t\treturn $path . $filePath;\n\t\t\t}\n\t\t}\n\t}",
"protected function getVendorFilePath()\n {\n $reflection = new \\ReflectionClass('Composer\\Autoload\\ClassLoader');\n return $reflection->getFileName();\n }",
"protected function getInstancePath() {}",
"public function getBasePath()\n {\n if ($this->_basePath === null) {\n $class = new \\ReflectionClass($this);\n $this->_basePath = dirname($class->getFileName());\n }\n return $this->_basePath;\n }",
"public static function getPath()\r\n {\r\n if ( ! self::$_path) {\r\n self::$_path = dirname(__FILE__);\r\n }\r\n return self::$_path;\r\n }",
"public function obtainCurrentClass(string $className) : string\n {\n $fileName = '';\n $namespace = '';\n //Check if it is possible to extract the namespace from the class name.\n if (false !== ($lastNsPos = strripos($className, $this->namespaceSeparator))) \n {\n //Extract the namespace\n $namespace = substr($className, 0, $lastNsPos);\n //Extract the real class name.\n $className = substr($className, $lastNsPos + 1);\n //Replace namespace separators with the system's directory separators\n $fileName = str_replace($this->namespaceSeparator, DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;\n }\n $fileName .= $className . $this->fileExtension;\n return $fileName;\n }",
"public static function getLocalPath(): ?string\n {\n //====================================================================//\n // Safety Check => Verify Local Class is Valid\n if (null == self::local()) {\n return null;\n }\n //====================================================================//\n // Create A Reflection Class of Local Class\n $reflector = new ReflectionClass(get_class(self::local()));\n\n //====================================================================//\n // Return Class Local Path\n return dirname((string) $reflector->getFileName());\n }",
"public static function getLookupPath() {\n return self::$lookup_path;\n }",
"public function testFindClassAnnotationFile()\n {\n $file = $this->get('file_locator')->locate('@ExtDirectBundle/Controller/TestController.php');\n $this->assertEquals(\n 'Ext\\DirectBundle\\Controller\\TestController',\n $this->getLoader()->findClass($file)\n );\n }",
"private function getFilePathAndNameFromNamespaceAndClass($paramClassOrInterface)\r\n {\r\n $validClassOrInterface = sanitize_text_field($paramClassOrInterface);\r\n\r\n $className = ltrim($validClassOrInterface, '\\\\');\r\n $filePath = \"\";\r\n $lastNamespacePosition = strripos($className, '\\\\');\r\n // If namespace is used\r\n if ($lastNamespacePosition !== FALSE)\r\n {\r\n // Then separate namespace and class name\r\n $namespace = substr($className, 0, $lastNamespacePosition);\r\n $className = substr($className, $lastNamespacePosition + 1);\r\n $filePath = str_replace('\\\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;\r\n }\r\n\r\n // Check if this is an interface or a class and set specific prefix to it\r\n if(isset($className[0]) && $className[0] == \"i\")\r\n {\r\n // This is an interface (i.e. iNRSModel) - add \"interface.\" prefix to the filename\r\n $fileName = 'interface.'.$className.'.php';\r\n } else\r\n {\r\n // This is a class (i.e. NRSModel) - add \"class.\" prefix to the filename\r\n $fileName = 'class.'.$className.'.php';\r\n }\r\n\r\n // DEBUG\r\n if($this->debugMode == 2)\r\n {\r\n echo \"<br /><br />Org class name: {$validClassOrInterface}\";\r\n echo \"<br />Class name: {$className}<br />\";\r\n echo \"File path and name: {$filePath}{$fileName}\";\r\n }\r\n\r\n return $filePath.$fileName;\r\n }",
"protected static function getPathThisScript() {}",
"function findBootstrapFile() {\n\t$bss = \"vendor/autoload.php\";\n\tforeach( array(__DIR__, getcwd()) as $dir ) {\n\t\t$prevDir = null;\n\t\twhile( $dir !== null and $dir !== $prevDir ) {\n\t\t\tif( file_exists($bsf = \"$dir/$bss\") ) {\n\t\t\t\treturn $bsf;\n\t\t\t}\n\t\t\t$prevDir = $dir;\n\t\t\t$dir = dirname($dir);\n\t\t}\n\t}\n\tthrow new Exception(\"'$bss' not found\");\n}",
"public function getFilepath() {\n\t\treturn $this->directory.$this->fileprefix.'-'.$this->filename.'.'.static::EXTENSION;\n\t}",
"public function lookup($sClassName)\n\t{\n\t\tforeach ($this->_aClassFileMaps as $oClassFileMap) {\n\t\t\t$sPath = $oClassFileMap->lookup($sClassName);\n\t\t\tif (! is_null($sPath)) {\n\t\t\t\treturn $sPath;\n\t\t\t}\n\t\t}\n\n\t\treturn null;\n\t}",
"public function find($class);",
"function getFilename()\n {\n return __FILE__;\n }",
"protected function _findMappingFile($className)\n {\n $fileName = str_replace('\\\\', '.', $className) . $this->_fileExtension;\n \n // Check whether file exists\n foreach ((array) $this->_paths as $path) {\n if (file_exists($path . DIRECTORY_SEPARATOR . $fileName)) {\n return $path . DIRECTORY_SEPARATOR . $fileName;\n }\n }\n\n throw MappingException::mappingFileNotFound($className, $fileName);\n }"
] | [
"0.7509601",
"0.74688923",
"0.739745",
"0.73043525",
"0.72787184",
"0.72032076",
"0.70262086",
"0.7023833",
"0.6967552",
"0.69195265",
"0.67014074",
"0.6699977",
"0.6682627",
"0.66732377",
"0.664041",
"0.6636902",
"0.662658",
"0.662087",
"0.6620328",
"0.658237",
"0.6546706",
"0.65259045",
"0.6513707",
"0.65046936",
"0.6490147",
"0.6479242",
"0.6479242",
"0.6463546",
"0.6403808",
"0.63566035",
"0.6356222",
"0.63327086",
"0.63327086",
"0.6321368",
"0.63119256",
"0.6298516",
"0.6278718",
"0.62683827",
"0.6263322",
"0.62230664",
"0.61931145",
"0.61837995",
"0.61662614",
"0.6165463",
"0.6150635",
"0.6145037",
"0.61363435",
"0.6134623",
"0.6107264",
"0.6083515",
"0.6083515",
"0.6083515",
"0.6081895",
"0.6073621",
"0.6054543",
"0.60437393",
"0.6043126",
"0.6025819",
"0.60189384",
"0.6012163",
"0.6009733",
"0.60051334",
"0.5971189",
"0.5960671",
"0.5956102",
"0.59483904",
"0.59477174",
"0.59381545",
"0.5908166",
"0.59054816",
"0.5894395",
"0.5884695",
"0.58756983",
"0.5864402",
"0.58591014",
"0.5855822",
"0.58485776",
"0.5841554",
"0.5841554",
"0.58251524",
"0.58177847",
"0.57828003",
"0.57798827",
"0.5778025",
"0.576631",
"0.57557595",
"0.5752364",
"0.5751277",
"0.57471246",
"0.5730729",
"0.5713788",
"0.5691239",
"0.5690166",
"0.5676364",
"0.56572306",
"0.56532806",
"0.56501234",
"0.56466204",
"0.5641119",
"0.5640027"
] | 0.5654042 | 95 |
Compile the store id. | protected function getStoreId($id = '')
{
$id .= ':'.$this->getState('filter.search');
//$id .= ':'.$this->getState('filter.access');
//$id .= ':'.$this->getState('filter.state');
$id .= ':'.$this->getState('filter.category_id');
return parent::getStoreId($id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function _getStoreId() {\n $store_id = 1;\n return $store_id;\n }",
"public function getStoreId();",
"public function getStoreId();",
"public function getStoreId();",
"protected function _getStoreId($id = '')\n\t{\n\t\t// Compile the store id.\n\n\t\treturn md5($id);\n\t}",
"protected function getStoreId($id = '')\n\t{\n\t\t// Compile the store id.\n\n\n\t\treturn parent::getStoreId($id);\n\t}",
"public function getStoreId(){\n return $this->_getData(self::STORE_ID);\n }",
"protected function getStoreId($id = '')\n\t{\n\t\t// Compile the store id.\n\n\t\treturn parent::getStoreId($id);\n\t}",
"protected function getStoreId($id = '')\n\t{\n\t\t// Compile the store id.\n\t\treturn md5($id);\n\t}",
"private function generateId() {\n $count = $this->getRowCount($this->tableName) + 1;\n $id = \"ST\" . str_pad($count, 4, '0', STR_PAD_LEFT);\n return $id;\n }",
"public function getStoreId(){\n $this->getStore()->getId();\n }",
"public function compileStoreDat() {}",
"protected function getStoreID() {\n\t\treturn $this->store_id;\n\t}",
"public function getStoreId(){\r\n\t\t$this->store_id = getValue(\"SELECT store_id FROM tbl_car_to_store WHERE car_id = \".$this->car_id.\" AND store_id!=0\");\r\n\t\treturn $this->store_id;\t\r\n\t}",
"protected function _makeId()\n\t{\n\t\treturn JCache::makeId();\n\t}",
"public function getStoreId()\n {\n return $this->getStore()->getId();\n }",
"protected function getStoreId()\n {\n return Mage::app()->getStore(true)->getId();\n }",
"public function getStoreId()\n {\n return $this->store_id;\n }",
"public function getStoreId()\n {\n return $this->store_id;\n }",
"public function getStoreId()\n {\n return $this->store_id;\n }",
"public function getStoreId()\n {\n return $this->store_id;\n }",
"protected function getStoreId($id = '')\n\t{\n\t\t// Compile the store id.\n\t\t$id .= ':' . $this->getState('client_id');\n\t\t$id .= ':' . $this->getState('filter.search');\n\t\t$id .= ':' . $this->getState('filter.state');\n\t\t$id .= ':' . $this->getState('filter.position');\n\t\t$id .= ':' . $this->getState('filter.module');\n\t\t$id .= ':' . $this->getState('filter.menuitem');\n\t\t$id .= ':' . $this->getState('filter.access');\n\t\t$id .= ':' . $this->getState('filter.language');\n\n\t\treturn parent::getStoreId($id);\n\t}",
"public function getStoreId()\n {\n return Mage::app()->getStore()->getId();\n }",
"public function getStoreId()\n\t{\n\t\treturn $this->_storeId;\n\t}",
"function getStoreId($id = '')\n\t{\n\t\t$id\t.= ':'.$this->getState('category.id');\n\n\t\treturn parent::getStoreId($id);\n\t}",
"public function getStoreId() {\r\n return Mage::app()->getStore()->getId();\r\n }",
"public function getStoreId()\n {\n return $this->_storeId;\n }",
"protected function _generateId()\n {\n return str_replace('.', '', microtime(true));\n }",
"public function getDistriStoreId()\n {\n return $this->distri_store_id;\n }",
"function storeIdentifier()\r\n\t{\r\n\t\t$input_def['id'] = 'storeIdentifier';\r\n\t\t$input_def['name'] = 'storeIdentifier';\r\n\t\t$input_def['type'] = 'text';\r\n\t\t$inputValue = '';\r\n\t\tif(isset($_POST[$input_def['name']]) && (wpklikandpay_option::getStoreConfigOption('wpklikandpay_store_mainoption', $input_def['name']) == ''))\r\n\t\t{\r\n\t\t\t$inputValue = wpklikandpay_tools::varSanitizer($_POST[$input_def['name']], '');\r\n\t\t}\r\n\t\telseif(wpklikandpay_option::getStoreConfigOption('wpklikandpay_store_mainoption', $input_def['name']) != '')\r\n\t\t{\r\n\t\t\t$inputValue = wpklikandpay_option::getStoreConfigOption('wpklikandpay_store_mainoption', $input_def['name']);\r\n\t\t}\r\n\t\t$input_def['value'] = $inputValue;\r\n\r\n\t\techo wpklikandpay_form::check_input_type($input_def);\r\n\t}",
"public function getID()\n\t{\n\t\treturn 'ojsxc';\n\t}",
"public function getStoreId()\n {\n $storeId = $this->_getData('store_id');\n if (is_null($storeId)) {\n $storeId = Mage::app()->getStore()->getId();\n }\n return $storeId;\n }",
"protected function getStoreId($id = '')\n\t{\n\t\t// Compile the store id.\n\t\t$id .= ':' . serialize($this->getState('filter.published'));\n\t\t$id .= ':' . $this->getState('filter.access');\n $id .= ':' . $this->getState('filter.featured'); \n\t\t$id\t.= ':' . serialize($this->getState('filter.category_id'));\n\t\t$id .= ':' . $this->getState('filter.category_id.include');\n\t\t$id\t.= ':' . serialize($this->getState('filter.author_id'));\n\t\t$id .= ':' . $this->getState('filter.author_id.include');\n\t\t$id\t.= ':' . serialize($this->getState('filter.author_alias'));\n\t\t$id .= ':' . $this->getState('filter.author_alias.include');\n\t\t$id .= ':' . $this->getState('filter.date_filtering');\n\t\t$id .= ':' . $this->getState('filter.date_field');\n\t\t$id .= ':' . $this->getState('filter.start_date_range');\n\t\t$id .= ':' . $this->getState('filter.end_date_range');\n\t\t$id .= ':' . $this->getState('filter.relative_date');\n\n\t\treturn parent::getStoreId($id);\n\t}",
"public function getStoreId()\n {\n if ($this->hasData('store_id')) {\n return $this->getData('store_id');\n }\n return Mage::app()->getStore()->getId();\n }",
"public function getStoreId() {\n if (!$this->hasStoreId()) {\n $this->setStoreId((int) Mage::app()->getStore(true)->getId());\n }\n\n return (int) $this->_getData('store_id');\n }",
"function gen_id() {\n\t\t$this->id = get_uid();\n\t\t$this->mk_paths($this->id);\n\t}",
"protected function getStoreId($id = '')\r\n {\r\n // Compile the store id.\r\n $id .= ':'.$this->getState('filter.search');\r\n $id .= ':'.serialize($this->getState('filter.access'));\r\n $id .= ':'.$this->getState('filter.published');\r\n $id .= ':'.serialize($this->getState('filter.user_id'));\r\n $id .= ':'.serialize($this->getState('filter.category_id'));\r\n $id .= ':'.serialize($this->getState('filter.tag'));\r\n $id .= ':'.$this->getState('filter.language');\r\n $id .= ':'.$this->getState('filter.product_type');\r\n\r\n return parent::getStoreId($id);\r\n }",
"public function getStoreId()\n {\n // Use mail preview configuration in admin mode\n if (Mage::app()->getStore()->isAdmin()) {\n return Mage::getStoreConfig('mailpreview/admin_settings/preview_store');\n }\n\n return parent::getStoreId();\n }",
"private function _getCurrentStoreId()\n {\n $storeName = Mage::app()->getRequest()->getParam('store');\n\n if (!$storeName) {\n $website = Mage::app()->getRequest()->getParam('website');\n return $this->_getHelper()->getStoreIdByWebsite($website);\n }\n return $this->_getHelper()->getStoreIdByStoreCode($storeName);\n }",
"private function generateId() {\n $this->setId(AgaviToolkit::uniqid(\"ldap_conn_\"));\n }",
"protected function generateId() : string\n {\n return '';\n\n }",
"protected function getStoreId($id = '')\n\t{\n\t\t// Compile the store id.\n\t\t$id .= ':' . $this->getState('filter.search');\n\t\t$id .= ':' . $this->getState('filter.published');\n\n\t\treturn parent::getStoreId($id);\n\t}",
"protected function getStoreId($id = '')\n\t{\n\t\t// Compile the store id.\n\t\t$id .= ':' . $this->getState('filter.search');\n\t\t$id .= ':' . $this->getState('filter.access');\n\t\t$id .= ':' . $this->getState('filter.published');\n\t\t$id .= ':' . $this->getState('filter.category_id');\n\t\t$id .= ':' . $this->getState('filter.manufacturer_id');\n\t\t$id .= ':' . $this->getState('filter.country_id');\n\n\t\treturn parent::getStoreId($id);\n\t}",
"private function make_id () {\n // http://sourceforge.net/projects/phunction/\n return sprintf('%04X%04X%04X', mt_rand(0, 65535), mt_rand(0, 65535), mt_rand(0, 65535));\n }",
"protected function getStoreId($id = '')\r\n\t{\r\n\t\t// Compile the store id.\r\n\t\t$id .= ':' . json_encode($this->getState('search'));\r\n\t\t$id .= ':' . json_encode($this->getState('filter'));\r\n\r\n\t\treturn parent::getStoreId($id);\r\n\t}",
"public function getStoreId(): int\n {\n return (int)$this->options['store_id'];\n }",
"protected function generateId()\n {\n }",
"public function getStoreId() {\n return $this->item->getStoreId();\n }",
"protected function getStoreId($id = '')\n\t{\n\t\t// Compile the store id.\n\t\t$id\t.= ':'.$this->getState('filter.search');\t\t\n\n\t\treturn parent::getStoreId($id);\n\t}",
"private function getStoreCodeById(int $storeId): string\n {\n if (!isset($this->storeIdToCode[$storeId])) {\n $this->storeIdToCode[$storeId] = $this->storeManager->getStore($storeId)->getCode();\n }\n return $this->storeIdToCode[$storeId];\n }",
"protected function getStoreId($id = '')\n\t{\n\t\t// Compile the store id.\n\t\t$id .= ':' . $this->getState('filter.search');\n\t\t$id .= ':' . $this->getState('filter.state');\n\n\t\treturn parent::getStoreId($id);\n\t}",
"protected function getStoreId($id = '') {\n // Compile the store id.\n $id.= ':' . $this->getState('filter.search');\n $id.= ':' . $this->getState('filter.state');\n\n return parent::getStoreId($id);\n }",
"protected function getStoreId($id = '') {\n // Compile the store id.\n $id.= ':' . $this->getState('filter.search');\n $id.= ':' . $this->getState('filter.state');\n\n return parent::getStoreId($id);\n }",
"protected function getStoreId($id = '') {\n // Compile the store id.\n $id.= ':' . $this->getState('filter.search');\n $id.= ':' . $this->getState('filter.state');\n $id.= ':' . $this->getState('filter.ordertype');\n\n return parent::getStoreId($id);\n }",
"protected function getStoreId($id = '')\r\n\t{\r\n\t\t// Compile the store id.\r\n\t\t$id .= ':' . $this->getState('filter.search');\r\n\t\t$id .= ':' . $this->getState('filter.state');\r\n\r\n\t\treturn parent::getStoreId($id);\r\n\t}",
"public function getStoreId()\n {\n return $this->getRequest()->getParam('store_id');\n }",
"public function setStoreId($store);",
"protected function generateId()\n {\n if (empty($this->editorOptions['id'])) {\n $this->editorOptions['id'] = $this->options['id'] . '-editor';\n }\n if (empty($this->containerOptions['id'])) {\n $this->containerOptions['id'] = $this->options['id'] . '-container';\n }\n if (empty($this->headerOptions['id'])) {\n $this->headerOptions['id'] = $this->options['id'] . '-header';\n }\n if (empty($this->footerOptions['id'])) {\n $this->footerOptions['id'] = $this->options['id'] . '-footer';\n }\n if (empty($this->previewOptions['id'])) {\n $this->previewOptions['id'] = $this->options['id'] . '-preview';\n }\n Html::addCssStyle($this->options, 'height:' . $this->height . 'px');\n }",
"public function getTempStoreId() {\n $id = [$this->id()];\n foreach ($this->getContexts() as $context) {\n if ($context instanceof AutomaticContext && $context->isAutomatic()) {\n $id = array_merge($id, $context->getCacheTags());\n }\n }\n return implode(':', $id);\n }",
"public function generateId()\n {\n $session_id = $this->request->param($this->sid_key, '');\n $_session_id = explode('-',$session_id ? xn_decrypt($session_id):'');\n $this->ip = isset($this->request->server['REMOTE_ADDR'])?$this->request->server['REMOTE_ADDR']:'127.0.0.1';\n $this->useragent = isset($this->request->server['USER-AGENT'])? md5($this->request->server['USER-AGENT']):'';\n $this->sid = ($_session_id[2]&&$this->useragent==$_session_id[1]) ? $_session_id[2] : get_uniqid(32);\n $this->sess_key = $_session_id[2]==$this->sid ? $session_id : xn_encrypt(getut().'-'.$this->useragent.'-'.$this->sid.'-'.$this->ip);\n }",
"public function getStoreFrontId();",
"private function computeId(): void\n {\n /** @noinspection JsonEncodingApiUsageInspection */\n $this->id = md5(\n json_encode(\n [\n $this->simulation->id,\n $this->fn,\n $this->useEndpoints,\n $this->usePerturbation,\n collect($this->findByTags)->map(fn($t) => strtolower($t))->sort()->toArray(),\n $this->searchMode\n ]\n )\n );\n }",
"private function retrieveSharedCatalogStoreId()\n {\n $sharedCatalogStoreId = $this->getSharedCatalog()->getStoreId();\n if (!isset($sharedCatalogStoreId)) {\n $sharedCatalogStoreId = $this->request->getParam('store_id');\n }\n\n return (int)$sharedCatalogStoreId;\n }",
"public function generate_archieve_state_wise_id() {\n $result = $this->db2->query(\"SELECT archieve_id FROM `state_wise_summary_all_history` ORDER BY archieve_id DESC LIMIT 0,1\");\n if ($result->num_rows() > 0) {\n $data = $result->row();\n $archieve_id = $data->archieve_id;\n//generate user_id\n $archieve_id = str_pad( ++$archieve_id, 5, '0', STR_PAD_LEFT);\n return $archieve_id;\n } else {\n $archieve_id = 'archieve_1001';\n return $archieve_id;\n }\n }",
"protected function buildId(TokenInterface $token): string\n {\n $id = spl_object_hash($token);\n $listeners = $this->getCacheIdentityListeners();\n\n foreach ($listeners as $listener) {\n $id .= '_'.$listener->getCacheId();\n }\n\n return $id;\n }",
"protected function getStoreId($id = '', $getall = 0)\n\t{\n\t\t// Compile the store id.\n\t\t$id .= ':' . $this->getState('filter.search');\n\t\t$id .= ':' . $this->getState('filter.state');\n\t\t$id .= ':' . $getall;\n\n\t\treturn parent::getStoreId($id);\n\t}",
"function getStoreId($id = '')\n\t{\n\t\t$id\t.= ':'.$this->getState('filter.extension');\n\t\t$id\t.= ':'.$this->getState('filter.published');\n\t\t$id\t.= ':'.$this->getState('filter.access');\n\t\t$id\t.= ':'.$this->getState('filter.parentId');\n\n\t\treturn parent::getStoreId($id);\n\t}",
"public function getCompileId() {\n\t\treturn parent::getCompileId();\n\t}",
"public function setStoreId($id);",
"public function getCipherId() {}",
"public function attach_store(data_store &$store)\n\t{\n\t\t$id = $this->generate_store_identifier($store);\n\t\t$store->set_identifier($id);\n\t\t\n\t\t$this->_attached_stores[$id] = $store;\n\t\treturn $id;\n\t}",
"public function getIdentifier()\n {\n $configID = $this->get_config() ? $this->get_config()->ID : 1;\n return ucfirst($this->get_mode()) . \"Site\" . $configID;\n }",
"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 }",
"public function buildCustomerId($prefix,$customer_id)\n {\n return $prefix.'_ps_'.$customer_id.'_'.date('YmdHis');\n }",
"protected function getId() {\n // Since initializePurgersService() autogenerates the IDs, ours is known.\n return 'id0';\n }",
"public function getShopifyId() {\n return $this->getShopifyProperty('id');\n }",
"static function makeID() {\n return uniqid();\n }",
"protected function _buildIdentifierForList($records)\n {\n $map = array(\n 'Item' => 'i-',\n 'Collection' => 'c-',\n 'File' => 'm-',\n );\n\n $identifiers = array();\n foreach ($records as $record) {\n $identifiers[] = $map[get_class($record)] . $record->id;\n }\n\n $identifier = implode(',', $identifiers);\n\n if (count($identifiers) == 1) {\n $identifier .= ',';\n }\n\n // Simplify the identifier: remove the \"i-\" if there are only items.\n if (strpos($identifier, 'c') === false && strpos($identifier, 'm') === false) {\n $identifier = str_replace('i-', '', $identifier);\n }\n\n return $identifier;\n }",
"public function createCompositeIdentifier()\n {\n $itemId = $this['id'];\n \n return $itemId;\n }",
"public function createCompositeIdentifier()\n {\n $itemId = $this['id'];\n \n return $itemId;\n }",
"public static function generateUniqueIdForCart() {\n return uniqid(\"Cart-\", true);\n }",
"private function generateId()\n {\n $startHex = dechex((int)$this->startTime);\n $uuid = bin2hex(random_bytes(12));\n\n return \"1-{$startHex}-{$uuid}\";\n }",
"protected function generateIdByName(): string\n {\n return \"auto_id_\" . $this->name;\n }",
"private function getCacheId()\n\t{\n\t\treturn self::CACHE_ID_PREFIX . '_' . $this->exportId . '_' . $this->type;\n\t}",
"protected function getStoreId($id = '')\n\t{\n\t\tif (! empty($this->keywords)) {\n\t\t\tforeach ($this->keywords as $keyword) {\n\t\t\t\t$id .= ':' . $this->getState('get.' . $keyword);\n\t\t\t\t$id .= ':' . $this->getState('filter.' . $keyword);\n\t\t\t}\n\t\t}\n\n\t\treturn parent::getStoreId($id);\n\t}",
"public function determineId() {}",
"public static function getId(){\n\t\t\n\t\t$serverName = isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : \"unknown\";\n\t\t\n\t\t//added MD5 because IE doesn't like dots I suspect\n\t\treturn md5(\\GO::config()->id.'AT'.$serverName);\n\t}",
"public function getIdentifier()\n {\n $sellerId = ($this->getSeller()) ? $this->getSeller()->getId() : '';\n\n return $sellerId.$this->getAmount().$this->getCurrency();\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 }",
"public function obtenerId() {}",
"function getStoreId($id = '')\n\t{\n\t\t$id\t.= ':'.$this->getState('filter.search');\n\n\t\treturn parent::getStoreId($id);\n\t}",
"public function getStringId()\n\t{\n\t\treturn 'id_' . $this->getId();\n\t}",
"public function generateSessionIdentifier($store_id = null){\n\n if(is_null($store_id)){\n\n $store = Mage::app()->getStore();\n $store_id = $store->getId();\n }\n $sessionIdentifier = null;\n $cookie = Mage::getModel('core/cookie');\n //session identifier format :favizone_connection_identifier_idStore\n //if(!empty($cookie->get('favizone_connection_identifier_'.$store_id)) != \"\" && !is_null($cookie->get('favizone_connection_identifier_'.$store_id))){\n if($cookie->get('favizone_connection_identifier_'.$store_id)){\n\n $sessionIdentifier = Mage::getModel('core/cookie')->get('favizone_connection_identifier_'.$store_id);\n }\n else{\n\n $sender = Mage::helper('favizone_recommender/sender');\n $data = Mage::helper('favizone_recommender/data');\n $data_to_send = array( \"key\" => $this->getApplicationKey());\n\n $result = $sender->postRequest($data->getRegisterProfiletUrl(), $data_to_send);\n $result = json_decode($result,true);\n if($result['response'] == 'authorized' || $result['response'] == 'success' ){\n\n $cookie->set('favizone_connection_identifier_'.$store_id, $result['identifier'], Favizone_Recommender_Helper_Data::getLifeTime(), '/', null, false, false);\n\n $abTest = $this->getStoreInfo($store_id)->getAbTest();\n $abTest = ($abTest == 'true');\n if(!$abTest){\n\n $cookie->set('favizone_visit_'.$store_id, true, null, '/', null, false, false);\n }\n \n $sessionIdentifier = $result['identifier'];\n }\n }\n return $sessionIdentifier;\n }",
"protected function getStoreId ($id = '')\n\t{\n\t\t$id .= ':' . $this->getState('filter.search');\n\t\t$id .= ':' . $this->getState('filter.state');\n\t\t$id .= ':' . $this->getState('filter.language');\n\n\t\treturn parent::getStoreId($id);\n\t}",
"public function PK() {\n $returnvalue = '';\n $returnvalue .= $this->getDNASequencingRunID();\n return $returnvalue;\n }",
"protected function get_cache_id() {\n\t\treturn wponion_hash_string( $this->module() . '_' . $this->unique() );\n\t}",
"public function obtenerID();",
"public function getcode() {\n\t\t$this -> db -> select('id');\n\t\t$this -> db -> from('store_info');\n\t\t$this -> db -> limit(1);\n\t\t$this -> db -> order_by(\"id\", \"desc\");\n\t\t$query = $this->db->get();\n\t\tif ($query->num_rows() > 0) {\n $row = $query->row();\n\t\t\tif (isset($row)){\n\t\t\t\treturn $row->id;\n\t\t\t}\n }else{\n\t\t\treturn 0;\n\t\t}\n \t}",
"public function getId()\n {\n\n if (isset($this->data[StoreAbstract::ID])) {\n return $this->data[StoreAbstract::ID];\n } else {\n $exceptionClass = $this::EXCEPTION_CLASS;\n throw new $exceptionClass(\n \"ID is not set.\"\n );\n }\n }",
"public function getCurrentCartIdentifier();",
"protected function getStoreId($id = '')\n\t{\n\t\t$id .= ':' . $this->getState('filter.search');\n\t\t$id .= ':' . $this->getState('filter.access');\n\t\t$id .= ':' . $this->getState('filter.state');\n\t\t$id .= ':' . $this->getState('filter.category_id');\n\t\t$id .= ':' . $this->getState('filter.language');\n\n\t\treturn parent::getStoreId($id);\n\t}"
] | [
"0.6626169",
"0.657287",
"0.657287",
"0.657287",
"0.64791393",
"0.63467884",
"0.63437885",
"0.6265582",
"0.61772543",
"0.61418647",
"0.61406773",
"0.61170757",
"0.61020064",
"0.60797566",
"0.6073847",
"0.6021382",
"0.5978879",
"0.5970089",
"0.5970089",
"0.5970089",
"0.5970089",
"0.5873767",
"0.58532906",
"0.5845526",
"0.5833201",
"0.582435",
"0.5796285",
"0.57764953",
"0.57759833",
"0.5774577",
"0.5772832",
"0.5769016",
"0.5737093",
"0.57292706",
"0.5722049",
"0.5710595",
"0.5708061",
"0.5701891",
"0.56976336",
"0.5695694",
"0.5683837",
"0.5673128",
"0.5671689",
"0.56596607",
"0.5657181",
"0.5653593",
"0.56524587",
"0.56523335",
"0.5646907",
"0.56433946",
"0.5629874",
"0.5626851",
"0.5626851",
"0.5602866",
"0.5598983",
"0.558857",
"0.5577344",
"0.55748475",
"0.55583334",
"0.5541975",
"0.5530337",
"0.5527275",
"0.5523612",
"0.5496188",
"0.54722446",
"0.5447861",
"0.54430866",
"0.5432908",
"0.5428888",
"0.54143685",
"0.53934234",
"0.5389098",
"0.53821",
"0.5376386",
"0.53757906",
"0.5375784",
"0.5363122",
"0.53519595",
"0.5350536",
"0.5350536",
"0.534553",
"0.5339073",
"0.53321576",
"0.533183",
"0.5329134",
"0.5311649",
"0.5302334",
"0.52897775",
"0.5275879",
"0.526711",
"0.5263703",
"0.5258519",
"0.5236823",
"0.5236375",
"0.5232088",
"0.52272433",
"0.5221234",
"0.5221226",
"0.5218988",
"0.52162296",
"0.52042675"
] | 0.0 | -1 |
/ $query = ' SELECT a., cc.title AS categorytitle, cc.id AS categoryid, i.title AS imagetitle, i.id AS imageid, ua.name AS editor, u.id AS ratinguserid, u.username AS ratingusername ' . ' FROM __lecturesevents_file_votes AS a ' . ' LEFT JOIN __lecturesevents AS i ON i.id = a.imgid ' . ' LEFT JOIN __lecturesevents_categories AS cc ON cc.id = i.catid ' . ' LEFT JOIN __users AS ua ON ua.id = a.checked_out ' . ' LEFT JOIN __users AS u ON u.id = a.userid' . $where . ' GROUP by a.id' . $orderby; | protected function getListQuery()
{
// Create a new query object.
$db = $this->getDbo();
$query = $db->getQuery(true);
// Select the required fields from the table.
$query->select(
$this->getState(
'list.select',
'a.*'
)
);
$query->from('`#__lecturesevents_file_votes` AS a');
// Join over the language
$query->select('l.title AS language_title');
$query->join('LEFT', '`#__languages` AS l ON l.lang_code = a.language');
// Join over the users for the checked out user.
$query->select('ua.id AS ratinguserid, ua.username AS ratingusername, ua.name AS ratingname');
$query->join('LEFT', '#__users AS ua ON ua.id=a.userid');
$query->select('uc.name AS editor');
$query->join('LEFT', '#__users AS uc ON uc.id=a.checked_out');
$query->select('i.title AS file_title, i.id AS file_id');
$query->join('LEFT', '#__lecturesevents AS i ON i.id = a.fileid');
/* // Join over the asset groups.
$query->select('ag.title AS access_level');
$query->join('LEFT', '#__viewlevels AS ag ON ag.id = a.access');
*/
// Join over the categories.
$query->select('c.title AS category_title, c.id AS category_id');
$query->join('LEFT', '#__lecturesevents_categories AS c ON c.id = i.catid');
// Filter by access level.
/* if ($access = $this->getState('filter.access')) {
$query->where('a.access = '.(int) $access);
}*/
// Filter by published state.
$published = $this->getState('filter.state');
if (is_numeric($published)) {
$query->where('a.published = '.(int) $published);
}
else if ($published === '') {
$query->where('(a.published IN (0, 1))');
}
// Filter by category.
$categoryId = $this->getState('filter.category_id');
if (is_numeric($categoryId)) {
$query->where('i.catid = ' . (int) $categoryId);
}
// Filter by search in title
$search = $this->getState('filter.search');
if (!empty($search))
{
if (stripos($search, 'id:') === 0) {
$query->where('a.id = '.(int) substr($search, 3));
}
else
{
$search = $db->Quote('%'.$db->getEscaped($search, true).'%');
$query->where('( ua.name LIKE '.$search.' OR ua.username LIKE '.$search.')');
}
}
$query->group('a.id');
// Add the list ordering clause.
$orderCol = $this->state->get('list.ordering');
$orderDirn = $this->state->get('list.direction');
if ($orderCol == 'a.ordering' || $orderCol == 'category_title') {
$orderCol = 'category_title '.$orderDirn.', a.ordering';
}
$query->order($db->getEscaped($orderCol.' '.$orderDirn));
//echo nl2br(str_replace('#__','jos_',$query));
return $query;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getallepics()\n {\n //$allepics = \"SELECT * from epics\";\n $allepics= \"SELECT e.*,staff.*,epics_statuses.name as epicsname,team.name as teamname\n FROM epics AS e\n LEFT JOIN epics_statuses AS epics_statuses ON epics_statuses.id = e.e_status_id\n LEFT JOIN team AS team ON team.id = e.team_id\n LEFT JOIN staff AS staff ON staff.staff_id = e.e_owner\"; \n $allepicsresult = $this->ds->select($allepics); \n //print_r($myepicsresult);\n return $allepicsresult;\n }",
"function enquery_view_sql()\n\t{\n\t\t$view_enquery=mysqli_query($this->con,\"SELECT enquery.*,categories.c_name FROM enquery,categories where enquery.c_id=categories.c_id order by enquery.id desc\");\n\t\treturn $view_enquery;\n\t}",
"function join_product_table(){\n global $db;\n $sql =\" SELECT p.id,p.name,p.keywords,p.quantity,p.url,p.buy_price,p.sale_price,p.media_id,p.date,c.name\";\n $sql .=\" AS categorie,m.file_name AS image\";\n $sql .=\" FROM products p\";\n $sql .=\" LEFT JOIN categories c ON c.id = p.categorie_id\";\n $sql .=\" LEFT JOIN media m ON m.id = p.media_id\";\n $sql .=\" ORDER BY p.id ASC\";\n return find_by_sql($sql);\n\n }",
"public function getDetalles()\n {\n $sql = \"select z.id,z.nombre, z.identificacion, z.estado_excluido, y.descripcion, w.categoria , (SELECT a.monto FROM appexamenisw2.categorias a,\n appexamenisw2.beneficios e, appexamenisw2.estudiantes b, appexamenisw2.beneficio__estudiantes c\n where a.descripcion = 'aeo'\n and b.id = c.estudiante_id\n and e.id = c.beneficio_id\n and a.id = e.categoria_id\n and b.id = z.id) as 'aeo' ,\n (SELECT a.monto FROM appexamenisw2.categorias a,\n appexamenisw2.beneficios e, appexamenisw2.estudiantes b, appexamenisw2.beneficio__estudiantes c\n where a.descripcion = 'alim'\n and b.id = c.estudiante_id\n and e.id = c.beneficio_id\n and a.id = e.categoria_id\n and b.id = z.id) as alim,\n (SELECT a.monto FROM appexamenisw2.categorias a,\n appexamenisw2.beneficios e, appexamenisw2.estudiantes b, appexamenisw2.beneficio__estudiantes c\n where a.descripcion = 'pare'\n and b.id = c.estudiante_id\n and e.id = c.beneficio_id\n and a.id = e.categoria_id\n and b.id = z.id) as pare\n from appexamenisw2.estudiantes z, appexamenisw2.beneficios y, appexamenisw2.categorias w,\n appexamenisw2.beneficio__estudiantes v\n where z.id = v.estudiante_id\n and y.id = v.beneficio_id\n and w.id = y.categoria_id\n group by z.id,z.nombre, z.identificacion, z.id, z.estado_excluido, y.descripcion,w.categoria\n order by z.id;\";\n\n $arrayDetalles = DB::connection('mysql')->select($sql);\n $ab = array();\n $ab = $arrayDetalles;\n foreach($ab as $t){\n $t->aeo = Crypt::decrypt($t->aeo);\n $t->alim = Crypt::decrypt($t->alim);\n $t->pare = Crypt::decrypt($t->pare);\n //$t->categoria = Crypt::decrypt($t->categoria);\n //$t->monto = Crypt::decrypt($t->monto);\n //return $t->monto;\n }\n return json_encode($ab);\n }",
"function select_fitness_apk_data() {\n\n global $connection;\n\n $sql = \"SELECT app.description, app.app_name, app.developer, category.name, apk.version, apk.link, apk.size, app_image.link_img, app_image.alt\n FROM app INNER JOIN apk ON app.app_id=apk.app_id INNER JOIN app_image on app_image.app_id=apk.app_id INNER JOIN category on category.cat_id=app.cat_id \n WHERE category.cat_id=2\";\n\n return $connection->query($sql);\n }",
"public function getSql(){\n $group_by = ['user_id'];\n \n // By default we do not perform an additional join for latest bid data\n $get_latest_bid_join = '';\n // The select for latest bid is therefore the same as the avg_bid\n $get_latest_bid_select = 'avg_bid as bid';\n \n if ($this->includeCampaigns) $group_by[] = 'amz_campaign_id';\n if ($this->includeAdGroups) $group_by[] = 'amz_adgroup_id';\n if ($this->includeKeywords) {\n $group_by[] = 'amz_kw_id';\n // This join will get the latest bid data only when amz_kw_ids are included\n // in the aggregate function.\n $get_latest_bid_join = \"\n inner join\n (\n select P.amz_kw_id, P.bid from ppc_keyword_metrics as P\n inner join\n (\n select\n amz_kw_id,\n max(`date`) as latest_date\n from ppc_keyword_metrics\n group by amz_kw_id\n ) as latest_date_inner\n on latest_date_inner.amz_kw_id = P.amz_kw_id and latest_date_inner.latest_date = P.`date`\n ) as latest_bid\n on T.amz_kw_id = latest_bid.amz_kw_id\n \";\n \n $get_latest_bid_join = \"\n inner join\n (\n select P.amz_kw_id, P.bid from ppc_keywords as P\n ) as latest_bid\n on T.amz_kw_id = latest_bid.amz_kw_id\n \";\n \n // The select statement can now be done using the latest bid data\n $get_latest_bid_select = 'latest_bid.bid as bid';\n }\n \n if ($this->includeDate) $group_by[] = '`date`';\n\n $group_by = implode(', ', $group_by);\n\n // Construct the where clause\n $where = [\"user_id = $this->userId\"];\n\n if ($this->startDate != null) $where[] = \"`date` >= '$this->startDate'\";\n if ($this->endDate != null) $where[] = \"`date` <= '$this->endDate'\";\n\n // Filter on campaign ids\n if (count($this->campaignIds) > 0){\n $campaign_ids = implode(', ', $this->campaignIds);\n $where[] = \"amz_campaign_id in ($campaign_ids)\";\n }\n\n // Filter on ad group ids\n if (count($this->adGroupIds) > 0){\n $ad_group_ids = implode(', ', $this->adGroupIds);\n $where[] = \"amz_adgroup_id in ($ad_group_ids)\";\n }\n\n // Filter on keyword ids\n if (count($this->keywordIds) > 0){\n $keyword_ids = implode(', ', $this->keywordIds);\n $where[] = \"amz_kw_id in ($keyword_ids)\";\n }\n\n // Combine all filters into one\n $where = implode(' and ', $where);\n\n // Order by clause\n $orderBy = '';\n if ($this->orderBy) {\n $orderBy = \"order by `$this->orderBy`\";\n if ($this->orderByDesc)\n $orderBy .= \" desc\";\n else\n $orderBy .= \" asc\";\n }\n\n // Included data\n $joins = [];\n if ($this->includeCampaigns) {\n $joins[] = 'campaigns on campaigns.amz_campaign_id = T2.amz_campaign_id';\n }\n if ($this->includeAdGroups) {\n $joins[] = 'ad_groups on ad_groups.amz_adgroup_id = T2.amz_adgroup_id';\n }\n if ($this->includeKeywords) {\n $joins[] = 'ppc_keywords on ppc_keywords.amz_kw_id = T2.amz_kw_id';\n }\n $joins = implode(\"\\ninner join \", $joins);\n if (strlen($joins) > 0) $joins = \"\\ninner join \" . $joins;\n\n return \"\n select *,\n ifnull(cvr, 0) as cvr,\n ifnull(ctr, 0) as ctr,\n ifnull(avg_cpc, 0) as avg_cpc,\n ifnull(acos, 0) as acos,\n ifnull(cvr, 0) as roas,\n \n \n ifnull(concat('$', round(T2.bid, 2)), '-') as bid_formatted,\n ifnull(nullif(round(impressions, 0), 0), '-') as impressions_formatted,\n ifnull(nullif(round(clicks, 0), 0), '-') as clicks_formatted,\n ifnull(nullif(concat('$', round(ad_spend, 2)), '$0.00'), '-') as ad_spend_formatted,\n ifnull(nullif(round(units_sold, 0), 0), '-') as units_sold_formatted,\n ifnull(nullif(concat('$', round(sales, 2)), '$0.00'), '-') as sales_formatted,\n ifnull(nullif(concat(round(cvr * 100, 2), '%'), 0), '-') as cvr_formatted,\n ifnull(nullif(concat(round(ctr * 100, 2), '%'), 0), '-') as ctr_formatted,\n \n concat('$', round(ifnull(ad_spend / units_sold, 0), 2)) as cost_per_unit_sold,\n round(ifnull(clicks / units_sold, 0), 2) as clicks_per_unit_sold,\n\n ifnull(concat('$', round(avg_cpc, 2)), '-') as avg_cpc_formatted,\n ifnull(concat(round(acos * 100, 2), '%'), '-') as acos_formatted,\n ifnull(concat('$', round(roas, 2)), '-') as roas_formatted\n from\n (\n select T.*,\n units_sold/clicks as cvr,\n clicks/impressions as ctr,\n ad_spend/clicks as avg_cpc,\n ad_spend/sales as acos,\n sales/ad_spend as roas,\n $get_latest_bid_select\n from\n (\n select\n $group_by,\n avg(bid) as avg_bid,\n sum(impressions) as impressions,\n sum(clicks) as clicks,\n sum(ad_spend) as ad_spend,\n sum(units_sold) as units_sold,\n sum(sales) as sales\n from ppc_keyword_metrics\n WHERE $where\n group by $group_by\n ) as T\n $get_latest_bid_join\n ) as T2\n $joins\n $orderBy\n \";\n }",
"function gallery_view_sql()\n\t{\n\t\t$view_gallery=mysqli_query($this->con,\"SELECT * FROM gallery where status=1 order by id desc\");\n\t\treturn $view_gallery;\n\t}",
"public function listarAtletas($id,$liga){\n //$sql = \"SELECT `EntrenadoresAthlete`.`id`, `EntrenadoresAthlete`.`coache_id`, `CdeportivoUser`.`athlete_id`, `CdeportivoUser`.`cdeportivo_id`, `CdeportivoUser`.`nivelrendimiento`,`Coache`.`id`, `Coache`.`user_id`, `Coache`.`liga_id`, `Coache`.`disponibilidad`, `Coache`.`descripcion` FROM `sporte`.`entrenadores_athletes` AS `EntrenadoresAthlete` LEFT JOIN `sporte`.`cdeportivo_users` AS `CdeportivoUser` ON (`EntrenadoresAthlete`.`cdeportivo_id` = `CdeportivoUser`.`cdeportivo_id`) LEFT JOIN `sporte`.`athletes` AS `Athlete` ON (`CdeportivoUser`.`athlete_id`=`Athlete`.`id`) LEFT JOIN `sporte`.`coaches` AS `Coache` ON (`EntrenadoresAthlete`.`coache_id` = `Coache`.`id`) WHERE `Coache`.`liga_id`=:em and `Coache`.`user_id`=:enSELECT `EntrenadoresAthlete`.`id`, `EntrenadoresAthlete`.`coache_id`, `CdeportivoUser`.`athlete_id`, `User`.nombre,`User`.apellido, `CdeportivoUser`.`cdeportivo_id`, `CdeportivoUser`.`nivelrendimiento`, `Coache`.`user_id`, `Coache`.`liga_id` FROM `sporte`.`entrenadores_athletes` AS `EntrenadoresAthlete` LEFT JOIN `sporte`.`cdeportivo_users` AS `CdeportivoUser` ON (`EntrenadoresAthlete`.`cdeportivo_id` = `CdeportivoUser`.`cdeportivo_id`) LEFT JOIN `sporte`.`athletes` AS `Athlete` ON (`CdeportivoUser`.`athlete_id`=`Athlete`.`id`) LEFT JOIN `sporte`.`users` AS `User` ON (`Athlete`.`user_id`=`User`.`id`) LEFT JOIN `sporte`.`coaches` AS `Coache` ON (`EntrenadoresAthlete`.`coache_id` = `Coache`.`id`) WHERE `Coache`.`liga_id`= :em and `Coache`.`user_id`= :en\";\n $sql=\"SELECT `EntrenadoresAthlete`.`id`, `EntrenadoresAthlete`.`coache_id`, `CdeportivoUser`.`athlete_id`, `User`.nombre,`User`.apellido, `CdeportivoUser`.`cdeportivo_id`, `CdeportivoUser`.`nivelrendimiento`, `Coache`.`user_id`, `Coache`.`liga_id` FROM `sporte`.`entrenadores_athletes` AS `EntrenadoresAthlete` LEFT JOIN `sporte`.`cdeportivo_users` AS `CdeportivoUser` ON (`EntrenadoresAthlete`.`cdeportivo_id` = `CdeportivoUser`.`cdeportivo_id`) LEFT JOIN `sporte`.`athletes` AS `Athlete` ON (`CdeportivoUser`.`athlete_id`=`Athlete`.`id`) LEFT JOIN `sporte`.`users` AS `User` ON (`Athlete`.`user_id`=`User`.`id`) LEFT JOIN `sporte`.`coaches` AS `Coache` ON (`EntrenadoresAthlete`.`coache_id` = `Coache`.`id`) WHERE `Coache`.`liga_id`= :em and `Coache`.`user_id`= :en\";\n $sentencia = $this->dblink->prepare($sql);\n $sentencia->bindParam(\":em\", $liga);\n $sentencia->bindParam(\":en\", $id);\n $sentencia->execute(); \n return $sentencia->fetchAll(PDO::FETCH_OBJ);\n }",
"function renderUserRatings() {\n $pdo = Database::connect();\n $sql = \"SELECT fd_media.*, fd_categories.category_name, innerquery.* \" .\n \"FROM fd_media, \" .\n \"fd_categories, \" .\n \"(SELECT fd_user_favorites.media_id, fd_user_favorites.rating \" .\n \" FROM fd_user_favorites \" .\n \" WHERE fd_user_favorites.user_id = ?) AS innerquery \" .\n \"WHERE fd_media.id = innerquery.media_id AND fd_media.category_id = fd_categories.id\";\n\n $q = $pdo->prepare($sql);\n $q->execute(array($_SESSION['user_id']));\n\n //render as rows\n foreach($q->fetchAll() as $row) {\n echo \"<tr>\";\n echo \"<td><img style='height: 75px;' src='data:image/jpeg;base64,\" . base64_encode($row['logo']) . \"'></td>\";\n echo \"<td><a href=\\\"fd_showmedia.php?showid=\" . $row['id'] . \"\\\">\" . $row['name'] . \"</a></td>\";\n echo \"<td>\" . $row['category_name'] . \"</td>\";\n echo \"<td>\" . getStars($row['rating']) . \"</td>\";\n echo \"<td>\" . getRatingForShowId($row['id']) . \"</td>\";\n echo \"</tr>\";\n }\n}",
"function getComments($where , $value, $and = NULL)\n{\n global $conn;\n $getComments = $conn->prepare(\"SELECT comments.* , users.username, items.name AS item_name \n FROM comments\n INNER JOIN users ON users.user_id = comments.user_id \n INNER JOIN items ON items.item_id = comments.item_id \n WHERE $where = ? $and\n ORDER BY created_at DESC\");\n $getComments->execute(array($value));\n $comments = $getComments->fetchAll();\n return $comments;\n}",
"function listRestaurants()\n{\nglobal $db;\n $stmt = $db->prepare(\n 'SELECT restaurant.*, AVG(review.rating) AS avg_rating FROM restaurant\n LEFT JOIN review ON review.restaurant_id = restaurant.restaurant_id\n GROUP BY review.restaurant_id\n ORDER BY avg_rating DESC;'\n );\n $stmt->execute();\n return $stmt->fetchAll();\n}",
"function get_equipos_cat($where=null){\n \n if(!is_null($where)){\n $where='WHERE '.$where;\n }else{\n $where='';\n }\n\n $sql=\"select sub4.uni_acad,trim(d.apellido)||', '||trim(d.nombre) as docente_nombre,d.nro_docum,d.legajo,d.fec_nacim,coalesce(d.correo_institucional,'')||' '|| coalesce(d.correo_personal,'') as correo,sub4.id_designacion,sub4.cat_est,sub4.carac,sub4.desde,sub4.hasta,t_mo.descripcion as modulo,carga_horaria,observacion,case when trim(rol)='NE' then 'Aux' else 'Resp' end as rol,p.descripcion as periodo, dep.descripcion as dep,ar.descripcion as area,t_o.descripcion as ori,case when materia_conj is not null then materia_conj else m.desc_materia||'('||pl.cod_carrera||' de '||pl.uni_acad|| ')' end as desc_materia\n from(select sub2.id_designacion,sub2.id_materia,sub2.id_docente,sub2.id_periodo,sub2.modulo,sub2.carga_horaria,sub2.rol,sub2.observacion,cat_est,dedic,carac,desde,hasta,uni_acad,sub2.id_departamento,sub2.id_area,sub2.id_orientacion,string_agg(sub4.materia,'/') as materia_conj \n from (select distinct * from (\n select distinct upper(trim(m.desc_materia)) as desc_materia,a.anio,b.id_designacion,b.id_docente,d.legajo,a.id_periodo,a.modulo,a.carga_horaria,a.rol,a.observacion,a.id_materia,b.uni_acad,cat_estat||dedic as cat_est,dedic,carac,b.desde,b.hasta,b.id_departamento,b.id_area,b.id_orientacion,case when lic.id_novedad is null then 0 else 1 end as licencia\n from asignacion_materia a\n INNER JOIN materia m ON (m.id_materia=a.id_materia)\n INNER JOIN designacion b ON (a.id_designacion=b.id_designacion)\n INNER JOIN docente d ON (b.id_docente=d.id_docente)\n --esto para saber si esta de licencia dentro del periodo y anio en el que esta designado. Entonces con el filtro puedo descartar a los que no estan ejerciendo\n INNER JOIN mocovi_periodo_presupuestario p ON (a.anio=p.anio)\n LEFT OUTER JOIN ( select t_n.*,extract(year from t_n.desde) as anio\n from novedad t_n \n where t_n.tipo_nov in (1,4,2,3,5)\n ) lic ON (lic.id_designacion = a.id_designacion \n and lic.anio=a.anio \n and ((lic.tipo_nov in (2,3,5) and\n ((a.id_periodo=1 and lic.desde<=to_date(cast(p.anio as text)||'-07-01','YYYY-MM-DD')and lic.hasta>=p.fecha_inicio) or\n (a.id_periodo=2 and lic.desde<=p.fecha_fin and lic.hasta>=to_date(cast(p.anio as text)||'-07-01','YYYY-MM-DD')) or\n ((a.id_periodo=3 or a.id_periodo=4) and lic.desde<=p.fecha_fin and lic.hasta>=p.fecha_inicio )\n )\n ) or\n (\n lic.tipo_nov in (1,4) and \n ((a.id_periodo=1 and lic.desde<=to_date(cast(p.anio as text)||'-07-01','YYYY-MM-DD')and lic.desde>=p.fecha_inicio) or\n (a.id_periodo=2 and lic.desde<=p.fecha_fin and lic.desde>=to_date(cast(p.anio as text)||'-07-01','YYYY-MM-DD')) or\n ((a.id_periodo=3 or a.id_periodo=4) and lic.desde<=p.fecha_fin and lic.desde>=p.fecha_inicio )\n )\n ) ) \n )\n where not (b.hasta is not null and b.hasta<=b.desde)\n )sub1\n \".$where.\" ) sub2 \n LEFT OUTER JOIN \n ( select t_c.id_conjunto,t_p.anio,t_c.id_periodo,t_c.ua,t_e.id_materia\n from en_conjunto t_e,conjunto t_c, mocovi_periodo_presupuestario t_p\n WHERE t_e.id_conjunto=t_c.id_conjunto and t_p.id_periodo=t_c.id_periodo_pres \n )sub3 ON (sub3.ua=sub2.uni_acad and sub3.id_periodo=sub2.id_periodo and sub3.anio=sub2.anio and sub3.id_materia=sub2.id_materia)\n LEFT OUTER JOIN \n (select t_e.id_conjunto,t_e.id_materia,t_m.desc_materia||'('||t_p.cod_carrera||' de '||t_p.uni_acad||')' as materia from en_conjunto t_e,materia t_m ,plan_estudio t_p\n where t_e.id_materia=t_m.id_materia\n and t_p.id_plan=t_m.id_plan)sub4 ON sub4.id_conjunto=sub3.id_conjunto\n group by sub2.id_designacion,sub2.id_materia,sub2.id_docente,sub2.id_periodo,sub2.modulo,sub2.carga_horaria,sub2.rol,sub2.observacion,cat_est,dedic,carac,desde,hasta,uni_acad,sub2.id_departamento,sub2.id_area,sub2.id_orientacion)sub4\n LEFT OUTER JOIN docente d ON d.id_docente=sub4.id_docente\n LEFT OUTER JOIN periodo p ON p.id_periodo=sub4.id_periodo\n LEFT OUTER JOIN modulo t_mo ON sub4.modulo=t_mo.id_modulo\n LEFT OUTER JOIN departamento dep ON dep.iddepto=sub4.id_departamento\n LEFT OUTER JOIN area ar ON ar.idarea=sub4.id_area\n LEFT OUTER JOIN orientacion t_o ON (sub4.id_orientacion=t_o.idorient and ar.idarea=t_o.idarea)\n LEFT OUTER JOIN materia m ON m.id_materia=sub4.id_materia\n LEFT OUTER JOIN plan_estudio pl ON pl.id_plan=m.id_plan\n \n order by desc_materia,periodo,modulo,rol\";\n return toba::db('designa')->consultar($sql);\n }",
"public function gettopDbeeusers($limit=2,$dbeeID='',$datefrom='', $dateto='') \n { \n $db = $this->getDbTable();\n $select = $db->select();\n /*$select->distinct('dbee.User')->from( array('dbee' => 'tblDbees'), array('DbeeID'=>'dbee.DbeeID',new Zend_Db_Expr(\"COUNT(dbee.DbeeID) AS total\") ));\n $select->join( array('u' => 'tblUsers'), 'u.UserID=dbee.User', array( 'UserID' => 'u.UserID','username' => 'u.Name','lname' => 'u.lname','image' =>'u.ProfilePic','uname' =>'u.Username') );\n $select->setIntegrityCheck( false ); \n $select->where('u.Status = ?', '1');\n $select->where(\"dbee.clientID = ?\", clientID);\n\n if(!empty($datefrom) && !empty($dateto)){\n $select->where(\"dbee.PostDate >= ?\", date('Y-m-d H:i:s',strtotime($datefrom)));\n $select->where(\"dbee.PostDate <= ?\", date('Y-m-d H:i:s',strtotime($dateto)));\n } \n $select->group ( array (\"dbee.User\") );\n $select->order('total DESC');*/\n\n $select->distinct('act.act_userId')->from( array('act' => 'tblactivity'), array('DbeeID'=>'act.act_userId',new Zend_Db_Expr(\"COUNT(act.act_id) AS total\"), new Zend_Db_Expr(\" sum( case when act_type=1 then 1 else 0 end) as postCount\" ), new Zend_Db_Expr(\" sum( case when act_type=2 then 1 else 0 end) as commentCount\" )));\n $select->join( array('u' => 'tblUsers'), 'u.UserID=act.act_userId', array( 'UserID' => 'u.UserID','username' => 'u.Name','lname' => 'u.lname','image' =>'u.ProfilePic','uname' =>'u.Username') );\n $select->setIntegrityCheck( false ); \n $select->where('u.Status = ?', '1');\n $select->where('u.Role != ?', '1');\n $select->where(\"act.clientID = ?\", clientID);\n $select->where(\"act.act_type = 1 OR act.act_type = 2\" );\n\n /*SELECT DISTINCT `act`.`act_userId` AS `DbeeID`, COUNT(act.act_id) AS total,sum(case when act_type=1 then 1 else 0 end) postCount,sum(case when act_type=2 then 1 else 0 end) commentCount ,`u`.`UserID`, `u`.`Name` AS `username`, `u`.`lname`, `u`.`ProfilePic` AS `image`, `u`.`Username` AS `uname` FROM `tblactivity` AS `act` INNER JOIN `tblUsers` AS `u` ON u.UserID=act.act_userId WHERE (u.Status = '1') AND (u.Role != '1') AND (act.clientID = '1') AND (act.act_type = 1 OR act.act_type = 2) GROUP BY `act`.`act_userId` ORDER BY `total` DESC*/\n\n if(!empty($datefrom) && !empty($dateto)){\n $select->where(\"act.act_date >= ?\", date('Y-m-d H:i:s',strtotime($datefrom)));\n $select->where(\"act.act_date <= ?\", date('Y-m-d H:i:s',strtotime($dateto)));\n } \n $select->group ( array (\"act.act_userId\") );\n $select->order('total DESC');\n if($limit!='all')\n $select->LIMIT($limit, 0);\n //echo $select; exit;\n $result= $db->fetchAll($select); \n return $result; \n }",
"function getByAlarmData(){\n $query = \"SELECT\n a.gebruikerId, a.alarmdataId, ad.soortAlarmId as alarmData_soortAlarmId, ad.vinificatieId as alarmData_vinificatieId, ad.minimumwaarde as alarmData_minimumwaarde, ad.maximumwaarde as alarmData_maximumwaarde, ad.actief as alarmData_actief, \n v.vatId as alarmData_vinificatie_vatId, v.persmethodeId as alarmData_vinificatie_persmethodeId, v.persHoeveelheid as alarmData_vinificatie_persHoeveelheid, v.oogst as alarmData_vinificatie_oogst, v.persDruk as alarmData_vinificatie_persDruk, v.actief as alarmData_vinificatie_actief\n \n \n FROM\n \" . $this->table_name . \" a\n LEFT JOIN\n Alarmdata ad\n ON a.alarmdataId = ad.id\n LEFT JOIN\n Vinificatie v\n ON ad.vinificatieId = v.id\n \n WHERE\n a.gebruikerId = ?\n \n GROUP BY\n v.vatId\n \";\n\n // prepare query statement\n $stmt = $this->conn->prepare( $query );\n\n\n $stmt->bindParam(1, $this->gebruikerId);\n\n // execute query\n $stmt->execute();\n\n return $stmt;\n\n\n }",
"public function read(){\n //create query\n $query = 'SELECT\n c.category_name as category_name,\n l.language_name as language_name,\n i.name as instructor_name,\n p.id,\n p.title,\n p.category_id,\n p.description,\n p.language_medium_id,\n p.image,\n p.instructor_id,\n p.created_at\n \n \n FROM\n ' .$this->table . ' p\n LEFT JOIN course_categories c ON p.category_id = c.id \n LEFT JOIN users i ON p.instructor_id = i.id \n LEFT JOIN language_mediums l ON p.language_medium_id = l.id\n ORDER BY p.created_at DESC'; \n \n\n //prepare statement\n $stmt = $this->conn->prepare($query);\n //execute query\n $stmt->execute();\n\n return $stmt;\n\n }",
"function getStatsCategories(){\r\n global $conn;\r\n $select = \"SELECT AVG(aprice) as aprice, AVG(aqa) as aqa, AVG(aqs) as aqs FROM (SELECT AVG(price) as aprice, AVG(quantityavailable) as aqa, AVG(quantitysold) as aqs FROM product AS T1 GROUP BY category) AS T2;\";\r\n $result = mysqli_query($conn, $select);\r\n return $result;\r\n}",
"function queryRicercaTuttiGliUtenti(){\r\n \r\n $sql = 'SELECT email_utente, nickname, utente_esperto, utente_seguito, utente_seguace, path_img_profilo, data_ora_richiesta, ' .\r\n 'richiesta_accettata, data_ora_risposta ' . \r\n 'FROM (utente NATURAL JOIN info_utente ) LEFT OUTER JOIN seguaci_seguiti ' . \r\n 'ON email_utente = utente_seguito AND utente_seguace =' . \r\n \"'\" . $_SESSION['email_utente'] . \"'\" ;\r\n \r\n return $sql;\r\n}",
"function getRest(){\n $query = \"SELECT\n a.gebruikerId, a.alarmdataId, ad.soortAlarmId as alarmData_soortAlarmId, ad.vinificatieId as alarmData_vinificatieId, ad.minimumwaarde as alarmData_minimumwaarde, ad.maximumwaarde as alarmData_maximumwaarde, ad.actief as alarmData_actief, \n v.vatId as alarmData_vinificatie_vatId, v.persmethodeId as alarmData_vinificatie_persmethodeId, v.persHoeveelheid as alarmData_vinificatie_persHoeveelheid, v.oogst as alarmData_vinificatie_oogst, v.persDruk as alarmData_vinificatie_persDruk, v.actief as alarmData_vinificatie_actief\n \n \n FROM\n \" . $this->table_name . \" a\n LEFT JOIN\n Alarmdata ad\n ON a.alarmdataId = ad.id\n LEFT JOIN\n Vinificatie v\n ON ad.vinificatieId = v.id\n \n WHERE \n a.gebruikerId = ? AND v.actief = 1 \n \n \n \n GROUP BY\n v.vatId\n \";\n\n // prepare query statement\n $stmt = $this->conn->prepare( $query );\n\n\n $stmt->bindParam(1, $this->gebruikerId);\n\n // execute query\n $stmt->execute();\n\n return $stmt;\n\n\n }",
"public static function frontCategoryNews(){\n $odisha_category_id = \\Config::get('constants.ODISHA_CATEGORY_ID');\n $query = \"SELECT b.id,b.name,b.slug,b.tags,b.featured_image,b.short_description,b.cat_id,b.file_path,b.approved_date AS approved_date,\n b.position,c.name AS categoryname,b.is_video,b.is_image,b.file_path,c.slug AS categoryslug,d.name AS username, b.journalist_name\n FROM\n (SELECT a.cat_id AS catid, MAX(a.approved_date) AS appdate FROM news a \n WHERE a.is_hot=1 AND a.is_approved=1 AND a.is_featured=0 AND a.is_top_story=0 AND a.is_archive=0 AND a.is_enable=1 AND a.is_trash=0 AND a.is_trash=0\n AND a.cat_id != $odisha_category_id GROUP BY a.cat_id) AS x \n INNER JOIN news b ON x.catid=b.cat_id AND x.appdate=b.approved_date\n LEFT JOIN news_categories c ON b.cat_id=c.id\n LEFT JOIN users d ON b.user_id=d.id\n WHERE c.is_active=1\n GROUP BY b.cat_id\n ORDER BY c.order ASC\";\n // ORDER BY b.cat_id ASC,b.position ASC,c.order ASC\";\n $categoryNews = DB::select(DB::raw($query));\n return $categoryNews; \n }",
"function gallery_view_sql()\n\t{\n\t\t$view_gallery=mysqli_query($this->con,\"SELECT * FROM gallery order by id desc\");\n\t\treturn $view_gallery;\n\t}",
"function review_list($aprove){\n\t\t$query = $this->db->select(\"dbo.zItemInventoryDetailAll.ProductName,dbo.customer_rating.*,dbo.customer_user.FirstName,dbo.customer_user.MiddleName,dbo.customer_user.LastName,(SELECT COUNT(*) from [dbo].[review_help] where [dbo].[review_help].[review_id] = [dbo].[customer_rating].[ID]) as total, (SELECT COUNT(*) from [dbo].[review_help] where [dbo].[review_help].[review_id] = [dbo].[customer_rating].[ID] AND [dbo].[review_help].[action] = 'Yes') as totalhelp\")\n\t\t\t\t->from(\"dbo.customer_rating\")\n\t\t\t\t->join(\"dbo.customer_user\",\"dbo.customer_user.ID=dbo.customer_rating.customer_id\")\n\t\t\t\t->join(\"dbo.zItemInventoryDetailAll\",\"dbo.zItemInventoryDetailAll.ListID=dbo.customer_rating.product_id\")\n\t\t\t\t->where(\"dbo.customer_rating.admin_status\",$aprove)\n\t\t\t\t->order_by(\"dbo.customer_rating.created\",\"ASC\")\n\t\t\t\t->get()->result();\n\t\treturn $query;\n\t}",
"public function retornaAnuncioPorId($idAnuncio){\n\n #deu certinho com a adição da subcategoria e categoria no innerJoin\n $sql = \"SELECT Anuncio.anuncio_id,Anuncio.anuncio_descricao,Anuncio.anuncio_media,Anuncio.anuncio_pacote,Anuncio.anuncio_status,Anuncio.anuncio_titulo,Anuncio.anuncio_email,Anuncio.anuncio_tel_fixo,Anuncio.anuncio_tel_cel,Anuncio.anuncio_whats,Anuncio.anuncio_categoria,Anuncio.anuncio_breve_descricao,Anuncio.anuncio_imagem_capa,Forma_pagamento.*,Link.*,Endereco.*,Horario_funcionamento.*,Cont_views.cont_views_anuncio_ref,Cont_views.cont_views_qtd_total,Plano_saude.*,Facilidades.*,Sub_categoria.sub_categoria_descricao,Sub_categoria.sub_categoria_cat_ref,Status_anuncio.*,Categoria.tipo_categoria_descricao FROM Anuncio\n INNER JOIN Forma_pagamento ON Anuncio.anuncio_id = Forma_pagamento.forma_pag_anuncio_ref\n INNER JOIN Link ON Anuncio.anuncio_id = Link.link_anuncio_ref\n INNER JOIN Endereco ON Anuncio.anuncio_endereco = Endereco.endereco_id\n INNER JOIN Horario_funcionamento ON Anuncio.anuncio_id = Horario_funcionamento.horario_func_anuncio_ref\n INNER JOIN Cont_views ON Anuncio.anuncio_id = Cont_views.cont_views_anuncio_ref\n INNER JOIN Plano_saude ON Anuncio.anuncio_id = Plano_saude.plano_saude_anuncio_ref\n INNER JOIN Facilidades ON Anuncio.anuncio_id = Facilidades.facilidades_anuncio_ref\n INNER JOIN Sub_categoria ON Anuncio.anuncio_categoria = Sub_categoria.sub_categoria_id\n INNER JOIN Status_anuncio ON Anuncio.anuncio_status = Status_anuncio.status_anuncio_id\n INNER JOIN Categoria ON Sub_categoria.sub_categoria_cat_ref = Categoria.tipo_categoria_id\n WHERE Anuncio.anuncio_id = {$idAnuncio} AND Anuncio.anuncio_excluido = 0 ORDER BY Anuncio.anuncio_titulo ASC, Anuncio.anuncio_id ASC;\";\n\n\t\t\n if($row = $this->runSelect($sql)){\n return $row;\n } else {\n return \"não foi possível retornar a consulta de anuncio por id\";\n }\n\n }",
"function newsItem_BacaDataListing_ByKategori_Hotspot_All( $tbl_news , $idkategori ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE idkategori = '$idkategori' AND hotspot != '0' ORDER BY urutan DESC, timeunix DESC \");\n\treturn $sql;\n}",
"function getListQuery()\n\t{\n\t\tglobal $jlistConfig; \n \n // Create a new query object.\n\t\t$db = $this->getDbo();\n\t\t$query = $db->getQuery(true);\n $user = JFactory::getUser();\n $groups = implode (',', $user->getAuthorisedViewLevels());\n \n\t\t// Select the required fields from the table.\n\t\t$query->select(\n\t\t\t$this->getState(\n\t\t\t\t'list.select',\n\t\t\t\t'a.file_id, a.file_title, a.file_alias, a.description, a.description_long, a.file_pic, a.images, a.price, a.release, a.file_language, a.system, '.\n 'a.license, a.url_license, a.license_agree, a.size, a.date_added, a.file_date, a.publish_from, a.publish_to, a.use_timeframe, a.url_download, a.preview_filename, '.\n 'a.other_file_id, a.md5_value, a.sha1_value, a.extern_file, a.extern_site, a.mirror_1, a.mirror_2, a.extern_site_mirror_1, a.extern_site_mirror_2, '.\n 'a.url_home, a.author, a.url_author, a.created_id, a.created_mail, a.modified_id, a.modified_date, a.submitted_by, a.set_aup_points, a.downloads, '.\n 'a.cat_id, a.changelog, a.password, a.password_md5, a.views, a.metakey, a.metadesc, a.robots, a.update_active, a.custom_field_1, '.\n 'a.custom_field_2, a.custom_field_3, a.custom_field_4, a.custom_field_5, a.custom_field_6, a.custom_field_7, a.custom_field_8, a.custom_field_9, '.\n 'a.custom_field_10, a.custom_field_11, a.custom_field_12, a.custom_field_13, a.custom_field_14, a.access, a.language, a.ordering, a.featured, '. \n 'a.published, a.checked_out, a.checked_out_time, ' .\n\t\t\t\t// use date_added if modified_date is 0\n // 'CASE WHEN a.modified_date = 0 THEN a.date_added ELSE a.modified_date END as modified, ' .\n 'a.modified_date as modified, ' .\n \t\t\t\t'a.modified_id,' .\n\t\t\t\t// use date_added if publish_from is 0\n\t\t\t\t'CASE WHEN a.publish_from = 0 THEN a.date_added ELSE a.publish_from END as publish_from,' .\n\t\t\t\t\t'a.publish_to, a.images, a.metakey, a.metadesc, a.access, ' .\n\t\t\t\t\t'a.downloads,'.' '.$query->length('a.description_long').' AS readmore'\n\t\t\t)\n\t\t);\n\n\t\t// Process an Archived Download layout\n\t\tif ($this->getState('filter.published') == 2) {\n\t\t\t// If badcats is not null, this means that the download is inside an archived category\n\t\t\t// In this case, the state is set to 2 to indicate Archived (even if the download state is Published)\n\t\t\t$query->select($this->getState('list.select', 'CASE WHEN badcats.id is null THEN a.published ELSE 2 END AS state'));\n\t\t}\n\t\telse {\n\t\t\t// Process non-archived layout\n\t\t\t// If badcats is not null, this means that the download is inside an unpublished category\n\t\t\t// In this case, the state is set to 0 to indicate Unpublished (even if the download state is Published)\n\t\t\t$query->select($this->getState('list.select', 'CASE WHEN badcats.id is not null THEN 0 ELSE a.published END AS state'));\n\t\t}\n\n\t\t$query->from('#__jdownloads_files AS a');\n \n // Join on files table.\n $query->select('aa.url_download AS filename_from_other_download');\n $query->join('LEFT', '#__jdownloads_files AS aa on aa.file_id = a.other_file_id'); \n\n\t\t// Join over the categories.\n\t\t$query->select('c.title AS category_title, c.access AS category_access, c.alias AS category_alias, c.cat_dir AS category_cat_dir, c.cat_dir_parent AS category_cat_dir_parent');\n\t\t$query->join('LEFT', '#__jdownloads_categories AS c ON c.id = a.cat_id');\n \n\t\t$query->join('LEFT', '#__users AS ua ON ua.id = a.created_id');\n\t\t$query->join('LEFT', '#__users AS uam ON uam.id = a.modified_id');\n\n // Join on user table.\n if ($jlistConfig['use.real.user.name.in.frontend']){\n $query->select('u.name AS creator');\n } else {\n $query->select('u.username AS creator');\n } \n $query->join('LEFT', '#__users AS u on u.id = a.created_id');\n \n if ($jlistConfig['use.real.user.name.in.frontend']){\n $query->select('u2.name AS modifier');\n } else {\n $query->select('u2.username AS modifier');\n } \n $query->join('LEFT', '#__users AS u2 on u2.id = a.modified_id'); \n \n // Join on license table.\n $query->select('l.title AS license_title, l.url AS license_url, l.description AS license_text, l.id as lid');\n $query->join('LEFT', '#__jdownloads_licenses AS l on l.id = a.license');\n \n // Join on ratings table.\n $query->select('ROUND(r.rating_sum / r.rating_count, 0) AS rating, r.rating_count as rating_count, r.rating_sum as rating_sum');\n $query->join('LEFT', '#__jdownloads_ratings AS r on r.file_id = a.file_id'); \n \n\t\t// Join over the categories to get parent category titles\n\t\t$query->select('parent.title as parent_title, parent.id as parent_id, parent.alias as parent_alias');\n\t\t$query->join('LEFT', '#__jdownloads_categories as parent ON parent.id = c.parent_id');\n \n // Join on menu table. We need the single download menu itemid when exist \n $query->select('menuf.id AS menuf_itemid');\n $query->join('LEFT', '(SELECT id, link, access, published from #__menu GROUP BY link) AS menuf on menuf.link LIKE CONCAT(\\'index.php?option=com_jdownloads&view=download&id=\\',a.file_id) AND menuf.published = 1 AND menuf.access IN ('.$groups.')') ;\n\n\t\t// Join to check for category published state in parent categories up the tree\n\t\t$query->select('c.published, CASE WHEN badcats.id is null THEN c.published ELSE 0 END AS parents_published');\n\t\t$subquery = 'SELECT cat.id as id FROM #__jdownloads_categories AS cat JOIN #__jdownloads_categories AS parent ';\n\t\t$subquery .= 'ON cat.lft BETWEEN parent.lft AND parent.rgt ';\n\t\t// Find any up-path categories that are not published\n\t\t// If all categories are published, badcats.id will be null, and we just use the download state\n\t\t$subquery .= ' AND parent.published != 1 GROUP BY cat.id ';\n\t\t// Select state to unpublished if up-path category is unpublished\n\t\t$publishedWhere = 'CASE WHEN badcats.id is null THEN a.published ELSE 0 END';\n \n\t\t$query->join('LEFT OUTER', '(' . $subquery . ') AS badcats ON badcats.id = c.id');\n\n\t\t// Filter by user id\n $query->where('a.created_id = '.$db->Quote($user->id)); \n \n // Filter by access level.\n\t\tif ($access = $this->getState('filter.access')) {\n\t\t\t$query->where('a.access IN ('.$groups.')');\n\t\t\t$query->where('c.access IN ('.$groups.')');\n\t\t}\n\n\t\t// Filter by published state\n\t\t$published = $this->getState('filter.published');\n\n\t\tif (is_numeric($published)) {\n\t\t\t// Use download state if badcats.id is null, otherwise, force 0 for unpublished\n\t\t\t$query->where($publishedWhere . ' = ' . (int) $published);\n\t\t}\n\t\telseif (is_array($published)) {\n\t\t\tArrayHelper::toInteger($published);\n\t\t\t$published = implode(',', $published);\n\t\t\t// Use download state if badcats.id is null, otherwise, force 0 for unpublished\n\t\t\t$query->where($publishedWhere . ' IN ('.$published.')');\n\t\t}\n \n // Filter by a single category\n $categoryId = $this->getState('filter.category_id');\n\n if (is_numeric($categoryId)) {\n $type = $this->getState('filter.category_id.include', true) ? '= ' : '<> ';\n\n $categoryEquals = 'a.cat_id '.$type.(int) $categoryId;\n $query->where($categoryEquals);\n } else { \n if (is_array($categoryId) && (count($categoryId) > 0)) {\n ArrayHelper::toInteger($categoryId);\n $categoryId = implode(',', $categoryId);\n if (!empty($categoryId)) {\n $type = $this->getState('filter.category_id.include', true) ? 'IN' : 'NOT IN';\n $query->where('a.cat_id '.$type.' ('.$categoryId.')');\n }\n } \n } \n\n\t\t// Filter by author\n\t\t$authorId = $this->getState('filter.author_id');\n\t\t$authorWhere = '';\n\n\t\tif (is_numeric($authorId)) {\n\t\t\t$type = $this->getState('filter.author_id.include', true) ? '= ' : '<> ';\n\t\t\t$authorWhere = 'a.created_id '.$type.(int) $authorId;\n\t\t}\n\t\telseif (is_array($authorId)) {\n\t\t\tArrayHelper::toInteger($authorId);\n\t\t\t$authorId = implode(',', $authorId);\n\n\t\t\tif ($authorId) {\n\t\t\t\t$type = $this->getState('filter.author_id.include', true) ? 'IN' : 'NOT IN';\n\t\t\t\t$authorWhere = 'a.created_id '.$type.' ('.$authorId.')';\n\t\t\t}\n\t\t}\n \n\t\tif (!empty($authorWhere)) {\n\t\t\t$query->where('('.$authorWhere.')');\n\t\t}\n\t\t\n\t\t// Filter by start and end dates.\n\t\t$nullDate\t= $db->Quote($db->getNullDate());\n\t\t$nowDate = $db->Quote(JFactory::getDate()->toSql()); // True to return the date string in the local time zone, false to return it in GMT.\n\n\t\t$query->where('(a.publish_from = '.$nullDate.' OR a.publish_from <= '.$nowDate.')');\n\t\t$query->where('(a.publish_to = '.$nullDate.' OR a.publish_to >= '.$nowDate.')');\n\n\t\t// Filter by Date Range or Relative Date\n\t\t$dateFiltering = $this->getState('filter.date_filtering', 'off');\n\t\t$dateField = $this->getState('filter.date_field', 'a.date_added');\n\n\t\tswitch ($dateFiltering)\n\t\t{\n\t\t\tcase 'range':\n\t\t\t\t$startDateRange = $db->Quote($this->getState('filter.start_date_range', $nullDate));\n\t\t\t\t$endDateRange = $db->Quote($this->getState('filter.end_date_range', $nullDate));\n\t\t\t\t$query->where('('.$dateField.' >= '.$startDateRange.' AND '.$dateField .\n\t\t\t\t\t' <= '.$endDateRange.')');\n\t\t\t\tbreak;\n\n\t\t\tcase 'relative':\n\t\t\t\t$relativeDate = (int) $this->getState('filter.relative_date', 0);\n\t\t\t\t$query->where($dateField.' >= DATE_SUB('.$nowDate.', INTERVAL ' .\n\t\t\t\t\t$relativeDate.' DAY)');\n\t\t\t\tbreak;\n\n\t\t\tcase 'off':\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\n\t\t// process the filter for list views with user-entered filters\n\t\t$params = $this->getState('params');\n\n\t\tif ((is_object($params)) && ($params->get('filter_field') != 'hide') && ($filter = $this->getState('list.filter'))) {\n\t\t\t// clean filter variable\n\t\t\t$filter = JString::strtolower($filter);\n\t\t\t$hitsFilter = intval($filter);\n\t\t\t$filter = $db->Quote('%'.$db->escape($filter, true).'%', false);\n\n\t\t\tswitch ($params->get('filter_field'))\n\t\t\t{\n\t\t\t\tcase 'author':\n\t\t\t\t\t$query->where(\n\t\t\t\t\t\t'LOWER(ua.name) LIKE '.$filter.' '\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'hits':\n\t\t\t\t\t$query->where('a.downloads >= '.$hitsFilter.' ');\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'title':\n\t\t\t\tdefault: // default to 'title' if parameter is not valid\n\t\t\t\t\t$query->where('LOWER( a.file_title ) LIKE '.$filter);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\n\t\t// Filter by language\n\t\tif ($this->getState('filter.language')) {\n\t\t\t$query->where('a.language in ('.$db->quote(JFactory::getLanguage()->getTag()).','.$db->quote('*').')');\n\t\t}\n \n // Filter by uncategorised (cat_id = 1 for 'root')\n if ($this->getState('only_uncategorised')) {\n $query->where('a.cat_id = 1');\n }\n\n // Filter by featured state\n $featured = $this->getState('filter.featured');\n\n switch ($featured)\n {\n case 'hide':\n $query->where('a.featured = 0');\n break;\n\n case 'only':\n $query->where('a.featured = 1');\n break;\n\n case 'show':\n default:\n break;\n } \n \n\t\t// Add the list ordering clause.\n $order = $this->getState('list.ordering', 'a.ordering').' '.$this->getState('list.direction', 'ASC');\n $order = str_replace('DESC DESC','DESC', $order);\n $query->order($order);\n\t\t\n\t\treturn $query;\n\t}",
"protected function _buildItemsQuery() {\n\n $query=\"SELECT b.id, b.title, b.alias, b.state, b.create_date, b.public_date, u.name AS author_name, c.title AS category_title, c.alias AS category_alias\n FROM `#__blog` AS b\n LEFT JOIN `#__categories` AS c\n ON b.category_id = c.id \n LEFT JOIN `#__users` AS u\n ON b.author_id = u.id\";\n\n return $query;\n\n }",
"function find_recent_product_added($limit){\n global $db;\n $sql = \" SELECT p.id,p.name,p.keywords,p.sale_price,p.media_id,c.name AS categorie,\";\n $sql .= \"m.file_name AS image FROM products p\";\n $sql .= \" LEFT JOIN categories c ON c.id = p.categorie_id\";\n $sql .= \" LEFT JOIN media m ON m.id = p.media_id\";\n $sql .= \" ORDER BY p.id DESC LIMIT \".$db->escape((int)$limit);\n return find_by_sql($sql);\n }",
"function getPersonalInboxQueries($connection,$userId,$inboxMessageSearch){\n $query = \"SELECT fpd.*,fu.name AS user_name,fu.profile_pic AS user_profile,fpd.datetime as posted_time FROM forum_personal_discussion fpd LEFT JOIN forum_users fu on fu.user_id=fpd.user_id WHERE fpd.person_id='$userId' \";\n\n // echo $query;\n if ($inboxMessageSearch){\n $query .= \" AND ( fpd.discussion_title LIKE '%{$inboxMessageSearch}%' OR fpd.message LIKE '%{$inboxMessageSearch}%' OR fu.name LIKE '%{$inboxMessageSearch}%') \";\n }\n $query .= ' ORDER BY datetime DESC';\n $result = $connection->query($query);\n return $result;\n }",
"protected function innerJoin() {\n return \" INNER JOIN ImageDetails ON MainPostImage = ImageID\n INNER JOIN Users ON Posts.UserID = Users.UserID\"; }",
"function newsItem_BacaDataListing_ByKategori_Dikomentari_All( $tbl_news , $idkategori ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE idkategori = '$idkategori' AND dikomentari != '0' ORDER BY urutan DESC, timeunix DESC \");\n\treturn $sql;\n}",
"function getLikesByPost($post_id) {\r\n// left join users u on pl.user_id=u.user_id \r\n//where \";\r\n // echo $sql;\r\n \r\n return $this->getLikes(\"pl.post_id=$post_id\");\r\n }",
"protected function getSelectStatement()\n {\n return \"SELECT BookID, ISBN10, ISBN13, Title, CopyrightYear, TrimSize, PageCountsEditorialEst\n as PageCount, Description, CoverImage, Status, Subcategories.SubcategoryID, SubcategoryName, Imprints.ImprintID, Imprint, BindingType FROM Books\n JOIN Statuses ON (Books.ProductionStatusID = Statuses.StatusID) JOIN Subcategories ON \n (Books.SubcategoryID = Subcategories.SubcategoryID) JOIN Imprints USING (ImprintID) JOIN BindingTypes USING (BindingTypeID)\";\n }",
"public function prepareQueryForCategory()\n {\n $sql = new SqlStatement();\n $sql->select(array('p.*'))\n ->from(array('p' => self::RESULTS_TABLE))\n ->innerJoin(array('pp' => 'product'), 'p.product_id = pp.product_id')\n ->innerJoin(array('pd' => 'product_description'), 'p.product_id = pd.product_id')\n ->where('pd.language_id = ?', (int)$this->config->get('config_language_id'))\n ->order($this->sortOrder)\n ->limit($this->productsLimit, $this->productsStart);\n \n if ($this->conditions->price) {\n if ($this->conditions->price->min) {\n $sql->where(\"{$this->subquery->actualPrice} >= ?\", array($this->conditions->price->min));\n }\n if ($this->conditions->price->max) {\n $sql->where(\"{$this->subquery->actualPrice} <= ?\", array($this->conditions->price->max));\n }\n }\n \n if ($this->conditions->rating) {\n $sql->where('ROUND(total) IN ('. implode(',', $this->conditions->rating[0]) . ')');\n } \n \n return $sql;\n }",
"function getmyepics($epicOwnerID)\n {\n //$myepics = \"SELECT * from epics\";\n $myepics= \"SELECT e.*,staff.*,epics_statuses.name as epicsname,team.name as teamname\n FROM epics AS e\n LEFT JOIN epics_statuses AS epics_statuses ON epics_statuses.id = e.e_status_id\n LEFT JOIN team AS team ON team.id = e.team_id\n LEFT JOIN staff AS staff ON staff.staff_id = e.e_owner WHERE e.e_owner='\".$epicOwnerID.\"'\"; \n $myepicsresult = $this->ds->select($myepics); \n //print_r($myepicsresult);\n return $myepicsresult;\n }",
"function newsItem_BacaDataListing_ByKategori_Pilihan_All( $tbl_news , $idkategori ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE idkategori = '$idkategori' AND pilihan != '0' ORDER BY urutan DESC, timeunix DESC \");\n\treturn $sql;\n}",
"public function viewVotingSummary()\r\n{\r\n $query_string = \"SELECT systemid, systemname, systemsummary \";\r\n $query_string .= \"FROM voting_system \";\r\n $query_string .= \"WHERE systemtypeid = :systemtypeid\";\r\n\r\n return $query_string;\r\n}",
"function banner_view_sql()\n {\n \t$banner_view=mysqli_query($this->con,\"SELECT * FROM `banner` where status=1 order by id desc\");\n \treturn $banner_view;\n }",
"public function get_all($pmss, $date1, $date2)\n {\n $query = $this->db->query(\"SELECT nid, duration_g, Integration, Integration_Default,Created, Published,Duration,\nsec_to_time(AVG(time_to_sec(TIMEDIFF( convert_tz(Published,'PST8PDT','GMT'), Created)))) 'ravg',\nsec_to_time(AVG(time_to_sec(TIMEDIFF( airbnb_created, convert_tz(Published,'PST8PDT','GMT'))))) 'aavg',\nsec_to_time(AVG(time_to_sec(TIMEDIFF( bookingcom_created, convert_tz(Published,'PST8PDT','GMT'))))) 'bavg',\nsec_to_time(AVG(time_to_sec(TIMEDIFF( homeaway_created, convert_tz(Published,'PST8PDT','GMT'))))) 'havg',\nsec_to_time(AVG(time_to_sec(TIMEDIFF( expedia_created, convert_tz(Published,'PST8PDT','GMT'))))) 'eavg',\nsec_to_time(AVG(time_to_sec(TIMEDIFF( tripadvisor_created, convert_tz(Published,'PST8PDT','GMT'))))) 'tavg'\n from(SELECT a.nid 'nid', DATE_FORMAT(timestamp1,'%Y-%m-%d') 'duration_g',\n\n\n-- sec_to_time(AVG(time_to_sec(TIMEDIFF( b.Published, timestamp1)))),\nif(cff.field_calendar_feed_format_value like 'haapi_%', 'homeaway API',cff.field_calendar_feed_format_value) 'Integration',\n cff.field_calendar_feed_format_value 'Integration_Default',\n timestamp1 'Created', \n b.Published 'Published', \n TIMEDIFF( b.Published, timestamp1) 'Duration', \n group_concat(\n if(\n cp.channel = 'airbnb', cp.created_ts, \n null\n )\n ) as 'airbnb_created', \n group_concat(\n if(\n cp.channel = 'bookingcom', cp.created_ts, \n null\n )\n ) as 'bookingcom_created', \n group_concat(\n if(\n cp.channel = 'homeaway', cp.created_ts, \n null\n )\n ) as 'homeaway_created', \n group_concat(\n if(\n cp.channel = 'expedia', cp.created_ts, \n null\n )\n ) as 'expedia_created', \n group_concat(\n if(\n cp.channel = 'tripadvisor', cp.created_ts, \n null\n )\n ) as 'tripadvisor_created' \nFROM \n (\n SELECT \n nid, \n uid, \n FROM_UNIXTIME(created) 'timestamp1' \n FROM \n node\n ) a \n left join (\n select \n min(psmnid), \n psmnid, \n nid, \n destination_state, \n created_at 'Published' \n from \n property_state_machine_notes \n where \n destination_state = 'live'\n group by nid\n ) b on b.nid = a.nid \n left join manager_cc_fees mc on mc.mid = a.uid \n left join channel_properties cp on cp.nid = a.nid \n left join field_data_field_calendar_feed_format cff on cff.entity_id = a.nid\nwhere timestamp1 between '\".$date1.\" 00:00:00' and '\".$date2.\" 23:59:59'\n$pmss\nand b.Published !='NULL'\n group by a.nid\n ) h\n group by h.duration_g\n \n;\");\n return $query->result_array();\n }",
"function newsItem_BacaDataListing_ByKategoriSub_Hotspot_All( $tbl_news , $idkategori, $idkategorisub ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE idkategori = '$idkategori' AND idkategorisub = '$idkategorisub' AND hotspot != '0' ORDER BY urutan DESC, timeunix DESC \");\n\treturn $sql;\n}",
"public static function category_listing($category_id,$limit = 15)\n {\n \n \n\n $query = \"SELECT id, category_id,created_by, title,description, url, featured_image, create_time,primary_phone,primary_email,\n\n (SELECT name FROM 9jb_locations WHERE 9jb_listings.city = 9jb_locations.id) AS city_name,\n (SELECT fa_icon FROM 9jb_categories WHERE 9jb_listings.category_id = 9jb_categories.id) AS icon,\n (SELECT color FROM 9jb_categories WHERE 9jb_listings.category_id = 9jb_categories.id) AS color,\n (SELECT title FROM 9jb_categories WHERE 9jb_listings.category_id = 9jb_categories.id) AS category_name,\n (SELECT name FROM 9jb_locations WHERE 9jb_listings.state = 9jb_locations.id) AS state_name,\n (SELECT count(*) FROM 9jb_reviews WHERE 9jb_reviews.listing_id = 9jb_listings.id) AS reviews\n\n FROM 9jb_listings\n WHERE category_id = ? AND status='activated'\n ORDER BY create_time DESC LIMIT $limit \";\n\n return \\DB::select($query,[$category_id]) ;\n }",
"function newsItem_BacaDataListing_ByKategori_Tampil_All( $tbl_news , $idkategori ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE idkategori = '$idkategori' AND statustampil != '0' ORDER BY urutan DESC, timeunix DESC \");\n\treturn $sql;\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}",
"function renderUserSubmissions() {\n $pdo = Database::connect();\n $sql = \"SELECT fd_media.*, fd_categories.category_name \" .\n \"FROM fd_media \" .\n \"INNER JOIN fd_categories ON fd_categories.id = fd_media.category_id \" .\n \"WHERE fd_media.creator_id = ?\";\n\n $q = $pdo->prepare($sql);\n $q->execute(array($_SESSION['user_id']));\n\n //render as rows\n foreach($q->fetchAll() as $row) {\n echo \"<tr>\";\n echo \"<td><img style='height: 75px;' src='data:image/jpeg;base64,\" . base64_encode($row['logo']) . \"'></td>\";\n echo \"<td><a href=\\\"fd_showmedia.php?showid=\" . $row['id'] . \"\\\">\" . $row['name'] . \"</a></td>\";\n echo \"<td>\" . $row['category_name'] . \"</td>\";\n echo \"<td>\" . getRatingForShowId($row['id']) . \"</td>\";\n echo \"</tr>\";\n }\n}",
"function immagini_get($id_imm=\"\"){\n $db = new db(DB_USER,DB_PASSWORD,DB_NAME,DB_HOST);\n\t\n\t$q_foto=\"SELECT immagine.* FROM imm_img JOIN immagine on immagine.id_img=imm_img.id_img WHERE imm_img.id_imm =$id_imm ORDER BY `ordine` ASC\";\n \n\t$r_foto=$db->query($q_foto);\n while($row_foto = mysql_fetch_assoc($r_foto))\n {\n $rows_foto[] = $row_foto;\n }\n \n return $rows_foto;\n\n \n}",
"function newsItem_BacaDataListing_ByKategori_TidakTampil_All( $tbl_news , $idkategori ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE idkategori = '$idkategori' AND statustampil == '0' ORDER BY urutan DESC, timeunix DESC \");\n\treturn $sql;\n}",
"function myjoin()\n {\n $this->db\n ->select('puestos.nombre AS pnombre')\n ->select('puestos.id AS pid')\n ->select('entidades.nombre AS enombre')\n ->select('entidades.id AS eid')\n ->select('departamentos.nombre AS dnombre')\n ->select('departamentos.id AS did')\n ->select('ubicaciones.nombre AS unombre')\n ->select('ubicaciones.id AS uid')\n ->join ('puestos', 'users.puesto = puestos.id' , 'left')\n ->join ('entidades', 'users.entidad = entidades.id' , 'left')\n ->join('departamentos', 'users.departamento = departamentos.id' , 'left')\n ->join('ubicaciones', 'users.ubicaciontrabajo = ubicaciones.id' , 'left');\n //$this->db->where('users.id',7);\n return $datosuser = $this->db->get('users')->result_array();\n }",
"function get_sql_select_torrents($torrents_ids,$orderby) {\n\tif (is_array($torrents_ids)) $torrents_ids = join(',',$torrents_ids);\n\treturn \"SELECT torrents.id, torrents.category, torrents.leechers, torrents.seeders, torrents.name, torrents.times_completed, torrents.size, torrents.added, torrents.comments,torrents.numfiles,torrents.filename,torrents.owner,torrents.team,\n\t \t\t\tcategories.name AS cat_name, categories.image AS cat_pic, users.username, teams.name AS teamName, teams.initials AS teamInitials, torrents.moder_status\n\t \t\t\tFROM torrents\n\t \t\t\tLEFT JOIN categories ON category = categories.id\n\t \t\t\tLEFT JOIN users ON torrents.owner = users.id\n\t \t\t\tLEFT JOIN teams ON (torrents.team > 0 AND torrents.team = teams.id)\n\t \t\t\tWHERE torrents.id IN ($torrents_ids) $orderby\";\n}",
"public function getFiveArtsByHits(){\n\t\t$sql=\"select a.articleid,a.title,a.description,a.pic,a.ptime,a.hits,a.author,c.categoryid,c.name from article a join category c on a.cid=c.categoryid order by a.hits desc limit 5\";\n\t\t\n\t\treturn $this->select($sql);\n\t}",
"function newsItem_BacaDataListing_ByKategoriSub_DiKomentari_All( $tbl_news , $idkategori, $idkategorisub ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE idkategori = '$idkategori' AND idkategorisub = '$idkategorisub' AND dikomentari != '0' ORDER BY urutan DESC, timeunix DESC \");\n\treturn $sql;\n}",
"function newsItem_BacaDataListing_ByKategori_TidakPopuler_All( $tbl_news , $idkategori ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE idkategori = '$idkategori' AND dilihat < '10' ORDER BY urutan DESC, timeunix DESC \");\n\treturn $sql;\n}",
"function newsItem_BacaDataListing_ByKategori_Terpopuler_All( $tbl_news , $idkategori ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE idkategori = '$idkategori' AND dilihat > '20' ORDER BY urutan DESC, timeunix DESC \");\n\treturn $sql;\n}",
"function newsItem_BacaDataListing_ByKategori_Terkini_All( $tbl_news , $idkategori ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE idkategori = '$idkategori' ORDER BY urutan DESC, timeunix DESC \");\n\treturn $sql;\n}",
"public function reviewAlacarte()\n {\n\n $alacartReviewQuery = DB::select(\"select `rd`.`id`, `rd`.`user_id`, `rd`.`reservation_status`, `rd`.`reservation_date`, `rd`.`reservation_time`, `rd`.`no_of_persons`,\n `products`.`name` as `product_name`, `vendors`.`id` as `vendor_id`, `vendors`.`name` as `vendor_name`,\n `rd`.`reservation_type`, `products`.`id` as `product_id`, `rd`.`vendor_location_id`,\n `rd`.`product_vendor_location_id`,\n `rd`.`special_request`, `rd`.`giftcard_id`, `rd`.`guest_name`, \n `rd`.`guest_name`, `rd`.`guest_email`, `rd`.`guest_phone`, \n `rd`.`points_awarded`, MAX(IF(pa.alias='short_description', pat.attribute_value,'')) AS product_short_description,\n MAX(IF(va.alias='short_description', vlat.attribute_value, ''))AS vendor_short_description, `ploc`.`name` as `product_locality`,\n `pvla`.`address` as `product_address`, `vloc`.`name` as `vendor_locality`,\n `vvla`.`address` as `vendor_address`, `products`.`slug` as `product_slug`, `ploc`.`name` as `city`,\n DAYNAME(rd.reservation_date) as dayname,pvl.id as product_vendor_location_id,`vloc1`.name as city_name,`vloc1`.id as city_id, vlr.review,vlr.id as review_id, vlr.status as review_status, vlr.rating as rating\n from `reservation_details` as `rd` \n inner join vendor_location_reviews as vlr on vlr.reserv_id = rd.id\n left join `vendor_locations` as `vl` on `vl`.`id` = `rd`.`vendor_location_id`\n left join `product_vendor_locations` as `pvl` on `pvl`.`product_id` = `rd`.`product_id` and pvl.vendor_location_id = `rd`.`vendor_location_id` \n left join `products` on `products`.`id` = `pvl`.`product_id` \n left join `vendors` on `vendors`.`id` = `vl`.`vendor_id` \n left join `product_attributes_text` as `pat` on `pat`.`product_id` = `products`.`id` \n left join `product_attributes` as `pa` on `pa`.`id` = `pat`.`product_attribute_id` \n left join `vendor_location_attributes_text` as `vlat` on `vlat`.`vendor_location_id` = `vl`.`id` \n left join `vendor_attributes` as `va` on `va`.`id` = `vlat`.`vendor_attribute_id` \n left join `vendor_locations` as `vl2` on `vl2`.`id` = `pvl`.`vendor_location_id` \n left join `locations` as `ploc` on `ploc`.`id` = `vl2`.`location_id` \n left join `vendor_location_address` as `pvla` on `pvla`.`vendor_location_id` = `pvl`.`vendor_location_id` \n left join `vendor_location_address` as `vvla` on `vvla`.`vendor_location_id` = `rd`.`vendor_location_id` \n left join `locations` as `vloc` on `vloc`.`id` = `vl`.`location_id`\n left join `locations` as `vloc1` on `vloc1`.`id` = vvla.city_id\n where`reservation_status` in ('new', 'edited') \n group by `rd`.`id` order by `rd`.`reservation_date` asc, `rd`.`reservation_time` asc\");\n \n $alacart_review = array();\n\n if(!empty($alacartReviewQuery))\n {\n foreach ($alacartReviewQuery as $row) {\n $alacart_review[] = array('reservid' => $row->id,\n 'user_id' => $row->user_id,\n 'reservation_date' => $row->reservation_date,\n 'product_name' => $row->product_name,\n //'vendor_id' => $queryResult[0]->vendor_id,\n 'vendor_name' => $row->vendor_name,\n 'reservation_type' => $row->reservation_type,\n 'product_id' => $row->product_id,\n 'vendor_location_id' => $row->vendor_location_id,\n 'guest_name' => $row->guest_name,\n 'guest_email' => $row->guest_email,\n 'product_short_description' => $row->product_short_description,\n 'product_locality' => $row->product_locality,\n 'vendor_locality' => $row->vendor_locality,\n 'city_name' => $row->city_name,\n 'city_id' => $row->city_id,\n 'vendor_address' => $row->vendor_address,\n 'review' => $row->review,\n 'review_id' => $row->review_id,\n 'review_status' => $row->review_status,\n 'rating' => $row->rating,\n );\n }\n }\n /*print_r($alacart_review);\n exit;*/\n\n return view('admin.review.alacarte_review',['alacartReviewDetails'=>$alacart_review]);\n }",
"public function getCategories()\r\n{\r\n $query_string = \"SELECT categoryid, categoryname, categorydescription \";\r\n $query_string .= \"FROM categories\";\r\n\r\n return $query_string;\r\n}",
"function newsItem_BacaDataListing_ByKategori_DiLampirkan_All( $tbl_news , $idkategori ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE idkategori = '$idkategori' AND dilampirkan != '0' ORDER BY urutan DESC, timeunix DESC \");\n\treturn $sql;\n}",
"function _buildQuery()\n\t{\n\t\t$where\t\t= $this->_buildContentWhere();\n\t\t$orderby\t= $this->_buildContentOrderBy();\n\n\t\t$query = 'SELECT c.*, g.name AS groupname, cc.title as name, u.name AS editor, f.ordering AS fpordering, v.name AS author'\n\t\t\t. ' FROM #__content AS c'\n\t\t\t. ' LEFT JOIN #__categories AS cc ON cc.id = c.catid'\n\t\t\t. ' INNER JOIN #__content_frontpage AS f ON f.content_id = c.id'\n\t\t\t. ' LEFT JOIN #__users AS u ON u.id = c.checked_out'\n\t\t\t. ' LEFT JOIN #__users AS v ON v.id = c.created_by'\n\t\t\t. $where\n\t\t\t. $orderby\n\t\t;\n\n\t\treturn $query;\n\t}",
"function getallproducts($warehouseid){\n \n $result = $this->db->query(\"SELECT a.*, \n b.id AS productid, b.`name` AS productname, b.`main_image` AS productimage, \n b.`price` AS product_price, b.`tax` AS product_tax, b.`description` AS product_description, b.`move_product_id` AS productuniqueid_forimages,\n c.`name` AS cat_name, c.`image` AS cat_image, d.`name` AS subcat_name, d.`image` AS subcat_image\n FROM warehouse_products a LEFT JOIN products b ON a.product=b.`id` LEFT JOIN category c ON b.`category_id` = c.`category_id` LEFT JOIN category d \n ON b.`sub_category_id` = d.`category_id` WHERE a.`warehouse` = \".$warehouseid.\" ORDER BY c.`name`, d.`name`\")->result();\n return $result;\n \n }",
"function EpicsDetails() \n {\n \n // $EpicsDetails=\"SELECT * FROM epics\n // LEFT JOIN team\n // ON team.id = epics.team_id\";\n\n\n $EpicsDetails=\"SELECT e.*,stf.*,ed.*,team.name as teamname,epics_statuses.name as statusename\n FROM epics AS e\n LEFT JOIN team as team ON team.id=e.team_id\n LEFT JOIN epics_statuses as epics_statuses ON epics_statuses.id=e.e_status_id\n LEFT JOIN staff AS stf ON stf.staff_id = e.e_owner \n LEFT JOIN epic_details AS ed ON ed.e_id = e.e_id where ed.e_id = e.e_id\";\n $EpicsDetailsresult = $this->ds->select($EpicsDetails);\n //print '<pre>';print_r($EpicsDetailsresult);\n return $EpicsDetailsresult;\n }",
"public function getUserData($userInterviewID)\n {\n// ->from('user_interview ui')\n// ->join('interview i', 'i.id = ui.interview_id')\n// ->join('interview_script_element ise', 'ise.interview_id = i.id')\n// ->where(\"ise.type = 'record' AND ui.id IN(\".$userInterviewID.\")\")\n// ->group_by('ui.id, ise.id')\n// ->get();\n// if($query->num_rows() > 0)\n// {\n// $data = $query->result();\n// return $data;\n// }\n// return NULL;\n $dsn = \"mysql:host=localhost;dbname=jiem\";\n $username = \"root\";\n $password = \"\";\n\n try {\n $conn = new PDO($dsn, $username, $password);\n $conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\n $sql = \"SELECT ui.id as interview_result_id, ise.id as answers_id, i.grade, ise.duration\n FROM user_interview ui\n INNER JOIN interview i ON i.id = ui.interview_id\n INNER JOIN interview_script_element ise ON ise.interview_id = i.id\n WHERE ise.type = 'record' AND ui.id IN(\".$userInterviewID.\")\n GROUP BY ui.id, ise.id\";\n\n $statement = $conn->prepare($sql);\n $statement->execute();\n\n $statement->setFetchMode(PDO::FETCH_ASSOC);\n $result = $statement->fetchAll();\n return $result;\n }\n catch(PDOException $error)\n {\n echo $sql . \"<br>\" . $error->getMessage();\n }\n }",
"function query_select_user_rating($user_id) {\n global $connection;\n\n //should be safe but escape:\n $user_id = mysqli_real_escape_string($connection, $user_id);\n\n //construct query\n $query = \"SELECT IF(FLOOR(AVG(stars)) IS NULL, 0, FLOOR(AVG(stars))) AS stars, \";\n $query .= \"COUNT(user_id) AS occurrences \";\n $query .= \"FROM feedback WHERE user_id='{$user_id}'\";\n\n $result = mysqli_query($connection, $query);\n\n if($result)\n $result = mysqli_fetch_assoc($result);\n\n return $result;\n}",
"function newsItem_BacaDataListing_ByKategoriSub_Tampil_All( $tbl_news , $idkategori, $idkategorisub ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE idkategori = '$idkategori' AND idkategorisub = '$idkategorisub' AND statustampil != '0' ORDER BY urutan DESC, timeunix DESC \");\n\treturn $sql;\n}",
"protected function getDetailedSelect() { \n return \"SELECT PostID, Posts.UserID, MainPostImage, Posts.Title, Message, PostTime, ImageDetails.ImageID, Path, FirstName, LastName\n FROM Posts\";\n }",
"public function getReviewIfRating() {\n //Try to get distinct\n $qry = $this->db->prepare('SELECT DISTINCT NAME,ADDRESS,SUBURB,LATITUDE,LONGITUDE,reviews.rating FROM n8598177.items INNER JOIN reviews ON reviews.hotspotName=items.NAME ');\n $qry->execute();\n foreach ($qry as $hotspot) {\n include('server/includes/recentReview.tpl.php');\n }\n }",
"function newsItem_BacaDataListing_ByKategoriSub_Pilihan_All( $tbl_news , $idkategori, $idkategorisub ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE idkategori = '$idkategori' AND idkategorisub = '$idkategorisub' AND pilihan != '0' ORDER BY urutan DESC, timeunix DESC \");\n\treturn $sql;\n}",
"public function getReviewsByPID($PaintingID) {\n \n $sql = 'SELECT reviewdate, rating, comment\n FROM Reviews';\n $sql .= ' WHERE Reviews.PaintingID = :PaintingID';\n $statement = DBHelper::runQuery($this->getConnection(),$sql, Array(\":PaintingID\" => $PaintingID));\n $row = $statement->fetchAll(); \n return $row;\n}",
"public function selectByFilter($sliderImageVo, $orderBy=array(), $startRecord=0, $recordSize=0){\ntry {\nif (empty($sliderImageVo)) $sliderImageVo = new SliderImageVo();\n$sql = \"select * from `slider_image` \";\n$condition = '';\n$params = array();\n$isFirst = true;\nif (!is_null($sliderImageVo->sliderImageId)){ //If isset Vo->element\n$fieldValue=$sliderImageVo->sliderImageId;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `slider_image_id` $key :sliderImageIdKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `slider_image_id` $key :sliderImageIdKey\";\n}\nif($type == 'str') {\n $params[] = array(':sliderImageIdKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':sliderImageIdKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `slider_image_id` = :sliderImageIdKey';\n$isFirst=false;\n}else{\n$condition.=' and `slider_image_id` = :sliderImageIdKey';\n}\n$params[]=array(':sliderImageIdKey', $fieldValue, PDO::PARAM_INT);\n}}\n\nif (!is_null($sliderImageVo->sliderId)){ //If isset Vo->element\n$fieldValue=$sliderImageVo->sliderId;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `slider_id` $key :sliderIdKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `slider_id` $key :sliderIdKey\";\n}\nif($type == 'str') {\n $params[] = array(':sliderIdKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':sliderIdKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `slider_id` = :sliderIdKey';\n$isFirst=false;\n}else{\n$condition.=' and `slider_id` = :sliderIdKey';\n}\n$params[]=array(':sliderIdKey', $fieldValue, PDO::PARAM_INT);\n}}\n\nif (!is_null($sliderImageVo->image)){ //If isset Vo->element\n$fieldValue=$sliderImageVo->image;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `image` $key :imageKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `image` $key :imageKey\";\n}\nif($type == 'str') {\n $params[] = array(':imageKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':imageKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `image` = :imageKey';\n$isFirst=false;\n}else{\n$condition.=' and `image` = :imageKey';\n}\n$params[]=array(':imageKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($sliderImageVo->title)){ //If isset Vo->element\n$fieldValue=$sliderImageVo->title;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `title` $key :titleKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `title` $key :titleKey\";\n}\nif($type == 'str') {\n $params[] = array(':titleKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':titleKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `title` = :titleKey';\n$isFirst=false;\n}else{\n$condition.=' and `title` = :titleKey';\n}\n$params[]=array(':titleKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($sliderImageVo->description)){ //If isset Vo->element\n$fieldValue=$sliderImageVo->description;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `description` $key :descriptionKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `description` $key :descriptionKey\";\n}\nif($type == 'str') {\n $params[] = array(':descriptionKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':descriptionKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `description` = :descriptionKey';\n$isFirst=false;\n}else{\n$condition.=' and `description` = :descriptionKey';\n}\n$params[]=array(':descriptionKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($sliderImageVo->link)){ //If isset Vo->element\n$fieldValue=$sliderImageVo->link;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `link` $key :linkKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `link` $key :linkKey\";\n}\nif($type == 'str') {\n $params[] = array(':linkKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':linkKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `link` = :linkKey';\n$isFirst=false;\n}else{\n$condition.=' and `link` = :linkKey';\n}\n$params[]=array(':linkKey', $fieldValue, PDO::PARAM_STR);\n}}\n\nif (!is_null($sliderImageVo->order)){ //If isset Vo->element\n$fieldValue=$sliderImageVo->order;\nif(is_array($fieldValue)){ //if is array\n$key = $fieldValue[0];\n$value = $fieldValue[1];\n$type = (isset($fieldValue[2])) ? $fieldValue[2] : 'str';\nif ($isFirst) {\n $condition .= \" `order` $key :orderKey\";\n $isFirst = false;\n} else {\n $condition .= \" and `order` $key :orderKey\";\n}\nif($type == 'str') {\n $params[] = array(':orderKey', $value, PDO::PARAM_STR);\n}\nelse{\n $params[] = array(':orderKey', $value, PDO::PARAM_INT);\n}}\nelse{ //is not array\nif ($isFirst){\n$condition.=' `order` = :orderKey';\n$isFirst=false;\n}else{\n$condition.=' and `order` = :orderKey';\n}\n$params[]=array(':orderKey', $fieldValue, PDO::PARAM_INT);\n}}\n\nif (!empty($condition)){\n$sql.=' where '. $condition;\n}\n\n//order by <field> asc/desc\nif(count($orderBy) != 0){\n $orderBySql = 'ORDER BY ';\n foreach ($orderBy as $k => $v){\n $orderBySql .= \"`$k` $v, \";\n }\n $orderBySql = substr($orderBySql, 0 , strlen($orderBySql)-2);\n $sql.= \" \".trim($orderBySql).\" \";\n}\nif($recordSize != 0) {\n$sql = $sql.' limit '.$startRecord.','.$recordSize;\n}\n\n//debug\nLogUtil::sql('(selectByFilter) '. DataBaseHelper::renderQuery($sql, $params));\n\n$stmt = $this->conn->prepare($sql);\nforeach ($params as $param){\n$stmt->bindParam($param[0], $param[1], $param[2]);\n}\nif ($stmt->execute()) {\n$row= $stmt->fetchAll(PDO::FETCH_NAMED);\nreturn PersistentHelper::mapResult('SliderImageVo', $row);\n}\n} catch (PDOException $e) {\nthrow $e;\n}\nreturn null;\n}",
"function allFilms()\n{\n $conn = connect();\n try {\n if ($conn) {\n $stmt = $conn->query(\"SELECT filmai.pavadinimas, filmai.id, filmai.aprasymas, \n filmai.trukme, filmai.rezisierius, kategorijos.pavadinimas AS kategorijosPavadinimas\n FROM filmai \n INNER JOIN kategorijos ON filmai.kategorijos_id=kategorijos.id\");\n $filmai = $stmt->fetchAll();\n $conn = null;\n }\n } catch (PDOException $e) {\n echo $e->getMessage();\n exit;\n }\n return $filmai;\n}",
"public function getProducts(){\n $query = \"SELECT \n products.id,\n products.name,\n products.description,\n products.price,\n images.image_file_name\n FROM products\n INNER JOIN products_images\n ON products.id = products_images.product_id\n INNER JOIN images\n ON products_images.image_id = images.image_id\";\n\n //-----construct query according to parameters supplied\n \n //create an array to pass string eg \"iii\" to bind_param\n $query_param_string = array();\n \n //create an array to pass values to the bind_param\n $query_param_values = array();\n \n //--TOTAL COUNT OF PRODUCTS\n //create an array to pass string eg \"iii\" to count total result\n $query_param_string_count = array();\n //create an array to pass values to to count total result\n $query_param_values_count = array();\n \n //--CATEGORIES\n //if there are categories selected, create a join with products_categories table\n //so we can find products in category or categories\n if( count( $this -> categories ) > 0 ){\n //store the name of the table in variable\n $tbl_products_categories = \"products_categories\";\n \n //string to add to query to join with products_categories table\n $category_join = \" INNER JOIN $tbl_products_categories ON products.id = $tbl_products_categories.product_id \";\n \n $category_query = array();\n foreach( $this -> categories as $cat ){\n //ignore if category = 0\n if( $cat !== 0 ){\n array_push( $category_query, \"$tbl_products_categories.category_id=?\");\n array_push( $query_param_string, \"i\" );\n array_push( $query_param_string_count, \"i\" );\n \n //we need each query param value as a reference\n array_push( $query_param_values, $cat );\n array_push( $query_param_values_count, $cat );\n }\n }\n //implode the categories into a string so we have\n //products_categories.category_id=? OR products_categories.category_id=?\n $cat_query_string = implode( \" OR \", $category_query );\n }\n \n //--PAGE\n //process page variables\n //to use pagination, we need to calculate offset\n //if we have 8 results per page, then offset is calculated using pagenumber $page -1 * perpage\n $offset = ($this -> page-1) * $this -> perpage;\n \n //add offset and limit to query_param_string array and query_param_values\n array_push( $query_param_string , \"i\" );\n array_push( $query_param_values , $this -> perpage );\n array_push( $query_param_string , \"i\" );\n array_push( $query_param_values , $offset );\n \n //add the query_param_string to the beginning of query_param_values\n //so we get the \"iii\" at the beginning of array\n array_unshift( $query_param_values, implode( \"\", $query_param_string ));\n //do the same for the count arrays\n array_unshift( $query_param_values_count, implode(\"\",$query_param_string_count) );\n \n //build the query with category parameters\n $limit = \" LIMIT ? OFFSET ?\";\n \n //add category join\n if( count( $this -> categories) > 0){\n $query = $query . \" \" . $category_join;\n //add category query string\n $query = $query . \" WHERE \" . $cat_query_string . \" AND products.active=1\";\n }\n \n //add grouping and sorting\n $query = $query . \" GROUP BY products.id\";\n //add sorting\n $query = $query . \" ORDER BY products.id ASC\";\n \n //create second query without the limit so we can get total number of products\n //without the pagination and limit (offset creates pages of result, \n //while limit limits the number of products per page)\n $count_query = $query;\n //add limit\n $query = $query . \" \" . $limit;\n \n //send the query to database using prepare\n $statement = $this -> connection -> prepare( $query );\n \n //create references to the array values using &$query_param_values\n //while adding to parameters array\n $parameters_array = array();\n foreach( $query_param_values as $key => $value ){\n $parameters_array[$key] = &$query_param_values[$key];\n }\n //do the same for count \n $parameters_array_count = array();\n foreach( $query_param_values_count as $key => $value ){\n $parameters_array_count[$key] = &$query_param_values_count[$key];\n }\n //use call_user_func_array to pass the array as a parameter to query\n //equivalent of calling bind_param(\"iii\",$var1,$var2,$var3)\n call_user_func_array( array($statement,'bind_param'), $parameters_array );\n \n //execute the query with the parameters\n if( $statement -> execute() ){\n $result = $statement -> get_result();\n //check number of rows in result\n if( $result -> num_rows > 0){\n $products = array();\n while( $row = $result -> fetch_assoc() ){\n $id = $row[\"id\"];\n $name = $row[\"name\"];\n $price = $row[\"price\"];\n $image_file_name = $row[\"image_file_name\"];\n $desc = new \\utilities\\TruncateWords( $row[\"description\"],15 );\n $description = $desc -> words;\n //$description = $row[\"description\"];\n array_push( $products, array( \n \"id\" => $id, \n \"name\" => $name, \n \"price\" => $price,\n \"description\" => $description, \n \"image_file_name\" => $image_file_name \n ) );\n }\n $statement -> close();\n //run the second query $count_query to get total number of products\n $statement = $this -> connection -> prepare($count_query);\n call_user_func_array( array($statement,'bind_param'), $parameters_array_count );\n $statement -> execute();\n $result = $statement -> get_result();\n $total = $result -> num_rows;\n \n $result_array = array();\n $result_array[\"total\"] = $total;\n $result_array[\"categories\"] = $this -> categories;\n $result_array[\"data\"] = $products;\n \n return $result_array;\n }\n else{\n return false;\n }\n }\n else {\n return false;\n }\n $statement -> close();\n }",
"public function getAll($id){\n $row = DB::run(\" SELECT torrents.anon, torrents.seeders, torrents.tube, torrents.banned, \n torrents.leechers, torrents.info_hash, torrents.filename, torrents.nfo, torrents.torrentlang, torrents.category,\n torrents.last_action, torrents.numratings, torrents.name, torrents.imdb, \n torrents.owner, torrents.save_as, torrents.descr, torrents.visible, \n torrents.size, torrents.added, torrents.views, torrents.hits, \n torrents.times_completed, torrents.id, torrents.type, torrents.external, \n torrents.image1, torrents.image2, torrents.announce, torrents.numfiles, \n torrents.freeleech, torrents.vip, \n IF(torrents.numratings < 2, NULL, ROUND(torrents.ratingsum / torrents.numratings, 1)) \n AS rating, torrents.numratings, categories.name \n AS cat_name, torrentlang.name \n AS lang_name, torrentlang.image \n AS lang_image, categories.parent_cat as cat_parent, users.username, users.privacy \n FROM torrents \n LEFT JOIN categories \n ON torrents.category = categories.id \n LEFT JOIN torrentlang ON torrents.torrentlang = torrentlang.id \n LEFT JOIN users ON torrents.owner = users.id \n WHERE torrents.id = $id\");\n $user1 = $row->fetchAll(PDO::FETCH_ASSOC);\n return $user1;\n }",
"function recup_des_articles()\n{\n global $connection;\n\n $sql = \"SELECT * FROM liaisons\n INNER JOIN users ON users.id_user = liaisons.id_user\n INNER JOIN articles ON articles.id_article = liaisons.id_article\n INNER JOIN categories ON categories.id_categorie = liaisons.id_categorie\n WHERE articles.actif=1\";\n\n $sth = $connection->prepare($sql);\n $sth->execute();\n\n $resultat = $sth->fetchAll(PDO::FETCH_OBJ);\n return $resultat;\n}",
"public function getAllRatings()\n {\n $ratings = [];\n\n switch (PMF_Db::getType()) {\n case 'mssql':\n case 'sqlsrv':\n // In order to remove this MS SQL 2000/2005 \"limit\" below:\n // The text, ntext, and image data types cannot be compared or sorted, except when using IS NULL or\n // LIKE operator.\n // we'll cast faqdata.thema datatype from text to char(2000)\n // Note: the char length is simply an heuristic value\n // Doing so we'll also need to trim $row->thema to remove blank chars when it is shorter than 2000 chars\n $query = sprintf('\n SELECT\n fd.id AS id,\n fd.lang AS lang,\n fcr.category_id AS category_id,\n CAST(fd.thema as char(2000)) AS question,\n (fv.vote / fv.usr) AS num,\n fv.usr AS usr\n FROM\n %sfaqvoting fv,\n %sfaqdata fd\n LEFT JOIN\n %sfaqcategoryrelations fcr\n ON\n fd.id = fcr.record_id\n AND\n fd.lang = fcr.record_lang\n WHERE\n fd.id = fv.artikel\n GROUP BY\n fd.id,\n fd.lang,\n fd.active,\n fcr.category_id,\n CAST(fd.thema as char(2000)),\n fv.vote,\n fv.usr\n ORDER BY\n fcr.category_id',\n PMF_Db::getTablePrefix(),\n PMF_Db::getTablePrefix(),\n PMF_Db::getTablePrefix()\n );\n break;\n\n default:\n $query = sprintf('\n SELECT\n fd.id AS id,\n fd.lang AS lang,\n fcr.category_id AS category_id,\n fd.thema AS question,\n (fv.vote / fv.usr) AS num,\n fv.usr AS usr\n FROM\n %sfaqvoting fv,\n %sfaqdata fd\n LEFT JOIN\n %sfaqcategoryrelations fcr\n ON\n fd.id = fcr.record_id\n AND\n fd.lang = fcr.record_lang\n WHERE\n fd.id = fv.artikel\n GROUP BY\n fd.id,\n fd.lang,\n fd.active,\n fcr.category_id,\n fd.thema,\n fv.vote,\n fv.usr\n ORDER BY\n fcr.category_id',\n PMF_Db::getTablePrefix(),\n PMF_Db::getTablePrefix(),\n PMF_Db::getTablePrefix()\n );\n break;\n }\n\n $result = $this->_config->getDb()->query($query);\n while ($row = $this->_config->getDb()->fetchObject($result)) {\n $ratings[] = array(\n 'id' => $row->id,\n 'lang' => $row->lang,\n 'category_id' => $row->category_id,\n 'question' => $row->question,\n 'num' => $row->num,\n 'usr' => $row->usr,\n );\n }\n\n return $ratings;\n }",
"public function fetchAll( $adStatus = null , $searchString = null )\n {\n\t /*\n\t $active = 1;\n\t $resultSet = $this->tableGateway->select(\n\t\tfunction (Select $select) use ($active) {\n //$select->columns(array('id', 'name', 'type')); \n $select->order('id DESC'); \n //$select->where(array('active'=> $active));\n });\n\t*/\n // return $resultSet;\n\t \n\n\t\n\t\t\n\t\t\n\t\t $adapter = $this->tableGateway->getAdapter();\t\t\n\t\t $sql = new Sql($adapter);\n\t\t $select = $sql->select();\n\t\t $select->from('advertisement_logs');\n\t\t $select->columns(array( 'id','user_id', 'add_id', 'date','status', 'totalClick' => new \\Zend\\Db\\Sql\\Expression('SUM(advertisement_logs.click_count)'), 'totalView' => new \\Zend\\Db\\Sql\\Expression('SUM(advertisement_logs.view_count)') ));\n\t\t $select->join('player', 'advertisement_logs.user_id = player.id ' , array('name' ,'email'),$type = self::JOIN_LEFT);\n\t\t //$select->join('player', 'advertisement_logs.user_id = player.id ' , array('name' ,'email'),$type = self::JOIN_LEFT);\n\t\t \n\t\t //$select->where(array('date'=> $active));\n\t\t\tif( $searchString != null )\n\t\t\t{\n\t\t\t\t$predicate \t\t= new \\Zend\\Db\\Sql\\Where();\n\t\t\t\t$str_arr \t\t= explode(\" - \" , $searchString );\n\t\t\t\t$startDate \t\t= date(\"Y-m-d\" , strtotime($str_arr[0]) );\n\t\t\t\t$endDate \t\t= date(\"Y-m-d\" , strtotime($str_arr[1]) );\n\t\t\t\t$select->where($predicate->greaterThanOrEqualTo('date',$startDate ) );\n\t\t\t\t$select->where($predicate->lessThanOrEqualTo('date',$endDate ) );\n\t\t\t\t//02/03/2015 - 02/18/2015\n\t\t\t}\n\t\t\t\n\t\tif($adStatus != null) {\n\t\t\t\t$select->where(array('status' => $adStatus));\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t\n\t\t\t\n\n\t\t \n\t\t $select->order('date DESC');\n\t\t $select->group('add_id');\n \n\t\t$statement = $sql->prepareStatementForSqlObject($select);\t\t\t\t\n\t\t$rowset = $statement->execute();\t\t\n \n\t\t$resultSet = new ResultSet();\n\t\t$resultSet->initialize($rowset);\n\t\treturn $resultSet; \n\t\t\n }",
"public function getPetsByUsuario($id_usuario){\n $db = db_connect();\n $resultados = $db->table('pet')\n ->select('pet.*')\n ->select('galeria.imagem')\n ->select('usuario.nome as nome_usuario, usuario.telefone, usuario.email')\n ->select('saude.id_pet as saude_id_pet, vermifugado, vacinado, castrado, cuidados_especiais')\n ->select('personalidade.id_pet as personalidade_id_pet, docil, agressivo, calmo, brincalhao, sociavel, arisco, independente, carente, tenso, assustado, casa, apartamento')\n ->select('porte.descricao as porte_descricao')\n ->select('especie.descricao as especie_descricao')\n ->select('sexo.descricao as sexo_descricao')\n ->select('faixa_etaria.descricao as faixa_etaria_descricao')\n ->select('municipio.nome as municipio_nome, municipio.uf')\n ->join('usuario', 'usuario.id_usuario = pet.id_usuario', 'left')\n ->join('porte', 'porte.id_porte = pet.id_porte', 'left')\n ->join('especie', 'especie.id_especie = pet.id_especie', 'left')\n ->join('sexo', 'sexo.id_sexo = pet.id_sexo', 'left')\n ->join('faixa_etaria', 'faixa_etaria.id_faixa_etaria = pet.id_faixa_etaria', 'left')\n ->join('municipio', 'municipio.id_municipio = pet.id_municipio', 'left')\n ->join('saude', 'saude.id_pet = pet.id_pet', 'left')\n ->join('personalidade', 'personalidade.id_pet = pet.id_pet', 'left')\n ->join('galeria', 'galeria.id_pet = pet.id_pet', 'left')\n ->where('pet.id_usuario', $id_usuario)\n ->where('galeria.capa',1)\n ->where('pet.excluido',0)\n ->get()->getResultObject();\n $db->close();\n return $resultados; \n }",
"function fetch($table, $campos=\"*\", $where=\"\", $order=\"\", $tipo=\"\", $limite=\"\"){\n\n\t\t$sql = \"SELECT DISTINCT \";\n\n\t\tif(is_array($campos)){\n\n\t\t\tforeach ($campos as $value){\n\t\t\t\t$sql .= \"'$value' ,\";\n\t\t\t}\n\n\t\t\t$strCut = strlen($sql) -1;\n\t\t\t$sql = substr($sql,0,$strCut);\n\n\t\t}else{\n\n\t\t\t$sql .= \" $campos \";\n\n\t\t}\n\n\t\tif ( strstr($table, \"|\") ) {\n\n\t\t\t$fromTable = substr($table,0,strpos($table,\"|\"));\n\n\t\t\t$leftJoin = substr($table,strpos($table,\"|\"),strlen($table));\n\n\t\t\t$leftJoin = explode(\"|\",$leftJoin);\n\n\t\t\t$sql .= \" FROM \".$fromTable;\n\n\t\t\tforeach ($leftJoin as $ex){\n\n\t\t\t\t$leftEx = explode(\">\", $ex );\n\n\t\t\t\t@list($left_table, $on_condition) = $leftEx;\n\n\t\t\t\tif(!empty($left_table)){\n\t\t\t\t\t$sql .= \" LEFT JOIN \" . $left_table;\n\t\t\t\t}\n\t\t\t\tif(!empty($on_condition)){\n\t\t\t\t\t$sql .= \" ON \" . $on_condition;\n\t\t\t\t}\n\n\n\t\t\t}\n\n\t\t}else{\n\n\t\t\t$sql .= \" FROM $table \";\n\n\t\t}\n\n\n\t\tif(!empty($where)) $sql .= \" WHERE \";\n\n\n\t\tif(is_array($where)){\n\n\t\t\tforeach ($where as $key => $value){\n\n\t\t\t\tif( strstr($value,\"!\") ){\n\t\t\t\t\t\t$value = substr($value, 1);\n\t\t\t\t\t\tif (strtolower($value) == \"empty\"){\n\t\t\t\t\t\t\t\t$sql .= \" $key <> '' OR $key <> 0 OR $key <> NULL AND\";\n\t\t\t\t\t\t}else if(is_int($value)){\n\t\t\t\t\t\t\t\t$sql .= \" $key <> $value OR $key <> 0 OR $key <> NULL AND\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$sql .= \" $key <> '$value' OR $key <> 0 OR $key <> NULL AND\";\n\t\t\t\t\t\t}\n\n\t\t\t\t}elseif( strstr($value,\"!<\") ){\n\t\t\t\t\t\t$value = substr($value, 2);\n\t\t\t\t\t\tif (strtolower($value) == \"empty\"){\n\t\t\t\t\t\t\t\t$sql .= \" $key <= '' AND\";\n\t\t\t\t\t\t}else if(is_int($value)){\n\t\t\t\t\t\t\t\t$sql .= \" $key <= $value AND\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$sql .= \" $key <= '$value' AND\";\n\t\t\t\t\t\t}\n\n\t\t\t\t}elseif( strstr($value,\"!>\") ){\n\t\t\t\t\t\t$value = substr($value, 2);\n\t\t\t\t\t\tif (strtolower($value) == \"empty\"){\n\t\t\t\t\t\t\t\t$sql .= \" $key >= '' AND\";\n\t\t\t\t\t\t}else if(is_int($value)){\n\t\t\t\t\t\t\t\t$sql .= \" $key >= $value AND\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$sql .= \" $key >= '$value' AND\";\n\t\t\t\t\t\t}\n\n\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif(is_int($value)){\n\t\t\t\t\t\t$sql .= \" $key LIKE $value AND\";\n\t\t\t\t\t\t}else{\n\t\t\t\t\t\t$sql .= \" $key LIKE '$value' AND\";\n\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$strCut = strlen($sql)-3;\n\t\t\t$sql = substr($sql,0,$strCut);\n\n\t\t}else{\n\n\t\t\t$sql .= \" $where \";\n\n\t\t}\n\n\t\t//envia sql para total rows\n\t\t$this->sql = $sql;\n\n\t\tif(!empty($order)) $sql .= \" ORDER BY \";\n\n\n\t\tif(is_array($order)){\n\n\t\t\tforeach ($order as $value){\n\t\t\t\t$sql .= \"$value ,\";\n\t\t\t}\n\n\t\t\t$strCut = strlen($sql)-1;\n\t\t\t$sql = substr($sql,0,$strCut);\n\n\t\t}else{\n\n\t\t\t$sql .= \" $order \";\n\n\t\t}\n\n\t\tif(!empty($tipo)) $sql .= \" $tipo \";\n\n\t\tif(!empty($limite)) $sql .= \" LIMIT $limite \";\n\n\t\t$qr = mysql_query($sql) or die($sql . \" <hr> \" . mysql_error());\n\t\t$rows = mysql_num_rows($qr);\n\n\t if($rows){\n\n\t\t\twhile ($rs = mysql_fetch_array($qr) ) {\n\n\t\t\t\t$exFetch[] = $rs;\n\n\t\t\t}\n\n\t\t}else{\n\n\t\t\t\t$exFetch = false;\n\t\t}\n\n\t\treturn $exFetch;\n\n\t}",
"function select() {\n return \"\n contact_a.id AS contact_id,\n contact_a.contact_sub_type AS contact_sub_type,\n contact_a.sort_name AS sort_name,\n source,\n created_date,\n modified_date\n \";\n }",
"function newsItem_BacaDataListing_ByKategoriSub_TidakPopuler_All( $tbl_news , $idkategori, $idkategorisub ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE idkategori = '$idkategori' AND idkategorisub = '$idkategorisub' AND dilihat < '10' ORDER BY urutan DESC, timeunix DESC \");\n\treturn $sql;\n}",
"function view_categories_sql()\n\t{\n\t\t$view_cat=mysqli_query($this->con,\"SELECT * FROM categories where status=1 order by c_id desc\");\n\t\treturn $view_cat;\n\t}",
"private function grup_sql()\n\t{\n\t\tif ($this->session->grup == 4)\n\t\t{\n\t\t\t$kf = $this->session->user;\n\t\t\t$filter_sql= \" AND a.id_user = $kf\";\n\t\t\treturn $filter_sql;\n\t\t}\n\t}",
"function GetNewsArticles($location_id = NULL){\n\tif (isset($location_id)){\n\t\t//Building the query\n\t\t$stringBuilder = \"SELECT na.*, f.location, f.`type`, c.name AS category_name, c.background_color \";\n\t\t$stringBuilder .= \"FROM news_article na \";\n\t\t$stringBuilder .= \"LEFT JOIN `file` f ON f.file_id=na.file_id \";\n\t\t$stringBuilder .= \"INNER JOIN category c ON c.category_id=na.category_id \";\n\t\t$stringBuilder .= \"WHERE (na.display_till >= NOW() && display_from <= NOW()) \";\n\t\t$stringBuilder .= \"AND na.news_article_id IN (SELECT nahl.news_article_id FROM news_article_has_location nahl WHERE nahl.location_id=?) \";\n\t\t// Preparing query\n\t\t$query = GetDatabaseConnection()->prepare($stringBuilder);\n\t\t$query->execute(array($location_id)); //Putting in the parameters\n\t\t$result = $query->fetchAll(); //Fetching it\n\t\treturn $result;\n\t} else {\n\t\t//Building the query\n\t\t$stringBuilder = \"SELECT * \";\n\t\t$stringBuilder .= \"FROM news_article na \";\n\t\t$stringBuilder .= \"JOIN news_article_has_location nahl ON na.news_article_id = nahl.news_article_id \";\n\t\t$stringBuilder .= \"JOIN file f ON na.file_id = f.file_id \";\n\t\t//$stringBuilder .= \"GROUP BY na.news_article_id\";\n\t\t// Preparing query\n\t\t$query = GetDatabaseConnection()->prepare($stringBuilder);\n\t\t$query->execute(); //Putting in the parameters\n\t\t$result = $query->fetchAll(); //Fetching it\n\t\treturn $result;\n\t}\n}",
"function newsItem_BacaDataListing_ByKategoriSub_TidakTampil_All( $tbl_news , $idkategori, $idkategorisub ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE idkategori = '$idkategori' AND idkategorisub = '$idkategorisub' AND statustampil == '0' ORDER BY urutan DESC, timeunix DESC \");\n\treturn $sql;\n}",
"private function getPosts(){\n $posts = DB::connection('mysql')->select('\n SELECT e.title, eu.titleURL, e.teaser, Date_Format(e.publishAt, \"%b %e, %Y\") AS publishDate,\n c.name AS categoryName, cu.name AS categoryURL,\n count(distinct(ed.id)) AS discussionCount,\n fsp.squareURL AS imageURL, fsp.title AS imageTitle,\n group_concat(DISTINCT concat(\"<a href=\\'/category/\", cu.name ,\"\\'>\", c.name, \"</a>\")) AS categoryNames\n FROM entries e\n INNER JOIN entryurls eu ON eu.entryId = e.id AND eu.isActive = 1 AND eu.deletedAt IS NULL\n LEFT JOIN entrycategories ec ON ec.entryId = e.id AND ec.deletedAt IS NULL\n LEFT JOIN categories c ON c.id = ec.categoryId\n LEFT JOIN categoryurls cu ON cu.categoryId = c.id AND cu.isActive = 1 AND cu.deletedAt iS NULL\n LEFT JOIN entrydiscussions ed ON ed.entryId = e.id AND ed.deletedAt IS NULL\n LEFT JOIN entryflickrsets efs ON efs.entryId = e.id AND efs.deletedAt IS NULL\n LEFT JOIN flickrsets fs ON fs.id = efs.flickrSetId AND fs.deletedAt IS NULL\n LEFT JOIN flickrcollections fc ON fc.id = fs.flickrCollectionid AND fc.deletedAt IS NULL\n LEFT JOIN flickrsetphotos fsp ON fsp.flickrSetId = fs.id AND fsp.deletedAt IS NULL\n WHERE e.deletedAt IS NULL\n GROUP BY e.id\n ORDER BY e.publishAt desc\n LIMIT 10');\n\n return $posts;\n }",
"function recup_articles()\n{\n global $connection;\n\n $sql = \"SELECT * FROM blog_link_table\n INNER JOIN users ON users.id_user = blog_link_table.id_user\n INNER JOIN blog_articles ON blog_articles.id_article = blog_link_table.id_article\n INNER JOIN blog_categorys_articles ON blog_categorys_articles.id_category_article = blog_link_table.id_category_article\n WHERE blog_articles.active_article = 1 \n ORDER BY create_article DESC\n LIMIT 4 \";\n\n $sth = $connection->prepare($sql);\n $sth->execute();\n\n $resultat = $sth->fetchAll(PDO::FETCH_OBJ);\n return $resultat;\n}",
"function newsItem_BacaDataListing_ByKategoriSub_DiLampirkan_All( $tbl_news , $idkategori, $idkategorisub ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE idkategori = '$idkategori' AND idkategorisub = '$idkategorisub' AND dilampirkan != '0' ORDER BY urutan DESC, timeunix DESC \");\n\treturn $sql;\n}",
"private function show(){\r\n\r\n global $language;\r\n $arr = array();\r\n\r\n $res = mysql_query(\"\r\n\r\n\r\n SELECT `picture`,\r\n `user_id`,\r\n `user_na`,\r\n `body`,\r\n `dates`,\r\n `ID`\r\n FROM \".USERS_SQLTBL_MAIN.\"\r\n\r\n INNER JOIN `\".PREFIX.\"comments_content` ON\r\n\r\n \".PREFIX.\"comments_content.`user_id`=`\".USERS_SQLTBL_MAIN.\"`.`userid`\r\n\r\n WHERE uri_request='{$this->request}'\r\n\r\n ORDER BY `\".PREFIX.\"comments_content`.`ID` DESC;\r\n\r\n \") or die(mysql_error());\r\n\r\n\r\n\r\n if((bool)$res) {\r\n $i=0;\r\n while( $r = mysql_fetch_array($res)){\r\n /*\r\n $arr['user_na'] = $row['user_na'];\r\n $arr['user_id'] = $row['user_id'];\r\n $arr['dates'] = $row['dates'];\r\n $arr['body'] = $row['body'];\r\n */\r\n $image = kernel::base_tag(\"/{publicfiles}users/{$r['user_na']}/{thumbs}/\".$r['picture']);\r\n\r\n if(!file_exists(ROOT.$image)){\r\n $image = kernel::base_tag(\"/{design}/users/{thumbs}/dp4-noavatar.png\");\r\n }\r\n $first=\" \";\r\n if($i ==0){$first='class=\"first\"';}\r\n\r\n\r\n $row['first'] = ($i ==0) ? 'class=\"first\"': \" \" ;\r\n $row['achor'] = \"<a name=\\\"{$row['ID']}\\\" ></a>\";\r\n $row['user_na'] = $r['user_na'];\r\n $row['user_pi'] = $image;\r\n $row['user_id'] = kernel::base_tag(\"{users}/view?id={$r['user_id']}\");\r\n $row['body'] = str_replace('\\n','<br />' ,nl2br( stripslashes($r['body']) ) );\r\n $row['dates'] = $this->admin_form($r['ID']).$r['dates'];\r\n $row['ID'] = \"\";\r\n $row['ttl_da'] = $language['md.ttl.da'];\r\n $this->output[] = theme::custom_template(\"comments\",$row) ;\r\n\r\n $i++; }\r\n\r\n }else{\r\n\r\n $this->output[] = '<p align=\"center\">' . $this->msg('md.empty.comm') .'</p>';\r\n\r\n }\r\n\r\n\r\n\r\n }",
"function newsItem_BacaDataListing_ByKategori_Headline_All( $tbl_news , $idkategori ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE idkategori = '$idkategori' AND headline != '0' ORDER BY urutan DESC, timeunix DESC \");\n\treturn $sql;\n}",
"public function liteAnalisis()\n {\n $results = DB::select(\"\n SELECT\n SUM(CASE WHEN criticidad = 'Critical' THEN 1 ELSE 0 END) as 'Critical',\n SUM(CASE WHEN criticidad = 'High' THEN 1 ELSE 0 END) as 'High',\n SUM(CASE WHEN criticidad = 'Medium' THEN 1 ELSE 0 END) as 'Medium',\n SUM(CASE WHEN criticidad = 'Low' THEN 1 ELSE 0 END) as 'Low'\n FROM(\n SELECT\n primerset.criticidad\n FROM\n ((SELECT Rel_Operador_Perfil.operador AS 'operador1', Rel_Operador_Perfil.sucursal_operador as 'sucursal1', Duty.nombre AS 'D1', Matriz.criticidad AS 'criticidad',\n Matriz.conflicto AS 'conflicto', Rel_Duty_Perfil.perfil as \\\"P1\\\"\n FROM (Rel_Operador_Perfil\n INNER JOIN Rel_Duty_Perfil ON Rel_Operador_Perfil.Operador_Perfil = Rel_Duty_Perfil.perfil\n INNER JOIN Duty ON Rel_Duty_Perfil.idduty = Duty.id\n INNER JOIN Matriz ON Duty.id = Matriz.duty1 ) )AS primerset\n \n INNER JOIN\n (SELECT Matriz.conflicto as 'conflicto2', Rel_Operador_Perfil.operador as 'operador2',Rel_Operador_Perfil.sucursal_operador as 'sucursal2', Duty.nombre AS 'D2', Rel_Duty_Perfil.perfil as \\\"P2\\\"\n FROM(Rel_Operador_Perfil\n INNER JOIN Rel_Duty_Perfil ON Rel_Operador_Perfil.Operador_Perfil = Rel_Duty_Perfil.perfil\n INNER JOIN Duty ON Rel_Duty_Perfil.idduty = Duty.id\n INNER JOIN Matriz ON Duty.id = Matriz.duty2 ) ) AS segundoset\n ON primerset.operador1 = segundoset.operador2) \n WHERE primerset.conflicto = segundoset.conflicto2\n GROUP BY primerset.operador1, primerset.D1, segundoset.D2, primerset.conflicto, primerset.criticidad,primerset.P1,segundoset.P2) AS fullset\n\");\n return $results; \n }",
"public function getArtikelByTrending()\n\t{\n\t\t$query = $this->db->query(\"SELECT * FROM kategori, posting, view, pengguna, rating WHERE posting.ID_POSTING = view.ID_POSTING AND pengguna.ID = posting.ID AND rating.ID_POSTING = rating.ID_POSTING AND kategori.ID_KATEGORI = posting.ID_KATEGORI AND posting.AKTIF ='Y' GROUP BY posting.ID_POSTING ORDER BY posting.ID_POSTING DESC LIMIT 5\")->result_array();\n //$query = $this->db->get();\n return $query;\n\t}",
"function getArticles() {\n global $db;\n $query = $db->query('SELECT * FROM article, auteur\n WHERE article.auteur_id = auteur.id ORDER BY article.id DESC');\n return $query->fetchAll();\n \n}",
"private function getSQL($active){\n\t\tif($active){\n\t\t\t$op = '>=';\n\t\t}else{\n\t\t\t$op = '<=';\n\t\t}\n\t\treturn 'SELECT `queries`.`qid`,`code`,`status`, `progress`,`url`,`quality`,`files`.`rname` as fileName FROM querydetails\n\t\t\t\tINNER JOIN queries\n\t\t\t\tON querydetails.qid = queries.qid\n\t\t\t\tLEFT JOIN files\n\t\t\t\tON querydetails.qid = files.fid\n\t\t\t\tWHERE luc '. $op .' ? AND uid = ?\n\t\t\t\tORDER BY luc DESC\n\t\t\t\tLIMIT 20';\n\t}",
"function getReviewByid(&$result,$albumID,$sqlConnection)\r\n{ \r\n\t$sqlSuccess = get_sql_results($result, $sqlConnection,\r\n\t\t\t\"select R.review, U.display_name, U.id from Reviews R, uc_users U \".\r\n\t\t\t\"where R.albumID = {$albumID} \".\r\n\t\t\t\"AND U.id = R.userID\");\r\n\treturn $sqlSuccess; \r\n}",
"function getInvReviews($invId) {\n $db = acmeConnect();\n $sql = 'SELECT reviews.reviewText, reviews.reviewDate, clients.clientFirstName, clients.clientLastName FROM reviews INNER JOIN clients ON reviews.clientId = clients.clientId WHERE invId = :invId ORDER BY reviews.reviewDate';\n $stmt = $db->prepare($sql);\n //treated as an integer\n $stmt->bindValue(':invId', $invId, PDO::PARAM_INT);\n $stmt->execute();\n //requesting an associative array \n $allReviews = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $stmt->closeCursor();\n return $allReviews;\n}",
"protected function query() {\n $query = Database::getConnection('default', $this->sourceConnection)\n ->select('og_uid', 'ogu')\n // we have a user 0 here for some stupid reason\n ->condition('uid', 0, '>')\n ->fields('ogu', array('nid', 'is_active', 'is_admin', 'uid'));\n return $query;\n }",
"function getCategories() {\n $db = connect_db();\n $sql = 'SELECT * FROM scores INNER JOIN match_users ON scores.userid = match_users.userid';\n $stmt = $db->prepare($sql);\n $stmt->execute();\n $categories = $stmt->fetchAll();\n $stmt->closeCursor();\n return $categories;\n}",
"function operasiJoinByDate($date){\n\t\t$query = $this->db->query(\"SELECT DISTINCT o.id_operasi, o.operasi, o.id_alat, a.id_kategori, o.tanggal, o.keterangan AS keterangan_operasi, a.nama_alat FROM operasi o INNER JOIN alat a ON o.id_alat = a.id_alat WHERE o.tanggal='$date' GROUP BY a.id_alat\"); \n\t\t\treturn $query->result();\n\t}",
"public function cargar_cat($com, $anu, $id){\n\n try{\n \n \n $pdo = AccesoDB::getCon();\n\n if($com == -1){\n\n $sql = \"select distinct * from (\nselect count(p.id_promo) promo,a.id_anuncio, a.nom_anuncio,a.cat_anuncio , \nIFNULL((select ROUND((sum(b.nota_puntaje)/count(b.id_puntaje)), 0) from puntaje b where a.id_anuncio = b.fk_anuncio and b.vig_puntaje = 1),0) puntaje,\nIFNULL((select i.img from img_anuncio i where a.id_anuncio = i.fk_id_anuncio order by i.id_img limit 1),'https://www.w3schools.com/bootstrap4/img_avatar1.png') img\nfrom anuncios a left join promo p on a.id_anuncio = fk_id_anuncio and p.duracion_promo > sysdate() where a.comuna_anuncio <> :com and a.vig_anuncio = 1 and a.id_anuncio <> :id and a.cat_anuncio = (select z.cat_anuncio from anuncios z where z.id_anuncio = :id) and a.fec_termino_anuncio >= sysdate() \ngroup by a.id_anuncio, a.nom_anuncio,a.cat_anuncio \nunion all\nselect count(p.id_promo) promo,a.id_anuncio, a.nom_anuncio,a.cat_anuncio , \nIFNULL((select ROUND((sum(c.nota_puntaje)/count(c.id_puntaje)), 0) from puntaje c where a.id_anuncio = c.fk_anuncio and c.vig_puntaje = 1),0) puntaje,\nIFNULL((select i.img from img_anuncio i where a.id_anuncio = i.fk_id_anuncio order by i.id_img limit 1),'https://www.w3schools.com/bootstrap4/img_avatar1.png') img\nfrom anuncios a inner join cat_anuncio b on a.cat_anuncio = b.id_cat left join promo p on a.id_anuncio = fk_id_anuncio and p.duracion_promo > sysdate()\nwhere b.nom_cat like :anu and a.comuna_anuncio <> :com and a.vig_anuncio = 1 and a.id_anuncio <> :id and a.fec_termino_anuncio >= sysdate() \ngroup by a.id_anuncio, a.nom_anuncio,a.cat_anuncio ) a\";\n\n\n\n }elseif ($com == 0) {\n $sql = \"select distinct * from (\nselect count(p.id_promo) promo,a.id_anuncio, a.nom_anuncio,a.cat_anuncio , \nIFNULL((select ROUND((sum(b.nota_puntaje)/count(b.id_puntaje)), 0) from puntaje b where a.id_anuncio = b.fk_anuncio and b.vig_puntaje = 1),0) puntaje,\nIFNULL((select i.img from img_anuncio i where a.id_anuncio = i.fk_id_anuncio order by i.id_img limit 1),'https://www.w3schools.com/bootstrap4/img_avatar1.png') img\nfrom anuncios a left join promo p on a.id_anuncio = fk_id_anuncio and p.duracion_promo > sysdate() where (a.nom_anuncio like :anu or a.desc_anuncio like :anu) and a.vig_anuncio = 1 and a.id_anuncio <> :id and a.fec_termino_anuncio >= sysdate() \ngroup by a.id_anuncio, a.nom_anuncio,a.cat_anuncio \nunion all\nselect count(p.id_promo) promo,a.id_anuncio, a.nom_anuncio,a.cat_anuncio , \nIFNULL((select ROUND((sum(c.nota_puntaje)/count(c.id_puntaje)), 0) from puntaje c where a.id_anuncio = c.fk_anuncio and c.vig_puntaje = 1),0) puntaje,\nIFNULL((select i.img from img_anuncio i where a.id_anuncio = i.fk_id_anuncio order by i.id_img limit 1),'https://www.w3schools.com/bootstrap4/img_avatar1.png') img\nfrom anuncios a inner join cat_anuncio b on a.cat_anuncio = b.id_cat left join promo p on a.id_anuncio = fk_id_anuncio and p.duracion_promo > sysdate()\nwhere b.nom_cat like :anu and a.vig_anuncio = 1 and a.id_anuncio <> :id and a.fec_termino_anuncio >= sysdate() \ngroup by a.id_anuncio, a.nom_anuncio,a.cat_anuncio ) a\";\n \n\n\n\n\n }else{\n\n \n\n $sql = \"select distinct * from (\nselect count(p.id_promo) promo,a.id_anuncio, a.nom_anuncio,a.cat_anuncio , \nIFNULL((select ROUND((sum(b.nota_puntaje)/count(b.id_puntaje)), 0) from puntaje b where a.id_anuncio = b.fk_anuncio and b.vig_puntaje = 1),0) puntaje,\nIFNULL((select i.img from img_anuncio i where a.id_anuncio = i.fk_id_anuncio order by i.id_img limit 1),'https://www.w3schools.com/bootstrap4/img_avatar1.png') img\nfrom anuncios a left join promo p on a.id_anuncio = fk_id_anuncio and p.duracion_promo > sysdate() where (a.nom_anuncio like :anu or a.desc_anuncio like :anu) and (a.comuna_anuncio = 1 or a.comuna_anuncio = 0) and a.vig_anuncio = 1 and a.id_anuncio <> :id and a.fec_termino_anuncio >= sysdate() \ngroup by a.id_anuncio, a.nom_anuncio,a.cat_anuncio \nunion all\nselect count(p.id_promo) promo,a.id_anuncio, a.nom_anuncio,a.cat_anuncio , \nIFNULL((select ROUND((sum(c.nota_puntaje)/count(c.id_puntaje)), 0) from puntaje c where a.id_anuncio = c.fk_anuncio and c.vig_puntaje = 1),0) puntaje,\nIFNULL((select i.img from img_anuncio i where a.id_anuncio = i.fk_id_anuncio order by i.id_img limit 1),'https://www.w3schools.com/bootstrap4/img_avatar1.png') img\nfrom anuncios a inner join cat_anuncio b on a.cat_anuncio = b.id_cat left join promo p on a.id_anuncio = fk_id_anuncio and p.duracion_promo > sysdate()\nwhere b.nom_cat like :anu and (a.comuna_anuncio = 1 or a.comuna_anuncio = 0) and a.vig_anuncio = 1 and a.id_anuncio <> :id and a.fec_termino_anuncio >= sysdate() \ngroup by a.id_anuncio, a.nom_anuncio,a.cat_anuncio ) a\";\n}\n \n \n \n \n \n $anu = \"%\".$anu.\"%\"; \n \n \n\n $stmt = $pdo->prepare($sql);\n $stmt->bindParam(\":anu\", $anu, PDO::PARAM_STR);\n $stmt->bindParam(\":com\", $com, PDO::PARAM_INT);\n $stmt->bindParam(\":id\", $id, PDO::PARAM_INT);\n $stmt->execute();\n\n $response = $stmt->fetchAll();\n return $response;\n\n } catch (Exception $e) {\n echo\"<script type=\\\"text/javascript\\\">alert('Error, comuniquese con el administrador\". $e->getMessage().\" '); </script>\";\n }\n }",
"public function pagadaall(){\n$sql = $this->db->query(\"SELECT pago_factura.*, facturas.id_factura FROM pago_factura INNER JOIN facturas ON pago_factura.factura_id = facturas.id\");\nreturn $sql;\n}",
"function getUserImages($user_id) {\n\n \n $sql = \"select name from images where user_id = :user_id\";\n try {\n $stmnt = $this->conn->prepare($sql);\n $params = [\n 'user_id' => $user_id\n ];\n $stmnt->execute($params);\n\n while ($row = $stmnt->fetch()) {\n echo <<<HTM\n \n <div class=\"gallery_product col-lg-4 col-md-4 col-sm-4 col-xs-6 filter hdpe\">\n <img src=\"img/{$row['name']}\" class=\"img-responsive\">\n </div>\n \nHTM;\n \n }\n \n }\n \n Catch (PDOException $e) {\n $e = new ErrorView([\n 'message' => $e->getMessage(),\n 'code' => $e->getCode()\n ]);\n }\n }",
"function showAllData($userID){\n $result = false;\n\n $alldateAgenda = \"(SELECT events.date FROM events WHERE FKusers = '$userID') UNION\n (SELECT `event-recurrence`.date FROM `event-recurrence` INNER JOIN events ON events.ID = `event-recurrence`.FKevents WHERE FKusers = '$userID')\";\n\n require_once 'model/dbConnector.php';\n\n $result = executeQuerySelect($alldateAgenda);\n\n return $result;\n}",
"function newsItem_BacaDataListing_ByKategoriSub_Terkini_All( $tbl_news , $idkategori, $idkategorisub ){\n\t$sql = mysql_query(\"SELECT * FROM $tbl_news WHERE idkategori = '$idkategori' AND idkategorisub = '$idkategorisub' ORDER BY urutan DESC, timeunix DESC \");\n\treturn $sql;\n}",
"function get_user($limit)\r\n {\r\n //$query=$this->db->query(\"SELECT *FROM user INNER JOIN division ON user.storeid=division.storeid WHERE \");\r\n/*$this->db->select('user.first_name,user.last_name,user.emailid,user.phone,user.fax,user.userid,user.storeid,user.isactive,\r\ndivision.store_name,division.division_type,division.divisionid');\r\n $this->db->from('user,division,user_division');\r\n $this->db->where('(user.userid=user_division.userid)');\r\n $this->db->where('(user.storeid=division.storeid)');\r\n $this->db->WHERE ('(user.storeid !=123456)');\r\n $this->db->group_by('user_division.userid');\r\n //$this->db->limit($limit);\r\n \r\n $query = $this->db->get();\r\necho $this->db->last_query();*/\r\n$query=$this->db->query(\"SELECT *FROM user INNER join division ON user.storeid=division.storeid $limit\");\r\n\r\n return $query->result_array(); \r\n }",
"function profileViewResult($conn,$id){\r\n\t\t$userId = $_SESSION['userId'];\r\n\t\t$query =\"select profile.profile_id,name,email,web_address,cover_letter,question,ip,resume_file,\r\n\t\t\t\tROUND(AVG(public_review.rating),1) as 'public_rating',\r\n\t\t\t\tmy_review.rating as 'my_rating'\r\n\t\t\t\tfrom profile\r\n\t\t\t\tleft join reviews as public_review ON public_review.profile_id = profile.profile_id\r\n\t\t\t\tleft join reviews as my_review ON ( my_review.profile_id = profile.profile_id\r\n\t\t\t\tAND my_review.user_id = '\".$userId.\"' )\r\n\t\t\t\twhere profile.profile_id = '\".$id.\"'\";\r\n\t\t$result =$conn->query($query);\r\n\t\t$resultSet = array();\r\n\t\t$i = 0;\r\n\t\tif($result->num_rows > 0){\r\n\t\t\twhile($row = $result->fetch_object()) {\r\n\t\t\t\t$resultSet[$i]['id'] = $row->profile_id;\r\n\t\t\t\t$resultSet[$i]['name'] = $row->name;\r\n\t\t\t\t$resultSet[$i]['email'] = $row->email;\r\n\t\t\t\t$resultSet[$i]['web_address'] = $row->web_address;\r\n\t\t\t\t$resultSet[$i]['cover_letter'] = $row->cover_letter;\r\n\t\t\t\t$resultSet[$i]['question'] = $row->question;\r\n\t\t\t\t$resultSet[$i]['ip'] = $row->ip;\r\n\t\t\t\t$resultSet[$i]['resume_file'] = $row->resume_file;\r\n\t\t\t\t$resultSet[$i]['public_rating'] = $row->public_rating;\r\n\t\t\t\t$resultSet[$i]['my_rating'] = $row->my_rating;\r\n\t\t\t\t$i++;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif(count($resultSet) > 0) {\r\n\t\t\t$resultArr['message'] = 'success';\r\n\t\t\t$resultArr['list'] = $resultSet;\r\n\t\t} else\r\n\t\t\t$resultArr['message'] = 'No Result Found';\r\n\t\treturn $resultArr;\r\n\t}"
] | [
"0.6305692",
"0.60058445",
"0.60003173",
"0.5996246",
"0.5984495",
"0.5952321",
"0.58136487",
"0.5813125",
"0.5808324",
"0.5787987",
"0.5780573",
"0.57668895",
"0.5736544",
"0.57307285",
"0.57198524",
"0.56948423",
"0.56886464",
"0.5685858",
"0.5682705",
"0.566901",
"0.56476635",
"0.5645976",
"0.5608379",
"0.5599877",
"0.55997264",
"0.556535",
"0.55624354",
"0.5557473",
"0.5553706",
"0.5548038",
"0.55134296",
"0.5512325",
"0.55106646",
"0.55075204",
"0.5507466",
"0.5503718",
"0.5503",
"0.55029964",
"0.5498208",
"0.5481253",
"0.54796684",
"0.5465789",
"0.54593855",
"0.54530764",
"0.5443115",
"0.5439724",
"0.5436881",
"0.54327375",
"0.5424445",
"0.5423183",
"0.5410793",
"0.5410363",
"0.54012233",
"0.53890294",
"0.538547",
"0.5385297",
"0.5382788",
"0.5376011",
"0.5369653",
"0.5362723",
"0.536039",
"0.5358418",
"0.5357573",
"0.535675",
"0.53525305",
"0.5349587",
"0.5349072",
"0.53480864",
"0.5346896",
"0.53416026",
"0.5340975",
"0.5338265",
"0.5336146",
"0.53323895",
"0.5324671",
"0.532424",
"0.53198636",
"0.531679",
"0.5316374",
"0.53116876",
"0.5310797",
"0.5310125",
"0.53036016",
"0.53027374",
"0.5300052",
"0.5299499",
"0.52971464",
"0.5291143",
"0.5287685",
"0.52866536",
"0.52802825",
"0.5279577",
"0.52741045",
"0.52729774",
"0.52713233",
"0.52677184",
"0.5267479",
"0.5265383",
"0.5263707",
"0.5262883"
] | 0.5619089 | 22 |
Affiche les restaurant d'un theme | public function themeAction($param=null){
$theme = Theme::findAll();
$donne = array('resto'=> $theme);
$int = 1;
foreach ($theme as $i){
$resto = Restaurant::findByIdTheme($i->id);
$donne[$int]=$resto;
$int++;
}
$a = new Affichage($donne);
$a->body($param['act']);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function show_restaurants()\n \t{\n\t\t\t$conn = connect_to_server();\n\t \t\t$sql = \"SELECT nazev, id_provozovna FROM Provozovna;\";\n\t \t\t\n\t \t\tif ($result = $conn->query($sql))\n\t \t\t\t// output data of each row\n\t\t \t\twhile($row = $result->fetch_assoc()) {\n\t\t \techo \"<a href=\\\"projekt.php?show_food_list=\". $row[\"id_provozovna\"]. \"\\\">\". $row[\"nazev\"]. \"</a><br>\";\n\t\t \t}\n\t\t}",
"function display_themes()\n {\n }",
"public function getAllThemes();",
"public function allRest(){\n\t\t$restaurantes = DB::SELECT('SELECT * FROM pf.res_restaurants where restaurant_id = parent_restaurant_id and activate = 1');\n\t\t$landing = LandingPage::select('header','logo','landing_page_id')->get();\n\n\t\treturn View::make('web.restaurantes')\n\t\t\t->with('restaurantes', $restaurantes)\n\t\t\t->with('landing', $landing);\n\t}",
"public function getAllRestaurants() {\n return view('pages.test.restaurants', ['restaurants'=>Restaurant::all()]);\n }",
"function get_themes()\n {\n }",
"public function index ()\n {\n $dbHandler = Lib\\DbHandler::getDbHandler();\n //objekte in ein array\n $list = $dbHandler->getRestaurants();\n $view = new View\\ShowRestaurant();\n $view->setVars($list);\n //echo $view->render();\n $view->show($view);\n }",
"public function theme() {\n \treturn array(\n \t\t'node_list' => array(\n \t\t\t'template' => 'node-list',\n \t\t\t'path' => drupal_get_path('module', 'scf') . '/theme',\n \t\t\t'arguments' => array(\n \t\t\t\t'items' => array(),\n \t\t\t\t'title' => NULL,\n \t\t\t\t'nid' => NULL,\n \t\t\t\t'haslink' => NULL,\n \t\t\t\t'associations' => array(),\n \t 'name' => NULL,\n \t 'form' => NULL,\n \t\t\t)\t\n \t\t)\n \t);\n }",
"public function theme()\n {\n }",
"public function index()\n {\n return view('admin.theme.overview', [\n 'themes' => Theme::all(),\n ]);\n }",
"public function index()\n {\n return view('site::admin.academy_theme.index', [\n 'repository' => $this->academyThemes,\n 'academyThemes' => $this->academyThemes->paginate(config('site.per_page.academy_theme', 100), ['academy_themes.*'])\n ]);\n }",
"public function retrieveThemes()\n {\n return $this->start()->uri(\"/api/theme\")\n ->get()\n ->go();\n }",
"public function themes()\n {\n return R::findAll('theme', 'order by name');\n }",
"public function run()\n {\n $themes = array(\n array('id' => '1','name' => 'Atliekų perdirbimas ir antrinis panaudojimas gamyboje','main_theme' => 'ECO','theme_number' => '1','created_at' => NULL,'updated_at' => NULL,'min_old' => NULL,'max_old' => NULL,'type' => NULL),\n array('id' => '2','name' => 'Ekologinis gaminių projektavimas','main_theme' => 'ECO','theme_number' => '2','created_at' => NULL,'updated_at' => NULL,'min_old' => NULL,'max_old' => NULL,'type' => NULL),\n array('id' => '3','name' => 'Taršos prevencija','main_theme' => 'ECO','theme_number' => '3','created_at' => NULL,'updated_at' => NULL,'min_old' => NULL,'max_old' => NULL,'type' => NULL),\n array('id' => '4','name' => 'Ekoinovacijų diegimas','main_theme' => 'ECO','theme_number' => '4','created_at' => NULL,'updated_at' => NULL,'min_old' => NULL,'max_old' => NULL,'type' => NULL),\n array('id' => '5','name' => 'Aplinkosaugos vadybos sistemų diegimas','main_theme' => 'ECO','theme_number' => '5','created_at' => NULL,'updated_at' => NULL,'min_old' => NULL,'max_old' => NULL,'type' => NULL),\n array('id' => '6','name' => 'Pasirengimo eksportui veiksmų planas','main_theme' => 'EXPO','theme_number' => '1','created_at' => NULL,'updated_at' => NULL,'min_old' => NULL,'max_old' => '3','type' => 'IKI3'),\n array('id' => '7','name' => 'Eksporto strategija','main_theme' => 'EXPO','theme_number' => '2','created_at' => NULL,'updated_at' => NULL,'min_old' => '3','max_old' => NULL,'type' => 'PO3'),\n array('id' => '8','name' => 'Tikslinių eksporto rinkų pasirinkimas ir išorinė komunikacija','main_theme' => 'EXPO','theme_number' => '3','created_at' => NULL,'updated_at' => NULL,'min_old' => '3','max_old' => NULL,'type' => 'PO3'),\n array('id' => '9','name' => 'Tarptautinės prekybos teisiniai aspektai ir sertifikavimas užsienio rinkose','main_theme' => 'EXPO','theme_number' => '4','created_at' => NULL,'updated_at' => NULL,'min_old' => '3','max_old' => NULL,'type' => 'PO3'),\n array('id' => '10','name' => 'Techniniai ir gamybiniai eksporto aspektai','main_theme' => 'EXPO','theme_number' => '5','created_at' => NULL,'updated_at' => NULL,'min_old' => '3','max_old' => NULL,'type' => 'PO3'),\n array('id' => '11','name' => 'Eksporto rizikos valdymas','main_theme' => 'EXPO','theme_number' => '6','created_at' => NULL,'updated_at' => NULL,'min_old' => '3','max_old' => NULL,'type' => 'PO3'),\n array('id' => '12','name' => 'Verslo planavimas','main_theme' => 'VKT','theme_number' => '1','created_at' => NULL,'updated_at' => NULL,'min_old' => NULL,'max_old' => '1','type' => 'PR'),\n array('id' => '13','name' => 'Mokesčiai ir buhalterinė apskaita','main_theme' => 'VKT','theme_number' => '2','created_at' => NULL,'updated_at' => NULL,'min_old' => NULL,'max_old' => '1','type' => 'PR'),\n array('id' => '14','name' => 'Parama verslui, verslo finansavimo šaltiniai','main_theme' => 'VKT','theme_number' => '3','created_at' => NULL,'updated_at' => NULL,'min_old' => NULL,'max_old' => '1','type' => 'PR'),\n array('id' => '15','name' => 'Produkto, paslaugos tobulinimas','main_theme' => 'VKT','theme_number' => '4','created_at' => NULL,'updated_at' => NULL,'min_old' => NULL,'max_old' => '1','type' => 'PR'),\n array('id' => '16','name' => 'Pardavimas','main_theme' => 'VKT','theme_number' => '5','created_at' => NULL,'updated_at' => NULL,'min_old' => NULL,'max_old' => '1','type' => 'PR'),\n array('id' => '17','name' => 'Rinkodara','main_theme' => 'VKT','theme_number' => '6','created_at' => NULL,'updated_at' => NULL,'min_old' => NULL,'max_old' => '1','type' => 'PR'),\n array('id' => '18','name' => 'Sutarčių sudarymas ir valdymas','main_theme' => 'VKT','theme_number' => '7','created_at' => NULL,'updated_at' => NULL,'min_old' => NULL,'max_old' => '1','type' => 'PR'),\n array('id' => '19','name' => 'Dokumentų rengimas ir valdymas','main_theme' => 'VKT','theme_number' => '8','created_at' => NULL,'updated_at' => NULL,'min_old' => NULL,'max_old' => '1','type' => 'PR'),\n array('id' => '20','name' => 'Personalo valdymas, darbo teisė ir sauga','main_theme' => 'VKT','theme_number' => '9','created_at' => NULL,'updated_at' => NULL,'min_old' => NULL,'max_old' => '1','type' => 'PR'),\n array('id' => '21','name' => 'Socialinis verslas','main_theme' => 'VKT','theme_number' => '10','created_at' => NULL,'updated_at' => NULL,'min_old' => NULL,'max_old' => '1','type' => 'PR'),\n array('id' => '22','name' => 'Įmonės strategija','main_theme' => 'VKT','theme_number' => '11','created_at' => NULL,'updated_at' => NULL,'min_old' => '1','max_old' => '5','type' => 'PL'),\n array('id' => '23','name' => 'Įmonės veiklos procesai ir veiklos efektyvumas','main_theme' => 'VKT','theme_number' => '12','created_at' => NULL,'updated_at' => NULL,'min_old' => '1','max_old' => '5','type' => 'PL'),\n array('id' => '24','name' => 'Rinkodara, įmonės įvaizdžio formavimas','main_theme' => 'VKT','theme_number' => '13','created_at' => NULL,'updated_at' => NULL,'min_old' => '1','max_old' => '5','type' => 'PL'),\n array('id' => '25','name' => 'Įmonės finansų valdymas','main_theme' => 'VKT','theme_number' => '14','created_at' => NULL,'updated_at' => NULL,'min_old' => '1','max_old' => '5','type' => 'PL'),\n array('id' => '26','name' => 'Pardavimas ir derybos','main_theme' => 'VKT','theme_number' => '15','created_at' => NULL,'updated_at' => NULL,'min_old' => '1','max_old' => '5','type' => 'PL'),\n array('id' => '27','name' => 'Investicijos ir finansavimo šaltiniai','main_theme' => 'VKT','theme_number' => '16','created_at' => NULL,'updated_at' => NULL,'min_old' => '1','max_old' => '5','type' => 'PL'),\n array('id' => '28','name' => 'Teisiniai aspektai','main_theme' => 'VKT','theme_number' => '17','created_at' => NULL,'updated_at' => NULL,'min_old' => '1','max_old' => '5','type' => 'PL'),\n array('id' => '29','name' => 'Projektų valdymas','main_theme' => 'VKT','theme_number' => '18','created_at' => NULL,'updated_at' => NULL,'min_old' => '1','max_old' => '5','type' => 'PL'),\n array('id' => '30','name' => 'Socialinis verslas','main_theme' => 'VKT','theme_number' => '19','created_at' => NULL,'updated_at' => NULL,'min_old' => '1','max_old' => '5','type' => 'PL')\n );\n\n Theme::truncate();\n\n foreach ($themes as $theme) {\n Theme::create($theme);\n }\n }",
"function display_theme($theme)\n {\n }",
"private function GererRestos() {\r\n if (isset($_GET['limiteBasse'])) {\r\n $limiteBasse = $_GET['limiteBasse'];\r\n } else {\r\n $limiteBasse = $_GET['limiteBasse'] = 0;\r\n }\r\n // -- Determine la pagination de l'affichage des restaurants\r\n $this->pagination = 50;\r\n $this->RestosCount = $this->CNX->countRestos();\r\n if ($this->action != \"Accueil\") {\r\n $this->afficherRestos = $this->CNX->showRestos(null, $limiteBasse, $this->pagination);\r\n $this->action = \"GererRestos\";\r\n } else {\r\n $this->afficherRestos = $this->CNX->showRestosAccueil(null, $limiteBasse, $this->pagination);\r\n }\r\n }",
"public function render_section_themes_description() {\n\t\t_e( 'Choose themes to make available in your SatisPress repository.', 'satispress' );\n\t}",
"public function viewtheme_select()\n\t{\n\t\t$site=array();$i=1;\t\n\n\t\t$query = $this->db->get_where(\"theme_select\",array(\"status\"=>1))->row()->color;\n\t\t\n\t\t$data['get_table'] = $this->db->get(\"theme_select\");\n\t\t$data['color']= $query ;\n\t\t$data['message']=\"\";\n\t \t$data['message_element'] = \"administrator/viewtheme_select\";\n\t\t$this->load->view('administrator/admin_template', $data);\n\t \t\t\t\n\t}",
"public function views() {\n\t\t$views = $this->get_views();\n\n\t\t/** This filter is documented in wp-admin/inclues/class-wp-list-table.php */\n\t\t$views = apply_filters( \"views_{$this->screen->id}\", $views );\n\n\t\t$this->screen->render_screen_reader_content( 'heading_views' );\n?>\n<div class=\"wp-filter\">\n\t<ul class=\"filter-links\">\n\t\t<?php\n\t\tif ( ! empty( $views ) ) {\n\t\t\tforeach ( $views as $class => $view ) {\n\t\t\t\t$views[ $class ] = \"\\t<li class='$class'>$view\";\n\t\t\t}\n\t\t\techo implode( \" </li>\\n\", $views ) . \"</li>\\n\";\n\t\t}\n\t\t?>\n\t</ul>\n\n\t<?php install_search_form(); ?>\n</div>\n<?php\n\t}",
"public function index_all()\n {\n //\n \n \n \n $factureStylimmos = Facture::whereIn('type',['stylimmo','avoir','pack_pub','carte_visite','communication','autre','forfait_entree','cci'])->latest()->get(); \n \n \n \n return view ('facture.index_all',compact('factureStylimmos'));\n }",
"public function themes(){\r\n\t\t\r\n\t\treturn $this->module_themes();\r\n\t}",
"public function indexAction()\n {\n $themes = XOOPS::service('registry')->themelist->read('active');\n foreach ($themes as $key => &$theme) {\n $theme[\"upgrade\"] = $this->checkUpgrade($key, $theme[\"version\"]);\n }\n $this->template->assign(\"themes_active\", $themes);\n $themes = XOOPS::service('registry')->themelist->read('inactive');\n foreach ($themes as $key => &$theme) {\n $theme[\"upgrade\"] = $this->checkUpgrade($key, $theme[\"version\"]);\n }\n $this->template->assign(\"themes_inactive\", $themes);\n $this->setTemplate(\"theme_list.html\");\n }",
"public function indexAction()\n {\n return $this->render('BugglMainBundle:Admin/TripTheme:triptheme.html.twig');\n }",
"public function index(){\n /* $restaurante= PaginaRestaurante::all();\n \n $peruano= PaginaPeruano::all();\n $extranjero= PaginaExtranjero::all();\n $comunidad= PaginaComunidad::all(); */\n $destinos= PaginaDestino::all(); \n return view('adminweb.restaurantes.index',compact(\"destinos\"));\n }",
"public function allRestaurants()\n {\n $compQuery = Company::where([\n 'active' => 1,\n 'companytype_id' => 1, // restaurants\n ])->get();\n\n $companies = new collection();\n\n foreach ($compQuery as $company) {\n $companies->push([\n 'id' => $company->id,\n 'area_id' => $company->area_id,\n 'name' => $company->name,\n 'slug' => $company->slug,\n 'rating' => intval($company->rating),\n 'description' => $company->description,\n 'address' => $company->address,\n 'image' => Front::myMediaUrl($company, 'company_image', 'banner'),\n ]);\n }\n // dd($companies);\n\n $pageConfigs = [\n 'newsletter' => true,\n 'breadcrumb' => true,\n 'title' => 'Abboda Restaurants',\n ];\n return view('pages.restaturants', [\n 'pageConfigs' => $pageConfigs,\n 'companies' => $companies->toArray(),\n ]);\n }",
"function index()\n {\n $data['theme'] = $this->Theme_model->get_all_theme();\n \n $data['_view'] = 'theme/index';\n $this->load->view('layouts/main',$data);\n }",
"public static function themes()\n {\n return Theme::all()->where('sttema', '=', 'apr')->toArray();\n }",
"function preview_theme()\n {\n }",
"function training_theme_html() {\n $array_items = array(\n l(t('List'), 'training/theme/list'),\n l(t('Table'), 'training/theme/table'),\n l(t('Image'), 'training/theme/image'),\n l(t('Access'), 'training/theme/access'),\n );\n\n return theme('item_list', array(\n 'items' => $array_items,\n 'type' => 'ol',\n 'title' => t('Links to themes'),\n ));\n}",
"public function theme_installer()\n {\n }",
"public function index()\n {\n $theme = Theme::uses(Setting::get('current_theme', 'default'))->layout('guest');\n $theme->setTitle(Setting::get('site_title').' '.Setting::get('title_seperator').' '.Setting::get('site_tagline'));\n return $theme->scope('landing')->render();\n }",
"public function theme_info($theme = \\null)\n {\n }",
"function show_food_list_by_rest()\n\t{\n\t\trequire(\"connection_credentials.php\");\n\t\ttry {\n\t\t\t$pdo = new PDO($dsn, $username, $password);\n\t\t} \n\t\tcatch (Exception $e) {\n\t\t\techo \"Connection error: \".$e->getMessage();\n\t\t\tdie();\n\t\t}\n\n\t\t$stmt = $pdo->prepare('SELECT nazev FROM Provozovna WHERE id_provozovna=?');\n\t\t\t\t\n\t\t$stmt->execute(array($_GET['show_food_list_by_rest_action']));\n\t\t$result = $stmt->fetch();\n\t\t\n\t\tglobal $name_of_rest;\n\t\t$name_of_rest = $result['nazev'];\n\n\n\t\t$stmt = $pdo->prepare('SELECT id_polozka, nazev, popis, cena, cas_platnosti, pocet, kategorie FROM Polozka WHERE id_provozovna=? ORDER BY FIELD(kategorie, \"predkrm\",\"polevka\", \"hlavni jidlo\", \"dezert\", \"napoj\")');\n\t\t$stmt->execute(array($_GET['show_food_list_by_rest_action']));\n\n\t\t$result = $stmt->fetchall();\n\t\t\n\t\t$count_of_items = count($result);\n\t\t$i = 0;\n\t\t\n\t\tglobal $html_output;\n\n\t\tforeach ($result as $row) {\n\n\n\t\t\tif($i % 4 == 0)\n\t\t\t{\n\t\t\t\t$html_output .= \"<div class=\\\"row\\\">\";\n\t\t\t}\n\t\t\t\n\n\t\t\t// Nacteni obrazku\n\t\t\tif(file_exists(\"uploads/\". $row[\"id_polozka\"]))\n\t\t\t{\n\t\t\t\t$img_src = 'uploads/'. $row[\"id_polozka\"];\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$img_src = 'uploads/unknown.png';\t\t\t\t\t\t\t\n\t\t\t}\n\n\t\t\t$html_output .='\n\t\t\t<div class=\"col-md-3 d-flex\" style=\"padding: 0.5vw;\">\n\t\t\t\t<div class=\"item\">\n\t\t\t\t\t<div class=\"item_image\"><img src=\"' . $img_src .'\" alt=\"Obrázek položky\" height=\"200\"></div>\n\t\t\t\t\t<div class=\"item_content\">\n\t\t\t\t\t\t<span>' . $row[\"nazev\"] . '</span><br>' . $row[\"popis\"] . '<br>' . '\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"item_to_cart\">\n\t\t\t\t\t\t<form class=\"m-auto\" action=\"restaurants.php\" method=\"post\">\n\t\t\t\t\t\t<span class=\"btn btn-dark\"> '.$row[\"cena\"] .' Kč</span>';\n\t\t\tif ($row['cas_platnosti'] == \"trvala\" or ($row['cas_platnosti'] == \"denni\" and $row['pocet'] > 0)) {\t\t\t\t\n\t\t\t\t$html_output .= '<input name=\"buy_item\" class=\"btn btn-info\" type=\"submit\" value=\"Vložit do košíku\" />';\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Položka je vyprodaná\n\t\t\t\t$html_output .= '<input disbaled name=\"buy_item\" class=\"btn btn-info\" type=\"submit\" value=\"Vyprodané\" disabled/>';\n\t\t\t}\n\t\t\t$html_output .= '\n\t\t\t\t\t\t\t<input name=\"item_id\" type=\"hidden\" value=\"' . $row[\"id_polozka\"] . '\">\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t';\n\n\t\t\tif(((($i+1) % 4 == 0) and ($i != 0)) or ($i == ($count_of_items-1)))\n\t\t\t{\n\t\t\t\t$html_output .= \"</div>\";\n\t\t\t}\n\n\t\t\t$i++;\n\t\t}\n\t}",
"function current_theme_info()\n {\n }",
"public function getTheme();",
"public function index()\n {\n\t\t$restaurants = Restaurant::paginate(10);\n return view('admin.restaurant.index', compact('restaurants'));\n }",
"public function Index() {\n\t\t\t$Plantilla = new NeuralPlantillasTwig('Tienda');\n\t\t\t$Plantilla->Parametro('Consulta', $this->Modelo->Listado());\n\t\t\t$Plantilla->Filtro('HexASCII', function ($Parametro) { return AppHexAsciiHex::ASCII_HEX($Parametro); });\n\t\t\techo $Plantilla->MostrarPlantilla('Proveedor/Listado.html');\n\t\t}",
"function theme($tipo=\"link\"){\n\t\n\t$theme_encontrado=0;\n\tif($theme_encontrado>=1){\n\t}else{\n\t\t$theme=\"default\";\n\t}\n\t\t\n\tglobal $AYV;\t\n\t\n\tif($tipo==\"dir\"){\n\t\treturn DIR_WEB.'/themes/'.$theme;\t\t\n\t}else{\n\t\treturn URL_WEB.'/themes/'.$theme;\t\t\n\t}\n\n}",
"function list_theme_updates()\n {\n }",
"public function restaurant_packages() {\n\t global $foodbakery_plugin_options, $restaurant_add_counter;\n\n\t $html = '';\n\n\t $restaurant_up_visi = 'block';\n\t $restaurant_hide_btn = 'none';\n\n\t $get_restaurant_id = foodbakery_get_input('restaurant_id', 0);\n\t if ($get_restaurant_id != '' && $get_restaurant_id != 0 && $this->is_publisher_restaurant($get_restaurant_id)) {\n\t\t$restaurant_up_visi = 'none';\n\t\t$restaurant_hide_btn = 'inline-block';\n\t }\n\n\t $show_li = false;\n\t $show_pgt = false;\n\n\t $foodbakery_free_restaurants_switch = isset($foodbakery_plugin_options['foodbakery_free_restaurants_switch']) ? $foodbakery_plugin_options['foodbakery_free_restaurants_switch'] : '';\n\t $foodbakery_currency_sign = isset($foodbakery_plugin_options['foodbakery_currency_sign']) ? $foodbakery_plugin_options['foodbakery_currency_sign'] : '$';\n\n\t if ($foodbakery_free_restaurants_switch != 'on') {\n\n\t\t// subscribed packages list\n\t\t//$subscribed_active_pkgs = $this->restaurant_user_subscribed_packages();\n\t\t$subscribed_active_pkgs = '';\n\n\t\tif (isset($_GET['package_id']) && $_GET['package_id'] != '') {\n\t\t $subscribed_active_pkgs = '';\n\t\t $buying_pkg_id = $_GET['package_id'];\n\t\t}\n\t\t$new_pkg_btn_visibility = 'none';\n\t\t$new_pkgs_visibility = 'block';\n\t\tif ($subscribed_active_pkgs) {\n\t\t $new_pkg_btn_visibility = 'block';\n\t\t $new_pkgs_visibility = 'none';\n\t\t}\n\n\t\t// Memberships\n\t\t$packages_list = '';\n\t\t$args = array('posts_per_page' => '-1', 'post_type' => 'packages', 'orderby' => 'title', 'post_status' => 'publish', 'order' => 'ASC');\n\t\t$cust_query = get_posts($args);\n\t\tif (is_array($cust_query) && sizeof($cust_query) > 0) {\n\t\t $opts_counter = 1;\n\t\t $packages_list_opts = '<div class=\"all-pckgs-sec\">';\n\t\t foreach ($cust_query as $package_post) {\n\t\t\tif (isset($package_post->ID)) {\n\t\t\t $show_li = true;\n\t\t\t $packg_title = $package_post->ID != '' ? get_the_title($package_post->ID) : '';\n\t\t\t $package_type = get_post_meta($package_post->ID, 'foodbakery_package_type', true);\n\t\t\t $package_price = get_post_meta($package_post->ID, 'foodbakery_package_price', true);\n\t\t\t $pckg_color = '';\n\t\t\t if (isset($buying_pkg_id) && $buying_pkg_id == $package_post->ID) {\n\t\t\t\t$pckg_color = ' style=\"background-color: #b7b7b7;\"';\n\t\t\t }\n\t\t\t $packages_list_opts .= '<div class=\"foodbakery-pkg-holder\">';\n\t\t\t $packages_list_opts .= '<div class=\"foodbakery-pkg-header\"' . $pckg_color . '>';\n\t\t\t $packages_list_opts .= '\n\t\t\t\t\t\t\t<div class=\"pkg-title-price pull-left\">\n\t\t\t\t\t\t\t\t<div class=\"radio-holder\">\n\t\t\t\t\t\t\t\t <div class=\"input-radio\">\n\t\t\t\t\t\t\t\t\t<input type=\"radio\" id=\"package-' . $package_post->ID . '\" name=\"foodbakery_restaurant_package\"' . (isset($buying_pkg_id) && $buying_pkg_id == $package_post->ID ? ' checked=\"checked\"' : '') . ' value=\"' . $package_post->ID . '\">\n\t\t\t\t\t\t\t\t <input type=\"hidden\" id=\"package-' . $package_post->ID . '\" name=\"' . $package_post->ID . '\" value=\"' . $package_type . '\">\n\t\t\t\t\t\t\t\t\t<label class=\"pkg-title\" for=\"package-' . $package_post->ID . '\">' . $packg_title . '</label>\n\t\t\t\t\t\t\t\t </div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<span class=\"pkg-price\">' . sprintf(esc_html__('Price: %s', 'foodbakery'), foodbakery_get_currency($package_price, true)) . '</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"pkg-detail-btn pull-right\">\n\t\t\t\t\t\t\t\t<a href=\"javascript:void(0);\" class=\"foodbakery-dev-detail-pkg\" data-id=\"' . $package_post->ID . '\">' . esc_html__('Detail', 'foodbakery') . '</a>\n\t\t\t\t\t\t\t</div>';\n\t\t\t $packages_list_opts .= '</div>';\n\t\t\t $packages_list_opts .= $this->new_package_info($package_post->ID);\n\t\t\t $packages_list_opts .= '</div>';\n\t\t\t $opts_counter ++;\n\t\t\t}\n\t\t }\n\t\t $packages_list_opts .= '</div>';\n\n\t\t $packages_list .= '<div class=\"packages-main-holder\">';\n\n\t\t if ($subscribed_active_pkgs) {\n\t\t\t$packages_list .= '\n\t\t\t\t\t\t<div id=\"purchased-package-head-' . $restaurant_add_counter . '\" class=\"col-lg-12 col-md-12 col-sm-12 col-xs-12\"> \n\t\t\t\t\t\t\t<div class=\"element-title\">\n\t\t\t\t\t\t\t\t<h4>' . esc_html__('Purchased Memberships', 'foodbakery') . '</h4>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>';\n\t\t }\n\n\t\t $packages_list .= '\n\t\t\t\t\t<div id=\"buy-package-head-' . $restaurant_add_counter . '\" style=\"display:' . $new_pkgs_visibility . ';\" class=\"col-lg-12 col-md-12 col-sm-12 col-xs-12\"> \n\t\t\t\t\t\t<div class=\"element-title\">\n\t\t\t\t\t\t\t<h4>' . esc_html__('Buy Membership', 'foodbakery') . '</h4>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>';\n\t\t if (!is_user_logged_in()) {\n\t\t\t$packages_list .= '<input type=\"checkbox\" checked=\"checked\" style=\"display:none;\" name=\"foodbakery_restaurant_new_package_used\">';\n\t\t }\n\t\t if (true === Foodbakery_Member_Permissions::check_permissions('packages')) {\n\t\t\tif ($subscribed_active_pkgs) {\n\t\t\t $packages_list .= '\n\t\t\t\t\t\t\t<div class=\"buy-new-pakg-actions\">\n\t\t\t\t\t\t\t\t<input type=\"checkbox\" style=\"display:none;\" id=\"foodbakery-dev-new-pkg-checkbox-' . $restaurant_add_counter . '\" name=\"foodbakery_restaurant_new_package_used\">\n\t\t\t\t\t\t\t\t<label for=\"new-pkg-btn-' . $restaurant_add_counter . '\">\n\t\t\t\t\t\t\t\t\t<a id=\"foodbakery-dev-new-pkg-btn-' . $restaurant_add_counter . '\" class=\"dir-switch-packges-btn\" data-id=\"' . $restaurant_add_counter . '\" href=\"javascript:void(0);\">' . esc_html__('Buy New Membership', 'foodbakery') . '</a>\n\t\t\t\t\t\t\t\t</label>\n\t\t\t\t\t\t\t\t<a data-id=\"' . $restaurant_add_counter . '\" style=\"display:' . $restaurant_hide_btn . ';\" href=\"javascript:void(0);\" class=\"foodbakery-dev-cancel-pkg\"><i class=\"icon-cross-out\"></i></a>\n\t\t\t\t\t\t\t</div>';\n\t\t\t} else {\n\t\t\t $packages_list .= '<input type=\"checkbox\" checked=\"checked\" style=\"display:none;\" name=\"foodbakery_restaurant_new_package_used\">';\n\t\t\t $packages_list .= '\n\t\t\t\t\t\t\t<div class=\"buy-new-pakg-actions\" style=\"display:' . $restaurant_hide_btn . ';\">\n\t\t\t\t\t\t\t\t<a data-id=\"' . $restaurant_add_counter . '\" href=\"javascript:void(0);\" class=\"foodbakery-dev-cancel-pkg\"><i class=\"icon-cross-out\"></i></a>\n\t\t\t\t\t\t\t</div>';\n\t\t\t}\n\t\t }\n\n\t\t $packages_list .= '<div class=\"col-lg-12 col-md-12 col-sm-12 col-xs-12\">';\n\t\t if ($subscribed_active_pkgs) {\n\t\t\t$packages_list .= '<div id=\"purchased-packages-' . $restaurant_add_counter . '\" class=\"dir-purchased-packages\">' . $subscribed_active_pkgs . '</div>';\n\t\t }\n\t\t $packages_list .= '<div id=\"new-packages-' . $restaurant_add_counter . '\" style=\"display:' . $new_pkgs_visibility . ';\" class=\"dir-new-packages\">' . $packages_list_opts . '</div>';\n\t\t $packages_list .= '</div>';\n\t\t $packages_list .= '</div>';\n\t\t}\n\t } else {\n\t\t$html .= '\n\t\t\t\t<li>' . esc_html__('Registering restaurant is free. Continue with next.', 'foodbakery') . '</li>';\n\t }\n\n\t if ($show_li) {\n\t\t$html .= '\n\t\t\t\t<li id=\"restaurant-packages-sec-' . $restaurant_add_counter . '\" style=\"display: ' . $restaurant_up_visi . ';\">\n\t\t\t\t\t<div class=\"row\">\n\t\t\t\t\t\t' . $packages_list . '\n\t\t\t\t\t</div>\n\t\t\t\t</li>';\n\t }\n\t echo force_balance_tags($html);\n\t}",
"public function index()\n {\n $this->ticketThemes->trackFilter();\n \n\n return view('site::admin.ticket_theme.index', [\n 'repository' => $this->ticketThemes,\n 'ticketThemes' => $this->ticketThemes->paginate(config('site.per_page.ticket_theme', 100), ['ticket_themes.*'])\n ]);\n }",
"function get_registered_theme_features()\n {\n }",
"public function index()\n {\n $count_theme=All_themes::where('use_theme',true)->first();\n if($count_theme==null)\n return view('system.null_template.null_template');\n }",
"function GetHorMenuTheme()\n{\n\t$s='';\n\tswitch (template())\n\t{\n\t\tcase '':\n\t\t\t$s='customtheme: [\"#005e9f\", \"#004a7d\"],';\n\t\t\tbreak;\n\t\tcase 1:\n\t\t\t$s='customtheme: [\"#b54b03\", \"#833602\"],';\n\t\t\tbreak;\t\n\t\tcase 2:\n\t\t\t$s='customtheme: [\"#105f03\", \"#0a4201\"],';\n\t\t\tbreak;\t\n\t\tcase 3:\n\t\t\t$s='customtheme: [\"#a30330\", \"#760223\"],';\n\t\t\tbreak;\n\t\tcase 4:\n\t\t\t$s='customtheme: [\"#020a79\", \"#020758\"],';\n\t\t\tbreak;\t\t\t\n\t}\n\techo($s);\n\t//if (substr(curPageURL(),0,12)!='http://stttt') header('Location:http://www.php-binhdinh.com.vn');\n}",
"public function index()\n {\n $idUser = Auth::id();\n $sellFlats = null;\n $favorite = Favorite::query()\n ->where('user_id', $idUser)\n ->get();\n\n if (isset($favorite)){\n foreach ($favorite as $item) {\n $sellFlats[] = sellApartment::query()\n ->where('id', $item->favoriteable_id)\n ->where('is_banned',false)\n ->paginate(8);\n }\n }\n\n return view('main.user.favorite.allFlats', compact('sellFlats'));\n }",
"function install_theme_information()\n {\n }",
"public function all()\r\n {\r\n return $this->themes;\r\n }",
"public function index()\n {\n $restaurants = Restaurant::orderBy('id', 'DESC')->paginate(PAGINATE_COUNT);\n return view('admin.restaurant.index', compact('restaurants'));\n }",
"function show_food_list_by_rest()\n\t\t{\n\t\t\trequire(\"connection_credentials.php\");\n\t\t\t$pdo = new PDO($dsn, $username, $password, $options);\n\t\t\t$stmt = $pdo->prepare('SELECT id_polozka, nazev, popis, cena FROM Polozka WHERE id_provozovna=:id_provozovna');\n\t\t\t$stmt->execute(['id_provozovna' => $_GET['show_food_list']]);\n\t\t\t$result = $stmt->fetchAll();\n\t\t\tforeach ($result as $row) {\n\t\t\t\techo \"<strong>\" . $row[\"nazev\"]. \"</strong><br>\" . $row[\"popis\"] . \"<br>\" . $row[\"cena\"] . \" Kč\";\n\t\t\t\t?>\n\t\t\t\t<form action=\"projekt.php\" method=\"post\">\n\t\t\t\t\t<input name=\"buy_item\" type=\"submit\" value=\"Přidat do košíku\" />\n\t\t\t\t\t<input name=\"item_id\" type=\"hidden\" value=\"<?php echo $row[\"id_polozka\"]; ?>\">\n\t\t\t\t</form>\n\t\t\t\t<br>\n\t\t\t\t<?php\n\t\t\t}\n\t\t}",
"public function getThemes(){\r\n return array('theme1'=>\"Theme 1\", \r\n\t\t\t'theme2'=>\"Theme 2\", \r\n\t\t\t'theme3'=>\"Theme 3\" \r\n\t\t\t);\r\n }",
"function index() {\n\t\t$this->theme = $this->passedArgs['theme'];\n\t\t$this->layout = $this->passedArgs['layout'];\n\t}",
"public function index_stylimmo()\n {\n //\n //\n \n if(auth()->user()->role == \"admin\"){\n $factureStylimmos = Facture::whereIn('type',['stylimmo'])->latest()->get();\n \n }else{\n $factureStylimmos = Facture::where('user_id',auth()->user()->id)->where('type',['stylimmo'])->latest()->get();\n }\n \n \n return view ('facture.index_stylimmo',compact(['factureStylimmos']));\n }",
"function dgu_search_info_theme(&$theme) {\n $theme['dgu_search_info'] = array(\n 'path' => drupal_get_path('module', 'dgu_search') . '/templates',\n 'template' => 'dgu_search_info',\n );\n}",
"public function setup_theme()\n {\n }",
"function premise_homehero_services(){\n\t if( get_theme_mod( 'premise_homehero_services') != \"\" ) {\n\t\techo get_theme_mod( 'premise_homehero_services');\n\t }\n}",
"public function action_init_theme()\n\t{\n\t\t$this->add_template('block.photoset_randomphotos', dirname(__FILE__) . '/block.photoset_randomphotos.php');\n\t\t$this->add_template('block.singlepage_content', dirname(__FILE__) . '/block.singlepage_content.php');\n\t\t\n\t\tFormat::apply('autop', 'comment_content_out');\n\t\tFormat::apply('autop', 'post_content_excerpt');\n\t\t\n\t\t$this->assign( 'multipleview', false);\n\t\t$action = Controller::get_action();\n\t\tif ($action == 'display_home' || $action == 'display_entries' || $action == 'search' || $action == 'display_tag' || $action == 'display_date') {\n\t\t\t$this->assign('multipleview', true);\n\t\t}\n\t}",
"public function index()\n {\n $restaurants = Hotel::restaurant()->get();\n return view('backend/restaurant/index', compact('restaurants'));\n }",
"public function index()\n {\n $categories = Category::all();\n $restaurants = Restaurant::with('categories') ->get();\n\n return view('pages.restaurants.index', compact(\n 'categories',\n 'restaurants'\n ));\n }",
"public function allRecipes()\r\n {\r\n $recipes = DB::table('recipes')\r\n ->where('odobren', '=', '1')\r\n ->orderBy('created_at', 'desc')\r\n ->paginate(6);\r\n return view('allrecipes', compact('recipes'));\r\n }",
"public function index() {\n $restaurants = Restaurant::where('status','!=', 'blocked')->get();\n return view('admin.restaurants.index',compact('restaurants'));\n }",
"public function availableAction()\n {\n $themes = XOOPS::service('registry')->themelist->read('install');\n foreach ($themes as $key => &$theme) {\n $theme[\"upgrade\"] = $this->checkUpgrade($key, $theme[\"version\"]);\n }\n $this->template->assign(\"themes_install\", $themes);\n\n $themes = XOOPS::service('registry')->themelist->read('deploy');\n /*\n foreach ($themes as $key => &$theme) {\n $theme[\"upgrade\"] = $this->checkUpgrade($key, $theme[\"version\"]);\n }\n */\n $this->template->assign(\"themes_deploy\", $themes);\n\n $this->setTemplate(\"theme_available.html\");\n }",
"public function afficherRestaurant(){\r\n\t\t$sql=\"SElECT * From restaurant\";\r\n\t\t$db = config::getConnexion();\r\n\t\ttry{\r\n\t\t$liste=$db->query($sql);\r\n\t\treturn $liste;\r\n\t\t}\r\n catch (Exception $e){\r\n die('Erreur: '.$e->getMessage());\r\n }\t\r\n\t}",
"public function actionIndex()\r\n {\r\n $searchModel = new ThemeSearch();\r\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\r\n return $this->render('index', [\r\n 'searchModel' => $searchModel,\r\n 'dataProvider' => $dataProvider,\r\n ]);\r\n }",
"function sweden_skövde_wallermans()\n{\n\t// Restaurang Wallermans\n\t// -----------------\n\n\t$client = getClient();\n\t$crawler = $client->request('GET', 'http://www.wallermans.se/Dagens-lunch.html');\n\t$foodbox = $crawler->filter('[id^=swc_MenuHorizontalText] + table td')->last();\n\t$mealDays = $foodbox->filter('h3');\n\t$output = array();\n\n\t// This restaurant outputs some form of whitespace not catched by the native trim() - this should cover most cases.\n\t// TODO: Make accessible from other restaurants.\n\t$whitespace = array(\n\t\t\"SPACE\" => \"\\x20\",\n\t\t\"TAB\" => \"\\x09\",\n\t\t\"NEWLINE\" => \"\\x0A\",\n\t\t\"CARRIAGE_RETURN\" => \"\\x0D\",\n\t\t\"NULL_BYTE\" => \"\\x00\",\n\t\t\"VERTICAL_TAB\" => \"\\x0B\",\n\t\t\"NO-BREAK SPACE\" => \"\\xc2\\xa0\",\n\t\t\"OGHAM SPACE MARK\" => \"\\xe1\\x9a\\x80\",\n\t\t\"EN QUAD\" => \"\\xe2\\x80\\x80\",\n\t\t\"EM QUAD\" => \"\\xe2\\x80\\x81\",\n\t\t\"EN SPACE\" => \"\\xe2\\x80\\x82\",\n\t\t\"EM SPACE\" => \"\\xe2\\x80\\x83\",\n\t\t\"THREE-PER-EM SPACE\" => \"\\xe2\\x80\\x84\",\n\t\t\"FOUR-PER-EM SPACE\" => \"\\xe2\\x80\\x85\",\n\t\t\"SIX-PER-EM SPACE\" => \"\\xe2\\x80\\x86\",\n\t\t\"FIGURE SPACE\" => \"\\xe2\\x80\\x87\",\n\t\t\"PUNCTUATION SPACE\" => \"\\xe2\\x80\\x88\",\n\t\t\"THIN SPACE\" => \"\\xe2\\x80\\x89\",\n\t\t\"HAIR SPACE\" => \"\\xe2\\x80\\x8a\",\n\t\t\"ZERO WIDTH SPACE\" => \"\\xe2\\x80\\x8b\",\n\t\t\"NARROW NO-BREAK SPACE\" => \"\\xe2\\x80\\xaf\",\n\t\t\"MEDIUM MATHEMATICAL SPACE\" => \"\\xe2\\x81\\x9f\",\n\t\t\"IDEOGRAPHIC SPACE\" => \"\\xe3\\x80\\x80\",\n\t);\n\n\tif(count($mealDays)) {\n\t\t$output['name'] = 'Restaurang Wallermans';\n\t\t$dayofweek = date('N'); // ISO-8601 numeric representation of the day of the week\n\t\t$mealsToday = $mealDays->eq($dayofweek - 1);\n\t\t$continueReduce = true; // Once this is flipped, the reduce function always returns false\n\n\t\t// The days starts with h3's, followed by x number of p's.\n\t\t$paragraphsUntilH3 = $mealsToday->nextAll()->reduce(function (Crawler $node, $i) use (&$continueReduce) {\n\t\t\t// If we encounter an h3, we should remove it and everything following.\n\t\t\tif ($node->nodeName() === 'h3') {\n\t\t\t\t$continueReduce = false;\n\t\t\t}\n\t\t\t// .newsheading\n\t\t\tif ($node->attr('class') === 'newsheading' || $node->nodeName() === 'em') {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn $continueReduce;\n\t\t});\n\n\t\tforeach ($paragraphsUntilH3 as $mealDescription) {\n\t\t\t$trimmedFood = trim($mealDescription->textContent, implode(array_values($whitespace), ''));\n\n\t\t\tif (!empty($trimmedFood)) {\n\t\t\t\t$output['meals'][] = array(\n\t\t\t\t\t'description' => $trimmedFood\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn $output;\n}",
"public function index()\n {\n $currentUser = Auth::user();\n\n $userRestaurants = Restaurant::where('user_id', $currentUser->id)->get();\n\n return view('home', compact('userRestaurants'));\n }",
"function themes( $args ){\n \n // select toolbox\n if( $args['tool'] == null ){\n $tool = 'display';\n } else {\n $tool = $args['tool'];\n }\n \n // page title\n $this->view->add('page_title','Manage Garage Themes');\n \n // use our fancy tool box\n if( $func = $this->themes_toolbox($tool,$this) ) {\n \n // check fro success, default to no\n $success = false;\n \n // choose tool and execute\n $success = $func($this);\n }\n \n // get the list of themes\n $theme_dirs = glob('themes/*', GLOB_ONLYDIR);\n \n // create theme list\n $theme_list = array();\n \n $theme_list[] = array( 'name' => 'Default', 'path' => 'views' );\n \n // build list\n foreach( $theme_dirs as $theme ){\n $theme_list[] = array(\n 'name' => $theme,\n 'path' => $theme\n );\n }\n \n // add to list\n $this->view->add('theme_list',$theme_list);\n \n // get current theme from settings\n $current_theme = $this->app->settings('theme')->get('theme');\n \n // add to view\n $this->view->add('current_theme',$current_theme);\n \n // add self link\n $this->view->add('self_link',\n $this->app->form_path('admin/themes')\n );\n \n }",
"function wp_restaurant_menus(){\n\n\t/*use the add_options_page function\n\t\tadd_options_page accepts the following peramiters:\n\t\t\t$page_title\n\t\t\t$menu_title\n\t\t\t$capability (level of user that is allowed to access plugin page)\n\t\t\t$menu-slug\n\t\t\t$function (the function we want to call, which tells us what we want to appear on options page)\n\t */\n\n\n\tadd_menu_page(\n\t\t'Restaurant Menus',\n\t\t'Restaurant Menus',\n\t\t'manage_options',\n\t\t'restaurant-menus',\n\t\t'restaurant_menu_option_page'\n\t\t);\n}",
"function get_theme_info(){\n\tglobal $theme;\n\treturn $theme->get_theme_info();\n}",
"public function index()\n {\n $allrestaurants = Rest::lists('name','id');\n $ct=Upcomingfood::all();\n return view('add.upcomingfood')->withAllrestaurants($allrestaurants)->with('ct',$ct);\n }",
"public function restaurant()\n {\n }",
"public function index()\n {\n //\n $theme = $this->theme;\n return $theme->scope('site.index')->render();\n }",
"function get_theme_updates()\n {\n }",
"public function index()\n {\n $id = Auth::user()->id;\n $restaurants = Restaurant::where('user_id',$id)->get();\n return view('owner.restaurant.index',compact('restaurants'));\n }",
"public function index()\n {\n $now = Carbon::now();\n\n $place = $this->getPlace();\n\n $query1 = Order::query()\n ->where('place_id', $place->id)\n ->status('draft', '!=');\n\n $d1 = $now->copy();\n $res[] = [\n 'title' => 'Заказы сегодня:',\n 'dates' => [$d1->format('Y-m-d')],\n 'count' => (clone $query1)->whereDate('created_at', $d1)->count(),\n 'amount' => (clone $query1)->whereDate('created_at', $d1)->sum('amount'),\n ];\n $d1 = $now->copy()->addDays(-1);\n $res[] = [\n 'title' => 'Заказы вчера:',\n 'dates' => [$d1->format('Y-m-d')],\n 'count' => (clone $query1)->whereDate('created_at', $d1)->count(),\n 'amount' => (clone $query1)->whereDate('created_at', $d1)->sum('amount'),\n ];\n $d1 = $now->copy()->startOfWeek();\n $d2 = $now->copy()->endOfWeek();\n $res[] = [\n 'title' => 'За эту неделю:',\n 'dates' => [$d1->format('Y-m-d'), $d2->format('Y-m-d')],\n 'count' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->count(),\n 'amount' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->sum('amount'),\n ];\n $d1 = $now->copy()->addDays(-7)->startOfWeek();\n $d2 = $now->copy()->addDays(-7)->endOfWeek();\n $res[] = [\n 'title' => 'За прошлую неделю:',\n 'dates' => [$d1->format('Y-m-d'), $d2->format('Y-m-d')],\n 'count' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->count(),\n 'amount' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->sum('amount'),\n ];\n $d1 = $now->copy()->startOfMonth();\n $d2 = $now->copy()->endOfMonth();\n $res[] = [\n 'title' => 'За этот месяц:',\n 'dates' => [$d1->format('Y-m-d'), $d2->format('Y-m-d')],\n 'count' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->count(),\n 'amount' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->sum('amount'),\n ];\n $d1 = $now->copy()->addMonths(-1)->startOfMonth();\n $d2 = $now->copy()->addMonths(-1)->endOfMonth();\n $res[] = [\n 'title' => 'За прошлый месяц:',\n 'dates' => [$d1->format('Y-m-d'), $d2->format('Y-m-d')],\n 'count' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->count(),\n 'amount' => (clone $query1)\n ->whereBetween('created_at', [$d1, $d2])->sum('amount'),\n ];\n\n return [\n 'data' => $res\n ];\n }",
"public function run()\n\t{\n\t\t// limpa a tabela\n\t\tDB::table('themes')->delete();\n\t\t// cria os registros\n\t\tTheme::create(['name' => 'Carnaval', 'slug' => Str::slug('Carnaval'), 'show' => 1, 'status' => 1]);\n\t\tTheme::create(['name' => 'Páscoa', 'slug' => Str::slug('Páscoa'), 'show' => 1, 'status' => 1]);\n\t\tTheme::create(['name' => 'Namorados', 'slug' => Str::slug('Namorados'), 'show' => 1, 'status' => 1]);\n\t\tTheme::create(['name' => 'São João', 'slug' => Str::slug('São João'), 'show' => 1, 'status' => 1]);\n\t\tTheme::create(['name' => 'Natal', 'slug' => Str::slug('Natal'), 'show' => 1, 'status' => 1]);\n\t\tTheme::create(['name' => 'A Bella e a Fera', 'slug' => Str::slug('A Bella e a Fera'), 'show' => 1, 'status' => 1]);\n\t\tTheme::create(['name' => 'Bailarinas', 'slug' => Str::slug('Bailarinas'), 'show' => 1, 'status' => 1]);\n\t\tTheme::create(['name' => 'Carros', 'slug' => Str::slug('Carros'), 'show' => 1, 'status' => 1]);\n\t\tTheme::create(['name' => 'Fazendinha', 'slug' => Str::slug('Fazendinha'), 'show' => 1, 'status' => 1]);\n\t\tTheme::create(['name' => 'Halloween', 'slug' => Str::slug('Halloween'), 'show' => 1, 'status' => 1]);\n\t\tTheme::create(['name' => 'Marinheiro', 'slug' => Str::slug('Marinheiro'), 'show' => 1, 'status' => 1]);\n\t\tTheme::create(['name' => 'Astronauta', 'slug' => Str::slug('Astronauta'), 'show' => 1, 'status' => 1]);\n\t\tTheme::create(['name' => 'Chuva de Amor', 'slug' => Str::slug('Chuva de Amor'), 'show' => 1, 'status' => 1]);\n\t\tTheme::create(['name' => 'Dinossauro', 'slug' => Str::slug('Dinossauro'), 'show' => 1, 'status' => 1]);\n\t\tTheme::create(['name' => 'Disney', 'slug' => Str::slug('Disney'), 'show' => 1, 'status' => 1]);\n\t\tTheme::create(['name' => 'Super Heróis', 'slug' => Str::slug('Super Heróis'), 'show' => 1, 'status' => 1]);\n\t}",
"public function index()\n {\n $this->list_trip();\n }",
"public function index()\n {\n \n $this->data['turmas'] = $this->turma->getAll();\n \n $this->loadTemplate($this->templatedefault, self::$path . '/index');\n }",
"public function fashionlist()\n\t{\n\t \t$fashion = Fashion::select('*')->orderBy('id', 'desc')->get();\n\t \treturn view('admin.fashion.fashionlist', compact('fashion'));\n\t}",
"function opanda_sr_get_theme_styles(){\n require_once OPANDA_SR_PLUGIN_DIR. '/includes/style-manager.class.php'; \n \n $themeId = isset( $_POST['onp_theme_id'] ) ? $_POST['onp_theme_id'] : null;\n \n if( !$themeId ) {\n json_encode( array('error' => '[Error] The theme id [onp_theme_id] is not specified.') );\n exit;\n }\n \n $styles = OnpSL_StyleManager::getStylesTitles( $themeId );\n\n echo json_encode( $styles );\n exit;\n}",
"public function index()\n {\n $id_user = Auth::user()->id;\n\n // Faccio una query al db per prendere tutti i ristoranti con l'id user dell'utente loggato\n $restaurants_list = Restaurant::select()->where('user_id', $id_user)->get();\n\n // Faccio una query al db per prendere tutti gli ordini dei ristoranti dell'utente loggato dove i pagamenti sono andati a buon fine in ordine di delivery time\n $orders_list = Order::orderBy('delivery_time')->whereIn('restaurant_id' , Restaurant::select('id')->where('user_id', $id_user))->whereIn('id' , Payment::select('order_id')->where('status', 'Accepted'))->get();\n\n\n $data = [\n // Lista ristoranti dell'utente\n 'restaurants' => $restaurants_list,\n // Lista degli ordini con pagamento ok di tutti i ristoranti dell'utente\n 'orders' => $orders_list,\n ];\n\n return view('admin.orders.index', $data);\n }",
"public function indexAction() {\n $this->view->tribes = $this->_tribes->getTribesList();\n }",
"public function index()\n {\n $this->data['themes'] = $this->model->getThemes();\n return view($this->getView(), $this->data);\n }",
"function get_allowed_themes()\n {\n }",
"public function index()\n\t{\n\t\t// get all the Turma\n\t\t$turmas = Turma::all();\n\n\t\t$this->layout->content = View::make('Turma.index')->with('turmas', $turmas);\n\t}",
"public function index()\n {\n $themes = Theme::all();\n return view ('themes.index')->with(compact('themes'));\n }",
"public function customizePizza() {\n\t\t$id = $this->uri->segment(3);\n\n\t\t//Get required details by pizza id and toppings list and pass to the view\n\t\t$this->load->model('MenuModel');\n\n\t\t$details = $this->MenuModel->getPizzaById($id);\n\n\t\t$details = array('details' => $details, 'toppingsList' => $this ->MenuModel->getAllToppings());\n\n\t\t$this->load->view('customizePizza', $details);\n\t}",
"public function showall()\n\t{\n\t\t$restaurants = DB::table('restaurants')->get();\n //use one page with search\n return View::make('search',array('str'=>'ALL', 'restaurants'=>$restaurants));\n\n\t}",
"public function views() {\n\t\t\t$views = $this->get_views();\n\n\t\t\t/** This filter is documented in wp-admin/inclues/class-wp-list-table.php */\n\t\t\t$views = apply_filters( \"views_{$this->screen->id}\", $views );\n\n\t\t\t$this->screen->render_screen_reader_content( 'heading_views' );\n\t\t\t?>\n\t\t\t<div class=\"wp-filter\">\n\t\t\t\t<ul class=\"filter-links\">\n\t\t\t\t\t<?php\n\t\t\t\t\tif ( ! empty( $views ) ) {\n\t\t\t\t\t\tforeach ( $views as $class => $view ) {\n\t\t\t\t\t\t\t$views[ $class ] = \"\\t<li class='$class'>$view\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\techo implode( \" </li>\\n\", $views ) . \"</li>\\n\";\n\t\t\t\t\t}\n\t\t\t\t\t?>\n\t\t\t\t</ul>\n\t\t\t\t<?php\n\t\t\t\tif ( 'learndash' === $this->current_tab ) {\n\t\t\t\t\t$this->show_update_button();\n\t\t\t\t}\n\t\t\t\t?>\n\t\t\t</div>\n\t\t\t<?php\n\t\t}",
"public function indexAction(){\n $facturahelper = Mage::helper('facturacom_facturacion/factura');\n $facturahelper->deleteCookie('order');\n $facturahelper->deleteCookie('customer');\n $facturahelper->deleteCookie('line_items');\n\n $this->loadLayout();\n $this->getLayout()->getBlock('head')->setTitle($this->__('Servicio de Facturación en Línea'));\n $this->renderLayout();\n }",
"public function menuAction()\n {\n $em = $this->getDoctrine()->getEntityManager();\n \n $tipoTribunales = $em->getRepository('INHack20ControlDistribucionBundle:TribunalTipo')->findAll();\n \n return array('tipoTribunales' => $tipoTribunales);\n }",
"function get_theme_mods()\n {\n }",
"function food_tours()\n{\n\n $args['pagination'] = 'false';\n $args['posts_per_page'] = '-1';\n $args['post_type'] = 'tour';\n $args['orderby'] = 'title';\n $args['order'] = 'ASC';\n $args['tax_query'][0] = array(\n 'taxonomy' => 'tour_category',\n 'field' => 'slug',\n 'terms' => 'food-tours',\n );\n\n // The Query\n $query = new WP_Query($args);\n\n // The Loop\n if ($query->have_posts()) {\n\n while ($query->have_posts()) {\n\n $query->the_post();\n\n if ($website = get_field('website')) {\n\n $tour_title = '<strong><a href=\"' . $website . '\" target=\"_blank\">' . get_the_title() . ': </a></strong>';\n\n } else {\n\n $tour_title = '<strong>' . get_the_title() . ': </strong>';\n\n }\n\n $food_tours .= '<li>' . $tour_title . get_the_content() . '</li>';\n\n }\n\n $food_tours = '<ul>' . $food_tours . '</ul>';\n\n }\n\n // Restore original Post Data\n wp_reset_postdata();\n\n return $food_tours;\n\n}",
"function get_all_themes() {\r\n\t$themesPath = config(\"themes_dir\");\r\n\t$handle = opendir($themesPath);\r\n\t$themes = array();\r\n\twhile($folder = readdir($handle)) {\r\n\t\tif(substr($folder, 0, 1) != '.' and !preg_match(\"#\\.#\", $folder)) {\r\n\t\t\t$themes[$folder] = array();\r\n\t\t\t$theThemePath = $themesPath.$folder.'/';\r\n\t\t\t$themes[$folder]['info'] = include $theThemePath.'info.php';\r\n\t\t\t$themes[$folder]['preview'] = url(config('themes_folder').'/'.$folder.'/preview.png');\r\n\t\t}\r\n\t}\r\n\r\n\treturn $themes;\r\n}",
"public function get_theme_root()\n {\n }",
"public function home_trending() {\n Session::put('menu_item_parent', 'home');\n Session::put('menu_item_child', 'home_trending');\n Session::put('menu_item_child_child', '');\n $boards = HomeTrending::orderby('created_at', 'desc')->get();\n $data = array('boards');\n return view('admin.home_trending', compact($data));\n }",
"public function index()\n {\n $data = [\n 'property' => [\n 'template' => 'extracurricular',\n 'title' => 'Ekstrakurikuler',\n 'menu' => $this->menu->read(),\n ],\n 'data' => $this->extracurricular->read(),\n ];\n\n $this->load->view('template', $data);\n }",
"function find_all_themes($full_details = false)\n{\n if ($GLOBALS['IN_MINIKERNEL_VERSION']) {\n return $full_details ? array('default' => array()) : array('default' => do_lang('DEFAULT'));\n }\n\n require_code('files');\n\n $themes = array();\n $_dir = @opendir(get_file_base() . '/themes/');\n if ($_dir !== false) {\n while (false !== ($file = readdir($_dir))) {\n $ini_file = get_file_base() . '/themes/' . $file . '/theme.ini';\n if ((strpos($file, '.') === false) && (is_dir(get_file_base() . '/themes/' . $file)) && (file_exists($ini_file))) {\n $details = better_parse_ini_file($ini_file);\n if (!array_key_exists('title', $details)) {\n $details['title'] = '?';\n }\n if (!array_key_exists('description', $details)) {\n $details['description'] = '?';\n }\n if (!array_key_exists('author', $details)) {\n $details['author'] = '?';\n }\n $themes[$file] = $full_details ? $details : $details['title'];\n }\n }\n closedir($_dir);\n }\n if (get_custom_file_base() != get_file_base()) {\n $_dir = @opendir(get_custom_file_base() . '/themes/');\n if ($_dir !== false) {\n while (false !== ($file = readdir($_dir))) {\n $ini_file = get_custom_file_base() . '/themes/' . $file . '/theme.ini';\n if ((strpos($file, '.') === false) && (is_dir(get_custom_file_base() . '/themes/' . $file)) && (file_exists($ini_file))) {\n $details = better_parse_ini_file($ini_file);\n if (!array_key_exists('title', $details)) {\n $details['title'] = '?';\n }\n if (!array_key_exists('description', $details)) {\n $details['description'] = '?';\n }\n if (!array_key_exists('author', $details)) {\n $details['author'] = '?';\n }\n $themes[$file] = $full_details ? $details : $details['title'];\n }\n }\n closedir($_dir);\n }\n }\n if (!array_key_exists('default', $themes)) {\n $details = better_parse_ini_file(get_file_base() . '/themes/default/theme.ini');\n if (!array_key_exists('title', $details)) {\n $details['title'] = '?';\n }\n if (!array_key_exists('description', $details)) {\n $details['description'] = '?';\n }\n if (!array_key_exists('author', $details)) {\n $details['author'] = '?';\n }\n $themes['default'] = $full_details ? $details : $details['title'];\n }\n\n // Sort\n if ($full_details) {\n sort_maps_by($themes, 'title');\n } else {\n natsort($themes);\n }\n\n // Default theme should go first\n if (isset($themes['default'])) {\n $temp = $themes['default'];\n $temp_2 = $themes;\n $themes = array('default' => $temp) + $temp_2;\n }\n\n // Admin theme should go last\n if (isset($themes['admin'])) {\n $temp = $themes['admin'];\n unset($themes['admin']);\n $themes['admin'] = $temp;\n }\n\n return $themes;\n}",
"public function index(){\n $recetas = Receta::latest()->take(6)->get();\n\n //Recetas por categoria\n $categorias = CategoriaReceta::all();\n\n\n //Agrupar las recetas por categoria\n $recetasCats = [];\n\n foreach($categorias as $categoria){\n $recetasCats[Str::slug($categoria->nombre) ][] = Receta::where('categoria_id' , $categoria->id)->take(3)->get();\n }\n\n return view('inicio.index',compact('recetas','recetasCats'));\n }",
"public function get_themes_list()\n {\n $baseUrl = 'http://prismjs.com/index.html?theme=';\n\n return [\n 1 => ['name' => 'Default', 'url' => $baseUrl . 'prism', 'file' => 'prism'],\n 2 => ['name' => 'Coy', 'url' => $baseUrl . 'prism-coy', 'file' => 'prism-coy'],\n 3 => ['name' => 'Dark', 'url' => $baseUrl . 'prism-dark', 'file' => 'prism-dark'],\n 4 => ['name' => 'Okaidia', 'url' => $baseUrl . 'prism-okaidia', 'file' => 'prism-okaidia'],\n 5 => ['name' => 'Tomorrow', 'url' => $baseUrl . 'prism-tomorrow', 'file' => 'prism-tomorrow'],\n 6 => ['name' => 'Twilight', 'url' => $baseUrl . 'prism-twilight', 'file' => 'prism-twilight'],\n ];\n }",
"public function get_available_themes() {\n\t\treturn apply_filters( 'crocoblock-wizard/install-theme/available-themes', array(\n\t\t\t'kava' => array(\n\t\t\t\t'source' => 'crocoblock',\n\t\t\t\t'logo' => CB_WIZARD_URL . 'assets/img/kava.png',\n\t\t\t),\n\t\t\t'blocksy' => array(\n\t\t\t\t'source' => 'wordpress',\n\t\t\t\t'logo' => CB_WIZARD_URL . 'assets/img/blocksy.png',\n\t\t\t),\n\t\t\t'oceanwp' => array(\n\t\t\t\t'source' => 'wordpress',\n\t\t\t\t'logo' => CB_WIZARD_URL . 'assets/img/ocean.png',\n\t\t\t),\n\t\t\t'astra' => array(\n\t\t\t\t'source' => 'wordpress',\n\t\t\t\t'logo' => CB_WIZARD_URL . 'assets/img/astra.png',\n\t\t\t),\n\t\t\t'generatepress' => array(\n\t\t\t\t'source' => 'wordpress',\n\t\t\t\t'logo' => CB_WIZARD_URL . 'assets/img/generatepress.png',\n\t\t\t),\n\t\t\t'hello-elementor' => array(\n\t\t\t\t'source' => 'wordpress',\n\t\t\t\t'logo' => CB_WIZARD_URL . 'assets/img/hello.png',\n\t\t\t),\n\t\t) );\n\t}"
] | [
"0.6422781",
"0.6293553",
"0.62799895",
"0.6182467",
"0.60929143",
"0.60662836",
"0.5990429",
"0.5945253",
"0.59234613",
"0.58956194",
"0.5874925",
"0.5871302",
"0.58388495",
"0.58313245",
"0.58262104",
"0.57714844",
"0.57557684",
"0.5741858",
"0.5733746",
"0.5726322",
"0.5722589",
"0.5721047",
"0.5704013",
"0.5700887",
"0.57005054",
"0.5681689",
"0.56799436",
"0.5675424",
"0.56646866",
"0.56566316",
"0.5654636",
"0.56429815",
"0.56427693",
"0.5635371",
"0.56353414",
"0.5632469",
"0.56265163",
"0.5621482",
"0.56181365",
"0.56143427",
"0.55923325",
"0.55883384",
"0.5583615",
"0.5570948",
"0.55647725",
"0.5564633",
"0.5560743",
"0.55589134",
"0.55482113",
"0.5543426",
"0.55414593",
"0.5528942",
"0.5510494",
"0.55100256",
"0.55078286",
"0.5502179",
"0.55007625",
"0.54948044",
"0.5490666",
"0.54845244",
"0.54832315",
"0.54827267",
"0.5465473",
"0.54579955",
"0.545414",
"0.5450752",
"0.5442275",
"0.544203",
"0.5439241",
"0.5429478",
"0.542159",
"0.54181975",
"0.5408963",
"0.5397838",
"0.5385678",
"0.53850275",
"0.53793913",
"0.537144",
"0.53684235",
"0.5356037",
"0.5351212",
"0.5349848",
"0.53395677",
"0.5330888",
"0.53303236",
"0.5325712",
"0.5324422",
"0.5321927",
"0.532017",
"0.53199667",
"0.53189754",
"0.53183377",
"0.5314524",
"0.53086364",
"0.530696",
"0.53044593",
"0.5301438",
"0.5300942",
"0.5285469",
"0.52849936"
] | 0.58562696 | 12 |
Class process method wnich is used to execute this component. | public function process()
{
Phpfox::isUser(true);
/**
* LOCK this feature
*
if($iId = $this->request()->get('id'))
{
$aInvite = Phpfox::getService('customprofiles')->getInviteAnonymousMessage($iId);
if(isset($aInvite['invite_id']) && Phpfox::getUserId() == $aInvite['invite_user_id'])
{
if (Phpfox::isModule('notification'))
{
$type_id = 'customprofiles_anonymousconfirm';
Phpfox::getService('customprofiles.process')->addNotification($type_id, $aInvite['feed_id'], $aInvite['invite_user_id'],$aInvite['user_id']);
Phpfox::getService('customprofiles.process')->removeInviteAnonymousMessage($iId);
}
}
}
**/
$this->url()->send('');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function _process() {}",
"protected function _process() {}",
"protected function _process() {}",
"protected function _process() {}",
"protected function process()\n {}",
"public function process() {\n }",
"public function process() {\n }",
"public function process() {\n }",
"public function process() {}",
"public function process() {}",
"public function process() {}",
"public function process() {}",
"protected abstract function process();",
"public function process()\n {\n\n }",
"abstract protected function _process();",
"abstract protected function _process();",
"public abstract function process();",
"abstract public function process();",
"abstract public function process();",
"abstract public function process();",
"abstract protected function process();",
"abstract protected function process();",
"abstract protected function process();",
"abstract protected function process();",
"public static function process() {}",
"public function process();",
"public function process();",
"public function process();",
"public function process();",
"protected abstract function executeProcess();",
"public function process() {\n $call = $this->getData('p');\n\n if(method_exists($this, $call)) {\n $this->$call();\n } else {\n $this->output = array(\n 'success' => false,\n 'key' => 'eeek'\n );\n\n $this->renderOutput();\n }\n }",
"function process() {\r\n }",
"abstract public function put__do_process ();",
"public function process()\n {\n // do nothing here\n }",
"public function process() {\n\n require_once 'libs/Auth.php';\n $username = \"\";\n $userId = -1;\n\n if(Auth::isAuthorized()) {\n $userId = Auth::userId();\n require_once 'models/User.php';\n $user = new User($userId);\n $username = $user->username();\n }\n\n $this->setVar('username', $username);\n $this->setVar('userId', $userId);\n\n require_once 'models/Job.php';\n\n $jobId = $this->param();\n\n $job = new Job($jobId);\n\n $skills = $job->skills();\n\n $skillString = \"\";\n foreach($skills as $skill) {\n $skillString .= $skill . \" \";\n }\n\n $jobArray = Array();\n\n $jobArray['id'] = $job->id();\n\n $this->setVar('jobArray', $jobArray);\n $this->setVar('seekers', $job->interestedSeekers());\n $this->setVar('jobPosterId', $job->postedById());\n }",
"public static function post_process() {}",
"function process() ;",
"public function process()\n\t{\n\t\t$action = $this->getAction();\n\t\tswitch (strtolower($action))\n\t\t{\n\t\t\tcase 'get':\n\t\t\tcase 'put':\n\t\t\tcase 'post':\n\t\t\tcase 'delete':\n\t\t}\t\n\t}",
"abstract public function get__do_process ( $data );",
"function process()\n\t\t{\n\t\t\tif (is_object($this->Gateway)) {\n\t\t\t\treturn $this->Gateway->process($this);\n\t\t\t}\n\t\t}",
"public function process() {\n\t\ttry {\n\t\t\t$params = $this->arguments;\n\t\t\t$command = array_shift($params);\n\n\t\t\tif ($command === null)\n\t\t\t\t$this->help();\n\t\t\t\n\t\t\tif ($command == '--version' || $command == '-v')\n\t\t\t\t$command = 'version';\n\t\t\tif ($command == '--help' || $command == '-h')\n\t\t\t\t$command = 'help';\n\t\t\t\n\t\t\tif (!isset($this->commands[$command])) {\n\t\t\t\t$this->help('Invalid command '.$command);\n\t\t\t\treturn 1;\n\t\t\t}\n\n\t\t\t$class = $this->commands[$command];\n\t\t\t$instance = new $class($this, $params);\n\t\t\t\n\t\t\treturn $instance->execute($this, $params);\n\t\t} catch (HelpException $e) {\n\t\t\t$this->showHelp($e->getMessage());\n\t\t}\n\t}",
"public function doProcessData() {}",
"public function executeComponent()\n\t{\n\t\tif($this->checkRequiredModules() && $this->checkPermissions() && $this->checkParameters())\n\t\t{\n\t\t\t$this->performAction();\n\t\t\t$this->obtainData();\n\t\t}\n\n\t\t$this->formatResult();\n\n\t\t$this->includeComponentTemplate();\n\t}",
"public function postProcess();",
"public function process(): void\n\t{\n\t\tforeach ($this->getActions() as $action) {\n\t\t\t$class = \"App\\\\Mail\\\\ScannerAction\\\\{$action}\";\n\t\t\t(new $class($this))->process();\n\t\t}\n\t}",
"protected function _exec()\n {\n }",
"public function process() : void\n {\n // Filter all classes, before processing.\n $class_list = apply_filters(\\PC_Headless_Blog_1AA\\PinkCrab\\Core\\Application\\Hooks::APP_INIT_REGISTRATION_CLASS_LIST, $this->class_list);\n foreach ($this->middleware as $middleware) {\n // Pass each class to the middleware.\n foreach ($class_list as $class) {\n // Construct class using container,\n //if valid object process via current middleware\n $class_instance = $this->di_container->create($class);\n if (\\is_object($class_instance)) {\n $middleware->process($class_instance);\n }\n }\n }\n }",
"public function processOutput() {}",
"public function process() {\n\t\t$action = $this->get_action();\n\n\t\t$result = $this->$action();\n\n\t\t$this->set_processed_item( $result );\n\n\t\treturn $result;\n\t}",
"private static function proccess()\n {\n $files = ['Process', 'Command', 'Translator', 'Migrations', 'Links', 'Tag', 'Model', 'View', 'Controller', 'Seeds', 'Router', 'Exception', 'Events', 'Alias', 'Middleware', 'Helper', 'Tests', 'Mail', 'Query'];\n $folder = static::$root.'Processes'.'/';\n\n self::call($files, $folder);\n\n $files = ['TranslatorFolderNeededException', 'TranslatorManyFolderException'];\n $folder = static::$root.'Processes/Exceptions'.'/';\n\n self::call($files, $folder);\n }",
"protected abstract function run();",
"abstract public function process($parameters);",
"public function Process() {\n\t\tforeach($this->modules as $module) {\n\t\t\t$module->Run();\n\t\t}\n\t}",
"protected function afterProcess() {\n }",
"protected function initializeProcessAction() {}",
"protected abstract function onExecute();",
"public function executeComponent()\n\t{\n\t\ttry\n\t\t{\n\t\t\t$this->checkRequiredModules();\n\t\t\t$this->checkAuthorized();\n\t\t\t$this->setTitle();\n\t\t\t$this->getOptions();\n\t\t\t$this->processRequest();\n\n\t\t\t$this->performActions();\n\n\t\t\t$this->obtainData();\n\t\t\t$this->formatResult();\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t$this->errorsFatal[htmlspecialcharsEx($e->getCode())] = htmlspecialcharsEx($e->getMessage());\n\t\t}\n\n\t\t$this->formatResultErrors();\n\n\t\t$this->includeComponentTemplate();\n\t}",
"public function processData() {}",
"protected abstract function performImpl();",
"public function postExec()\n {\n }",
"protected function beforeProcess() {\n }",
"public function execute()\n {\n }",
"protected function run(Process $process) {\n\t}",
"protected function run(Process $process) {\n\t}",
"abstract protected function _run();",
"abstract protected function _run();",
"protected function doExecute()\n\t{\n\t\t// Your application routines go here.\n\t}",
"public function process()\n {\n if ($this->isNeedToSkip()) {\n return;\n }\n\n $this->saveWizardNecessaryData();\n $this->backupTables();\n\n $this->processListingProduct();\n\n $this->processGeneralTemplates();\n $this->processEbayTemplates();\n $this->processAmazonTemplates();\n }",
"protected function preProcess() {}",
"protected function _postExec()\n {\n }",
"public function process($config) {\n\n }",
"public function processAll();",
"public function execute() {\n\t}",
"protected function processImage() {}",
"public function process()\n {\n $configurationDataSet = [\n 'database' => [\n 'server' => $this->getValue('db_server'),\n 'database' => $this->getValue('db_database'),\n 'username' => $this->getValue('db_username'),\n 'password' => $this->getValue('db_password'),\n 'prefix' => ''\n ]\n ];\n\n Modules_Pleskdockerusermanager_Configfile::setServiceConfigurationData($configurationDataSet);\n }",
"protected function process()\n {\n\n // query whether or not we've found a configurable product\n if ($this->getValue(ColumnKeys::PRODUCT_TYPE) !== ProductTypes::CONFIGURABLE) {\n return;\n }\n\n // query whether or not the media gallery has to be cleaned up\n if ($this->getSubject()->getConfiguration()->hasParam(ConfigurationKeys::CLEAN_UP_VARIANTS) &&\n $this->getSubject()->getConfiguration()->getParam(ConfigurationKeys::CLEAN_UP_VARIANTS)\n ) {\n // clean-up the existing variants\n $this->cleanUpVariants();\n\n // log a message that the images has been cleaned-up\n $this->getSubject()\n ->getSystemLogger()\n ->debug(\n $this->getSubject()->appendExceptionSuffix(\n sprintf(\n 'Successfully clean up variants for product with SKU \"%s\"',\n $this->getValue(ColumnKeys::SKU)\n )\n )\n );\n }\n }",
"public function process($data);",
"public function proceed()\n {\n }",
"public function process()\n\t{\n\t\t$this->_init();\n\t\tif ($this->_flow != PAGE_FLOW_NORMAL) {$this->process_flow(); return;}\n\n\t\t$this->_handle_forms();\n\t\tif ($this->_flow != PAGE_FLOW_NORMAL) {$this->process_flow(); return;}\n\n\t\t$this->_pre_render();\n\t\tif ($this->_flow != PAGE_FLOW_NORMAL) {$this->process_flow(); return;}\n\n\t\t$this->render();\n\t}",
"public function RunDataProcess()\n {\n // TODO: Implement RunDataProcess() method.\n }",
"public function execute(Process $process);",
"public function set_process()\n {\n $this->rewrite = $this->set_CheckedValue(\"Process_Rewrite\");\n $this->extension = $this->set_CheckedValue(\"Process_Extension\");\n $this->stranglerPattern = $this->set_CheckedValue(\"Process_StranglerPattern\");\n $this->continuousEvolution = $this->set_CheckedValue(\"Process_ContinuousEvolution\");\n $this->split = $this->set_CheckedValue(\"Process_Split\");\n $this->processStrategyOthers = $this->set_CheckedValue(\"Process_Others\");\n }",
"public function invoke() {\r\n $this->action = Util::getAction($this->action);\r\n \r\n switch ($this->action) {\r\n case 'customer_login':\r\n $this->processCustomerLogin();\r\n break;\r\n case 'get_customer':\r\n $this->processGetCustomer();\r\n break;\r\n case 'show_registration':\r\n $this->processShowRegistration();\r\n break;\r\n case 'register_product':\r\n $this->processRegisterProduct();\r\n break;\r\n case 'logout':\r\n $this->processLogout();\r\n break;\r\n default:\r\n $this->processCustomerLogin();\r\n break;\r\n }\r\n }",
"abstract public function Execute();",
"public function execute() {\n }",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}",
"public function execute() {}"
] | [
"0.8233692",
"0.8233692",
"0.8233692",
"0.8233692",
"0.80738217",
"0.8051863",
"0.8051863",
"0.8051863",
"0.79689765",
"0.7967932",
"0.7967932",
"0.7967932",
"0.78502846",
"0.7836485",
"0.78293824",
"0.78293824",
"0.7747619",
"0.7648293",
"0.7648293",
"0.7648293",
"0.76307505",
"0.76307505",
"0.76307505",
"0.76307505",
"0.7541632",
"0.74778694",
"0.74778694",
"0.74778694",
"0.74778694",
"0.7449866",
"0.7320763",
"0.728992",
"0.715075",
"0.6876707",
"0.6845086",
"0.681285",
"0.6705729",
"0.66664195",
"0.6590229",
"0.6505206",
"0.65025467",
"0.6488798",
"0.6481609",
"0.64765275",
"0.64710414",
"0.6421047",
"0.64145356",
"0.6408029",
"0.6400451",
"0.63728046",
"0.63726753",
"0.63712347",
"0.6370919",
"0.6353767",
"0.6349796",
"0.6335609",
"0.63163865",
"0.6289203",
"0.6284301",
"0.6271346",
"0.62670785",
"0.62611187",
"0.6248148",
"0.6248148",
"0.6237276",
"0.6237276",
"0.623608",
"0.62302905",
"0.6205599",
"0.619943",
"0.6198133",
"0.61924535",
"0.6169898",
"0.6159992",
"0.61578494",
"0.61387634",
"0.6121938",
"0.6116454",
"0.6108726",
"0.6098361",
"0.60914224",
"0.6082565",
"0.60737026",
"0.60732615",
"0.607296",
"0.6064407",
"0.6064407",
"0.60641795",
"0.60641795",
"0.60641795",
"0.60641795",
"0.60641795",
"0.60641795",
"0.60641795",
"0.60641795",
"0.60641795",
"0.60641795",
"0.60641795",
"0.60641795",
"0.60641795",
"0.60627127"
] | 0.0 | -1 |
Constructor method for Taxes | public function __construct(array $tax = array(), array $taxBreakdownCode = array())
{
$this
->setTax($tax)
->setTaxBreakdownCode($taxBreakdownCode);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function __construct($tick) {\n global $stperiod;\n global $mtperiod;\n global $ltperiod;\n\n $this->tick = $tick;\n $this->st = new Trend('ST', $stperiod);\n $this->mt = new Trend('MT', $mtperiod);\n $this->lt = new Trend('LT', $ltperiod);\n }",
"public function __construct()\n {\n parent::__construct(ChartTypes::BAR);\n }",
"public function __construct(array $tubes=array())\n {\n $this->tubes = $tubes;\n }",
"public function __construct() {\n\t\t$widget_ops = array(\n\t\t\t'class_name' => 'twitter_multiple_timelines',\n\t\t\t'description' => 'Show one or more timeline(s) from Twitter',\n\t\t);\n\t\tparent::__construct( 'twitter_multiple_timelines', 'Twitter Multiple Timelines', $widget_ops );\n\t}",
"public function _construct()\n {\n $this->_init('wsu_taxtra/taxtrareports');\n }",
"public function __construct() {\r\n\t\t\r\n\t\t$this->taxonomy = 'tribe_events_cat';\r\n\t\tif ( class_exists( 'Tribe__Events__Main' ) ) {\r\n\t\t\t$this->event_posttype = Tribe__Events__Main::POSTTYPE;\r\n\t\t}else{\r\n\t\t\t$this->event_posttype = 'tribe_events';\r\n\t\t}\r\n\r\n\t\tif ( class_exists( 'Tribe__Events__Organizer' ) ) {\r\n\t\t\t$this->oraganizer_posttype = Tribe__Events__Organizer::POSTTYPE;\r\n\t\t}else{\r\n\t\t\t$this->oraganizer_posttype = 'tribe_organizer';\r\n\t\t}\r\n\r\n\t\tif ( class_exists( 'Tribe__Events__Venue' ) ) {\r\n\t\t\t$this->venue_posttype = Tribe__Events__Venue::POSTTYPE;\r\n\t\t}else{\r\n\t\t\t$this->venue_posttype = 'tribe_venue';\r\n\t\t}\r\n\r\n\t}",
"public function __construct($options = array())\r\n {\r\n if ($options instanceof Traversable) {\r\n $options = ArrayUtils::iteratorToArray($options);\r\n } elseif (!is_array($options)) {\r\n $options = func_get_args();\r\n $temp['baseValue'] = array_shift($options);\r\n if (!empty($options)) {\r\n $temp['step'] = array_shift($options);\r\n }\r\n if (!empty($options)) {\r\n $temp['format'] = array_shift($options);\r\n }\r\n if (!empty($options)) {\r\n $temp['timezone'] = array_shift($options);\r\n }\r\n\r\n $options = $temp;\r\n }\r\n\r\n if (!isset($options['step'])) {\r\n $options['step'] = new DateInterval('P1D');\r\n }\r\n if (!isset($options['timezone'])) {\r\n $options['timezone'] = new DateTimeZone(date_default_timezone_get());\r\n }\r\n\r\n parent::__construct($options);\r\n }",
"public function MSDClientCPT(){$this->__construct();}",
"function __construct() {\n\t\tparent::__construct(\n\t\t\t'upcoming_tours', // Base ID\n\t\t\t__( 'Upcoming Tours', 'text_domain' ), // Name\n\t\t\tarray( 'description' => __( 'Show 2 Upcoming Tours', 'text_domain' ), ) // Args\n\t\t);\n\t}",
"public function __construct()\n {\n $this->tnt = new TNTIndexer;\n parent::__construct();\n }",
"public function __construct()\n {\n parent::__construct(new Tv());\n }",
"public function __construct()\n {\n // Metres, Centimetres, Millimetres, Yards, Foot, Inches\n $conversions = array(\n 'Weight' => array(\n 'base' => 'kg',\n 'conv' => array(\n 'g' => 1000,\n 'mg' => 1000000,\n 't' => 0.001,\n 'oz' => 35.274,\n 'lb' => 2.2046,\n )\n ),\n 'Distance' => array(\n 'base' => 'km',\n 'conv' => array(\n 'm' => 1000,\n 'cm' => 100000,\n 'mm' => 1000000,\n 'in' => 39370,\n 'ft' => 3280.8,\n 'yd' => 1093.6\n )\n )\n );\n\n foreach ($conversions as $val) {\n $this->addConversion($val['base'], $val['conv']);\n }\n }",
"public function setAxes($axes)\n {\n $this->data['axes'] = $axes;\n return $this;\n }",
"function __construct() {\n $this->always = array();\n $this->at = array();\n }",
"function __construct( $data = false ){\n\t\t$this->taxonomy = EM_TAXONOMY_CATEGORY;\n\t\tparent::__construct($data);\n\t}",
"public function __construct()\n {\n parent::__construct();\n $this->endpoint = 'scales';\n $this->init();\n }",
"public function __construct(array $stocks, DateTimeInterface $from, DateTimeInterface $to, TimeframeEnum $ticker)\n {\n $this->stocks = $stocks;\n $this->from = $from;\n $this->to = $to;\n $this->ticker = $ticker;\n }",
"function __construct($tick,$name,$exchange) {\n\t\t\t$this->tick = $tick;\n\t\t\t$this->name = $name;\n\t\t\t$this->exchange = $exchange;\n\t\t\t}",
"public function __construct()\n {\n $this->startDate = \\DateTime::createFromFormat('Y-m-d H:i:s', date('Y-m-d H:i:s'));\n $this->endDate = \\DateTime::createFromFormat('Y-m-d H:i:s', date('Y-m-d H:i:s'));\n $this->initWorkflow();\n $this->categories = new ArrayCollection();\n }",
"public function __construct(Trix $field)\n {\n $this->field = $field;\n }",
"public function __construct() {\n\t\t\t$branding = wpex_get_theme_branding();\n\t\t\t$branding = $branding ? $branding . ' - ' : '';\n\t\t\tparent::__construct(\n\t\t\t\t'wpex_templatera',\n\t\t\t\t$branding . __( 'Templatera', 'total' ),\n\t\t\t\tarray(\n\t\t\t\t\t'customize_selective_refresh' => true,\n\t\t\t\t)\n\t\t\t);\n\t\t}",
"public function __construct(Ticker $obj)\n {\n //$this->middleware('auth');\n $this->obj = $obj;\n $this->slug = 'ticker';\n $this->title = 'Ticker';\n \n }",
"function __construct() {\n parent::__construct(\n 'cwts_widget', // Base ID\n __('CWTS Widget', CWTS_TEXT_DOMAIN), // Name OF widget\n array('description' => __('CWTS Widget', CWTS_TEXT_DOMAIN)) // Args For Widget\n );\n }",
"public function __construct() {\n\n $configuration = (new Configuration_File())->find('koala-trends');\n\n parent::__construct($configuration);\n\n $this->url = \"http://\".strtolower($configuration['country']).\".koalatrends.com\";\n\n }",
"public function __construct() {\n\t\t// widget actual processes\n\t\t\n\t\tparent::__construct(\n\t\t\t'xtreme_example_widget', // Base ID\n\t\t\t__( 'Xtreme Example Widget Title', XF_TEXTDOMAIN ), // Name\n\t\t\tarray( 'description' => __( 'A Foo Widget', XF_TEXTDOMAIN ), ) // Args\n\t\t);\n\t}",
"public function __construct()\n {\n if (1 == func_num_args()) {\n $this->payFrequency = func_get_arg(0);\n }\n }",
"public function __construct() {\n parent::__construct();\n\n $this -> radiusX;\n $this -> radiusY;\n\n\t}",
"public function __construct()\n {\n $this->thisWeekStart = date('Y-m-d 00:00:00',strtotime('7 days ago'));\n $this->thisWeekEnd = date('Y-m-d 23:59:59',strtotime('1 days ago'));\n $this->lastWeekStart = date('Y-m-d 00:00:00',strtotime('14 days ago'));\n $this->lastWeekEnd = date('Y-m-d 23:59:59',strtotime('7 days ago'));\n parent::__construct();\n }",
"public function __construct()\n {\n parent::__construct();\n\n $this->apis[] = new DynatraceProblems();\n $this->apis[] = new Alarms();\n $this->apis[] = new Metric(env('CACHETHQ_METRIC'));\n }",
"public function __construct() {\n\t\tparent::__construct(\n\t \t\t'ws7_weather_widget', // Base ID\n\t\t\t'WS7 Weather Widget', // Name\n\t\t\tarray( 'description' => __( 'Shows a pretty forecast based on today\\'s forecast by Kevin Jones', 'ws7weather' ), ) // Args\n\t\t);\n\t}",
"function __construct($width = 200, $height = 200, $type = 'g', $direction='v'){\n\t\t$this -> setChartType($type, $direction);\n\t\t$this -> setDimensions($width, $height);\t\n\t}",
"public function __construct(Temboo_Session $session)\n {\n parent::__construct($session, '/Library/LastFm/User/GetWeeklyTrackChart/');\n }",
"private function __construct(){\r\n $this->ttl_by_type = array(\r\n 'short' => 300 , // 5 minutes\r\n 'default' => 7200, // 2 hours\r\n 'halfday' => 43200, // 12 hours\r\n 'day' => 86400, // 24 hours\r\n 'week' => 604800, // 7 days\r\n 'month' => 2592000, // 30 days (1 month)\r\n 'longterm' => 15811200 // 183 days (6 months)\r\n );\r\n }",
"function __construct() {\n\t\tparent::__construct(\n\t\t\t'zappy_feed_burner', // Base ID\n\t\t\t__('Zappy Feed Burner Widget','fashion'), // Widget Name\n\t\t\tarray( 'description' => __( 'Subscribe to our email newsletter.', 'zappy_feed_burner' ), ) // Widget Description\n\t\t);\n\t}",
"public function __construct($taxa)\n {\n //\n $this->taxa = $taxa;\n\n }",
"public function __construct()\r\n {\r\n $this->createdAt = new \\Datetime('now');\r\n $this->updatedAt = new \\Datetime('now');\r\n $this->deleted = false;\r\n $this->date = new \\Datetime('now');\r\n }",
"public function __construct()\n {\n $this->conversions = array(\n 'km' => 1.60934,\n 'm' => 1609.34,\n 'cm' => 160934,\n 'mm' => 1609340,\n 'yd' => 1760,\n 'ft' => 5280,\n 'in' => 63360,\n 'mi' => 1\n );\n }",
"public function __construct()\n {\n parent::__construct('gems__tracks');\n\n $this->addColumn(\"CASE WHEN gtr_track_class = 'SingleSurveyEngine' THEN 'deleted' ELSE '' END\", 'row_class');\n\n \\Gems_Model::setChangeFieldsByPrefix($this, 'gtr');\n\n $this->set('gtr_date_start', 'default', new \\Zend_Date());\n }",
"public function __construct() {\n // Adding values to the variabels\n $this->currentYear = date(\"Y\");\n $this->offsetYear = 0;\n $this->multiplier = 1;\n }",
"public function __construct() {\n\n\t\t}",
"public function __construct(Temboo_Session $session)\n {\n parent::__construct($session, '/Library/LastFm/User/GetWeeklyArtistChart/');\n }",
"public function __construct() { \n\t\t\n\n\t\t}",
"public function __construct($trade = null)\n\t{\n\t\t$this->trade = $trade;\n\t}",
"public function __construct() {\n parent::__construct();\n $this->setOdataType('#microsoft.graph.shiftPreferences');\n }",
"final private function __construct() {\n\t\t\t}",
"public function __construct() {\n parent::__construct(\n 'get_weather',\n 'Get Weather Forecast',\n ['description' => __('A widget for showing weather forecast', 'getweather')]\n );\n }",
"function __construct() {\n\t\tparent::__construct(\n\t\t \t// Base ID\n\t\t\t'Tweet_Date_Archive_Widget',\n\n\t\t\t// Name\n\t\t\t'Tweet Date Archive',\n\n\t\t\t// Args\n\t\t\tarray(\n\t\t\t\t'description' => 'Add fancy archive stats',\n\t\t\t)\n\t\t);\n\t}",
"public function __construct()\n {\n $this->city = new City;\n $this->country = new Country;\n $this->event = new Event;\n $this->experience = new Experience;\n $this->place = new Place;\n $this->type = new Type;\n $this->subcategory = new Subcategory;\n }",
"public function __construct()\n {\n parent::__construct();\n\n $this->redisOptions = array_merge($this->redisOptions, config('zipkin.redis_options', []));\n $this->esOptions = array_merge($this->esOptions, config('zipkin.es_options', []));\n $this->endpointUrl = config('zipkin.endpoint_url', 'http://localhost:9411/api/v2/spans');\n $this->curlTimeout = config('zipkin.curl_timeout', 1);\n }",
"public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t\n // No DB logging.\n DB::connection()->disableQueryLog();\n \n // Log user in as spicer\n Auth::loginUsingId(1);\n \n // Setup models.\n $this->daytrades_model = App::make('App\\Models\\DayTrades');\n \n // Setup Tradier\n $this->tradier = App::make('App\\Library\\Tradier');\n $this->tradier->set_token(Crypt::decrypt(Auth::user()->UsersTradierToken)); \t\t\n\t}",
"private function __construct() {\n\n // Register taxonomies\n add_action('init', array($this, 'register_taxonomies'));\n\n // Populate taxonomy if it's empty\n add_action('init', array($this, 'populate_default_terms'));\n\n\t\t// set the geo data for this instance\n\t\t$this->what_is_client_ip();\n\t\t$this->get_json_geo_data();\n\t\t$this->save_to_session();\n\t}",
"public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->setAdapter(new TActiveControlAdapter($this));\n\t}",
"public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->setAdapter(new TActiveControlAdapter($this));\n\t}",
"public function __construct()\n\t{\n\t\tparent::__construct();\n\t\t$this->timestamp = time();\n\t}",
"public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t\t$this->Twitter = Twitter::getInstance();\n\t}",
"public function __construct( $args = [] ) {\n\t\t\tadd_filter( 'cx_breadcrumbs/trail_taxonomies', [ $this, 'modify_breadcrumbs_trail_taxonomies'] );\n\t\t}",
"public function __construct()\n\t\t{\n\t\t\t$this->today = date('Y-m-d');\n\n\t\t\t// Set a default start/run date to today. This can be\n\t\t\t// overridden using the setStartDate() method.\n\t\t\t$this->start_date = $this->today;\n\n\t\t\t// Some functions require an end_date. This is set to today\n\t\t\t// but can be overridden using the setEndDate() method.\n\t\t\t$this->end_date = $this->today;\n\t\t}",
"public function __construct() {\n\n $this->post_type = 'testimonials';\n\t\t\n\t\t// Register this cpt\n // First parameter should be an array with Singular, Plural, and Registered name\n parent::__construct(\n \n \tarray(\n\t\t\t\t__( 'Testimonial', '_s' ), // Singular\n\t\t\t\t__( 'Testimonials', '_s' ), // Plural\n\t\t\t\t$this->post_type // Registered name/slug\n\t\t\t),\n\t\t\tarray( \n\t\t\t\t'public' => true,\n\t\t\t\t'publicly_queryable' => true,\n\t\t\t\t'show_ui' => true,\n\t\t\t\t'query_var' => true,\n\t\t\t\t'capability_type' => 'post',\n\t\t\t\t'has_archive' => false,\n\t\t\t\t'hierarchical' => false,\n\t\t\t\t'show_ui' \t\t\t => true,\n\t\t\t\t'show_in_menu' \t\t => true,\n\t\t\t\t'show_in_nav_menus' => false,\n\t\t\t\t'exclude_from_search' => false,\n\t\t\t\t//'rewrite' => array('slug'=> 'feature-Testimonials' ),\n\t\t\t\t'supports' => array( 'title', 'thumbnail', 'editor', 'revisions', 'page-attributes' ),\n\t\t\t\t )\n\n );\n\t\t\n\t\t//add_filter('pre_get_posts', array( $this, 'query_filter' ) );\n\t\t\n }",
"public function __construct( array $values = null )\n {\n parent::__construct( 3, 3, $values );\n }",
"function __construct() {\n\t\tparent::__construct(\n\t\t\t'bimber_sticky_start_point_widget', // Base ID.\n\t\t\tesc_html__( 'Bimber Sticky Start Point', 'bimber' ), // Name\n\t\t\tarray( // Args.\n\t\t\t\t'description' => esc_html__( 'Use this widget to define place where sticky elements starts', 'bimber' ),\n\t\t\t)\n\t\t);\n\t}",
"public function __construct()\n\t\t{\n\t\t\t//\n\t\t}",
"function __construct()\n {\n parent::__construct('rs_Widget_Agenda', 'Eventos', 'Exibe uma lista com os próximos eventos.');\n }",
"public function __construct() {\n\t\tparent::__construct(\n\t\t\t'twitter_timeline',\n\t\t\t/** This filter is documented in modules/widgets/facebook-likebox.php */\n\t\t\tapply_filters( 'jetpack_widget_name', esc_html__( 'Twitter Timeline', 'jetpack' ) ),\n\t\t\tarray(\n\t\t\t\t'classname' => 'widget_twitter_timeline',\n\t\t\t\t'description' => __( 'Display an official Twitter Embedded Timeline widget.', 'jetpack' ),\n\t\t\t\t'customize_selective_refresh' => true,\n\t\t\t)\n\t\t);\n\n\t\tif ( is_active_widget( false, false, $this->id_base ) || is_active_widget( false, false, 'monster' ) || is_customize_preview() ) {\n\t\t\tadd_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );\n\t\t}\n\n\t\tadd_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );\n\t}",
"public function __construct() {\n\t\tparent::__construct(\n\t\t\tfalse,\n\t\t\t'Testimonials',\n\t\t\tarray( 'description' => 'My Testimonials Widget' )\n\t\t);\n\t}",
"public function __construct() {\n $this->xot = XotData::make();\n $this->register_type = (string) $this->xot->register_type;\n }",
"public function __construct() {\n parent::__construct(\n 'eltd_weather_widget', // Base ID\n esc_html__('Elated Weather Widget','newsroom') // Name\n );\n\n $this->setParams();\n }",
"public static function create()\n {\n return new Taxi();\n }",
"public function MSDArtworkCPT(){$this->__construct();}",
"public function __construct()\n {\n parent::__construct();\n\n $this->entrances = Entrance::orExpired()->orSoldOut()->get();\n }",
"public function __construct() {\n\n\t\tparent::__construct();\n\t\t\n\t}",
"public function __construct()\n\t{\n\t\t$this->setTimeStamp();\n\t}",
"final private function __construct()\n {\n }",
"function __construct()\n\t{\n\t\tparent::__construct(\n\t\t\t'jetty_widget_twitter_feed',\n\t\t\t__('Twitter Feed', 'jetty'),\n\t\t\tarray( 'description' => __( 'This widget for display twitter timeline feed', 'jetty' ), )\n\t\t);\n\t}",
"function __construct() {\n\t\tparent::__construct(\n\t\t\t'Calculatr', // Base ID\n\t\t\tesc_html__( 'Calculator', 'text_domain' ), // Name\n\t\t\tarray( 'description' => esc_html__('A stylish calculator to perform basic scientific calculations', 'text_domain' ), ) // Args\n\t\t);\n\t}",
"private function __construct() {\n\t\t}",
"function __construct(int $x, int $y, bool $ticks = true)\n\t{\n\t\t$this->ticks = $ticks;\n\n\t\t$this->sizeX = $x;\n\t\t$this->sizeY = $y;\n\t\t$this->imageName = \"chart.png\";\n\t\t$this->im = imagecreatetruecolor($x, $y);\n\n\t\t//Assign default colors\n\t\t$this->colorTickY = imagecolorallocate($this->im, 255, 255, 255); //white\n\t\t$this->colorTickX = imagecolorallocate($this->im, 255, 255, 255); //white\n\t\t$this->colorAxisY = imagecolorallocate($this->im, 255,215,0); //gold\n\t\t$this->colorAxisX = imagecolorallocate($this->im, 255, 215, 0); //gold\n\t\t$this->colorBackground = imagecolorallocate($this->im, 0, 0, 0); //black\n\t\t$this->colorPoints = imagecolorallocate($this->im, 0,128,0); //green\n\t\timagefill($this->im, 0, 0, $this->colorBackground);\n\t}",
"public function __construct()\n {\n $this->init('atos');\n }",
"public function __construct() {\n parent::__construct();\n $this->setOdataType('#microsoft.graph.subjectRightsRequestEnumeratedSiteLocation');\n }",
"public function __construct(Temboo_Session $session)\n {\n parent::__construct($session, '/Library/LastFm/User/GetWeeklyChartList/');\n }",
"public function __construct() {\r\n\r\n $this->defaults = array(\r\n 'title' => __(\"Advert Categories\", \"adverts\"),\r\n 'show_count' => 1,\r\n 'hide_empty' => 1,\r\n 'top_only' => 0,\r\n 'multi_level' => 0,\r\n );\r\n \r\n \r\n parent::__construct(\r\n 'wpadverts-widget-categories', \r\n __(\"Advert Categories\", \"adverts\"),\r\n array(\r\n \"description\"=> __(\"Displays list of available categories.\", \"adverts\"),\r\n \"classname\" => 'wpadverts-widget-categories'\r\n )\r\n );\r\n \r\n }",
"function __construct() {\n\t\tif ( class_exists( 'PremiseCPT' ) ) {\n\t\t\tnew PremiseCPT( self::$example_labels, $this->example_options );\n\t\t}\n\n\t\tpwp_add_metabox(\n\t\t\t'Example Meta',\n\t\t\tarray( self::$example_labels['post_type_name'] ),\n\t\t\tarray(\n\t\t\t\t'name_prefix' => 'example_meta',\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'context' => 'post',\n\t\t\t\t\t'name' => '[tel]',\n\t\t\t\t\t'label' => 'Telephone',\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t'context' => 'post',\n\t\t\t\t\t'name' => '[email]',\n\t\t\t\t\t'label' => 'Email',\n\t\t\t\t),\n\t\t\t),\n\t\t\t'example_meta'\n\t\t);\n\t}",
"function __construct() {\n\n\t\t}",
"public function __construct()\n {\n $this->plants = new ArrayCollection();\n \n // NOTICE custom property not mapped with BDD\n // $this->tutus = new ArrayCollection();\n\n $this->createdAt = new \\DateTime();\n }",
"public function __construct(array $array)\n {\n if (isset($array['expenseDate'])) {\n $array['expenseDate'] = new Carbon($array['expenseDate']);\n }\n\n parent::__construct($array);\n }",
"public function __construct(Templater $templater, array $token);",
"function __construct() {\n\t\tparent::__construct(\n\t\t\t'coupons_widget', // Base ID\n\t\t\t__( 'ATW Coupons', 'text_domain' ), // Name\n\t\t\tarray( 'description' => __( 'Show 2 coupons', 'text_domain' ), ) // Args\n\t\t);\n\t}",
"public function __construct()\n {\n parent::__construct();\n $this->evenements = new ArrayCollection();\n $this->createdAt = new \\DateTime(date('Y-m-d'));\n }",
"public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}",
"public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}",
"public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}",
"public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}",
"public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}",
"public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}",
"public function __construct() {\n\t\t// TODO Auto-generated constructor\n\t}",
"public function __construct() {\n $this->getDateBought(new \\DateTime());\n }",
"function __construct() {\n\t\tparent::__construct(\n\t\t\t'truman_sign_clock_widget',\n\t\t\t__( 'Clock Widget', 'truman-digital-sign-theme' ),\n\t\t\tarray( 'description' => __( 'Shows a clock with time and date', 'truman-digital-sign-theme' ), )\n\t\t);\n\t}",
"public function __construct() {\n parent::__construct();\n $this->setOdataType('#microsoft.graph.macOSCustomConfiguration');\n }",
"public function __construct($options = null) {\n Configurator::configure($this, $options);\n $this->data = new \\DateTime('now');\n $this->data->setTimezone(new \\DateTimeZone('America/Sao_Paulo'));\n }",
"public function __construct(System $system, Client $client, $ttr = 3600) {\n $this->system = $system;\n\n parent::__construct($client, $ttr);\n }",
"private function __construct() {\r\n\t\r\n\t}",
"public function __construct()\r\n\t\t{\r\n\t\t}"
] | [
"0.70481944",
"0.60520244",
"0.603004",
"0.60108507",
"0.59459907",
"0.5932816",
"0.59299934",
"0.5812928",
"0.5789796",
"0.5704089",
"0.5678779",
"0.56427",
"0.56231314",
"0.56131005",
"0.561186",
"0.56100655",
"0.5599619",
"0.55664164",
"0.55581516",
"0.55551034",
"0.5538389",
"0.5513685",
"0.54962206",
"0.54855114",
"0.54744655",
"0.5470041",
"0.5459354",
"0.5453081",
"0.545268",
"0.54454774",
"0.54299635",
"0.5414544",
"0.5406025",
"0.5405947",
"0.54056525",
"0.5399715",
"0.5399468",
"0.53884834",
"0.537649",
"0.53681344",
"0.53658515",
"0.5357482",
"0.53532165",
"0.53339994",
"0.53338",
"0.53326106",
"0.5324606",
"0.53232026",
"0.53192323",
"0.5317736",
"0.5312723",
"0.53117263",
"0.53117263",
"0.531077",
"0.53001267",
"0.52987623",
"0.52981305",
"0.5296251",
"0.5295351",
"0.52930534",
"0.52893287",
"0.52844006",
"0.52704054",
"0.52690685",
"0.5267112",
"0.5263174",
"0.5260116",
"0.5258828",
"0.52520436",
"0.52501845",
"0.5250156",
"0.52500343",
"0.5246908",
"0.52421004",
"0.5240395",
"0.5239803",
"0.5234689",
"0.5232121",
"0.5229713",
"0.52290374",
"0.5227686",
"0.5224318",
"0.5223614",
"0.5223434",
"0.5222348",
"0.52217686",
"0.5221137",
"0.5220419",
"0.5220419",
"0.5220419",
"0.5220419",
"0.5220419",
"0.5220419",
"0.5220419",
"0.52174026",
"0.52167124",
"0.52163935",
"0.5215355",
"0.52140737",
"0.5212403",
"0.52113557"
] | 0.0 | -1 |
Add item to Tax value | public function addToTax(\Sabre\UpdateReservation\StructType\AncillaryTax $item)
{
// validation for constraint: itemType
if (!$item instanceof \Sabre\UpdateReservation\StructType\AncillaryTax) {
throw new \InvalidArgumentException(sprintf('The Tax property can only contain items of \Sabre\UpdateReservation\StructType\AncillaryTax, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
}
$this->Tax[] = $item;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addTax() {\n\t\t$adb = PearDatabase::getInstance();\n\n\t\t$tableName = $this->getTableNameFromType();\n\t\t$taxid = $adb->getUniqueID($tableName);\n\t\t$taxLabel = $this->getName();\n\t\t$percentage = $this->get('percentage');\n\n\t\t//if the tax is not available then add this tax.\n\t\t//Add this tax as a column in related table\n\t\tif($this->isShippingTax()) {\n\t\t\t$taxname = \"shtax\".$taxid;\n\t\t\t$query = \"ALTER TABLE vtiger_inventoryshippingrel ADD COLUMN $taxname decimal(7,3) DEFAULT NULL\";\n\t\t} else {\n\t\t\t$taxname = \"tax\".$taxid;\n\t\t\t$query = \"ALTER TABLE vtiger_inventoryproductrel ADD COLUMN $taxname decimal(7,3) DEFAULT NULL\";\n\t\t}\n\t\t$res = $adb->pquery($query, array());\n\n\t\tvimport('~~/include/utils/utils.php');\n\n\t\tif ($this->isProductTax()) {\n\t\t\t// TODO Review: if field addition is required in shipping-tax case too.\n\t\t\t// NOTE: shtax1, shtax2, shtax3 that is added as default should also be taken care.\n\n\t\t\t$inventoryModules = getInventoryModules();\n\t\t\tforeach ($inventoryModules as $moduleName) {\n\t\t\t\t$moduleInstance = Vtiger_Module::getInstance($moduleName);\n\t\t\t\t$blockInstance = Vtiger_Block::getInstance('LBL_ITEM_DETAILS',$moduleInstance);\n\t\t\t\t$field = new Vtiger_Field();\n\n\t\t\t\t$field->name = $taxname;\n\t\t\t\t$field->label = $taxLabel;\n\t\t\t\t$field->column = $taxname;\n\t\t\t\t$field->table = 'vtiger_inventoryproductrel';\n\t\t\t\t$field->uitype = '83';\n\t\t\t\t$field->typeofdata = 'V~O';\n\t\t\t\t$field->readonly = '0';\n\t\t\t\t$field->displaytype = '5';\n\t\t\t\t$field->masseditable = '0';\n\n\t\t\t\t$blockInstance->addField($field);\n\t\t\t}\n\t\t}\n\n\t\t//if the tax is added as a column then we should add this tax in the list of taxes\n\t\tif($res) {\n\t\t\t$deleted = 0;\n\t\t\tif($this->isDeleted()) {\n\t\t\t\t$deleted = 1;\n\t\t\t}\n\n\t\t\t$compoundOn = Zend_Json::encode($this->get('compoundon'));\n\t\t\t$regions = Zend_Json::encode($this->get('regions'));\n\n\t\t\t$query = 'INSERT INTO '.$tableName.' values(?,?,?,?,?,?,?,?,?)';\n\t\t\t$params = array($taxid, $taxname, $taxLabel, $percentage, $deleted, $this->get('method'), $this->get('type'), $compoundOn, $regions);\n\t\t\t$adb->pquery($query, $params);\n\t\t\treturn $taxid;\n\t\t}\n\t\tthrow new Error('Error occurred while adding tax');\n\t}",
"function tep_add_tax($price, $tax) {\n global $currencies;\n\n if (DISPLAY_PRICE_WITH_TAX == 'true') {\n return tep_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']) + tep_calculate_tax($price, $tax);\n } else {\n return tep_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);\n }\n}",
"public function testDifferentTaxes()\n {\n\n $item = $this->addItem();\n\n $prevHash = $item->getHash();\n\n $item->tax = .05;\n\n $this->assertNotEquals($prevHash, $item->getHash());\n\n $item = $this->addItem();\n $item->tax = .3;\n\n $this->assertEquals('2.35', $this->laracart->total(false));\n\n $item = $this->addItem(1, 1, true, [\n 'tax' => .7\n ]);\n\n $this->assertEquals('.70', $item->tax());\n\n $this->assertEquals('4.05', $this->laracart->total(false));\n }",
"function tep_add_tax($price, $tax) {\n global $currencies, $sppc_customer_group_show_tax;\n\n if ( (DISPLAY_PRICE_WITH_TAX == 'true') && ($tax > 0) && $sppc_customer_group_show_tax == '1') {\n return tep_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']) + tep_calculate_tax($price, $tax);\n } else {\n return tep_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);\n }\n }",
"function tep_add_tax($price, $tax, $override = false) {\n if ( ( (DISPLAY_PRICE_WITH_TAX == 'true') || ($override == true) ) && ($tax > 0) ) {\n return $price + tep_calculate_tax($price, $tax);\n } else {\n return $price;\n }\n }",
"public function addTaxRate()\n {\n $this->taxRates[] = [\n 'id' => null,\n 'name' => null,\n 'priority' => count($this->taxRates) + 1,\n 'amounts' => $this->taxClasses->map(function ($taxClass) {\n return [\n 'id' => null,\n 'tax_class_id' => $taxClass->id,\n 'tax_class_name' => $taxClass->name,\n 'percentage' => 0,\n ];\n })->toArray(),\n ];\n }",
"function NewTaxAmount($amount ,$tax=0.06)\n{\n $amount += $amount * $tax;\n echo \"Total amount: $amount\";\n}",
"function agst_pmpro_tax($tax, $values, $order)\n{ \t\n\t$tax = round((float)$values[price] * 0.1, 2);\n\treturn $tax;\n}",
"public function getTaxAmount();",
"public function addTax(AdjustmentDataInterface $tax)\n {\n $this->taxes[] = $tax;\n }",
"public function getTotalTaxAmount();",
"public function addTax(){\n $data['title'] = \"Add Tax\";\n $this->admin_load('taxes/add_tax',$data); \n }",
"public function getTaxAttribute(): float;",
"function wp_ajax_inline_save_tax()\n {\n }",
"public function tax(): float;",
"public function getBaseTaxAmount();",
"function tep_calculate_tax($price, $tax) {\n return $price * $tax / 100;\n }",
"public function setTaxInfo(KCommandContext $context)\n\t{\n\t\t$vats = $context->data->federal_tax;\n \n\t\t$this->getItem()->setFederalTax( KConfig::unbox( $vats ) );\n\t}",
"public function getTaxedPrice();",
"public function getTaxInvoiced();",
"public function saveTax() {\n // $productIds = explode(\",\", Input::get('ProductIds'));\n $marchantId = Input::get(\"merchantId\");\n $merchant = Merchant::find(Input::get('merchantId'))->getstores()->first();\n $prifix = $merchant->prefix;\n $taxNew = [];\n $taxNew['label'] = Input::get('label');\n $taxNew['name'] = Input::get('label');\n $taxNew['rate'] = Input::get('rate');\n $taxNew['tax_number'] = Input::get('tax_number');\n $taxNew['status'] = Input::get('status');\n\n if (Input::get('id')) {\n DB::table($prifix . '_tax')->where(\"id\", Input::get(\"id\"))->update($taxNew);\n } else {\n DB::table($prifix . '_tax')->insert($taxNew);\n }\n\n $viewname = \"\";\n $data = ['status' => '1', 'msg' => (Input::get('id')) ? 'Tax updated successfully.' : 'Tax added successfully.', 'taxinfo' => $taxNew];\n return Helper::returnView($viewname, $data, $url = 'admin.tax.view');\n }",
"public function addVehicleTax() {\n global $REQUEST_DATA;\n\t\t$busId = trim($REQUEST_DATA['busNo']);\n\t\t$regnNoValidTill = trim($REQUEST_DATA['regnNoValidTill']);\n\t\t$passengerTaxValidTill = trim($REQUEST_DATA['passengerTaxValidTill']);\n\t\t$roadTaxValidTill = trim($REQUEST_DATA['roadTaxValidTill']);\n\t\t$pollutionCheckValidTill = trim($REQUEST_DATA['pollutionCheckValidTill']);\n\t\t$passingValidTill = trim($REQUEST_DATA['passingValidTill']);\n\n\n\t\t$query = \"\tINSERT INTO bus_entries (busId,busNoValidTill,passengerTaxValidTill,roadTaxValidTill,pollutionCheckValidTill,passingValidTill) \n\t\t\t\t\tVALUES ('$busId','$regnNoValidTill','$passengerTaxValidTill','$roadTaxValidTill','$pollutionCheckValidTill','$passingValidTill')\";\n \n\t\treturn SystemDatabaseManager::getInstance()->executeUpdateInTransaction($query,\"Query: $query\");\n }",
"public function setTax(string $value): void\n {\n if (is_null($value)) {\n return;\n }\n\n if ($value == 0) {\n $value = 'TAX_0';\n } else {\n $value = number_format($value, 2);\n\n // not sure why has two underscores?\n if ($value < 1) {\n $value = 'TAX__' . str_replace('0.', '', $value);\n } else {\n $value = 'TAX_' . str_replace('.', '_', $value);\n }\n }\n\n $this->elements['tax-class-id'] = $value;\n }",
"public function getTaxData($item)\n {\n $removeKey = array('count_in', 'add_on', 'total', 'comp', 'count_out');\n foreach ($removeKey as $key) {\n unset($item[$key]);\n }\n return $item;\n }",
"public function getShippingTaxAmount();",
"public function taxupdate() {\n $arr['page'] = 'taxdetail';\n\t\t$arr['active'] = 'other';\n\t\t$arr['productTax'] = $this->setting->getTax('product');\n\t\t$arr['shippingTax'] = $this->setting->getTax('shipping');\n\t\t$this->load->view('vwSettingTax',$arr);\n\t}",
"public function tax()\n {\n return 0;\n }",
"public function getTaxRate();",
"function BuyableCalculatedAdditionalTax(){\n\t\tif($this->owner InstanceOf ProductVariation) {\n\t\t\tif($product = $this->owner->Product()) {\n\t\t\t\treturn $product->AdditionalTax();\n\t\t\t}\n\t\t}\n\t\treturn $this->owner->AdditionalTax();\n\t}",
"public function subtotalWithTax()\n {\n return $this->subtotal() + $this->tax();\n }",
"private function _addTax($price, $exclShippingTax=true) {\n $totals = $this->getTotals();\n if (isset($totals['tax'])) {\n if ($exclShippingTax) {\n $price += $totals['tax']->getValue()-$this->_getShippingTaxAmount();\n } else {\n $price += $totals['tax']->getValue();\n }\n }\n return $price;\n }",
"function get_taxed_price($value, $tax)\r\n\t{\r\n\t\tglobal $config;\r\n\t\t$taxed = $value + $value * $tax / 100;\r\n\t\treturn $taxed;\r\n\t}",
"abstract public function getTaxType();",
"private function sellTrasactionAddsMoney(){\n\n }",
"public function setTaxAmount($amount);",
"public function set_cart_contents_tax( $value ) {\n\t\t$this->totals['cart_contents_tax'] = wc_round_tax_total( $value );\n\t}",
"function tep_calculate_tax($price, $tax) {\n global $currencies;\n\n return tep_round($price * $tax / 100, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);\n}",
"private function setItemTaxArray(string $row, float $amount): void\n {\n if ((!$this->item instanceof WC_Order_Item_Shipping) && (!$this->item instanceof WC_Order_Item_Fee)) {\n return;\n }\n $taxes = $this->item->get_taxes();\n if (empty($taxes[$row])) {\n $taxes[$row] = array( 0 => $amount );\n } else {\n foreach ($taxes[$row] as &$value) {\n $value = $amount;\n $amount = 0;\n }\n }\n\n try {\n $this->item->set_taxes($taxes);\n $this->needUpdate();\n } catch (\\Throwable $ex) {\n Splash::log()->report($ex);\n }\n }",
"public function getTaxRefunded();",
"public static function calculate_tax_filter() {\n global $edd_options;\n\n if ( isset( $edd_options['taxedd_private_token'] ) ) {\n $private_key = $edd_options['taxedd_private_token'];\n \n try { \n\n $taxtaxamo = new Taxamo( new APIClient( $private_key, 'https://api.taxamo.com' ) );\n\n $cart_items = edd_get_cart_content_details();\n\n $countrycode = \"\";\n\n $address = edd_get_customer_address();\n\n if ( isset($address['country']) && !empty($address['country']) && \"\" !== $address['country'] ) {\n $countrycode = $address['country'];\n } else {\n $ipcc = taxedd_get_country_code();\n $countrycode = $ipcc->country_code;\n }\n\n $transaction = new Input_transaction();\n $transaction->currency_code = edd_get_currency();\n $transaction->buyer_ip = $_SERVER['REMOTE_ADDR'];\n $transaction->billing_country_code = $countrycode;\n $transactionarray = array();\n $customid = \"\";\n $transaction->force_country_code = $countrycode;\n\n if ( !empty( $cart_items ) ) { \n foreach ( $cart_items as $cart_item ) {\n\n $customid++;\n $transaction_line = new Input_transaction_line();\n $transaction_line->amount = $cart_item['item_price'];\n $transaction_line->custom_id = $cart_item['name'] . $customid;\n array_push( $transactionarray, $transaction_line );\n\n }\n }\n\n $transaction->transaction_lines = $transactionarray;\n\n $resp = $taxtaxamo->calculateTax( array( 'transaction' => $transaction ) );\n\n return $resp->transaction->tax_amount;\n\n } catch ( exception $e ) {\n\n return \"\";\n }\n }\n }",
"public function getBaseShippingTaxAmount();",
"public function setTaxNo($taxno);",
"public function formattedTax(): string;",
"public function getTaxCost()\n {\n $total = 0;\n\n foreach ($this->items as $item) {\n if ($item->TotalTax) {\n $total += $item->TotalTax;\n }\n }\n\n if ($this->postage && $this->postage->Cost && $this->postage->Tax) {\n $total += ($this->postage->Cost / 100) * $this->postage->Tax;\n }\n \n return $total;\n }",
"public function getBaseTaxInvoiced();",
"public function calculateTaxAction()\n {\n $data = $this->Request()->getParams();\n\n //init variables\n $positions = json_decode($data['positions']);\n $shippingCosts = $data['shippingCosts'];\n $net = $data['net'];\n $total = 0;\n $taxSums = [];\n $totalWithoutTax = 0;\n $articleNumber = 0;\n $shippingCostsNet = 0;\n\n foreach ($positions as $position) {\n $total += $position->price * $position->quantity;\n $priceWithoutTax = $this->calculateNetPrice($position->price, $position->taxRate) * $position->quantity;\n $totalWithoutTax += $priceWithoutTax;\n\n if (!isset($taxSums[$position->taxRate])) {\n $taxSums[$position->taxRate] = [];\n $taxSums[$position->taxRate]['sum'] = 0;\n $taxSums[$position->taxRate]['count'] = 0;\n }\n $taxSums[$position->taxRate]['sum'] += $this->calculateNetPrice($position->price, $position->taxRate);\n $taxSums[$position->taxRate]['count'] += $position->quantity;\n\n $articleNumber += $position->quantity;\n }\n\n if ($shippingCosts != 0 && !is_null($shippingCosts) && $shippingCosts != '') {\n foreach ($taxSums as $taxRate => $taxRow) {\n $taxRelation = $articleNumber / $taxRow['count'];\n $shippingCostsRelation = $shippingCosts / $taxRelation;\n\n $shippingCostsNet += $this->calculateNetPrice($shippingCostsRelation, $taxRate);\n }\n if (count($taxSums) == 0) {\n $shippingCostsNet = $shippingCosts;\n }\n }\n\n $sum = $total;\n if ($net === 'true') {\n $total = $shippingCostsNet + $total;\n } else {\n $total = $shippingCosts + $total;\n }\n $totalWithoutTax = $shippingCostsNet + $totalWithoutTax;\n\n $taxSum = $total - $totalWithoutTax;\n if ($totalWithoutTax == 0) {\n $taxSum = 0;\n }\n\n if ($net === 'true') {\n $shippingCosts = $shippingCostsNet;\n $totalWithoutTax = $total;\n $taxSum = 0;\n }\n\n $result = [\n 'totalWithoutTax' => $this->roundPrice($totalWithoutTax),\n 'sum' => $this->roundPrice($sum),\n 'total' => $this->roundPrice($total),\n 'shippingCosts' => $this->roundPrice($shippingCosts),\n 'shippingCostsNet' => $this->roundPrice($shippingCostsNet),\n 'taxSum' => $this->roundPrice($taxSum)\n ];\n\n $this->view->assign(\n [\n 'data' => $result,\n 'success' => true\n ]\n );\n }",
"public function tax()\n {\n return $this->getCartSessionCollection()->map(function($item, $key) {\n return (($item['price'] * $item['quantity']) / 100) * $this->config->get('cart.tax_rate');\n })->reduce(function($carry, $item) {\n return $carry + $item;\n });\n }",
"function addTaxRates ( ) {\r\n\r\n\t\t$taxratekeys = $this->cart->lookupProductTaxRates( true );\r\n\r\n\t\t$this->glmsg .= '<tax-tables>'\r\n\t\t \t . '<default-tax-table>'\r\n \t\t . '<tax-rules>'\r\n \t\t . '<default-tax-rule>'\r\n \t\t . '<rate>0</rate>'\r\n \t\t . '<tax-area><world-area/></tax-area>'\r\n \t\t . '</default-tax-rule>'\r\n \t\t . '</tax-rules>'\r\n \t\t . '</default-tax-table>'\r\n\t\t\t\t\t . '<alternate-tax-tables>';\r\n\r\n\t\tif( is_array( $taxratekeys ) ) {\r\n\t\t\tforeach( $taxratekeys as $key ) {\r\n\t\t\t\t$this->glmsg .= '<alternate-tax-table standalone=\"true\" name=\"' . htmlspecialchars( $key, ENT_NOQUOTES) . '\">'\r\n\t\t\t\t\t\t\t . '<alternate-tax-rules>'\r\n\t\t\t\t\t\t\t . \t'<alternate-tax-rule>'\r\n\t\t\t\t\t\t\t . \t\t'<rate>' . strval( $this->cart->lookupTaxPerc( $key ) ) . '</rate>'\r\n\t\t\t\t\t\t\t . \t\t'<tax-area><world-area/></tax-area>'\r\n\t\t\t\t\t\t\t . \t'</alternate-tax-rule>'\r\n\t\t\t\t\t\t\t . '</alternate-tax-rules>'\r\n\t\t\t\t\t\t\t . '</alternate-tax-table>';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif( $this->cart->getShippingHandlingTotal() != 0 ) {\r\n\t\t\t$this->glmsg .= '<alternate-tax-table standalone=\"true\" name=\"shipping\">'\r\n\t\t\t\t\t\t . '<alternate-tax-rules>'\r\n\t\t\t\t\t\t . \t'<alternate-tax-rule>'\r\n\t\t\t\t\t\t . \t\t'<rate>' . $this->cart->lookupTaxPercSpecial( 'Shipping' ) . '</rate>'\r\n\t\t\t\t\t\t . \t\t'<tax-area><world-area/></tax-area>'\r\n\t\t\t\t\t\t . \t'</alternate-tax-rule>'\r\n\t\t\t\t\t\t . '</alternate-tax-rules>'\r\n\t\t\t\t\t\t . '</alternate-tax-table>';\r\n\t\t}\r\n\r\n\r\n\t\t$this->glmsg .= '</alternate-tax-tables>'\r\n\t\t\t\t\t . '</tax-tables>';\r\n\t}",
"public function add_bill_item($action, $bill_id, $particular, $qnt = NULL, $amt = NULL, $mrp = NULL, $item_id = NULL, $tax_amount = NULL,$tax_id = NULL) {\r\n\r\n\t\t$data['bill_id'] = $bill_id;\r\n\r\n\t\t$data['particular'] = $particular;\r\n\r\n\t\t$data['quantity'] = $qnt;\r\n\r\n\t\t$data['amount'] = $amt;\r\n\r\n\t\t$data['mrp'] = $mrp;\r\n\r\n\t\t$data['type'] = $action;\r\n\r\n\t\t$data['item_id'] = $item_id;\r\n\r\n\t\t$data['clinic_code'] = $this->session->userdata('clinic_code');\r\n\r\n\t\t$data['tax_amount'] = $tax_amount;\r\n\r\n\t\t$data['tax_id'] = $tax_id;\r\n\r\n\r\n\r\n\t\tif ($item_id != NULL){\r\n\r\n\t\t\t$query = $this->db->get_where('bill_detail', array('bill_id ' => $bill_id, 'item_id ' => $item_id));\r\n\r\n\t\t\tif ($query->num_rows() > 0){\r\n\r\n\t\t\t\t$bill_detail = $query->row_array();\r\n\r\n\t\t\t\t$data['quantity'] = $qnt + $bill_detail['quantity'];\r\n\r\n\t\t\t\t$data['amount'] = $amt + $bill_detail['amount'];\r\n\r\n\t\t\t\t$data['sync_status'] = 0;\r\n\r\n\t\t\t\t$this->db->update('bill_detail', $data,array('bill_id ' => $bill_id, 'item_id ' => $item_id));\r\n\r\n\t\t\t\t//echo $this->db->last_query().\"<br/>\";\r\n\r\n\t\t\t}else{\r\n\r\n\t\t\t\t$this->db->insert('bill_detail', $data);\r\n\r\n\t\t\t\t$bill_detail_id = $this->db->insert_id();\r\n\r\n\t\t\t\t//echo $this->db->last_query().\"<br/>\";\r\n\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\r\n\t\t\t$this->db->insert('bill_detail', $data);\r\n\r\n\t\t\t$bill_detail_id = $this->db->insert_id();\r\n\r\n\t\t\t//echo $this->db->last_query().\"<br/>\";\r\n\r\n\t\t}\r\n\r\n\t\tif($action == \"tax\"){\r\n\r\n\t\t\t$total_amount = 0;\r\n\r\n\t\t\t$tax_amount = $amt;\r\n\r\n\t\t}else{\r\n\r\n\t\t\t$total_amount = $amt;\r\n\r\n\t\t}\r\n\r\n\r\n\r\n $sql = \"update \" . $this->db->dbprefix('bill') . \" set sync_status = 0,total_amount = total_amount + ? where bill_id = ?;\";\r\n\r\n $this->db->query($sql, array($total_amount, $bill_id));\r\n\r\n\t\t//echo $this->db->last_query().\"<br/>\";\r\n\r\n\r\n\r\n\t\t$total_tax_amount=$tax_amount;\r\n\r\n\t\t$sql = \"update \" . $this->db->dbprefix('bill') . \" set sync_status = 0,tax_amount = tax_amount + ? where bill_id = ?;\";\r\n\r\n $this->db->query($sql, array($total_tax_amount, $bill_id));\r\n\r\n\t\t//echo $this->db->last_query().\"<br/>\";\r\n\r\n\r\n\t\t//Due Amount \r\n\t\t/*$due_amount = $total_amount + $tax_amount;\r\n\r\n\t\t$sql = \"update \" . $this->db->dbprefix('bill') . \" set sync_status = 0,due_amount = due_amount + ? where bill_id = ?;\";\r\n\r\n $this->db->query($sql, array($due_amount, $bill_id));\r\n\r\n\t\t//echo $this->db->last_query().\"<br/>\";*/\r\n\t\treturn $bill_detail_id;\r\n\r\n }",
"public function tax(bool $update = true): float;",
"public function getSubtotalInclTax();",
"function testTaxModifier() {\n\t\t$this->get('product-1b/add');\n\t\t$this->get('product-1b/add');\n\n\t\t/* Log our NZ member in so we can assert they see the GST component */\n\t\t$this->session()->inst_set('loggedInAs', $this->idFromFixture('Member', 'member'));\n\t\t\n\t\t/* 12.5% GST appears to our NZ user logged in */\n\t\t$this->get('checkout/');\n\t\t$this->assertPartialMatchBySelector('tr.taxmodifier td', array(\n\t\t\t'12.5% GST (included in the above price)'\n\t\t));\n\n\t\t/* Let's check the totals to make sure GST wasn't being added (which is important!) */\n\t\t/* NZD is shown as the label, since it was set as the site currency in setUp() */\n\t\t$this->assertExactMatchBySelector('#Table_Order_Total', '$1,205.00 NZD');\n\t\t\n\t\t/* Let's sneakily change the GST to be exclusive, altering the checkout total */\n\t\tTaxModifier::set_for_country('NZ', 0.125, 'GST', 'exclusive');\n\t\t\n\t\t/* See what the checkout page has got now */\n\t\t$this->get('checkout/');\n\t\t\n\t\t/* Check the total, it has changed since the GST is now exclusive */\n\t\t$this->assertExactMatchBySelector('#Table_Order_Total', '$1,355.63 NZD');\n\t\t\t\t\n\t\t/* Member logs out */\n\t\t$this->session()->inst_set('loggedInAs', null);\n\t}",
"public function getTaxAmount() {\n return $this->item->getTaxAmount();\n }",
"private function get_total_tax() {\n\n\t\t$taxes = $this->order->getCombinedTax();\n\n\t\t$tax = 0;\n\n\t\tif ( empty( $taxes ) ) {\n\t\t\treturn $tax;\n\t\t}\n\n\t\tforeach( $taxes as $name => $amount ) {\n\t\t\t$tax += $amount;\n\t\t}\n\n\t\treturn $tax;\n\t}",
"public function syncTaxPercentage() : void\n {\n $subscription = $this->asStripeSubscription();\n $subscription->tax_percent = $this->user->taxPercentage();\n $subscription->save();\n }",
"public function setTotalTax($value){\n return $this->setParameter('total_tax', $value);\n }",
"function tep_calculate_tax($price, $tax) {\n global $currencies;\n return tep_round($price * $tax / 100, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);\n }",
"function calculate_tax($sub){\n\t//echo $sub;\n\treturn $sub * 0.12;\n\t}",
"protected function _calculateItemTaxPrice($item) {\n\t\t\t$response = 0.00;\n\t\t\treturn $response;\n\t\t}",
"function saveOrder($item) {\n $data = json_encode($item->data);\n $this->db->executeQuery(\"delete from payment_order where itemid = '\" . $item->itemid . \"'\");\n $dt = date('Y-m-d H:i:s');\n $user = db_fetch_array($this->db->executeQuery(\"select * from registration where id = '\" . $item->userid . \"'\"));\n $qry = \"insert into payment_order ( id, orderid, userid, amount, itemid, itemname, itemdescription, payfor, data, paymentway, datetime, auction_id) values(null, '\" . $item->orderid . \"','\" . $item->userid . \"','\" . $item->amount . \"','\" . $item->itemid . \"','\" . addslashes($item->itemname) . \"','\" . addslashes($item->itemdescription) . \"','\" . addslashes($item->payfor) . \"','$data','\" . $item->paymentway . \"','$dt', '\" . $item->itemid . \"')\";\n $this->db->executeQuery($qry);\n\t$this->db->executeQuery(\"CREATE TABLE IF NOT EXISTS `tax_records` ( `id` int(11) NOT NULL auto_increment, `invoiceid` varchar(250) default NULL, `userid` int(20) NOT NULL, `tax` decimal(20, 2) NOT NULL default '0.00', `state` varchar(200) default null, `country` varchar(200) default null, PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;\");\n\t$this->db->executeQuery(\"alter table tax_records add column st_tax decimal(20, 2) not null default '0.00'\");\n\t$this->db->executeQuery(\"insert into tax_records values(null, '\" . $item->orderid . \"','\" . $item->userid . \"', '\" . number_format($item->data->tax1,2) . \"', '$user[delivery_state]', '$user[delivery_country]', '\" . number_format($item->data->tax2,2) . \"')\");\n \t echo db_error();\n }",
"function fix_order_amount_item_total( $price, $order, $item, $inc_tax = false, $round = true ) {\n $qty = ( ! empty( $item[ 'qty' ] ) && $item[ 'qty' ] != 0 ) ? $item[ 'qty'] : 1;\n if( $inc_tax ) {\n $price = ( $item[ 'line_total' ] + $item[ 'line_tax' ] ) / $qty;\n } else {\n $price = $item[ 'line_total' ] / $qty;\n }\n $price = $round ? round( $price, 2 ) : $price;\n return $price;\n}",
"public function getTaxTotal() {\n $total = 0;\n\n // Calculate total from items in the list\n foreach($this->Items() as $item) {\n $total += $item->getTaxTotal();\n }\n\n // Add any tax from postage\n $total += $this->PostageTax;\n\n return $total;\n }",
"public function getTax()\n\t{\n\t\treturn $this->getKeyValue('Tax'); \n\n\t}",
"public function tax($decimals = null, $decimalPoint = null, $thousandSeperator = null)\n {\n $content = $this->getContent();\n $tax = config('cart.tax');\n $coupon = $this->coupon();\n\n $summPrice = 0;\n foreach ($content as $item) {\n $summPrice += $item->price * $item->qty;\n }\n\n $summPrice = $summPrice - $coupon;\n $priceTax = $summPrice * $tax / 100 + 0.3 + $summPrice;\n $summPriceTax = $priceTax * $tax / 100 + 0.3;\n return $this->numberFormat($summPriceTax, $decimals, $decimalPoint, $thousandSeperator);\n }",
"public function createTax($data) \n {\n return $this->insert($this->table,$data);\n }",
"public function getBaseTaxRefunded();",
"private function registerTax() {\n $labels = array(\n 'name' => esc_html__('Masonry Gallery Categories', 'eltdf-core'),\n 'singular_name' => esc_html__('Masonry Gallery Category', 'eltdf-core'),\n 'search_items' => esc_html__('Search Masonry Gallery Categories', 'eltdf-core'),\n 'all_items' => esc_html__('All Masonry Gallery Categories', 'eltdf-core'),\n 'parent_item' => esc_html__('Parent Masonry Gallery Category', 'eltdf-core'),\n 'parent_item_colon' => esc_html__('Parent Masonry Gallery Category:', 'eltdf-core'),\n 'edit_item' => esc_html__('Edit Masonry Gallery Category', 'eltdf-core'),\n 'update_item' => esc_html__('Update Masonry Gallery Category', 'eltdf-core'),\n 'add_new_item' => esc_html__('Add New Masonry Gallery Category', 'eltdf-core'),\n 'new_item_name' => esc_html__('New Masonry Gallery Category Name', 'eltdf-core'),\n 'menu_name' => esc_html__('Masonry Gallery Categories', 'eltdf-core'),\n );\n\n register_taxonomy($this->taxBase, array($this->base), array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'query_var' => true,\n 'show_admin_column' => true,\n 'rewrite' => array( 'slug' => 'masonry-gallery-category' ),\n ));\n }",
"public function store(CreateTaxRequest $request)\n {\n $input = $request->all();\n $customFields = $this->customFieldRepository->findByField('custom_field_model', $this->taxRepository->model());\n try {\n $tax = $this->taxRepository->create($input);\n $tax->customFieldsValues()->createMany(getCustomFieldsValues($customFields, $request));\n\n } catch (ValidatorException $e) {\n Flash::error($e->getMessage());\n }\n\n Flash::success(__('lang.saved_successfully', ['operator' => __('lang.tax')]));\n\n return redirect(route('taxes.index'));\n }",
"public function getFormattedTaxAttribute(): string;",
"public function getTotalTax(){\n return $this->getParameter('total_tax');\n }",
"public function testPostTaxTotal()\n {\n $items = [1, 2, 5, 8];\n $tax = 0.20;\n $coupon = null;\n\n // Create a mock receipt class\n $Receipt = $this->getMockBuilder('TDD\\Receipt')\n ->setMethods(['tax', 'total'])\n ->getMock();\n\n // Make sure that the total method in mock Receipt will return 10.00\n $Receipt->expects($this->once())// Total assumes it will be called once\n ->method('total')\n ->with($items, $coupon)// Make sure total is called with these values\n ->will($this->returnValue(10.00));\n\n // Make sure that the tax method in mock Receipt will return 1.00\n $Receipt->expects($this->once())// Tax assumes it will be called once\n ->method('tax')\n ->with(10.00, $tax)// Make sure tax is called with these values\n ->will($this->returnValue(1.00));\n\n // Execute postTaxTotal with random values\n $result = $Receipt->postTaxTotal([1, 2, 5, 8], 0.20, null);\n $this->assertEquals(\n 11.00, // Expected value\n $result // Value returned by postTaxTotal() using mocked values 10.00 and 1.00\n );\n }",
"public function getTax()\n {\n return $this->tax;\n }",
"public function testTax()\n {\n $inputAmount = 10.00;\n $taxInput = 0.10;\n\n // Run tax() with the variables and save to $output\n $output = $this->Receipt->tax($inputAmount, $taxInput);\n $this->assertEquals(\n 1.00, // expected value\n $output, // Value returned by tax()\n 'The tax calculation should equal 1.00' // Message to return in case of error\n );\n }",
"abstract public function getTaxPercent();",
"public function getAlias()\n {\n return 'tax';\n }",
"function save_tax_meta( $term_id ){\n \n if ( isset( $_POST['term_meta'] ) ) {\n \n $term_meta = array();\n \n $term_meta['tax_date'] = isset ( $_POST['term_meta']['tax_date'] ) ? esc_html( $_POST['term_meta']['tax_date'] ) : '';\n \n //formato da data\n if( preg_match( '/[0-9]{2}\\/[0-9]{2}\\/[0-9]{4}/', $term_meta['tax_date'] ) )\n $term_meta['tax_date'] = preg_replace( '/^([0-9]{2})\\/([0-9]{2})\\/([0-9]{4})$/', '$3-$2-$1', $term_meta['tax_date'] );\n\n // Save the option array.\n update_option( \"taxonomy_$term_id\", $term_meta );\n \n } // if isset( $_POST['term_meta'] )\n }",
"public function __tallyUpInvoice() {\n\n $this->__itemTotals();\n\n $subTotal = $this->__subtotal($this->request->data['items']);\n\n //$taxTotal = $this->__tax($subTotal, $this->request->data['Invoice']['taxRate']);\n\n //$taxTotal = $this->__tax($this->request->data['items']);\n\n //$this->request->data['total'] = $subTotal + $taxTotal;\n $this->request->data['total'] = $subTotal;\n\n //$this->request->data['subTotal'] = $subTotal;\n\n //$this->request->data['taxTotal'] = $taxTotal;\n\n return true;\n }",
"public function getExternalTaxRate();",
"public function getTotal() \n {\n $tax = $this->getTax(); \n return $this->_subtotal + $tax; \n }",
"public function getCustomerTaxvat();",
"public function add($item);",
"public function add($item);",
"function add($item);",
"public function getTaxableItemsAttribute(): Collection;",
"function get_tax($tax_class, $subtotal)\n{\n global $config, $tax_cache, $current_user_info;\n\n $rate = get_tax_rate($tax_class);\n\n if ($config['cart']['tax_base'] == 'shipping') {\n $tbase = 'ship';\n } else {\n $tbase = 'bill';\n }\n if (comparecsn($config['site_city'], $current_user_info[$tbase.'_city'])) {\n $tax_rate = $rate['tax_city'];\n } elseif (comparecsn($config['site_state'], $current_user_info[$tbase.'_state'])) {\n $tax_rate = $rate['tax_state'];\n } elseif (comparecsn($config['site_country'], $current_user_info[$tbase.'_country'])) {\n $tax_rate = $rate['tax_nation'];\n } else {\n $tax_rate = $rate['tax_world'];\n }\n\n return ($tax_rate / 100) * $subtotal;\n}",
"public function getTax(): Tax {\n\t\t\treturn Tax::fromArray( $this->value );\n\t\t}",
"function __lineItemTotal($qty, $price, $rate) {\n\n\n\n\n\n\n\n// if ($curency_id == 2)\n// $currency = 1;\n//\n// if ($curency_id == 1)\n// $currency = 4.17;\n//\n// if ($curency_id == 3)\n// $currency = 4.50;\n\n\n\n $line_total = $qty * $price * $rate;\n\n //$line_total = $line_total + (($line_total * $taxRate) / 100);\n\n\n\n return $line_total;\n }",
"public function setTax(float $tax)\n\t{\n\t\t$this->addKeyValue('Tax', $tax); \n\n\t}",
"function TaxInclusivePrice(){\n\t\tuser_error(\"to be completed\");\n\t}",
"abstract public function add_item();",
"public function getBaseShippingTaxRefunded();",
"public function addItemDiscountAmount($amount)\n {\n $this->itemDiscountAmount += $amount;\n }",
"public function getShippingTaxRefunded();",
"public function getTax(){\n $brutto = $this->getBrutto();\n return $brutto - ($brutto / (107) * 100);\n }",
"public function insertTax(){\n \n if($this->form_validation->run('add_tax') == FALSE){\n $data['title'] = \"Add Tax\";\n $this->admin_load('taxes/add_tax',$data); \n }else{\n\n $data= array(\n 'name'=>$this->input->post('name'),\n 'taxrate'=>$this->input->post('taxrate')\n );\n $table = 'tbltaxes';\n $insertData= $this->TaxModel->insert($table, $data);\n if($insertData){\n\n redirect('admin/taxes');\n }\n }\n\n }",
"public function getTax()\n {\n return $this->_tax;\n }",
"public function add_to_cart_details_post(){\n $product_id = $this->input->post('product_id');\n $qnty \t\t= $this->input->post('qnty');\n $variant = $this->input->post('variant');\n $store_id = $this->input->post('store_id');\n\n $discount = 0;\n $onsale_price = 0;\n $cgst = 0;\n $cgst_id = 0;\n\n $sgst = 0;\n $sgst_id = 0;\n\n $igst = 0;\n $igst_id = 0;\n\n $result = array();\n\n if ($product_id && $qnty>0) {\n $product_details = $this->Homes->product_details($product_id,$store_id);\n\n //CGST product tax\n $this->db->select('*');\n $this->db->from('tax_product_service');\n $this->db->where('product_id',$product_details->product_id);\n $this->db->where('tax_id','H5MQN4NXJBSDX4L');\n $tax_info = $this->db->get()->row();\n\n if (!empty($tax_info)) {\n if (($product_details->onsale_store == 1)) {\n $cgst = $product_details->onsale_price_store - ($product_details->onsale_price_store/($tax_info->tax_percentage/100+1));\n $cgst = number_format((float)$cgst,'4','.','');\n $cgst_id = $tax_info->tax_id;\n }else{\n $cgst = $product_details->price_store - ($product_details->price_store/($tax_info->tax_percentage/100+1));\n $cgst = number_format((float)$cgst,'4','.','');\n $cgst_id = $tax_info->tax_id;\n }\n }\n\n if ($product_details->onsale_store) {\n $price = $product_details->onsale_price_store /*- $cgst*/;\n $onsale_price = $product_details->onsale_price_store /*- $cgst*/;\n $discount = $product_details->price_store - $product_details->onsale_price_store;\n }else{\n $price = $product_details->price_store /*- $cgst*/;\n }\n\n //SGST product tax\n $this->db->select('*');\n $this->db->from('tax_product_service');\n $this->db->where('product_id',$product_details->product_id);\n $this->db->where('tax_id','52C2SKCKGQY6Q9J');\n $tax_info = $this->db->get()->row();\n\n if (!empty($tax_info)) {\n if (($product_details->onsale == 1)) {\n //$sgst = ($tax_info->tax_percentage * $product_details->onsale_price_store)/100;\n $sgst = $product_details->onsale_price_store - ($product_details->onsale_price_store/($tax_info->tax_percentage/100+1));\n $sgst = number_format((float)$sgst,'4','.','');\n $sgst_id = $tax_info->tax_id;\n }else{\n //$sgst = ($tax_info->tax_percentage * $product_details->price_store)/100;\n $sgst = $product_details->price_store - ($product_details->price_store/($tax_info->tax_percentage/100+1));\n $sgst = number_format((float)$sgst,'4','.','');\n $sgst_id = $tax_info->tax_id;\n }\n }\n\n //IGST product tax\n $this->db->select('*');\n $this->db->from('tax_product_service');\n $this->db->where('product_id',$product_details->product_id);\n $this->db->where('tax_id','5SN9PRWPN131T4V');\n $tax_info = $this->db->get()->row();\n\n if (!empty($tax_info)) {\n if (($product_details->onsale == 1)) {\n $igst = $product_details->onsale_price_store - ($product_details->onsale_price_store/($tax_info->tax_percentage/100+1));\n $igst = number_format((float)$igst,'4','.','');\n $igst_id = $tax_info->tax_id;\n }else{\n $igst = $product_details->price_store - ($product_details->price_store/($tax_info->tax_percentage/100+1));\n $igst = number_format((float)$igst,'4','.','');\n $igst_id = $tax_info->tax_id;\n }\n }\n\n //Shopping cart validation\n $flag = TRUE;\n\n if($flag) {\n $data = array(\n 'id' => $this->generator(15),\n 'product_id' => $product_details->product_id,\n 'qty' => $qnty,\n 'price' => $price,\n 'actual_price' => $product_details->price_store,\n 'supplier_price' => $product_details->supplier_price_store,\n 'onsale_price' => $onsale_price,\n 'name' => $product_details->product_name,\n 'discount' => $discount,\n 'variant' => $variant,\n 'promo' => $product_details->promo_store,\n 'options' => array(\n 'image' => $product_details->image_thumb,\n 'model' => $product_details->product_model,\n 'cgst' => $cgst,\n 'sgst' => $sgst,\n 'igst' => $igst,\n 'cgst_id' => $cgst_id,\n 'sgst_id' => $sgst_id,\n 'igst_id' => $igst_id,\n )\n );\n }\n //$this->response($this->cart->total_items(),201);\n $result['result'] = '1';\n $result['data'] = $data;\n $result['pagination'] = false;\n }\n else\n {\n $result['result'] = '2';\n $result['message'] = 'Error al agregar al carrito';\n }\n\n $this->response($result,201);\n }",
"function AddProduct() {\n\t$customer_id=$_GET['customer_id'];\n\n\t$invoice_id=$_GET['invoice_id'];\n\n\t$invoice_item_id = $_POST['invoice_item_id'];\n\n\t$service_type = $_POST['service_type'];\n\n\t$service_range = $_POST['service_range'];\n\n\t$price = $_POST['price'];\n\n\t$value = ($_POST['price'] * $_POST['service_range'])-(($_POST['price'] * $_POST['service_range'])*($_POST['vat']/(100+$_POST['vat'])));\n\t$vat_percent = $_POST['vat'];\n\n\t$vat= ($_POST['price'] * $_POST['service_range'])*($_POST['vat']/(100+$_POST['vat']));\n\n\t$vat_value =(($_POST['price'] * $_POST['service_range'])-(($_POST['price'] * $_POST['service_range'])*($_POST['vat']/(100+$_POST['vat']))))+\n\t(($_POST['price'] * $_POST['service_range'])*($_POST['vat']/(100+$_POST['vat'])));\n\tif ($_POST['rebate']>0) {\n\t\t$rabat = (($_POST['price'] * $_POST['service_range']/100)*$_POST['rebate']);\n\t}else{\n\t\t$rebate = $_POST['rebate'];}\n\n\t\tif ($_POST['rebate']>0) {\n\t\t\t$total_value = ((($_POST['price'] * $_POST['service_range'])-(($_POST['price'] * $_POST['service_range'])*($_POST['vat']\n\t\t\t\t/(100+$_POST['vat']))))+(($_POST['price'] * $_POST['service_range'])*($_POST['vat']/(100+$_POST['vat']))))\n\t\t\t-(($_POST['price']*$_POST['service_range'])/100*$_POST['rebate']);\n\t\t}else{\n\t\t\t$total_value = (($_POST['price'] * $_POST['service_range'])-(($_POST['price'] * $_POST['service_range'])\n\t\t\t\t*($_POST['vat']/(100+$_POST['vat'])))+(($_POST['price'] * $_POST['service_range'])*($_POST['vat']/(100+$_POST['vat']))));}\n\n\t\t\t$query = \"INSERT INTO invoice_item (invoice_item_id,invoice_id,customer_id, service_range, service_type, price, value,\n\t\t\t vat ,vat_percent,vat_value,rebate,total_value)\n\t\t\tVALUES (NULL,'$invoice_id','$customer_id','$service_range','$service_type','$price','$value',\n\t\t\t\t'$vat','$vat_percent','$vat_value','$rebate','$total_value')\";\n\t\t\t$result = mysql_query($query);\n\n\t\t\tif(!$result) \n\t\t\t{\n\t\t\t\tdie(mysql_error());\n\t\t\t}\n\n\t\t}",
"public function set_total_tax( $value ) {\n\t\t$this->totals['total_tax'] = wc_round_tax_total( $value );\n\t}",
"function glbs_save_extra_tax_fileds( $term_id ) {\n\tif ( ! isset( $_POST['glbs_nonce_tax'] ) || ! wp_verify_nonce( $_POST['glbs_nonce_tax'], '_glbs_nonce_tax' ) ) {\n\t\treturn;\n\t}\n\t\n\tif ( isset( $_POST['basic_seo_title'] ) ) {\n\t\tupdate_term_meta( $term_id, 'basic_seo_title', esc_attr( $_POST['basic_seo_title'] ) );\n\t}\n\tif ( isset( $_POST['basic_seo_keywords'] ) ) {\n\t\tupdate_term_meta( $term_id, 'basic_seo_keywords', esc_attr( $_POST['basic_seo_keywords'] ) );\n\t}\n\tif ( isset( $_POST['basic_seo_description'] ) ) {\n\t\tupdate_term_meta( $term_id, 'basic_seo_description', esc_attr( $_POST['basic_seo_description'] ) );\n\t}\n}"
] | [
"0.7166932",
"0.660643",
"0.66051143",
"0.6544759",
"0.65325576",
"0.6413176",
"0.6383377",
"0.63763964",
"0.63555014",
"0.6282826",
"0.6167081",
"0.6140034",
"0.60363984",
"0.6033494",
"0.5978659",
"0.59554535",
"0.5951478",
"0.5904062",
"0.589607",
"0.58868414",
"0.58721906",
"0.58636606",
"0.58489454",
"0.5838989",
"0.58282846",
"0.58152467",
"0.5803655",
"0.57752293",
"0.5765886",
"0.576093",
"0.5756709",
"0.574468",
"0.57444465",
"0.5708039",
"0.56887877",
"0.56789756",
"0.5673392",
"0.5671526",
"0.5667537",
"0.5655734",
"0.565258",
"0.56515473",
"0.5647202",
"0.5642698",
"0.56408",
"0.5635896",
"0.5630117",
"0.56299144",
"0.56150925",
"0.56046635",
"0.56006557",
"0.5594253",
"0.55924684",
"0.5590195",
"0.55874765",
"0.5582334",
"0.5578743",
"0.5557585",
"0.55517167",
"0.55385715",
"0.5536402",
"0.5527121",
"0.55269027",
"0.55172527",
"0.55138636",
"0.5512853",
"0.5509073",
"0.5508326",
"0.5504442",
"0.5492951",
"0.5491304",
"0.54677904",
"0.54622316",
"0.5456695",
"0.545266",
"0.54459906",
"0.5439193",
"0.5438945",
"0.5433959",
"0.5418567",
"0.5407649",
"0.5407649",
"0.5389446",
"0.53846604",
"0.5368129",
"0.5367923",
"0.53637666",
"0.536241",
"0.5357966",
"0.5356898",
"0.53479224",
"0.5342438",
"0.53411293",
"0.5341122",
"0.53407156",
"0.5340356",
"0.53402644",
"0.5328855",
"0.5327475",
"0.53244674"
] | 0.61471313 | 11 |
Add item to TaxBreakdownCode value | public function addToTaxBreakdownCode(\Sabre\UpdateReservation\StructType\TaxBreakdownCode $item)
{
// validation for constraint: itemType
if (!$item instanceof \Sabre\UpdateReservation\StructType\TaxBreakdownCode) {
throw new \InvalidArgumentException(sprintf('The TaxBreakdownCode property can only contain items of \Sabre\UpdateReservation\StructType\TaxBreakdownCode, "%s" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);
}
$this->TaxBreakdownCode[] = $item;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function addTax() {\n\t\t$adb = PearDatabase::getInstance();\n\n\t\t$tableName = $this->getTableNameFromType();\n\t\t$taxid = $adb->getUniqueID($tableName);\n\t\t$taxLabel = $this->getName();\n\t\t$percentage = $this->get('percentage');\n\n\t\t//if the tax is not available then add this tax.\n\t\t//Add this tax as a column in related table\n\t\tif($this->isShippingTax()) {\n\t\t\t$taxname = \"shtax\".$taxid;\n\t\t\t$query = \"ALTER TABLE vtiger_inventoryshippingrel ADD COLUMN $taxname decimal(7,3) DEFAULT NULL\";\n\t\t} else {\n\t\t\t$taxname = \"tax\".$taxid;\n\t\t\t$query = \"ALTER TABLE vtiger_inventoryproductrel ADD COLUMN $taxname decimal(7,3) DEFAULT NULL\";\n\t\t}\n\t\t$res = $adb->pquery($query, array());\n\n\t\tvimport('~~/include/utils/utils.php');\n\n\t\tif ($this->isProductTax()) {\n\t\t\t// TODO Review: if field addition is required in shipping-tax case too.\n\t\t\t// NOTE: shtax1, shtax2, shtax3 that is added as default should also be taken care.\n\n\t\t\t$inventoryModules = getInventoryModules();\n\t\t\tforeach ($inventoryModules as $moduleName) {\n\t\t\t\t$moduleInstance = Vtiger_Module::getInstance($moduleName);\n\t\t\t\t$blockInstance = Vtiger_Block::getInstance('LBL_ITEM_DETAILS',$moduleInstance);\n\t\t\t\t$field = new Vtiger_Field();\n\n\t\t\t\t$field->name = $taxname;\n\t\t\t\t$field->label = $taxLabel;\n\t\t\t\t$field->column = $taxname;\n\t\t\t\t$field->table = 'vtiger_inventoryproductrel';\n\t\t\t\t$field->uitype = '83';\n\t\t\t\t$field->typeofdata = 'V~O';\n\t\t\t\t$field->readonly = '0';\n\t\t\t\t$field->displaytype = '5';\n\t\t\t\t$field->masseditable = '0';\n\n\t\t\t\t$blockInstance->addField($field);\n\t\t\t}\n\t\t}\n\n\t\t//if the tax is added as a column then we should add this tax in the list of taxes\n\t\tif($res) {\n\t\t\t$deleted = 0;\n\t\t\tif($this->isDeleted()) {\n\t\t\t\t$deleted = 1;\n\t\t\t}\n\n\t\t\t$compoundOn = Zend_Json::encode($this->get('compoundon'));\n\t\t\t$regions = Zend_Json::encode($this->get('regions'));\n\n\t\t\t$query = 'INSERT INTO '.$tableName.' values(?,?,?,?,?,?,?,?,?)';\n\t\t\t$params = array($taxid, $taxname, $taxLabel, $percentage, $deleted, $this->get('method'), $this->get('type'), $compoundOn, $regions);\n\t\t\t$adb->pquery($query, $params);\n\t\t\treturn $taxid;\n\t\t}\n\t\tthrow new Error('Error occurred while adding tax');\n\t}",
"public function testDifferentTaxes()\n {\n\n $item = $this->addItem();\n\n $prevHash = $item->getHash();\n\n $item->tax = .05;\n\n $this->assertNotEquals($prevHash, $item->getHash());\n\n $item = $this->addItem();\n $item->tax = .3;\n\n $this->assertEquals('2.35', $this->laracart->total(false));\n\n $item = $this->addItem(1, 1, true, [\n 'tax' => .7\n ]);\n\n $this->assertEquals('.70', $item->tax());\n\n $this->assertEquals('4.05', $this->laracart->total(false));\n }",
"public function addTax(AdjustmentDataInterface $tax)\n {\n $this->taxes[] = $tax;\n }",
"public static function add_country_code() {\n\n $taxamo = taxedd_get_country_code();\n\n if ( $taxamo && isset( $taxamo->country_code ) ) {\n ?>\n <input class=\"edd-country\" type=\"hidden\" name=\"edd_country\" id=\"edd-country\" value=\"<?php echo $taxamo->country_code; ?>\"/>\n <?php\n }\n }",
"public function addTaxRate()\n {\n $this->taxRates[] = [\n 'id' => null,\n 'name' => null,\n 'priority' => count($this->taxRates) + 1,\n 'amounts' => $this->taxClasses->map(function ($taxClass) {\n return [\n 'id' => null,\n 'tax_class_id' => $taxClass->id,\n 'tax_class_name' => $taxClass->name,\n 'percentage' => 0,\n ];\n })->toArray(),\n ];\n }",
"public function addVehicleTax() {\n global $REQUEST_DATA;\n\t\t$busId = trim($REQUEST_DATA['busNo']);\n\t\t$regnNoValidTill = trim($REQUEST_DATA['regnNoValidTill']);\n\t\t$passengerTaxValidTill = trim($REQUEST_DATA['passengerTaxValidTill']);\n\t\t$roadTaxValidTill = trim($REQUEST_DATA['roadTaxValidTill']);\n\t\t$pollutionCheckValidTill = trim($REQUEST_DATA['pollutionCheckValidTill']);\n\t\t$passingValidTill = trim($REQUEST_DATA['passingValidTill']);\n\n\n\t\t$query = \"\tINSERT INTO bus_entries (busId,busNoValidTill,passengerTaxValidTill,roadTaxValidTill,pollutionCheckValidTill,passingValidTill) \n\t\t\t\t\tVALUES ('$busId','$regnNoValidTill','$passengerTaxValidTill','$roadTaxValidTill','$pollutionCheckValidTill','$passingValidTill')\";\n \n\t\treturn SystemDatabaseManager::getInstance()->executeUpdateInTransaction($query,\"Query: $query\");\n }",
"public function addTax(){\n $data['title'] = \"Add Tax\";\n $this->admin_load('taxes/add_tax',$data); \n }",
"function wp_ajax_inline_save_tax()\n {\n }",
"public function setTax(string $value): void\n {\n if (is_null($value)) {\n return;\n }\n\n if ($value == 0) {\n $value = 'TAX_0';\n } else {\n $value = number_format($value, 2);\n\n // not sure why has two underscores?\n if ($value < 1) {\n $value = 'TAX__' . str_replace('0.', '', $value);\n } else {\n $value = 'TAX_' . str_replace('.', '_', $value);\n }\n }\n\n $this->elements['tax-class-id'] = $value;\n }",
"public function formattedTax(): string;",
"public function addToTax(\\Sabre\\UpdateReservation\\StructType\\AncillaryTax $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\Sabre\\UpdateReservation\\StructType\\AncillaryTax) {\n throw new \\InvalidArgumentException(sprintf('The Tax property can only contain items of \\Sabre\\UpdateReservation\\StructType\\AncillaryTax, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->Tax[] = $item;\n return $this;\n }",
"function tep_add_tax($price, $tax, $override = false) {\n if ( ( (DISPLAY_PRICE_WITH_TAX == 'true') || ($override == true) ) && ($tax > 0) ) {\n return $price + tep_calculate_tax($price, $tax);\n } else {\n return $price;\n }\n }",
"function tep_add_tax($price, $tax) {\n global $currencies;\n\n if (DISPLAY_PRICE_WITH_TAX == 'true') {\n return tep_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']) + tep_calculate_tax($price, $tax);\n } else {\n return tep_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);\n }\n}",
"abstract public function getTaxType();",
"function tep_add_tax($price, $tax) {\n global $currencies, $sppc_customer_group_show_tax;\n\n if ( (DISPLAY_PRICE_WITH_TAX == 'true') && ($tax > 0) && $sppc_customer_group_show_tax == '1') {\n return tep_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']) + tep_calculate_tax($price, $tax);\n } else {\n return tep_round($price, $currencies->currencies[DEFAULT_CURRENCY]['decimal_places']);\n }\n }",
"private function registerTax() {\n $labels = array(\n 'name' => esc_html__('Masonry Gallery Categories', 'eltdf-core'),\n 'singular_name' => esc_html__('Masonry Gallery Category', 'eltdf-core'),\n 'search_items' => esc_html__('Search Masonry Gallery Categories', 'eltdf-core'),\n 'all_items' => esc_html__('All Masonry Gallery Categories', 'eltdf-core'),\n 'parent_item' => esc_html__('Parent Masonry Gallery Category', 'eltdf-core'),\n 'parent_item_colon' => esc_html__('Parent Masonry Gallery Category:', 'eltdf-core'),\n 'edit_item' => esc_html__('Edit Masonry Gallery Category', 'eltdf-core'),\n 'update_item' => esc_html__('Update Masonry Gallery Category', 'eltdf-core'),\n 'add_new_item' => esc_html__('Add New Masonry Gallery Category', 'eltdf-core'),\n 'new_item_name' => esc_html__('New Masonry Gallery Category Name', 'eltdf-core'),\n 'menu_name' => esc_html__('Masonry Gallery Categories', 'eltdf-core'),\n );\n\n register_taxonomy($this->taxBase, array($this->base), array(\n 'hierarchical' => true,\n 'labels' => $labels,\n 'show_ui' => true,\n 'query_var' => true,\n 'show_admin_column' => true,\n 'rewrite' => array( 'slug' => 'masonry-gallery-category' ),\n ));\n }",
"public function createTax($data) \n {\n return $this->insert($this->table,$data);\n }",
"function gcd_tax_add_new_meta_field() {\r\n ?>\r\n <div class=\"form-field\">\r\n <label for=\"term_meta[featured]\"><?php _e( 'Featured ?', '' ); ?></label>\r\n <input type=\"text\" name=\"term_meta[featured]\" id=\"term_meta[featured]\" value=\"\">\r\n <p class=\"description\"><?php _e( 'Type 1 if you want to list category as featured','' ); ?></p>\r\n </div>\r\n\r\n <div class=\"form-field\">\r\n <label for=\"term_meta[subtitle]\"><?php _e( 'Subtitle', '' ); ?></label>\r\n <input type=\"text\" name=\"term_meta[subtitle]\" id=\"term_meta[subtitle]\" value=\"\">\r\n <p class=\"description\"><?php _e( 'Subtitle for your group','' ); ?></p>\r\n <div>\r\n<?php\r\n}",
"private function act_badd($raw) {\n\t\treturn \"<a class='budg-add' href='/budget/add/show:{$raw['showid']}/'>Add Budget Item</a>\";\n\t}",
"public function addNutritionalBenefit(){\n \t$id = $this->formValueForKey(\"nutritionalBenefitSelection\");\n \n \t$foundNutritionalBenefit = BLGenericRecord::recordMatchingKeyAndValue(\"NutritionalBenefit\", \"id\", $id);\n \t$this->currentRecipe()->addNutritionalBenefit($foundNutritionalBenefit);\n }",
"public function addToFareBasisCode($item)\n {\n // validation for constraint: itemType\n if (!is_string($item)) {\n throw new \\InvalidArgumentException(sprintf('The FareBasisCode property can only contain items of string, \"%s\" given', is_object($item) ? get_class($item) : gettype($item)), __LINE__);\n }\n $this->FareBasisCode[] = $item;\n return $this;\n }",
"public function getTaxAmount();",
"public function addToAllowed_for_Tax_Deduction_Data(\\WorkdayWsdl\\\\StructType\\Allowed_for_Tax_Deduction_DataType $item)\n {\n // validation for constraint: itemType\n if (!$item instanceof \\WorkdayWsdl\\\\StructType\\Allowed_for_Tax_Deduction_DataType) {\n throw new \\InvalidArgumentException(sprintf('The Allowed_for_Tax_Deduction_Data property can only contain items of type \\WorkdayWsdl\\\\StructType\\Allowed_for_Tax_Deduction_DataType, %s given', is_object($item) ? get_class($item) : (is_array($item) ? implode(', ', $item) : gettype($item))), __LINE__);\n }\n $this->Allowed_for_Tax_Deduction_Data[] = $item;\n return $this;\n }",
"public function add($_item)\n\t{\n\t\treturn BingTypeSearchOption::valueIsValid($_item)?parent::add($_item):false;\n\t}",
"function wpcp_add_custom_data_to_order($item, $cart_item_key, $values, $order)\n{\n foreach ($item as $cart_item_key => $values) {\n if (isset($values['wpcp_location'])) {\n $item->add_meta_data(__('wpcp_location', 'wpcp'), $values['wpcp_location'], true);\n }\n }\n}",
"function addTaxRates ( ) {\r\n\r\n\t\t$taxratekeys = $this->cart->lookupProductTaxRates( true );\r\n\r\n\t\t$this->glmsg .= '<tax-tables>'\r\n\t\t \t . '<default-tax-table>'\r\n \t\t . '<tax-rules>'\r\n \t\t . '<default-tax-rule>'\r\n \t\t . '<rate>0</rate>'\r\n \t\t . '<tax-area><world-area/></tax-area>'\r\n \t\t . '</default-tax-rule>'\r\n \t\t . '</tax-rules>'\r\n \t\t . '</default-tax-table>'\r\n\t\t\t\t\t . '<alternate-tax-tables>';\r\n\r\n\t\tif( is_array( $taxratekeys ) ) {\r\n\t\t\tforeach( $taxratekeys as $key ) {\r\n\t\t\t\t$this->glmsg .= '<alternate-tax-table standalone=\"true\" name=\"' . htmlspecialchars( $key, ENT_NOQUOTES) . '\">'\r\n\t\t\t\t\t\t\t . '<alternate-tax-rules>'\r\n\t\t\t\t\t\t\t . \t'<alternate-tax-rule>'\r\n\t\t\t\t\t\t\t . \t\t'<rate>' . strval( $this->cart->lookupTaxPerc( $key ) ) . '</rate>'\r\n\t\t\t\t\t\t\t . \t\t'<tax-area><world-area/></tax-area>'\r\n\t\t\t\t\t\t\t . \t'</alternate-tax-rule>'\r\n\t\t\t\t\t\t\t . '</alternate-tax-rules>'\r\n\t\t\t\t\t\t\t . '</alternate-tax-table>';\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\tif( $this->cart->getShippingHandlingTotal() != 0 ) {\r\n\t\t\t$this->glmsg .= '<alternate-tax-table standalone=\"true\" name=\"shipping\">'\r\n\t\t\t\t\t\t . '<alternate-tax-rules>'\r\n\t\t\t\t\t\t . \t'<alternate-tax-rule>'\r\n\t\t\t\t\t\t . \t\t'<rate>' . $this->cart->lookupTaxPercSpecial( 'Shipping' ) . '</rate>'\r\n\t\t\t\t\t\t . \t\t'<tax-area><world-area/></tax-area>'\r\n\t\t\t\t\t\t . \t'</alternate-tax-rule>'\r\n\t\t\t\t\t\t . '</alternate-tax-rules>'\r\n\t\t\t\t\t\t . '</alternate-tax-table>';\r\n\t\t}\r\n\r\n\r\n\t\t$this->glmsg .= '</alternate-tax-tables>'\r\n\t\t\t\t\t . '</tax-tables>';\r\n\t}",
"public function getTaxInvoiced();",
"function NewTaxAmount($amount ,$tax=0.06)\n{\n $amount += $amount * $tax;\n echo \"Total amount: $amount\";\n}",
"public function getFormattedTaxAttribute(): string;",
"public function getTaxRefunded();",
"public function subtotalWithTax()\n {\n return $this->subtotal() + $this->tax();\n }",
"public function getBaseTaxRefunded();",
"public function add() {\n $dataH['CustomerBankAccount'] = $_lib['sess']->get_companydef('BankAccount');\n $old_pattern = array(\"/[^0-9]/\");\n $new_pattern = array(\"\");\n $dataH['CustomerAccountPlanID'] = strtolower(preg_replace($old_pattern, $new_pattern , $_lib['sess']->get_companydef('OrgNumber')));\n }",
"public function setTaxNo($taxno);",
"public function getBaseTaxInvoiced();",
"public function getTaxcode()\n {\n return $this->taxcode;\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 getSubtotalInclTax();",
"public function setTaxInfo(KCommandContext $context)\n\t{\n\t\t$vats = $context->data->federal_tax;\n \n\t\t$this->getItem()->setFederalTax( KConfig::unbox( $vats ) );\n\t}",
"function ci_e_list_cat_tag_tax($separator=', ')\n{\n\techo ci_list_cat_tag_tax($separator);\n}",
"public function add_bill_item($action, $bill_id, $particular, $qnt = NULL, $amt = NULL, $mrp = NULL, $item_id = NULL, $tax_amount = NULL,$tax_id = NULL) {\r\n\r\n\t\t$data['bill_id'] = $bill_id;\r\n\r\n\t\t$data['particular'] = $particular;\r\n\r\n\t\t$data['quantity'] = $qnt;\r\n\r\n\t\t$data['amount'] = $amt;\r\n\r\n\t\t$data['mrp'] = $mrp;\r\n\r\n\t\t$data['type'] = $action;\r\n\r\n\t\t$data['item_id'] = $item_id;\r\n\r\n\t\t$data['clinic_code'] = $this->session->userdata('clinic_code');\r\n\r\n\t\t$data['tax_amount'] = $tax_amount;\r\n\r\n\t\t$data['tax_id'] = $tax_id;\r\n\r\n\r\n\r\n\t\tif ($item_id != NULL){\r\n\r\n\t\t\t$query = $this->db->get_where('bill_detail', array('bill_id ' => $bill_id, 'item_id ' => $item_id));\r\n\r\n\t\t\tif ($query->num_rows() > 0){\r\n\r\n\t\t\t\t$bill_detail = $query->row_array();\r\n\r\n\t\t\t\t$data['quantity'] = $qnt + $bill_detail['quantity'];\r\n\r\n\t\t\t\t$data['amount'] = $amt + $bill_detail['amount'];\r\n\r\n\t\t\t\t$data['sync_status'] = 0;\r\n\r\n\t\t\t\t$this->db->update('bill_detail', $data,array('bill_id ' => $bill_id, 'item_id ' => $item_id));\r\n\r\n\t\t\t\t//echo $this->db->last_query().\"<br/>\";\r\n\r\n\t\t\t}else{\r\n\r\n\t\t\t\t$this->db->insert('bill_detail', $data);\r\n\r\n\t\t\t\t$bill_detail_id = $this->db->insert_id();\r\n\r\n\t\t\t\t//echo $this->db->last_query().\"<br/>\";\r\n\r\n\t\t\t}\r\n\r\n\t\t}else{\r\n\r\n\t\t\t$this->db->insert('bill_detail', $data);\r\n\r\n\t\t\t$bill_detail_id = $this->db->insert_id();\r\n\r\n\t\t\t//echo $this->db->last_query().\"<br/>\";\r\n\r\n\t\t}\r\n\r\n\t\tif($action == \"tax\"){\r\n\r\n\t\t\t$total_amount = 0;\r\n\r\n\t\t\t$tax_amount = $amt;\r\n\r\n\t\t}else{\r\n\r\n\t\t\t$total_amount = $amt;\r\n\r\n\t\t}\r\n\r\n\r\n\r\n $sql = \"update \" . $this->db->dbprefix('bill') . \" set sync_status = 0,total_amount = total_amount + ? where bill_id = ?;\";\r\n\r\n $this->db->query($sql, array($total_amount, $bill_id));\r\n\r\n\t\t//echo $this->db->last_query().\"<br/>\";\r\n\r\n\r\n\r\n\t\t$total_tax_amount=$tax_amount;\r\n\r\n\t\t$sql = \"update \" . $this->db->dbprefix('bill') . \" set sync_status = 0,tax_amount = tax_amount + ? where bill_id = ?;\";\r\n\r\n $this->db->query($sql, array($total_tax_amount, $bill_id));\r\n\r\n\t\t//echo $this->db->last_query().\"<br/>\";\r\n\r\n\r\n\t\t//Due Amount \r\n\t\t/*$due_amount = $total_amount + $tax_amount;\r\n\r\n\t\t$sql = \"update \" . $this->db->dbprefix('bill') . \" set sync_status = 0,due_amount = due_amount + ? where bill_id = ?;\";\r\n\r\n $this->db->query($sql, array($due_amount, $bill_id));\r\n\r\n\t\t//echo $this->db->last_query().\"<br/>\";*/\r\n\t\treturn $bill_detail_id;\r\n\r\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 add($_item)\n\t{\n\t\treturn BingTypeSourceType::valueIsValid($_item)?parent::add($_item):false;\n\t}",
"public function taxupdate() {\n $arr['page'] = 'taxdetail';\n\t\t$arr['active'] = 'other';\n\t\t$arr['productTax'] = $this->setting->getTax('product');\n\t\t$arr['shippingTax'] = $this->setting->getTax('shipping');\n\t\t$this->load->view('vwSettingTax',$arr);\n\t}",
"public function getTaxCategory();",
"public function getTaxCategory();",
"public function getTaxCategory();",
"public function getTotalTaxAmount();",
"public function getBaseTaxAmount();",
"public function addBaggageItem($key, $value)\n {\n $this->context = $this->context->withBaggageItem($key, $value);\n }",
"function glbs_add_extra_tax_fields( $term ) {\n\t$id = $term->term_id;\n\t\n\t$title = get_term_meta( $id, 'basic_seo_title', true );\n\t$key = get_term_meta( $id, 'basic_seo_keywords', true );\n\t$desc = get_term_meta( $id, 'basic_seo_description', true );\n\t?>\n\t<?php wp_nonce_field( '_glbs_nonce_tax', 'glbs_nonce_tax' ); ?>\n\t<div class=\"form-field\">\n\t\t<label for=\"basic_seo_title\"><?php _e( 'SEO Title', 'glbs' ); ?></label>\n\t\t<input class=\"large-text\" type=\"text\" name=\"basic_seo_title\" id=\"basic_seo_title\" value=\"<?php echo $title ? $title : ''; ?>\"><br>\n\t\t<span class=\"description\">Leave empty to use default title</span>\n\t</div>\n\t<div class=\"form-field\">\n\t\t<label for=\"basic_seo_keywords\"><?php _e( 'SEO Keywords', 'glbs' ); ?></label>\n\t\t<input class=\"large-text\" type=\"text\" name=\"basic_seo_keywords\" id=\"basic_seo_keywords\" value=\"<?php echo $key ? $key : ''; ?>\"><br>\n\t\t<span class=\"description\">Enter the list of keywords separated by comma</span>\n\t</div>\n\t<div class=\"form-field\">\n\t\t<label for=\"basic_seo_description\"><?php _e( 'SEO Description', 'glbs' ); ?></label>\n\t\t<textarea class=\"large-text\" name=\"basic_seo_description\" id=\"basic_seo_description\" rows=\"5\"><?php echo $desc ? $desc : ''; ?></textarea><br>\n\t\t<span class=\"description\">Enter meta description for this Term</span>\n\t</div>\n\t<?php\n}",
"public function saveTax() {\n // $productIds = explode(\",\", Input::get('ProductIds'));\n $marchantId = Input::get(\"merchantId\");\n $merchant = Merchant::find(Input::get('merchantId'))->getstores()->first();\n $prifix = $merchant->prefix;\n $taxNew = [];\n $taxNew['label'] = Input::get('label');\n $taxNew['name'] = Input::get('label');\n $taxNew['rate'] = Input::get('rate');\n $taxNew['tax_number'] = Input::get('tax_number');\n $taxNew['status'] = Input::get('status');\n\n if (Input::get('id')) {\n DB::table($prifix . '_tax')->where(\"id\", Input::get(\"id\"))->update($taxNew);\n } else {\n DB::table($prifix . '_tax')->insert($taxNew);\n }\n\n $viewname = \"\";\n $data = ['status' => '1', 'msg' => (Input::get('id')) ? 'Tax updated successfully.' : 'Tax added successfully.', 'taxinfo' => $taxNew];\n return Helper::returnView($viewname, $data, $url = 'admin.tax.view');\n }",
"public function addPostalCode($postalCode);",
"function t_add_texonomy_field() {\n echo '<div class=\"form-field\">\n\t\t<label for=\"taxonomy_displayorder\">' . __('Display Order', 'zci') . '</label>\n\t\t<input type=\"text\" name=\"taxonomy_displayorder\" id=\"taxonomy_displayorder\" value=\"1\" />\n\t</div>';\n}",
"function agst_pmpro_tax($tax, $values, $order)\n{ \t\n\t$tax = round((float)$values[price] * 0.1, 2);\n\treturn $tax;\n}",
"abstract public function add_item();",
"public function tax($decimals = null, $decimalPoint = null, $thousandSeperator = null)\n {\n $content = $this->getContent();\n $tax = config('cart.tax');\n $coupon = $this->coupon();\n\n $summPrice = 0;\n foreach ($content as $item) {\n $summPrice += $item->price * $item->qty;\n }\n\n $summPrice = $summPrice - $coupon;\n $priceTax = $summPrice * $tax / 100 + 0.3 + $summPrice;\n $summPriceTax = $priceTax * $tax / 100 + 0.3;\n return $this->numberFormat($summPriceTax, $decimals, $decimalPoint, $thousandSeperator);\n }",
"public function __construct(array $tax = array(), array $taxBreakdownCode = array())\n {\n $this\n ->setTax($tax)\n ->setTaxBreakdownCode($taxBreakdownCode);\n }",
"function pmprowoo_add_gift_code_from_order($order_id)\r\n{\r\n global $wpdb, $pmprowoo_gift_codes;\r\n\r\n //don't bother if array is empty\r\n if(empty($pmprowoo_gift_codes))\r\n return;\r\n\r\n /*\r\n does this order contain a gift membership code?\r\n */\r\n //gift membership code product ids\r\n $product_ids = array_keys($pmprowoo_gift_codes);\r\n\r\n //get order\r\n $order = new WC_Order($order_id);\r\n $items = $order->get_items();\r\n\t\r\n //does the order have some products?\r\n if(sizeof($items) > 0)\r\n {\r\n foreach($items as $item_id => $item)\r\n {\r\n if($item['product_id'] > 0) \t//not sure when a product has id 0, but the Woo code checks this\r\n {\r\n //is there a gift membership code for this product?\r\n if(in_array($item['product_id'], $product_ids))\r\n {\r\n\r\n\t /*\r\n\t\t Create Gift Code\r\n\t */\t\r\n\r\n\t //get selected gifted discount code id\r\n\t $gift_code_id = $pmprowoo_gift_codes[$item['product_id']];\r\n\r\n // get discount code level to copy\r\n $gift_level = $wpdb->get_row(\"SELECT * FROM $wpdb->pmpro_discount_codes_levels WHERE code_id = '\" . $gift_code_id . \"' LIMIT 1\");\r\n if(!$gift_level){ \r\n //possibly add an error if coupon code doesn't exist\r\n return; \r\n }\r\n \r\n\r\n\t //create new gift code\r\n\t $code = \"GIFT\" . rand(1, 99) . pmpro_getDiscountCode(); //added rand to code to make it unique for multiple gift orders\r\n\t $starts = current_time( 'Y-m-d', 0 );\r\n\t $expires = date(\"Y-m-d\", strtotime(\"+1 year\"));\t\t\r\n\t $sqlQuery = \"INSERT INTO $wpdb->pmpro_discount_codes (code, starts, expires, uses) VALUES('\" . esc_sql($code) . \"', '\" . $starts . \"', '\" . $expires . \"', '1')\";\r\n\t\r\n \t if($wpdb->query($sqlQuery) !== false){\r\n\t\t //get id of new code\r\n\t\t $code_id = $wpdb->insert_id;\r\n\t\t\r\n\t\t //add code to level\r\n\t\t $sqlQuery = \"INSERT INTO $wpdb->pmpro_discount_codes_levels (code_id, level_id, initial_payment, billing_amount, cycle_number, cycle_period, billing_limit, trial_amount, trial_limit, expiration_number, expiration_period) VALUES(\r\n '\" . esc_sql($code_id) . \"',\r\n '\" . esc_sql($gift_level->level_id) . \"',\r\n '\" . esc_sql($gift_level->initial_payment) . \"',\r\n '\" . esc_sql($gift_level->billing_amount) . \"',\r\n '\" . esc_sql($gift_level->cycle_number) . \"',\r\n '\" . esc_sql($gift_level->cycle_period) . \"',\r\n '\" . esc_sql($gift_level->billing_limit) . \"',\r\n '\" . esc_sql($gift_level->trial_amount) . \"',\r\n '\" . esc_sql($gift_level->trial_limit) . \"',\r\n '\" . esc_sql($gift_level->expiration_number) . \"',\r\n '\" . esc_sql($gift_level->expiration_period) . \"')\";\r\n\t\t$wpdb->query($sqlQuery);\r\n\t\t\t \r\n /* Add Code to Order Meta */\r\n wc_add_order_item_meta( $item_id, \"Gift Code\", $code );\r\n\t\t\r\n\t /*\r\n\t\t //Email Gift Code\r\n // Tag: !!gift_product!! => Title of the Product\r\n // Tag: !!membership_gift_code!! => Generated Gift Code\r\n\t */\t\r\n $recipient_name = wp_strip_all_tags($item['Recipient Name']);\r\n $recipient_email = wp_strip_all_tags($item['Recipient Email']);\r\n\r\n if(!empty($recipient_email)){\r\n\r\n // Send Email to Recipient\r\n $pmproemail = new PMProEmail();\r\n $pmproemail->email = $recipient_email;\r\n\t $pmproemail->subject = sprintf(__(\"A Gift from %s\", 'pmpro-woocommerce'), get_option('blogname'));\r\n $pmproemail->template = 'gift_membership_code';\r\n \r\n $pmproemail->data = array(\"subject\" => $pmproemail->subject, \"name\" => $recipient_name, \"user_login\" => '', \"sitename\" => get_option(\"blogname\"), \"membership_id\" => '', \"membership_level_name\" => '', \"siteemail\" => pmpro_getOption(\"from_email\"), \"login_link\" => '', \"enddate\" => '', \"display_name\" => $recipient_name, \"user_email\" => $recipient_email, \"gift_product\" => $item['name'], \"membership_gift_code\" => $code, \"body\" => pmpro_loadTemplate('gift_membership_code','local','email','html'));\t\t\r\n\t\t\t\r\n\t if($pmproemail->sendEmail() == false){\r\n $message = \"Gift Email FAILED To Recipient \". $recipient_email .\". Contact Site Admin. \";\r\n global $phpmailer;\r\n if (isset($phpmailer)) {\r\n $message .= $phpmailer->ErrorInfo;\r\n }\r\n } else {\r\n $message = \"Gift Email Sent To Recipient \". $recipient_email;\r\n }\r\n\r\n if ( function_exists('wc_add_notice') ) {\r\n wc_add_notice( $message, $notice_type = 'success' );\r\n }\r\n\r\n } else {\r\n\r\n // If no Recipient Send Email to Customer\r\n $pmproemail = new PMProEmail();\r\n $pmproemail->email = $order->get_billing_email();\r\n $pmproemail->subject = sprintf(__(\"A Gift from %s\", 'pmpro-woocommerce'), get_option(\"blogname\"));\r\n $pmproemail->template = 'gift_membership_code';\r\n \r\n $pmproemail->data = array(\"subject\" => $pmproemail->subject, \"name\" => $order->get_billing_first_name(), \"user_login\" => '', \"sitename\" => get_option(\"blogname\"), \"membership_id\" => '', \"membership_level_name\" => '', \"siteemail\" => pmpro_getOption(\"from_email\"), \"login_link\" => '', \"enddate\" => '', \"display_name\" => $order->get_billing_first_name(), \"user_email\" => $order->get_billing_email(), \"gift_product\" => $item['name'], \"membership_gift_code\" => $code, \"body\" => pmpro_loadTemplate('gift_membership_code','local','email','html'));\t\t\r\n\t\t\t\r\n\t if($pmproemail->sendEmail() == false){\r\n $message = \"Gift Email FAILED To \". $order->get_billing_email() .\". Contact Site Admin. \";\r\n global $phpmailer;\r\n if (isset($phpmailer)) {\r\n $message .= $phpmailer->ErrorInfo;\r\n }\r\n } else {\r\n $message = \"Gift Email Sent To \". $order->get_billing_email();\r\n }\r\n \r\n if ( function_exists('wc_add_notice') ) {\r\n wc_add_notice( $message, $notice_type = 'success' );\r\n }\r\n \r\n }\r\n\r\n \t }\r\n\r\n }\r\n }\r\n }\r\n }\r\n}",
"function glbs_save_extra_tax_fileds( $term_id ) {\n\tif ( ! isset( $_POST['glbs_nonce_tax'] ) || ! wp_verify_nonce( $_POST['glbs_nonce_tax'], '_glbs_nonce_tax' ) ) {\n\t\treturn;\n\t}\n\t\n\tif ( isset( $_POST['basic_seo_title'] ) ) {\n\t\tupdate_term_meta( $term_id, 'basic_seo_title', esc_attr( $_POST['basic_seo_title'] ) );\n\t}\n\tif ( isset( $_POST['basic_seo_keywords'] ) ) {\n\t\tupdate_term_meta( $term_id, 'basic_seo_keywords', esc_attr( $_POST['basic_seo_keywords'] ) );\n\t}\n\tif ( isset( $_POST['basic_seo_description'] ) ) {\n\t\tupdate_term_meta( $term_id, 'basic_seo_description', esc_attr( $_POST['basic_seo_description'] ) );\n\t}\n}",
"protected function setTaxCondition($value)\n\t{\n\t\t$this->setTextFont(10);\n\t\tfor($i=0;$i<$this->copies;$i++){\n\t\t\t$this->_getPdf()->pages[$i]->drawText($value, 92, 623, 'UTF-8');\n\t\t}\n\t}",
"public function getBaseShippingTaxRefunded();",
"public function getSubtotalAfterTax(){\n return $this->getParameter('sub_total_after_tax');\n }",
"public function set_cart_contents_tax( $value ) {\n\t\t$this->totals['cart_contents_tax'] = wc_round_tax_total( $value );\n\t}",
"function saveOrder($item) {\n $data = json_encode($item->data);\n $this->db->executeQuery(\"delete from payment_order where itemid = '\" . $item->itemid . \"'\");\n $dt = date('Y-m-d H:i:s');\n $user = db_fetch_array($this->db->executeQuery(\"select * from registration where id = '\" . $item->userid . \"'\"));\n $qry = \"insert into payment_order ( id, orderid, userid, amount, itemid, itemname, itemdescription, payfor, data, paymentway, datetime, auction_id) values(null, '\" . $item->orderid . \"','\" . $item->userid . \"','\" . $item->amount . \"','\" . $item->itemid . \"','\" . addslashes($item->itemname) . \"','\" . addslashes($item->itemdescription) . \"','\" . addslashes($item->payfor) . \"','$data','\" . $item->paymentway . \"','$dt', '\" . $item->itemid . \"')\";\n $this->db->executeQuery($qry);\n\t$this->db->executeQuery(\"CREATE TABLE IF NOT EXISTS `tax_records` ( `id` int(11) NOT NULL auto_increment, `invoiceid` varchar(250) default NULL, `userid` int(20) NOT NULL, `tax` decimal(20, 2) NOT NULL default '0.00', `state` varchar(200) default null, `country` varchar(200) default null, PRIMARY KEY (`id`)) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;\");\n\t$this->db->executeQuery(\"alter table tax_records add column st_tax decimal(20, 2) not null default '0.00'\");\n\t$this->db->executeQuery(\"insert into tax_records values(null, '\" . $item->orderid . \"','\" . $item->userid . \"', '\" . number_format($item->data->tax1,2) . \"', '$user[delivery_state]', '$user[delivery_country]', '\" . number_format($item->data->tax2,2) . \"')\");\n \t echo db_error();\n }",
"public function getTaxData($item)\n {\n $removeKey = array('count_in', 'add_on', 'total', 'comp', 'count_out');\n foreach ($removeKey as $key) {\n unset($item[$key]);\n }\n return $item;\n }",
"public function getBaseSubtotalInclTax();",
"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 }",
"function save_tax_meta( $term_id ){\n \n if ( isset( $_POST['term_meta'] ) ) {\n \n $term_meta = array();\n \n $term_meta['tax_date'] = isset ( $_POST['term_meta']['tax_date'] ) ? esc_html( $_POST['term_meta']['tax_date'] ) : '';\n \n //formato da data\n if( preg_match( '/[0-9]{2}\\/[0-9]{2}\\/[0-9]{4}/', $term_meta['tax_date'] ) )\n $term_meta['tax_date'] = preg_replace( '/^([0-9]{2})\\/([0-9]{2})\\/([0-9]{4})$/', '$3-$2-$1', $term_meta['tax_date'] );\n\n // Save the option array.\n update_option( \"taxonomy_$term_id\", $term_meta );\n \n } // if isset( $_POST['term_meta'] )\n }",
"public function getShippingTaxAmount();",
"protected function add($item)\n {\n if ($item instanceof Item) {\n $this->breadcrumb[] = (object) [\n 'url' => $item->getUrl(),\n 'title' => $item->getTitle(),\n ];\n }\n }",
"function add($item);",
"function uc_order_pane_line_items_add($form, &$form_state) {\n $order = &$form_state['order'];\n $type = $form_state['values']['li_type_select'];\n\n uc_order_line_item_add($order->order_id, $type, _uc_line_item_data($type, 'title'), 0);\n $order->line_items = uc_order_load_line_items($order);\n\n $form_state['rebuild'] = TRUE;\n}",
"public function getTaxRate();",
"public function getShippingTaxRefunded();",
"public function getTaxableItemsAttribute(): Collection;",
"function _putNumberItem(&$pdf, $item, $x, $y, $align='R', $margin=null, $check_zero = false)\n {\n if (!isset($item)) return;\n\t\tif (empty($item) && !$check_zero) return;\n\n\t\t$item = number_format($item);\n\t\t$leng = strlen($item);\n\t\t$first_val = substr($item, 0, 1);\n\t\tif ($first_val == '-') {\n\t\t\t$first_val = '△';\n\t\t\t$last_val = substr($item, 1, $leng - 1);\n\t\t\t$item = $first_val . $last_val;\n\t\t}\n\t\t$pdf->SetXY($x, $y);\n\t\t$pdf->MultiCell(28, 5, $item, 0, $align);\n }",
"public function getTaxedPrice();",
"function addItemAtBeginOf(&$target, $item){\n\t\t\t\t\n\t\t\t\tif($target != \"\" && (is_array($item) || $item !== \"\")){\n\t\t\t\t $target = arrayMerge($item, $target);\n\t\t\t\t}\n\t\t\t}",
"public static function calculate_tax_filter() {\n global $edd_options;\n\n if ( isset( $edd_options['taxedd_private_token'] ) ) {\n $private_key = $edd_options['taxedd_private_token'];\n \n try { \n\n $taxtaxamo = new Taxamo( new APIClient( $private_key, 'https://api.taxamo.com' ) );\n\n $cart_items = edd_get_cart_content_details();\n\n $countrycode = \"\";\n\n $address = edd_get_customer_address();\n\n if ( isset($address['country']) && !empty($address['country']) && \"\" !== $address['country'] ) {\n $countrycode = $address['country'];\n } else {\n $ipcc = taxedd_get_country_code();\n $countrycode = $ipcc->country_code;\n }\n\n $transaction = new Input_transaction();\n $transaction->currency_code = edd_get_currency();\n $transaction->buyer_ip = $_SERVER['REMOTE_ADDR'];\n $transaction->billing_country_code = $countrycode;\n $transactionarray = array();\n $customid = \"\";\n $transaction->force_country_code = $countrycode;\n\n if ( !empty( $cart_items ) ) { \n foreach ( $cart_items as $cart_item ) {\n\n $customid++;\n $transaction_line = new Input_transaction_line();\n $transaction_line->amount = $cart_item['item_price'];\n $transaction_line->custom_id = $cart_item['name'] . $customid;\n array_push( $transactionarray, $transaction_line );\n\n }\n }\n\n $transaction->transaction_lines = $transactionarray;\n\n $resp = $taxtaxamo->calculateTax( array( 'transaction' => $transaction ) );\n\n return $resp->transaction->tax_amount;\n\n } catch ( exception $e ) {\n\n return \"\";\n }\n }\n }",
"public function add_trainee_to_list() {\n $taxcode = $this->input->post('taxcode');\n $trainee_data = $this->classtraineemodel->get_trainee_details($taxcode);\n if ($trainee_data) {\n echo '<tr>\n <td><input type = \"checkbox\" value = \"' . $trainee_data [user_id] . '\">\n <a class = \"small_text1\" rel = \"modal:open\" href = \"' . $taxcode . '\">' . $taxcode . '</a></td>\n <td>' . $trainee_data [first_name] . ' ' . $trainee_data [last_name] . '</td>\n <td>' . $trainee_data [gender] . '</td>\n <td>' . $trainee_data [dob] . '</td>\n <td>' . $trainee_data[user_id] . '</td>\n <td>' . $trainee_data[registration_date] . '</td>\n </tr>';\n }\n }",
"public function setTaxAmount($amount);",
"protected function _setAddButton()\n {\n $this->setChild('add_button',\n $this->getLayout()->createBlock('adminhtml/widget_button')\n ->setData(array('id' => \"add_tax_\" . $this->getElement()->getHtmlId(),\n 'label' => Mage::helper('catalog')->__('Add Tax'),\n 'onclick' => \"weeeTaxControl.addItem('\" . $this->getElement()->getHtmlId() . \"')\",\n 'class' => 'add'\n )));\n }",
"function customtax($customtax) {\n ob_start();\n\n taxvalue($tax = $customtax);\n\n $content = ob_get_contents();\n ob_end_clean();\n return $content;\n}",
"function AddArtikelAuftrag($artikel,$auftrag)\n {\n\n }",
"public function addBaseItemDiscountAmount($amount)\n {\n $this->baseItemDiscountAmount +=$amount;\n }",
"function calculate_tax($sub){\n\t//echo $sub;\n\treturn $sub * 0.12;\n\t}",
"public function getTaxCategoryId();",
"function addItem($value, $text, $bstore=false){\n\t\t\t\tif($bstore){\n\t\t\t\t\t$this->items[] = array($value => $text);\n\t\t\t\t}else{\n\t\t\t\t\t$this->item = array($value => $text);\n\t\t\t\t}\n\n\t\t\t\treturn $this->item;\n\t\t\t}",
"public function getTaxAttribute(): float;",
"public function setSubtotalAfterTax($value){\n return $this->setParameter('sub_total_after_tax', $value);\n }",
"public function addTaxrate($taxrate)\n {\n if ((is_numeric($taxrate)) && ($taxrate > 0) && ($taxrate < 1)) {\n $this->_taxrate = $taxrate;\n }\n }",
"public function addToTaxAmount(\\Devlabs91\\TravelgateNotify\\Models\\Ota\\VehicleChargeType\\TaxAmountsAType\\TaxAmountAType $taxAmount)\n {\n $this->taxAmount[] = $taxAmount;\n return $this;\n }",
"private function sellTrasactionAddsMoney(){\n\n }",
"public function addItemDiscountAmount($amount)\n {\n $this->itemDiscountAmount += $amount;\n }",
"public function __tallyUpInvoice() {\n\n $this->__itemTotals();\n\n $subTotal = $this->__subtotal($this->request->data['items']);\n\n //$taxTotal = $this->__tax($subTotal, $this->request->data['Invoice']['taxRate']);\n\n //$taxTotal = $this->__tax($this->request->data['items']);\n\n //$this->request->data['total'] = $subTotal + $taxTotal;\n $this->request->data['total'] = $subTotal;\n\n //$this->request->data['subTotal'] = $subTotal;\n\n //$this->request->data['taxTotal'] = $taxTotal;\n\n return true;\n }",
"function testTaxModifier() {\n\t\t$this->get('product-1b/add');\n\t\t$this->get('product-1b/add');\n\n\t\t/* Log our NZ member in so we can assert they see the GST component */\n\t\t$this->session()->inst_set('loggedInAs', $this->idFromFixture('Member', 'member'));\n\t\t\n\t\t/* 12.5% GST appears to our NZ user logged in */\n\t\t$this->get('checkout/');\n\t\t$this->assertPartialMatchBySelector('tr.taxmodifier td', array(\n\t\t\t'12.5% GST (included in the above price)'\n\t\t));\n\n\t\t/* Let's check the totals to make sure GST wasn't being added (which is important!) */\n\t\t/* NZD is shown as the label, since it was set as the site currency in setUp() */\n\t\t$this->assertExactMatchBySelector('#Table_Order_Total', '$1,205.00 NZD');\n\t\t\n\t\t/* Let's sneakily change the GST to be exclusive, altering the checkout total */\n\t\tTaxModifier::set_for_country('NZ', 0.125, 'GST', 'exclusive');\n\t\t\n\t\t/* See what the checkout page has got now */\n\t\t$this->get('checkout/');\n\t\t\n\t\t/* Check the total, it has changed since the GST is now exclusive */\n\t\t$this->assertExactMatchBySelector('#Table_Order_Total', '$1,355.63 NZD');\n\t\t\t\t\n\t\t/* Member logs out */\n\t\t$this->session()->inst_set('loggedInAs', null);\n\t}",
"public function run()\n {\n \n\n \\DB::table('purchase_taxes')->delete();\n \n \\DB::table('purchase_taxes')->insert(array (\n 0 => \n array (\n 'id' => 1,\n 'purchase_order_detail_id' => 1,\n 'tax_type_id' => 1,\n 'tax_amount' => 44.955,\n ),\n 1 => \n array (\n 'id' => 2,\n 'purchase_order_detail_id' => 2,\n 'tax_type_id' => 2,\n 'tax_amount' => 25.116,\n ),\n 2 => \n array (\n 'id' => 3,\n 'purchase_order_detail_id' => 3,\n 'tax_type_id' => 1,\n 'tax_amount' => 0.36,\n ),\n 3 => \n array (\n 'id' => 4,\n 'purchase_order_detail_id' => 4,\n 'tax_type_id' => 1,\n 'tax_amount' => 2.1,\n ),\n 4 => \n array (\n 'id' => 5,\n 'purchase_order_detail_id' => 4,\n 'tax_type_id' => 2,\n 'tax_amount' => 3.22,\n ),\n 5 => \n array (\n 'id' => 6,\n 'purchase_order_detail_id' => 5,\n 'tax_type_id' => 2,\n 'tax_amount' => 83.72,\n ),\n 6 => \n array (\n 'id' => 7,\n 'purchase_order_detail_id' => 6,\n 'tax_type_id' => 1,\n 'tax_amount' => 6.93,\n ),\n 7 => \n array (\n 'id' => 8,\n 'purchase_order_detail_id' => 7,\n 'tax_type_id' => 1,\n 'tax_amount' => 92.565,\n ),\n 8 => \n array (\n 'id' => 9,\n 'purchase_order_detail_id' => 7,\n 'tax_type_id' => 2,\n 'tax_amount' => 141.933,\n ),\n 9 => \n array (\n 'id' => 10,\n 'purchase_order_detail_id' => 8,\n 'tax_type_id' => 1,\n 'tax_amount' => 0.39,\n ),\n 10 => \n array (\n 'id' => 11,\n 'purchase_order_detail_id' => 8,\n 'tax_type_id' => 2,\n 'tax_amount' => 0.598,\n ),\n 11 => \n array (\n 'id' => 12,\n 'purchase_order_detail_id' => 9,\n 'tax_type_id' => 1,\n 'tax_amount' => 0.5519999999999999,\n ),\n 12 => \n array (\n 'id' => 13,\n 'purchase_order_detail_id' => 10,\n 'tax_type_id' => 1,\n 'tax_amount' => 8.34,\n ),\n 13 => \n array (\n 'id' => 14,\n 'purchase_order_detail_id' => 11,\n 'tax_type_id' => 1,\n 'tax_amount' => 15.6,\n ),\n 14 => \n array (\n 'id' => 15,\n 'purchase_order_detail_id' => 11,\n 'tax_type_id' => 2,\n 'tax_amount' => 23.92,\n ),\n 15 => \n array (\n 'id' => 16,\n 'purchase_order_detail_id' => 12,\n 'tax_type_id' => 1,\n 'tax_amount' => 1.0079999999999998,\n ),\n 16 => \n array (\n 'id' => 17,\n 'purchase_order_detail_id' => 13,\n 'tax_type_id' => 1,\n 'tax_amount' => 109.956,\n ),\n 17 => \n array (\n 'id' => 18,\n 'purchase_order_detail_id' => 14,\n 'tax_type_id' => 2,\n 'tax_amount' => 188.37,\n ),\n 18 => \n array (\n 'id' => 19,\n 'purchase_order_detail_id' => 15,\n 'tax_type_id' => 1,\n 'tax_amount' => 109.956,\n ),\n 19 => \n array (\n 'id' => 20,\n 'purchase_order_detail_id' => 16,\n 'tax_type_id' => 2,\n 'tax_amount' => 188.37,\n ),\n 20 => \n array (\n 'id' => 21,\n 'purchase_order_detail_id' => 17,\n 'tax_type_id' => 2,\n 'tax_amount' => 62.78999999999999,\n ),\n 21 => \n array (\n 'id' => 22,\n 'purchase_order_detail_id' => 18,\n 'tax_type_id' => 1,\n 'tax_amount' => 30.812807881773097,\n ),\n 22 => \n array (\n 'id' => 23,\n 'purchase_order_detail_id' => 19,\n 'tax_type_id' => 1,\n 'tax_amount' => 29.527093596058876,\n ),\n 23 => \n array (\n 'id' => 24,\n 'purchase_order_detail_id' => 20,\n 'tax_type_id' => 1,\n 'tax_amount' => 11.054187192118206,\n ),\n 24 => \n array (\n 'id' => 25,\n 'purchase_order_detail_id' => 20,\n 'tax_type_id' => 2,\n 'tax_amount' => 16.817204301075208,\n ),\n 25 => \n array (\n 'id' => 34,\n 'purchase_order_detail_id' => 27,\n 'tax_type_id' => 2,\n 'tax_amount' => 138.046,\n ),\n 26 => \n array (\n 'id' => 35,\n 'purchase_order_detail_id' => 28,\n 'tax_type_id' => 1,\n 'tax_amount' => 112.5018,\n ),\n 27 => \n array (\n 'id' => 36,\n 'purchase_order_detail_id' => 29,\n 'tax_type_id' => 1,\n 'tax_amount' => 45.0012,\n ),\n 28 => \n array (\n 'id' => 37,\n 'purchase_order_detail_id' => 29,\n 'tax_type_id' => 2,\n 'tax_amount' => 69.00183999999999,\n ),\n 29 => \n array (\n 'id' => 45,\n 'purchase_order_detail_id' => 30,\n 'tax_type_id' => 1,\n 'tax_amount' => 7.623000000000001,\n ),\n 30 => \n array (\n 'id' => 46,\n 'purchase_order_detail_id' => 31,\n 'tax_type_id' => 1,\n 'tax_amount' => 92.565,\n ),\n 31 => \n array (\n 'id' => 47,\n 'purchase_order_detail_id' => 31,\n 'tax_type_id' => 2,\n 'tax_amount' => 141.933,\n ),\n 32 => \n array (\n 'id' => 48,\n 'purchase_order_detail_id' => 32,\n 'tax_type_id' => 2,\n 'tax_amount' => 145.04489999999998,\n ),\n 33 => \n array (\n 'id' => 53,\n 'purchase_order_detail_id' => 33,\n 'tax_type_id' => 2,\n 'tax_amount' => 138.046,\n ),\n 34 => \n array (\n 'id' => 54,\n 'purchase_order_detail_id' => 34,\n 'tax_type_id' => 1,\n 'tax_amount' => 112.5018,\n ),\n 35 => \n array (\n 'id' => 55,\n 'purchase_order_detail_id' => 35,\n 'tax_type_id' => 1,\n 'tax_amount' => 45.0012,\n ),\n 36 => \n array (\n 'id' => 56,\n 'purchase_order_detail_id' => 35,\n 'tax_type_id' => 2,\n 'tax_amount' => 69.00183999999999,\n ),\n 37 => \n array (\n 'id' => 57,\n 'purchase_order_detail_id' => 36,\n 'tax_type_id' => 1,\n 'tax_amount' => 2.2272,\n ),\n ));\n \n \n }",
"function accouk_custom_category_order_meta_field($tag) {\n \n $current_category_order = get_term_meta($tag->term_id, 'category_order', true);\n\n ?>\n <tr class=\"form-field\">\n <th valign=\"top\" scope=\"row\"><label for=\"term_fields[category_order]\"><?php _e('Category order'); ?></label></th>\n <td>\n <input type=\"number\" value=\"<?php echo esc_attr($current_category_order); ?>\" id=\"term_fields[category_order]\" name=\"term_fields[category_order]\"><br/>\n <p class=\"description\"><?php _e('Enter a number to order the category in navigation menus. This must be present in order for a category to show in navigation.'); ?></p><br />\n </td>\n </tr> \n\n <?php\n}",
"public function addDietaryCategory(){\n \t$id = $this->formValueForKey(\"dietaryCategorySelection\");\n \t \n \t$foundDietaryCategory = BLGenericRecord::recordMatchingKeyAndValue(\"DietaryCategory\", \"id\", $id);\n \t$this->currentRecipe()->addDietaryCategory($foundDietaryCategory);\n }"
] | [
"0.6022677",
"0.5650368",
"0.561249",
"0.5508849",
"0.5507532",
"0.5432416",
"0.540472",
"0.5397493",
"0.5362307",
"0.5269257",
"0.5217888",
"0.52035296",
"0.51972234",
"0.51873654",
"0.51750666",
"0.51657856",
"0.51474166",
"0.51095754",
"0.5083389",
"0.50705147",
"0.50632066",
"0.50562495",
"0.5038773",
"0.50335467",
"0.5015033",
"0.5010325",
"0.5002657",
"0.49713093",
"0.49702716",
"0.49641207",
"0.49507588",
"0.4945161",
"0.49286503",
"0.49179667",
"0.49141073",
"0.49074",
"0.4904358",
"0.48962477",
"0.4887778",
"0.4886228",
"0.48808414",
"0.4866845",
"0.48616982",
"0.48462597",
"0.4818685",
"0.4818685",
"0.4818685",
"0.4812707",
"0.4812574",
"0.48102722",
"0.4798834",
"0.479098",
"0.47834602",
"0.47770947",
"0.4767411",
"0.47670507",
"0.47567895",
"0.47557855",
"0.47494766",
"0.474511",
"0.4741568",
"0.47413582",
"0.4735479",
"0.47354463",
"0.47331005",
"0.47318795",
"0.4729551",
"0.47194454",
"0.47078973",
"0.47003973",
"0.46984893",
"0.46922374",
"0.46901238",
"0.46894848",
"0.46756694",
"0.46679884",
"0.46661958",
"0.46593156",
"0.46491167",
"0.46431834",
"0.46410754",
"0.46385777",
"0.46361735",
"0.46335134",
"0.46326995",
"0.46313432",
"0.4629111",
"0.46234906",
"0.46231142",
"0.46228662",
"0.4617963",
"0.4614228",
"0.4614057",
"0.46114504",
"0.46113205",
"0.4610231",
"0.46067747",
"0.46017107",
"0.46013647",
"0.46001542"
] | 0.67118555 | 0 |
Method called when an object has been exported with var_export() functions It allows to return an object instantiated with the values | public static function __set_state(array $array)
{
return parent::__set_state($array);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function ExportObject() {\n // Init object\n $plugin = new stdClass();\n // Set values\n $plugin->Name = $this->Name;\n $plugin->Version = $this->Version;\n $plugin->Author = $this->Author;\n $plugin->About = $this->About;\n $plugin->Root = $this->Root;\n $plugin->Identifier = $this->Identifier;\n \n // Return result\n return $plugin;\n }",
"protected function constructExportObject()\n\t{\n\t\t//default export is \"all public fields\"\n\t\treturn (object) Arrays::getPublicPropertiesOfObject($this);\n\t}",
"function from_export($value) {\n return $value;\n }",
"public function export(): mixed;",
"public function ExportObject() {\n // Init object\n $col = new stdClass();\n \n // Set values\n $col->id = $this->Id;\n $col->type = $this->Type;\n $col->label = $this->Label;\n $col->p = $this->P;\n \n // Return values\n return $col;\n }",
"public function exportData() {\n\t\treturn $this->constructExportObject();\n\t}",
"public function toObject();",
"function ctools_export_new_object($table, $set_defaults = TRUE) {\r\n $schema = ctools_export_get_schema($table);\r\n $export = $schema['export'];\r\n\r\n $object = new $export['object'];\r\n foreach ($schema['fields'] as $field => $info) {\r\n if (isset($info['object default'])) {\r\n $object->$field = $info['object default'];\r\n }\r\n else if (isset($info['default'])) {\r\n $object->$field = $info['default'];\r\n }\r\n else {\r\n $object->$field = NULL;\r\n }\r\n }\r\n\r\n if ($set_defaults) {\r\n // Set some defaults so this data always exists.\r\n // We don't set the export_type property here, as this object is not saved\r\n // yet. We do give it NULL so we don't generate notices trying to read it.\r\n $object->export_type = NULL;\r\n $object->{$export['export type string']} = t('Local');\r\n }\r\n return $object;\r\n}",
"public function export();",
"public function export();",
"public function export();",
"public function export();",
"public function export();",
"public function createExport();",
"public function newInstance(): object;",
"public static function createFromGlobals();",
"public function export (){\n\n }",
"public function getObj();",
"function &object(object $value, string $namespace = 'default'): object\n{\n $var = new Variable\\ObjectVariable($value);\n Repository::add($var, $namespace);\n return $var->getValue();\n}",
"public static function toObject(){\r\n $args = func_get_args();\r\n \r\n if(count($args) >=2){\r\n $className = '\\\\'.str_replace('.', '\\\\', $args[0]);\r\n $refClass = new \\ReflectionClass($className);\r\n $toObjInstance = $refClass->newInstance();\r\n\r\n unset($args[0]);\r\n \r\n foreach($args as $arg){\r\n \r\n if(is_object($arg)){\r\n $arg = Obj::getProperties($arg);\r\n }\r\n \r\n if(is_array($arg)){\r\n foreach($arg as $propertyName=>$propertyValue){\r\n if($refClass->hasProperty($propertyName)){\r\n $property = $refClass->getProperty($propertyName);\r\n $property->setAccessible(true);\r\n $property->setValue($toObjInstance, $propertyValue);\r\n }\r\n }\r\n }\r\n }\r\n return $toObjInstance;\r\n }\r\n }",
"public function export()\n {\n }",
"function &stdClass(stdClass $value, string $namespace = 'default'): stdClass\n{\n $var = new Variable\\StdClassVariable($value);\n Repository::add($var, $namespace);\n return $var->getValue();\n}",
"public function getExportableValues() {\n\t\telgg_deprecated_notice(__METHOD__ . ' has been deprecated by toObject()', 1.9);\n\t\treturn array(\n\t\t\t'id',\n\t\t\t'entity_guid',\n\t\t\t'name',\n\t\t\t'value',\n\t\t\t'value_type',\n\t\t\t'owner_guid',\n\t\t\t'type',\n\t\t);\n\t}",
"public function ExportObject() {\n // Init object\n $overviewChart = new stdClass();\n \n // Set values\n $overviewChart->Types = $this->Types;\n $overviewChart->Chart = $this->Chart->ExportObject();\n \n //return result\n return $overviewChart;\n }",
"public function export()\n {\n \n }",
"public function newInstance(): object\n {\n return $this->instantiator->instantiate($this->name);\n }",
"public function getter () {\n return (object)[\n get_plugin_name => $this->plugin_name,\n get_plugin_version => $this->plugin_version,\n get_translation_slug => $this->translation_slug,\n get_admin_page_slug => $this->admin_page_slug,\n get_api_namespace => $this->api_namespace,\n get_options_name => $this->options_name\n ];\n }",
"public function getObject() {}",
"public function getObject() {}",
"public function export()\n {\n //\n }",
"function _instantiateExportDeployment($context) {\n\t\t$exportDeploymentClassName = $this->getExportDeploymentClassName();\n\t\t$this->import($exportDeploymentClassName);\n\t\t$exportDeployment = new $exportDeploymentClassName($context, $this);\n\t\treturn $exportDeployment;\n\t}",
"function get_obj()\n {\n $object = new ApiRest;\n return $object;\n }",
"public function __CONSTRUCT(){\n\t}",
"public function newInstance();",
"public function newInstance();",
"public function getInstance(): object;",
"public function exportedVars(): iterable;",
"public static function fromGlobals() {}",
"public function ExportObject() {\n // Init object\n $submission = new stdClass();\n \n // Set values\n $submission->Id = $this->Id;\n $submission->DateTime = $this->DateTime;\n $submission->GitHash = $this->GitHash;\n $submission->Categories = array();\n \n // Export each category\n foreach ($this->Categories as $category) {\n $submission->Categories[] = $category->ExportObject();\n }\n \n // return result\n return $submission;\n }",
"public function getInstance(): object\n {\n }",
"function ctools_get_default_object($table, $name) {\r\n $schema = ctools_export_get_schema($table);\r\n $export = $schema['export'];\r\n\r\n if (!$export['default hook']) {\r\n return;\r\n }\r\n\r\n // Try to load individually from cache if this cache is enabled.\r\n if (!empty($export['cache defaults'])) {\r\n $defaults = _ctools_export_get_some_defaults($table, $export, array($name));\r\n }\r\n else {\r\n $defaults = _ctools_export_get_defaults($table, $export);\r\n }\r\n\r\n $status = variable_get($export['status'], array());\r\n\r\n if (!isset($defaults[$name])) {\r\n return;\r\n }\r\n\r\n $object = $defaults[$name];\r\n\r\n // Determine if default object is enabled or disabled.\r\n if (isset($status[$object->{$export['key']}])) {\r\n $object->disabled = $status[$object->{$export['key']}];\r\n }\r\n\r\n $object->{$export['export type string']} = t('Default');\r\n $object->export_type = EXPORT_IN_CODE;\r\n $object->in_code_only = TRUE;\r\n\r\n return $object;\r\n}",
"public function toStdClass() {\n $stdClass = new stdClass();\n $stdClass->number = $this->_number;\n $stdClass->internal = $this->_internal;\n return $stdClass;\n }",
"public function getObject(): object;",
"public function get_export_data()\n {\n\n $l_sql = \"SELECT isys_obj_type__id, isys_obj_type__title, isys_verinice_types__title, isys_verinice_types__const \" . \"FROM isys_obj_type \" . \"INNER JOIN isys_verinice_types ON isys_obj_type__isys_verinice_types__id = isys_verinice_types__id \";\n\n return $this->retrieve($l_sql);\n\n }",
"public function dataProviderExport()\n {\n // Regular :\n $data = [\n [\n 'test string',\n var_export('test string', true),\n ],\n [\n 75,\n var_export(75, true),\n ],\n [\n 7.5,\n var_export(7.5, true),\n ],\n [\n null,\n 'null',\n ],\n [\n true,\n 'true',\n ],\n [\n false,\n 'false',\n ],\n [\n [],\n '[]',\n ],\n ];\n // Arrays :\n $var = [\n 'key1' => 'value1',\n 'key2' => 'value2',\n ];\n $expectedResult = <<<'RESULT'\n[\n 'key1' => 'value1',\n 'key2' => 'value2',\n]\nRESULT;\n $data[] = [$var, $expectedResult];\n $var = [\n 'value1',\n 'value2',\n ];\n $expectedResult = <<<'RESULT'\n[\n 'value1',\n 'value2',\n]\nRESULT;\n $data[] = [$var, $expectedResult];\n $var = [\n 'key1' => [\n 'subkey1' => 'value2',\n ],\n 'key2' => [\n 'subkey2' => 'value3',\n ],\n ];\n $expectedResult = <<<'RESULT'\n[\n 'key1' => [\n 'subkey1' => 'value2',\n ],\n 'key2' => [\n 'subkey2' => 'value3',\n ],\n]\nRESULT;\n $data[] = [$var, $expectedResult];\n // Objects :\n $var = new \\StdClass();\n $var->testField = 'Test Value';\n $expectedResult = \"unserialize('\" . serialize($var) . \"')\";\n $data[] = [$var, $expectedResult];\n $var = function () {return 2;};\n $expectedResult = 'function () {return 2;}';\n $data[] = [$var, $expectedResult];\n return $data;\n }",
"public static function export()\n {\n return null;\n }",
"function create()\n\t{\n\t\t$names = $this->_fields;\n\t\t$object = new StdClass;\n\t\tforeach ($names as $name)\n\t\t\t$object->$name = \"\";\n\t\treturn $object;\n\t}",
"public function construct()\n {\n return $this->object;\n }",
"public function metaExport($object = false);",
"public function vars()\n {\n \n return new ArrayWrapper(get_object_vars($this->object));\n \n }",
"public function getValuesObject()\n {\n $obj = new \\stdClass;\n\n foreach ( $this->keyValues as $key => $value )\n {\n $obj->$key = $value;\n }\n\n return $obj;\n }",
"public function getObject();",
"public function getObject();",
"function newDataObject() {\n\t\t$ofrPlugin =& PluginRegistry::getPlugin('generic', $this->parentPluginName);\n\t\t$ofrPlugin->import('classes.ObjectForReviewPerson');\n\t\treturn new ObjectForReviewPerson();\n\t}",
"public function __construct(VariableExportInterface $variableExport)\n {\n $this->serialized = $variableExport->toSerialize();\n }",
"public function as_object($class = TRUE, $arguments = array());",
"function var_export($expression, $return = false)\n{\n}",
"function getObject();",
"function getObject();",
"abstract public function object();",
"public function __construct()\r\n {\r\n $this->_internalObject = new stdClass();\r\n\t\t$a=serialize($this->_internalObject);\r\n\t\t\"echo $a<br>\";\r\n }",
"abstract protected function createObject();",
"function &getInstance($module_srl)\n\t{\n\t\treturn new ExtraVar($module_srl);\n\t}",
"abstract function exportData();",
"function createProduct($name,$price,$qty,$id):stdClass\n{\n$product=new stdClass();\n$product->name=$name;\n$product->price=$price;\n$product->quantity= $qty;\n$product->id=$id;\n\nreturn $product;\n}",
"abstract protected function exportFunctions();",
"public static function factory()\n {\n $class = get_called_class();\n $object = new $class();\n foreach (static::getDefaults() as $field => $value) {\n $object->{$field} = $value;\n }\n return $object;\n }",
"public function &__invoke()\r\n\t{\r\n\t\t$result = new stdClass();\r\n\t\tAdhoc::eachTrap('Registry',\r\n\t\t\tfunction ($trap) use (&$result)\r\n\t\t\t{\r\n\t\t\t\t$data =& $trap->GetList();\r\n\t\t\t\tforeach ($data as $k=>$v)\r\n\t\t\t\t{\r\n\t\t\t\t\tif (!isset($result->$k) and isset($v))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$result->$k = $v;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t);\r\n\t\t\r\n\t\treturn $result;\r\n\t}",
"public static function instantation($the_record){\n\n // can be used to retrieve a string with the name of the called class and static:: introduces its scope.\n $calling_class = get_called_class();\n\n $the_object = new $calling_class;\n\n\n // doing a loop to get all of the values in the object ]\n foreach($the_record as $key => $value) {\n\n if($the_object->has_the_key($key)){\n $the_object->$key = $value;\n \n }\n }\n\n return $the_object;\n }",
"public static function get_object() {\n\t\treturn self::$object;\n\t}",
"function adminer_object() {\r\n include_once \"./plugins/plugin.php\";\r\n \r\n // autoloader\r\n foreach (glob(\"plugins/*.php\") as $filename) {\r\n include_once \"./$filename\";\r\n }\r\n \r\n $plugins = array(\r\n // specify enabled plugins here\r\n // new AdminerDumpXml,\r\n // new AdminerTinymce,\r\n // new AdminerFileUpload(\"data/\"),\r\n // new AdminerSlugify,\r\n // new AdminerTranslation,\r\n // new AdminerForeignSystem,\r\n // new AdminerLoginPasswordLess(password_hash(\"\", PASSWORD_DEFAULT)),\r\n );\r\n \r\n /* It is possible to combine customization and plugins:\r\n class AdminerCustomization extends AdminerPlugin {\r\n }\r\n return new AdminerCustomization($plugins);\r\n */\r\n class AdminerCustomization extends AdminerPlugin {\r\n function login($login, $password) {\r\n // validate user submitted credentials\r\n return true;\r\n }\r\n }\r\n return new AdminerCustomization($plugins);\r\n \r\n // return new AdminerPlugin($plugins);\r\n}",
"public function ExportItem() {\n // Init object\n $submission = new stdClass();\n \n // Set values\n $submission->Id = $this->Id;\n $submission->DateTime = $this->DateTime;\n $submission->ImportDateTime = $this->ImportDateTime;\n $submission->User = $this->User;\n $submission->Good = $this->Good;\n $submission->Bad = $this->Bad;\n $submission->Strange = $this->Strange;\n $submission->GitHash = $this->GitHash;\n $submission->SequenceNumber = $this->SequenceNumber;\n \n // Return result\n return $submission;\n }",
"private static function _instantiateThisObject() {\r\n $className = get_called_class();\r\n return new $className();\r\n }",
"function instance($obj) {\n\tif (is_string($obj)) {\n\t\t$obj = new $obj;\n\t}\n\treturn $obj;\n}",
"public function getOutputObject()\n {\n $baseObject = parent::getOutputObject();\n $baseObject->name = $this->getName();\n\n return $baseObject;\n }",
"function ctools_var_export($var, $prefix = '') {\r\n if (is_array($var)) {\r\n if (empty($var)) {\r\n $output = 'array()';\r\n }\r\n else {\r\n $output = \"array(\\n\";\r\n foreach ($var as $key => $value) {\r\n $output .= $prefix . \" \" . ctools_var_export($key) . \" => \" . ctools_var_export($value, $prefix . ' ') . \",\\n\";\r\n }\r\n $output .= $prefix . ')';\r\n }\r\n }\r\n else if (is_object($var) && get_class($var) === 'stdClass') {\r\n // var_export() will export stdClass objects using an undefined\r\n // magic method __set_state() leaving the export broken. This\r\n // workaround avoids this by casting the object as an array for\r\n // export and casting it back to an object when evaluated.\r\n $output = '(object) ' . ctools_var_export((array) $var, $prefix);\r\n }\r\n else if (is_bool($var)) {\r\n $output = $var ? 'TRUE' : 'FALSE';\r\n }\r\n else {\r\n $output = var_export($var, TRUE);\r\n }\r\n\r\n return $output;\r\n}",
"public function init_objects() {\n $this->controller_oai = new \\Tainacan\\OAIPMHExpose\\OAIPMH_Expose();\n $this->list_sets = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Sets();\n $this->list_metadata_formats = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Metadata_Formats();\n $this->list_records = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Records();\n $this->get_record = new \\Tainacan\\OAIPMHExpose\\OAIPMH_Get_Record();\n $this->identify = new \\Tainacan\\OAIPMHExpose\\OAIPMH_Identify();\n $this->identifiers = new \\Tainacan\\OAIPMHExpose\\OAIPMH_List_Identifiers();\n }",
"public function _construct(){\n\t\treturn $this->data;\n\t}",
"public function _construct(){\n\t\treturn $this->data;\n\t}",
"public function regularNew() {}",
"public function newInstance()\n {\n return $this->newInstanceArgs(func_get_args());\n }",
"function data2Object($data) { \n\t\t\t$class_object = new getData($data); \n\t\t\treturn $class_object; \n\t\t}",
"function ctools_export_object($table, $object, $indent = '', $identifier = NULL, $additions = array(), $additions2 = array()) {\r\n $schema = ctools_export_get_schema($table);\r\n if (!isset($identifier)) {\r\n $identifier = $schema['export']['identifier'];\r\n }\r\n\r\n $output = $indent . '$' . $identifier . ' = new ' . get_class($object) . \"();\\n\";\r\n\r\n if ($schema['export']['can disable']) {\r\n $output .= $indent . '$' . $identifier . '->disabled = FALSE; /* Edit this to true to make a default ' . $identifier . ' disabled initially */' . \"\\n\";\r\n }\r\n if (!empty($schema['export']['api']['current_version'])) {\r\n $output .= $indent . '$' . $identifier . '->api_version = ' . $schema['export']['api']['current_version'] . \";\\n\";\r\n }\r\n\r\n // Put top additions here:\r\n foreach ($additions as $field => $value) {\r\n $output .= $indent . '$' . $identifier . '->' . $field . ' = ' . ctools_var_export($value, $indent) . \";\\n\";\r\n }\r\n\r\n $fields = $schema['fields'];\r\n if (!empty($schema['join'])) {\r\n foreach ($schema['join'] as $join) {\r\n if (!empty($join['load'])) {\r\n foreach ($join['load'] as $join_field) {\r\n $fields[$join_field] = $join['fields'][$join_field];\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Go through our schema and joined tables and build correlations.\r\n foreach ($fields as $field => $info) {\r\n if (!empty($info['no export'])) {\r\n continue;\r\n }\r\n if (!isset($object->$field)) {\r\n if (isset($info['default'])) {\r\n $object->$field = $info['default'];\r\n }\r\n else {\r\n $object->$field = '';\r\n }\r\n }\r\n\r\n // Note: This is the *field* export callback, not the table one!\r\n if (!empty($info['export callback']) && function_exists($info['export callback'])) {\r\n $output .= $indent . '$' . $identifier . '->' . $field . ' = ' . $info['export callback']($object, $field, $object->$field, $indent) . \";\\n\";\r\n }\r\n else {\r\n $value = $object->$field;\r\n if ($info['type'] == 'int') {\r\n if (isset($info['size']) && $info['size'] == 'tiny') {\r\n $info['boolean'] = (!isset($info['boolean'])) ? $schema['export']['boolean'] : $info['boolean'];\r\n $value = ($info['boolean']) ? (bool) $value : (int) $value;\r\n }\r\n else {\r\n $value = (int) $value;\r\n }\r\n }\r\n\r\n $output .= $indent . '$' . $identifier . '->' . $field . ' = ' . ctools_var_export($value, $indent) . \";\\n\";\r\n }\r\n }\r\n\r\n // And bottom additions here\r\n foreach ($additions2 as $field => $value) {\r\n $output .= $indent . '$' . $identifier . '->' . $field . ' = ' . ctools_var_export($value, $indent) . \";\\n\";\r\n }\r\n\r\n return $output;\r\n}",
"function _construct(){ }",
"public function createValidObject() : object {\n\t\treturn (object) [\"tweetContent\" => bin2hex(random_bytes(12))];\n\t}",
"public function _init_obj()\n {\n // dummy\n }",
"protected function make_object( \\stdClass $data ) {\n\t\treturn new Purchase( $data );\n\t}",
"public function as_object()\n {\n $this->return_as = 'object';\n return $this;\n }",
"static public function fromObj($anObj) {\n\t\t$theClassName = get_called_class();\n\t\t$o = new $theClassName();\n\t\treturn $o->setDataFrom($anObj);\n\t}",
"function adminer_object() {\n\t\tinclude_once \"plugins/plugin.php\";\n\t\t// autoloader\n\t\tforeach (glob(\"plugins/*.php\") as $filename) {\n\t\t\tinclude_once $filename;\n\t\t}\n\t\t$plugins = array(\n\t\t\t// specify enabled plugins here\n\t\t\tnew AdminerDatabaseHide(array('information_schema', 'mysql', 'performance_schema')),\n\t\t\t//new AdminerDumpJson,\n\t\t\t//new AdminerDumpBz2,\n\t\t\t//new AdminerDumpZip,\n\t\t\t//new AdminerDumpXml,\n\t\t\t//new AdminerDumpAlter,\n\t\t\t//~ new AdminerSqlLog(\"past-\" . rtrim(`git describe --tags --abbrev=0`) . \".sql\"),\n\t\t\t//new AdminerFileUpload(\"\"),\n\t\t\t//new AdminerJsonColumn,\n\t\t\t//new AdminerSlugify,\n\t\t\t//new AdminerTranslation,\n\t\t\t//new AdminerForeignSystem,\n\t\t\t//new AdminerEnumOption,\n\t\t\t//new AdminerTablesFilter,\n\t\t\t//new AdminerEditForeign,\n\t\t);\n\n\t\treturn new AdminerPlugin($plugins);\n\t}",
"public function newCObj() {}",
"private function PREPARE_OBJECT_VARIABLE_METHOD()\r\r {\r\r if($this->_type === 'POST')\r\r {\r\r foreach($this->_fields as $key=>$field)\r\r {\r\r $this->_object[$key]['VALUE'] = isset($_POST[$key])?$_POST[$key]:false;\r\r } \r\r } \r\r else if($this->_type === 'GET')\r\r {\r\r foreach($this->_fields as $key=>$field)\r\r {\r\r $this->_object[$key]['VALUE'] = isset($_GET[$key])?$_GET[$key]:false;\r\r } \r\r } \r\r }",
"public function toStdClass() {\n $stdClass = new stdClass();\n $stdClass->billOfLading = $this->_billOfLading;\n $stdClass->secondaryPickingType = $this->_secondaryPickingType;\n return $stdClass;\n }",
"public function toStdClass() {\n $stdClass = new stdClass();\n $stdClass->amountInsuranceBase = $this->_amountInsuranceBase;\n $stdClass->fragile = $this->_fragile;\n $stdClass->parcelsCount = $this->_parcelsCount;\n $stdClass->serviceTypeId = $this->_serviceTypeId;\n return $stdClass;\n }",
"abstract public function prepare_new_object(array $args);",
"protected function getRealScriptUserObj() {}",
"public function export(bool $private = FALSE, bool $meta = FALSE) {\n\t\t$keys = [];\n\t\t$ret = [];\n\n\t\tif ($private) {\n\t\t\t$keys = static::$PRIVATE;\n\t\t} else {\n\t\t\t$keys = static::$PUBLIC;\n\t\t}\n\n\t\tif (!empty(array_intersect(EXP_RESERVED, $keys))) {\n\t\t\tthrow new ExportableException(\n\t\t\t\t\"Reserved key '\".EXP_CLASSNAME.\"' used in object.\"\n\t\t\t);\n\t\t}\n\n\t\tif ($meta) { // Add metadata.\n\t\t\t$ret[EXP_CLASSNAME] = get_class($this);\n\t\t\t$ret[EXP_VISIBILITY] = $private ? 'private' : 'public';\n\t\t}\n\n\t\tforeach ($keys as $k) {\n\t\t\t$current = $this->__exportable_get($k);\n\t\t\tswitch (gettype($current)) {\n\t\t\t\tcase 'object':\n\t\t\t\t\t$ret[$k] = $this->exp_obj(\n\t\t\t\t\t\t$current, $private, $meta\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'array':\n\t\t\t\t\t$ret[$k] = $this->exp_array(\n\t\t\t\t\t\t$current, $private, $meta\n\t\t\t\t\t);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$ret[$k] = $current;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\treturn $ret;\n\t}",
"public static function & GetInstance ();",
"public function getInstance(): mixed;",
"function FetchObj() {}",
"public function convertToUserIntObject() {}"
] | [
"0.69515294",
"0.6923768",
"0.6576974",
"0.63780874",
"0.6144996",
"0.6124818",
"0.6055735",
"0.60398006",
"0.5923768",
"0.5923768",
"0.5923768",
"0.5923768",
"0.5923768",
"0.58598137",
"0.58370847",
"0.58125174",
"0.58023953",
"0.57166743",
"0.57161003",
"0.5712639",
"0.5690429",
"0.5658764",
"0.56411463",
"0.56030023",
"0.5526796",
"0.5511375",
"0.54631126",
"0.54070634",
"0.54070634",
"0.5404343",
"0.53760177",
"0.53724045",
"0.53706235",
"0.53703153",
"0.53703153",
"0.53422844",
"0.5337181",
"0.5316759",
"0.53088367",
"0.52975017",
"0.526447",
"0.5260522",
"0.5248745",
"0.52458274",
"0.52279043",
"0.51887614",
"0.51799625",
"0.51508296",
"0.51422167",
"0.51340485",
"0.51329184",
"0.5118142",
"0.5118142",
"0.511736",
"0.5112222",
"0.51068985",
"0.50981015",
"0.5094207",
"0.5094207",
"0.50793505",
"0.5039961",
"0.5039229",
"0.5032565",
"0.50096965",
"0.50063366",
"0.5003701",
"0.4998425",
"0.49873513",
"0.49863768",
"0.49791452",
"0.49754107",
"0.49686027",
"0.49577007",
"0.49562922",
"0.49514377",
"0.4951162",
"0.4943018",
"0.49281895",
"0.49281895",
"0.49187505",
"0.49170077",
"0.49165994",
"0.49084175",
"0.4907546",
"0.48962373",
"0.48939422",
"0.4888758",
"0.48828146",
"0.488192",
"0.4876927",
"0.4875198",
"0.4865094",
"0.48631313",
"0.48630783",
"0.4847857",
"0.48473755",
"0.4840886",
"0.4838868",
"0.48384947",
"0.4836019",
"0.4835311"
] | 0.0 | -1 |
Method returning the class name | public function __toString()
{
return __CLASS__;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getClassName();",
"public function getClassName();",
"public function getClassName() ;",
"public function getClassName() {}",
"public function getClassName() {}",
"public function getClassName() {}",
"public function getClassName() {}",
"public function getClassName()\n {\n return __CLASS__;;\n }",
"private function get_class_name() {\n\t\t\treturn !is_null($this->class_name) ? $this->class_name : get_class($this);\n\t\t}",
"public function getClassName() {\r\n\t\treturn($this->class_name);\r\n\t}",
"public static function get_class_name() {\r\n\t\treturn __CLASS__;\r\n\t}",
"public function getClassName() { return __CLASS__; }",
"public static function getClassName() {\n\t\treturn get_called_class();\n\t}",
"public function getClassName(): string\n {\n return $this->get(self::CLASS_NAME);\n }",
"public static function getClassName()\n\t{\n\t\treturn get_called_class();\n\t}",
"public static function getClassName()\n {\n return get_called_class();\n }",
"public function getClassName()\n {\n return $this->class;\n }",
"public function getClassName()\n {\n return $this->class;\n }",
"public static function className() : string {\n return get_called_class();\n }",
"public function getName()\n {\n return __CLASS__;\n }",
"public function getName()\n\t{\n\t\treturn str_replace('\\\\', '_', __CLASS__);\n\t}",
"public function getClassName()\n {\n return $this->class_name;\n }",
"public function class_name() {\n\t\treturn strtolower(get_class($this));\n\t}",
"public function getName(): string\n {\n return __CLASS__;\n }",
"public static function getClassName() {\n return get_called_class();\n }",
"public function getClassname(){\n\t\treturn $this->classname;\n\t}",
"public function getClassname()\n\t{\n\t\treturn $this->classname;\n\t}",
"public function getClassName()\n {\n return $this->_sClass;\n }",
"public function get_just_class_name() {\n\n\t\t$full_path = $this->get_called_class();\n\n\t\treturn substr( strrchr( $full_path, '\\\\' ), 1 );\n\n\t}",
"protected function getClassName(): string\n {\n return $this->className;\n }",
"public static function getClassName() {\n return self::$className;\n }",
"public function getClassName(): string;",
"public function getClassName() : string;",
"public function getName() {\r\n $parsed = Parser::parseClassName(get_class());\r\n return $parsed['className'];\r\n }",
"public function getClassName() : string\n {\n return $this->className;\n }",
"public function getClassName()\n {\n $fullClass = get_called_class();\n $exploded = explode('\\\\', $fullClass);\n\n return end($exploded);\n }",
"public static function getClassName()\n {\n $classNameArray = explode('\\\\', get_called_class());\n\n return array_pop($classNameArray);\n }",
"public function getClassName(): string\n {\n return $this->className;\n }",
"public function getClassName(): string\n {\n return $this->className;\n }",
"public function getClassName() {\t\t\n\t\treturn MemberHelper::getClassName($this->classNumber);\n\t}",
"public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}",
"public function getName()\n\t{\n\t\treturn substr(__CLASS__, 7);\n\t}",
"public function getClassName() {\r\n\t\treturn $this->strClassName;\r\n\t}",
"public function getClassName() : string\n {\n\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public function getClassName()\n {\n return $this->className;\n }",
"public static function staticGetClassName()\n {\n return __CLASS__;\n }",
"public function getClassName() {\n return $this->className;\n }",
"public function getClassName() {\n\t\treturn $this->className;\n\t}",
"public function getClassName(): string\n {\n return $this->makeClassFromFilename($this->filename);\n }",
"public function getClassName() {\n\t\treturn $this->_className;\n\t}",
"public function getClassName() {\n return $this->className;\n }",
"public function getClassName() {\n return $this->className;\n }",
"public function getClassName ()\n {\n $className = explode('\\\\', get_class($this));\n\n return array_pop($className);\n }",
"function getClassName()\n {\n // TODO: Implement getClassName() method.\n }",
"public static function getClassName(){\n $parts = explode('\\\\', static::class);\n return end($parts);\n }",
"function getClassName(){\n echo __CLASS__ . \"<br><br>\"; \n }",
"public function name()\n {\n $name = get_class($this);\n\n return substr($name, strrpos($name, '\\\\') + 1);\n }",
"public function class()\n {\n // @codingStandardsIgnoreLine\n return $this->class ?? \"\";\n }",
"public function getClass()\n {\n return $this->_className;\n }",
"private function getClassName() {\n return (new \\ReflectionClass(static::class))->getShortName();\n }",
"public function getName() {\n\t\t\n\t\t// cut last part of class name\n\t\treturn substr( get_class( $this ), 0, -11 );\n\t\t\n\t}",
"public function getClassNm()\r\n {\r\n\t\t$tabInfo = $this->getPathInfo();\r\n\t\treturn $tabInfo[1];\r\n }",
"public function className()\n {\n $full_path = explode('\\\\', get_called_class());\n return end($full_path);\n }",
"private function className () {\n $namespacedClass = explode(\"\\\\\", get_class($this));\n\n return end($namespacedClass);\n }",
"public function getClass(): string\n {\n return $this->class;\n }",
"public static function getFullyQualifiedClassName() {\n $reflector = new \\ReflectionClass(get_called_class());\n return $reflector->getName();\n }",
"public function getClassName()\n\t{\n\t\tif (null === $this->_className) {\n\t\t\t$this->setClassName(get_class($this));\n\t\t}\n\t\t\n\t\treturn $this->_className;\n\t}",
"public function getClassName() : string {\n if ($this->getType() != Router::CLOSURE_ROUTE) {\n $path = $this->getRouteTo();\n $pathExplode = explode(DS, $path);\n\n if (count($pathExplode) >= 1) {\n $fileNameExplode = explode('.', $pathExplode[count($pathExplode) - 1]);\n\n if (count($fileNameExplode) == 2 && $fileNameExplode[1] == 'php') {\n return $fileNameExplode[0];\n }\n }\n }\n\n return '';\n }",
"public function getName(){\n\t\treturn get_class($this);\n\t}",
"public function getClassName() {\r\n return $this->myCRUD()->getClassName();\r\n }",
"public static function className()\n\t{\n\t\treturn static::class;\n\t}",
"public function toClassName(): string\n {\n return ClassName::full($this->name);\n }",
"public function getName()\n {\n return static::CLASS;\n }",
"public function getClass(): string;",
"public function getClass(): string;",
"public function getClass(): string;",
"public function getClass(): string;",
"public function getClass(): string;",
"public function getClass(): string;",
"function getName()\n {\n return get_class($this);\n }",
"public function className(): string\n {\n return $this->taskClass->name();\n }",
"public static function getClassName($class)\n {\n return static::splitClassName($class)[1];\n }",
"function getName()\r\n\t{\r\n\t\treturn get_class($this);\r\n\t}",
"public function getName() {\n return get_class($this);\n }",
"public function getName() {\n return get_class($this);\n }",
"public function toString()\n {\n return __CLASS__;\n }",
"public function getName()\n\t{\n\t\treturn $this->name ?: class_basename($this);\n\t}",
"public function getNamespacedName()\n {\n return get_class();\n }",
"protected function name() {\n\t\treturn strtolower(str_replace('\\\\', '_', get_class($this)));\n\t}",
"protected function getClassName()\n {\n return ucwords(camel_case($this->getNameInput())) . 'TableSeeder';\n }",
"function getClassName($name)\n{\n return str_replace('_', ' ', snake_case(class_basename($name)));\n}",
"public function getClassName(): ?string {\n\t\treturn Hash::get($this->_config, 'className');\n\t}",
"public function __toString() {\n\t\treturn $this->className();\n\t}",
"public static function name()\n {\n return lcfirst(self::getClassShortName());\n }"
] | [
"0.87522393",
"0.87522393",
"0.8751158",
"0.87397957",
"0.87397957",
"0.87397957",
"0.87397957",
"0.8731564",
"0.8696754",
"0.8673495",
"0.8638432",
"0.8615335",
"0.8603119",
"0.8566906",
"0.8562364",
"0.8555002",
"0.85503733",
"0.85503733",
"0.85425884",
"0.8533183",
"0.8529981",
"0.85237026",
"0.8502733",
"0.8493115",
"0.8491238",
"0.8488943",
"0.8484194",
"0.847459",
"0.8441478",
"0.8418852",
"0.8399611",
"0.83950585",
"0.83949184",
"0.83853173",
"0.8378261",
"0.837777",
"0.8372544",
"0.8355432",
"0.8355432",
"0.83479965",
"0.8325877",
"0.8325877",
"0.8312873",
"0.83027107",
"0.8272631",
"0.8272631",
"0.8272631",
"0.8272631",
"0.8272631",
"0.8272631",
"0.8272631",
"0.8272631",
"0.82474744",
"0.8242934",
"0.8202995",
"0.8185409",
"0.8184752",
"0.81829107",
"0.81829107",
"0.8176191",
"0.81761754",
"0.8162896",
"0.8142928",
"0.81323636",
"0.8062757",
"0.80528253",
"0.8045769",
"0.8033823",
"0.8026215",
"0.8001116",
"0.79949147",
"0.79779136",
"0.79672754",
"0.7957633",
"0.790449",
"0.78617185",
"0.7860126",
"0.7847096",
"0.78195953",
"0.7817044",
"0.780094",
"0.780094",
"0.780094",
"0.780094",
"0.780094",
"0.780094",
"0.77821547",
"0.7761565",
"0.77588034",
"0.7747239",
"0.77409905",
"0.77409905",
"0.7710985",
"0.76808393",
"0.7670475",
"0.76640886",
"0.76514393",
"0.76499707",
"0.76323646",
"0.76005036",
"0.75937456"
] | 0.0 | -1 |
Get the value of id | public function getId()
{
return $this->id;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getId(){\n\t\t\treturn $this->$id;\n\t\t}",
"public function getId()\n {\n return $this->getValue('id');\n }",
"public function getId() {\n\t\treturn $this -> data['id'];\n\t}",
"function get_id() {\n\t\treturn $this->get_data( 'id' );\n\t}",
"function getID() {\n\t\treturn $this->data_array['id'];\n\t}",
"public function getId(){\n return $this->_data['id'];\n }",
"public function get_id();",
"public function get_id();",
"public function getId() {\r\n\t\treturn $this->data['id'];\r\n\t}",
"function getId() {\n\t\treturn $this->getData('id');\n\t}",
"function getId() {\n\t\treturn $this->getData('id');\n\t}",
"public function getid(){\n\t\t\treturn $this->id;\n\t\t}",
"public function value($id)\n\t{\n\t\treturn $this->connection()->get(\"element/$id/value\");\n\t}",
"public function get_id(){\n\t\treturn $this->id;\n\t}",
"public function getId() : string{\n return $this->id;\n }",
"public function getId() : string{\n return $this->id;\n }",
"public function getId() : string\n {\n $rtn = $this->data['id'];\n\n return $rtn;\n }",
"function get_id() {\n\t\treturn $this->id;\n\t}",
"public function getID();",
"public function getID();",
"public function getID();",
"function get_id() {\n return $this->get_mapped_property('id');\n }",
"public static function id(){\n return self::info('id');\n }",
"public function getid() {\n\t\treturn $this->id;\n\t}",
"public function getID()\n { return $this->get('id'); }",
"function get_id() {\n\t\treturn $this->id;\n\n\t}",
"public function getid()\n {\n return $this->id;\n }",
"public function getid()\n {\n return $this->id;\n }",
"public function get_id(){\n return $this->id;\n }",
"function get_id() {\n return $this->id;\n }",
"public function getId(){\n\t\t\treturn $this->id;\n\t\t}",
"public function getId(){\n\t\t\treturn $this->id;\n\t\t}",
"public function getId(){\n\t\t\treturn $this->id;\n\t\t}",
"public function getId(){\n\t\t\treturn $this->id;\n\t\t}",
"static function id()\n\t{\n\t\treturn self::data('id');\n\t}",
"public function getId(){\n\t\treturn $this->id;\n\t}",
"public function getId(){\n\t\treturn $this->id;\n\t}",
"public function getId(){\n\t\treturn $this->id;\n\t}",
"public function getId(){\n\t\treturn $this->id;\n\t}",
"public function getId(){\n\t\treturn $this->id;\n\t}",
"public function getId(){\r\n\t\t\treturn $this->id;\r\n\t\t}",
"public function getId(){\r\n\t\treturn $this->id;\r\n\t}",
"public function getIdVit(){\n\t\treturn ($this->id);\n\t}",
"public static function get()\n {\n return self::$id;\n }",
"public function getId()\n {\n $value = $this->get(self::ID);\n return $value === null ? (string)$value : $value;\n }",
"function getId() {\n\t\treturn $this->id;\n\t}",
"function getId();",
"public function getValueId()\n {\n return $this->valueId;\n }",
"function get_id()\n {\n return $this->id;\n }",
"function get_id()\r\n {\r\n return $this->id;\r\n }",
"function getId(){\n\t\treturn $this->id;\n\t}",
"function getId(){\n\t\treturn $this->id;\n\t}",
"function getId(){\n\t\treturn $this->id;\n\t}",
"public function getId() ;",
"public function get_id () {\r\n\t\treturn $this->id;\r\n\t}",
"public function getId() {\n return @$this->attributes['id'];\n }",
"public function getId() {\n return @$this->attributes['id'];\n }",
"function get() {\n if (!empty($this->_id)) {\n return $this->_id;\n }\n return '';\n }",
"abstract public function get_id();",
"function get_id(){\n return $this -> id;\n }",
"function get_id(){\n return $this -> id;\n }",
"public function get_id() {\r\n\t\treturn ($this->id);\r\n\t}",
"public function get_id() {\r\n\t\treturn ($this->id);\r\n\t}",
"public function getID(){\n \treturn $this->id;\n }",
"public function get($id) {\n return $this->currentValues[$id];\n }",
"public function getId()\n { return $this->getAttribute('id'); }",
"public function getID(): string;",
"function get_id()\n\t{\n\t\treturn $this->id;\n\t}",
"public function getId(): mixed;",
"public function getId()\n { // getter ID\n return $this->id;\n }",
"public function getId()\n {\n return $this['id'];\n }",
"public function id() {\n return $this->id;\n }",
"public function getId() {}",
"public function getId() {}",
"public function getid()\n {\n return $this->Id;\n }",
"public function getId()\n {\n $rtn = $this->data['id'];\n\n return $rtn;\n }",
"public function getID() : string;",
"public function getId()\n\t{\n\t\treturn $this->id; \n\n\t}",
"public function getId()\n {\n return $this->getData(self::ID);\n }",
"public function id(): string\n {\n return $this->getAttribute('id');\n }",
"function id():string {return $this->_p['_id'];}",
"public function get_id() {\n return $this->id;\n }",
"public function get_id() {\n return $this->id;\n }",
"public function get_id() {\n return $this->id;\n }",
"public function id()\n {\n return $this->id;\n }",
"public function id()\n {\n return $this->id;\n }",
"public function id()\n {\n return $this->id;\n }",
"public function id()\n {\n return $this->id;\n }",
"private function getId() {\n return Xss::filter($this->request->get('id'));\n }",
"public function getId() : string {\n return $this->id;\n }",
"public function getID()\n {\n return $this->formattedData['id'];\n }",
"function getId()\r\n\t\t{\r\n\t\t\treturn $this->id;\r\n\t\t\t\r\n\t\t}",
"public function getId():string {\n return $this->id;\n }",
"public function getId() {\n\t\treturn $this->id;\n\t}",
"public function getId() {\n\t\treturn $this->id;\n\t}",
"public function getId() {\n\t\treturn $this->id;\n\t}",
"public function getId() {\n\t\treturn $this->id;\n\t}",
"public function getId() {\n\t\treturn $this->id;\n\t}",
"public function getId() {\n\t\treturn $this->id;\n\t}",
"public function getId() {\n\t\treturn $this->id;\n\t}",
"public function getId() {\n\t\treturn $this->id;\n\t}"
] | [
"0.77531433",
"0.75790346",
"0.7551146",
"0.74920887",
"0.7472376",
"0.7445116",
"0.7433321",
"0.7433321",
"0.74298936",
"0.7415067",
"0.7415067",
"0.732741",
"0.7291388",
"0.72722006",
"0.7259057",
"0.7259057",
"0.7255057",
"0.7253809",
"0.72535557",
"0.72535557",
"0.72535557",
"0.72478676",
"0.7239034",
"0.7214735",
"0.7207342",
"0.72061116",
"0.7202167",
"0.7202167",
"0.7191623",
"0.7179009",
"0.7162689",
"0.7162689",
"0.7162689",
"0.7162689",
"0.7156056",
"0.7142556",
"0.7142556",
"0.7142556",
"0.7142556",
"0.7142556",
"0.7142064",
"0.71383333",
"0.71373826",
"0.7133959",
"0.71320766",
"0.712474",
"0.711623",
"0.7115175",
"0.7114791",
"0.71101403",
"0.7102386",
"0.7102386",
"0.7102386",
"0.7091067",
"0.70898867",
"0.708427",
"0.708427",
"0.7076914",
"0.7074607",
"0.7059175",
"0.7059175",
"0.705889",
"0.705889",
"0.7057164",
"0.7053134",
"0.705276",
"0.70520186",
"0.7050234",
"0.7041468",
"0.7041224",
"0.7039091",
"0.7035577",
"0.70308214",
"0.70308214",
"0.7025611",
"0.70220804",
"0.7018659",
"0.7014001",
"0.7010808",
"0.7003174",
"0.70012575",
"0.69916296",
"0.69916296",
"0.69916296",
"0.69893074",
"0.69893074",
"0.69893074",
"0.69893074",
"0.69839543",
"0.6982348",
"0.69735116",
"0.6972415",
"0.6970156",
"0.69687396",
"0.69687396",
"0.69687396",
"0.69687396",
"0.69687396",
"0.69687396",
"0.69687396",
"0.69687396"
] | 0.0 | -1 |
Set the value of id | public function setId($id)
{
$this->id = $id;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function SetId($value) { $this->id=$value; }",
"function setId($value) {\n $this->_id = intval($value);\n }",
"public function setID($value) {\r\n //if (!is_numeric($value)) die(\"setID() only accepts a numerical ID value\");\r\n $this->id = $value;\r\n }",
"function set_id($id) {\n\t\t$this->id = $id;\n\t}",
"private function setID($id) {\r\n\t\t$this->id = $id;\r\n\t}",
"private function SetID($value)\n\t\t{\n\t\t\t$this->id = $value;\n\t\t}",
"function setId($id) {\n\t\t$this->setData('id', $id);\n\t}",
"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($id)\n {\n $this->id = $id;\n }",
"function setId($id) {\n\t\t$this->_id = $id;\n\t}",
"public function set_id($id){\n $this->id = $id;\n }",
"function setId($id) {\r\n $this->_id = $id;\r\n }",
"public function set_id( $id ) {\n\t\t$this->id = absint( $id );\n\t}",
"public function setId($id){\n $this->_id = $id;\n }",
"public function SetId ($id);",
"function setId($id) {\n $this->id = $id;\n }",
"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 }",
"function setId($id)\n {\n $this->id = $id;\n }",
"private function setId($id)\n {\n $this->id = $id;\n }",
"public function setId($id) { $this->id = $id; }",
"public function setId($id){\n\t\t$this->id = $id;\n\t}",
"public function setId($id)\n {\n $this->id = $id;\n\n \n }",
"public function setID($id);",
"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 function set_id( $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 ) {\n\t\t$this->id = $id;\n\t}",
"public function setId( $id ) {\n\t\t$this->id = $id;\n\t}",
"public function setId($id){\n\t\t\t$this->id = $id;\n\t\t}",
"public function setId($id) {\n\t\t$this->id = (integer)$id;\n\t}",
"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 setID($id){\n $this->id=$id;\n }",
"public function setId($id) \n {\n $this->id = $id;\n }",
"public function setId( $id )\n {\n $this->id = $id;\n }",
"public function setId($id){\n $this->id = $id;\n }",
"public function setId($x) { $this->id = $x; }",
"public function set($id, $value);",
"public function set($id, $value);",
"public function setId($value)\n {\n $this->setDataField('id', $value);\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($id) {\n\t\t$this->id = $id;\n\t}",
"public function setId($id) {\n\t\t$this->id = $id;\n\t}",
"public function setId($id) {\n\t\t$this->id = $id;\n\t}",
"public function setId($id) {\n\t\t$this->id = $id;\n\t}",
"public function setId($id) {\n\t\t$this->id = $id;\n\t}",
"public function setid($id)\n\t\t{\n\t\t\t$this->id = $id;\n\t\t}",
"public function setId($id) {\r\n $this->_id = $id;\r\n }",
"public function set(string $id, $value);",
"public function setId($id)\n {\n $this->_id = (int) $id;\n }",
"public function setId($id)\n {\n $this->_id = (int) $id;\n }",
"public function setId($id) {\r\n $this->id = $id;\r\n }",
"public function setId($id) {\r\n $this->id = $id;\r\n }",
"public function setId($id)\n {\n $id = (int) $id;\n \n if ($id > 0)\n {\n $this->_id = $id;\n }\n }",
"public function setId($id){\n $this->id = (string) $id;\n }",
"public function setId($id)\n {\n $this->id = $id;\n }",
"public function setId($id)\r\n\t\t{\r\n\t\t\t$this->_id = $id;\r\n\t\t}",
"public function setId($id)\r\n\t{\r\n\t\t$this->id = $id;\r\n\t}",
"public function setID($id) {\n\t\t$this->id = $id;\n\t}",
"function setId($id)\n\t{\n\t\t// Set id\n\t\t$this->_id\t = $id;\n\t}",
"public static function set($id)\n {\n self::$id = $id;\n }",
"public function setId($var){\n\t\t$this->id=$var;\n\t}",
"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 $this->id=$id;\n }",
"function setId($id) {\n\t\treturn $this->setData('id', $id);\n\t}",
"public function setId($id)\n {\n $this->_id = $id;\n }",
"public function setId($id)\r\n {\r\n $this->_id = (int) $id;\r\n }",
"public function setId($id)\n\t{\n\t\t$this->id = (int) $id;\n\t}",
"public function setId($id)\n\t\t{\n\t\t\t$this->id = $id;\n\t\t}",
"public function setId($id)\n\t{\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)\n\t{\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)\n {\n $this->_id = (int)$id;\n }",
"function setId($id) {\r\n\t\t// Set id and wipe data\r\n\t\t$this->_id = $id;\r\n\t}",
"function set_id($id)\r\n {\r\n $this->set_default_property(self :: PROPERTY_ID, $id);\r\n }",
"public function setID($_id) \n \t{\n \t\t$this->_id = $_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 function setId($id) {\n $this->id = $id;\n }",
"public function setID($id){\n $this->ID = $id;\n }",
"public function setId($id){\n\t\t\t\t$this->id=$id;\n\t\t\t}",
"public function setId($id) {\n $this->id = $id;\n }",
"public function setId($id)\n {\n $this->id = $id;\n }",
"public function setId($id)\n {\n $this->id = $id;\n }",
"public function setId($id)\n {\n $this->id = $id;\n }",
"public function setId($id)\n {\n $this->id = $id;\n }",
"public function setId($id)\n {\n $this->id = $id;\n }",
"public function setId($id)\n {\n $this->id = $id;\n }",
"public function setId($id)\n {\n $this->id = $id;\n }",
"public function setId($id)\n {\n $this->id = $id;\n }",
"public function setId($id)\n {\n $this->id = $id;\n }",
"public function setId($id)\n {\n $this->id = $id;\n }",
"public function setId($id)\n {\n $this->id = $id;\n }",
"public function setId($id)\n {\n $this->id = $id;\n }"
] | [
"0.88871074",
"0.843179",
"0.8386374",
"0.82243615",
"0.8207132",
"0.8197505",
"0.8139511",
"0.81316125",
"0.8130276",
"0.81274986",
"0.8092258",
"0.80916125",
"0.807949",
"0.80521345",
"0.80423075",
"0.8040586",
"0.8028681",
"0.8028681",
"0.80261153",
"0.8006119",
"0.8002501",
"0.80008864",
"0.79958093",
"0.79923487",
"0.79879093",
"0.79750544",
"0.7966122",
"0.7966122",
"0.7966122",
"0.7961761",
"0.79594445",
"0.7944638",
"0.7944638",
"0.7937812",
"0.79355067",
"0.79330397",
"0.792408",
"0.79183996",
"0.790568",
"0.79031277",
"0.7896356",
"0.7891149",
"0.7891149",
"0.78905076",
"0.7888843",
"0.78869873",
"0.7884865",
"0.7884865",
"0.7884865",
"0.7884865",
"0.7884865",
"0.7882667",
"0.78793806",
"0.787181",
"0.78704524",
"0.7868695",
"0.78657496",
"0.78657496",
"0.78600323",
"0.78554225",
"0.7837032",
"0.7824912",
"0.782488",
"0.78234637",
"0.7819974",
"0.7815607",
"0.7811229",
"0.78052753",
"0.7797653",
"0.7787404",
"0.77867395",
"0.7781688",
"0.7772302",
"0.7768127",
"0.7766342",
"0.7766342",
"0.7766342",
"0.7766342",
"0.7764087",
"0.7759395",
"0.7751634",
"0.77469563",
"0.7746471",
"0.7746471",
"0.7746471",
"0.7746471",
"0.77461237",
"0.7740466",
"0.77401155",
"0.7731116",
"0.7731116",
"0.7731116",
"0.7731116",
"0.7731116",
"0.7731116",
"0.7731116",
"0.7731116",
"0.7731116",
"0.7731116",
"0.7731116",
"0.7731116"
] | 0.0 | -1 |
Get the value of nombre | public function getNombre()
{
return $this->nombre;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getNombre(){\n //Creamos la consulta\n $sql = \"SELECT nombre FROM usuarios WHERE id_usuario = \".$this->id_user.\";\";\n //obtenemos el array\n $data = $this->getArraySQL($sql);\n //obtenemos el primer elemento, ya que así no tenemos que extraerlo posteriormente\n return $data[0][0];\n }",
"public function getNombre(){\n\t\treturn $this->nombre;\n\t}",
"public function getNombre(){\n \n return $this->_nombre;\n \n }",
"public function getNom();",
"public function getNombre() {\n\t\treturn $this -> nombre;\n\t}",
"function getNombre(){\n\t\treturn $this->nombre;\n\t}",
"function getNombre(){\t\treturn $this->mNombre;\t}",
"public function getNombre()\n {\n return $this->nombre;\n \n }",
"public function getNombre()\n {\n return $this->nombre;\n }",
"public function getNombre()\n {\n return $this->nombre;\n }",
"public function getNombre()\n {\n return $this->nombre;\n }",
"public function getNombre()\n {\n return $this->nombre;\n }",
"public function getNombre()\n {\n return $this->nombre;\n }",
"public function getNombre()\n {\n return $this->nombre;\n }",
"public function getNombre()\n {\n return $this->nombre;\n }",
"public function getNombre()\n {\n return $this->nombre;\n }",
"public function getNombre()\n {\n return $this->nombre;\n }",
"public function getNombre()\n {\n return $this->nombre;\n }",
"public function getNombre()\n {\n return $this->nombre;\n }",
"public function getNombre()\n {\n return $this->nombre;\n }",
"public function getNombre()\n {\n return $this->nombre;\n }",
"public function getNombre()\n {\n return $this->nombre;\n }",
"public function getNombre()\n {\n return $this->nombre;\n }",
"public function getNombre()\n {\n return $this->nombre;\n }",
"public function getNombre()\n {\n return $this->nombre;\n }",
"public function getNombre()\n {\n return $this->nombre;\n }",
"public function getNombre()\n {\n return $this->nombre;\n }",
"public function getNombre()\n {\n return $this->nombre;\n }",
"public function getNombre()\n {\n return $this->nombre;\n }",
"public function getNombre()\n {\n return $this->_nombre;\n }",
"public function getNombre() {\r\n return $this->nombre;\r\n }",
"function getNom($numAbonne){\n\t\tglobal $serv;\n\t\t$req = \"SELECT Distinct Nom FROM abonnes WHERE Code=\\\"$numAbonne\\\";\";\n\t\t$res = db_execSQL($req,$serv);\n\t\t$resultat = mysql_fetch_assoc($res);\n\t\treturn $resultat['Nom'];\t\t\n\t}",
"public function getNombre() {\n return $this->nombre;\n }",
"public function getNombre() {\n return $this->nombre;\n }",
"public function getNombre()\n {\n return $this->nombre;\n }",
"public function getNombre()\r\n {\r\n return $this->Nombre;\r\n }",
"public function getNombre()\n {\n return $this->Nombre;\n }",
"function getNombre(){\n\t\treturn $this->categoria->getNombre;\n\t}",
"public function getNombre() {\n\t\t\treturn $this->_nombre;\n\t\t}",
"public function getNombre(){\n return $this->nombre;\n }",
"public function getNombre(){\n return $this->nombre;\n }",
"public function getNom(): string\r\n {\r\n return $this->nom;\r\n }",
"public function getNom() {\n return strval($this->nom);\n }",
"function getNombre($nombre){\n\t\t$texto = \"El nombre es: $nombre\";\n\n\t\treturn $texto;\n\t}",
"function valorCampo($nombreCampo){\n\t if($this->val!=\"\")\n\t\tforeach($this->val as $indice => $valor){\n\t\t\tif($nombreCampo==$indice){\n\t\t\t\treturn $valor;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"public function getNom() : string{\n return $this->nom;\n }",
"public function getnom() {\n\t\treturn $this->nom;\n\t}",
"public function getNom()\r\n {\r\n return $this->nom;\r\n }",
"public function getNom()\r\n {\r\n return $this->nom;\r\n }",
"public function getNombPropietario(){\n $app = App::getSingleton();\n $conn = $app->conexionBd();\n $IDpropietario = self::getPropietario();\n $query = sprintf(\"SELECT nombre FROM usuarios WHERE id = %s\",$conn->real_escape_string($IDpropietario));\n $consulta = $conn->query($query);\n if($consulta->num_rows > 0){\n $fila = $consulta->fetch_assoc();\n $nombPropietario = $fila['nombre'];\n }else{\n $nombPropietario = \"Anonimo\";\n }\n return $nombPropietario;\n }",
"public function getNom()\n {\n return $this->Nom;\n }",
"public function getNom()\n { \n \n return $this->_nom;\n }",
"public function getNom() { return $this->nom; }",
"public function getNombati()\n {\n return $this->nombati;\n }",
"public function getNom()\n {\n return $this->nom;\n }",
"public function getNom()\n {\n return $this->nom;\n }",
"public function getNom()\n {\n return $this->nom;\n }",
"public function getNom()\n {\n return $this->nom;\n }",
"public function getNom()\n {\n return $this->nom;\n }",
"public function getNom()\n {\n return $this->nom;\n }",
"public function getNom()\n {\n return $this->nom;\n }",
"public function getNom()\n {\n return $this->nom;\n }",
"public function getNom()\n {\n return $this->nom;\n }",
"public function getNom()\n {\n return $this->nom;\n }",
"public function getNom()\n {\n return $this->nom;\n }",
"public function getNom()\n {\n return $this->nom;\n }",
"public function getNom()\n {\n return $this->nom;\n }",
"public function getNom()\n {\n return $this->nom;\n }",
"public function getNom()\n {\n return $this->nom;\n }",
"public function getNom()\n {\n return $this->nom;\n }",
"public function getNom()\n {\n return $this->nom;\n }",
"public function getNom()\n {\n return $this->nom;\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}",
"public function getNom():string{\r\n\r\n\r\n\r\n return $this->nom;\r\n\r\n\r\n\r\n\r\n \t\t\t}",
"public function getNom() \n {\n return $this->nom;\n }",
"public function obtener_nombre()\n {\n echo \" el nombre es del alumno es: \" .$this -> nombre; \n }",
"public function get_nom()\n {\n return $this->_nom;\n }",
"public function get_nom()\n {\n return $this->_nom;\n }",
"public function getNom()\n {\n return $this->_nom;\n }",
"public final function getNom()\n\t{\n\t\treturn $this->nom;\n\t}",
"public function getNom()\n {\n return $this->nom;\n }",
"public function getNom()\n\t{\n\t\treturn $this->nom;\n\t}",
"public function getNifbyName($nombre){\n $stmt=$this->db()->prepare(\"SELECT nif from Trabajador WHERE nombre='$nombre'\");\n\n $stmt->execute();\n\n $resultado=$stmt->fetchColumn();\n\t return $resultado;\n }",
"function getNom()\n {\n return $this->_Nom;\n }",
"function getNombreProducto()\n {\n return $this->NombreProducto;\n }",
"function getNom() {\r\n\t\treturn $this->_nom;\r\n\t}",
"public function get_per_nombre_completo() {\n return $this->atletas_nombre_completo;\n }",
"public function getNombre_propuesta() {\n return $this->nombre_propuesta;\n }",
"function getporNombre($nombre) {\r\n //devuelve el objeto entero\r\n $parametros = array();\r\n $parametros[\"nombre\"] = $nombre;\r\n $this->bd->select($this->tabla, \"*\", \"nombre =:nombre\", $parametros);\r\n $fila = $this->bd->getRow();\r\n $mecanico = new Mecanico();\r\n $mecanico->set($fila);\r\n return $mecanico;\r\n }",
"public function getDocumentoNombre(){\n return $this->docPersona.' - '.$this->nombre.' '.$this->apellidos;\n \n }",
"public function campo($nombre) {}",
"public function obtenerNombre() {\n return $this->nombreModelo;\n }",
"function nombreEmpresa($usuario){\n $db = obtenerBaseDeDatos();\n $sentencia = $db->prepare(\"SELECT * FROM proveedores WHERE id = ?\");\n $sentencia->execute([$usuario]);\n return $sentencia->fetchObject();\n }",
"public function getNombre_empresa(){\n return $this->nombre_empresa;\n }",
"public function getNombreEmpresa(){\n $empresa=DatosEmpresa::datosGenerales($this->idempresa);\n if($empresa==null)\n return '';\n else\n return $empresa->razonsocial;\n }"
] | [
"0.7478505",
"0.7434344",
"0.73567563",
"0.7341521",
"0.73043305",
"0.729088",
"0.7247797",
"0.7226201",
"0.7205094",
"0.7205094",
"0.7205094",
"0.7205094",
"0.7205094",
"0.7205094",
"0.7205094",
"0.7205094",
"0.7205094",
"0.7205094",
"0.7205094",
"0.7205094",
"0.7205094",
"0.7205094",
"0.7205094",
"0.7205094",
"0.7205094",
"0.7205094",
"0.7205094",
"0.7205094",
"0.7205094",
"0.71971816",
"0.7187295",
"0.7170347",
"0.7164793",
"0.7164793",
"0.7155328",
"0.7132238",
"0.71045923",
"0.7065799",
"0.70202637",
"0.7014878",
"0.7014878",
"0.69339615",
"0.69229025",
"0.69154346",
"0.6894459",
"0.68829125",
"0.6877446",
"0.6867154",
"0.6867154",
"0.6859373",
"0.68433934",
"0.6841627",
"0.68267995",
"0.68151253",
"0.6814879",
"0.6814879",
"0.6814879",
"0.6814879",
"0.6814879",
"0.6814879",
"0.6814879",
"0.6814879",
"0.6814879",
"0.6814879",
"0.6814879",
"0.6814879",
"0.6814879",
"0.6814879",
"0.6814879",
"0.6814879",
"0.68105835",
"0.68105835",
"0.6809813",
"0.6801744",
"0.6777505",
"0.6775115",
"0.67495435",
"0.67495435",
"0.6746487",
"0.67297095",
"0.67269725",
"0.6708637",
"0.67008096",
"0.66854894",
"0.66850996",
"0.66754717",
"0.6671667",
"0.6664936",
"0.66566145",
"0.6619157",
"0.6615046",
"0.66002166",
"0.6582254",
"0.6574339",
"0.65705633"
] | 0.71591437 | 39 |
Set the value of nombre | public function setNombre($nombre)
{
$this->nombre = $nombre;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setNombre($nombre){\n $this->nombre = $nombre;\n }",
"public function setNombre($nombre){\n $this->nombre = $nombre;\n }",
"public function setNombre($n){\n\t\t$this->nombre = $n;\n\t}",
"public function setNombre($nombre) {\n\t\t$this->nombre = $nombre;\n\t}",
"public function setNombre($nombre)\n {\n $this->nombre = $nombre;\n }",
"public function setNombre($nombre)\n {\n $this->nombre = $nombre;\n }",
"public function setNombre($nombre)\n {\n $this->nombre = $nombre;\n }",
"public function setNombre($nombre)\n {\n $this->nombre = $nombre;\n }",
"public function setNombre($nombre) {\n $this->nombre = $nombre;\n }",
"public function setNom($value)\n\t{\n\t\t$this -> _nom = $value;\n\t}",
"public final function asigNombre($nombre){\r\n $this->nombre=$nombre;\r\n }",
"function setNombre($nombre){\n\t\tif (is_string($nombre)){\n\t\t\t$this->nombre=$nombre;\n\t\t}else{\n\t\t\tthrow new Exception(\"Debe establecer una cadena para el nombre\");\n\t\t}\t\t\n\t}",
"public function ingresar_nombre($nombre,$username = ' la massa')\n {\n $this -> nombre = $nombre . $username; \n }",
"public function _setNombre($Nombre)\n {\n $this->Nombre = $Nombre;\n\n }",
"public function setNombre($nombre)\n {\n $this->nombre = $this->db->real_escape_string($nombre);\n\n \n }",
"public function setNombre($_nombre)\n {\n $this->_nombre = $_nombre;\n\n return $this;\n }",
"public function setNombre($nombre){\n $this->nombre = $this->db->real_escape_string($nombre);\n }",
"public function setNome($valor){\n\t\t\t$this->nome = $valor;\n\t\t}",
"public function setNombre($nom)\n {\n $this->nombre = $nom;\n }",
"public function __set($nome, $valor) {\n $this->nome = $valor;\n }",
"function setValSubNode($nombre,$valor){\n\t\t$clase=$this->nmclass;\n\t\t$this->nodos[$clase][$nombre]=$valor;\n\t\t$this->anode=$nombre;\n\t\treturn 0;\n\t}",
"public function setNombre($nombre)\n {\n $this->nombre = $nombre;\n\n return $this;\n }",
"public function setNombreAttribute($value)\n\t{\n\t\t$this->attributes['nombre'] = mb_strtoupper($value);\n\t}",
"public function __set($nombre,$valor){\n $class = get_class($this);\n $nombre = strtolower($nombre); // se ponen los nombres en mayusculas ya que en la base de datos estan asi y estan en minusculas no funcionan las consultas\n if(property_exists($class,$nombre)){\n $this->$nombre = $valor; // le asignas al campo de igual nombre en la BD el valor pasado por parametro.\n }\n }",
"public function asignarNombre($nombre){\n$this->nombre = self::mensaje().$nombre;\n}",
"function setNombre_materia($nombre_materia){\n\t\t\n\t\t$this->nombre_materia = $nombre_materia;\n\t\t$this->cambios = true;\n\t}",
"public function testSetNumero() {\n\n $obj = new Collaborateurs();\n\n $obj->setNumero(\"numero\");\n $this->assertEquals(\"numero\", $obj->getNumero());\n }",
"public function setNome($nome){$this->nome = $nome;}",
"public function set($nombreAtributo, $valor){\n if(!isset($this->vars[$nombreAtributo])){\n $this->vars[$nombreAtributo]=$valor;\n }\n }",
"public function setName($nombre)\n\t{\n\t\t \n\t\t if(!empty($nombre))\n\t\t {\n\n\t\t \t$name = trim($nombre);\n if(Auth::check())\n {\n $nameExiste=Account::find($this->account_id)->where('name',$name)->first();\n\n }else{\n\n $nameExiste=Account::find($this->getAccount_id())->where('name',$name)->first();\n } \n\t\t \t\n\t\t \tif($nameExiste)\n\t\t \t{\n\t\t \t\t$this->fv_error_message = $this->fv_error_message . '<br> - Nombre '.$name.ERROR_DUPLICADO;\n\t\t \t\treturn $this->fv_name=null;\n\t\t \t}\n\t\t \treturn $this->fv_name = $name;\n\t\t }\n\t\t \t// return null;\n\t\t \t$this->fv_error_message = $this->fv_error_message .'<br> - Nombre '.ERROR_NULL;\n\t\t \treturn $this->fv_name = null;\n\t\t \n\t}",
"public function setName($name){\n\t$this->nom = $name;\n}",
"public function setNom($param)\n\t\t{\n\t\t\t$this->autnom = $param;\n\t\t}",
"public function setNombreUsuario($nombreUsuario){\n $this->nombreUsuario = $nombreUsuario;\n }",
"public function setNombre_propuesta($nombre_propuesta) {\n $this->nombre_propuesta = $nombre_propuesta;\n }",
"function setNumero($numero){\n if(empty($numero)){\n header(\"Location:../vu/formulaire_inscription.php\");\n return;\n\n }\n //on declare de la variable numero puis on appelle la varibale prive numero\n $this->_numero = $numero;\n }",
"public function setNome(string $nome)\n {\n $this->nome = $nome;\n }",
"function setModificarJugador($id,$nombre,$url_img){\n\t$this->nombre = $nombre;\n\t$this->id = $id;\n\t$this->url_img = $url_img;\n}",
"public function comerPersona($nombre){\n\t\techo \"Soy el tiburon peligroso $this->nombre y me voy a comer a la persona $nombre\";\n\t}",
"public function set_nome($nome) : void\n {\n try {\n $this->obj_contato_anunciante->set_nome(Validador::Contato_Anunciante()::validar_nome($nome));\n } catch (Exception $e) {\n $this->erros[] = $e->getMessage();\n $this->campos['nome'] = \"erro\";\n }\n }",
"abstract public function ingresar_nombre($nombre);",
"function setMainNode($nombre){\n\t\t$this->nodeppal=$nombre;\n\t\treturn 0;\n\t}",
"public function setNom($nom){\n if(empty($nom)){\n //on redirige\n header(\"Location:../vu/formulaire_inscription.php\");\n return;\n\n }\n //on declare de la variable nom puis on appelle la varibale prive nom\n $this->_nom = $nom;\n }",
"public function nombreTabla( $nombre ){\n $this->json[ \"tabla\" ] = $nombre;\n }",
"public function setNombre($nombre)\n {\n $this->nombre = $nombre;\n\n return $this;\n }",
"public function setNombre($nombre)\n {\n $this->nombre = $nombre;\n\n return $this;\n }",
"public function setNombre($nombre)\n {\n $this->nombre = $nombre;\n\n return $this;\n }",
"public function setNombre($nombre)\n {\n $this->nombre = $nombre;\n\n return $this;\n }",
"public function setNombre($nombre)\n {\n $this->nombre = $nombre;\n\n return $this;\n }",
"public function setNombre($nombre)\n {\n $this->nombre = $nombre;\n\n return $this;\n }",
"public function setNombre($nombre)\n {\n $this->nombre = $nombre;\n\n return $this;\n }",
"public function setNombre($nombre)\n {\n $this->nombre = $nombre;\n\n return $this;\n }",
"public function setNombre($nombre)\n {\n $this->nombre = $nombre;\n\n return $this;\n }",
"public function setNombre($nombre)\n {\n $this->nombre = $nombre;\n\n return $this;\n }",
"public function setNombre($nombre)\n {\n $this->nombre = $nombre;\n\n return $this;\n }",
"public function setNombre($nombre)\n {\n $this->nombre = $nombre;\n\n return $this;\n }",
"public function setNombre($nombre)\n {\n $this->nombre = $nombre;\n\n return $this;\n }",
"public function setNombre($nombre)\n {\n $this->nombre = $nombre;\n\n return $this;\n }",
"public function setNombre($nombre)\n {\n $this->nombre = $nombre;\n\n return $this;\n }",
"public function campo($nombre) {}",
"public function setnombrePaciente($value){\n\n\t\t$this->_nombrePaciente = $value;\n\t}",
"public function setidExamen($Valor){\r\n $this->idExamen = trim($Valor);\r\n }",
"function setNom($nom) { if (is_string($nom)) {\r\n $this->_nom = $nom;\r\n }\r\n }",
"public function setId($valor){\n\t\t\t$this->id = $valor;\n\t\t}",
"public function __set($nome, $valor) {\n $this->dados[$nome] = $valor;\n }",
"public function setNombre_empresa($nombre_empresa){\n $this->nombre_empresa = $nombre_empresa;\n }",
"public function setArl_nombre($arl_nombre){\n $this->arl_nombre = $arl_nombre;\n }",
"public function setPension_nombre($pension_nombre){\n $this->pension_nombre = $pension_nombre;\n }",
"public function setNom($nom) {\n $this->nom = $nom;\n }",
"public function setNom($nom)\n {\n $this->nom = $nom;\n }",
"public function setNome($nome)\n {\n $this->nome = $nome;\n\n \n }",
"public function __construct($nombre=\"Invitado\"){\n\t\t\t$this->nombre=$nombre;\n\t\t\t$this->distanciaRecorrida=0;\n\n\t\t}",
"public function testSetNom() {\n\n $obj = new Collaborateurs();\n\n $obj->setNom(\"nom\");\n $this->assertEquals(\"nom\", $obj->getNom());\n }",
"function __set($modelo, $valor)\n\t{\n\t\t$this->modelo = $modelo;\n\t}",
"function setId_nom($iid_nom)\n {\n $this->iid_nom = $iid_nom;\n }",
"function setId_nom($iid_nom)\n {\n $this->iid_nom = $iid_nom;\n }",
"function setAgregarUnPais(){\n\t\t$this->comienza_con++;\n\t}",
"public function setNombre($nombre)\n {\n $this->nombre = $this->db->real_escape_string($nombre);\n\n return $this;\n }",
"protected function ponerNombre(){\r\n\t\t$time=$this->time;\r\n\t\t\tif ($this->nombreUnicoImagen=='default') {\r\n\t\t\t\tfor ($i=0; $i <$this->cantidad ; $i++) { \r\n\t\t\t\t$this->nombreImagenes[$i]=$time.'-to_'.($i+1).'_and_'.$this->cantidad;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\tfor ($i=0; $i <$this->cantidad ; $i++) { \r\n\t\t\t\t\t$this->nombreImagenes[$i]=$this->nombreUnicoImagen.'-'.$time.'-to_'.($i+1).'_and_'.$this->cantidad;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t}",
"function modificarNumFilhos($numFilhos) {\r\n $this->numFilhos = $numFilhos;\r\n }",
"public function set_nom($_nom) {\n $this->_nom = $_nom;\n\n return $this;\n }",
"public function setNome($nome)\n\t\t{\n\t\t\t\t$this->nome = $nome;\n\t\t}",
"public function testSetNumero() {\n\n $obj = new Employes();\n\n $obj->setNumero(\"numero\");\n $this->assertEquals(\"numero\", $obj->getNumero());\n }",
"public function set($atributo, $valor) {\r\n\t\t\t $this->$atributo = $valor;\r\n\t\t}",
"public function testSetNumeroFiche() {\n\n $obj = new FichesControlesEntetes();\n\n $obj->setNumeroFiche(10);\n $this->assertEquals(10, $obj->getNumeroFiche());\n }",
"public function set_nom(string $_nom){\n $this->_nom = $_nom;\n\n return $this;\n }",
"public function setNome($nome)\n {\n $this->nome = $nome;\n }",
"public function __set($atributo, $valor) {\n\t\t\t// $this->modelo = $valor;\n\t\t\t$this->$atributo = $valor;\n\t\t}",
"public static function update_nombre($id_medio,$nombre){\n global $baseDatos;\n \n $res = $baseDatos->query(\" UPDATE `art_venta_medio` SET `nombre`='$nombre' WHERE id_medio = $id_medio\"); \n \n return $res;\n }",
"public function testSetNomVoie() {\n\n $obj = new Collaborateurs();\n\n $obj->setNomVoie(\"nomVoie\");\n $this->assertEquals(\"nomVoie\", $obj->getNomVoie());\n }",
"public function obtener_nombre()\n {\n echo \" el nombre es del alumno es: \" .$this -> nombre; \n }",
"function setName($value) {\n $this->name = $value;\n }",
"public function modificarNombre($objTeatro, $nombre){\n $objTeatro->setNombre($nombre);\n $exito=$objTeatro->modificar();\n\n return $exito;\n }",
"public function setVida($valor){\n $this->vida=$valor;\n }",
"public function setIdusuario($value){\n $this->idusuario = $value;\n }",
"public function testSetNomNaissance() {\n\n $obj = new Employes();\n\n $obj->setNomNaissance(\"nomNaissance\");\n $this->assertEquals(\"nomNaissance\", $obj->getNomNaissance());\n }",
"public function setCliNombreAttribute($value)\n {\n $this->attributes['cli_nombre'] = strtoupper($value);\n }"
] | [
"0.78101224",
"0.78101224",
"0.77143884",
"0.74746263",
"0.74102265",
"0.74102265",
"0.74102265",
"0.74102265",
"0.74058175",
"0.74005854",
"0.7364611",
"0.72835755",
"0.7268867",
"0.7108571",
"0.7054164",
"0.7028272",
"0.6996061",
"0.6941704",
"0.69088876",
"0.68710977",
"0.67941076",
"0.6793254",
"0.6751634",
"0.66962725",
"0.6689935",
"0.66631997",
"0.6638051",
"0.6587418",
"0.657763",
"0.6553695",
"0.650837",
"0.6496646",
"0.64945406",
"0.64786327",
"0.6452146",
"0.64396656",
"0.6439464",
"0.64027697",
"0.6396669",
"0.63927376",
"0.639194",
"0.6385264",
"0.63736963",
"0.6372099",
"0.6372099",
"0.6372099",
"0.6372099",
"0.6372099",
"0.6372099",
"0.6372099",
"0.6372099",
"0.6372099",
"0.6372099",
"0.6372099",
"0.6372099",
"0.6372099",
"0.6372099",
"0.6372099",
"0.6357246",
"0.6345793",
"0.632312",
"0.62984365",
"0.6298104",
"0.6283712",
"0.62693965",
"0.6264407",
"0.62619203",
"0.62337595",
"0.6224718",
"0.6218945",
"0.62182266",
"0.6205126",
"0.62027687",
"0.6192633",
"0.6192633",
"0.61873883",
"0.61799663",
"0.61772656",
"0.6173199",
"0.61519516",
"0.61510205",
"0.6138642",
"0.6128521",
"0.61276186",
"0.61257803",
"0.61142194",
"0.6100419",
"0.6092349",
"0.60898024",
"0.607748",
"0.60620517",
"0.6061249",
"0.6051341",
"0.60466",
"0.604216",
"0.6031263"
] | 0.65546256 | 32 |
Get the value of apellidos | public function getApellidos()
{
return $this->apellidos;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getApellidos(){\n return $this->apellidos;\n }",
"public function getApellido()\n {\n return $this->apellido;\n }",
"public function getApellido()\n {\n return $this->apellido;\n }",
"public function getApellido()\n {\n return $this->_apellido;\n }",
"public function getApellidos() {\n\t\treturn $this->apellidos;\n\t}",
"public function getApellido()\n {\n return $this->apellido;\n }",
"public function getApellidos() {\n return $this->getDatos(0);\n }",
"public function getApellido1()\n {\n return $this->apellido1;\n }",
"public function getApellido2()\n {\n return $this->apellido2;\n }",
"public function apellidosCompletos($apellidos){\n $apeMinuscula = strtolower($this->sanear_string($apellidos));\n //junto el/los apellidos/s del preinscripto\n $ape = str_replace(' ','',$apeMinuscula); \n //$ape = preg_replace('[\\s+]','', $apeMinuscula);\n //devuelvo solo los apellido de los preinscriptos\n return $ape;\n }",
"public function setApellidos($apellidos){\n $this->apellidos = $apellidos;\n }",
"function ObtenerApellidoParaBuscar($apellidosarch)\n{\n\tglobal $con;\n\t\n\t$query_ConsultaFuncion = sprintf(\"SELECT id_student FROM students WHERE surname = %s \",\n\t\t GetSQLValueString($apellidosarch, \"text\"));\n\t//echo $query_ConsultaFuncion;\n\t$ConsultaFuncion = mysqli_query($con, $query_ConsultaFuncion) or die(mysqli_error($con));\n\t$row_ConsultaFuncion = mysqli_fetch_assoc($ConsultaFuncion);\n\t$totalRows_ConsultaFuncion = mysqli_num_rows($ConsultaFuncion);\n\t\n\treturn $row_ConsultaFuncion[\"id_student\"];\t\n\t\n\tmysqli_free_result($ConsultaFuncion);\n}",
"public function getIniciales() {\n $aIni = array();\n $aApe = $this->getApellidos();\n $sIni = \"\";\n foreach ($aApe as $Apellido) {\n $ini = substr($Apellido, 0, 1);\n if($ini != $sIni) {\n $aIni[] = $ini;\n }\n $sIni = $ini;\n }\n return $aIni;\n }",
"public function getNombreApellido($id) {\r\n\t\t$aux='';\r\n\t\t$pasante = $this->findFirst(\"id='$id'\");\r\n\t\tif ($pasante){\r\n\t\t\t$aux= \"{$pasante->getNombre()} {$pasante->getApellido()}\";\r\n\t\t}\r\n\t\treturn $aux;\r\n\t}",
"public function getNombreAndApellidoAttribute()\n {\n return $this->nombre . ' ' . $this->apellido;\n }",
"public function getNombreAndApellidoAttribute()\n {\n return $this->nombre . ' ' . $this->apellido;\n }",
"function ObtenerApellidoUsuario($apellido)\n{\n\tglobal $con;\n\t\n\t$query_ConsultaFuncion = sprintf(\"SELECT surname FROM users WHERE id_user = %s \",\n\t\t GetSQLValueString($apellido, \"int\"));\n\t//echo $query_ConsultaFuncion;\n\t$ConsultaFuncion = mysqli_query($con, $query_ConsultaFuncion) or die(mysqli_error($con));\n\t$row_ConsultaFuncion = mysqli_fetch_assoc($ConsultaFuncion);\n\t$totalRows_ConsultaFuncion = mysqli_num_rows($ConsultaFuncion);\n\t\n\treturn $row_ConsultaFuncion[\"surname\"];\t\n\t\n\tmysqli_free_result($ConsultaFuncion);\n}",
"public function setApellidos($apellidos) {\n\t\t$this->apellidos = $apellidos;\n\t}",
"public function getNamaPelajaran();",
"public function getLongitudEmpresa()\n {\n return $this->longitudEmpresa;\n }",
"public function setApellidos($apellidos)\n {\n $this->apellidos = $apellidos;\n\n return $this;\n }",
"public function setApellidos($apellidos)\n {\n $this->apellidos = $apellidos;\n\n return $this;\n }",
"public function getPersona()\n\t{\n\t $persona=Persona::model()->find(\"id_usuario = \".$this->id);\n\t if($persona)\n\t \treturn $persona->nombre.', '.$persona->apellido;\n\t else\n\t \treturn \"Falta completar datos\";\n\t}",
"public function getMataPelajaran();",
"public function getPengajuan() {\n $dataPengajuan = Pengajuan::model()->findAll('NIM=:NIM', array(':NIM' => Yii::app()->user->getUsername()));\n return CHtml::listData($dataPengajuan, 'IDPengajuan', 'Judul');\n }",
"public function setApellido($apellido)\n {\n $this->apellido = $apellido;\n\n return $this;\n }",
"public function setApellido($_apellido)\n {\n $this->_apellido = $_apellido;\n\n return $this;\n }",
"public function getLido()\n {\n return $this->lido;\n }",
"public function setApellido($apellido)\n {\n $this->apellido = $this->db->real_escape_string($apellido);\n\n \n }",
"public function getArl_nombre(){\n return $this->arl_nombre;\n }",
"public function getNombre_empresa(){\n return $this->nombre_empresa;\n }",
"function ObtenerApellidoStudent($apellidoS)\n{\n\tglobal $con;\n\t\n\t$query_ConsultaFuncion = sprintf(\"SELECT surname FROM students WHERE id_student = %s \",\n\t\t GetSQLValueString($apellidoS, \"int\"));\n\t//echo $query_ConsultaFuncion;\n\t$ConsultaFuncion = mysqli_query($con, $query_ConsultaFuncion) or die(mysqli_error($con));\n\t$row_ConsultaFuncion = mysqli_fetch_assoc($ConsultaFuncion);\n\t$totalRows_ConsultaFuncion = mysqli_num_rows($ConsultaFuncion);\n\t\n\treturn $row_ConsultaFuncion[\"surname\"];\t\n\t\n\tmysqli_free_result($ConsultaFuncion);\n}",
"public function setApellido($apellido)\n {\n $this->apellido = $apellido;\n\n return $this;\n }",
"public function percobaan()\n {\n \t$a = \"Ahmad Muhaimin\";\n \treturn \"Nama Saya Adalah \".$a;\n }",
"public function getPessoa(){\n return $this->pessoa;\n }",
"public function getPessoa(){\n return $this->pessoa;\n }",
"public function getPessoa(){\n return $this->pessoa;\n }",
"public function getOdmitnuteClanky(){\n $sth = $this->db->prepare(\"SELECT * FROM PRISPEVKY\n WHERE stav LIKE 'odmítnuto'\");\n $sth->execute();\n $data = $sth->fetchAll();\n return $data;\n }",
"public function getLongitud()\n {\n return $this->longitud;\n }",
"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 }",
"public function getPlaca(){ return $this->placa;}",
"function getfield(){\r\n // Талбаруудын утгыг авах\r\n }",
"function localidadConsultarNombre($criterio) {\n\n\t$query = \"SELECT localidad_nombre FROM localidades WHERE id=\".$criterio;\t\n\t$res = ejecutarQuerySQL($query);\n\t$actual = getFila($res);\n\t\t\t\nreturn $actual['localidad_nombre'];\n}",
"function buscar_personal($names){\n\t$names_pers = textfilter_specialchars($names);\n\t$n = substr_count($names_pers, \",\");\n\tif($n > 0){\n\t\t$names_pers = explode(\", \",$names_pers);\n\t\t$apellidos = $names_pers[0];\n\t\t$nombres = $names_pers[1];\n\t\t$cons_dni = \"SELECT dni FROM personal \n\t\t\t\t\t\tWHERE apellidos='$apellidos' AND nombres='$nombres'\";\n\t\t$resp_dni = mysql_query($cons_dni);\n\t\t$dni = 0;\n\t\tif($row = mysql_fetch_array($resp_dni)){\n\t\t\t$dni = $row[0];\n\t\t}else{\n\t\t\t$dni = 0;\n\t\t}\n\t}else{\n\t\t$dni = 0;\n\t}\t\n\treturn $dni;\n}",
"public function getDescripcionEmpresa()\n {\n return $this->descripcionEmpresa;\n }",
"public function getNameLukasBodnariuc(): string{\r\n return $this->nameLukasBodnariuc . \" \" . $this->surnameLukasBodnariuc;\r\n }",
"public function idAluno()\n {\n $result = $this->aluno->id_aluno;\n\n return $this->view->escapeHtml($result);\n }",
"function getNombre(){\t\treturn $this->mNombre;\t}",
"public function getLongitud()\n {\n return $this->Longitud;\n }",
"private function namakelas()\n {\n // UNLESS it's the email for the current user\n \n $id = $this->input->post('haknilai_id');\n $this->db->where('haknilai_kelas', $this->input->post('haknilai_kelas'));\n !$id || $this->db->where('haknilai_id !=', $id);\n $namakelas = $this->hakmapel_m->get();\n \n return $namakelas;\n }",
"function getDesc_teleco()\n {\n if (!isset($this->sdesc_teleco) && !$this->bLoaded) {\n $this->DBCarregar();\n }\n return $this->sdesc_teleco;\n }",
"public function getProvinciaNombre()\n {\n return $this->provincia->getNombre();\n }",
"public function pegaUm()\n\t{\n\t\t// return mysqli_fetch_assoc($this->resultado);\n\t\treturn $this->resultado->fetch(PDO::FETCH_ASSOC);\n\t}",
"public function getIdentificacao();",
"public function getEmpleado_idemp(){\n return $this->empleado_idemp;\n }",
"public function getIdade() {\r\n return $this->idade;\r\n }",
"public function getRolePengguna() {\n $rolesyangberhak = DB::table('roles')->where('id','=','3')->first()->namaRule;\n return $rolesyangberhak;\n }",
"public function getTexto() {\n return $this->texto;\n }",
"function verRespuestaDetallePersonal($idEstudiante, $idPregunta) {\n global $ruta, $db;\n $query_buscarespuesta = \"SELECT EstudianteDetallesPersonalesId \n FROM EstudianteDetallesPersonales \n WHERE idestudiantegeneral='\" . $idEstudiante . \"' AND idobs_admitidos_contexto='\" . $idPregunta . \"'\";\n\n $respuestaestu = $db->Execute($query_buscarespuesta);\n $totalRows = $respuestaestu->RecordCount();\n\n if ($totalRows == 0) {\n return \"null\";\n } else {\n $rowrespuesta = $respuestaestu->FetchRow();\n return $rowrespuesta[\"EstudianteDetallesPersonalesId\"];\n }\n }",
"function getAllFromProizvod(){\n\t\treturn $this->ime . \" \" . $this->imeProizvođača . \" \" \n\t\t. $this->prezimeProizvođača . \" \" . $this->cijena;\n\t}",
"public function getNombre()\n {\n return $this->Nombre;\n }",
"public function valorarUsuario($nickname, $puntuacion){\r\n if(!$this->dao){\r\n $this->dao = new UsuarioDAO();\r\n }\r\n $aux= $this->dao;\r\n return $aux->valorarUsuario($nickname, $puntuacion);\r\n }",
"public function getDescricao(){\n return $this->_data['descricao'];\n }",
"public function getParcela()\n {\n return $this->parcela;\n }",
"public function recuperaNome(){\n $nome = \"\";\n if(isset($_POST['nomericetta'])){\n $nome = $_POST['nomericetta'];\n }\n return $nome;\n }",
"public function getDescripcionunidad()\n {\n return $this->descripcionunidad;\n }",
"function ap ($nama)\n\t\t\t{\n\t\t\t\treturn $this->db->order_by('apa', 'ASC')->like('nama', $nama)->or_like('ic', $nama)->get_where('user_data', array('id <>' => 1, 'nama' => 'Admin'));\n\t\t\t}",
"public function getNombre()\r\n {\r\n return $this->Nombre;\r\n }",
"public function getempleado()\r\n {\r\n return $this->empleado;\r\n }",
"public function getempleado()\r\n {\r\n return $this->empleado;\r\n }",
"public function testSePuedeCrearYObtenerNombreYApellido()\n { \n $emp= $this->crear();\n $this->assertEquals(\"Ricardo Montaner\", $emp->getNombreApellido());\n }",
"function getNombre(){\n //Creamos la consulta\n $sql = \"SELECT nombre FROM usuarios WHERE id_usuario = \".$this->id_user.\";\";\n //obtenemos el array\n $data = $this->getArraySQL($sql);\n //obtenemos el primer elemento, ya que así no tenemos que extraerlo posteriormente\n return $data[0][0];\n }",
"public function getLinha();",
"public function getId_anuncio()\n {\n return $this->id_anuncio;\n }",
"public function pesquisa()\n {\n $query = \"SELECT * FROM noticia WHERE titulo LIKE :titulo\";\n $stmt = $this->db->prepare($query);\n $stmt->bindValue(\":titulo\", $this->titulo.\"%\");\n $stmt->execute();\n return $stmt->fetchAll(PDO::FETCH_ASSOC);\n }",
"private function namakelas()\n {\n // UNLESS it's the email for the current user\n \n $id = $this->input->post('wali_id');\n $this->db->where('wali_kelas', $this->input->post('wali_kelas'));\n !$id || $this->db->where('wali_id !=', $id);\n $this->db->where('wali_tahunajaran', $this->konfigurasi_m->konfig_tahun());\n $namakelas = $this->wali_m->get();\n \n return $namakelas;\n }",
"public function getPersonal();",
"function get_aut_idautor(){return $this->aut_idautor;}",
"function get_aula ($id_aula){\n $sql=\"SELECT nombre \n FROM aula \n WHERE id_aula=$id_aula\";\n $aula=toba::db('gestion_aulas')->consultar($sql);\n \n return ($aula[0]['nombre']);\n }",
"function exibirApiLancamentosNome($id){\n $id = preg_split(\"/[\\s,]+/\", $id);\n\n $data = Buscar::exibirProdutosLancamentosNome($id);\n return $data ->toArray();\n }",
"public static function obtenerEmpresas(){ \n $partidas = self::find() \n ->orderBy('razon_social')\n ->all();\n return ArrayHelper::map($partidas,'empresa_id','razon_social');\n }",
"public function getNombreProvincia() {\n return $this->provincia->nombre_provincia;\n }",
"public function getNombrePedido()\r\n {\r\n return $this->NombrePedido;\r\n }",
"public function getMarcaNombre()\n {\n return $this->marcaNombre;\n }",
"function obtenerFolleto($edicion){\n\t\t$concurso = new Concurso();\n\t\t$res = $concurso->recuperar($edicion);\n\t\treturn $res['folleto'];\n\t}",
"function ret_nome($idnome)\n {\n global $db;\n\t$sql=\"select nome from usuario where usuario=$idnome\";\n\t$db->query($sql);\n\t$nome=$db->dados();\n\treturn $nome[0];\n }",
"public function getAsientos(){ return $this->asientos;}",
"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}",
"public function getPerusahaan() {\r\n $sql = $this->db->query(\"SELECT * FROM ms_company WHERE comp_status = 0 ORDER BY comp_nama ASC\");\r\n if ($sql->num_rows() > 0) {\r\n return $sql->result_array();\r\n }\r\n return null;\r\n }",
"public function getNom();",
"private function obtenerNombreUsuario()\n {\n\n $idUsuario = Auth::user()->id;\n $nombre = DB::table('persona')\n\n ->join('empleado', 'empleado.idPersona', '=', 'persona.idPersona')->join('users', 'users.id', 'empleado.idUsuario')\n ->select('persona.nombre')\n ->where('users.id', '=', $idUsuario)\n ->get();\n if ($nombre) {\n return $nombre[0]->nombre;\n } else {\n return Auth::user()->nombre;\n }\n }",
"public function get_per_nombre_completo() {\n return $this->atletas_nombre_completo;\n }",
"function getEmperor(){\r\n\t\t$this->retriveDataRow();\r\n\r\n\t\tif(!is_null($this->data)){\r\n\t\t\treturn $this->data['czlonek_1'];\r\n\t\t}else{\r\n\t\t\treturn NULL;\r\n\t\t}\r\n\t}",
"function listarPersonalAlmacenDisponible($conexion){\n\ttry{\n\t\t$consulta = \"SELECT PID FROM PERSONAL WHERE DEPARTAMENTO='Almacen' AND ESTADO='Libre' ORDER BY PID\"; \n \t$stmt = $conexion->query($consulta);\n\t\treturn $stmt;\n\t}catch(PDOException $e) {\n\t\treturn $e->getMessage();\n }\n}",
"public function setApellido1($apellido1)\n {\n $this->apellido1 = $apellido1;\n\n return $this;\n }",
"public function getExamen_medico(){\n return $this->examen_medico;\n }",
"function getDescUsuario() {\n return $this->descUsuario;\n }",
"function String_Get_Nombre_Perfil($perfil)\n{\n\t$usuario = consultar(\"SELECT * FROM `tb_perfiles` WHERE id_perfiles=$perfil\"); \n\twhile ($valor = mysqli_fetch_array($usuario)) {\n\t\treturn $valor['nombre'];\n\t}\t\n}",
"function consultarNotaAprobatoria() {\r\n\r\n $variables=array('codProyectoEstudiante'=> $this->datosEstudiante['CARRERA'] \r\n );\r\n $cadena_sql = $this->sql->cadena_sql(\"nota_aprobatoria\", $variables);\r\n $resultado = $this->ejecutarSQL($this->configuracion, $this->accesoOracle, $cadena_sql, \"busqueda\");\r\n return $resultado[0][0];\r\n }"
] | [
"0.80048215",
"0.79264444",
"0.79264444",
"0.7915871",
"0.7889416",
"0.7882793",
"0.7839877",
"0.70381016",
"0.67566264",
"0.6606118",
"0.6378194",
"0.6378145",
"0.62622064",
"0.623776",
"0.62113965",
"0.62113965",
"0.61512154",
"0.61276686",
"0.60578716",
"0.5984344",
"0.5957456",
"0.5957456",
"0.5908531",
"0.58782333",
"0.5787647",
"0.57762116",
"0.5740849",
"0.5733331",
"0.5695546",
"0.5644573",
"0.5565305",
"0.5549035",
"0.5513324",
"0.54667675",
"0.543118",
"0.543118",
"0.543118",
"0.54212445",
"0.5418651",
"0.53888047",
"0.5351563",
"0.5348007",
"0.5344371",
"0.5328362",
"0.5322101",
"0.5311871",
"0.5306769",
"0.5289554",
"0.5285093",
"0.5283495",
"0.5280191",
"0.5278482",
"0.5263652",
"0.52573067",
"0.5254809",
"0.5248367",
"0.5243628",
"0.52349406",
"0.5232127",
"0.52295464",
"0.5224215",
"0.52235806",
"0.52235454",
"0.5222276",
"0.5215312",
"0.5202806",
"0.5193873",
"0.518507",
"0.5183771",
"0.5183771",
"0.5177129",
"0.5174592",
"0.51722157",
"0.5168198",
"0.51669866",
"0.51539755",
"0.5150133",
"0.51497364",
"0.51454353",
"0.51370424",
"0.51358575",
"0.5134746",
"0.5132251",
"0.51305187",
"0.51291317",
"0.51186234",
"0.51151365",
"0.5114185",
"0.5111757",
"0.5109849",
"0.51085436",
"0.5104105",
"0.51029783",
"0.5099932",
"0.50976235",
"0.5095024",
"0.50925505",
"0.50907654",
"0.50867325"
] | 0.78756535 | 7 |
Set the value of apellidos | public function setApellidos($apellidos)
{
$this->apellidos = $apellidos;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setApellidos($apellidos){\n $this->apellidos = $apellidos;\n }",
"public function setApellidos($apellidos) {\n\t\t$this->apellidos = $apellidos;\n\t}",
"public function setApellido($apellido)\n {\n $this->apellido = $this->db->real_escape_string($apellido);\n\n \n }",
"public function setApellido($_apellido)\n {\n $this->_apellido = $_apellido;\n\n return $this;\n }",
"public function setApellidoAttribute($value)\n\t{\n\t\t$this->attributes['apellido'] = mb_strtoupper($value);\n\t}",
"public function getApellidos(){\n return $this->apellidos;\n }",
"public function setApellido($apellido)\n {\n $this->apellido = $apellido;\n\n return $this;\n }",
"public function getApellidos()\n {\n return $this->apellidos;\n }",
"public function getApellidos()\n {\n return $this->apellidos;\n }",
"public function getApellidos() {\n\t\treturn $this->apellidos;\n\t}",
"public function getApellido()\n {\n return $this->apellido;\n }",
"public function getApellido()\n {\n return $this->apellido;\n }",
"public function getApellido()\n {\n return $this->apellido;\n }",
"public function getApellido()\n {\n return $this->_apellido;\n }",
"public function setApellido($apellido)\n {\n $this->apellido = $apellido;\n\n return $this;\n }",
"public function getApellidos() {\n return $this->getDatos(0);\n }",
"public function apellidosCompletos($apellidos){\n $apeMinuscula = strtolower($this->sanear_string($apellidos));\n //junto el/los apellidos/s del preinscripto\n $ape = str_replace(' ','',$apeMinuscula); \n //$ape = preg_replace('[\\s+]','', $apeMinuscula);\n //devuelvo solo los apellido de los preinscriptos\n return $ape;\n }",
"public function setMensagemLido($lido) \n\t{\n\t\t$query = \"UPDATE usuario SET lido = \".$lido.\" WHERE id_mensagem = :id_mensagem\";\n\t\t$stmt = $this->db->prepare($query);\n\t\t$stmt->bindValue(':id_mensagem', $_this->__get('id_mensagem'));\n\t\t$stmt->execute();\n\t}",
"public function edit(){\n $carros = array();\n\n $nomes[] = 'Astra';\n $nomes[] = 'Caravan';\n $nomes[] = 'Ipanema';\n $nomes[] = 'Kadett';\n $nomes[] = 'Monza';\n $nomes[] = 'Opala';\n $nomes[] = 'Veraneio';\n\n $this->set('carros',$nomes);\n }",
"public function setCliApellidoAttribute($value)\n {\n $this->attributes['cli_apellido'] = strtoupper($value);\n }",
"public function setApellido1($apellido1)\n {\n $this->apellido1 = $apellido1;\n\n return $this;\n }",
"public function setidExamen($Valor){\r\n $this->idExamen = trim($Valor);\r\n }",
"public function setMataPelajaran($mata_pelajaran);",
"public function getApellido1()\n {\n return $this->apellido1;\n }",
"function setEmpresa($empresa, $puesto, $depto = \"\", $idempleado = \"\", $nss = 0, $ExtTelefonica = 0 ){\n\t\t$this->mClaveEmpresa\t= $empresa;\n\t\t$this->mPuesto\t\t\t= $puesto;\n\t\t$this->mDepto\t\t\t= $depto;\n\t\t$this->mIDEmpleado\t\t= $idempleado;\n\t\t$this->mNSS\t\t\t\t= $nss;\n\t\t$this->mExtTelefonica\t= $ExtTelefonica;\n\t\t//iniciar domicilio?\n\t\t$xEmp\t\t\t\t\t= new cEmpresas($this->mCodigoPostal);\n\t\tif($xEmp->init() == true){\n\t\t\t$this->mNombreEmpresa\t= $xEmp->getNombreCorto();\n\t\t\t$this->mDomicilio\t\t= $xEmp->getDomicilio();\n\t\t\t$OPers\t\t\t\t\t= $xEmp->getOPersona();\n\t\t\tif($OPers != null){\n\t\t\t\t$xViv\t\t\t\t= $OPers->getODomicilio();\n\t\t\t\tif($xViv != null){\n\t\t\t\t\t$this->mClaveDeEstado\t\t= $xViv->getClaveDeEstado();\n\t\t\t\t\t$this->mClaveDeMunicipio\t= $xViv->getClaveDeMunicipio();\n\t\t\t\t\t$this->mClaveDeLocalidad\t= $xViv->getClaveDeLocalidad();\n\t\t\t\t\t\n\t\t\t\t\t$this->mNombreDeLocalidad\t= $xViv->getLocalidad();\n\t\t\t\t\t$this->mNombreDeMunicipio\t= $xViv->getMunicipio();\n\t\t\t\t\t$this->mNombreDeEstado\t\t= $xViv->getEstado();\n\t\t\t\t\t$this->mCodigoPostal\t\t= $xViv->getCodigoPostal();\n\t\t\t\t\t$this->mIDDomicilio\t\t\t= $xViv->getClaveUnica();\t\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function setListar($value)\n\t{\n\t\t$this->listar = $value;\n\t}",
"private function setNome($nomecompleto){\t\t\n\t\tif($nomecompleto = filter_var($nomecompleto, FILTER_SANITIZE_STRING)){\n\t\t\t$this->nomecompleto = $nomecompleto; \n\t\t} \n\t}",
"public function set_pengiriman($id){ // untuk membuat database langkah pengiriman\n\t\t$cek = $this->M_biodata->get_biodata($id)->result();\n\t\t$this->load->model('M_transaksi');\n\t\tif (count($cek)>0){\n\t\t\tforeach ($cek as $c){\n\t\t\t\t\n\t\t\t};\n\t\t\t$data = array(\n\t\t\t'nama' => $c->namaAlumni,\n\t\t\t'alamat' => $c->alamat,\n\t\t\t'noHp' => $c->noHp,\n\t\t\t'id_pemesan' => $c->id_alumni\n\t\t\t);\t\n\t\t\t$this->M_transaksi->set_pengiriman($data,'pengiriman');\n\t\t$this->set_pembayaran($id);\n\t\t}\n\t}",
"public function empresa_apta(){\n\n\t\t$this->where('id',$this->user);\n\t\t//campos imprescindibles\n\t\t$campos = array('empresa','tipo_empresa','direccion','descripcion','empresa_telefono','img');\n\t\tif($salida = $this->getOne('perfiles_emp',$campos)){\n\t\t\tforeach ($salida as $key => $value) {\n\t\t\t\tif( (empty($value)) || ($value == '') ){\t\t\t\n\t\t\t\t\treturn false;\n\t\t}\t}\t}\n\t\t//si pasa del foreach es que no hay campos vacios\n\t\t$this->where('id',$this->user);\n\t\t$campos = array('apto' => 1);\n\t\t$this->update('perfiles_emp',$campos);\n\t}",
"function setSorpresa($_caja){\r\n $this->sorpresa=$_caja;\r\n }",
"protected function asignarCamposRelacionales() {\n foreach($this->campos as $nombre=>$campo) {\n if($campo->tipo!='relacional'||($campo->relacion!='1:1'&&$campo->relacion!='1:0')) continue;\n $columna=$campo->columna;\n if(is_object($this->consultaValores->$nombre)) {\n //Asignado como entidad u objeto anónimo\n $this->consultaValores->$columna=$this->consultaValores->$nombre->id;\n } elseif(is_array($this->consultaValores->$nombre)) {\n //Asignado como array\n $this->consultaValores->$columna=$this->consultaValores->$nombre['id'];\n }\n }\n }",
"public function setEditPersona($data){\r\n\t\t\tif(!empty($data['id'])){\r\n\t\t\t\t$query =\"UPDATE persona SET nombres='\".$data['nombres'].\"', apellidos='\".$data['apellidos'].\"', curp='\".$data['curp'].\"', tel='\".$data['tel'].\"', email='\".$data['email'].\"', pass='\".$data['pass'].\"', estado='\".$data['estado'].\"', ciudad='\".$data['ciudad'].\"' WHERE id=\".$data['id'];\r\n\t\t\t\t$result =mysqli_query($this->link,$query);\r\n\t\t\t\tif($result){\r\n\t\t\t\t\treturn true;\r\n\t\t\t\t}else{\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t\t}else{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}",
"function set_idioma($code = 'es')\n\t{\n\t\tif ($code != '' && $code != $this->config->item('language'))\n\t\t{\n\t\t\t$this->config->set_item('language', $code);//CAMBIO EL IDIOMA DEL CONFIG\n\t\t}\n\t\t$this->session->set_userdata('idioma',$code); //adicional por hector en 30/10/2013 para sol y luna\n\t\t$this->session->set_userdata('id_idioma',$this->idioma_model->get_id($code));//AGREGADO POR HECTOR\n\t}",
"public function edit(Luanchuyentaisans $luanchuyentaisans)\n {\n //\n }",
"public function editarpersonal($datos){\n $c= new conectar();\n $conexion=$c->conexion();\n\n $sql=\"UPDATE personal set nombres='$datos[0]',ape_pat='$datos[1]',ape_mat='$datos[2]',dni='$datos[3]',celular='$datos[4]',correo='$datos[5]'\n where id_personal=$datos[6]\";\n return $result=mysqli_query($conexion,$sql);\n\n }",
"public function set_nome($nome) : void\n {\n try {\n $this->obj_contato_anunciante->set_nome(Validador::Contato_Anunciante()::validar_nome($nome));\n } catch (Exception $e) {\n $this->erros[] = $e->getMessage();\n $this->campos['nome'] = \"erro\";\n }\n }",
"public function setNamaPelajaran($nama_pelajaran);",
"public function setAtributos($atributos)\n {\n $this->atributos = collect($atributos)->map(function ($item) {\n return [\"atributo_id\" => $item];\n });\n }",
"public function edit(Pelamar $pelamar)\n {\n //\n }",
"public function filterByApellidos($apellidos = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($apellidos)) {\n $comparison = Criteria::IN;\n }\n }\n\n return $this->addUsingAlias(ColaboradorTableMap::COL_APELLIDOS, $apellidos, $comparison);\n }",
"function setPorc_asistencia($porc_asistencia){\n\t\t\n\t\t$this->porc_asistencia = $porc_asistencia;\n\t\t$this->cambios = true;\n\t}",
"public function setIdempresa($idempresa){\n $this->idempresa = $idempresa;\n }",
"public function edit_ave_campania ($valores=NULL){\n return \"\n UPDATE ave_campania\n SET id_ave_campania_proc = -2\n WHERE id_ave_campania = $valores[0]\n ;\n \";\n }",
"public function __set($nome, $valor) {\n $this->nome = $valor;\n }",
"public function set_apelido(Apelido $object)\n {\n $this->apelido = $object;\n $this->apelido_id = $object->id;\n }",
"public function setVida($valor){\n $this->vida=$valor;\n }",
"function carregaValors($id,$autor){\t\r\n\t\t\t\t$this->set_aut_idautor($id);\r\n\t\t\t\t$this->set_aut_autor($autor);\r\n\t\t}",
"public function getNombreAndApellidoAttribute()\n {\n return $this->nombre . ' ' . $this->apellido;\n }",
"public function getNombreAndApellidoAttribute()\n {\n return $this->nombre . ' ' . $this->apellido;\n }",
"public function setArl_nombre($arl_nombre){\n $this->arl_nombre = $arl_nombre;\n }",
"public function getApellido2()\n {\n return $this->apellido2;\n }",
"function asignar_valores(){\n\t\t//$this->ciudad=$_SESSION['ciudad_admin'];\n\t\t$this->nombre=$_POST['nombre'];\n\t\t$this->apellido=$_POST['apellido'];\n\t\t$this->cantidad=$_POST['cantidad'];\n\t\t$this->cedula=$_POST['cedula'];\n\t\t$this->correo=$_POST['correo'];\n\t}",
"public function cariJenazah(): void\n {\n $result = Jenazah::where('nama', 'LIKE', \"%$this->namaJenazah%\")\n ->get(['id', 'nama', 'blok']);\n\n if (count($result) === 0) {\n $result = [[\n 'nama' => \"Nama jenazah tidak ditemukan.\",\n 'id' => null,\n 'blok' => null,\n ]];\n }\n\n $this->suggestion_name = $result;\n\n // ...\n }",
"public function setNota($nota){\n $this->nota = $nota;\n }",
"public function setArticulo($nombre, $codigo, $descripcion, $alto, $ancho, $largo, $diametro, $peso, $empaque, $categoria, $tipo) {\n\t\trequire_once 'phputils/mysqlConexion.php';\n\t\t/*$nombre = strtolower($nombre);\n\t\t$codigo = strtolower($codigo);\n\t\t$descripcion = strtolower($descripcion);*/\n\t\t\n\t\t$newArticulo = new Articulos;\n\t\t$newArticulo -> nombre = $nombre;\n\t\t$newArticulo -> codigo = $codigo;\n\t\t$newArticulo -> descripcion = $descripcion;\n\t\tif ($alto != null)\n\t\t\t$newArticulo -> alto = $alto;\n\t\tif ($ancho != null)\n\t\t\t$newArticulo -> ancho = $ancho;\n\t\tif ($largo != null)\n\t\t\t$newArticulo -> largo = $largo;\n\t\tif ($diametro != null)\n\t\t\t$newArticulo -> diametro = $diametro;\n\t\tif ($peso != null)\n\t\t\t$newArticulo -> peso = $peso;\n\t\tif ($empaque != null)\n\t\t\t$newArticulo -> empaque = $empaque;\n\t\t$today = time() - 18720; \n\t\t$mysqldate = date('Y-m-d h:i:s',$today);\n\t\t$newArticulo -> fechaingreso = $mysqldate;\n\t\t$newArticulo -> categoria = $categoria;\n\t\t$newArticulo -> tipo = $tipo;\n\n\t\ttry {\n\t\t\t$newArticulo -> save();\n\t\t\treturn $newArticulo -> id;\n\t\t} catch (Exception $e) {\n\t\t\treturn 'false';\n\t\t} \n\t\t\n\t}",
"public function setNome($nome){$this->nome = $nome;}",
"function asignar_valores2(){\n\t\t$this->nombre=$_POST['nombre'];\n\t\t$this->apellido=$_POST['apellido'];\n\t\t$this->telefono=$_POST['telefono'];\n\t\t$this->email=$_POST['email'];\n\t\t\n\t\t$this->marca=$_POST['marca'];\n\t\t$this->modelo=$_POST['modelo'];\n\t\t$this->ano=$_POST['ano'];\n\t\t$this->tipo=$_POST['tipo'];\n\t\t$this->descripcion=$_POST['descripcion'];\n\t}",
"public function setEdad($valor){\n\t\t\t$this->edad = $valor;\n\t\t}",
"public function setNome(string $nome)\n {\n $this->nome = $nome;\n }",
"public function setApellido2($apellido2)\n {\n $this->apellido2 = $apellido2;\n\n return $this;\n }",
"public function testSePuedeCrearYObtenerNombreYApellido()\n { \n $emp= $this->crear();\n $this->assertEquals(\"Ricardo Montaner\", $emp->getNombreApellido());\n }",
"public function setPaisAttribute($value)\n\t{\n\t\t$this->attributes['pais'] = mb_strtoupper($value);\n\t}",
"public function setNomeArea($nome) {\n $this->_nome = $nome; \n }",
"public function set($atributo, $valor) {\r\n\t\t\t $this->$atributo = $valor;\r\n\t\t}",
"public function editarAportante(){ \n if(isset($_POST[\"cedulaE\"]))\n {\n $aportante=new Aportante($this->adapter);\n $aportante->setAportanteID($_POST[\"idE\"]);\n $aportante->setCedula($_POST[\"cedulaE\"]);\n $aportante->setNames($_POST[\"namesE\"]);\n $aportante->setLastnames($_POST[\"lastnamesE\"]);\n $aportante->setPhoneHome($_POST[\"phoneHomeE\"]);\n\t\t\t$aportante->setPhoneMobile($_POST[\"phoneMobileE\"]);\n\t\t\t$aportante->setEmail($_POST[\"emailE\"]);\n $save=$aportante->update(); // Manda a actualizar la moto en el modelo\n } \n $this->redirect(\"BandejaCallcenters\", \"index\"); // COntrolador + Vista\n }",
"function berinamaTeman($teman){\r\n\t\t\t$this->nama_teman = $teman;\r\n\t\t}",
"public function setEditais($editais)\n {\n if (!is_null($editais))\n $this->editais = $editais;\n }",
"function set_llamado(){\n\n\t\tif($this->input->post()){\n\n\t\t\t//Obtener datos del cliente\n\n\t\t\t$cliente = applib::get_table_field(applib::$clientes_table,array('id' => $this->session->userdata('cliente_id')),'*');\n\n\t\t\t//Guardar llamado\n\n\t\t\tapplib::update(array('vendedor_id' => $cliente['vendedor_id']),applib::$orden_vendedor_table,array('status' => 1));\n\n\t\t\t//Guardar llamado a vendedor\n\n\t\t\tapplib::create(applib::$llamado_vendedor_table,array('vendedor_id' => $cliente['vendedor_id'],'tipo_llamado_id' => 2,'created_at' => applib::fecha(),'cliente_id' => $cliente['id']));\n\n\t\t\techo \"success\";\n\n\t\t}\n\t}",
"public function setNota($nota){\n\t\t$this->nota = $nota;\n\t}",
"private function camposObligatorios()\n {\n $this->setRequiredField(\"mascara\");\n $this->setRequiredField(\"etiqueta\");\n/*\n $this->setRequiredField(\"id_padre\");\n*/\n $this->setRequiredField(\"posicion\");\n $this->setRequiredField(\"visible\");\n $this->setRequiredField(\"nivel_acceso\");\n/*\n $this->setRequiredField(\"accion\");\n*/\n\n return;\n }",
"function setAukstis($x) {\n $this->aukstis = $x; // privaciai reiksmei priskiriam kintamaji, kuris bus kazkuom pakeistas\n }",
"function comprobar_apellidos()\n\t{\n\t$correcto = true; //variable booleana que comprueba si el atributo cuumple o no lo especificado\n\n\t//si los atributos estan vacios\n\tif (strlen($this->apellidos) == 0)\n\t{\n\t\tarray_push($this->erroresdatos, [\"nombreatributo\" => \"apellidos\", \"codigoincidencia\" => \"00001\" ,\"mensajeerror\" => \"apellidos vacio\"]);\n\n\t\t$correcto = false;\t\n\t}\n\n\t//si los atributos estan vacios\n\tif (strlen($this->apellidos) > 51)\n\t{\n\t\tarray_push($this->erroresdatos, [\"nombreatributo\" => \"apellidos\", \"codigoincidencia\" => \"00002\" ,\"mensajeerror\" => \"apellidos demasiado largo, maximo 10 caracteres\"]);\n\n\t\t$correcto = false;\t\t}\n\n\tif (strlen($this->apellidos) < 3)\n\t{\n\t\tarray_push($this->erroresdatos, [\"nombreatributo\" => \"apellidos\", \"codigoincidencia\" => \"00003\" ,\"mensajeerror\" => \"Valor de atributo no numérico demasiado corto\"]);\n\n\t\t$correcto = false;\n\t}\n\n\t//si los atributos son alfabeticos\n\tif (ctype_alpha($this->apellidos))\n\t{\n\t\tarray_push($this->erroresdatos, [\"nombreatributo\" => \"apellidos\", \"codigoincidencia\" => \"00003\" ,\"mensajeerror\" => \"apellidos no valido, solo se admiten caracteres\"]);\n\n\t\t$correcto = false;\t\n\t}\n\n\treturn $correcto;\n}",
"public function setIdusuario($value){\n $this->idusuario = $value;\n }",
"public function editar()\n {\n if (AuthHelper::obtenerUsuarixAdmin() == 2){\n\n $id = $_POST['pais'];\n $nombre = $_POST['name'];\n \n if (!empty($_POST['name'])) {\n \n //busco en la tabla de paises alguno que coincida con el nombre puesto por el usuario.\n $paisDb = $this->modelpaises->obtenerPais($nombre);\n //y si no se obtuvo un pais en la base de datos que coincida\n //con lo ingresado por el usuario ahi si lo agrego.\n if (empty($paisDb)) {\n \n $this->modelpaises->editar($id, $nombre);\n header(\"Location: \" . BASE_URL . 'home');\n } else\n $this->mostrarEditar($id, \"Ya existe un pais con ese nombre\");\n } else\n $this->mostrarEditar($id, \"Error,nombre vacio\");\n } else {\n $this->view->mostrarError(\"Acceso denegado\");\n }\n }",
"function setCausaleEvasione($codice)\n {\n $this->cauEvasione = $codice; \n }",
"public function salvar_meu_cadastro($dados,$password = true){\n\n #seta o endereço, se tiver sido preenchido\n if (_v($dados,\"bairro\") != \"\"){\n $end = [\"bairro\"=>$dados[\"bairro\"], \"cidade\"=>$dados[\"cidade\"], \"uf\"=>$dados[\"uf\"]];\n $CI =& get_instance();\n $CI->load->model('Endereco_model');\n $endereco = $CI->Endereco_model->getOrCreate($end);\n $dados[\"idbairro\"] = $endereco[\"idbairro\"];\n } else {\n $dados[\"idbairro\"] = null;\n }\n \n #transforma o nome dos campos que vem do formulário para o nome no db\n $fields = [\"id\",\"nome_completo\",\"nome_social\",\"email\",\"cpf\",\"tipoInscricao\",\n \"curriculo\",\"lattes\",\"telefone\",\"foto\",\n \"instituicao\"=>\"idinstituicao\",\n \"curso\"=>\"idcurso\",\"pago\",\"logradouro\",\"idnivelcurso\",\n \"cep\",\"numero\",\"idbairro\",\"outra_instituicao\"];\n\n $tratados = $this->replaceNames($dados,$fields);\n if (!isset($dados[\"id\"])){\n $tratados[\"id\"] = null;\n }\n \n\n #caso ele tenha marcado outra instituicao\n if (isset($tratados[\"idinstituicao\"])){\n if ($tratados[\"idinstituicao\"] == \"outra\"){\n $tratados[\"idinstituicao\"] = null;\n } else {\n $tratados[\"outra_instituicao\"] = null;\n }\n }\n\n if (_v($dados,\"password\") != \"\"){\n if (_v($dados,\"id\") == \"\" && !isset($dados[\"password\"])){\n $tratados[\"password\"] = sha1(\"12345678\");\n } else {\n $tratados[\"password\"] = sha1($dados[\"password\"]);\n\n #se eu estiver alterando a minha propria senha na area de perfil\n if (isset($_SESSION[\"user\"]) && _v($_SESSION[\"user\"],\"id\") == $dados[\"id\"]){\n $tratados[\"email_confirmado\"] = true;\n }\n }\n if ($password == false){\n $tratados[\"password\"] = null;\n }\n }\n\n #todo mundo terá pago por padrão\n $tratados['pago'] = true;\n\n #todo mundo é participante por padrão\n if (_v($dados,\"id\") == \"\"){\n $tratados['nivel'] = NIVEL_PARTICIPANTE;\n }\n \n \n return parent::salvar($tratados);\n }",
"function berinamateman ($teman) {\n $this->nama_teman=$teman;\n }",
"public function edit(peserta $peserta)\n {\n //\n }",
"public function editar()\n {\n //Pega o id a partir da URL\n $id = $this->uri->segment(3);\n\n //Se o id for nulo, redireciona para a página inicial\n if(is_null($id))\n redirect();\n\n //Utitiliza o método getById para obter as informações da empresa\n $resultado = $this->EmpresasModel->getById($id);\n\n $dados['empresaid'] = $resultado; \n\n //Carrega a tela passando os dados da consulta\n $this->load->view(\"Empresas/altera\", $dados);\n }",
"public function __set($atributo, $valor) {\n\t\t\t// $this->modelo = $valor;\n\t\t\t$this->$atributo = $valor;\n\t\t}",
"function editar_anuncio(Anuncio $anuncioEdita){\n global $mybd;\n\t\t$STH = $mybd->DBH->prepare(\"Update anuncio Set anu_titulo=:ti,anu_descricao=:de,anu_morada=:mo,anu_email=:em,anu_estado=:es,anu_telefone=:te,anu_codigopostal=:co,anu_wcprivativo=:wc,anu_mobilada=:mob,anu_utensilios=:ut,anu_despesas=:des,anu_animais=:ani,anu_latitude=:la,anu_longitude=:lo,anu_preco=:pre,anu_internet=:inte,anu_rapazes=:rap,anu_raparigas=:ra,anu_disponibilidade=:di Where anu_id=:an;\");\n if(!$STH->execute($anuncioEdita->to_array_com_id()))return false;\n return true;//\n }",
"public function setIdAuteur($idauteur){\n\t\t$idauteur = (int) $idauteur;\n\t\t// On vérifie ensuite si ce nombre est bien strictement positif.\n\t\tif ($idauteur > 0){\n\t\t\t// Si c'est le cas, c'est tout bon, on assigne la valeur à l'attribut correspondant.\n\t\t\t$this->_idauteur = $idauteur;\n\t\t}\n\t}",
"public function setSaldo($nuevo_saldo, $id_empresa){\n }",
"public function guardar($nombre,$apellido)\n\t\t{\n\t\t\t// o asi \n\t\t\t$this->nombres[] = $nombre;\n\t\t\t$this->apellidos[] = $apellido;\n\t\t}",
"public function setCampoLivre($campo_livre){\n if (strlen($campo_livre) > 128) {\n throw new \\UnexpectedValueException('O campo livre deve ter, no máximo, 128 caracteres');\n }\n\n $this->campo_livre = $campo_livre;\n }",
"public function setNombre($nombre){\n $this->nombre = $nombre;\n }",
"public function setNombre($nombre){\n $this->nombre = $nombre;\n }",
"public function edit(Peserta $peserta)\n {\n //\n \n }",
"public function setLenom(string $lenom):string\n {\n //checking the name for injection in db with strip_tags and trim\n $lenom = strip_tags(trim($lenom));\n // checking is empty\n if(empty($lenom)){\n trigger_error(\"The name can't be empty\",E_USER_NOTICE);\n //checking lenght name is not superieur for 45caratcters\n }else if (strlen($lenom) > 45){\n trigger_error(\"The lenght of your name cannot exceed 45 characters!!\",E_USER_NOTICE);\n }else{\n\n $this->lenom = $lenom;\n }\n }",
"public function setArticulo($articulo)\n {\n $this->articulo = $articulo;\n }",
"function anadirObligatorio($llave, $mensaje)\n {\n $this->_obligatorios[$llave] = $mensaje;\n return $this;\n }",
"public function edita()\n\t {\t\n\t\t$car=$_REQUEST['car'];\n\t\t$per=$_REQUEST['per'];\n\t\t$logi=$_REQUEST['logi'];\n\t\t$pas=$_REQUEST['pas'];\n\t\t$obs=$_REQUEST['obs'];\n\t\t$est=$_REQUEST['est'];\n\t\t\t//$usu=$_REQUEST['usu'];\n\t\t$user_data=array();\n\t\t$user_data['carnet']=$car;\n\t\t$user_data['login']=$logi;\n\t\t$user_data['password']=$pas;\n\t\t$user_data['estado']=$est;\n\t\t$user_data['observacion']=$obs;\n\t\t$user_data['perfil']=$per;\n\t\t\n\t\t//print_r($user_data);\n\t\t$usuario=new Usuarios;\n\t\t$usuario->edit($user_data);\n\t\t$data1=$usuario->lista();\n\t\t$this->principal();\n\t }",
"public function edit(DetalleCuentasArrendatario $detalleCuentasArrendatario)\n {\n //\n }",
"public function setId($valor){\n\t\t\t$this->id = $valor;\n\t\t}",
"public function setAlamatAttribute($alamat)\n {\n $this->attributes['alamat'] = trim(strtolower($alamat));\n }",
"function modificarAnuncio($titulo, $descripcion, $imagen, $id_poi, $id_usuario) {\n $sql = \"UPDATE anuncio SET titulo='\" . $titulo . \"',descripcion='\" . $descripcion . \"',imagen='\" . $imagen\n . \"' WHERE id_usuario='\" . $id_usuario . \"' AND id_poi='\" . $id_poi . \"'\";\n $con = new DB();\n $result = $con->exec($sql);\n $con = null;\n }",
"public function setResaca($resaca){\n $this->resaca=$resaca;\n }",
"public function setValorDiaria($valorDiaria)\n {\n $this->valorDiaria = $valorDiaria;\n\n \n\n }",
"function berinamateman($teman){\n\t\t$this->nama_teman=$teman;\n\t}"
] | [
"0.80841523",
"0.7665547",
"0.7481696",
"0.6967922",
"0.6933774",
"0.68358094",
"0.67287254",
"0.67003113",
"0.67003113",
"0.65600556",
"0.64195305",
"0.63769686",
"0.63769686",
"0.636552",
"0.62784386",
"0.6209964",
"0.6038242",
"0.5965853",
"0.5828855",
"0.5777017",
"0.5694798",
"0.5684976",
"0.55975896",
"0.5495163",
"0.5436607",
"0.5358895",
"0.5252466",
"0.5250051",
"0.52476233",
"0.52386916",
"0.52367646",
"0.51848257",
"0.51832473",
"0.5180325",
"0.5180004",
"0.5162419",
"0.51275665",
"0.51249075",
"0.5120067",
"0.51160324",
"0.5112216",
"0.5110712",
"0.51059866",
"0.51028186",
"0.5094964",
"0.5086762",
"0.50706166",
"0.5070199",
"0.5070199",
"0.50631887",
"0.5053961",
"0.50331414",
"0.5028704",
"0.50237083",
"0.50201726",
"0.50108576",
"0.49795103",
"0.4976436",
"0.49737632",
"0.49622226",
"0.49580717",
"0.49566174",
"0.4953826",
"0.4948863",
"0.49459398",
"0.49441963",
"0.4943532",
"0.49428472",
"0.49406123",
"0.4935858",
"0.49255258",
"0.4918836",
"0.4917166",
"0.49142617",
"0.49111426",
"0.49074677",
"0.49043462",
"0.4894277",
"0.48932773",
"0.48906818",
"0.4890242",
"0.48885468",
"0.48868197",
"0.4885888",
"0.4871835",
"0.48712966",
"0.48712966",
"0.48674697",
"0.4863764",
"0.48635992",
"0.48635757",
"0.48604646",
"0.4856339",
"0.48529872",
"0.4850178",
"0.48483616",
"0.48472112",
"0.48456702",
"0.48447683"
] | 0.6879716 | 6 |
Get the value of email | public function getEmail()
{
return $this->email;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getEmail() {\n return $this->getValue('email');\n }",
"function getEmail() {\n\t\treturn $this->getData('email');\n\t}",
"public function getEmail() {}",
"public function getEmail() {}",
"public function getEmail() {}",
"public function getEmail() {}",
"public function getEmail() {}",
"public function getEmail();",
"public function getEmail();",
"public function getEmail();",
"public function getEmail();",
"public function getEmail();",
"public function getEmail();",
"public function getEmail();",
"public function getEmail();",
"public function getEmail();",
"public function getEmail();",
"public function getEmail();",
"public function get_email() {\r\n return $this->email;\r\n }",
"public function getEmail()\n {\n return $this->getParam(self::EMAIL);\n }",
"public function getEmail()\r\n\t{\r\n\t\treturn $this['email'];\r\n\t}",
"public function getEmail()\n {\n return $this->get(self::EMAIL);\n }",
"public function get_email() \n {\n return $this->email;\n }",
"public function getEmail()\n {\n return $this->__get(\"email\");\n }",
"public function getEmail()\n {\n \treturn $this->email;\n }",
"public function getEmail() {\n\t\treturn $this->response['email'] ?: NULL;\n\t}",
"public function get_email()\n {\n return $this->_email;\n }",
"public function get_email()\n {\n return $this->_email;\n }",
"public function get_email()\n {\n return $this->_email;\n }",
"private function _extract_email()\r\n\t{\r\n\t\tif (! isset( $_SESSION['blesta_client_id'] ) ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\tLoader :: loadModels( $this, array( 'clients' ) );\r\n\t\t$client_id\t=\t$_SESSION['blesta_client_id'];\r\n\t\t\r\n\t\t$client\t=\t$this->Clients->get( $_SESSION['blesta_client_id'] );\r\n\t\t\r\n\t\tif (! isset( $client->email ) ) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\treturn $client->email;\r\n\t}",
"public function getEmail(){\n\t\treturn $this->email;\n\t}",
"public function getEmail(){\r\n\t\t\treturn $this->email;\r\n\t\t}",
"public static function getEmail(){\n if(Cache::isStored('website_email')) return Cache::get('website_email'); \n $row = getDatabase()->queryFirstRow(\"SELECT `value` FROM `settings` WHERE `setting` = 'website_email'\");\n $address = $row['value'];\n Cache::store('website_email', $address);\n return $address;\n }",
"public function getEmail():string\n {\n return $this->email;\n }",
"public function getEmail() {\n\t\treturn($this->email);\n\t}",
"public function getEmail() : string\r\n\t{\r\n\t\treturn $this->email;\r\n\t}",
"public function getEmail(): string\n {\n return $this->email;\n }",
"public function getEmail(): string\n {\n return $this->email;\n }",
"public function getEmail(): string\n {\n return $this->email;\n }",
"public function getEmail(): string\n {\n return $this->email;\n }",
"public function getEmail(): string\n\t{\n\t\treturn $this->email->getEmail();\n\t}",
"public function getEmail(){\n\t\t\treturn $this->email;\n\t\t}",
"public function getEmail() {\n return($this->email);\n }",
"public function getEmail()\r\n {\r\n return $this->email;\r\n }",
"public function getEmail()\r\n {\r\n return $this->email;\r\n }",
"public function getEmail()\n {\n return $this->getParameter('email');\n }",
"public function getEmail()\n {\n return $this->getParameter('email');\n }",
"public function getEmail()\n {\n return $this->getParameter('email');\n }",
"public function getEmail()\n {\n return $this->getParameter('email');\n }",
"public function getEmail()\n {\n return $this->getParameter('email');\n }",
"public function getEmail() {\r\n return $this->email;\r\n }",
"public function getEmail(): string {\n return $this->email;\n }",
"public static function getEmail()\n {\n return self::$email;\n }",
"public function getUserEmail () {\n\t\treturn ($this->userEmail);\n\t}",
"public function getEmailAddress()\n {\n return $this->_getVar('user_email');\n }",
"public function getEmail() : string {\n return $this->email;\n }",
"public function getEmail() { return $this->email; }",
"public function getEmail()\r\n {\r\n return $this->email;\r\n }",
"public function getEmail(): ?string\n {\n return $this->data->email;\n }",
"public function getEmail(){\n return $this->email;\n }",
"public function getEmail(){\n return $this->email;\n }",
"public function getEmail()\n {\n return $this->getAttribute('email');\n }",
"public function getMail();",
"function getEmail() {\n return $this->email;\n }",
"function getEmail() {\n return $this->email;\n }",
"public function getEmail() {\r\n return $this->email;\r\n }",
"public function getEmail()\n {\n if (array_key_exists(\"email\", $this->_propDict)) {\n return $this->_propDict[\"email\"];\n } else {\n return null;\n }\n }",
"public function getEmail()\n {\n return $this->get('Email');\n }",
"public function getEmail()\n\t{\n\t\treturn $this->email;\n\t}",
"public function getEmail()\n\t{\n\t\treturn $this->email;\n\t}",
"public function getEmail()\n\t{\n\t\treturn $this->email;\n\t}",
"public function getEmail()\n\t{\n\t\treturn $this->email;\n\t}",
"public function getEmail()\n\t{\n\t\treturn $this->email;\n\t}",
"public function getEmail()\n\t{\n\t\treturn $this->email;\n\t}",
"public function getEmail()\n {\n return $this->attributes['email'] ?? null;\n }",
"public function getEmail()\n {\n return $this->email;\n }",
"public function getEmail()\n {\n return $this->email;\n }",
"public function getEmail()\n {\n return $this->email;\n }",
"public function getEmail()\n {\n return $this->email;\n }",
"public function getEmail()\n {\n return $this->email;\n }",
"public function getEmail()\n {\n return $this->email;\n }",
"public function getEmail()\n {\n return $this->email;\n }",
"public function getEmail()\n {\n return $this->email;\n }",
"public function getEmail()\n {\n return $this->email;\n }",
"public function getEmail()\n {\n return $this->email;\n }",
"public function getEmail()\n {\n return $this->email;\n }",
"public function getEmail()\n {\n return $this->email;\n }",
"public function getEmail()\n {\n return $this->email;\n }",
"public function getEmail()\n {\n return $this->email;\n }",
"public function getEmail()\n {\n return $this->email;\n }",
"public function getEmail()\n {\n return $this->email;\n }",
"public function getEmail()\n {\n return $this->email;\n }",
"public function getEmail()\n {\n return $this->email;\n }",
"public function getEmail()\n {\n return $this->email;\n }",
"public function getEmail()\n {\n return $this->email;\n }",
"public function getEmail()\n {\n return $this->email;\n }",
"public function getEmail()\n {\n return $this->email;\n }",
"public function getEmail()\n {\n return $this->email;\n }",
"public function getEmail()\n {\n return $this->email;\n }",
"public function getEmail()\n {\n return $this->email;\n }",
"public function getEmail()\n {\n return $this->email;\n }"
] | [
"0.8002364",
"0.7952843",
"0.7890073",
"0.7890073",
"0.7890073",
"0.7888515",
"0.7888515",
"0.7846802",
"0.7846802",
"0.7846802",
"0.7846802",
"0.7846802",
"0.7846802",
"0.7846802",
"0.7846802",
"0.7846802",
"0.7846802",
"0.7846802",
"0.7819241",
"0.7816924",
"0.774737",
"0.77340025",
"0.77323246",
"0.77134895",
"0.7672438",
"0.76661175",
"0.76409215",
"0.76409215",
"0.76409215",
"0.76336527",
"0.76212835",
"0.7610483",
"0.76093084",
"0.75813216",
"0.7580942",
"0.75690013",
"0.75384265",
"0.75384265",
"0.75384265",
"0.75384265",
"0.7536169",
"0.7535064",
"0.7534046",
"0.75304127",
"0.75304127",
"0.7529553",
"0.7529553",
"0.7529553",
"0.7529553",
"0.7529553",
"0.7529509",
"0.7527274",
"0.7511017",
"0.7501595",
"0.7499948",
"0.7493577",
"0.7489446",
"0.7489255",
"0.7483856",
"0.74801385",
"0.74801385",
"0.747859",
"0.7477801",
"0.7476893",
"0.7476893",
"0.7472777",
"0.74461263",
"0.74437994",
"0.7441117",
"0.7441117",
"0.7441117",
"0.7441117",
"0.7441117",
"0.7441117",
"0.7435536",
"0.7433159",
"0.7433159",
"0.7433159",
"0.7433159",
"0.7433159",
"0.7433159",
"0.7433159",
"0.7433159",
"0.7433159",
"0.7433159",
"0.7433159",
"0.7433159",
"0.7433159",
"0.7433159",
"0.7433159",
"0.7433159",
"0.7433159",
"0.7433159",
"0.7433159",
"0.7433159",
"0.7433159",
"0.7433159",
"0.7433159",
"0.7433159",
"0.7433159",
"0.7433159"
] | 0.0 | -1 |
Set the value of email | public function setEmail($email)
{
$this->email = $email;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setEmail($value)\n {\n $this->_email = $value;\n }",
"public function setEmail($value) {\r\n $this->email = $value;\r\n }",
"public function setEmail($value) {\n if(!strstr($value, \"@\")){\n throw new Exception(\"Errore in setEmail\");\n }\n // se esiste\n\n $this->email = $value;\n\n //$this->generateUserId();\n }",
"public function setEmail($value) {\n\t\tif(!check($value)) throw new Exception(lang('error_9'));\n\t\tif(!Validator::AccountEmail($value)) throw new Exception(lang('error_9'));\n\t\t\n\t\t$this->_email = $value;\n\t}",
"private function setEmail()\n {\n\t if ( empty( $_POST['email'] ) ) {\n\t\t\t$this->data['error']['email'] = 'Please provide a valid email address.';\n $this->error = true;\n return;\n }\n \n $e = trim( $_POST['email'] );\n \n\t\tif ( ! filter_var( $e, FILTER_VALIDATE_EMAIL ) ) {\n\t\t\t$this->data['error']['email'] = 'Please provide a valid email address.';\n $this->error = true;\n return;\n\t\t}\n \n\t\t$this->data['email'] = $e;\n }",
"public function setEmail(?string $value): void {\n $this->getBackingStore()->set('email', $value);\n }",
"function setEmail($newEmail){\n $this->email = $newEmail;\n }",
"function setEmail( $email )\n {\n $this->setValueByFieldName( 'person_email', $email );\n return;\n }",
"public function setEmailAttribute($value)\n {\n if (!empty($value)) {\n $this->attributes['email'] = $this->mayaEncrypt($value);\n }\n }",
"public function changeEmail($newValue){\n\n $this->email = $newValue;\n $this ->save();\n\n }",
"public function setUserEmail($value)\n {\n return $this->set('UserEmail', $value);\n }",
"public function setUserEmail($value)\n {\n return $this->set('UserEmail', $value);\n }",
"public function setEmail($email){\n\t\t$this->email = $email;\n\t}",
"function setEmail($email) {\n\t\treturn $this->setData('email', $email);\n\t}",
"public function setEmail(string $email){\n $this->email = $email;\n }",
"private function _setEmail($input) {\n\t\tif(!Validator::Email($input)) throw new Exception(lang('error_9'));\n\t\t$this->_identifier = $input;\n\t}",
"public function setEmail($newEmail){\n\t}",
"public function set_email( $email ) {\n\t\treturn $this->set_field( 'EMAIL', $email );\n\t}",
"protected function setEmail(string $email)\r\n\t{\r\n\t\t$this->email = $email;\r\n\t}",
"public function setEmail($email){\n\t\t\t$this->email = $email;\n\t\t}",
"public function setEmail($value)\n {\n return $this->set('Email', $value);\n }",
"public function setEmail($value)\n {\n return $this->set('Email', $value);\n }",
"public function setEmail($value)\n {\n return $this->set('Email', $value);\n }",
"public function setEmail($value)\n {\n \t$this->email = $value;\n \treturn $this;\n }",
"public function setEmail($value)\n {\n return $this->set(self::EMAIL, $value);\n }",
"public function setEmail(string $email): void\n {\n $this->_email = $email;\n }",
"public function setEmail($email) {\n\t\t$this->_email = $email;\n\t}",
"public function setUserMail(?string $value): void {\n $this->getBackingStore()->set('userMail', $value);\n }",
"protected function setEmail(string $email) {\n $this->email = $email;\n }",
"public function setEmailAddress($email);",
"public function setEmail($email);",
"public function setEmail($email);",
"public function setEmail($email);",
"public function setGiftcardSenderEmail($value);",
"public static function setEmail($email)\n {\n self::$email = $email;\n }",
"public function setEmail($email)\n {\n $this->email = $this->db->real_escape_string( $email);\n\n }",
"public function setEmail(string $email): void\n {\n $this->email = $email;\n }",
"public function setEmail($email) {\n\t\t$this->email = $email;\n\t}",
"public function setEmail($email) {\n\t\t$this->email = $email;\n\t}",
"public function setEmail($email) {\n\t\t$this->email = $email;\n\t}",
"public function setEmail($email)\n\t{\n\t\t$this->email = $email;\n\t}",
"public function setEmail($email)\n\t{\n\t\t$this->email = $email;\n\t}",
"public function setEmail(string $email)\n {\n $this->email = $email;\n }",
"public function setEmail($email) {\n $this->user_email = $email;\n }",
"public function setEmail1($value)\n {\n return $this->set('Email1', $value);\n }",
"public function setEmail($email) {\n $this->set('email', $email, 'user');\n }",
"public function setEmailAttribute($value)\n {\n $this->attributes['email'] = mb_strtolower($value);\n }",
"public function setEmail(String $email)\n {\n $this->email = $email;\n }",
"function set_email($email) {\n if (is_string($email) == false)\n throw new Exception('type error!');\n\n $email = strtolower($email);\n $len = strlen($email);\n \n if ($len == 0)\n throw new Exception(\"email cannot be empty\");\n if (preg_match(\"/[^a-z_.0-9-@]+/\", $email))\n throw new Exception(\"email has some not allowed characters.\");\n if (!filter_var($email, FILTER_VALIDATE_EMAIL))\n throw new Exception(\"email is not valid\");\n if ($len > 30)\n throw new Exception(\"email cannot be more than 30 characters\");\n\n $this->email = $email;\n }",
"public function setEmail($email)\n {\n $this->email = $email;\n }",
"public function setEmail($email)\n {\n $this->email = $email;\n }",
"public function setEmail($email)\n {\n $this->email = $email;\n }",
"public function setEmail($email)\n {\n $this->email = $email;\n }",
"public function setEmail($email)\n {\n $this->email = $email;\n }",
"public function setEmail($email)\n {\n $this->email = $email;\n }",
"public function setEmail($email)\n {\n $this->email = $email;\n }",
"public function setEmail(string $email) {\n\n $this->email = $email;\n\n }",
"public function setEmailAttribute($value) {\n \t$this->attributes['email'] = strtolower($value);\n\t}",
"public function setEmail($strEmail) {\n\t\t$this->email = $strEmail;\n\t}",
"public function setEmail($email) {\n $this->email = $email;\n }",
"public function setEmail($email) {\n $this->email = $email;\n }",
"public function setEmail($email) {\n $this->email = $email;\n }",
"public function setEmail(?string $email): void;",
"public function setEmail(?string $email): void;",
"public function setEmail($val)\n {\n $this->_propDict[\"email\"] = $val;\n return $this;\n }",
"function _webform_edit_email_validate($element, &$form_state) {\r\n if ($form_state['values']['user_email']) {\r\n $form_state['values']['value'] = '%useremail';\r\n }\r\n}",
"public function set_email($email) : void\n {\n try {\n $this->obj_contato_anunciante->set_email(Validador::Contato_Anunciante()::validar_email($email));\n } catch (Exception $e) {\n $this->erros[] = $e->getMessage();\n $this->campos['email'] = \"erro\";\n }\n }",
"public function setEmail($email)\n {\n $this->session->set('email', $email);\n $this->session->set('crumb', md5($this->config->secrets->secret . time()));\n if($this->isOwner())\n $this->session->set('site', $_SERVER['HTTP_HOST']);\n }",
"public function set_email($email){\n if (\n !empty($email) &&\n \\Audit::instance()->email($email) == false\n ) {\n // no valid email address\n $this->throwValidationError('email');\n }\n return $email;\n }",
"public function setGiftcardRecipientEmail($value);",
"public function setEmail($email)\n\n{\n\n$this->email = $email;\n\n}",
"public function setEmail($mail);",
"public function setEmailAttribute($value)\n {\n $this->attributes['email'] = strtolower($value);\n }",
"public function setEmail($email) {\n $this->setUsername($email);\n $this->email = $email;\n }",
"public function setEmail($newEmail) {\n //first, trim the input of excess whitespace\n $newEmail = trim($newEmail);\n \n //second, sanitize the email of all invalid email characters\n $newEmail = filter_var($newEmail, FILTER_SANITIZE_EMAIL);\n \n //finally, bring the email out of quarantine\n $this->email = $newEmail;\n }",
"public function setEmail($email)\r\n {\r\n if(!$this->validate($email)){\r\n $this->message = \"Field is empty\";\r\n return false;\r\n }\r\n \r\n $this->email = $email;\r\n\r\n return true;\r\n }",
"public function setEmail($email)\n\t\t{\n\t\t$this->email = $email;\n\t\treturn true;\n\t\t}",
"public function userEmail($value = null)\n\t{\n\t\tif ($value != null)\n\t\t{\n\t\t\t$this->_userEmail = $value;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn $this->_userEmail;\n\t\t}\n\t}",
"public function setEmail(?CustomerTextFilter $email): void\n {\n $this->email = $email;\n }",
"function set_admin_email($email) {\n $this->admin_email = $email;\n }",
"public function setEmailAttribute(string $value): void\n {\n $this->attributes[self::EMAIL] = \\strtolower($value);\n }",
"public function setEmail($email) {\n $this->getlead()->setEmail($email);\n }",
"public function setUsernameToEmail()\n {\n $this->username = $this->email;\n $this->usernameCanonical = $this->emailCanonical;\n }",
"function changeemail($member,$oldemail,$newemail) {\n\t\n}",
"public function setMail($_mail)\n {\n $this->mail = $_mail;\n }",
"public function setADEmail($email)\n\t{\n\t\t$this->email = $email;\n\t}",
"public function setUserEmail($user) {\n\t\t$this->userEmail = $user;\n\t}",
"public function updateEmail($email)\n {\n $this->email = trim($email);\n $this->update();\n }",
"function email($email)\n {\n if (!is_valid_email($email))\n return false;\n\n if ($email != $this->email)\n $this->update['email'] = $email;\n\n $this->email = $email;\n\n return true;\n }",
"public function setEmail($value)\n {\n return $this->setParameter('email', $value);\n }",
"public function setEmail($value)\n {\n return $this->setParameter('email', $value);\n }",
"public function setEmail($value)\n {\n return $this->setParameter('email', $value);\n }",
"public function setEmail($value)\n {\n return $this->setParameter('email', $value);\n }",
"public function setEmail($value)\n {\n return $this->setParameter('email', $value);\n }",
"public function _setEmail($Email)\n {\n $this->Email = $Email;\n\n }",
"public function setEmail($email)\n {\n if (!filter_var($_POST['email'],FILTER_VALIDATE_EMAIL)) {\n $this->erreur[] = 'Mauvais format Email';\n }else{\n $this->email = htmlspecialchars($_POST['email']);\n return $this;\n }\n }",
"public function setEmail($anEmail) {\n\t\t$this->_email = $anEmail;\n\t}",
"public function setEmailToAddress($value) { $this->_emailToAddress = $value; }",
"protected static function _email(){\n if (self::$_ruleValue) {\n $str = filter_var(trim(self::$_elementValue), FILTER_VALIDATE_EMAIL);\n if (!$str) {\n self:: setErrorMessage(\"Enter valid email\");\n self::setInvalidFlag(true);\n } else {\n self::setInvalidFlag(false);\n }\n }\n }",
"public function change_email() {\n if($_SESSION['user']->set_email($this->email)) {\n return true;\n } else {\n // An error occured updating the email address, return false\n return false;\n }\n }",
"public function setEmail($email) {\n if (!filter_var($email, FILTER_VALIDATE_EMAIL)) {\n return false;\n }\n $this->email = $email;\n return true;\n }"
] | [
"0.8320114",
"0.8207443",
"0.81339836",
"0.80443805",
"0.7915434",
"0.78432465",
"0.78333914",
"0.7637634",
"0.7605696",
"0.756671",
"0.75154626",
"0.75154626",
"0.7496423",
"0.7487856",
"0.7484968",
"0.74780154",
"0.74690026",
"0.7465834",
"0.74249554",
"0.73958474",
"0.7376175",
"0.73746145",
"0.73746145",
"0.73733425",
"0.7350471",
"0.73355174",
"0.7335016",
"0.73184",
"0.7308534",
"0.7303374",
"0.72843206",
"0.72843206",
"0.72843206",
"0.7282046",
"0.72757095",
"0.7272034",
"0.72678685",
"0.7241061",
"0.7241061",
"0.7241061",
"0.7229155",
"0.7229155",
"0.7227465",
"0.7195372",
"0.7191777",
"0.71894056",
"0.71891856",
"0.71888304",
"0.71815145",
"0.7175152",
"0.7175152",
"0.7175152",
"0.7175152",
"0.7175152",
"0.7175152",
"0.7175152",
"0.716556",
"0.7160852",
"0.7160221",
"0.7152097",
"0.7152097",
"0.7152097",
"0.7128992",
"0.7128992",
"0.7121045",
"0.71195114",
"0.711073",
"0.70832497",
"0.70753133",
"0.7065379",
"0.7054867",
"0.7051952",
"0.70494074",
"0.7031222",
"0.7007698",
"0.70075375",
"0.69909424",
"0.6990149",
"0.6979738",
"0.6979417",
"0.6968789",
"0.6964078",
"0.69636315",
"0.6953141",
"0.6923221",
"0.6909192",
"0.688023",
"0.6869575",
"0.6860859",
"0.68381596",
"0.68381596",
"0.68381596",
"0.68381596",
"0.68381596",
"0.6832759",
"0.68308496",
"0.6829195",
"0.6819542",
"0.68109906",
"0.67864144",
"0.6784444"
] | 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 {\n // TODO: Check if has business\n return session()->has('id');\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 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 $user = User::find($this->id);\n\n if (!$user) {\n $user = User::where('no_ahli', $this->no_ahli)->first();\n }\n if ($user && $user->id == auth()->user()->id) return true;\n if (auth()->user()->is('admin')) return true;\n\n return false;\n }",
"public function authorize()\n {\n # if it's false, it will rejected\n return true;\n }",
"public function authorize()\n {\n $isValid = auth()->user()->is($this->route('task')->attempt->checklist->owner);\n\n return $isValid;\n }",
"public function authorize()\n {\n $user = Auth::user();\n\n return ($user->getRole() == 'admin');\n }",
"public function is_authorized() {\n\t\t$authorized = true;\n\t\tif ( $this->is_access_token_expired() ) {\n\t\t\t$authorized = false;\n\t\t}\n\n\t\treturn $authorized;\n\t}",
"public function authorize()\n {\n $user = User::findOrFail($this->route('id'));\n\n return $user->hasRole('admin') || $user->hasRole('teacher');\n }",
"public function authorize()\n {\n $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }",
"public function isAuthorized() {\n\t\treturn (bool)$this->_storage->hasData();\n\t}",
"public function authorize() : 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.83988106",
"0.8375419",
"0.8375419",
"0.83422995",
"0.8251736",
"0.82455397",
"0.82108665",
"0.8144899",
"0.8109159",
"0.8082",
"0.7990051",
"0.7987851",
"0.798199",
"0.7958163",
"0.7949029",
"0.7946942",
"0.79250675",
"0.7913215",
"0.78981346",
"0.78917295",
"0.78889436",
"0.78883326",
"0.78593844",
"0.783886",
"0.783886",
"0.7837413",
"0.7822166",
"0.78110564",
"0.78064126",
"0.77906877",
"0.7785905",
"0.7780735",
"0.77793187",
"0.7761016",
"0.77523595",
"0.77171916",
"0.77171916",
"0.77143407",
"0.7711753",
"0.7701846",
"0.7692613",
"0.7690749",
"0.7690104",
"0.7688827",
"0.7671174",
"0.76656014",
"0.76646394",
"0.7654714",
"0.76486903",
"0.76410675",
"0.76410496",
"0.76400185",
"0.763243",
"0.7628761",
"0.7626861",
"0.76255405",
"0.76200867",
"0.76200867",
"0.76113725",
"0.7602363",
"0.7601313",
"0.7600614",
"0.7600614",
"0.75994784",
"0.7597175",
"0.7593741",
"0.758599",
"0.7584371",
"0.75786763",
"0.7560661",
"0.7551552",
"0.75501144",
"0.7550086",
"0.7541874",
"0.75402915",
"0.75372165",
"0.7536008",
"0.7527105",
"0.7515016",
"0.7511648",
"0.7498465",
"0.7495165",
"0.74936795",
"0.74896306",
"0.7486042",
"0.7484901",
"0.7479097",
"0.74750495",
"0.7470983",
"0.7470015",
"0.7463743",
"0.7463166",
"0.7461619",
"0.7460629",
"0.74603736",
"0.74478126",
"0.74382544",
"0.7435131",
"0.7432152",
"0.7430674",
"0.74216324"
] | 0.0 | -1 |
Get the validation rules that apply to the request. | public function rules()
{
$rules = [
'name' => 'required|unique:brands|max:191'
];
if($this->getMethod() == 'PUT' || $this->getMethod() == 'PATCH') $rules['name'] .= ',id, ' . $this->request->get("id");
return $rules;
} | {
"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 }",
"public function rules()\n {\n $data = $this->request->all();\n $rules['username'] = 'required|email';\n $rules['password'] = 'required'; \n\n return $rules;\n }",
"protected function getValidationRules()\n {\n $class = $this->model;\n\n return $class::$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 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 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 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 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 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 $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 }",
"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 }",
"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\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 {\n switch ($this->method()) {\n case 'POST':\n return $this->getPostRules();\n case 'PUT':\n return $this->getPutRules();\n }\n }",
"public function rules()\n\t{\n\t\treturn ModelHelper::getRules($this);\n\t}",
"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 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 getValidationRules() : array;",
"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 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 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 {\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 }",
"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 }",
"protected function get_validation_rules()\n {\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 rules(Request $request)\n {\n return Qc::$rules;\n }",
"public function defineValidationRules()\n {\n return [];\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.8343821",
"0.8013592",
"0.7936293",
"0.79256666",
"0.7923988",
"0.7904124",
"0.7859339",
"0.7789916",
"0.7783626",
"0.7764009",
"0.77377397",
"0.7732641",
"0.7710237",
"0.7692145",
"0.7685806",
"0.7682352",
"0.7682352",
"0.7682352",
"0.7682352",
"0.7682352",
"0.7682352",
"0.76764345",
"0.76736814",
"0.76648664",
"0.76589006",
"0.7642358",
"0.7630315",
"0.76299596",
"0.7618019",
"0.7609191",
"0.7608528",
"0.7602886",
"0.7599232",
"0.7598731",
"0.759276",
"0.7589901",
"0.7587388",
"0.7580103",
"0.7555663",
"0.755539",
"0.7550758",
"0.75460374",
"0.75400335",
"0.7537494",
"0.7536634",
"0.7530304",
"0.751899",
"0.75147283",
"0.7507793",
"0.75060636",
"0.75058895",
"0.749851",
"0.74955255",
"0.7495497",
"0.7493491",
"0.7490783",
"0.74902636",
"0.74900305",
"0.7487785",
"0.7485355",
"0.74800664",
"0.7479263",
"0.74697244",
"0.7464123",
"0.74631083",
"0.7461849",
"0.74595183",
"0.7455498",
"0.74541795",
"0.7453817",
"0.74505293",
"0.74489987",
"0.74412817",
"0.7441232",
"0.74353904",
"0.7435348",
"0.74327135",
"0.7429806",
"0.74293125",
"0.7424185",
"0.7420515",
"0.741543",
"0.7414524",
"0.7413734",
"0.74124366",
"0.7410401",
"0.74060625",
"0.7404286",
"0.740283",
"0.7401983",
"0.7390648",
"0.73845214",
"0.7373376",
"0.7371277",
"0.7369807",
"0.7361433",
"0.7356357",
"0.73448884",
"0.7344577",
"0.7343399",
"0.7335577"
] | 0.0 | -1 |
Return a speech response of either plaintext or SSML type | public function say($text, $type = self::TYPE_PLAINTTEXT)
{
return $this->respond(self::RESPONSE_TYPE_OUTPUT_SPEECH, $this->getSpeechResponse($text, $type));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getSpeechResponse($text, $type)\n\t{\n\t\t$response = [\n\t\t\t'type' => $type,\n\t\t\t'text' => $text,\n\t\t];\n\n\t\tif ($type === self::TYPE_SSML) {\n\t\t\t$response['ssml'] = $response['text'];\n\n\t\t\tunset($response['text']);\n\t\t}\n\n\t\treturn $response;\n\t}",
"public function textToSpeech($message);",
"public function convertSpeechToText(string $text);",
"public function getEquipSynthesisReply()\n {\n return $this->get(self::_EQUIP_SYNTHESIS_REPLY);\n }",
"public function textToSpeech(string $text): string\n {\n return $this->sendRequest(\"https://code.responsivevoice.org/getvoice.php\", [\n \"tl\" => $this->language,\n \"t\" => $text,\n ]);\n }",
"public function read($text)\n {\n $initializeOptions = $this->getOptions()->getInitializeOptions();\n $pollyClient = new PollyClient([\n 'version' => $initializeOptions->getVersion(),\n 'region' => $initializeOptions->getRegion(),\n 'credentials' => [\n 'key' => $initializeOptions->getCredentials()->getKey(),\n 'secret' => $initializeOptions->getCredentials()->getSecret()\n ]\n ]);\n\n $synthesizeOptions = [\n 'OutputFormat' => $this->getOptions()->getOutputFormat(),\n 'Text' => $text,\n 'TextType' => $this->getOptions()->getTextType(),\n 'VoiceId' => $this->getOptions()->getVoiceId(),\n 'VoiceLanguageCode' => $this->getOptions()->getLanguage(),\n 'SampleRate' => $this->getOptions()->getSampleRate(),\n 'Engine' => $this->getOptions()->getEngine(),\n ];\n if (!empty($this->getOptions()->getLexiconNames())) {\n $synthesizeOptions['LexiconNames'] = $this->getOptions()->getLexiconNames();\n }\n\n $awsResult = $pollyClient->synthesizeSpeech($synthesizeOptions);\n $this->setHeaders($awsResult->get('@metadata'));\n $stream = $awsResult->get('AudioStream');\n return $stream->getContents();\n }",
"public function getSpeechLanguage()\n {\n \treturn Tools::getSpeechLanguage($this->language_flag)['short'];\n }",
"public function sentence()\n {\n $sentence = $this->randomizer->getSentences(1);\n\n return $this->apiResponse($sentence[0]);\n }",
"public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n global $textTpl;\n if (!empty($postStr))\n {\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $type = $postObj->MsgType;\n\n switch ($type)\n {\n case \"event\":\n $resultStr = GetEventMessage($postObj);\n break;\n case \"location\":\n $resultStr = GetLocationMessage($postObj);\n break;\n case \"text\":\n $resultStr = GetTextMessage($postObj);\n break;\n default:\n $resultStr = GetTextMessage($postObj);\n //$resultStr = GetDefaultMessage($postObj);\n break;\n }\n\n RecordInputContent($postObj); //保存用户输入的所有内容\n RefleshUserLoginTime($postObj); // 更新用户登录的最新时间\n\n echo $resultStr;\n }\n else\n {\n echo \"\";\n exit;\n }\n }",
"public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n //extract post data\n if (!empty($postStr)){\n \n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $RX_TYPE = trim($postObj->MsgType);\n\n switch($RX_TYPE)\n {\n case \"text\":\n $resultStr = $this->handleText($postObj);\n break;\n case \"event\":\n $resultStr = $this->handleEvent($postObj);\n break;\n default:\n $resultStr = \"Unknow msg type: \".$RX_TYPE;\n break;\n }\n echo $resultStr;\n }else {\n echo \"\";\n exit;\n }\n }",
"public function speak(){\n switch (strtolower($this->type)){\n case Animal::TYPE_DOG:\n return 'Wooof';\n break;\n\n case Animal::TYPE_CAT:\n return 'Miaouu';\n break;\n \n case Animal::TYPE_BIRD:\n echo 'cui-cui';\n break;\n \n case Animal::TYPE_FISH:\n return 'blub';\n break;\n\n case Animal::TYPE_FERRET:\n return 'Les furets.com';\n break;\n \n default:\n return 'Pfffft';\n break;\n }\n }",
"public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n //extract post data\n if (!empty($postStr)){\n \n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $RX_TYPE = trim($postObj->MsgType);\n\n switch($RX_TYPE)\n {\n case \"text\":\n $resultStr = $this->handleText($postObj);\n break;\n case \"event\":\n $resultStr = $this->handleEvent($postObj);\n break;\n default:\n $resultStr = \"Unknow msg type: \".$RX_TYPE;\n break;\n }\n echo $resultStr;\n }else {\n echo \"\";\n exit;\n }\n }",
"public function sounds_lossless()\n\t{\n\t\tif (preg_match('/^http:\\/\\/dream-of-usenet\\.org .+? - \\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//Rush - Sector One 24-96 (000/229] - \".nzb\" yEnc\n\t\t//Stevie Ray Vaughan - Couldn't Stand the Weather (01/19] - \".sfv\" yEnc\n\t\tif (preg_match('/^([a-zA-Z0-9]+.+? - .+?)\\s+\\(\\d+\\/\\d+\\] - \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //trtk07073 - [18/26] - \"1990 Santana - Spirits Dancing In The Flesh (flac).part17.rar\" yEnc\n\t\tif (preg_match('/^trtk\\d+ - \\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //COMPLETE REPOST Magma - NMR - 1974 - Wurdah Itah [01 of 23] \"1974 - Wurdah Itah.par2\" yEnc\n\t\tif (preg_match('/^COMPLETE REPOST (.+? - )NMR -( \\d{4}) - (.+?) \\[\\d+ of \\d+\\] \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1] . $match[3] . \"(\" . $match[2] . \")\";\n\t\t} //Sensation - VA - Source Of Light (2CD 2012) [02 of 67] - \"00 - Sensation - VA - Source Of Light (2CD 2012) [nmr].txt\" yEnc\n\t\tif (preg_match('/^([A-Z0-9].+? - VA - .+?) \\[\\d+ of \\d+\\] - \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//Ryan McGarvey - Forward In Reverse [01/21] - \"00 - Ryan Mcgarvey - Forward in Reverse.nfo\" yEnc\n\t\t//JFC - The Timerewinder (NMR) [01/15] - \"00 - The Timerewinder.nfo\" yEnc\n\t\t//The Brothers Johnson - 1981 - Winners (2011 expanded remastered) [01/31] - \"01 - The Real Thing.flac\" yEnc\n\t\t//Jermaine Jackson - 1980 - Let's Get Serious [00/23] - \"Jermaine Jackson - 1980 - Let's Get Serious.nzb\" yEnc\n\t\tif (preg_match('/^([A-Z0-9][A-Za-z0-9 ]{2,} -( \\d{4} -)? [A-Z0-9].+?( \\(.+?\\))?) \\[\\d+\\/\\d+\\] - \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//Miles Davis - In A Silent Way (1969) [2013 - HDTracks 24-176,4] - \"iasw24-176.par2\" yEnc\n\t\t//Bob James & David Sanborn - Quartette Humaine (2013) [HDTracks 24-88,2] - \"qh24-88.par2\" yEnc\n\t\tif (preg_match('/^([A-Z0-9].+? - [A-Z0-9].+? \\(\\d{4}\\) \\[.*?HDTracks.+?\\]) - \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//Sonny Landreth - 2010 - Mississippi Blues - 04 of 29 - 00 - Mississippi Blues.sfv yEnc\n\t\t//Fruteland Jackson - 1996 - ... Is All I Crave - 08 of 20 - 00 - Fruteland Jackson - ... Is All I Crave.log yEnc\n\t\tif (preg_match('/^([A-Z0-9].+? - \\d{4} - .+?) - \\d+ of \\d+ - \\d+ - .+? yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(VA - Cafe Del Mar Dreams 5-2012-Samfie Man) [37/38] - \"VA - Cafe Del Mar Dreams 5-2012-Samfie Man.vol063+040.par2\" yEnc\n\t\tif (preg_match('/^\\((VA - .+?)\\) \\[\\d+\\/\\d+\\] - \".+?\" yEnc$/', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //(152092XA20) [08/16] - \"Guns and Roses - Use Your Illusion I - 08-Back Off Bitch.flac\" yEnc\n\t\tif (preg_match('/^\\([A-Z0-9]+\\) \\[\\d+\\/\\d+\\] - \"(.+?) - \\d+-.+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Eros_Ramazzotti-Eros-IT-CD-FLAC-1997-FADA[04/26] - \"00-eros_ramazzotti-eros-1997-fada.sfv\" yEnc\n\t\tif (preg_match('/^([\\w-]{5,})\\[\\d+\\/\\d+\\] - \".+?\" yEnc$/', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//.: VA-Liquid_Music-The_Future_House_Compilation-CD-FLAC-1993-WRS :. - .:www.thunder-news.org:. - .:sponsored by secretusenet.com:. - \"00-va-liquid_music-the_future_house_compilation-cd-flac-1993-wrs.nfo\" yEnc\n\t\t//.:Bruce_BecVar-Arriba-CD-FLAC-1993-JLM:. - .:thunder-news.org:. - .:sponsored by secretusenet.com:. - \"00-bruce_becvar-arriba-cd-flac-1993.m3u\" yEnc\n\t\tif (preg_match('/^.:[-_\\s]{0,3}(.+?)[-_\\s]{0,3}:..+?thunder-news\\.org.+?secretusenet\\.com:. - \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //_ \"CARUSO & GIGLI - O Sole Mio - The Unknown.nzb\" yEnc\n\t\tif (preg_match('/^[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//\"Art Tatum - The Complete Trio Sessions with Tiny Grimes & Slam Stewart - Vol 1.NFO\" - 1 of 6 (1/1)\n\t\t//\"Galen Jeter and the Dallas Jazz Orchestra - Thank You, Leon.NFO\" - 1 of 5 (1/1) (1/1)\n\t\tif (preg_match('/^[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t '[-_\\s]{0,3}\\d+ (of \\d+)( \\(\\d+\\/\\d+\\)){1,2} (yEnc)?$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //\"Doc Watson - 1973 - The Essential Doc Watson - 01 - Tom Dooley.flac\" - 406.64 MB - yEnc\n\t\tif (preg_match('/^[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t '[ _-]{0,3}\\d+[.,]\\d+ [kKmMgG][bB][ _-]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}",
"public function getSay()\n {\n return $this->get(self::_SAY);\n }",
"public function respond_simpleMessage($textToSpeak, $stringToDisplay = '') {\n\t \n\t // Prevent duplicate responses\n\t if ($this->hasResponded) return;\n\t $this->hasResponded = true;\n\t \n // If this hasn't been defined, set it to the same text as the speech (accessibility)\n if ($stringToDisplay == '') {\n $stringToDisplay = $textToSpeak;\n }\n header(\"Content-type:application/json\");\n\t\treturn json_encode(array(\n\t\t\t\"speech\" => $textToSpeak,\n\t\t\t\"displayText\" => $stringToDisplay,\n\t\t));\n }",
"function synthesizeWindows($voice, $text, $filename)\n {\n $error = false;\n $errormessage = null;\n $errorcode = 0;\n $output = array();\n \n $chosenVoice = null;\n $msVoice = null;\n $isSAPIVoice = false; \n \n // error de Microsoft Speech Platform\n $errorMSP = false;\n $errorMSPtmp = null;\n\n try {\n // Recollim els objectes de les llibreries Speech de Microsoft que necessitem\n $msVoice = new COM('Speech.SpVoice');\n\n $numvoices = $msVoice->GetVoices()->Count;\n\n // per cada veu miram si la descripció coincideix amb el nom de la veu\n // seleccionada per l'usuari\n for ($i=0; $i<$numvoices; $i++) {\n if ($voice == $msVoice->GetVoices()->Item($i)->GetDescription) {\n $chosenVoice = $msVoice->GetVoices()->Item($i);\n $isSAPIVoice = false;\n }\n }\n \n } catch (Exception $ex) {\n $errorMSP = true;\n $errorMSPtmp = \"Error. Unable to access Microsoft Speech Platform.\";\n }\n\n // error de SAPI\n $errorSAPI = false;\n $errorSAPItmp = null;\n\n try {\n // Recollim els objectes de les llibreries SAPI que necessitem\n $msVoice = new COM('SAPI.SpVoice');\n\n $numvoicesSAPI = $msVoice->GetVoices()->Count;\n\n // per cada veu miram si la descripció coincideix amb el nom de la veu\n // seleccionada per l'usuari\n for ($i=0; $i<$numvoicesSAPI; $i++) {\n if ($voice == $msVoice->GetVoices()->Item($i)->GetDescription) {\n $chosenVoice = $msVoice->GetVoices()->Item($i);\n $isSAPIVoice = true;\n }\n }\n \n } catch (Exception $ex) {\n $errorSAPI = true;\n $errorSAPItmp = \"Error. Unable to access SAPI voices.\";\n }\n\n if ($errorMSP && $errorSAPI) {\n $error = true;\n $errormessage = \"Error. Unable to access your selected Windows voice due to unkown circumstances. \"\n . \"Try changing your voices in your user configuration settings. \"\n . \"Otherwise, your Windows may not be compatible with MSP or SAPI.\";\n $errorcode = 111;\n }\n // si no hi ha hagut cap error, procedim a generar l'audio\n else {\n\n try {\n\n $msFileStream = null;\n $msAudioFormat = null;\n \n if (!$isSAPIVoice) {\n $msFileStream = new COM('Speech.SpFileStream');\n $msAudioFormat = new COM('Speech.SpAudioFormat');\n }\n else {\n $msFileStream = new COM('SAPI.SpFileStream');\n $msAudioFormat = new COM('SAPI.SpAudioFormat');\n }\n\n // Path al fitxer on guardarem les veus\n $wavfile = \"C:\\\\xampp\\htdocs\\mp3\\\\\".$filename.\".mp3\";\n \n // hem de triar la veu que vol l'usuari (trobada anteriorment)\n $msVoice->Voice = $chosenVoice;\n\n // passem la frase d'utf-8 a format de Windows perquè llegeixi bé\n // tots els caràcters\n $fraseconvertida = iconv(\"utf-8\", \"Windows-1252\", $text);\n\n // guardarem el fitxer amb la menor qualitat possible, format 4\n $msAudioFormat->Type = 4;\n $msFileStream->Format = $msAudioFormat;\n\n // obrim el fitxer on escriurem l'àudio en format CreateWrite\n $msFileStream->Open($wavfile, 3, 0);\n $msVoice->AudioOutputStream = $msFileStream;\n \n // es diu la frase de manera asíncrona\n $msVoice->Speak($fraseconvertida, 1);\n // esperem a que acabi, ja que si no talla la frase\n $msVoice->WaitUntilDone(-1);\n\n // tanquem el fitxer i alliberem la memòria dels objectes\n $msFileStream->Close();\n $msAudioFormat = null;\n $msFileStream = null;\n $msVoice = null;\n\n } catch (Exception $e) {\n $error = true;\n $errormessage = \"Error. An error occurred while writing your Windows audio file.\";\n $errorcode = 112;\n }\n }\n \n $output[0] = $error;\n $output[1] = $errormessage;\n $output[2] = $errorcode;\n return $output;\n }",
"public function getSpe()\n {\n return $this->spe;\n }",
"function getAnswerText(){\r\n\t\tif($this->inDB==false||$this->answer==null){\r\n\t\t\t$type = $this->dbq->getAnswerType($this->answer_id);\r\n\t\t\tif($type==3 || $type==7 || $type==8){\r\n\t\t\t\t$io = new FileIOHandler();\r\n\t\t\t\t$this->answer=$io->MediaRead($type,$this->answer_id);\r\n\t\t\t}else{\r\n\t\t\t\t$temp = $this->dbq->getAnswer($this->answer_id);\r\n\t\t\t\t$num=mysql_numrows($temp);\r\n\t\t\t\t\tif($num==1){\r\n\t\t\t\t\t\tif($type==1){\r\n\t\t\t\t\t\t\t$this->answer=mysql_result($temp,0,\"text\");\r\n\t\t\t\t\t\t}elseif($type== 2 || $type==4 || $type==5 || $type==9){\r\n\t\t\t\t\t\t\t$this->answer=mysql_result($temp,0,\"num\");\t\t\t\t\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\treturn $this->answer;\t\t\r\n\t}",
"public function build_audioResponse($url, $displayText) {\n\t \n\t // Loop through the URLs if they are an array and build the ssml as necessary\n\t $ssml = ' <speak> ';\n\t if ( is_array($url) ) {\n\t\t foreach($url as $u) {\n\t\t\t $ssml .= \"<audio src = '\" . $u . \"' /> \";\n\t\t }\n\t }\n\t else {\n\t\t $ssml .= \"<audio src = '\" . $url . \"' /> \";\n\t }\n\t $ssml .= '</speak>';\n\t \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 }",
"function response()\n{\n //$data = $GLOBALS['HTTP_RAW_POST_DATA'];\n $data = file_get_contents('php://input');\n $client = simplexml_load_string($data);\n\n if (strtolower($client->MsgType) == \"event\") {\n if ($client->Event == 'subscribe') {\n $toUserName = $client->FromUserName;\n $FromUserName = $client->ToUserName;\n $time = time();\n $msgType = 'text';\n $content = \"hello world\";\n $tpl = \" <xml>\n <ToUserName><![CDATA[%s]]></ToUserName>\n <FromUserName><![CDATA[%s]]></FromUserName>\n <CreateTime>%s</CreateTime>\n <MsgType><![CDATA[%s]]></MsgType>\n <Content><![CDATA[%s]]></Content>\n </xml>\";\n $info = sprintf($tpl,$toUserName,$FromUserName,$time,$msgType,$content);\n echo $info;\n }\n\n\n }else{\n if(strtolower($client->MsgType) == 'text'){\n $request = $client->Content;\n $flag = fliter($request);\n switch($flag){\n case 'cet4':\n $msg = cet4($request);\n break;\n case 'matrix':\n $msg = matrixCaculator($request);\n break;\n case 'default':\n $msg = $request;\n break;\n default:\n $msg = $request;\n }\n responseText($client,$msg);\n }\n }\n}",
"static public function parse_plain_response($s)\n {\n parse_str($s, $a);\n return $a;\n }",
"public function TextResponse ($output = '', $terminate = TRUE) {\n\t\t$res = $this->response;\n\t\tif (!$res->HasHeader('Content-Type'))\n\t\t\t$res->SetHeader('Content-Type', 'text/plain');\n\t\t$res->SetBody($output);\n\t\tif ($res->GetCode() === NULL)\n\t\t\t$res->SetCode(\\MvcCore\\IResponse::OK);\n\t\tif ($terminate) $this->Terminate();\n\t}",
"public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n //extract post data\n if (!empty($postStr)) {\n\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $keyword = trim($postObj->Content);\n $time = time();\n $textTpl = \"<xml>\n\t\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n\t\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n\t\t\t\t\t\t\t<CreateTime>%s</CreateTime>\n\t\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\n\t\t\t\t\t\t\t<Content><![CDATA[%s]]></Content>\n\t\t\t\t\t\t\t<FuncFlag>0</FuncFlag>\n\t\t\t\t\t\t\t</xml>\";\n if (!empty($keyword)) {\n $msgType = \"text\";\n $contentStr = \"Welcome to wechat world!\";\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n } else {\n echo \"Input something...\";\n }\n\n } else {\n echo \"\";\n exit;\n }\n }",
"function synthesizeAudio($md5, $text, $voice, $type, $language, $rate)\n { \n \t\n // DEBUG\n \t// echo \"T: \".$text.\"; V: \".$voice.\"; Ty: \".$type.\"; L: \".$language;\n \t\n $CI = &get_instance();\n $CI->load->model('Audio_model');\n \n $output = array();\n $error = false;\n $errormessage = null;\n $errorcode = 0;\n $filename = null;\n $extension = \"mp3\";\n \n // if it's an online voice\n if ($type == \"online\") {\n \n // default voice ES masc (Jorge)\n $vocalwareLID = 2;\n $vocalwareVID = 6;\n \n // if it's a default interface voice\n if (preg_match(\"/DEFAULT \\(/i\", $voice)) {\n $isfem = true;\n if (preg_match(\"/DEFAULT \\(masc\\)/i\", $voice)) $isfem = false;\n \n // get default values for the interface voice in each language\n switch ($language) {\n \n // CA\n case 1:\n $vocalwareLID = 5;\n if ($isfem) $vocalwareVID = 1;\n else $vocalwareVID = 2;\n break;\n \n // ES\n case 2:\n $vocalwareLID = 2;\n if ($isfem) $vocalwareVID = 1;\n else $vocalwareVID = 6;\n break;\n \n // EN\n case 3:\n $vocalwareLID = 1;\n if ($isfem) $vocalwareVID = 1;\n else $vocalwareVID = 2;\n break;\n \n default:\n $error = true;\n $errormessage = \"Error. Default voice not found for this language.\";\n $errorcode = 106;\n break;\n } \n }\n // the voice is the id of the voice in the database\n else {\n // we get the info of the voice from the database\n $auxrow = $CI->Audio_model->getOnlineVoices((int) $voice);\n $voiceinfo = $auxrow[0];\n \n $vocalwareLID = $voiceinfo->vocalwareIdLang;\n $vocalwareVID = $voiceinfo->vocalwareVoiceId;\n }\n \n if (!$error) {\n $auxresponse = $this->synthesizeOnline($vocalwareLID, $vocalwareVID, $text, $md5);\n // if there was an error\n if ($auxresponse[0]) {\n $error = true;\n $errormessage = $auxresponse[1];\n $errorcode = $auxresponse[2];\n }\n }\n \n }\n // si la veu és offline\n else {\n $user_agent = $this->getOS();\n \n switch ($user_agent) {\n case \"Mac OS X\":\n $extension = \"m4a\";\n \n $auxresponse = $this->synthesizeMacOSX($voice, $text, $md5, $rate);\n // if there was an error\n if ($auxresponse[0]) {\n $error = true;\n $errormessage = $auxresponse[1];\n $errorcode = $auxresponse[2];\n }\n\n break;\n \n case \"Windows\":\n \n $auxresponse = $this->synthesizeWindows($voice, $text, $md5);\n // if there was an error\n if ($auxresponse[0]) {\n $error = true;\n $errormessage = $auxresponse[1];\n $errorcode = $auxresponse[2];\n }\n \n break;\n\n default:\n $error = true;\n $errormessage = \"Error. Your OS is not compatible with offline voices. \"\n . \"Change your voices in your user configuration settings.\";\n $errorcode = 107;\n break;\n }\n }\n \n if (!$error) {\n $filename = $md5.\".\".$extension;\n $CI->Audio_model->saveAudioFileToDatabase($text, $md5, $filename);\n }\n \n $output[0] = $filename;\n $output[1] = $error;\n $output[2] = $errormessage;\n $output[3] = $errorcode;\n \n return $output;\n }",
"function textus_get_text($id, $type) {\n $request = new get_text_controller();\n $text = $request->ol_get_text($id, $type);\n\n if ($text['error']) {\n return $text['error'];\n }\n else{\n return $text['data'];\n }\n}",
"private function sendSingleVoiceTtsResponse(ResponseInterface $response, UriInterface $requestUri): mixed\n {\n $statusCode = $response->getStatusCode();\n $responseBody = $response->getBody();\n $responseHeaders = $response->getHeaders();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf('[%d] API Error (%s)', $statusCode, $requestUri),\n $statusCode,\n $responseHeaders,\n $responseBody\n );\n }\n\n $responseResult = null;\n\n $responseResult = $this->deserialize($responseBody, '\\Infobip\\Model\\CallsVoiceResponse', $responseHeaders);\n return $responseResult;\n }",
"public function say( Twilio_Statement $what_to_say ){\n\n header(\"content-type: text/xml\");\n\n echo \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\";\n\n echo (string) $what_to_say;\n\n\n }",
"public function responseMsg()\n {\n\t\t$postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n if (!empty($postStr)){\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $RX_TYPE = trim($postObj->MsgType);\n\n switch ($RX_TYPE)\n {\n case \"text\":\n $resultStr = $this->receiveText1($postObj);\n break;\n case \"event\":\n $resultStr = $this->receiveEvent($postObj);\n break;\n default:\n $resultStr = \"\";\n break;\n }\n echo $resultStr;\n }else {\n echo \"\";\n exit;\n }\n // \t//extract post data\n\t\t// if (!empty($postStr)){\n // /* libxml_disable_entity_loader is to prevent XML eXternal Entity Injection,\n // the best way is to check the validity of xml by yourself */\n // libxml_disable_entity_loader(true);\n // \t$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n // $fromUsername = $postObj->FromUserName;\n // $toUsername = $postObj->ToUserName;\n // $keyword = trim($postObj->Content);\n // $time = time();\n // $textTpl = \"<xml>\n\t\t// \t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n\t\t// \t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n\t\t// \t\t\t\t\t<CreateTime>%s</CreateTime>\n\t\t// \t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\n\t\t// \t\t\t\t\t<Content><![CDATA[%s]]></Content>\n\t\t// \t\t\t\t\t<FuncFlag>0</FuncFlag>\n\t\t// \t\t\t\t\t</xml>\"; \n\t\t// \t\tif(!empty( $keyword ))\n // {\n // \t\t$msgType = \"text\";\n // \t$contentStr = \"Welcome to wechat world!\";\n // \t$resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n // \techo $resultStr;\n // }else{\n // \techo \"Input something...\";\n // }\n\n // }else {\n // \techo \"\";\n // \texit;\n // }\n }",
"public function getType()\r\n\t{\r\n\t\t//TODO: Parse the raw response header info for content type\r\n\t\t//EXAMPLE OF RETURNED DATA FROM $this->_solrResponse->getRawResponseHeaders()\r\n\t\t/*\r\n\t\t\"HTTP/1.1 200 OK\r\n\t\tContent-Type: text/xml; charset=utf-8\r\n\t\tContent-Length: 764\r\n\t\tServer: Jetty(6.1.3)\r\n\r\n\t\t\"\r\n\t\t*/\r\n\t\t\r\n\t\treturn 'text/xml';\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 responseMsg()\n\t{\n\t\t$postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\t\t//extract post data\n\t\tif (!empty($postStr)){\n\t\t\t/* libxml_disable_entity_loader is to prevent XML eXternal Entity Injection,\n\t\t\t the best way is to check the validity of xml by yourself */\n\t\t\tlibxml_disable_entity_loader(true);\n\t\t\t$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n\t\t\t$fromUsername = $postObj->FromUserName;\n\t\t\tif(!empty($fromUsername)){\n\t\t\t\t$this->getGzUserInfo($fromUsername);\n\t\t\t}\n\t\t\t$toUsername = $postObj->ToUserName;\n\t\t\t$keyword = trim($postObj->Content);\n\t\t\t$Event = trim($postObj->Event);//事件类型,subscribe(订阅)、unsubscribe(取消订阅)\n// \t\t\t$time = time();\n// \t\t\t$textTpl = \"<xml>\n// \t\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n// \t\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n// \t\t\t\t\t\t\t<CreateTime>%s</CreateTime>\n// \t\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\n// \t\t\t\t\t\t\t<Content><![CDATA[%s]]></Content>\n// \t\t\t\t\t\t\t<FuncFlag>0</FuncFlag>\n// \t\t\t\t\t\t\t</xml>\";\n// \t\t\tif(!empty( $keyword ))\n// \t\t\t{\n// \t\t\t\t$msgType = \"text\";\n\t\t\t//订阅消息推送\n\t\t\t$resultStr\t= \"\";\n\t\t\tif(!empty($Event) && $Event=='subscribe'){\n\t\t\t\t$contentStr = \"您好,感谢您订阅衣伴网络,我们程序员正在玩命开发中,敬请期待...... 如果觉得我们有用,请推荐您的朋友关注。(微信搜索yibanwangluo)\";\n\t\t\t\t$resultStr\t= $this->responseTxt($fromUsername, $toUsername, $contentStr);\n\t\t\t}else{\n\t\t\t\tif(!empty($keyword) && $keyword=='ybwl' ){\n\t\t\t\t\t$title\t= '衣伴商务速洗';\n\t\t\t\t\t$des\t= '全国最大商务速洗O2O平台';\n\t\t\t\t\t$picurl\t= 'http://www.91yb.cn/static/images/weixin.jpg';\n\t\t\t\t\t$url\t= 'http://www.91yb.cn/?f=weixin';\n\t\t\t\t\t$resultStr = $this->responsePicTxt($fromUsername, $toUsername, $title, $des, $picurl, $url);\n\t\t\t\t}else{\n\t\t\t\t\t$resultStr =$this->responseTxt($fromUsername, $toUsername, '您好,感谢您订阅衣伴网络,我们程序员正在玩命开发中,敬请期待......');\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//@mwtlog(\"responseMsg_test\",$postStr.\"\\r\\n\",true);\n\t\t\t\techo $resultStr;\n// \t\t\t}else{\n// \t\t\t\techo \"Input something...\";\n// \t\t\t}\n\t\n\t\t}else {\n\t\t\techo \"\";\n\t\t\texit;\n\t\t}\n\t}",
"public function getText(): ?FHIRString\n {\n return $this->text;\n }",
"public function makeSms()\n {\n $sms = strtoupper($this->search_words);\n switch ($this->definitions_count) {\n case 0:\n $sms .= \" | No definitions found.\";\n break;\n case 1:\n $sms .= \" | \" .$this->definitions[0];\n\n\n\n\n break;\n default:\n foreach($this->definitions as $definition) {\n $sms .= \" / \" . $definition;\n }\n }\n\n $sms .= \" | \" . $this->response;\n\n // Really need to refactor this double :/\n $this->sms_message = $sms;\n\n }",
"public function render() {\n\t\t$rtn = [\n\t\t\t'speech' => $this->speech,\n\t\t\t'source' => $this->source\n\t\t];\n\t\t$data = [];\n\t\tif ($this->googleData) {\n\t\t\t$data['google']=$this->googleData->render();\n\t\t}\n\t\tif (count($data)>0) {\n\t\t\t$rtn['data']=$data;\n\t\t}\n\t\tif ($this->displayText) {\n\t\t\t$rtn['displayText'] = $this->displayText;\n\t\t}\n\t\treturn $rtn;\n\t}",
"public function responseMsg()\n {\n\t\t$postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n \t//extract post data\n\t\tif (!empty($postStr)){\n /* libxml_disable_entity_loader is to prevent XML eXternal Entity Injection,\n the best way is to check the validity of xml by yourself */\n libxml_disable_entity_loader(true);\n \t$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $keyword = trim($postObj->Content);\n $time = time();\n $textTpl = \"<xml>\n\t\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n\t\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n\t\t\t\t\t\t\t<CreateTime>%s</CreateTime>\n\t\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\n\t\t\t\t\t\t\t<Content><![CDATA[%s]]></Content>\n\t\t\t\t\t\t\t<FuncFlag>0</FuncFlag>\n\t\t\t\t\t\t\t</xml>\"; \n\t\t\t\tif(!empty( $keyword ))\n {\n \t\t$msgType = \"text\";\n \t$contentStr = \"Welcome to wechat world!\";\n \t$resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n \techo $resultStr;\n }else{\n \techo \"Input something...\";\n }\n\n }else {\n \techo \"\";\n \texit;\n }\n }",
"public function answer ( )\n\t{\n\t\t$output_options = array(\n \"encoding\" => \"utf-8\"\n );\n\t\treturn str_replace( \"&#\", \"&#\", xmlrpc_server_call_method( $this->sh, file_get_contents( 'php://input'), NULL, $output_options ) );\n\t\t\n\t}",
"public function answer()\n\t{\n\n $twiml = new Services_Twilio_Twiml();\n\n $gather = $twiml->gather([\n 'method' => 'GET',\n 'action' => 'twilio/check-account'\n ]);\n $gather->say(\"Hello, thanks for calling Phlare. Please enter your account number, followed by the pound sign.\");\n\n return $twiml;\n\n\t}",
"protected function responseMsg()\n {\n $postStr = file_get_contents('php://input', 'r');\n\n //extract post data\n if (!empty($postStr)){\n /* libxml_disable_entity_loader is to prevent XML eXternal Entity Injection,\n the best way is to check the validity of xml by yourself */\n libxml_disable_entity_loader(true);\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $keyword = trim($postObj->Content);\n $time = time();\n $textTpl = \"<xml>\n\t\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n\t\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n\t\t\t\t\t\t\t<CreateTime>%s</CreateTime>\n\t\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\n\t\t\t\t\t\t\t<Content><![CDATA[%s]]></Content>\n\t\t\t\t\t\t\t<FuncFlag>0</FuncFlag>\n\t\t\t\t\t\t\t</xml>\";\n if(!empty( $keyword ))\n {\n $msgType = \"text\";\n $contentStr = \"Welcome to wechat world!\";\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n }else{\n echo \"Input something...\";\n }\n\n }else {\n echo \"\";\n exit;\n }\n }",
"public function responseMsg()\n {\n\t\t$postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n //接收微信公众平台发送过来的用户消息,该消息数据结构为XML,不是php默认的识别数据类型,因此这里用了$GLOBALS['HTTP_RAW_POST_DATA']来接收,同时赋值给了$postStr\n\n \t//extract post data\n\t\tif (!empty($postStr)){\n \n \t$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n \t//使用simplexml_load_string() 函数将接收到的XML消息数据载入对象$postObj中。这个严谨的写法后面还得加个判断是否载入成功的条件语句,不过不写也没事。\n \t$RX_TYPE = trim($postObj->MsgType); \n \t//接收信息的类型\n \t\n \tswitch($RX_TYPE)\n {\n case \"text\":\n $resultStr = $this->handleText($postObj);\n break;\n \n case \"event\":\n $resultStr = $this->handleEvent($postObj);\n break;\n \n default:\n $resultStr = \"Unknow msg type:\".$RX_TYPE.\"\\n\".$postObj->Event.\"\\n\".$postObj->EventKey;\n break;\n }\n \techo $resultStr;\n \n }else{ \n \techo \"\";\n \texit;\n }\n }",
"public function parse(ResponseInterface $response)\n {\n $contents = $response->getBody()->getContents();\n $xml = simplexml_load_string($contents, 'SimpleXMLElement', LIBXML_NOERROR | LIBXML_NOWARNING);\n\n if (false === $xml instanceof \\SimpleXMLElement) {\n throw new SpeechKitException(\n sprintf('Could not parse response contents: %s', $contents)\n );\n }\n\n if (self::SUCCESSFUL_RESULT !== (int)$xml->attributes()->success) {\n return new HypothesesList();\n }\n\n $result = new HypothesesList(count($xml->variant));\n $current = 0;\n foreach ($xml->variant as $variant) {\n $confidence = (float)$variant->attributes()->confidence;\n $result[$current] = new Hypothesis($confidence, (string)$variant);\n $current++;\n }\n\n return $result;\n }",
"public function responseType ();",
"private function response() {\n $reply = trim(fgets($this -> __sock, 512));\n switch(substr($reply, 0, 1)) {\n /* Error reply */\n case '-':\n trigger_error('ERROR (' . trim($reply) . ')', E_USER_ERROR);\n /* Inline reply */\n case '+':\n $response = substr(trim($reply), 1);\n if($response === 'OK') $response = true;\n break;\n /* Bulk reply */\n case '$':\n $response = null;\n if($reply === '$-1') break;\n $read = 0;\n $size = intval(substr($reply, 1));\n if($size > 0) {\n do {\n $block_size = ($size - $read) > 1024 ? 1024 : ($size - $read);\n $r = fread($this -> __sock, $block_size);\n if($r === false)\n trigger_error('READ FROM SERVER ERROR', E_USER_ERROR);\n else {\n $read += strlen($r);\n $response .= $r;\n }\n } while($read < $size);\n }\n fread($this -> __sock, 2); /* CRLF */\n break;\n /* Multi-bulk reply */\n case '*':\n $count = intval(substr($reply, 1));\n if($count === -1) return null;\n $response = array();\n for($i = 0; $i < $count; $i++)\n $response[] = $this -> response();\n break;\n /* Integer reply */\n case ':':\n $response = intval(substr(trim($reply), 1));\n break;\n default:\n trigger_error('UNKNOWN RESPONSE ERROR', E_USER_ERROR);\n }\n return $response;\n }",
"public function build_simpleResponse($textToSpeech, $displayText) {\n\t $response = array(\n\t\t 'simpleResponse' => array(\n\t\t\t 'textToSpeech' => $textToSpeech,\n\t\t\t 'displayText' => $displayText\n\t\t\t)\n\t\t);\n\t\t$this->items[] = $response;\n }",
"Public function renduTextPlain()\n {\n if($this->choixEffectuer())\n {\n $rendu = $this->calculerFils();\n }\n return $rendu;\n }",
"function getQuestionType() {\n\t\treturn 'extended_text';\n\t}",
"static function setResponseFormatPlain(){\n self::$responseFormat = 'plain';\n }",
"function synthesizeOnline($vocalwareLID, $vocalwareVID, $text, $filename)\n {\n $error = false;\n $errormessage = null;\n $errorcode = 0;\n $output = array();\n \n $curl = curl_init();\n\n\n\t\t// A Vocalware account is needed\n $url = \"\";\n $secret_phrase = \"\";\n\n // Vocalware API identification is required\n $data = array(\n 'EID' => '2',\n 'LID' => $vocalwareLID,\n 'VID' => $vocalwareVID,\n 'TXT' => $text,\n 'EXT' => 'mp3',\n 'ACC' => '', // required\n 'API' => '' // required \n );\n\n $data['CS'] = md5($data['EID'].$data['LID'].$data['VID'].$data['TXT'].$data['EXT'].$data['ACC'].$data['API'].$secret_phrase);\n\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\n $result = curl_exec($curl);\n\n curl_close($curl);\n \n // if no error occurred (we assume there's an error if the mp3 data is less than 1000 characters)\n if ($result && !strpos($result, \"Error: \") && (strlen($result) > 1000)) {\n\n try {\n $filenamewrite = \"mp3/\".$filename.\".mp3\";\n $fitxertxtwrite = fopen($filenamewrite,\"w+b\");\n\n if (flock($fitxertxtwrite, LOCK_EX)) {\n fwrite($fitxertxtwrite, $result);\n flock($fitxertxtwrite, LOCK_UN);\n fclose($fitxertxtwrite);\n }\n } catch (Exception $ex) {\n $error = true;\n $errormessage = \"Error. An error occurred while writing the audio file.\";\n $errorcode = 108;\n }\n }\n // if there was an error\n else {\n $error = true;\n $errormessage = \"Error. An error occurred while contacting the online voice service. Try again.\";\n $errorcode = 109;\n }\n \n $output[0] = $error;\n $output[1] = $errormessage;\n $output[2] = $errorcode;\n return $output;\n }",
"public function responseMsg_demo()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n //extract post data\n if (!empty($postStr)){\n\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $type = $postObj->MsgType;\n $event=$postObj->Event;\n $EventKey=$postObj->EventKey;\n\n $latitude = $postObj->Location_X;\n $longitude = $postObj->Location_Y;\n $keyword = trim($postObj->Content);\n $time = time();\n $textTpl = \"<xml>\n\t\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n\t\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n\t\t\t\t\t\t\t<CreateTime>%s</CreateTime>\n\t\t\t\t\t\t\t<MsgType><![CDATA[text]]></MsgType>\n\t\t\t\t\t\t\t<Content><![CDATA[%s]]></Content>\n\t\t\t\t\t\t\t<FuncFlag>0</FuncFlag>\n\t\t\t\t\t\t\t</xml>\";\n if ($event==\"CLICK\" and $EventKey==\"V1001_BRAND\")\n {\n $contentStr=\"自定义菜单教程\";\n\n }\n elseif ($event==\"CLICK\" and $EventKey==\"V1001_SUPPLY\")\n {\n $contentStr=\"谢谢你的赞扬\";\n }\n elseif ($event==\"CLICK\" and $EventKey==\"V1001_CHECK\")\n {\n $contentStr=\"你好我也好\";\n } elseif ($event==\"CLICK\" and $EventKey==\"V1001_ANTI_FAKE\")\n {\n $contentStr=\"谢谢你的赞扬\";\n }\n elseif ($event==\"CLICK\" and $EventKey==\"V1001_PROMOTE\")\n {\n $contentStr=\"你好我也好\";\n }\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $contentStr);\n echo $resultStr;\n\n\n\n }\n\n }",
"public function responseMsg()\r\n\t{\r\n\t\t$postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\r\n\r\n\t\t//extract post data\r\n\t\tif (!empty($postStr)){\r\n\t\t\t\t\r\n\t\t\t\t$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\r\n\t\t\t\t$fromUsername = $postObj->FromUserName;\r\n\t\t\t\t$toUsername = $postObj->ToUserName;\r\n\t\t\t\t$keyword = trim($postObj->Content);\r\n\t\t\t\t$time = time();\r\n\r\n\t\t\t\t/*文字回复*/\r\n\t\t\t\t$textTpl = \"<xml>\r\n\t\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\r\n\t\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\r\n\t\t\t\t\t\t\t<CreateTime>%s</CreateTime>\r\n\t\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\r\n\t\t\t\t\t\t\t<Content><![CDATA[%s]]></Content>\r\n\t\t\t\t\t\t\t<FuncFlag>0</FuncFlag>\r\n\t\t\t\t\t\t\t</xml>\"; \r\n\r\n\t\t\t\t/*图文回复*/\r\n\t\t\t\t$itemTpl = \"<xml>\r\n\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\r\n\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\r\n\t\t\t\t\t\t<CreateTime>%s</CreateTime>\r\n\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\r\n\t\t\t\t\t\t<ArticleCount>1</ArticleCount>\r\n\t\t\t\t\t\t<Articles>\r\n\t\t\t\t\t\t<item>\r\n\t\t\t\t\t\t<Title><![CDATA[%s]]></Title> \r\n\t\t\t\t\t\t<Description><![CDATA[%s]]></Description>\r\n\t\t\t\t\t\t<PicUrl><![CDATA[%s]]></PicUrl>\r\n\t\t\t\t\t\t<Url><![CDATA[%s]]></Url>\r\n\t\t\t\t\t\t</item>\r\n\t\t\t\t\t\t</Articles>\r\n\t\t\t\t\t\t</xml>\";\r\n\r\n\r\n\r\n\t\t\t\tif(!empty( $keyword )){\r\n\t\t\t\t\t$keyworde = $this -> FindKeyword($keyword,$fromUsername);\r\n\t\t\t\t\tswitch ($keyworde) {\r\n\t\t\t\t\t\tcase '红包':\r\n\t\t\t\t\t\t\t// $msgType = \"news\";\r\n\t\t\t\t\t\t\t// $contentStr = \"恭喜你获得一个红包!\";\r\n\t\t\t\t\t\t\t// $contentStr2 = \"点击图片领取你的红包!\";\r\n\t\t\t\t\t\t\t// // $PicUrl = \"http://imgsrc.baidu.com/forum/w%3D580/sign=6926f2cad488d43ff0a991fa4d1fd2aa/3e8ad5dcd100baa1583412044510b912c9fc2ea8.jpg\";\r\n\t\t\t\t\t\t\t// $url = \"http://i.shuilaile.com/index.php?s=/Home/Get/pay/openid/\".$fromUsername.\"/code/\".$keyword.\".html\";\r\n\t\t\t\t\t\t\t// $resultStr = sprintf($itemTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr, $contentStr2, $PicUrl, $url);\r\n\t\t\t\t\t\t\t// echo $resultStr;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//执行发红包\r\n\t\t\t\t\t\t\t$this -> pay($fromUsername,$keyword);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t$msgType = \"text\";\r\n\t\t\t\t\t\t\t$contentStr = $keyworde;\r\n\t\t\t\t\t\t\t// $contentStr = \"Welcome to wechat world!\";\r\n\t\t\t\t\t\t\t$resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\r\n\t\t\t\t\t\t\techo $resultStr;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\techo \"Input something...\";\r\n\t\t\t\t}\r\n\r\n\t\t}else {\r\n\t\t\techo \"\";\r\n\t\t\texit;\r\n\t\t}\r\n\t}",
"public function readSubject()\n {\n $this->response = null;\n\n\n $this->num_hits = 0;\n // Extract uuids into\n\n //$this->number = extractNumber();\n\n $keywords = $this->keywords;\n\n if ($this->agent_input != null) {\n\n // If agent input has been provided then\n // ignore the subject.\n // Might need to review this.\n $input = strtolower($this->agent_input);\n\n } else {\n\n $input = strtolower($this->subject);\n\n }\n\n $this->input = $input;\n\n\t\t$haystack = $this->agent_input . \" \" . $this->from . \" \" . $this->subject;\n\n $prior_uuid = null;\n\n $pieces = explode(\" \", strtolower($input));\n\n\t\t// So this is really the 'sms' section\n\t\t// Keyword\n if (count($pieces) == 1) {\n\n if ($input == 'eventful') {\n //$this->search_words = null;\n $this->response = \"Asked Oxford Dicionaries about nothing.\";\n return;\n }\n\n }\n\n foreach ($pieces as $key=>$piece) {\n foreach ($keywords as $command) {\n if (strpos(strtolower($piece),$command) !== false) {\n\n switch($piece) {\n\n case 'run':\n // //$this->thing->log(\"read subject nextblock\");\n $this->runTrain();\n break;\n\n default:\n }\n\n }\n }\n\n }\n\n\n $whatIWant = $input;\n if (($pos = strpos(strtolower($input), \"oxforddictionaries is\")) !== FALSE) { \n $whatIWant = substr(strtolower($input), $pos+strlen(\"oxforddictionaries is\")); \n } elseif (($pos = strpos(strtolower($input), \"oxforddictionaries\")) !== FALSE) { \n $whatIWant = substr(strtolower($input), $pos+strlen(\"oxforddictionaries\")); \n }\n\n $filtered_input = ltrim(strtolower($whatIWant), \" \");\n\n if ($filtered_input != \"\") {\n $this->search_words = $filtered_input;\n $this->response = \"Asked Oxford Dictionaries about the word \" . $this->search_words . \".\";\n return false;\n }\n\n\n\n $this->response = \"Message not understood\";\n\t\treturn true;\n\n\t\n\t}",
"function getPolarityByTweet($string,$data_text)\n{\n\t$positif_words=[\n\"😂\",\n\"💪\", \n\"💜\",\n\"💖\",\n\"👏\",\n\"👍\",\n\"🎺\",\n\"😍\",\n\"bravo\",\n\"courage\",\n\"positif\",\n\"amour\",\n\"espoir\",\n\"chance\",\n\"belle\",\n\"beau\",\n\"top\",\n\"super\",\n\"magnifique\",\n\"excellent\",\n\"heureusement\",\n\"explique\",\n\"arrogant\",\n\"arrête\",\n\"plat\",\n\"cœur\",\n\"caricatur\",\n\"félicitation\",\n\"intellectuelle\",\n\"élection\",\n\"incroyable\",\n\"grâce\",\n\"connait\",\n\"côté\",\n\"cesse\",\n\"attaqu\",\n\"résume\",\n\"changement\",\n\"hauteur\",\n\"confiance\",\n\"aimer\",\n\"joie\",\n\"merci\",\n\"calme\",\n\"adore\",\n\"felicitations\",\n\"intelligence\",\n\"credible\",\n\"prouve\",\n\"responsable\",\n\"respecter\",\n];\n\n\t$negatif_words=[\n\"🚮\",\n\"😠\",\n\"😳\",\n\"🚫\", \n\"🔥\",\n\"😢\", \n\"😱\",\n\"😹\",\n\"😠\",\n\"😨\",\n\"😫\",\n\"😭\",\n\"malade\",\n\"bloodysusu\",\n\"honte\",\n\"suicide\",\n\"autosuicide\",\n\"suicidaire\",\n\"suicidemediatique\",\n\"suicidepolitique\",\n\"assume\",\n\"jevoteelledegage\",\n\"haine\",\n\"ToutSaufMacron\",\n\"hontemarine\",\n\"null\",\n\"con\",\n\"ivre\",\n\"échec\",\n\"frapp\",\n\"clash\",\n\"invectiv\",\n\"racist\",\n\"cougar\",\n\"couille\",\n\"schlag\",\n\"shlag\",\n\"mensonge\",\n\"bat\",\n\"médiocre\",\n\"poudre\",\n\"cour\",\n\"cons\",\n\"nul\",\n\"diocre\",\n\"flavienneuvy\",\n\"archi\",\n\"damidotvalerie\",\n\"hop\",\n\"grosse\",\n\"rigol\",\n\"idio\",\n\"humilier\",\n\"pute\",\n\"putain\",\n\"encule\",\n\"connard\",\n\"salope\",\n\"merde\",\n\"cul\",\n\"batard\",\n\"connasse\",\n\"enfoire\",\n\"abruti\",\n\"caca\",\n\"bordel\",\n\"peur\",\n\"mort\",\n\"salir\",\n\"voile\",\n\"menace\",\n\"triste\",\n\"contre\",\n\"folle\",\n\"indigne\",\n\"parasite\",\n\"gueule\",\n\"pathetique\",\n\"crise\",\n\"insulter\",\n\"menteuse\",\n\"ridiculisee\",\n\"lecon\",\n\"abstentionnistes\",\n\"debile\",\n\"pleurer\",\n\"couilles\",\n\"ptdr\",\n\"marre\",\n\"connerie\",\n\"vulgarite\",\n\"agressivite\",\n\"genante\",\n\"ment\",\n\"betises\",\n\"sdementhon\",\n\"reconciliee\",\n\"menteur\",\n\"danger\",\n\"fhollande\",\n\"fhaine\",\n\"shutthefnckup\",\n];\n\n$mixte_words=[\n\"solere\",\n\"ecologie\",\n\"franceinsoumise\",\n\"neant\",\n\"casse\",\n\"mdrrrr\",\n\"malaise\",\n\"vulgaire\",\n\"ecu\",\n\"blonde\",\n\"mdr\",\n\"ridiculisation\",\n\"clown\",\n\"taire\",\n\"bizarre\",\n\"perd\",\n\"EnMarche\",\n\"honteux\",\n\"daesh\",\n\"démotivé\",\n\"guerre\",\n\"dupontaignan\",\n\"francoisfillon\",\n\"fake\",\n\"ridiculis\",\n\"pas\",\n\"mauvais\",\n\"insupportable\",\n\"immigration\",\n\"interrompre\",\n\"fini\",\n\"regret\",\n\"macron\",\n\"lepen\",\n\"pen\",\n\"islamis\",\n\"djihadis\"\n];\n\n//echo $string.\" \". getStringScore($string,$data_text); die;\n$score=getStringScore($string,$data_text);\n\tif ($score==0) {\n\t\t\tif ((!strposa($string, $mixte_words, 1))&&(!strposa($string, $negatif_words, 1))&&(!strposa($string, $positif_words, 1))){\n\t return 'autre';\n\t}else{\n\t return 'negatif';\n\t}\n\n\t}\n\tif ($score<-1){\n\t return 'negatif';\n\t} else if ($score>=-1 && $score<1){\n\t return 'autre';\n\t} else if ($score>=1&& $score<5){\n\t return 'mixte';\n\t} else if ($score>=5){\n\t return 'positif';\n\t}\n\n}",
"public function respond() {\n\t \n\t // Prevent duplicate responses\n\t if ($this->hasResponded) return;\n\t $this->hasResponded = true;\n\t \n\t // Set google as default for now\n\t $integrations = array(\n\t\t 'google' => array(\n\t\t\t 'expectUserResponse' => $this->expectUserResponse,\n\t\t\t 'richResponse' => array(\n\t\t\t\t 'items' => $this->items\n\t\t\t )\n\t\t )\n\t );\n\t \n\t $fulfillmentMessages = array();\n\t \n\t $response = array(\n\t\t 'fulfillmentText' => $this->speech,\t\t \n\t\t 'payload' => $integrations,\t\t \n\t );\n\t \n\t header(\"Content-type:application/json\");\n\t return json_encode($response);\n }",
"public function getResponseAsString(): string;",
"function sensei_custom_lesson_quiz_text () {\n\t$text = \"Report What You Have Learned\";\n\treturn $text;\n}",
"function translate_parse($dataStr)\n\t\t{\n\t\t if($dataStr)\n\t\t {\n\t\t\t $arr = json_decode($dataStr,true); \n\t\t\t\t return $arr['responseData']['translatedText'];\n\t\t }\n\t\t return \"\";\n\t\t}",
"public function get_plain() \n\t{ \n\t\treturn $this->PLAIN; \n\t}",
"public function string(){\n try {\n // Sparql11query.g:586:3: ( STRING_LITERAL1 | STRING_LITERAL2 | STRING_LITERAL_LONG1 | STRING_LITERAL_LONG2 ) \n // Sparql11query.g: \n {\n if ( ($this->input->LA(1)>=$this->getToken('STRING_LITERAL1') && $this->input->LA(1)<=$this->getToken('STRING_LITERAL_LONG2')) ) {\n $this->input->consume();\n $this->state->errorRecovery=false;\n }\n else {\n $mse = new MismatchedSetException(null,$this->input);\n throw $mse;\n }\n\n\n }\n\n }\n catch (RecognitionException $re) {\n $this->reportError($re);\n $this->recover($this->input,$re);\n }\n catch(Exception $e) {\n throw $e;\n }\n \n return ;\n }",
"public function speak($word = '')\n\t{\n\t\tif (empty($word)) {\n\t\t\t$word = 'woof';\n\t\t}\n\t\treturn parent::speak($word);\n\t}",
"private function getHtmlResponse() {\r\n\t\t\r\n\t\t\t// check if a request has been made, else skip!\r\n\t\t\t$cmd = @$_POST['request'];\r\n\t\t\tif (!$cmd) {return '';}\r\n\t\t\t\r\n\t\t\t// get the connection\r\n\t\t\t$con = Factory::getVdrConnection();\r\n\t\t\t$resp = $con->request($cmd);\r\n\t\t\t\r\n\t\t\t// create the template\r\n\t\t\t$tpl = new Template('svdrp_response');\r\n\t\t\t$tpl->set('HEADER', LANG_SVDRP_RESPONSE_HEADER);\r\n\t\t\t$tpl->set('CONTENT', $resp->getLinesAsString());\r\n\t\t\treturn $tpl->get();\r\n\t\t\t\r\n\t\t}",
"public function analyse($string)\n {\n $this->addData(\"text\", $string);\n return $this->request();\n }",
"public function getTutorialReply()\n {\n return $this->get(self::_TUTORIAL_REPLY);\n }",
"public function getSpeechToTextSettings()\n {\n return isset($this->speech_to_text_settings) ? $this->speech_to_text_settings : null;\n }",
"public function getPlainText()\n {\n $this->_process();\n return $this->_plainText;\n }",
"public function getSyncSkillStrenReply()\n {\n return $this->get(self::_SYNC_SKILL_STREN_REPLY);\n }",
"function spellchecker_google_suggest_xml($text, $format = SPELLCHECKER_XML_FORMAT) {\n\n $url = GOOGLE_SPELL_URL . \"?lang=\" . $_GET['lang'];\n $lang = $_REQUEST['lang'] ? $_REQUEST['lang'] : variable_get('spellchecker_pspell_default_language', PSPELL_DEFAULT_LANGUAGE);\n $ignoredups = $_REQUEST['ignoredups'];\n $ignoredigits = $_REQUEST['ignoredigits'] ? $_REQUEST['ignoredigits'] : variable_get('spellchecker_ignoredigits', TRUE);\n $ignoreallcaps = $_REQUEST['ignoreallcaps'] ? $_REQUEST['ignoreallcaps'] : !(int)variable_get('spellchecker_case_sensitive', TRUE);\n\n\n $body = '<?xml version=\"1.0\" encoding=\"utf-8\" ?>';\n $body .= '<spellrequest textalreadyclipped=\"0\" ignoredups=\"1\" ignoredigits=\"' . (int)$ignoredigits . '\" ignoreallcaps=\"' . (int)$ignoreallcaps . '\">';\n $body .= '<text>' . $text . '</text>';\n $body .= '</spellrequest>';\n // Use curl if it exists\n if (function_exists('curl_init')) {\n // Use curl\n $ch = curl_init();\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_POST, TRUE);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-length: ' . drupal_strlen($body)));\n curl_setopt($ch, CURLOPT_POSTFIELDS, $body);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n $xml = curl_exec($ch);\n curl_close($ch);\n } else {\n // Use raw sockets\n $fp = fsockopen(\"ssl://\" . $server, $port, $errno, $errstr, 30);\n if ($fp) {\n // Send request\n fwrite($fp, $header);\n\n // Read response\n $xml = \"\";\n while (!feof($fp))\n $xml .= fgets($fp, 128);\n\n fclose($fp);\n } else\n echo \"Could not open SSL connection to google.\";\n }\n return $xml;\n}",
"function http_negotiate_language(array $supported, ?array &$result = null) {}",
"function translate_bing($data)\n\t {\n\t \t //\n\t \t //print_r($data);\n\t \t $api = 'F0DE0CCB37335B16E7EB0BD3FA2A3C9FD3543DE5';\n\t \t \n\t \t if(empty($data['text']))\n\t\t { \n\t\t return ''; \n\t\t } \n\t\t \n\t\t if($data['orignal_type'] == 'zh')\n\t\t {\n\t\t \t$data['orignal_type'] = 'zh-CHS';\n\t\t }\n\t\t \n\t\t if($data['local_type'] == 'zh')\n\t\t {\n\t\t \t$data['local_type'] = 'zh-CHS';\n\t\t }\n\n\t\t \n\t\t $url = \"http://api.microsofttranslator.com/v2/Http.svc/Translate?appId=\".$api.\"&text=\".urlencode($data['text']) . \"&from=\" . $data['orignal_type'] . \"&to=\" . $data['local_type']; \n\t\t \n\t\t //echo $url;\n\t\t \n\t\t if (function_exists('curl_init')) \n\t\t { \n\t\t $curl = curl_init(); \n\t\t curl_setopt($curl, CURLOPT_URL, $url); \n\t\t curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); \n\t\t $res = curl_exec($curl); \n\t\t } \n\t\t else \n\t\t { \n\t\t $res = @file_get_contents($url); \n\t\t }\n\t\t \n\t\t //echo $res;\n\t\t \n\t\t preg_match(\"~<string([^><]*?)>([\\s\\S]*?)<\\/string>~i\", $res, $ostr); \n\t\t //print_r($ostr);\n\t\t if (empty($ostr[2])) \n\t\t { \n\t\t return ''; \n\t\t } \n\t\t else \n\t\t { \n\t\t return htmlspecialchars_decode($ostr[2]); \n\t\t } \n\t }",
"function dahz_get_audio_transcript( $post_id = 0 ) {\n\n\tif ( empty( $post_id ) )\n\t\t$post_id = get_the_ID();\n\n\t/* Set up some default variables and get the image metadata. */\n\t$lyrics = '';\n\t$meta = wp_get_attachment_metadata( $post_id );\n\n\t/* Look for the 'unsynchronised_lyric' tag. */\n\tif ( isset( $meta['unsynchronised_lyric'] ) )\n\t\t$lyrics = $meta['unsynchronised_lyric'];\n\n\t/* Seen this misspelling of the id3 tag. */\n\telseif ( isset( $meta['unsychronised_lyric'] ) )\n\t\t$lyrics = $meta['unsychronised_lyric'];\n\n\t/* Apply filters for the transcript. */\n\treturn apply_filters( 'dahz_audio_transcript', $lyrics );\n}",
"private function sendAdvancedVoiceTtsResponse(ResponseInterface $response, UriInterface $requestUri): mixed\n {\n $statusCode = $response->getStatusCode();\n $responseBody = $response->getBody();\n $responseHeaders = $response->getHeaders();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf('[%d] API Error (%s)', $statusCode, $requestUri),\n $statusCode,\n $responseHeaders,\n $responseBody\n );\n }\n\n $responseResult = null;\n\n $responseResult = $this->deserialize($responseBody, '\\Infobip\\Model\\CallsVoiceResponse', $responseHeaders);\n return $responseResult;\n }",
"public function responseMsg()\n {\n //设置了register_globals禁止,不能用$GLOBALS[\"HTTP_RAW_POST_DATA\"];\n // 2018-5-17 潘\n\t\t// $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n $postStr = file_get_contents(\"php://input\");\n \t//extract post data\n\t\tif (!empty($postStr)){\n /* libxml_disable_entity_loader is to prevent XML eXternal Entity Injection,\n the best way is to check the validity of xml by yourself */\n libxml_disable_entity_loader(true);\n \t$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $keyword = trim($postObj->Content);\n $time = time();\n $textTpl = \"<xml>\n\t\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n\t\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n\t\t\t\t\t\t\t<CreateTime>%s</CreateTime>\n\t\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\n\t\t\t\t\t\t\t<Content><![CDATA[%s]]></Content>\n\t\t\t\t\t\t\t<FuncFlag>0</FuncFlag>\n\t\t\t\t\t\t\t</xml>\"; \n\t\t\t\tif(!empty( $keyword ))\n {\n \t\t$msgType = \"text\";\n \t$contentStr = \"行行,DSB\";\n \t$resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n \techo $resultStr;\n }else{\n \techo \"Input something...\";\n }\n\n }else {\n \techo \"嗨!\";\n \texit;\n }\n }",
"private function parse_response(array $response)\n {\n //strip all leading and trailing whitespace from the answer\n $response['answer'] = trim($response['answer']);\n\n //interpret the user's reponse according to the reponse mode\n switch($this->response_mode)\n {\n \n //handle STRING-mode respones\n case qtype_scripted_response_mode::MODE_STRING: \n\n //return the answer as-is, as we already recieved a string\n return strtolower($response['answer']);\n\n //handle STRING-mode respones\n case qtype_scripted_response_mode::MODE_STRING_CASE_SENSITIVE: \n\n //return the answer as-is, as we already recieved a string\n return $response['answer'];\n\n //handle DECIMAL-mode responses\n case qtype_scripted_response_mode::MODE_NUMERIC:\n\n //if the string was empty, return false, a non-numeric form of zero\n if($response['answer'] === '')\n return false;\n\n //get a floating-point interpretation of the answer\n return floatval($response['answer']);\n\n \n //handle HEXADECIMAL-mode responses \n case qtype_scripted_response_mode::MODE_HEXADECIMAL:\n\n //if the user entered a number in C format, parse it using PHP's native recognition of hex numbers\n if(substr($response['answer'], 0, 2) === \"0x\")\n return intval(substr($response['answer'], 2), 16);\n\n //if the user entered the hex number in HCS08 format (i.e. $0F), accept that, as well\n elseif(substr($response['answer'], 0, 1) == '$')\n return hexdec(substr($response['answer'], 1));\n\n //otherwise, return the answer parsed as a hex number\n else\n return hexdec($response['answer']);\n\n //handle BINARY-mode respones\n case qtype_scripted_response_mode::MODE_BINARY:\n\n //if the user entered a number in 0b format (used by some calculators), accept it \n if(substr($response['answer'], 0, 2) === \"0b\")\n return bindec(substr($response['answer'], 2), 16);\n\n //if the user entered the binary number in HCS08 format (i.e. %0F), accept that, as well\n elseif(substr($response['answer'], 0, 1) == '%')\n return bindec(substr($response['answer'], 1));\n\n //otherwise, return the answer parsed as a binary number\n else\n return bindec($response['answer']);\n\n\n //handle OCTAL-mode\n case qtype_scripted_response_mode::MODE_OCTAL:\n\n //if the user entered a number in 0o format, accept it, for consistency with other prefix strings\n //(as far as I know, no major format uses this)\n if(substr($response['answer'], 0, 2) === \"0o\")\n return octdec(substr($response['answer'], 2), 16);\n\n //if the user entered the binary number in HCS08 format (i.e. @0F), accept that, as well\n elseif(substr($response['answer'], 0, 1) == '@')\n return octdec(substr($response['answer'], 1));\n\n //otherwise, return the answer parsed as a octal number\n else\n return octdec($response['answer']);\n }\n }",
"public function isAccepted_as_talk() {\n\t\t$this->getAccepted_as_talk();\n\t}",
"public function Plain()\n\t{\n\t\tif (isset($this->params['output']) && ($this->params['output'] == 'plain'))\n\t\t\treturn true;\n\n\t\treturn false;\n\t}",
"function yms_send_response($success_string, $result)\n{\n global $lang, $output;\n \n if ( $result === true )\n {\n if ( isset($_GET['ajax']) )\n {\n yms_json_response(array(\n 'mode' => 'success',\n 'message' => $lang->get($success_string)\n ));\n }\n else\n {\n $output->add_after_header(\n '<div class=\"info-box\">' . $lang->get($success_string) . '</div>'\n );\n }\n }\n else\n {\n if ( isset($_GET['ajax']) )\n {\n yms_json_response(array(\n 'mode' => 'error',\n 'error' => $lang->get($result)\n ));\n }\n else\n {\n $output->add_after_header(\n '<div class=\"error-box\">' . $lang->get($result) . '</div>'\n );\n }\n }\n}",
"public function ssml();",
"public function toneDetection($data) {\n $parameters=array(\n 'data'=>$data \n );\n $content = json_encode($parameters);\n \n $jsonreply=$this->CallWebService('getTone',$content);\n \n return $this->ParseReply($jsonreply);\n }",
"public function answer()\n\t{\n\t\tif (!$this->typeResponseCode)\n\t\t\treturn $this->answerTwoHundred($this->data);\n\t\telse\n\t\t\treturn $this->answerThroughHeader($this->data);\n\t}",
"function detect_bing($data)\n\t {\n\t \t //\n\t \t //print_r($data);\n\t \t $api = 'F0DE0CCB37335B16E7EB0BD3FA2A3C9FD3543DE5';\n\t \t \n\t \t if(empty($data['text']))\n\t\t { \n\t\t return ''; \n\t\t } \n\t\t \t\t \n\t\t $url = \"http://api.microsofttranslator.com/v2/Http.svc/Detect?appId=\".$api.\"&text=\".urlencode($data['text']); \n\t\t \n\t\t //echo $url;\n\t\t \n\t\t if (function_exists('curl_init')) \n\t\t { \n\t\t $curl = curl_init(); \n\t\t curl_setopt($curl, CURLOPT_URL, $url); \n\t\t curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); \n\t\t $res = curl_exec($curl); \n\t\t } \n\t\t else \n\t\t { \n\t\t $res = @file_get_contents($url); \n\t\t }\n\t\t \t\t \n\t\t preg_match(\"~<string([^><]*?)>([\\s\\S]*?)<\\/string>~i\", $res, $ostr); \n\t\t //print_r($ostr);\n\t\t if (empty($ostr[2])) \n\t\t { \n\t\t return ''; \n\t\t } \n\t\t else \n\t\t { \n\t\t $code_str = htmlspecialchars_decode($ostr[2]); \n\t\t $arr = explode(\"-\",$code_str);\n\t\t return (count($arr)>1) ? $arr[0] : $code_str;\n\t\t } \n\t }",
"public function createTwilm()\n {\n $response = new Twiml();\n $response->say('Hello');\n $response->play('https://api.twilio.com/cowbell.mp3', array(\"loop\" => 5));\n print $response;\n }",
"public function getBodyText();",
"public function getSessionText()\n {\n if ($text = $this->_session->get('text')) {\n return $this->respond(['text' => $text], 200);\n }\n\n return $this->failNotFound();\n }",
"function get_text()\n {\n if ( !$this->_converted ) {\n $this->_convert();\n }\n\n return $this->text;\n }",
"public function testPlainTextTranslate()\n {\n // Given\n $this->responseMock->expects($this->any())->method('json')->will($this->returnValue(\n ['data' => ['translations' => [['translatedText' => \"J'ai\"]]]]\n ));\n\n // When\n $value = $this->translator->translate('I have', 'fr', 'en', true);\n\n // Then\n $this->assertEquals($value, \"J'ai\", 'Should return \"J\\'ai\"');\n }",
"public function setGatewayResponse(string $text);",
"public function getResponseMessage();",
"public function getReasonPhrase(): string;",
"function talk()\n {\n $this->load->library('service');\n $data = file_get_contents('php://input');\n $ret = array(\n 'out' => $this->service->handle('talk', $data)\n );\n $this->output($ret);\n }",
"public function isPlain()\n\t{\n\t\treturn Str::contains($this->getHeaderLine('Content-Type'), '/plain');\n\t}",
"public function setEquipSynthesisReply(Down_EquipSynthesisReply $value)\n {\n return $this->set(self::_EQUIP_SYNTHESIS_REPLY, $value);\n }",
"protected function simpleAnswer($response) {\n $response = strtoupper($response);\n\n if ($response === 'Y' || $response === 'YES')\n return TRUE;\n else if ($response === 'N' || $response === 'NO')\n return FALSE;\n else\n return $this->promptMessage('yesorno') . PHP_EOL;\n }",
"public function text_or_binary()\n {\n }",
"public function supportSms() {\n return $this->har_sms;\n }",
"public function isText() {}",
"public function hello()\n {\n return $this->TextResponseFactory->make(static::HELLO_TEXT);\n }",
"public function getReasonPhrase();",
"public function scissors($str, $type){\n if ($type == 'username'){\n if (strlen($str)>10){\n $dataReturn = mb_substr($str, 0, 8).'..';\n }else{\n $dataReturn = $str;\n }\n }\n \n // if the text is message or note \n if ($type == 'note'){\n if (strlen($str)>114){\n $dataReturn = mb_substr($str, 0, 110).'....';\n }else{\n $dataReturn = $str;\n }\n }\n if ($type == 'Lyric.title'){\n if (strlen($str)>32){\n $dataReturn = mb_substr($str, 0, 30).'..';\n }else{\n $dataReturn = $str;\n }\n }\n \n return $dataReturn;\n }",
"public function get_correct_response()\n {\n return null;\n }",
"function extract_response($text) {\n return mb_strtolower(trim($text, ' /,.!?;:\\'\"+'));\n}",
"function dire($texte,$signature='', $voice='')\n { \n if ($signature != '') {\n $this->url .='&tts='.rawurlencode('Message de '.stripslashes(trim($signature)).' : ').rawurlencode(stripslashes(trim($texte)));\n } else {\n $this->url .='&tts='.rawurlencode(stripslashes(trim($texte)));\n }\n //Pour le francais on ne prends pas la voix par defaut (preference personnelle ;)\n if ($voice == '' && $this->lang==\"fr\") $voice='claire22k';\n if ($voice == '' && $this->lang==\"us\") $voice='heather22k';\n \n if ($voice != '') {\n $this->url .='&voice='.$voice;\n }\n }",
"function getResponseFromWatson2($p_input_text) {\n $workspace_id = \"9ecfefaa-5874-44cc-bca1-ebdb5664fe53\";\n $_watson_API_username = \"apikey\";\n $_watson_API_password = \"yqfzvnhDEwwmJ99__n4GNIWkl72f5dV5BtWxUadQ2Nn1\";\n $_version_date = \"2018-11-19\";\n\n // set url\n $api_url = \"https://gateway-syd.watsonplatform.net/assistant/api/v1/workspaces/\" . $workspace_id . \"/message?version=2018-11-19\";\n $response = \"\";\n if (isset($_POST['submit2M'])) {\n $p_input_text = $_POST['my_message2'];\n\n if (!empty($_POST['my_message2'])) {\n $api_request_array['input']['text'] = $p_input_text;\n } else {\n $api_request_array['input'] = null;\n }\n\n\n if (!empty($p_watson_context))\n $api_request_array['context'] = $p_watson_context;\n\n $json_api_request = json_encode($api_request_array);\n\n\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, $api_url);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n curl_setopt($ch, CURLOPT_USERPWD, \"$_watson_API_username:$_watson_API_password\");\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $json_api_request);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\"Content-Type: application/json\"));\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\n $response = curl_exec($ch);\n\n if (curl_errno($ch)) {\n //echo 'Error connecting with Watson API. Error:(' . $errno . ') - ' . curl_strerror($errno);\n echo 'Curl error: ' . curl_error($ch);\n }\n\n // $output contains the output string\n $watson_reply_message = json_decode($response, true); // return an array instead of object\n //$watson_reply_message = json_decode($response); // return object instead of array\n\n\n if (isset($watson_reply_message->output->text[0]))\n $watson_output_text = $watson_reply_message->output->text;\n else\n $watson_output_text[] = \"Sorry! Watson service could not reply\";\n\n //store the context in session which will be used before calling the api\n if (isset($watson_reply_message->context)) {\n $return_message['watson_api_context'] = $watson_reply_message->context;\n }\n\n $return_message['watson_reply_text'] = $watson_output_text;\n\n $response = $watson_reply_message['output']['text'][0];\n\n // close curl resource to free up system resources\n curl_close($ch);\n }\n\n return $response;\n }"
] | [
"0.65729666",
"0.6135586",
"0.60326725",
"0.59929335",
"0.5739224",
"0.5725024",
"0.56324434",
"0.56298894",
"0.5580013",
"0.5452184",
"0.5444587",
"0.54277897",
"0.5398656",
"0.5280201",
"0.526189",
"0.52449316",
"0.52394897",
"0.5235516",
"0.5233124",
"0.52252895",
"0.51953816",
"0.5131461",
"0.5130523",
"0.5126297",
"0.5116531",
"0.5104517",
"0.5097309",
"0.508699",
"0.50734925",
"0.5072585",
"0.50617874",
"0.5056408",
"0.5041356",
"0.5040174",
"0.50280935",
"0.5021085",
"0.5008682",
"0.50044554",
"0.49968395",
"0.49893782",
"0.49798834",
"0.4962308",
"0.4935186",
"0.49220556",
"0.49179617",
"0.48920867",
"0.48909444",
"0.486615",
"0.48626196",
"0.4858108",
"0.48558086",
"0.48290658",
"0.48166925",
"0.48069578",
"0.48064458",
"0.48027185",
"0.48013562",
"0.48006853",
"0.47994772",
"0.47920313",
"0.47837475",
"0.4777174",
"0.4775408",
"0.47716683",
"0.47690874",
"0.4765513",
"0.47617504",
"0.47603366",
"0.47561416",
"0.47539234",
"0.47435218",
"0.47416347",
"0.4741364",
"0.4733825",
"0.47284058",
"0.47260776",
"0.4721458",
"0.47133794",
"0.4688401",
"0.46615753",
"0.46566078",
"0.4656466",
"0.46453115",
"0.46440277",
"0.4643808",
"0.46370187",
"0.46345937",
"0.46294197",
"0.46285674",
"0.46281523",
"0.46276674",
"0.46256614",
"0.46219862",
"0.4619851",
"0.46181634",
"0.4617018",
"0.4613708",
"0.46046194",
"0.46037418",
"0.45965648"
] | 0.5671842 | 6 |
Return a Card response | public function card(CardInterface $card)
{
return $this->respond(self::RESPONSE_TYPE_CARD, $card->toArray());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCard() {\n return $this->card;\n }",
"function card_get(){\n\t\tif ($this->get('idspbu') == NULL){\n\t\t\t$this->response(array( 'status' => \"ID SPBU not found\" ), 408);\n\t\t} else {\n\t\t\t$param['id_spbu'] = $this->get('idspbu');\n\t\t\t$param['id_pelanggan'] = $this->get('idpelanggan');\n\t\t\t$param['id_card'] = $this->get('idcard');\n\t\t\t$param['nik'] = $this->get('nik');\n\t\t\t\n\t\t\t$response = $this->rest_model->getCard($this->get('idspbu'), $param);\n\t\t\tif(!empty($response)){\n\t\t\t\t$this->response($response, 200);\n\t\t\t} else {\n\t\t\t\t$this->response(array( 'status' => \"NULL\" ), 406);\n\t\t\t}\n\t\t}\n\t}",
"public function getCard()\n {\n return $this->card;\n }",
"public function getAllCard(){\n $cards = Card::all();\n\n return response()->json([\n 'response_code' => 200,\n 'status' => 'success',\n 'message' => \"berhasil mendapatkan semua card\",\n 'error' => (Object)[],\n 'cards' => $cards\n ],200);\n }",
"public function get_card(){ return $this->_card;}",
"public function card();",
"public function getCardData()\n {\n $cardData = $this->dashboardHelper->getFormattedCardData(request()->all());\n\n return response()->json($cardData);\n }",
"public function card()\n {\n if ( ! $this->bean->card) $this->bean->card = R::dispense('card');\n return $this->bean->card;\n }",
"public function askForCard()\n {\n }",
"public function getCard()\n {\n return $this->vaultHelper->getQuoteCard($this->getSubscription()->getQuote());\n }",
"public function getCard(): ?string\n {\n return $this->card;\n }",
"protected function returnCard()\n {\n $request = $this->request();\n\n $player = $this->getCurrentPlayer();\n\n $this->result()->setCurrent('Decks');\n\n $this->assertParamsNonEmpty(['current_deck']);\n $deckId = $request['current_deck'];\n\n // load deck\n $deck = $this->dbEntity()->deck()->getDeckAsserted($deckId);\n\n // validate deck ownership\n if ($deck->getUsername() != $player->getUsername()) {\n throw new Exception('Can only manipulate own deck', Exception::WARNING);\n }\n\n $this->result()->setCurrent('Decks_edit');\n\n $cardId = $request['return_card'];\n\n $this->service()->deck()->removeCard($deck, $cardId);\n }",
"public function getCards();",
"protected function getCimResponse() {\r\n\t\t$result = new Varien_Object;\r\n\t\t$r \t\t= explode( $this->cim->getDelimiter(), str_replace('\"','',$this->cim->getDirectResponse()) );\r\n\t\t\r\n\t\tif( count($r) > 0 ) {\r\n\t\t\t$result->setResponseCode((int)$r[0])\r\n\t\t\t\t->setResponseSubcode((int)$r[1])\r\n\t\t\t\t->setResponseReasonCode((int)$r[2])\r\n\t\t\t\t->setResponseReasonText($r[3])\r\n\t\t\t\t->setApprovalCode($r[4])\r\n\t\t\t\t->setAvsResultCode($r[5])\r\n\t\t\t\t->setTransactionId($r[6])\r\n\t\t\t\t->setInvoiceNumber($r[7])\r\n\t\t\t\t->setDescription($r[8])\r\n\t\t\t\t->setAmount($r[9])\r\n\t\t\t\t->setMethod($r[10])\r\n\t\t\t\t->setTransactionType($r[11])\r\n\t\t\t\t->setCustomerId($r[12])\r\n\t\t\t\t->setMd5Hash($r[37])\r\n\t\t\t\t->setCardCodeResponseCode($r[38])\r\n\t\t\t\t->setCAVVResponseCode( (isset($r[39])) ? $r[39] : null)\r\n\t\t\t\t->setAccNumber($r[50])\r\n\t\t\t\t->setCardType($r[51])\r\n\t\t\t\t->setSplitTenderId($r[52])\r\n\t\t\t\t->setRequestedAmount($r[53])\r\n\t\t\t\t->setBalanceOnCard($r[54]);\r\n\t\t}\r\n\t\t\r\n\t\treturn $result;\r\n\t}",
"public function dealCardToDealer();",
"public function response(): ResponseContract;",
"protected function getCards($args) {\n\n if ($args['ent_date_time'] == '')\n return $this->_getStatusMessage(1, 1);\n\n $this->curr_date_time = urldecode($args['ent_date_time']);\n\n $returned = $this->_validate_token($args['ent_sess_token'], $args['ent_dev_id'], '2');\n\n if (is_array($returned))\n return $returned;\n\n if ($this->User['stripe_id'] == '')\n return $this->_getStatusMessage(51, 51);\n\n $getCardArr = array('stripe_id' => $this->User['stripe_id']);\n\n $cardsArr = array();\n\n $card = $this->stripe->apiStripe('getCustomer', $getCardArr);\n\n if ($card['error'])\n return array('errNum' => 16, 'errFlag' => 1, 'errMsg' => $card['error']['message'], 'test' => 2);\n\n foreach ($card['cards']['data'] as $c) {\n $cardsArr[] = array('id' => $c['id'], 'last4' => $c['last4'], 'type' => $c['brand'], 'exp_month' => $c['exp_month'], 'exp_year' => $c['exp_year']);\n }\n\n if (count($cardsArr) > 0)\n $errNum = 52;\n else\n $errNum = 51;\n\n $errMsgArr = $this->_getStatusMessage($errNum, 52);\n return array('errNum' => $errMsgArr['errNum'], 'errFlag' => $errMsgArr['errFlag'], 'errMsg' => $errMsgArr['errMsg'], 'cards' => $cardsArr, 'def' => $card['default_card']);\n }",
"public function test_manual_CardPayment_getPaymentURL_response_is_accepted_and_contains_response_attributes()\n {\n $this->markTestIncomplete(\n 'skeleton for manual test of card payment'\n );\n\n $orderLanguage = \"sv\";\n $returnUrl = \"http://foo.bar.com\";\n $ipAddress = \"127.0.0.1\";\n\n // create order\n $order = TestUtil::createOrder(TestUtil::createIndividualCustomer(\"SE\")->setIpAddress($ipAddress));\n $order->setClientOrderNumber(\"foobar\" . date('c'));\n // set payment method\n // call getPaymentURL\n $response = $order\n ->usePaymentMethod(PaymentMethod::KORTCERT)\n ->setPayPageLanguage($orderLanguage)\n ->setReturnUrl($returnUrl)\n ->getPaymentUrl();\n\n // check that request was accepted\n ////print_r($response);\n $this->assertEquals(1, $response->accepted);\n\n // check that response set id, created exist and not null\n $this->assertTrue(isset($response->id));\n $this->assertTrue(isset($response->created));\n // check that request response contains url\n $this->assertEquals(\"https://test\", substr($response->url, 0, 12));\n // check that request response contains testurl\n $this->assertEquals(\"https://test\", substr($response->testurl, 0, 12));\n }",
"protected function parseCardsResponse(array $list)\n\t{\n\t\t$cards = [];\n\n\t\tforeach ($list as $row)\n\t\t{\n\t\t\t$cards[] = new Card([\n\t\t\t\t'code' => $row['CardCode'],\n\t\t\t\t'serial' => $row['CardSerial'],\n\t\t\t\t'expire' => $row['ExpriceDate'],\n\t\t\t]);\n\t\t}\n\n\t\treturn $cards;\n\t}",
"public function getCard(): ?bool\n {\n return $this->card;\n }",
"public function getCard(): bool {\n $result = $this->mysqli->query(\"SELECT * FROM cards WHERE id='{$this->id}'\");\n if($result->num_rows == 1) { # Card exists in database\n $card = $result->fetch_assoc();\n $this->cardNum = $card['card_num'];\n $this->name = $card['name'];\n $this->billingAddress = $card['billing_address'];\n $this->exp = $card['exp'];\n $this->securityCode = $card['security_code'];\n return true;\n } else { # Card doesn't exist yet\n return false;\n }\n }",
"function CardInfo(){\r\n }",
"public function get_card_info($card_id, Request $request){\n\t\t\n\t\t$login_info = $request->session()->get('total_info');\n\t\t\n\t\t$card = App\\Card::find($card_id);\n\t\tif(null !== $card){\n\t\t\t$card->valid_forever = ($card->valid_period == null);\n\t\t\t$card->expire_remain_days = floor( (strtotime($card->valid_period) - time()) / 86400 );\n\t\t\t$card->dealer;\n\t\t\t$card->product;\n\t\t\t$card->customer;\n\t\t\t$card->product_stock = App\\Stock::getDealerStockInfo($card->product_id, $login_info['dealer_id']);\n\t\t\tif($card->product){\n\t\t\t\t$card->product->level1_info;\n\t\t\t\t$card->product->level2_info;\n\t\t\t}\n\t\t\t$return_arr = array(\"status\" => true, 'card' => $card);\n\t\t}else{\n\t\t\t$return_arr = array(\"status\" => false);\n\t\t}\n\t\techo json_encode($return_arr);\n\t}",
"public function build(): ListCardsResponse\n {\n return CoreHelper::clone($this->instance);\n }",
"public function getResponseClass(): string\n {\n return 'GetCardBindingsResponse';\n }",
"protected function getCardData()\n {\n $this->getCard()->validate();\n\n $card = array();\n $card['name'] = $this->getCard()->getName();\n $card['number'] = $this->getCard()->getNumber();\n $card['expiry_month'] = $this->getCard()->getExpiryDate('m');\n $card['expiry_year'] = $this->getCard()->getExpiryDate('y');\n $card['cvd'] = $this->getCard()->getCvv();\n\n return $card;\n }",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function creditcardvalidationAction()\n {\n \t$post = $this->bodyParams();\n\t\t$card = new CreditCardDataEntity($post);\n\n\t\t$result = $this->creditcardService->validateCreditCard($card, $post['amount']);\n\n\t\tswitch(get_class($result)):\n\t\t\tcase 'Zend\\Json\\Server\\Error':\n\t\t\t\treturn new ApiProblemResponse(\n\t\t new ApiProblem(\n\t\t $result->getCode() ,\n\t\t $result->getMessage(),\n\t\t 'http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html',\n\t\t null,\n\t\t ['additional details'=>$result->getData()]\n\t\t )\n\t\t );\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t$hydrator = new \\Zend\\Stdlib\\Hydrator\\Reflection;\n\t\t\t\t$class = new \\Openy\\V1\\Rest\\Creditcard\\CreditcardEntity;\n\t\t\t\t$result = $hydrator->extract($result);\n\t\t\t\t$result = $hydrator->hydrate($result,$class);\n\t\t\t\t$result = get_object_vars($result);\n\t\t\t\treturn new JsonModel($result);\n\t\t\t\tbreak;\n\t\tendswitch;\n }",
"public function getCardcode()\n {\n return $this->cardcode;\n }",
"public function needCard() {\n return FALSE;\n }",
"public function cardAuthorization(Request $request)\n {\n\n $card = new PaymentGateway($request);\n\n $token = $card->createCardIdentifier();\n\n if ( $token instanceof ResponseInterface) {\n return new JsonResponse(json_decode($token->getBody()->__toString()), 200);\n }\n\n return new JsonResponse(\n 'Error creating a Card Token',\n 201\n );\n }",
"public function getResponse() {}",
"public function getResponse() {}",
"public function makeActive(card $card)\n {\n $card->makeActive();\n\n if (request()->wantsJson()) {\n return response([], 204);\n }\n }",
"abstract public function response();",
"public function omise_create_card()\n\t\t{\n\t\t\t$token = isset ( $_POST['omise_token'] ) ? wc_clean ( $_POST['omise_token'] ) : '';\n\n\t\t\tif ( empty( $token ) ) {\n\t\t\t\tOmise_Util::render_json_error( 'omise_token is required' );\n\t\t\t\tdie();\n\t\t\t}\n\n\t\t\tif ( ! wp_verify_nonce($_POST['omise_nonce'], 'omise_add_card' ) ) {\n\t\t\t\tOmise_Util::render_json_error( 'Nonce verification failure' );\n\t\t\t\tdie();\n\t\t\t}\n\n\t\t\ttry {\n\t\t\t\t$card = $this->customerCard->create($this->omise_customer_id, $token);\n\t\t\t\techo json_encode( $card );\n\t\t\t} catch( Exception $e ) {\n\t\t\t\techo json_encode( array(\n\t\t\t\t\t'object' => 'error',\n\t\t\t\t\t'message' => $e->getMessage()\n\t\t\t\t) );\n\t\t\t}\n\n\t\t\tdie();\n\t\t}",
"public function reponse()\n {\n $paymentResponse = new Mercanet('S9i8qClCnb2CZU3y3Vn0toIOgz3z_aBi79akR30vM9o');\n\n $paymentResponse->setResponse($_POST);\n\n if ($paymentResponse->isValid() && $paymentResponse->isSuccessful()) {\n // Traitement pour les paiements valides\n return $this->render('shop/commande-ok.html.twig');\n } else {\n // Traitement pour les paiements en echec\n return $this->render('shop/commande-echec.html.twig');\n }\n }",
"public function getIdCard()\n {\n return $this->id_card;\n }",
"public function pay_by_card($data) {\r\n\r\n $result = json_decode($this->call_restfull->call_API('POST', $data, $this->api_pay_by_card, $this->getConfigData), true);\r\n\r\n return $result;\r\n }",
"public function getCards()\n {\n $response = $this->dashboardHelper->getCards();;\n\n $response = array_map(function ($card) {\n if ($card['view_url'] ?? false) {\n $card['view_url'] = route($card['view_url'], $card['url_params'] ?? []);\n }\n\n return $card;\n }, $response);\n\n return response()->json($response);\n }",
"public function actionCardContent()\n\t{\n\t\tif(FacebookController::getUserID() ==0)\n\t\t{\n\t\t\t$error = new ErrorController('error');\n\t\t\t$error->actionFaildUserID();\n\t\t\treturn ;\n\t\t}\n\t\t$card_id = $_GET[\"card_id\"];\n\t\t$user_id = FacebookController::getUserID();\n\t\t$cat_name = $_GET[\"cat\"];\n\t\t// To be Change\n\t\t$num = $card_id % 7 ;\n\t\t$num++;\n\t\t$picName = array(\"nancyCompBG\", \"nancyfbCover\",\"nancyfbPP\",\"nancymobileBG\");\n\t\t// end change\n\t /** @type string represent card's images urls */\t\t\n\t\t$picURL = array();\n\t\tfor ($i=0 ; $i <count($picName) ; $i++)\n\t\t{\n\t\t\t$picURL[$i] = UtilityController::siteUrl(). $num. \"/\". $picName[$i]. \".jpg\";\n\t\t}\n\t\t/** @type string represent card's css elements */\n\t\t$cssName = array(\"compBG\", \"fbCover\",\"fbPP\",\"mobileBG\");\n\t\t$this->render('cardContent',array('card_id'=>$card_id,'user_id'=>$user_id,'cat_name'=>$cat_name,'picURL'=>$picURL,'cssName'=>$cssName));\n\t}",
"public function getCidCard()\n {\n return $this->cid_card;\n }",
"public function getResponse() {\n }",
"public function getCardDetails($parameters = array())\n {\n return $this->createRequest('TopBetta\\Services\\Accounting\\Gateways\\Message\\RapidDirectGetCardRequest', $parameters);\n }",
"public function getCards()\n {\n return $this->cards;\n }",
"public function getCards()\n {\n return $this->cards;\n }",
"public function getCards()\n {\n return $this->cards;\n }",
"public function card_details(Request $request) {\n\n $cards = Card::select('user_id as id','id as card_id','customer_id',\n 'last_four', 'card_token', 'is_default', \n \\DB::raw('DATE_FORMAT(created_at , \"%e %b %y\") as created_date'))\n ->where('user_id', $request->id)->get();\n\n $cards = (!empty($cards) && $cards != null) ? $cards : [];\n\n $response_array = ['success'=>true, 'data'=>$cards];\n\n return response()->json($response_array, 200);\n }",
"function chooseCard () {\n\tglobal $sql;\n\t$response = array();\n\t$gameid = @$_COOKIE['gameid']?:\"\";\n\t$card = @$_GET['card']?:\"\";\n\t$offdef = @$_GET['offdef']?:\"\";\n\t\n\t$Query = $sql->prepare(\"UPDATE `fliip_games` SET `fg_\".$offdef.\"` = ? WHERE `fg_id` = ?\".\n\t\t\t\t\t\t\t/* control to only set Offense card if Defense is not yet set, and as a contrary only set Defense if Offense is already set */\n\t\t\t\t\t\t\t\" AND \".($offdef==\"offense\"?\"`fg_defense` is NULL\":\"`fg_offense` is not NULL\"));\n\t$Query->bind_param(\"si\",$card,$gameid);\n\t$Query->execute();\n\tif ($Query->affected_rows > 0) {\n\t\t$response['status']=\"OK\";\n\t\t$response['html']=\"Card \".$card.\" recorded successfully for \".$offdef.\". (gameid=\".$gameid.\")\";\n\t} else {\n\t\t$response['status']=\"ERROR\";\n\t\t$response['html']=\"Card \".$card.\" not valid, gameid \".$gameid.\" (empty if no cookie) not found, side \".$offdef.\" error or try to change offense after defense choice or SQL error.\";\n\t}\n\treturn (@$_GET['format']==\"json\")?json_encode($response):$response['html'];\n}",
"public function build(): DeleteCustomerCardResponse\n {\n return CoreHelper::clone($this->instance);\n }",
"function getCardDetail()\n {\n $disabled = array();\n $required = array();\n \n if ($this->vars[\"card_id\"]) {\n $action = 2; // modify\n // find all the disabled fields for current action\n foreach ($this->fieldData[\"detailview\"] as $dkey => $dval) {\n if (in_array($action, $dval[\"disabled\"])) {\n $disabled[] = $dkey;\n }\n }\n // find all the required fields for current action\n foreach ($this->fieldData[\"detailview\"] as $rkey => $rval) {\n if (in_array($action, $rval[\"required\"])) {\n $required[] = $rkey;\n }\n }\n\n $res =& $this->db->query(\"SELECT * FROM `module_isic_card` WHERE `id` = !\", $this->vars[\"card_id\"]);\n $result = array();\n if ($data = $res->fetch_assoc()) {\n $t_pic = str_replace(\"_thumb.jpg\", \".jpg\", $data[\"pic\"]);\n if (file_exists(SITE_PATH . $t_pic)) {\n $data[\"pic\"] = $t_pic;\n } else {\n $data[\"pic\"] = \"\";\n }\n $data[\"person_birthday\"] = date(\"d/m/Y\", strtotime($data[\"person_birthday\"]));\n $data[\"expiration_date\"] = date(\"d/m/Y\", strtotime($data[\"expiration_date\"]));\n $data[\"status_id\"] = $data[\"status_id\"] ? $data[\"status_id\"] : '';\n $data[\"bank_id\"] = $data[\"bank_id\"] ? $data[\"bank_id\"] : '';\n $result[] = $data;\n echo JsonEncoder::encode(array('success' => true, 'data' => $result, 'disable' => $disabled, 'require' => $required));\n } else {\n echo JsonEncoder::encode(array('error' => 'cold not load data'));\n }\n } else {\n $action = 1; // add\n // find all the disabled fields for current action\n foreach ($this->fieldData[\"detailview\"] as $dkey => $dval) {\n if (in_array($action, $dval[\"disabled\"])) {\n $disabled[] = $dkey;\n }\n }\n // find all the required fields for current action\n foreach ($this->fieldData[\"detailview\"] as $rkey => $rval) {\n if (in_array($action, $rval[\"required\"])) {\n $required[] = $rkey;\n }\n }\n $result[] = array(\"pic\" => \"\");\n echo JsonEncoder::encode(array('success' => true, 'data' => $result, 'disable' => $disabled, 'require' => $required));\n }\n exit();\n }",
"public function cardPay($json) \n\t{\t\t\n\t\t$pay = $this->cardPayment($json);\t\t\n\t\treturn $pay;\n\t}",
"public function addCard()\n {\n }",
"public function testGetCardInfo()\n {\n $card = factory('App\\Card')->create();\n\n $response = $this->actingAs($card->owner, 'api')\n ->withHeader('Accept', 'application/json')\n ->get(route('api.cards.info', [$card->number]));\n\n $response->assertOk();\n $response->assertJsonStructure([\n 'currency',\n 'owner',\n ]);\n }",
"public function card()\r\n {\r\n return [\r\n [\r\n 'title' => Az::l('Первый этап'),\r\n 'items' => [\r\n [\r\n 'title' => Az::l('Форма'),\r\n 'items' => [\r\n [\r\n 'id',\r\n 'catalogId',\r\n 'name',\r\n 'amount',\r\n 'title',\r\n 'url',\r\n 'visible',\r\n 'image',\r\n 'new_price',\r\n 'price_old',\r\n 'currency',\r\n 'currencyType',\r\n 'cart_amount',\r\n 'delivery_type',\r\n 'delivery_price',\r\n 'review_count',\r\n 'measure',\r\n 'measureStep',\r\n 'rating',\r\n 'cash_type',\r\n 'action',\r\n ],\r\n ],\r\n ],\r\n ],\r\n ],\r\n ];\r\n }",
"public function getResponse()\n {\n }",
"public function getResponse() {\n\t}",
"public function stock_get_qr_code($card_id, Request $request){\n\t\t$card = App\\Card::find($card_id);\n\t\tif($card !== null){\n\t\t\t$qr_code_str = base64_encode(json_encode(array(\"code\" => $card->code, \"password\" => $card->passwd)));\n\t\t\t$code_image = 'card/qrcode_'.$card->id.'.png';\n\t\t\t\n\t\t\tif(!is_file(public_path($code_image))){\n\t\t\t\t$renderer = new \\BaconQrCode\\Renderer\\Image\\Png();\n\t\t\t\t$renderer->setHeight(256);\n\t\t\t\t$renderer->setWidth(256);\n\t\t\t\t$writer = new \\BaconQrCode\\Writer($renderer);\n\t\t\t\t$writer->writeFile($qr_code_str, public_path($code_image));\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$return_arr = array(\"status\" => true, \"img_code\" => $code_image);\n\t\t}else{\n\t\t\t$return_arr = array(\"status\" => false);\n\t\t}\n\t\techo json_encode($return_arr);\n\t}",
"public function inCard()\n {\n return $this->inCard;\n }",
"public function inCard()\n {\n return $this->inCard;\n }",
"function getStatusDescription($statusResponse) {\n if ($statusResponse == \"\" || $statusResponse == \"No Value Returned\") {\n $result = \"3DS not supported or there was no 3DS data provided\";\n } else {\n switch ($statusResponse) {\n Case \"Y\" : $result = \"The cardholder was successfully authenticated.\"; break;\n Case \"E\" : $result = \"The cardholder is not enrolled.\"; break;\n Case \"N\" : $result = \"The cardholder was not verified.\"; break;\n Case \"U\" : $result = \"The cardholder's Issuer was unable to authenticate due to some system error at the Issuer.\"; break;\n Case \"F\" : $result = \"There was an error in the format of the request from the merchant.\"; break;\n Case \"A\" : $result = \"Authentication of your Merchant ID and Password to the ACS Directory Failed.\"; break;\n Case \"D\" : $result = \"Error communicating with the Directory Server.\"; break;\n Case \"C\" : $result = \"The card type is not supported for authentication.\"; break;\n Case \"S\" : $result = \"The signature on the response received from the Issuer could not be validated.\"; break;\n Case \"P\" : $result = \"Error parsing input from Issuer.\"; break;\n Case \"I\" : $result = \"Internal Payment Server system error.\"; break;\n default : $result = \"Unable to be determined\"; break;\n }\n }\n return $result;\n }",
"public function response ();",
"public static function movecard_returns() {\n return new external_single_structure(\n array(\n 'warnings' => new external_warnings()\n )\n );\n }",
"public function printCardInfo() {\n\t\tprint $this->strRepresentation();\n\t}",
"public function response();",
"function createCard($account_id) {\n // final product looks like this: https://www.w3schools.com/w3css/tryit.asp?filename=tryw3css_cards_buttons2\n\n $con = Connection::connect();\n $stmt = $con->prepare(\"select * from Account where account_ID = ? and active = 0\");\n $stmt->bindValue(1, $account_id, PDO::PARAM_INT);\n $stmt->execute();\n $row = $stmt->fetch(PDO::FETCH_ASSOC);\n\n if ($row != null) {\n return \"\";\n }\n\n $image = \"data:image/jpeg;base64, /9j/4AAQSkZJRgABAQAAAQABAAD/2wBDABQQEBkSGScXFycyJh8mMi4mJiYmLj41NTU1NT5EQUFBQUFBRERERERERERERERERERERERERERERERERERERET/2wBDARUZGSAcICYYGCY2JiAmNkQ2Kys2REREQjVCRERERERERERERERERERERERERERERERERERERERERERERERERET/wAARCAJYAlgDACIAAREBAhEB/8QAGgABAQEBAQEBAAAAAAAAAAAAAAEEAwIFBv/EACcQAQACAgEDBAIDAQEAAAAAAAABAgMRMQQSITJBUWETcSJCkVKB/8QAFQEBAQAAAAAAAAAAAAAAAAAAAAH/xAAUEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMAAAERAhEAPwD9UAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAgqAAAAAAAgoD0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAACAAAAAAAAgAAD2AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAACAKgAAAAAiiAAAAA9gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAgCoAAAAAAIAAAAAAD2AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAACAAAAAAAAAgAAAAAAICoAAAAAIKA9gAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAkzEcgo426isceXKeptPEaBrGGc1593ibTPMg+huITuj5fPAfR3Eq+asWmOJB9EYYzXj3e46m0cxsGsca9RWefDrExPAKAAAAAAgAAAAAAAIAAAAAAACKAgGwAACQBA5AdAAAAAAAAAAAAAAAAAAAAAAAAAAASZ15kFeLXrTmXHJ1HtT/WeZmfMg7X6mZ9Phxm028z5QUAAAAAAAAAAFi018x4QBop1Mx6vLvW9b8SwLEzHmEH0Rmx9R7X/ANaImJ8wCoqAAAAAAAIqAAAAAAAIKCAAAAIqAAAAA6AAAAAAAAAAAAAAAAAAAAAAAAA55csY4+wW+SKRuWPJkm/PHw82tNp3KKAAAAAAAAAAAAAAAAAAD3jyzTjj4eAG+mSLxuHp8+tprO4bMWWMkfaDoAAAACAAAAAAAAgAAAAIoAIqAAACAOoAAAAAAAAAAAAAAAAAAAAAAPN7RSNyDzkyRjj7YpmbTuVvebzuXlQAAAAAAAAAAAAAAAAAAAAAAWJms7jlAG7HkjJH29vn0vNJ3DdW0XjcIPSKgAAAAAAAIAAAAAioAAAAAigAgDqAAAAAAAAAAAAAAAAAAAAAAxZsnfOo4h3z5O2NRzLGAAoAAAAAAAAAAAAAAAAAAAAAACKCOuHJ2TqeJcgH0RxwZO6NTzDsgAAAAAAgAAAAAIKgAAAACKgAAOoAAAAAAAAAAAAAAAAAAACcK49Rftrr5BmyX77TLwCgAAAAAAAAAAAAAAAAAAAAAAioAAAAD3jv2WiW7l85s6e3dXXwg6gAAAIABsAEUBBUAAAABBUAABBQHUAAAAAAAAAAAAAAAAAAABiz27rfpsmdRt8+Z3OwQBQAAAAAAAAAAAAAAAAAAAAAAQAAAAAHXBbtt+3IideYB9ESJ3G/kQUEBUAARQQAAAAAEFAQABFAQAHYAAAAAAAAAAAAAAAAAAAHLPOqSxNXVT4iGUABQAAAAAAAAAAAAAAAAAABABUAAAAAAAABswTukOrP00+JhoQQAAEBQQFQAAAAQAABABdiAAAOwAAAAAAAAAAAAAAAAAAAMvVT5iGd36n1R+nBQAAAAAAAAAAAAAAAAAABAVAAAAAAAAAAEAaOm5lpZem9U/pqQAAAAEAAAAEAAAAASVQAAD9gA7AAAAAAAAAAAAAAAAAAAAydT6o/Tg0dTzDOoAAAAAAAAAAAAAAAAAAgAAAAAAAAAAAIADv03qn9NTN03MtKAAAgAAAAgKgAAAJKpMgB5ABCQUQB3AAAAAAAAAAAAAAAAAAABn6qPESytvURun6YgAFAAAAAAAAAAAAAABAAAAAAAAAAAAQAAAaemjxMtDlgjVHVAQADYAAAgAAAAIAAAioAAAADuAAAAAAAAAAAAAAAAAAADzaO6Jj5fPfSYc9e28/fkHMBQAAAAAAAAAAAABAAAAAAAAAAARQBAAAdMNe68fXkGysdsRCiIKgAAAgAB+wABAA2AAAIAAHsAIA0AAAAAAAAAAAAAAAAAAAAOHU03Xu+HdJjcakHzh6vXtmYl5UAAAAAAAAAAAQFQAAAAAAAAAEFBAAAAGrp6ajfyzVr3TEQ3xGo1AACAAAgAqAAACAAAAioAAAIoCAA0AAAAAAAAAAAAAAAAAAAAAAz9Rj3HdHsyvosWXH2T9ewOYCgAAAAAAAAgAAAAAAAAAAgAqAAAA94qd869vcHbp6ajun3dzgQAAEVAAAEUBAAAABOQACQBFBAAQUBoAAAAAAAAAAAAAAAAAAAAAAeMlIvGpewHzrVms6lG3Ni743HLFMa8SoAAAAAgKIAAAAAAAAAAAgAAAAERsFiJtOobcdIpGnnFi7I3PLogqAAAAgAAACAAAIbVAAAAQFQABAFEAaQAAAAAAAAAAAAAAAAAAAAAAAHHNh7/McuyA+dMa8SNuTFF/2x2pNJ1KiAAAgAAAAAAAAAIAAAAAD1Ws3nUA8xG/DXixdnmeXrFiin3Py9oKgAAAgEgAAIAAHACAC/SAAIAoIAciAogAADSAAAAAAAAAAAAAAAAAAAAAAACAAJasWjUqAyZME1818w4voud8Nb/UgwjrfBavHmHNRAAAAAAAABAAAAdaYLW58Q0UxVp+wcMeCbeZ8Q01rFY1D0iABsAAENAAAACAqAAACAAAAIABIgKCAEgCCgNIAAAAAAAAAAAAAAAAAAAAACAAAAAAAA8Wx1tzD0A4W6aP6y5WwXj222APnzWY5hH0UmtZ5iAfPG78VfiD8VPgGEbvxUj2WK1jiIBgiszxG3SuC8/X7bAGevTR/aXatK14h6AQVAAAAAAQFSQAJABDYAAAkAAAAgAAASigIABIb90AABqAAAAAAAAAAAAAAAAAAAARUABJmI8yCjhfqYj0+We2S1+ZBrtlrXmXK3U/8AMf6zCjr+e+97dadTH9mUB9CtotxKvnxOvMOlc9o+0GwcK9THvGnSMtJ9wexInfCgAgAAAkzp4nLWPcHQZ7dTEcQ52z3n6BqtaK8zpxv1Mf1hmmd8ijp+e+97e69T/wBQzgNtctbe/l0fOe65LV4nwg2jhTqIn1eHaJieAUDkBCDYAAAgAAAAAIAiooIACoACAAH2A1AAAAAAAAAAAAAAAAAAAgBM6eMmWKc8/DJfLa/PHwDvk6iI8V8s1rTadyiKKioAAAAAAAAAsXtHEy8qD1+W/wAr+a/y5gPf5b/KTe0+8vIAAAAAioAAACAPVbTXzEomwasfURPiztt897plmnHANo8UyRfjn4e0AEAAARUAAARUAiQAAQAAANIAADWAAAAAAAAAAAAAAAACAOOXP2+K8vObN/Wv+swEzvzICgCAAAAAAAAAAAIAAAAAAACKAgAAAAgAAAABvU7hqxZu7xbllQH0BnxZv62/1oQA5QF0nKoBIACAAAAkqgCKbAQIAABrAAAAAAAAAAAAAAAAZs+b+tf/AF6z5e3+McsgACgioAAAAAAAAAgoCAAAAAAAACAAAAAAgAAAAAAIAA0Yc39bf+M4D6COOHL3fxnl2QDYAciALKCAogAAAgAAABADWAAAAAAAAAAAAAA8ZL9kbemLLk77b9vYHiZmZ3KAoAAgAAAAAAAAACKgAAAAAAAIAAAAACAAAAAAgKioAAAABE6nw2Uv312xvWO/bP17g2ofYgAAIqASAASgAAAQICgA1gAAAAAAAAAAAAkzryDj1F9R2xzLI9Xt32mXlQBAVAAAAAAAAAAAAQAAAAAAQFQAAAAQBUAAAAAEVAAAAAASQAAacF9x2/DsxUt2zts3uNwCiCAABIIAAACAoiggANgAAAAAAAAAAIA49RfVdfLsxZrd1p+vAOYCgioAAAAAAAAAAAIAAAAAAAIAAAAIAAAAAAAIAAAAAAgAAAAI1YLbjU+zK6Yrdtv2DYgIAIAAAACKgCoAAANgAAAAAAAAIAADze3bWZYGrqbaiI+WUBBVEAAAAAAAAEAUQAAAAAAARUAAAABFEAAAAABAVAAAAABAAAARUAAAbaW7oiXpx6e3jXw6oAAAigSioAqKCAAAA2AAAAAAAAgAAAMfUTu2vhyesk7tM/bwoAAAAAAAAAAAgAAAAAACKgAAAAAgAAAAAbEBUAAAAABAAAAQUBAAAB1wT/L9tLHSdWiWwAOBADaAKIAqAAAAANgAAAAACKgAACTOo2rxkn+M/oGFAUAAAAAAAAAQAAAAAABFQAAAABBQQAAAAABFQAAAEBUVANAAAAIqAAACADdHnyxNmP0x+gegEEUNgipsAAAAn4AAUbAEAABAAAAAAeMvol7eMvokGABQAAAAAAEAAAAAAAAQAAAAAJQAAAAAEBUAAAAABFQAAAEAAAAABAAAGzFP8IY2zH6YB7AQQAA+gAIDYIoigEgNoCACAAAAAAAOeX0S6OeX0SDCAoAAAAAAIAAAAAAACAAAASIAKgAAAAAAIAAACKIAAAACKgAAAACAAAANmP0wxtmP0wD2hyIHAICgASCKKIAAINoIAAAAAAAAA55fRL28ZfRIMICgAACAqAAAAAAigCAAAACACoAAAAAIAqAAAAigIAAAAioCoAAACAAAAAA2YvTDG2Y/TAPRIIAAACiSqScAAIAQA2AAAAAAAAIADxl9Evbxl9EgwgKAICoqAAAAAAAIAAAAACAAAAAAAAgAAAIoAgAAAAgLKAAAAIAAAAAAgDZj9MMbbi9MfoHpUEABQAAEP0gCoC+wQA1gAAAAAgAAADxm9EgDCAoAAgAAAAACAAAAAAACAAAAAAIAAAAACAAAAAAgAAAAAgAAACAAACteP0wAPYCAnIKAALsBBDQAv2Ao/9k=\";\n\n $user = User::fromID($account_id);\n $location = $user->formatCityAndState();\n if ($location == \"\") {\n $location = getApproximateLocation($account_id);\n }\n //$imageSrc = file_get_contents(\"http://corsair.cs.iupui.edu:22891/courseproject/image.php?account_id=\" . $account_id);\n //$imageSrc = \"http://corsair.cs.iupui.edu:22891/courseproject/image.php?account_id=\" . $account_id;\n\n return '<div class=\"w3-container\" style=\"display: inline-block; text-align: center; order: ' . $account_id . ';\">\n <div class=\"w3-card-4 w3-margin-bottom\">\n <header class=\"w3-container w3-pale-red\">\n <h3>'.$user->formatName().'</h3>\n </header>\n <div class=\"w3-container w3-text-grey w3-white\">\n <div class=\"w3-row-padding\">\n <div class=\"w3-third\">\n <div class = \"w3-padding-16\" style=\"position: relative; top: 50%;\">\n <img id=\"' . $account_id . '\" class=\"w3-circle w3-border\" src=\"' . $image . '\" style=\"width: 100%;\" alt=\"Avatar\">\n </div>\n <p style=\"margin:0.25em;\">' . getUserMentorshipPreference($account_id) . \" / \" . $user->formatGender() . '</p>\n </div>\n <div class=\"w3-twothird w3-small\" style=\"text-align: left;\">' . formatDegreesAndJobs(getDegrees($account_id), getJobs($account_id)) . '</div>\n </div>\n <hr>\n <p>' . $location . '</p>\n </div>\n <a class=\"w3-button w3-block w3-dark-grey\" href=\"profile.php?user=' . $account_id . '\">+ View Profile</a>\n </div></div>';\n}",
"public function card()\r\n {\r\n return [\r\n [\r\n 'title' => Az::l('Первый этап'),\r\n 'items' => [\r\n [\r\n 'title' => Az::l('Форма'),\r\n 'items' => [\r\n [\r\n 'id',\r\n 'name',\r\n 'date_deliver',\r\n 'created_at',\r\n 'status',\r\n 'shipment_type',\r\n 'prepayment',\r\n 'currency_type',\r\n ],\r\n ],\r\n ],\r\n ],\r\n ],\r\n ];\r\n }",
"public function getNameCard()\n {\n return $this->get(self::_NAME_CARD);\n }",
"public function getCardCvv()\n\t{\n\t\treturn $this->type;\n\t}",
"public function createCard(){\n if(Input::has('name') && Input::has('email') && Input::has('phone') && Input::has('company') && Input::has('position')){\n\n $user = User::where('_id', '=', Session::get('id'))->first();\n if($user){\n $card = $user->card;\n if($card == null){\n\n $user->card = array(\n 'name' => Input::get('name'),\n 'email' => Input::get('email'),\n 'photo' => Input::get('photo'),\n 'phone' => Input::get('phone'),\n 'company' => Input::get('company'),\n 'position' => Input::get('position')\n );\n $user->isCompleted = true;\n $user->save();\n\n return Response::json(\n array('reason' => 'card created and profile completed', 'status' => 0))->setCallback(Input::get('callback'));\n }\n\n return Response::json(\n array('reason' => 'existent user card', 'status' => 1))->setCallback(Input::get('callback'));\n }\n return Response::json(\n array('reason' => 'user not exist', 'status' => 2))->setCallback(Input::get('callback'));\n }\n return Response::json(\n array('reason' => 'fields arguments are icorrect', 'status' => 3))->setCallback(Input::get('callback'));\n }",
"public function actionPaymentcard()\n\t{ \n\t\t\n\t\tif( isset($_SESSION['invoice_id']) )\n\t\t{\n\t\t\t$invoiceModel = new Invoices;\n\t\t\t$payment\t\t= $invoiceModel->getInvoicePayment( $_SESSION['invoice_id'] );\n\t\t\t# Add 2% of the total in the invoice total for creditcard only\n\t\t\t$twoPercentAmount = ($payment[0]['payment_amount'] * 2)/100;\n\t\t\t$payment[0]['payment_amount'] += round($twoPercentAmount, 2);\n\t\t\t$this->render(\"cardForm\", array(\"payment\"=>$payment));\n \t\t}\n\t\t\n\t}",
"public function giftcard()\n {\n // for API brands\n $var = preg_split(\"/\\//\", $this->url->current());\n $new = str_replace('%20', ' ', $var[5]);\n try {\n $client = new GuzzleHttpClient();\n $apiRequest = $client->request('GET', 'https://eo2i7chdqb.execute-api.us-east-1.amazonaws.com/dev/api/templates');\n $content = json_decode($apiRequest->getBody()->getContents());\n\n foreach ($content as $key => $value){\n if($value->template == $new){\n $data[] = array(\n 'template' => $value->template,\n 'denominations' => $value->denominations,\n 'thumbnail' => $value->thumbnail,\n );\n }\n }\n $data_array = json_encode($data);\n $data_object['res'] = json_decode($data_array , true);\n $data_object['fword'] = preg_split(\"/\\s+/\", $data[0]['template'], -1, PREG_SPLIT_NO_EMPTY);\n return view('giftcard',$data_object);\n } catch (RequestException $re) {\n }\n }",
"public function show(Deck $deck)\n {\n\n return $this->response->item(\n $deck,\n $this->transformer(),\n $this->parameters()\n )->setStatusCode(201);\n }",
"public function newDeck()\n {\n return response()->json(\\Deck::newDeck(false));\n }",
"function execute()\r\n {\r\n\t\t$cardName = urldecode($this->getRequest()->cardName);\r\n\t\t$cardInfo = TextHelper::getCardText($cardName);\r\n\r\n switch($this->getFormat())\r\n {\r\n case \"json\":\r\n $this->getResponse()->cardInfo = json_encode($cardInfo);\r\n $this->getResponse()->render(ROOT_DIRECTORY . \"/views/textData.json.tpl.php\");\r\n break;\r\n case \"html\":\r\n $this->getResponse()->cardInfo = $cardInfo;\r\n $this->getResponse()->render(ROOT_DIRECTORY . \"/views/textData.html.tpl.php\");\r\n break;\r\n default:\r\n $this->getResponse()->redirect(BASE_URL);\r\n break;\r\n }\r\n }",
"public function getStoredCards()\n {\n if (!$this->getData('stored_cards')) {\n $cards = array(); // Array to hold card objects\n \n $customer = $this->getCustomer();\n $cimGatewayId = $customer->getCimGatewayId();\n\n if (!$cimGatewayId) {\n if($this->isAdmin() && Mage::getModel('authorizenetcim/profile')->isAllowGuestCimProfile()) {\n $orderId = Mage::getSingleton('adminhtml/session_quote')->getOrderId();\n if (!$orderId) $orderId = Mage::getSingleton('adminhtml/session_quote')->getReordered();\n if (!$orderId) return false;\n $order = Mage::getModel('sales/order')->load($orderId);\n $payment = $order->getPayment();\n if ($payment) {\n $cimCustomerId = $payment->getData('authorizenetcim_customer_id');\n $cimPaymentId = $payment->getData('authorizenetcim_payment_id');\n }\n } else {\n return false;\n }\n }\n\n if ($cimGatewayId) {\n $cim_profile = Mage::getModel('authorizenetcim/profile')->getCustomerProfile($cimGatewayId);\n if ($cim_profile) {\n if (isset($cim_profile->paymentProfiles) && is_object($cim_profile->paymentProfiles)) {\n /**\n * The Soap XML response may be a single stdClass or it may be an\n * array. We need to adjust it to make it uniform.\n */\n if (is_array($cim_profile->paymentProfiles->CustomerPaymentProfileMaskedType)) {\n $payment_profiles = $cim_profile->paymentProfiles->CustomerPaymentProfileMaskedType;\n } else {\n $payment_profiles = array($cim_profile->paymentProfiles->CustomerPaymentProfileMaskedType);\n }\n }\n }\n } else {\n if ($cimCustomerId && $cimPaymentId) {\n $payment_profiles = array(Mage::getModel('authorizenetcim/profile')->getCustomerPaymentProfile($cimCustomerId, $cimPaymentId));\n } else {\n return false;\n }\n }\n\n if (isset($payment_profiles) && $payment_profiles) {\n // Assign card objects to array\n foreach ($payment_profiles as $payment_profile) {\n $card = new Varien_Object();\n $card->setCcNumber($payment_profile->payment->creditCard->cardNumber)\n ->setGatewayId($payment_profile->customerPaymentProfileId)\n ->setFirstname($payment_profile->billTo->firstName)\n ->setLastname($payment_profile->billTo->lastName)\n ->setAddress($payment_profile->billTo->address)\n ->setCity($payment_profile->billTo->city)\n ->setState($payment_profile->billTo->state)\n ->setZip($payment_profile->billTo->zip)\n ->setCountry($payment_profile->billTo->country);\n $cards[] = $card;\n }\n }\n \n if (!empty($cards)) {\n $this->setData('stored_cards', $cards);\n } else { \n $this->setData('stored_cards',false);\n }\n }\n \n return $this->getData('stored_cards');\n }",
"public function getResponse()\n {\n // TODO: Implement getResponse() method.\n }",
"function getResponse();",
"function getResponse();",
"function drawCard (&$deck) {\n \n $suit = array_rand($deck);\n $card = array_rand($deck[$suit]);\n \n // Determine the face value of the card.\n\t// Face cards are worth 10\n\tif ($card >=10){\n $card_value = 10;\n }\n else {\n $card_value = $card;\n }\n \n $return_value = array('display' =>\n ($card < 10) ? $suit. \"0{$card}.jpg\" :\n \"$suit{$card}.jpg\", 'value' => $card_value);\n // returns a two element array showing a card's suit & face value\n \n unset($deck[$suit][$card]);\n \n return $return_value;\n // returns a two-element array showing a card's suit and face value\n }",
"public function show(Card $card)\n {\n //\n }",
"public function show(Card $card)\n {\n //\n }",
"public function show(Card $card)\n {\n //\n }",
"public function show(Card $card)\n {\n //\n }",
"function displayCSCResponse($cscResultCode) {\n\n if ($cscResultCode != \"\") {\n switch ($cscResultCode) {\n Case \"Unsupported\" : $result = \"CSC not supported or there was no CSC data provided\"; break;\n Case \"M\" : $result = \"Exact code match\"; break;\n Case \"S\" : $result = \"Merchant has indicated that CSC is not present on the card (MOTO situation)\"; break;\n Case \"P\" : $result = \"Code not processed\"; break;\n Case \"U\" : $result = \"Card issuer is not registered and/or certified\"; break;\n Case \"N\" : $result = \"Code invalid or not matched\"; break;\n default : $result = \"Unable to be determined\"; break;\n }\n } else {\n $result = \"null response\";\n }\n return $result;\n }",
"public function getStoredCardData() {\n\t $tokenId = (int) $this->getInfoInstance()->getAdditionalInformation('token_id');\n\t \n\t if($tokenId && ($tokenId > 0)){\n\t return Mage::getModel('hostedpayments/storedcard')->load($tokenId);\n\t }\n\t \n\t return false;\n\t}",
"public function drawCard(int $cardId): Card;",
"function makeCards() {\n\t\t\n\t\t$cards = explode(\" \", $this->me->get(\"cards\"));\n\t\t$i = 0;\n\t\t$rv = \"gamestate.cards = [];\";\n\t\t\n\t\tforeach ($cards as $value) {\n\t\t\t$name = getOneThing(\"name\", \"gamedata_cards\", \"id=\".$value);\n\t\t\t$description = getOneThing(\"description\", \"gamedata_cards\", \"id=\".$value);\n\t\t\t$rv .= \"gamestate.cards[\".$i.\"] = new Object();\\n\";\n\t\t\t$rv .= \"gamestate.cards[\".$i.\"].name = '\".$name.\"';\\ngamestate.cards[\".$i.\"].description = '\".$description.\"';\\n\";\n\t\t\t$i++;\n\t\t\t}\n\t\t\n\t\n\t\treturn $rv;\n\t\t\n\t\n\t}",
"function get_card_info($file){\n $template_data = get_file_data( $file , array( 'Card' => 'Card' ) );\n if (!empty($template_data['Card'])) {\n return $template_data['Card'];\n }\n }",
"public static function getCardById($id)\n {\n\t\t$key = 'CardById_' . $id;\n\t\t$cache = Hapyfish_Cache_Memcached::getInstance();\n\t\t$card = $cache->get($key);\n\t\tif ($card === false) {\n\t\t\t//load from database\n\t\t\t$db = Hapyfish_Island_Dal_Card::getDefaultInstance();\n\t\t\t$card = $db->getCardById($id);\n\t\t\tif ($card) {\n\t\t\t\t$cache->add($key, $card, Hapyfish_Cache_Memcached::LIFE_TIME_ONE_MONTH);\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $card;\n }"
] | [
"0.6849949",
"0.682923",
"0.67764735",
"0.6676103",
"0.6617826",
"0.66177595",
"0.6543389",
"0.64561677",
"0.6348846",
"0.6329933",
"0.6126838",
"0.6120103",
"0.60777456",
"0.604684",
"0.60012907",
"0.5987791",
"0.59828883",
"0.5938717",
"0.5935131",
"0.58965313",
"0.5889521",
"0.58811563",
"0.58793247",
"0.5828161",
"0.5809563",
"0.5805838",
"0.5794484",
"0.5794484",
"0.5794484",
"0.5794484",
"0.5794484",
"0.5794484",
"0.5794484",
"0.5794484",
"0.5794484",
"0.5794484",
"0.5794484",
"0.578529",
"0.5783606",
"0.5768086",
"0.5756553",
"0.5734373",
"0.5734373",
"0.5702794",
"0.56974334",
"0.5690276",
"0.56864697",
"0.56648207",
"0.5664766",
"0.56628764",
"0.56510204",
"0.5644362",
"0.562961",
"0.5626719",
"0.56234604",
"0.56234604",
"0.56234604",
"0.561634",
"0.56161696",
"0.5613747",
"0.5596401",
"0.5592084",
"0.55908585",
"0.55901635",
"0.5583808",
"0.55774224",
"0.5575497",
"0.55751455",
"0.5572889",
"0.5572889",
"0.55605733",
"0.5553435",
"0.5548304",
"0.55441844",
"0.55428135",
"0.5523817",
"0.55172235",
"0.55134994",
"0.5500858",
"0.549512",
"0.5492159",
"0.5484526",
"0.5467257",
"0.5464644",
"0.5462511",
"0.54577774",
"0.54542136",
"0.54503626",
"0.54503626",
"0.5446015",
"0.54459214",
"0.54459214",
"0.54459214",
"0.54459214",
"0.54396576",
"0.5436258",
"0.5436071",
"0.54293823",
"0.54270583",
"0.5406668"
] | 0.6998666 | 0 |
Return a reprompt response, wrapping a speech response | public function reprompt($reprompt, $type = self::TYPE_PLAINTTEXT)
{
return $this->respond(
self::RESPONSE_TYPE_REPROMPT, [
self::RESPONSE_TYPE_OUTPUT_SPEECH => $this->getSpeechResponse($reprompt, $type),
]
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function response() {\n $reply = trim(fgets($this -> __sock, 512));\n switch(substr($reply, 0, 1)) {\n /* Error reply */\n case '-':\n trigger_error('ERROR (' . trim($reply) . ')', E_USER_ERROR);\n /* Inline reply */\n case '+':\n $response = substr(trim($reply), 1);\n if($response === 'OK') $response = true;\n break;\n /* Bulk reply */\n case '$':\n $response = null;\n if($reply === '$-1') break;\n $read = 0;\n $size = intval(substr($reply, 1));\n if($size > 0) {\n do {\n $block_size = ($size - $read) > 1024 ? 1024 : ($size - $read);\n $r = fread($this -> __sock, $block_size);\n if($r === false)\n trigger_error('READ FROM SERVER ERROR', E_USER_ERROR);\n else {\n $read += strlen($r);\n $response .= $r;\n }\n } while($read < $size);\n }\n fread($this -> __sock, 2); /* CRLF */\n break;\n /* Multi-bulk reply */\n case '*':\n $count = intval(substr($reply, 1));\n if($count === -1) return null;\n $response = array();\n for($i = 0; $i < $count; $i++)\n $response[] = $this -> response();\n break;\n /* Integer reply */\n case ':':\n $response = intval(substr(trim($reply), 1));\n break;\n default:\n trigger_error('UNKNOWN RESPONSE ERROR', E_USER_ERROR);\n }\n return $response;\n }",
"public function respond() {\n\t \n\t // Prevent duplicate responses\n\t if ($this->hasResponded) return;\n\t $this->hasResponded = true;\n\t \n\t // Set google as default for now\n\t $integrations = array(\n\t\t 'google' => array(\n\t\t\t 'expectUserResponse' => $this->expectUserResponse,\n\t\t\t 'richResponse' => array(\n\t\t\t\t 'items' => $this->items\n\t\t\t )\n\t\t )\n\t );\n\t \n\t $fulfillmentMessages = array();\n\t \n\t $response = array(\n\t\t 'fulfillmentText' => $this->speech,\t\t \n\t\t 'payload' => $integrations,\t\t \n\t );\n\t \n\t header(\"Content-type:application/json\");\n\t return json_encode($response);\n }",
"public function getOriginalResponse() : ResponseInterface;",
"public function getEquipSynthesisReply()\n {\n return $this->get(self::_EQUIP_SYNTHESIS_REPLY);\n }",
"public function getReplyPost();",
"protected function getSpeechResponse($text, $type)\n\t{\n\t\t$response = [\n\t\t\t'type' => $type,\n\t\t\t'text' => $text,\n\t\t];\n\n\t\tif ($type === self::TYPE_SSML) {\n\t\t\t$response['ssml'] = $response['text'];\n\n\t\t\tunset($response['text']);\n\t\t}\n\n\t\treturn $response;\n\t}",
"public function getSyncSkillStrenReply()\n {\n return $this->get(self::_SYNC_SKILL_STREN_REPLY);\n }",
"public function getAskMagicsoulReply()\n {\n return $this->get(self::_ASK_MAGICSOUL_REPLY);\n }",
"function responseToDialogue($response){\n $response = json_encode(array_merge($response, array_filter(['extendedIds' => SUtl::translatedExtendedIdCols()]), ['extras' => Tfk::getExtras(), 'feedback' => Feedback::get()]));\n if ($response){\n $this->dialogue->response->setContent(Tfk::$registry->get('translatorsStore')->substituteTranslations($response));\n }else{\n Tfk::debug_mode('error', 'AbstractController->responseToDialogue - json_encoding error: ', json_last_error());\n }\n }",
"function replyMessage ($message) {\n /*\n * Instantiate Recast.AI SDK, just for connect service\n */\n $request = Client::Request($_ENV[\"REQUEST_TOKEN\"]);\n\n /*\n * Get text from message received\n */\n $text = $message->content;\n\n /*\n * Get senderId to catch unique conversation_token\n */\n $senderId = $message->senderId;\n\n /*\n * Call Recast.AI SDK, through /converse route\n */\n $response = $request->converseText($text, [ 'conversation_token' => $senderId ]);\n\n /*\n * Here, you can add your own process.\n * Ex: You can call any external API\n * Or: Update your DB\n * etc...\n */\n $server = \"localhost\";\n$dbusername = \"root\";\n$dbpassword = \"root\";\n$dbname = \"phplms\";\nif ($response->action->slug == 'greetings') {\n // Do your code\necho \"Greetings User!\";\n\n\n$usernametext = \"sid\";\n$passwordtext = \"sid\";\n//array_push($response->replies, \"Welcome to LMS. You can enquire about your marks as of now.\");\n\n$conn = new mysqli($server, $dbusername, $dbpassword, $dbname);\n// Check connection\nif ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n} \nelse{\n$sql = \"SELECT * from register where username = 'sid' and password = 'sid';\";\n$result = $conn->query($sql);\n\n//if ($result->num_rows > 0) {\nif($result!=null){\n //array_push($response->replies, \"Inside rows > 0\");\n // output data of each row\n while($row = $result->fetch_assoc()) {\n //array_push($response->replies, \"Inside While\");\n //echo \"id: \" . $row[\"id\"]. \" - Name: \" . $row[\"firstname\"]. \" \" . $row[\"lastname\"]. \"<br>\";\n if($usernametext==$row[\"username\"]){\n if($passwordtext==$row[\"password\"]){\n //session_start();\n echo \"User found! Username = \".$row['username'].\"\\n\";\n echo \"Password = \".$row['password'].\"\\n\";\n //array_push($response->replies, \"Welcome to LMS. You can enquire about your marks as of now.\");\n //$_SESSION['username']=$usernametext;\n //$_SESSION['name']=$row[\"name\"];\n //header('Location: Auth.php');\n $conn->close();\n //exit;\n }\n }\n }\n}\nelse{\n echo \"0 results\";\n $conn->close();\n}\n}\n}\n\nif ($response->action->slug == 'online-test-marks') {\n $sql = \"\";\n $test_number = $response->memory->number->scalar;\n $username = $response->memory->username->value;\n if($username==null){\n array_push($response->replies, \"Code : Username is missing\");\n }\n //array_push($response->replies, \"Test number = \".$test_number);\n else if($test_number==null){\n //array_push($response->replies, \"Test number null\");\n\n \n }else{\n $sql = \"select * from onlinetest\".$test_number.\" where username = '\".$username.\"';\";\n $conn = new mysqli($server, $dbusername, $dbpassword, $dbname);\nif ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n} \nelse{\n$result = $conn->query($sql);\n\n//if ($result->num_rows > 0) {\nif($result!=null){\n array_push($response->replies, \"Your onlinetest\".$test_number.\" marks :\");\n // output data of each row\n while($row = $result->fetch_assoc()) {\n //echo \"id: \" . $row[\"id\"]. \" - Name: \" . $row[\"firstname\"]. \" \" . $row[\"lastname\"]. \"<br>\";\n array_push($response->replies, $row[\"cname\"].\" - \".$row[\"marks\"]);\n }\n }\n}\n}\n}\n\nif ($response->action->slug == 'login-1') {\n\n\n$usernametext = $response->memory->username->value;\n$passwordtext = $response->memory->password->value;\narray_push($response->replies, \"Username :\".$usernametext.\"END Password :\".$passwordtext.\"END\");\n//array_push($response->replies, \"Welcome to LMS. You can enquire about your marks as of now.\");\n//$result = null;\n$conn = new mysqli($server, $dbusername, $dbpassword, $dbname);\n// Check connection\nif ($conn->connect_error) {\n die(\"Connection failed: \" . $conn->connect_error);\n}\nelse{\n$sql = \"SELECT * from register where username = '.$usernametext.' and password = '.$passwordtext.';\";\n$result = $conn->query($sql);\narray_push($response->replies, \"No. of rows : \".mysqli_num_rows($result));\n//if ($result->num_rows > 0) {\nif($result!=null){\n//if(mysqli_num_rows($result)>0){\n array_push($response->replies, \"Code : Successfully logged in as \".$usernametext);\n array_push($response->replies, \"Welcome to LMS. You can enquire about your marks as of now.\");\n $conn->close();\n}\nelse{\n array_push($response->replies, \"Code : Username or password is wrong! Please log in again.\");\n $conn->close();\n}\n}\n}\n\nif ($response->action->slug == 'my-details') {\n $usernametext = $response->memory->username->value;\n $passwordtext = $response->memory->password->value;\n array_push($response->replies, \"Username : \".$usernametext.\" Password : \".$passwordtext);\n }\n /*\n * Add each replies received from API to replies stack\n */\n foreach ($response->replies as $reply) {\n $message->addReply([(object)['type' => 'text', 'content' => $reply]]);\n }\n\n $message->reply();\n}",
"public function getTutorialReply()\n {\n return $this->get(self::_TUTORIAL_REPLY);\n }",
"public function getOpenShopReply()\n {\n return $this->get(self::_OPEN_SHOP_REPLY);\n }",
"public function getResponseMessage();",
"public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n //extract post data\n if (!empty($postStr)){\n \n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $RX_TYPE = trim($postObj->MsgType);\n\n switch($RX_TYPE)\n {\n case \"text\":\n $resultStr = $this->handleText($postObj);\n break;\n case \"event\":\n $resultStr = $this->handleEvent($postObj);\n break;\n default:\n $resultStr = \"Unknow msg type: \".$RX_TYPE;\n break;\n }\n echo $resultStr;\n }else {\n echo \"\";\n exit;\n }\n }",
"public function getCorrectResponse() {\r\n return new qti_variable($this->cardinality, $this->type, array('value' => $this->correctResponse));\r\n }",
"public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n //extract post data\n if (!empty($postStr)){\n \n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $RX_TYPE = trim($postObj->MsgType);\n\n switch($RX_TYPE)\n {\n case \"text\":\n $resultStr = $this->handleText($postObj);\n break;\n case \"event\":\n $resultStr = $this->handleEvent($postObj);\n break;\n default:\n $resultStr = \"Unknow msg type: \".$RX_TYPE;\n break;\n }\n echo $resultStr;\n }else {\n echo \"\";\n exit;\n }\n }",
"public function getReply()\n {\n return $this->reply;\n }",
"public function & GetResponse ();",
"public function answer()\n\t{\n\n $twiml = new Services_Twilio_Twiml();\n\n $gather = $twiml->gather([\n 'method' => 'GET',\n 'action' => 'twilio/check-account'\n ]);\n $gather->say(\"Hello, thanks for calling Phlare. Please enter your account number, followed by the pound sign.\");\n\n return $twiml;\n\n\t}",
"public function makeResponse(): ResponseInterface;",
"private function sendSingleVoiceTtsResponse(ResponseInterface $response, UriInterface $requestUri): mixed\n {\n $statusCode = $response->getStatusCode();\n $responseBody = $response->getBody();\n $responseHeaders = $response->getHeaders();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf('[%d] API Error (%s)', $statusCode, $requestUri),\n $statusCode,\n $responseHeaders,\n $responseBody\n );\n }\n\n $responseResult = null;\n\n $responseResult = $this->deserialize($responseBody, '\\Infobip\\Model\\CallsVoiceResponse', $responseHeaders);\n return $responseResult;\n }",
"public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n global $textTpl;\n if (!empty($postStr))\n {\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $type = $postObj->MsgType;\n\n switch ($type)\n {\n case \"event\":\n $resultStr = GetEventMessage($postObj);\n break;\n case \"location\":\n $resultStr = GetLocationMessage($postObj);\n break;\n case \"text\":\n $resultStr = GetTextMessage($postObj);\n break;\n default:\n $resultStr = GetTextMessage($postObj);\n //$resultStr = GetDefaultMessage($postObj);\n break;\n }\n\n RecordInputContent($postObj); //保存用户输入的所有内容\n RefleshUserLoginTime($postObj); // 更新用户登录的最新时间\n\n echo $resultStr;\n }\n else\n {\n echo \"\";\n exit;\n }\n }",
"public function getShopConsumeReply()\n {\n return $this->get(self::_SHOP_CONSUME_REPLY);\n }",
"public function sendResponse();",
"public function get_correct_response()\n {\n return null;\n }",
"abstract public function response();",
"public function getRequireRewardsReply()\n {\n return $this->get(self::_REQUIRE_REWARDS_REPLY);\n }",
"function get_response() {\n return $this->response;\n }",
"public function response(): ResponseContract;",
"public function getMidasReply()\n {\n return $this->get(self::_MIDAS_REPLY);\n }",
"protected function Transform_Response($response)\n\t{\n\t\t\n\t\tif (is_string($response))\n\t\t{\n\t\t\t$response = new OLP_Response($response);\n\t\t}\n\t\t\n\t\t// we want the merged result so we have tokens for promo_id, etc.\n\t\t$data = array_merge($response->Signature()->To_Array(), $response->Collection()->To_Array());\n\t\t\n\t\t$proxy = new stdClass();\n\t\t$proxy->session_id = $response->Unique_ID();\n\t\t$proxy->page = $response->Page();\n\t\t$proxy->data = $data;\n\t\t$proxy->errors = $response->Errors()->To_Array();\n\t\t$proxy->event = array();\n\t\t\n\t\t// if we have a <section> element, turn it into\n\t\t// the eds_page in the response, using XSLT\n\t\tif (count($response->Content()->Sections()))\n\t\t{\n\t\t\t\n\t\t\t// which style-sheet?\n\t\t\t$xslt = DIR_SHARED.\"/xsl/{$response->Page()}.xsl\";\n\t\t\t\n\t\t\tif (is_file($xslt))\n\t\t\t{\n\t\t\t\t// transform our response\n\t\t\t\t$content = Transform_XML($xslt, $response->Received());\n\t\t\t\t$proxy->eds_page = array('content'=>$content, 'type'=>'text/html');\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn $proxy;\n\t\t\n\t}",
"public function answer()\n\t{\n\t\tif (!$this->typeResponseCode)\n\t\t\treturn $this->answerTwoHundred($this->data);\n\t\telse\n\t\t\treturn $this->answerThroughHeader($this->data);\n\t}",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"public function getResponse();",
"private function sendAdvancedVoiceTtsResponse(ResponseInterface $response, UriInterface $requestUri): mixed\n {\n $statusCode = $response->getStatusCode();\n $responseBody = $response->getBody();\n $responseHeaders = $response->getHeaders();\n\n if ($statusCode < 200 || $statusCode > 299) {\n throw new ApiException(\n sprintf('[%d] API Error (%s)', $statusCode, $requestUri),\n $statusCode,\n $responseHeaders,\n $responseBody\n );\n }\n\n $responseResult = null;\n\n $responseResult = $this->deserialize($responseBody, '\\Infobip\\Model\\CallsVoiceResponse', $responseHeaders);\n return $responseResult;\n }",
"function response($response_name) {\r\n\t\t$return_value = '';\r\n\t\t$response_name = (string) $response_name;\r\n\r\n\t\t$return_value .= '<message name=\"' . $response_name . 'Response\">'\r\n\t\t. $this->part('head', 'cpaintResponseHead');\r\n\r\n\t\t// iterate over all response argument\r\n\t\tforeach ($this->functions[$response_name]['output'] as $structure) {\r\n\t\t\t$return_value .= $this->part($structure['name'], $structure['type']);\r\n\t\t} // end: foreach\r\n\r\n\t\t$return_value .= '</message>';\r\n\r\n\t\treturn $return_value;\r\n\t}",
"public function getRawResponse() {\n\t}",
"public function getResponse(): string\n {\n return $this->response;\n }",
"public function getResponse(): ResponseInterface;",
"public function getResponse(): ResponseInterface;",
"public function getSellItemReply()\n {\n return $this->get(self::_SELL_ITEM_REPLY);\n }",
"public function build_simpleResponse($textToSpeech, $displayText) {\n\t $response = array(\n\t\t 'simpleResponse' => array(\n\t\t\t 'textToSpeech' => $textToSpeech,\n\t\t\t 'displayText' => $displayText\n\t\t\t)\n\t\t);\n\t\t$this->items[] = $response;\n }",
"protected function _unwrapResponse($response) {\n $startPosition = strlen(self::WRAPWORD);\n $symbolsToExtract = strlen($response) - $startPosition - 1;\n return substr($response, $startPosition, $symbolsToExtract);\n }",
"public function testDirectReply()\n {\n $this->markTestIncomplete('Not yet implemented.');\n }",
"public function prepareResponse();",
"function getResponse();",
"function getResponse();",
"#[Pure]\n public function getRawResponseMessage() {}",
"public function setCorrectResponse($value) {\r\n $this->correctResponse = $value->value;\r\n }",
"public function getRawResponse();",
"private function getHtmlResponse() {\r\n\t\t\r\n\t\t\t// check if a request has been made, else skip!\r\n\t\t\t$cmd = @$_POST['request'];\r\n\t\t\tif (!$cmd) {return '';}\r\n\t\t\t\r\n\t\t\t// get the connection\r\n\t\t\t$con = Factory::getVdrConnection();\r\n\t\t\t$resp = $con->request($cmd);\r\n\t\t\t\r\n\t\t\t// create the template\r\n\t\t\t$tpl = new Template('svdrp_response');\r\n\t\t\t$tpl->set('HEADER', LANG_SVDRP_RESPONSE_HEADER);\r\n\t\t\t$tpl->set('CONTENT', $resp->getLinesAsString());\r\n\t\t\treturn $tpl->get();\r\n\t\t\t\r\n\t\t}",
"public function getResponse() {}",
"public function getResponse() {}",
"public function getSplitHeroReply()\n {\n return $this->get(self::_SPLIT_HERO_REPLY);\n }",
"public function get_correct_response() \n {\n return array('answer' => 0);\n }",
"public function envelope_response($response, $embed)\n {\n }",
"public function sentence()\n {\n $sentence = $this->randomizer->getSentences(1);\n\n return $this->apiResponse($sentence[0]);\n }",
"abstract public function simplifyResponse($request, $response);",
"public function prepareResponse($response)\n\t{\n\t\tif ($response instanceof modProcessorResponse) {\n\t\t\t$output = $response->getResponse();\n\t\t} else {\n\t\t\t$message = $response;\n\t\t\tif (empty($message)) {\n\t\t\t\t$message = $this->lexicon('err_unknown');\n\t\t\t}\n\t\t\t$output = $this->failure($message);\n\t\t}\n\t\tif ($this->config['jsonResponse'] AND is_array($output)) {\n\t\t\t$output = $this->modx->toJSON($output);\n\t\t} elseif (!$this->config['jsonResponse'] AND !is_array($output)) {\n\t\t\t$output = $this->modx->fromJSON($output);\n\t\t}\n\n\t\treturn $output;\n\t}",
"public function getResponse($response) {\r\n\r\n\r\n }",
"public function getOriginalResponse()\n {\n return $this->originalResponse;\n }",
"public function getRawResponse()\n {\n return $this->rawResponse;\n }",
"public function story_response()\n {\n $user_id = $this->_require_login();\n $this->_require_register();\n\n $post_data = $this->input->post(NULL, TRUE);\n $story_id = $post_data['story_id'];\n $story = $this->story_model->get($story_id);\n\n if($this->_is_user_bottle($story_id) == 0 && $story[0]['story_user_id'] != $user_id){\n redirect('/pick');\n }else{\n\n $reply_to_id = $story[0]['story_user_id'];\n\n $reply_data = array(\n 'reply_sender_id' => $user_id,\n 'reply_story_id' => $story_id,\n 'reply_to_id' => $post_data['reply_to_id'],\n 'reply_text' => $post_data['response_content'],\n 'reply_time' => date(\"Y-m-d H:i:s\")\n );\n\n $reply_id = $this->reply_model->insert($reply_data);\n redirect('/bottles/'.$story_id);\n }\n }",
"public function respond( /* variable length arguments */ ){\n\n $response = '';\n\n foreach ( func_get_args() as $argument )\n\n if ( ! is_subclass_of($argument,'\\\\Code_Alchemy\\\\Vendors\\\\Twilio\\\\Twilio_Response_Object')){\n\n \\FB::error(get_called_class().\": \".__FUNCTION__.\": Each argument must be a Twilio Response Object\");\n\n break;\n } else\n\n $response .= (string) $argument;\n\n header(\"content-type: text/xml\");\n\n echo \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\";\n\n echo (string) \"<Response>$response</Response>\";\n\n\n }",
"protected function getResponse(): Response\n {\n return new Response(fopen('data://text/plain,', 'rb'), 200);\n }",
"public function resendConfirmationDialogueAction(): ResponseInterface\n {\n return $this->htmlResponse();\n }",
"public function get_response()\n {\n return $this->response; \n }",
"function _sendMessageReply($chatId, $messageId, $text){\n\n $data = [\n 'chat_id' => $chatId,\n 'reply_to_message_id'=>$messageId,\n 'parse_mode'=>'HTML',\n 'disable_web_page_preview'=>true, \n 'text' => $text\n ];\n \n return Request('sendMessage', $data);\n}",
"public function reply($cleaned) {\n\t\tif (!Registry::get(\"sys\") -> getSecurityManager() -> securityCheck(\"MESSAGE_CENTRE\")) {\n\t\t\techo \"Sorry, you have sent too many requests in a short amount of time. Please wait.\";\n\t\t\treturn;\n\t\t}\n\t\tif (!isset($cleaned['id'])) {\n\t\t\techo \"Sorry, please a contact a system administrator. #454\";\n\t\t\treturn;\n\t\t}\n\t\t$this -> configure();\n\t\t$message = $this -> getMessage($cleaned['id']);\n\t\tif (!$message) {\n\t\t\techo \"Sorry, an error occured please contact your system administrator.\";\n\t\t\treturn;\n\t\t}\n\t\t$html = Utils::purify($cleaned['html']);\n\t\tif (strlen($html) < 6) {\n\t\t\techo \"Your message must be 6 or more characters.\";\n\t\t\treturn;\n\t\t} else if (strlen($html) > 10000) {\n\t\t\techo \"Your message can't exceed 10000 characters.\";\n\t\t\treturn;\n\t\t}\n\t\t$isMessage = $message -> getSender() == $this -> user -> getUsername();\n\t\t$subject = $message -> getSubject();\n\t\tif (!$isMessage && !$message -> isReply()) {\n\t\t\t$subject = \"RE: \" . $message -> getSubject();\n\t\t}\n\t\tif (!$this -> create($this -> user -> getUsername(), $isMessage ? $message -> getRecipient() : $message -> getSender(), $subject, $cleaned['html'])) {\n\t\t\techo \"Sorry, your request could not be approved at this time. Please try again later.\";\n\t\t\treturn;\n\t\t}\n\t\techo \"SUCCESS /account/message/index.php?id=\" . $this -> database-> getConnection() -> lastInsertId();\n\t}",
"protected function prepareGetTextAlternativesResponse(ResponseContextAbstract $context): DictionaryResponse\n {\n return $this->processLookupResponse($context);\n }",
"function jx_pnh_fran_resendreply()\r\n\t{\r\n\t\t$reply_for = $this->input->post('resend_reply_for');\r\n\t\t$output = array();\r\n\t\tif($this->db->query(\"select sender from pnh_sms_log where id = ?\",$reply_for)->num_rows())\r\n\t\t{\r\n\t\t\t$sender = $this->db->query(\"select sender from pnh_sms_log where id = ?\",$reply_for)->row()->sender;\r\n\t\t\t$msg_det = $this->db->query(\"select franchise_id,msg from pnh_sms_log where reply_for = ?\",$reply_for)->row_array();\r\n\t\t\t$this->erpm->pnh_sendsms($sender,$msg_det['msg'],$msg_det['franchise_id']);\r\n\t\t\t$output['message'] = 'Reply message sent';\r\n\t\t}else\r\n\t\t{\r\n\t\t\t$output['message'] = 'No SMS found';\r\n\t\t}\r\n\t\t\r\n\t\techo json_encode($output);\r\n\t}",
"public function send_response() {\n\t\n\t\t$return = $this->get_response();\n\t\t\n\t\t/* send it and terminate this instance */\n\t\tif($this->get_errors()) {\n\t\t\twp_send_json_error($return);\t\t\t\t\t\t\n\t\t} else {\n \t\tif( null === $this->wp_query ) {\n \t\t\twp_send_json_success($return); \t\t \t\t\n \t\t} else {\n \t\t\n \t\t\t$data = array(\n \t\t\t'success' => true,\n \t\t\t'data' => $return,\n \t\t\t'query' => $this->parse_wp_query_object_2_js( $this->wp_query )\n \t\t\t);\n \t\t\twp_send_json($data); // build a custom wp_send_json_success with an extra property \n \t\t}\t\t\t\n\t\t}\n\t}",
"protected final function getResponse()\n {\n $this->response = \n $this->communicator->getResponse($this->buildCommand());\n }",
"public function getExcavateReply()\n {\n return $this->get(self::_EXCAVATE_REPLY);\n }",
"public final function getSnowmanResponse()\n {\n return $this->snowmanresponse;\n }",
"public function getRawResponse(): ?string\n {\n return $this->rawResponse;\n }",
"function send_response() {\n $nocrypt = isset($_POST[\"nocrypt\"]);\n $cert = isset($_POST[\"cert\"]) ? trim($_POST[\"cert\"]) : \"\";\n if (!$nocrypt && !$cert) {\n header(\"HTTP/1.1 400 Bad Request\");\n echo \"No recipient certificate specified!\\n\";\n return;\n }\n\n if (!create_response()) {\n header(\"HTTP/1.1 500 Internal Server Error\");\n echo \"Error creating response\";\n return;\n }\n\n $err = digidoc::initialize();\n if ($err != digidoc::ERR_OK) {\n header(\"HTTP/1.1 500 Internal Server Error\");\n echo \"Error initializing libdigidoc: \" . digidoc::get_error($err);\n return;\n }\n $err = sign_response();\n if ($err != digidoc::ERR_OK) {\n header(\"HTTP/1.1 500 Internal Server Error\");\n echo \"Error signing response: \" . digidoc::get_error($err);\n digidoc::finalize();\n return;\n }\n if (!$nocrypt) {\n $err = encrypt_response($cert);\n if ($err != digidoc::ERR_OK) {\n header(\"HTTP/1.1 500 Internal Server Error\");\n echo \"Error encrypting response: \" . digidoc::get_error($err);\n digidoc::finalize();\n return;\n }\n }\n digidoc::finalize();\n\n if ($err == digidoc::ERR_OK) {\n $ext = $nocrypt ? \"ddoc\" : \"cdoc\";\n $resp = File::readLocalFile(get_response_prefix() . \".$ext\");\n File::saveAs(\"response.$ext\", $resp, \"application/x-$ext\", \"utf-8\");\n }\n}",
"public function getResponse() {\n\t}",
"public function say($text, $type = self::TYPE_PLAINTTEXT)\n\t{\n\t\treturn $this->respond(self::RESPONSE_TYPE_OUTPUT_SPEECH, $this->getSpeechResponse($text, $type));\n\t}",
"public function response ();",
"public function responseMsg()\r\n\t{\r\n\t\t$postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\r\n\r\n\t\t//extract post data\r\n\t\tif (!empty($postStr)){\r\n\t\t\t\t\r\n\t\t\t\t$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\r\n\t\t\t\t$fromUsername = $postObj->FromUserName;\r\n\t\t\t\t$toUsername = $postObj->ToUserName;\r\n\t\t\t\t$keyword = trim($postObj->Content);\r\n\t\t\t\t$time = time();\r\n\r\n\t\t\t\t/*文字回复*/\r\n\t\t\t\t$textTpl = \"<xml>\r\n\t\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\r\n\t\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\r\n\t\t\t\t\t\t\t<CreateTime>%s</CreateTime>\r\n\t\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\r\n\t\t\t\t\t\t\t<Content><![CDATA[%s]]></Content>\r\n\t\t\t\t\t\t\t<FuncFlag>0</FuncFlag>\r\n\t\t\t\t\t\t\t</xml>\"; \r\n\r\n\t\t\t\t/*图文回复*/\r\n\t\t\t\t$itemTpl = \"<xml>\r\n\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\r\n\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\r\n\t\t\t\t\t\t<CreateTime>%s</CreateTime>\r\n\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\r\n\t\t\t\t\t\t<ArticleCount>1</ArticleCount>\r\n\t\t\t\t\t\t<Articles>\r\n\t\t\t\t\t\t<item>\r\n\t\t\t\t\t\t<Title><![CDATA[%s]]></Title> \r\n\t\t\t\t\t\t<Description><![CDATA[%s]]></Description>\r\n\t\t\t\t\t\t<PicUrl><![CDATA[%s]]></PicUrl>\r\n\t\t\t\t\t\t<Url><![CDATA[%s]]></Url>\r\n\t\t\t\t\t\t</item>\r\n\t\t\t\t\t\t</Articles>\r\n\t\t\t\t\t\t</xml>\";\r\n\r\n\r\n\r\n\t\t\t\tif(!empty( $keyword )){\r\n\t\t\t\t\t$keyworde = $this -> FindKeyword($keyword,$fromUsername);\r\n\t\t\t\t\tswitch ($keyworde) {\r\n\t\t\t\t\t\tcase '红包':\r\n\t\t\t\t\t\t\t// $msgType = \"news\";\r\n\t\t\t\t\t\t\t// $contentStr = \"恭喜你获得一个红包!\";\r\n\t\t\t\t\t\t\t// $contentStr2 = \"点击图片领取你的红包!\";\r\n\t\t\t\t\t\t\t// // $PicUrl = \"http://imgsrc.baidu.com/forum/w%3D580/sign=6926f2cad488d43ff0a991fa4d1fd2aa/3e8ad5dcd100baa1583412044510b912c9fc2ea8.jpg\";\r\n\t\t\t\t\t\t\t// $url = \"http://i.shuilaile.com/index.php?s=/Home/Get/pay/openid/\".$fromUsername.\"/code/\".$keyword.\".html\";\r\n\t\t\t\t\t\t\t// $resultStr = sprintf($itemTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr, $contentStr2, $PicUrl, $url);\r\n\t\t\t\t\t\t\t// echo $resultStr;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//执行发红包\r\n\t\t\t\t\t\t\t$this -> pay($fromUsername,$keyword);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t$msgType = \"text\";\r\n\t\t\t\t\t\t\t$contentStr = $keyworde;\r\n\t\t\t\t\t\t\t// $contentStr = \"Welcome to wechat world!\";\r\n\t\t\t\t\t\t\t$resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\r\n\t\t\t\t\t\t\techo $resultStr;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\techo \"Input something...\";\r\n\t\t\t\t}\r\n\r\n\t\t}else {\r\n\t\t\techo \"\";\r\n\t\t\texit;\r\n\t\t}\r\n\t}",
"public function getWorldcupReply()\n {\n return $this->get(self::_WORLDCUP_REPLY);\n }",
"function reply_content() {\n\tglobal $reply;\n\treturn Parsedown::instance()->parse($reply['content']);\n}",
"public function buildResponse($embedlyResponse);",
"public function getRawResponse(): ?string {\n return $this->rawResponse;\n }",
"public function responseMsg()\n\t{\n\t\t$postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\t\t//extract post data\n\t\tif (!empty($postStr)){\n\t\t\t/* libxml_disable_entity_loader is to prevent XML eXternal Entity Injection,\n\t\t\t the best way is to check the validity of xml by yourself */\n\t\t\tlibxml_disable_entity_loader(true);\n\t\t\t$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n\t\t\t$fromUsername = $postObj->FromUserName;\n\t\t\tif(!empty($fromUsername)){\n\t\t\t\t$this->getGzUserInfo($fromUsername);\n\t\t\t}\n\t\t\t$toUsername = $postObj->ToUserName;\n\t\t\t$keyword = trim($postObj->Content);\n\t\t\t$Event = trim($postObj->Event);//事件类型,subscribe(订阅)、unsubscribe(取消订阅)\n// \t\t\t$time = time();\n// \t\t\t$textTpl = \"<xml>\n// \t\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n// \t\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n// \t\t\t\t\t\t\t<CreateTime>%s</CreateTime>\n// \t\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\n// \t\t\t\t\t\t\t<Content><![CDATA[%s]]></Content>\n// \t\t\t\t\t\t\t<FuncFlag>0</FuncFlag>\n// \t\t\t\t\t\t\t</xml>\";\n// \t\t\tif(!empty( $keyword ))\n// \t\t\t{\n// \t\t\t\t$msgType = \"text\";\n\t\t\t//订阅消息推送\n\t\t\t$resultStr\t= \"\";\n\t\t\tif(!empty($Event) && $Event=='subscribe'){\n\t\t\t\t$contentStr = \"您好,感谢您订阅衣伴网络,我们程序员正在玩命开发中,敬请期待...... 如果觉得我们有用,请推荐您的朋友关注。(微信搜索yibanwangluo)\";\n\t\t\t\t$resultStr\t= $this->responseTxt($fromUsername, $toUsername, $contentStr);\n\t\t\t}else{\n\t\t\t\tif(!empty($keyword) && $keyword=='ybwl' ){\n\t\t\t\t\t$title\t= '衣伴商务速洗';\n\t\t\t\t\t$des\t= '全国最大商务速洗O2O平台';\n\t\t\t\t\t$picurl\t= 'http://www.91yb.cn/static/images/weixin.jpg';\n\t\t\t\t\t$url\t= 'http://www.91yb.cn/?f=weixin';\n\t\t\t\t\t$resultStr = $this->responsePicTxt($fromUsername, $toUsername, $title, $des, $picurl, $url);\n\t\t\t\t}else{\n\t\t\t\t\t$resultStr =$this->responseTxt($fromUsername, $toUsername, '您好,感谢您订阅衣伴网络,我们程序员正在玩命开发中,敬请期待......');\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//@mwtlog(\"responseMsg_test\",$postStr.\"\\r\\n\",true);\n\t\t\t\techo $resultStr;\n// \t\t\t}else{\n// \t\t\t\techo \"Input something...\";\n// \t\t\t}\n\t\n\t\t}else {\n\t\t\techo \"\";\n\t\t\texit;\n\t\t}\n\t}",
"public function response();",
"public function getResponse(): string\n {\n return $this->response;\n }",
"public function createAuthenticationQRResponse(): StreamedResponse\n {\n $sessionKey = $this->getAuthenticationSessionKey();\n try {\n return new StreamedResponse(function () use ($sessionKey) {\n $this->tiqrService->generateAuthQR($sessionKey);\n });\n } catch (Exception $e) {\n throw TiqrServerRuntimeException::fromOriginalException($e);\n }\n }",
"public function process($response) {\n return $response;\n }",
"public function getRawResponse()\n {\n return $this->response;\n }"
] | [
"0.59148437",
"0.5905642",
"0.56824",
"0.56219715",
"0.56104815",
"0.54974437",
"0.548491",
"0.54318166",
"0.54279864",
"0.539601",
"0.5364582",
"0.5350667",
"0.53386617",
"0.53163886",
"0.5295762",
"0.5294509",
"0.5273699",
"0.5264613",
"0.5262042",
"0.5256307",
"0.52530974",
"0.5250891",
"0.52482665",
"0.5247603",
"0.52388304",
"0.5219717",
"0.5204224",
"0.5200056",
"0.5199996",
"0.51952446",
"0.5189259",
"0.5176815",
"0.51762396",
"0.51762396",
"0.51762396",
"0.51762396",
"0.51762396",
"0.51762396",
"0.51762396",
"0.51762396",
"0.51762396",
"0.51762396",
"0.51762396",
"0.51711303",
"0.51544046",
"0.5136968",
"0.5125469",
"0.5108658",
"0.5108658",
"0.51037365",
"0.51026624",
"0.51006395",
"0.5097804",
"0.5097153",
"0.50860304",
"0.50860304",
"0.50844437",
"0.5084324",
"0.5075104",
"0.5072038",
"0.50655055",
"0.50655055",
"0.5062854",
"0.5041177",
"0.50381154",
"0.50302494",
"0.5028092",
"0.5026877",
"0.5021982",
"0.502168",
"0.50100154",
"0.50097996",
"0.5002737",
"0.4996576",
"0.4991229",
"0.4985768",
"0.4978381",
"0.49713656",
"0.49684647",
"0.4968357",
"0.49562564",
"0.49532136",
"0.495232",
"0.49514386",
"0.49457172",
"0.49451536",
"0.49442434",
"0.494312",
"0.4942198",
"0.493681",
"0.492908",
"0.492901",
"0.49121588",
"0.49111283",
"0.49103677",
"0.4907379",
"0.49056163",
"0.49034858",
"0.49022213",
"0.49011114"
] | 0.5964544 | 0 |
Is the session ending? | public function isEnding()
{
return $this->session->expiring();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function sessions_end()\n\t{\n\t\t// nothing to see here\n\t}",
"public static function sessionClose()\n {\n return true;\n }",
"public static function afnSessionStop()\n {\n @session_unset();\n @session_destroy();\n return true;\n }",
"public function logout()\n\t\t{\n\t\t\treturn $this->end_session();\n\t\t}",
"public static function endSession()\n {\n if (!empty(self::$_start_time)) {\n $now = microtime(true);\n self::$_duration = $now - self::$_start_time;\n }\n }",
"private function end() {\n if ($this->isSessionStarted()) {\n session_commit();\n $this->clear();\n }\n }",
"public function isEnded();",
"public function closeSession() {\n session_unset();\n return true;\n }",
"public function isEnded() {}",
"public function stop() {\r\n\t\tif ($this->hasSession()) {\r\n\t\t\t$sessionId = self::getSessionId();\r\n\t\t\tself::session($sessionId);\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"function on_session_end() {\n}",
"public function stop() : bool\n {\n if ($this->isActive()) {\n $closed = \\session_write_close();\n }\n return $closed ?? true;\n }",
"public function close()\n {\n session_write_close();\n return true;\n }",
"private function _closeSession()\n {\n $session = $this->requestStack->getCurrentRequest()->getSession();\n if ($session===null || !$session->isStarted()) {\n return;\n } \n \n $session->save();\n }",
"public function destroy(){\n\t\tif( $this->sessionState == self::SESION_INICIADA){\n\t\t\t$this->sessionState = !session_destroy();\n\t\t\tunset( $_SESSION);\n\t\t\treturn !$this->sessionState;\n\t\t}\n\t\treturn FALSE;\n\t}",
"function isSessionExpired() {\n $lastActivity = $_SESSION['LAST_ACTIVITY'];\n $timeOut = $_SESSION['IDLE_TIME_LIMIT'];\n // Check if session has been active longer than IDLE_TIME_LIMIT\n if(time() - $lastActivity >= $timeOut) {\n return true;\n } else { false; }\n }",
"public function sessionIsTimedOut()\n {\n if ($this->sessionTimeout <= $this->sessionAge()) {\n return true;\n }\n\n return false;\n }",
"public function logout() {\r\n $this->sess->resetSession();\r\n return(true);\r\n }",
"public function isEnded()\n {\n return $this->ended_at > 0;\n }",
"private function expiredSession() {\r\n\r\n if (time()>$this->forcedExpire) return true;\r\n else return false;\r\n }",
"public function destroy():bool\n {\n\n $this->sessionState = !session_destroy();\n unset($_SESSION);\n\n return !$this->sessionState;\n }",
"public function end_login(){\n\n\t\t//STARTS SESSION IF NON\n\t\tsession_id() == ''? session_start(): NULL;\n\n\t\t$this->LOGGED_IN = false;\n\t\tunset($this->USER_ID);\n\n\t\t$_SESSION = Array();\n\n\t\tsetcookie(\"PHPSESSID\", NULL, time()-3600, '/');\n\t\tsetcookie(\"user\", NULL, time()-3600, '/');\n\n\t\techo Janitor::build_json_alert('Logged Out Successfully', 'Success', 107, 1);\n\t\texit;\n\t\t}",
"function EndSession(){\n session_unset(); \n // destroy the session \n session_destroy(); \n }",
"public function destroy()\n {\n if ($this->sessionState == self::SESSION_STARTED) {\n $this->sessionState = !session_destroy();\n unset($_SESSION);\n\n return !$this->sessionState;\n }\n \n return false;\n }",
"public static function logout()\n\t{\n\t\t$session = Common::getSession();\n\t\t$session->del(self::$sessionName);\n\t\treturn true;\n\t}",
"private function end_session()\n\t\t{\n\t\t\tif (isset($_SESSION['userid']))\n\t\t\t{\n\t\t\t\tif (isset($_COOKIE['auth_token']))\n\t\t\t\t\tsetcookie('auth_token', '', strtotime('-1 year'));\n\n\t\t\t\tsession_destroy();\n\t\t\t}\n\t\t\treturn ['id' => null, 'name' => null, 'state' => 0];\n\t\t}",
"public final function __end() : bool {\n\t\t\treturn false;\n\t\t}",
"public function close() {\n\t\t$this->sessionClosed = true;\n\t}",
"public function hasSession() {}",
"public function logout()\n\t\t{\n\t\tif (!$this->checkSession()) return false;\n\t\t$res=$this->get(\"http://m.linkedin.com/session/logout\",true);\n\t\t$this->debugRequest();\n\t\t$this->resetDebugger();\n\t\t$this->stopPlugin();\n\t\treturn true;\t\n\t\t}",
"function session_leave()\n{\n session_write_close();\n}",
"public function isLoged() {\n\n\t\tif (is_null($this->getSession()))\n\t\t\treturn false;\n\t\telse\n\t\t\treturn true;\n\t}",
"public function action_endsession()\n\t{\n\t\t// This is so easy!\n\t\tunset($_SESSION['admin_time']);\n\n\t\t// Clean any admin tokens as well.\n\t\tcleanTokens(false, '-admin');\n\n\t\tif (isset($this->_req->query->redir, $this->_req->server->HTTP_REFERER))\n\t\t{\n\t\t\tredirectexit($_SERVER['HTTP_REFERER']);\n\t\t}\n\n\t\tredirectexit();\n\t}",
"protected function is_timed_out( )\n\t{\n\t\t$user = $this->php_session->get('user');\n\t\tif( $user['last_active'] <= time()-1800 ) //times out in 30 minutes\n\t\t\treturn False; \n\t\treturn True;\t\n\t}",
"public function logout()\n {\n $user = LSPrincipal::getUser();\n $logout = $user->userLogout();\n \n // Verifying if the user left completely\n if (($logout === true)) {\n return true;\n } else {\n return false;\n }\n }",
"static public function sessionIsValid()\n {\n try {\n $ret = false;\n\n session_start();\n\n // TODO: Make sure this is correct\n if (isset($_SESSION) && $_SESSION['sessionkey']) {\n $ret = true;\n\n // Update last activity time stamp\n $_SESSION['LAST_ACTIVITY'] = time();\n } else {\n session_unset();\n session_destroy();\n }\n\n return $ret;\n } catch (Exception $e) {\n return false;\n }\n }",
"public function hasEnded()\n {\n return $this->ended;\n }",
"function endSession()\n\t{\n\t\tsession_start();\n\t\tif (isset($_SESSION['userFirstName']) && isset($_SESSION['userLastName']) && isset($_SESSION['userName']))\n\t\t{\n\t\t\tunset($_SESSION['userFirstName']);\n\t\t\tunset($_SESSION['userLastName']);\n\t\t\tunset($_SESSION['userName']);\n\t\t\tsession_destroy();\n\n\t\t\techo json_encode(array('success' => 'Session deleted'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdie(json_encode(errors(417)));\n\t\t}\n\t}",
"public function verifySessionIntegrity() {\n if (!$this->isValidSession()) {\n $this->end();\n $this->restart();\n }\n }",
"public function __destruct() {\n session_write_close();\n return true;\n }",
"public function destroy() {\n\n if($this->isActive()) {\n return session_destroy();\n }\n return false;\n }",
"public function ends()\n {\n return $this->endRepeat !== \"never\";\n }",
"public function sessionIdIsTimedOut()\n {\n if ($this->sessionIdTimeout <= $this->sessionAge()) {\n return true;\n }\n\n return false;\n }",
"public function logout() {\n $this->session->unsetUserData();\n return true;\n }",
"public function destroy(): bool\n {\n session_destroy();\n if ($this->active()) {\n session_destroy();\n unset($_SESSION);\n\n return $this->active() === false;\n }\n return false;\n }",
"public function abort() : bool\n {\n if ($this->isActive()) {\n $aborted = \\session_abort();\n }\n return $aborted ?? true;\n }",
"public function destroy() : bool\n {\n if ($this->isActive()) {\n $destroyed = \\session_destroy();\n }\n unset($_SESSION);\n return $destroyed ?? true;\n }",
"public function logout()\n\t\t{\n\t\tif (!$this->checkSession()) return false;\n\t\t$res=$this->get(\"http://www.plurk.com/Users/logout\",true); \n\t\t$this->debugRequest();\n\t\t$this->resetDebugger();\n\t\t$this->stopPlugin();\n\t\treturn true;\t\n\t\t}",
"public static function logout()\n {\n $currentSession = SessionService::getCurrent();\n if (!is_null($currentSession)) {\n SessionService::setCurrent(null);\n return self::invalidateSession($currentSession[\"guid\"]);\n }\n return true;\n }",
"protected static function sessionExists() {\n return session_status() == 2;\n }",
"static public function isCurrentSessionValid() {\n\t\t$session = self::getCurrentSession();\n\t\t\n\t\tif (!empty($session)) {\n\t\t\t\n\t\t\t$now = new DateTime('now', new DateTimeZone('UTC'));\n\t\t\t$ssoSessionExpires = new DateTime($session->SSOSessionExpires);\n\t\t\t\n\t\t\tif ($ssoSessionExpires > $now) \n\t\t\t\treturn true;\n\t\t\telse {\n\t\t\t\treturn false;\n\t\t\t\tself::clearCurrentSession();\n\t\t\t}\n\t\t} \n\t\t\n\t\treturn false;\n\t}",
"protected function _IsSessionTimeout()\n\t{\n\t\t// ...\n\t\t$bRet = false;\n\n\t\t// ...\n\t\t$bValidSession = true;\n\t\t$cSession\t= new CUCSession();\n\n\t\t//\n\t\t//\tCheck session via Redis service if T->CKT_REFRESHTM is overdue\n\t\t//\n\t\t$nRefreshTime = $this->GetXTValue( $this->m_sMKeyT, self::CKT_REFRESHTM );\n\t\tif ( time() - $nRefreshTime > 0 )\n\t\t{\n\t\t\t//\trefresh time is overdue, it's time to check via Redis\n\t\t\t//\t...\n\t\t\t$bValidSession = $cSession->IsValidSession();\n\t\t}\n\n\t\t// ...\n\t\tif ( $bValidSession )\n\t\t{\n\t\t\tif ( $this->IsKeepAlive() )\n\t\t\t{\n\t\t\t\t//\n\t\t\t\t//\treturn false if user set to keep alive\n\t\t\t\t//\n\t\t\t\t$bRet = false;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//\t...\n\t\t\t\t$nLoginTime = $this->GetXTValue( $this->m_sMKeyT, self::CKT_LOGINTM );\n\t\t\t\tif ( is_numeric( $nLoginTime ) )\n\t\t\t\t{\n\t\t\t\t\t//\tescaped time in seconds after user logged in\n\t\t\t\t\t// the default timeout is 1 day.\n\t\t\t\t\t$term = floatval( time() - floatval( $nLoginTime ) );\n\t\t\t\t\t$bRet = ( $term > $this->m_arrCfg[ self::CFGKEY_STIMEOUT ] );\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// login time is invalid\n\t\t\t\t\t// So, we marked this session as timeout\n\t\t\t\t\t$bRet = true;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// session is timeout.\n\t\t\t// So, we marked this session as timeout\n\t\t\t$bRet = true;\n\t\t}\n\n\t\treturn $bRet;\n\t}",
"private function isLoggedin()\n\t{\n\t\t$this->idletime = 18000;\n\n\t\tif ((time()-$_SESSION['timestamp'])>$this->idletime)\n\t\t{\n\t\t\t$message = \"You are signed out from the previous session ! Please try sign in again!\";\n\t\t\t$this->logout($message);\n\t\t}\n\t\telseif($this->logged_in() == false)\n\t\t{\n\t\t\t$message = \"Invalid session !! Please try sign in again.\";\n\t\t\t$this->logout($message);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$_SESSION['timestamp'] = time();\n\t\t}\n\t}",
"function db_pwassist_session_close()\n{\n\treturn true;\n}",
"public function sessionIsValid()\n {\n return $this->authClient->sessionIsValid();\n }",
"public function isRecentLogout()\n {\n if ($this->session->get($this->recentLogoutEventIndex)) {\n $this->session->set($this->recentLogoutEventIndex, false);\n return true;\n }\n return false;\n }",
"function _session_is_valid(){\n\t\treturn session_is_valid($this->_state_session_id);\n\t}",
"function destroy()\n {\n // session was already destroyed\n\t\tif( $this->_state === 'destroyed' ) {\n return true;\n\t\t}\n\n session_unset();\n session_destroy();\n\n\t\t// In order to kill the session altogether, like to log the user out, the session id\n\t\t// must also be unset. If a cookie is used to propagate the session id (default behavior),\n\t\t// then the session cookie must be deleted.\n\t\tif (isset($_COOKIE[session_name()])) {\n\t\t\tsetcookie(session_name(), '', time()-42000, '/');\n\t\t}\n\n\t\t$this->_state = 'destroyed';\n\t\treturn true;\n\t}",
"public function hasSession() {\r\n\t\treturn is_null($this->id) ? false : true;\r\n\t}",
"function checkLogout(){\n\t\tif ($_SESSION['logrec_logout'] == 0){\n\t\t\tshowMessage(\"You forgot to logout last time. Please remember to log out properly.\");\n\t\t\t$_SESSION['logrec_logout'] = 1;\n\t\t}\n\t}",
"public function hasSession() {\n return !empty($this->session);\n }",
"public static function close() {\n if ('' !== session_id()) {\n session_write_close();\n }\n }",
"public function has_ended() {\r\n\t\treturn 0 == $this->get_seconds_left();\r\n\t}",
"private function isSessionAvailable(): bool\n {\n return $this->session !== null;\n }",
"public function verifySession() {\n\t\t$this->reload();\n\t\tif ($this->getSession() == session_id())\n\t\t\treturn true;\n\t\telse {\n\t\t\tif($_SESSION[\"loginUser\"])\n\t\t\t\tunset($_SESSION[\"loginUser\"]);\n\t\t\treturn false;\n\t\t}\n\t}",
"function endSession()\n {\n $this->documentBuffer .= \"</div>\\n\";\n }",
"protected function hasExpired()\r\n {\r\n return isset($this->_session[$this->_timeoutKey]) && $this->_session[$this->_timeoutKey] < time();\r\n }",
"private function userFinishedSession(Session $session)\n {\n return $session->participants()\n ->wherePivot('user_id', Auth::id())\n ->wherePivot('status', 'finished')\n ->exists();\n }",
"function shutdown() {\r\n // Write the session data to the disk\r\n session_write_close();\r\n}",
"public function logout( ) {\n\t\tif( ini_get(\"session.use_cookies\") ) {\n\t\t\t$params = session_get_cookie_params();\n\t\t\tsetcookie(session_name(), '', time() - 42000,\n\t\t\t$params[\"path\"], $params[\"domain\"],\n\t\t\t$params[\"secure\"], $params[\"httponly\"]\n\t\t\t);\n\t\t}\n\t\tif( parent::logout() ) {\n\t\t\t$_SESSION = array();\n\t\t\tsession_destroy();\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function expireSession()\n\t{\n\t\t// TODO\n\t}",
"function _close()\n\t{\n\t\tif (!$this->connection)\n\t\t{\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $this->_send_command('QUIT');\n\t}",
"public static function logout()\n {\n if (self::check()) {\n session_unset($_SESSION['user']);\n return true;\n }\n return false;\n }",
"public static function sessionCloseHandler();",
"public static function Logout()\n\t{\n\t\t$_SESSION = array();\n\t\tsession_destroy();\n\t\tsession_start();\n\t\tsession_regenerate_id();\n\t\treturn !isset($_SESSION['userID']);\n\t}",
"public function logout(){\n\t\n\t\t$accessor = BankAccessor::create();\n\t\t\n\t\t//\tGets the current user and their token\n\t\t$user = $accessor->getCurrentUser();\n\t\t$token = Cookie::get('BankingSession');\n\t\t\n\t\t//\tIf the logout was successful delete the cookie\n\t\tif ($accessor->logout($user->ID, $token) == 0) {\n\t\t\t\n\t\t\tCookie::force_expiry(\"BankingSession\");\n\t\t\treturn true;\n\t\t}\n\t\t\n\t\treturn false;\n\t}",
"public static function endSession ($sid)\r\n\t{\r\n\t\t$sess = self::$instances->$sid;\r\n\t\t$sess->end();\r\n\t\tunset(self::$instances->$sid);\r\n\r\n\t\t// Destroy the global session object after the\r\n\t\t// last session has been closed\r\n\t\tif (0 === sizeof(self::$instances)) {\r\n\t\t\tsession_destroy();\r\n\t\t}\r\n\t}",
"public function sessions_end($SESS)\n\t{\n\t\t// Check app version to see what to do\n\t\tif (version_compare(APP_VER, '2.4.0', '<') && REQ == 'PAGE')\n\t\t{\n\t\t\t$this->_add_vars();\n\t\t}\n\n\t\t// Return it again\n\t\treturn $SESS;\n\t}",
"public function destroy() {\r\n\t\tsession_destroy();\r\n\treturn true;\r\n\t}",
"public function sessions_end($session)\n {\n if ($this->ee->uri->segment(1) === 'payment_return') {\n // assign the session object prematurely, since EE won't need it anyway\n // (this hook runs inside the Session object constructor, which is a bit weird)\n $this->ee->session = $session;\n\n $_GET['H'] = (string) $this->ee->uri->segment(2);\n\n $module = new Module;\n $module->act_payment_return();\n }\n }",
"public static function destroy(){\n\t\t\tif(Session::session_started()){\n\t\t\t\tif(ini_get('session.use_cookies')){\n\t\t\t\t\t$params = session_get_cookie_params();\n\t\t\t\t\tsetcookie(session_name(), '', time() - 86400, $params['path'], $params['domain'], $params['secure'], $params['httponly']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tsession_destroy();\n\t\t\t\t\n\t\t\t\tSession::session_start();\n\t\t\t\tSession::reset();\n\t\t\t\treturn true;\n\t\t\t}else{\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t}",
"public function sessionEnd (){\n $this->load->library( 'nativesession' );\n $this->load->helper('url');\n\n //delete session data\n $this->nativesession->delete('userid');\n $this->nativesession->delete('userLevel');\n\n session_destroy();\n\n redirect(\"../../../iris/dashboard\");\n\t}",
"private function verifySession()\n {\n if ((isset($this->session['id']))\n && (is_numeric($this->session['id']))\n && (isset($this->session['legit']))\n && ($this->session['legit'] === $this->sessionHash())\n ) {\n return true;\n }\n return false;\n }",
"public function endSessionAction() {\n try {\n if ($this->statistics) {\n $statisticsTime = new StatisticsTime();\n $statisticsTime\n ->setStatistics($this->statistics)\n ->setAction($this->type)\n ->setMySessionId($this->sessionId)\n ->setIp(@$_SERVER['REMOTE_ADDR'])\n ->setTimeType('end')\n ->setTimeLength(time() - $this->statistics->getCreatedAt()->getTimestamp());\n $this->em->persist($statisticsTime);\n $this->em->flush();\n return new JsonResponse(array('success' => true, 'msg' => 'End session action successuflly did'));\n } else {\n throw new \\Exception('Cant find statistics for this session id and app id!');\n }\n } catch (\\Exception $e) {\n return new JsonResponse(array('success' => false, 'msg' => 'An error occured', 'error' => $e->getMessage()));\n }\n }",
"public function ended();",
"private function isSession () : bool {\n return !empty($_SESSION);\n }",
"public static function session_kill()\n {\n \tif (isset($_SESSION)) {\n \t\t$_SESSION = array();\n\n \t\tif (ini_get('session.use_cookies')) {\n \t\t $params = session_get_cookie_params();\n \t\t setcookie(session_name(), '', time() - 42000,\n \t\t $params['path'], $params['domain'],\n \t\t $params['secure'], $params['httponly']\n \t\t );\n \t\t}\n\n\t\t\tsession_unset();\n \t\tsession_destroy();\n \t\treturn true;\n \t}\n \treturn false;\n }",
"public function logout()\n {\n // destroy all data registered to the session\n session_destroy();\n // unset a given variable\n unset($_SESSION['user_session']);\n\n return true;\n }",
"public function LogOut()\n {\n $uid = $_SESSION['uid'];\n\n if(session_destroy()) {\n $result = $this->db->delete('sessions', array('fk_uid' => $uid));\n if($result) {\n return true;\n } else {\n return false;\n }\n } else {\n return false;\n }\n }",
"function wsod_sess_close() {\n $_GET['debug'] ? unregister_tick_function('wsod_tick') : NULL; // DEBUG_OFF\n $_GET['debug'] ? print wsod_tick(TRUE) : NULL; // DEBUG_PRINT\n\n $is_emergency = (strpos($_SERVER['SCRIPT_FILENAME'], 'emergency.php') !== FALSE);\n wsod_check_wsod(TRUE, $is_emergency, $is_emergency, $is_emergency);\n return TRUE;\n}",
"public function getTermination() : bool\r\n\t{\r\n\t\treturn $this->terminated;\r\n\t}",
"private function isNewSession($timestamp = '', $last_req = 0) {\n\t\t\n\t\t$is_new_session = false;\n\t\t\n\t\tif ( ! $timestamp ) {\n\t\t\t$timestamp = time();\n\t\t}\n\t\t\t\t\n\t\t$time_since_lastreq = $timestamp - $last_req;\n\t\t$len = owa_coreAPI::getSetting( 'base', 'session_length' );\n\t\tif ( $time_since_lastreq < $len ) {\n\t\t\towa_coreAPI::debug(\"This request is part of a active session.\");\n\t\t\treturn false;\t\t\n\t\t} else {\n\t\t\t//NEW SESSION. prev session expired, because no requests since some time.\n\t\t\towa_coreAPI::debug(\"This request is the start of a new session. Prior session expired.\");\n\t\t\treturn true;\n\t\t}\n\t}",
"public function isExpired($timeout) {\n // Session ended normally\n if ($this->session != self::SESSION_ACTIVE) {\n return true;\n }\n\n // Session timed out\n if (($this->created + $timeout) >= time()) {\n $this->setState(self::SESSION_TIMEOUT);\n return true;\n }\n\n return false;\n }",
"public function logout()\n {\n $this->_user->delLoggedInUser();\n return true;\n }",
"public function logout(): bool\n {\n }",
"public function logout(): bool\n {\n }",
"private function isLogoutSuccessful()\n {\n if (isset($_SESSION[\"user\"])) {\n $this->logoutMessage = \"Fel uppstod, du kunde EJ loggas ut!\";\n return false;\n } else {\n $this->logoutMessage = \"Du har loggat ut. Stäng ner webbläsaren som extra säkerhet!\";\n return true;\n }\n }",
"public function reset() : bool\n {\n return \\session_reset();\n }",
"public function auth_logout()\r\n {\r\n $_SESSION['usr'] = null;\r\n session_destroy();\r\n\r\n return true;\r\n }",
"protected function checkSessionLifetime() {}"
] | [
"0.7965865",
"0.76960903",
"0.7401781",
"0.73459166",
"0.71515185",
"0.71076417",
"0.70544535",
"0.7033305",
"0.70268667",
"0.7003383",
"0.6970757",
"0.6925148",
"0.6842896",
"0.68338794",
"0.683221",
"0.6814471",
"0.68008876",
"0.67978567",
"0.67450947",
"0.673175",
"0.67193335",
"0.6716497",
"0.669879",
"0.66333747",
"0.6565394",
"0.6550854",
"0.65294564",
"0.65179634",
"0.6504312",
"0.6503547",
"0.65021837",
"0.6501443",
"0.64931494",
"0.64736307",
"0.6460457",
"0.6458514",
"0.6433407",
"0.642971",
"0.64249367",
"0.64194953",
"0.64125574",
"0.64058244",
"0.6397991",
"0.63859284",
"0.63840646",
"0.6375078",
"0.6372906",
"0.6361116",
"0.63561094",
"0.6322166",
"0.63032687",
"0.6288793",
"0.62879413",
"0.62760866",
"0.6258719",
"0.6255149",
"0.6222436",
"0.6199859",
"0.6195804",
"0.6192542",
"0.61921394",
"0.61906385",
"0.619028",
"0.6188596",
"0.6178817",
"0.6167547",
"0.6152634",
"0.61461604",
"0.6145183",
"0.61399996",
"0.6138447",
"0.61378914",
"0.61291414",
"0.61173785",
"0.6114714",
"0.6102231",
"0.6101258",
"0.6098875",
"0.6093009",
"0.6091233",
"0.6079436",
"0.6069322",
"0.6061885",
"0.606185",
"0.6044614",
"0.60250497",
"0.60166776",
"0.59981436",
"0.59929466",
"0.59806687",
"0.5980363",
"0.5971432",
"0.59707737",
"0.59694135",
"0.59664804",
"0.59664804",
"0.5964704",
"0.59609634",
"0.59572864",
"0.5954682"
] | 0.871339 | 0 |
End the current session | public function endSession()
{
$this->session->end();
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function sessions_end()\n\t{\n\t\t// nothing to see here\n\t}",
"private function end() {\n if ($this->isSessionStarted()) {\n session_commit();\n $this->clear();\n }\n }",
"public function sessionEnd (){\n $this->load->library( 'nativesession' );\n $this->load->helper('url');\n\n //delete session data\n $this->nativesession->delete('userid');\n $this->nativesession->delete('userLevel');\n\n session_destroy();\n\n redirect(\"../../../iris/dashboard\");\n\t}",
"public function action_endsession()\n\t{\n\t\t// This is so easy!\n\t\tunset($_SESSION['admin_time']);\n\n\t\t// Clean any admin tokens as well.\n\t\tcleanTokens(false, '-admin');\n\n\t\tif (isset($this->_req->query->redir, $this->_req->server->HTTP_REFERER))\n\t\t{\n\t\t\tredirectexit($_SERVER['HTTP_REFERER']);\n\t\t}\n\n\t\tredirectexit();\n\t}",
"function EndSession(){\n session_unset(); \n // destroy the session \n session_destroy(); \n }",
"public function logout()\n {\n $this->session->end();\n }",
"public function close()\n {\n $this->_client->endSession($this->_session);\n }",
"public static function endSession()\n {\n if (!empty(self::$_start_time)) {\n $now = microtime(true);\n self::$_duration = $now - self::$_start_time;\n }\n }",
"public function logout()\n\t\t{\n\t\t\treturn $this->end_session();\n\t\t}",
"public function close() {\n\t\t$this->sessionClosed = true;\n\t}",
"private function _closeSession()\n {\n $session = $this->requestStack->getCurrentRequest()->getSession();\n if ($session===null || !$session->isStarted()) {\n return;\n } \n \n $session->save();\n }",
"public function end_login(){\n\n\t\t//STARTS SESSION IF NON\n\t\tsession_id() == ''? session_start(): NULL;\n\n\t\t$this->LOGGED_IN = false;\n\t\tunset($this->USER_ID);\n\n\t\t$_SESSION = Array();\n\n\t\tsetcookie(\"PHPSESSID\", NULL, time()-3600, '/');\n\t\tsetcookie(\"user\", NULL, time()-3600, '/');\n\n\t\techo Janitor::build_json_alert('Logged Out Successfully', 'Success', 107, 1);\n\t\texit;\n\t\t}",
"public function endSession() {\n $this->state = 0;\n $_SESSION['authstate'] = 0;\n setcookie('access_token', '', 0);\n setcookie('access_token_secret', '', 0);\n }",
"public function end() {\n\t\t$this->get = null;\n\t\t$this->post = null;\n\t\t$this->server = null;\n\t\t$this->header = null;\n\t\t$this->cookie = null;\n\t\t$this->files = null;\n\t\t$this->sw_request = null;\n\t\tif ($this->session !== null) {\n\t\t\t$handler = Container::getInstance()->get(Dispatcher::class)->getSessionHandler();\n\t\t\t$handler->write($this->session->id(), $this->session->encode());\n\t\t\t$this->session = null;\n\t\t}\n\t}",
"function endSession()\n\t{\n\t\tsession_start();\n\t\tif (isset($_SESSION['userFirstName']) && isset($_SESSION['userLastName']) && isset($_SESSION['userName']))\n\t\t{\n\t\t\tunset($_SESSION['userFirstName']);\n\t\t\tunset($_SESSION['userLastName']);\n\t\t\tunset($_SESSION['userName']);\n\t\t\tsession_destroy();\n\n\t\t\techo json_encode(array('success' => 'Session deleted'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdie(json_encode(errors(417)));\n\t\t}\n\t}",
"public function end();",
"public function end();",
"public function end();",
"public function end();",
"private function end_session()\n\t\t{\n\t\t\tif (isset($_SESSION['userid']))\n\t\t\t{\n\t\t\t\tif (isset($_COOKIE['auth_token']))\n\t\t\t\t\tsetcookie('auth_token', '', strtotime('-1 year'));\n\n\t\t\t\tsession_destroy();\n\t\t\t}\n\t\t\treturn ['id' => null, 'name' => null, 'state' => 0];\n\t\t}",
"function endSession()\n {\n $this->documentBuffer .= \"</div>\\n\";\n }",
"public function end() {}",
"public function end() {}",
"public function end() {}",
"public static function close() {\n if ('' !== session_id()) {\n session_write_close();\n }\n }",
"public static function terminate(): void {\n\t\tself::$sessionInstance->terminate ();\n\t}",
"public function endSessionAction() {\n try {\n if ($this->statistics) {\n $statisticsTime = new StatisticsTime();\n $statisticsTime\n ->setStatistics($this->statistics)\n ->setAction($this->type)\n ->setMySessionId($this->sessionId)\n ->setIp(@$_SERVER['REMOTE_ADDR'])\n ->setTimeType('end')\n ->setTimeLength(time() - $this->statistics->getCreatedAt()->getTimestamp());\n $this->em->persist($statisticsTime);\n $this->em->flush();\n return new JsonResponse(array('success' => true, 'msg' => 'End session action successuflly did'));\n } else {\n throw new \\Exception('Cant find statistics for this session id and app id!');\n }\n } catch (\\Exception $e) {\n return new JsonResponse(array('success' => false, 'msg' => 'An error occured', 'error' => $e->getMessage()));\n }\n }",
"public function logout() {\r\n Session::end();\r\n Misc::redirect('login');\r\n }",
"public function close()\n {\n $this->session->sess_destroy();\n redirect('/home');\n }",
"function session_leave()\n{\n session_write_close();\n}",
"protected function unlock_session() {\n \\core\\session\\manager::write_close();\n ignore_user_abort(true);\n }",
"public function destroy()\r\n\t\t{\r\n\t\t\t\tsession_unset();\r\n\t\t\t\tsession_destroy();\r\n\t\t\t\t$scriptName = getScriptName() . '.php';\r\n\t\t\t\tif ($scriptName != self::SESSION_END_URL)\r\n\t\t\t\t\t\theader('Location: ' . self::SESSION_END_URL);\r\n\t\t}",
"public function endAction()\n {\n $test = $this->session->remove('auth');\n\t\t\n $this->flash->success('Goodbye!' .$test);\n return $this->forward('apps/index');\n }",
"public function end() {\n $this->memcache->delete(PREFIX_SESSION.$this->sessionID);\n $targets = $this->getTargets();\n foreach ($targets as $share) {\n if ($share->exists()) {\n switch ($share->getType()) {\n case SHARE_TYPE_ALONE:\n $share->end();\n break;\n case SHARE_TYPE_GROUP:\n $share->clean();\n break;\n }\n }\n }\n }",
"public function destroySession() {}",
"public function end()\n {\n }",
"public function logout()\n {\n Session::destroy();\n $this->ok();\n }",
"public static function endSession ($sid)\r\n\t{\r\n\t\t$sess = self::$instances->$sid;\r\n\t\t$sess->end();\r\n\t\tunset(self::$instances->$sid);\r\n\r\n\t\t// Destroy the global session object after the\r\n\t\t// last session has been closed\r\n\t\tif (0 === sizeof(self::$instances)) {\r\n\t\t\tsession_destroy();\r\n\t\t}\r\n\t}",
"public function close()\n {\n curl_close($this->_session);\n }",
"function shutdown() {\r\n // Write the session data to the disk\r\n session_write_close();\r\n}",
"public static function afnSessionStop()\n {\n @session_unset();\n @session_destroy();\n return true;\n }",
"public function endAction()\n { \n $this->session->remove('auth');\n $this->flash->success('Goodbye!');\n return $this->forward('index/index');\n }",
"public function logoutxxx()\n {\n $this->getSession()->destroy();\n }",
"public function logout() {\n\t\tif ($this->isLoggedIn ()) { //only the logged in user may call logout.\n\t\t\t//Remove session data\n\t\t\tunset ( $this->session );\n\t\t\t$this->updateSession ();\n\t\t\tunset ($_SESSION['uid']);\n\t\t\tsession_destroy();\n\t\t}\n\t\techo '<reply action=\"ok\" />';\n\t}",
"public function destroy() {\n\t\t\tif (isset($_SESSION)) {\n\t\t\t\tsession_destroy();\n\t\t\t} else {\n\t\t\t\t$this->response->throwErr(\"There's no active session\");\n\t\t\t\texit();\n\t\t\t}\n\t\t}",
"public function expireSession()\n\t{\n\t\t// TODO\n\t}",
"public function cerrar2()\n {\n Session::destroy();\n }",
"public static function Logout()\n {\n Session::CloseSession();\n }",
"public function logout() {\r\n\t\tSession::delete($this->_sessionName);\r\n\t}",
"function on_session_end() {\n}",
"public function endCommunication()\n {\n $this->restAPI->keepAuth = false;\n $this->restAPI->logout();\n }",
"Public function end()\n\t{\n\t\t$this->endTimer = microtime(TRUE);\n\t}",
"public function logout()\n {\n $this->flushSession();\n }",
"public static function logOut()\n {\n self::startSession();\n session_destroy();\n }",
"public static function sessionClose()\n {\n return true;\n }",
"public function sessions_end($session)\n {\n if ($this->ee->uri->segment(1) === 'payment_return') {\n // assign the session object prematurely, since EE won't need it anyway\n // (this hook runs inside the Session object constructor, which is a bit weird)\n $this->ee->session = $session;\n\n $_GET['H'] = (string) $this->ee->uri->segment(2);\n\n $module = new Module;\n $module->act_payment_return();\n }\n }",
"public function end()\n\t{\n\t\t$this->set_process_state(false);\n\t}",
"public function commitSession()\n {\n session_write_close();\n }",
"public function ended();",
"public function logout() {\n @session_start();\n session_destroy();\n }",
"public function logout() {\n $s = Session::getInstance();\n $key = $this->sessionId;\n unset($s->$key);\n $this->setAuthed(false);\n }",
"public static function destroySession();",
"public function logout() {\n unset($_SESSION['uID']);\n\n // close the session\n session_write_close();\n\n // send to the homepage\n header('Location: '.BASE_URL);\n\n }",
"public function end()\n\t{\n\t\tTwitchHelper::log(TwitchHelper::LOG_INFO, \"Stream end\");\n\t}",
"public function endAction() {\r\n $this->session->remove('auth');\r\n $this->flash->success('Obrigado!');\r\n\r\n return $this->dispatcher->forward([\r\n \"controller\" => \"peer\",\r\n \"action\" => \"index\"\r\n ]);\r\n }",
"public static function sessionCloseHandler();",
"public static function end()\r\n {\r\n self::singleton()->endScript();\r\n }",
"public function logout()\n\t{\n\t\tif (isset($_SESSION[$this->sess_auth])) {\t\n\t\t\tSessionManager::instance()->trashLoginCreadentials();\n\t\t}\n\t}",
"public function killSession()\n {\n $this->session->invalidate();\n }",
"public function _logout()\n {\n $this->_login( self::getGuestID() );\n }",
"public function logout() {\n $session_key = $this->getSessionKey();\n if ($this->Session->valid() && $this->Session->check($session_key)) {\n $ses = $this->Session->read($session_key);\n if (!empty($ses) && is_array($ses)) {\n $this->Session->delete($session_key);\n $this->Session->delete($this->config['prefixo_sessao'] . '.frompage');\n }\n }\n if ($this->config['auto_redirecionamento'] && !empty($this->config['pagina_logout'])) {\n $this->redirecionar($this->config['pagina_logout']);\n }\n }",
"public function destroy()\n {\n session_start();\n session_destroy();\n $this->view->mostrarsesionExpirada();\n die();\n }",
"public function logout() {\n\t\tif($this->checkLoggedIn()) {\n\t\t\t$this->session->stop();\n\t\t\t$this->session->start();\n\t\t\t$this->session->set('logout', 'A bientôt !');\n\t\t\theader('Location: index.php?action=forumHome');\n\t\t}\n\t}",
"public function endCommunication()\n {\n $this->provider->keepAuth = false;\n $this->provider->logout();\n }",
"public function logout()\n {\n $this->userId = 0;\n $this->createSession();\n $this->logger->loginOutEntry(2);\n }",
"public function shutdown()\n {\n $this->setAttribute('lastrequest', time(), 'user');\n\n // rimozione variabili flash da eliminare\n foreach ($names = $this->getNames('core/user/flash/remove') as $name)\n {\n $this->removeAttribute($name, 'core/user/flash');\n $this->removeAttribute($name, 'core/user/flash/remove');\n }\n\n // termina immediatamente\n session_write_close();\n }",
"public function logout()\r\n\t{\r\n\t\t$_SESSION = array();\r\n\t\tsession_destroy();\r\n\t\treturn;\r\n\t}",
"function end();",
"function __destruct()\n {\n session_write_close();\n }",
"public function logout()\n\t\t{\n\t\tif (!$this->checkSession()) return false;\n\t\t$res=$this->get(\"http://www.plurk.com/Users/logout\",true); \n\t\t$this->debugRequest();\n\t\t$this->resetDebugger();\n\t\t$this->stopPlugin();\n\t\treturn true;\t\n\t\t}",
"public function end(): void\n {\n }",
"public function logOut () : void {\n $this->destroySession();\n }",
"public function closeSession() {\n session_unset();\n return true;\n }",
"public function logout() { \n \n session_destroy(); \n }",
"public function logout() {\r\n\t\tSession::set('login', FALSE, self::$namespace);\r\n\t}",
"function destroySession(){\n\t\t\tSession::destroy();\n\t\t\t$login = substr(URL, 0, -1);\n\t\t\theader(\"Location:\".$login);\n\t\t}",
"public function close()\n {\n session_write_close();\n return true;\n }",
"public function cerrar()\n {\n session_start();\n\n session_destroy();\n\n header(\"Location:\" . RUTA_URL . \"/inicio\");\n\n }",
"public function logout()\n {\n $this->deleteSession();\n }",
"public function logoutAction()\n {\n QuizSessionService::endSession();\n return new ResponseModel(ResponseModel::STATUS, true);\n }",
"public function logout() {\n\t\t//Bridge Logout\n\t\tif ($this->config->get('cmsbridge_active') == 1 && !$this->lite_mode){\n\t\t\t$this->bridge->logout();\n\t\t}\n\n\t\t//Loginmethod logout\n\t\t$arrAuthObjects = $this->get_login_objects();\n\t\tforeach($arrAuthObjects as $strMethods => $objMethod){\n\t\t\tif (method_exists($objMethod, 'logout')){\n\t\t\t\t$objMethod->logout();\n\t\t\t}\n\t\t}\n\n\t\t//Destroy this session\n\t\t$this->destroy();\n\t}",
"public function doLogout()\n {\n $this->deleteRememberMeCookie();\n\n $_SESSION = array();\n session_destroy();\n\n $this->user_is_logged_in = false;\n $this->messages[] = MESSAGE_LOGGED_OUT;\n }",
"public function logout()\n\t\t{\n\t\tif (!$this->checkSession()) return false;\n\t\t$res=$this->get(\"http://m.linkedin.com/session/logout\",true);\n\t\t$this->debugRequest();\n\t\t$this->resetDebugger();\n\t\t$this->stopPlugin();\n\t\treturn true;\t\n\t\t}",
"public function logout()\n\t{\n\t\t$this->session->sess_destroy();\n\t\tredirect('main');\n\t}",
"public function LogOut()\n {\n session_destroy();\n }",
"public static function logout() {\n session_start();\n session_destroy();\n header(\"Location: /\");\n exit;\n }",
"public function doLogout() {\n $_SESSION = array();\n session_destroy();\n $this->messages[] = \"Acabas de cerrar Sesión.\";\n \n\n }",
"public function logout(){\n\t\tsession_destroy();\n\t\theader(\"location: index.php\");\n\t\texit;\n\t}",
"public function logout()\n {\n session_destroy();\n $this->redirect(BASE_URL . 'index.php?page=home');\n }",
"public function __destruct() {\n session_write_close();\n return true;\n }",
"public function logoutAction()\n {\n session_unset();\n header(\"Location: /SafeRideStore\");\n }"
] | [
"0.84253466",
"0.84229064",
"0.7923977",
"0.7921572",
"0.7919525",
"0.79044193",
"0.7807676",
"0.7669818",
"0.75881207",
"0.7535007",
"0.7498573",
"0.7480881",
"0.7433788",
"0.74071795",
"0.73748875",
"0.73519677",
"0.73519677",
"0.73519677",
"0.73519677",
"0.73416996",
"0.7327437",
"0.72883034",
"0.72883034",
"0.72883034",
"0.72368115",
"0.72361207",
"0.71120924",
"0.710145",
"0.7084178",
"0.7073324",
"0.706322",
"0.70565444",
"0.70527506",
"0.7030345",
"0.7006236",
"0.7000515",
"0.69319654",
"0.6929594",
"0.69251984",
"0.6920456",
"0.6912403",
"0.6877496",
"0.6873849",
"0.68735605",
"0.6872167",
"0.68621355",
"0.6835266",
"0.6829543",
"0.6822598",
"0.68161815",
"0.6806514",
"0.6800788",
"0.6799055",
"0.6787222",
"0.67822",
"0.67657864",
"0.6759235",
"0.67587185",
"0.6723016",
"0.6714694",
"0.670303",
"0.6679294",
"0.6657008",
"0.66456735",
"0.6634843",
"0.6614721",
"0.6614464",
"0.6610935",
"0.6608584",
"0.6599991",
"0.6599904",
"0.65831894",
"0.6580803",
"0.65800905",
"0.6571229",
"0.6568979",
"0.65675634",
"0.6567",
"0.6564849",
"0.65636075",
"0.6558272",
"0.6552574",
"0.6538197",
"0.65322465",
"0.65321434",
"0.6531205",
"0.6530633",
"0.652967",
"0.65131825",
"0.65130436",
"0.650951",
"0.6494831",
"0.649185",
"0.6488836",
"0.6483738",
"0.64750546",
"0.64748895",
"0.6472561",
"0.64574254",
"0.6457015",
"0.64559114"
] | 0.0 | -1 |
Build a plaintext speech response | protected function getSpeechResponse($text, $type)
{
$response = [
'type' => $type,
'text' => $text,
];
if ($type === self::TYPE_SSML) {
$response['ssml'] = $response['text'];
unset($response['text']);
}
return $response;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function textToSpeech($message);",
"public function makeSms()\n {\n $sms = strtoupper($this->search_words);\n switch ($this->definitions_count) {\n case 0:\n $sms .= \" | No definitions found.\";\n break;\n case 1:\n $sms .= \" | \" .$this->definitions[0];\n\n\n\n\n break;\n default:\n foreach($this->definitions as $definition) {\n $sms .= \" / \" . $definition;\n }\n }\n\n $sms .= \" | \" . $this->response;\n\n // Really need to refactor this double :/\n $this->sms_message = $sms;\n\n }",
"public function build_simpleResponse($textToSpeech, $displayText) {\n\t $response = array(\n\t\t 'simpleResponse' => array(\n\t\t\t 'textToSpeech' => $textToSpeech,\n\t\t\t 'displayText' => $displayText\n\t\t\t)\n\t\t);\n\t\t$this->items[] = $response;\n }",
"public function build_audioResponse($url, $displayText) {\n\t \n\t // Loop through the URLs if they are an array and build the ssml as necessary\n\t $ssml = ' <speak> ';\n\t if ( is_array($url) ) {\n\t\t foreach($url as $u) {\n\t\t\t $ssml .= \"<audio src = '\" . $u . \"' /> \";\n\t\t }\n\t }\n\t else {\n\t\t $ssml .= \"<audio src = '\" . $url . \"' /> \";\n\t }\n\t $ssml .= '</speak>';\n\t \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 render() {\n\t\t$rtn = [\n\t\t\t'speech' => $this->speech,\n\t\t\t'source' => $this->source\n\t\t];\n\t\t$data = [];\n\t\tif ($this->googleData) {\n\t\t\t$data['google']=$this->googleData->render();\n\t\t}\n\t\tif (count($data)>0) {\n\t\t\t$rtn['data']=$data;\n\t\t}\n\t\tif ($this->displayText) {\n\t\t\t$rtn['displayText'] = $this->displayText;\n\t\t}\n\t\treturn $rtn;\n\t}",
"public function convertSpeechToText(string $text);",
"public function sentence()\n {\n $sentence = $this->randomizer->getSentences(1);\n\n return $this->apiResponse($sentence[0]);\n }",
"public function textToSpeech(string $text): string\n {\n return $this->sendRequest(\"https://code.responsivevoice.org/getvoice.php\", [\n \"tl\" => $this->language,\n \"t\" => $text,\n ]);\n }",
"function response()\n{\n //$data = $GLOBALS['HTTP_RAW_POST_DATA'];\n $data = file_get_contents('php://input');\n $client = simplexml_load_string($data);\n\n if (strtolower($client->MsgType) == \"event\") {\n if ($client->Event == 'subscribe') {\n $toUserName = $client->FromUserName;\n $FromUserName = $client->ToUserName;\n $time = time();\n $msgType = 'text';\n $content = \"hello world\";\n $tpl = \" <xml>\n <ToUserName><![CDATA[%s]]></ToUserName>\n <FromUserName><![CDATA[%s]]></FromUserName>\n <CreateTime>%s</CreateTime>\n <MsgType><![CDATA[%s]]></MsgType>\n <Content><![CDATA[%s]]></Content>\n </xml>\";\n $info = sprintf($tpl,$toUserName,$FromUserName,$time,$msgType,$content);\n echo $info;\n }\n\n\n }else{\n if(strtolower($client->MsgType) == 'text'){\n $request = $client->Content;\n $flag = fliter($request);\n switch($flag){\n case 'cet4':\n $msg = cet4($request);\n break;\n case 'matrix':\n $msg = matrixCaculator($request);\n break;\n case 'default':\n $msg = $request;\n break;\n default:\n $msg = $request;\n }\n responseText($client,$msg);\n }\n }\n}",
"function synthesizeOnline($vocalwareLID, $vocalwareVID, $text, $filename)\n {\n $error = false;\n $errormessage = null;\n $errorcode = 0;\n $output = array();\n \n $curl = curl_init();\n\n\n\t\t// A Vocalware account is needed\n $url = \"\";\n $secret_phrase = \"\";\n\n // Vocalware API identification is required\n $data = array(\n 'EID' => '2',\n 'LID' => $vocalwareLID,\n 'VID' => $vocalwareVID,\n 'TXT' => $text,\n 'EXT' => 'mp3',\n 'ACC' => '', // required\n 'API' => '' // required \n );\n\n $data['CS'] = md5($data['EID'].$data['LID'].$data['VID'].$data['TXT'].$data['EXT'].$data['ACC'].$data['API'].$secret_phrase);\n\n curl_setopt($curl, CURLOPT_POSTFIELDS, $data);\n\n curl_setopt($curl, CURLOPT_URL, $url);\n curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);\n\n $result = curl_exec($curl);\n\n curl_close($curl);\n \n // if no error occurred (we assume there's an error if the mp3 data is less than 1000 characters)\n if ($result && !strpos($result, \"Error: \") && (strlen($result) > 1000)) {\n\n try {\n $filenamewrite = \"mp3/\".$filename.\".mp3\";\n $fitxertxtwrite = fopen($filenamewrite,\"w+b\");\n\n if (flock($fitxertxtwrite, LOCK_EX)) {\n fwrite($fitxertxtwrite, $result);\n flock($fitxertxtwrite, LOCK_UN);\n fclose($fitxertxtwrite);\n }\n } catch (Exception $ex) {\n $error = true;\n $errormessage = \"Error. An error occurred while writing the audio file.\";\n $errorcode = 108;\n }\n }\n // if there was an error\n else {\n $error = true;\n $errormessage = \"Error. An error occurred while contacting the online voice service. Try again.\";\n $errorcode = 109;\n }\n \n $output[0] = $error;\n $output[1] = $errormessage;\n $output[2] = $errorcode;\n return $output;\n }",
"public function responseMsg_demo()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n //extract post data\n if (!empty($postStr)){\n\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $type = $postObj->MsgType;\n $event=$postObj->Event;\n $EventKey=$postObj->EventKey;\n\n $latitude = $postObj->Location_X;\n $longitude = $postObj->Location_Y;\n $keyword = trim($postObj->Content);\n $time = time();\n $textTpl = \"<xml>\n\t\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n\t\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n\t\t\t\t\t\t\t<CreateTime>%s</CreateTime>\n\t\t\t\t\t\t\t<MsgType><![CDATA[text]]></MsgType>\n\t\t\t\t\t\t\t<Content><![CDATA[%s]]></Content>\n\t\t\t\t\t\t\t<FuncFlag>0</FuncFlag>\n\t\t\t\t\t\t\t</xml>\";\n if ($event==\"CLICK\" and $EventKey==\"V1001_BRAND\")\n {\n $contentStr=\"自定义菜单教程\";\n\n }\n elseif ($event==\"CLICK\" and $EventKey==\"V1001_SUPPLY\")\n {\n $contentStr=\"谢谢你的赞扬\";\n }\n elseif ($event==\"CLICK\" and $EventKey==\"V1001_CHECK\")\n {\n $contentStr=\"你好我也好\";\n } elseif ($event==\"CLICK\" and $EventKey==\"V1001_ANTI_FAKE\")\n {\n $contentStr=\"谢谢你的赞扬\";\n }\n elseif ($event==\"CLICK\" and $EventKey==\"V1001_PROMOTE\")\n {\n $contentStr=\"你好我也好\";\n }\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $contentStr);\n echo $resultStr;\n\n\n\n }\n\n }",
"public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n global $textTpl;\n if (!empty($postStr))\n {\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $type = $postObj->MsgType;\n\n switch ($type)\n {\n case \"event\":\n $resultStr = GetEventMessage($postObj);\n break;\n case \"location\":\n $resultStr = GetLocationMessage($postObj);\n break;\n case \"text\":\n $resultStr = GetTextMessage($postObj);\n break;\n default:\n $resultStr = GetTextMessage($postObj);\n //$resultStr = GetDefaultMessage($postObj);\n break;\n }\n\n RecordInputContent($postObj); //保存用户输入的所有内容\n RefleshUserLoginTime($postObj); // 更新用户登录的最新时间\n\n echo $resultStr;\n }\n else\n {\n echo \"\";\n exit;\n }\n }",
"public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n //extract post data\n if (!empty($postStr)) {\n\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $keyword = trim($postObj->Content);\n $time = time();\n $textTpl = \"<xml>\n\t\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n\t\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n\t\t\t\t\t\t\t<CreateTime>%s</CreateTime>\n\t\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\n\t\t\t\t\t\t\t<Content><![CDATA[%s]]></Content>\n\t\t\t\t\t\t\t<FuncFlag>0</FuncFlag>\n\t\t\t\t\t\t\t</xml>\";\n if (!empty($keyword)) {\n $msgType = \"text\";\n $contentStr = \"Welcome to wechat world!\";\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n } else {\n echo \"Input something...\";\n }\n\n } else {\n echo \"\";\n exit;\n }\n }",
"function synthesizeWindows($voice, $text, $filename)\n {\n $error = false;\n $errormessage = null;\n $errorcode = 0;\n $output = array();\n \n $chosenVoice = null;\n $msVoice = null;\n $isSAPIVoice = false; \n \n // error de Microsoft Speech Platform\n $errorMSP = false;\n $errorMSPtmp = null;\n\n try {\n // Recollim els objectes de les llibreries Speech de Microsoft que necessitem\n $msVoice = new COM('Speech.SpVoice');\n\n $numvoices = $msVoice->GetVoices()->Count;\n\n // per cada veu miram si la descripció coincideix amb el nom de la veu\n // seleccionada per l'usuari\n for ($i=0; $i<$numvoices; $i++) {\n if ($voice == $msVoice->GetVoices()->Item($i)->GetDescription) {\n $chosenVoice = $msVoice->GetVoices()->Item($i);\n $isSAPIVoice = false;\n }\n }\n \n } catch (Exception $ex) {\n $errorMSP = true;\n $errorMSPtmp = \"Error. Unable to access Microsoft Speech Platform.\";\n }\n\n // error de SAPI\n $errorSAPI = false;\n $errorSAPItmp = null;\n\n try {\n // Recollim els objectes de les llibreries SAPI que necessitem\n $msVoice = new COM('SAPI.SpVoice');\n\n $numvoicesSAPI = $msVoice->GetVoices()->Count;\n\n // per cada veu miram si la descripció coincideix amb el nom de la veu\n // seleccionada per l'usuari\n for ($i=0; $i<$numvoicesSAPI; $i++) {\n if ($voice == $msVoice->GetVoices()->Item($i)->GetDescription) {\n $chosenVoice = $msVoice->GetVoices()->Item($i);\n $isSAPIVoice = true;\n }\n }\n \n } catch (Exception $ex) {\n $errorSAPI = true;\n $errorSAPItmp = \"Error. Unable to access SAPI voices.\";\n }\n\n if ($errorMSP && $errorSAPI) {\n $error = true;\n $errormessage = \"Error. Unable to access your selected Windows voice due to unkown circumstances. \"\n . \"Try changing your voices in your user configuration settings. \"\n . \"Otherwise, your Windows may not be compatible with MSP or SAPI.\";\n $errorcode = 111;\n }\n // si no hi ha hagut cap error, procedim a generar l'audio\n else {\n\n try {\n\n $msFileStream = null;\n $msAudioFormat = null;\n \n if (!$isSAPIVoice) {\n $msFileStream = new COM('Speech.SpFileStream');\n $msAudioFormat = new COM('Speech.SpAudioFormat');\n }\n else {\n $msFileStream = new COM('SAPI.SpFileStream');\n $msAudioFormat = new COM('SAPI.SpAudioFormat');\n }\n\n // Path al fitxer on guardarem les veus\n $wavfile = \"C:\\\\xampp\\htdocs\\mp3\\\\\".$filename.\".mp3\";\n \n // hem de triar la veu que vol l'usuari (trobada anteriorment)\n $msVoice->Voice = $chosenVoice;\n\n // passem la frase d'utf-8 a format de Windows perquè llegeixi bé\n // tots els caràcters\n $fraseconvertida = iconv(\"utf-8\", \"Windows-1252\", $text);\n\n // guardarem el fitxer amb la menor qualitat possible, format 4\n $msAudioFormat->Type = 4;\n $msFileStream->Format = $msAudioFormat;\n\n // obrim el fitxer on escriurem l'àudio en format CreateWrite\n $msFileStream->Open($wavfile, 3, 0);\n $msVoice->AudioOutputStream = $msFileStream;\n \n // es diu la frase de manera asíncrona\n $msVoice->Speak($fraseconvertida, 1);\n // esperem a que acabi, ja que si no talla la frase\n $msVoice->WaitUntilDone(-1);\n\n // tanquem el fitxer i alliberem la memòria dels objectes\n $msFileStream->Close();\n $msAudioFormat = null;\n $msFileStream = null;\n $msVoice = null;\n\n } catch (Exception $e) {\n $error = true;\n $errormessage = \"Error. An error occurred while writing your Windows audio file.\";\n $errorcode = 112;\n }\n }\n \n $output[0] = $error;\n $output[1] = $errormessage;\n $output[2] = $errorcode;\n return $output;\n }",
"public function speak(){\n switch (strtolower($this->type)){\n case Animal::TYPE_DOG:\n return 'Wooof';\n break;\n\n case Animal::TYPE_CAT:\n return 'Miaouu';\n break;\n \n case Animal::TYPE_BIRD:\n echo 'cui-cui';\n break;\n \n case Animal::TYPE_FISH:\n return 'blub';\n break;\n\n case Animal::TYPE_FERRET:\n return 'Les furets.com';\n break;\n \n default:\n return 'Pfffft';\n break;\n }\n }",
"public function getSay()\n {\n return $this->get(self::_SAY);\n }",
"public function createTwilm()\n {\n $response = new Twiml();\n $response->say('Hello');\n $response->play('https://api.twilio.com/cowbell.mp3', array(\"loop\" => 5));\n print $response;\n }",
"public static function homeSentence() {\n $q = self::getQ();\n $nb_result = self::nbContactsSelected();\n $sentence = \"\";\n $sentence .= \"Vous avez \";\n if(!empty($q)) {\n $sentence .= $nb_result;\n if ($nb_result > 1) {\n $sentence .= \" résultats\";\n } else {\n $sentence .= \" résultat\";\n }\n $sentence .= \" pour (\";\n $sentence .= \\Phonebook\\Controllers\\ContactsController::getQ();\n $sentence .= \") parmi vos \";\n }\n $sentence .= \\Phonebook\\Controllers\\ContactsController::nbContactsTotal();\n $sentence .= \" contacts dans l'annuaire\";\n echo $sentence;\n }",
"function synthesizeAudio($md5, $text, $voice, $type, $language, $rate)\n { \n \t\n // DEBUG\n \t// echo \"T: \".$text.\"; V: \".$voice.\"; Ty: \".$type.\"; L: \".$language;\n \t\n $CI = &get_instance();\n $CI->load->model('Audio_model');\n \n $output = array();\n $error = false;\n $errormessage = null;\n $errorcode = 0;\n $filename = null;\n $extension = \"mp3\";\n \n // if it's an online voice\n if ($type == \"online\") {\n \n // default voice ES masc (Jorge)\n $vocalwareLID = 2;\n $vocalwareVID = 6;\n \n // if it's a default interface voice\n if (preg_match(\"/DEFAULT \\(/i\", $voice)) {\n $isfem = true;\n if (preg_match(\"/DEFAULT \\(masc\\)/i\", $voice)) $isfem = false;\n \n // get default values for the interface voice in each language\n switch ($language) {\n \n // CA\n case 1:\n $vocalwareLID = 5;\n if ($isfem) $vocalwareVID = 1;\n else $vocalwareVID = 2;\n break;\n \n // ES\n case 2:\n $vocalwareLID = 2;\n if ($isfem) $vocalwareVID = 1;\n else $vocalwareVID = 6;\n break;\n \n // EN\n case 3:\n $vocalwareLID = 1;\n if ($isfem) $vocalwareVID = 1;\n else $vocalwareVID = 2;\n break;\n \n default:\n $error = true;\n $errormessage = \"Error. Default voice not found for this language.\";\n $errorcode = 106;\n break;\n } \n }\n // the voice is the id of the voice in the database\n else {\n // we get the info of the voice from the database\n $auxrow = $CI->Audio_model->getOnlineVoices((int) $voice);\n $voiceinfo = $auxrow[0];\n \n $vocalwareLID = $voiceinfo->vocalwareIdLang;\n $vocalwareVID = $voiceinfo->vocalwareVoiceId;\n }\n \n if (!$error) {\n $auxresponse = $this->synthesizeOnline($vocalwareLID, $vocalwareVID, $text, $md5);\n // if there was an error\n if ($auxresponse[0]) {\n $error = true;\n $errormessage = $auxresponse[1];\n $errorcode = $auxresponse[2];\n }\n }\n \n }\n // si la veu és offline\n else {\n $user_agent = $this->getOS();\n \n switch ($user_agent) {\n case \"Mac OS X\":\n $extension = \"m4a\";\n \n $auxresponse = $this->synthesizeMacOSX($voice, $text, $md5, $rate);\n // if there was an error\n if ($auxresponse[0]) {\n $error = true;\n $errormessage = $auxresponse[1];\n $errorcode = $auxresponse[2];\n }\n\n break;\n \n case \"Windows\":\n \n $auxresponse = $this->synthesizeWindows($voice, $text, $md5);\n // if there was an error\n if ($auxresponse[0]) {\n $error = true;\n $errormessage = $auxresponse[1];\n $errorcode = $auxresponse[2];\n }\n \n break;\n\n default:\n $error = true;\n $errormessage = \"Error. Your OS is not compatible with offline voices. \"\n . \"Change your voices in your user configuration settings.\";\n $errorcode = 107;\n break;\n }\n }\n \n if (!$error) {\n $filename = $md5.\".\".$extension;\n $CI->Audio_model->saveAudioFileToDatabase($text, $md5, $filename);\n }\n \n $output[0] = $filename;\n $output[1] = $error;\n $output[2] = $errormessage;\n $output[3] = $errorcode;\n \n return $output;\n }",
"public function responseMsg()\n\t{\n\t\t$postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\t\t//extract post data\n\t\tif (!empty($postStr)){\n\t\t\t/* libxml_disable_entity_loader is to prevent XML eXternal Entity Injection,\n\t\t\t the best way is to check the validity of xml by yourself */\n\t\t\tlibxml_disable_entity_loader(true);\n\t\t\t$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n\t\t\t$fromUsername = $postObj->FromUserName;\n\t\t\tif(!empty($fromUsername)){\n\t\t\t\t$this->getGzUserInfo($fromUsername);\n\t\t\t}\n\t\t\t$toUsername = $postObj->ToUserName;\n\t\t\t$keyword = trim($postObj->Content);\n\t\t\t$Event = trim($postObj->Event);//事件类型,subscribe(订阅)、unsubscribe(取消订阅)\n// \t\t\t$time = time();\n// \t\t\t$textTpl = \"<xml>\n// \t\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n// \t\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n// \t\t\t\t\t\t\t<CreateTime>%s</CreateTime>\n// \t\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\n// \t\t\t\t\t\t\t<Content><![CDATA[%s]]></Content>\n// \t\t\t\t\t\t\t<FuncFlag>0</FuncFlag>\n// \t\t\t\t\t\t\t</xml>\";\n// \t\t\tif(!empty( $keyword ))\n// \t\t\t{\n// \t\t\t\t$msgType = \"text\";\n\t\t\t//订阅消息推送\n\t\t\t$resultStr\t= \"\";\n\t\t\tif(!empty($Event) && $Event=='subscribe'){\n\t\t\t\t$contentStr = \"您好,感谢您订阅衣伴网络,我们程序员正在玩命开发中,敬请期待...... 如果觉得我们有用,请推荐您的朋友关注。(微信搜索yibanwangluo)\";\n\t\t\t\t$resultStr\t= $this->responseTxt($fromUsername, $toUsername, $contentStr);\n\t\t\t}else{\n\t\t\t\tif(!empty($keyword) && $keyword=='ybwl' ){\n\t\t\t\t\t$title\t= '衣伴商务速洗';\n\t\t\t\t\t$des\t= '全国最大商务速洗O2O平台';\n\t\t\t\t\t$picurl\t= 'http://www.91yb.cn/static/images/weixin.jpg';\n\t\t\t\t\t$url\t= 'http://www.91yb.cn/?f=weixin';\n\t\t\t\t\t$resultStr = $this->responsePicTxt($fromUsername, $toUsername, $title, $des, $picurl, $url);\n\t\t\t\t}else{\n\t\t\t\t\t$resultStr =$this->responseTxt($fromUsername, $toUsername, '您好,感谢您订阅衣伴网络,我们程序员正在玩命开发中,敬请期待......');\n\t\t\t\t}\n\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//@mwtlog(\"responseMsg_test\",$postStr.\"\\r\\n\",true);\n\t\t\t\techo $resultStr;\n// \t\t\t}else{\n// \t\t\t\techo \"Input something...\";\n// \t\t\t}\n\t\n\t\t}else {\n\t\t\techo \"\";\n\t\t\texit;\n\t\t}\n\t}",
"public function say($text, $type = self::TYPE_PLAINTTEXT)\n\t{\n\t\treturn $this->respond(self::RESPONSE_TYPE_OUTPUT_SPEECH, $this->getSpeechResponse($text, $type));\n\t}",
"public function responseMsg()\n {\n\t\t$postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n \t//extract post data\n\t\tif (!empty($postStr)){\n /* libxml_disable_entity_loader is to prevent XML eXternal Entity Injection,\n the best way is to check the validity of xml by yourself */\n libxml_disable_entity_loader(true);\n \t$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $keyword = trim($postObj->Content);\n $time = time();\n $textTpl = \"<xml>\n\t\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n\t\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n\t\t\t\t\t\t\t<CreateTime>%s</CreateTime>\n\t\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\n\t\t\t\t\t\t\t<Content><![CDATA[%s]]></Content>\n\t\t\t\t\t\t\t<FuncFlag>0</FuncFlag>\n\t\t\t\t\t\t\t</xml>\"; \n\t\t\t\tif(!empty( $keyword ))\n {\n \t\t$msgType = \"text\";\n \t$contentStr = \"Welcome to wechat world!\";\n \t$resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n \techo $resultStr;\n }else{\n \techo \"Input something...\";\n }\n\n }else {\n \techo \"\";\n \texit;\n }\n }",
"public function say( Twilio_Statement $what_to_say ){\n\n header(\"content-type: text/xml\");\n\n echo \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\";\n\n echo (string) $what_to_say;\n\n\n }",
"public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n //extract post data\n if (!empty($postStr)){\n \n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $RX_TYPE = trim($postObj->MsgType);\n\n switch($RX_TYPE)\n {\n case \"text\":\n $resultStr = $this->handleText($postObj);\n break;\n case \"event\":\n $resultStr = $this->handleEvent($postObj);\n break;\n default:\n $resultStr = \"Unknow msg type: \".$RX_TYPE;\n break;\n }\n echo $resultStr;\n }else {\n echo \"\";\n exit;\n }\n }",
"public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n //extract post data\n if (!empty($postStr)){\n \n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $RX_TYPE = trim($postObj->MsgType);\n\n switch($RX_TYPE)\n {\n case \"text\":\n $resultStr = $this->handleText($postObj);\n break;\n case \"event\":\n $resultStr = $this->handleEvent($postObj);\n break;\n default:\n $resultStr = \"Unknow msg type: \".$RX_TYPE;\n break;\n }\n echo $resultStr;\n }else {\n echo \"\";\n exit;\n }\n }",
"public function respond() {\n\t \n\t // Prevent duplicate responses\n\t if ($this->hasResponded) return;\n\t $this->hasResponded = true;\n\t \n\t // Set google as default for now\n\t $integrations = array(\n\t\t 'google' => array(\n\t\t\t 'expectUserResponse' => $this->expectUserResponse,\n\t\t\t 'richResponse' => array(\n\t\t\t\t 'items' => $this->items\n\t\t\t )\n\t\t )\n\t );\n\t \n\t $fulfillmentMessages = array();\n\t \n\t $response = array(\n\t\t 'fulfillmentText' => $this->speech,\t\t \n\t\t 'payload' => $integrations,\t\t \n\t );\n\t \n\t header(\"Content-type:application/json\");\n\t return json_encode($response);\n }",
"public function read($text)\n {\n $initializeOptions = $this->getOptions()->getInitializeOptions();\n $pollyClient = new PollyClient([\n 'version' => $initializeOptions->getVersion(),\n 'region' => $initializeOptions->getRegion(),\n 'credentials' => [\n 'key' => $initializeOptions->getCredentials()->getKey(),\n 'secret' => $initializeOptions->getCredentials()->getSecret()\n ]\n ]);\n\n $synthesizeOptions = [\n 'OutputFormat' => $this->getOptions()->getOutputFormat(),\n 'Text' => $text,\n 'TextType' => $this->getOptions()->getTextType(),\n 'VoiceId' => $this->getOptions()->getVoiceId(),\n 'VoiceLanguageCode' => $this->getOptions()->getLanguage(),\n 'SampleRate' => $this->getOptions()->getSampleRate(),\n 'Engine' => $this->getOptions()->getEngine(),\n ];\n if (!empty($this->getOptions()->getLexiconNames())) {\n $synthesizeOptions['LexiconNames'] = $this->getOptions()->getLexiconNames();\n }\n\n $awsResult = $pollyClient->synthesizeSpeech($synthesizeOptions);\n $this->setHeaders($awsResult->get('@metadata'));\n $stream = $awsResult->get('AudioStream');\n return $stream->getContents();\n }",
"public function responseMsg()\n {\n\t\t$postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n if (!empty($postStr)){\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $RX_TYPE = trim($postObj->MsgType);\n\n switch ($RX_TYPE)\n {\n case \"text\":\n $resultStr = $this->receiveText1($postObj);\n break;\n case \"event\":\n $resultStr = $this->receiveEvent($postObj);\n break;\n default:\n $resultStr = \"\";\n break;\n }\n echo $resultStr;\n }else {\n echo \"\";\n exit;\n }\n // \t//extract post data\n\t\t// if (!empty($postStr)){\n // /* libxml_disable_entity_loader is to prevent XML eXternal Entity Injection,\n // the best way is to check the validity of xml by yourself */\n // libxml_disable_entity_loader(true);\n // \t$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n // $fromUsername = $postObj->FromUserName;\n // $toUsername = $postObj->ToUserName;\n // $keyword = trim($postObj->Content);\n // $time = time();\n // $textTpl = \"<xml>\n\t\t// \t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n\t\t// \t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n\t\t// \t\t\t\t\t<CreateTime>%s</CreateTime>\n\t\t// \t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\n\t\t// \t\t\t\t\t<Content><![CDATA[%s]]></Content>\n\t\t// \t\t\t\t\t<FuncFlag>0</FuncFlag>\n\t\t// \t\t\t\t\t</xml>\"; \n\t\t// \t\tif(!empty( $keyword ))\n // {\n // \t\t$msgType = \"text\";\n // \t$contentStr = \"Welcome to wechat world!\";\n // \t$resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n // \techo $resultStr;\n // }else{\n // \techo \"Input something...\";\n // }\n\n // }else {\n // \techo \"\";\n // \texit;\n // }\n }",
"function response($response_name) {\r\n\t\t$return_value = '';\r\n\t\t$response_name = (string) $response_name;\r\n\r\n\t\t$return_value .= '<message name=\"' . $response_name . 'Response\">'\r\n\t\t. $this->part('head', 'cpaintResponseHead');\r\n\r\n\t\t// iterate over all response argument\r\n\t\tforeach ($this->functions[$response_name]['output'] as $structure) {\r\n\t\t\t$return_value .= $this->part($structure['name'], $structure['type']);\r\n\t\t} // end: foreach\r\n\r\n\t\t$return_value .= '</message>';\r\n\r\n\t\treturn $return_value;\r\n\t}",
"public function hello()\n {\n return $this->TextResponseFactory->make(static::HELLO_TEXT);\n }",
"function create_response($text, $message)\r\n{\r\n global $usernamebot;\r\n \r\n // inisiasi variable hasil yang mana merupakan hasil olahan pesan\r\n $hasil = ''; \r\n \r\n $chatid = $message[\"chat\"][\"id\"]; // variable penampung id chat\r\n \r\n\r\n // variable penampung username nya user\r\n isset($message[\"from\"][\"username\"])\r\n ? $chatuser = $message[\"from\"][\"username\"]\r\n : $chatuser = '';\r\n \r\n\r\n // variable penampung nama user\r\n\r\n isset($message[\"from\"][\"last_name\"]) \r\n ? $namakedua = $message[\"from\"][\"last_name\"] \r\n : $namakedua = ''; \r\n\r\n $namauser = $message[\"from\"][\"first_name\"]. ' ' .$namakedua;\r\n\r\n $pecah = explode(' ', $text); \r\n\t\r\n // identifikasi perintah (yakni kata pertama, atau array pertamanya)\r\n switch ($pecah[0]) {\r\n \r\n case '/start':\r\n if(str_word_count($text)<=1){\r\n $_SESSION['namauser']=$namauser;\r\n\r\n $hasil = \"Hai 💁 `{$_SESSION['namauser']}` .. Selamat datang di `Sistem Informasi Jadwal Laboratorium FASILKOM-TI` Universitas Sumatera Utara! \\n\\n\";\r\n $hasil .= '💁🏼 Aku adalah *bot SisLabTI* ver.`'.myVERSI.\"`\\n\";\r\n $hasil .= \"🎓 yang dibuat oleh :\\n\";\r\n $hasil .= \" _Indana Fariza Hidayat 161402082_\\n\";\r\n $hasil .= \" _Gistya Fakhrani 161402094_\\n\";\r\n $hasil .= \" _Rina Ayu Wulan Sari 161402097_\\n \";\r\n $hasil .= \" _Sinta Anjelina 161402100_\\n\";\r\n $hasil .= \" _Dea Amanda 161402118_\\n⌛️\".lastUPDATE.\"\\n\\n\";\r\n $hasil .= \"‼️ Notes ‼️ \\n `Bot hanya mengerti bahasa instruksi yang disediakan` 🔻 \\n `Jika` instruksi sudah sesuai namun `bot sedang lambat & tidak merespons`. `Ketikkan instruksi ulang` 🔻\\n\\n\";\r\n\r\n $hasil .= \"Silahkan _login_ terlebih dahulu. ketik: /login\\n\";\r\n $_SESSION['step']= \"/login\";\r\n } else {\r\n $hasil= '⛔️ *ERROR:* _Tidak ada instruksi tersebut . Panggil bot sesuai instruksi!_';\r\n $hasil .= \"\\n\".'ingat /start ya ! 😅'; \r\n }\r\n break;\r\n\r\n // balasan default jika pesan tidak di definisikan\r\n default:\r\n\t\t\t//if(isset($_SESSION['chatid'])){\r\n\t\t\t\tif(isset($_SESSION['step'])){\r\n\t\t\t\t\tswitch($_SESSION['step']){\r\n case '/login':\r\n var_dump($text);\r\n $hasil = start($text);\r\n break;\r\n case 'level_user':\r\n $hasil = level_user($text);\r\n // return $hasil;\r\n break;\r\n case 'menupraktikan':\r\n $hasil = menupraktikan($text);\r\n $_SESSION['chat_id'] = $chatid;\r\n break;\r\n case 'menuaslab':\r\n $hasil = menuaslab($text);\r\n $_SESSION['chat_id'] = $chatid;\r\n break;\r\n case 'nim':\r\n //tampung dulu nimnya ke SESSION\r\n var_dump($text);\r\n $_SESSION['nim'] = $text;\r\n var_dump($_SESSION['nim']);\r\n $hasil = login($text);\r\n $_SESSION['chat_id'] = $chatid;\r\n break;\r\n case 'password':\r\n var_dump($text);\r\n $_SESSION['password'] = $text; \r\n $hasil = password($text);\r\n $_SESSION['chat_id'] = $chatid; \r\n break;\r\n case 'term': \r\n $_SESSION['semester'] = $text;\r\n $hasil = term($text);\r\n $_SESSION['chat_id']=$chatid;\r\n break;\r\n case 'matakuliah':\r\n $_SESSION['id_matkul']= $text;\r\n $hasil = matakuliah($text);\r\n $_SESSION['chat_id']=$chatid;\r\n break;\r\n case 'hari':\r\n $_SESSION['hari'] = $text;\r\n $hasil = hari($text);\r\n $_SESSION['chat_id'] = $chatid;\r\n break;\r\n case 'waktu':\r\n $_SESSION['waktu'] = $text;\r\n $hasil = waktu($text);\r\n $_SESSION['chat_id'] = $chatid;\r\n break;\r\n case 'ruangan':\r\n $_SESSION['ruangan'] = $text;\r\n $hasil = ruangan($text);\r\n $_SESSION['chat_id'] = $chatid;\r\n break;\r\n case 'kom':\r\n $_SESSION['kom'] = $text;\r\n $hasil = kom($text);\r\n $_SESSION['chat_id'] = $chatid;\r\n break;\r\n\r\n case 'menu': \r\n $hasil = menu($_SESSION['nama_aslab']);\r\n break;\r\n\r\n case 'gantihari':\r\n $_SESSION['hariganti'] = $text;\r\n $hasil = gantihari($text);\r\n $_SESSION['chat_id'] = $chatid;\r\n break;\r\n case 'gantiwaktu':\r\n $_SESSION['waktuganti'] = $text;\r\n $hasil = gantiwaktu($text);\r\n $_SESSION['chat_id'] = $chatid;\r\n break;\r\n case 'gantiruangan':\r\n $_SESSION['ruanganganti'] = $text;\r\n $hasil = gantiruangan($text);\r\n $_SESSION['chat_id'] = $chatid;\r\n break;\r\n case 'update':\r\n $text = strtolower($text);\r\n $_SESSION['chat_id'] = $chatid;\r\n if($text == 'ya'){\r\n $hasil .=upselesai();\r\n return $hasil;\r\n }\r\n elseif ($text== 'tidak') {\r\n # code...\r\n var_dump($_SESSION['nama_aslab']);\r\n $hasil = \"🅾️ Anda tidak jadi mengubah jadwal.\\n\\n\";\r\n $_SESSION['step']='menuaslab';\r\n $hasil .= menu($_SESSION['nama_aslab']);\r\n \r\n }\r\n else {\r\n $hasil = \"Masukkan sesuai perintah (ya/tidak)\\n\";\r\n $_SESSION['step'] ='update';\r\n break; \r\n }\r\n break;\r\n\r\n case 'upselesai':\r\n $hasil .= upselesai();\r\n break;\r\n\r\n\r\n \r\n\t\t\t\t\t\tcase 'verifikasi':\r\n $text = strtolower($text);\r\n $_SESSION['chat_id'] = $chatid;\r\n\t\t\t\t\t\t\tif($text == 'ya'){\r\n $hasil .=selesai();\r\n return $hasil;\r\n\t\t\t\t\t\t\t}\r\n elseif ($text== 'tidak') {\r\n # code...\r\n $hasil = \"Silahkan ulangi dengan perintah /tambah\";\r\n $_SESSION['step']='menuaslab';\r\n }\r\n else {\r\n $hasil = \"Masukkan sesuai perintah (ya/tidak)\\n\";\r\n $_SESSION['step'] ='verifikasi';\r\n break; \r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tcase 'selesai':\r\n\t\t\t\t\t\t\t// simpan ke database\r\n $hasil=selesai();\r\n\t\t\t\t\t\t\t//return $hasil;\r\n\t\t\t\t\t\t\t//session_destroy();\r\n\t\t\t\t\t\t\tbreak;\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\r\n\t\t\t\t} else {\r\n\t\t\t\t $hasil = \"😥 Instruksi tidak tersedia jika `anda belum memanggil Bot`.\\n Panggil bot dengan `/start` ya! 😅\";\r\n\t\t\t\t}\r\n\t\t\t//}\r\n break;\r\n\t\t\t\r\n }\r\n\t\r\n\tprint_r($_SESSION);\r\n\r\n return $hasil;\r\n}",
"function RandomSentenceGenerator(array & $dictionary)\n{\n\t\t$verbType = type_name();\n\t\t$nounType = noun_type();\n//\t $introPhrase = random_intro_phrase();\n\t\t$nounClause = random_noun_clause($nounType, $dictionary); //get noun clause\n\t\t$verbage = random_verb_by_type($verbType, $nounType, $dictionary); //get verb and adverb(maybe)\n\t\t$nounType2 = noun_type();\n\t\t$finalNounClause = random_noun_clause($nounType2, $dictionary);\n//\t $endPhrase = random_end_phrase();\n\t\t$sentence = $nounClause . $verbage . $finalNounClause . \". \";\n\t\t$phrase = ucfirst($sentence);\n\t\treturn $phrase;\n}",
"function talk()\n {\n $this->load->library('service');\n $data = file_get_contents('php://input');\n $ret = array(\n 'out' => $this->service->handle('talk', $data)\n );\n $this->output($ret);\n }",
"function responseToDialogue($response){\n $response = json_encode(array_merge($response, array_filter(['extendedIds' => SUtl::translatedExtendedIdCols()]), ['extras' => Tfk::getExtras(), 'feedback' => Feedback::get()]));\n if ($response){\n $this->dialogue->response->setContent(Tfk::$registry->get('translatorsStore')->substituteTranslations($response));\n }else{\n Tfk::debug_mode('error', 'AbstractController->responseToDialogue - json_encoding error: ', json_last_error());\n }\n }",
"private function getRandomSayText()\n {\n $texts = [\n 'They see me rollin\\'',\n '*whistle*',\n 'I\\'m walking on sunshine',\n ];\n $rand = mt_rand(0, count($texts) - 1);\n\n return $texts[$rand];\n }",
"public function answer()\n\t{\n\n $twiml = new Services_Twilio_Twiml();\n\n $gather = $twiml->gather([\n 'method' => 'GET',\n 'action' => 'twilio/check-account'\n ]);\n $gather->say(\"Hello, thanks for calling Phlare. Please enter your account number, followed by the pound sign.\");\n\n return $twiml;\n\n\t}",
"protected function responseMsg()\n {\n $postStr = file_get_contents('php://input', 'r');\n\n //extract post data\n if (!empty($postStr)){\n /* libxml_disable_entity_loader is to prevent XML eXternal Entity Injection,\n the best way is to check the validity of xml by yourself */\n libxml_disable_entity_loader(true);\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $keyword = trim($postObj->Content);\n $time = time();\n $textTpl = \"<xml>\n\t\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n\t\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n\t\t\t\t\t\t\t<CreateTime>%s</CreateTime>\n\t\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\n\t\t\t\t\t\t\t<Content><![CDATA[%s]]></Content>\n\t\t\t\t\t\t\t<FuncFlag>0</FuncFlag>\n\t\t\t\t\t\t\t</xml>\";\n if(!empty( $keyword ))\n {\n $msgType = \"text\";\n $contentStr = \"Welcome to wechat world!\";\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n }else{\n echo \"Input something...\";\n }\n\n }else {\n echo \"\";\n exit;\n }\n }",
"function tts($conteudo, $nome) {\n $text = $conteudo;\n\n // quebra o texto em frases\n $frases = explode('.', $text);\n\n // Nome do arquivo, título da notícia\n $file = $nome;\n\n // Salvar em MP3 no diretório especificado\n $file = \"audio/\" . $file . \".mp3\";\n\n // Percorre cada frase\n foreach ($frases AS $frase) {\n // Verifica se tem algum texto para evitar erros\n if (strlen($frase) > 1 && $frase != ' ' && $frase != ', ') {\n\n // Verifica se o texto tem mais de 100 caracteres, pois a api só aceita esse tamanho\n if (strlen($frase) > 100) {\n $virgulas = explode(',', $frase); // quebra a frase entre virgulas\n $virgulas2 = array(); // array que recebera as strings quebradas\n $i = 0; // variavel para modificar o array temporario\n foreach ($virgulas AS $virgula) { // percorre o array criado ao quebrar a frase pelas virgulas\n $temp = (string) $virgulas2[$i]; // guarda o trecho da string em uma variavel temporaria\n if (strlen($temp) < 1) { // verifica se temp é vazia\n $virgulas2[$i] = $virgula; // guarda o trecho quebrado no array\n } else { // se temp não for vazia\n $virgulas2[$i] = $virgulas2[$i] . ',' . $virgula; // concatena as strings\n }\n // verifica se a string tem a quantidade de caracteres validas\n if (strlen($virgulas2[$i]) > 100) {\n if (strlen($temp) < 1) { // se temp for vazia\n $count = strlen($virgulas2[$i]); // pega a quantidade de caracteres da string\n $temp = wordwrap($virgulas2[$i], ($count / 2), ','); // insere uma virgula no meio da string\n $temp2 = explode(',', $temp); // quebra a string novamente\n $virgulas2[$i] = $temp2[0]; // guarda o primeiro pedaço da string\n $i++; // incrementa a variavel de controle\n $virgulas2[$i] = $temp2[1] . $temp2[2]; // guarda o segundo pedaço da string\n } else { // se temp tiver alguma string\n $virgulas2[$i] = $temp; // retorna o valor de temp para o array\n if (strlen($virgulas2[$i]) > 100) {\n $count = strlen($virgulas2[$i]); // pega a quantidade de caracteres da string\n $temp = wordwrap($virgulas2[$i], (($count + 1) / 2), ','); // insere uma virgula no meio da string\n $temp2 = explode(',', $temp); // quebra a string novamente\n $virgulas2[$i] = $temp2[0]; // guarda o primeiro pedaço da string\n $i++; // incrementa a variavel de controle\n $virgulas2[$i] = $temp2[1] . $temp2[2]; // guarda o segundo pedaço da string\n }\n $i++; // incrementa a variavel de controle\n if (strlen($virgula) < 100) { // verifica se o pedaço do texto é aceito no script\n $virgulas2[$i] = $virgula; // guarda a string atual no array\n } else { // se não for aceito, quebra a string\n $count = strlen($virgula); // pega a quantidade de caracteres da string\n $temp = wordwrap($virgula, (($count + 1) / 2), ','); // insere uma virgula no meio da string\n $temp2 = explode(',', $temp); // quebra a string novamente\n $virgulas2[$i] = $temp2[0]; // guarda o primeiro pedaço da string\n $i++; // incrementa a variavel de controle\n $virgulas2[$i] = $temp2[1] . $temp2[2]; // guarda o segundo pedaço da string\n }\n }\n }\n }\n // Percorre o texto quebrado nas virgulas\n foreach ($virgulas2 AS $virgula) {\n // Verifica se tem algum texto para evitar erros\n if (strlen($virgula) > 1) {\n // Gera o arquivo de narrativa no servidor\n $url = 'http://translate.google.com/translate_tts?ie=UTF-8&tl=pt-br&q=' . urlencode($virgula);\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_USERAGENT, \"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)\");\n curl_setopt($ch, CURLOPT_TIMEOUT, 60);\n $mp3 = curl_exec($ch);\n curl_close($ch);\n \n // Verifica se o arquivo já existe ou é necessário cria-lo\n if (file_exists($file)) {\n file_put_contents($file, $mp3, LOCK_EX | FILE_APPEND);\n } else {\n file_put_contents($file, $mp3, LOCK_EX);\n }\n sleep(0.5);\n }\n }\n\n // Se o texto tiver menos de 100 caracteres grava a narração\n } else {\n // Gera o arquivo de narrativa no servidor\n $url = 'http://translate.google.com/translate_tts?ie=UTF-8&tl=pt-br&q=' . urlencode($frase);\n $ch = curl_init($url);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_USERAGENT, \"Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1)\");\n curl_setopt($ch, CURLOPT_TIMEOUT, 60);\n $mp3 = curl_exec($ch);\n curl_close($ch);\n\n // Verifica se o arquivo já existe ou é necessário cria-lo\n if (file_exists($file)) {\n file_put_contents($file, $mp3, LOCK_EX | FILE_APPEND);\n } else {\n file_put_contents($file, $mp3, LOCK_EX);\n }\n sleep(0.5);\n }\n }\n }\n // Imprime o player na tela.\n /*echo ('\n <audio autoplay=\"autoplay\" controls=\"controls\">\n <source src=\"' . $file . '\" type=\"audio/mp3\" />\n </audio>'\n );*/\n}",
"public function respond( /* variable length arguments */ ){\n\n $response = '';\n\n foreach ( func_get_args() as $argument )\n\n if ( ! is_subclass_of($argument,'\\\\Code_Alchemy\\\\Vendors\\\\Twilio\\\\Twilio_Response_Object')){\n\n \\FB::error(get_called_class().\": \".__FUNCTION__.\": Each argument must be a Twilio Response Object\");\n\n break;\n } else\n\n $response .= (string) $argument;\n\n header(\"content-type: text/xml\");\n\n echo \"<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n\";\n\n echo (string) \"<Response>$response</Response>\";\n\n\n }",
"public function responseMsg()\r\n\t{\r\n\t\t$postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\r\n\r\n\t\t//extract post data\r\n\t\tif (!empty($postStr)){\r\n\t\t\t\t\r\n\t\t\t\t$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\r\n\t\t\t\t$fromUsername = $postObj->FromUserName;\r\n\t\t\t\t$toUsername = $postObj->ToUserName;\r\n\t\t\t\t$keyword = trim($postObj->Content);\r\n\t\t\t\t$time = time();\r\n\r\n\t\t\t\t/*文字回复*/\r\n\t\t\t\t$textTpl = \"<xml>\r\n\t\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\r\n\t\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\r\n\t\t\t\t\t\t\t<CreateTime>%s</CreateTime>\r\n\t\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\r\n\t\t\t\t\t\t\t<Content><![CDATA[%s]]></Content>\r\n\t\t\t\t\t\t\t<FuncFlag>0</FuncFlag>\r\n\t\t\t\t\t\t\t</xml>\"; \r\n\r\n\t\t\t\t/*图文回复*/\r\n\t\t\t\t$itemTpl = \"<xml>\r\n\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\r\n\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\r\n\t\t\t\t\t\t<CreateTime>%s</CreateTime>\r\n\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\r\n\t\t\t\t\t\t<ArticleCount>1</ArticleCount>\r\n\t\t\t\t\t\t<Articles>\r\n\t\t\t\t\t\t<item>\r\n\t\t\t\t\t\t<Title><![CDATA[%s]]></Title> \r\n\t\t\t\t\t\t<Description><![CDATA[%s]]></Description>\r\n\t\t\t\t\t\t<PicUrl><![CDATA[%s]]></PicUrl>\r\n\t\t\t\t\t\t<Url><![CDATA[%s]]></Url>\r\n\t\t\t\t\t\t</item>\r\n\t\t\t\t\t\t</Articles>\r\n\t\t\t\t\t\t</xml>\";\r\n\r\n\r\n\r\n\t\t\t\tif(!empty( $keyword )){\r\n\t\t\t\t\t$keyworde = $this -> FindKeyword($keyword,$fromUsername);\r\n\t\t\t\t\tswitch ($keyworde) {\r\n\t\t\t\t\t\tcase '红包':\r\n\t\t\t\t\t\t\t// $msgType = \"news\";\r\n\t\t\t\t\t\t\t// $contentStr = \"恭喜你获得一个红包!\";\r\n\t\t\t\t\t\t\t// $contentStr2 = \"点击图片领取你的红包!\";\r\n\t\t\t\t\t\t\t// // $PicUrl = \"http://imgsrc.baidu.com/forum/w%3D580/sign=6926f2cad488d43ff0a991fa4d1fd2aa/3e8ad5dcd100baa1583412044510b912c9fc2ea8.jpg\";\r\n\t\t\t\t\t\t\t// $url = \"http://i.shuilaile.com/index.php?s=/Home/Get/pay/openid/\".$fromUsername.\"/code/\".$keyword.\".html\";\r\n\t\t\t\t\t\t\t// $resultStr = sprintf($itemTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr, $contentStr2, $PicUrl, $url);\r\n\t\t\t\t\t\t\t// echo $resultStr;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t//执行发红包\r\n\t\t\t\t\t\t\t$this -> pay($fromUsername,$keyword);\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t\tdefault:\r\n\t\t\t\t\t\t\t$msgType = \"text\";\r\n\t\t\t\t\t\t\t$contentStr = $keyworde;\r\n\t\t\t\t\t\t\t// $contentStr = \"Welcome to wechat world!\";\r\n\t\t\t\t\t\t\t$resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\r\n\t\t\t\t\t\t\techo $resultStr;\r\n\t\t\t\t\t\t\tbreak;\r\n\t\t\t\t\t}\r\n\t\t\t\t}else{\r\n\t\t\t\t\techo \"Input something...\";\r\n\t\t\t\t}\r\n\r\n\t\t}else {\r\n\t\t\techo \"\";\r\n\t\t\texit;\r\n\t\t}\r\n\t}",
"function getResponseFromWatson($p_input_text) {\n $workspace_id = \"9ecfefaa-5874-44cc-bca1-ebdb5664fe53\";\n $_watson_API_username = \"apikey\";\n $_watson_API_password = \"yqfzvnhDEwwmJ99__n4GNIWkl72f5dV5BtWxUadQ2Nn1\";\n $_version_date = \"2018-11-19\";\n\n // set url\n $api_url = \"https://gateway-syd.watsonplatform.net/assistant/api/v1/workspaces/\" . $workspace_id . \"/message?version=2018-11-19\";\n $response = \"\";\n if(isset($_POST['submitM'])) {\n $p_input_text = $_POST['my_message'];\n\n if (!empty($_POST['my_message'])) {\n $api_request_array['input']['text'] = $p_input_text;\n } else {\n $api_request_array['input'] = null;\n }\n\n if (!empty($p_watson_context))\n $api_request_array['context'] = $p_watson_context;\n\n $json_api_request = json_encode($api_request_array);\n\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, $api_url);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n curl_setopt($ch, CURLOPT_USERPWD, \"$_watson_API_username:$_watson_API_password\");\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $json_api_request);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\"Content-Type: application/json\"));\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\n $response = curl_exec($ch);\n\n if (curl_errno($ch)) {\n //echo 'Error connecting with Watson API. Error:(' . $errno . ') - ' . curl_strerror($errno);\n echo 'Curl error: ' . curl_error($ch);\n }\n\n // $output contains the output string\n\n $watson_reply_message = json_decode($response, true); // return an array instead of object\n //$watson_reply_message = json_decode($response); // return object instead of array\n\n\n if (isset($watson_reply_message->output->text[0]))\n $watson_output_text = $watson_reply_message->output->text;\n else\n $watson_output_text[] = \"Sorry! Watson service could not reply\";\n\n //store the context in session which will be used before calling the api\n if (isset($watson_reply_message->context)) {\n $return_message['watson_api_context'] = $watson_reply_message->context;\n } else {\n $return_message['watson_reply_text'] = $watson_output_text;\n }\n\n $response = $watson_reply_message['output']['text'][0];\n\n // close curl resource to free up system resources\n curl_close($ch);\n }\n\n return $response;\n }",
"public function TextResponse ($output = '', $terminate = TRUE) {\n\t\t$res = $this->response;\n\t\tif (!$res->HasHeader('Content-Type'))\n\t\t\t$res->SetHeader('Content-Type', 'text/plain');\n\t\t$res->SetBody($output);\n\t\tif ($res->GetCode() === NULL)\n\t\t\t$res->SetCode(\\MvcCore\\IResponse::OK);\n\t\tif ($terminate) $this->Terminate();\n\t}",
"public function getEquipSynthesisReply()\n {\n return $this->get(self::_EQUIP_SYNTHESIS_REPLY);\n }",
"public function speak(UserEnv $userEnv, Question $question) {\r\n\t\t$response = new Response();\r\n\t\t$db = loadDb('db_json/db.json');\r\n\t\t$uGameData = $this->getUserGameData($db, $userEnv);\r\n\t\t$enigmeDB = loadDb('games/enigme/enigmeDB.json');\r\n\t\t$c = $this->changeCategorie($enigmeDB, $question);\r\n\t\tif ($c) {\r\n\t\t\t$uGameData['categorie'] = $c;\r\n\t\t}\r\n\t\tif (!isset($uGameData['categorie'])) {\r\n\t\t\t$uGameData['categorie'] = 'dur';\r\n\t\t}\r\n\t\tif (!isset($uGameData['categories'])) {\r\n\t\t\t$uGameData['categories'] = array();\r\n\t\t}\r\n\t\tif (!isset($uGameData['categories'][$uGameData['categorie']])) {\r\n\t\t\t$uGameData['categories'][$uGameData['categorie']] = 0;\r\n\t\t}\r\n\t\t$enigmeNb = $uGameData['categories'][$uGameData['categorie']];\r\n\t\tif (isset($enigmeDB[$uGameData['categorie']][$enigmeNb])) {\r\n\t\t\t$enigme = $enigmeDB[$uGameData['categorie']][$enigmeNb];\r\n\t\t\tif ($this->isRightAnswer($question->originalText, $enigme['reponses'])) {\r\n\t\t\t\t$response->message .= 'Reponse exacte! '.PHP_EOL;\r\n\t\t\t\t$response->message .= $enigme['explication'].PHP_EOL;\r\n\t\t\t\t$enigmeNb++;\r\n\t\t\t\t$uGameData['categories'][$uGameData['categorie']] = $enigmeNb;\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (isset($enigmeDB[$uGameData['categorie']][$enigmeNb])) {\r\n\t\t\t$enigme = $enigmeDB[$uGameData['categorie']][$enigmeNb];\r\n\t\t\t$response->message .= 'Enigme n '.$enigmeNb.' ('.$uGameData['categorie'].') : '.$enigme['text'];\r\n\t\t} else {\r\n\t\t\t$response->message .= ' WIN! Categorie '.$uGameData['categorie'].' finie!';\r\n\t\t}\r\n\t\t$response->status = 200;\r\n\t\t$response->info = 'categorie:'.$uGameData['categorie'].' enigme:'.$enigmeNb;\r\n\t\t$response->choices[] = '[la reponse]';\r\n\t\tforeach ($enigmeDB as $catKey => $categorie) {\r\n\t\t\t$response->choices[] = 'change categorie '.$catKey;\r\n\t\t}\r\n\t\t$this->saveUserGameData($db, $userEnv, $uGameData);\r\n\t\treturn $response;\r\n\t}",
"function sensei_custom_lesson_quiz_text () {\n\t$text = \"Report What You Have Learned\";\n\treturn $text;\n}",
"function sen_sms($to,$text)///ส่ง sms\n{ //create client with api key and secret\n $rest = substr($to, 1);\n $client = new Nexmo\\Client(new Nexmo\\Client\\Credentials\\Basic('c21feb7d', 'yrxEwwXERXj8yv7L'));\n $message = $client->message()->send([\n 'to' => '66'.$rest,\n 'from' => 'RFLpang',\n 'text' => $text,\n 'type' => 'unicode'\n ]);\n //array access provides response data\n //echo \"Sent message to \" . $message['to'] . \". Balance is now \" . $message['remaining-balance'] . PHP_EOL;\n\n return \"Sent message to \" . $message['to'] . \". Balance is now \" . $message['remaining-balance'] . PHP_EOL;\n}",
"private function generateChallenge()\n {\n //store two random numbers in an array\n $numbers = array(mt_rand(1,4),mt_rand(1,4));\n //store the correct answer in a session\n $_SESSION['challenge'] = $numbers[0] + $numbers[1];\n //convert the numbers to their ASCII\n $converted = array_map('ord', $numbers);\n //generate a math question as HTML markup\n return \"\n <label>What is \n &#$converted[0]; + &#$converted[1];?\n <input type=\\\"text\\\" name=\\\"s_q\\\" />\n </label>\";\n }",
"public function substrwords()\n {\n $longString = \"In this talk, we will show how to leverage InfluxDB to implement some solutions to tackle on the issues of time series forecasting at scale, including continuous accuracy evaluation and algorithm hyperparameters optimization.\";\n // echo strlen($longString);\n if (strlen($longString) > 160) {\n\n $this->truncated = substr($longString, 0, strpos(wordwrap($longString, 160), \"\\n\"));\n\n $this->truncated .= $this->end;\n echo $this->truncated;\n echo \"\\n\";\n\n $nd = $this->truncated = substr($longString, strpos(wordwrap($longString, 160), \"\\n\"));\n\n echo $this->end . $nd;\n\n #################\n # evans\n // $w = urldecode($MESSAGE);// remove special Characters\n // echo strlen($w);\n // $chars = 157;\n // while($w){\n // if (strlen($w) > $chars) {\n\n // // $chars += $chars; \n \n // $TruncMESSAGE = substr($w, 0, strpos($w, ' ', $chars)) . '...';// truncate from position 0-157\n // // $TruncMES = '...' . substr($w, strpos($w, ' ', 157));// truncate from position 157-...\n \n // $mes = array($TruncMESSAGE); // array with cut messages\n // foreach ($mes as $key) {\n // $encoded = urlencode($key);\n // $smsUrl = $emgUrl . \"&SOURCEADDR=\" . $SOURCEADDR . \"&DESTADDR=\" . $DESTADDR . \"&MESSAGE=\" . $encoded . \"&DLR=\" . $DLR . \"&USERNAME=\" . $smsuser . \"&PASSWORD=\" . $smspassword;\n // $smsResults = join('', file($smsUrl)); \n // echo $smsUrl; \n // echo \"\\n\"; \n \n // }\n \n // } else {\n \n // $smsUrl = $emgUrl . \"&SOURCEADDR=\" . $SOURCEADDR . \"&DESTADDR=\" . $DESTADDR . \"&MESSAGE=\" . $MESSAGE . \"&DLR=\" . $DLR . \"&USERNAME=\" . $smsuser . \"&PASSWORD=\" . $smspassword;\n \n // }\n #evans#\n #################################3\n }\n\n return $this->truncated;\n }",
"public function responseMsg()\n {\n\t\t$postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\n \t//extract post data\n\t\tif (!empty($postStr))\n { \n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $msgType = $postObj->MsgType;\n \n $time = time();\n \n $textTpl = \"<xml>\n <ToUserName><![CDATA[%s]]></ToUserName>\n <FromUserName><![CDATA[%s]]></FromUserName>\n <CreateTime>%s</CreateTime>\n <MsgType><![CDATA[%s]]></MsgType>\n <Content><![CDATA[%s]]></Content>\n <FuncFlag>0</FuncFlag>\n </xml>\";\n \n if($msgType == \"text\")\n {\n \t/*\n $keyword = trim($postObj->Content);\n\t\t\t\t\n\t\t\t\t\n $msgType = \"text\";\n \n $contentStr = $keyword;\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n\t\t\t\t * \n\t\t\t\t */\n }\n else if($msgType == \"event\")\n {\n $event = $postObj->Event;\n if($event == \"subscribe\")\n {\n $msgType = \"text\";\n \n $contentStr = \"你好,欢迎你的关注!\";\n \n \n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n }\n\t\t\t\telse if($event == \"CLICK\")\n\t\t\t\t{\n\t\t\t\t\t$eventKey = $postObj->EventKey;\n\t\t\t\t\t\n\t\t\t\t\tif($eventKey == \"VK_RECENT\")\n\t { \n\t \n\t $query = \"select `id`, `post_title`, `post_content`\n\t from `wp_posts`\n\t where `post_status` like 'publish' and `post_type` like 'post'\n\t order by `post_date` desc\n\t limit 0, 5\";\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t$sql = new SQL();\n\t $result = $sql->getResult($query);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($result === FALSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$msgType = \"text\"; \n\t \n\t\t $contentStr = \"服务器维护中\";\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t $strTitle = \"近期文章:\\n\\n\";\n\t\t $num_results = $result->num_rows;\n\t\t for($i = 0; $i < $num_results; ++$i)\n\t\t {\n\t\t $row = $result->fetch_assoc();\n\t\t \n\t\t $strTitle .= '「<a href=\"'. SITE . '/?p=' . $row['id'] . '\">';\n\t\t $strTitle .= $row['post_title'];\n\t\t $strTitle .= \"</a>」\\n\\n\";\n\t\t }\n\t\t \n\t\t $msgType = \"text\";\n\t\t \n\t\t \n\t\t $contentStr = $strTitle;\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\n\t \n\t }\n\t else if($eventKey == \"VK_DATE\")\n\t {\n\t $query = \"select year(`post_date`), month(`post_date`), extract(year_month from(`post_date`)), count(extract(year_month from(`post_date`))) \n\t from `wp_posts`\n\t where `post_status` like 'publish' and `post_type` like 'post' \n\t group by extract(year_month from(`post_date`))\n\t order by extract(year_month from(`post_date`)) desc\";\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$sql = new SQL();\n\t $result = $sql->getResult($query);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($result === FALSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$msgType = \"text\"; \n\t \n\t\t $contentStr = \"服务器维护中\";\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t $strTitle = \"文章归档:\\n\\n\";\n\t\t $num_results = $result->num_rows;\n\t\t for($i = 0; $i < $num_results; ++$i)\n\t\t {\n\t\t $row = $result->fetch_assoc();\n\t\t \n\t\t $strTitle .= ' <a href=\"'. SITE . '/?m=' . $row['extract(year_month from(`post_date`))'] . '\">';\n\t\t $strTitle .= $row['year(`post_date`)'] . \"年\".\n\t\t chineseMonth($row['month(`post_date`)']) . \"月\";\n\t\t \n\t\t $strTitle .= \"</a> (\" .$row['count(extract(year_month from(`post_date`)))']. \")\\n\\n\";\n\t\t }\n\t\t \n\t\t $msgType = \"text\";\n\t\t \n\t\t \n\t\t $contentStr = $strTitle;\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\n\t \t}\n\t \n\t }\n\t else if($eventKey == \"VK_CATEGORY\")\n\t {\n\t \t$query = \"select `wp_terms`.`term_id`, `wp_terms`.`name`, `wp_term_taxonomy`.`count`\n\t from `wp_terms`, `wp_term_taxonomy`\n\t where `wp_term_taxonomy`.`taxonomy` like 'category' and `wp_term_taxonomy`.`count` != 0\n\t and `wp_terms`.`term_id` = `wp_term_taxonomy`.`term_id`\";\n\t \n\t \n\t $sql = new SQL();\n\t $result = $sql->getResult($query);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($result === FALSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$msgType = \"text\"; \n\t \n\t\t $contentStr = \"服务器维护中\";\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t $strTitle = \"分类目录:\\n\\n\";\n\t\t $num_results = $result->num_rows;\n\t\t for($i = 0; $i < $num_results; ++$i)\n\t\t {\n\t\t $row = $result->fetch_assoc();\n\t\t \n\t\t $strTitle .= ' <a href=\"'. SITE . '/?cat=' . $row['term_id'] . '\">';\n\t\t $strTitle .= $row['name'];\n\t\t \n\t\t $strTitle .= \"</a> (\" .$row['count']. \")\\n\\n\";\n\t\t }\n\t\t \n\t\t $msgType = \"text\";\n\t\t \n\t\t $contentStr = $strTitle;\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\n\t\t\t\t\t\t} \n\t }\n\t else if($eventKey == \"VK_TAG\")\n\t {\n\t $query = \"select `wp_terms`.`slug`, `wp_terms`.`name`, `wp_term_taxonomy`.`count`\n\t from `wp_terms`, `wp_term_taxonomy`\n\t where `wp_term_taxonomy`.`taxonomy` like 'post_tag' and `wp_term_taxonomy`.`count` != 0\n\t and `wp_terms`.`term_id` = `wp_term_taxonomy`.`term_id`\";\n\t \n\t \n\t $sql = new SQL();\n\t $result = $sql->getResult($query);\n\t\t\t\t\t\t\n\t\t\t\t\t\tif($result === FALSE)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$msgType = \"text\"; \n\t \n\t\t $contentStr = \"服务器维护中\";\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t $strTitle = \"标签列表:\\n\\n\";\n\t\t $num_results = $result->num_rows;\n\t\t for($i = 0; $i < $num_results; ++$i)\n\t\t {\n\t\t $row = $result->fetch_assoc();\n\t\t \n\t\t $strTitle .= ' <a href=\"'. SITE . '/?tag=' . $row['slug'] . '\">';\n\t\t $strTitle .= $row['name'];\n\t\t \n\t\t $strTitle .= \"</a> (\" .$row['count']. \")\\n\\n\";\n\t\t }\n\t\t \n\t\t $msgType = \"text\";\n\t\t \n\t\t $contentStr = $strTitle;\n\t\t $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n\t\t echo $resultStr;\n\t\t\t\t\t\t}\n\t }\t\t\t\t\t\n\t\t\t\t}\n }\n\n }\n else\n {\n \techo \"\";\n \texit;\n }\n }",
"function sendText($phoneNumber, $textString)\n{\n $textString = urlencode($textString);\n $phoneNumber = intval($phoneNumber);\n $url = 'https://api.mogreet.com/moms/transaction.send?client_id=1316&token=dbd7557a6a9d09ab13fda4b5337bc9c7&campaign_id=28420&to=' . $phoneNumber . '&message=' . $textString . '&format=json';\n $ch = curl_init($url);\n $response = curl_exec($ch);\n curl_close($ch);\n}",
"function getResponseFromWatson2($p_input_text) {\n $workspace_id = \"9ecfefaa-5874-44cc-bca1-ebdb5664fe53\";\n $_watson_API_username = \"apikey\";\n $_watson_API_password = \"yqfzvnhDEwwmJ99__n4GNIWkl72f5dV5BtWxUadQ2Nn1\";\n $_version_date = \"2018-11-19\";\n\n // set url\n $api_url = \"https://gateway-syd.watsonplatform.net/assistant/api/v1/workspaces/\" . $workspace_id . \"/message?version=2018-11-19\";\n $response = \"\";\n if (isset($_POST['submit2M'])) {\n $p_input_text = $_POST['my_message2'];\n\n if (!empty($_POST['my_message2'])) {\n $api_request_array['input']['text'] = $p_input_text;\n } else {\n $api_request_array['input'] = null;\n }\n\n\n if (!empty($p_watson_context))\n $api_request_array['context'] = $p_watson_context;\n\n $json_api_request = json_encode($api_request_array);\n\n\n $ch = curl_init();\n\n curl_setopt($ch, CURLOPT_URL, $api_url);\n curl_setopt($ch, CURLOPT_POST, 1);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);\n curl_setopt($ch, CURLOPT_USERPWD, \"$_watson_API_username:$_watson_API_password\");\n curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);\n curl_setopt($ch, CURLOPT_POSTFIELDS, $json_api_request);\n curl_setopt($ch, CURLOPT_HTTPHEADER, array(\"Content-Type: application/json\"));\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);\n\n $response = curl_exec($ch);\n\n if (curl_errno($ch)) {\n //echo 'Error connecting with Watson API. Error:(' . $errno . ') - ' . curl_strerror($errno);\n echo 'Curl error: ' . curl_error($ch);\n }\n\n // $output contains the output string\n $watson_reply_message = json_decode($response, true); // return an array instead of object\n //$watson_reply_message = json_decode($response); // return object instead of array\n\n\n if (isset($watson_reply_message->output->text[0]))\n $watson_output_text = $watson_reply_message->output->text;\n else\n $watson_output_text[] = \"Sorry! Watson service could not reply\";\n\n //store the context in session which will be used before calling the api\n if (isset($watson_reply_message->context)) {\n $return_message['watson_api_context'] = $watson_reply_message->context;\n }\n\n $return_message['watson_reply_text'] = $watson_output_text;\n\n $response = $watson_reply_message['output']['text'][0];\n\n // close curl resource to free up system resources\n curl_close($ch);\n }\n\n return $response;\n }",
"public function buildResponse($embedlyResponse);",
"public function respond_simpleMessage($textToSpeak, $stringToDisplay = '') {\n\t \n\t // Prevent duplicate responses\n\t if ($this->hasResponded) return;\n\t $this->hasResponded = true;\n\t \n // If this hasn't been defined, set it to the same text as the speech (accessibility)\n if ($stringToDisplay == '') {\n $stringToDisplay = $textToSpeak;\n }\n header(\"Content-type:application/json\");\n\t\treturn json_encode(array(\n\t\t\t\"speech\" => $textToSpeak,\n\t\t\t\"displayText\" => $stringToDisplay,\n\t\t));\n }",
"public function sounds_lossless()\n\t{\n\t\tif (preg_match('/^http:\\/\\/dream-of-usenet\\.org .+? - \\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//Rush - Sector One 24-96 (000/229] - \".nzb\" yEnc\n\t\t//Stevie Ray Vaughan - Couldn't Stand the Weather (01/19] - \".sfv\" yEnc\n\t\tif (preg_match('/^([a-zA-Z0-9]+.+? - .+?)\\s+\\(\\d+\\/\\d+\\] - \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //trtk07073 - [18/26] - \"1990 Santana - Spirits Dancing In The Flesh (flac).part17.rar\" yEnc\n\t\tif (preg_match('/^trtk\\d+ - \\[\\d+\\/\\d+\\] - \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //COMPLETE REPOST Magma - NMR - 1974 - Wurdah Itah [01 of 23] \"1974 - Wurdah Itah.par2\" yEnc\n\t\tif (preg_match('/^COMPLETE REPOST (.+? - )NMR -( \\d{4}) - (.+?) \\[\\d+ of \\d+\\] \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1] . $match[3] . \"(\" . $match[2] . \")\";\n\t\t} //Sensation - VA - Source Of Light (2CD 2012) [02 of 67] - \"00 - Sensation - VA - Source Of Light (2CD 2012) [nmr].txt\" yEnc\n\t\tif (preg_match('/^([A-Z0-9].+? - VA - .+?) \\[\\d+ of \\d+\\] - \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//Ryan McGarvey - Forward In Reverse [01/21] - \"00 - Ryan Mcgarvey - Forward in Reverse.nfo\" yEnc\n\t\t//JFC - The Timerewinder (NMR) [01/15] - \"00 - The Timerewinder.nfo\" yEnc\n\t\t//The Brothers Johnson - 1981 - Winners (2011 expanded remastered) [01/31] - \"01 - The Real Thing.flac\" yEnc\n\t\t//Jermaine Jackson - 1980 - Let's Get Serious [00/23] - \"Jermaine Jackson - 1980 - Let's Get Serious.nzb\" yEnc\n\t\tif (preg_match('/^([A-Z0-9][A-Za-z0-9 ]{2,} -( \\d{4} -)? [A-Z0-9].+?( \\(.+?\\))?) \\[\\d+\\/\\d+\\] - \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//Miles Davis - In A Silent Way (1969) [2013 - HDTracks 24-176,4] - \"iasw24-176.par2\" yEnc\n\t\t//Bob James & David Sanborn - Quartette Humaine (2013) [HDTracks 24-88,2] - \"qh24-88.par2\" yEnc\n\t\tif (preg_match('/^([A-Z0-9].+? - [A-Z0-9].+? \\(\\d{4}\\) \\[.*?HDTracks.+?\\]) - \".+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//Sonny Landreth - 2010 - Mississippi Blues - 04 of 29 - 00 - Mississippi Blues.sfv yEnc\n\t\t//Fruteland Jackson - 1996 - ... Is All I Crave - 08 of 20 - 00 - Fruteland Jackson - ... Is All I Crave.log yEnc\n\t\tif (preg_match('/^([A-Z0-9].+? - \\d{4} - .+?) - \\d+ of \\d+ - \\d+ - .+? yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //(VA - Cafe Del Mar Dreams 5-2012-Samfie Man) [37/38] - \"VA - Cafe Del Mar Dreams 5-2012-Samfie Man.vol063+040.par2\" yEnc\n\t\tif (preg_match('/^\\((VA - .+?)\\) \\[\\d+\\/\\d+\\] - \".+?\" yEnc$/', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t} //(152092XA20) [08/16] - \"Guns and Roses - Use Your Illusion I - 08-Back Off Bitch.flac\" yEnc\n\t\tif (preg_match('/^\\([A-Z0-9]+\\) \\[\\d+\\/\\d+\\] - \"(.+?) - \\d+-.+?\" yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //Eros_Ramazzotti-Eros-IT-CD-FLAC-1997-FADA[04/26] - \"00-eros_ramazzotti-eros-1997-fada.sfv\" yEnc\n\t\tif (preg_match('/^([\\w-]{5,})\\[\\d+\\/\\d+\\] - \".+?\" yEnc$/', $this->subject, $match)) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//.: VA-Liquid_Music-The_Future_House_Compilation-CD-FLAC-1993-WRS :. - .:www.thunder-news.org:. - .:sponsored by secretusenet.com:. - \"00-va-liquid_music-the_future_house_compilation-cd-flac-1993-wrs.nfo\" yEnc\n\t\t//.:Bruce_BecVar-Arriba-CD-FLAC-1993-JLM:. - .:thunder-news.org:. - .:sponsored by secretusenet.com:. - \"00-bruce_becvar-arriba-cd-flac-1993.m3u\" yEnc\n\t\tif (preg_match('/^.:[-_\\s]{0,3}(.+?)[-_\\s]{0,3}:..+?thunder-news\\.org.+?secretusenet\\.com:. - \"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' .\n\t\t\t\t\t $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //_ \"CARUSO & GIGLI - O Sole Mio - The Unknown.nzb\" yEnc\n\t\tif (preg_match('/^[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e1,\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\t//\"Art Tatum - The Complete Trio Sessions with Tiny Grimes & Slam Stewart - Vol 1.NFO\" - 1 of 6 (1/1)\n\t\t//\"Galen Jeter and the Dallas Jazz Orchestra - Thank You, Leon.NFO\" - 1 of 5 (1/1) (1/1)\n\t\tif (preg_match('/^[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t '[-_\\s]{0,3}\\d+ (of \\d+)( \\(\\d+\\/\\d+\\)){1,2} (yEnc)?$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t} //\"Doc Watson - 1973 - The Essential Doc Watson - 01 - Tom Dooley.flac\" - 406.64 MB - yEnc\n\t\tif (preg_match('/^[-_\\s]{0,3}\"([\\w\\säöüÄÖÜß+¤¶!.,&_()\\[\\]\\'\\`{}#-]{8,}?\\b.?)' . $this->e0 .\n\t\t\t\t\t '[ _-]{0,3}\\d+[.,]\\d+ [kKmMgG][bB][ _-]{0,3}yEnc$/',\n\t\t\t\t\t $this->subject,\n\t\t\t\t\t $match)\n\t\t) {\n\t\t\treturn $match[1];\n\t\t}\n\t\treturn array(\n\t\t\t\"cleansubject\" => $this->releaseCleanerHelper($this->subject), \"properlynamed\" => false\n\t\t);\n\t}",
"function translate_bing($data)\n\t {\n\t \t //\n\t \t //print_r($data);\n\t \t $api = 'F0DE0CCB37335B16E7EB0BD3FA2A3C9FD3543DE5';\n\t \t \n\t \t if(empty($data['text']))\n\t\t { \n\t\t return ''; \n\t\t } \n\t\t \n\t\t if($data['orignal_type'] == 'zh')\n\t\t {\n\t\t \t$data['orignal_type'] = 'zh-CHS';\n\t\t }\n\t\t \n\t\t if($data['local_type'] == 'zh')\n\t\t {\n\t\t \t$data['local_type'] = 'zh-CHS';\n\t\t }\n\n\t\t \n\t\t $url = \"http://api.microsofttranslator.com/v2/Http.svc/Translate?appId=\".$api.\"&text=\".urlencode($data['text']) . \"&from=\" . $data['orignal_type'] . \"&to=\" . $data['local_type']; \n\t\t \n\t\t //echo $url;\n\t\t \n\t\t if (function_exists('curl_init')) \n\t\t { \n\t\t $curl = curl_init(); \n\t\t curl_setopt($curl, CURLOPT_URL, $url); \n\t\t curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); \n\t\t $res = curl_exec($curl); \n\t\t } \n\t\t else \n\t\t { \n\t\t $res = @file_get_contents($url); \n\t\t }\n\t\t \n\t\t //echo $res;\n\t\t \n\t\t preg_match(\"~<string([^><]*?)>([\\s\\S]*?)<\\/string>~i\", $res, $ostr); \n\t\t //print_r($ostr);\n\t\t if (empty($ostr[2])) \n\t\t { \n\t\t return ''; \n\t\t } \n\t\t else \n\t\t { \n\t\t return htmlspecialchars_decode($ostr[2]); \n\t\t } \n\t }",
"public function generateResponse(){\n\n switch ($this->requestMethod) {\n\n case 'GET':\n if(isset($this->topicId)){\n\n $response = $this->getTopicById($this->topicId);\n\n }else{\n\n $response = $this->getAllTopic();\n \n } \n \n break;\n\n case 'POST':\n\n $response = $this->createTopic();\n \n break;\n \n case 'PUT':\n\n if($this->userAction === \"update_topic\"){\n $response = $this->updateTopic($this->topicId);\n }else{\n\n $response = $this->notFoundResponse();\n }\n \n break;\n\n case 'DELETE':\n if($this->userAction == \"delete_topic_info\"){\n $response = self::deleteUser($this->topicId);\n } \n \n break;\n \n default:\n $response = $this->invalidRoute();\n break;\n }\n \n echo $response['body'];\n\n }",
"public function readSubject()\n {\n $this->response = null;\n\n\n $this->num_hits = 0;\n // Extract uuids into\n\n //$this->number = extractNumber();\n\n $keywords = $this->keywords;\n\n if ($this->agent_input != null) {\n\n // If agent input has been provided then\n // ignore the subject.\n // Might need to review this.\n $input = strtolower($this->agent_input);\n\n } else {\n\n $input = strtolower($this->subject);\n\n }\n\n $this->input = $input;\n\n\t\t$haystack = $this->agent_input . \" \" . $this->from . \" \" . $this->subject;\n\n $prior_uuid = null;\n\n $pieces = explode(\" \", strtolower($input));\n\n\t\t// So this is really the 'sms' section\n\t\t// Keyword\n if (count($pieces) == 1) {\n\n if ($input == 'eventful') {\n //$this->search_words = null;\n $this->response = \"Asked Oxford Dicionaries about nothing.\";\n return;\n }\n\n }\n\n foreach ($pieces as $key=>$piece) {\n foreach ($keywords as $command) {\n if (strpos(strtolower($piece),$command) !== false) {\n\n switch($piece) {\n\n case 'run':\n // //$this->thing->log(\"read subject nextblock\");\n $this->runTrain();\n break;\n\n default:\n }\n\n }\n }\n\n }\n\n\n $whatIWant = $input;\n if (($pos = strpos(strtolower($input), \"oxforddictionaries is\")) !== FALSE) { \n $whatIWant = substr(strtolower($input), $pos+strlen(\"oxforddictionaries is\")); \n } elseif (($pos = strpos(strtolower($input), \"oxforddictionaries\")) !== FALSE) { \n $whatIWant = substr(strtolower($input), $pos+strlen(\"oxforddictionaries\")); \n }\n\n $filtered_input = ltrim(strtolower($whatIWant), \" \");\n\n if ($filtered_input != \"\") {\n $this->search_words = $filtered_input;\n $this->response = \"Asked Oxford Dictionaries about the word \" . $this->search_words . \".\";\n return false;\n }\n\n\n\n $this->response = \"Message not understood\";\n\t\treturn true;\n\n\t\n\t}",
"function send_response() {\n $nocrypt = isset($_POST[\"nocrypt\"]);\n $cert = isset($_POST[\"cert\"]) ? trim($_POST[\"cert\"]) : \"\";\n if (!$nocrypt && !$cert) {\n header(\"HTTP/1.1 400 Bad Request\");\n echo \"No recipient certificate specified!\\n\";\n return;\n }\n\n if (!create_response()) {\n header(\"HTTP/1.1 500 Internal Server Error\");\n echo \"Error creating response\";\n return;\n }\n\n $err = digidoc::initialize();\n if ($err != digidoc::ERR_OK) {\n header(\"HTTP/1.1 500 Internal Server Error\");\n echo \"Error initializing libdigidoc: \" . digidoc::get_error($err);\n return;\n }\n $err = sign_response();\n if ($err != digidoc::ERR_OK) {\n header(\"HTTP/1.1 500 Internal Server Error\");\n echo \"Error signing response: \" . digidoc::get_error($err);\n digidoc::finalize();\n return;\n }\n if (!$nocrypt) {\n $err = encrypt_response($cert);\n if ($err != digidoc::ERR_OK) {\n header(\"HTTP/1.1 500 Internal Server Error\");\n echo \"Error encrypting response: \" . digidoc::get_error($err);\n digidoc::finalize();\n return;\n }\n }\n digidoc::finalize();\n\n if ($err == digidoc::ERR_OK) {\n $ext = $nocrypt ? \"ddoc\" : \"cdoc\";\n $resp = File::readLocalFile(get_response_prefix() . \".$ext\");\n File::saveAs(\"response.$ext\", $resp, \"application/x-$ext\", \"utf-8\");\n }\n}",
"private function getHtmlResponse() {\r\n\t\t\r\n\t\t\t// check if a request has been made, else skip!\r\n\t\t\t$cmd = @$_POST['request'];\r\n\t\t\tif (!$cmd) {return '';}\r\n\t\t\t\r\n\t\t\t// get the connection\r\n\t\t\t$con = Factory::getVdrConnection();\r\n\t\t\t$resp = $con->request($cmd);\r\n\t\t\t\r\n\t\t\t// create the template\r\n\t\t\t$tpl = new Template('svdrp_response');\r\n\t\t\t$tpl->set('HEADER', LANG_SVDRP_RESPONSE_HEADER);\r\n\t\t\t$tpl->set('CONTENT', $resp->getLinesAsString());\r\n\t\t\treturn $tpl->get();\r\n\t\t\t\r\n\t\t}",
"public function send() {\n $tidy = new Tidy();\n $tidy->parseString($this->output, $this->tidyConfig);\n $tidy->cleanRepair();\n\n // Send the output string to the client\n echo $tidy;\n }",
"public function getTutorialReply()\n {\n return $this->get(self::_TUTORIAL_REPLY);\n }",
"function respond($tf)\n{\n\n print '<?xml version = \"1.0\" encoding = \"utf-8\"?>\n <soapenv:Envelope xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">\n <soapenv:Body>\n <notifications xmlns=\"http://soap.sforce.com/2005/09/outbound\">\n <Ack>' . $tf . '</Ack>\n </notifications>\n </soapenv:Body>\n </soapenv:Envelope>';\n}",
"public function responseMsg()\n {\n //设置了register_globals禁止,不能用$GLOBALS[\"HTTP_RAW_POST_DATA\"];\n // 2018-5-17 潘\n\t\t// $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n $postStr = file_get_contents(\"php://input\");\n \t//extract post data\n\t\tif (!empty($postStr)){\n /* libxml_disable_entity_loader is to prevent XML eXternal Entity Injection,\n the best way is to check the validity of xml by yourself */\n libxml_disable_entity_loader(true);\n \t$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $keyword = trim($postObj->Content);\n $time = time();\n $textTpl = \"<xml>\n\t\t\t\t\t\t\t<ToUserName><![CDATA[%s]]></ToUserName>\n\t\t\t\t\t\t\t<FromUserName><![CDATA[%s]]></FromUserName>\n\t\t\t\t\t\t\t<CreateTime>%s</CreateTime>\n\t\t\t\t\t\t\t<MsgType><![CDATA[%s]]></MsgType>\n\t\t\t\t\t\t\t<Content><![CDATA[%s]]></Content>\n\t\t\t\t\t\t\t<FuncFlag>0</FuncFlag>\n\t\t\t\t\t\t\t</xml>\"; \n\t\t\t\tif(!empty( $keyword ))\n {\n \t\t$msgType = \"text\";\n \t$contentStr = \"行行,DSB\";\n \t$resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n \techo $resultStr;\n }else{\n \techo \"Input something...\";\n }\n\n }else {\n \techo \"嗨!\";\n \texit;\n }\n }",
"public function summarise_response(array $response)\n {\n //TODO: fixme\n return 'waveform';\n }",
"public function createSynthesizeSpeechPreSignedUrl(array $args)\n {\n $uri = new Uri($this->getEndpoint());\n $uri = $uri->withPath('/v1/speech');\n\n // Formatting parameters follows rest-json protocol\n $this->formatter = $this->formatter ?: new JsonBody($this->getApi());\n $queryArray = json_decode(\n $this->formatter->build(\n $this->getApi()->getOperation('SynthesizeSpeech')->getInput(),\n $args\n ),\n true\n );\n\n // Mocking a 'GET' request in pre-signing the Url\n $query = Psr7\\Query::build($queryArray);\n $uri = $uri->withQuery($query);\n\n $request = new Request('GET', $uri);\n $request = $request->withBody(Psr7\\Utils::streamFor(''));\n $signer = new SignatureV4('polly', $this->getRegion());\n return (string) $signer->presign(\n $request,\n $this->getCredentials()->wait(),\n '+15 minutes'\n )->getUri();\n }",
"public function responseMsg()\n {\n\t\t$postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n //接收微信公众平台发送过来的用户消息,该消息数据结构为XML,不是php默认的识别数据类型,因此这里用了$GLOBALS['HTTP_RAW_POST_DATA']来接收,同时赋值给了$postStr\n\n \t//extract post data\n\t\tif (!empty($postStr)){\n \n \t$postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n \t//使用simplexml_load_string() 函数将接收到的XML消息数据载入对象$postObj中。这个严谨的写法后面还得加个判断是否载入成功的条件语句,不过不写也没事。\n \t$RX_TYPE = trim($postObj->MsgType); \n \t//接收信息的类型\n \t\n \tswitch($RX_TYPE)\n {\n case \"text\":\n $resultStr = $this->handleText($postObj);\n break;\n \n case \"event\":\n $resultStr = $this->handleEvent($postObj);\n break;\n \n default:\n $resultStr = \"Unknow msg type:\".$RX_TYPE.\"\\n\".$postObj->Event.\"\\n\".$postObj->EventKey;\n break;\n }\n \techo $resultStr;\n \n }else{ \n \techo \"\";\n \texit;\n }\n }",
"public function responseMsg()\n {\n $postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n \n //extract post data\n if (!empty($postStr)){\n /* libxml_disable_entity_loader is to prevent XML eXternal Entity Injection,\n the best way is to check the validity of xml by yourself */\n libxml_disable_entity_loader(true);\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $keyword = trim($postObj->Content);\n $time = time();\n $msgType = $postObj->MsgType;//消息类型\n $event = $postObj->Event;//时间类型,subscribe(订阅)、unsubscribe(取消订阅)\n $textTpl = \"<xml>\n <ToUserName><![CDATA[%s]]></ToUserName>\n <FromUserName><![CDATA[%s]]></FromUserName>\n <CreateTime>%s</CreateTime>\n <MsgType><![CDATA[%s]]></MsgType>\n <Content><![CDATA[%s]]></Content>\n <FuncFlag>0</FuncFlag>\n </xml>\"; \n \n switch($msgType){\n case \"event\":\n if($event==\"subscribe\"){\n $contentStr = \"最新更新说明:\".\"\\n\".\"A:优化二维码搜索功能,搜索更精准\".\"\\n\".\"B:微信群二维码采集源更新:\".\"\\n\".\"1、百度贴吧\".\"\\n\".\"2、新浪微博\".\"\\n\".\"3、兴趣部落\".\"\\n\".\"4、700+陌陌群\".\"\\n\".\"5、3500+个微信群\".\"\\n\".\"6、1300+个QQ群\".\"\\n\".\"C:支持支付方式:\".\"\\n\".\"1、微信支付\".\"\\n\".\"2、支付宝(敬请期待)\";\n } \n break;\n case \"text\":\n /*switch($keyword){\n case \"1\":\n $contentStr = \"店铺地址:\".\"\\n\".\"杭州市江干艮山西路233号新东升市场地下室第一排.\"; \n break;\n case \"2\":\n $contentStr = \"商品种类:\".\"\\n\".\"杯子、碗、棉签、水桶、垃圾桶、洗碗巾(刷)、拖把、扫把、\"\n .\"衣架、粘钩、牙签、垃圾袋、保鲜袋(膜)、剪刀、水果刀、饭盒等.\";\n break;\n default:\n $contentStr = \"对不起,你的内容我会稍后回复\";\n }*/\n $contentStr = \"对不起,你的内容我会稍后回复\";\n break;\n }\n $msgType = \"text\";\n $resultStr = sprintf($textTpl, $fromUsername, $toUsername, $time, $msgType, $contentStr);\n echo $resultStr;\n }else {\n echo \"post str is null\";\n exit;\n }\n }",
"function GenerateSentence() {\n $nb = rand(1, 10);\n $s = '';\n for ($i = 1; $i <= $nb; $i++)\n $s .= $this->GenerateWord() . ' ';\n return substr($s, 0, -1);\n }",
"function generate_sentence($num_words)\r\n\t{\r\n\t\t$output = '';\r\n\t\tfor($i = 0; $i < $num_words; $i++)\r\n\t\t{\r\n\t\t\t$output = $output . generate_word(rand(1,3)) . ' ';\r\n\t\t}\r\n\t\t\r\n\t\treturn $output;\r\n\t}",
"function synthesizeMacOSX($voice, $text, $filename, $rate)\n { \n $error = false;\n $errormessage = null;\n $errorcode = 0;\n $output = array();\n \n try {\n $concatveus = \"\";\n \n if ($rate > 0) $concatveus .= \"-r \".$rate.\" \";\n\n $concatveus .= \"-v '\".$voice.\"' \";\n $concatveus .= \"-o mp3/\".$filename.\".m4a --data-format=aach \";\n\n $cmd=\"say \".$concatveus.'\"'.$text.'\" > /dev/null 2>&1 &';\n shell_exec($cmd);\n\n } catch (Exception $ex) {\n $error = true;\n $errormessage = \"Error. Unable to access your selected Mac OS X voice due to unkown circumstances. \"\n . \"Try changing your voices in your user configuration settings. \"\n . \"Otherwise, your OS X may not be compatible with the 'say' command.\";\n $errorcode = 110;\n }\n \n $output[0] = $error;\n $output[1] = $errormessage;\n $output[2] = $errorcode;\n return $output;\n }",
"private function response() {\n $reply = trim(fgets($this -> __sock, 512));\n switch(substr($reply, 0, 1)) {\n /* Error reply */\n case '-':\n trigger_error('ERROR (' . trim($reply) . ')', E_USER_ERROR);\n /* Inline reply */\n case '+':\n $response = substr(trim($reply), 1);\n if($response === 'OK') $response = true;\n break;\n /* Bulk reply */\n case '$':\n $response = null;\n if($reply === '$-1') break;\n $read = 0;\n $size = intval(substr($reply, 1));\n if($size > 0) {\n do {\n $block_size = ($size - $read) > 1024 ? 1024 : ($size - $read);\n $r = fread($this -> __sock, $block_size);\n if($r === false)\n trigger_error('READ FROM SERVER ERROR', E_USER_ERROR);\n else {\n $read += strlen($r);\n $response .= $r;\n }\n } while($read < $size);\n }\n fread($this -> __sock, 2); /* CRLF */\n break;\n /* Multi-bulk reply */\n case '*':\n $count = intval(substr($reply, 1));\n if($count === -1) return null;\n $response = array();\n for($i = 0; $i < $count; $i++)\n $response[] = $this -> response();\n break;\n /* Integer reply */\n case ':':\n $response = intval(substr(trim($reply), 1));\n break;\n default:\n trigger_error('UNKNOWN RESPONSE ERROR', E_USER_ERROR);\n }\n return $response;\n }",
"public function positive()\n {\n return $this->speak(collect([\n 'cool',\n 'great',\n 'awesome',\n 'super',\n 'tubular',\n 'hey-o',\n 'yeah',\n 'yee-haw',\n 'sick',\n 'sweet',\n 'yippee',\n 'boom',\n 'nice one',\n 'cool beans',\n 'woohoo',\n 'yahoo',\n ]));\n }",
"public function sendVoice($datas = [])\r\n {\r\n return $this->telegram(\"sendVoice\", $datas);\r\n }",
"function forwardCall($num) {\r\n return \"<?xml version='1.0' encoding='UTF-8'?><Response><Dial>$num</Dial></Response>\"; \r\n}",
"function generateMobileResponse($result, $statuscode = 1, $statustext = \"\") {\n\n $item = new stdClass();\n $item->result = $result;\n $item->statuscode = $statuscode;\n\n if (is_array($statustext)) {\n\n $item->statustext = trim(implode(\"\\n\", $statustext));\n } else {\n $item->statustext = $statustext;\n }\n\n\n echo json_encode($item);\n die();\n}",
"function dahz_get_audio_transcript( $post_id = 0 ) {\n\n\tif ( empty( $post_id ) )\n\t\t$post_id = get_the_ID();\n\n\t/* Set up some default variables and get the image metadata. */\n\t$lyrics = '';\n\t$meta = wp_get_attachment_metadata( $post_id );\n\n\t/* Look for the 'unsynchronised_lyric' tag. */\n\tif ( isset( $meta['unsynchronised_lyric'] ) )\n\t\t$lyrics = $meta['unsynchronised_lyric'];\n\n\t/* Seen this misspelling of the id3 tag. */\n\telseif ( isset( $meta['unsychronised_lyric'] ) )\n\t\t$lyrics = $meta['unsychronised_lyric'];\n\n\t/* Apply filters for the transcript. */\n\treturn apply_filters( 'dahz_audio_transcript', $lyrics );\n}",
"function dire($texte,$signature='', $voice='')\n { \n if ($signature != '') {\n $this->url .='&tts='.rawurlencode('Message de '.stripslashes(trim($signature)).' : ').rawurlencode(stripslashes(trim($texte)));\n } else {\n $this->url .='&tts='.rawurlencode(stripslashes(trim($texte)));\n }\n //Pour le francais on ne prends pas la voix par defaut (preference personnelle ;)\n if ($voice == '' && $this->lang==\"fr\") $voice='claire22k';\n if ($voice == '' && $this->lang==\"us\") $voice='heather22k';\n \n if ($voice != '') {\n $this->url .='&voice='.$voice;\n }\n }",
"public function responseMsg()\n\t{\n\t\t$postStr = $GLOBALS[\"HTTP_RAW_POST_DATA\"];\n\t\t\n \t//extract post data\n\t\tif (!empty($postStr))\n\t\t{\n /* libxml_disable_entity_loader is to prevent XML eXternal Entity Injection,\n the best way is to check the validity of xml by yourself */\n\t\t\t\t// 使用simplexml技术对xml进行解析 \n\t\t\t\t// libxml_disable_entity_loader(true), 是从安全性考虑,为了防止xml外部注入,\n\t\t\t\t//只对xml内部实体内容进行解析\n libxml_disable_entity_loader(true);\n\t\t\t\t//加载 postStr 字符串\n $postObj = simplexml_load_string($postStr, 'SimpleXMLElement', LIBXML_NOCDATA);\t\t\t\n $fromUsername = $postObj->FromUserName;\n $toUsername = $postObj->ToUserName;\n $keyword = trim($postObj->Content);\n $time = time();\n global $tmp_arr;\n\n\t\t\t\t//连接Mysql数据库,并添加信息\n\n switch($postObj->MsgType)\n {\n \tcase 'event':\n \tif($postObj->Event == 'subscribe')\n \t{\t\t\n\n //获取用户信息并入库 \n \t\trequire_once 'get_token.php';\n \t\theader('content-type:text/html;charset=utf-8');\n //获取用户的$openid\n \t\t$url = \"https://api.weixin.qq.com/cgi-bin/user/info?access_token={$access_token}&openid={$fromUsername}\";\n //发送请求\n \t\t$res = http_request($url, null);\n \t\t$res = json_decode($res);\n //获取我们需要的各种信息\n \t\t$openid = $res->openid;\n \t\t$nickname = $res->nickname;\n \t\t$country = $res->country;\n \t\t$province = $res->province;\n \t\t$city = $res->city;\n \t\t$address = $country. ' '. $province. ' '. $city;\n \t\t$sex = $res->sex;\n \t\t$contentStr =\" 嘿,亲爱的 \". $nickname .\"\\n\\r这里是 【 废品回收管理中心 】\\n\\r功能研究请戳导航栏~\\n\\r更多功能期待您的发现~ \";\n \t\t$resultStr = sprintf($tmp_arr['text'], $fromUsername, $toUsername, $time, $contentStr);\n \t\techo $resultStr;\n \t}\n //用户取消关注\n \tif($postObj->Event == 'unsubscribe')\n \t{\n \t\t//应该做一个删除动作\n \t}else if($postObj->Event == 'LOCATION')\n \t{\n\t\t\t\t\t\t\t//取出该用户上报的纬度和经度\n \t\t$Latitude = $postObj->Latitude;\n \t\t$Longitude = $postObj->Longitude;\n\t\t\t\t\t\t\t//返回给用户\n\t\t\t\t\t\t\t// $contentStr = \"我们收到您上报的地理位置:\\n\\n 纬度是: {$Latitude}\\n 经度是:{$Longitude}\";\n\t\t\t\t\t\t\t// $resultStr = sprintf($tmp_arr['text'], $fromUsername, $toUsername, $time, $contentStr);\n\t\t\t\t\t\t\t// echo $resultStr;\n \t}\n\t\t\t\t\t\t//响应用户的点击事件\n \tif($postObj->Event == 'CLICK' )\n \t{\n \t\tif($postObj->EventKey == 'V1001_GOOD')\n \t\t{\n\t\t\t\t\t\t\t\t//这里你就可以写自己的逻辑代码,返回一句话\n \t\t\t$contentStr = \"微信:10010\";\n \t\t\t$resultStr = sprintf($tmp_arr['text'], $fromUsername, $toUsername, $time, $contentStr);\n \t\t\techo $resultStr; \n \t\t}\n \t}\n \tbreak;\n \tcase 'text':\n\t\t\t\t\t\t\t// $sql = \"INSERT INTO `zx_info` (`id`, `openid`, `zx_info`) VALUES(NULL, '{$fromUsername}', '{$keyword}')\";\n\t\t\t\t\t\t\t// mysql_query($sql);\n \t$contentStr = \"暂不支持回复功能,快点击下方按钮进行废品回收吧~~\";\n \t$resultStr = sprintf($tmp_arr['text'], $fromUsername, $toUsername, $time, $contentStr);\n \techo $resultStr;\n \tbreak;\n\t\t\t\t\t//处理用户上传图片\n \tcase 'image':\n\t\t\t\t\t\t//回复用户刚刚上传的这张图片\n\t\t\t\t\t\t//获取到用户上传的图片的mediaid\n \t$media_id = $postObj->MediaId;\n \t$resultStr = sprintf($tmp_arr['image'], $fromUsername, $toUsername, $time, $media_id);\n \techo $resultStr;\n\n\t\t\t\t\t\t//把图片保存到本地服务器的文件系统\n\t\t\t\t\t\t//1. 先给图片创建一个名字\n \t$image_file_name = time(). \".jpg\";\n\t\t\t\t\t\t//2. 获取该图片的内容\n \t$image_file = file_get_contents($postObj->PicUrl);\n\t\t\t\t\t\t//3. 保存到本地服务器的文件系统, 特别提醒,应当保证该你创建的文件夹是www用户可读可写,否\n\t\t\t\t\t\t//无法保存该图片到文件夹 \n \tfile_put_contents(\"./uploadimage/\". $image_file_name, $image_file);\n\n\t\t\t\t\t\t//将图片的路径和相关信息入库\n\t\t\t\t\t\t//1. 创建一张表\n\t\t\t\t\t\t//2. 连接Mysql数据库,并添加图片信息\n \t$connect = mysql_connect('localhost', 'root', 'root');\n \tmysql_select_db('wxdb', $connect);\n \tmysql_query('SET NAMES UTF8');\n \t$media_path = \"./uploadimage/\". $image_file_name;\n \t$sql = \"INSERT INTO keep_image_uploads (id, openid, media_id, media_path) VALUES(NULL, '{$fromUsername}', '{$media_id}', '{$media_path}')\";\n \tmysql_query($sql, $connect);\n \tbreak;\n\t\t\t\t\t\t//处理用户上传语言的业务逻辑\n \tcase 'voice':\n \t$media_id = $postObj->MediaId;\n \t$resultStr = sprintf($tmp_arr['voice'], $fromUsername, $toUsername, $time, $media_id);\n \techo $resultStr;\n \tbreak;\n\t\t\t\t\t\t//处理用户上传的地理位置信息\n \tcase 'location':\n\t\t\t\t\t\t//获取到用户上传的经度\n \t$Location_Y = $postObj->Location_Y;\n\t\t\t\t\t\t//获取上传的纬度\n \t$Location_X = $postObj->Location_X;\n \t$contentStr = \"您上报的地理位置是: \\n\\n 经度是 {$Location_Y} \\n 纬度是{$Location_X}\";\n \t$resultStr = sprintf($tmp_arr['text'], $fromUsername, $toUsername, $time, $contentStr);\n \techo $resultStr;\n \tbreak;\n\t\t\t\t\t\t//处理用户发送的链接消息\n \tcase 'link':\n\t\t\t\t\t\t//获取到用户上传的链接信息\n \t$Title = $postObj->Title;\n \t$Url = $postObj->Url;\n \t$contentStr = \"<a href='{$Url}'>{$Title}</a>\";\n \t$resultStr = sprintf($tmp_arr['text'], $fromUsername, $toUsername, $time, $contentStr);\n \techo $resultStr;\n \tbreak;\n\t\t\t\t\t//default:\n }\n }else {\n \techo \"\";\n \texit;\n }\n }",
"function azureSendRequest(&$results)\n {\n $body_message = '{ \"documents\" : [';\n foreach ($results as $index => $result) {\n $message = $result['text'];\n $message = str_replace('\"', \"'\", $message);\n $id = $index + 1;\n $body_message .= '{ \"language\": \"en\", \n \"id\": ' . $id . ',\n \"text\": \"' . $message . '\"},';\n }\n $body_message .= \"]}\";\n\n // Azure API key from DB\n $key = AzureApiKey::where('name', 'key1')->first();\n\n /*Creating a request*/\n $client = new Client(); //GuzzleHttp\\Client\n $res = null;\n try {\n $res = $client->request('POST',\n 'https://westcentralus.api.cognitive.microsoft.com/text/analytics/v2.0/sentiment', [\n 'headers' => [\n 'content-type' => 'application/json',\n 'Ocp-Apim-Subscription-Key' => $key->key\n ],\n 'body' => $body_message\n ]);\n } catch (\\Exception $e) {\n // How can I get the response body?\n return false;\n }\n\n /*Response returned*/\n $json = \"\";\n if ($res->getStatusCode() == 200) {\n $json = $res->getBody();\n }\n\n /* Parsing results and incrementing a sentiment counter*/\n $return = json_decode($json, true);\n\n return $return;\n }",
"public function answer ( )\n\t{\n\t\t$output_options = array(\n \"encoding\" => \"utf-8\"\n );\n\t\treturn str_replace( \"&#\", \"&#\", xmlrpc_server_call_method( $this->sh, file_get_contents( 'php://input'), NULL, $output_options ) );\n\t\t\n\t}",
"public function toTalk(): string;",
"public function phrases()\n {\n $group_id = ee()->input->get('group_id') ? ee()->input->get('group_id') : ee()->publisher_phrase->get_first_group();\n\n $vars = ee()->publisher_helper_cp->get_phrase_vars($group_id);\n\n $vars = ee()->publisher_helper_cp->prep_phrase_vars($vars);\n\n return ee()->load->view('phrase/index', $vars, TRUE);\n }",
"public function actionVoice()\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('voice',[\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 }",
"function getResponse($command) {\n\n $response['coin'] = \"As a reputable exchange, the Binance team will not share our views on individual coins. \"\n .\"However, you are welcome to discuss various coins in our group amongst the rest of the community.\";\n\n $response['list'] = \"If you would like to suggest a coin for listing on Binance, please ask the core team to \"\n .\"[fill out our application form](https://goo.gl/forms/rm4JuOPOxYq2xGTQ2).\\n\\n\"\n .\"Binance does not disclose coin listing information until an official announcement has been made. You may \"\n .\"join our announcements channel for the latest news \"\n .\"([@binance_announcements](https://t.me/binance_announcements)).\\n\\n\"\n .\"Additionally, if a project has announced listing on Binance prior to an official Binance announcement, \"\n .\"they are at risk of disqualification.\";\n\n $response['app'] = \"The Binance mobile application is available for Android and iOS using the following \"\n .\"links:\\n\\n\"\n .\"*Android*: https://ftp.binance.com/pack/Binance.apk\\n\"\n .\"*iOS*: https://fir.im/binance \"\n .\"([Installation Guide](https://support.binance.com/hc/en-us/articles/115001507811))\\n\\n\"\n .\"If you have previously installed the application, please make sure it is uninstalled before attempting to \"\n .\"install again.\";\n\n $response['feature'] = \"Thank you for the suggestion! We would appreciate it if you would write an e-mail to \"\n .\"[email protected] outlining your feature request. Please be as detailed as possible. If it is deemed \"\n .\"valuable enough, you may even receive a neat prize from the team!\";\n\n $response['plan'] = \"Typically, Binance does not disclose future plans. There are a few reasons for this:\\n\\n\"\n .\"1) We do not want to be accused of encouraging price manipulation.\\n\\n\"\n .\"2) We want to avoid providing vital information to our competitors.\\n\\n\" \n .\"3) Our plans are subject to change at any time. There are always new features and improvements in the \"\n .\"pipeline, and as a result, priorities may shift.\";\n\n $response['slow'] = \"If your deposit or withdrawal is processing slowly, please check if you have received a \"\n .\"Transaction ID (TxID). If you have, you will need to monitor the status of your transaction on the \"\n .\"relevant blockchain.\\n\\n\"\n .\"For Bitcoin (BTC), the network is often congested. You may check your transaction status on the Bitcoin \"\n .\"blockchain at [Satoshi.info](http://statoshi.info/dashboard/db/memory-pool) or \"\n .\"[Blockchain.info](https://blockchain.info/unconfirmed-transactions).\\n\\n\"\n .\"For Ethereum (ETH), the network can get quite busy during large ICOs. You are able to check the status of \"\n .\"a transaction on the Ethereum blockchain at [Etherscan.io](https://etherscan.io/txs).\\n\\n\"\n .\"If you have received numerous confirmations with no update to your balance, please *privately* send us \"\n .\"your Binance e-mail and TxID so that we may investigate further.\";\n\n $response['angel'] = \"Binance Angels are volunteers from within our community that donate their own time and \"\n .\"energy to supporting our platform in various ways, primarily assisting our userbase with questions and \"\n .\"concerns.\\n\\n\"\n .\"For more information, and details regarding how to apply to become a Binance Angel, please read our \"\n .\"announcement: [Calling for Binance Angels](https://support.binance.com/hc/en-us/articles/115000483751).\";\n\n $response['login'] = \"If for some reason you're unable to log in, please attempt the following:\\n\\n\"\n .\"1) Utilize our alternate login page: \"\n .\"[https://www.binance.com/hw_login.html](https://www.binance.com/hw_login.html)\\n\\n\"\n .\"2) Clear your browser cache and cookies. If issues persist, temporarily disable any browser extensions you \"\n .\"may have installed, especially script or ad blockers, or attempt logging in with another browser.\\n\\n\"\n .\"3) Update your DNS servers to Google's (Primary: `8.8.8.8`, Secondary: `8.8.4.4`). As a last resort, you \"\n .\"should attempt to log in with another device. If you are still unable, it may be an issue with your \"\n .\"network. If you are connected to a home or Wi-Fi network, attempt using mobile data (or vice-versa).\\n\\n\"\n .\"If none of the above steps were successful, please \"\n .\"[open a support ticket](https://support.binance.com/hc/en-us/requests/new) and/or *private message* your \"\n .\"Binance e-mail to customer service. Our IT department will look into it as soon as possible.\";\n\n $response['2fa'] = \"To reset your Two-Factor Authentication, please [open a support ticket](\"\n .\"https://support.binance.com/hc/en-us/requests/new).\\n\\n\"\n .\"*Note*: If you have assets in your account, for your own security, you will be unable to withdraw for a \"\n .\"period of 48 hours after two-factor authentication has been reset.\";\n\n $response['burn'] = \"Every quarter, Binance will use 20% of its profits to buy back and burn/destroy BNB \"\n .\"until 50% of the total supply has been depleted. Eventually, only a total of 100,000,000 BNB will \"\n .\"remain.\\n\\n\"\n .\"All related transactions will be completed on the blockchain, available for public view.\";\n\n $response['fork'] = \"Binance is preparing for the upcoming potential Bitcoin fork with the following \"\n .\" procedures:\\n\\n\"\n .\"1) Before the potential fork, we may momentarily suspend Bitcoin deposits and withdrawals.\\n\\n\"\n .\"2) If the fork occurs, Binance would like to support any meaningful forks. Our priority is to protect \"\n .\"our customer's funds, and we will evaluate the coin listing depending on the situation.\\n\\n\"\n .\"3) If you are unsure how to handle the technical aspects surrounding the bitcoin fork, feel free to \"\n .\"deposit your Bitcoin on the Binance exchange in advance and we will handle it for you. We will ensure \"\n .\"that you have all possible assets after the fork.\";\n\n $response['commands'] = \"*List of Commands*:\\n\"\n .\"/burn = Buyback & Burn Information\\n\"\n .\"/2fa = Resetting Two-Factor Authentication\\n\"\n .\"/login = Assistance with Login Issues\\n\"\n .\"/angel = Binance Angel Details & Application\\n\"\n .\"/slow = Guidance for Slow Deposits/Withdrawals\\n\"\n .\"/plan = Inquiries for Future Binance Plans\\n\"\n .\"/feature = Procedure for Feature Suggestions\\n\"\n .\"/app = Mobile App Details & Links\\n\"\n .\"/coin = Staff Opinions on Specific Coins\\n\"\n .\"/list = Procedures for Listing a Coin\\n\"\n .\"/fork = Information Regarding the Bitcoin Fork\";\n\n return ( $response[$command] ) ? $response[$command] : \"Error: Response undefined for command.\";\n }",
"public static function sentence()\n {\n\n # Determine the number of comma-separated sections and number of words in\n # each section for this sentence.\n\n for ($section_count = mt_rand(1, 5); $section_count; --$section_count)\n {\n foreach (array_rand(static::$words, mt_rand(3, 12)) as $key)\n {\n $section[] = static::$words[$key];\n }\n $sentence[] = implode($section, ' ');\n }\n # Convert to sentence case and add end punctuation.\n return ucfirst(implode($sentence, ', ')) . (mt_rand(0, 1) ? '.' : '?');\n }",
"public function sendResult()\n\t{\n\t\theader('Content-Type: application/json');\n\t\tif ($this->responseDataType == 'json') {\n\t\t\techo json_encode($this->emojiArray);\n\t\t} else {\n\t\t\techo \"{$this->responseCallback}(\" . json_encode($this->emojiArray) . ')';\n\t\t}\n\t\texit;\n\t}",
"public function getTextReport() {\n \n $r = '';\n \n // date and POST url\n for ($i=0; $i<80; $i++) { $r .= '-'; }\n $r .= \"\\n[\".date('m/d/Y g:i A').'] - '.$this->getPostUri();\n if ($this->use_curl) $r .= \" (curl)\\n\";\n else $r .= \" (fsockopen)\\n\";\n \n // HTTP Response\n for ($i=0; $i<80; $i++) { $r .= '-'; }\n $r .= \"\\n{$this->getResponse()}\\n\";\n \n // POST vars\n for ($i=0; $i<80; $i++) { $r .= '-'; }\n $r .= \"\\n\";\n \n foreach ($this->post_data as $key => $value) {\n $r .= str_pad($key, 25).\"$value\\n\";\n }\n $r .= \"\\n\\n\";\n \n return $r;\n }",
"public function getTextReport() {\n \n $r = '';\n \n // date and POST url\n for ($i=0; $i<80; $i++) { $r .= '-'; }\n $r .= \"\\n[\".date('m/d/Y g:i A').'] - '.$this->getPostUri();\n if ($this->use_curl) $r .= \" (curl)\\n\";\n else $r .= \" (fsockopen)\\n\";\n \n // HTTP Response\n for ($i=0; $i<80; $i++) { $r .= '-'; }\n $r .= \"\\n{$this->getResponse()}\\n\";\n \n // POST vars\n for ($i=0; $i<80; $i++) { $r .= '-'; }\n $r .= \"\\n\";\n \n foreach ($this->post_data as $key => $value) {\n $r .= str_pad($key, 25).\"$value\\n\";\n }\n $r .= \"\\n\\n\";\n \n return $r;\n }",
"protected function construct_response()\n {\n $this->feedback['ok'] = $this->ok;\n $this->feedback['code'] = $this->code;\n $this->feedback['resource'] = $this->resource;\n }",
"public static function run($speech = null)\n\t{\n\t\tif ( ! isset($speech))\n\t\t{\n\t\t\t$speech = 'KILL ALL HUMANS!';\n\t\t}\n\n\t\t$eye = \\Cli::color(\"*\", 'red');\n\n\t\treturn \\Cli::color(\"\n\t\t\t\t\t\\\"{$speech}\\\"\n\t\t\t _____ /\n\t\t\t /_____\\\\\", 'blue').\"\\n\"\n.\\Cli::color(\"\t\t\t ____[\\\\\", 'blue').$eye.\\Cli::color('---', 'blue').$eye.\\Cli::color('/]____', 'blue').\"\\n\"\n.\\Cli::color(\"\t\t\t /\\\\ #\\\\ \\\\_____/ /# /\\\\\n\t\t\t / \\\\# \\\\_.---._/ #/ \\\\\n\t\t\t / /|\\\\ | | /|\\\\ \\\\\n\t\t\t/___/ | | | | | | \\\\___\\\\\n\t\t\t| | | | |---| | | | |\n\t\t\t|__| \\\\_| |_#_| |_/ |__|\n\t\t\t//\\\\\\\\ <\\\\ _//^\\\\\\\\_ /> //\\\\\\\\\n\t\t\t\\\\||/ |\\\\//// \\\\\\\\\\\\\\\\/| \\\\||/\n\t\t\t | | | |\n\t\t\t |---| |---|\n\t\t\t |---| |---|\n\t\t\t | | | |\n\t\t\t |___| |___|\n\t\t\t / \\\\ / \\\\\n\t\t\t |_____| |_____|\n\t\t\t |HHHHH| |HHHHH|\", 'blue');\n\t}",
"function makeTXT()\n {\n $calendar_text = \"No calendar information available.\";\n if (isset($this->calendar->events)) {\n $calendar_text = \"\";\n foreach ($this->calendar->events as $event) {\n $description_seperator = \" - \";\n $description = \"description\";\n if ($this->description_flag != \"on\") {\n $description_seperator = \"\";\n $description = \"\";\n }\n\n $t =\n $this->textCalendar($event, [\n \"timestamp Y-m-d H:i\",\n \" \",\n // 'timezone',\n // ' ',\n \"summary\",\n \" [\",\n \"runtime\",\n \"]\",\n $description_seperator,\n $description,\n ]) . \"\\n\";\n\n $calendar_text .= $t;\n }\n }\n\n $txt =\n \"CALENDAR \" .\n $this->time_zone .\n \"\\n\\n\" .\n $calendar_text .\n \"\\n\\n\" .\n $this->response;\n\n $this->txt = $txt;\n $this->thing_report[\"txt\"] = $txt;\n }",
"public function sendtwiml() {\n // Step 5: Loop over all our friends. $number is a phone number above, and \n // $name is the name next to it\n //$response = new Twiml();\n $this->btwiml->sms('The king stay the king.', ['from' => '+14105551234',\n 'to' => '+917987050092']);\n\n print_r($this->btwiml);\n }",
"function send_response($sess_id)\n {\n\t\tglobal $ilconfig, $ilance;\n\t\t$server = 'www.platnosci.pl';\n\t\t$server_script = '/paygw/UTF/Payment/get';\n\t\t$key1 = trim($ilconfig['platnosci_pos_key1']);\n\t\t$ts = time();\n\t\t$sig = md5($ilconfig['platnosci_pos_id'] . $sess_id . $ts . $key1);\t\t\n\t\t$parameters = \"pos_id=\" . trim($ilconfig['platnosci_pos_id']) . \"&session_id=\" . $sess_id . \"&ts=\" . $ts . \"&sig=\" . $sig;\t\t\t\n\t\t$fsocket = false;\n\t\t$curl = false;\n\t\t$result = false;\n\t\tif ((PHP_VERSION >= 4.3) AND ($fp = @fsockopen('ssl://' . $server, 443, $errno, $errstr, 30))) \n\t\t{\n\t\t\t$fsocket = true;\n\t\t} \n\t\telse if (function_exists('curl_exec')) \n\t\t{\n\t\t\t$curl = true;\n\t\t}\n\t\tif ($fsocket == true) \n\t\t{\n\t\t\t$header = 'POST ' . $server_script . ' HTTP/1.0' . \"\\r\\n\" .\n'Host: ' . $server . \"\\r\\n\" .\n'Content-Type: application/x-www-form-urlencoded' . \"\\r\\n\" .\n'Content-Length: ' . strlen($parameters) . \"\\r\\n\" .\n'Connection: close' . \"\\r\\n\\r\\n\";\n\t\t\t@fputs($fp, $header . $parameters);\n\t\t\t$platnosci_response = '';\n\t\t\twhile (!@feof($fp)) \n\t\t\t{\n\t\t\t\t$res = @fgets($fp, 1024);\n\t\t\t\t$platnosci_response .= $res;\n\t\t\t}\n\t\t\t@fclose($fp);\n\t\t}\n\t\telse if ($curl == true) \n\t\t{\n\t\t\t$ch = curl_init();\n\t\t\tcurl_setopt($ch, CURLOPT_URL, \"https://\" . $server . $server_script);\n\t\t\tcurl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE);\n\t\t\tcurl_setopt($ch, CURLOPT_HEADER, 0);\n\t\t\tcurl_setopt($ch, CURLOPT_TIMEOUT, 20);\n\t\t\tcurl_setopt($ch, CURLOPT_POST, 1);\n\t\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, $parameters);\n\t\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\t\t$platnosci_response = curl_exec($ch);\n\t\t\tcurl_close($ch);\n\t\t} \n\t\telse \n\t\t{\n\t\t\tdie(\"ERROR: No connect method ...\\n\");\n\t\t}\n\t\tif (eregi(\"<trans>.*<pos_id>([0-9]*)</pos_id>.*<session_id>(.*)</session_id>.*<order_id>(.*)</order_id>.*<amount>([0-9]*)</amount>.*<status>([0-9]*)</status>.*<desc>(.*)</desc>.*<ts>([0-9]*)</ts>.*<sig>([a-z0-9]*)</sig>.*</trans>\", $platnosci_response, $parts)) \n\t\t{\n\t\t\t$result = $this->get_status($parts);\n\t\t\t$pos_id = $parts[1];\n\t\t\t$session_id = $parts[2];\n\t\t\t$order_id = $parts[3];\n\t\t\t$amount = $parts[4];\n\t\t\t$status = $parts[5];\n\t\t\t$desc = $parts[6];\n\t\t\t$ts = $parts[7];\n\t\t\t$sig = $parts[8];\n\t\t\t$this->response = $parts;\n\t\t\treturn $this->response;\n\t\t}\n\t\telse \n\t\t{\n\t\t\treturn array('5' => '888');\n\t\t}\n }",
"private function createInitialHelpResponse(): Response\n {\n $commands = collect(config('services.discord.global_commands'));\n\n $responseText = $commands->map(function($command){\n $formatted = \"/{$command['name']}\\n\";\n\n foreach($command['options'] as $option) {\n $formatted .= self::formatOption($option);\n }\n\n return $formatted;\n })->join(\"\\n\");\n\n return Response::make($this->codeBlock($responseText))\n ->ephemeral();\n }",
"public function speak(Collection $words)\n {\n $word = ucfirst($words->random()) . '!';\n\n if ($this->strong) {\n $word = '<strong>' . $word . '</strong>';\n }\n\n return $word;\n }",
"protected function _answer($text)\n {\n $this->_registry->getResponse()\n ->appendContent($text);\n }",
"public function toneDetection($data) {\n $parameters=array(\n 'data'=>$data \n );\n $content = json_encode($parameters);\n \n $jsonreply=$this->CallWebService('getTone',$content);\n \n return $this->ParseReply($jsonreply);\n }",
"function send_sms_response($user_number, $message)\n {\n try \n {\n $myNew_value=null;\n $raw_number ='';//count($striped_num)\n if(strlen($user_number) == 10)\n { //convert your string into array\n $array_num = str_split($user_number);\n\n for($i = 1; $i <count($array_num) ; $i++)\n { \n $myNew_value .= $array_num[$i];\n }\n \n $raw_number = '233'. $myNew_value;\n\n }else\n {\n $raw_number = $user_number; \n }\n \n $msisdn = $raw_number;\n $message = urlencode($message);\n $url = \"\";\n $curl = curl_init();\n curl_setopt_array($curl, array(\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_URL => $url\n ));\n \n $result = curl_exec($curl);\n $error = curl_error($curl);\n\n if ($error) {\n echo \"There was an: \". $error;\n } else{\n //var_dump($result);\n }\n // echo json_encode($result);\n curl_close($curl);\n return $result;\n\n }catch (Exception $exc) \n {\n \n }\n }",
"function targoman($text)\n{\n if (empty(trim($text))) {\n return null;\n }\n $ch = curl_init('https://targoman.ir/API/');\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($ch, CURLOPT_POST, true);\n curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);\n curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);\n curl_setopt($ch, CURLOPT_POSTFIELDS, '{\"jsonrpc\":\"2.0\",\"method\":\"Targoman::translate\",\"id\":1,\"params\":[\"sSTargomanWUI\",\"'.$text.'\",\"en2fa\",\"127.0.0.10\",\"NMT\",true,true,true]}');\n $response = curl_exec($ch);\n curl_close($ch);\n $response = json_decode($response, true);\n if (isset($response['result']['tr']['base'][0][1])) {\n return $response['result']['tr']['base'][0][1];\n }\n\n return null;\n}",
"function showPhrases($id, $name){\n\trequire('items.php');\n\n\t// check for empty parameters\n\tif ( ($name == '') || (!isset($name)) ) {\n\t\treturn error(\"partial\");\n\t}\n\n\tif ( $id == 100 ) {\n\t\treturn error(\"not_found\");\n\t}\n\n\t// place all validation code here\n\tif ( ($id < 0) || ($id > 4) ){\n\t\treturn error('bounds');\n\t}\n\n\t// Check the name for swear words\n\tif ( strtolower($name) == 'ass'){\n\t\treturn error('custom', '', 'Please do not use drunken sailor language when using the webservice.');\n\t}\n\n\t// replace all the needles with the name\n\t$phrase = preg_replace(\"/NnnnnnnnnN/\", $name, $phrases[$id]);\n\t$fin_data['status'] = array('status'=>'ok','message'=>'');\n\t$fin_data['phrase'] = $phrase;\n\n\treturn $fin_data;\n}"
] | [
"0.6167869",
"0.60034186",
"0.5984724",
"0.5900365",
"0.5865474",
"0.58422834",
"0.57967716",
"0.57681406",
"0.5625163",
"0.56102175",
"0.5600672",
"0.55773574",
"0.55527693",
"0.5546909",
"0.54965687",
"0.5491957",
"0.54363227",
"0.54267955",
"0.54080623",
"0.5381778",
"0.53810954",
"0.53758323",
"0.53382415",
"0.53366023",
"0.53229606",
"0.52935433",
"0.5270632",
"0.52594155",
"0.52543604",
"0.5245692",
"0.52433425",
"0.52113634",
"0.52101153",
"0.5208741",
"0.5201365",
"0.51837236",
"0.5176787",
"0.51755816",
"0.5172724",
"0.5164463",
"0.5158651",
"0.5149346",
"0.5145855",
"0.5144805",
"0.51292783",
"0.50982434",
"0.5085734",
"0.5084474",
"0.50803757",
"0.5078704",
"0.50708264",
"0.50645757",
"0.5052855",
"0.5050901",
"0.5037998",
"0.50293875",
"0.501843",
"0.50140226",
"0.5001891",
"0.49874863",
"0.49845436",
"0.49755302",
"0.4969351",
"0.4963993",
"0.49558714",
"0.4951603",
"0.4944005",
"0.4941222",
"0.4934183",
"0.49326652",
"0.4922323",
"0.49165398",
"0.49157482",
"0.49103335",
"0.4896467",
"0.487872",
"0.48769245",
"0.48732948",
"0.48685876",
"0.4861037",
"0.4855104",
"0.48509717",
"0.4846695",
"0.48458582",
"0.48397747",
"0.48352346",
"0.48310405",
"0.48310405",
"0.48246986",
"0.48243693",
"0.482267",
"0.48113698",
"0.48036462",
"0.48026967",
"0.47931758",
"0.47888044",
"0.4777956",
"0.47768533",
"0.47741878",
"0.4766514"
] | 0.5609711 | 10 |
Build a response in array form | protected function respond($type, array $response)
{
return [
'version' => $this->config['application_version'],
'sessionAttributes' => $this->session->getAttributes(),
'response' => [
$type => $response,
'shouldEndSession' => $this->session->expiring(),
],
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function toArray() {\r\n \treturn array(\"response\"=>$this->_response);\r\n }",
"public function response(): array\n {\n return [\n 'error' => $this->hasError(),\n 'exists' => $this->exists(),\n 'code' => $this->code,\n 'data' => $this->data,\n 'awb' => $this->awb,\n 'status' => $this->status,\n 'updateOn' => $this->updateOn,\n 'message' => $this->message,\n ];\n }",
"public function getResponseArray() {\n return [\n 'error' => $this->error,\n 'code' => $this->code,\n 'msg' => $this->msg\n ];\n }",
"public function toArray() {\n\t\treturn $this->response;\n\t}",
"public function getResponse() : array;",
"public function getResponse(): array;",
"public function toArray()\n {\n return $this->response;\n }",
"public function toArray()\n {\n return $this->response;\n }",
"public function toArray()\n {\n return $this->response;\n }",
"public function toArray()\n {\n return $this->response;\n }",
"public function toArray()\n {\n return $this->response;\n }",
"public function toArray()\n {\n return $this->response;\n }",
"public function toArray()\n {\n return $this->response;\n }",
"public function getResponseData(): array\n {\n $this->build();\n\n return $this->responseData;\n }",
"public function toResponse()\n\t{\n\t\treturn $this->toArray();\n\t}",
"private function getResponseStructure(){\n $success = [];\n if($this->success == false){\n //WE have to show the error\n $success = [];\n $success[\"success\"] = $this->success;\n $success[\"error_code\"] = $this -> error_code;\n $success[\"error_msg\"] = $this -> error_message;\n }else{\n\n $success = [];\n $success[\"success\"] = $this->success;\n if($this->total_elements > 0){\n $success[\"total_elements\"] = $this->total_elements;\n }\n $success[$this->data_root] = $this->data;\n }\n return $success;\n }",
"private function createResponse(){\r\n #scraping metatag to get IMAGE TITLE and FULL PATH INC FILE NAME \r\n $metaTag = get_meta_tags($this->url);\r\n\r\n \r\n $this->setImageTitle($metaTag[\"sailthru_title\"]); #setting up title\r\n $this->setFileName($metaTag[\"sailthru_image_full\"]); #setting up full file name\r\n $this->setDimensions(); #setting up image dimensions\r\n \r\n $this->setFileSize(); #setting up file size in kB\r\n \r\n #create response array based on properties\r\n $array = array('title' => $this->imageTitle,\r\n 'dimensions' => $this->imageDimensions,\r\n 'filename' => $this->getPlainFileName(),\r\n 'file size in kB' => $this->fileSize\r\n );\r\n \r\n return $array;\r\n }",
"protected function asArray()\n\t{\n\t\treturn \\json_decode($this->response, true);\n\t}",
"public function modelResponse(): array\n {\n return [\n 'id' => $this->id,\n 'name' => $this->name,\n 'menu_id' => $this->menu_id,\n 'menu_products' => MenuProductResource::collection($this->menuProducts)\n ];\n }",
"public function toArray()\n {\n $this->messages($this->messages);\n $this->userAttributes($this->user_attributes);\n\n $response = [\n 'messages' => $this->messages\n ];\n\n if( $this->user_attributes != null && \n count($this->user_attributes) > 0 ) {\n $response['set_attributes'] = $this->user_attributes;\n }\n\n return $response;\n }",
"public static function getHmpoResponseArray()\n {\n return self::getAll(true);\n }",
"public function getArrayResp()\n {\n return json_decode(Yii::$app->request->post(), false);\n }",
"public function jsonSerialize(): array\n {\n Response::jsonField('name', $this->getName());\n Response::jsonField('in', $this->getIn());\n Response::jsonField('description', $this->getDescription());\n Response::jsonField('required', $this->isRequired());\n Response::jsonField('type', $this->getType());\n Response::jsonField('format', $this->getFormat());\n Response::jsonField('allowEmptyValue', $this->isAllowEmptyValue());\n Response::jsonField('collectionFormat', $this->getCollectionFormat());\n Response::jsonField('items', $this->getItems());\n Response::jsonField('schema', $this->getSchema());\n\n return Response::jsonSerialize($this);\n }",
"public function build()\n {\n $this->responseData = [\n 'data' => $this->getData(),\n 'meta' => $this->getMeta(),\n 'links' => $this->getLinks(),\n ];\n }",
"public function toArray()\n {\n return [\n 'code' => $this->code,\n 'result' => $this->result ? 0 : -1,\n 'data' => $this->data,\n ];\n }",
"private function getResponseData()\n {\n $response = Shopware()->Front()->Response();\n\n return array(\n 'Class' => get_class($response),\n 'Raw header' => $response->getRawHeaders(),\n 'Response code' => $response->getHttpResponseCode(),\n 'Exception' => $response->getException()\n );\n }",
"public function toArray(): array\n {\n $this->buildResponse();\n\n return json_decode($this->response->getBody()->getContents(), true);\n }",
"public function toLoguxResponse() : array\n {\n // Handle internal server error\n if (isset($this->_log['error'])) {\n return [[\n 'answer' => 'error',\n 'details' => $this->_log['error'],\n 'id' => $this->getId()\n ]];\n }\n\n $response = [];\n if ($this->_recepients) {\n $response[] = array_merge([\n 'answer' => 'resend',\n 'id' => $this->getId()\n ], $this->_recepients);\n }\n\n $response = array_merge($response, array_map(function ($logType) {\n return [\n 'answer' => $logType,\n 'id' => $this->getId()\n ];\n }, $this->_log));\n\n return $response;\n }",
"public function getVerboseResponse() \n {\n $this->execute();\n \n if ($this->error) {\n return $this->error;\n }\n \n $contentType = $this->getContentType();\n \n $body = ($this->def['dataType'] == 'array' || strpos($contentType, 'json') !== false) ? static::data2json($this->responseText) : $this->responseText;\n \n return [\n 'status' => $this->status,\n 'body' => $body, \n 'info' => $this->responseInfo,\n 'header' => $this->responseHeaders,\n 'request_header' => $this->getRequestHeaders(),\n 'content_type' => $contentType\n ];\n }",
"protected function build_response($res, $options = []){\n\n if(!$res) {\n return [];\n }\n\n $details = [];\n if(in_array('detail', $options)) {\n $details = [\n 'content' => $res->content,\n 'status' => $res->status\n ];\n }\n\n if(in_array('public_status', $options)) {\n\n if(isset($res->started_at) && $res->started_at > business_date('Y-m-d H:i:s')) {\n $details['public_status'] = 'before_published';\n }\n\n if($res->started_at <= business_date('Y-m-d H:i:s') && (business_date('Y-m-d H:i:s') <= $res->ended_at || $res->ended_at == null)) {\n $details['public_status'] = 'available';\n }\n\n if(isset($res->ended_at) && business_date('Y-m-d H:i:s') > $res->ended_at) {\n $details['public_status'] = 'expired';\n }\n }\n\n return array_merge([\n 'id' => isset($res->id) ? (int) $res->id : NULL,\n 'title' => $res->title,\n 'created_at' => $res->created_at,\n 'started_at' => $res->started_at,\n 'ended_at' => $res->ended_at\n ], $details);\n }",
"public function modelResponse(): array\n {\n return [\n 'id' => $this->id,\n 'name' => $this->name,\n 'image' => $this->image,\n 'longitude' => $this->longitude,\n 'latitude' => $this->latitude,\n 'place_type_id' => $this->place_type_id,\n 'information' => PlaceInformationResource::collection($this->placeInformation),\n 'place_type' => new PlaceTypeResource($this->placeType)\n ];\n }",
"private function compileSuccessResponseData(): array\r\n {\r\n $data = $this->getCalculatedAreaModel()->getAllData();\r\n $data['price'] = $this->fence->getPrice();\r\n $data['success'] = true;\r\n return $data;\r\n }",
"public function response()\n {\n $metadata = $this->metadata;\n $tmp = array();\n \n if ($this->showConfigRoot != false) {\n $tmp['root'] = $metadata['root'];\n $tmp['totalProperty'] = $metadata['totalProperty'];\n $tmp['successProperty'] = $metadata['successProperty'];\n $tmp['messageProperty'] = $metadata['messageProperty'];\n }\n \n $tmp[$metadata['root']] = (empty($this->data)) ? array() : $this->data;\n $tmp[$metadata['successProperty']] = $this->success;\n \n // if metadata Is String return as Raw else create new array\n if ($this->showMetaData != false)\n if ($metadata['onlyRaw'] === true) {\n $tmp['metaData'] = \"|1|2|3|4|5|...5|||\";\n } else {\n $tmp['metaData'] = $this->metadata;\n }\n $rawJson = json_encode($tmp);\n if ($metadata['onlyRaw'] === true) {\n return str_replace('\"|1|2|3|4|5|...5|||\"', $metadata['raw'], $rawJson);\n }\n \n return $rawJson;\n }",
"public function prepareResponse();",
"protected function getOutput(): array\n {\n return $this->successFactory->make($this->serializer, $this->data);\n }",
"public function toArray($request)\n {\n\n $response_message = null;\n $response_type = null;\n $code = null;\n\n if($this->soap_shipping_response){\n if($this->soap_shipping_response->sent){\n\n $response_message = $this->soap_shipping_response->description;\n $code = (int) $this->soap_shipping_response->code;\n\n if($code === 0) {\n $response_type = 'success';\n }elseif($code < 2000) {\n $response_type = 'error';\n }elseif ($code < 4000) {\n $response_type = 'error';\n } else {\n $response_type = 'warning';\n }\n \n }\n\n }\n\n return [\n 'id' => $this->id,\n 'number_full' => $this->number_full,\n 'state_type_id' => $this->state_type_id,\n 'supplier_email' => $this->supplier->email,\n 'response_message' => in_array($this->state_type_id, ['07', '09']) ? ($code ? \"{$code} - \" : '').\"{$response_message}\" : $response_message,\n 'response_type' => $response_type,\n 'download_cdr' => $this->download_external_cdr,\n ];\n \n }",
"private function make_response_array($response) {\n $myarray = array();\n $data = explode(\"\\n\", $response);\n if (strpos($data[0], 'HTTP') === 0) {\n // the first line is a status code\n $myarray['status'] = $data[0];\n array_shift($data);\n }\n foreach ($data as $part) {\n if (json_decode($part)) {\n $myarray[] = json_decode($part);\n continue;\n }\n $middle = explode(\": \", $part, 2);\n $myarray[trim($middle[0])] = trim($middle[1]);\n }\n return $myarray;\n }",
"public function toArray()\n\t{\n\t\t$response = $this->data;\n\n\t\t// Convert more data\n\t\tif (isset($response['player1'])) $response['player1'] = $response['player1']->toArray();\n\t\tif (isset($response['player2'])) $response['player2'] = $response['player2']->toArray();\n\t\tif (isset($response['winner'])) $response['winner'] = $response['winner']->toArray();\n\t\tif (isset($response['event'])) $response['event'] = $response['event']->toArray();\n\n\t\treturn $response;\n\t}",
"public function getResponseData(): array\n {\n $responseData = [\n 'success' => $this->isSuccessful(),\n 'data' => $this->data,\n ];\n\n if ($this->error && !$this->isSuccessful()) {\n $responseData['error'] = $this->getErrorData();\n }\n\n if ($this->message) {\n $responseData['message'] = $this->message;\n }\n\n if (!empty($this->meta)) {\n $responseData['meta'] = $this->meta;\n }\n\n $responseData += ($this->fields ?: []);\n\n return $responseData;\n }",
"public function toArray() {\n return array(\n 'success' => $this->success(),\n 'fields' => $this->fields()\n );\n }",
"private function _setReponseArray() {\n try {\n $this->RESP = array(\n 'MSG' => $this->MSG,\n 'STATUS' => $this->STATUS\n );\n } catch (Exception $ex) {\n throw new Exception('Crud Model : Error in _setReponseArray function - ' . $ex);\n }\n }",
"public function toArray($request)\n {\n $response_body = [\n 'id' => $this->id,\n 'last_name' => $this->last_name,\n 'middle_name' => $this->middle_name,\n 'first_name' => $this->first_name,\n 'alias' => $this->alias,\n 'gender' => $this->gender,\n 'birth_date' => $this->birth_date,\n ];\n\n return $response_body;\n }",
"public function toArray()\n {\n return [\n 'success' => $this->success,\n 'error' => !$this->success,\n 'message' => $this->message,\n ] + $this->data;\n }",
"private function createRequestsArray(){\n \n\t$doctorNames = $this->getDoctorNames();\n\t\n $requests = $this->getDatabaseRequests();\n\t\n\t$reqArray = array();\n\t\n\tforeach($requests as $req) {\n\t\tforeach($doctorNames as $doc) {\n\t\t\tif($doc[0] == $req[0]) {\n\t\t\t\t$dateFromRequest = strtotime($req[2]);\n\t\t\t\t$dateReq = date('Y-m-d',$dateFromRequest);\n\t\t\t\tif($req[1] == '0'){\n\t\t\t\t\t$color = \"#FF0000\";\n\t\t\t\t} else {\n\t\t\t\t\t$color = \"#00FF00\";\n\t\t\t\t}\n\t\t\t\t$request = array('title'=>\"$doc[1]\",'start'=>\"$dateReq\",'backgroundColor'=>\"$color\");\n\t\t\t\t$reqArray[] = $request;\n\t\t\t\tunset($request);\n\t\t\t}\n\t\t}\n\t}\n\t\n\t//$reqArray = array(array('title'=>'TEST','start'=>\"2013-04-04\",'backgroundColor'=>\"#FF0000\"),\n\t//array('title'=>'TEST2','start'=>\"2013-04-06\",'backgroundColor'=>\"#00FF00\"));\n\t\n\treturn $reqArray;\n}",
"public function respond() : array;",
"public function buildData()\n {\n $message = $this->getMessage();\n\n if ($this->data == []) {\n return [\n 'success' => false,\n 'message' => $message\n ];\n }\n\n return [\n 'success' => false,\n 'message' => $message,\n 'data' => (object) $this->data\n ];\n }",
"protected function initializeResultArray() {}",
"private function buildResponseArray($devices, $sensors, $projectName){\n $response = array(\"project\" => $projectName[0][\"name\"]);\n \n //Build the shopping list\n $devicesWithSensorsUncounted = $this->assignSensorsToDevices($devices, $sensors);\n // var_dump($devicesWithSensorsUncounted);\n $shoppingList = $this->collapseDuplicateShoppingListItems($devicesWithSensorsUncounted);\n \n //Add it to the response\n $response[\"shoppinglist\"] = $shoppingList;\n \n return $response;\n }",
"public function getResponse(){\n return [\n \"error\" => $this->getError(),\n \"message\" => $this->getMessage(),\n \"data\" => $this->getData()\n ];\n }",
"private function getJSON(){\n return json_encode($this->getResponseStructure());\n }",
"public function getResponseData();",
"public function jsonString(){\n return json_encode($this->createRequestsArray());\n }",
"private function apiGetBuild($data)\n {\n $output = array();\n for($i=0; $i<count($data); $i++){\n $output = array(\n\n );\n }\n\n return $output;\n }",
"public function toArray(): array\n {\n $body = (string) $this->response->getBody();\n\n return json_decode($body, true) ?? [];\n }",
"public function to_array()\r\n {\r\n $d = array();\r\n\r\n if (!empty($this->http_status_code)) {\r\n $d['@http_status_code'] = $this->http_status_code;\r\n }\r\n if (!empty($this->visible_sources)) {\r\n $d['@visible_sources'] = $this->visible_sources;\r\n }\r\n if (!empty($this->available_sources)) {\r\n $d['@available_sources'] = $this->available_sources;\r\n }\r\n if (!empty($this->search_id)) {\r\n $d['@search_id'] = $this->search_id;\r\n }\r\n if (!empty($this->persons_count)) {\r\n $d['@persons_count'] = $this->persons_count;\r\n }\r\n\r\n if (!empty($this->warnings)) {\r\n $d['warnings'] = $this->warnings;\r\n }\r\n if (!empty($this->query)) {\r\n $d['query'] = $this->query->to_array();\r\n }\r\n if (!empty($this->person)) {\r\n $d['person'] = $this->person->to_array();\r\n }\r\n if (!empty($this->possible_persons)) {\r\n $d['possible_persons'] = array();\r\n foreach ($this->possible_persons as $possible_person) {\r\n $d['possible_persons'][] = $possible_person->to_array();\r\n }\r\n }\r\n if (!empty($this->sources)) {\r\n $d['sources'] = array();\r\n foreach ($this->sources as $source) {\r\n $d['sources'][] = $source->to_array();\r\n }\r\n }\r\n\r\n if (!empty($this->available_data)) {\r\n $d['available_data'] = $this->available_data->to_array();\r\n }\r\n\r\n if (!empty($this->match_requirements)) {\r\n $d['match_requirements'] = $this->match_requirements;\r\n }\r\n\r\n return $d;\r\n }",
"public function response($as_assoc = false);",
"public function toArray(): array\n {\n $correspondences = [\n 'Accept-Patch' => 'acceptPatch',\n 'Accept-Ranges' => 'acceptRanges',\n 'Access-Control-Allow-Credentials' => 'allowCredentials',\n 'Access-Control-Allow-Headers' => 'allowHeaders',\n 'Access-Control-Allow-Methods' => 'allowMethods',\n 'Access-Control-Allow-Origin' => 'allowOrigin',\n 'Access-Control-Expose-Headers' => 'exposeHeaders',\n 'Access-Control-Max-Age' => 'maxAge',\n 'Allow' => 'allow',\n 'Cache-Control' => 'cacheControl',\n 'Clear-Site-Data' => 'clearSiteData',\n 'Content-Disposition' => 'contentDisposition',\n 'Content-Encoding' => 'contentEncoding',\n 'Content-Language' => 'contentLanguage',\n 'Content-Length' => 'contentLength',\n 'Content-Location' => 'contentLocation',\n 'Content-Range' => 'contentRange',\n 'Content-Type' => 'contentType',\n 'Cross-Origin-Resource-Policy' => 'crossOriginResourcePolicy',\n 'Digest' => 'digest',\n 'ETag' => 'etag',\n 'Expires' => 'expires',\n 'Last-Modified' => 'lastModified',\n 'Location' => 'location',\n 'Referrer-Policy' => 'referrerPolicy',\n 'Rentry-After' => 'rentryAfter',\n 'Source-Map' => 'sourceMap',\n 'Strict-Transport-Security' => 'strictTransportSecurity',\n 'Timing-Allow-Origin' => 'timingAllowOrigin',\n 'Tk' => 'tk',\n 'Trailer' => 'trailer',\n 'Transfer-Encoding' => 'transferEncoding',\n 'Vary' => 'vary',\n 'WWW-Authenticate' => 'wwwAuthenticate',\n 'X-Content-Type-Options' => 'xContentTypeOptions',\n 'X-DNS-Prefetch-Control' => 'xDNSPrefetchControl',\n 'X-Frame-Options' => 'xFrameOptions'\n ];\n\n $response = [];\n foreach ($correspondences as $header=>$field) {\n $value = $this->$field;\n if ($value) {\n if (is_object($value)) {\n $response[$header] = $value->toString();\n } elseif (is_array($value)) {\n if ($header == \"Clear-Site-Data\") {\n $response[$header] = \"\\\"\".implode(\"\\\", \\\"\", $value).\"\\\"\";\n } else {\n $response[$header] = implode(\", \", $value);\n }\n } else {\n $response[$header] = $value;\n }\n }\n }\n if ($this->customHeaders) {\n $response = array_merge($response, $this->customHeaders);\n }\n return $response;\n }",
"public function toJSON () {\r\n \treturn json_encode($this->_response);\r\n }",
"public function toArrayForApi()\n {\n $return = array();\n\n if ($this->getMeeting()) {\n $return['meeting_id'] = $this->getMeeting();\n }\n if ($this->getContact()) {\n $return['contact_id'] = $this->getContact();\n }\n\n return $return;\n }",
"public function toArray()\n {\n return array(\n \"httpGet\" => $this->httpGet,\n \"httpPost\" => $this->httpPost,\n \"formats\" => $this->formats\n );\n }",
"private function buildResponseArray($circuitBreakers, $fuses, $devices, $projectName){\n $response = array(\"project\" => $projectName[0][\"name\"]);\n \n //Build the plan\n $fusesWithDevices = $this->assignDevicesToFuses($fuses, $devices);\n $circuitplan = $this->assignFusesToCircuitBreakers($circuitBreakers, $fusesWithDevices); \n \n //Add it to the response\n $response[\"circuitplan\"] = $circuitplan;\n \n return $response;\n }",
"public function toArray(){\n $result = [];\n $result['id'] = $this->getId();\n $result['description'] = $this->getDescripcion();\n return $result;\n }",
"public static function getDecodedMutateResultWithArrayOfResults()\n {\n return [\n 'result' => [\n [\n 'FakeBudget' => [\n 'budgetId' => 1\n ]\n ],\n [\n 'FakeBudget' => [\n 'budgetId' => 2\n ]\n ]\n ]\n ];\n }",
"public function toArray() {\n return [\n 'content' => $this->content,\n 'status' => $this->status\n ];\n }",
"public function toArray(): array\n {\n return [\n 'success' => $this->success,\n 'status' => $this->status,\n 'data' => $this->data\n ];\n }",
"public function mapResponse(array $data = [])\n {\n return array_map(function ($item) {\n return [\n 'id' => $item['orderId'],\n 'symbol' => $item['symbol'],\n 'side' => strtolower($item['side']),\n 'type' => strtolower($item['type']),\n 'status' => strtolower($item['status']),\n 'price' => $item['price'],\n 'amount' => $item['origQty'],\n 'timestamp' => $item['time'],\n ];\n }, $data);\n }",
"public function build(): array;",
"public function build(): array;",
"protected function _createResponse($name, $data = array())\n\t{\n\t\treturn new ArrayResponse($name, $data);\n\t}",
"public function getTransformedCollection( ) {\n $response[\"data\"] = [];\n foreach ( (new static)->get() as $industry_object) {\n $response['data'][] = $industry_object->getBeforeStandard();\n }//foreach ( (new static)->get() as $industry_object)\n return $response;\n }",
"public function getResponse()\n\t{\n\t\treturn array($this->_code, join(\"\\n\", $this->_arguments));\n\t}",
"public function genera_respuesta($respuesta) \n {\n $array_resp=null;\n if (isset($respuesta)) {\n if (empty($respuesta)) {\n $array_resp= array(\n 'estado' => 'OK',\n 'datos_base' => $respuesta,\n 'filas' => '0'\n );\n } else { \n $array_resp= array(\n 'estado' => 'OK',\n 'datos_base' => $respuesta,\n 'filas' => count($respuesta)\n );\n }\n } else {\n $array_resp= array(\n 'estado' => 'ERROR',\n 'datos_base' => $respuesta,\n 'filas' => '0'\n );\n }\n return $array_resp;\n }",
"function toArray()\n {\n $ary = array('request' => $this->uri, 'type' => $this->_type);\n if ($this->_shortName) {\n $ary['shortname'] = $this->_shortName;\n }\n if ($this->_description) {\n $ary['description'] = $this->_description;\n }\n \n if (!isset($this->template)) {\n throw new RuntimeException('The search template has not been set!');\n }\n $ary['template'] = $this->template; \n if ($this->_developer) {\n $ary['developer'] = $this->_developer;\n }\n if ($this->contact) {\n $ary['contact'] = $this->contact;\n }\n \n if (count($this->tags) > 0) {\n $ary['tags'] = $this->tags;\n }\n if ($this->_longName) {\n $ary['longname'] = $this->_longName;\n }\n \n if (count($this->_image) > 0) {\n $ary['image'] = $this->_image;\n }\n \n if ($this->_attribution) {\n $ary['attribution'] = $this->_attribution;\n }\n \n if ($this->_syndicationRight) {\n $ary['syndicationright'] = $this->_syndicationRight;\n }\n if (isset($this->adultContent)) {\n $ary['adultcontent'] = $this->adultContent;\n }\n \n if (count($this->languages) > 0) {\n $ary['language'] = $this->languages;\n }\n if (count($this->inputEncodings) > 0) {\n $ary['inputencodings'] = $this->inputEncodings;\n }\n if (count($this->outputEncodings) > 0) {\n $ary['outputencodings'] = $this->outputEncodings;\n }\n \n if ($this->exampleQuery || count($this->_contextSets) > 0) {\n $ary['query'] = array();\n if ($this->exampleQuery) {\n $ary['query']['example'] = $this->exampleQuery;\n }\n foreach ($this->_contextSets as $c) {\n if (!$ary['query']['context-sets']) {\n $ary['query']['context-sets'] = array();\n }\n array_push($ary['query']['context-sets'], $c->toArray());\n }\n }\n return $ary;\n }",
"public function getArray() {\r\n \r\n $data = [\r\n \"id\" => $this->id,\r\n \"name\" => $this->name,\r\n \"description\" => $this->desc,\r\n \"url_file\" => $this->url_file,\r\n \"filename\" => $this->filename,\r\n \"filepath\" => $this->filepath,\r\n \"filesize\" => $this->filesize,\r\n \"mime\" => $this->mime,\r\n \"active\" => $this->active,\r\n \"approved\" => $this->approved,\r\n \"meta\" => $this->extra_data,\r\n \"date\" => $this->Date,\r\n \"author\" => $this->Author->getArray(),\r\n \"url\" => $this->url->getURLs(),\r\n \"thumbnail\" => $this->getThumbnail(),\r\n \"icon\" => $this->getIcon(),\r\n ];\r\n \r\n return $data;\r\n \r\n }",
"private function set_response_rows($result) { \n $rows = [];\n foreach ($result as $r) {\n $cell = [];\n foreach ($r as $column => $value) {\n $cell[] = call_user_func($this->format, $column, $value, $r);\n }\n\n $rows[] = [\n 'id' => $r->id,\n 'cell' => $cell\n ];\n }\n return $rows;\n }",
"public function __toArray() {\n\t\t\n\t\t// empty template\n\t\treturn array(\n\t\t\t'status' => 'ERROR',\n\t\t\t'data' => array(\n\t\t\t\t'statusCode' => $this->getStatusCode(),\n\t\t\t\t'exception' => get_class($this),\n\t\t\t\t'message' => $this->getMessage(),\n\t\t\t),\n\t\t);\n\t}",
"private function buildResponse(string $endpoint, bool $useOld): array\n {\n $apiResult = $this->callAPI($endpoint, $useOld);\n\n return [\n \"error\" => $apiResult === false,\n \"result\" => json_decode($apiResult, true)\n ];\n }",
"public function getInnerResponse();",
"public function jsonSerialize()\n {\n return [['id' => $this->id,\n 'users_id' => $this->users,\n 'result' => $this->result,\n 'time' => $this->time]\n\n ];\n }",
"private static function get_data($response)\r\n {\r\n $data = $response->resultList->result;\r\n\r\n $result = array();\r\n\r\n foreach($data as $row)\r\n {\r\n $result[] = array\r\n (\r\n 'pmid' => property_exists($row, \"pmid\") ? $row->pmid : \"\",\r\n 'doi' => property_exists($row, \"doi\") ? $row->doi : \"\",\r\n 'title' => property_exists($row, \"title\") ? $row->title : \"\",\r\n 'authors' => property_exists($row, \"authorString\") ? $row->authorString : \"\",\r\n 'journal' => property_exists($row, \"journalTitle\") ? $row->journalTitle : \"\",\r\n 'issue' => property_exists($row, \"issue\") ? $row->issue : '',\r\n 'volume' => property_exists($row, \"journalVolume\") ? $row->journalVolume : \"\",\r\n 'year' => property_exists($row, \"pubYear\") ? $row->pubYear : \"\",\r\n 'pages' => property_exists($row, \"pageInfo\") ? $row->pageInfo : '',\r\n 'citedByCount' => property_exists($row, \"citedByCount\") ? $row->citedByCount : \"\",\r\n 'publicatedDate' => property_exists($row, \"firstPublicationDate\") ? \r\n date('d-m-Y', strtotime($row->firstPublicationDate)) : \"\"\r\n );\r\n }\r\n\r\n return $result;\r\n }",
"public function toArray($request)\n {\n $countdowns = request('finished') == '1' ? $this->countdowns : Countdown::where('user_id',$this->id)->where('finished',0)->get();\n return [\n 'id' => $this->id,\n 'name' => $this->name, \n 'countdowns' => $countdowns,\n \n //'cards' => $this->cards, \n ];\n }",
"public function toArray()\n {\n return array_merge([\n 'driver' => $this->driver,\n 'content' => $this->content,\n 'from' => $this->from,\n 'to' => $this->to,\n 'type' => $this->type,\n 'client_reference' => $this->clientReference,\n ], $this->extra);\n }",
"public function toArray()\n {\n $data = array(\n 'id' => $this->getId(),\n 'status' => $this->getStatus(),\n 'title' => $this->field ? ($this->field->getAlertDescription() ? $this->field->getAlertDescription() : $this->field->getAlertTitle()) : '',\n 'alert_description' => $this->field ? ($this->field->getAlertDescription() ? $this->field->getAlertDescription() : $this->field->getAlertTitle()) : '',\n 'field' => $this->field ? $this->field->toArray() : null,\n 'vehicle' => $this->getVehicle()->toInfoArray(),\n 'user' => $this->check_list ? $this->check_list->getUser()->toInfoArray() : array(),\n 'description' => $this->getDescription(),\n 'images' => $this->getImages(),\n 'thumbnail' => $this->getThumbnail(),\n 'comments' => $this->getComments(),\n 'creation_date' => $this->getCreationDate()->getTimestamp(),\n 'update_date' => $this->getUpdateDate()->getTimestamp(),\n 'history' => $this->getHistory(),\n 'refreshed_times' => $this->getRefreshedTimes()\n );\n return $data;\n }",
"public function list() : array\n {\n $raw = $this->connection->get($this->url(self::ENDPOINT));\n $this->response = json_decode($raw, true);\n $this->triggerErrorIfAny();\n\n return $this->response;\n }",
"public function jsonSerialize()\n {\n return [\n 'respuestaSolucion' => [\n 'idRespuestaSolucion' => $this->getIdRespuestaSolucion(),\n 'respuesta' => $this->getRespuesta(),\n 'solucionesIdsoluciones' => $this->getIdSolucion(),\n 'usuariosId' => $this->getIdUsuario()\n ]\n ];\n }",
"private function buildRequest(): array\n {\n return [\n \"documentoResponsavelPagamento\" => $this->payerTaxId,\n \"numeroNotaFiscal\" => $this->invoiceNumber,\n \"numeroSerieNotaFiscal\" => $this->invoiceSeries,\n \"conhecimentoTransporteEletronico\" => $this->eBillOfLadingNumber,\n \"numeroSerieConhecimentoTransporteEletronico\" => $this->ebillsOfLadingeries,\n \"documentoDestinatario\" => $this->receiverTaxId,\n \"codigoFilialOrigem\" => $this->originBranch,\n \"dataInicial\" => $this->initialDate,\n \"dataFinal\" => $this->finalDate\n ];\n }",
"function createGridResponseData($code, $success, $message = '',$embedded = [], $entities = [],$pagination, Illuminate\\Http\\Request $request){\n\n $response = [];\n\n $response['status_code'] = $code;\n $response['success'] = $success;\n $response['message'] = $message;\n\n if($pagination){\n $response['pages'] = $pagination;\n }\n\n $response['embedded'] = $embedded;\n $response['entities'] = $entities;\n\n return $response;\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}",
"public function buildResponse($embedlyResponse);",
"public function build(): ListCardsResponse\n {\n return CoreHelper::clone($this->instance);\n }",
"public function build()\n {\n return [\n 'headers' => [\n 'Authorization' => 'Bearer ' . $this->token\n ]\n ];\n }",
"public function toArray() {\n return [\n 'dataId' => $this->dataId,\n 'voucher' => $this->voucher,\n 'nextTime' => $this->nextTime,\n 'simNumber' => $this->simNumber\n ];\n }",
"public function result()\n {\n $history = $this->getHistory();\n\n return $this->build([\n 'info' => [\n 'no_awb' => $this->response->TTKNO,\n 'service' => null,\n 'status' => $this->response->StatusTerakhir == 3 ? 'DELIVERED' : 'ON PROCESS',\n 'tanggal_kirim' => Utils::setDate(reset($this->response->data)->Tanggal),\n 'tanggal_terima' => $this->tanggalTerima,\n 'harga' => null,\n 'berat' => null, // gram\n 'catatan' => null,\n ],\n 'pengirim' => [\n 'nama' => trim(strtoupper(preg_replace('/\\s+/', ' ', $this->response->Pengirim))),\n 'phone' => null,\n 'alamat' => $this->kotaPengirim,\n ],\n 'penerima' => [\n 'nama' => trim(strtoupper(preg_replace('/\\s+/', ' ', $this->response->Penerima))),\n 'nama_penerima' => rtrim($this->namaPenerima),\n 'phone' => $this->response->NOTELP,\n 'alamat' => strtoupper($this->response->Alamatpenerima),\n ],\n 'history' => $history\n ]);\n }",
"public function toArray($request)\n {\n // return parent::toArray($request);\n return [\n 'id' => $this->ID,\n 'desc1' => $this->DESC1,\n 'desc2' => $this->DESC2,\n 'brCode' => $this->BR_CODE,\n 'trCode' => $this->TR_CODE,\n 'slcCode' => $this->SLC_CODE,\n 'sltCode' => $this->SLT_CODE,\n 'coaId' => $this->COAID,\n 'isLocked' => $this->IsLocked,\n 'isNewSlOnly' => $this->IsNEWSLOnly,\n 'isMustHaveSl' => $this->IsMUSTHaveSL,\n 'requestClientId' => $this->RequestCLIENTID\n ];\n }",
"public function build() {\n return array();\n }",
"public function toArray($request)\n {\n $rooms = $this->rooms;\n $apiArr = array();\n \n /*\n Generation an API-link like PokeAPI or SWAPI.\n Not sure if this is recommended... prob not.\n Commented in return is a nested Json that contains the rooms.\n */\n foreach($rooms as $room){\n array_push($apiArr, request()->getHttpHost() . Config('enum.apiRooms') . $room->id);\n }\n\n return [\n 'id' => $this->id,\n 'description' => $this->description,\n 'type' => $this->type,\n 'price' => number_format($this->price / 100, 2),\n 'rooms_url' => $apiArr,\n //'rooms_data' => $this->rooms\n ];\n }",
"function jsonSerialize()\n {\n return [\n 'meta' => [\n 'offset' => $this->page->getOffset(),\n 'limit' => $this->page->getLimit(),\n 'total' => $this->total,\n ],\n 'data' => $this->results,\n ];\n }",
"public function generateArray()\r\n\t{\t\r\n\t\t$data = array('logID'=>$this->logID,'text'=>$this->Text,'timestamp'=>$this->timestamp, 'textid'=>$this->textID);\r\n\t\tif($this->user!=null)\r\n\t\t\t$data['user'] = $this->user->generateArray();\r\n\t\tif($this->building!=null)\r\n\t\t\t$data['building'] = $this->building->generateArray('normal');\r\n\t\tif($this->card!=null)\r\n\t\t\t$data['card']=$this->card->generateArray();\r\n\t\tif($this->location!=null)\r\n\t\t\t$data['location']=$this->location->generateArray();\r\n\t\tif($this->icon!=null)\r\n\t\t\t$data['icon']=$this->icon;\r\n\t\tif($this->game!=null)\r\n\t\t\t$data['game']=$this->game;\r\n\t\treturn $data;\r\n\t\r\n\t}",
"public function complexListing(){\n\t\t//if someone knows, please make it better\n\t\t$formatResponse = new ResponseModel();\n\t\t$enrollmentModel = new EnrollmentModel();\n\t\t$formatResponse->data = [];\n\t\tforeach ($enrollmentModel->getStudentbyClass() as $item) {\n\t\t\t$new_item[\"fullname\"] = $item[\"firstname\"] . \" \" . $item[\"lastname\"];\n\t\t\t$new_item[\"birtdate\"] = date(\"d F Y\",strtotime($item[\"birthdate\"]));\n\t\t\t$new_item[\"enrollments\"] = $enrollmentModel->getClassByIdStudent($item[\"student_id\"]);\n\t\t\tarray_push($formatResponse->data,$new_item);\n\t\t}\n\t\treturn $this->respond($formatResponse);\n\t}",
"public function response() {\n $response = (object)[\n 'count' => $this->response,\n 'errors' => $this->errors\n ];\n echo json_encode($response); \n }",
"public function getCurrentResponseArray()\n {\n return $this->responseArray;\n }"
] | [
"0.7442654",
"0.7160023",
"0.71155906",
"0.6987261",
"0.69591796",
"0.6953336",
"0.68581146",
"0.68581146",
"0.68581146",
"0.68581146",
"0.68581146",
"0.68581146",
"0.68581146",
"0.68078744",
"0.6787875",
"0.6711376",
"0.6705358",
"0.67006713",
"0.66605085",
"0.6640761",
"0.6606105",
"0.65485555",
"0.6509992",
"0.64487016",
"0.64152646",
"0.64041746",
"0.63902277",
"0.63900274",
"0.638021",
"0.63749015",
"0.63536644",
"0.63411707",
"0.6313609",
"0.6273864",
"0.6272418",
"0.62701386",
"0.6248691",
"0.62405807",
"0.62293524",
"0.61844105",
"0.61716723",
"0.6163831",
"0.6158205",
"0.6152084",
"0.6147888",
"0.6119333",
"0.6109708",
"0.6098325",
"0.60946083",
"0.60943705",
"0.60795957",
"0.6061153",
"0.6026156",
"0.6014325",
"0.6009687",
"0.6003266",
"0.599795",
"0.59963435",
"0.599362",
"0.5984213",
"0.59745514",
"0.5974533",
"0.5968851",
"0.5964846",
"0.5955747",
"0.5947695",
"0.59406024",
"0.59406024",
"0.5935492",
"0.5933612",
"0.59326893",
"0.5925918",
"0.59205884",
"0.5918144",
"0.5916042",
"0.5914672",
"0.59050256",
"0.59016174",
"0.5898001",
"0.589728",
"0.5860334",
"0.5857923",
"0.5856585",
"0.58473176",
"0.5841697",
"0.5831205",
"0.58294654",
"0.58227617",
"0.5820183",
"0.581997",
"0.58190423",
"0.5818005",
"0.5817295",
"0.5815724",
"0.5815458",
"0.5807819",
"0.58001685",
"0.5796913",
"0.57870054",
"0.5786401",
"0.5784726"
] | 0.0 | -1 |
Store a newly created Cart in storage and return the data to the user. | public function store(Request $request)
{
if (Auth::guard('api')->check()) {
$userID = auth('api')->user()->getKey();
}
//$user = JWTAuth::authenticate($request->token);
$cart = Cart::create([
'id' => md5(uniqid(rand(), true)),
'key' => md5(uniqid(rand(), true)),
'user_id' => isset($userID) ? $userID : null,
]);
return response()->json([
'Message' => 'A new cart have been created for you!',
'cartToken' => $cart->id,
'cartKey' => $cart->key,
], 201);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store()\n\t{\n\t\t$validator = Validator::make($data = Input::all(), Cart::$rules);\n\n\t\tif ($validator->fails())\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\t\t}\n\n\t\tCart::create($data);\n\n\t\treturn Redirect::route('carts.index')->with('message', 'Cart created.');\n\t}",
"public function create()\n {\n $cart = session()->get('cart');\n }",
"public function save(): void\n {\n $this->session?->put('shop.cart', $this->toArray());\n }",
"public function store(StoreCartRequest $request)\n {\n try {\n $cart = new Cart();\n // create cart\n $cart->sub_total = $request->cart_sub_total;\n $cart->save();\n\n return response()->json([\n 'cart' => $cart->refresh(),\n 'message' => 'Cart has been created.'\n ]);\n } catch (Exception $e) {\n if (config('app.env') !== 'production') {\n return $e->getMessage();\n } else {\n Log::error($e->getMessage());\n return response()->json([\n 'error' => 'This request failed successfully in cart store.'\n ]);\n }\n }\n }",
"public function store(Request $request){\n //dd($request);\n //$cart[$request->item_id] = $request->quantity;\n //ways to create an array\n //$cart = array(values);\n //$cart = [value1, value2, etc];\n //$cart[key/index] = value;\n //What happens when an item is added to cart, it will assign the quantity\n // to index number equal to the item_id.\n //Session::put(\"cart\", $cart); // adds a session variable called cart with the content from $cart\n //dd(Session::get(\"cart\"));\n // This is only halfway done, why? Because the Session::put overwrites the original content. Fina a way to prevent it from overwriting. (Ie. revamp the entire logic)\n \n // Check if there is already a cart\n //1a. If there is no cart, create a new one\n //1b. If there is already a cart, call the cart and update the content.\n //2b. Save the updated cart in the session.\n\n $cart = []; //empty cart\n if(Session::exists(\"cart\")){ // if there is a cart in our session, pull it.\n $cart = Session::get(\"cart\");\n }\n $cart[$request->item_id]= $request->quantity;// update the cart\n Session::put(\"cart\", $cart); \n //dd(Session::get(\"cart\"));\n Session::flash(\"message\", $request->quantity . \"items added to cart\");\n // dd(Session::get(\"cart\"));\n // push it back to the session cart\n \n //Syntax: put into $cart into a session variable called \"cart\".\n \n return redirect(\"/products\"); //return to the catalog page.\n }",
"public function createCart() {\n if (!is_array($this->cart)) {\n $this->cart = array();\n $this->updateSession();\n }\n }",
"public function store()\n {\n $products = Cart::getProducts();\n\n // Create Order\n $order = new Order;\n $order->products_data = serialize($products);\n $order->user_id = auth()->user()->id;\n $order->save();\n\n return redirect('/orders')->with('success', 'Order Created');\n }",
"public function store(StoreCartRequest $request)\n {\n $product = Product::getProductByType($request->product_type, $request->id);\n\n $data = [$product, $request->qty];\n\n if ($product instanceof Part) {\n $data[] = ['producer_id' => $product->producer_id];\n }\n\n forward_static_call_array(['Cart', 'add'], $data);\n\n return response([\n 'qty' => Cart::count()\n ]);\n }",
"protected function save(): void\n {\n if ($this->connection == 'database') {\n $this->cart->each(\n function ($item) {\n if ($cart = $this->storage->has($item['id'])) {\n $cart->update(\n [\n 'rowId' => $item['id'],\n 'price' => $item['price'],\n 'quantity' => $item['quantity'],\n 'cartable_id' => $item['cartable_id'],\n 'cartable_type'=> $item['cartable_type'],\n ]\n );\n } else {\n $this->storage->create(\n [\n 'rowId' => $item['id'],\n 'user_id' => $this->user->id,\n 'price' => $item['price'],\n 'quantity' => $item['quantity'],\n 'cartable_id' => $item['cartable_id'],\n 'cartable_type'=> $item['cartable_type'],\n ]\n );\n }\n }\n );\n } elseif ($this->sessionStatus) {\n $this->storage->put([$this->instanceName => $this->cart]);\n }\n }",
"public function store()\n\t{\n\t\t$id = Request::input('cart');\n\t\t$cart = Cart::where('id', $id)->first();\n\n\t\t$cart_products = $cart->products;\n\n\t\t$order = new Order;\n\t\t\\Auth::user()->orders()->save($order);\n\n\t\tif (!$cart_products->isEmpty()) {\n\n\t\t\tforeach ($cart_products as $product){\n\t\t\t\tif($product->stock < $product->pivot->quantity ) {\n\t\t\t\t\t$order->delete();\n\t\t\t\t\tflash()->error('Cannot fulfill order as insufficient ' . $product->title. ' stock');\n\t\t\t\t\treturn redirect('orders/create');\n\t\t\t\t}\n\t\t\t}\n\t\t\tforeach ($cart_products as $product) {\n\t\t\t\t$order->products()->attach([$product->id], [ 'quantity' => $product->pivot->quantity ]);\n\t\t\t}\n\t\t}\n\n\t\tflash()->success('Order successfully created');\n\t\treturn redirect('orders');\n\t\t\n\t}",
"public function store(CartItemPostRequest $request)\n {\n $size = $request->post('size');\n $color_id = $request->post('color');\n $product_id = $request->post('product');\n $amount = $request->post('amount');\n\n $productDesign = ProductDesign::where('size', $size)\n ->where('color_id', $color_id)\n ->where('product_id', $product_id)->first();\n\n // save cart item in DB for logged in user\n if(Auth::check()){\n\n // get cart if already exists, else create one\n $cart = Cart::firstOrCreate([\n 'user_id' => Auth::user()->id,\n ]);\n\n // create cart item and save it\n CartItem::create([\n 'product_design_id' => $productDesign->id,\n 'amount' => $amount,\n 'cart_id' => $cart->id,\n ]);\n }\n\n // save cart item in session for guest\n else {\n // get cart items from session\n $cartItems = session()->get('cartItems');\n\n // if guest hasn't add anything to cart yet, create cartItems array\n if(!$cartItems) {\n session()->put('cartItems', []);\n }\n\n // create cart item\n $cartItem = new CartItem([\n 'product_design_id' => $productDesign->id,\n 'amount' => $amount,\n ]);\n\n // add cart item to cartItems array in session\n session()->push('cartItems', ($cartItem));\n }\n\n return response()->json([\n 'success' => 'Produkt bol pridaný do košíka',\n ], 200);\n\n }",
"public function save()\n {\n /** @var \\Illuminate\\Http\\Request $request */\n $request = App::make('request');\n $request->session()->put($this->collection->cart_name, $this->collection);\n }",
"public function store(Request $request)\n {\n Cart::Create([\n 'user_id'=>Auth::User()->id,\n 'item_id'=>$request->item_id,\n ]);\n return redirect()->action('CartController@index');\n }",
"public function store(StoreCartItemRequest $request)\n {\n//dd($request->all());\n $request->session()->put('seats_data', $request->seats_data);\n $data = isset($_POST) ? $_POST : '';\n $q = Cart::store($request->product_id, $request->qty, $request->options ?? [], $data);\n\n // echo \"<pre>\"; print_r($q->seats_data); exit('check');\n\n return back()->withSuccess(trans('cart::messages.added'));\n }",
"public function save(Cart $cart);",
"public function store(Request $request)\n {\n //\n $request->validate([\n 'item_id'=>'required',\n ]);\n\n $data=$request->all();\n $data['user_id']=auth()->user()->id;\n $item=Item::findOrFail($request->item_id);\n $data['price']=$item->price_per;\n $data['quantity']=$request->quantity;\n $data['item']=$item->name;\n \n $cart =new Cart($data);\n $cart->save();\n return redirect()->route('cart.index')->with('sucess','Added in Cart');\n \n }",
"public function store(Request $request){\n $cartDetail = new CartDetail(); //creamos un nuevo objeto\n $cartDetail->cart_id = auth()->user()->cart->id; //capturamos el usuario de ese carro\n $cartDetail->product_id= $request->product_id;\n $cartDetail->quantity = $request->quantity;\n $cartDetail->save();\n $notification = \"El producto fue añadido correctamente\";\n return back()-> with(compact('notification'));\n }",
"public function store($pid)\n {\n// return ($pid);\n// $cart = auth()->user()->cart();\n $cart = DB::table('carts')\n ->where('product_id', $pid)\n ->where('user_id', auth()->user()->id)\n ->first();\n if(count($cart)== 0) {\n $product = Product::find($pid);\n// return (string)$product;\n $cart = Cart::create([\n 'user_id' => auth()->user()->id,\n 'product_id' => $pid,\n 'product_title' => $product->title,\n 'product_image' => $product->image,\n 'price' => $product->price\n ]);\n }\n $cart = DB::table('carts')\n ->where('product_id', $pid)\n ->where('user_id', auth()->user()->id)\n ->first();\n// dd($cart->id);\n\n $cart->quantity = $cart->quantity+1;\n DB::table('carts')\n ->where('id', $cart->id)\n ->update(['quantity' => $cart->quantity]);\n }",
"public function save() {\n $_SESSION['cart'] = $this->items;\n\n }",
"public function save()\n {\n $this->_user->setAttribute(\n 'cart_items',\n $this->_items,\n timpanyCart::SESSION_NS\n );\n }",
"public function store(Request $request)\n {\n $rules = CartProduct::rules($request);\n $request->validate($rules);\n $product = Products::findOrFail($request->product_id);\n // Check if user has already cart\n $cart = Cart::where('user_id', Auth()->id())\n ->first();\n if ($cart==null) {// User does not have cart\n $newCart = Cart::create([\n 'user_id' => Auth()->id(),\n 'total' => $product->product_price\n ]);\n $credentials = CartProduct::credentials($request, $product);\n $credentials['cart_id'] = $newCart->id;\n $CART = CartProduct::create($credentials);\n } else {//User already have cart\n $credentials = CartProduct::credentials($request, $product);\n $credentials['cart_id'] = $cart->id;\n // Test 1\n $SameProduct = CartProduct::where('user_id', Auth()->id())->where('product_id' , $product->id )->get();\n if ($SameProduct->count() >= 1 ) {\n return redirect()->route('my-cart.index')->withErrors('The Item Is Already Exist');\n } else {\n // Insert product into cart\n $CART = CartProduct::create($credentials);\n // update total price\n $this->updateTotal($cart);\n }\n }\n\n\n return redirect()->route('my-cart.index');\n }",
"public function store(Request $request)\n {\n $product = Product::find($request->id);\n $item = new Cart;\n $item->name = $product->name;\n $item->description = $product->description;\n $item->price = $product->price;\n $item->featured_img = $product->featured_img;\n $item->quantity = 1;\n $item->user_id = Auth::user()->id;\n $item->status = 0; //producto no comprado.\n $item->cart_number = 0;\n $item->save();\n return redirect('/cart');\n }",
"public function store(Request $request)\n {\n Cart::add($request->id, $request->product_title, 1, $request->product_price)->associate('App\\Product');\n return redirect()->route('store-page')->with(\"success_message\",\"item was added to the cart\");\n }",
"protected function storageCart(Cart $cartModel, Request $request){\n\n $data['id_cnv'] = $request->input('id_cnv');\n $data['id_user'] = Auth::user()->id;\n\n echo $cartModel->addCnvCart($data);\n }",
"private function saveCart()\n\t{\n\t\t$totalPrice = $this->cart->calculateTotalPriceGross();\n\t\t$companyDetails = \\App\\User::getUser()->get('companyDetails');\n\t\tif (!empty($companyDetails) && isset($companyDetails['creditlimit']) && $totalPrice > ($companyDetails['creditlimit'] - $companyDetails['sum_open_orders'])) {\n\t\t\t$result = [\n\t\t\t\t'error' => \\App\\Language::translate('LBL_MERCHANT_LIMIT_EXCEEDED', 'Products'),\n\t\t\t];\n\t\t} else {\n\t\t\t$this->cart->save();\n\t\t\t$result = [\n\t\t\t\t'numberOfItems' => $this->cart->count(),\n\t\t\t\t'totalPriceNetto' => \\App\\Fields\\Currency::formatToDisplay($this->cart->calculateTotalPriceNetto()),\n\t\t\t\t'totalPriceGross' => \\App\\Fields\\Currency::formatToDisplay($totalPrice),\n\t\t\t\t'shippingPrice' => \\App\\Fields\\Currency::formatToDisplay($this->cart->getShippingPrice()),\n\t\t\t];\n\t\t}\n\n\t\t$response = new \\App\\Response();\n\t\t$response->setResult($result);\n\t\t$response->emit();\n\t}",
"public function store(Request $request)\n {\n $cartDetail = New CartDetail();\n /**ID del Carrito del Usuario */\n $cartDetail->cart_id = auth()->user()->cart->id;//Campo Calculado del ID del Carrito para el usuario solo hay un Carrito activo para cada Usuario\n /**Recibimos los datos del producto y lo asociamos */\n $cartDetail->product_id = $request->product_id;\n $cartDetail->cost_price = $request->cost_price;\n $cartDetail->price = $request->price;\n $cartDetail->quantity = $request->quantity;\n $cartDetail->colours = $request->colour;\n $cartDetail->opcional_colours = $request->colourOptional;\n $cartDetail->waists = $request->waist;\n /**Guardamos la información recibida */\n $cartDetail->save();\n /**Lo llevamos al lugar don el usuario se encontraba */\n flash('¡Bien Hecho! Agregamos Correctamente el Producto a tu Carrito de Compras.')->success()->important();\n return back();\n\n }",
"public function store(Request $request)\n {\n $cart = session('cart');\n\n $cart->products()->attach(\n $request->get('product_id'), ['quantity'=>$request->get('qty')]\n );\n\n session()->put('cart', $cart);\n\n return redirect('/');\n }",
"public function store()\n\t{\n\t\t//\n $fields = ['id', 'name', 'price', 'qty'];\n $rules = [\n 'id' => 'required|integer',\n 'name' => 'required',\n 'price' => 'required|numeric',\n 'qty' => 'required|integer'\n ];\n $data = array_only(Input::all(), $fields);\n $validator = \\Validator::make($data, $rules);\n# var_dump($data);exit;\n\n if ($validator->passes()) {\n \\Cart::associate('Product')->add($data);\n return \\Redirect::back()->with(['success'=>'添加成功']);\n } else {\n return $this->redirectBack(['error'=>'添加失败']);\n }\n\n\t}",
"public function store(Request $request)\n {\n $user = Auth::User();\n $cart = DB::table('orders')\n ->select('id')\n ->where('status_id', '=', 1)\n ->where('user_id', '=', $user->id)\n ->value('id');\n\n if(empty($cart)) {\n $order = new Order;\n $order->user_id = $user->id;\n $order->status_id = 1;\n $order->save();\n\n $orderProduct = new OrderProduct;\n $orderProduct->order_id = $order->id;\n $orderProduct->product_id = $request->product_id;\n $orderProduct->quantity = $request->quantity;\n $orderProduct->save();\n } else {\n // if you already have this product in your cart just add the next quantity to the same line item\n if (OrderProduct::where('order_id', $cart)->where('product_id', $request->product_id)->exists() ){\n $repeatOrderProduct = OrderProduct::where('order_id', $cart)->where('product_id', $request->product_id)->first();\n $orderProduct = OrderProduct::find($repeatOrderProduct->id);\n $orderProduct->product_id = $request->product_id;\n $orderProduct->quantity = $request->quantity + $orderProduct->quantity;\n $orderProduct->save();\n }\n // else make a new line item for this new item\n else {\n $orderProduct = new OrderProduct;\n $orderProduct->order_id = $cart;\n $orderProduct->product_id = $request->product_id;\n $orderProduct->quantity = $request->quantity;\n $orderProduct->save();\n }\n }\n\n Activity::log('Saved an item to their cart.', $user->id);\n\n $request->session()->flash('status', 'Product was saved to cart.');\n\n return Redirect::action('CartController@index');\n\n }",
"public function store(Request $request)\n {\n $qty = $request->qty;\n $product_id = $request->product_id;\n $cart = Product::where('product_id',$product_id)->first();\n // Cart::add('293ad', 'Product 1', 1, 9.99, 550);\n $data['id'] = $product_id;\n $data['qty'] = $qty;\n $data['price'] = $cart->product_price;\n $data['name'] = $cart->product_name;\n $data['weight'] = 50;\n $data['options']['image'] = $cart->product_image;\n Cart::add($data);\n return Redirect::to('/show-cart');\n }",
"public function store(Request $request)\n {\n $cart = Cart::where('vendor_id', Auth::user()->id)->where('crop_id', $request->crop_id)->first();\n if ($cart) {\n return redirect()->back()->withError('Already in cart');\n }\n\n $data = $request->all();\n $data['vendor_id'] = Auth::user()->id;\n $data['seller_id'] = Crop::find($request->crop_id)->user_id;\n Cart::create($data);\n return redirect()->back()->withSuccess('Cart updated');\n }",
"public function store(Request $request)\n {\n $request->validate([\n 'pid' => 'required|integer',\n\n ]);\n\n $pid = Product::find($request->pid);\n\n Cart::add([\n 'id'=> $pid->id,\n 'name'=> $pid->product,\n 'price'=> $pid->price,\n 'quantity' => $request->qty,\n 'attributes' => [\n 'image'=> $pid->image,\n ]\n\n ]);\n\n\n\n\n return redirect()->route('cart.show');\n\n }",
"public function store(Request $request)\n {\n $input = [\n 'product_uid' => $request->input('product_uid'),\n 'price' => (int) $request->input('price'),\n 'qty' => (int) $request->input('qty'),\n ];\n \n // Validate data request\n $validator = $this->_validationForm($input);\n if($validator->fails()) {\n return $this->sendError('Validation Error.', $validator->errors(), 400); \n }\n\n // check stock available\n // check stock available\n $availableStock = $this->_checkAvailableStock($input['product_uid'], $input['qty']);\n if(!$availableStock) {\n return $this->sendError('Validation Error.', 'Product stock is not available', 400); \n }\n\n DB::beginTransaction();\n try {\n $input['uid'] = Str::uuid();\n unset($input['product_uid']);\n \n $cart = Cart::create($input);\n \n // Assign Product ID to cart\n $product = Product::where('uid', $request->input('product_uid'))->first();\n $product->stock = Product::getAvailableStock($product); // get available stock \n\n $cart->product_data = json_encode(new ProductResource($product));\n $cart->product()->associate($product);\n $cart->save();\n\n DB::commit(); // if there is no error, commit data to database\n return $this->sendResponse(new CartResource($cart), \"{$product->name} has bedd added to cart.\", 201);\n } catch (\\Exception $e) {\n DB::rollback(); // if there is an error, rollback data from database\n // return $this->sendError('Internal Server Error.', 'Contact the administrator to tell about this error.', 500);\n return $this->sendError('Internal Server Error.', $e->getMessage(), 500);\n }\n }",
"public function store(Request $request, $id)\n {\n\n $cart=Cart::find(session('cartId'));\n\n $cart->products()->attach($id);\n //si esta logueado meto tambien el user id al Carrito si no lo tiene\n\n return redirect()->back();\n }",
"public function store(Request $request) {\n $data = $request->all();\n $product = Products::find($data['id']);\n $cartItem = \\Cart::add([\n 'id' => $product->id,\n 'name' => $product->name,\n 'qty' => isset($data['options']['quantity']) ? $data['options']['quantity'] : 1,\n 'price' => $product->price,\n 'options' => array(\n 'slug' => $product->slug,\n 'image' => $product->img,\n 'size' => isset($data['options']['size']) ? $data['options']['size'] : 0,\n 'color' => isset($data['options']['color']) ? $data['options']['color'] : 0,\n 'material' => isset($data['options']['material']) ? $data['options']['material'] : 0\n )]);\n \\Cart::associate($cartItem->rowId, \\App\\Models\\Admin\\Products::class);\n return response()->json([\n 'carts' => \\Cart::content(),\n 'count' => \\Cart::count(),\n 'total' => \\Cart::total(0)\n ]);\n }",
"public function store(Request $request, $id)\n {\n $produk = produk::where('id', $id)->first();\n if($request->qty > $produk->stok)\n {\n return redirect('detail/'.$id)->with('status', 'The order exceeds the existing stock limit');\n }\n\n $subtotal = $produk->harga * $request->qty;\n $cek_cart = Cart::where('id_produk', Session::get('id_produk'))->first();\n if(empty($cek_cart)){\n\n $itemcart = Cart::create($request->all());\n $itemcart-> id_user = $request->id_user;\n $itemcart-> id_produk = $request->id_produk;\n $itemcart-> qty = $request->qty;\n $itemcart->save();\n } else {\n \n }\n\n\n\n return redirect('/cart')->with('status', 'Successfully create a new product!');\n\n }",
"public function setToCart()\n\t{\n\t\t$this->cart->set($this->request->getInteger('record'), $this->request->getInteger('amount', 1), [\n\t\t\t'priceNetto' => (float) $this->request->get('priceNetto', 0.0),\n\t\t\t'priceGross' => (float) $this->request->get('priceGross', 0.0),\n\t\t]);\n\t\t$this->saveCart();\n\t}",
"public function store(Request $request)\n {\n $userId = Auth::id();\n $task = Cart::create(['user_id' => $userId]);\n }",
"public function store(Request $request, $id)\n {\n $cartDbEntry = $this->retrieveCartDatabaseEntry($request);\n if ($cartDbEntry) {\n $cart = Cart::find($cartDbEntry->id);\n if (is_null($cart->items)) {\n $cartItems = (object)[];\n } else {\n $cartItems = json_decode($cart->items);\n }\n } else {\n $cart = Cart::create([\n 'token' => $request->session()->get('_token'),\n 'items' => null,\n 'total' => null\n ]);\n $cartItems = (object)[];\n }\n\n if (array_key_exists($id, $cartItems)) {\n $cartItems->$id->amount++;\n $cartItems->$id->display_price = $this->formatDisplayPrice($cartItems->$id->price);\n } else {\n $product = DB::table('products')->where('sku', $id)->first();\n $type = ($product->subscription == true) ? 'plan' : 'product';\n\n $displayPrice = $this->formatDisplayPrice($product->price);\n $cartItems->$id = (object)['amount' => 1, 'type' => $type, 'name' => $product->full_name, 'description' => $product->description, 'price' => $product->price, 'display_price' => $displayPrice];\n }\n\n $this->saveCart($cart, $cartItems);\n\n return redirect('/cart');\n }",
"private function saveCart($request)\n {\n \t$request->session()->put('cart', $this->cart);\n }",
"public function store(CartStoreRequest $request, Cart $cart)\n {\n $cart->add($request->products);\n }",
"public function create()\r\n\t\t{\r\n\t\t\t//Validate request method\r\n\t\t\tif($this->getRequestMethod() != \"POST\"){\r\n\t\t\t\t$this->methodNotAllowed();\r\n\t\t\t}\r\n\r\n\t\t\t// Input validations\r\n\t\t\t$this->validation(array('sCartName','iProductId','iTotal','iTotalDiscount','iTotalWithDiscount','iTotalTax','iTotalWithTax','iGrandTotal'));\r\n\r\n\t\t\t$arrCartData = array(\r\n\t\t\t\t'sCartName'\t\t\t=> $this->_arrRequest['sCartName'],\r\n\t\t\t\t'iProductId' \t\t=> $this->_arrRequest['iProductId'],\r\n\t\t\t\t'iTotal'\t\t\t=> $this->_arrRequest['iTotal'],\r\n\t\t\t\t'iTotalDiscount'\t=> $this->_arrRequest['iTotalDiscount'],\r\n\t\t\t\t'iTotalWithDiscount'=> $this->_arrRequest['iTotalWithDiscount'],\r\n\t\t\t\t'iTotalTax'\t\t\t=> $this->_arrRequest['iTotalTax'],\r\n\t\t\t\t'iTotalWithTax'\t\t=> $this->_arrRequest['iTotalWithTax'],\r\n\t\t\t\t'iGrandTotal'\t\t=> $this->_arrRequest['iGrandTotal'],\r\n\t\t\t\t'dCreated'\t\t\t=> date(\"Y-m-d H:i:s\")\r\n\t\t\t);\r\n\r\n\t\t\t$iCartId = $this->insertRecord($this->_sCartTable,$arrCartData);\r\n\t\t\t$iStatus = ($iCartId>0) ? \"Success\" : \"False\";\r\n\t\t\t$sMessage = ($iCartId>0) ? \"Cart added successfully.\" : \"Fail to add.\";\r\n\r\n\t\t\t$arrResponse['status']\t= $iStatus;\r\n\t\t\t$arrResponse['message']\t= $sMessage;\r\n\t\t\t$this->response($this->json($arrResponse), 200);\r\n\t\t}",
"public function store(Request $request)\n {\n $data = $this->validate(request(),\n [\n 'user_id' => 'required|numeric',\n 'product_id' => 'required|numeric',\n 'quantity' => 'required|numeric',\n \n \n ], [] ,[\n 'user_id' => trans('admin.user_id'),\n 'product_id' => trans('admin.product_id'),\n 'country_id' => trans('admin.country_id'),\n \n \n ]);\n \n Cart::create($data);\n session()->flash('success',trans('admin.record_added'));\n return redirect(aurl('carts'));\n }",
"public function store(Request $request)\n {\n\n $item = Cart::where('product_id', $request->product_id)->first();\n if (!empty($item)) {\n $item->increment('quantity');\n $item = $item->first();\n } else {\n $item = Cart::forceCreate([\n 'product_id' => $request->product_id,\n 'quantity' => 1\n ]);\n }\n\n return response()->json([\n 'quantity' => $item->quantity,\n 'product' => $item->product\n ]);\n\n }",
"public function store(Request $request)\n {\n $dubl = Cart::search(function ($cartItem, $rowId) use ($request) {\n return $cartItem->id === $request->id;\n });\n if ($dubl->isNotEmpty()) {\n \n toastr()->warning('product is already in cart !');\n\n \n \n\n\n\n };\n\n \n\n ///////////////////////////////////////////////////\n\n $user = DB::table('orders')\n ->where('user_id', '=', Auth::user()->id)\n ->first();\n //////////////////////////////////////////////\n\n //////////////////////////////////\n $order_id = order::latest()->first()->id;\n\n /////////////////\n\n\n////////////////////////////////////\n\n\n /////////////////////////////////////////////////\n\n if (isset($user) ) {\n\n\n orderItem::create([\n 'order_id' =>$order_id,\n 'product_id' => $request->id,\n 'user_id' => Auth::user()->id,\n 'quantity' => 1,\n 'price' => $request->price,\n ]);\n\n\n\n\n } else{\n\n order::create([\n 'user_id' => (Auth::user()->id),\n 'status' => 1,\n\n ]);\n\n orderItem::create([\n 'order_id' => $order_id,\n 'product_id' => $request->id,\n 'user_id ' => Auth::user()->id,\n 'quantity' => 1,\n 'price' => $request->price,\n ]);\n }\n\n\n\n\n\n\n /////////////////////////////////////////\n\n Cart::add($request->id, $request->name, 1, $request->price)->associate('App\\product', 'App\\orderItem');\n toastr()->success('product added Successfully');\n\n\n return redirect()->back();\n \n }",
"public function store(Request $request)\n {\n $item=Cart::search(function ($cartItem, $rowId) use($request){\n return $cartItem->id === $request->id;\n });\n\n if ($item->isNotEmpty()) {\n return redirect()->route('cart.index')\n ->with('success_message','item already added in your cart!');\n }\n Cart::add($request->id,$request->title,$request->qty,$request->price)\n ->associate('App\\Models\\Product');\n\n return redirect()->route('cart.index')\n ->with('success_message','item was added!');\n }",
"public function store(Request $request)\n {\n Cart::add($request->id, $request->name, 1, $request->price)\n ->associate('App\\Models\\Product');\n\n return redirect()->route('pointofsell.index');\n }",
"function save_cart_data() \n\t\t{\n\t\t\tif (!$this->data['user'])\n\t\t\t{\n\t\t\t\t// Users that are not logged in cannot save cart data.\n\t\t\t\t$this->flexi_cart->set_error_message('You must be logged in to save your cart.', 'public');\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The load/save/delete cart data functions require the flexi cart ADMIN library.\n\t\t\t\t$this->load->library('flexi_cart_admin');\n\t\t\t\n\t\t\t\t// Save the cart data to the database.\n\t\t\t\t$this->flexi_cart_admin->save_cart_data($this->data['user']->id);\n\t\t\t}\n\n\t\t\t// Set a message to the CI flashdata so that it is available after the page redirect.\n\t\t\t$this->session->set_flashdata('message', $this->flexi_cart->get_messages());\n\t\t\t\n\t\t\tredirect('cart');\n\t\t}",
"public function store(Request $request)\n {\n \n $duplicata=Cart::search(function ($cartItem, $rowId) use($request) {\n return $cartItem->id == $request->pid;\n });\n if($duplicata->isNotEmpty()){\n return redirect()->back()->with('success','Sorry the item is already added');\n }\n $product=Product::find($request->pid);\n Cart::add($product->pid,$product->name,1,$product->price)\n ->associate('card/store');\n return redirect('/')->with('success','the product added to card succesfully');\n }",
"public function store(Request $request, $id)\n {\n //Retreive Request Data\n $qty = $request->input('qty');\n\n //Retreive Product data From DataBase By Requested Id\n $product = Product::find($id);\n $product_id = $product->id;\n $product_name = $product->description;\n $price = $product->price;\n $options = $product->images_urls;\n\n //Calculation\n $tax = $price * (env('TAX') / 100);\n $subtotal = ($price * $qty) + $tax;\n $uniqueId = Str::uuid();\n\n //Add Results To An Array\n $item = [\n 'row_id' => $uniqueId,\n 'product_id' => $product_id,\n 'name' => $product_name,\n 'qty' => $qty,\n 'price' => $price,\n 'options' => $options,\n 'tax' => $tax,\n 'subtotal' => $subtotal\n ];\n\n //Retreive Discount Data From DataBase\n $discounts = Discount::where('discount_code', 'TestDevinweb')->first();\n\n // Assuming That The Cart Id ($cartId) Is Belongs To The Customer\n $cartId = 36;\n\n //If The Cart Id Exists, Then Add The Product To The Cart Items\n if ($cart = Cart::find($cartId)) {\n\n $total = 0;\n foreach ($cart->content as $items) {\n $total += $items['price'];\n }\n\n $discount = [\n 'code' => $discounts->discount_code,\n 'discounted_amount' => ($total + $price) * ($discounts->percentage_value / 100),\n 'value' => $discounts->percentage_value,\n ];\n\n //Add The New Item array To The Existing Cart Items\n $items = Arr::prepend($cart->content, $item);\n\n //Update The Cart\n $cart->content = $items;\n $cart->discount = $discount;\n $cart->save();\n return new CartResource($cart);\n }\n\n //If The Cart Id Does Not Exist, Then Create New Cart And Add The Product To It\n else {\n\n //Create A Discount Array\n $discount = [\n 'code' => $discounts->discount_code,\n 'discounted_amount' => $price * ($discounts->percentage_value / 100),\n 'value' => $discounts->percentage_value,\n ];\n\n //Add The New Item array To The New Cart Items\n $items = [$item];\n\n //Create The Record\n $cart = new Cart();\n $cart->content = $items;\n $cart->discount = $discount;\n $cart->save();\n return new CartResource($cart);\n }\n }",
"public function store()\n {\n $idProductos = Session::get('cart');\n $total = 0;\n foreach ($idProductos as $value) {\n $total = $total + ($value['quantity'] * $value['price']);\n };\n\n $sale = new Sale();\n $sale->transaction_key = Session::getId();\n $sale->payment_data = 'MercadoPago';\n $sale->total = $total;\n $sale->status = 'Pendiente';\n $sale->user_id = Auth::user()->id;\n\n $sale->save();\n\n $idVenta = $sale->id;\n\n foreach ($idProductos as $value) {\n $saleDetail = new SalesDetail();\n $saleDetail->user_id = Auth::user()->id;\n $saleDetail->sale_id = $idVenta;\n $saleDetail->product_id = $value['id'];\n $saleDetail->unit_price = $value['price'];\n $saleDetail->quantity = $value['quantity'];\n $saleDetail->save();\n\n $restaStock = ($value['stock'] - $value['quantity']);\n $stock = Product::find($value['id'])->update(['stock' => $restaStock]);\n };\n\n Session::forget('cart');\n\n return view('shopcartPay', compact('total'));\n }",
"public function store(CartStoreFormRequest $request, Cart $cart, Branch $branch)\n {\n // dd($request->validated());\n $store = $cart->setCartType('cart')->withBranch($branch)->add($request->validated());\n if (count($store['attached']) || count($store['updated'])) {\n $this->setApiResponse(fn() => response()->json(['message' => 'added to cart successfully']));\n $this->redirectBack();\n } else {\n $this->redirectBack();\n $this->setApiResponse(fn() => response()->json(['created' => false]));\n }\n\n return $this->response();\n }",
"public function store(AddCartRequest $request)\n {\n // Will return only validated data\n\n $validated = $request->validated();\n\n $message = $this->cartRepository->create($validated);\n\n return [\n 'status' => 'success',\n 'message' => $message\n ];\n }",
"public function store(Request $request, $id)\n {\n $product = Product::leftJoin('images','products.id', '=','images.product_id')\n ->select('products.*','images.path','images.name')->find($id);\n\n if (Auth::check()) {\n\n $cart = Cart::where('user_id', Auth::id())->where('product_id',$product->id)->first();\n\n if ($cart === null) {\n\n $cart = new Cart;\n\n $cart->user_id = Auth::id();\n $cart->product_id = $product->id;\n $cart->quantity = 1;\n $cart->save();\n\n return response()->json($cart);\n\n } else {\n\n $cart->quantity += 1;\n $cart->save();\n\n return response()->json('Quantity increased');\n }\n }\n }",
"public function addToCart(){\n\t\t// if the user has accepted to use cookies, they will be stored\n\t\tif(isset($_COOKIE['isUsingCookies']) && $_COOKIE['isUsingCookies'] == true){\n\t\t\t$expirationTime = time()+60*60*24*62;\n\t\t}else{\n\t\t\t$expirationTime = 0;\n\t\t}\n\n\t\t// unset unused attributes from variable\n\t\tunset($_POST['_token']);\n\n\t\t// add the product to the current cart or increase the quantity if it is already in the cart\n\t\tif(isset($_COOKIE['cart'])){\n\t\t\t$previousCart = json_decode($_COOKIE['cart'],true);\n\t\t\tforeach ($previousCart as $key => $product) {\n\t\t\t\tvar_dump($product);\n\t\t\t\techo'<br>';\n\n\t\t\t\tif($_POST['id_product'] == $product['id_product']){\n\t\t\t\t\t$previousCart[$key]['quantity'] += 1;\n\t\t\t\t\tsetcookie('cart', json_encode($previousCart), $expirationTime);\n\t\t\t\t\treturn redirect()->route('cart');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tarray_push($previousCart, ['id_product' => $_POST['id_product'], 'quantity' => '1', 'price' => $_POST['price'], 'picture_url' => $_POST['picture_url'], 'name' => $_POST['name'], 'picture_alt' => $_POST['picture_alt'], 'stock' => $_POST['stock'], 'item_sold' => $_POST['item_sold'], 'name_category' => $_POST['name_category']]);\n\t\t\t$newCart = json_encode($previousCart);\n\n\t\t\tsetcookie('cart', $newCart, $expirationTime);\n\t\t}else{\n\t\t\tsetcookie('cart', json_encode([['id_product' => $_POST['id_product'], 'quantity' => '1', 'price' => $_POST['price'], 'picture_url' => $_POST['picture_url'], 'name' => $_POST['name'], 'picture_alt' => $_POST['picture_alt'], 'stock' => $_POST['stock'], 'item_sold' => $_POST['item_sold'], 'name_category' => $_POST['name_category']]]), $expirationTime);\n\t\t}\n\t\treturn redirect()->route('cart');\n\t}",
"public function store(Request $request)\n {\n $this->validate($request,[\n 'medicine_id'=> 'required'\n ],\n [\n 'medicine_id.required' =>'Please Select A product'\n ]);\n if (Auth::check()) {\n $cart = Cart::orwhere('user_id',Auth::id())\n ->orwhere('medicine_id', $request->medicine_id)\n ->first(); \n }else{\n $cart = Cart::where('ip_address',request()->ip())\n ->where('medicine_id', $request->medicine_id)\n ->first();\n }\n\n if (!is_null($cart)) {\n $cart->increment('product_quantity');\n }else{\n $cart = new Cart();\n $cart->medicine_id = $request->medicine_id;\n $cart->sub_price = $cart->medicine->price;\n $cart->ip_address = $request->ip();\n $cart->sub_price = $cart->medicine->price;\n $cart->save(); \n }\nreturn json_encode(['status' => 'success','Message' => 'Item Added to your cart']) ;\n\n }",
"public function store(Request $request)\n {\n try{\n $cart = Cart::where('table_id',$request->table_id)->where('item_id',$request->item_id)->first();\n $item = AppItems::find($request->item_id);\n if($item){\n $request->merge(['amount'=>$item->amount*$request->qty]);\n }\n if($cart){\n $cart->qty = $request->qty;\n $cart->save();\n if($request->qty == '0'){\n $cart->delete();\n }\n }else{\n $cart = Cart::create($request->except('_token'));\n }\n $cart->items;\n $data['data'] = $cart;\n $data['message'] = 'created';\n return $this->apiResponse($data,200);\n }catch(\\Exception $e){\n $data['message'] = $e->getMessage();\n return $this->apiResponse($data,404);\n }\n }",
"public function store(Request $request)\n {\n if (isLogin() == false) return redirect(config('app.auth') . '/requirelogin?url=' . config('app.api'));\n\n $cart = CartUser::addToCartUsersTables();\n $cartproduct = CartProduct::getProductByProductIDinSpecCart($cart->id, $request->id);\n // For POST method with missing optional data\n if ($cartproduct != null) {\n if ($cartproduct->quantity == 10) {\n session()->flash('errors', collect(['Quantity must be between 1 and 10.']));\n return redirect()->route('cart.index');\n }\n }\n $this->addToCartProductsTables($request);\n return redirect()->route('cart.index')->with('success_message', 'Item was added to your cart!');\n }",
"public function store(Request $request)\n {\n $this->validate(request(), [\n 'id' => 'bail|required',\n 'price' => 'required',\n 'name' => 'required'\n ]);\n\n $order = Order::firstOrCreate(['user_id' => auth()->user()->id, 'status' => 'Cart'], ['status' => 'Cart', 'ordered_on' => Carbon::now()]);\n $orderproduct = OrderProduct::firstOrNew(['order_id' => $order->id, 'product_id' => $request->input('id')]);\n $orderproduct->name = $request->input('name');\n $orderproduct->quantity = $orderproduct->quantity + 1;\n $orderproduct->price = $request->input('price');\n $orderproduct->save();\n\n return $orderproduct;\n }",
"public function store(Request $request)\n {\n $this->validate($request, [\n 'product_id' => 'required'\n ],\n [\n 'product_id.required' => 'Please Selcet Any product First !'\n ]);\n\n if(!empty($request->user_id)){\n $cart = Cart::where('user_id', $request->user_id)\n ->where('product_id', $request->product_id)\n ->where('order_id', NULL)\n ->first();\n }else{\n $cart = Cart::where('ip_address', request()->ip())\n ->where('product_id', $request->product_id)\n ->where('order_id', NULL)\n ->first();\n\n }\n\n if(!is_null($cart)){\n $cart->increment('product_quantity');\n }\n else{\n $cart = new Cart();\n if(!empty($request->user_id)){\n $cart->user_id = $request->user_id;\n }\n $cart->ip_address = request()->ip();\n $cart->product_id = $request->product_id;\n $cart->save();\n }\n\n session()->flash('success', 'This product are added to cart');\n return back();\n }",
"public function store(Request $request)\n {\n $url = $request->url;\n $explode = explode('/', $url);\n $user = Auth::id();\n $product_id = $request->id;\n $product = Product::where('id', $product_id)->first();\n if ($explode[1] == \"purchase\") {\n $type = 1;\n } else {\n $type = 2;\n }\n $getCart = Cart::where('product_id', $product_id)->where('type', $type)->first();\n if ($getCart) {\n $cartU = Cart::where('id', $getCart->id)->where('user_id', $user)->where('type', $type)->first();\n $cartU->qty = $cartU->qty + 1;\n $cartU->subtotal = $cartU->qty * $getCart->price;\n $cartU->save();\n } else {\n $cart = new Cart();\n $cart->product_id = $product_id;\n $cart->user_id = $user;\n $cart->product_name = $product->title;\n if ($explode[1] == \"purchase\") {\n $cart->qty = 1;\n } else {\n if ((int)$product->stock < 1) {\n return response()->json('Product stock out.');\n } else {\n $cart->qty = 1;\n }\n }\n if ($explode[1] == \"purchase\") {\n $cart->price = $product->buying_price;\n $cart->subtotal = $product->buying_price;\n } else {\n $cart->price = $product->selling_price;\n $cart->subtotal = $product->selling_price;\n }\n $cart->photo_url = $product->photo->image_path;\n $cart->freight_cost = $product->freight_cost;\n if ($explode[1] == \"purchase\") {\n $cart->type = 1;\n } else {\n $cart->type = 2;\n }\n $cart->save();\n }\n }",
"public function store(Request $request)\n {\n $this->validate($request, [\n 'course_id' => 'required'\n ],\n [\n 'course_id.required' => 'Please Selcet Any Course First !'\n ]);\n\n if(!empty($request->user_id)){\n $cart = Cart::where('user_id', $request->user_id)\n ->where('course_id', $request->course_id)\n ->where('order_id', NULL)\n ->first();\n }else{\n $cart = Cart::where('ip_address', request()->ip())\n ->where('course_id', $request->course_id)\n ->where('order_id', NULL)\n ->first();\n\n }\n\n if(!is_null($cart)){\n $cart->increment('course_quantity');\n }\n else{\n $cart = new Cart();\n if(!empty($request->user_id)){\n $cart->user_id = $request->user_id;\n }\n $cart->ip_address = request()->ip();\n $cart->course_id = $request->course_id;\n $cart->save();\n }\n\n return json_encode(['status'=>'success', 'Message'=>'Item Added','totalItems'=> Cart::totalItems()]);\n }",
"public function store(Request $request)\n {\n $carts = new Cart();\n //dd($request->code);\n $carts->TotalPayment = $request->TotalPayment;\n $carts->save();\n //dd($request->code);\n return response()->json([\n 'data' => $carts,\n 'msg' => [\n 'summary' => 'success',\n 'detail' => '',\n 'code' => '201'\n ]], 201);\n }",
"public function store(Request $request)\n {\n $order = [\n 'user_id' => $request->user_id,\n 'sc_id' => $request->sc_id,\n 'quantity' => $request->quantity,\n 'subtotal' => $request->subtotal,\n ];\n if(ProductInShoppingCart::create($order)){\n return 200;\n }else{\n return 400;\n }\n }",
"public function created(Cart $cart)\n {\n //\n }",
"public function store($album_id)\n {\n \n //\n if(auth()->check()) // logged user\n {\n $request = new Request([\n 'id' => $album_id,\n ]);\n $request->validate([\n 'id' => ['required', 'Integer','min:1']\n ]);\n \n Cart::firstOrCreate(\n ['user_id' => auth()->id(), 'album_id' => $album_id], \n ['number' => '1']\n );\n\n \n }\n \n // for both logged user and guest\n if(session()->has('cart'))\n {\n $items = session()->get('cart');\n if(!in_array($album_id, $items)){\n session()->push('cart', $album_id);\n }\n }\n else{\n session()->push('cart', $album_id);\n }\n \n return strval(count(session()->get('cart')));\n \n\n }",
"public function store()\n {\n $validator = Validator::make(Input::all(), Products::$rules);\n\n if ($validator->passes()) {\n $product = new Products;\n $product->name = addslashes(Input::get('name'));\n $product->color_id = Input::get('color');\n $product->product_code = 0;\n $product->sp = Input::get('sp');\n $product->cp = Input::get('cp');\n $product->quantity = Input::get('quantity');\n $product->type_id = Input::get('type_id');\n $product->unit_id = Input::get('unit_id');\n $product->save();\n $product->setProductCode($product);\n $stock = new Stocks();\n $stock->supplier_id = Input::get('supplier_id');\n $stock->product_id = $product->id;\n $stock->quantity = Input::get('quantity');\n $stock->save();\n\n return Redirect::route('products.index')\n ->with('success', 'Product created successfully');\n } else {\n return Redirect::route('products.create')\n ->withErrors($validator)\n ->withInput(Input::all());\n }\n }",
"public function store()\n {\n $pizza = new Pizza();\n $pizza->name = request('name');\n $pizza->type = request('type');\n $pizza->base = request('base');\n // toppings is an array and needs to be stored as JSON in the database\n // we must cast it in th Pizza model\n $pizza->toppings = request('toppings');\n $pizza->save();\n\n return redirect('/')->with('mssg', 'Thanks for your order!');\n }",
"public function store(Request $request)\n {\n $api = $this->api();\n \n if ( ! $request->session()->has('cart_id')) {\n $api->createCart();\n }\n \n $search = Search::where('token', session('search'))->firstOrFail();\n \n $item = collect(json_decode($search->results))->first(function($result) use ($request) {\n return $result->meta->digest == $request->input('digest');\n });\n \n $result = $api->addItemToCart(['data' => $item]);\n \n if ($result) {\n return response()->json(['success'], 200);\n }\n \n return response()->json('error', $api->errorsArray());\n }",
"public function addToCart()\n {\n $inputs = request()->all();\n\n try\n {\n $items = $this->userRepo->addToUserCart(auth()->user(), $inputs, session('area_id'));\n }\n catch(AddToCartException $e)\n {\n return $this->respondWithErrors($e->getMessage());\n }\n\n return $this->respondWithSuccess([\n 'items' => $items\n ]);\n }",
"public function store()\n\t{\n\t\t$rules = array(\n\t\t\t'product_name'\t\t=> 'required',\n\t\t\t'category_name'\t\t=> 'required',\n\t\t\t'quantity'\t\t\t=> 'required|integer|min:0'\n\t\t\t);\n\n\t\t$validator = Validator::make(Input::all(), $rules);\n\n\t\tif ($validator -> fails()) {\n\t\t\treturn Redirect::route('stock.create')\n\t\t\t\t->withErrors($validator)\n\t\t\t\t->withInput(Input::all());\n\t\t}\n\t\telse{\n\t\t\t$stock = new Stock;\n\t\t\t$stock->product_id \t\t= Input::get('product_name');\n\t\t\t$stock->category_id \t= Input::get('category_name');\n\t\t\t$stock->note \t\t\t= Input::get('note');\n\t\t\t$stock->quantity\t\t= Input::get('quantity');\n\t\t\t$stock->save();\n\n\t\t\t// Update product stock\n\t\t\tProduct::updateInStock($stock->product_id);\n\n\t\t\treturn Redirect::route('stock.create')->with('message', 'Stock created successfully');\n\t\t}\n\t}",
"public function addToCart(Request $request)\n {\n $id = $request->id;\n $type = $request->type;\n $message = '';\n\n switch($type)\n {\n case 'file':\n $product = File::find($id);\n break;\n case 'episode':\n $product = Episode::find($id);\n break;\n case 'plan':\n $product = Plan::find($id);\n break;\n }\n\n\n if(!$product)\n {\n abort(404);\n }\n\n if(Auth::check())\n {\n $userId = Auth::id(); //extracting user ID\n $userCartExistance = Cart::HasCart($userId); //check if this user has any cart or not, this syntax returns true or false\n\n if($userCartExistance) // if logged in user has any cart then return cart object of this user\n {\n\n $userCart = Cart::userCart($userId); // returning cart object\n $cartId = $userCart->id; //returning cart's ID\n\n $productExistance = Cartable::CheckIfExists($cartId, $id, $type); //check if this product already exists in the cartables table or not\n\n if($productExistance) //if this product exists in the cart\n {\n $message = 'محصول موردنظر در سبد خرید شما موجود است.';\n }\n else\n {\n switch($type)\n {\n case 'file':\n $userCart->files()->attach($id);\n break;\n case 'episode':\n $userCart->episodes()->attach($id);\n break;\n case 'plan':\n $userCart->plans()->attach($id);\n break;\n }\n\n $message = 'محصول موردنظر به سبد خرید اضافه شد.';\n\n }\n\n }\n else //if logged in user has no cart then create one for her!\n {\n $userCart = new Cart();\n $userCart->user_id = $userId;\n $userCart->save();\n\n switch($type)\n {\n case 'file':\n $userCart->files()->attach($id);\n break;\n case 'episode':\n $userCart->episodes()->attach($id);\n break;\n case 'plan':\n $userCart->plans()->attach($id);\n break;\n }\n\n $message = 'محصول موردنظر به سبد خرید اضافه شد.';\n\n }\n }\n else // if user is not logged in then store cart information in session\n {\n $oldCart = Session::has('cart') ? Session::get('cart') : null;\n $cart = new ShoppingCart($oldCart);\n $message = $cart->add($product, $type, $id);\n Session::put('cart', $cart);\n }\n // route('showProduct', $id)\n // return redirect()->back()->with('message', $message);\n\n return response()->json(['message' => $message]);\n }",
"function store(Request $request){\n\n // $user->name = request('name');\n // // $user->email = request('email');\n // $user->address = request('address');\n // $user->doctor = request('doctor');\n // $user->save();\n // $user = auth()->user();\n\n $total = Cart::subtotal();\n //insert into orders table \n\n $order = UserOrder::create([\n 'user_id'=> auth()->user() ? auth()->user()->id : null,\n 'email' => $request->email,\n 'name' => $request->name,\n 'address' => $request->address,\n 'doctor' => $request->doctor,\n 'sub_total' => $total ,\n ]);\n\n //insert into product\n foreach(Cart::Content() as $item){\n PatientOrders::create([\n 'order_id' => $order->id,\n 'product_id' => $item->model->id,\n // 'quantity' => $item->qty\n\n ]);\n }\n\n Cart::destroy();\n return redirect()->route('list.index')->with('success_message', 'Order Placed'); \n }",
"public function store(Request $request)\n {\n $id = $request->get('product-id');\n $rowId = $this->getRowId($id);\n $quantity = $request->get('quantity');\n $product = Product::find($id);\n $cart_quantity = empty($rowId) ? 0 : Cart::get($rowId)->qty;\n if ($quantity + $cart_quantity > 5) {\n return back()->with('error', 'Chỉ cho phép thêm số lượng tối đa 5 trên mỗi sản phẩm!');\n }\n if ($quantity + $cart_quantity > $product->getQuantity()) {\n return back()->with('error', 'Chỉ còn lại '.$product->getQuantity().' sản phẩm');\n }\n Cart::add($id, $product->name, $quantity, 0);\n if (Auth::guard('customer')->check()) {\n $cart = ShoppingCart::where('customer_id', Auth::guard('customer')->user()->id)->first();\n if ($cart_quantity == 0) {\n $cart_product = new ShoppingCartProduct();\n $cart_product->shopping_cart_id = $cart->id;\n $cart_product->product_id = $id;\n $cart_product->quantity = $quantity;\n $cart_product->save();\n }\n else {\n $cart_product = $cart->getCartProductById($id);\n $cart_product->quantity = $quantity + $cart_quantity;\n $cart_product->update();\n }\n }\n return back()->with('success', 'Thêm vào giỏ hàng thành công.');\n }",
"public function store(Request $request)\n {\n $duplicates = Cart::search(function ($cartItem, $rowId) use ($request){\n return $cartItem->id === $request->id;\n });\n\n if ($duplicates->isNotEmpty()) {\n return redirect()->route('frontEnd.cart.index')->with('success_message', 'Item is already in your Cart');\n # code...\n }\n Cart::add($request->id, $request->name, $request->quantity, $request->price, ['size' => $request->productSize , 'color' => $request->productColor] )\n ->associate('App\\Product');\n\n return redirect()->route('frontEnd.cart.index')->with('success_message', 'Item was added to your cart!');\n \n }",
"public function addToCart(Request $request){\n if($request->session()->has('user'))\n {\n //add item info inside cart table\n $cart = new Cart;\n $cart->user_id = auth()->user()->id;\n $cart->product_id = $request->product_id;\n $cart->save();\n return redirect('/products');\n }else{\n return redirect('/login');\n }\n }",
"public function store(CartRequest $request, Product $product)\n {\n if($this->cartHasDuplicates($product, $request))\n {\n return redirect()->route('carts.show');\n }\n\n $this->addToCart($product, $request);\n\n $this->removeFromTheCustomCart($product, config('constants.wishcart'));\n\n return back();\n }",
"public function store(Request $request)\n {\n $product = new Product();\n\n $product->name = $request->name;\n $product->unitprice = $request->unitprice;\n $product->description = $request->description;\n $product->provider_id = $request->provider_id;\n \n $product->save();\n\n $storage = new Storage();\n $storage->product_id = $product->id;\n $storage->amount = 0;\n\n $storage->save();\n\n return redirect()->route('providers.index');\n }",
"public function store(Product $product)\n { \n Cart::add($product->id, $product->name , 1, $product->price)\n ->associate('App\\Product');\n return redirect()->route('cart.index')->with('success_message', 'Item was added to your cart!');\n \n }",
"public function store(Request $request) {\n $input = $request->only(\n [\n 'brand_id',\n 'branch_id',\n 'cart_type',\n ]\n );\n\n /* $input = $request->all();\n */\n $this->validate(\n $request,\n [\n 'brand_id' => 'required',\n 'cart_type' => 'required',\n ]\n );\n $brand_id = $input['brand_id'] ?? null;\n $branch_id = $input['branch_id'] ?? null;\n $cart_type = $input['cart_type'] ?? null;\n //pickup/delivery\n if (Auth::guard('api')->check()) {\n $userID = auth('api')->user()->getKey();\n }\n $user = Auth::user();\n $cart_item = $user->cart\n ->where('brand_id', $brand_id)\n ->where('branch_id', $branch_id)\n ->where('cart_type', $cart_type)\n ->first();\n\n if (!$cart_item) {\n $cart = Cart::create(\n [\n 'id' => md5(uniqid(rand(), true)),\n 'key' => md5(uniqid(rand(), true)),\n 'userID' => isset($userID) ? $userID : null,\n 'brand_id' => $brand_id,\n 'branch_id' => $branch_id,\n 'cart_type' => $cart_type,\n\n ]\n );\n } else {\n $cart = $cart_item;\n\n }\n return response()->json(\n [\n 'status' => 1,\n 'message' => 'done',\n 'cartToken' => $cart->id,\n 'cartKey' => $cart->key,\n ],\n 201\n );\n\n }",
"public function store(Request $request){\n\n $description = ([\n \"idProduc.required\" => \"Pleace do not move the HTML parameters\",\n \"producCant.required\" => \"por favor ingrese la cantidad\",\n \"producCant.min\" => \"ingrese un valor mayor a 0\"\n ]);\n\n $validations = ([\n \"idProduc\" => \"numeric|required\",\n \"producCant\" => \"required|numeric|min:0\"\n ]);\n\n $this->validate($request,$validations,$description);\n\n $cartDet = CartDetail::where('cart_id', auth()->user()->Cart->id )\n ->where('product_id', $request->idProduc )\n ->first();\n \n $message = \"Agregado a tu carrito de compras\";\n\n if($cartDet && $request->producCant >= 1){\n $cartDet->cuantity = ($cartDet->cuantity + $request->producCant);\n //$cartDet->selling_price = Produc::where('id',$request->idProduc)->first()->selling_price;\n $cartDet->save();\n }elseif($request->producCant >= 1){\n $cartDet = new CartDetail();\n $cartDet->product_id = $request->idProduc;\n $cartDet->cuantity = $request->producCant;\n //$cartDet->selling_price = Produc::where('id',$request->idProduc)->first()->selling_price;\n $cartDet->cart_id = auth()->user()->Cart->id;\n $cartDet->save();\n }else $message = \"Something was wrong\";\n\n return back()->with(compact('message'));\n }",
"public function store(Request $request)\n {\n $validatedData = $request->validate([\n 'product_id' => 'required',],\n [\n 'product_id.required' =>'Product is requed',\n ]);\n if (Auth::check()) {\n $carts=Cart::where('user_id',Auth::id())\n ->where('product_id',$request->product_id)\n ->where('order_id', NULL)\n ->first();\n }\n else\n {\n $carts=Cart::where('ip_address',request()->ip())\n ->where('product_id',$request->product_id)\n ->where('order_id',NULL)\n ->first();\n }\n //\n\n //\n \n if (!is_null($carts)) {\n $carts->increment('product_quantity'); \n }\n else{\n $cart= new Cart();\n if(Auth::check())\n {\n $cart->user_id =Auth::id();\n }\n $cart->ip_address=$request->ip();\n $cart->product_id=$request->product_id;\n $cart->save();\n\n }\n session()->flash('success','Product Add Successfuly');\n return back();\n\n }",
"public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }",
"public function store(Request $request)\n {\n $this->validate($request, [\n 'item_id' => 'required|max:60',\n 'item_name' => 'required|max:255'\n ]);\n\n $data = $request->all();\n $data[$this->account_id] = Auth::user()->account_id;\n\n Products::create($data);\n\n return redirect('/product');\n }",
"public function addtoCart(Request $request)\n {\n Session::forget('CouponAmount' );\n Session::forget('CouponCode');\n $data = $request->all();\n // echo \"<pre>\";print_r($data);die;\n if (empty($data['email'])) {\n $data['user_email'] = '';\n }\n $session_id = Str::random(40);\n Session::put('session_id', $session_id);\n $sizeArr = explode('-', $data['size']);\n DB::table('cart')->insert([\n 'product_id' => $data['product_id'],\n 'product_name' => $data['product_name'],\n 'product_code' => $data['product_code'],\n 'product_color' => $data['color'],\n 'price' => $data['price'],\n 'size' => $sizeArr[1],\n 'quantity' => $data['quantity'],\n 'user_email' => $data['user_email'],\n 'session_id' => $session_id\n ]);\n\n return redirect('/cart')->with('flash_message_success', 'Product has been added in cart');\n }",
"public function store(Request $request)\n {\n $user = User::where('id', $request->id)->first();\n Catalog::create(['user_id' => $user->id, 'login' => $user->name, 'name' => $request->name]);\n return redirect('/catalogs');\n }",
"public function store(Request $request)\n {\n $this->validate($request,[\n 'name'=>'required',\n 'address'=>'required',\n 'phone'=>'required'\n ]);\n\n if($request->payment_method != \"cash_in\"){\n if($request->transaction_id == NULL || empty($request->transaction_id)){\n return back()->with('error','Please Insert Transaction Id');\n }\n }\n $payment_id = Payment::where('short_name',$request->payment_method)->first();\n $order = new Order();\n if(Auth::check()){\n $order->user_id = Auth::id();\n }\n\n $order->email = $request->email;\n $order->name = $request->name;\n $order->address = $request->address;\n $order->phone = $request->phone;\n $order->ip_address = request()->ip();\n $order->payment_id = $payment_id->id;\n $order->transaction_id = $request->transaction_id;\n $order->save();\n\n foreach (Cart::totalCarts() as $cart){\n $cart->order_id = $order->id;\n $cart->save();\n }\n return redirect()->route('products.index')->with('success','Order Successful');\n\n\n }",
"public function storeProduct();",
"public function store(Request $request,Cart $cart)\n {\n //dd($request->all());\n //根据商品id获得商品数据\n $good=Good::find($request->id);\n //dd($good->toArray());\n //根据规格id获得规格数据\n $spec=Spec::find($request->spec);\n //dd($spec->toArray());\n //不同的用户买同一个商品,同一个规格 买多个,不希望每加一条都会在数据库中添加一条\n //希望只是num在增加.\n $newCart = Cart::where('user_id',auth()->id())->where('good_id',$request->id)->where('spec_id',$request->spec)->first();\n //dd($newCart);\n if (!$newCart){\n //执行购物车添加\n $cart->pic =$good->list_pic;\n $cart->good_id=$request->id;\n $cart->title =$good->title;\n $cart->spec =$spec->spec;\n $cart->price =$good->price;\n $cart->num =$request->num;\n $cart->user_id=auth()->id();\n $cart->spec_id=$request->spec;\n $cart->save();\n }else{\n $newCart->num = (int)$newCart['num'] + (int)$request->num;\n $newCart->save();\n }\n return ['code'=>1,'message'=>'添加成功'];\n }",
"public function addToCart($id){\n $produk=Product::findOrFail($id);\n Auth::loginUsingId(1);\n $user = Auth::user()->id;\n $addToCart = Cart::create(['product_id'=>$produk->id,\n 'user_id'=>$user]);\n return 'Berhasil Memasukan data ke cart list';\n }",
"public function addToCart()\n {\n $product = Cart::firstOrNew([\n 'user_id' => $this->student->id,\n 'product_id' => $this->id,\n 'product_type' => Enrollment::class\n ]);\n\n $product->save();\n return $product->id;\n }",
"public function store()\n {\n $command = new PostNewItemCommand(Input::get('title'), Input::get('currency'), Input::get('price'), Auth::user()->getAuthIdentifier());\n return $this->commandBus->execute($command);\n\n }",
"public function store(Request $request)\n {\n // dd($request->all());\n\n $product = Product::find($request->product);\n\n if ($product->attributes()->count() > 0) {\n $productAttr = $product->attributes()->where('default', 1)->first();\n\n if (isset($productAttr->sale_price)) {\n $product->price = $productAttr->price;\n\n if (!is_null($productAttr->sale_price)) {\n $product->price = $productAttr->sale_price;\n }\n }\n }\n\n $options = [];\n\n if ($request->has('productAttribute')) {\n $productAttribute = ProductAttribute::find($request->productAttribute);\n $attrValues = $productAttribute->attributesValues;\n $product->price = $productAttribute->price;\n\n if ($productAttribute->sale_price) {\n $product->price = $productAttribute->sale_price;\n }\n\n $options['product_attribute_id'] = $productAttribute->id;\n\n foreach ($attrValues as $value) {\n $attr = Attribute::find($value->attribute_id);\n $options[$attr->slug] = [\n 'value' => $value->value,\n 'code' => $value->code\n ];\n }\n\n // dd($options);\n }\n\n $cart = Cart::name('shopping');\n\n $cart->addItem([\n 'model' => $product,\n 'id' => $product->id,\n 'title' => $product->name,\n 'quantity' => $request->quantity,\n 'price' => $product->price,\n 'options' => $options,\n ]);\n\n return redirect()->route('cart.index')->withSuccess('Thêm vào giỏ thành công');\n }",
"public function store() {\n $input = Request::all();\n $userStock = new UserStock ();\n $userStock->stock_id = $input ['stockId'];\n $userStock->users_id = $input ['userId'];\n $userStock->name = $input ['name'];\n $userStock->description = $input ['description'];\n $userStock->flag = '1';\n $userStock->save();\n return redirect('viewManageUserStock');\n }",
"public function addToCart()\n\t{\n\t\t$recordId = $this->request->getInteger('record');\n\t\t$amount = $this->request->getInteger('amount', 1);\n\t\tif ($this->cart->has($recordId)) {\n\t\t\t$this->cart->add($recordId, $amount);\n\t\t} else {\n\t\t\t$this->cart->set($recordId, $amount, [\n\t\t\t\t'priceNetto' => (float) $this->request->get('priceNetto', 0.0),\n\t\t\t\t'priceGross' => (float) $this->request->get('priceGross', 0.0),\n\t\t\t]);\n\t\t}\n\t\t$this->saveCart();\n\t}",
"public function store(Request $request)\n {\n\n if($request->session()->get('cart') != null){\n $requierement = new Requierement();\n $requierement->recibe = Auth::user()->name . ' ' . Auth::user()->last_name;\n $requierement->state = \"pedido\";\n $requierement->save();\n $cart = $request->session()->get('cart');\n foreach ($cart as $key => $item) {\n // dd($sale);\n $detail = new RequierementDetail();\n $detail->request = $item['amount'];\n $detail->item_id = $item['item_id'];\n $detail->requirement_id = $requierement->id;\n $detail->save();\n }\n $request->session()->forget('cart');\n }\n return redirect(route('public.index'));\n }",
"public function store()\n {\n # code...\n $item = new Item();\n\n $item->item_name = request('itemname');\n $item->price = request('itemprice');\n $item->itemCategory = request('type');\n $item->save();\n return redirect()->route('item.index');\n }",
"public function addtocart(Request $request, $id)\n {\n //\n $products_data = Products::find($id);\n // return $products_data;\n $old_cart = Session::has('cart') ? Session::get('cart') : null;\n\n\n $cart = new Cart($old_cart);\n // return $cart;\n $cart->add($products_data, $products_data->id);\n $request->session()->put('cart', $cart);\n // dd($request->session()->get('cart'));\n return redirect('/products');\n }",
"public function store(Request $request)\n {\n\n $validated = $request->validate([\n 'name' => 'required',\n 'lname' => 'required',\n 'email' => 'required|email',\n 'wilaya' => 'required',\n 'address' => 'required',\n 'codep' => 'required|Numeric',\n 'tel' => 'required|Numeric|min:11',\n ]);\n\n // Verifier si la quantité chercher par le client existe\n if ($this->findustock()) {\n return redirect()->route('cart.index', app()->getLocale())->with('danger', \"Un des produits que vous avez selectionner n'est pas disponible\");\n }\n\n\n $order = new Order();\n $order->nom = $request->name;\n $order->prenom = $request->lname;\n $order->email = $request->email;\n $order->wilaya = $request->wilaya;\n $order->address = $request->address;\n $order->code = $request->codep;\n $order->tel = $request->tel;\n $order->price = floatval(Cart::subtotal());\n $order->user_id = Auth::user()->id;\n $order->etat = 'en attente';\n\n $order->save();\n \n $orderproduct = new OrderProduct();\n foreach(Cart::content() as $item ){\n OrderProduct::create([\n 'order_id' => $order->id,\n 'product_id' => $item->model->id,\n ]);\n }\n \n $this->updatestock();\n Cart::destroy();\n\n return redirect()->route('success', app()->getLocale())->with(\"message\", \"Commande réussi\");\n\n }",
"public function store()\n\t{\n\t\t$depositItem = DepositItem::create(Input::all());\n\t\treturn Response::json($depositItem);\n\t}"
] | [
"0.81081665",
"0.7560818",
"0.7444694",
"0.7423214",
"0.73532426",
"0.73356307",
"0.7317357",
"0.72753644",
"0.7273217",
"0.72604275",
"0.7255526",
"0.7248813",
"0.724834",
"0.72069544",
"0.71948004",
"0.71945536",
"0.71772474",
"0.71290106",
"0.70973164",
"0.7092513",
"0.7088958",
"0.70749116",
"0.7070667",
"0.705785",
"0.7056115",
"0.70451635",
"0.70277566",
"0.70046115",
"0.6972326",
"0.6969046",
"0.6953213",
"0.69515055",
"0.69226074",
"0.6918044",
"0.6901793",
"0.68770933",
"0.6855564",
"0.68465203",
"0.68319905",
"0.68018913",
"0.6792848",
"0.6773695",
"0.675342",
"0.6729597",
"0.6678301",
"0.6667518",
"0.6667206",
"0.66648626",
"0.6647066",
"0.66417485",
"0.66242635",
"0.6623361",
"0.66106063",
"0.65985084",
"0.65858203",
"0.6585471",
"0.6582004",
"0.65816003",
"0.65770113",
"0.6574244",
"0.6572242",
"0.65619445",
"0.65533245",
"0.6553002",
"0.6508466",
"0.65031046",
"0.6494205",
"0.6492171",
"0.64888483",
"0.6488779",
"0.647515",
"0.64679456",
"0.6460424",
"0.6460314",
"0.6457692",
"0.6451837",
"0.64497954",
"0.64458776",
"0.6431668",
"0.64022166",
"0.6389838",
"0.6356835",
"0.63555044",
"0.6346101",
"0.63405985",
"0.6333732",
"0.6333017",
"0.6330936",
"0.63220054",
"0.63202167",
"0.63166064",
"0.6314655",
"0.6312741",
"0.63119876",
"0.6306169",
"0.6304941",
"0.6304375",
"0.62926394",
"0.6290258",
"0.6286556"
] | 0.70612425 | 23 |
Display the specified Cart. | public function show(Cart $cart, Request $request)
{
// $validator = Validator::make($request->all(), [
// 'cartKey' => 'required',
// ]);
// if ($validator->fails()) {
// return response()->json([
// 'errors' => $validator->errors(),
// ], 400);
// }
// $cartKey = $request->input('cartKey');
// if ($cart->key == $cartKey) {
return response()->json([
'cart' => $cart->id,
'Items in Cart' => $cart->items,
], 200);
// } else {
// return response()->json([
// 'message' => 'The CarKey you provided does not match the Cart Key for this Cart.',
// ], 400);
// }
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(Cart $cart)\n {\n //\n }",
"public function show(Cart $cart)\n {\n //\n }",
"public function show(Cart $cart)\n {\n //\n }",
"public function show(Cart $cart)\n {\n //\n }",
"public function show(Cart $cart)\n {\n //\n }",
"public function show(Cart $cart)\n {\n //\n }",
"public function show(Cart $cart)\n {\n //\n }",
"public function show(Cart $cart)\n {\n //\n }",
"public function show(cart $cart)\n {\n //\n }",
"public function showCart()\n\t{\n\t\t $session_name = \"c_product\";\n\n\t\t// if (!isset($_SESSION[\"$session_name\"]) || !in_array($p, $_SESSION[\"$session_name\"]))\n\t\t// {\n\t\t// \t$_SESSION[\"$session_name\"][] = $p;\t\t\n\t\t// }\n\t\t$total = 0;\n\t\tforeach ($_SESSION[\"$session_name\"] as $id)\n\t\t{\n\t\t\t$total += $this->showProductInCart($id);\n\t\t}\n\t\t$total = number_format($total);\n\t\t$totalprice = <<<DELIMITER\n\t\t\t<div class=\"row\">\n\t\t\t\t<div class=\"col-3\">\n\t\t\t\t\t<h4> TOTAL PRICE: </h4>\n\t\t\t\t</div>\n\t\t\t\t<div class=\"col-6\" style=\"text-align:right\">\n\t\t\t\t\t<h3 style= \"color:red\">{$total}₫</h3>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t\t<hr>\n\t\tDELIMITER;\n\t\techo $totalprice;\n\t}",
"public function showCart($cart) {\n $this->logInfo('carro: ' . str_replace('\"', \"'\", json_encode($cart)));\n }",
"public function show(Cart $cart)\n {\n dd('show');\n }",
"public function show(UserCart $userCart) {\n\t\t//\n\t}",
"public function cart(): void\n {\n $userData = $this->getSession()->getCurrentUserData();\n\n if ($userData->getCart() && $userData->getCart()->hasProducts())\n {\n echo $this->render('cart/shoppingCart', $userData->getRenderCartParams());\n }\n }",
"public function printCart()\n {\n if ( !(isEmpty() ) )\n {\n foreach( $this->cartItems as $item )\n {\n echo $item->getModelNumber();\n echo \"\\r\" ;\n }\n }\n else\n {\n echo \"Cart is empty in Cart.php\";\n }\n }",
"public function viewCart(){\r\n $data =(isset($_SESSION['cart']))? $_SESSION['cart']:array('cart' => 'empty');\r\n render('cart',$data);\r\n }",
"public function show()\n {\n return view('cart.show')->with([\n 'cart' => cart(),\n ]);\n }",
"public function show(){\n $data=$this->cart->contents();\n echo \"<pre>\";\n print_r($data);\n echo \"</pre>\";\n\t}",
"public function show()\n {\n return view('fontend.pages.cart.carts');\n }",
"public function show()\n {\n $cartItems = $this->getCartContent();\n\n $products = $this->findProducts($cartItems);\n\n return view('carts.show', compact('cartItems', 'products'));\n }",
"public function actionShow() {\n $session = $this->session;\n $this->layout = false; // loading only view file, without layout;\n $items_to_show = $this->getProductObject($session);\n return $this->render('cart-modal', compact('session', 'cart_products', 'items_to_show'));\n }",
"public function showCart()\n {\n $carts=Cart::content();\n foreach ($carts as $cart) {\n $products = Products::findOrFail($cart->id);\n $quantityInStock = $products->quantityInStock - $cart->qty;\n DB::table('products')\n ->where('id','=', $cart->id)\n ->update(['quantityInStock' => $quantityInStock]);\n }\n $total=Cart::total();\n return view('users.pages.cart', compact('carts', 'total'));\n }",
"public function showCartButton() {\n\t\t\n\t\techo $this->getCartButton();\n\t}",
"public function show(Cart $cart)\n {\n //TODO GET ALL VOUCHER THAT SELLER HAS\n $vouchers = null;\n return view('pages.carts.show', compact('cart', 'vouchers'));\n }",
"public function cartAction()\r\n\t{\r\n\t\t$this->_view->_title = 'Giỏ hàng';\r\n\t\t$this->_view->motoInCart = $this->_model->listItem($this->_arrParam, ['task' => 'motos_in_cart']);\r\n\t\t$this->_view->render($this->_arrParam['controller'] . '/cart');\r\n\t}",
"public function show(CartModel $cartModel)\n {\n //\n }",
"public function display()\n\t\t{\n\t\t\techo \"<table border=\\\"1\\\">\";\n\t\t\techo \"<tr><th>Artikel</th><th>Menge</th><th>Optionen</th></tr>\";\n\t\t\tforeach ($this->items as $art=>$qty)\n\t\t\t\techo \"<tr>\n\t\t\t\t\t\t<td>$art</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<form name='qtyForm' action='cart.php' method='get'>\n\t\t\t\t\t\t\t\t<input type='hidden' name='artChangeQty' value='$art'/>\n\t\t\t\t\t\t\t\t<input name='artQty' value='$qty'/>\n\t\t\t\t\t\t\t\t<input name='positive' type='submit' value='1' />\n\t\t\t\t\t\t\t\t<input name='negative' type='submit' value='-1' />\n\t\t\t\t\t\t\t\t<br/>\n\t\t\t\t\t\t\t\t<input type='submit' value='Ändern' />\n\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t<form name='removeForm' action='cart.php' method='get'>\n\t\t\t\t\t\t\t\t<input type='hidden' name='artRemoveAll' value='$art'/>\n\t\t\t\t\t\t\t\t<input type='submit' value='Remove' />\n\t\t\t\t\t\t\t</form>\n\t\t\t\t\t\t</td>\n\t\t\t\t\t </tr>\";\n\t\t\techo \"</table>\";\n\t\t}",
"public function showCart(Request $request){\n\n $cart_items=Cart::content();\n return view('frontend.cart',['configurations'=>$this->configuration,'cart_items'=>$cart_items]);\n\n }",
"function printCart(){\n\t\tprint_r($this->articulos);\n\t}",
"public function show()\n {\n return view('carts');\n }",
"public function view_cart()\n {\n $this->layout = 'cart';\n $cart = $this->Session->read('cart'); //doc session va gui session len tren view\n $payment = $this->Session->read('payment');\n $this->set(compact('cart','payment')); //gửi nhiều biến cùng 1 lúc lên view\n $this->set('title_for_layout', 'Giỏ hàng - ChickenRainShop');\n\n }",
"public function show()\n {\n $cart = Cart::content();\n\n return view('customer_side.pages.cart') ->with('cart', $cart);\n }",
"public function viewCartAction(Request $request)\n {\n $session = $request->getSession();\n\n if (!$session->has('cart')) $session->set('cart', array());\n\n $em = $this->getDoctrine()->getManager();\n $products = $em->getRepository('WizishopCoreBundle:Product')->findArray(array_keys($session->get('cart')));\n\n return $this->render('WizishopCoreBundle:Core:cart.html.twig', array(\n 'products' => $products,\n 'cart' => $session->get('cart'),\n ));\n }",
"public function show()\n {\n if(count(auth()->user()->cart()->get()) ==0)\n return back();\n return view('cart.show');\n }",
"public function index() \n\t{\n $this->initModel('Cart_model');\n\n\t\tif(!empty($_SESSION['cart']->getProdList()))\n\t\t{\n //We instansiate cartItems method where we save the new array from session\n\t\t$data = $this->modelObj->showCart();\n $this->reqView('Cart', $data);\n\n\t\t} else {\n\t\t\t$this->reqView('Cart');\n\t\t}\n //This will be shown on our cart page\n\t}",
"public function indexAction()\n\t{\n\t\t$cart = Cart::find();\n\t\n\t\t// send data to the view\n\t\t$this->view->cart = $cart;\n\t}",
"public function show()\n\t{\n\t\t$cart= Cart::content()->groupBy('options.store_name');\n\n\n if(Session::get('lang') == 'en'){\n return view('en.cart.my-cart', compact('cart'));\n }\n return view('ar.cart.my-cart', compact('cart'));\n\t\n }",
"public function show($id)\n\t{\n\t\t$cart = Cart::findOrFail($id);\n\n\t\treturn View::make('cart.show', compact('cart'));\n\t}",
"public function show(ProductsInShoppingCart $productsInShoppingCart)\n {\n //\n }",
"public function show(Request $request)\n {\n $cartDbEntry = $this->retrieveCartDatabaseEntry($request);\n\n if ($cartDbEntry) {\n $cartItems = json_decode($cartDbEntry->items);\n $total = $cartDbEntry->total;\n } else {\n $cartItems = null;\n $total = 0;\n }\n\n return view('cart', ['cartItems' => $cartItems, 'total' => $total]);\n }",
"public function showCart(){\n\n // $oldCart = Cookie::get('cart');\n // $cart = new Cart($oldCart);\n // $products = $cart->items;\n\n /* Cart by Session */\n\n // if(Session::has('cart')){\n // return view('cart.index',compact('products => null'));\n // }\n $user_id = Auth::id();\n $profile = User::find($user_id);\n $oldCart = Session::get('cart');\n $cart = new Cart($oldCart);\n $products = $cart->items;\n $totalQty = $cart->totalQty;\n $totalPrice = $cart->totalPrice;\n $totalPriceThai = $this->getConvertNumberString( $totalPrice );\n\n // return view('cart.index',['products' => $cart->items, 'totalQty'=>$cart->totalQty, 'totalPrice'=>$cart->totalPrice]);\n return view('cart.index',compact('profile','products','totalQty','totalPrice', 'totalPriceThai'));\n }",
"public function show($id)\n {\n return view('website.cart.show', ['cart' => Cart::findOrFail($cart)]);\n }",
"public function show()\n\t{\n\t\t//\tObteniendo los productos del carro.\n\t\t$cart = \\Session::get('cart');\n\t\t//\tCalculando el total.\n\t\t$total = $this->total();\n\t\treturn view('home.cart',compact('cart', 'total'));\n\t}",
"public function view_cart(){\n\t\t//Devuelve el carrrtio\n\t\t$data['title'] = 'Detalle de la Compra';\n\t\t$data['active'] = 2; //punto 2 del sidebar\n\t\t//Obtener carrito\n\t\t$userid = $_SESSION['logged_in']['userid'];\n\t\t$data['carrito'] = $this->cila_model->get_carrito($userid);\n\t\t$this->loadview('shop-cart',$data);\n\n\t}",
"public function showUserCart()\n\t{\n\n\t\t$modelUserCart = $this->getModel('usercart');\n\t\t$userId = $this->_getUserId();\n\n\t\tif (!JSession::checkToken('get'))\n\t\t{\n\n\t\t\techo new JResponseJson(null, JText::_('JINVALID_TOKEN'), true);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$modelUserCart->getUserCart($userId);\n\t\t\techo new JResponseJson($modelUserCart->getUserCart($userId),true, false);\n\n\t\t}\n\t}",
"public function show( Cart $cart, Request $request ) {\n $this->validate( $request, [\n 'cartKey' => 'required',\n ] );\n /* $validator = Validator::make( $request->all(), [\n 'cartKey' => 'required',\n ] );\n\n if ( $validator->fails() ) {\n return response()->json( [\n 'errors' => $validator->errors(),\n ], 400 );\n } */\n\n $cartKey = $request->input( 'cartKey' );\n if ( $cart->key == $cartKey ) {\n\n return response()->json( [\n 'cart' => $cart->id,\n 'data' => new CartItemCollection( $cart->items ),\n ], 200 );\n\n } else {\n\n return response()->json( [\n 'message' => 'The CarKey you provided does not match the Cart Key for this Cart.',\n ], 400 );\n }\n\n }",
"public function cart()\n {\n\n $cartCollection = \\Cart::getContent();\n\n return view('cart',compact('cartCollection'));\n }",
"public function goToCart(){\n $cart = Cart::content();\n $this->data['cart'] = $cart;\n return view('Customer.Layouts.cart',$this->data);\n }",
"public function show()\n {\n $cart = session('cart', array());\n $products = Product::whereIn('id', array_keys($cart))->get();\n $total = 0;\n foreach($products as $product)\n {\n $total += $product->price * $cart[$product->id];\n }\n return view('cart', compact('cart', $cart, 'products', $products, 'total', $total));\n }",
"public static function cart_show(){\r\n\t\t\tglobal $wpdb;\r\n\r\n\t\t\tif (isset($_SESSION['cartArray']) && !empty($_SESSION['cartArray'])) {\r\n\r\n\t\t\t\t$cartArray = $_SESSION['cartArray'];\r\n\t\t\t\t\t$cartString = implode(\",\", array_unique($cartArray));\r\n\t\t\t\t\t$cartString = RBAgency_Common::clean_string($cartString);\r\n\r\n\t\t\t\t// Show Cart\r\n\t\t\t\t$query = \"SELECT profile.*,media.* FROM \". table_agency_profile .\" profile, \". table_agency_profile_media .\" media WHERE profile.ProfileID = media.ProfileID AND media.ProfileMediaType = \\\"Image\\\" AND media.ProfileMediaPrimary = 1 AND profile.ProfileID IN (\". $cartString .\") ORDER BY profile.ProfileContactNameFirst ASC\";\r\n\t\t\t\t$results = $wpdb->get_results($query,ARRAY_A) or die( \"<a href=\\\"?page=\". $_GET['page'] .\"&action=cartEmpty\\\" class=\\\"button-secondary\\\">\". __(\"No profile selected. Try again\", RBAGENCY_casting_TEXTDOMAIN) .\"</a>\"); //die ( __(\"Error, query failed\", RBAGENCY_casting_TEXTDOMAIN ));\r\n\t\t\t\t$count = $wpdb->num_rows;\r\n\t\t\t\techo \"<div class=\\\"boxblock-container\\\" style=\\\"float: left; padding-top:24px; width: 49%; min-width: 500px;\\\">\\n\";\r\n\t\t\t\techo \"<div style=\\\"float: right; width: 100px; \\\"><a href=\\\"?page=\". $_GET['page'] .\"&action=cartEmpty\\\" class=\\\"button-secondary\\\">\". __(\"Empty Cart\", RBAGENCY_casting_TEXTDOMAIN) .\"</a></div>\";\r\n\t\t\t\techo \"<div style=\\\"float: left; line-height: 22px; font-family:Georgia; font-size:13px; font-style: italic; color: #777777; \\\">\". __(\"Currently\", RBAGENCY_casting_TEXTDOMAIN) .\" <strong>\". $count .\"</strong> \". __(\"in Cart\", RBAGENCY_casting_TEXTDOMAIN) .\"</div>\";\r\n\t\t\t\techo \"<div style=\\\"clear: both; border-top: 2px solid #c0c0c0; \\\" class=\\\"profile\\\">\";\r\n\r\n\t\t\t\tif ($count == 1) {\r\n\t\t\t\t\t$cartAction = \"cartEmpty\";\r\n\t\t\t\t} elseif ($count < 1) {\r\n\t\t\t\t\techo \"\". __(\"There are currently no profiles in the casting cart\", RBAGENCY_casting_TEXTDOMAIN) .\".\";\r\n\t\t\t\t\t$cartAction = \"cartEmpty\";\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$cartAction = \"cartRemove\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\tforeach ($results as $data) {\r\n\r\n\t\t\t\t\t$ProfileDateUpdated = $data['ProfileDateUpdated'];\r\n\t\t\t\t\techo \" <div style=\\\"position: relative; border: 1px solid #e1e1e1; line-height: 22px; float: left; padding: 10px; width: 210px; margin: 6px; \\\">\";\r\n\t\t\t\t\techo \" <div style=\\\"text-align: center; \\\"><h3>\". stripslashes($data['ProfileContactNameFirst']) .\" \". stripslashes($data['ProfileContactNameLast']) . \"</h3></div>\";\r\n\t\t\t\t\techo \" <div style=\\\"float: left; width: 100px; height: 100px; overflow: hidden; margin-top: 2px; \\\"><img style=\\\"width: 100px; \\\" src=\\\"\". RBAGENCY_UPLOADDIR .\"\". $data['ProfileGallery'] .\"/\". $data['ProfileMediaURL'] .\"\\\" /></div>\\n\";\r\n\t\t\t\t\techo \" <div style=\\\"float: left; width: 100px; height: 100px; overflow: scroll-y; margin-left: 10px; line-height: 11px; font-size: 9px; \\\">\\n\";\r\n\r\n\t\t\t\t\tif (!empty($data['ProfileDateBirth'])) {\r\n\t\t\t\t\t\techo \"<strong>\".__(\"Age:\",RBAGENCY_casting_TEXTDOMAIN).\"</strong> \". rb_agency_get_age($data['ProfileDateBirth']) .\"<br />\\n\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t// TODO: ADD MORE FIELDS\r\n\r\n\t\t\t\t\techo \" </div>\";\r\n\t\t\t\t\techo \" <div style=\\\"position: absolute; z-index: 20; top: 120px; left: 200px; width: 20px; height: 20px; overflow: hidden; \\\"><a href=\\\"?page=\". $_GET['page'] .\"&actiontwo=cartRemove&action=cartAdd&RemoveID=\". $data['ProfileID'] .\"&\\\" title=\\\"\". __(\"Remove from Cart\", RBAGENCY_casting_TEXTDOMAIN) .\"\\\"><img src=\\\"\". RBAGENCY_PLUGIN_URL .\"style/remove.png\\\" style=\\\"width: 20px; \\\" alt=\\\"\". __(\"Remove from Cart\", RBAGENCY_casting_TEXTDOMAIN) .\"\\\" /></a></div>\";\r\n\t\t\t\t\techo \" <div style=\\\"clear: both; \\\"></div>\";\r\n\t\t\t\t\techo \" </div>\";\r\n\t\t\t\t}\r\n\r\n\t\t\t\techo \" <div style=\\\"clear: both;\\\"></div>\\n\";\r\n\t\t\t\techo \"</div>\";\r\n\r\n\t\t\t\tif (($cartAction == \"cartEmpty\") || ($cartAction == \"cartRemove\")) {\r\n\t\t\t\techo \"<a name=\\\"compose\\\"> </a>\";\r\n\t\t\t\techo \"<div class=\\\"boxblock\\\">\\n\";\r\n\t\t\t\techo \" <h3>\". __(\"Cart Actions\", RBAGENCY_casting_TEXTDOMAIN) .\"</h3>\\n\";\r\n\t\t\t\techo \" <div class=\\\"inner\\\">\\n\";\r\n\t\t\t\techo \" <a href=\\\"?page=rb_agency_searchsaved&action=searchSave\\\" title=\\\"\". __(\"Save Search & Email\", RBAGENCY_casting_TEXTDOMAIN) .\"\\\" class=\\\"button-primary\\\">\". __(\"Save Search & Email\", RBAGENCY_casting_TEXTDOMAIN) .\"</a>\\n\";\r\n\t\t\t\techo \" <a href=\\\"?page=rb_agency_search&action=massEmail#compose\\\" title=\\\"\". __(\"Mass Email\", RBAGENCY_casting_TEXTDOMAIN) .\"\\\" class=\\\"button-primary\\\">\". __(\"Mass Email\", RBAGENCY_casting_TEXTDOMAIN) .\"</a>\\n\";\r\n\t\t\t\techo \" <a href=\\\"#\\\" onClick=\\\"window.open('\". get_bloginfo(\"url\") .\"/profile-print/?action=castingCart&cD=1','mywindow','width=930,height=600,left=0,top=50,screenX=0,screenY=50,scrollbars=yes')\\\" title=\\\"Quick Print\\\" class=\\\"button-primary\\\">\". __(\"Quick Print\", RBAGENCY_casting_TEXTDOMAIN) .\"</a>\\n\";\r\n\t\t\t\techo \" <a href=\\\"#\\\" onClick=\\\"window.open('\". get_bloginfo(\"url\") .\"/profile-print/?action=castingCart&cD=0','mywindow','width=930,height=600,left=0,top=50,screenX=0,screenY=50,scrollbars=yes')\\\" title=\\\"Quick Print - Without Details\\\" class=\\\"button-primary\\\">\". __(\"Quick Print\", RBAGENCY_casting_TEXTDOMAIN) .\" - \". __(\"Without Details\", RBAGENCY_casting_TEXTDOMAIN) .\"</a>\\n\";\r\n\t\t\t\techo \" </div>\\n\";\r\n\t\t\t\techo \"</div>\\n\";\r\n\t\t\t\t}// Is Cart Empty\r\n\r\n\t\t\t} else {\r\n\r\n\t\t\t\techo \"<p>There are no profiles added to the casting cart.</p>\\n\";\r\n\r\n\t\t\t}\r\n\r\n\r\n\t\t}",
"function show_cart(){\n \t$output = '';\n \t$no = 0;\n \tforeach ($this->cart->contents() as $items) {\n \t\t$no++;\n \t\t$output .='\n \t\t<tr>\n \t\t<td>'.$items['name'].'</td>\n \t\t<td>'.number_format($items['price']).'</td>\n \t\t<td>'.$items['qty'].'</td>\n \t\t<td>'.number_format($items['subtotal']).'</td>\n \t\t<td><button type=\"button\" id=\"'.$items['rowid'].'\" class=\"hapus_cart btn btn-danger btn-xs\">Batal</button></td>\n \t\t</tr>\n \t\t';\n \t}\n \t$output .= '\n \t<tr>\n \t<th colspan=\"3\">Total</th>\n \t<th colspan=\"2\">'.'Rp '.number_format($this->cart->total()).'</th>\n \t</tr>\n \t';\n \treturn $output;\n }",
"function lb_show_view_cart_page_action() {\n\tlb_show_templates(\n\t\tarray(\n\t\t\t'name' => 'view-cart',\n\t\t)\n\t);\n}",
"public function show(Cart $cart, Request $request) {\n $this->validate(\n $request,\n [\n 'cartKey' => 'required',\n ]\n );\n /* $validator = Validator::make( $request->all(), [\n 'cartKey' => 'required',\n ] );\n\n if ( $validator->fails() ) {\n return response()->json( [\n 'errors' => $validator->errors(),\n ], 400 );\n } */\n\n $cartKey = $request->input('cartKey');\n if ($cart->key == $cartKey) {\n $total_quantity = CartItem::where(['cart_id' => $cart->getKey()])->sum('quantity');\n $total_price = CartItem::where(['cart_id' => $cart->getKey()])->sum('price');\n return response()->json(\n [\n 'status' => 1,\n 'cart' => $cart->id,\n 'total_quantity' => (string)$total_quantity,\n 'total_price' => 'AED ' . $total_price,\n 'data' => new CartItemCollection($cart->items),\n ],\n 200\n );\n\n } else {\n\n return response()->json(\n [\n 'status' => 0,\n 'message' => 'The CarKey you provided does not match the Cart Key for this Cart.',\n ],\n 400\n );\n }\n\n }",
"public function index()\n\t{\n\t\t// $this->load->model('Product');\n\t\t// $queryRecords = $this->Product->list_product();\n\t\t// $data['products'] = $queryRecords; \n\t\t$data['cart_list'] = $this->cart->contents();\n\n\t\t$this->load->view('cart',$data);\n\t}",
"public function viewCart()\n {\n return view('shoppingCart.cart');\n }",
"public function show(Cartas $cartas)\n {\n //\n }",
"public function index()\n {\n $cart = $this->cartRepository->getCart();\n return view('cart.index', compact('cart'));\n }",
"public function show(Request $request)\n {\n $cart = Cart::find($request->id);\n $cart->check_product();\n return view('front.account.cart-show', compact('cart'));\n }",
"public function cart(){\n return view('pages.cart', compact('cart'));\n }",
"public function index()\n\t{\n\t\t$carts = Cart::all();\n\n\t\treturn View::make('cart.index', compact('carts'));\n\t}",
"public function cart()\n {\n return view('carts.cart');\n }",
"public function show()\n {\n\n\n if (session('cart')) {\n // dd(session('cart'));\n $products = collect([]);\n\n foreach (session('cart') as $product) {\n\n $currentProduct = collect([]);\n $currentProduct->push(Product::find($product['id']));\n $currentProduct->push($product['qty']);\n $products->push($currentProduct);\n }\n\n $total = 0;\n foreach ($products as $product) {\n\n $total = $total + ($product[0]['price'] * $product[1]);\n }\n\n $totalProducts = 0;\n foreach ($products as $product) {\n\n $totalProducts = $totalProducts + $product[1];\n }\n } else {\n\n return view('noproducts');\n }\n\n\n if (empty($products)) {\n\n $productsExists = false;\n } else {\n\n $productsExists = true;\n };\n\n return view('checkout', compact('products', 'total', 'totalProducts', 'productsExists'));\n }",
"public function index()\n\t{\n# \\Cart::destroy();return;\n $contents = \\Cart::content()->paginate(5);\n// foreach ($contents as $row) {\n//// echo 'You have ' . $row->qty . ' items of ' . $row->product->name . ' with description: \"' . $row->product->description . '\" in your cart.';\n// }\n\n $total = number_format(\\Cart::total(), 2);\n $this->view('shopcart.index', compact('contents', 'total'));\n\n\t}",
"public function cart(Request $request)\n {\n return view('frontend.cart.cartdetail');\n }",
"public function index()\n {\n $carts = Cart::latest()->get();\n return view('backend.cart.index', compact('carts'));\n }",
"public function cartView()\n {\n $cartItems = Cart::content();// получаем весь массив айдишников товаров текущего экземпляра корзины\n\n return view('basket', ['items' => $cartItems]);\n }",
"public function index()\n {\n $products = Cart::all();\n\n return view('cart')\n ->with('cart',$products);\n }",
"public function show(CartaPorte $cartaPorte)\n {\n //\n }",
"public function index(MyHelpers $cart)\n\t{\n $products = $cart->cartProducts();\n return view('cart', ['cart' => $cart, 'products' => isset($products) ? $products : null]);\n }",
"public function actionIndex(){\n\n $session = Yii::$app->session;\n\n $items = $session['cart'];\n\n return $this->render('index',[\n 'items' => $items,\n ]);\n\n }",
"function display_cart()\n\t\t{\n\t\t\tglobal $connect;\n\t\t\tglobal $currency;\n\t\t\tif(isset($_SESSION['cart']))\n\t\t\t{\n\t\t\t\tif(isset($_POST['place-order-btn']))\n\t\t\t\t{\n\t\t\t\t\tinsert_order();\n\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t$cart = $_SESSION['cart'];\n\t\t\t\t$html = '';\n\t\t\t\t$html.='\n\t\t\t\t<div class=\"cv-order-detail spacer-top-less spacer-bottom\">\n\t\t\t <div class=\"container\">\n\t\t\t <div class=\"cv-heading\">\n\t\t\t <h1>product details</h1>\n\t\t\t <p>Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat.</p>\n\t\t\t </div>\n\t\t\t <div class=\"row\">\n\t\t\t <div class=\"col-md-12\">\n\t\t\t <div class=\"cv-last-order\">\n\t\t\t <table>\n\t\t\t <thead>\n\t\t\t <tr>\n\t\t\t <th>Product name</th>\n\t\t\t <th>unit price</th>\n\t\t\t <th>Quantity</th>\n\t\t\t <th>Total</th>\n\t\t\t </tr>\n\t\t\t </thead>\n\t\t\t <tbody>\n\t\t\t\t';\n\n\t\t\t\tforeach ($cart as $key => $value) {\n\t\t\t\t\t// Fetch cart details\n\t\t\t\t\t$cart_table_qry = \"select * from product where product_id=$value[product_id] and status=1\";\n $cart_table_qry_result = mysqli_query($connect,$cart_table_qry); \n $cart_table_arr = mysqli_fetch_assoc($cart_table_qry_result); \n\n\n\t\t\t\t\t$html.='<tr>\n\t <td>'.$cart_table_arr['product_name'].'</td>\n\t <td>'.$currency.$cart_table_arr['product_price'].'</td>\n\t <td>'.$value['quantity'].'</td>\n\t <td>'.$currency.$value['quantity'] * $cart_table_arr['product_price'].'</td>\n\t </tr>';\n\t\t\t\t}\n\t\t\t\t\t$html.='<tr>\n <td colspan=\"2\" class=\"cv-d-none\"></td>\n <td><b>Grand Total</b></td>\n <td class=\"cv-price\">'.$currency.$_SESSION['grand_total'].'</td>\n </tr>\n\t\t\t\t\t\t\t\t\t\t</tbody>\n\t\t\t\t\t\t\t\t\t</table>\n \t\t\t</div>\n\t\t <div class=\"cv-cart-btn\">\n\t\t <form method=\"post\" action='.$_SERVER['PHP_SELF'].'>\n\t\t <input href=\"javascript:void(0)\" class=\"cv-btn place-order-btn\" type=\"submit\" value=\"place order\" name=\"place-order-btn\">\n\t\t </form>\n\t\t </div>\n\t\t </div>\n\t\t </div>\n\t\t <p class=\"font-weight-bold\">Only COD(Cash on delivery) payment mehod is available.</p>\n\t\t </div>\n\t\t </div>';\n\t\t\t\t\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$html ='';\n\t\t\t}\n\t\t\techo $html;\n\t\t}",
"public function show(carts $carts)\n {\n return $id;\n }",
"public function show(){\n $cart = session()->get('cart');\n return $cart;\n }",
"public function index()\n\t{\n\t\t$items = \\Cart::getContent();\n\t\t$this->data['items'] = $items;\n\n\t\treturn $this->load_theme('carts.index', $this->data);\n\t}",
"public function index()\n\t{\n\t\t$carts =$this-> cart ->contents();\n\t\t$total_items=$this-> cart->total_items();\n\t\t$this->data['carts']=$carts;\t\n\t\t// var_dump($carts);\n/*\t\techo \"<pre>\";\n \t\tprint_r($carts);\n \t\techo \"<pre>\";*/\n\n\t \t$this->load ->view('Fr_giohang_view',$this->data);\n\t\t\n\t }",
"public function show(EntCart $horaExec)\n {\n //\n }",
"public function index()\n {\n $cart = Cart::content();\n return view('cart.index', compact('cart'));\n }",
"public function index()\n {\n $userCart = Cart::where('user_id', Auth()->id())\n ->first();\n $MyCart = CartProduct::where('user_id' , Auth()->id())->get();\n\n // dd($userCart);\n if ($userCart == NULL)\n {\n return view('cart', compact('userCart'));\n } else {\n $CartProducts = CartProduct::where('user_id', Auth()->id())\n ->where('cart_id', $userCart->id)\n ->get();\n return view('cart', compact('userCart', 'CartProducts','MyCart'));\n }\n }",
"public function myCart(){\n Auth::loginUsingId(1);\n // $currentUser = Auth::user();\n // $cartList = $currentUser->cartProductId();\n $currUserId = Auth::user()->id;\n $cartList = Cart::cartList($currUserId)->get();\n return view ('myCart',compact('cartList'));\n // return view('myCart',compact('cartList'));\n }",
"public function index()\n {\n\n $cart = $this->cart->content();\n\n return view('public.cart.index', compact('cart'));\n }",
"public function edit(cart $cart)\n {\n //\n }",
"public function edit(cart $cart)\n {\n //\n }",
"public function show($id)\n {\n $cart = Cart::find($id);\n\n\n \n \n\n\n return view('details_venta.show')->with(compact('cart'));\n }",
"public function getCart();",
"public function index(){\n $carts = Cart::content();\n $total = Cart::total();\n $subtotal = Cart::subtotal();\n\n return view('front.shop.cart', compact('carts','total', 'subtotal'));\n }",
"public function index()\n {\n $user = Auth::user();\n $carts = Cart::with(['product.galleries', 'user'])\n ->where('users_id', Auth::user()->id)->get();\n return view('pages.cart',[\n 'carts' => $carts,\n 'user' => $user\n ]);\n }",
"function displayCart($cart){\n\tif(count($cart) > 0)//Cart isn't empty\n\t{\t\n\t\t$totalPrice = 0;\n\t\tforeach ($cart as $item)\n\t\t{\n\t\t\t$totalPrice += $item['productQuantity']*$item['productPrice'];//quantity*price for each item in the cart to get total price\n\n\t\t\t/* Table to out data */\n\t\t\techo '<table class=\"table table-striped table-hover table-responsive\">';\n\t\t\techo\t'<tr style=\"border-bottom:none;\">';\n\t\t\techo\t\t'<td colspan=\"4\" class=\"col-sm-3 col-md-3 col-lg-3 align-left\">'.$item['productTitle'].'</td>';\n\t\t\techo\t'</tr>';\n\t\t\techo\t'<tr>';\n\t\t\techo\t\t'<td>x'.$item['productQuantity'].'</td>';\n\t\t\techo\t\t'<td>€'.$item['productPrice'].'</td>';\n\t\t\t\n\t\t\techo \t\t'<td>';\n\t\t\techo\t\t\t'<form id=\"cart-action\" method=\"post\">';\n\t\t\techo \t\t'<input type=\"hidden\" name=\"vendorId\" value=\"'.$item['vendorId'].'\">';\n\t\t\techo\t\t\t\t'<input type=\"hidden\" name=\"productId\" value=\"'.$item['productId'].'\">';\n\t\t\techo \t'<input type=\"hidden\" name=\"action\" value=\"add\">';\n\t\t\techo \t'<input type=\"hidden\" name=\"productTitle\" value=\"'.base64_decode($item['productTitle']).'\">';\n\t\t\techo \t'<input type=\"hidden\" name=\"productPrice\" value=\"'.$item['productPrice'].'\">';\n\t\t\techo \t\t'<button type=\"submit\"><a><span class=\"glyphicon glyphicon-plus-sign\"></span></a></button>';\n\t\t\techo \t\t\t'</form>';\n\t\t\techo \t\t'</td>';\n\t\t\t\n\t\t\techo\t\t'<td>';\n\t\t\techo \t\t\t'<form id=\"cart-action\" method=\"POST\">';\n\t\t\techo \t\t\t\t'<input type=\"hidden\" name=\"action\" value=\"remove\">';\n\t\t\techo \t\t\t\t\"<input type='hidden' name='productId' value=\".$item['productId'].\">\";\n\t\t\techo \t\t\t\t'<button type=\"submit\"><a><span class=\"glyphicon glyphicon-remove-circle\"></span></a></button>';\n\t\t\techo \t\t\t'</form>';\n\t\t\techo\t\t'</td>';\n\t\t\techo\t'</tr>';\n\t\t\techo '</table>';\n\t\t}\n\t\t\techo '<div class=\"cart-total-price\">';\n\t\t\t\techo '<p><strong>Total: €'.$totalPrice.'</strong></p>';\n\t\t\techo '</div>';\n\t\t\techo '<script type=\"text/javascript\">location.reload()</script>';//Temporary Page Reload for checkout order options to change\n\t\t}else{//Print not items selected\n\t\t\techo '<p>No Items Selected</p>';\n\t\t\t}\n}",
"public function index()\n {\n return view('cart.index',[\n 'cart' => Cart::content()\n ]);\n }",
"public function cart()\n {\n if(Auth::check()) {\n $user_email = Auth::user()->email;\n $userCart = DB::table('cart')->where('user_email', $user_email)->get();\n } else {\n $session_id = Session::get('session_id');\n $userCart = DB::table('cart')->where('session_id', $session_id)->get();\n }\n \n // Get images for cart items\n foreach($userCart as $key => $product){\n $product = Product::where('id', $product->product_id)->first();\n $userCart[$key]->image = $product->image;\n }\n $meta_title = \"Shopping Cart - E-com Website\";\n $meta_description = \"View Shopping Cart of E-com Website\";\n $meta_keywords = \"Shopping Cart - E-com Website\";\n return view('products.cart', compact('userCart', 'meta_title','meta_description', 'meta_keywords'));\n }",
"public function edit(Cart $cart)\n {\n //\n }",
"public function edit(Cart $cart)\n {\n //\n }",
"public function edit(Cart $cart)\n {\n //\n }",
"public function edit(Cart $cart)\n {\n //\n }",
"public function edit(Cart $cart)\n {\n //\n }",
"public function edit(Cart $cart)\n {\n //\n }",
"public function edit(Cart $cart)\n {\n //\n }",
"public function edit(Cart $cart)\n {\n //\n }",
"public function cartAction() {\n\t\t$result = $this->_updateShoppingCart();\n\n\t\tif ($result !== true) {\n\t\t\t$response = array('status' => 1, 'message' => $result);\n\t\t\t$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));\n\t\t\treturn;\n\t\t}\n\n\t\t$response = array('status' => 0);\n\n\t\t$quote = $this->_getCart()->getQuote();\n\t\t$checkoutHelper = Mage::helper('checkout');\n\n\t\t$items = array();\n\t\tforeach ($quote->getAllVisibleItems() as $item) {\n\t\t\t$items[] = array(\n\t\t\t\t'id' => $item->getId(),\n\t\t\t\t'qty' => $item->getQty(),\n\t\t\t\t'rowtotal' => $checkoutHelper->formatPrice($item->getRowTotal()),\n\t\t\t);\n\t\t}\n\n\t\t$response['items'] = $items;\n\n\t\t$totals = $quote->getTotals();\n\t\tif (isset($totals['subtotal'])) {\n\t\t\t$response['subtotal'] = $checkoutHelper->formatPrice($totals['subtotal']->getValue());\n\t\t}\n\t\tif (isset($totals['shipping'])) {\n\t\t\t$response['shipping'] = $checkoutHelper->formatPrice($totals['shipping']->getAddress()->getShippingAmount());\n\t\t}\n\t\tif (isset($totals['discount'])) {\n\t\t\t$response['discount'] = $checkoutHelper->formatPrice($totals['discount']->getValue());\n\t\t}\n\t\tif (isset($totals['grand_total'])) {\n\t\t\t$response['grand_total'] = $checkoutHelper->formatPrice($totals['grand_total']->getValue());\n\t\t}\n\n\t\t$response['version'] = strtotime($quote->getUpdatedAt());\n\n\t\t$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));\n\t}",
"public function cart(Request $request)\n {\n \treturn view('homepage.cart');\n }",
"function displayCart(){\r\n\r\n\t\r\n\r\n\t$totalPrice = 0;\r\n\t$imageUrl = \" \";\r\n\tforeach ($_SESSION[\"cart\"] as $item ) {\r\n\t$totalPrice += $item->getPrice();\r\n\t$imageUrl =\t \"../\".$item->getImageUrl();\r\n\r\n\t$itemId = $item->getItemId()\r\n?>\r\n\t <div class=\"cart-header\">\r\n\t\t\t\t\r\n\t\t\t\t \t<a href = \"?action=removeItem&itemId=<?php echo $item->getItemId().\"&price=\".$item->getPrice(); ?>\">\r\n\t\t\t\t\t\t<div class=\"close1\"></div>\r\n\t\t\t\t\t</a>\r\n\t\t\t\t \r\n\t\t\t\t <div class=\"cart-sec\">\r\n\t\t\t\t\t\t<div class=\"cart-item cyc\">\r\n\t\t\t\t\t\t \r\n\t\t\t\t\t\t\t<?php echo'<img src=\"'.$imageUrl.'\" alt=\"\"/>' ?>\r\n\t\t\t\t\t\t</div>\r\n\t\t\t\t\t <div class=\"cart-item-info\">\r\n\t\t\t\t\t\t\t<h3><?php echo $item->getItemName() ?>\r\n\t\t\t\t\t\t\t\t<span>\r\n\t\t\t\t\t\t\t\t\t \t<?php \r\n\t\t\t\t\t\t\t\t\t \t echo \"Item Id: \";\r\n\t\t\t\t\t\t\t\t\t \t\techo $itemId; \r\n\t\t\t\t\t\t\t\t\t \t?>\r\n\t\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t\t</h3>\r\n\t\t\t\t\t\t\t <h4><span>Price. R </span><?php echo $item->getPrice() ?></h4>\r\n\t\t\t\t\t\t\t <p class=\"qty\">Qty ::</p>\r\n\t\t\t\t\t\t\t <input min=\"1\" type=\"number\" id=\"quantity\" name=\"quantity\" value=\"1\" class=\"form-control input-small\">\r\n\t\t\t\t\t </div>\r\n\t\t\t\t\t <div class=\"clearfix\"></div>\r\n\t\t\t\t\t\t<div class=\"delivery\">\r\n\t\t\t\t\t\t\t <p>Service Charges:: Rs.50.00</p>\r\n\t\t\t\t\t\t\t <span>Delivered in 2-3 bussiness days</span>\r\n\t\t\t\t\t\t\t <div class=\"clearfix\"></div>\r\n\t\t\t\t </div>\t\t\t\t\t\t\r\n\t\t\t\t </div>\r\n</div>\r\n<?php\r\n\t}\r\n}"
] | [
"0.84091514",
"0.84091514",
"0.84091514",
"0.84091514",
"0.84091514",
"0.84091514",
"0.84091514",
"0.84091514",
"0.8323434",
"0.77528465",
"0.7728337",
"0.7651165",
"0.75253093",
"0.7319019",
"0.73046935",
"0.72852504",
"0.72723085",
"0.7214472",
"0.7184507",
"0.71763086",
"0.7162608",
"0.71481717",
"0.7145874",
"0.7126505",
"0.71176416",
"0.7067304",
"0.7023714",
"0.69833785",
"0.69814426",
"0.6973333",
"0.6966153",
"0.6944068",
"0.69047683",
"0.6897457",
"0.68974286",
"0.6893722",
"0.6890642",
"0.6889984",
"0.6867032",
"0.68644094",
"0.68514025",
"0.68370026",
"0.6785187",
"0.6765255",
"0.67603666",
"0.6755013",
"0.6736969",
"0.6735234",
"0.6709314",
"0.6681047",
"0.6658246",
"0.66533786",
"0.66506237",
"0.6643717",
"0.6616897",
"0.6600146",
"0.65812534",
"0.6541072",
"0.6502887",
"0.6487588",
"0.64808625",
"0.6473454",
"0.6470704",
"0.6466609",
"0.64666003",
"0.64562947",
"0.6442467",
"0.63876027",
"0.6384468",
"0.6374096",
"0.6360048",
"0.6337845",
"0.63198704",
"0.62948805",
"0.628526",
"0.6278229",
"0.627588",
"0.62741303",
"0.6267737",
"0.62621826",
"0.6261435",
"0.6261435",
"0.6257339",
"0.6254035",
"0.624018",
"0.6230662",
"0.6204523",
"0.62044394",
"0.61990035",
"0.6192552",
"0.6192552",
"0.6192552",
"0.6192552",
"0.6192552",
"0.6192552",
"0.6192552",
"0.6192552",
"0.61902285",
"0.61891407",
"0.61854583"
] | 0.6915275 | 32 |
Remove the specified Cart from storage. | public function destroy(Cart $cart, Request $request)
{
$validator = Validator::make($request->all(), [
'cartKey' => 'required',
]);
if ($validator->fails()) {
return response()->json([
'errors' => $validator->errors(),
], 400);
}
$cartKey = $request->input('cartKey');
if ($cart->key == $cartKey) {
$cart->delete();
return response()->json(null, 204);
} else {
return response()->json([
'message' => 'The CarKey you provided does not match the Cart Key for this Cart.',
], 400);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function removeFromCart()\n\t{\n\t\t$this->cart->remove($this->request->getInteger('record'));\n\t\t$this->saveCart();\n\t}",
"public function remove($cartId);",
"public function destroyCart()\n {\n unset($this->items);\n\n $this->update();\n\n \\Event::fire('laracart.destroy', $this->instance);\n }",
"public function removeCart($id) {\n Cart::destroy($id);\n return redirect('cart');\n }",
"public function deleting(Cart $cart)\n {\n //\n }",
"public function destroy(cart $cart)\n {\n //\n }",
"public function destroy(cart $cart)\n {\n //\n }",
"public function destroy(Cart $cart)\n {\n //\n }",
"public function destroy(Cart $cart)\n {\n //\n }",
"public function destroy(Cart $cart)\n {\n //\n }",
"public function remove()\n\t{\n\t\t$item = ORM::factory('cart_item', $this->input->post('id'));\n\t\t$this->cart->remove_product($item);\n\t\t\n\t\turl::redirect('cart');\n\t}",
"function deleteCart() {\n\t\tunset($_SESSION['cart']);\t\t\n\t}",
"public function removeCart($id,Request $request)\n {\n $carts = empty(Session::get('carts')) ? [] : Session::get('carts');\n //dd($carts);\n\n //delete item\n Arr::pull($carts, $id);\n\n // store session\n session(['carts' => $carts]);\n //dd($carts);\n return redirect()->route('cart.cart-info');\n }",
"public function removeFromCart() : void\n {\n $this->VIEW = false;\n $this->Cart->removeFromCart($_SESSION['Auth']->id, $_POST);\n }",
"public function clearCart(): Cart;",
"public function destroyInCart(Request $request)\n {\n $rowId = Cart::instance('shopping')->content()->where('id', $request->id)->first()->rowId;\n Cart::remove($rowId);\n }",
"public function clearCart()\n {\n $this->model->destroy();\n }",
"public function removeCart($id){\n\n CartItem::destroy($id);\n return redirect('/product_carts')->withSuccessRemoveCartMessage('Product cart has been removed!');\n //->withSuccessRemoveCartMessage('Product cart has been removed!');\n }",
"public function removeFromCart(Request $request, $id=null)\n {\n $data = $request->id;\n // dd($data);\n if($request->id)\n {\n $cart = session()->get('cart');\n // dd($cart);\n if(isset($cart[$request->id]))\n {\n unset($cart[$request->id]);\n // dd($cart);\n\n session()->put('cart', $cart);\n }\n\n return redirect()->back()->with('success', 'Initiative removed successfully');\n }\n // Session::forget('cart');\n // return redirect()->back();\n }",
"public function remove(Request $request): void\n {\n \\Cart::remove($request->get('product_id'));\n }",
"public function clearCart()\n {\n $this->clearParams('cart');\n }",
"public function deleteCart(Request $request){\n Cart::remove($request->rowId);\n if(Cart::count()==0){\n session(['discount'=>0]);\n }\n Session::flash('success','Item delted!');\n return redirect()->route('accounts.get_cart');\n\n }",
"function deleteCart() {\n\t\t$queryString = \"DELETE FROM cart;\";\n\n\t\tif ($stmt = $this->connection->prepare($queryString)) {\n\t\t\t$stmt->execute();\n\t\t\t$stmt->store_result();\n\t\t\theader(\"Location: http://serenity.ist.rit.edu/~qsb2538/341/project1/cart.php\");\n\t\t}\n\t}",
"public function removeFromCart() {\n\t\t$count = 0;\n\t\tforeach ($_SESSION['cart'] as $cartRow) {\n\t\t\tif ($cartRow['id'] == $this->productId) {\n\t\t\t\t$_SESSION['cart'] = array_splice($_SESSION['cart'], $count, 1);\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$count += 1;\n\t\t}\n\t}",
"public function clearCart(): void\n {\n CartFcd::clear();\n $this->updateCart();\n }",
"public function removeFromCart(Request $request)\n {\n if ($request->id) {\n $cart = session()->get('cart');\n\n if (isset($cart[$request->id])) {\n unset($cart[$request->id]);\n session()->put('cart', $cart);\n }\n session()->flash('success', 'Product removed successfully');\n }\n return $request;\n }",
"public function deleteCart($id)\n {\n $data['cart'] = DB::table('carts')\n ->where('id', $id)\n ->delete(); //delete data from db table.cart based on item id\n\n return back()->with('success', 'Removed Item From Cart!');\n }",
"public function deleteCart($id)\n {\n $cart = session()->get('cart');\n $quantita_bloccata = $cart[$id]['quantita'];\n $idProduct = $cart[$id]['id'];\n $products = Product::with('sector')->find($idProduct);\n \n $products->sector->quantita_bloccata = $products->sector->quantita_bloccata - $quantita_bloccata;\n $quantitaTemp = $products->sector->quantita_bloccata;\n if ( $quantitaTemp >=0 ) {\n $products->push();\n \n }\n\n unset($cart[$id]);\n session()->put('cart', $cart);\n if (count($cart)==0) {\n session()->forget('cart');\n\n }\n\n return redirect()->back();\n \n }",
"public function removeCart(Request $request)\n {\n $cart = new Cart($request);\n $item = Product::find($request->get('product_id'));\n if(!empty($item)) {\n $data = $cart->deleteItem($item,1,$request);\n return response()->json([\"message\" => __(\"Product remove from cart\"),\"data\" => $data]);\n }\n return response()->setStatusCode(404)->json([\"message\" => \"Product not found\"]);\n\n }",
"public function clearCart(){\r\n\t\t$this->cart_items = array();\r\n\t\t$this->latestItemId = 1;\t\t\r\n\t}",
"public function remove_from_cart() {\n WC_Gokeep_JS::get_instance()->remove_from_cart();\n }",
"public static function remove($id)\n {\n session()->remove('cart');\n }",
"public function removeFromShoppingCart($id){\r\n $stmt = $this->DB->prepare(\"DELETE FROM shopping_cart WHERE Cart_ID = $id;\");\r\n $stmt->execute();\r\n }",
"public function remove()\n {\n return $this->session->remove('cart');\n }",
"public function deleteCart(){\n $cartItemModel = \\Ccc::objectManager('\\Model\\Item',false);\n\n foreach($this->getCartItems() as $item){\n $ids[] = $item->itemId;\n }\n \n if($cartItemModel->deleteData($ids)){\n return true;\n }\n\n return false;\n }",
"public function destroyCart(Request $request)\n {\n if($request->id) {\n $cart = session()->get('cart');\n if(isset($cart[$request->id])) {\n unset($cart[$request->id]);\n session()->put('cart', $cart);\n }\n session()->flash('cart-success', 'Produsul a fost sters.');\n }\n }",
"public function removeItem(Cart $cart, CartItem $item);",
"public function clear_cart()\n {\n unset($_SESSION['cart']);\n }",
"public function deleteFromCart($prod_id){\n $this->cartConstruct();\n $this->removeItem($prod_id);\n if(count($this->items)>0)\n {\n Session::put('cart',$this);\n }\n else\n {\n Session::forget('cart',$this);\n }\n return redirect()->back();\n\t}",
"public function destroy(Request $request)\n {\n $cartDetail = CartDetail::find($request->cart_detail_id);\n if ($cartDetail->cart_id == auth()->user()->cart->id) \n $cartDetail->delete();\n\n\n /* if ($cartDetail) {\n\n $op = $cartDetail->product->quantity + $cartDetail->quantity;\n\n \n\n \n\n $cartDetail->where('quantity','>','0')\n ->update(['quantity'=>$op]);\n }*/\n \n $notification = 'El producto se ha eliminado del carrito de compras correctamente.';\n return back()->with(compact('notification'));\n \n \n }",
"public function destroy(Cart $cart)\n {\n //\n $carts= Cart::findOrFail($cart->id);\n $carts->delete();\n return redirect()->route('cart.index');\n }",
"function deletesinglecart($cart_id){\n $cart= Cart::findOrfail($cart_id);\n $cart->delete();\n return back();\n }",
"public function remove()\n{\n return $this->session->remove('cart');//vide le panier\n}",
"public function removeProduct(Product $product): CurrentCart;",
"function remove()\n {\n $gameId = $this->registry->params[0];\n\n if (isset($gameId, $_SESSION['cart'])) {\n Util::deleteElement($gameId, $_SESSION['cart']);\n }\n\n $count = 0;\n for ($index = 0; $index < sizeof($_SESSION['cart']); $index++) {\n $count++;\n if ($_SESSION['cart'][$index][0] == $gameId) {\n unset($_SESSION['cart'][$index]);\n }\n }\n if($count == 0){\n unset($_SESSION['cart']);\n }\n\n header(\"Location: /cart\");\n }",
"public function destroy(Cart $cart,Product $product)\n {\n\n //TO DO GET CART_PRODUCTS DATA HERE AND DELETE IT\n\n\n //TO DO DELETE CART DATA HERE\n\n return back();\n }",
"public function destroy()\n\t{\n\t\t// Remove all the data from the cart and set some base values\n\t\t//\n\t\tarray_set($this->cart_contents, $this->cart_name, array('cart_total' => 0, 'total_items' => 0));\n\n\t\t// Remove the session.\n\t\t//\n\t\tSession::forget($this->cart_name);\n\t}",
"public function destroy( Cart $cart, Request $request ) {\n $this->validate( $request, [\n 'cartKey' => 'required',\n ] );\n /* $validator = Validator::make( $request->all(), [\n 'cartKey' => 'required',\n ] );\n\n if ( $validator->fails() ) {\n return response()->json( [\n 'errors' => $validator->errors(),\n ], 400 );\n } */\n\n $cartKey = $request->input( 'cartKey' );\n\n if ( $cart->key == $cartKey ) {\n $cart->delete();\n return response()->json( null, 204 );\n } else {\n\n return response()->json( [\n 'message' => 'The CarKey you provided does not match the Cart Key for this Cart.',\n ], 400 );\n }\n\n }",
"public function destroy()\n {\n $this->CI->session->unset_userdata('cartItems');\n }",
"public function destroy(Cart $cart, Request $request) {\n $this->validate(\n $request,\n [\n 'cartKey' => 'required',\n ]\n );\n /* $validator = Validator::make( $request->all(), [\n 'cartKey' => 'required',\n ] );\n\n if ( $validator->fails() ) {\n return response()->json( [\n 'errors' => $validator->errors(),\n ], 400 );\n } */\n\n $cartKey = $request->input('cartKey');\n\n if ($cart->key == $cartKey) {\n $cart->delete();\n return response()->json(['status' => 1, 'message' => 'done'], 204);\n } else {\n\n return response()->json(\n [\n 'status' => 0,\n 'message' => 'The CarKey you provided does not match the Cart Key for this Cart.',\n ],\n 400\n );\n }\n\n }",
"public function remove($request)\n {\n\n \\Cart::remove($request->id);\n return redirect()->route('cart.index')->with('success_msg', 'Item is removed!');\n\n }",
"public function destroy($id)\n {\n Cart::Remove($id);\n return redirect()->back();\n }",
"function deleteCartItem()\n {\n $item_id = $_POST['movie_id'];\n\n // User is not logged in\n if (!LoggedIn::user()) {\n\n $storeItem = 1;\n $movieItem = 0;\n $sessionType = \"\";\n\n $category_id = $_POST['category_id'];\n\n // if cart or store\n\n if ($category_id == $movieItem) {\n\n $sessionType = 'cart';\n\n } else if ($category_id == $storeItem) {\n\n $sessionType = 'store_items';\n }\n\n\n // CART\n foreach ($_SESSION[$sessionType] as $key => $value) {\n foreach ($value as $movie => $id) {\n if ($id == $item_id) {\n // Is match then remove element at position $key eg 0, 1, 2 ,3 in the array\n unset($_SESSION[$sessionType][$key]);\n }\n }\n }\n\n\n // STORE\n\n\n } else {\n\n // IF USER IS LOGGED IN USE THIS (TODO::LATER)\n Cart_item::where('movie_id', '=', $item_id)->delete();\n }\n }",
"public function delete($id)\n{\n //faut recupere la qty de l id\n $cart=$this->session->get('cart',[]);\n unset($cart[$id]);\n return $this->session->set('cart', $cart);\n}",
"public function removeItem(string $sku): Cart;",
"public function removeitem(Request $request) {\n Cart::remove([\n 'id' => $request->id,\n ]);\n return back()->with('success',\"Producto eliminado con éxito de su carrito.\");\n }",
"public function destroy()\n {\n Cart::destroy();\n return redirect()->back()->with('success', 'Your cart is now empty');\n }",
"public function removeProduct($product)\n {\n\n $cart = $product->cart()->where('cart_id',$this->id)->wherePivot('deleted_at',null)->first();\n\n if (! is_null($cart))\n\n $cart->pivot->delete();\n }",
"function removeProduct(Product $product){\n \t$this->myCart->remove($product);\n }",
"public function destroy(Product $cart)\n {\n $cartContent = session( 'cart', collect());\n $cartContent = $cartContent->where('id', '!=', $cart->id);\n\n session(['cart' => $cartContent]);\n\n return redirect()->back();\n }",
"public function delete(Request $request)\n {\n $cart = new Shoppingcart($request);\n $cart->remove($request->input('id')); \n }",
"public function destroy(UserCart $userCart) {\n\t\t//\n\t}",
"public function delete_cart(Request $request)\n {\n\n $cart_id = $request->input('cart_id');\n\n $cart = WechatCart::find($cart_id);\n\n if ($cart) {\n $order_item = $cart->order_item;\n $cart->delete();\n $order_item->delete();\n }\n\n return redirect()->route('gouwuche');\n }",
"function clearCart() {\r\n\tunset($_SESSION['cart']);\r\n}",
"public function destroy($id){\n Cart::remove($id);\n return back()->with('status', 'Cart Item is deleted');\n }",
"public function removeItem($index) {\n $this->sessionCart->removeItem($index);\n }",
"public function removeItem($id){\n $cart = Session::get('cart');\n unset($cart->items[$id]);\n $itemTotal = $this->items[$id]['price'] * $this->items[$id]['qty'];\n $cart->totalPrice -= $itemTotal;\n $cart->totalQty -= $this->items[$id]['qty'];\n if($cart->totalQty <= 0){\n Session::flush();\n } else {\n Session::put('cart', $cart);\n }\n }",
"public function deleteCart($id)\n {\n //Delete cart\n \tCart::where('cartId',Auth::user()->userId.'#'.$id)->delete();\n \treturn redirect()->back();\n }",
"public function remove(Request $request)\n {\n $cart_item= $request->input('remove-data');\n Cart::remove($cart_item);\n\n return Redirect::back();\n }",
"public function destroy(Request $request,$id)\n {\n \n $cart = Cart::find($id);\n if (!is_null($cart)) {\n $cart->delete();\n }else {\n return redirect()->route('carts');\n }\n session()->flash('success', 'Cart item has Deleted successfully !!');\n return back();\n\n }",
"public function destroy(Cart $cart)\n {\n $message = $cart->product ? \"{$cart->product->name} has been deleted.\" : \"Data has been deleted\";\n $cart->delete();\n\n return $this->sendResponse([], $message);\n }",
"public function destroy($id)\n {\n $user = Auth::id();\n $cart = Cart::where('id', $id)->where('user_id', $user)->first();\n $cart->delete();\n }",
"public function remove_from_cart($qty=0, $oid=0, $proid=0) {\n\t\tif($qty) {\n\t\t\t$query = \"UPDATE pivot_order-products SET quantity = ? WHERE order_id = ? AND product_id = ?\";\n\t\t\t$values = array($qty,$oid,$prodid);\n\t\t\n\t\t} else {\n\t\t\t$query = \"DELETE FROM pivot_order-products WHERE order_id = ? AND product_id = ?\";\n\t\t\t$values = array($oid,$prodid);\n\n\t\t}\n\t\treturn $this->db->query($query,$values);\n\t}",
"public function destroy($id)\n {\n\n $cartId = 36;\n $cart = Cart::find($cartId);\n //Remove Product If Exists In Cart Items\n $collection = new Collection();\n foreach ($cart->content as $items) {\n if ($items['product_id'] != $id) {\n $collection->push((object)$items);\n }\n }\n\n //Update The Cart\n $cart->content = $collection;\n $cart->save();\n return new CartResource($cart);\n }",
"public function clear()\n {\n Cart::destroy();\n return redirect()->route('cart.index');\n }",
"public function delete_from_cart(Request $data) {\n \t$product_info = array(\n \t\t\"product_id\" => $data->product_id,\n \t\t\"num_items\" => $data->num_items,\n \t\t\"selectors\" => $data->selectors\n \t);\n\n \t// Create cart helper class and delete\n \t$cart_helper = new CartHelper();\n \t$cart_helper->delete_from_cart($product_info);\n\n \t// Return to cart\n \treturn redirect()->back();\n }",
"public function destroy()\n {\n $this->_session->offsetUnset('products');\n $this->getEventManager()->trigger(CartEvent::EVENT_DELETE_CART_POST, $this, ['cart_id'=>$this->_session->cartId]);\n }",
"function remove_from_cart ($external_cart_id, $product_id) {\n $db = getDb();\n $cart_id = fetch_cart_id($external_cart_id);\n\n $statement = $db->prepare(\"\n DELETE FROM\n cart_content\n WHERE (\n cart_id = :cart_id AND\n product_id = :product_id\n )\n \");\n $executed = $statement->execute([\n \"cart_id\" => $cart_id,\n \"product_id\" => $product_id,\n ]);\n if (!$executed) {\n throw new Exception(\"An unexpected error occurred; could not remove from cart\");\n }\n}",
"public function deleteCartProduct($id = null)\n {\n Session::forget('CouponAmount');\n Session::forget('CouponCode');\n\n DB::table('cart')->where(['id'=>$id])->delete();\n return redirect('/cart')->with('update_message','Product has been deleted from cart');\n }",
"public function emptyCart(){\n if(Session::exists(\"cart\")){\n //Remove all cart entries\n Session::forget(\"cart\");\n }\n return redirect(\"/cart\");\n }",
"public function deleteItemToCart(Request $request)\n {\n return $this->repository->deleteItemToCart($request);\n }",
"public function remove($rowid) {\n\t\t \n\t\tif ($rowid===\"all\"){\n\t\t\t$this->cart->destroy(); //invokes destroy() method of Cart class.\n\t\t}\n\t\telse{\n\t\t\t$data = array(\n\t\t\t\t'rowid' => $rowid,\n\t\t\t\t'qty' => 0\n\t\t\t);\n\t\t\t$this->cart->update($data); //invokes update() method of Cart class.\n\t\t}\n\t\tredirect('cart'); //redirect to the same controller but in index method\n\t}",
"public function deleteOne(Cart $cartObj)\n {\n $query = $this->pdo->prepare(\"\n DELETE FROM orders_products\n WHERE product_id=:product_id AND order_id=:order_id;\");\n $query->execute(array('product_id'=>$cartObj->getProductId(),'order_id'=>$cartObj->getOrderId()));\n unset($query);\n }",
"public function removeFromCart(string $id): void\n {\n CartFcd::remove($id);\n $this->updateCart();\n }",
"public function destroy($id)\n {\n $item = Cart::where('id',$id)\n ->where('user_id',Auth::user()->id)\n ->where('status',0)->get(); //La consulta nos devuelve un array de datos con 1 solo item.\n $item[0]->delete(); //El item está en la posición 0 del array. Lo eliminamos.\n return redirect('/cart');\n }",
"public function removeItem($type, $id)\n {\n if(Auth::check())\n {\n $userId = Auth::id(); // user id\n $userCart = Cart::userCart($userId); //finding cart object of this user\n $cartId = $userCart->id; // finding user's cart ID\n\n $item = Cartable::FindItem($cartId, $type, $id); //finding specified item in the cart\n\n switch($type)\n {\n case 'file':\n $result = $userCart->files()->detach($item->cartable_id);\n break;\n case 'episode':\n $result = $userCart->episodes()->detach($item->cartable_id);\n break;\n case 'plan':\n $result = $userCart->plans()->detach($item->cartable_id);\n break;\n }\n\n if($result)\n {\n $message = 'محصول موردنظر از سبد خرید حذف شد.';\n }\n else\n {\n $message = 'محصول موردنظر در سبد خرید موجود نیست.';\n }\n }\n else //if user is not logged in then remove item from session\n {\n $userCart = Session::get('cart');\n\n\n $oldCart = Session::has('cart') ? Session::get('cart') : null;\n $cart = new ShoppingCart($oldCart);\n $message = $cart->removeItem($type, $id);\n Session::put('cart', $cart);\n }\n\n return redirect()->route('shoppingCart')->with('message', $message);\n }",
"public function destroy($id)\n {\n $cart = session('cart');\n //dd($cart->products()->first());\n $cart->products()->detach($id);\n session()->put('cart', $cart);\n return redirect()->back();\n }",
"public function removeDonation($cartId);",
"public function destroy(Request $request, $id)\n {\n if(Auth::check()){\n\n $cartItem = CartItem::find($id);\n\n $this->authorize('delete', $cartItem);\n\n $cartItem->delete();\n\n $cart = Cart::where('user_id', Auth::user()->id)->first();\n $cartItems = $cart->cartItems;\n\n // if there are no cart items left delete cart\n if($cartItems->isEmpty()) {\n $cart->delete();\n //session()->forget('cartItems');\n session()->forget('payment');\n session()->forget('transport');\n }\n }\n\n // delete cart item of guest from session\n else {\n $cartItems = session()->get('cartItems');\n array_splice($cartItems, $id, 1);\n session()->forget('cartItems');\n\n // save cartItems to session only when not empty\n if($cartItems) {\n session()->put('cartItems',$cartItems);\n }\n\n // delete payment and transport info from session\n else {\n session()->forget('payment');\n session()->forget('transport');\n }\n }\n\n return redirect('/cart');\n }",
"public function clearCart(){\n Mage::getSingleton ( 'checkout/cart' )->truncate ()->save ();\n Mage::getSingleton ( 'checkout/session' )->clear ();\n }",
"public function delete()\n\t{\n\t\t$option = JRequest::getVar('option');\n\t\t$post = JRequest::get('post');\n\t\t$cartElement = $post['cart_index'];\n\t\t$Itemid = JRequest::getVar('Itemid');\n\t\t$redhelper = new redhelper;\n\t\t$Itemid = $redhelper->getCartItemid();\n\t\t$model = $this->getModel('cart');\n\n\t\t$model->delete($cartElement);\n\t\t$this->_carthelper->cartFinalCalculation();\n\t\t$this->_carthelper->carttodb();\n\t\t$link = JRoute::_('index.php?option=' . $option . '&view=cart&Itemid=' . $Itemid, false);\n\t\t$this->setRedirect($link);\n\t}",
"public function testShoppingCartCanBeDeleted()\n {\n $id1 = new UUID();\n $cart1 = new ShoppingCart($id1);\n $this->gateway->insert($id1, $cart1);\n\n $query = $this->db->query('SELECT * FROM shoppingCart');\n $result = $query->fetchAll(PDO::FETCH_COLUMN);\n $this->assertEquals(1, count($result));\n\n // Delete Cart from Cart Database\n $this->gateway->delete($id1);\n\n $query = $this->db->query('SELECT * FROM shoppingCart');\n $result = $query->fetchAll(PDO::FETCH_COLUMN);\n $this->assertEquals(0, count($result));\n }",
"public function destroy($id)\n {\n Cart::remove($id);\n return redirect()->route('store.cart')->with(\"success_message\",\"item removed from cart\");\n\n }",
"public function empty_cart()\n\t{\n\t\tunset($_SESSION['cart']);\n\t}",
"public function CartRemove($rowId){\n $remove=Cart::remove($rowId);\n return Redirect()->back();\n }",
"public function clear() {\n\t\t$this->load->library('cart');\n\t\tforeach($this->cart->contents() as $item) {\n\t\t\t\t$item['qty'] = 0;\n\t\t\t\t$this->cart->update($item);\n\t\t}\n\t\t$this->json->output(array(\"status\"=>\"success\", \"msg\"=>\"Your cart has been cleared.\"));\n\t}",
"public function emptyCart()\n {\n unset($this->items);\n\n $this->update();\n\n \\Event::fire('laracart.empty', $this->instance);\n }",
"public function removeItemFromCart( $map ) {\r\n\t\t\t$params = array('session_cookie'=>$map['session_cookie'],'option_id'=>$map['option_id'],'restid'=>$map['restid']);\r\n\t\t\t$this->db->select('quantity')->from(TABLES::$ORDER_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(count($result) > 0) {\r\n\t\t\t\tif ($result[0]['quantity'] <=1 ) {\r\n\t\t\t\t\t$this->db->where($params);\r\n\t\t\t\t\t$this->db->delete(TABLES::$ORDER_CART);\r\n\t\t\t\t} else {\r\n\t\t\t\t\t$quantity = $result[0]['quantity'];\r\n\t\t\t\t\t$qty = array();\r\n\t\t\t\t\t$qty['quantity'] = $quantity - 1;\r\n\t\t\t\t\t$this->db->where($params);\r\n\t\t\t\t\t$this->db->update(TABLES::$ORDER_CART,$qty);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}",
"protected function deleteCart(Cart $cartModel, $id){\n\n if (Auth::check()){\n\n $cartModel->delMyCart($id);\n }\n\n return redirect()->back();\n }",
"function destroy_cart()\n\t\t{\n\t\t\t$this->flexi_cart->destroy_cart();\n\n\t\t\t// Set a message to the CI flashdata so that it is available after the page redirect.\n\t\t\t$this->session->set_flashdata('message', $this->flexi_cart->get_messages());\n\t\t\t\n\t\t\tredirect('cart');\n\t\t}"
] | [
"0.7769094",
"0.7515215",
"0.73774534",
"0.7178666",
"0.71713215",
"0.71102905",
"0.71102905",
"0.71075696",
"0.71075696",
"0.71075696",
"0.70803934",
"0.69930524",
"0.6917314",
"0.69075185",
"0.68733907",
"0.686197",
"0.68597007",
"0.6830262",
"0.68218315",
"0.68168277",
"0.6801645",
"0.67865974",
"0.677814",
"0.67750615",
"0.6757831",
"0.6752653",
"0.6715738",
"0.67026234",
"0.6691935",
"0.66867197",
"0.6650511",
"0.6642956",
"0.6631954",
"0.6624724",
"0.6610113",
"0.65864533",
"0.6586437",
"0.655696",
"0.65442884",
"0.6504869",
"0.6503559",
"0.6485656",
"0.64849204",
"0.64830446",
"0.6479315",
"0.647707",
"0.64657533",
"0.6465596",
"0.6458168",
"0.64559495",
"0.6440269",
"0.64190185",
"0.6377257",
"0.6374818",
"0.6373521",
"0.63716114",
"0.63286245",
"0.6326727",
"0.63252634",
"0.6325078",
"0.6317059",
"0.6316514",
"0.63097835",
"0.6304575",
"0.62982106",
"0.6294439",
"0.6274377",
"0.627264",
"0.6246694",
"0.6246425",
"0.6245869",
"0.6243654",
"0.6243413",
"0.623873",
"0.6237915",
"0.62345177",
"0.6215013",
"0.6210824",
"0.6206321",
"0.6202225",
"0.61971056",
"0.61693263",
"0.61648726",
"0.6161708",
"0.6155423",
"0.6153246",
"0.6148133",
"0.6144816",
"0.6142778",
"0.6132089",
"0.61114025",
"0.61070234",
"0.60997903",
"0.6092737",
"0.60897726",
"0.6072759",
"0.60685873",
"0.60652673",
"0.60617167",
"0.60546315"
] | 0.65520865 | 38 |
Adds Products to the given Cart; | public function addProducts(Cart $cart, Request $request)
{
$validator = Validator::make($request->all(), [
// 'cartKey' => 'required',
'quantity' => 'required|numeric|min:1|max:10',
'itemName' =>'required',
'size' => 'required',
'color' => 'required',
'itemPriceNDT' => 'required',
]);
if ($validator->fails()) {
return response()->json([
'errors' => $validator->errors(),
], 400);
}
// $cartKey = $request->input('cartKey');
$quantity = $request->input('quantity');
$itemName = $request->input('itemName');
$size = $request->input('size');
$color = $request->input('color');
$itemPriceNDT = $request->input('itemPriceNDT');
$tt = $quantity * $itemPriceNDT;
$aliwangwang = $request->input('aliwangwang');
$shopId = $request->input('shopId');
$shopName = $request->input('shopName');
$shopLink = $request->input('shopLink');
$website = $request->input('website');
$itemImage = $request->input('itemImage');
$itemLink = $request->input('itemLink');
$saleLocation = $request->input('saleLocation');
$stock = $request->input('stock');
// if ($cart->key == $cartKey) {
//check if the the same product is already in the Cart, if true update the quantity, if not create a new one.
$cartItem = CartItem::where([
'cart_id' => $cart->getKey(),
'itemName' => $itemName
])->first();
if ($cartItem) {
$cartItem->quantity = $quantity;
$cartItem->size = $size;
$cartItem->color = $color;
$cartItem->itemPriceNDT = $itemPriceNDT;
CartItem::where([
'cart_id' => $cart->getKey(),
'itemName' => $itemName,
'itemImage' => $itemImage,
'status' => 0,
'itemLink' => $itemLink,
'saleLocation'=> $saleLocation,
'stock'=> $stock,
'aliwangwang'=> $aliwangwang,
'shopId'=> $shopId,
'shopName'=> $shopName,
'shopLink'=> $shopLink,
'website'=> $website
])->update(['quantity' => $quantity,
'size' => $size,
'price' => $tt,
'color' => $color,
'itemPriceNDT'=> $itemPriceNDT,
]);
} else {
CartItem::create([
'cart_id' => $cart->getKey(),
'quantity' => $quantity,
'itemName' => $itemName,
'size' => $size,
'price' => $tt,
'itemPriceNDT' => $itemPriceNDT,
'color' => $color,
'status' => 0,
'itemLink' => $itemLink,
'itemImage'=> $itemImage,
'saleLocation'=> $saleLocation,
'stock'=> $stock,
'aliwangwang'=> $aliwangwang,
'shopId'=> $shopId,
'shopName'=> $shopName,
'shopLink'=> $shopLink,
'website'=> $website
]);
}
$sanpham = DB::table('cart_items')->where('cart_id',$cart->id)->get();
$soluong = DB::table('cart_items')->where('cart_id',$cart->id)->count('quantity');
return response()->json([
'message' => 'The Cart was updated with the given product information successfully',
'thông báo' => 'có '.$soluong.' sản phẩm',
'sản phẩm' => $sanpham,
], 200);
// } else {
// return response()->json([
// 'message' => 'The CarKey you provided does not match the Cart Key for this Cart.',
// ], 400);
// }
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addProduct(Product $product){\n \t$this->myCart ->add($product);\n }",
"public function addToCart() {\n\t\t$baseQuantity = 1;\n\t\t$result = $this->db->select();\n\t\twhile(($row = mysql_fetch_assoc($result)) != FALSE){\n\t\t\t$_SESSION['cart'][] = array($row['id'], $row['name'], $row['description'], $row['cost'], $baseQuantity);\n\t\t}\n\t}",
"public function addToCart()\n {\n\n $id = $_POST['id'];\n $quantity = intval($_POST['quantity']);\n\n $model = new ProductModel();\n $dice = $model->getProductByID($id);\n $diceToAdd = [\n 'product' => $dice,\n 'quantity' => $quantity\n ];\n\n // if cart is empty, initialize empty cart\n if (empty($_SESSION['shoppingCart'])) {\n $_SESSION['shoppingCart'] = [];\n }\n\n // item already in cart ? no\n $found = false;\n\n // if product is already in the cart, adding to quantity\n for ($i = 0; $i < count($_SESSION['shoppingCart']); $i++) {\n if ($_SESSION['shoppingCart'][$i]['product']['id'] == $id) {\n $_SESSION['shoppingCart'][$i]['quantity'] += $quantity;\n $_SESSION['totalInCart'] += $quantity;\n\n $found = true;\n }\n }\n\n //if not, adding product and quantity\n if ($found == false) {\n array_push($_SESSION['shoppingCart'], $diceToAdd);\n $_SESSION['totalInCart'] += $diceToAdd['quantity'];\n }\n\n header('Location: ./shop');\n exit;\n }",
"private function addToCart () {\n }",
"private function addToCart () {\n }",
"public function testAddProductToCart()\n {\n $this->browse(function (Browser $browser) {\n // Home Page\n $browser->visit(new HomePage);\n\n // Get Collection Name\n $collectionName = $browser->text('.thumbnail .caption a');\n\n // Products Page\n $browser->clickLink($collectionName)\n ->assertSee($collectionName);\n\n // Get Product Name\n $productName = $browser->text('.thumbnail .caption a');\n\n $browser->clickLink($productName)\n // Product Page\n ->assertSee($productName)\n ->press('Add To Cart')\n ->assertSee('Product has been added to your cart.')\n // Cart Page\n ->visit('/cart')\n ->assertSee($productName);\n });\n }",
"public function addAction() {\r\n $cart = $this->_getCart();\r\n $params = $this->getRequest()->getParams();\r\n try {\r\n if (isset($params['qty'])) {\r\n $filter = new Zend_Filter_LocalizedToNormalized(\r\n array('locale' => Mage::app()->getLocale()->getLocaleCode())\r\n );\r\n $params['qty'] = $filter->filter($params['qty']);\r\n }\r\n\r\n $product = $this->_initProduct();\r\n $related = $this->getRequest()->getParam('related_product');\r\n\r\n /**\r\n * Check product availability\r\n */\r\n if (!$product) {\r\n $this->_goBack();\r\n return;\r\n }\r\n\r\n $cart->addProduct($product, $params);\r\n if (!empty($related)) {\r\n $cart->addProductsByIds(explode(',', $related));\r\n }\r\n\r\n $cart->save();\r\n\r\n $this->_getSession()->setCartWasUpdated(true);\r\n\r\n /**\r\n * @todo remove wishlist observer processAddToCart\r\n */\r\n $this->getLayout()->getUpdate()->addHandle('ajaxcart');\r\n $this->loadLayout();\r\n\r\n Mage::dispatchEvent('checkout_cart_add_product_complete', array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())\r\n );\r\n\r\n if (!$this->_getSession()->getNoCartRedirect(true)) {\r\n if (!$cart->getQuote()->getHasError()) {\r\n $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->escapeHtml($product->getName()));\r\n $this->_getSession()->addSuccess($message);\r\n }\r\n $this->_goBack();\r\n }\r\n } catch (Mage_Core_Exception $e) {\r\n $_response = Mage::getModel('ajaxcart/response');\r\n $_response->setError(true);\r\n\r\n $messages = array_unique(explode(\"\\n\", $e->getMessage()));\r\n $json_messages = array();\r\n foreach ($messages as $message) {\r\n $json_messages[] = Mage::helper('core')->escapeHtml($message);\r\n }\r\n\r\n $_response->setMessages($json_messages);\r\n\r\n $url = $this->_getSession()->getRedirectUrl(true);\r\n\r\n $_response->send();\r\n } catch (Exception $e) {\r\n $this->_getSession()->addException($e, $this->__('Cannot add the item to shopping cart.'));\r\n Mage::logException($e);\r\n\r\n $_response = Mage::getModel('ajaxcart/response');\r\n $_response->setError(true);\r\n $_response->setMessage($this->__('Cannot add the item to shopping cart.'));\r\n $_response->send();\r\n }\r\n }",
"public function add()\n\t{\n\t\t$product = ORM::factory('product', $this->input->post('product_id'));\n\t\t$quantity = $this->input->post('quantity', 1);\n\t\t$variant = ORM::factory('variant', $this->input->post('variant_id'));\n\t\t\n\t\t$this->cart->add_product($product, $variant, $quantity);\n\t\t\n\t\turl::redirect('cart');\n\t}",
"public function addToCart(): void\n {\n //añadimos un Item con la cantidad indicada al Carrito\n Cart::add($this->oferta->id, $this->product->name, $this->oferta->getRawOriginal('offer_prize'), $this->quantity);\n //emite al nav-cart el dato para que lo actualize\n $this->emitTo('nav-cart', 'refresh');\n }",
"private function add($product){\n $cart = ['qty'=>0,'price' => 0, 'product' => $product];\n if($this->items){\n if(array_key_exists($product->prod_id, $this->items)){\n $cart = $this->items[$product->prod_id];\n }\n }\n $cart['qty']++;\n $cart['price'] += $product->price;\n $this->items[$product->prod_id] = $cart;\n $this->totalQty++;\n $this->totalPrice += $product->price;\n }",
"public function addAction()\n {\n $cart = $this->_getCart();\n $params = $this->getRequest()->getParams();\n// qq($params);\n try {\n if (isset($params['qty'])) {\n $filter = new Zend_Filter_LocalizedToNormalized(\n array('locale' => Mage::app()->getLocale()->getLocaleCode())\n );\n $params['qty'] = $filter->filter($params['qty']);\n }\n\n $product = $this->_initProduct();\n $related = $this->getRequest()->getParam('related_product');\n $related_products = $this->getRequest()->getParam('related_products');\n $related_qty = $this->getRequest()->getParam('related_qty');\n /**\n * Check product availability\n */\n if (!$product) {\n $this->_goBack();\n return;\n }\n \n $in_cart = $cart->getQuoteProductIds();\n if($product->getTypeId() == 'cartproduct') {\n $cart_product_id = $product->getId();\n if(in_array($cart_product_id, $in_cart)) {\n $this->_goBack();\n return;\n }\n }\n\n if($params['qty']) $cart->addProduct($product, $params);\n \n if (!empty($related_qty)) {\n foreach($related_qty as $pid=>$qty){\n if(intval($qty)>0){\n $product = $this->_initProduct(intval($pid));\n $related_params['qty'] = $filter->filter($qty);\n if(isset($related_products[$pid])){\n if($product->getTypeId() == 'bundle') {\n $related_params['bundle_option'] = $related_products[$pid]['bundle_option'];\n// qq($related_params);\n// die('test');\n } else {\n $related_params['super_attribute'] = $related_products[$pid]['super_attribute'];\n }\n }\n $cart->addProduct($product, $related_params);\n }\n }\n }\n \n $collection = Mage::getModel('cartproducts/products')->getCollection()\n ->addAttributeToFilter('type_id', 'cartproduct')\n ->addAttributeToFilter('cartproducts_selected', 1)\n ;\n \n foreach($collection as $p)\n {\n $id = $p->getId();\n if(isset($in_cart[$id])) continue;\n \n $cart = Mage::getSingleton('checkout/cart');\n $quote_id = $cart->getQuote()->getId();\n \n if(Mage::getSingleton('core/session')->getData(\"cartproducts-$quote_id-$id\")) continue;\n \n $p->load($id);\n $cart->getQuote()->addProduct($p, 1);\n }\n \n if($cart->getQuote()->getShippingAddress()->getCountryId() == '') $cart->getQuote()->getShippingAddress()->setCountryId('US');\n $cart->getQuote()->setCollectShippingRates(true);\n $cart->getQuote()->getShippingAddress()->setShippingMethod('maxshipping_standard')->collectTotals()->save();\n \n $cart->save();\n \n Mage::getSingleton('checkout/session')->resetCheckout();\n\n\n $this->_getSession()->setCartWasUpdated(true);\n\n /**\n * @todo remove wishlist observer processAddToCart\n */\n Mage::dispatchEvent('checkout_cart_add_product_complete',\n array('product' => $product, 'request' => $this->getRequest(), 'response' => $this->getResponse())\n );\n\n if (!$this->_getSession()->getNoCartRedirect(true)) {\n if (!$cart->getQuote()->getHasError() && $params['qty'] ){\n $message = $this->__('%s was added to your shopping cart.', Mage::helper('core')->htmlEscape($product->getName()));\n $this->_getSession()->addSuccess($message);\n }\n $this->_goBack();\n }\n } catch (Mage_Core_Exception $e) {\n if ($this->_getSession()->getUseNotice(true)) {\n $this->_getSession()->addNotice($e->getMessage());\n } else {\n $messages = array_unique(explode(\"\\n\", $e->getMessage()));\n foreach ($messages as $message) {\n $this->_getSession()->addError($message);\n }\n }\n\n $url = $this->_getSession()->getRedirectUrl(true);\n if ($url) {\n $this->getResponse()->setRedirect($url);\n } else {\n $this->_redirectReferer(Mage::helper('checkout/cart')->getCartUrl());\n }\n } catch (Exception $e) {\n $this->_getSession()->addException($e, $this->__('Cannot add the item to shopping cart.'));\n Mage::logException($e);\n $this->_goBack();\n }\n }",
"public function store(CartStoreRequest $request, Cart $cart)\n {\n $cart->add($request->products);\n }",
"public function add_to_cart($cartid=0, $prodid=0, $qty=0) {\n\t\t// otherwise create a new entry in cart for this prodid.\n\t\t\n\t\t$query = \"SELECT * FROM pivot_order-products WHERE order_id = ? AND product_id = ?\";\t\t\t\n\t\t$values = array($cartid,$prodid);\n\t\t$results = $this->db->query($query,$values);\n\n\t\tif($results) {\n\t\t\t$total = $results('quantity') + $qty;\n\t\t\t$query = \"UPDATE pivot_order-products SET quantity = ?, SET modified_on = NOW() WHERE order_id = ? AND product_id = ?\";\n\t\t\t$values = array($total, $cartid, $prodid);\n\n\t\t} else {\n\t\t\t$query = \"INSERT INTO pivot_order-products (order_id,product_id,quantity,created_on,modified_on) VALUES \";\n\t\t\t$query = \"(?,?,?,NOW(),NOW())\";\n\t\t\t$values = array($cartid, $prodid, $qty);\n\n\t\t}\n\t\treturn $this->db->query($query, $values);\n\t}",
"public function addToCart() : void\n {\n $this->VIEW = false;\n $this->Cart->addToCart($_SESSION['Auth']->id, $_POST);\n }",
"function addToCart($proID){\n $product = $this->product->getRows($proID);\n \n // Add product to the cart\n $data = array(\n 'id' => $product['pro_id'],\n 'qty' => 1,\n 'price' => $product['price'],\n 'name' => $product[\"name\"],\n 'image' => $product['image']\n );\n $this->cart->insert($data);\n \n // Redirect to the cart page\n redirect(base_url().'index.php/CCart');\n }",
"public function addToCart(){\n\t\t// if the user has accepted to use cookies, they will be stored\n\t\tif(isset($_COOKIE['isUsingCookies']) && $_COOKIE['isUsingCookies'] == true){\n\t\t\t$expirationTime = time()+60*60*24*62;\n\t\t}else{\n\t\t\t$expirationTime = 0;\n\t\t}\n\n\t\t// unset unused attributes from variable\n\t\tunset($_POST['_token']);\n\n\t\t// add the product to the current cart or increase the quantity if it is already in the cart\n\t\tif(isset($_COOKIE['cart'])){\n\t\t\t$previousCart = json_decode($_COOKIE['cart'],true);\n\t\t\tforeach ($previousCart as $key => $product) {\n\t\t\t\tvar_dump($product);\n\t\t\t\techo'<br>';\n\n\t\t\t\tif($_POST['id_product'] == $product['id_product']){\n\t\t\t\t\t$previousCart[$key]['quantity'] += 1;\n\t\t\t\t\tsetcookie('cart', json_encode($previousCart), $expirationTime);\n\t\t\t\t\treturn redirect()->route('cart');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tarray_push($previousCart, ['id_product' => $_POST['id_product'], 'quantity' => '1', 'price' => $_POST['price'], 'picture_url' => $_POST['picture_url'], 'name' => $_POST['name'], 'picture_alt' => $_POST['picture_alt'], 'stock' => $_POST['stock'], 'item_sold' => $_POST['item_sold'], 'name_category' => $_POST['name_category']]);\n\t\t\t$newCart = json_encode($previousCart);\n\n\t\t\tsetcookie('cart', $newCart, $expirationTime);\n\t\t}else{\n\t\t\tsetcookie('cart', json_encode([['id_product' => $_POST['id_product'], 'quantity' => '1', 'price' => $_POST['price'], 'picture_url' => $_POST['picture_url'], 'name' => $_POST['name'], 'picture_alt' => $_POST['picture_alt'], 'stock' => $_POST['stock'], 'item_sold' => $_POST['item_sold'], 'name_category' => $_POST['name_category']]]), $expirationTime);\n\t\t}\n\t\treturn redirect()->route('cart');\n\t}",
"public static function add($product)\n {\n session()->push('cart', $product);\n }",
"public function add_to_cart(Request $request){\n $product = Product::find($request->input('product_id'));\n //On s'assure qu'il y'a bien un produit qui est retourne\n if($product){\n //On enregistre la session cart dans une variable\n $cart = $request->session()->get('cart');\n //On verifie si la cle du produit est deja dans les produits dans la session avant de l'ajouter\n if(!isset($cart['products'][$product->id])){\n //On prepare comment ajouter le produit dans les sessions. Chaque produit dans la sessoin set enregistre dans une cle cart. cette cle contient un\n $cart['products'][$product->id] = ['name' => $product->name, 'price' => $product->price, 'quantite' => 1, \"total\" => $product->price];\n //On ajoute la variable $cart dans les sessions\n $request->session()->put('cart',$cart);\n }\n }\n return response()->json(['success' => true,], 200);\n }",
"public function add_to_cart($params) {\n if ($params[0]) {\n $_REQUEST['id_item'] = $params[0];\n $_REQUEST['quantity'] = 1;\n }\n\n $hash = self::getHash();\n $cart = $this->NeoCartModel->getCart($hash);\n\n //hai sa bagam produsul in shopping cart\n $this->NeoCartModel->addToCart($_REQUEST, $cart);\n\n controller::set_alert_message(\"<br/>Produsul a fost adaugat in cos\");\n header(\"Location: \" . $this->getRefPage());\n exit();\n }",
"public function addToCart($prod_id){\n\t\t$product = Product::find($prod_id);\n $this->cartConstruct();\n $this->add($product);\n Session::put('cart',$this);\n return redirect()->route('cart');\n\t}",
"public function addToCart()\n\t{\n\t\t$recordId = $this->request->getInteger('record');\n\t\t$amount = $this->request->getInteger('amount', 1);\n\t\tif ($this->cart->has($recordId)) {\n\t\t\t$this->cart->add($recordId, $amount);\n\t\t} else {\n\t\t\t$this->cart->set($recordId, $amount, [\n\t\t\t\t'priceNetto' => (float) $this->request->get('priceNetto', 0.0),\n\t\t\t\t'priceGross' => (float) $this->request->get('priceGross', 0.0),\n\t\t\t]);\n\t\t}\n\t\t$this->saveCart();\n\t}",
"public function addAction()\n {\n /** @var $session */\n $session = $this->get('session');\n\n $cart = $session->get('cart');\n\n $productID = $_POST['product_id'];\n $quantity = $_POST['quantity'];\n\n // First addition to the shopping cart\n if (empty($cart)) {\n $cart[] = array(\n 'product_id' => $productID,\n 'quantity' => $quantity\n );\n } else {\n $existingItem = false;\n\n foreach ($cart as &$cartItem) {\n // If product already exists in cart\n if ($cartItem['product_id'] == $productID) {\n $existingItem= true;\n\n // add to existing quantity\n $cartItem['quantity'] += $quantity;\n }\n }\n\n // if brand new item\n if ($existingItem == false) {\n $cart[]= array(\n 'product_id' => $productID,\n 'quantity' => $quantity\n );\n }\n }\n\n $session->set('cart', $cart);\n\n\n return new RedirectResponse('/cart');\n }",
"function addToCart(){\n\t\tif(!isset($_POST['id'])) header(sprintf(\"Location: %s\", $this->Files['Cart']));\n\t\t// ---------- These are our posted variables --------------\t\t\n\t\t$TmpCart=array();\n\t\t$TmpCart['type'] \t= 1;\n\t\t$TmpCart['name'] \t= clean_variable($_POST['name'],true);\n\t\t$TmpCart['id']\t \t= clean_variable($_POST['id'],true);\n\t\t$TmpCart['qty'] \t= (is_int($_POST['qty']) && isset($_POST['qty']))?clean_variable($_POST['qty'],true):'1';\n\t\t$TmpCart['price'] = clean_variable($_POST['price'],true);\n\t\t\n\t\t// Process Products Specs and Attributes\n\t\t$SPC = \t\t\t(isset($_POST['spec'])) ? \n\t\t\t\t\t\t\t\t\t((!is_array($_POST['spec'])) ? array( $_POST['spec'] ) : $_POST['spec']):\n\t\t\t\t\t\t\t\tarray();\n\t\tif(is_array($SPC)) foreach($SPC as &$v) clean_variable($v,true);\n\t\t\n\t\t$TmpStrg = '';\n\t\tif(count($SPC) > 0){ /* // Check the Specs of the product and get the price for that spec. If differant use that price\n\t\t\tforeach($SPC as $k => $v){ \n\t\t\t\t$getSpecs = new sql_processor($this->DB,$this->Conn,$this->Gateway);\n\t\t\t\t$getSpecs->mysql(\"SELECT `att_price`, `att_sale`, `att_sale_exp` FROM `prod_link_prod_att` WHERE `att_id` = '$v' AND `prod_id` = '\".$TmpCart['id'].\"';\");\n\t\t\t\t$getSpecs->mssql(\"SELECT att_price, att_sale, att_sale_exp FROM prod_link_prod_att WHERE att_id = '$v' AND prod_id = '\".$TmpCart['id'].\"';\");\n\t\t\t\t$getSpecs = $getSpecs->Rows();\n\t\t\t\tif($getSpecs[0]['att_price'] > 0){\n\t\t\t\t\t$attSaleExp = ereg('[^A-Za-z0-9]', $getSpecs[0]['att_sale_exp']);\n\t\t\t\t\tif($attSaleExp == \"00000000000000\") $attprices += $getSpecs[0]['att_price'];\n\t\t\t\t\telse if ($attSaleExp > date(\"YmdHis\")) $attprices += $getSpecs[0]['att_sale'];\n\t\t\t\t\telse $attprices += $getSpecs[0]['att_price'];\n\t\t\t\t} else { $attprices = 0; }\n\t\t\t\t$TmpStrg .= ($TmpStrg == \"\") ? ($v.\".\".$attprices) : (\":\".$v.\".\".$attprices);\n\t\t\t} */\n\t\t}\n\t\t$TmpCart['spec'] = $TmpStrg;\n\t\t\n\t\t// Process Products Special Options\n\t\t$SPCL = \t\t(isset($_POST['special'])) ?\n\t\t\t\t\t\t\t\t\t((!is_array($_POST['special'])) ? array( $_POST['special'] ) : $_POST['special']):\n\t\t\t\t\t\t\t\tarray();\n\t\tif(is_array($SPCL)) foreach($SPCL as &$v) clean_variable($v,true);\n\t\t$TmpCart['special'] = (is_array($SPCL) && count($SPCL) > 0) ? implode(\":\",$SPCL) : $SPCL;\n\t\t\n\t\t\n\t\t$SLCT = \t\t(isset($_POST['selections'])) ?\n\t\t\t\t\t\t\t\t\t((!is_array($_POST['selections'])) ? array( $_POST['selections'] ) : $_POST['selections']):\n\t\t\t\t\t\t\t\tarray();\n\t\tif(is_array($SLCT)) foreach($SLCT as &$v) clean_variable($v,true);\n\t\t$TmpCart['selections'] = (is_array($SLCT) && count($SLCT) > 0) ? implode(\":\",$SLCT) : $SLCT;\n\t\t\n\t\t// Process Products Messages and Comments, mainly used for gift cards\n\t\t$MSG = \t\t\t(isset($_POST['message'])) \t\t\t? clean_variable($_POST['message'],true):'';\n\t\t$MSGTo = \t\t(isset($_POST['message_to'])) \t? clean_variable($_POST['message_to'],true):'';\n\t\t$MSGFrm = \t(isset($_POST['message_from'])) ? clean_variable($_POST['message_from'],true):'';\n\t\t\n\t\t$MSGEng = \t(isset($_POST['message']))?\n\t\t\t\t\t\t\t\t\t((!is_array($_POST['engraving']))? array( $_POST['engraving'] ) : $_POST['engraving'] ):\n\t\t\t\t\t\t\t\t'';\n\t\tif(is_array($MSGEng)) foreach($MSGEng as &$v) clean_variable($v,true);\n\t\t/*\n\t\t$getMsgs = new sql_processor($this->DB,$this->Conn,$this->Gateway);\n\t\t$getMsgs->mysql(\"SELECT `prod_msg_type` FROM `prod_products` WHERE `prod_id` = '\".$TmpCart['id'].\"';\");\n\t\t$getMsgs->mssql(\"SELECT prod_msg_type FROM prod_products WHERE prod_id = '\".$TmpCart['id'].\"';\");\n\t\t$getMsgs = $getMsgs->Rows();\n\t\t$Msgs = $getMsgs[0]['prod_msg_type'];\n\t\t*/\n\t\t$Msgs='';\n\t\tif(strlen(trim($Msgs)) > 0) $Msgs = unserialize(urldecode($Msgs));\n\t\telse $Msgs = array(); $Tarray = array();\n\t\tif(count($Msgs) > 0){\n\t\t\tforeach($Msgs as $k => $v){\n\t\t\t\tswitch($k){\n\t\t\t\t\tcase \"Cmnts\": if(strlen(trim($MSG)) > 0) $Tarray['Cmnts'][0] = $MSG; break; // Straight Comment for the Product\n\t\t\t\t\tcase \"ToFrm\":\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// To From comments for Gift Cards Ect.\n\t\t\t\t\t\tif(strlen(trim($MSGTo)) > 0){\n\t\t\t\t\t\t\t$Tarray['ToFrm'][0] = $MSGTo;\n\t\t\t\t\t\t\t$Tarray['ToFrm'][1] = $MSGFrm;\n\t\t\t\t\t\t} break;\n\t\t\t\t\tcase \"Engv\":\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t// Engravings for the product allows for multiple lines\n\t\t\t\t\t\tif(intval($v)>1){ if(strlen(trim($MSGEng)) > 0) $Tarray['Engv'][0] = $MSGEng;\n\t\t\t\t\t\t} else { $n=0; foreach($MSGEng as $v){\n\t\t\t\t\t\t\t\tif(strlen(trim($v)) > 0) $Tarray['Engv'][$n] = $v; $n++;\n\t\t\t\t\t\t\t} \n\t\t\t\t\t\t} break;\n\t\t\t\t}\n\t\t\t} $TmpCart['msgs'] = $Tarray;\n\t\t} else { $TmpCart['msgs'] = 0; }\n\t\t\n\t\t$TmpCart['attnd']\t= \t(isset($_POST['attendee']))? array(clean_variable($_POST['attendee'],true)) : array(0);\n\t\t\n\t\t$this->updateCart($TmpCart); // Update our cart with our new information\n\t\t\n\t\theader(sprintf(\"Location: %s\", $this->Files['Cart'] )); // Go to page to dispaly Cart -- Do this to prevent double insertion of product via refresh button\n\t}",
"function uc_order_edit_products_add($form, &$form_state) {\n $form_state['products_action'] = 'products_select';\n $form_state['refresh_products'] = TRUE;\n $form_state['rebuild'] = TRUE;\n $order = $form_state['build_info']['args'][0];\n\n $data = module_invoke_all('uc_add_to_cart_data', $form_state['values']['product_controls']);\n $product = uc_product_load_variant(intval($form_state['values']['product_controls']['nid']), $data);\n $product->qty = isset($form_state['values']['product_controls']['qty']) ? $form_state['values']['product_controls']['qty'] : $product->default_qty;\n\n drupal_alter('uc_order_product', $product, $order);\n uc_order_product_save($order->order_id, $product);\n $order->products[] = $product;\n\n uc_order_log_changes($order->order_id, array('add' => t('Added (@qty) @title to order.', array('@qty' => $product->qty, '@title' => $product->title))));\n\n // Decrement stock.\n if (module_exists('uc_stock')) {\n uc_stock_adjust_product_stock($product, 0, $order);\n }\n\n // Add this product to the form values for accurate tax calculations.\n $form_state['values']['products'][] = (array) $product;\n}",
"function addToCart()\n{\n\t// make sure the product id is in get, redirect otherwise.\n\tif (isset($_GET['p']) && (int)$_GET['p'] > 0) {\n\t\t$productID = (int)$_GET['p'];\n\t} else {\n\t\theader('Location: ./storeIndex.php');\n\t}\n\t\n\t// check if the product is in the database.\n\t$sql = \"SELECT ItemID, Quantity\n\t FROM Items\n\t\t\tWHERE ItemID = $productID\";\n\t$result = query($sql);\n\t\n\tif (mysql_num_rows($result) != 1) {\n\t\t// the product doesn't exist\n\t\theader('Location: ./cart.php');\n\t} else {\n\t\t//Check stock\n\t\t$row = mysql_fetch_assoc($result);\n\t\t$currentStock = $row['Quantity'];\n\n\t\tif ($currentStock == 0) {\n\t\t\t// Out of stock item, show error.\n\t\t\tsetError('The product you requested is no longer in stock');\n\t\t\theader('Location: ./cart.php');\n\t\t\texit;\n\t\t}\n\n\t}\t\t\n\t\n\t//Check if items is already in cart, and if so, update quantity.\n\t$sql = \"SELECT ItemID\n\t FROM Cart\n\t\t\tWHERE ItemID = $productID\";\n\t$result = query($sql);\n\t\n\tif (mysql_num_rows($result) == 0) {\n\t\t// put the product in the cart \n\t\t$sql = \"INSERT INTO Cart (ItemID, Quantity)\n\t\t\t\tVALUES ($productID, 1)\";\n\t\t$result = query($sql);\n\t} else {\n\t\t// update product quantity in the cart\n\t\t$sql = \"UPDATE Cart\n\t\t SET Quantity = Quantity + 1\n\t\t\t\tWHERE ItemID = $productID\";\t\t\n\t\t\t\t\n\t\t$result = query($sql);\t\t\n\t}\t\n\t\t\n\theader('Location: ' . $_SESSION['shop_return_url']);\t\t\t\t\n}",
"public function add(Request $request, $product_id){\n\n $product = Product::find($product_id);\n\n // data validator \n $validator = Validator::make($request->all(), [\n 'quantity' => 'required|integer|min:1',\n ]);\n\n // case validator fails\n if($validator->fails()){\n return redirect()->back()->with('error', 'You have to add at least one item in your cart');\n }\n\n // check if product exists\n if($product){\n \n if(Auth::user()){\n\n $cartItems = Auth::user()->cartItems;\n foreach($cartItems as $item){\n if($item->product_id == $product->id){\n // case product already exists in cart\n $item->quantity += $request->quantity;\n $item->save();\n \n return redirect()->back()->with('success', 'Product added to cart');\n }\n }\n \n $cartItem = new CartItem;\n $cartItem->quantity = $request->quantity;\n $cartItem->product_id = $product_id;\n $cartItem->user_id = Auth::user()->id;\n $cartItem->save();\n\n }else{\n \n // if there are products in this session\n if(Session::has('cartItems')){\n foreach(Session::get('cartItems') as $item){\n if($item->product_id == $product->id){\n // case product already exists in cart\n $item->quantity += $request->quantity;\n \n return redirect()->back()->with('success', 'Product added to cart');\n }\n }\n\n $cartItem = new \\stdClass();\n $cartItem->quantity = $request->quantity;\n $cartItem->product_name = $product->name;\n $cartItem->product_id = $product->id;\n $cartItem->product_price = $product->price;\n\n $cartItems = Session::get('cartItems');\n array_push($cartItems, $cartItem);\n Session::put('cartItems', $cartItems);\n\n }else{\n\n $cartItem = new \\stdClass();\n $cartItem->quantity = $request->quantity;\n $cartItem->product_name = $product->name;\n $cartItem->product_id = $product->id;\n $cartItem->product_price = $product->price;\n\n Session::put('cartItems', array());\n $cartItems = Session::get('cartItems');\n array_push($cartItems, $cartItem);\n Session::put('cartItems', $cartItems);\n\n }\n\n } \n\n return redirect()->back()->with('success', 'Product added to cart');\n\n }\n\n // case product not found\n return redirect()->back()->with('error', 'Product not found');\n\n }",
"public function add_to_cart() {\n if ( ! is_single() ) {\n return;\n }\n\n global $product;\n\n WC_Gokeep_JS::get_instance()->add_to_cart( $product , '.single_add_to_cart_button' );\n }",
"public function actionAdd() {\n $id = Yii::$app->request->get('id');\n $qty = (int)Yii::$app->request->get('qty');\n $qty = !$qty ? 1 : $qty;\n\n $product = Product::findOne($id);\n if (empty($product)) return false;\n $session = $this->session;\n $cart = new Cart();\n $cart->addToCart($product, $qty);\n if (!Yii::$app->request->isAjax) { // works if js is off and ajax request did not occur\n return $this->redirect(Yii::$app->request->referrer);\n }\n $this->layout = false; // loading only view file, without layout;\n $items_to_show = $this->getProductObject($session);\n return $this->render('cart-modal', compact('session', 'items_to_show'));\n }",
"public function rapidAdd($id){\n $product=Products::find($id);\n $cart= Cart::add([\n'id'=>$product->id,\n'name'=>$product->pro_name,\n'qty'=>1,\n'price'=>$product->pro_price,\n ]);\n Cart::associate($cart->rowId, 'App\\Models\\Products');\nreturn redirect('/cart')->with('info', 'Product added in cart');\n }",
"public function addProducts(array $products);",
"public function addProduct(Product $product, $quantity);",
"public function addProducts()\n {\n $this->_rootElement->find($this->addProducts)->click();\n }",
"public function addToCart($id){\n $produk=Product::findOrFail($id);\n Auth::loginUsingId(1);\n $user = Auth::user()->id;\n $addToCart = Cart::create(['product_id'=>$produk->id,\n 'user_id'=>$user]);\n return 'Berhasil Memasukan data ke cart list';\n }",
"public function addItem(Cart $cart, CartItem $item);",
"function old_pushCart($product_id,$quantity,$transport) \n {\n $conn=connect();\n $query= \"INSERT INTO shopping_cart(user_id,delivery,product_id,quantity) VALUES (\".$this->user_id.\",\".$transport.\",\".$product_id.\",\".$quantity.\")\"; //obtain information about a product\n if($results = mysqli_query($conn, $query)) //to add to the cart\n {\n $last_id =mysqli_insert_id($conn);\n $this->cart->addProduct($last_id, $product_id,$transport,$quantity);\n }\n mysqli_close($conn);\n \n \n }",
"public function addToCart()\n {\n $id = intval($_GET[\"id\"]);\n if ($id > 0) {\n if ($_SESSION['cart'] != \"\") {\n $cart = json_decode($_SESSION['cart'], true);\n $found = false;\n for ($i = 0; $i < count($cart); $i++)\n {\n if ($cart[$i][\"product\"] == $id)\n {\n $cart[$i][\"quantity\"] = $cart[$i][\"quantity\"] + 1;\n $found = true;\n break;\n }\n }\n if (!$found)\n {\n $line = new stdClass;\n $line->product = $id;\n $line->quantity = 1;\n $cart[] = $line;\n }\n $_SESSION['cart'] = json_encode($cart);\n }\n else\n {\n $line = new stdClass;\n $line->product = $id;\n $line->quantity = 1;\n $cart[] = $line;\n $_SESSION['cart'] = json_encode($cart);\n }\n }\n }",
"public function addProduct(array $params = []): void\n {\n if (!empty($params))\n {\n $id = intval($params['id']) ?? null;\n $title = $params['title'] ?? null;\n $price = floatval($params['price']) ?? null;\n $quantity = intval($params['quantity']) ?? null;\n $userData = $this->getSession()->getCurrentUserData();\n\n if ($id && $title && $price && $quantity)\n {\n if (!$userData->getCart())\n {\n $userData->cart = new ShoppingCart();\n }\n\n $userData->getCart()->addProduct(compact('id', 'title', 'price', 'quantity'));\n }\n\n echo $this->render('cart/shoppingCart', $userData->getRenderCartParams());\n }\n }",
"function add_to_cart($id,$qty){\r\n\r\n $row = $this->Web_model->get_by_id($id);\r\n $kategori = $this->Web_model->get_by_idkat($row->id_kategori);\r\n if ($row) {\r\n $datas= array(\r\n 'id' => $row->id_menu,\r\n 'name' => $row->nama_menu,\r\n 'price' => $row->harga,\r\n 'qty' => $qty, \r\n 'id_kategori' => $row->id_kategori,\r\n 'gambar' => $row->foto_menu,\r\n 'nama_kategori' => $kategori->nama_kategori,\r\n );\r\n $this->cart->product_name_rules = '[:print:]';\r\n $this->cart->insert($datas);\r\n echo(count($this->cart->contents()));\r\n }\r\n }",
"protected function addProductsToCart(array $products)\n {\n $addProductsToCart = $this->objectManager->create(\n \\Magento\\Checkout\\Test\\TestStep\\AddProductsToTheCartStep::class,\n ['products' => $products]\n );\n $addProductsToCart->run();\n }",
"public function addProduct(Product $product): CurrentCart;",
"public function addToCart() {\n $cartData = Input::all();\n //dd(array_key_exists('product_color', $cartData));\n $color = array_key_exists('product_color', $cartData)? $cartData['product_color'] : NULL;\n $size = array_key_exists('product_size', $cartData) ? $cartData['product_size'] : NULL;\n $quantity = $cartData['quantity'];\n $productId = $cartData['product_id'];\n \n //echo \" size : \" . $size . \" color : \" . $color . \" quantity : \" . $quantity . \" product id : \" . $productId; exit();\n \n $products = ProductModel::getProductById($productId);\n //dd($products);\n $categoryAndSubcategory = CategoryModel::getCategory();\n //dd($categoryAndSubcategory);\n //dd($products);\n \n foreach ($products as $product) {\n Cart::add(array(\n 'id' => $product['id'],\n 'name' => $product['product_name'],\n 'price' => $product['product_price'],\n 'quantity' => $quantity,\n 'attributes' => array(\n 'size' => $size,\n 'color' => $color\n )\n ));\n }\n $cartProducts = Cart::getContent();\n //dd($cartProducts);\n// return back()\n// ->with('categoryAndSubcategory', $categoryAndSubcategory)\n// ->with('products', $products)\n// ->with('cartProducts', $cartProducts);\n\n return view('user.pages.product_cart')\n ->with('categoryAndSubcategory', $categoryAndSubcategory)\n ->with('products', $products)\n ->with('cartProducts', $cartProducts);\n \n }",
"public function store(Request $request)\n {\n $user = Auth::User();\n $cart = DB::table('orders')\n ->select('id')\n ->where('status_id', '=', 1)\n ->where('user_id', '=', $user->id)\n ->value('id');\n\n if(empty($cart)) {\n $order = new Order;\n $order->user_id = $user->id;\n $order->status_id = 1;\n $order->save();\n\n $orderProduct = new OrderProduct;\n $orderProduct->order_id = $order->id;\n $orderProduct->product_id = $request->product_id;\n $orderProduct->quantity = $request->quantity;\n $orderProduct->save();\n } else {\n // if you already have this product in your cart just add the next quantity to the same line item\n if (OrderProduct::where('order_id', $cart)->where('product_id', $request->product_id)->exists() ){\n $repeatOrderProduct = OrderProduct::where('order_id', $cart)->where('product_id', $request->product_id)->first();\n $orderProduct = OrderProduct::find($repeatOrderProduct->id);\n $orderProduct->product_id = $request->product_id;\n $orderProduct->quantity = $request->quantity + $orderProduct->quantity;\n $orderProduct->save();\n }\n // else make a new line item for this new item\n else {\n $orderProduct = new OrderProduct;\n $orderProduct->order_id = $cart;\n $orderProduct->product_id = $request->product_id;\n $orderProduct->quantity = $request->quantity;\n $orderProduct->save();\n }\n }\n\n Activity::log('Saved an item to their cart.', $user->id);\n\n $request->session()->flash('status', 'Product was saved to cart.');\n\n return Redirect::action('CartController@index');\n\n }",
"public function addCart($cart){\n $this->cart_id = $cart; \n }",
"public function addtocart(Request $request, $id)\n {\n //\n $products_data = Products::find($id);\n // return $products_data;\n $old_cart = Session::has('cart') ? Session::get('cart') : null;\n\n\n $cart = new Cart($old_cart);\n // return $cart;\n $cart->add($products_data, $products_data->id);\n $request->session()->put('cart', $cart);\n // dd($request->session()->get('cart'));\n return redirect('/products');\n }",
"public function addToCart($product, $qty = 1){\n // Create Cart\n // if Product has in Cart, add + qty\n if(isset($_SESSION['cart'][$product->id])){\n $_SESSION['cart'][$product->id]['qty'] += $qty;\n } else { // if not in Cart, create\n $_SESSION['cart'][$product->id] = [\n 'qty' => $qty,\n 'name' => $product->name,\n 'price' => $product->price,\n 'img' => $product->img\n ];\n }\n // Total Qty\n // if isset Qty or if not\n $_SESSION['cart.qty'] = isset( $_SESSION['cart.qty'])\n ? $_SESSION['cart.qty'] + $qty\n : $qty;\n // Total Sum\n $_SESSION['cart.sum'] = isset($_SESSION['cart.sum'])\n ? $_SESSION['cart.sum'] + $qty * $product->price\n : $qty * $product->price;\n\n }",
"function gc_template_loop_add_to_cart( $args = array() ) {\n\t\tglobal $product;\n\n\t\tif ( $product ) {\n\t\t\t$defaults = array(\n\t\t\t\t'quantity' => 1,\n\t\t\t\t'class' => implode( ' ', array_filter( array(\n\t\t\t\t\t\t'btn btn-outline-secondary gc-add-to-cart',\n\t\t\t\t\t\t'product_type_' . $product->get_type(),\n\t\t\t\t\t\t$product->is_purchasable() && $product->is_in_stock() ? 'add_to_cart_button' : '',\n\t\t\t\t\t\t$product->supports( 'ajax_add_to_cart' ) ? 'ajax_add_to_cart' : '',\n\t\t\t\t) ) ),\n\t\t\t);\n\n\t\t\t$args = apply_filters( 'woocommerce_loop_add_to_cart_args', wp_parse_args( $args, $defaults ), $product );\n\n\t\t\twc_get_template( 'loop/add-to-cart.php', $args );\n\t\t}\n\t}",
"public function insert($items = array())\n {\n if ($this->_checkCartInsert($items) === TRUE)\n {\n\n $isNew = true;\n $shouldUpdate = $this->_config['on_insert_update_existing_item'];\n\n //check if should update existing product\n if($shouldUpdate){\n $products = is_array($this->_session['products']) ? $this->_session['products'] : array();\n foreach ($products as $token => $existing_item) {\n if($existing_item['id'] === $items['id']){\n //fount same product already on cart\n $isNew = false;\n $items = array('token'=>$token, 'qty'=> $existing_item['qty']+$items['qty']);\n break;\n }\n }\n }\n\n if($isNew){\n $token = sha1($items['id'].$items['qty'].time());\n\n if (is_array($this->_session['products']))\n {\n $this->_session['products'][$token] = $this->_cart($items);\n } else {\n //creo il carrello in sessione\n $this->_session['products'] = array();\n $this->_session->cartId = $this->_session->getManager()->getId();\n $this->getEventManager()->trigger(CartEvent::EVENT_CREATE_CART_POST, $this, array('cart_id'=>$this->_session->cartId));\n //aggiungo elemento\n $this->_session['products'][$token] = $this->_cart($items);\n }\n //evento per elemento aggiunto\n $this->trigger(CartEvent::EVENT_ADD_ITEM_POST, $token, $this->_session['products'][$token], $this);\n }else{\n //update existing product\n $this->update($items);\n }\n\n }\n }",
"public function addToCart($id, Request $request)\n {\n $product = DB::table('products')\n ->join('images', 'products.id', '=', 'images.product_id')\n ->select('products.*', 'images.name as imageName')\n ->where('products.id', '=', $id)\n ->groupby('products.id')\n ->get();\n $name = $product[0]->name;\n $price = $product[0]->price * ((100-$product[0]->sale)/100);\n $image = $product[0]->imageName;\n Cart::add(array('id' => $id, 'name' => $name, 'qty' => 1, 'price' => $price, 'options' => array('size' => 'L', 'image' => $image)));\n return redirect('user/cart');\n }",
"public function actionAdd()\n {\n $product_id = $this->getRequest('post','product_id');\n $image_id = $this->getRequest('post','image_id');\n $product = \\common\\models\\Products::find()->where(['id' => $product_id])->one();\n $total = $product->price;\n $count = $this->getRequest('post','count');\n $cover_id = $this->getRequest('post','cover_id');\n $color_id = $this->getRequest('post','color_id');\n\n $cart = new OrderCart();\n $cart->product_id = $product_id;\n $cart->image_id = $image_id;\n $cart->total = $total;\n $cart->count = $count;\n $cart->cover_id = $cover_id;\n $cart->user_id =$this->getUserId();\n $cart->user_hash = $this->getFromSession('id');\n $cart->color_id = $color_id;\n $cart->save();\n $allCart = (new CartsUtil())->getSelfCart();\n foreach($allCart as $k=> $v) {\n if($v['id'] == $cart->id) {\n $discont = (new SalesUtil())->detectSale($v);\n $cart->total = $cart->total - (($discont && isset($discont['sale_val']))\n ? $discont['sale_val']\n : 0 );\n break;\n }\n }\n return ($cart->save()) ? 200 : 400;\n }",
"public function addToCart($id)\n {\n $product = Product::find($id);\n if (!$product) {\n abort(404);\n }\n $cart = session()->get('cart');\n\n // if cart is empty then this the first product\n if (!$cart) {\n $cart = [\n $id => [\n 'name' => $product->name,\n 'quantity' => 1,\n 'price' => $product->price,\n 'photo' => $product->image\n ]\n ];\n session()->put('cart', $cart);\n\n return redirect()->back()->with('success', 'Product added to cart successfully');\n }\n // if cart not empty then check if this product exist then increment quantity\n if (isset($cart[$id])) {\n $cart[$id]['quantity']++;\n\n session()->put('cart', $cart);\n\n return redirect()->back()->with('success', 'Product added to cart successfully');\n }\n // if item not exist in cart then add to cart with quantity = 1\n $cart[$id] = [\n 'name' => $product->name,\n 'quantity' => 1,\n 'price' => $product->price,\n 'photo' => $product->image\n ];\n session()->put('cart', $cart);\n\n return redirect()->back()->with('success', 'Product added to cart successfully');\n }",
"public function addItem(string $sku, int $qty): Cart;",
"public function actionAddProductList()\n {\n\n $order_id = Yii::app()->request->getQuery('id');\n $model = $this->_loadModel($order_id);\n if ($order_id) {\n if (!Yii::app()->request->isAjaxRequest) {\n $this->redirect(array('/admin/cart/default/update', 'id' => $order_id));\n }\n }\n if (!Yii::app()->request->isAjaxRequest) {\n $this->redirect(array('/admin/cart/default/index'));\n }\n\n $dataProvider = new ShopProduct('search');\n\n if (isset($_GET['ShopProduct']))\n $dataProvider->attributes = $_GET['ShopProduct'];\n\n $this->renderPartial('_addProduct', array(\n 'dataProvider' => $dataProvider,\n 'order_id' => $order_id,\n 'model' => $model,\n ));\n }",
"public function add()\n\t{\n\t\t$app = JFactory::getApplication();\n\t\t$option = JRequest::getVar('option');\n\t\t$post = JRequest::get('post');\n\t\t$parent_accessory_productid = $post['product_id'];\n\t\t$Itemid = JRequest::getVar('Itemid');\n\t\t$producthelper = new producthelper;\n\t\t$redhelper = new redhelper;\n\t\t$Itemid = $redhelper->getCartItemid();\n\t\t$model = $this->getModel('cart');\n\n\t\t// Call add method of modal to store product in cart session\n\t\t$userfiled = JRequest::getVar('userfiled');\n\n\t\tJPluginHelper::importPlugin('redshop_product');\n\t\t$dispatcher = JDispatcher::getInstance();\n\t\t$dispatcher->trigger('onBeforeAddProductToCart', array(&$post));\n\n\t\t$result = $this->_carthelper->addProductToCart($post);\n\n\t\tif (is_bool($result) && $result)\n\t\t{\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$errmsg = ($result) ? $result : JText::_(\"COM_REDSHOP_PRODUCT_NOT_ADDED_TO_CART\");\n\n\t\t\tif (AJAX_CART_BOX == 1)\n\t\t\t{\n\t\t\t\techo \"`0`\" . $errmsg;\n\t\t\t\tdie();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$ItemData = $producthelper->getMenuInformation(0, 0, '', 'product&pid=' . $post['product_id']);\n\n\t\t\t\tif (count($ItemData) > 0)\n\t\t\t\t{\n\t\t\t\t\t$prdItemid = $ItemData->id;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$prdItemid = $redhelper->getItemid($post['product_id']);\n\t\t\t\t}\n\n\t\t\t\t$link = JRoute::_(\"index.php?option=\" . $option . \"&view=product&pid=\" . $post[\"product_id\"] . \"&Itemid=\" . $prdItemid, false);\n\t\t\t\t$app->Redirect($link, $errmsg);\n\t\t\t}\n\t\t}\n\n\t\t$session = JFactory::getSession();\n\t\t$cart = $session->get('cart');\n\n\t\tif (isset($cart['AccessoryAsProduct']))\n\t\t{\n\t\t\t$attArr = $cart['AccessoryAsProduct'];\n\n\t\t\tif (ACCESSORY_AS_PRODUCT_IN_CART_ENABLE)\n\t\t\t{\n\t\t\t\t$data['accessory_data'] = $attArr[0];\n\t\t\t\t$data['acc_quantity_data'] = $attArr[1];\n\t\t\t\t$data['acc_attribute_data'] = $attArr[2];\n\t\t\t\t$data['acc_property_data'] = $attArr[3];\n\t\t\t\t$data['acc_subproperty_data'] = $attArr[4];\n\n\t\t\t\tif (isset($data['accessory_data']) && ($data['accessory_data'] != \"\" && $data['accessory_data'] != 0))\n\t\t\t\t{\n\t\t\t\t\t$accessory_data = explode(\"@@\", $data['accessory_data']);\n\t\t\t\t\t$acc_quantity_data = explode(\"@@\", $data['acc_quantity_data']);\n\t\t\t\t\t$acc_attribute_data = explode(\"@@\", $data['acc_attribute_data']);\n\t\t\t\t\t$acc_property_data = explode(\"@@\", $data['acc_property_data']);\n\t\t\t\t\t$acc_subproperty_data = explode(\"@@\", $data['acc_subproperty_data']);\n\n\t\t\t\t\tfor ($i = 0; $i < count($accessory_data); $i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$accessory = $producthelper->getProductAccessory($accessory_data[$i]);\n\t\t\t\t\t\t$post = array();\n\t\t\t\t\t\t$post['parent_accessory_product_id'] = $parent_accessory_productid;\n\t\t\t\t\t\t$post['product_id'] = $accessory[0]->child_product_id;\n\t\t\t\t\t\t$post['quantity'] = $acc_quantity_data[$i];\n\t\t\t\t\t\t$post['category_id'] = 0;\n\t\t\t\t\t\t$post['sel_wrapper_id'] = 0;\n\t\t\t\t\t\t$post['attribute_data'] = $acc_attribute_data[$i];\n\t\t\t\t\t\t$post['property_data'] = $acc_property_data[$i];\n\t\t\t\t\t\t$post['subproperty_data'] = $acc_subproperty_data[$i];\n\n\t\t\t\t\t\t$result = $this->_carthelper->addProductToCart($post);\n\n\t\t\t\t\t\t$cart = $session->get('cart');\n\n\t\t\t\t\t\tif (is_bool($result) && $result)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$errmsg = ($result) ? $result : JText::_(\"COM_REDSHOP_PRODUCT_NOT_ADDED_TO_CART\");\n\n\t\t\t\t\t\t\tif (JError::isError(JError::getError()))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$error = JError::getError();\n\t\t\t\t\t\t\t\t$errmsg = $error->message;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (AJAX_CART_BOX == 1)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\techo \"`0`\" . $errmsg;\n\t\t\t\t\t\t\t\tdie();\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$ItemData = $producthelper->getMenuInformation(0, 0, '', 'product&pid=' . $post['product_id']);\n\n\t\t\t\t\t\t\t\tif (count($ItemData) > 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$prdItemid = $ItemData->id;\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{\n\t\t\t\t\t\t\t\t\t$prdItemid = $redhelper->getItemid($post['product_id']);\n\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t$link = JRoute::_(\"index.php?option=\" . $option . \"&view=product&pid=\" . $post[\"product_id\"] . \"&Itemid=\" . $prdItemid, false);\n\t\t\t\t\t\t\t\t$app->Redirect($link, $errmsg);\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\tif (!DEFAULT_QUOTATION_MODE || (DEFAULT_QUOTATION_MODE && SHOW_QUOTATION_PRICE))\n\t\t\t{\n\t\t\t\t$this->_carthelper->carttodb();\n\t\t\t}\n\n\t\t\t$this->_carthelper->cartFinalCalculation();\n\t\t\tunset($cart['AccessoryAsProduct']);\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif (!DEFAULT_QUOTATION_MODE || (DEFAULT_QUOTATION_MODE && SHOW_QUOTATION_PRICE))\n\t\t\t{\n\t\t\t\t$this->_carthelper->carttodb();\n\t\t\t}\n\n\t\t\t$this->_carthelper->cartFinalCalculation();\n\t\t}\n\n\t\tif (!$userfiled)\n\t\t{\n\t\t\tif (AJAX_CART_BOX == 1 && isset($post['ajax_cart_box']))\n\t\t\t{\n\t\t\t\t$link = JRoute::_('index.php?option=' . $option . '&view=cart&ajax_cart_box=' . $post['ajax_cart_box'] . '&tmpl=component&Itemid=' . $Itemid, false);\n\t\t\t\t$app->Redirect($link);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (ADDTOCART_BEHAVIOUR == 1)\n\t\t\t\t{\n\t\t\t\t\t$link = JRoute::_('index.php?option=' . $option . '&view=cart&Itemid=' . $Itemid, false);\n\t\t\t\t\t$app->Redirect($link);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$link = JRoute::_($_SERVER['HTTP_REFERER'], false);\n\n\t\t\t\t\tif ($cart['notice_message'] != \"\")\n\t\t\t\t\t{\n\t\t\t\t\t\t$msg = $cart['notice_message'] . \"<br>\";\n\t\t\t\t\t}\n\n\t\t\t\t\t$msg .= JTEXT::_('COM_REDSHOP_PRODUCT_ADDED_TO_CART');\n\t\t\t\t\t$app->Redirect($link, $msg);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$link = JRoute::_('index.php?option=' . $option . '&view=product&pid=' . $post['p_id'] . '&Itemid=' . $Itemid, false);\n\t\t\t$app->Redirect($link);\n\t\t}\n\t}",
"public function addProduct($prod) {\n\t\t\t$this->products[$this->pid] = $prod;\n\t\t\t$this->pid ++;\n\t\t}",
"public function add()\n {\n if (Request::isMethod('post')) {\n\n $product_id = Request::get('id');\n $product = Product::find($product_id);\n Cart::add(\n [\n 'id' => $product_id,\n 'name' => $product->name,\n 'image' => $product->image,\n 'qty' => 1,\n 'price' => $product->price\n ]\n );\n }\n return redirect('/products');\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&tab=buy&area=cart\" );\n\t}",
"function add($product_id)\n\t{\n\t\t$product = $this->database->getProductbyId($product_id);\n\n\t\tif($product)\n\t\t{\n\t\t\t$this->_add_to_cart($product);\n\t\t}\n\t\t\n\t\t$this->_show_add_to_cart_comment($product['add_to_cart_comment']);\n\t\t\n\t\tredirect('cart');\n\t}",
"public function addCart()\n\t{\t\n\t\t$id \t\t\t= isset($_POST['id'])\t\t? abs((int)$_POST['id']) : 0;\n\t\t$filter_item_id\t= isset($_POST['size'])\t\t? abs((int)$_POST['size']) : 0;\n\t\t$type \t\t\t= isset($_POST['type'])\t\t? abs((int)$_POST['type']) : 0;\n\t\t$quantity \t\t= isset($_POST['quantity'])\t? abs((int)$_POST['quantity']) : 1;\n\t\n\t\t$quantity = $quantity <= 0 ? 1 : $quantity;\n\t\t\n\t\t# есть ли такой товар\n\t\t$product = $this->productModel->getProduct($id);\n\n\t\tif ( ! $product){return 1;}\n\n\t\t# аня попросила внести категорию в заказ\n\t\t$product->parent = $this->categoryModel->getCategory($product->parent);\n\t\t\n\t\t# если есть цена-размер\n\t\tif ($product->prices){\n\t\t\t# если неверный размер(кто-то балуется)\n\t\t\tif ( ! isset($product->prices[$filter_item_id])) return;\n\t\t\t\n\t\t\tif ($type == 0){\n\t\t\t\t$price = $product->prices[$filter_item_id]->roz;\n\t\t\t}elseif($type == 1){\n\t\t\t\t$price = $product->prices[$filter_item_id]->opt;\n\t\t\t}else{\n\t\t\t\treturn;\n\t\t\t}\n\t\t}else{\n\t\t\t$price = $product->price;\n\t\t}\n\t\t\n\t\t# если цена равна нулю - выходим\n\t\tif ( ! $price) return;\n\t\t\n\t\t# опции\n\t\t$options = array(\n\t\t\t'type'=>$type,\n\t\t\t'size'=>$filter_item_id \n\t\t);\n\n\t\t$data = array(\n\t\t\t'id'\t\t\t\t=> $product->id,\n\t\t\t'qty'\t\t\t\t=> $quantity,\n\t\t\t'price'\t\t\t\t=> $price,\n\t\t\t'options'\t\t\t=> $options,\n\t\t\t\n\t\t\t'discount'\t\t\t=> $product->discount*1 ? $product->discount : (isset($product->prices[$filter_item_id]) ? $product->prices[$filter_item_id]->discount : 0),\n\t\t\t'prices'\t\t\t=> isset($product->prices[$filter_item_id]) ? (array)$product->prices[$filter_item_id] : '',\n\t\t\t\n\t\t\t'parent'\t\t\t=> $product->parent,\n\t\t\t'manufacturer'\t\t=> isset($product->manufacturer->name) ? $product->manufacturer->name : '—',\n\t\t\t'manufacturer_id'\t=> $product->manufacturer_id,\n\t\t\t'name'\t\t\t\t=> $product->name,\n\t\t\t'image'\t\t\t\t=> $product->image,\n\t\t\t'url'\t\t\t\t=> $product->url,\n\t\t\t'_url'\t\t\t\t=> $product->_url\n\t\t);\n\t\t\n\t\t$this->cart->insert($data);\n\t}",
"public function cart(): void\n {\n $userData = $this->getSession()->getCurrentUserData();\n\n if ($userData->getCart() && $userData->getCart()->hasProducts())\n {\n echo $this->render('cart/shoppingCart', $userData->getRenderCartParams());\n }\n }",
"public function addProduct(Cart $cartObj) :bool\n {\n $orderObj = new Order();\n $orderObj->createOrder();\n $query = $this->pdo->prepare(\"SELECT orders_products.id from orders_products\nINNER JOIN orders on orders_products.order_id = orders.id\nWHERE orders.user_id = :user_id AND orders.status='cart' AND orders_products.product_id=:product_id\");\n $query->execute(array('product_id'=>$cartObj->getProductId(),'user_id'=> $orderObj->getUserId()));\n $row = $query->fetchALL(PDO::FETCH_ASSOC);\n if (empty($row)) {\n $query = $this->pdo->prepare(\"\n INSERT INTO orders_products\n SELECT NULL,id,:product_id,:quantity FROM orders WHERE user_id = :user_id AND status ='cart'\");\n $query->execute(array\n (\n 'product_id' => $cartObj->getProductId(),\n 'user_id' => $orderObj->getUserId(),\n 'quantity'=>$cartObj->getQuantity()));\n $product = new Product();\n $product->decreaseQuantity($cartObj->getOrderId(), $cartObj->getQuantity());\n unset($query);\n } else {\n $query = $this->pdo->prepare(\"UPDATE orders_products \n SET quantity = quantity+:quantity WHERE product_id =:product_id;\");\n $query->execute(array\n (\n 'product_id'=>$cartObj->getProductId(),\n 'quantity'=>$cartObj->getQuantity()));\n $product = new Product();\n $product->decreaseQuantity($cartObj->getProductId(), $cartObj->getQuantity());\n unset($query);\n }\n return true;\n }",
"public function add($product_id)\n {\n $product = Product::find($product_id);\n if(!$product)\n {\n abort(404);\n }\n Cart::associate('Product','App\\Models')->add($product_id, $product->name, 1, $product->price);\n return redirect()->route('cart.index');\n }",
"public function insertUpdateStoreProductsInCart() {\n if (func_num_args() > 0) {\n $user_id = func_get_arg(0);\n $store_id = func_get_arg(1);\n $product_id = func_get_arg(2);\n $quantity = func_get_arg(3);\n $allCartDetail = array();\n $success = null;\n $i = 0;\n $this->getAdapter()->beginTransaction();\n\n try {\n\n foreach ($product_id as $key => $value) {\n $cartId = $this->select()\n ->from($this, array('id'))\n ->where('user_id = ?', $user_id)\n ->where('store_id = ?', $store_id)\n ->where('product_id = ?', $value);\n\n $cartId = $this->getAdapter()->fetchRow($cartId);\n\n $data = null;\n\n if ($cartId) {\n\n $where['id = ?'] = $cartId['id'];\n $data1 = array('quantity' => 0);\n $data2 = array('quantity' => $quantity[$key]);\n $updateQuantity1 = $this->update($data1, $where);\n $updateQuantity2 = $this->update($data2, $where);\n\n if ($updateQuantity1 && $updateQuantity2) {\n\n $allCartDetail[$i]['cartId'] = $cartId['id'];\n $allCartDetail[$i]['productId'] = $value;\n $allCartDetail[$i]['orderedQuantity'] = $quantity[$key];\n $success = true;\n } else {\n $success = false;\n break;\n }\n } else {\n\n $data = array(\n 'product_id' => $value,\n 'user_id' => $user_id,\n 'quantity' => $quantity[$key],\n 'store_id' => $store_id,\n );\n\n $insertedCartId = $this->insert($data);\n\n if ($insertedCartId) {\n $allCartDetail[$i]['cartId'] = $insertedCartId;\n $allCartDetail[$i]['productId'] = $value;\n $allCartDetail[$i]['orderedQuantity'] = $quantity[$key];\n $success = true;\n } else {\n $success = false;\n break;\n }\n }\n\n $i++;\n }\n\n if ($success) {\n $this->getAdapter()->commit();\n return $allCartDetail;\n } else {\n $this->getAdapter()->rollBack();\n return 'fail';\n }\n } catch (Exception $ex) {\n $this->getAdapter()->rollBack();\n throw new Exception(\"Error : \" . $ex);\n }\n } else {\n throw new Exception(\"Argument has not passed\");\n }\n }",
"public function actionAddtocart($id,$price,$name, $quantity)\n {\n $session = Yii::$app->session;\n //$session->remove('cart');\n if($session->has('cart')) //if the session is there, we need to add to it\n {\n //t\n $item = [\n 'id' => $id,\n 'price' => $price,\n 'name' => $name,\n 'quantity' => $quantity\n\n ];\n $session['cart'] = array_merge($session['cart'],[$item]);\n\n\n }\n else //if the session is not there, we need to create it\n {\n\n $session['cart'] = array();\n $item = [\n 'id' => $id,\n 'price' => $price,\n 'name' => $name,\n 'quantity' => $quantity\n ];\n $session['cart'] = array_merge($session['cart'],[$item]);\n }\n //go to the users' cart page\n $this->redirect(['cart/index']);\n }",
"public function actionAddToCart()\n {\n (LoginController::class)::checkLogin();\n $id = App::call()->request->getParams()['id'];\n $cart = (new Sessions())->get('cart');\n if ($id) {\n if (!$cart || !in_array($id, $cart)) {\n (new Sessions())->add('cart', $id);\n $message = 'Item is added!';\n } else {\n $message = 'Item is already in cart!';\n }\n }\n echo $message;\n }",
"public function addToCart(Request $request){\n if($request->session()->has('user'))\n {\n //add item info inside cart table\n $cart = new Cart;\n $cart->user_id = auth()->user()->id;\n $cart->product_id = $request->product_id;\n $cart->save();\n return redirect('/products');\n }else{\n return redirect('/login');\n }\n }",
"function addToCart() {\n\t\t$wine_name = $_SESSION['wine']['name'];\n\t\t//check if there is a registered user logged in\n\t\t// --> LET US NOT THINK ABOUT USERNAMES FOR NOW <--\n\t\t//if (!isset($_SESSION['user'])) {\n\t\t\t//generate a random username (string) for\n\t\t\t//unlogged user\n\t\t\t//$username = uniqid('',true);\n\t\t\t//$_SESSION['user']['username'] = $username;\n\t\t//}\n\n\t\t//get the cart\n\t\t$cart = $_SESSION['cart'];\n\t\t//get wine count\n\t\t$wine_qty = $_POST['wine_quantity'];\n\t\t// detect if the same item already exist in the cart\n\t\tif (isset($_SESSION['cart'][$wine_name])) {\n\t\t\t//just add the post quantity to the quantity in the cart\n\t\t\t$_SESSION['cart'][$wine_name] += $wine_qty;\n\t\t}\n\t\telse {\n\t\t\t//create an array of the selected item to be\n\t\t\t//added to the cart\n\t\t\t$_SESSION['cart'][$wine_name] = intval($wine_qty);\n\t\t\t//current date will also be used at view cart\n\t\t\t//\"purchase_date\" => date(\"Y-m-d h:i:sa\")\n\t\t}\n\t\t//redirect to homepage\n\t\theader('Location: index.php');\n\t}",
"public function addToCart(Request $request, $id)\n {\n $product = Product::find($id);\n $oldCart = Session::has('cart') ? Session::get('cart') : null;\n $cart = new Cart($oldCart);\n $cart->add($product, $product->id);\n\n $request->session()->put('cart', $cart);\n return redirect('shopping');\n }",
"public static function addProduct($id){\n \n $id = intval($id);\n \n $productsInCart = array();\n \n if(isset($_SESSION['products'])){\n $productsInCart = $_SESSION['products'];\n }\n \n if(array_key_exists($id, $productsInCart)){\n $productsInCart[$id]++;\n }else{\n $productsInCart[$id] = 1; \n }\n \n $_SESSION['products'] = $productsInCart;\n \n return self::countItems();\n }",
"public function add($id)\n {\n \tif(empty($this->items))\n \t{\n \t\t$item = new ShoppingItem($id,1);\n\t\t\t$this->session->push(self::SHOPPINGCART, $item);\n\t\t\t$this->items[] = $item;\n \t}else\n \t{\n \n \t\tif($this->getItem($id))\n \t\t{\n \t\t\t$item = $this->getItem($id);\n \t\t\t$item->quantity += 1;\n \t\t}\n else\n {\n \t\t$item = new ShoppingItem($id,1);\n \t\t$this->session->push(self::SHOPPINGCART,$item);\n \t\t$this->items[] = $item;\n }\n \t} \n \t\n }",
"public function addCart($id, Request $request)\n {\n $carts = empty(Session::get('carts')) ? [] : Session::get('carts');\n //dd($carts);\n // trùng product\n $quantity = $request->quantity;\n if (!empty($carts)) {\n foreach ($carts as $cart) {\n if($cart['id'] == $id){\n $newQuantity = $cart['quantity'];\n $quantity += $newQuantity;\n }\n }\n }\n else{\n $quantity = $request->quantity;\n }\n // dd( $quantityNew);\n\n //// get quantity from Form Request\n // $quantity = $request->quantity;\n\n // get quantity from data\n $product = Product::findOrFail($id);\n $quantityDB = $product->quantity;\n\n if ($quantity <= $quantityDB) {\n $Product = [\n 'id' => $id,\n 'quantity' => $quantity,\n 'price_id' => $request->price_id,\n 'promotion_id' => $request->promotion_id\n ];\n\n $carts[$id] = $Product;\n // set data for SESSION\n session(['carts' => $carts]);\n //dd($carts);\n return redirect()->route('cart.cart-info')\n ->with('success', 'Add Product to Cart successful!');\n\n }else{\n return redirect()->back()->with('error','Please re-enter the quantity!');\n }\n }",
"public function addCart(Request $request)\n {\n $cart = new Cart($request);\n $item = Product::find($request->get('product_id'));\n if(!empty($item)) {\n $data = $cart->addItem($item,1,$request);\n return response()->json([\"message\" => __(\"Product added to cart\"),\"data\" => $data]);\n }\n return response()->setStatusCode(404)->json([\"message\" => \"Product not found\"]);\n\n }",
"function addToCart($id, $name, $supplier, $price, $amount) {\n foreach ($_SESSION['cart'] as $key => $prod) {\n if ($prod['id'] == $id) { // If item is already in cart add selected amount to cart\n $_SESSION['cart'][$key]['amount'] = $_SESSION['cart'][$key]['amount'] + $amount;\n return getCart();\n }\n }\n // If the cart doesn't have the selected item, add it to the cart\n array_push($_SESSION['cart'], [\"id\"=>$id, \"name\"=>$name, \"supplier\"=>$supplier, \"price\"=>$price, \"amount\"=>$amount]);\n return getCart();\n }",
"private function addProduct($product) \r\n\t{\r\n\t\t$this->newProducts[] = $product;\r\n\t}",
"public function addToCart($request)\n\t{\n // Validation \n $this->attributes = $request;\n $this->user_id = 1;\n\n if(!$this->validate()){\n return false;\n }\n\n // Validation: Check Product Exist in Product Table \n $productModel = Products::findOne($this->product_id);\n if(!$productModel){\n $this->addError(\"Failed to Add\",\"Given Product (\".$this->product_id.\") is not Available\");\n return false;\n }\n\n // Check Product Already Exist. If already exist then update other wise add\n $cartProduct = Cart::find()->where([\"product_id\"=>$this->product_id])->one();\n\n if($cartProduct){\n $cartProduct->quantity = $cartProduct->quantity + $this->quantity; \n $isSaved = $cartProduct->save();\n return $isSaved ? $cartProduct->id : false; \n }else{\n $isSaved = $this->save(); \n return $isSaved ? $this->id : false; \n }\n }",
"public function add_product($project_id, $product_id, $quantity, $price)\n\t{\n\t\tif($this->projects_model->add_product($project_id, $product_id, $quantity, $price))\n\t\t{\n\t\t\tredirect('edit-project/'.$project_id);\n\t\t}\n\t}",
"public function addProduct($product)\n {\n \n $cart = $product->cart()->where('cart_id',$this->id)->wherePivot('deleted_at',null)->first();\n\n if(is_null($cart))\n {\n $this->product()->save($product);\n }\n else\n {\n\n $quantity = $cart->pivot->quantity;\n\n $quantity++;\n\n $cart->pivot->update(compact('quantity'));\n }\n\n }",
"public function addItemToCart(Request $request,$id){\n \n //get product\n $product=Product::with('get_images')->findOrFail($id);\n\n\n //check if the quantity entered is null or 0\n\n if($request->quantity==null || $request->quantity==0){\n return back()->withInput($request->input())->withErrors('Min unit needs to be 1');\n }\n //to check if the product exists in cart \n\n $cart_product=Cart::content()->groupBy('id')->get($id);\n\n //if not present check the quantity requested with the entered one. If present then compare with quantity requested and entered.\n\n if($cart_product==null){\n if($request->quantity>$product->quantity){\n return back()->withInput($request->input())->withErrors('Only '.$product->quantity.'units are available');\n }\n }\n else if(($request->quantity+($cart_product->first()->qty))>$product->quantity ){\n return back()->withInput($request->input())->withErrors('Only '.$product->quantity.'units are available');\n }\n if($product->special_price_from && $product->special_price_to){\n $date=date('Y-m-d');\n if($date<=$product->special_price_to && $date>=$product->special_price_from){\n \n $product->price=$product->special_price;\n\n }\n }\n Cart::add(['id'=>$product->id,'name'=>$product->name,'qty'=>$request->quantity,'price'=>$product->price,'options'=>['image'=>$product->get_images->first()->image_name]]);\n session(['cart_total'=>round((float)str_replace(',', '', Cart::total()),2)]);\n\n Session::flash('success','Item added to cart!');\n return back();\n\n }",
"public function loadData(Cart $cart)\n\t{\n\t\tif (!Validate::isLoadedObject($cart) || ($products = $cart->getProducts()) === array())\n\t\t\treturn;\n\n\t\t$currency = new Currency($cart->id_currency);\n\t\tif (!Validate::isLoadedObject($currency))\n\t\t\treturn;\n\n\t\t// Cart rules are available from prestashop 1.5 onwards.\n\t\tif (_PS_VERSION_ >= '1.5')\n\t\t{\n\t\t\t$cart_rules = (array)$cart->getCartRules(CartRule::FILTER_ACTION_GIFT);\n\n\t\t\t$gift_products = array();\n\t\t\tforeach ($cart_rules as $cart_rule)\n\t\t\t\tif ((int)$cart_rule['gift_product'])\n\t\t\t\t{\n\t\t\t\t\tforeach ($products as $key => &$product)\n\t\t\t\t\t\tif (empty($product['gift'])\n\t\t\t\t\t\t\t&& (int)$product['id_product'] === (int)$cart_rule['gift_product']\n\t\t\t\t\t\t\t&& (int)$product['id_product_attribute'] === (int)$cart_rule['gift_product_attribute'])\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$product['cart_quantity'] = (int)$product['cart_quantity'];\n\t\t\t\t\t\t\t$product['cart_quantity']--;\n\n\t\t\t\t\t\t\tif (!($product['cart_quantity'] > 0))\n\t\t\t\t\t\t\t\tunset($products[$key]);\n\n\t\t\t\t\t\t\t$gift_product = $product;\n\t\t\t\t\t\t\t$gift_product['cart_quantity'] = 1;\n\t\t\t\t\t\t\t$gift_product['price_wt'] = 0;\n\t\t\t\t\t\t\t$gift_product['gift'] = true;\n\n\t\t\t\t\t\t\t$gift_products[] = $gift_product;\n\n\t\t\t\t\t\t\tbreak; // One gift product per cart rule\n\t\t\t\t\t\t}\n\t\t\t\t\tunset($product);\n\t\t\t\t}\n\n\t\t\t$items = array_merge($products, $gift_products);\n\t\t}\n\t\telse\n\t\t\t$items = $products;\n\n\t\tforeach ($items as $item)\n\t\t{\n\t\t\t$name = $item['name'];\n\t\t\tif (isset($item['attributes_small']))\n\t\t\t\t$name .= ' ('.$item['attributes_small'].')';\n\n\t\t\t$this->line_items[] = array(\n\t\t\t\t'product_id' => (int)$item['id_product'],\n\t\t\t\t'quantity' => (int)$item['cart_quantity'],\n\t\t\t\t'name' => (string)$name,\n\t\t\t\t'unit_price' => Tiresias::helper('price')->format($item['price_wt']),\n\t\t\t\t'price_currency_code' => (string)$currency->iso_code,\n\t\t\t);\n\t\t}\n\t}",
"public function create_cart()\n {\n // get products currently in cart\n\n $products = $this->get();\n\n $shipping = $this->get_shipping_cost();\n $data = '';\n $subtotal = 0;\n\n $data .= '<li class=\"header_row\"><div class=\"col1\">Product Name:</div>\n <div class=\"col2\">Quantity:</div><div class=\"col3\">Product Price:</div>\n <div class=col4>Total:</div></li>';\n\n if ($products != '') {\n //products to display\n\n $line = 1;\n foreach ($products as $product) {\n // create new item in cart\n $data .= '<li';\n if ($line % 2 == 0) {\n $data .= 'class=\"alt\"';\n }\n // displaying cart items(name, price,count)\n $data .= '><div class=\"col1\"><a href=\"' . SITE_PATH . 'product.php?id=' . $product['id'] . '\" >' . $product['name'] . '</a></div>';\n $data .= '<div class=\"col2\"><input name=\"product' . $product['id'] . '\" value=\"' . $_SESSION['cart'][$product['id']] . '\"></div>';\n $data .= '<div class=\"col3\">$' .number_format((float)($product['price']), 2, '.', '') . '</div>';\n $data .= '<div class=\"col4\">$' . $product['price'] * $_SESSION['cart'][$product['id']] . '</div></li>';\n\n // calculating subtotal\n $subtotal += $product['price'] * $_SESSION['cart'][$product['id']];\n\n $line++;\n }\n\n // add subtotal row\n $data .= '<li class=\"subtotal_row\"><div class=\"col1\">Subtotal</div>\n <div class=\"col2\">$' . number_format((float)($subtotal), 2, '.', '') . '</div></li>';\n\n // Tax row\n $data .= '<li class= \"taxes_row\"><div class=\"col1\">Tax (%' . (TAX * 100) . ' )</div>\n <div class=\"col2\">$' . number_format((float)(TAX * $subtotal), 2, '.', '') . '</div></li>';\n\n // Shipping row\n $data .= '<li class= \"shipping_row\"><div class=\"col1\">Total Shipping Cost</div>\n <div class=\"col2\">$' . number_format((float)($shipping), 2, '.', '') . '</div></li>';\n\n\n // add total row\n $data .= '<li class=\"total_row\"><div class=\"col1\">Total</div>\n <div class=\"col2\">$' . number_format((float)((TAX * $subtotal) + $subtotal) + $shipping, 2, '.', '') . '</div></li>';\n \n } else {\n // no products to display\n $data .= '<li><strong>No items in the Cart!</strong></li>';\n\n // add subtotal row\n $data .= '<li class=\"subtotal_row\"><div class=\"col1\">Subtotal</div>\n <div class=\"col2\">$0.00</div></li>';\n\n // Tax row\n $data .= '<li class= \"taxes_row\"><div class=\"col1\">Tax (%' . (TAX * 100) . ' )</div>\n <div class=\"col2\">$0.00</div></li>';\n\n // Shipping row\n $data .= '<li class= \"shipping_row\"><div class=\"col1\">Total Shipping Cost</div>\n <div class=\"col2\">$0.00</div></li>';\n\n // add total row\n $data .= '<li class=\"total_row\"><div class=\"col1\">Total</div>\n <div class=\"col2\">$0.00</div></li>';\n }\n\n\n return $data;\n }",
"function add_to_cart(){\n\t\t$data = array(\n\t\t\t'id' => $this->input->post('produk_id'), \n\t\t\t'name' => $this->input->post('produk_nama'), \n\t\t\t'price' => $this->input->post('produk_harga'), \n\t\t\t'qty' => $this->input->post('quantity'), \n\t\t);\n\t\t$this->cart->insert($data);\n echo $this->show_cart(); //tampilkan cart setelah added\n }",
"public function addItem($id){\n \t$product = Product::findOrFail($id);\n \tCart::add($id, $product->product_name, 1, $product->product_price, 550, ['img'=>$product->image, \"stock\" => $product->stock]);\n \treturn back();\n }",
"public function addProduct($productInfo, $quantity, $request)\n { \n if (empty($this->cart[$productInfo->id])) {\n $product = ['product_id' => $productInfo->id, 'quantity' => $quantity, 'product_name' => $productInfo->product_name, 'product_desc' => $productInfo->product_description, 'product_price' => $productInfo->product_price];\n $this->cart[$productInfo->id] = $product;\n } else {\n $this->addProductCount($productInfo->id, $quantity);\n }\n\n $this->saveCart($request);\n }",
"public function addToCart(Request $request)\n {\n $id = $request->id;\n $type = $request->type;\n $message = '';\n\n switch($type)\n {\n case 'file':\n $product = File::find($id);\n break;\n case 'episode':\n $product = Episode::find($id);\n break;\n case 'plan':\n $product = Plan::find($id);\n break;\n }\n\n\n if(!$product)\n {\n abort(404);\n }\n\n if(Auth::check())\n {\n $userId = Auth::id(); //extracting user ID\n $userCartExistance = Cart::HasCart($userId); //check if this user has any cart or not, this syntax returns true or false\n\n if($userCartExistance) // if logged in user has any cart then return cart object of this user\n {\n\n $userCart = Cart::userCart($userId); // returning cart object\n $cartId = $userCart->id; //returning cart's ID\n\n $productExistance = Cartable::CheckIfExists($cartId, $id, $type); //check if this product already exists in the cartables table or not\n\n if($productExistance) //if this product exists in the cart\n {\n $message = 'محصول موردنظر در سبد خرید شما موجود است.';\n }\n else\n {\n switch($type)\n {\n case 'file':\n $userCart->files()->attach($id);\n break;\n case 'episode':\n $userCart->episodes()->attach($id);\n break;\n case 'plan':\n $userCart->plans()->attach($id);\n break;\n }\n\n $message = 'محصول موردنظر به سبد خرید اضافه شد.';\n\n }\n\n }\n else //if logged in user has no cart then create one for her!\n {\n $userCart = new Cart();\n $userCart->user_id = $userId;\n $userCart->save();\n\n switch($type)\n {\n case 'file':\n $userCart->files()->attach($id);\n break;\n case 'episode':\n $userCart->episodes()->attach($id);\n break;\n case 'plan':\n $userCart->plans()->attach($id);\n break;\n }\n\n $message = 'محصول موردنظر به سبد خرید اضافه شد.';\n\n }\n }\n else // if user is not logged in then store cart information in session\n {\n $oldCart = Session::has('cart') ? Session::get('cart') : null;\n $cart = new ShoppingCart($oldCart);\n $message = $cart->add($product, $type, $id);\n Session::put('cart', $cart);\n }\n // route('showProduct', $id)\n // return redirect()->back()->with('message', $message);\n\n return response()->json(['message' => $message]);\n }",
"public function placeItemsInCart($cartId, array $items, $isReplace = false);",
"public function addProductToCart(Request $request): JsonResponse\n {\n\n // Check if request includes the product\n $product_id = $request->get('product');\n if (!$product_id) {\n return $this->errorResponse('You need to provide a product!', Response::HTTP_BAD_REQUEST);\n }\n\n // Check if product exists in the db\n $product = Product::find($product_id);\n if (!$product) {\n return $this->errorResponse('Couldnt find product', Response::HTTP_NOT_FOUND);\n }\n\n $this->orderHandler->updateCartProductSession($product_id);\n return $this->successResponse([], Response::HTTP_OK);\n }",
"public function addToSession($product)\n {\n $session = $this->session;\n\n if ($session->has('cart')) {\n $products = (array)$session->get('cart');\n array_push($products, $product->getHash());\n $session->set('cart', $products);\n } else {\n $products = array($product->getHash());\n $session->set('cart', $products);\n }\n }",
"public function actionAddToCart($product_id, $user_id, $variation_id) {\n $saveArr['product_id'] = $product_id;\n $saveArr['user_id'] = $user_id;\n $saveArr['variation_id'] = $variation_id;\n $saveArr['created_date'] = date('Y-m-d H:i:s');\n $saveArr['updated_date'] = date('Y-m-d H:i:s');\n $saveArr['updated_by'] = $user_id;\n $saveArr['status'] = '1';\n Yii::$app->db->createCommand()->insert('shopping_cart', $saveArr)->execute();\n exit;\n }",
"public function createCartProduct($request, $product_id)\n {\n $cart = Cart::create([\n 'user_id' => $request->input('user_id'),\n 'quantity' => $request->input('quantity'),\n ]);\n $cart_item = Cart::find($cart->id);\n $cart_item->state = 'direct-buy';\n $cart_item->save();\n DB::table('product_cart')->insert([\n 'product_id' => $product_id,\n 'cart_id' => $cart->id,\n ]);\n }",
"public function postAdd(Request $request, $product_id) {\n $cart = new Carts();\n $mycart = $cart->getCustomerCarts(Auth::guard('web')->user()->id);\n $data_items['desgin_detail'] = $request->desgin_detail;\n $data_items['desgin_link'] = $request->desgin_link;\n $data_items['spec'] = json_encode($request->spec);\n $data_items['product_width'] = $request->product_width ? $request->product_width : 0;\n $data_items['product_height'] = $request->product_height ? $request->product_height : 0;\n $data_items['qty'] = $request->qty ? $request->qty : 1;\n $data_items['product_id'] = $product_id;\n if ($request->page_no) {\n $data_items['page_no'] = $request->page_no;\n }\n\n if ($mycart) {\n //if yes add to order items\n $data_items['cart_id'] = $mycart->id;\n } else {\n //if no create then add to order items\n $data['customer_id'] = Auth::guard('web')->user()->id;\n $order_id = Carts::create($data)->id;\n $data_items['cart_id'] = $order_id;\n }\n $order_id = CartsItems::create($data_items);\n $request->session()->flash('success', 'تمت اضافة المنتج');\n return redirect('cart');\n }",
"public function add($product, $quantity = 1)\n\t{\n\t\t$item = [\n\t\t\t'id' => $product->id,\n\t\t\t'name' => $product->name,\n\t\t\t'price' => ($product->promotionprice != 0) ? $product->promotionprice : $product->unitprice,\n\t\t\t'image' => $product->image,\n\t\t\t'quantity' => $quantity,\n\t\t];\n\n\t\tif(isset($this->items[$product->id])){\n\t\t\t$this->items[$product->id]['quantity'] += $quantity;\n\t\t}else{\n\t\t\t$this->items[$product->id] = $item;\n\t\t}\n\t\t\n\t\tsession(['cart' => $this->items]);\n\t\t//dd($this->items);\n\t}",
"public function addtocart() {\n \n $this->viewBuilder()->layout('');\n //pr($_POST); exit;\n \n \n $session = $this->request->session();\n \n \n //$session->write('mycart','');\n //$session->write('amount','');\n \n $precart = $session->read('mycart');\n \n if(!empty($precart)){\n $cartData['tid'] = $_POST['tid'];\n $cartData['mid'] = $_POST['mid'];\n $cartData['pid'] = $_POST['pid'];\n $cartData['qt'] = $_POST['qt'];\n $cartData['price'] = $_POST['price'];\n $precart[$_POST['pid']]=$cartData;\n //pr($precart); exit;\n $toprice = 0; foreach($precart as $crt){ $toprice = $toprice + $crt['price']; }\n\n //array_merge($precart,$cartData);\n $session->write('mycart',$precart);\n $session->write('amount',$toprice);\n echo count($precart).\"-\".$toprice; exit;\n } else {\n $cartData1['tid'] = $_POST['tid'];\n $cartData1['mid'] = $_POST['mid'];\n $cartData1['pid'] = $_POST['pid'];\n $cartData1['qt'] = $_POST['qt'];\n $cartData1['price'] = $_POST['price']; \n \n $cartData[$_POST['pid']] = $cartData1;\n $session->write('mycart',$cartData);\n $session->write('amount',$_POST['price']);\n echo \"1-\".$_POST['price']; exit;\n }\n \n \n //pr($session->read('mycart')); exit;\n $this->autoRender = false;\n }",
"public function addItemToCart( $item ){\n $this->cartItems[] = $item;\n Cart::updateTotalPrice();\n }",
"public function addToCart(Request $request)\n {\n // Cart::destroy();\n // return $request->all();\n $duplicate = Cart::instance('shopping')->search(function ($cartItem, $rowId) use ($request) {\n return $cartItem->id === $request->id;\n });\n if ($duplicate->isNotEmpty()) {\n $rowId = Cart::instance('shopping')->content()->where('id', $request->id)->first()->rowId;\n // Cart::remove($rowId);\n $arr = array('msg' => 'Already in Cart', 'Status' => false, 'Cart_cout' => Cart::instance('shopping')->content());\n return response($arr, 200);\n } else {\n // Cart::add(['id' => '293ad', 'name' => 'Product 1', 'qty' => 1, 'price' => 9.99 );\n\n Cart::instance('shopping')->add($request->id, $request->name, $request->qty ?? 1, $request->amount , ['qtyValue' => $request->qtyValue])\n ->associate('\\App\\Product');;\n $arr = array('msg' => 'Added to cart', 'Status' => true, 'Cart_cout' => Cart::instance('shopping')->content());\n return response($arr, 200);\n }\n }",
"public function addCartAction(Request $request)\n {\n\n if (!$request->user()) {\n return redirect()->route('login');\n }\n\n $category = $request->get('category');\n\n $productId = $request->get('product');\n $product = Product::find($productId);\n\n $this->cart->add($product, $product->id);\n\n return redirect()->back();\n }",
"public function addProducts( Cart $cart, Request $request ) {\n $this->validate( $request, [\n 'cartKey' => 'required',\n 'item_id' => 'required',\n 'quantity' => 'required|numeric|min:0',\n 'size' => 'required|numeric',\n ] );\n\n /* $validator = Validator::make( $request->all(), [\n 'cartKey' => 'required',\n 'item_id' => 'required',\n 'quantity' => 'required|numeric|min:1|max:10',\n 'size' => 'required|numeric',\n ] );\n\n if ( $validator->fails() ) {\n return response()->json( [\n 'errors' => $validator->errors(),\n ], 400 );\n } */\n\n $cartKey = $request->input( 'cartKey' );\n $item_id = $request->input( 'item_id' );\n $quantity = $request->input( 'quantity' );\n $size = $request->input( 'size' );\n\n //Check if the CarKey is Valid\n if ( $cart->key == $cartKey ) {\n //Check if the proudct exist or return 404 not found.\n try {\n $Product = Product::findOrFail( $item_id );\n $size_details = $Product->sizes()->where( 'shop_product_attribute.id', $size )->first();\n\n $price = $quantity*$size_details->price;\n } catch ( ModelNotFoundException $e ) {\n return response()->json( [\n 'message' => 'The Item you\\'re trying to add does not exist.',\n ], 404);\n }\n\n //check if the the same product is already in the Cart, if true update the quantity, if not create a new one.\n $cartItem = CartItem::where(['cart_id' => $cart->getKey(), 'product_id' => $item_id])->first();\n\n if ($cartItem) {\n if($quantity==0){\n $del=CartItem::where(['cart_id' => $cart->getKey(), 'product_id' => $item_id])->delete();\n }else{\n $cartItem->quantity = $quantity;\n CartItem::where(['cart_id' => $cart->getKey(), 'product_id' => $item_id])->update(['quantity' => $quantity, 'size_id' => $size, 'price' => $price,'size_title'=>$size_details->name]);\n }\n } else if($quantity>0){\n CartItem::create(['cart_id' => $cart->getKey(), 'product_id' => $item_id, 'quantity' => $quantity, 'size_id' => $size, 'price' => $price,'size_title'=>$size_details->name]);\n }\n\n $total_quantity=CartItem::where(['cart_id' => $cart->getKey()])->sum('quantity');\n $total_price=CartItem::where(['cart_id' => $cart->getKey()])->sum('price');\n //2 items AED 122\n return response()->json(['total_quantity' =>\"$total_quantity\",'total_price' =>'AED '.$total_price\n ,'message' => (isset($del))?'Item Removed from cart successfully':'The Cart was updated with the given product information successfully'], 200);\n\n } else {\n\n return response()->json([\n 'message' => 'The CarKey you provided does not match the Cart Key for this Cart.',\n ], 400);\n }\n\n }",
"public function addProducts(Cart $cart, Request $request) {\n $this->validate(\n $request,\n [\n 'cartKey' => 'required',\n 'item_id' => 'required',\n 'quantity' => 'required|numeric|min:0',\n 'size' => 'required|numeric',\n ]\n );\n\n /* $validator = Validator::make( $request->all(), [\n 'cartKey' => 'required',\n 'item_id' => 'required',\n 'quantity' => 'required|numeric|min:1|max:10',\n 'size' => 'required|numeric',\n ] );\n\n if ( $validator->fails() ) {\n return response()->json( [\n 'errors' => $validator->errors(),\n ], 400 );\n } */\n\n $cartKey = $request->input('cartKey');\n $item_id = $request->input('item_id');\n $quantity = $request->input('quantity');\n $size = $request->input('size');\n\n //Check if the CarKey is Valid\n if ($cart->key == $cartKey) {\n //Check if the proudct exist or return 404 not found.\n try {\n $Product = Product::findOrFail($item_id);\n $size_details = $Product->sizes()->where('shop_product_attribute.id', $size)->first();\n\n $price = $quantity * $size_details->price;\n } catch (ModelNotFoundException $e) {\n return response()->json(\n [\n 'status' => 0,\n 'message' => 'The Item you\\'re trying to add does not exist.',\n ],\n 404\n );\n }\n\n //check if the the same product is already in the Cart, if true update the quantity, if not create a new one.\n $cartItem = CartItem::where(['cart_id' => $cart->getKey(), 'product_id' => $item_id])->first();\n\n if ($cartItem) {\n if ($quantity == 0) {\n $del = CartItem::where(['cart_id' => $cart->getKey(), 'product_id' => $item_id])->delete();\n } else {\n $cartItem->quantity = $quantity;\n CartItem::where(['cart_id' => $cart->getKey(), 'product_id' => $item_id])->update(['quantity' => $quantity, 'size_id' => $size, 'price' => $price, 'size_title' => $size_details->name]);\n }\n } else {\n if ($quantity > 0) {\n CartItem::create(['cart_id' => $cart->getKey(), 'product_id' => $item_id, 'quantity' => $quantity, 'size_id' => $size, 'price' => $price, 'size_title' => $size_details->name]);\n }\n }\n\n $total_quantity = CartItem::where(['cart_id' => $cart->getKey()])->sum('quantity');\n $total_price = CartItem::where(['cart_id' => $cart->getKey()])->sum('price');\n //2 items AED 122\n return response()->json(\n [\n 'status' => 1,\n 'total_quantity' => \"$total_quantity\",\n 'total_price' => 'AED ' . $total_price,\n 'message' => (isset($del)) ? 'Item Removed from cart successfully' : 'The Cart was updated with the given product information successfully'\n ],\n 200\n );\n\n } else {\n\n return response()->json(\n [\n 'status' => 0,\n 'message' => 'The CarKey you provided does not match the Cart Key for this Cart.',\n ],\n 400\n );\n }\n\n }",
"public function add($sunglassesId) {\n\t\t$this->load->model('SunglassesModel');\n\t\t$this->SunglassesModel->addToCart($sunglassesId);\n\t\techo \"Adding product to cart\";\n\t}",
"public function addToCart(Request $request, $id){\n if(Auth::user()) {\n $shop = Product::find($request->product);\n if(!$shop) {\n abort(404);\n }\n \n $cart = session()->get('cart'); //verificam daca exista un cos in sesiune\n\n if(!$cart) {\n $cart = [\n $id => [\n \"name\" => $shop->name,\n \"quantity\" => 1,\n \"price\" => $shop->price,\n \"image\" => $shop->image\n ]\n ];\n session()->put('cart', $cart);\n return redirect()->back()->with('cart-success', 'Produs adaugat cu succes!');\n }\n \n if(isset($cart[$id])) { // daca cart nu este gol at verificam daca produsul exista pt a incrementa cantitate\n $cart[$id]['quantity']++;\n session()->put('cart', $cart);\n return redirect()->back()->with('cart-success', 'Produs adaugat cu succes!');\n }\n \n $cart[$id] = [ // daca item nu exista in cos at addaugam la cos cu quantity = 1\n \"name\" => $shop->name,\n \"quantity\" => 1,\n \"price\" => $shop->price,\n \"image\" => $shop->image\n ];\n session()->put('cart', $cart);\n return redirect()->back()->with('cart-success', 'Produs adaugat cu succes!');\n } else {\n return view('auth.login', ['url' => 'user']);\n }\n \n }",
"public function add($id){\n $product = Product::findOrFail($id);\n\n //goi phuong thức add() từ thư viện Cart\n Cart::add([\n 'id' => $id,\n 'name' => $product->name,\n 'qty' => 1,\n 'price' => $product->discount ?? $product->price,\n 'weight' => $product->weight ?? 0,\n 'options' => [\n 'images' => $product->productImages,\n ],\n ]);\n\n//dung phuong thuc content() de xem DL trong cart\n// dd(Cart::content());\n\n return back();\n }",
"public function addItemToCart($id)\n {\n\n //$this->db->query(\"insert into koszyk (id_produktu, id_klienta, ilosc)\");\n\n return $this->getProductById($id);\n }",
"public function store(Request $request)\n {\n $rules = CartProduct::rules($request);\n $request->validate($rules);\n $product = Products::findOrFail($request->product_id);\n // Check if user has already cart\n $cart = Cart::where('user_id', Auth()->id())\n ->first();\n if ($cart==null) {// User does not have cart\n $newCart = Cart::create([\n 'user_id' => Auth()->id(),\n 'total' => $product->product_price\n ]);\n $credentials = CartProduct::credentials($request, $product);\n $credentials['cart_id'] = $newCart->id;\n $CART = CartProduct::create($credentials);\n } else {//User already have cart\n $credentials = CartProduct::credentials($request, $product);\n $credentials['cart_id'] = $cart->id;\n // Test 1\n $SameProduct = CartProduct::where('user_id', Auth()->id())->where('product_id' , $product->id )->get();\n if ($SameProduct->count() >= 1 ) {\n return redirect()->route('my-cart.index')->withErrors('The Item Is Already Exist');\n } else {\n // Insert product into cart\n $CART = CartProduct::create($credentials);\n // update total price\n $this->updateTotal($cart);\n }\n }\n\n\n return redirect()->route('my-cart.index');\n }"
] | [
"0.7679751",
"0.75072837",
"0.74739057",
"0.7393167",
"0.7393167",
"0.7326175",
"0.72718024",
"0.7270599",
"0.7206845",
"0.71892416",
"0.71466136",
"0.71236646",
"0.7083336",
"0.7081223",
"0.7073627",
"0.70351636",
"0.7026774",
"0.69907373",
"0.697701",
"0.69648874",
"0.6955173",
"0.6943374",
"0.6908545",
"0.6900886",
"0.68942267",
"0.6893526",
"0.6890054",
"0.68843746",
"0.6877421",
"0.6876835",
"0.6867776",
"0.68383485",
"0.6788887",
"0.6783959",
"0.6769772",
"0.67636275",
"0.67582446",
"0.67250335",
"0.67246115",
"0.6710886",
"0.6702148",
"0.66941863",
"0.66936713",
"0.6681198",
"0.6675513",
"0.6675348",
"0.66752285",
"0.66708976",
"0.6668714",
"0.66608447",
"0.66482234",
"0.66332865",
"0.66320884",
"0.6620778",
"0.66121906",
"0.6610902",
"0.66083854",
"0.6595134",
"0.6583912",
"0.657604",
"0.6574939",
"0.6569582",
"0.6569346",
"0.65659654",
"0.6564444",
"0.6560911",
"0.6542173",
"0.6533147",
"0.6529858",
"0.652292",
"0.6520932",
"0.65173185",
"0.65141994",
"0.6512155",
"0.65100145",
"0.6506836",
"0.64946413",
"0.6492782",
"0.6490733",
"0.64868927",
"0.6485413",
"0.6475357",
"0.6474906",
"0.6468353",
"0.64678586",
"0.64663607",
"0.6460773",
"0.64579076",
"0.64477533",
"0.64258987",
"0.6419973",
"0.64081234",
"0.6401445",
"0.6400111",
"0.6396267",
"0.63912165",
"0.6385785",
"0.63837326",
"0.6382487",
"0.63716084",
"0.6366862"
] | 0.0 | -1 |
checkout the cart Items and create and order. | public function dathang(Request $request, CartItem $cart_id)
{
$validator = Validator::make($request->all(), [
'phivcnoidia' => 'required',
'discount' => 'required',
]);
if ($validator->fails()) {
return response()->json([
'errors' => $validator->errors(),
], 400);
}
if (Auth::guard('api')->check()) {
$userID = auth('api')->user()->getKey();
}
$cartKey = $request->input('cartKey');
$phivcnoidia = $request->input('phivcnoidia');
$discount = $request->input('discount');
$d = substr('DH000000', 2, 5);
$n =0 ;
$price = DB::table('cart_items')->where('cart_id',$cartKey)->sum('price');
$tygia = 3.335;
$tienhang = round(($price * $tygia) - $discount);
$pdv = 0;
if( $tienhang > 0 && $tienhang < 10000000)
{
$pdv = ROUND($price * 0.05);
}
if( $tienhang > 10000000 && $tienhang < 50000000)
{
$pdv = ROUND($price * 0.04);
}
if( $tienhang > 50000000 && $tienhang < 100000000)
{
$pdv = ROUND($price * 0.03);
}
if( $tienhang > 100000000 && $tienhang < 200000000)
{
$pdv = ROUND($price * 0.02);
}
if( $tienhang >= 200000000)
{
$pdv = ROUND($price * 0.01);
}
$qty= $tienhang + $phivcnoidia + $pdv;
$donhang = DB::table('donhangs')->select('madonhang')->where('cart_item_id',$cart_id)->get();
if ($donhang) {
$donhang3 = DB::table('donhangs')->count('madonhang');
$donhang4 = 'DH'.$d. ($donhang3 + 1);
$donhang = donhang::create([
'user_id' => isset($userID) ? $userID : null,
'madonhang' =>$donhang4,
'cart_item_id' => $cartKey,
'locationship'=> 'null',
'totalqty' => $qty,
'status' => 'mở'
]);
$donhang1 = DB::table('cart_items')->select('cart_items.cart_id','cart_items.name_product','cart_items.size','cart_items.color','cart_items.price','cart_items.quantity')
->where('cart_items.cart_id',$cartKey)->get();
foreach ($donhang1 as $donhang1) {
$chitietdonhang = new chitietdonhang();
$chitietdonhang->donhang_id = $donhang->id;
$chitietdonhang->name_product = $donhang1->name_product;
$chitietdonhang->size = $donhang1->size;
$chitietdonhang->color = $donhang1->color;
$chitietdonhang->price = $donhang1->price;
$chitietdonhang->quantity = $donhang1->quantity;
$chitietdonhang->save();
}
}else{
$donhang4 = 'DH' . $d . $n;
$donhang = donhang::create([
'user_id' => isset($userID) ? $userID : null,
'madonhang' =>$donhang4,
'cart_item_id' => $cartKey,
'locationship'=> 'null',
'totalqty' => $qty,
'status' => 'mở'
]);
$donhang1 = DB::table('cart_items')->select('cart_items.cart_id','cart_items.name_product','cart_items.size','cart_items.color','cart_items.price','cart_items.quantity')->where('cart_items.cart_id',$cartKey)->get();
foreach ($donhang1 as $donhang1) {
$chitietdonhang = new chitietdonhang();
$chitietdonhang->donhang_id = $donhang->id;
$chitietdonhang->name_product = $donhang1->name_product;
$chitietdonhang->size = $donhang1->size;
$chitietdonhang->color = $donhang1->color;
$chitietdonhang->price = $donhang1->price;
$chitietdonhang->quantity = $donhang1->quantity;
$chitietdonhang->save();
}
}
$chitietdonhang3 = DB::table('chitietdonhangs')->select('chitietdonhangs.name_product','chitietdonhangs.size','chitietdonhangs.color','chitietdonhangs.price','chitietdonhangs.quantity')
->join('donhangs','donhangs.id','=','chitietdonhangs.donhang_id')
->where('donhangs.id',$donhang->id)->get();
return response()->json([
'message' => 'Đơn hàng được tạo',
'đơn hàng' => $donhang->madonhang,
'chi tiết đơn hàng' => $chitietdonhang3,
'Tông tiền ( tạm tính)' => $donhang,
], 200);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function saveCartItems() {\n $order_id = $this->_order->check_cart($this->_auth->id);\n //echo '<pre>';\n //var_dump($this->_items);\n \n $order_data = array('user_id' => $this->_auth->id, 'order_status'=>'incomplete', 'ip'=>$_SERVER[\"REMOTE_ADDR\"],\n 'items' => serialize($this->_items)\n );\n //udpate order table\n if ($order_id) {\n $order_data['date_modified'] = date(\"Y-m-d H:i:s\");\n $this->_order->update($order_data, $order_id);\n } else {\n $order_data['date_added'] = date(\"Y-m-d H:i:s\");\n $order_id = $this->_order->save($order_data);\n }\n // echo $order_id; \n }",
"public function action_purchaseCartItems()\n {\n $cartItems = $this->request->post('itemList');\n\n if(!is_null($cartItems))\n {\n $cartIds = explode(\"_\", $cartItems);\n $modelCartItems = new Model_CartItemInfo();\n try\n {\n for($i = 0; $i<count($cartIds)-1; $i++)\n $modelCartItems->purchaseItem($cartIds[$i]);\n }\n catch (Exception $e)\n {\n $this->request->status = 400;\n $this->request->response = View::factory('errors/400');\n }\n }\n else\n {\n $this->request->status = 406;\n $this->request->response = View::factory('errors/406');\n }\n\n //Need to redirect to print ticket page\n $authManager = new Manager_AuthManager();\n $authManager->addValueToSession('cartItemIds',$cartIds);\n $this->redirect('ticket/print');\n }",
"public function checkout(Request $request)\n {\n\n\t\t$builder = new ProductCheckoutBuilder();\n\t\t\n\t\t$order = new Order();\n\t\t$order->customer_id = $request->customer_id;\n\t\t$builder->setOrder($order);\n\t\t\n\t\tcollect($request->cart)->map(function($order) use ($builder) {\n\t\t\t$order_detail = new OrderDetail();\n\t\t\t$order_detail->product_id = $order['product_id'];\n\t\t\t$order_detail->quantity = $order['quantity'];\n\t\t\t$builder->add($order_detail);\n\t\t});\n\t\t$builder->checkout();\n }",
"function checkout() \n\t\t{\n\t\t\t// Minimum order value has not been reached, set a custom error message notifying the user.\t\t\t\n\t\t\tif (! $this->flexi_cart->minimum_order_status())\n\t\t\t{\n\t\t\t\t$this->flexi_cart->set_error_message('The minimum order value of '.$this->flexi_cart->minimum_order().' has not been reached.', 'public');\n\t\t\t\t// Set a message to the CI flashdata so that it is available after the page redirect.\n\t\t\t\t$this->session->set_flashdata('message', $this->flexi_cart->get_messages());\n\t\t\t\tredirect('cart');\n\t\t\t}\n\t\t\t\n\t\t\t// There are no items in the cart that can currently be shipped to the current shipping location, set a custom error message notifying the user.\n\t\t\tif (! $this->flexi_cart->location_shipping_status(FALSE))\n\t\t\t{\n\t\t\t\t$this->flexi_cart->set_error_message('There are no items in the cart that can currently be shipped to the current shipping location.', 'public');\n\t\t\t\t// Set a message to the CI flashdata so that it is available after the page redirect.\n\t\t\t\t$this->session->set_flashdata('message', $this->flexi_cart->get_messages());\n\t\t\t\tredirect('cart');\n\t\t\t}\n\n\t\t\t$this->load->model('demo_cart_model');\n\n\t\t\t// Check whether the cart is empty and redirect the user away.\n\t\t\tif (! $this->flexi_cart->cart_status())\n\t\t\t{\n\t\t\t\t$this->flexi_cart->set_error_message('You must add an item to the cart before you can checkout.', 'public');\n\n\t\t\t\t// Set a message to the CI flashdata so that it is available after the page redirect.\n\t\t\t\t$this->session->set_flashdata('message', $this->flexi_cart->get_messages());\n\t\t\t\t\n\t\t\t\tredirect('cart');\n\t\t\t}\n\n\t\t\t// Load PayPal library config file.\n\t\t\t$this->config->load('paypal');\n\n\t\t\t$paypal_config = array(\n\t\t\t\t// Sandbox / testing mode option.\n\t\t\t\t'Sandbox' \t\t=> $this->config->item('Sandbox'),\n\t\t\t\t// PayPal API username of the API caller\n\t\t\t\t'APIUsername' \t=> $this->config->item('APIUsername'),\n\t\t\t\t// PayPal API password of the API caller\n\t\t\t\t'APIPassword' \t=> $this->config->item('APIPassword'),\n\t\t\t\t// PayPal API signature of the API caller\n\t\t\t\t'APISignature' \t=> $this->config->item('APISignature'),\n\t\t\t\t// PayPal API subject (email address of 3rd party user that has granted API permission for your app)\n\t\t\t\t'APISubject' \t=> '',\n\t\t\t\t// API version you'd like to use for your call. You can set a default version in the class and leave this blank if you want.\n\t\t\t\t'APIVersion' \t=> $this->config->item('APIVersion'),\n\t\t\t\t'DeviceID' \t\t=> $this->config->item('DeviceID'),\n\t\t\t\t'ApplicationID' => $this->config->item('ApplicationID'),\n\t\t\t\t'DeveloperEmailAccount' => $this->config->item('DeveloperEmailAccount')\n\t\t\t);\n\n\t\t\t// Load PayPal library\n\t\t\t$this->load->library('paypal/paypal_pro', $paypal_config);\n\t\t\t\n\t\t\t/**\n\t\t\t * Here we are setting up the parameters for a basic Express Checkout flow.\n\t\t\t *\n\t\t\t * The template provided at /vendor/angelleye/paypal-php-library/templates/SetExpressCheckout.php\n\t\t\t * contains a lot more parameters that we aren't using here, so I've removed them to keep this clean.\n\t\t\t *\n\t\t\t * $domain used here is set in the config file.\n\t\t\t */\n\t\t\t$SECFields = array(\n\t\t\t\t// The expected maximum total amount the order will be, including S&H and sales tax.\n\t\t\t\t'maxamt' \t=> $this->flexi_cart->total($discounts = TRUE, $format_value = FALSE),\n\t\t\t\t'returnurl' => site_url('checkout_review'),\n\t\t\t\t'cancelurl' => site_url('checkout_failed'),\n\t\t\t\t// Header banner image\n\t\t\t\t// 'hdrimg' => '',\n\t\t\t\t'logoimg' \t=> base_url($this->store->owner()->logo),\n\t\t\t\t// A label that overrides the business name in the PayPal account on the PayPal hosted checkout pages. 127 char max.\n\t\t\t\t'brandname' => $this->store->owner()->name,\n\t\t\t\t'customerservicenumber' => $this->store->owner()->name,\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Now we begin setting up our payment(s).\n\t\t\t *\n\t\t\t * Express Checkout includes the ability to setup parallel payments,\n\t\t\t * so we have to populate our $Payments array here accordingly.\n\t\t\t *\n\t\t\t * For this sample (and in most use cases) we only need a single payment,\n\t\t\t * but we still have to populate $Payments with a single $Payment array.\n\t\t\t *\n\t\t\t * Once again, the template file includes a lot more available parameters,\n\t\t\t * but for this basic sample we've removed everything that we're not using,\n\t\t\t * so all we have is an amount.\n\t\t\t */\n\t\t\t$Payments = array();\n\t\t\t$Payment = array(\n\t\t\t\t// Required. The total cost of the transaction to the customer. If shipping cost and tax charges are known, include them in this value. If not, this value should be the current sub-total of the order.\n\t\t\t\t'amt' => $this->flexi_cart->total($discounts = TRUE, $format_value = FALSE),\n\t\t\t\t// Subtotal of items only.\n\t\t\t\t'itemamt' => $this->flexi_cart->item_summary_total($discounts = TRUE, $format_value = FALSE),\n\t\t\t\t// A three-character currency code. Default is USD.\n\t\t\t\t'currencycode' => $this->flexi_cart->currency_name(),\n\t\t\t\t// Total shipping costs for this order. If you specify SHIPPINGAMT you mut also specify a value for ITEMAMT.\n\t\t\t\t'shippingamt' => $this->flexi_cart->shipping_total($discounts = TRUE, $format_value = FALSE),\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Here we push our single $Payment into our $Payments array.\n\t\t\t */\n\t\t\tarray_push($Payments, $Payment);\n\n\t\t\t$OrderItems = array();\n\t\t\tforeach ($this->flexi_cart->cart_items() as $key => $item)\n\t\t\t{\n\t\t\t\tarray_push($OrderItems, array(\n\t\t\t\t\t'l_name' => $item['name'], // Item Name. 127 char max.\n\t\t\t\t\t// 'l_desc' => '', // Item description. 127 char max.\n\t\t\t\t\t'l_amt' => $this->flexi_cart->item_price_total($item['row_id'], $discounts = TRUE, $format_value = FALSE), // Cost of individual item.\n\t\t\t\t\t'l_number' => $item['id'], // Item Number. 127 char max.\n\t\t\t\t\t'l_qty' => $item['quantity'], // Item quantity. Must be any positive integer.\n\t\t\t\t\t// 'l_taxamt' => '', // Item's sales tax amount.\n\t\t\t\t));\n\t\t\t}\n\n\t\t\t/**\n\t\t\t * Now we gather all of the arrays above into a single array.\n\t\t\t */\n\t\t\t$PayPalRequestData = array(\n\t\t\t\t'SECFields' => $SECFields,\n\t\t\t\t'Payments' => $Payments,\n\t\t\t\t'OrderItems' => $OrderItems,\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Here we are making the call to the SetExpressCheckout function in the library,\n\t\t\t * and we're passing in our $PayPalRequestData that we just set above.\n\t\t\t */\n\t\t\t$PayPalResult = $this->paypal_pro->SetExpressCheckout($PayPalRequestData);\n\n\t\t\t/**\n\t\t\t * Now we'll check for any errors returned by PayPal, and if we get an error,\n\t\t\t * we'll save the error details to a session and redirect the user to an\n\t\t\t * error page to display it accordingly.\n\t\t\t *\n\t\t\t * If all goes well, we save our token in a session variable so that it's\n\t\t\t * readily available for us later, and then redirect the user to PayPal\n\t\t\t * using the REDIRECTURL returned by the SetExpressCheckout() function.\n\t\t\t */\n\t\t\tif(!$this->paypal_pro->APICallSuccessful($PayPalResult['ACK']))\n\t\t\t{\n\t\t\t\t$this->data['errors'] = array('Errors'=>$PayPalResult['ERRORS']);\n\t\t\t\t\n\t\t\t\t// Get products.\n\t\t\t\t$this->load->library('store');\n\t\t\t\t\n\t\t\t\t$products = $this->store->products(array(\n\t\t\t\t\t'limit' => 12\n\t\t\t\t));\n\t\t\t\t\n\t\t\t\t$this->data['products'] = $products['rows'];\t\n\t\t\t\t$this->data['total'] = $products['total'];\t\n\t\t\t\t$this->data['pagination'] = $products['pagination'];\n\n\t\t\t\t$this->load->view('public/cart/checkout_error', $this->data);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// Successful call.\n\n\t\t\t\t// Set PayPalResult into session userdata (so we can grab data from it later on a 'payment complete' page)\n\t\t\t\t$this->session->set_userdata('PayPalResult', $PayPalResult);\n\n\t\t\t\t// Move to PayPal checkout\n\t\t\t\tredirect($PayPalResult['REDIRECTURL'], 'Location');\n\t\t\t}\n\t\t}",
"function addItemsToCart()\n\t{\n\t\t$order = $_POST['order'];\n\t\tsession_start();\n\t\tif(isset($_SESSION['userName']))\n\t\t{\n\t\t\t$result = addItemsToCartDB($_SESSION['userName'], $order);\n\t\t\tif($result['status'] == 'COMPLETE')\n\t\t\t{\n\t\t\t\techo json_encode($result);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n # Something went wrong\n\t\t\t\tdie(json_encode($result));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tdie(json_encode(errors(417)));\n\t\t}\n\t}",
"private function addToCart () {\n }",
"private function addToCart () {\n }",
"public function createCart() {\n if (!is_array($this->cart)) {\n $this->cart = array();\n $this->updateSession();\n }\n }",
"public function actionCartPayment()\n\t{ \n\t # - Get Visitor Cart Items for Listing\n\t\t$model = new Store;\t\n \t $cartItem = $model->getAllCartItem();\n \t\t\n\t\t# Create invoice for the subscriptions\n\t\t$invoiceModel = new Invoices;\n\t\t$invoice_id = $invoiceModel->createInvoiceByCart( $cartItem );\n\t\t \n \t\t# Create Subscription for each Item and create relation with the invoice\n\t\t$subModel\t = new Subscriptions;\n\t\t$subs = $subModel->createSubscriptionByCart( $invoice_id, $cartItem );\n\t\t\n\t\t$_SESSION['invoice_id'] = $invoice_id;\n \t\t$this->render(\"cartPayment\", array(\"cartItems\"=>$cartItem));\n\t}",
"public function index()\n {\n if (empty(Auth::user())) {\n return redirect()->route('login')->with('error', 'Please login or register before checkout');\n } else {\n if (Session::has('cart')) {\n $cartProducts = Session::get('cart');\n\n $customerId = Auth::user()->id;\n foreach($cartProducts as $resellerId => $products) {\n $order = Order::create([\n 'customer_id' => $customerId,\n 'reseller_id'=> $resellerId\n ]);\n\n $orderId = $order->id;\n\n if (! empty($orderId)) {\n foreach($products as $product) {\n $orderDetail = new OrderItem;\n $orderDetail->order_id = $orderId;\n $orderDetail->name = $product['name'];\n $orderDetail->sku = $product['sku'];\n $orderDetail->price = $product['price']; \n $orderDetail->qty = $product['quantity'];\n $orderDetail->save();\n }\n }\n }\n\n Session::forget('cart');\n Session::save();\n\n return redirect()->route('home')->with('success', 'Order has been placed');\n } else {\n return redirect()->route('home')->with('error', 'Please add to cart the product');\n }\n }\n }",
"public function checkout(Cart $cart, Request $request)\n {\n\n if (Auth::guard('api')->check()) {\n $userID = auth('api')->user()->getKey();\n }\n $this->validate($request, [\n 'cartKey' => 'required',\n 'name' => 'required',\n 'adress' => 'required',\n /* 'credit_card_number' => 'required',\n 'expiration_year' => 'required',\n 'expiration_month' => 'required',\n 'cvc' => 'required', */\n ]);\n /* $validator = Validator::make($request->all(), [\n 'cartKey' => 'required',\n 'name' => 'required',\n 'adress' => 'required',\n //'credit_card_number' => 'required',\n //'expiration_year' => 'required',\n //'expiration_month' => 'required',\n //'cvc' => 'required',\n ]);\n\n if ($validator->fails()) {\n return response()->json([\n 'errors' => $validator->errors(),\n ], 400);\n } */\n\n $cartKey = $request->input('cartKey');\n if ($cart->key == $cartKey) {\n $name = $request->input('name');\n $adress = $request->input('adress');\n //$creditCardNumber = $request->input('credit_card_number');\n $TotalPrice = (float) 0.0;\n $items = $cart->items;\n\n foreach ($items as $item) {\n\n $product = Product::find($item->product_id);\n $price = $item->price/$item->quantity;\n //$inStock = $product->UnitsInStock;\n $TotalPrice = $TotalPrice + ($price * $item->quantity);\n /* if ($inStock >= $item->quantity) {\n\n $TotalPrice = $TotalPrice + ($price * $item->quantity);\n\n $product->UnitsInStock = $product->UnitsInStock - $item->quantity;\n $product->save();\n } else {\n return response()->json([\n 'message' => 'The quantity you\\'re ordering of ' . $item->Name .\n ' isn\\'t available in stock, only ' . $inStock . ' units are in Stock, please update your cart to proceed',\n ], 400);\n } */\n }\n\n /**\n * Credit Card information should be sent to a payment gateway for processing and validation,\n * the response should be dealt with here, but since this is a dummy project we'll\n * just assume that the information is sent and the payment process was done succefully,\n */\n\n $PaymentGatewayResponse = true;\n $transactionID = md5( uniqid( rand(), true ) );\n\n if ( $PaymentGatewayResponse ) {\n $order = Order::create( [\n 'products' => json_encode( new CartItemCollection( $items ) ),\n 'order_type'=>$cart->cart_type,\n 'totalPrice' => $TotalPrice,\n 'name' => $name,\n 'address' => $adress,\n 'userID' => isset( $userID ) ? $userID : null,\n 'transactionID' => $transactionID,\n ] );\n\n $cart->delete();\n\n return response()->json( [\n 'message' => 'you\\'re order has been completed succefully, thanks for shopping with us!',\n 'orderID' => $order->getKey(),\n ], 200);\n }\n } else {\n return response()->json([\n 'message' => 'The CarKey you provided does not match the Cart Key for this Cart.',\n ], 400 );\n }\n\n }",
"public function checkout()\n {\n $user = Auth::User();\n $cart = DB::table('orders')\n ->select('id')\n ->where('status_id', '=', 1)\n ->where('user_id', '=', $user->id)\n ->value('id');\n $items = Order::find($cart)->product()->get();\n $order = Order::find($cart);\n\n $sum = 0;\n foreach($items as $item) {\n $sum+= number_format($item->pivot->quantity * $item->price, 2);\n }\n\n $addresses = $user->address()->get();\n\n return view('cart.checkout', ['items'=>$items, 'sum'=>$sum, 'user'=>$user, 'addresses'=>$addresses, 'order'=>$order]);\n }",
"public function createCart($observer)\n {\n /*$order = Mage::getModel('sales/order')->loadByIncrementId('145000025');\n print_r($order);exit;*/\n\n $cart = Mage::getModel('checkout/cart')->getQuote();\n $cartItems = $cart->getAllItems();\n\n $result = array();\n $apiItems = array();\n\n foreach ($cartItems as $item) {\n $product = $item->getProduct();\n\n $apiItems[] = array(\n 'sku' => $product->getSku(),\n 'name' => $product->getName(),\n 'vat' => $this->priceFormat($this->getTaxPercent($product->getTaxClassId())),\n 'price' => $this->priceFormat($product->getPrice()),\n 'quantity' => $item->getQty(),\n );\n }\n\n $result['items'] = $apiItems;\n\n $api = Mage::getModel(\"vaimo_urbit/urbit_api\", new Vaimo_UrbIt_Model_Urbit_Api_Client());\n $responseObj = $api->createCart($result);\n\n //save cart id to session\n if (isset($responseObj->response['id'])) {\n Mage::getSingleton('core/session')->setCartIdFromApi($responseObj->response['id']);\n Mage::log($responseObj->response['id']);\n }\n }",
"public function checkout(){\n \n $user_id = Auth::user()->id;\n $order = new Order;\n $total = 0;\n if(Session::has('cart_'.Auth::user()->id)){\n foreach(session('cart_'.Auth::user()->id) as $id => $product){\n $total += $product['price'] * $product['quantity'] ;\n $order->total_price = $total;\n $order->quantity = $product['quantity'];\n $order->user_id = $user_id;\n $order->save();\n $order->product()->sync($product['id'],false);\n }//end foreach\n \n \n Session::forget('cart_'.Auth::user()->id);\n return redirect()->back();\n }\n else{\n return redirect('UserHome');\n }\n \n \n }",
"private function initiate_cart()\n\t{\n\t\tif (!($this->ci->session->has_userdata('cart_items'))) {\n\t\t\t$cart_items = array('cart_items' => array());\n\t\t\t$this->ci->session->set_userdata($cart_items);\n\t\t}\n\t}",
"function make_cart_transaction_button($items,$currency,$order_id)\n\t{\n\t\t$payment_address=$this->_get_payment_address();\n\n\t\t$ipn_url=$this->get_ipn_url();\n\n\t\t$notification_text=do_lang_tempcode('CHECKOUT_NOTIFICATION_TEXT',$order_id);\n\n\t\t$user_details=array();\n\n\t\tif (!is_guest())\n\t\t{\n\t\t\t$user_details['first_name']=get_ocp_cpf('firstname');\n\t\t\t$user_details['last_name']=get_ocp_cpf('lastname');\n\t\t\t$user_details['address1']=get_ocp_cpf('building_name_or_number');\n\t\t\t$user_details['city']=get_ocp_cpf('city');\n\t\t\t$user_details['state']=get_ocp_cpf('state');\n\t\t\t$user_details['zip']=get_ocp_cpf('post_code');\n\t\t\t$user_details['country']=get_ocp_cpf('country');\n\n\t\t\tif (($user_details['address1']=='') || ($user_details['city']=='') || ($user_details['zip']=='') || ($user_details['country']==''))\n\t\t\t{\n\t\t\t\t$user_details=array(); // Causes error on PayPal due to it crashing when trying to validate the address\n\t\t\t}\n\t\t}\n\n\t\treturn do_template('ECOM_CART_BUTTON_VIA_PAYPAL',array('ITEMS'=>$items,'CURRENCY'=>$currency,'PAYMENT_ADDRESS'=>$payment_address,'IPN_URL'=>$ipn_url,'ORDER_ID'=>strval($order_id),'NOTIFICATION_TEXT'=>$notification_text,'MEMBER_ADDRESS'=>$user_details));\n\t}",
"public function addtocart($productid,$quantity,$userid) { \n \n\t\t\t \n\t \n\t\t\t\n\t\t$store=$this->storeManager->getStore();\n $websiteId = $this->storeManager->getStore()->getWebsiteId();\n $customer=$this->customerFactory->create();\n $customer->setWebsiteId($websiteId);\n //$customer->loadByEmail($orderData['email']);// load customet by email address\n\t\t$customer->load($userid);\n\t\t $customer->getId();\n\t\t $customer->getEntityId();\n /* if(!$customer->getEntityId()){\n //If not avilable then create this customer \n $customer->setWebsiteId($websiteId)\n ->setStore($store)\n ->setFirstname($orderData['shipping_address']['firstname'])\n ->setLastname($orderData['shipping_address']['lastname'])\n ->setEmail($orderData['email']) \n ->setPassword($orderData['email']);\n $customer->save();\n } */\n\t\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\n\t\t\n\t\t$quote_sql_customer = \"Select * FROM customer_entity where entity_id=$userid \";\n\t\t $result_result_customer = $connection->fetchAll($quote_sql_customer);\t\n\t\t //exit;\n\t\t if(!empty($result_result_customer)):\n\t\t \n\t\t\n\t\t$quote_sql = \"Select * FROM quote where customer_id=$userid and store_id=1 and is_active=1\";\n\t\t$result_result = $connection->fetchAll($quote_sql);\n\t\t//print_r($result_result); \n\t\tif(!empty($result_result))\n\t\t{\n\t\t $quoteId=$result_result[0]['entity_id'];\n\t\t\t$quote = $this->quote->create()->load($quoteId);\n\t\t\t//echo\"1\";\n\t\t\t\n\t\t $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n\t\t $productdetails = $objectManager->create('Magento\\Catalog\\Model\\Product')->load($productid);\n $checkoutSession =$objectManager->get('Magento\\Checkout\\Model\\Session');\n\t\t $checkoutSession->setQuoteId($quoteId);\n\t\t \n\t\t $this->cart->addProduct($productdetails, array('qty' =>$quantity));\n\t\t $this->cart->save();\n\t\t\t \n\t\t}\n\t\telse \n\t\t{\n\t\t\t\n \n\t\t$quote=$this->quote->create();\n\t\t\n\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n\t\t $productdetails = $objectManager->create('Magento\\Catalog\\Model\\Product')->load($productid);\n /* $quote->addProduct(\n //$product,\n\t\t\t\t$productdetails,\n intval($quantity)\n ); */ \n\t\t/** @var $checkoutSession \\Magento\\Checkout\\Model\\Session */\n //$checkoutSession = $this->getModel('Magento\\Checkout\\Model\\Session');\n\t\t//$checkoutSession =$objectManager->get('Magento\\Checkout\\Model\\Session');\n //$checkoutSession->setQuoteId($quote->getId());\n\t\t\n\t\t$checkoutSession =$objectManager->get('Magento\\Checkout\\Model\\Session');\n\t\t$checkoutSession->setQuoteId($quote->getId());\n\t\t\n\t\t\n\t\t$this->cart->addProduct($productdetails, array('qty' =>$quantity));\n\t\t$this->cart->save();\n\t\t$quote = $this->cart->getQuote();\n //$quote->setCustomerId ($this->_currentCustomer->getCustomerId ());\n \t $quote->setCustomerId ($userid);\n\t\t// Configure quote\n\t\t//$quote->setInventoryProcessed (false);\n\t\t//$quote->collectTotals ();\n\n\t\t// Update changes\n\t\t $quote->setStore($store); //set store for which you create quote\n // if you have allready buyer id then you can load customer directly \n $customer= $this->customerRepository->getById($customer->getEntityId());\n $quote->setCurrency();\n $quote->assignCustomer($customer);\n\t\t\n\t\t\n\t\t$quote->save();\n\t\t//echo $quote->getId();\n\t\t}\n\t\t\n\t\t\n\t\tif($quote->getId())\n\t\t {\n\t\t\t\n\t\t //$result[]=array(\"message\"=>\"product Added\");\n\t\t $result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"product Added\"));\n\t\t }\n\t\t else\n\t\t {\n\t\t \n\t\t// $result[]=array(\"message\"=>\"product not Added\");\n\t\t$result[]=array('status'=>array(\"code\"=>\"0\",\"message\"=>\"product not Added\"));\n\t\t }\n\t\t \n\t\t \n\t\telse:\n\t\t $result[]=array('status'=>array(\"code\"=>\"0\",\"message\"=>\"error\"));\n\t\tendif;\n\t\t\n\t\t\n return $result; \n \n\t }",
"public function addToCart() {\n\t\t$baseQuantity = 1;\n\t\t$result = $this->db->select();\n\t\twhile(($row = mysql_fetch_assoc($result)) != FALSE){\n\t\t\t$_SESSION['cart'][] = array($row['id'], $row['name'], $row['description'], $row['cost'], $baseQuantity);\n\t\t}\n\t}",
"public function allcartAction()\n {\n if ($this->_isCheckFormKey && !$this->_validateFormKey()) {\n $this->_forward('noRoute');\n return;\n }\n\n $wishlist = $this->_getWishlist();\n if (!$wishlist) {\n $this->_forward('noRoute');\n return;\n }\n $isOwner = $wishlist->isOwner(Mage::getSingleton('customer/session')->getCustomerId());\n\n $messages = array();\n $addedItems = array();\n $notSalable = array();\n $hasOptions = array();\n\n $cart = Mage::getSingleton('checkout/cart');\n $collection = $wishlist->getItemCollection()\n ->setVisibilityFilter();\n\n $qtysString = $this->getRequest()->getParam('qty');\n if (isset($qtysString)) {\n $qtys = array_filter(json_decode($qtysString), 'strlen');\n }\n\n foreach ($collection as $item) {\n /** @var Mage_Wishlist_Model_Item */\n try {\n \n $disableAddToCart = $item->getProduct()->getDisableAddToCart();\n $item->unsProduct(); \n \n // Start: Get childProduct and overwrite stored product with loaded simple configurable because it holds stock info\n $itemBuyRequest = $item->getBuyRequest();\n $childProduct = null; \n if($itemBuyRequest['super_attribute']) {\n \n $childProduct = $item->getProduct()->getTypeInstance(true)->getProductByAttributes($itemBuyRequest['super_attribute'], $item->getProduct());\n $childProduct = Mage::getModel('catalog/product')->load($childProduct->getId());\n\n if($childProduct) {\n //$buyRequest->setData('product', $childProduct->getId()); \n $item->setProduct($childProduct); \n $itemBuyRequest->setData('product', $childProduct->getId()); \n $item->mergeBuyRequest($itemBuyRequest); \n } \n } \n // End\n \n // Set qty\n if (isset($qtys[$item->getId()])) {\n $qty = $this->_processLocalizedQty($qtys[$item->getId()]);\n if ($qty) {\n $item->setQty($qty);\n }\n }\n $item->getProduct()->setDisableAddToCart($disableAddToCart);\n // Add to cart\n if ($item->addToCart($cart, $isOwner)) {\n $addedItems[] = $item->getProduct();\n }\n\n } catch (Mage_Core_Exception $e) {\n if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_NOT_SALABLE) {\n $notSalable[] = $item;\n } else if ($e->getCode() == Mage_Wishlist_Model_Item::EXCEPTION_CODE_HAS_REQUIRED_OPTIONS) {\n $hasOptions[] = $item;\n } else {\n $messages[] = $this->__('%s for \"%s\".', trim($e->getMessage(), '.'), $item->getProduct()->getName());\n }\n\n $cartItem = $cart->getQuote()->getItemByProduct($item->getProduct());\n if ($cartItem) {\n $cart->getQuote()->deleteItem($cartItem);\n }\n } catch (Exception $e) {\n Mage::logException($e);\n $messages[] = Mage::helper('wishlist')->__('Cannot add the item to shopping cart.');\n }\n }\n\n if ($isOwner) {\n $indexUrl = Mage::helper('wishlist')->getListUrl($wishlist->getId());\n } else {\n $indexUrl = Mage::getUrl('wishlist/shared', array('code' => $wishlist->getSharingCode()));\n }\n if (Mage::helper('checkout/cart')->getShouldRedirectToCart()) {\n $redirectUrl = Mage::helper('checkout/cart')->getCartUrl();\n } else if ($this->_getRefererUrl()) {\n $redirectUrl = $this->_getRefererUrl();\n } else {\n $redirectUrl = $indexUrl;\n }\n\n if ($notSalable) {\n $products = array();\n foreach ($notSalable as $item) {\n $products[] = '\"' . $item->getProduct()->getName() . '\"';\n }\n $messages[] = Mage::helper('wishlist')->__('Unable to add the following product(s) to shopping cart: %s.', join(', ', $products));\n }\n\n if ($hasOptions) {\n $products = array();\n foreach ($hasOptions as $item) {\n $products[] = '\"' . $item->getProduct()->getName() . '\"';\n }\n $messages[] = Mage::helper('wishlist')->__('Product(s) %s have required options. Each of them can be added to cart separately only.', join(', ', $products));\n }\n\n if ($messages) {\n $isMessageSole = (count($messages) == 1);\n if ($isMessageSole && count($hasOptions) == 1) {\n $item = $hasOptions[0];\n if ($isOwner) {\n $item->delete();\n }\n $redirectUrl = $item->getProductUrl();\n } else {\n $wishlistSession = Mage::getSingleton('wishlist/session');\n foreach ($messages as $message) {\n $wishlistSession->addError($message);\n }\n $redirectUrl = $indexUrl;\n }\n }\n\n if ($addedItems) {\n // save wishlist model for setting date of last update\n try {\n $wishlist->save();\n }\n catch (Exception $e) {\n Mage::getSingleton('wishlist/session')->addError($this->__('Cannot update wishlist'));\n $redirectUrl = $indexUrl;\n }\n\n $products = array();\n foreach ($addedItems as $product) {\n $products[] = '\"' . $product->getName() . '\"';\n }\n\n Mage::getSingleton('checkout/session')->addSuccess(\n Mage::helper('wishlist')->__('%d product(s) have been added to shopping cart: %s.', count($addedItems), join(', ', $products))\n );\n\n // save cart and collect totals\n $cart->save()->getQuote()->collectTotals();\n }\n\n Mage::helper('wishlist')->calculate();\n\n $this->_redirectUrl($redirectUrl);\n }",
"public function orderPlace(Request $request)\n {\n $user_id = auth()->user()->id;\n $allCart = Cart::where('user_id',$user_id)->get();//get user items\n $i=1;\n foreach($allCart as $cart)\n {\n \n $order = new Order ;\n $order->product_id = $cart['product_id'];\n $order->user_id = $cart['user_id'];\n $order->address = $request->address ;\n $order->payment_method = $request->payment_method;\n $order->status = 'pending';\n $order->payment_status = 'pending';\n //save\n $order->save();\n Cart::where('user_id',$user_id)->delete(); //remove item from the Cart()\n }\n return back();\n }",
"public function create_cart()\n\t{\n\t\t#get products currently in cart\n\t\t$products = $this->get();\n\t\t\n\t\t$data = '';\n\t\t$form = '';\n\t\t$total = 0;\n\n\t\tif ($products != '')\n\t\t{\n\t\t\t#products to display\n\t\t\t$line = 1;\n\t\t\t$shipping = 0;\n\n\t\t\tforeach($products as $product)\n\t\t\t{\n\t\t\t\t$item_shipping = $this->get_shipping_cost($product['price']) * $_SESSION['cart'][$product['id']];\n\t\t\t\t$shipping += $item_shipping;\n\t\t\t\t\n\t\t\t\t$data .= '<li><b class=\"tab-head\">Product Name:</b>' . \"<b class='tab-detail'>\" . $product['name'] . '</b></li>';\n\t\t\t\t$data .= '<li><b class=\"tab-head\">Quantity:</b><b class=\"tab-detail\"><input name=\"product' . $product['id'] . '\" value=\"' . $_SESSION['cart'][$product['id']] .'\"></b></li>';\n\t\t\t\t$data .= '<li><b class=\"tab-head\">Product Price:</b><b class=\"tab-detail\">£' . $product['price'] . '</b></li><br>';\n\n\t\t\t\t//Create paypal form fields\n\t\t\t\t$form .= '<input type=\"hidden\" name=\"item_name_' . $line . '\" value=\"' . $product['name'] . '\">';\n\t\t\t\t$form .= '<input type=\"hidden\" name=\"amount_' . $line . '\" value=\"' . number_format($product['price'], 2) . '\">';\n\t\t\t\t$form .= '<input type=\"hidden\" name=\"quantity_' . $line . '\" value=\"' . $_SESSION['cart'][$product['id']] . '\">';\n\t\t\t\t$form .= '<input type=\"hidden\" name=\"shipping_' . $line . '\" value=\"' . $item_shipping . '\">';\n\n\t\t\t\t$total += $product['price'] * $_SESSION['cart'][$product['id']];\n\t\t\t\t$line++;\n\t\t\t}\n\t\t\t#add subtotal row\n\t\t\t$data .= '<li><b class=\"tab-head\">Subtotal:</b><b class=\"tab-detail\">£' . $total . '</b></li>';\n\n\t\t\t#add shipping row\n\t\t\t$data .= '<li><b class=\"tab-head\">Shipping cost:</b><b class=\"tab-detail\">£' . number_format($shipping, 2) . '</b></li>';\n\n\t\t\t#add tax row\n\t\t\tif (SHOP_TAX > 0)\n\t\t\t{\n\t\t\t\t$data .= '<li><b class=\"tab-head\">VAT: (' .(SHOP_TAX * 100) . '%):</b><b class=\"tab-detail\">£' . number_format(SHOP_TAX * $total, 2) . '</b></li>';\n\t\t\t}\n\n\t\t\t#add total row\n\t\t\t$data .= '<br><li><b class=\"tab-head\">Total:</b><b class=\"tab-detail\">£' . number_format((SHOP_TAX * $total) + $total + $shipping, 2) . '</li></b>';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t#no products to display\n\t\t\t$data .= '<li class=\"red\"><p class=\"text-warning\">There are no items are in your basket.</p></li>';\n\t\t\n\t\t\t#add subtotal row\n\t\t\t$data .= '<li><b class=\"tab-head\">Subtotal:</b><b class=\"tab-detail\">£0.00</b></li>';\n\t\t\n\t\t\t#add shipping row\n\t\t\t$data .= '<li><b class=\"tab-head\">Shipping cost:</b><b class=\"tab-detail\">£0.00</b></li>';\n\t\t\t\n\t\t\t#add tax row\n\t\t\tif (SHOP_TAX > 0)\n\t\t\t{\n\t\t\t\t$data .= '<li><b class=\"tab-head\">VAT: (' .(SHOP_TAX * 100) . '%):</b><b class=\"tab-detail\">£0.00</b></li>';\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t#add total row\n\t\t\t$data .= '<br><li><b class=\"tab-head\">Total:</b><b class=\"tab-detail\">£0.00</b></li>';\n\t\t}\n\t\t//set PayPal tax rate \n\t\t$form .= '<input type=\"hidden\" name=\"tax_cart\" value=\"' . number_format(SHOP_TAX * $total, 2).'\">';\n\t\treturn array($data, $form);\n\t}",
"public function checkDone(Request $request) {\n\t\t$cartPrice = DB::table('cartproduct')\n\t\t\t->where('customerid', $request->session()->get('loggedUser')->id)\n\t\t\t->sum('price');\n\t\t$cartlist = DB::table('cartproduct')\n\t\t\t->where('customerid', $request->session()->get('loggedUser')->id)\n\t\t\t->get();\n\t\t$cart = DB::table('cart')\n\t\t\t->where('customerid', $request->session()->get('loggedUser')->id)\n\t\t\t->count();\n\t\tif ($cart == 0) {\n\t\t\techo \"empty\";\n\t\t\treturn;\n\t\t}\n\t\tforeach ($cartlist as $p) {\n\t\t\tif ($p->quantity < $p->cartquantity) {\n\t\t\t\techo \"not available\";\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\n\t\t$invoice = new invoice();\n\t\t$invoice->empid = 0;\n\t\t$invoice->customerid = $request->session()->get('loggedUser')->id;\n\t\t$invoice->price = $cartPrice;\n\t\t$invoice->status = \"ON_PROCESS\";\n\n\t\tdate_default_timezone_set('Asia/Dhaka');\n\n\t\t$invoice->datetime = date('Y-m-d H:i:s');\n\n\t\t$invoice->save();\n\t\tforeach ($cartlist as $cList) {\n\t\t\t$orderlist = new orderlist();\n\t\t\t$orderlist->productid = $cList->id;\n\t\t\t$orderlist->quantity = $cList->cartquantity;\n\t\t\t$orderlist->price = $cList->selling_price;\n\t\t\t$orderlist->total_price = $cList->price;\n\t\t\t$orderlist->invoiceid = $invoice->id;\n\t\t\t$orderlist->save();\n\n\t\t\t$product = product::find($cList->id);\n\t\t\t$product->quantity = $product->quantity - $cList->cartquantity;\n\t\t\t$product->save();\n\n\t\t}\n\t\tDB::table('cart')\n\t\t\t->where('customerid', $request->session()->get('loggedUser')->id)\n\t\t\t->delete();\n\t\treturn redirect()->route('products.index');\n\t}",
"public function cartAction() {\n\t\t$result = $this->_updateShoppingCart();\n\n\t\tif ($result !== true) {\n\t\t\t$response = array('status' => 1, 'message' => $result);\n\t\t\t$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));\n\t\t\treturn;\n\t\t}\n\n\t\t$response = array('status' => 0);\n\n\t\t$quote = $this->_getCart()->getQuote();\n\t\t$checkoutHelper = Mage::helper('checkout');\n\n\t\t$items = array();\n\t\tforeach ($quote->getAllVisibleItems() as $item) {\n\t\t\t$items[] = array(\n\t\t\t\t'id' => $item->getId(),\n\t\t\t\t'qty' => $item->getQty(),\n\t\t\t\t'rowtotal' => $checkoutHelper->formatPrice($item->getRowTotal()),\n\t\t\t);\n\t\t}\n\n\t\t$response['items'] = $items;\n\n\t\t$totals = $quote->getTotals();\n\t\tif (isset($totals['subtotal'])) {\n\t\t\t$response['subtotal'] = $checkoutHelper->formatPrice($totals['subtotal']->getValue());\n\t\t}\n\t\tif (isset($totals['shipping'])) {\n\t\t\t$response['shipping'] = $checkoutHelper->formatPrice($totals['shipping']->getAddress()->getShippingAmount());\n\t\t}\n\t\tif (isset($totals['discount'])) {\n\t\t\t$response['discount'] = $checkoutHelper->formatPrice($totals['discount']->getValue());\n\t\t}\n\t\tif (isset($totals['grand_total'])) {\n\t\t\t$response['grand_total'] = $checkoutHelper->formatPrice($totals['grand_total']->getValue());\n\t\t}\n\n\t\t$response['version'] = strtotime($quote->getUpdatedAt());\n\n\t\t$this->getResponse()->setBody(Mage::helper('core')->jsonEncode($response));\n\t}",
"public function addToCart(): void\n {\n //añadimos un Item con la cantidad indicada al Carrito\n Cart::add($this->oferta->id, $this->product->name, $this->oferta->getRawOriginal('offer_prize'), $this->quantity);\n //emite al nav-cart el dato para que lo actualize\n $this->emitTo('nav-cart', 'refresh');\n }",
"public function create_cart()\n {\n // get products currently in cart\n\n $products = $this->get();\n\n $shipping = $this->get_shipping_cost();\n $data = '';\n $subtotal = 0;\n\n $data .= '<li class=\"header_row\"><div class=\"col1\">Product Name:</div>\n <div class=\"col2\">Quantity:</div><div class=\"col3\">Product Price:</div>\n <div class=col4>Total:</div></li>';\n\n if ($products != '') {\n //products to display\n\n $line = 1;\n foreach ($products as $product) {\n // create new item in cart\n $data .= '<li';\n if ($line % 2 == 0) {\n $data .= 'class=\"alt\"';\n }\n // displaying cart items(name, price,count)\n $data .= '><div class=\"col1\"><a href=\"' . SITE_PATH . 'product.php?id=' . $product['id'] . '\" >' . $product['name'] . '</a></div>';\n $data .= '<div class=\"col2\"><input name=\"product' . $product['id'] . '\" value=\"' . $_SESSION['cart'][$product['id']] . '\"></div>';\n $data .= '<div class=\"col3\">$' .number_format((float)($product['price']), 2, '.', '') . '</div>';\n $data .= '<div class=\"col4\">$' . $product['price'] * $_SESSION['cart'][$product['id']] . '</div></li>';\n\n // calculating subtotal\n $subtotal += $product['price'] * $_SESSION['cart'][$product['id']];\n\n $line++;\n }\n\n // add subtotal row\n $data .= '<li class=\"subtotal_row\"><div class=\"col1\">Subtotal</div>\n <div class=\"col2\">$' . number_format((float)($subtotal), 2, '.', '') . '</div></li>';\n\n // Tax row\n $data .= '<li class= \"taxes_row\"><div class=\"col1\">Tax (%' . (TAX * 100) . ' )</div>\n <div class=\"col2\">$' . number_format((float)(TAX * $subtotal), 2, '.', '') . '</div></li>';\n\n // Shipping row\n $data .= '<li class= \"shipping_row\"><div class=\"col1\">Total Shipping Cost</div>\n <div class=\"col2\">$' . number_format((float)($shipping), 2, '.', '') . '</div></li>';\n\n\n // add total row\n $data .= '<li class=\"total_row\"><div class=\"col1\">Total</div>\n <div class=\"col2\">$' . number_format((float)((TAX * $subtotal) + $subtotal) + $shipping, 2, '.', '') . '</div></li>';\n \n } else {\n // no products to display\n $data .= '<li><strong>No items in the Cart!</strong></li>';\n\n // add subtotal row\n $data .= '<li class=\"subtotal_row\"><div class=\"col1\">Subtotal</div>\n <div class=\"col2\">$0.00</div></li>';\n\n // Tax row\n $data .= '<li class= \"taxes_row\"><div class=\"col1\">Tax (%' . (TAX * 100) . ' )</div>\n <div class=\"col2\">$0.00</div></li>';\n\n // Shipping row\n $data .= '<li class= \"shipping_row\"><div class=\"col1\">Total Shipping Cost</div>\n <div class=\"col2\">$0.00</div></li>';\n\n // add total row\n $data .= '<li class=\"total_row\"><div class=\"col1\">Total</div>\n <div class=\"col2\">$0.00</div></li>';\n }\n\n\n return $data;\n }",
"public function submitCartAction()\n {\n $user = $this->getUser();\n $cart = $this->getDoctrine()\n ->getRepository('ArtSpaceShopBundle:CartItem')\n ->findByUser($user);\n \n // Transfere le caddie dans les commandes passées (PastOrder)\n $em = $this->getDoctrine()->getManager(); \n foreach($cart as $cartItem){\n $pastOrder = new PastOrder;\n $pastOrder->setProduct($cartItem->getProduct());\n $pastOrder->setUser($cartItem->getUser());\n $pastOrder->setQuantity($cartItem->getQuantity());\n $pastOrder->setDate(new \\DateTime);\n \n $em->persist($pastOrder);\n $em->remove($cartItem);\n }\n $em->flush();\n \n return $this->redirect($this->generateUrl('art_space_shop_cart'));\n }",
"public function addToCart() : void\n {\n $this->VIEW = false;\n $this->Cart->addToCart($_SESSION['Auth']->id, $_POST);\n }",
"public function checkout (Request $request, $id)\n {\n // dd($request);\n $cart = Cart::where([['user_id', Auth::id()], ['status', 1], ['id', $id]])->first();\n $cartDetails = CartDetail::join('products', 'products.id', '=', 'cart_details.product_id')\n ->select('products.name', 'products.price', 'products.discount', 'products.image1','products.quantity as pro_quantity', 'cart_details.*')\n ->where([['cart_details.cart_id', $id], ['cart_details.destroy', null],['products.quantity', '>', 0]])->get();\n\n $cartDetails->status = 2;\n if($request->address != null) {\n $customer = Customer::where([['user_id', Auth::id()], ['id', $request->address]])->first();\n if ($customer) {\n $customer->batch++;\n $customer->save();\n }\n }\n else {\n $customer = new Customer;\n $customer->user_id = Auth::id();\n $customer->name = ucwords($request->name);\n $customer->email = $request->email;\n $customer->phone = $request->phone;\n $customer->address = $this->getAddress($request->province, $request->district, $request->ward, $request->street);\n $customer->save();\n }\n\n $bill = new Bill;\n $bill->customer_id = $customer->id;\n if ($request->note) {\n $bill->note = $request->note;\n }\n $bill->status_id = 1;\n $bill->payment = $request->payment;\n $bill->total_price = $request->totalPrice;\n $bill->save();\n\n foreach ($cartDetails as $cartDetail)\n { if ($cartDetail->pro_quantity >= $cartDetail->qty) {\n $cartDetail->status = 2;\n $cartDetail->save();\n $billDetail = new BillDetail;\n $billDetail->bill_id = $bill->id;\n $billDetail->product_id = $cartDetail->product_id;\n $product = Product::where('id', $cartDetail->product_id)->first();\n $product->quantity -= $cartDetail->qty;\n $product->save();\n $revenue = Revenue::where('product_id', $cartDetail->product_id)->first();\n $revenue->sold_quantity += $cartDetail->qty;\n $revenue->the_remaining_quantity = $revenue->total_quantity - $revenue->sold_quantity;\n $revenue->actual_revenue = $revenue->sold_quantity * $revenue->export_price;\n $revenue->save();\n $billDetail->price = $cartDetail->price;\n $billDetail->qty = $cartDetail->qty;\n $billDetail->save();\n }\n }\n $cart->status = 2;\n $cart->save();\n $data['name'] = $customer->name;\n $data['email'] = $customer->email;\n $data['phone'] = $customer->phone;\n $data['note'] = $bill->note;\n $data['payment'] = $bill->payment;\n $data['address'] = $customer->address;\n $data['carts'] = $cartDetails;\n $data['total_price'] = $request->totalPrice;\n $email = $customer->email;\n $name = $customer->name;\n Mail::send('frontend.pages.checkout.email', $data, function ($message) use ($email, $name) {\n $message->from('[email protected]', 'Ho Huong');\n $message->to($email, $name);\n $message->cc('[email protected]', 'Thục Linh');\n $message->subject('Xác nhận thông tin mua hàng');\n });\n\n return redirect()->route('message')->with(['cart' => '']);\n }",
"public function store(Request $request)\n {\n $user = Auth::User();\n $cart = DB::table('orders')\n ->select('id')\n ->where('status_id', '=', 1)\n ->where('user_id', '=', $user->id)\n ->value('id');\n\n if(empty($cart)) {\n $order = new Order;\n $order->user_id = $user->id;\n $order->status_id = 1;\n $order->save();\n\n $orderProduct = new OrderProduct;\n $orderProduct->order_id = $order->id;\n $orderProduct->product_id = $request->product_id;\n $orderProduct->quantity = $request->quantity;\n $orderProduct->save();\n } else {\n // if you already have this product in your cart just add the next quantity to the same line item\n if (OrderProduct::where('order_id', $cart)->where('product_id', $request->product_id)->exists() ){\n $repeatOrderProduct = OrderProduct::where('order_id', $cart)->where('product_id', $request->product_id)->first();\n $orderProduct = OrderProduct::find($repeatOrderProduct->id);\n $orderProduct->product_id = $request->product_id;\n $orderProduct->quantity = $request->quantity + $orderProduct->quantity;\n $orderProduct->save();\n }\n // else make a new line item for this new item\n else {\n $orderProduct = new OrderProduct;\n $orderProduct->order_id = $cart;\n $orderProduct->product_id = $request->product_id;\n $orderProduct->quantity = $request->quantity;\n $orderProduct->save();\n }\n }\n\n Activity::log('Saved an item to their cart.', $user->id);\n\n $request->session()->flash('status', 'Product was saved to cart.');\n\n return Redirect::action('CartController@index');\n\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&tab=buy&area=cart\" );\n\t}",
"public function postAddItem(Request $request){\n // Forget Coupon Code & Amount in Session\n Session::forget('CouponAmount');\n Session::forget('CouponCode');\n\n $session_id = Session::get('session_id');\n if(empty($session_id)){\n $session_id = str_random(40);\n Session::put('session_id', $session_id);\n }\n\n // Kiểm tra item đã có trong giỏ hàng chưa\n $checkItem = Cart::where(['product_id'=>$request['product_id'], 'attribute_id'=>$request['attribute_id'], 'session_id'=>$session_id])->first();\n\n // Nếu item đã có trong giỏ hàng thì cộng số lượng\n // Nếu item chưa có trong giỏ hàng thì thêm vào cart\n if(!empty($checkItem)){\n $checkItem->quantity = $checkItem->quantity + $request['quantity'];\n $checkItem->save();\n }else{\n $cart = new Cart;\n $cart->product_id = $request['product_id'];\n $cart->attribute_id = $request['attribute_id'];\n $cart->quantity = $request['quantity'];\n $cart->session_id = $session_id;\n if($request['user_email']){\n $cart->user_email = '';\n }else{\n $cart->user_email = $request['user_email'];\n }\n $cart->save();\n }\n\n return redirect()->route('get.cart')->with('flash_message_success', 'Sản phẩm đã được thêm vào giỏ hàng!');\n }",
"public function store(Request $request)\n {\n $this->validate($request,[\n 'name' => ['required','string'],\n 'phone' => ['required'],\n 'email' => ['required','string'],\n 'address' => ['required','string'],\n ]);\n\n $carts = Cart::where('customer_id',Auth::guard('customer')->user()->id)->get();\n\n\n foreach ($carts as $cart)\n {\n\n $product = Product::find($cart->product_id);\n $product->quantity -= $cart->quantity;\n $product->save();\n\n Order::create([\n 'customer_id' => Auth::guard('customer')->user()->id,\n 'name' => $request['name'],\n 'phone' => $request['phone'],\n 'email' => $request['email'],\n 'country' => $request['country'],\n 'government' => $request['government'],\n 'city' => $request['city'],\n 'address' => $request['address'],\n 'product_name' => $product->name,\n 'product_price' => $product->price,\n 'image1' => $product->image1,\n 'quantity' => $cart->quantity,\n 'amount' => $cart->quantity * $product->price,\n ]);\n\n Cart::where('id',$cart->id)->delete();\n }\n\n return redirect('/');\n\n\n }",
"public function testCheckCart()\n {\n \n\n $customerSession = $this->getModelMock('customer/session', array('getQuote', 'start', 'renewSession', 'init'));\n $this->replaceByMock('model', 'customer/session', $customerSession);\n \n $itemsCollection = array();\n $product = new Varien_Object();\n $product->setId(1);\n $item = new Varien_Object();\n $item->setProduct($product);\n $item->setId(1);\n $itemsCollection[] = $item;\n $item = new Varien_Object();\n $product->setId(2);\n $item->setProduct($product);\n $item->setId(2);\n $itemsCollection[] = $item;\n $item = new Varien_Object();\n $product->setId(3);\n $item->setProduct($product);\n $item->setId(3);\n $itemsCollection[] = $item;\n $quoteMock = $this->getModelMock('sales/quote', array('getAllItems'));\n $quoteMock->expects($this->any())\n ->method('getAllItems')\n ->will($this->returnValue($itemsCollection));\n $this->replaceByMock('model', 'sales/quote', $quoteMock);\n $quote = Mage::getModel('sales/quote')->load(2);\n $checkoutSession = $this->getModelMock('checkout/session', array('getQuote', 'start', 'renewSession', 'init'));\n $checkoutSession->expects($this->any())\n ->method('getQuote')\n ->will($this->returnValue($quote));\n $this->replaceByMock('model', 'checkout/session', $checkoutSession);\n \n $this->assertEquals(21, Mage::helper('postident/data')->checkCart());\n }",
"public function order(Request $request)\n {\n $items = $request->all();\n unset($items['_token']);\n $client = Auth::user()->client()->first();\n $order = Orders::create([\n 'client_id' => $client->id,\n ]);\n $numb = 0;\n foreach($items as $key => $value)\n {\n if($value == 0)\n {\n continue;\n }\n OrderDetails::create([\n 'order_id' => $order->id,\n 'article_id' => $key,\n 'quantity' => $value,\n 'description' => 'hey',\n ]);\n $numb++;\n }\n if($numb == 0)\n {\n $order->delete();\n }\n $cart = new Shoppingcart($request);\n $cart->removeAll(); \n\n return redirect()->to('/home');\n }",
"public function cartAction()\r\n\t{\r\n\t\t$this->_view->_title = 'Giỏ hàng';\r\n\t\t$this->_view->motoInCart = $this->_model->listItem($this->_arrParam, ['task' => 'motos_in_cart']);\r\n\t\t$this->_view->render($this->_arrParam['controller'] . '/cart');\r\n\t}",
"public function vpup_set_cart() \n {\n // Used to decide if we need to redirect to the cart. \n $should_redirect = false;\n\n // TODO: Refactor this to be dynamic. \n // Check our Product Quantity then add a cart item, if we have any items. \n if( $_GET[ 'vetCertQuantity' ] > 0 ) {\n WC()->cart->add_to_cart( 147, $_GET[ 'vetCertQuantity'] );\n $should_redirect = true;\n }\n\n // Check our Product Quantity then add a cart item, if we have any items. \n if( $_GET[ 'vetCertAvianQuantity' ] > 0 ) {\n WC()->cart->add_to_cart( 149, $_GET[ 'vetCertAvianQuantity'] );\n $should_redirect = true;\n }\n\n // Check our Product Quantity then add a cart item, if we have any items. \n if( $_GET[ 'groomerQuantity' ] > 0 ) {\n WC()->cart->add_to_cart( 150, $_GET[ 'groomerQuantity'] );\n $should_redirect = true;\n }\n\n // Check our Product Quantity then add a cart item, if we have any items. \n if( $_GET[ 'trainerQuantity' ] > 0 ) {\n WC()->cart->add_to_cart( 151, $_GET[ 'trainerQuantity'] );\n $should_redirect = true;\n }\n\n // Return our cart redirect value\n return $should_redirect;\n }",
"public function placeorder(Request $request)\n {\n if(!Session::has('customerlogin'))\n {\n return redirect('customer/signup');\n }\n\n $order = new Order;\n $order->customer_id = Session::get('customerid');\n $order->total_quantity = $request->total_quantity;\n $order->total_price = $request->total_price;\n $order->shipping_cost = $request->shipping_cost;\n $order->payment_method = $request->payment_method;\n $order->transaction_no = $request->transaction_no;\n $order->total_amount = $request->total_amount;\n $order->order_billingaddress = Session::get('customer_billing_address');\n $order->order_status = 'pending';\n $order->save();\n\n $lastid = Order::where('order_status', 'pending')->orderBy('id','desc')->limit(1)->get()->toArray();\n $orderproducts = Cart::with(['product'])->get()->toArray();\n foreach ($orderproducts as $orderproduct) {\n $op = new Orderproduct;\n $op->order_id = $lastid[0]['id'];\n $op->product_id = $orderproduct['product_id'];\n $op->quantity = $orderproduct['quantity'];\n $op->price = $orderproduct['product']['sale_price'];\n $op->total_price = $orderproduct['quantity'] * $orderproduct['product']['sale_price'];\n $op->total_amount = $orderproduct['quantity'] * $orderproduct['product']['sale_price'];\n $op->size = 'XL'; //'not dynamic'\n $op->order_pro_status = 'pending';\n $op->save();\n }\n\n $orderdata = Order::where('customer_id',Session::get('customerid'))->orderBy('id','desc')->limit(1)->get()->toArray(); \n //Remove products from cart for specific session and user\n Cart::where('session_key',Session::getId())->delete(); \n Cart::where('customer_id',Session::get('customerid'))->delete(); \n return redirect('order/confirmation/'.$orderdata[0]['id']);\n }",
"public function save() {\n $_SESSION['cart'] = $this->items;\n\n }",
"public function placeItemsInCart($cartId, array $items, $isReplace = false);",
"public function checkout()\n\t {\n $this->db->where('email',$this->session->userdata('email'));\n $qry=$this->db->get('user');\n $data['user']=$qry->row();\n\t $data['cartItems'] = $this->cart->contents();\n\t\t $this->load->view('checkout',$data);\n\t }",
"public function execute()\n {\n //children[child_id][startdate] = startdate[child_id];\n $newCartState = $this->state->toObject();\n\n $cartSession = JFactory::getSession();\n $cart = ($cart = $cartSession->get('sp4k_cart')) ? $cart : [];\n\n if(count($cart)>0) {\n foreach($cart as $item_type=>&$type_items){\n if($newCartState->item_type == $item_type){\n if(array_key_exists($newCartState->{$newCartState->item_identifier},$type_items)){\n $test='test';\n $type_items[$newCartState->{$newCartState->item_identifier}] = $newCartState;\n }\n }\n }\n }else{\n $cart[$newCartState->item_type][$newCartState->{$newCartState->item_identifier}]\n = $newCartState;\n }\n\n $cartSession->set('sp4k_cart',$cart);\n\n /**\n * todo\n * set a cart item type, then use a class to process that cart item for display.\n * also use that class to process new additions to the cart, so it can intelligently merge new items.\n *\n */\n }",
"public function checkoutAction()\r\n\t{\r\n\r\n\t\t$this->_view->hienthi = false;\r\n\t\t$this->_view->_title = 'Thông tin đặt hàng';\r\n\t\t$this->_view->motoInCart = $this->_model->listItem($this->_arrParam, ['task' => 'motos_in_cart']);\r\n\t\t// $this->_view->user = $this->_model->infoItem($this->_arrParam, ['task' => 'info_user']);\r\n\r\n\t\tif (isset($this->_arrParam['form']['token'])) {\t\t //khi nhan nut xac nhan\t\r\n\t\t\t$this->_validate->validateInfoOrder($this->_arrParam['form_user']);\r\n\t\t\t$this->_arrParam['form_user'] = $this->_validate->getResult();\r\n\t\t\tif (!$this->_validate->isValid()) {\r\n\t\t\t\t$this->_view->user = $this->_model->infoItem($this->_arrParam, ['task' => 'info_user']);\r\n\t\t\t\t$this->_view->hienthi = true;\r\n\t\t\t\t$this->_view->errors = $this->_validate->showErrorsPublic();\r\n\t\t\t} else {// khong co loi\r\n\r\n\t\t\t\t$this->_model->save($this->_arrParam, ['task' => 'submit_cart']);\r\n\t\t\t\t// URL::redirect('frontend', 'index', 'notice', ['type' => 'dat_hang_thanh_cong']);\r\n\t\t\t}\r\n\t\t} else { // moi vao trang\r\n\t\t\t$this->_view->hienthi = true;\r\n\t\t\t$this->_view->user = $this->_model->infoItem($this->_arrParam, ['task' => 'info_user']);\r\n\t\t}\r\n\t\t$this->_view->render($this->_arrParam['controller'] . '/checkout');\r\n\t}",
"public function addtocartAction()\n\t{\n\t\trequire_once './app/Mage.php';\n\t\tMage::app('default');\n\n $params = array();\n\t\t$uid = $this->getRequest()->getPost('uid');\n $pid = $this->getRequest()->getPost('pid');\n\t\t$pqty = $this->getRequest()->getPost('qty');\n $size = $this->getRequest()->getPost('size');\n $params['cptions']['size_clothes'] = $size;\n\n $token = $this->getRequest()->getPost('token');\n\n if($this->tokenval() != $token)\n {\n $response['msg'] = 'You are not authorized to access this';\n $response['status'] = '1';\n echo json_encode($response);\n exit;\n }\n\n $connectionRead = Mage::getSingleton('core/resource')->getConnection('core_read');\n\n $selectrows = \"SELECT `sales_flat_quote`.* FROM `sales_flat_quote` WHERE customer_id= \".$uid.\" AND is_active = '1' AND COALESCE(reserved_order_id, '') = ''\";\n\n $rowArray = $connectionRead->fetchRow($selectrows);\n\n $entity_id = $rowArray['entity_id'];\n\n $select = $connectionRead->select()\n ->from('sales_flat_quote_item', array('*'))\n ->where('quote_id=?', $entity_id)\n ->where('product_id=?', $pid);\n\n $rowItems = $connectionRead->fetchAll($select);\n\n $qtycount = 0;\n $items = array();\n foreach ($rowItems as $item) {\n if ($item['price'] != 0) {\n $qty2 = number_format($item['qty'],0);\n $qtycount += $qty2;\n }\n }\n\n $_product = Mage::getModel('catalog/product')->load($pid);\n\n $qty = 0;\n $min = (float)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getNotifyStockQty();\n\n if ($_product->isSaleable()) {\n if ($_product->getTypeId() == \"configurable\") {\n $associated_products = $_product->loadByAttribute('sku', $_product->getSku())->getTypeInstance()->getUsedProducts();\n foreach ($associated_products as $assoc){\n $assocProduct = Mage::getModel('catalog/product')->load($assoc->getId());\n $qty += (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($assocProduct)->getQty();\n }\n } elseif ($_product->getTypeId() == 'grouped') {\n $qty = $min + 1;\n } elseif ($_product->getTypeId() == 'bundle') {\n $associated_products = $_product->getTypeInstance(true)->getSelectionsCollection(\n $_product->getTypeInstance(true)->getOptionsIds($_product), $_product);\n foreach($associated_products as $assoc) {\n $qty += Mage::getModel('cataloginventory/stock_item')->loadByProduct($assoc)->getQty();\n }\n } else {\n $qty = (int)Mage::getModel('cataloginventory/stock_item')->loadByProduct($_product)->getQty();\n }\n }\n\n $response = array();\n\n $checkqty = $qtycount + $pqty;\n\n /*if($checkqty > 2)\n {\n $response['msg'] = 'The maximum quantity allowed for purchase is 2';\n $response['status'] = '0';\n echo json_encode($response);\n exit;\n }*/\n\n $params['product_id'] = $pid;\n $params['qty'] = $pqty;\n\n if ($_product->getTypeId() == \"configurable\" && isset($params['cptions'])) {\n\n // Get configurable options\n $productAttributeOptions = $_product->getTypeInstance(true)\n ->getConfigurableAttributesAsArray($_product);\n\n foreach ($productAttributeOptions as $productAttribute) {\n $attributeCode = $productAttribute['attribute_code'];\n\n if (isset($params['cptions'][$attributeCode])) {\n $optionValue = $params['cptions'][$attributeCode];\n\n foreach ($productAttribute['values'] as $attribute) {\n if ($optionValue == $attribute['store_label']) {\n $params['super_attribute'] = array(\n $productAttribute['attribute_id'] => $attribute['value_index']\n );\n //$params['options'][$productAttribute['attribute_id']] = $attribute['value_index'];\n }\n }\n }\n else{\n foreach ($productAttribute['values'] as $attribute) {\n if (trim($size) == $attribute['store_label']) {\n $params['super_attribute'] = array(\n $productAttribute['attribute_id'] => $attribute['value_index']\n );\n }\n }\n }\n }\n }\n\n unset($params['cptions']);\n\n //$childProduct = Mage::getModel('catalog/product_type_configurable')->getProductByAttributes(151, $_product);\n\n try {\n\n $customerData = Mage::getModel('customer/customer')->load($uid)->getData();\n\n $connectionRead = Mage::getSingleton('core/resource')->getConnection('core_read');\n\n $selectrows = \"SELECT `sales_flat_quote`.* FROM `sales_flat_quote` WHERE customer_id= \".$uid.\" AND is_active = '1' AND COALESCE(reserved_order_id, '') = ''\";\n\n $rowArray = $connectionRead->fetchRow($selectrows);\n\n if(!empty($rowArray))\n {\n $entity_id = $rowArray['entity_id'];\n $db_write = Mage::getSingleton('core/resource')->getConnection('core_read');\n $sqlQuerys = \"SELECT * FROM sales_flat_quote_item WHERE quote_id =\".$rowArray['entity_id'].\" AND product_id = \".$pid.\" ORDER BY item_id DESC\";\n $rowArrays = $db_write->fetchRow($sqlQuerys);\n\n if(!empty($rowArrays))\n {\n if($rowArrays['product_type'] == 'configurable')\n {\n $sqlQueryss = \"SELECT * FROM sales_flat_quote_item WHERE parent_item_id =\".$rowArrays['item_id'];\n $rowArrayss = $db_write->fetchRow($sqlQueryss);\n\n //check Quantity count\n //$sqlQuantity = \"SELECT * FROM sales_flat_quote_item WHERE item_id =\".$rowArrays['parent_item_id'];\n //$rowArrayqnt = $db_write->fetchRow($sqlQuantity);\n\n $checkqty = number_format($rowArrays['qty']) + $pqty;\n\n $oldsize = explode('(', $rowArrayss['name']);\n if(isset($oldsize[1])) {\n $newsize = str_replace(' )', '', $oldsize[1]);\n }\n else{\n $oldsize = explode('-', $rowArrayss['name']);\n if(isset($oldsize[1]))\n {\n $newsize = $oldsize[1];\n }\n else\n {\n $oldsize = explode('\\'', $rowArrayss['name']);\n if(isset($oldsize[1]))\n {\n $newsize = $size[1];\n }\n }\n }\n\n if(trim($newsize) == trim($size))\n {\n if($checkqty > 2)\n {\n $response['msg'] = 'The maximum quantity allowed for purchase is 2';\n $response['status'] = '0';\n echo json_encode($response);\n exit;\n }\n $connections = Mage::getSingleton('core/resource')->getConnection('core_write');\n $date = date('Y-m-d h:i:s');\n $totqty = $rowArrays['qty'] + $pqty;\n $totprice = $_product->getSpecialPrice() * $totqty;\n $connections->query(\"UPDATE `sales_flat_quote_item` SET `updated_at`='\".$date.\"',`qty`=\".$totqty.\",`row_total`=\".$totprice.\",`base_row_total`=\".$totprice.\",`price_incl_tax`=\".$totprice.\",`base_price_incl_tax`=\".$totprice.\",`row_total_incl_tax`=\".$totprice.\",`base_row_total_incl_tax`=\".$totprice.\" WHERE product_id =\".$pid.\" AND product_type ='configurable'\");\n\n $rowqty = $rowArray['items_qty'] + $pqty;\n $connectionquote = Mage::getSingleton('core/resource')->getConnection('core_write');\n $connectionquote->query(\"UPDATE `sales_flat_quote` SET `items_qty`=\".$rowqty.\" WHERE `entity_id`=\".$rowArray['entity_id']);\n }\n else\n {\n $connectionWrit = Mage::getSingleton('core/resource')->getConnection('core_write');\n\n $date = date('Y-m-d h:i:s');\n $sku = $_product->getSku();\n $name = $_product->getName();\n $price = $_product->getSpecialPrice() * $pqty;\n $connectionWrit->query(\"INSERT INTO `sales_flat_quote_item`(`quote_id`, `created_at`, `updated_at`, `product_id`, `store_id`, `is_virtual`, `sku`, `name`, `weight`, `qty`, `price`, `base_price`, `row_total`, `base_row_total`, `row_weight`, `product_type`, `price_incl_tax`, `base_price_incl_tax`, `row_total_incl_tax`, `base_row_total_incl_tax`, `weee_tax_disposition`, `weee_tax_row_disposition`, `base_weee_tax_disposition`, `base_weee_tax_row_disposition`, `weee_tax_applied`, `weee_tax_applied_amount`, `weee_tax_applied_row_amount`, `base_weee_tax_applied_amount`, `base_weee_tax_applied_row_amnt`) VALUES (\".$rowArray['entity_id'].\",'\".$date.\"','\".$date.\"',\".$pid.\",'1','0','\".$sku.\"','\".$name.\"','1.0000',\".$pqty.\",\".$price.\",\".$price.\",\".$price.\",\".$price.\",'1.0000','configurable',\".$price.\",\".$price.\",\".$price.\",\".$price.\",'0.0000','0.0000','0.0000','0.0000','a:0:{}','0.0000','0.0000','0.0000','')\");\n\n $db_write = Mage::getSingleton('core/resource')->getConnection('core_write');\n $sqlQuery = \"SELECT item_id FROM sales_flat_quote_item ORDER BY item_id DESC LIMIT 1;\";\n $rowArrayes = $db_write->fetchRow($sqlQuery);\n $item_id = $rowArrayes['item_id'];\n\n $connectionWri = Mage::getSingleton('core/resource')->getConnection('core_write');\n $sname = $name.'( '.$size.' )';\n $connectionWri->query(\"INSERT INTO `sales_flat_quote_item` (`quote_id`, `created_at`, `updated_at`, `product_id`, `store_id`, `parent_item_id`, `is_virtual`, `sku`, `name`, `weight`, `qty`, `price`, `base_price`, `row_total`, `base_row_total`, `row_weight`, `product_type`, `price_incl_tax`, `base_price_incl_tax`, `row_total_incl_tax`, `base_row_total_incl_tax`, `weee_tax_disposition`, `weee_tax_row_disposition`, `base_weee_tax_disposition`, `base_weee_tax_row_disposition`, `weee_tax_applied`, `weee_tax_applied_amount`, `weee_tax_applied_row_amount`, `base_weee_tax_applied_amount`, `base_weee_tax_applied_row_amnt`) VALUES (\".$rowArray['entity_id'].\",'\".$date.\"','\".$date.\"',\".$pid.\",'1',\".$item_id.\",'0','\".$sku.\"','\".$sname.\"','1.0000',\".$pqty.\",'0.0000','0.0000','0.0000','0.0000','1.0000','simple','0.0000','0.0000','0.0000','0.0000','0.0000','0.0000','0.0000','0.0000','a:0:{}','0.0000','0.0000','0.0000','')\");\n\n $rowqty = $rowArray['items_qty'] + $pqty;\n $rowcount = $rowArray['items_count'] + $pqty;\n $connectionquote = Mage::getSingleton('core/resource')->getConnection('core_write');\n $connectionquote->query(\"UPDATE `sales_flat_quote` SET `items_count`=\".$rowcount.\", `items_qty`=\".$rowqty.\" WHERE `entity_id`=\".$rowArray['entity_id']);\n }\n }\n\n if($rowArrays['product_type'] == 'simple')\n {\n if($rowArrays['parent_item_id'] != NULL)\n {\n //check Quantity count\n $sqlQueryss = \"SELECT * FROM sales_flat_quote_item WHERE item_id =\".$rowArrays['parent_item_id'];\n $rowArrayss = $db_write->fetchRow($sqlQueryss);\n\n $checkqty = number_format($rowArrayss['qty']) + $pqty;\n\n $oldsize = explode('(', $rowArrays['name']);\n if(isset($oldsize[1])) {\n $newsize = str_replace(' )', '', $oldsize[1]);\n }\n else{\n $oldsize = explode('-', $rowArrays['name']);\n if(isset($oldsize[1]))\n {\n $newsize = $oldsize[1];\n }\n else\n {\n $oldsize = explode('\\'', $rowArrays['name']);\n if(isset($oldsize[1]))\n {\n $newsize = $size[1];\n }\n }\n }\n\n if(trim($newsize) == trim($size))\n {\n if($checkqty > 2)\n {\n $response['msg'] = 'The maximum quantity allowed for purchase is 2';\n $response['status'] = '0';\n echo json_encode($response);\n exit;\n }\n $connections = Mage::getSingleton('core/resource')->getConnection('core_write');\n $date = date('Y-m-d h:i:s');\n $totqty = $rowArrays['qty'] + $pqty;\n $totprice = $_product->getSpecialPrice() * $totqty;\n $connections->query(\"UPDATE `sales_flat_quote_item` SET `updated_at`='\".$date.\"',`qty`=\".$totqty.\",`row_total`=\".$totprice.\",`base_row_total`=\".$totprice.\",`price_incl_tax`=\".$totprice.\",`base_price_incl_tax`=\".$totprice.\",`row_total_incl_tax`=\".$totprice.\",`base_row_total_incl_tax`=\".$totprice.\" WHERE product_id =\".$pid.\" AND product_type ='configurable'\");\n\n $rowqty = $rowArray['items_qty'] + $pqty;\n $connectionquote = Mage::getSingleton('core/resource')->getConnection('core_write');\n $connectionquote->query(\"UPDATE `sales_flat_quote` SET `items_qty`=\".$rowqty.\" WHERE `entity_id`=\".$rowArray['entity_id']);\n }\n else\n {\n $connectionWrit = Mage::getSingleton('core/resource')->getConnection('core_write');\n\n $date = date('Y-m-d h:i:s');\n $sku = $_product->getSku();\n $name = $_product->getName();\n $price = $_product->getSpecialPrice() * $pqty;\n $connectionWrit->query(\"INSERT INTO `sales_flat_quote_item`(`quote_id`, `created_at`, `updated_at`, `product_id`, `store_id`, `is_virtual`, `sku`, `name`, `weight`, `qty`, `price`, `base_price`, `row_total`, `base_row_total`, `row_weight`, `product_type`, `price_incl_tax`, `base_price_incl_tax`, `row_total_incl_tax`, `base_row_total_incl_tax`, `weee_tax_disposition`, `weee_tax_row_disposition`, `base_weee_tax_disposition`, `base_weee_tax_row_disposition`, `weee_tax_applied`, `weee_tax_applied_amount`, `weee_tax_applied_row_amount`, `base_weee_tax_applied_amount`, `base_weee_tax_applied_row_amnt`) VALUES (\".$rowArray['entity_id'].\",'\".$date.\"','\".$date.\"',\".$pid.\",'1','0','\".$sku.\"','\".$name.\"','1.0000',\".$pqty.\",\".$price.\",\".$price.\",\".$price.\",\".$price.\",'1.0000','configurable',\".$price.\",\".$price.\",\".$price.\",\".$price.\",'0.0000','0.0000','0.0000','0.0000','a:0:{}','0.0000','0.0000','0.0000','')\");\n\n $db_write = Mage::getSingleton('core/resource')->getConnection('core_write');\n $sqlQuery = \"SELECT item_id FROM sales_flat_quote_item ORDER BY item_id DESC LIMIT 1;\";\n $rowArrayes = $db_write->fetchRow($sqlQuery);\n $item_id = $rowArrayes['item_id'];\n\n $connectionWri = Mage::getSingleton('core/resource')->getConnection('core_write');\n $sname = $name.'( '.$size.' )';\n $connectionWri->query(\"INSERT INTO `sales_flat_quote_item` (`quote_id`, `created_at`, `updated_at`, `product_id`, `store_id`, `parent_item_id`, `is_virtual`, `sku`, `name`, `weight`, `qty`, `price`, `base_price`, `row_total`, `base_row_total`, `row_weight`, `product_type`, `price_incl_tax`, `base_price_incl_tax`, `row_total_incl_tax`, `base_row_total_incl_tax`, `weee_tax_disposition`, `weee_tax_row_disposition`, `base_weee_tax_disposition`, `base_weee_tax_row_disposition`, `weee_tax_applied`, `weee_tax_applied_amount`, `weee_tax_applied_row_amount`, `base_weee_tax_applied_amount`, `base_weee_tax_applied_row_amnt`) VALUES (\".$rowArray['entity_id'].\",'\".$date.\"','\".$date.\"',\".$pid.\",'1',\".$item_id.\",'0','\".$sku.\"','\".$sname.\"','1.0000',\".$pqty.\",'0.0000','0.0000','0.0000','0.0000','1.0000','simple','0.0000','0.0000','0.0000','0.0000','0.0000','0.0000','0.0000','0.0000','a:0:{}','0.0000','0.0000','0.0000','')\");\n\n $rowqty = $rowArray['items_qty'] + $pqty;\n $rowcount = $rowArray['items_count'] + $pqty;\n $connectionquote = Mage::getSingleton('core/resource')->getConnection('core_write');\n $connectionquote->query(\"UPDATE `sales_flat_quote` SET `items_count`=\".$rowcount.\", `items_qty`=\".$rowqty.\" WHERE `entity_id`=\".$rowArray['entity_id']);\n }\n }\n else\n {\n if($checkqty > 2)\n {\n $response['msg'] = 'The maximum quantity allowed for purchase is 2';\n $response['status'] = '0';\n echo json_encode($response);\n exit;\n }\n $connections = Mage::getSingleton('core/resource')->getConnection('core_write');\n $date = date('Y-m-d h:i:s');\n $totqty = $rowArrays['qty'] + $pqty;\n $totprice = $_product->getSpecialPrice() * $totqty;\n $connections->query(\"UPDATE `sales_flat_quote_item` SET `updated_at`='\".$date.\"',`qty`=\".$totqty.\",`row_total`=\".$totprice.\",`base_row_total`=\".$totprice.\",`price_incl_tax`=\".$totprice.\",`base_price_incl_tax`=\".$totprice.\",`row_total_incl_tax`=\".$totprice.\",`base_row_total_incl_tax`=\".$totprice.\" WHERE product_id =\".$pid.\" AND product_type ='simple'\");\n\n $rowqty = $rowArray['items_qty'] + $pqty;\n $connectionquote = Mage::getSingleton('core/resource')->getConnection('core_write');\n $connectionquote->query(\"UPDATE `sales_flat_quote` SET `items_qty`=\".$rowqty.\" WHERE `entity_id`=\".$rowArray['entity_id']);\n }\n\n }\n }\n else\n {\n if($_product->getTypeId() == \"configurable\")\n {\n $connectionWrit = Mage::getSingleton('core/resource')->getConnection('core_write');\n\n $date = date('Y-m-d h:i:s');\n $sku = $_product->getSku();\n $name = $_product->getName();\n $price = $_product->getSpecialPrice() * $pqty;\n $connectionWrit->query(\"INSERT INTO `sales_flat_quote_item`(`quote_id`, `created_at`, `updated_at`, `product_id`, `store_id`, `is_virtual`, `sku`, `name`, `weight`, `qty`, `price`, `base_price`, `row_total`, `base_row_total`, `row_weight`, `product_type`, `price_incl_tax`, `base_price_incl_tax`, `row_total_incl_tax`, `base_row_total_incl_tax`, `weee_tax_disposition`, `weee_tax_row_disposition`, `base_weee_tax_disposition`, `base_weee_tax_row_disposition`, `weee_tax_applied`, `weee_tax_applied_amount`, `weee_tax_applied_row_amount`, `base_weee_tax_applied_amount`, `base_weee_tax_applied_row_amnt`) VALUES (\".$rowArray['entity_id'].\",'\".$date.\"','\".$date.\"',\".$pid.\",'1','0','\".$sku.\"','\".$name.\"','1.0000',\".$pqty.\",\".$price.\",\".$price.\",\".$price.\",\".$price.\",'1.0000','configurable',\".$price.\",\".$price.\",\".$price.\",\".$price.\",'0.0000','0.0000','0.0000','0.0000','a:0:{}','0.0000','0.0000','0.0000','')\");\n //$connectionWrit->query(\"UPDATE `sales_flat_quote_item` SET `quote_id`=\".$rowArray['entity_id'].\",`created_at`='\".$date.\"',`updated_at`='\".$date.\"',`product_id`=\".$pid.\",`store_id`=1,`parent_item_id`='',`is_virtual`=0,`sku`='\".$sku.\"',`name`='\".$name.\"',`description`='',`applied_rule_ids`='',`additional_data`='',`free_shipping`=0,`is_qty_decimal`=0,`no_discount`=0,`weight`='1.0000',`qty`=\".$pqty.\",`price`=\".$price.\",`base_price`=\".$price.\",`custom_price`='',`discount_percent`='0',`discount_amount`='0',`base_discount_amount`='0',`tax_percent`='0',`tax_amount`='0',`base_tax_amount`='0',`row_total`=\".$price.\",`base_row_total`=\".$price.\",`row_total_with_discount`='0',`row_weight`='1.0000',`product_type`='configurable',`base_tax_before_discount`='',`tax_before_discount`='',`original_custom_price`='',`redirect_url`='',`base_cost`='',`price_incl_tax`=\".$price.\",`base_price_incl_tax`=\".$price.\",`row_total_incl_tax`=\".$price.\",`base_row_total_incl_tax`=\".$price.\",`hidden_tax_amount`=0,`base_hidden_tax_amount`=0,`gift_message_id`='',`weee_tax_disposition`='0.0000',`weee_tax_row_disposition`='0.0000',`base_weee_tax_disposition`='0.0000',`base_weee_tax_row_disposition`='0.0000',`weee_tax_applied`='a:0:{}',`weee_tax_applied_amount`='0.0000',`weee_tax_applied_row_amount`='0.0000',`base_weee_tax_applied_amount`='0.0000',`base_weee_tax_applied_row_amnt`='' WHERE 1\");\n\n $db_write = Mage::getSingleton('core/resource')->getConnection('core_write');\n $sqlQuery = \"SELECT item_id FROM sales_flat_quote_item ORDER BY item_id DESC LIMIT 1;\";\n $rowArrayes = $db_write->fetchRow($sqlQuery);\n $item_id = $rowArrayes['item_id'];\n\n $connectionWri = Mage::getSingleton('core/resource')->getConnection('core_write');\n $sname = $name.'( '.$size.' )';\n $connectionWri->query(\"INSERT INTO `sales_flat_quote_item` (`quote_id`, `created_at`, `updated_at`, `product_id`, `store_id`, `parent_item_id`, `is_virtual`, `sku`, `name`, `weight`, `qty`, `price`, `base_price`, `row_total`, `base_row_total`, `row_weight`, `product_type`, `price_incl_tax`, `base_price_incl_tax`, `row_total_incl_tax`, `base_row_total_incl_tax`, `weee_tax_disposition`, `weee_tax_row_disposition`, `base_weee_tax_disposition`, `base_weee_tax_row_disposition`, `weee_tax_applied`, `weee_tax_applied_amount`, `weee_tax_applied_row_amount`, `base_weee_tax_applied_amount`, `base_weee_tax_applied_row_amnt`) VALUES (\".$rowArray['entity_id'].\",'\".$date.\"','\".$date.\"',\".$pid.\",'1',\".$item_id.\",'0','\".$sku.\"','\".$sname.\"','1.0000',\".$pqty.\",'0.0000','0.0000','0.0000','0.0000','1.0000','simple','0.0000','0.0000','0.0000','0.0000','0.0000','0.0000','0.0000','0.0000','a:0:{}','0.0000','0.0000','0.0000','')\");\n //$connectionWri->query(\"UPDATE `sales_flat_quote_item` SET `quote_id`=\".$rowArray['entity_id'].\",`created_at`='\".$date.\"',`updated_at`='\".$date.\"',`product_id`=\".$pid.\",`store_id`=1,`parent_item_id`='',`is_virtual`=0,`sku`='\".$sku.\"',`name`='\".$sname.\"',`description`='',`applied_rule_ids`='',`additional_data`='',`free_shipping`=0,`is_qty_decimal`=0,`no_discount`=0,`weight`='1.0000',`qty`=\".$pqty.\",`price`='0',`base_price`='0',`custom_price`='',`discount_percent`='0',`discount_amount`='0',`base_discount_amount`='0',`tax_percent`='0',`tax_amount`='0',`base_tax_amount`='0',`row_total`='0',`base_row_total`='0',`row_total_with_discount`='0',`row_weight`='0.0000',`product_type`='simple',`base_tax_before_discount`='',`tax_before_discount`='',`original_custom_price`='',`redirect_url`='',`base_cost`='',`price_incl_tax`='',`base_price_incl_tax`='',`row_total_incl_tax`='',`base_row_total_incl_tax`='',`hidden_tax_amount`='',`base_hidden_tax_amount`='',`gift_message_id`='',`weee_tax_disposition`='0.0000',`weee_tax_row_disposition`='0.0000',`base_weee_tax_disposition`='0.0000',`base_weee_tax_row_disposition`='0.0000',`weee_tax_applied`='a:0:{}',`weee_tax_applied_amount`='0.0000',`weee_tax_applied_row_amount`='0.0000',`base_weee_tax_applied_amount`='0.0000',`base_weee_tax_applied_row_amnt`='' WHERE 1\");\n }\n\n if($_product->getTypeId() == \"simple\")\n {\n $connectionWrit = Mage::getSingleton('core/resource')->getConnection('core_write');\n\n $date = date('Y-m-d h:i:s');\n $sku = $_product->getSku();\n $name = $_product->getName();\n $price = $_product->getSpecialPrice() * $pqty;\n\n $connectionWrit->query(\"INSERT INTO `sales_flat_quote_item`(`quote_id`, `created_at`, `updated_at`, `product_id`, `store_id`, `is_virtual`, `sku`, `name`, `weight`, `qty`, `price`, `base_price`, `row_total`, `base_row_total`, `row_weight`, `product_type`, `price_incl_tax`, `base_price_incl_tax`, `row_total_incl_tax`, `base_row_total_incl_tax`, `weee_tax_disposition`, `weee_tax_row_disposition`, `base_weee_tax_disposition`, `base_weee_tax_row_disposition`, `weee_tax_applied`, `weee_tax_applied_amount`, `weee_tax_applied_row_amount`, `base_weee_tax_applied_amount`, `base_weee_tax_applied_row_amnt`) VALUES (\".$rowArray['entity_id'].\",'\".$date.\"','\".$date.\"',\".$pid.\",'1','0','\".$sku.\"','\".$name.\"','1.0000',\".$pqty.\",\".$price.\",\".$price.\",\".$price.\",\".$price.\",'1.0000','simple',\".$price.\",\".$price.\",\".$price.\",\".$price.\",'0.0000','0.0000','0.0000','0.0000','a:0:{}','0.0000','0.0000','0.0000','')\");\n\n //$connectionWrit->query(\"UPDATE `sales_flat_quote_item` SET `quote_id`=\".$rowArray['entity_id'].\",`created_at`='\".$date.\"',`updated_at`='\".$date.\"',`product_id`=\".$pid.\",`store_id`=1,`parent_item_id`='',`is_virtual`=0,`sku`='\".$sku.\"',`name`='\".$name.\"',`description`='',`applied_rule_ids`='',`additional_data`='',`free_shipping`=0,`is_qty_decimal`=0,`no_discount`=0,`weight`='1.0000',`qty`=\".$pqty.\",`price`=\".$price.\",`base_price`=\".$price.\",`custom_price`='',`discount_percent`='0',`discount_amount`='0',`base_discount_amount`='0',`tax_percent`='0',`tax_amount`='0',`base_tax_amount`='0',`row_total`=\".$price.\",`base_row_total`=\".$price.\",`row_total_with_discount`='0',`row_weight`='1.0000',`product_type`='configurable',`base_tax_before_discount`='',`tax_before_discount`='',`original_custom_price`='',`redirect_url`='',`base_cost`='',`price_incl_tax`=\".$price.\",`base_price_incl_tax`=\".$price.\",`row_total_incl_tax`=\".$price.\",`base_row_total_incl_tax`=\".$price.\",`hidden_tax_amount`=0,`base_hidden_tax_amount`=0,`gift_message_id`='',`weee_tax_disposition`='0.0000',`weee_tax_row_disposition`='0.0000',`base_weee_tax_disposition`='0.0000',`base_weee_tax_row_disposition`='0.0000',`weee_tax_applied`='a:0:{}',`weee_tax_applied_amount`='0.0000',`weee_tax_applied_row_amount`='0.0000',`base_weee_tax_applied_amount`='0.0000',`base_weee_tax_applied_row_amnt`='' WHERE 1\");\n }\n\n $rowqty = $rowArray['items_qty'] + $pqty;\n $rowcount = $rowArray['items_count'] + $pqty;\n $connectionquote = Mage::getSingleton('core/resource')->getConnection('core_write');\n $connectionquote->query(\"UPDATE `sales_flat_quote` SET `items_count`=\".$rowcount.\", `items_qty`=\".$rowqty.\" WHERE `entity_id`=\".$rowArray['entity_id']);\n }\n }\n else\n {\n $cart = Mage::getModel('checkout/cart');\n $cart->init();\n $cart->addProduct($_product, $params);\n $cart->save();\n\n $db_write = Mage::getSingleton('core/resource')->getConnection('core_read');\n $sqlQuery = \"SELECT quote_id FROM sales_flat_quote_item ORDER BY item_id DESC LIMIT 1;\";\n $rowArray = $db_write->fetchRow($sqlQuery);\n $entity_id = $rowArray['quote_id'];\n\n $connectionWrite = Mage::getSingleton('core/resource')->getConnection('core_write');\n\n //Update customer Id\n $date = date('Y-m-d h:i:s');\n $connectionWrite->query(\"update sales_flat_quote set customer_id = '\".$uid.\"', customer_email = '\".$customerData['email'].\"',customer_firstname = '\".$customerData['firstname'].\"',customer_lastname = '\".$customerData['lastname'].\"',customer_gender = '\".$customerData['gender'].\"', updated_at = '\".$date.\"' WHERE entity_id = \".$entity_id);\n }\n\n $connectionWrites = Mage::getSingleton('core/resource')->getConnection('core_write');\n\n $connectionWrites->query(\"update sales_flat_quote_address set customer_id = '\".$uid.\"', email = '\".$customerData['email'].\"',firstname = '\".$customerData['firstname'].\"',lastname = '\".$customerData['lastname'].\"' WHERE quote_id = \".$entity_id);\n\n $response['msg'] = 'Product added in cart';\n $response['status'] = 1;\n }\n catch (Exception $e) {\n\n $response['msg'] = $e->getMessage();\n $response['status'] = 0;\n }\n\n\n\t\techo json_encode($response);\n\t}",
"public function checkoutDone(Request $request)\n {\n $user = Auth::user();\n if(isset($user))\n {\n $user_id = $user->id;\n $dat_order = date('Y-m-d H:i:s');\n $total = Cart::total();\n $delivered = 0;\n $note = $request->input('note');\n\n DB::select('call sp_insert_order(?,?,?,?,?)', array($user_id, $dat_order, $total, $note, $delivered));\n\n $order_data = DB::select('call sp_findOrderByDate(?)', array($dat_order));\n\n foreach ($order_data as $details) {\n $order_id = $details->id;\n }\n $cartItems = Cart::content();\n foreach ($cartItems as $cartItem) {\n $product_id = $cartItem->id;\n $quantity = $cartItem->qty;\n $price = $cartItem->price;\n }\n $order_details = DB::select('call sp_addOrderDetail(?,?,?,?)', array($order_id, $product_id, $quantity, $price));\n\n //user_id, order_id, name, email, address, phone_number\n\n $shipping_name = $request->input('fullName');\n $shipping_email = $request->input('email');\n $shipping_address = $request->input('address');\n $shipping_phonenum = $request->input('phoneNumber');\n\n DB::select('call sp_addShippingInfo(?,?,?,?,?,?)', array($user_id,$order_id,$shipping_name,$shipping_email,$shipping_address,$shipping_phonenum));\n\n Cart::destroy();\n return redirect()->route('front.home');\n }\n else{\n return redirect()->route('front.home');\n }\n\n }",
"public function checkout($item_id)\n {\n // second step is getting signature - https://github.com/williammalone/Simple-HTML5-Drawing-App\n if (!$this->_isAuthorized()) {\n redirect('auth/login');\n }\n $data['item'] = $this->inventory_model->getitem($item_id);\n $data['users'] = $this->_prepareUsers();\n $data['title'] = 'Item checkout STEP 1';\n $data['error'] = false;\n $this->load->library('form_validation');\n $this->load->helper('form');\n $this->form_validation->set_rules('datedue', 'Date due', 'callback_valid_date');\n $this->form_validation->set_rules('user_id', 'Student email', 'callback_valid_student');\n if ($data['item']->accessories) {\n $i=0;\n foreach ($data['item']->accessories as $acc) {\n $this->form_validation->set_rules('accessories'.$i++, 'Accessories', 'required');\n }\n }\n if ($this->form_validation->run()) {\n //$success = $this->inventory_model->checkout();\n $success = true;\n if ($success) {\n $data['msg'] = \"The item has been checked out. Please enter signature now.\";\n } else {\n $data['msg'] = \"An unexpected error occurred.\";\n }\n } else {\n $data['item'] = $this->inventory_model->getitem($item_id);\n }\n $data['categories'] = $this->_prepareCategories();\n $this->load->view('templates/header', $data);\n $this->load->view('inventory/checkout', $data);\n $this->load->view('templates/footer');\n }",
"public function doAddToCart(Request $request){\n $account = new AccountController($request);\n $cust_id = $account->checkCookie($request);\n\n \t$prod_id = decrypt($request->prod_id);\n\n \t$cart = DB::table('t_cart_detail')->where(['prod_id'=>$prod_id,'cust_id'=>$request->session()->get('cust_id')])->get();\n\n $response = [];\n \tif($cart->isEmpty()){\n\t \tDB::table('t_cart_detail')->insert(['prod_id'=>$prod_id,\n\t \t\t\t\t\t\t\t\t\t\t'cust_id'=>$request->session()->get('cust_id'),\n\t \t\t\t\t\t\t\t\t\t\t'qty'=>$request->qty,\n\t \t\t\t\t\t\t\t\t\t\t'addtime'=>date('Y-m-d H:i:s')]);\n\t \t$response['text'] = 'Berhasil ditambahkan ke Keranjang Belanja. <a href=\"'.url('transaction/cart').'\" class=\"btn btn-primary\">Lihat Keranjang Belanja</a>';\n\t \t$response['res'] = 'success';\n\t } else {\n\t \t$response['text'] = 'Produk ini sudah ada di Keranjang Belanja. <a href=\"'.url('transaction/cart').'\" class=\"btn btn-primary\">Lihat Keranjang Belanja</a>';\n\t \t$response['res'] = 'danger';\n\t }\n $response['count_cart'] = DB::table('t_cart_detail')->where('cust_id',$request->session()->get('cust_id'))\n ->count();\n\t return response()->json($response);\n }",
"public function postOrderMake() {\n\n /*\n Array\n (\n [12_97d170e1550eee4afc0af065b78cda302a97674c] => 5\n [metrics] => Порода:\n Пол:\n Обхват шеи:\n Обхват груди:\n Длина спины:\n Обхват передней лапы:\n От шеи до передней лапы:\n Между передними лапами:\n\n [name] => фывчфы\n [email] => [email protected]\n [address] => фывфы\n [tel] => фывфы\n [pay_type] => 1\n )\n */\n\n #Helper::ta(Input::all());\n\n /**\n * Получаем корзину\n */\n CatalogCart::getInstance();\n $goods = CatalogCart::get_full();\n #Helper::ta($goods);\n\n /**\n * Формируем массив с продуктами\n */\n $products = [];\n if (count($goods)) {\n foreach ($goods as $good_hash => $good) {\n $products[$good_hash] = [\n 'id' => $good->id,\n 'count' => $good->_amount,\n 'price' => $good->price,\n 'attributes' => (array)$good->_attributes,\n ];\n }\n }\n #Helper::ta($products);\n\n $pay_type = @$this->pay_types[Input::get('pay_type')] ?: NULL;\n\n /**\n * Формируем окончательный массив для создания заказа\n */\n $order_array = [\n 'client_name' => Input::get('name'),\n 'delivery_info' => Input::get('address') . ' ' . Input::get('email') . ' ' . Input::get('tel'),\n 'comment' => $pay_type . \"\\n\\n\" . Input::get('metrics'),\n 'status' => 1, ## Статус заказа, нужно подставлять ID статуса наподобие \"Новый заказ\"\n 'products' => $products,\n ];\n #Helper::tad($order_array);\n\n $order = Catalog::create_order($order_array);\n\n /*\n $json_request = [];\n $json_request['responseText'] = '';\n $json_request['status'] = FALSE;\n\n if (is_object($order) && $order->id)\n $json_request['status'] = TRUE;\n\n\n return Response::json($json_request, 200);\n */\n\n if (is_object($order) && $order->id) {\n\n CatalogCart::clear();\n return Redirect::route('mainpage');\n #return Redirect::route('catalog-order-success');\n\n } else {\n\n return URL::previous();\n }\n }",
"function checkout_cart ($external_cart_id) {\n $db = getDb();\n\n //We use a transaction so that all purchases either succeed\n //or all fail\n $transactionStarted = $db->beginTransaction();\n if (!$transactionStarted) {\n throw new Exception(\"An unexpected error occurred; failed to enter transaction\");\n }\n\n $cart = fetch_cart($external_cart_id);\n if (count($cart->products) == 0) {\n throw new InvalidOperationException(\"Cart is empty\");\n }\n foreach ($cart->products as $product) {\n purchase_product($product->product_id, $product->quantity);\n }\n\n $committed = $db->commit();\n if (!$committed) {\n throw new Exception(\"An unexpected error occurred; failed to commit\");\n }\n}",
"public function clickAddToCart()\n {\n $this->waitFormToLoad();\n $this->_rootElement->find($this->addToCart)->click();\n }",
"public function checkOut(Request $request)\n {\n $request->validate([\n 'specify' => 'required'\n ]);\n\n if(!Session::has('cart'))\n {\n return view('shoppingcart');\n }\n $cart = Session::get('cart');\n\n $order = \\App\\Order::All();\n if ($order->count() == 0)\n {\n $orderId = 1;\n }\n else\n {\n $orderId = $order->last()->orderId;\n $orderId += 1;\n\n }\n foreach ($cart->items as $item)\n {\n $newOrder = new \\App\\Order();\n $newOrder->orderId = $orderId;\n $newOrder->user_id = Auth::user()->id;\n $newOrder->user_email = Auth::user()->email;\n $newOrder->product_id = $item[\"item\"]->id;\n $newOrder->amountOrder = $item[\"qty\"];\n $newOrder->totalPrice = $cart->totalPrice;\n $newOrder->specify = $request->specify;\n\n $newOrder->save();\n\n }\n session()->forget('cart');\n return 'hi';\n }",
"public function checkout(Cart $cart, Request $request) {\n\n if (Auth::guard('api')->check()) {\n $userID = auth('api')->user()->getKey();\n }\n $input = $request->only(\n [\n 'cartKey',\n 'customer_name',\n 'mobile',\n 'email',\n 'address_id',\n 'address_text',\n 'address_lat',\n 'address_long',\n 'address_landmark',\n 'transaction_id',\n\n ]\n );\n\n //todo: validate if order type piickup diffrernt fields on delievry\n\n $this->validate(\n $request,\n [\n 'cartKey' => 'required',\n 'customer_name' => 'required',\n /* 'mobile' => 'required', */\n 'address_id' => 'required_without:address_text',\n 'address_text' => 'required_without:address_id',\n 'transaction_id' => 'required',\n\n ]\n );\n\n\n $cartKey = $request->input('cartKey');\n if ($cart->key == $cartKey) {\n $total_quantity = CartItem::where(['cart_id' => $cart->getKey()])->sum('quantity');\n if (!$total_quantity) {\n return response()->json(\n [\n 'status' => 0,\n 'message' => 'Shopping Cart is empty.',\n ],\n 400\n );\n }\n $order['user_id'] = $cart->userID;\n $name = explode(' ', $input['customer_name']);\n $order['first_name'] = $name[0];\n $order['last_name'] = $name[1] ?? \" \";\n\n $order['address_id'] = $input['address_id'] ?? null;\n $order['address1'] = $input['address_text'] ?? null;\n $order['address1_lat'] = $input['address_lat'] ?? null;\n $order['address1_long'] = $input['address_long'] ?? null;\n $order['address2'] = $input['address_landmark'] ?? null;\n $order['phone'] = $input['mobile'] ?? null;\n $order['email'] = $input['email'] ?? null;\n\n\n $order['order_type'] = $cart->cart_type;\n $order['brand_id'] = $cart->brand_id;\n $order['branch_id'] = $cart->branch_id;\n\n $order['status'] = 1;\n $order['payment_status'] = 3;\n $order['shipping_status'] = 1;\n\n $order['currency'] = 'AED';\n $order['exchange_rate'] = '1.00';\n\n $subtotal = (float)0.0;\n $items = $cart->items;\n $order['items'] = json_encode(new CartItemCollection($items));\n foreach ($items as $item) {\n\n $product = Product::find($item->product_id);\n $price = $item->price / $item->quantity;\n //$inStock = $product->UnitsInStock;\n $subtotal += ($price * $item->quantity);\n $price = 'AED ' . $price;\n /* if ($inStock >= $item->quantity) {\n\n $TotalPrice = $TotalPrice + ($price * $item->quantity);\n\n $product->UnitsInStock = $product->UnitsInStock - $item->quantity;\n $product->save();\n } else {\n return response()->json([\n 'message' => 'The quantity you\\'re ordering of ' . $item->Name .\n ' isn\\'t available in stock, only ' . $inStock . ' units are in Stock, please update your cart to proceed',\n ], 400);\n } */\n }\n $order['subtotal'] = $subtotal;\n $order['shipping'] = 0;\n $order['discount'] = 0;\n $order['tax'] = 0;\n\n\n $order['total'] = $order['subtotal'] + $order['shipping'] - $order['discount'] + $order['tax'];\n //$transactionID = md5( uniqid( rand(), true ) );\n $order['transaction'] = $request->input('transaction_id');\n\n /**\n * Credit Card information should be sent to a payment gateway for processing and validation,\n * the response should be dealt with here, but since this is a dummy project we'll\n * just assume that the information is sent and the payment process was done succefully,\n */\n\n $PaymentGatewayResponse = true;\n\n\n if ($PaymentGatewayResponse) {\n $estimated_time = 45;//to do dynamic from store\n $order['estimated_time'] = Carbon::now()->addMinutes($estimated_time);\n $order1 = Order::create($order);\n\n $cart->delete();\n\n return new JsonResponse(\n [\n 'status' => 1,\n 'message' => 'Your order has been completed successfully, please check the order status for the updates!',\n 'data' => new OrderResource($order1),\n ], 200\n );\n\n }\n } else {\n return response()->json(\n [\n 'status' => 0,\n 'message' => 'The CarKey you provided does not match the Cart Key for this Cart.',\n ],\n 400\n );\n }\n\n }",
"function transfer_cart($customer_id, $the_session_id) {\n\t//echo \"OK\";\n\tglobal $cxn;\n\t\n\t$sql=\"select * from cart where session_id='$the_session_id' order by sequence\";\n\tif(!$query=$cxn->query($sql))\n\t{\n\t\t$err='query_failure:'\n\t\t.'ERRNO: '\n\t\t.$cxn->errno\n\t\t.'ERROR: '\n\t\t.$cxn->error\n\t\t.PHP_EOL\n\t\t.' QUERY: '\n\t\t.$query\n\t\t.PHP_EOL;\n\t\ttrigger_error($err, E_USER_WARNING);\n\t}\n\twhile($row=$query->fetch_assoc())\n\t{\n\t\t\n\t\t//be sure that you're not adding something that's already in the order table\n\t\t\n\t\t$sql_2=\"select id from order_items where session_id='$the_session_id' and product_id='$row[id]'\";\n\t\t//echo $sql_2;\n\t\t$query_2=$cxn->query($sql_2);\n\t\t$count_2=$query_2->num_rows;\n\t\t\n\t\tif($count_2==0)\n\t\t{\n\t\t\t$sql_1=\"INSERT into order_items (session_id, product_id, product_cost, option_id, feature_id, feature_cost, door_id, quantity, sequence, customer_id) VALUES (\n\t\t\t'$the_session_id',\n\t\t\t'$row[product_id]', \n\t\t\t'$row[product_cost]', \n\t\t\t'$row[option_id]', \n\t\t\t'$row[feature_id]', \n\t\t\t'$row[feature_cost]', \n\t\t\t'$row[door_id]', \n\t\t\t'$row[quantity]',\n\t\t\t'$row[sequence]', \n\t\t\t'$customer_id')\";\n\t\t\t//echo $sql_1;\n\t\t\tif(!$query_1=$cxn->query($sql_1))\n\t\t\t{\n\t\t\t\t$err_1='query_failure:'\n\t\t\t\t.'ERRNO: '\n\t\t\t\t.$cxn->errno\n\t\t\t\t.'ERROR: '\n\t\t\t\t.$cxn->error\n\t\t\t\t.PHP_EOL\n\t\t\t\t.' QUERY: '\n\t\t\t\t.$query_1\n\t\t\t\t.PHP_EOL;\n\t\t\t\ttrigger_error($err_1, E_USER_WARNING);\n\t\t\t}\n\t\t}\n\t}\n}",
"public function addToCart(){\n\t\t// if the user has accepted to use cookies, they will be stored\n\t\tif(isset($_COOKIE['isUsingCookies']) && $_COOKIE['isUsingCookies'] == true){\n\t\t\t$expirationTime = time()+60*60*24*62;\n\t\t}else{\n\t\t\t$expirationTime = 0;\n\t\t}\n\n\t\t// unset unused attributes from variable\n\t\tunset($_POST['_token']);\n\n\t\t// add the product to the current cart or increase the quantity if it is already in the cart\n\t\tif(isset($_COOKIE['cart'])){\n\t\t\t$previousCart = json_decode($_COOKIE['cart'],true);\n\t\t\tforeach ($previousCart as $key => $product) {\n\t\t\t\tvar_dump($product);\n\t\t\t\techo'<br>';\n\n\t\t\t\tif($_POST['id_product'] == $product['id_product']){\n\t\t\t\t\t$previousCart[$key]['quantity'] += 1;\n\t\t\t\t\tsetcookie('cart', json_encode($previousCart), $expirationTime);\n\t\t\t\t\treturn redirect()->route('cart');\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tarray_push($previousCart, ['id_product' => $_POST['id_product'], 'quantity' => '1', 'price' => $_POST['price'], 'picture_url' => $_POST['picture_url'], 'name' => $_POST['name'], 'picture_alt' => $_POST['picture_alt'], 'stock' => $_POST['stock'], 'item_sold' => $_POST['item_sold'], 'name_category' => $_POST['name_category']]);\n\t\t\t$newCart = json_encode($previousCart);\n\n\t\t\tsetcookie('cart', $newCart, $expirationTime);\n\t\t}else{\n\t\t\tsetcookie('cart', json_encode([['id_product' => $_POST['id_product'], 'quantity' => '1', 'price' => $_POST['price'], 'picture_url' => $_POST['picture_url'], 'name' => $_POST['name'], 'picture_alt' => $_POST['picture_alt'], 'stock' => $_POST['stock'], 'item_sold' => $_POST['item_sold'], 'name_category' => $_POST['name_category']]]), $expirationTime);\n\t\t}\n\t\treturn redirect()->route('cart');\n\t}",
"public function addToCart(Request $req)\n {\n if($req->session()->has('user'))\n { \n \n $user_id = Session::get('user')['id'];\n $cartId = DB::table('cart')\n ->where('cart_status','=','0')\n ->where('user_id',$user_id)\n ->pluck('id')->first();\n \n \n\n if(isset($cartId))\n {\n\n $cartdetail = new CartDetail;\n \n $cartdetail->order_id = $cartId;\n $cartdetail->product_id = $req->product_id; \n $cartdetail->quantity = $req->quantity;\n $cartdetail->weight = $req->weight;\n $cartdetail->message = $req->message;\n $cartdetail->baselayer = $req->baselayer;\n $cartdetail->save(); \n \n $tot_cost = DB::table('cart')\n ->where('cart_status','=','0')\n ->where('user_id',$user_id)\n ->pluck('total_cost')->first();\n \n $qty = DB::table('cart')\n ->join('cartdetails','cart.id','=','cartdetails.order_id')\n ->join('products','cartdetails.product_id','=','products.id')\n ->where('user_id',$user_id)\n ->where('cart.user_id',$user_id)\n ->where('cartdetails.product_id',$req->product_id)\n ->pluck('cartdetails.quantity')\n ->first();\n \n \n // echo \"<pre>\";\n // print_r($qty);\n // die();\n\n Cart::where('cart_status','=','0')\n ->where('user_id',$user_id)\n ->update(['total_cost' => ($qty * $req->price) + $tot_cost]);\n\n $qty_before = DB::table('products')\n ->where('id','=',$req->product_id)\n ->pluck('qty_available')->first();\n \n // echo \"<pre>\";\n // print_r($qty_before);\n // die();\n $qty_after = DB::table('products')\n ->where('id','=',$req->product_id)\n ->update(['qty_available' => $qty_before - $qty]);\n\n }\n else\n {\n $cart= new Cart;\n $cart->user_id = $user_id;\n $cart->save();\n $cartId=$cart->id;\n\n \n $cartdetail= new CartDetail;\n \n $cartdetail->order_id = $cartId;\n $cartdetail->product_id = $req->product_id; \n $cartdetail->quantity = $req->quantity;\n $cartdetail->weight = 5;\n $cartdetail->message = $req->message;\n $cartdetail->baselayer = $req->baselayer;\n $cartdetail->save(); \n\n $cart->total_cost = $req->quantity * $req->price;\n \n $cart->save();\n\n $qty = DB::table('cart')\n ->join('cartdetails','cart.id','=','cartdetails.order_id')\n ->join('products','cartdetails.product_id','=','products.id')\n ->where('user_id',$user_id)\n ->where('cart.user_id',$user_id)\n ->where('cartdetails.product_id',$req->product_id)\n ->pluck('cartdetails.quantity')\n ->first();\n\n $qty_before = DB::table('products')\n ->where('id','=',$req->product_id)\n ->pluck('qty_available')->first();\n\n $qty_after = DB::table('products')\n ->where('id','=',$req->product_id)\n ->update(['qty_available' => $qty_before - $qty]);\n\n }\n return redirect ('/cart');\n\n }\n else\n { \n\n return redirect ('/home');\n }\n }",
"function checkout ($name, $email) {\n // PARAM $name : customer's name\n // $email : customer's email address\n\n // Init\n $this->start();\n // Create the order entry first\n $pass = $this->exec(\n \"INSERT INTO `orders` (`order_name`, `order_email`) VALUES (?, ?)\",\n [$name, $email]\n );\n\n // Insert the items\n if ($pass) {\n $this->orderID = $this->lastID;\n $sql = \"INSERT INTO `orders_items` (`order_id`, `product_id`, `quantity`) VALUES \";\n $cond = [];\n foreach ($_SESSION['cart'] as $id=>$qty) {\n $sql .= \"(?, ?, ?),\";\n array_push($cond, $this->orderID, $id, $qty);\n }\n $sql = substr($sql, 0, -1) . \";\";\n $pass = $this->exec($sql, $cond);\n }\n // Finalize\n $this->end($pass);\n return $pass;\n }",
"public function run()\n {\n // CartItem 3 product_id=1,2,3\n CartItem::factory(3)\n ->state(new Sequence(\n ['product_id' => 1],\n ['product_id' => 2],\n ['product_id' => 3],\n ))\n ->for(User::find(1))\n ->create();\n }",
"public function insert($items = array())\n {\n if ($this->_checkCartInsert($items) === TRUE)\n {\n\n $isNew = true;\n $shouldUpdate = $this->_config['on_insert_update_existing_item'];\n\n //check if should update existing product\n if($shouldUpdate){\n $products = is_array($this->_session['products']) ? $this->_session['products'] : array();\n foreach ($products as $token => $existing_item) {\n if($existing_item['id'] === $items['id']){\n //fount same product already on cart\n $isNew = false;\n $items = array('token'=>$token, 'qty'=> $existing_item['qty']+$items['qty']);\n break;\n }\n }\n }\n\n if($isNew){\n $token = sha1($items['id'].$items['qty'].time());\n\n if (is_array($this->_session['products']))\n {\n $this->_session['products'][$token] = $this->_cart($items);\n } else {\n //creo il carrello in sessione\n $this->_session['products'] = array();\n $this->_session->cartId = $this->_session->getManager()->getId();\n $this->getEventManager()->trigger(CartEvent::EVENT_CREATE_CART_POST, $this, array('cart_id'=>$this->_session->cartId));\n //aggiungo elemento\n $this->_session['products'][$token] = $this->_cart($items);\n }\n //evento per elemento aggiunto\n $this->trigger(CartEvent::EVENT_ADD_ITEM_POST, $token, $this->_session['products'][$token], $this);\n }else{\n //update existing product\n $this->update($items);\n }\n\n }\n }",
"public function demo_order_creator()\n {\n $products = Product::limit(10)->latest('id')->pluck('id');\n\n foreach ($products as $product_id){\n\n //Create cart product\n $cart_product = CartProduct::create( ['product_id' => $product_id] );\n\n $product_option = ProductOption::where('product_id',$product_id)->get();\n\n //If product has options create cart product options\n if(count($product_option)){\n\n $product_options_ids = $product_option->pluck('id');\n\n foreach ($product_options_ids as $product_option_id){\n CartProductOption::create([\n 'cart_product_id' => $cart_product->id,\n 'product_option_id' => $product_option_id,\n 'quantity' => 1\n ]);\n }\n }\n\n }\n\n //Create carts\n $site_users = User::pluck('id')->toArray();\n\n for ( $i=1; $i <= 20;$i++ ){\n $site_user_id = $site_users[array_rand( $site_users )];\n Cart::create([ 'id' => $i, 'user_id' => $site_user_id,'status' => 1 ]);\n }\n\n //Create cart items\n $all_cart_products = CartProduct::pluck('id')->toArray();\n\n for ( $i=1; $i <= 100;$i++ ){\n\n CartItem::create([\n 'id' => $i,\n 'cart_id' => rand(1,20),\n 'cart_product_id' => $all_cart_products[array_rand( $all_cart_products )],\n 'quantity' => rand(1,3),\n 'price' => rand(100,250)\n ]);\n }\n\n //Create orders\n $all_shop_branches = ShopBranch::pluck('id')->toArray();\n $all_order_statuses = OrderStatus::pluck('id')->toArray();\n $all_payment_methods = OrderPaymentMethod::pluck('id')->toArray();\n $all_user_addresses = UserAddress::pluck('id')->toArray();\n $all_couriers = Courier::pluck('id')->toArray();\n\n for ( $i=1; $i <= 96;$i++ ){\n\n Order::create([\n 'id' => $i,\n 'cart_id' => rand(1,20),\n 'shop_branch_id' => $all_shop_branches[ array_rand( $all_shop_branches ) ],\n 'status_id' => $all_order_statuses[ array_rand( $all_order_statuses ) ],\n 'payment_method' => $all_payment_methods[ array_rand( $all_payment_methods ) ],\n 'payment_status' => rand(0,1),\n 'user_id' => $site_users[array_rand( $site_users )],\n 'user_address_id' => $all_user_addresses[array_rand( $all_user_addresses )],\n 'is_takeaway' => 0,\n 'delivery_datetime' => date('Y-m-d H:i:s'),\n 'courier_id' => $all_couriers[array_rand( $all_couriers )],\n 'delivery_cost' => rand(0,12),\n ]);\n }\n\n return 'ok';\n }",
"public function postOrder(Request $request) {\n //`user_id``address_id``total_ongkir``no_resi``kurir``status``total`\n\n $address_tarif = explode('|', Input::get('address_id'));\n $address_id = $address_tarif[0];\n $total_ongkir = $address_tarif[1];\n\n // Set $user_id to the currently authenticated user\n $user_id = Auth::user()->id;\n\n // Set $cart_products to the Cart Model with its products where\n // the user_id = to the current signed in user ID\n $cart_products = Cart::with('products')->where('user_id', '=', $user_id)->get();\n\n // Set $cart_total to the Cart Model alond with all its products, and\n // where the user_id = the current signed in user ID, and\n // also get the sum of the total field.\n $cart_total = Cart::with('products')->where('user_id', '=', $user_id)->sum('total');\n\n // Get the total, and set the charge amount\n $charge_amount = number_format($cart_total, 2) * 100;\n\n\n // Create the order in DB, and assign each variable to the correct form fields\n $order = Order::create (\n array(\n 'user_id' => $user_id,\n 'address_id' => $address_id,\n 'total_ongkir' => $total_ongkir,\n 'total' => $cart_total+$total_ongkir,\n 'status' => 'unpaid'\n ));\n\n // Attach all cart items to the pivot table with their fields\n foreach ($cart_products as $order_products) {\n $order->orderItems()->attach($order_products->product_id, array(\n 'qty' => $order_products->qty,\n 'price' => $order_products->products->price,\n 'reduced_price' => $order_products->products->reduced_price,\n 'total' => $order_products->products->price * $order_products->qty,\n 'total_reduced' => $order_products->products->reduced_price * $order_products->qty,\n ));\n // Decrement the product quantity in the products table by how many a user bought of a certain product.\n // \\DB::table('products')->decrement('product_qty', $order_products->qty);\n // \\DB::table('products')->increment('buy', $order_products->qty);\n \\DB::table('products')->where('id',$order_products->product_id)->decrement('product_qty', $order_products->qty);\n \\DB::table('products')->where('id',$order_products->product_id)->increment('buy', $order_products->qty);\n }\n\n\n \n\n \n // Delete all the items in the cart after transaction successful\n Cart::where('user_id', '=', $user_id)->delete();\n \n // Then return redirect back with success message\n flash()->success('Success', 'Your order was processed successfully.');\n\n return redirect()->route('cart');\n\n }",
"public function add_order()\n {\n if (isset($_SESSION['cart'])) {\n $total_cost = 0;\n $quantity = 0;\n $quaty = \"\";\n foreach ($_SESSION['cart'] as $id => $quaty) {\n $product = Data::find_by_id($id);\n $cost = $product->price * $quaty; // $quaty is quantity.\n $quantity += $quaty;\n $total_cost = $total_cost + $cost;\n }\n if ($quaty > 0) {\n echo \"<p class='text-light pl-2 pr-2 pb-0 m-0'> $quantity </p>\";\n }\n } else {\n echo \"<p class='text-light pl-2 pr-2 pb-0 m-0'> Empty</p>\";\n }\n }",
"public function add(Request $request){\n $cart = Cart::where('user_id','=',Auth()->user()->id)->get();\n\n //Criar o pedido\n $order = Order::create([\n 'user_id' => Auth()->user()->id,\n 'status' => 'Processando',\n 'address' => 'Rua TESTE',\n 'address_number' => '111',\n 'address_city' => 'São Paulo',\n 'address_state' => 'SP',\n 'cc_number' => substr($request->cc_card,-4),\n ]);\n\n foreach($cart as $item){\n OrderItem::create([\n 'order_id' => $order->id,\n 'product_id' => $item->product_id,\n 'quantity' => $item->quantity,\n 'price' => $item->product()->price,\n ]);\n\n $item->delete();\n }\n\n return redirect(route('order.show'));\n\n }",
"public function createOrderFromCart($cart)\n {\n\n if ($cart === null) {\n vmError('createOrderFromCart() called without a cart - that\\'s a programming bug', 'Can\\'t create order, sorry.');\n return false;\n }\n\n $usr = JFactory::getUser();\n //$prices = $cart->getCartPrices();\n\n if (($orderID = $this->_createOrder($cart, $usr)) == 0) {\n vmError('Couldn\\'t create order', 'Couldn\\'t create order');\n return false;\n }\n if (!$this->_createOrderLines($orderID, $cart)) {\n vmError('Couldn\\'t create order items', 'Couldn\\'t create order items');\n return false;\n }\n if (!$this->_createOrderCalcRules($orderID, $cart)) {\n vmError('Couldn\\'t create order items', 'Couldn\\'t create order items');\n return false;\n }\n $this->_updateOrderHist($orderID);\n if (!$this->_writeUserInfo($orderID, $usr, $cart)) {\n vmError('Couldn\\'t create order userinfo', 'Couldn\\'t create order userinfo');\n return false;\n }\n\n return $orderID;\n }",
"public function store(Request $request)\n {\n $betkoks = session('cart.reservation_info');\n $order = Order::create([\n 'name' =>$betkoks['name'], \n 'email' => $betkoks['email'],\n 'table_name' => $betkoks['table_name'],\n 'contact_person' => $betkoks['contact_person'],\n 'phone' => $betkoks['phone'],\n 'order_time' => $betkoks['order_time'],\n 'order_date' => $betkoks['order_date'],\n 'number_of_persons' => $betkoks['number_of_persons'],\n\n 'total' => session('cart.total'),\n 'date' => \\Carbon\\Carbon::now(),\n 'user_id' => \\Auth::user()->id,\n\n ]);\n foreach (session('cart.items') as $item){\n OrderLine::create([\n 'name' =>$betkoks['name'],\n 'order_id' => $order->id,\n 'dish_id' => $item['id'],\n 'quantity' => $item['quantity'],\n 'total' => $item['total'],\n\n 'contact_person' => $request->get('contact_person'),\n 'phone' => $request->get('phone'),\n 'order_date' => $request->get('order_date'),\n 'order_time' => $request->get('order_time')\n ]);\n }\n $this->clearCart();\n return redirect()->route('contacts.index')->with('message', [\n 'text' => 'uzsakymas priimtas',\n 'type' => 'success'\n ]);\n }",
"public function store(Request $request)\n {\n try {\n $rules = [\n 'order_date' => 'required',\n 'customer_name' => 'required'\n ];\n \n $messages = [\n 'order_date.required' => 'Masukkan tanggal order!',\n 'customer_name.required' => 'Masukkan nama customer!'\n ];\n \n $validator = Validator::make($request->all(), $rules, $messages);\n \n if($validator->fails()){\n return redirect()->back()->withErrors($validator)->withInput($request->all);\n }\n \n $carts = Session::get('items');\n if(!$carts){\n return redirect()->back()->with('error', 'Silahkan masukkan data product!');\n }\n \n $total = 0;\n foreach ($carts as $key => $value) {\n $total += $value['price'] * $value['qty'];\n }\n \n $gen = $this->generateID($request->order_date);\n if (!$gen)\n return redirect()->back()->with('error', 'Error when generating id');\n $order = new Order;\n $order->id = (int)$gen;\n $order->customer_name = $request->customer_name;\n $order->order_date = Carbon::parse($request->order_date);\n $order->total = $total;\n\n $order->save();\n\n foreach ($carts as $key => $value) {\n $orderprod = new OrderProduct;\n $orderprod->order_id = $gen;\n $orderprod->product_id = $value['id'];\n $orderprod->customer = $request->customer_name;\n $orderprod->qty = $value['qty'];\n $orderprod->sub_total = $value['price'] * $value['qty'];\n\n $orderprod->save();\n }\n\n Session::forget('items');\n\n $ord_result = Order::findOrFail($order->id);\n $pro_result = OrderProduct::where('order_id', $order->id)\n ->join('products', 'products.id', '=', 'order_products.product_id')\n ->get(['order_products.*', 'products.product_name', 'products.price']);\n Session::flash('success', 'Berhasil membuat order!');\n return redirect()->back()->with(['orders' => $ord_result , 'orderproducts' => $pro_result]);\n } catch (\\Excepcion $e) {\n return redirect()->back()->with('error', $e->getMessage());\n }\n }",
"public function store(Request $request)\n {\n $dubl = Cart::search(function ($cartItem, $rowId) use ($request) {\n return $cartItem->id === $request->id;\n });\n if ($dubl->isNotEmpty()) {\n \n toastr()->warning('product is already in cart !');\n\n \n \n\n\n\n };\n\n \n\n ///////////////////////////////////////////////////\n\n $user = DB::table('orders')\n ->where('user_id', '=', Auth::user()->id)\n ->first();\n //////////////////////////////////////////////\n\n //////////////////////////////////\n $order_id = order::latest()->first()->id;\n\n /////////////////\n\n\n////////////////////////////////////\n\n\n /////////////////////////////////////////////////\n\n if (isset($user) ) {\n\n\n orderItem::create([\n 'order_id' =>$order_id,\n 'product_id' => $request->id,\n 'user_id' => Auth::user()->id,\n 'quantity' => 1,\n 'price' => $request->price,\n ]);\n\n\n\n\n } else{\n\n order::create([\n 'user_id' => (Auth::user()->id),\n 'status' => 1,\n\n ]);\n\n orderItem::create([\n 'order_id' => $order_id,\n 'product_id' => $request->id,\n 'user_id ' => Auth::user()->id,\n 'quantity' => 1,\n 'price' => $request->price,\n ]);\n }\n\n\n\n\n\n\n /////////////////////////////////////////\n\n Cart::add($request->id, $request->name, 1, $request->price)->associate('App\\product', 'App\\orderItem');\n toastr()->success('product added Successfully');\n\n\n return redirect()->back();\n \n }",
"public function checkout()\n {\n $authService = $this->auth;\n $customerID = $authService::getUserID();\n $data = $this->getData();\n\n $result = array();\n $this->transaction(\"begin\");\n \n // create order\n $orderID = $this->createCustomerOrder($data, $customerID);\n if (!$orderID) {\n $this->transaction(\"rollback\");\n return $result;\n }\n\n // get cart summary\n if (!$cartSummary = $this->getCartSummary($customerID)) {\n $this->transaction(\"rollback\");\n return $result;\n }\n // save cart items to order\n foreach ($cartSummary as $row) {\n if (!$this->saveOrderItems($row, $orderID)) {\n $this->transaction(\"rollback\");\n return $result;\n }\n }\n\n // save payment details\n if (!$paymentID = $this->saveOrderPayment($data, $orderID)) {\n $this->transaction(\"rollback\");\n return $result;\n }\n\n // save payment method details\n if (!$this->savePaymentMethodDetails($data, $paymentID)) {\n $this->transaction(\"rollback\");\n return $result;\n }\n\n // clear the cart\n if (!$this->clearCart($customerID)) {\n $this->transaction(\"rollback\");\n return $result;\n }\n\n // validate coupon code if any\n if ($data[\"orderCouponApplied\"]) {\n // get coupon ID\n if (!$couponID = $this->getCouponID($data[\"orderCouponApplied\"])) {\n $this->transaction(\"rollback\");\n return $result;\n }\n\n // save the coupon usage\n if (!$this->logCouponUsage($customerID, $orderID, $couponID)) {\n $this->transaction(\"rollback\");\n return $result;\n }\n } \n\n $this->transaction(\"commit\");\n\n return $this->validateResult(array(\"order_no\" => $orderID, \"order_status\" => 1), $this->dataSignature);\n }",
"public function insertUpdateStoreProductsInCart() {\n if (func_num_args() > 0) {\n $user_id = func_get_arg(0);\n $store_id = func_get_arg(1);\n $product_id = func_get_arg(2);\n $quantity = func_get_arg(3);\n $allCartDetail = array();\n $success = null;\n $i = 0;\n $this->getAdapter()->beginTransaction();\n\n try {\n\n foreach ($product_id as $key => $value) {\n $cartId = $this->select()\n ->from($this, array('id'))\n ->where('user_id = ?', $user_id)\n ->where('store_id = ?', $store_id)\n ->where('product_id = ?', $value);\n\n $cartId = $this->getAdapter()->fetchRow($cartId);\n\n $data = null;\n\n if ($cartId) {\n\n $where['id = ?'] = $cartId['id'];\n $data1 = array('quantity' => 0);\n $data2 = array('quantity' => $quantity[$key]);\n $updateQuantity1 = $this->update($data1, $where);\n $updateQuantity2 = $this->update($data2, $where);\n\n if ($updateQuantity1 && $updateQuantity2) {\n\n $allCartDetail[$i]['cartId'] = $cartId['id'];\n $allCartDetail[$i]['productId'] = $value;\n $allCartDetail[$i]['orderedQuantity'] = $quantity[$key];\n $success = true;\n } else {\n $success = false;\n break;\n }\n } else {\n\n $data = array(\n 'product_id' => $value,\n 'user_id' => $user_id,\n 'quantity' => $quantity[$key],\n 'store_id' => $store_id,\n );\n\n $insertedCartId = $this->insert($data);\n\n if ($insertedCartId) {\n $allCartDetail[$i]['cartId'] = $insertedCartId;\n $allCartDetail[$i]['productId'] = $value;\n $allCartDetail[$i]['orderedQuantity'] = $quantity[$key];\n $success = true;\n } else {\n $success = false;\n break;\n }\n }\n\n $i++;\n }\n\n if ($success) {\n $this->getAdapter()->commit();\n return $allCartDetail;\n } else {\n $this->getAdapter()->rollBack();\n return 'fail';\n }\n } catch (Exception $ex) {\n $this->getAdapter()->rollBack();\n throw new Exception(\"Error : \" . $ex);\n }\n } else {\n throw new Exception(\"Argument has not passed\");\n }\n }",
"public function get_sess_cart_items()\n {\n $cart = array();\n $new_cart = array();\n $this->cart_product_ids = array();\n if (!empty($this->session->userdata('mds_shopping_cart'))) {\n $cart = $this->session->userdata('mds_shopping_cart');\n }\n foreach ($cart as $cart_item) {\n $product = $this->product_model->get_available_product($cart_item->product_id);\n if (!empty($product)) {\n //if purchase type is bidding\n if ($cart_item->purchase_type == 'bidding') {\n $this->load->model('bidding_model');\n $quote_request = $this->bidding_model->get_quote_request($cart_item->quote_request_id);\n if (!empty($quote_request) && $quote_request->status == 'pending_payment') {\n $item = new stdClass();\n $item->cart_item_id = $cart_item->cart_item_id;\n $item->product_id = $product->id;\n $item->product_type = $cart_item->product_type;\n $item->product_title = $cart_item->product_title;\n $item->options_array = $cart_item->options_array;\n $item->quantity = $cart_item->quantity;\n $item->unit_price = $quote_request->price_offered / $quote_request->product_quantity;\n $item->total_price = $quote_request->price_offered;\n $item->discount_rate = 0;\n $item->currency = $product->currency;\n $item->product_vat = 0;\n $item->shipping_cost = $quote_request->shipping_cost;\n $item->purchase_type = $cart_item->purchase_type;\n $item->quote_request_id = $cart_item->quote_request_id;\n $item->is_stock_available = 1;\n if ($this->form_settings->shipping != 1) {\n $item->shipping_cost = 0;\n }\n array_push($new_cart, $item);\n }\n } else {\n $object = $this->get_product_price_and_stock($product, $cart_item->product_title, $cart_item->options_array);\n $price = calculate_product_price($product->price, $product->discount_rate);\n $item = new stdClass();\n $item->cart_item_id = $cart_item->cart_item_id;\n $item->product_id = $product->id;\n $item->product_type = $cart_item->product_type;\n $item->product_title = $cart_item->product_title;\n $item->options_array = $cart_item->options_array;\n $item->quantity = $cart_item->quantity;\n $item->unit_price = $object->price_calculated;\n $item->total_price = $object->price_calculated * $cart_item->quantity;\n $item->discount_rate = $object->discount_rate;\n $item->currency = $product->currency;\n $item->product_vat = $this->calculate_total_vat($object->price_calculated, $product->vat_rate, $cart_item->quantity);\n $item->shipping_cost = $this->get_product_shipping_cost($product, $cart_item->quantity);\n $item->purchase_type = $cart_item->purchase_type;\n $item->quote_request_id = $cart_item->quote_request_id;\n $item->is_stock_available = $object->is_stock_available;\n if ($this->form_settings->shipping != 1) {\n $item->shipping_cost = 0;\n }\n array_push($new_cart, $item);\n }\n }\n }\n $this->session->set_userdata('mds_shopping_cart', $new_cart);\n return $new_cart;\n }",
"public static function saveToCart($cart_products,$order, $total_price,$currency,$ses_id){\n $error = array();\n foreach($cart_products as $product){\n $prod = Product::productById($product['product_id']);\n //$latest_products_info[$product['product_id']] = $prod; \n if($product['cart_quantity'] > $prod['quantity']){ \n $error['error'] .= \"{$product['name']} , Quantity: {$product['cart_quantity']} not Available, \\n\";\n }\n }\n if(!empty($error)){ $error['success'] = false; echo json_encode($error); die; }\n\n\n if(!isset($order['shipping_address_id']) || !isset($order['billing_address_id']) || !isset($order['payment_method']) || !isset($order['shipping_method'])){\n $error['success'] = false;\n $error['error'] = 'Fill Order Steps';\n //pr($order);\n echo json_encode($error);\n die; \n }\n \n \n $sessUserId = (isset($_SESSION['sess_user_id']) ? $_SESSION['sess_user_id'] : 0);\n if($sessUserId!=$order['customer_id']){\n $error['success'] = false;\n $error['error'] = 'Please login to correct user'; \n }\n \n \n \n //$store = Store::loadById(2);\n $store = Store::load($start = 1, $limit = 1);\n $store = $store[0];\n if(empty($store)){\n $error['success'] = false;\n $error['error'] = 'Please login to correct user';\n echo json_encode($error);\n die; \n }\n $customer = Customer::loadById($order['customer_id']);\n $store_url = BASE_URL.\"admins/store/index.php?id=1\"; \n\n $paddress = CustomerAddress::loadById($order['billing_address_id']);\n $shipaddress = CustomerAddress::loadById($order['shipping_address_id']);\n $payment_country_name = Country::loadById( $paddress->getCountryId() );\n $ship_country_name = Country::loadById( $shipaddress->getCountryId() );\n $payment_zone_name = Zone::loadById($paddress->getZoneId());\n $ship_zone_name = Zone::loadById($shipaddress->getZoneId());\n $PaymentMethod = PaymentMethod::loadByCode($order['payment_method']);\n $shippingMethod = DeliveryMethod::loadByCode($order['shipping_method']);\n $date_added = date('Y-m-d H:i:s', time());\n\n if(empty($PaymentMethod)){\n $error['success'] = false;\n $error['error'] = 'Select Payment method';\n echo json_encode($error);\n die; \n }\n\n \n if(empty($shippingMethod)){\n $error['success'] = false;\n $error['error'] = 'Select Shipping method';\n echo json_encode($error);\n die; \n }\n\n \n \n \n $objOrderList = new OrderList(); \n $objOrderList->setInvoiceNo(0);\n $objOrderList->setInvoicePrefix(\"INV-\".date(\"Y-m\"));\n $objOrderList->setStoreId(0);\n $objOrderList->setStoreName($store->getName());\n $objOrderList->setStoreUrl($store_url);\n $objOrderList->setCustomerId($customer->getCustomerId());\n $objOrderList->setCustomerGroupId($customer->getCustomerGroupId());\n $objOrderList->setFirstname($customer->getFirstname());\n $objOrderList->setLastname($customer->getLastname());\n $objOrderList->setEmail($customer->getEmail());\n $objOrderList->setTelephone($customer->getTelephone());\n $objOrderList->setFax($customer->getFax());\n $objOrderList->setPaymentFirstname($paddress->getFirstname());\n $objOrderList->setPaymentLastname($paddress->getLastname());\n $objOrderList->setPaymentCompany($paddress->getCompany());\n $objOrderList->setPaymentCompanyId($paddress->getCompanyId());\n $objOrderList->setPaymentTaxId($paddress->getTaxId());\n $objOrderList->setPaymentAddress1($paddress->getAddress1());\n $objOrderList->setPaymentAddress2($paddress->getAddress2());\n $objOrderList->setPaymentCity($paddress->getCity());\n $objOrderList->setPaymentPostcode($paddress->getPostcode());\n $objOrderList->setPaymentCountry($payment_country_name->getName());\n $objOrderList->setPaymentCountryId($paddress->getCountryId());\n $objOrderList->setPaymentZone($payment_zone_name->getName()); \n $objOrderList->setPaymentZoneId($paddress->getZoneId());\n $objOrderList->setPaymentAddressFormat('');\n $objOrderList->setPaymentMethod($PaymentMethod->getName()); \n $objOrderList->setPaymentCode($order['payment_method']);\n $objOrderList->setPaymentComment($order[\"payment_comment\"]);\n $objOrderList->setBankName($order[\"bank_name\"]);\n $objOrderList->setBankAcountNo($order[\"bank_acount_no\"]);\n $objOrderList->setShippingFirstname($shipaddress->getFirstname());\n $objOrderList->setShippingLastname($shipaddress->getLastname());\n $objOrderList->setShippingCompany($shipaddress->getCompany());\n $objOrderList->setShippingAddress1($shipaddress->getAddress1());\n $objOrderList->setShippingAddress2($shipaddress->getAddress2());\n $objOrderList->setShippingCity($shipaddress->getCity()); \n $objOrderList->setShippingPostcode($shipaddress->getPostcode());\n $objOrderList->setShippingCountry($ship_country_name->getName());\n $objOrderList->setShippingCountryId($shipaddress->getCountryId());\n $objOrderList->setShippingZone($ship_zone_name->getName());\n $objOrderList->setShippingZoneId($shipaddress->getZoneId());\n $objOrderList->setShippingAddressFormat('');\n $objOrderList->setShippingMethod($shippingMethod->getMethodName());\n $objOrderList->setShippingCode($order['shipping_method']);\n $objOrderList->setComment($order['shipping_comment']); //$order['shipping_comment']\n $objOrderList->setTotal($total_price);\n $objOrderList->setOrderStatusId(1);\n $objOrderList->setAffiliateId(0);\n $objOrderList->setCommission(0);\n $objOrderList->setLanguageId(1);\n $objOrderList->setCurrencyId($currency[\"currency_id\"]);\n $objOrderList->setCurrencyCode($currency[\"code\"]);\n $objOrderList->setCurrencyValue($currency[\"value\"]);\n $objOrderList->setIp($_SERVER['REMOTE_ADDR']);\n $objOrderList->setForwardedIp('');\n $objOrderList->setUserAgent($_SERVER[\"HTTP_USER_AGENT\"]);\n $objOrderList->setAcceptLanguage($_SERVER['HTTP_ACCEPT_LANGUAGE']);\n $objOrderList->setDateAdded($date_added);\n $objOrderList->setDateModified($date_added);\n $objOrderList->setCbaFreeShipping(0);\n \n\n \n $result = $objOrderList->save(); \n $order_id = $objOrderList->getOrderId();\n \n if($result['success']){ \n $customer_reward = $cart_total_price = 0;\n\n // order Product insertion\n if(!empty($cart_products))\n foreach($cart_products as $k=>$product){\n $cart_product_price_total = $price= 0;\n $objOrderProduct = new OrderProduct();\n //$objOrderProduct->setOrderProductId($resultRow[\"order_product_id\"]);\n $objOrderProduct->setOrderId($order_id);\n $objOrderProduct->setProductId($product[\"product_id\"]);\n $objOrderProduct->setName($product[\"name\"]);\n $objOrderProduct->setModel($product[\"manufacture_name\"]);\n $objOrderProduct->setQuantity($product[\"cart_quantity\"]);\n $objOrderProduct->setSize($product[\"product_size\"]);\n if($product['product_discount_id']!=NULL)\n $price = ($product[\"discount_price\"]*$currency['value']);\n else \n $price = ($product[\"price\"]*$currency['value']);\n \n $objOrderProduct->setPrice($price);\n $cart_product_price_total = $price*$product[\"cart_quantity\"];\n $cart_total_price +=$cart_product_price_total;\n $objOrderProduct->setTotal($cart_product_price_total);\n $objOrderProduct->setTax(0);\n $objOrderProduct->setReward(($product[\"points\"]*$product[\"cart_quantity\"]));\n $customer_reward += intval($product[\"points\"]); \n $result_prod = $objOrderProduct->save();\n $objOrderProduct->getOrderProductId();\n\n $order_products[] = \"{$product[\"name\"]} - {$product[\"cart_quantity\"]} - {$currency['code']}{$price} \";\n } \n\n // order Reward insertion\n if($customer_reward>0){\n $custrewardinfo = CustomerReward::fetchByCustomerId($customer->getCustomerId());\n $objCustomerReward = new CustomerReward();\n if(!empty($custrewardinfo) && $custrewardinfo->getCustomerRewardId()>0)\n $objCustomerReward->setCustomerRewardId($custrewardinfo->getCustomerRewardId());\n $objCustomerReward->setCustomerId($customer->getCustomerId());\n $objCustomerReward->setOrderId(1);\n $objCustomerReward->setDescription(\"Reward point\");\n $objCustomerReward->setPoints($customer_reward);\n $objCustomerReward->setDateAdded($date_added);\n $objCustomerReward->save();\n }\n\n // order Total insertion only shipping implement\n \n\n $objOrderTotal = new OrderTotal();\n $objOrderTotal->setOrderId($order_id);\n $objOrderTotal->setCode('sub_total');\n $objOrderTotal->setTitle('Sub-Total');\n $objOrderTotal->setText($cart_total_price);\n $objOrderTotal->setValue($cart_total_price);\n $objOrderTotal->setSortOrder(1);\n $objOrderTotal->save();\n \n\n $objOrderTotal = new OrderTotal();\n $objOrderTotal->setOrderId($order_id);\n $objOrderTotal->setCode($shippingMethod->getDeliveryMethodCode());\n $objOrderTotal->setTitle($shippingMethod->getMethodName());\n $objOrderTotal->setText($shippingMethod->getMethodName());\n $ship_rate = $shippingMethod->getCost()*$currency['value'];\n $objOrderTotal->setValue($ship_rate);\n $objOrderTotal->setSortOrder(2);\n $result = $objOrderTotal->save();\n\n $objOrderTotal = new OrderTotal();\n //$objOrderTotal->setOrderTotalId($resultRow[\"order_total_id\"]);\n $objOrderTotal->setOrderId($order_id);\n $objOrderTotal->setCode('total');\n $objOrderTotal->setTitle('Total');\n $objOrderTotal->setText(($cart_total_price+$ship_rate));\n $objOrderTotal->setValue(($cart_total_price+$ship_rate));\n $objOrderTotal->setSortOrder(3);\n $result = $objOrderTotal->save();\n \n // Order Hisory Entry\n $objOrderHistory = new OrderHistory(); \n $objOrderHistory->setOrderId($order_id);\n $objOrderHistory->setOrderStatusId(1);\n $objOrderHistory->setNotify(1);\n $objOrderHistory->setComment($order['payment_comment']);\n $objOrderHistory->setDateAdded($date_added);\n $result = $objOrderHistory->save(); \n unset($_SESSION[$ses_id]['Order']);\n unset($_SESSION[$ses_id]['Products']);\n unset($_SESSION[$ses_id]['Cart_Total_Price']);\n $customerinfo = Customer::loadById($customer->getCustomerId());\n $result = Customer::saveCart($customer->getCustomerId(), serialize(array()));\n $result['result'] = \"Succes submit\";\n\n $order_products_str = implode(\", \\n\", $order_products);\n\n /*$mailObj = new Mailer();\n $from = $customer->getEmail(); \n $fromname = $customer->getFirstname(). \" \".$customer->getLastname();\n \n $subject = sprintf(CART_CHECKOUT_SUBJECT,$order_id);\n $body = sprintf(CART_CHECKOUT_BODY,$order_products_str);\n $mailObj->setMailAddress($from, $fromname);\n $mailObj->setMailSubject($subject);\n $mailObj->setMailBody(sprintf(CART_CHECKOUT_BODY,$order_products_str));\n //pr($mailObj); die(\"d\"); \n //if(!$mailObj->MailSend($from,$fromname,$subject,$body)){\n if(!$mailObj->MailSend()){\n $result['error'] = \"Mail can\\'t send ! Order Submit. \\n Check your Account Order history\";\n $result['success']=false;\n echo json_encode($result);\n die;\n }*/\n\n $result['order_id'] = $order_id;\n $result['success']=true;\n \n echo json_encode($result);\n die;\n\n \n }\n\n\n }",
"public function testAddProductToCart()\n {\n $this->browse(function (Browser $browser) {\n // Home Page\n $browser->visit(new HomePage);\n\n // Get Collection Name\n $collectionName = $browser->text('.thumbnail .caption a');\n\n // Products Page\n $browser->clickLink($collectionName)\n ->assertSee($collectionName);\n\n // Get Product Name\n $productName = $browser->text('.thumbnail .caption a');\n\n $browser->clickLink($productName)\n // Product Page\n ->assertSee($productName)\n ->press('Add To Cart')\n ->assertSee('Product has been added to your cart.')\n // Cart Page\n ->visit('/cart')\n ->assertSee($productName);\n });\n }",
"function checkOut($order, $cart)\n {\n $db = new Database();\n $conn = $db->getConnection();\n\n $success = false;\n\n $conn->autocommit(FALSE);\n $conn->begin_transaction();\n\n $ordersDataService = new OrderDataService();\n $productBusinessService = new ProductBusinessService();\n\n $orderID = $this->addOrdersLine($order, $conn);\n\n foreach ($cart->getItems() as $product_id => $qty) {\n\n $product = $productBusinessService->getProductByID($product_id);\n\n $orderDetails = new OrderDetails($orderID, $product_id, $qty, ($qty * $product->getPrice()), \"here is some description\");\n $okdetails = $this->addDetailsLine($orderID, $orderDetails, $conn);\n }\n\n if ($orderID && $okdetails) {\n $conn->commit();\n $success = true;\n } else {\n $conn->rollback();\n }\n\n $conn->close();\n\n return $success;\n }",
"function addToCart() {\n\t\t$wine_name = $_SESSION['wine']['name'];\n\t\t//check if there is a registered user logged in\n\t\t// --> LET US NOT THINK ABOUT USERNAMES FOR NOW <--\n\t\t//if (!isset($_SESSION['user'])) {\n\t\t\t//generate a random username (string) for\n\t\t\t//unlogged user\n\t\t\t//$username = uniqid('',true);\n\t\t\t//$_SESSION['user']['username'] = $username;\n\t\t//}\n\n\t\t//get the cart\n\t\t$cart = $_SESSION['cart'];\n\t\t//get wine count\n\t\t$wine_qty = $_POST['wine_quantity'];\n\t\t// detect if the same item already exist in the cart\n\t\tif (isset($_SESSION['cart'][$wine_name])) {\n\t\t\t//just add the post quantity to the quantity in the cart\n\t\t\t$_SESSION['cart'][$wine_name] += $wine_qty;\n\t\t}\n\t\telse {\n\t\t\t//create an array of the selected item to be\n\t\t\t//added to the cart\n\t\t\t$_SESSION['cart'][$wine_name] = intval($wine_qty);\n\t\t\t//current date will also be used at view cart\n\t\t\t//\"purchase_date\" => date(\"Y-m-d h:i:sa\")\n\t\t}\n\t\t//redirect to homepage\n\t\theader('Location: index.php');\n\t}",
"public function buyProducts(Request $request)\n {\n $carts = $request->has('cards') ? $request->cards : [];\n $note = $request->has('note') ? $request->note : \"\";\n $user_id = \\Auth::id();\n $email = \\Auth::user()->email;\n $order = [\n 'user_id' => $user_id,\n 'date_order' => now(),\n 'status' => 1,\n 'total' => end($carts)['total'],\n 'note' => $note,\n 'code' => rand(100000, 999999)\n ];\n try {\n $order = Order::create($order);\n foreach($carts as $cart) {\n if (count(array_keys($cart)) == 3) {\n OrderDetail::create([\n 'order_id' => $order->id,\n 'product_id' => $cart['id'],\n 'quantity' => $cart['quantity'],\n 'price' => $cart['unit']\n ]);\n }\n }\n Mail::to($email)->send(new Orders($order));\n }\n catch (Exception $e) {\n throw new Exception($e->getMessage());\n }\n # create order detail\n return response()->json(true);\n }",
"public function save_order() {\n$customer = array(\n'nama' => $this->input->post('nama'),\n'email' => $this->input->post('email'),\n);\n// And store user information in database.\n$cust_id = $this->Shop_model->insert_customer($customer);\n\n$order = array(\n'pelanggan' => $cust_id\n);\n\n$ord_id = $this->Shop_model->insert_order($order);\n\n\nforeach ($this->cart->contents() as $item):\n$order_detail = array(\n'order_id' => $ord_id,\n'produk' => $item['id'],\n'qty' => $item['qty'],\n'harga' => $item['price']\n);\n\n// Insert product imformation with order detail, store in cart also store in database.\n\n$cust_id = $this->Shop_model->insert_order_detail($order_detail);\nendforeach;\n\n\nredirect('shop');\n\n }",
"public function placeOrder($id_cart, $status, $transaction_data)\n {\n $cart = new Cart($id_cart);\n\n $payment_details = $transaction_data['payment_details'];\n $email = $payment_details['email'];\n $first_name = $payment_details['first_name'];\n $last_name = $payment_details['last_name'];\n $address_1 = $payment_details['address_1'];\n $address_2 = $payment_details['address_2'];\n $city = $payment_details['city'];\n $postcode = $payment_details['zip'];\n $country_code = (new League\\ISO3166\\ISO3166)->alpha3($payment_details['country_code'])['alpha2'];\n $phone = $payment_details['phone'];\n\n // Get Customer\n if ($cart->id_customer > 0) {\n $customer = new Customer($cart->id_customer);\n } else {\n // Check Customer by E-Mail\n $id_customer = (int)Customer::customerExists($email, true, true);\n if ($id_customer > 0) {\n $customer = new Customer($id_customer);\n } else {\n // Create Customer\n $password = Tools::passwdGen(8);\n $customer = new Customer();\n $customer->firstname = $first_name;\n $customer->lastname = $last_name;\n $customer->email = $email;\n $customer->passwd = Tools::encrypt($password);\n $customer->is_guest = 0;\n $customer->id_default_group = (int)Configuration::get('PS_CUSTOMER_GROUP', null, $cart->id_shop);\n $customer->newsletter = 1;\n $customer->optin = 0;\n $customer->active = 1;\n $customer->id_gender = 9;\n $customer->add();\n $this->sendConfirmationMail($customer, $cart->id_lang, $password);\n }\n }\n\n // Check existing address\n $id_country = (string)Country::getByIso($country_code);\n foreach ($customer->getAddresses($cart->id_lang) as $address) {\n if ($address['firstname'] === $first_name\n && $address['lastname'] === $last_name\n && $address['city'] === $city\n && $address['address1'] === $address_1\n && $address['address2'] === $address_2\n && $address['postcode'] === $postcode\n && $address['phone_mobile'] === $phone\n && $address['id_country'] === $id_country) {\n // Set Address\n $cart->id_address_invoice = $address['id_address'];\n $cart->id_address_delivery = $address['id_address'];\n\n break;\n }\n }\n\n // Save Address if don't exists\n if (!$cart->id_address_invoice) {\n $address = new Address();\n $address->firstname = $first_name;\n $address->lastname = $last_name;\n $address->address1 = $address_1;\n $address->address2 = $address_2;\n $address->postcode = $postcode;\n $address->phone_mobile = $phone;\n $address->city = $city;\n $address->id_country = $id_country;\n $address->id_customer = $customer->id;\n $address->alias = $this->l('My address');\n $address->add();\n\n // Set Address\n $cart->id_address_invoice = $address->id;\n $cart->id_address_delivery = $address->id;\n }\n\n // Update cart\n $cart->getPackageList(true);\n $cart->getDeliveryOptionList(null, true);\n $cart->id_customer = $customer->id;\n $cart->secure_key = $customer->secure_key;\n $cart->delivery_option = '';\n $cart->save();\n\n $cart = new Cart($cart->id);\n $this->validateOrder(\n $cart->id,\n $status,\n $cart->getOrderTotal(true, 3),\n $this->displayName,\n null,\n array(),\n $cart->id_currency,\n false,\n $customer->secure_key\n );\n\n return $this->currentOrder;\n }",
"public function continue_checkout($Recipt,$ShoppingCart,$discount)\n {\n $Recipt->update([\n 'is_init_for_card_payment' => null\n ]);\n\n Recipt::where('member_id',$Recipt->member_id)->where('is_init_for_card_payment','1')->delete();\n\n $ReciptProducts = [];\n //--for create Recipt Products--\n foreach ($ShoppingCart as $key => $Cart)\n {\n $this_product = Product::find($Cart->product_id);\n if( $this_product->quantity > 0 || !$this_product)\n {\n //check if selected quantity is not bigger than the stock quantity\n $required_quantity = ($Cart->quantity < $this_product->quantity) ? $Cart->quantity : $this_product->quantity;\n $produ = null;\n $produ = [\n 'recipt_id' => $Recipt->id,\n 'quantity' => $required_quantity ,\n 'product_name_en' => $this_product->name_en ,\n 'product_name_ar' => $this_product->name_ar,\n 'product_id' => $this_product->id ,\n 'cheese_type' => $Cart->cheese_type,\n 'cheese_weight' => $Cart->cheese_weight,\n 'bundle_products_ids' => $this_product->bundle_products_ids,\n 'single_price' => $this_product->price,\n 'total_price' => $this_product->price * $Cart->quantity\n ];\n array_push($ReciptProducts, $produ);\n\n //---decrease the quantity from the product---\n $this_product->update([\n 'quantity' => $this_product->quantity - $required_quantity\n ]);\n }//End if\n }//End foreach\n ReciptProducts::insert($ReciptProducts);\n ShoppingCart::where( 'member_id',$Recipt->member_id )->delete();\n if($discount)\n {\n $myPromo = MemberPromo::where( 'member_id',$Recipt->member_id )->where('is_used',0)->first();\n $myPromo->update([\n 'is_used' => 1,\n 'used_date' => \\Carbon\\Carbon::now()\n ]);\n }\n\n $member = \\App\\Member::find($Recipt->member_id);\n\n $member->update([\n // 'reward_points' => ( $member->reward_points + ceil($Recipt->total_price / 20) ) - $Recipt->points_deduction_price\n 'reward_points' => $member->reward_points - $Recipt->points_deduction_price\n ]);\n\n if($Recipt->payment_method == 'creadit_card')\n {\n $Recipt->update([\n 'payment_method' => 'creadit_card' ,\n 'is_piad' => 1 ,\n ]);\n\n try {\n \\Mail::to($member->email)\n ->send(new \\App\\Mail\\ConfirmOrder($Recipt,$member));\n } catch (\\Exception $e) {\n\n }\n }\n else {\n try {\n \\Mail::to($member->email)\n ->send(new \\App\\Mail\\ConfirmOrder($Recipt,$member));\n }catch (\\Exception $e) {\n\n }\n }\n return response()->json([\n 'status' => 'success',\n 'status_message' => __('page.Thank you for purchasing from us'),\n ]);\n }",
"public function neworder() {\n\t\tparent::__construct();\n\t\tsession_start();\n\t\tif(isset($_SESSION['uid'])){\n\t\t\t$this->write('orders', array(NULL, $_SESSION['uid'], 1, \"PAID\"));\n\t\t} else {\n\t\t\t$this->write('orders', array(NULL, NULL, 1, \"PAID\"));\n\t\t}\n\t\t$this->orderid = $this->id;\n\t\t\n\t\t//Create new order table and insert cart data\n\t\t$create = $this->conn->prepare(\n\t\t\t'DROP TABLE IF EXISTS order'.$this->orderid.'; '\n\t\t\t.'CREATE TABLE order'.$this->orderid\n\t\t\t.'(itemid INT(7) ZEROFILL NOT NULL, itemname VARCHAR(256) NOT NULL, qnt INT(3) NOT NULL, itemprice DECIMAL(6,2) NOT NULL); '\n\t\t);\n\t\t$create->execute();\n\n\t\t$count = 0;\n\t\tforeach($_SESSION['cart'] as $item){\n\t\t\t//This is redundant but otherwise db insert skips first row - PDO or db class issue?\n\t\t\tif($count == 0){$this->write('order'.$this->orderid, array($item[\"item\"],$item[\"name\"],$item[\"qnt\"],$item[\"price\"]));};\n\t\t\t$count++;\n\t\t\t$this->write('order'.$this->orderid, array($item[\"item\"],$item[\"name\"],$item[\"qnt\"],$item[\"price\"]));\n\t\t}\n\t}",
"public function addToCart(Request $request){\n\t\t\n\t\t$customers_id \t\t\t\t= $request->customers_id;\n\t\t$products_id \t\t\t\t= $request->products_id;\n\t\t$customers_basket_quantity \t= $request->customers_basket_quantity;\n\t\t$final_price \t\t\t\t= $request->final_price;\n\t\t$customers_basket_date_added = date('Y-m-d H:i:s');\n\t\t\n\t\tDB::table('customers_basket')->insert(\n\t\t[\n\t\t\t 'customers_id' => $customers_id,\n\t\t\t 'products_id' => $products_id,\n\t\t\t 'customers_basket_quantity' => $customers_basket_quantity,\n\t\t\t 'final_price' => $final_price,\n\t\t\t 'customers_basket_date_added' => $customers_basket_date_added,\n\t\t]);\n\t\t\n\t\tif(!empty($request->attribute)){\n\t\t\tforeach($request->attribute as $attribute){\n\t\t\t\t//print_r($attribute['products_options_id']);\t\n\t\t\t\tDB::table('customers_basket_attributes')->insert(\n\t\t\t\t[\n\t\t\t\t\t 'customers_id' => $customers_id,\n\t\t\t\t\t 'products_id' => $products_id,\n\t\t\t\t\t 'products_options_id' =>$attribute['products_options_id'],\n\t\t\t\t\t 'products_options_values_id' => $attribute['products_options_values_id']\n\t\t\t\t]);\n\t\t\t}\n\t\t}\n\t\t\n\t\t$responseData = array('success'=>'1', 'data'=>array(), 'message'=>\"Cart item added.\");\n\t\t$cartResponse = json_encode($responseData);\n\t\tprint $cartResponse;\n\t}",
"public function store(Request $request, $id)\n {\n $produk = produk::where('id', $id)->first();\n if($request->qty > $produk->stok)\n {\n return redirect('detail/'.$id)->with('status', 'The order exceeds the existing stock limit');\n }\n\n $subtotal = $produk->harga * $request->qty;\n $cek_cart = Cart::where('id_produk', Session::get('id_produk'))->first();\n if(empty($cek_cart)){\n\n $itemcart = Cart::create($request->all());\n $itemcart-> id_user = $request->id_user;\n $itemcart-> id_produk = $request->id_produk;\n $itemcart-> qty = $request->qty;\n $itemcart->save();\n } else {\n \n }\n\n\n\n return redirect('/cart')->with('status', 'Successfully create a new product!');\n\n }",
"function execute() {\n\t\t$guest = false;\n\t\t$this->defineProperties();\n\t\tif (!df_checkout_h()->canOnepageCheckout()) {\n\t\t\techo json_encode(['error' => 0, 'msg' => '', 'redirect' => $this->_url->getUrl('quotation/quote')]);\n\t\t\texit;\n\t\t}\n\t\t// Validate checkout\n\t\t$quote = $this->getOnepage()->getQuote();\n\t\tif (!$quote->hasItems() || $quote->getHasError() || !$quote->validateMinimumAmount()) {\n\t\t\techo json_encode(['error' => 0, 'msg' => '', 'redirect' => $this->_url->getUrl('quotation/quote')]);\n\t\t\texit;\n\t\t}\n\t\t$isLoggedIn = $this->_customerSession->isLoggedIn();\n\t\tif (!$isLoggedIn) {\n\t\t\tif (isset($_POST['register_new_account'])) {\n\t\t\t\t$isGuest = $this->getRequest()->getPost('register_new_account');\n\t\t\t\tif ($isGuest == '1' || $this->_dataHelper->haveProductDownloadable()) {\n\t\t\t\t\t// If checkbox register_new_account checked or exist downloadable product, create new account\n\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('register');\n\t\t\t\t\t$storeManager = $this->_objectManager->get('Magento\\Store\\Model\\StoreManagerInterface');\n\t\t\t\t\t// Preparing data for new customer\n\t\t\t\t\t$customer = $this->_objectManager->get('Magento\\Customer\\Model\\CustomerFactory')->create();\n\t\t\t\t\t$customer->setWebsiteId($storeManager->getWebsite()->getId())\n\t\t\t\t\t\t->setEmail(isset($_POST['billing']['email']) ? $_POST['billing']['email'] : '')\n\t\t\t\t\t\t->setPrefix(isset($_POST['billing']['prefix']) ? $_POST['billing']['prefix'] : '')\n\t\t\t\t\t\t->setFirstname(isset($_POST['billing']['firstname']) ? $_POST['billing']['firstname'] : '')\n\t\t\t\t\t\t->setLastname(isset($_POST['billing']['lastname']) ? $_POST['billing']['lastname'] : '')\n\t\t\t\t\t\t->setMiddlename(isset($_POST['billing']['middlename']) ? $_POST['billing']['middlename'] : '')\n\t\t\t\t\t\t->setSuffix(isset($_POST['billing']['suffix']) ? $_POST['billing']['suffix'] : '')\n\t\t\t\t\t\t->setDob(isset($_POST['dob']) ? $_POST['dob'] : '')\n\t\t\t\t\t\t->setTaxvat(isset($_POST['billing']['taxvat']) ? $_POST['billing']['taxvat'] : '')\n\t\t\t\t\t\t->setGender(isset($_POST['billing']['gender']) ? $_POST['billing']['gender'] : '')\n\t\t\t\t\t\t->setPassword(isset($_POST['billing']['customer_password']) ? $_POST['billing']['customer_password'] : '');\n\t\t\t\t\t// Set customer information to quote\n\t\t\t\t\t$quote->setCustomer($customer->getDataModel())->setPasswordHash($customer->getPasswordHash());\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('guest');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse {\n\t\t\t\t// Fix for persistent\n\t\t\t\tif (\n\t\t\t\t\t$this->getCheckout()->getPersistentRegister() && $this->getCheckout()->getPersistentRegister() == \"register\"\n\t\t\t\t) {\n\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('register');\n\t\t\t\t}\n\t\t\t\telse {\n\t\t\t\t\tif (!$this->_dataHelper->getStoreConfig('onestepcheckout/general/allowguestcheckout')\n\t\t\t\t\t\t|| !$this->_dataHelper->getStoreConfig('checkout/options/guest_checkout')\n\t\t\t\t\t\t|| $this->_dataHelper->haveProductDownloadable()\n\t\t\t\t\t) {\n\t\t\t\t\t\t$storeManager = $this->_objectManager->get('Magento\\Store\\Model\\StoreManagerInterface');\n\t\t\t\t\t\t// Preparing data for new customer\n\t\t\t\t\t\t$customer = $this->_objectManager->get(\n\t\t\t\t\t\t\t'Magento\\Customer\\Model\\CustomerFactory'\n\t\t\t\t\t\t)->create();\n\t\t\t\t\t\t$guest = false;\n\t\t\t\t\t\t$email = isset($_POST['billing']['email']) ? $_POST['billing']['email'] : '';\n\t\t\t\t\t\tif ($email) {\n\t\t\t\t\t\t\t$customer1 = $this->_objectManager->get(\n\t\t\t\t\t\t\t\t'Magento\\Customer\\Model\\CustomerFactory'\n\t\t\t\t\t\t\t)->create();\n\t\t\t\t\t\t\t$customer1->loadByEmail($email);\n\t\t\t\t\t\t\tif ($customer1->getId()) {\n\t\t\t\t\t\t\t\t$customer->setEntityId($customer1->getEntityId());\n\t\t\t\t\t\t\t\tif (!$customer1->getPasswordHash()) {\n\t\t\t\t\t\t\t\t\t$customer->setEntityId($customer1->getEntityId());\n\t\t\t\t\t\t\t\t\t$this->_customerSession->setCustomerId($customer1->getEntityId());\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t\t\t$password = isset($_POST['billing']['customer_password']) ? $_POST['billing']['customer_password'] : '';\n\t\t\t\t\t\t\t\t\t$accountManagement = $this->_objectManager->get('Magento\\Customer\\Api\\AccountManagementInterface');\n\t\t\t\t\t\t\t\t\t$accountManagement->authenticate($email, $password);\n\t\t\t\t\t\t\t\t\t$guest = true;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (!$guest) {\n\t\t\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('register');\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse {\n\t\t\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('guest');\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$customer->setWebsiteId($storeManager->getWebsite()->getId())\n\t\t\t\t\t\t\t->setEmail(isset($_POST['billing']['email']) ? $_POST['billing']['email'] : '')\n\t\t\t\t\t\t\t->setPrefix(isset($_POST['billing']['prefix']) ? $_POST['billing']['prefix'] : '')\n\t\t\t\t\t\t\t->setFirstname(isset($_POST['billing']['firstname']) ? $_POST['billing']['firstname'] : '')\n\t\t\t\t\t\t\t->setLastname(isset($_POST['billing']['lastname']) ? $_POST['billing']['lastname'] : '')\n\t\t\t\t\t\t\t->setMiddlename(isset($_POST['billing']['middlename']) ? $_POST['billing']['middlename'] : '')\n\t\t\t\t\t\t\t->setSuffix(isset($_POST['billing']['suffix']) ? $_POST['billing']['suffix'] : '')\n\t\t\t\t\t\t\t->setDob(isset($_POST['dob']) ? $_POST['dob'] : '')\n\t\t\t\t\t\t\t->setTaxvat(isset($_POST['billing']['taxvat']) ? $_POST['billing']['taxvat'] : '')\n\t\t\t\t\t\t\t->setGender(isset($_POST['billing']['gender']) ? $_POST['billing']['gender'] : '')\n# 2021-05-26 Dmitry Fedyuk https://www.upwork.com/fl/mage2pro\n# @todo \"«empty password in vendor/magento/framework/Encryption/Encryptor.php on line 591»\n# on a quotecheckout/index/updateordermethod request\": https://github.com/canadasatellite-ca/site/issues/127\n\t\t\t\t\t\t\t->setPassword(isset($_POST['billing']['customer_password']) ? $_POST['billing']['customer_password'] : '');\n\t\t\t\t\t\t// Set customer information to quote\n\t\t\t\t\t\t$quote->setCustomer($customer->getDataModel())->setPasswordHash($customer->getPasswordHash());\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\t$this->getOnepage()->saveCheckoutMethod('guest');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t// Save billing address\n\t\tif ($this->getRequest()->isPost()) {\n\t\t\t$billingData = $this->_dataHelper->filterdata(\n\t\t\t\t$this->getRequest()->getPost('billing', []),\n\t\t\t\tfalse\n\t\t\t);\n\t\t\tif ($isLoggedIn) {\n\t\t\t\t$this->saveAddress('billing', $billingData);\n\t\t\t}\n\t\t\t$customerAddressId = $this->getRequest()->getPost('billing_address_id', false);\n\t\t\tif ($this->getRequest()->getPost('billing_address_id') != \"\"\n\t\t\t\t&& (!isset($billingData['save_in_address_book'])\n\t\t\t\t\t|| (isset($billingData['save_in_address_book']) && $billingData['save_in_address_book']) == 0)\n\t\t\t) {\n\t\t\t\t$customerAddressId = \"\";\n\t\t\t}\n\t\t\tif ($isLoggedIn\n\t\t\t\t&& (isset($billingData['save_in_address_book']) && $billingData['save_in_address_book'] == 1)\n\t\t\t\t&& !$this->_dataHelper->getStoreConfig('onestepcheckout/addfield/addressbook')\n\t\t\t) {\n\t\t\t\t$customerAddressId = $this->getDefaultAddress('billing');\n\t\t\t}\n\t\t\tif (isset($billingData['email'])) {\n\t\t\t\t$billingData['email'] = trim($billingData['email']);\n\t\t\t\tif ($this->_dataHelper->isSubscriberByEmail($billingData['email'])) {\n\t\t\t\t\tif ($this->getRequest()->getParam('subscribe_newsletter') == '1') {\n\t\t\t\t\t\tif ($isLoggedIn) {\n\t\t\t\t\t\t\t$customer = $this->_customerSession->getCustomer();\n\t\t\t\t\t\t\t$this->_objectManager->get(\n\t\t\t\t\t\t\t\t'Magento\\Newsletter\\Model\\SubscriberFactory'\n\t\t\t\t\t\t\t)->create()->subscribeCustomerById($customer->getId());\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->saveSubscriber($billingData['email']);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$address = $this->_objectManager->get('Magento\\Quote\\Model\\Quote\\Address');\n\t\t\tif ($customerAddressId) {\n\t\t\t\t$addressData = $this->_objectManager->get('Magento\\Customer\\Api\\AddressRepositoryInterface')\n\t\t\t\t\t->getById($customerAddressId)\n\t\t\t\t\t->__toArray();\n\t\t\t\t$billingData = array_merge($billingData, $addressData);\n\t\t\t}\n\t\t\t$address->setData($billingData);\n\t\t\t$this->getOnepage()->getQuote()->setBillingAddress($address);\n\t\t\tif (isset($billingData['save_into_account'])\n\t\t\t\t&& intval($billingData['save_into_account']) == 1\n\t\t\t\t&& $isLoggedIn\n\t\t\t) {\n\t\t\t\t$this->setAccountInfoSession($billingData);\n\t\t\t}\n\t\t}\n\t\t// Save shipping address\n\t\t$isclick = $this->getRequest()->getPost('ship_to_same_address');\n\t\t$ship = \"billing\";\n\t\tif ($isclick != '1') {\n\t\t\t$ship = \"shipping\";\n\t\t}\n\t\tif ($this->getRequest()->getPost()) {\n\t\t\t$shippingData = $this->_dataHelper->filterdata($this->getRequest()->getPost($ship, []), false);\n\t\t\tif ($isLoggedIn && !$isclick) {\n\t\t\t\t$this->saveAddress('shipping', $shippingData);\n\t\t\t}\n\t\t\tif ($isclick == '1') {\n\t\t\t\t$shippingData['same_as_billing'] = 1;\n\t\t\t}\n\t\t\t// Change address if user change infomation\n\t\t\t// Reassign customeraddressid and save to shipping\n\t\t\t$customeraddressid = $this->getRequest()->getPost($ship . '_address_id', false);\n\t\t\t// If user chage shipping, billing infomation but not save to database\n\t\t\tif ($isclick || ($this->getRequest()->getPost('shipping_address_id') != \"\"\n\t\t\t\t\t&& (!isset($shippingData['save_in_address_book']) || (isset($shippingData['save_in_address_book']) && $shippingData['save_in_address_book'] == 0)))\n\t\t\t) {\n\t\t\t\t$customeraddressid = \"\";\n\t\t\t}\n\t\t\tif (!$isclick && $isLoggedIn\n\t\t\t\t&& (isset($shippingData['save_in_address_book']) && $shippingData['save_in_address_book'] == 1)\n\t\t\t\t&& !$this->_dataHelper->getStoreConfig('onestepcheckout/addfield/addressbook')\n\t\t\t) {\n\t\t\t\t$customeraddressid = $this->getDefaultAddress('shipping');\n\t\t\t}\n\t\t\t$this->getOnepage()->saveShipping($shippingData, $customeraddressid);\n\t\t}\n\t\tif ($customer_note = $this->getRequest()->getPost('onestepcheckout_comments')) {\n\t\t\t$quote->setCustomerNote($customer_note);\n\t\t}\n\t\tif ($this->getRequest()->isPost()) {\n\t\t\t$shippingMethodData = $this->getRequest()->getPost('shipping_method', '');\n\t\t\t$resultSaveShippingMethod = $this->getOnepage()->saveShippingMethod($shippingMethodData);\n\t\t\tif (!$resultSaveShippingMethod) {\n\t\t\t\t$eventManager = $this->_objectManager->get('Magento\\Framework\\Event\\ManagerInterface');\n\t\t\t\t$eventManager->dispatch('checkout_controller_onepage_save_shipping_method', [\n\t\t\t\t\t'request' => $this->getRequest(),\n\t\t\t\t\t'quote' => $this->getOnepage()->getQuote()\n\t\t\t\t]);\n\t\t\t}\n\t\t\t$this->getOnepage()->getQuote()->collectTotals();\n\t\t}\n\t\t$result = new \\Magento\\Framework\\DataObject();\n\t\ttry {\n\t\t\tif (!$quote->getCustomerId() && !$guest) {\n\t\t\t\tdf_quote_customer_m()->populateCustomerInfo($quote);\n\t\t\t}\n\t\t\t$quote->setIsActive(false);\n\t\t\t$cQuote = df_new_om(CQuote::class); /** @var CQuote $cQuote */\n\t\t\t$quotation = $cQuote->create($quote)->load($quote->getId());\n\t\t\t$cHelper = df_o(CHelper::class); /** @var CHelper $cHelper */\n\t\t\t$isAutoProposalEnabled = $cHelper->isAutoConfirmProposalEnabled();\n\t\t\t$qtyBreak = false;\n\t\t\t$price = true;\n\t\t\t$totalItems = 0;\n\t\t\tforeach ($quote->getAllItems() as $item) {\n\t\t\t\tif (!$item->getParentItemId()) {\n\t\t\t\t\t$totalItems++;\n\t\t\t\t\tif ($item->getQty() > 1) {\n\t\t\t\t\t\t$qtyBreak = true;\n\t\t\t\t\t}\n\t\t\t\t\tif ($item->getProduct()->getFinalPrice() == 0 || $item->getProduct()->getPrice() == 0) {\n\t\t\t\t\t\t$price = false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($quote->getCustomerNote() || $qtyBreak || !$price || $totalItems > 1) {\n\t\t\t\t$isAutoProposalEnabled = false;\n\t\t\t}\n\t\t\tif ($isAutoProposalEnabled) {\n\t\t\t\t$quotation->setProposalSent((new \\DateTime())->getTimestamp());\n\t\t\t\t$quotation->setState(\\Cart2Quote\\Quotation\\Model\\Quote\\Status::STATE_PENDING)\n\t\t\t\t\t->setStatus(\\Cart2Quote\\Quotation\\Model\\Quote\\Status::STATUS_AUTO_PROPOSAL_SENT);\n\t\t\t\t$qProposalSender = df_o(QuoteProposalSender::class); /** @var QuoteProposalSender $qProposalSender */\n\t\t\t\t$qProposalSender->send($quotation);\n\t\t\t\t$quotation->save();\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$qRequestSender = df_o(QuoteRequestSender::class); /** @var QuoteRequestSender $qRequestSender */\n\t\t\t\t$qRequestSender->send($quotation, false);\n\t\t\t}\n\t\t\tif (true || $this->getRequest()->getParam('clear_quote', false)) {\n\t\t\t\t$qs = df_o(CSession::class); /** @var CSession $qs */\n\t\t\t\t$qs->fullSessionClear();\n\t\t\t\t$qs->updateLastQuote($quotation);\n\t\t\t}\n\t\t\t$redirectUrl = $this->getOnepage()->getCheckout()->getRedirectUrl();\n\t\t\t$result->setData('success', true);\n\t\t\t$result->setData('error', false);\n\t\t}\n\t\tcatch (\\Exception $e) {\n\t\t\t$data = ['error' => 1, 'msg' => $e->getMessage(),];\n\t\t\t$reloadcheckoutpage = $quote->getData('reloadcheckoutpage');\n\t\t\tif ($reloadcheckoutpage) {\n\t\t\t\t$data['redirect'] = $this->_url->getUrl('checkout');\n\t\t\t}\n\t\t\techo json_encode($data);\n\t\t\texit;\n\t\t}\n\t\tif (isset($redirectUrl)) {\n\t\t\t$result->setData('redirect', $redirectUrl);\n\t\t}\n\t\t$this->_eventManager->dispatch('checkout_controller_onepage_saveOrder', ['result' => $result, 'action' => $this]);\n\t\tif (isset($redirectUrl)) {\n\t\t\techo json_encode([\n\t\t\t\t'error' => 0,\n\t\t\t\t'msg' => '',\n\t\t\t\t'redirect' => $redirectUrl\n\t\t\t]);\n\t\t\texit;\n\t\t}\n\t\techo json_encode([\n\t\t\t'error' => 0,\n\t\t\t'msg' => '',\n\t\t\t'redirect' => $this->_url->getUrl('quotation/quote/success', array('id' => $quote->getId()))\n\t\t]);\n\t\texit;\n\t\treturn;\n\t}",
"public function customcheckout($userid,$email,$name,$street,$city,$country_id,$postcode,$telephone,$shipping,$payment,$quoteId)\n\t {\n\t\t/* $parts = explode(\" \", $name);\n\t\t $lastname = array_pop($parts);\n\t\tif($lastname=='')\n\t\t{\n\t\t\t$lastname='@';\n\t\t}\n $firstname = implode(\" \", $parts);\n\t\tif($firstname=='')\n\t\t{\n\t\t\t$firstname='@';\n\t\t} */\n\t\t\n\t\tif(strpos($name, ' ') > 0)\n\t\t{\n\t\t\t$parts = explode(\" \", $name);\n\t\t $lastname = array_pop($parts);\n\t\t $firstname = implode(\" \", $parts);\n\t\t\n\t\t}\n else\n {\n\t\t $lastname = $name;\n\t\t $firstname = $name;\n\t}\n\t\t\n\t\t//exit;\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t $orderData=[\n\t\t\t\t 'currency_id' => 'USD',\n\t\t\t\t 'email' => $email, //buyer email id\n\t\t\t\t 'shipping_address' =>[\n\t\t\t\t\t\t'firstname' => $firstname, //address Details\n\t\t\t\t\t\t'lastname' => $lastname,\n\t\t\t\t\t\t\t\t'street' => $street,\n\t\t\t\t\t\t\t\t'city' => $city,\n\t\t\t\t\t\t//'country_id' => 'IN',\n\t\t\t\t\t\t'country_id' => $country_id,\n\t\t\t\t\t\t'region' => '',\n\t\t\t\t\t\t'postcode' => $postcode,\n\t\t\t\t\t\t'telephone' => $telephone,\n\t\t\t\t\t\t'fax' => '',\n\t\t\t\t\t\t'save_in_address_book' => 1\n\t\t\t\t\t\t\t ],\n\t\t\t 'items'=> [ //array of product which order you want to create\n\t\t\t\t\t\t ['product_id'=>'5','qty'=>1,'price'=>'50'],\n\t\t\t\t\t\t ['product_id'=>'6','qty'=>2,'price'=>'100']\n\t\t\t\t\t\t] \n\t\t\t\t\t\t\n\t\t\t];\n\n /*for sote 4 */\t\t\t\n\t\t /* $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance(); // Instance of object manager\n\t $helper = $objectManager->get('Webkul\\Marketplace\\Helper\\Data');\n\t\t $helper->setCurrentStore(4); */\n\t\t /* end for sote 4 */\n\t\t\n\t\t\n\t\t$store=$this->storeManager->getStore();\n $websiteId = $this->storeManager->getStore()->getWebsiteId();\n $customer=$this->customerFactory->create();\n $customer->setWebsiteId($websiteId);\n //$customer->loadByEmail($orderData['email']);// load customet by email address\n\t\t$customer->load($userid);\n\t\t $customer->getId();\n\t\t $customer->getEntityId();\n /* if(!$customer->getEntityId()){\n //If not avilable then create this customer \n $customer->setWebsiteId($websiteId)\n ->setStore($store)\n ->setFirstname($orderData['shipping_address']['firstname'])\n ->setLastname($orderData['shipping_address']['lastname'])\n ->setEmail($orderData['email']) \n ->setPassword($orderData['email']);\n $customer->save();\n } */\n\t\t\t\n\t\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\n\t\t//$quote_sql_latest = \"Select * FROM quote where customer_id=$userid and store_id=4 and is_active=1 order by entity_id ASC limit 1\";\n\t\t$quote_sql_latest = \"Select * FROM quote where customer_id=$userid and store_id=1 and is_active=1 order by entity_id ASC limit 1\";\n\t \n\n\t\t$result_result_cart = $connection->fetchAll($quote_sql_latest);\n\t\t // print_r($result_result_cart); \n\t\t\n\t\t\n\t\t$quote_sql = \"Select * FROM quote where customer_id=$userid and store_id=1 and entity_id='$quoteId' and is_active=1\";\n\t\t//$quote_sql = \"Select * FROM quote where customer_id=$userid and store_id=4 and entity_id='$quoteId' and is_active=1\";\n\t\t\n\t\t\n\t\t$result_result = $connection->fetchAll($quote_sql);\t\n\t\tif(!empty($result_result))\n\t\t{\n\t\t\n\t\t\t $quoteId2=$result_result[0]['entity_id'];\n\t\t\t $quote = $this->quote->create()->load($quoteId2);\n\t\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n $checkoutSession =$objectManager->get('Magento\\Checkout\\Model\\Session');\n\t\t $checkoutSession->setQuoteId($quoteId2);\n\t\t \n\t\t \n\t\t //Set Address to quote\n $quote->getBillingAddress()->addData($orderData['shipping_address']);\n $quote->getShippingAddress()->addData($orderData['shipping_address']);\n \n // Collect Rates and Set Shipping & Payment Method\n \n $shippingAddress=$quote->getShippingAddress(); \n $shippingAddress->setCollectShippingRates(true)\n ->collectShippingRates()\n //->setShippingMethod('freeshipping_freeshipping'); //shipping method\n\t\t\t\t\t\t->setShippingMethod($shipping); //shipping method\n\t\t\t\t\t\t\n //$quote->setPaymentMethod('cashondelivery'); //payment method\n\t\t$quote->setPaymentMethod($payment);\n $quote->setInventoryProcessed(false); //not effetc inventory\n $quote->save(); //Now Save quote and your quote is ready\n \n // Set Sales Order Payment\n //$quote->getPayment()->importData(['method' => 'cashondelivery']);\n $quote->getPayment()->importData(['method' => $payment]);\n // Collect Totals & Save Quote\n $quote->collectTotals()->save();\n $quote->getId();\n // Create Order From Quote\n $order = $this->quoteManagement->submit($quote);\n \n $order->setEmailSent(0);\n\t //$order->setEmailSent(1);\n $increment_id = $order->getRealOrderId();\n\t $lastOrderId = $increment_id;\n\t\t\n\t\t$helper = $objectManager->get(\n 'Webkul\\Marketplace\\Helper\\Data'\n );\n\t\t\n\t\t$getProductSalesCalculation = $objectManager->get(\n 'Webkul\\Marketplace\\Observer\\SalesOrderPlaceAfterObserver'\n );\n $getProductSalesCalculation->getProductSalesCalculation($order);\n\n /*send placed order mail notification to seller*/\n\n $salesOrder = $objectManager->create(\n 'Webkul\\Marketplace\\Model\\ResourceModel\\Seller\\Collection'\n )->getTable('sales_order');\n $salesOrderItem = $objectManager->create(\n 'Webkul\\Marketplace\\Model\\ResourceModel\\Seller\\Collection'\n )->getTable('sales_order_item');\n\t\t\n\t\t\n\t\t\n\t\t $paymentCode = '';\n if ($order->getPayment()) {\n $paymentCode = $order->getPayment()->getMethod();\n }\n\n $shippingInfo = '';\n $shippingDes = '';\n\n $billingId = $order->getBillingAddress()->getId();\n\n $billaddress = $objectManager->create(\n 'Magento\\Sales\\Model\\Order\\Address'\n )->load($billingId);\n $billinginfo = $billaddress['firstname'].'<br/>'.\n $billaddress['street'].'<br/>'.\n $billaddress['city'].' '.\n $billaddress['region'].' '.\n $billaddress['postcode'].'<br/>'.\n $objectManager->create(\n 'Magento\\Directory\\Model\\Country'\n )->load($billaddress['country_id'])->getName().'<br/>T:'.\n $billaddress['telephone'];\n\n $payment = $order->getPayment()->getMethodInstance()->getTitle();\n\n\t\t\n\t\t\n\t\t if ($order->getShippingAddress()) {\n $shippingId = $order->getShippingAddress()->getId();\n $address = $objectManager->create(\n 'Magento\\Sales\\Model\\Order\\Address'\n )->load($shippingId);\n $shippingInfo = $address['firstname'].'<br/>'.\n $address['street'].'<br/>'.\n $address['city'].' '.\n $address['region'].' '.\n $address['postcode'].'<br/>'.\n $objectManager->create(\n 'Magento\\Directory\\Model\\Country'\n )->load($address['country_id'])->getName().'<br/>T:'.\n $address['telephone'];\n $shippingDes = $order->getShippingDescription();\n }\n\t\t\n\t\t\n\t\t$adminStoremail = $helper->getAdminEmailId();\n $adminEmail = $adminStoremail ? $adminStoremail : $helper->getDefaultTransEmailId();\n $adminUsername = 'Admin';\n\n $customerModel = $objectManager->create(\n 'Magento\\Customer\\Model\\Customer'\n );\n\n $sellerOrder = $objectManager->create(\n 'Webkul\\Marketplace\\Model\\Orders'\n )\n ->getCollection()\n ->addFieldToFilter('order_id', $lastOrderId)\n ->addFieldToFilter('seller_id', ['neq' => 0]);\n\t\t\n\t \n\t foreach ($sellerOrder as $info) {\n $userdata = $customerModel->load($info['seller_id']);\n $username = $userdata['firstname'];\n $useremail = $userdata['email'];\n\n $senderInfo = [];\n $receiverInfo = [];\n\n $receiverInfo = [\n 'name' => $username,\n 'email' => $useremail,\n ];\n $senderInfo = [\n 'name' => $adminUsername,\n 'email' => $adminEmail,\n ];\n $totalprice = '';\n $totalTaxAmount = 0;\n $codCharges = 0;\n $shippingCharges = 0;\n $orderinfo = '';\n\n $saleslistIds = [];\n $collection1 = $objectManager->create(\n 'Webkul\\Marketplace\\Model\\Saleslist'\n )->getCollection()\n ->addFieldToFilter('order_id', $lastOrderId)\n ->addFieldToFilter('seller_id', $info['seller_id'])\n ->addFieldToFilter('parent_item_id', ['null' => 'true'])\n ->addFieldToFilter('magerealorder_id', ['neq' => 0])\n ->addFieldToSelect('entity_id');\n\n $saleslistIds = $collection1->getData();\n\n $fetchsale = $objectManager->create(\n 'Webkul\\Marketplace\\Model\\Saleslist'\n )\n ->getCollection()\n ->addFieldToFilter(\n 'entity_id', \n ['in' => $saleslistIds]\n );\n $fetchsale->getSelect()->join(\n $salesOrder.' as so', \n 'main_table.order_id = so.entity_id', \n ['status' => 'status']\n );\n\n $fetchsale->getSelect()->join(\n $salesOrderItem.' as soi', \n 'main_table.order_item_id = soi.item_id AND main_table.order_id = soi.order_id', \n [\n 'item_id' => 'item_id', \n 'qty_canceled' => 'qty_canceled', \n 'qty_invoiced' => 'qty_invoiced', \n 'qty_ordered' => 'qty_ordered', \n 'qty_refunded' => 'qty_refunded', \n 'qty_shipped' => 'qty_shipped', \n 'product_options' => 'product_options', \n 'mage_parent_item_id' => 'parent_item_id'\n ]\n );\n foreach ($fetchsale as $res) {\n $product = $objectManager->create(\n 'Magento\\Catalog\\Model\\Product'\n )->load($res['mageproduct_id']);\n\n /* product name */\n $productName = $res->getMageproName();\n $result = [];\n if ($options = unserialize($res->getProductOptions())) {\n if (isset($options['options'])) {\n $result = array_merge($result, $options['options']);\n }\n if (isset($options['additional_options'])) {\n $result = array_merge($result, $options['additional_options']);\n }\n if (isset($options['attributes_info'])) {\n $result = array_merge($result, $options['attributes_info']);\n }\n }\n if ($_options = $result) {\n $proOptionData = '<dl class=\"item-options\">';\n foreach ($_options as $_option) {\n $proOptionData .= '<dt>'.$_option['label'].'</dt>';\n\n $proOptionData .= '<dd>'.$_option['value'];\n $proOptionData .= '</dd>';\n }\n $proOptionData .= '</dl>';\n $productName = $productName.'<br/>'.$proOptionData;\n } else {\n $productName = $productName.'<br/>';\n }\n /* end */\n\n $sku = $product->getSku();\n $orderinfo = $orderinfo.\"<tbody><tr>\n <td class='item-info'>\".$productName.\"</td>\n <td class='item-info'>\".$sku.\"</td>\n <td class='item-qty'>\".($res['magequantity'] * 1).\"</td>\n <td class='item-price'>\".\n $order->formatPrice(\n $res['magepro_price'] * $res['magequantity']\n ).\n '</td>\n </tr></tbody>';\n $totalTaxAmount = $totalTaxAmount + $res['total_tax'];\n $totalprice = $totalprice + ($res['magepro_price'] * $res['magequantity']);\n\n /*\n * Low Stock Notification mail to seller\n */\n if ($helper->getlowStockNotification()) {\n $stockItemQty = $product['quantity_and_stock_status']['qty'];\n if ($stockItemQty <= $helper->getlowStockQty()) {\n $orderProductInfo = \"<tbody><tr>\n <td class='item-info'>\".$productName.\"</td>\n <td class='item-info'>\".$sku.\"</td>\n <td class='item-qty'>\".($res['magequantity'] * 1).'</td>\n </tr></tbody>';\n\n $emailTemplateVariables = [];\n $emailTempVariables['myvar1'] = $orderProductInfo;\n $emailTempVariables['myvar2'] = $username;\n\n $this->_objectManager->get(\n 'Webkul\\Marketplace\\Helper\\Email'\n )->sendLowStockNotificationMail(\n $emailTemplateVariables,\n $senderInfo,\n $receiverInfo\n );\n }\n }\n }\n $shippingCharges = $info->getShippingCharges();\n $totalCod = 0;\n\n if ($paymentCode == 'mpcashondelivery') {\n $totalCod = $info->getCodCharges();\n $codRow = \"<tr class='subtotal'>\n <th colspan='3'>\".__('Cash On Delivery Charges').\"</th>\n <td colspan='3'><span>\".\n $order->formatPrice($totalCod).\n '</span></td>\n </tr>';\n } else {\n $codRow = '';\n }\n\n $orderinfo = $orderinfo.\"<tfoot class='order-totals'>\n <tr class='subtotal'>\n <th colspan='3'>\".__('Shipping & Handling Charges').\"</th>\n <td colspan='3'><span>\".\n $order->formatPrice($shippingCharges).\"</span></td>\n </tr>\n <tr class='subtotal'>\n <th colspan='3'>\".__('Tax Amount').\"</th>\n <td colspan='3'><span>\".\n $order->formatPrice($totalTaxAmount).'</span></td>\n </tr>'.$codRow.\"\n <tr class='subtotal'>\n <th colspan='3'>\".__('Grandtotal').\"</th>\n <td colspan='3'><span>\".\n $order->formatPrice(\n $totalprice + \n $totalTaxAmount + \n $shippingCharges + \n $totalCod\n ).'</span></td>\n </tr></tfoot>';\n\n $emailTemplateVariables = [];\n if ($shippingInfo != '') {\n $isNotVirtual = 1;\n } else {\n $isNotVirtual = 0;\n }\n $emailTempVariables['myvar1'] = $order->getRealOrderId();\n $emailTempVariables['myvar2'] = $order['created_at'];\n $emailTempVariables['myvar4'] = $billinginfo;\n $emailTempVariables['myvar5'] = $payment;\n $emailTempVariables['myvar6'] = $shippingInfo;\n $emailTempVariables['isNotVirtual'] = $isNotVirtual;\n $emailTempVariables['myvar9'] = $shippingDes;\n $emailTempVariables['myvar8'] = $orderinfo;\n $emailTempVariables['myvar3'] = $username;\n\n $objectManager->get(\n 'Webkul\\Marketplace\\Helper\\Email'\n )->sendPlacedOrderEmail(\n $emailTempVariables,\n $senderInfo,\n $receiverInfo\n );\n }\n\t \n\t \n if($order->getEntityId())\n\t\t {\n // $result['order_id']= $order->getRealOrderId();\n\t\t \n\t\t \n/* \t\t $quote_sql = \"Select * FROM quote where customer_id=$userid and store_id=1 and is_active=1 order by entity_id ASC limit 1\";\n\t $result_result = $connection->fetchAll($quote_sql);\n\t\t print_r($result_result); */\n\t\t\t\tif(!empty($result_result_cart))\n\t\t\t\t{\n\t\t\t\t\t $quoteId3=$result_result_cart[0]['entity_id'];\n\t\t\t\t\t\t \n\t\t\t\t\t\t if($quoteId3==$quoteId)\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t $quote_sql3 = \"Select * FROM quote where customer_id=$userid and store_id=1 and is_active=1 and entity_id !=$quoteId3\";\n\t\t\t\t\t\t\t\t $result_result3 = $connection->fetchAll($quote_sql3);\n\t\t\t\t\t\t\t\t if(!empty($result_result3))\n\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t foreach ($result_result3 as $qt)\n\t\t\t\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t\t\t$qtid=$qt['entity_id'];\n\t\t\t\t\t\t\t\t\t\t $quote_sql = \"delete FROM quote where entity_id=$qtid \";\n\t\t\t\t\t\t\t\t\t\t $connection->rawQuery($quote_sql); \n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t $result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"success\"),'order_id'=> $order->getRealOrderId());\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t }\n\t\t\t\t\t\t else\n\t\t\t\t\t\t {\n\t\t\t\t\t\t\t\t\t$quote_sql2 = \"Select * FROM quote_item where quote_id=$quoteId limit 1\";\n\t\t\t\t\t\t\t\t $result_result2 = $connection->fetchAll($quote_sql2);\n\t\t\t\t\t\t\t\t\t//print_r($result_result2);\n\t\t\t\t\t\t\t\t\tif(!empty($result_result2))\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\t\t$checkoutSession =$objectManager->get('Magento\\Checkout\\Model\\Session');\n\t\t\t\t\t\t\t\t\t$checkoutSession->setQuoteId($quoteId3);\n\t\t\t\t\t\t\t\t\t \n\t\t\t\t\t\t\t\t\t\t$quote_item_id=$result_result2[0]['item_id'];\n\t\t\t\t\t\t\t\t\t\t$quote_item_productid=$result_result2[0]['product_id'];\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$quote_sql24 = \"Select * FROM quote_item where quote_id=$quoteId3 and product_id=$quote_item_productid\";\n\t\t\t\t\t\t\t\t $result_result24 = $connection->fetchAll($quote_sql24);\n\t\t\t\t\t\t\t\t\t\tif(!empty($result_result24))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$quote_item_id=$result_result24[0]['item_id'];\n\t\t\t\t\t\t\t\t\t\t\t$objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();//instance of object manager\n\t\t\t\t\t\t\t\t\t\t\t$itemModel = $objectManager->create('Magento\\Quote\\Model\\Quote\\Item');//Quote item mode\n\t\t\t\t\t\t\t\t\t\t\t$quoteItem=$itemModel->load($quote_item_id);//load particular item which you want to delete by his item id\n\t\t\t\t\t\t\t\t\t\t\t$quoteItem->delete();//deletes the item\n\t\t\t\t\t\t\t\t\t\t\t$this->cart->removeItem($quote_item_id);\n\t\t\t\t\t\t\t\t\t\t $this->cart->save();\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t$result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"success\"),'order_id'=> $order->getRealOrderId());\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\telse\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$result[]=array('status'=>array(\"code\"=>\"1\",\"message\"=>\"error\"));\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t }\n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t\t\t\t \n\t\t\t \n\t\t\t\t\n\t\t\t\t\n\t\t\t\t}\n\t\t \n\t\t \n\t\t \n\t\t \n\t\t\t\n\t\t\t\n\t\t\t\n }else{\n $result[]=array('status'=>array(\"code\"=>\"0\",\"message\"=>\"error\"));\n } \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t \n\t\t // $result[]=array('satus'=>'error');\n\t\t \n\t\t \n\t\t \n\t\t}\t\t\t\n\t\telse\n\t\t{\n\t\t\t$result[]=array('status'=>array(\"code\"=>\"0\",\"message\"=>\"error\"));\n\t\t}\t\t\t\n\t\t\n \t\t\t\n\t return $result; \n\t\n\t }",
"public function addItemToCart($account_id, $item_id, $quantity = false);",
"public function store(Request $request)\n {\n $this->validate(request(),[\n 'user_id'=>'required',\n 'product_id'=>'required',\n 'product_price'=>'required',\n 'seller_id'=>'required',\n ]);\n \n $orders = Order::where('user_id', Auth::user()->id)\n ->where('order_status_id', 1)->get();\n if(!count($orders)){\n $seller = User::find($request->seller_id);\n $order = new Order();\n $order->user_id = $request->user_id;\n $order->order_status_id = 1;\n $order->order_number = mt_rand();\n\n if( $order->save() ){\n $order_id = $order->id;\n }\n\n $seller->addCart()->attach($order_id);\n $orderitem = new OrderItem();\n $orderitem->order_id=$order_id;\n $orderitem->product_id = $request->product_id;\n $orderitem->product_price = $request->product_price;\n $orderitem->quantity = 1;\n $orderitem->save();\n return redirect('/buyers');\n }\n else{\n $order = Order::where('user_id', Auth::user()->id)\n ->where('order_status_id', 1)->first();\n $order_id = $order->id;\n\n $orderInCart = OrderUser::where('user_id',$request->seller_id)\n ->where('order_id',$order_id)->get();\n\n if( !count($orderInCart) ) {\n $seller = User::find($request->seller_id);\n $seller->addCart()->attach($order_id);\n }\n \n $orderitem = new OrderItem();\n $orderitem->order_id=$order_id;\n $orderitem->product_id = $request->product_id;\n $orderitem->product_price = $request->product_price;\n $orderitem->quantity = 1;\n $orderitem->save();\n return redirect('/buyers');\n }\n \n return back();\n }",
"public function getSessionItems() { global $smarty; \n if(isset($_SESSION['checkout']['items'])) { \n $smarty->assign(\"cart\", $_SESSION['checkout']['items']);\n }\n }",
"public function store(Request $request){\n //dd($request);\n //$cart[$request->item_id] = $request->quantity;\n //ways to create an array\n //$cart = array(values);\n //$cart = [value1, value2, etc];\n //$cart[key/index] = value;\n //What happens when an item is added to cart, it will assign the quantity\n // to index number equal to the item_id.\n //Session::put(\"cart\", $cart); // adds a session variable called cart with the content from $cart\n //dd(Session::get(\"cart\"));\n // This is only halfway done, why? Because the Session::put overwrites the original content. Fina a way to prevent it from overwriting. (Ie. revamp the entire logic)\n \n // Check if there is already a cart\n //1a. If there is no cart, create a new one\n //1b. If there is already a cart, call the cart and update the content.\n //2b. Save the updated cart in the session.\n\n $cart = []; //empty cart\n if(Session::exists(\"cart\")){ // if there is a cart in our session, pull it.\n $cart = Session::get(\"cart\");\n }\n $cart[$request->item_id]= $request->quantity;// update the cart\n Session::put(\"cart\", $cart); \n //dd(Session::get(\"cart\"));\n Session::flash(\"message\", $request->quantity . \"items added to cart\");\n // dd(Session::get(\"cart\"));\n // push it back to the session cart\n \n //Syntax: put into $cart into a session variable called \"cart\".\n \n return redirect(\"/products\"); //return to the catalog page.\n }",
"public function placeOrderAction() {\n\t\tif ($this->_checkPk ()) {\n\t\t\t$this->_redirect ( \"checkout/cart\" );\n\t\t\treturn $this;\n\t\t}\n\t\tif ($this->getRequest ()->isPost ()) {\n\t\t\t$post = $this->getRequest ()->getPost ();\n\t\t\tMage::getSingleton ( 'customer/session' )->setExprsFormData ( $post );\n\t\t\t\n\t\t\t$translate = Mage::getSingleton ( 'core/translate' );\n\t\t\t/* @var $translate Mage_Core_Model_Translate */\n\t\t\t$translate->setTranslateInline ( false );\n\t\t\ttry {\n\t\t\t\t$quote = $this->getQuote ();\n\t\t\t\t$postObject = new Varien_Object ();\n\t\t\t\t$postObject->setData ( $post );\n\t\t\t\t\n\t\t\t\t$error = false;\n\t\t\t\t\n\t\t\t\tif (! Zend_Validate::is ( trim ( $post ['longaccesstoken'] ), 'NotEmpty' )) {\n\t\t\t\t\t$error = true;\n\t\t\t\t}\n\t\t\t\tif (! Zend_Validate::is ( trim ( $post ['cards'] ), 'NotEmpty' )) {\n\t\t\t\t\t$error = true;\n\t\t\t\t}\n\t\t\t\tif (! $quote->getIsVirtual ()) {\n\t\t\t\t\t\n\t\t\t\t\tif (! Zend_Validate::is ( trim ( $post ['address'] ), 'NotEmpty' ) && ! $post ['shipping']) {\n\t\t\t\t\t\t$error = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif ($error) {\n\t\t\t\t\tthrow new Exception ();\n\t\t\t\t} else {\n\t\t\t\t\t$precheckoutData = Mage::helper ( 'masterpass' )->postExpressCheckoutData ( $post );\n\t\t\t\t\t$precheckoutData = json_decode ( json_encode ( ( array ) $precheckoutData ), 1 );\n\t\t\t\t\tif (empty ( $precheckoutData )) {\n\t\t\t\t\t\t\n\t\t\t\t\t\t// remove longaccesstoken\n\t\t\t\t\t\t// save long access token\n\t\t\t\t\t\t$customer = Mage::getSingleton ( 'customer/session' )->getCustomer ();\n\t\t\t\t\t\t$customerData = Mage::getModel ( 'customer/customer' )->load ( $customer->getId () );\n\t\t\t\t\t\t$longAccessToken = null;\n\t\t\t\t\t\t$customerData->setData ( 'longtoken', $longAccessToken );\n\t\t\t\t\t\t\n\t\t\t\t\t\t$customerData->save ();\n\t\t\t\t\t\tMage::getSingleton ( 'core/session' )->addError ( Mage::getStoreConfig ( 'masterpass/config/checkouterrormessage' ) );\n\t\t\t\t\t\t$this->_redirect ( 'checkout/cart' );\n\t\t\t\t\t\treturn $this;\n\t\t\t\t\t}\n\t\t\t\t\tif (! empty ( $precheckoutData ['Checkout'] )) {\n\t\t\t\t\t\t$this->savePrecheckoutData ( $precheckoutData );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$customer = Mage::getSingleton ( 'customer/session' )->getCustomer ();\n\t\t\t\t\t\t$customerData = Mage::getModel ( 'customer/customer' )->load ( $customer->getId () );\n\t\t\t\t\t\t$customerData->save ();\n\t\t\t\t\t\t\n\t\t\t\t\t\tif (isset ( $precheckoutData ['Errors'] ['Error'] ['Source'] )) {\n\t\t\t\t\t\t\tif ($precheckoutData ['Errors'] ['Error'] ['Source'] == \"3DS Needed\") {\n\t\t\t\t\t\t\t\tthrow new Mage_Core_Exception ( \"3DS Needed\" );\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} catch ( Mage_Core_Exception $e ) {\n\t\t\t\tif ($e->getMessage () == \"3DS Needed\") {\n\t\t\t\t\tMage::getSingleton ( 'core/session' )->setExpSecure ( true );\n\t\t\t\t} else {\n\t\t\t\t\tMage::getSingleton ( 'core/session' )->setExpSecure ( false );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (isset ( $postback_data )) {\n\t\t\t\t\t$TransactionStatus = 'Failure';\n\t\t\t\t\tMage::helper ( 'masterpass' )->postTransaction ( $postback_data, $TransactionStatus, self::APPROVAL_CODE );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->_redirect ( 'masterpass/masterpasspairing/precheckout' );\n\t\t\t}\n\t\t} else {\n\t\t\t$generic_error_message = Mage::getStoreConfig ( 'masterpass/config/checkouterrormessage' );\n\t\t\tMage::getSingleton ( 'core/session' )->addError ( $generic_error_message );\n\t\t\t$this->_redirect ( 'masterpass/masterpasspairing/precheckout' );\n\t\t}\n\t}",
"public function update_cart(){\n\t\t\tself::__construct();\n\t\t}",
"private function saveCart()\n\t{\n\t\t$totalPrice = $this->cart->calculateTotalPriceGross();\n\t\t$companyDetails = \\App\\User::getUser()->get('companyDetails');\n\t\tif (!empty($companyDetails) && isset($companyDetails['creditlimit']) && $totalPrice > ($companyDetails['creditlimit'] - $companyDetails['sum_open_orders'])) {\n\t\t\t$result = [\n\t\t\t\t'error' => \\App\\Language::translate('LBL_MERCHANT_LIMIT_EXCEEDED', 'Products'),\n\t\t\t];\n\t\t} else {\n\t\t\t$this->cart->save();\n\t\t\t$result = [\n\t\t\t\t'numberOfItems' => $this->cart->count(),\n\t\t\t\t'totalPriceNetto' => \\App\\Fields\\Currency::formatToDisplay($this->cart->calculateTotalPriceNetto()),\n\t\t\t\t'totalPriceGross' => \\App\\Fields\\Currency::formatToDisplay($totalPrice),\n\t\t\t\t'shippingPrice' => \\App\\Fields\\Currency::formatToDisplay($this->cart->getShippingPrice()),\n\t\t\t];\n\t\t}\n\n\t\t$response = new \\App\\Response();\n\t\t$response->setResult($result);\n\t\t$response->emit();\n\t}",
"public function makeOrder(){\n\t\tsession_start();\n\n\t\t// prepares the request\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://\" . IP . \"/bde_site/api/purchase/\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\t\tcurl_setopt($ch, CURLOPT_POST, true);\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Authorization: ' . TOKEN));\n\n\t\t// send the request\n\t\tcurl_setopt($ch, CURLOPT_POSTFIELDS, json_encode(['id_user' => $_SESSION['id_user'], 'date' => date('Y-m-d')]));\n\t\t$output = curl_exec($ch);\n\t\t$info = curl_getinfo($ch);\n\t\tcurl_close($ch);\n\n\t\t// decode the answer into a php object\n\t\t$insertId = json_decode($output,true)['insertId'];\n\n\t\t// decode the cookie into a php object\n\t\t$cart = json_decode($_COOKIE['cart'], true);\n\n\t\t// fill the contain table from the API with the products of the order\n\t\tforeach ($cart as $key => $product) {\n\t\t\t$this->addToOrder($product['quantity'], $insertId, $product['quantity']);\n\t\t}\n\n/*\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: ' . TOKEN));\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://\" . IP . \"/bde_site/api/user/status/bde_member\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t\t$output = curl_exec($ch);\n\t\t$info = curl_getinfo($ch);\n\t\tcurl_close($ch);\n\n\t\t$bdeMembers = json_decode($output, true);\n\n\t\tvar_dump($bdeMembers);\n\n\t\t$emailMessage = \"L'utilisateur \" . $_SESSION['first_name'] . \" \" . $_SESSION['last_name'] . \" a passer une commande :\\n\";\n\t\t$total = 0;\n\t\tforeach ($cart as $key => $product) {\n\t\t\t$emailMessage = $emailMessage . \"\\t\" . $cart['name'] . \" : \" . $cart['quantity'] . \"\\n\";\n\t\t\t$total += $cart['price'] * $cart['quantity'];\n\t\t}\n\n\t\t$emailMessage = $emailMessage . \"Montant : \" . $total . \"€\";\n\n\t\techo $emailMessage;\n\n\t\tforeach ($bdeMembers as $key => $bdeMember) {\n\t\t\tmail('[email protected]', \"Commande n°\" . '1', 'test');\n\t\t}*/\n\n\t\t// deletes the cart cookie\n\n\t\t// erase the cookie\n\t\tunset($_COOKIE['cart']);\n \t\tsetcookie('cart', '', time() - 3600);\n\n \t\treturn redirect()->route('cart', 'success');\n\t}",
"private function _expressCheckoutInitial()\r\n\t{\r\n\t\t/* If the customer has no cart yet, we need to create an empty one */\r\n\t\tif (!$this->context->cart->id)\r\n\t\t{\r\n\t\t\tif ($this->context->cookie->id_guest)\r\n\t\t\t{\r\n\t\t\t\t$guest = new Guest((int)$this->context->cookie->id_guest);\r\n\t\t\t\t$this->context->cart->mobile_theme = $guest->mobile_theme;\r\n\t\t\t}\r\n\t\t\t$this->context->cart->add();\r\n\t\t\tif ($this->context->cart->id)\r\n\t\t\t\t$this->context->cookie->id_cart = (int)$this->context->cart->id;\r\n\t\t}\r\n\t\t/* If the customer is coming from a product page, we need to add his/her product to the cart */\r\n\t\tif (Tools::getValue('paypal_express_checkout_id_product') != '')\r\n\t\t\t$this->context->cart->updateQty((int)Tools::getValue('paypal_express_checkout_quantity'), (int)Tools::getValue('paypal_express_checkout_id_product'), (int)Tools::getValue('paypal_express_checkout_id_product_attribute'));\r\n\r\n\t\t$nvp_request = '';\r\n\t\t$i = 0;\r\n\t\t$totalToPay = (float)$this->context->cart->getOrderTotal(true);\r\n\t\t$totalToPayWithoutTaxes = (float)$this->context->cart->getOrderTotal(false);\r\n\t\t$total_price = 0;\r\n\r\n\t\tforeach ($this->context->cart->getProducts() as $product)\r\n\t\t{\r\n\t\t\t$nvp_request .= '&L_PAYMENTREQUEST_0_NAME'.$i.'='.urlencode($product['name']).\r\n\t\t\t\t\t'&L_PAYMENTREQUEST_0_NUMBER'.$i.'='.urlencode((int)$product['id_product']).\r\n\t\t\t\t\t'&L_PAYMENTREQUEST_0_DESC'.$i.'='.urlencode(strip_tags(Tools::truncate($product['description_short'], 80))).\r\n\t\t\t\t\t'&L_PAYMENTREQUEST_0_AMT'.$i.'='.urlencode((float)$product['price']).\r\n\t\t\t\t\t'&L_PAYMENTREQUEST_0_QTY'.$i.'='.urlencode((int)$product['cart_quantity']);\r\n\t\t\t$total_product += (float)$product['price'] * (int)$product['cart_quantity'];\r\n\t\t\t$i++;\r\n\t\t}\r\n\r\n\t\t$cart_discount = current($this->context->cart->getCartRules(CartRule::FILTER_ACTION_REDUCTION));\r\n\r\n\t\tif (($totalToPay - ($total_product + $this->context->cart->getTotalShippingCost()+ ($totalToPay - $totalToPayWithoutTaxes))) != 0)\r\n\t\t{\r\n\t\t\t$nvp_request .= '&L_PAYMENTREQUEST_0_NAME'.$i.'='.urlencode($this->paypal_usa->l('Coupon')).\r\n\t\t\t\t\t'&L_PAYMENTREQUEST_0_DESC'.$i.'='.urlencode(strip_tags(Tools::truncate($cart_discount['description'], 80))).\r\n\t\t\t\t\t'&L_PAYMENTREQUEST_0_AMT'.$i.'='.urlencode(number_format($totalToPay - ($total_product + $this->context->cart->getTotalShippingCost()+ ($totalToPay - $totalToPayWithoutTaxes)),2)).\r\n\t\t\t\t\t'&L_PAYMENTREQUEST_0_QTY'.$i.'=1';\r\n\t\t\t$i++;\r\n\t\t}\r\n\t\t$nvp_request .= '&L_PAYMENTREQUEST_0_NAME'.$i.'='.urlencode($this->paypal_usa->l('Shipping fees')).\r\n\t\t\t\t'&L_PAYMENTREQUEST_0_AMT'.$i.'='.urlencode((float)$this->context->cart->getTotalShippingCost()).\r\n\t\t\t\t'&L_PAYMENTREQUEST_0_QTY'.$i.'=1'.\r\n\t\t\t\t'&PAYMENTREQUEST_0_ITEMAMT='.(float)$totalToPayWithoutTaxes.\r\n\t\t\t\t'&PAYMENTREQUEST_0_TAXAMT='.(float)($totalToPay - $totalToPayWithoutTaxes);\r\n\r\n\t\t/* Create a PayPal payment request and redirect the customer to PayPal (to log-in or to fill his/her credit card info) */\r\n\t\t$currency = new Currency((int)$this->context->cart->id_currency);\r\n\r\n\t\t$result = $this->paypal_usa->postToPayPal('SetExpressCheckout', (Configuration::get('PAYPAL_USA_EXP_CHK_BORDER_COLOR') != '' ? '&CARTBORDERCOLOR='.substr(str_replace('#', '', Configuration::get('PAYPAL_USA_EXP_CHK_BORDER_COLOR')), 0, 6) : '').'&PAYMENTREQUEST_0_AMT='.$totalToPay.'&PAYMENTREQUEST_0_PAYMENTACTION=Sale&RETURNURL='.urlencode($this->context->link->getModuleLink('paypalusa', 'expresscheckout', array('pp_exp_checkout' => 1,))).'&CANCELURL='.urlencode($this->context->link->getPageLink('order.php')).'&PAYMENTREQUEST_0_CURRENCYCODE='.urlencode($currency->iso_code).$nvp_request);\r\n\t\tif (strtoupper($result['ACK']) == 'SUCCESS' || strtoupper($result['ACK']) == 'SUCCESSWITHWARNING')\r\n\t\t{\r\n\t\t\theader('Location: https://www.'.(Configuration::get('PAYPAL_USA_SANDBOX') ? 'sandbox.' : '').'paypal.com/'.(Configuration::get('PAYPAL_USA_SANDBOX') ? '' : 'cgi-bin/').'webscr?cmd=_express-checkout&token='.urldecode($result['TOKEN']));\r\n\t\t\texit;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tforeach ($result as $key => $val)\r\n\t\t\t\t$result[$key] = urldecode($val);\r\n\r\n\t\t\t$this->context->smarty->assign('paypal_usa_errors', $result);\r\n\t\t\t$this->setTemplate('express-checkout-messages.tpl');\r\n\t\t}\r\n\t}",
"private function makeItemPurchase() : void\n {\n $this->item->available = $this->item->available - 1;\n $this->coinService->setCoinCount(\n $this->coinService->getCurrenCoinCount() - $this->item->cost\n );\n $this->item->save();\n }",
"public function checkout_page() {\n\t\tif ( monsterinsights_is_page_reload() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$cart_contents = WC()->cart->get_cart();\n\n\t\t// If there's no cart contents, then return\n\t\tif ( empty( $cart_contents ) ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$atts = array(\n\t\t\t't' => 'event', \t\t\t\t\t // Type of hit\n\t\t\t'ec' => 'Checkout', \t\t\t\t // Event Category\n\t\t\t'ea' => 'Started Checkout', \t\t\t // Event Action\n\t\t\t'el' => 'Checkout Page', \t\t\t\t // Event Label\n\t\t\t'ev' => '', \t\t\t\t\t // Event Value (unused)\n\t\t\t'cos' => 1, \t\t\t\t\t // Checkout Step\n\t\t\t'pa' => $this->get_funnel_action( 'started_checkout' ), // Product Action\n\t\t\t'pal' => '', \t\t\t\t\t // Product Action List\n\t\t\t'nonInteraction' => true, \t\t\t\t // Set as non-interaction event\n\t\t);\n\n\t\tif ( monsterinsights_get_option( 'userid', false ) && is_user_logged_in() ) {\n\t\t\t$atts['uid'] = get_current_user_id(); // UserID tracking\n\t\t}\n\n\t\t// Declare items in cart\n\t\t$items = array();\n\t\t$i = 1;\n\t\tforeach ( $cart_contents as $item ) {\n\t\t\t$product_id = $item['product_id'];\n\t\t\t$variation = '';\n\t\t\t$product = null;\n\n\t\t\tif ( ! empty( $item['variation_id'] ) ) {\n\t\t\t\t$product = wc_get_product( $item['variation_id'] );\n\t\t\t\tif ( method_exists( $product, 'get_name' ) ) {\n\t\t\t\t\t$variation = $product->get_name();\n\t\t\t\t} else {\n\t\t\t\t\t$variation = $product->post->post_title;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$product = wc_get_product( $product_id );\n\t\t\t}\n\n\t\t\t$categories = (array) get_the_terms( $product_id, 'product_cat' );\n\t\t\t$category_names = wp_list_pluck( $categories, 'name' );\n\t\t\t$first_category = reset( $category_names );\n\n\t\t\t$items[\"pr{$i}id\"] = $product_id; \t\t\t // Product ID\n\t\t\t$items[\"pr{$i}nm\"] = get_the_title( $product_id ); // Product Name\n\t\t\t$items[\"pr{$i}ca\"] = $first_category; \t\t\t // Product Category\n\t\t\t$items[\"pr{$i}va\"] = $variation; \t\t\t // Product Variation Title\n\t\t\t$items[\"pr{$i}pr\"] = $product->get_price(); // Product Price\n\t\t\t$items[\"pr{$i}qt\"] = $item['quantity']; \t\t\t // Product Quantity\n\t\t\t$items[\"pr{$i}ps\"] = $i; \t\t\t\t // Product Order\n\t\t\t$i++;\n\t\t}\n\n\t\t$atts = array_merge( $atts, $items );\n\t\tmonsterinsights_mp_track_event_call( $atts );\n\t}",
"public function store(Request $request)\n {\n\n //dd($request->all());\n $cart = cartGet();\n $res = ['status' => 'success'];\n //dd(route('success'));\n if (!cart()->empty) {\n\n $order = new Order;\n $order->city = currentCity() ? currentCity()->name : '';\n $order->country_id = country()->id;\n $order->delivery = $request->cart_delivery;\n $order->fio = $request->name;\n $order->phone = $request->phone;\n $order->address = $request->address;\n $order->comment = $request->message;\n $order->date = time();\n $order->save();\n\n $res['name'] = $order->fio;\n $res['phone'] = $order->phone;\n $res['status'] = 'success';\n\n //apply promocode\n if(promocode() && !promocode()->apply(cart()->collection))\n {\n return abort(406);\n }\n\n foreach (cart()->products as $product) {\n $items[] = [\n 'order_id' => $order->id,\n 'product_id' => $product->id,\n 'price' => $product->price_real,\n 'price_promo'=> $product->price,\n 'count' => $product->count,\n ];\n }\n\n $pid = \\DB::table('order_items')->insert($items);\n\n $order->price = cart()->total;\n $order->save();\n\n if (!env(\"MAIL_DISABLE\", false)) {\n Mail::to(getConfigValue('message_mail'))->send(new OrderShipped($order));\n }\n\n cart()->flush();\n\n //clear promocode\n if(promocode())\n {\n promocode()->remove();\n }\n\n session(['order_id' => $order->id]);\n return redirect(route('success') . '/');\n $res['fields'] = [\n '.js-cart-count' => cartCount(),\n '.js-cart-sum' => cartSum(),\n '.js-order-phone' => $request->phone,\n '.js-order-name' => $request->name,\n ];\n $res['location'] = '/success';\n $res['popup'] = '#order-pop';\n } else {\n $res['location'] = '/';\n }\n return back();\n }",
"public function resetItems()\n {\n Yii::$app->session->set('cart', []);\n }",
"public static function placeOrder($dbController, $customerId, $productId, $productQuantity) {\n $sql = \"SELECT * FROM order_processing WHERE customerid = $customerId AND processed = '0' \";\n $result = $dbController->conn->query($sql); \n //case of new order \n if ($result->num_rows == 0) {\n $sql = \"INSERT INTO order_processing(customerid,productid,quantity,processed,shipped)\n\t\t\t\t\t\tVALUES ($customerId,$productId,$productQuantity,0,0)\"; \n $dbController->conn->query($sql); \n $transactionId = $dbController->conn->insert_id;; // get last id\n // case of exist order\n } else {\n $row = $result->fetch_assoc();\n $transactionId = $row['transaction_id']; \n \n }\n \n //add product to cart\n $sql = \"SELECT * FROM order_product WHERE transaction_id = $transactionId AND product_id = $productId\";\n $result = $dbController->conn->query($sql);\n //case of new product\n if ($result->num_rows == 0) {\n \n $sql = \"INSERT INTO order_product VALUES ($transactionId,$productId,$productQuantity)\";\n }\n //case of exist product\n else {\n $row = $result->fetch_assoc();\n $productQuantity += $row['product_quantity'];\n $sql = \"UPDATE order_product SET product_quantity = $productQuantity \"\n . \"WHERE transaction_id =$transactionId AND product_id = $productId\";\n }\n \n return $dbController->conn->query($sql);\n \n }",
"public function checkout(Request $request)\n {\n $carts = empty(Session::get('carts')) ? [] : Session::get('carts');\n $total = 0;\n $products = [];\n if (!empty($carts)) {\n // create list product id\n $listProductId = [];\n foreach ($carts as $cart) {\n $listProductId[] = $cart['id'];\n }\n //dd( $listProductId);\n // get data product from list product id\n $products = Product::whereIn('id', $listProductId)\n ->get();\n }\n //dd($products);\n return view('carts.checkout', compact('carts','products','total'));\n }",
"private function _cart($items = array())\n {\n \treturn array(\n 'id'\t\t=> $items['id'],\n 'qty' \t\t=> $items['qty'],\n 'price' \t=> $this->_formatNumber($items['price']),\n 'name' \t\t=> $items['name'],\n \t'options'\t=> isset($items['options']) ? $items['options'] : 0,\n 'date' \t \t=> date('Y-m-d H:i:s', time()),\n 'vat' => isset($items['vat']) ? $items['vat'] : $this->_config['vat']\n );\n }",
"public function actionAddToCart()\n {\n (LoginController::class)::checkLogin();\n $id = App::call()->request->getParams()['id'];\n $cart = (new Sessions())->get('cart');\n if ($id) {\n if (!$cart || !in_array($id, $cart)) {\n (new Sessions())->add('cart', $id);\n $message = 'Item is added!';\n } else {\n $message = 'Item is already in cart!';\n }\n }\n echo $message;\n }",
"function store(Request $request){\n\n // $user->name = request('name');\n // // $user->email = request('email');\n // $user->address = request('address');\n // $user->doctor = request('doctor');\n // $user->save();\n // $user = auth()->user();\n\n $total = Cart::subtotal();\n //insert into orders table \n\n $order = UserOrder::create([\n 'user_id'=> auth()->user() ? auth()->user()->id : null,\n 'email' => $request->email,\n 'name' => $request->name,\n 'address' => $request->address,\n 'doctor' => $request->doctor,\n 'sub_total' => $total ,\n ]);\n\n //insert into product\n foreach(Cart::Content() as $item){\n PatientOrders::create([\n 'order_id' => $order->id,\n 'product_id' => $item->model->id,\n // 'quantity' => $item->qty\n\n ]);\n }\n\n Cart::destroy();\n return redirect()->route('list.index')->with('success_message', 'Order Placed'); \n }",
"function changeCart(){\n\t\t$this->getCart();\n\t\t\n\t\t$keys = array(); $keys = $_POST['Key']; // Cart Keys\n\t\t$qtys = array(); $qtys = $_POST['Qty']; // Cart Quantities\n\t\tif(count($this->Cart) == 0) header(sprintf(\"Location: %s\", $this->Files['Cart'] ));\n\n\t\tforeach($keys as $k => $v){ // For Each Item go through the system and update the quatities\n\t\t\t$this->Cart[$v][\"qty\"] = $qtys[$k];\n\t\t\t$this->Cart[$v][\"attnd\"] = (isset($_POST['attnd_'.$k])) ? $_POST['attnd_'.$k] : array() ; // Cart Attendies\n\t\t\t/*\n\t\t\t$getProdMsgs = new sql_processor($this->DB,$this->Conn,$this->Gateway);\n\t\t\t$getProdMsgs->mysql(\"SELECT `prod_msg_type` FROM `prod_products` WHERE `prod_id` = '\".$cart[$v][\"id\"].\"';\");\n\t\t\t$getProdMsgs->mssql(\"SELECT prod_msg_type FROM prod_products WHERE prod_id = '\".$cart[$v][\"id\"].\"';\");\n\t\t\t$getProdMsgs = $getProdMsgs->Rows();\n\t\t\t$Msgs = $getProdMsgs[0]['prod_msg_type'];\n\t\t\t*/\n\t\t\t$Msgs='';\n\t\t\tif(strlen(trim($Msgs)) > 0)$Msgs = unserialize(urldecode($Msgs));\n\t\t\telse $Msgs = array(); $Tarray = array();\n\t\t\t\n\t\t\tif(count($Msgs) > 0){ // Now we need to update any message that the products may have.\n\t\t\t\tforeach($Msgs as $msgk => $msgv){\n\t\t\t\t\tswitch($msgk){\n\t\t\t\t\t\tcase \"Cmnts\":\n\t\t\t\t\t\t\tif(strlen(trim($_POST['message_'.$v])) > 0) $Tarray['Cmnts'][0] = clean_variable($_POST['message_'.$v],true);\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"ToFrm\":\n\t\t\t\t\t\t\tif(strlen(trim($_POST['message_to_'.$v])) > 0){\n\t\t\t\t\t\t\t\t$Tarray['ToFrm'][0] = clean_variable($_POST['message_to_'.$v],true);\n\t\t\t\t\t\t\t\t$Tarray['ToFrm'][1] = clean_variable($_POST['message_from_'.$v],true);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase \"Engv\":\n\t\t\t\t\t\t\tif(intval($msgv)>1){\n\t\t\t\t\t\t\t\tif(strlen(trim($_POST['engraving_'.$k])) > 0) $Tarray['Engv'][0] = clean_variable($_POST['engraving_'.$v],true);\n\t\t\t\t\t\t\t} else { $n=0;\n\t\t\t\t\t\t\t\tforeach($_POST['engraving_'.$v] as $msgv2){\n\t\t\t\t\t\t\t\t\tif(strlen(trim($v)) > 0) $Tarray['Engv'][$n] = clean_variable($msgv2,true);\n\t\t\t\t\t\t\t\t\t$n++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} break;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->Cart[$v]['msgs'] = $Tarray;\n\t\t\t\tif($qtys[$k] > 1){ $this->Cart[$v]['qty'] = 1; $Tarray = $this->Cart[$v]; array_push($this->Cart,$Tarray); }\n\t\t\t}\n\t\t}\n\t\t//echo '<pre>';\n\t\t//var_dump($this->Cart);\n\t\t//echo '</pre>';\n\t\t//die();\n\t\t$this->getRefered();\n\t\t$this->setCart();\n\t\t\n\t\tswitch($_POST['Controller']){\n\t\t\tcase \"CtnShp\": $GoTo = $this->Files['prodList']; break;\n\t\t\tdefault: $GoTo = $this->Files['Cart']; breal;\n\t\t}\n\t\theader(sprintf(\"Location: %s\", $GoTo));\n\t}",
"public function checkout(){\n\t\ttry {\n\t\t\tif (Session::has('cart')){\n\t\t\t\t$cart = Session::get('cart');\n\t\t\t\treset($cart);\n\t\t\t\t$restaurant_id = key($cart);\n $idParen= DB::table('res_restaurants')\n ->select('parent_restaurant_id')\n ->where('restaurant_id', $restaurant_id)\n ->get();\n\t\t\t\t$res_addresses = Restaurant::where(\"parent_restaurant_id\", $idParen[0]->parent_restaurant_id)->where(\"activate\",1)->get();\n\n $shipping_charge=0;\n \n foreach ($res_addresses as $key => $value) {\n\t\t\t\t\t$resadds[$value->restaurant_id] = $value->name.\" - \".$value->address;\n \n if($value->restaurant_id==$value->parent_restaurant_id){\n //Si es el padre usar ese costo de envío\n $shipping_charge = $value->shipping_cost;\n }\n \n\t\t\t\t}\n\n\t\t\t\t$sches = Schedule::where(\"restaurant_id\", $restaurant_id)\n\t\t\t\t\t->where(\"day_id\", date('w')+1)->get();\n\n\t\t\t\t//Aqui mando a traer las direcciones\n\t\t\t\t$addrss = Address::where('user_id', Auth::user()->user_id)->get();\n\t\t\t\tforeach ($addrss as $key => $value) {\n\t\t\t\t\t$usradds[$value->address_id] = $value->address_name .\" - \". $value->address_1 .\n\t\t\t\t\t\t(!empty($value->address_2) ? \", \".$value->address_2 : \"\") .\n\t\t\t\t\t\t(!empty($value->city) ? \", \".$value->city : \"\");\n\t\t\t\t}\n\n\t\t\t\tif(!isset($usradds)){\n\t\t\t\t\t$usradds = array ();\n\t\t\t\t}\n \n\t\t\t\tif(!isset($resadds) || count($resadds) == 0){\n\t\t\t\t\t$resadds = array ();\t\n\t\t\t\t}\n \n if(count($resadds)>1){\n foreach ($resadds as $k=>$v) {\n if($k==$idParen[0]->parent_restaurant_id){\n unset($resadds[$k]);\n }\n }\n }\n \n $data['contador_add'] = count($addrss);\n $data['res_address']=$resadds;\n $data['usr_address']=$usradds;\n //Devolviendo la id, del padre\n $data['restaurant_id']=$restaurant_id;\n $data['parent_shipping_cost']=$shipping_charge;\n $data['schedule']=$sches;\n \n //For new Addresses\n $statelst = State::where('country_id', 69)->where('active', true)->get();\n $data['states'] = array();\n $data['municipalities'] = array();\n $data['zones'] = array();\n $data['states']['']=\"--Seleccione un departamento--\";\n $data['municipalities']['']=\"--Seleccione un municipio--\";\n $data['zones']['']=\"--Seleccione una zona--\";\n\n //Obtengo todas las zonas sin necesidad de los municipios\n $zonas = Zone::select('zone_id', DB::raw('CONCAT(zone, \" - $\", price) AS name_zona'))\n\t\t\t ->join('pf.com_shipping_prices', 'pf.com_zones.shipping_price_id', '=', 'pf.com_shipping_prices.shipping_price_id')\n\t\t\t ->lists('name_zona', 'zone_id');\n #sort($zonas);\n\t\t $combobox = array('none' => \"--Seleccione una zona\") + $zonas;\n\t\t $selected = array();\n \n \n foreach ($statelst as $state) {\n $data['states'][$state->state_id]=$state->state;\n }\n\n $date = new DateTime();\n\t\t $fecha = $date->format('Y-m-d H:i:s');\n\n\t\t $promociones = Product::where('activate',1)\n\t\t ->where('promotion',1)\n\t\t ->where('res_products.start_date', '<=', $fecha)->where('res_products.end_date', '>=', $fecha)\n\t\t ->count();\n\n\t\t\t\treturn View::make('web.checkout', compact('combobox', 'selected'))\n\t\t\t\t\t->with('promociones', $promociones)\n\t\t\t\t\t->with($data);\n\t\t\t}else{\n\t\t\t\treturn View::make('web.home');\n\t\t\t}\n\t\t} catch (Exception $e) {\n\t\t\treturn Response::json(array('message_error' => $e->getMessage()), 400);\n\t\t}\t\t\n\t}"
] | [
"0.71181166",
"0.7005549",
"0.69881046",
"0.69676185",
"0.6860215",
"0.6766215",
"0.6766215",
"0.67424214",
"0.6662357",
"0.6579462",
"0.6536061",
"0.65321183",
"0.6531296",
"0.6493035",
"0.6487418",
"0.6482323",
"0.64647466",
"0.6456546",
"0.64442086",
"0.6429419",
"0.64251786",
"0.6399108",
"0.63976455",
"0.63899404",
"0.6364056",
"0.63469154",
"0.63452345",
"0.6342897",
"0.63396627",
"0.6330029",
"0.63280714",
"0.6323035",
"0.6315835",
"0.629925",
"0.6296057",
"0.62906766",
"0.62905324",
"0.62848675",
"0.6266566",
"0.6259918",
"0.62502277",
"0.6247817",
"0.62297064",
"0.62272274",
"0.6227088",
"0.62236005",
"0.6213163",
"0.6207298",
"0.6205009",
"0.61797583",
"0.6174395",
"0.6166823",
"0.61664426",
"0.61615926",
"0.61607766",
"0.6156816",
"0.6154771",
"0.61490434",
"0.6140377",
"0.61387163",
"0.61295766",
"0.61194146",
"0.61175436",
"0.6111174",
"0.6094089",
"0.6089662",
"0.608965",
"0.6088461",
"0.60789436",
"0.60733736",
"0.6071223",
"0.60703135",
"0.60664344",
"0.6063452",
"0.6061289",
"0.60609597",
"0.6057608",
"0.6057313",
"0.6054434",
"0.6053218",
"0.6048094",
"0.60443985",
"0.60355383",
"0.60283864",
"0.60280186",
"0.60161614",
"0.6015861",
"0.6008322",
"0.6003235",
"0.6002905",
"0.59887826",
"0.5986887",
"0.59848756",
"0.59784883",
"0.59724474",
"0.59689724",
"0.5966561",
"0.59587693",
"0.59463984",
"0.5943512",
"0.5938002"
] | 0.0 | -1 |
Execute the console command. | public function handle()
{
$url = 'http://www.everlytic.co.za/';
$seostats = new \SEOstats\SEOstats;
if ($seostats->setUrl($url)) {
// Create a new SEOstats instance.
///dd(SEOstats\Alexa::getGlobalRank());
dd(SEOstats\Social::getLinkedInShares());
// dd(SEOstats\Alexa::getGlobalRank());
// dd(SEOstats\Alexa::getGlobalRank());
// dd(SEOstats\Alexa::getGlobalRank());
// dd(SEOstats\Alexa::getGlobalRank());
}
} | {
"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\n $settings = Setting::fetch();\n $id = $this->argument('id');\n $this->scrape_game_data($id);\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 // 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 $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 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\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 $subscriptionUpdateService = new SubscriptionUpdateService();\n $subscriptionUpdateService->runUpdates();\n }",
"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 $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\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 $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 $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 $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 $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->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 $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 // 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 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 $countryFiles = $this->getFiles();\n\n foreach ($countryFiles as $fileName) {\n $this->seed($fileName);\n }\n\n $this->info('End.');\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 $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 //\n $modelName = $this->argument('model');\n $column = $this->argument('column');\n $this->generateMutation($modelName, $column);\n\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 $this->makeDir($this->basePath . $this->kebabPlural());\n\n $this->exportViews();\n\n $this->info('Resource views generated successfully.');\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 $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 // 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 $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 if ($this->validation()) {\n $money = $this->argument('money');\n Cache::increment('amount', $money);\n }\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 $this->info('Publishing stuff..');\n\n $this->publishFiles();\n\n $this->info('Setup complete. Enjoy!');\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.6469205",
"0.6463761",
"0.6426904",
"0.63497347",
"0.6316859",
"0.6273603",
"0.6260993",
"0.6260039",
"0.6234982",
"0.6224031",
"0.62203085",
"0.62127924",
"0.61931187",
"0.61907774",
"0.61823803",
"0.61771643",
"0.61763066",
"0.6173071",
"0.614875",
"0.61481935",
"0.61478025",
"0.6146515",
"0.61378634",
"0.6134108",
"0.61305386",
"0.611494",
"0.61125565",
"0.6108917",
"0.6107659",
"0.61040413",
"0.6102003",
"0.6101093",
"0.6099741",
"0.60949016",
"0.60936064",
"0.6090574",
"0.6088933",
"0.6083463",
"0.60809344",
"0.60777074",
"0.60756934",
"0.6074443",
"0.60738426",
"0.6071605",
"0.6068733",
"0.6068527",
"0.6067375",
"0.6065772",
"0.606112",
"0.60584533",
"0.6057447",
"0.6056741",
"0.6048619",
"0.60417557",
"0.6038975",
"0.6032054",
"0.60303104",
"0.6027232",
"0.6024652",
"0.60196066",
"0.60188687",
"0.60179913",
"0.6012857",
"0.601259",
"0.6012461",
"0.6011362",
"0.60076964",
"0.600724",
"0.6006366",
"0.6005053",
"0.6004709",
"0.6001817",
"0.599914",
"0.59979004",
"0.59978044",
"0.5990107",
"0.59885967",
"0.59885967",
"0.59871256",
"0.59864116",
"0.59845364",
"0.5984081",
"0.5979547",
"0.59767544",
"0.5976526",
"0.597233",
"0.59683913",
"0.59669304",
"0.5966169",
"0.59638894",
"0.5963461",
"0.5961134",
"0.596042",
"0.59560114",
"0.5954082",
"0.5951348",
"0.5949012",
"0.5947517",
"0.5945386",
"0.5944714",
"0.59442943"
] | 0.0 | -1 |
SAVE BREWERY DATA TO SQL DB | function saveData($breweryName, $address){
$conn = mysqli_connect('localhost','root','','ratebeer_data');
$brewery_name = $breweryName;
$brewery_name = preg_replace('/((.*?)#41;/', '', $brewery_name);
echo $brewery_name;
$brewery_street = $address['street'];
$brewery_city = $address['city'];
$brewery_state = $address['state'];
$brewery_country = $address['country'];
$brewery_zip = $address['zipcode'];
$brewery_phone = $address['telephone'];
$check_brewery_exist = "SELECT id FROM `ratebeer_breweries` WHERE name = '$brewery_name'";
$brewery_result = mysqli_query($conn, $check_brewery_exist);
if(!$brewery_result || mysqli_num_rows($brewery_result) == 0)
{
$insert_brewery = "INSERT INTO `ratebeer_breweries` (`name`, `city`, `state`, `country`, `zip1`, `phone`)
VALUES ('$brewery_name', '$brewery_city', '$brewery_state', '$brewery_country', '$brewery_zip', '$brewery_phone')";
$insert_brewery_result = mysqli_query($conn, $insert_brewery);
print $insert_brewery_result;
if (mysqli_affected_rows($conn) > 0) {
$output['message'] = "brewery added!";
print json_encode($output);
} else {
$output['message'] = "Brewery denied!";
mysqli_error($conn);
print json_encode($output);
}
}
else {
$output['message'] = 'Sorry, that brewery has already been added';
print json_encode($output);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function saveToDB()\n {\n }",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"public function save();",
"function saveToDb()\n\t{\n\t\tglobal $ilDB;\n\t\t\n\t\t// date handling\n\t\t$rmd_start = $this->getReminderStart();\n\t\tif(is_object($rmd_start))\n\t\t{\n\t\t\t$rmd_start = $rmd_start->get(IL_CAL_DATE);\n\t\t}\n\t\t$rmd_end = $this->getReminderEnd();\n\t\tif(is_object($rmd_end))\n\t\t{\n\t\t\t$rmd_end = $rmd_end->get(IL_CAL_DATE);\n\t\t}\n\t\t\n\t\tinclude_once(\"./Services/RTE/classes/class.ilRTE.php\");\n\t\tif ($this->getSurveyId() < 1)\n\t\t{\n\t\t\t$next_id = $ilDB->nextId('svy_svy');\n\t\t\t$affectedRows = $ilDB->insert(\"svy_svy\", array(\n\t\t\t\t\"survey_id\" => array(\"integer\", $next_id),\n\t\t\t\t\"obj_fi\" => array(\"integer\", $this->getId()),\n\t\t\t\t\"author\" => array(\"text\", $this->getAuthor()),\n\t\t\t\t\"introduction\" => array(\"clob\", ilRTE::_replaceMediaObjectImageSrc($this->getIntroduction(), 0)),\n\t\t\t\t\"outro\" => array(\"clob\", ilRTE::_replaceMediaObjectImageSrc($this->getOutro(), 0)),\n\t\t\t\t\"status\" => array(\"text\", $this->getStatus()),\n\t\t\t\t\"startdate\" => array(\"text\", $this->getStartDate()),\n\t\t\t\t\"enddate\" => array(\"text\", $this->getEndDate()),\n\t\t\t\t\"evaluation_access\" => array(\"text\", $this->getEvaluationAccess()),\n\t\t\t\t\"invitation\" => array(\"text\", $this->getInvitation()),\n\t\t\t\t\"invitation_mode\" => array(\"text\", $this->getInvitationMode()),\n\t\t\t\t\"complete\" => array(\"text\", $this->isComplete()),\n\t\t\t\t\"created\" => array(\"integer\", time()),\n\t\t\t\t\"anonymize\" => array(\"text\", $this->getAnonymize()),\n\t\t\t\t\"show_question_titles\" => array(\"text\", $this->getShowQuestionTitles()),\n\t\t\t\t\"mailnotification\" => array('integer', ($this->getMailNotification()) ? 1 : 0),\n\t\t\t\t\"mailaddresses\" => array('text', strlen($this->getMailAddresses()) ? $this->getMailAddresses() : NULL),\n\t\t\t\t\"mailparticipantdata\" => array('text', strlen($this->getMailParticipantData()) ? $this->getMailParticipantData() : NULL),\n\t\t\t\t\"tstamp\" => array(\"integer\", time()),\n\t\t\t\t\"template_id\" => array(\"integer\", $this->getTemplate()),\n\t\t\t\t\"pool_usage\" => array(\"integer\", $this->getPoolUsage()),\n\t\t\t\t// 360°\n\t\t\t\t\"mode_360\" => array(\"integer\", $this->get360Mode()),\n\t\t\t\t\"mode_360_self_eval\" => array(\"integer\", $this->get360SelfEvaluation()),\n\t\t\t\t\"mode_360_self_rate\" => array(\"integer\", $this->get360SelfRaters()),\n\t\t\t\t\"mode_360_self_appr\" => array(\"integer\", $this->get360SelfAppraisee()),\n\t\t\t\t\"mode_360_results\" => array(\"integer\", $this->get360Results()),\n\t\t\t\t\"mode_360_skill_service\" => array(\"integer\", (int) $this->get360SkillService()),\n\t\t\t\t// reminder/notification\n\t\t\t\t\"reminder_status\" => array(\"integer\", (int)$this->getReminderStatus()),\n\t\t\t\t\"reminder_start\" => array(\"datetime\", $rmd_start),\n\t\t\t\t\"reminder_end\" => array(\"datetime\", $rmd_end),\n\t\t\t\t\"reminder_frequency\" => array(\"integer\", (int)$this->getReminderFrequency()),\t\t\t\t\n\t\t\t\t\"reminder_target\" => array(\"integer\", (int)$this->getReminderTarget()),\n\t\t\t\t\"reminder_last_sent\" => array(\"datetime\", $this->getReminderLastSent()),\n\t\t\t\t\"tutor_ntf_status\" => array(\"integer\", (int)$this->getTutorNotificationStatus()),\n\t\t\t\t\"tutor_ntf_reci\" => array(\"text\", implode(\";\", (array)$this->getTutorNotificationRecipients())),\n\t\t\t\t\"tutor_ntf_target\" => array(\"integer\", (int)$this->getTutorNotificationTarget()),\n\t\t\t\t\"own_results_view\" => array(\"integer\", $this->hasViewOwnResults()),\n\t\t\t\t\"own_results_mail\" => array(\"integer\", $this->hasMailOwnResults())\n \t\t\t));\n\t\t\t$this->setSurveyId($next_id);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$affectedRows = $ilDB->update(\"svy_svy\", array(\n\t\t\t\t\"author\" => array(\"text\", $this->getAuthor()),\n\t\t\t\t\"introduction\" => array(\"clob\", ilRTE::_replaceMediaObjectImageSrc($this->getIntroduction(), 0)),\n\t\t\t\t\"outro\" => array(\"clob\", ilRTE::_replaceMediaObjectImageSrc($this->getOutro(), 0)),\n\t\t\t\t\"status\" => array(\"text\", $this->getStatus()),\n\t\t\t\t\"startdate\" => array(\"text\", $this->getStartDate()),\n\t\t\t\t\"enddate\" => array(\"text\", $this->getEndDate()),\n\t\t\t\t\"evaluation_access\" => array(\"text\", $this->getEvaluationAccess()),\n\t\t\t\t\"invitation\" => array(\"text\", $this->getInvitation()),\n\t\t\t\t\"invitation_mode\" => array(\"text\", $this->getInvitationMode()),\n\t\t\t\t\"complete\" => array(\"text\", $this->isComplete()),\n\t\t\t\t\"anonymize\" => array(\"text\", $this->getAnonymize()),\n\t\t\t\t\"show_question_titles\" => array(\"text\", $this->getShowQuestionTitles()),\n\t\t\t\t\"mailnotification\" => array('integer', ($this->getMailNotification()) ? 1 : 0),\n\t\t\t\t\"mailaddresses\" => array('text', strlen($this->getMailAddresses()) ? $this->getMailAddresses() : NULL),\n\t\t\t\t\"mailparticipantdata\" => array('text', strlen($this->getMailParticipantData()) ? $this->getMailParticipantData() : NULL),\n\t\t\t\t\"tstamp\" => array(\"integer\", time()),\n\t\t\t\t\"template_id\" => array(\"integer\", $this->getTemplate()),\n\t\t\t\t\"pool_usage\" => array(\"integer\", $this->getPoolUsage()),\n\t\t\t\t// 360°\n\t\t\t\t\"mode_360\" => array(\"integer\", $this->get360Mode()),\n\t\t\t\t\"mode_360_self_eval\" => array(\"integer\", $this->get360SelfEvaluation()),\n\t\t\t\t\"mode_360_self_rate\" => array(\"integer\", $this->get360SelfRaters()),\n\t\t\t\t\"mode_360_self_appr\" => array(\"integer\", $this->get360SelfAppraisee()),\n\t\t\t\t\"mode_360_results\" => array(\"integer\", $this->get360Results()),\n\t\t\t\t\"mode_360_skill_service\" => array(\"integer\", (int) $this->get360SkillService()),\n\t\t\t\t// reminder/notification\n\t\t\t\t\"reminder_status\" => array(\"integer\", $this->getReminderStatus()),\n\t\t\t\t\"reminder_start\" => array(\"datetime\", $rmd_start),\n\t\t\t\t\"reminder_end\" => array(\"datetime\", $rmd_end),\n\t\t\t\t\"reminder_frequency\" => array(\"integer\", $this->getReminderFrequency()),\n\t\t\t\t\"reminder_target\" => array(\"integer\", $this->getReminderTarget()),\n\t\t\t\t\"reminder_last_sent\" => array(\"datetime\", $this->getReminderLastSent()),\n\t\t\t\t\"tutor_ntf_status\" => array(\"integer\", $this->getTutorNotificationStatus()),\n\t\t\t\t\"tutor_ntf_reci\" => array(\"text\", implode(\";\", (array)$this->getTutorNotificationRecipients())),\n\t\t\t\t\"tutor_ntf_target\" => array(\"integer\", $this->getTutorNotificationTarget()),\n\t\t\t\t\"own_results_view\" => array(\"integer\", $this->hasViewOwnResults()),\n\t\t\t\t\"own_results_mail\" => array(\"integer\", $this->hasMailOwnResults())\n\t\t\t), array(\n\t\t\t\"survey_id\" => array(\"integer\", $this->getSurveyId())\n\t\t\t));\n\t\t}\n\t\tif ($affectedRows)\n\t\t{\n\t\t\t// save questions to db\n\t\t\t$this->saveQuestionsToDb();\n\t\t}\n\t\t\n\t\t// moved activation to ilObjectActivation\n\t\tif($this->ref_id)\n\t\t{\n\t\t\tinclude_once \"./Services/Object/classes/class.ilObjectActivation.php\";\t\t\n\t\t\tilObjectActivation::getItem($this->ref_id);\n\t\t\t\n\t\t\t$item = new ilObjectActivation;\t\t\t\n\t\t\tif(!$this->isActivationLimited())\n\t\t\t{\n\t\t\t\t$item->setTimingType(ilObjectActivation::TIMINGS_DEACTIVATED);\n\t\t\t}\n\t\t\telse\n\t\t\t{\t\t\t\t\n\t\t\t\t$item->setTimingType(ilObjectActivation::TIMINGS_ACTIVATION);\n\t\t\t\t$item->setTimingStart($this->getActivationStartDate());\n\t\t\t\t$item->setTimingEnd($this->getActivationEndDate());\n\t\t\t\t$item->toggleVisible($this->getActivationVisibility());\n\t\t\t}\t\t\t\t\t\t\n\t\t\t\n\t\t\t$item->update($this->ref_id);\t\t\n\t\t}\n\t}",
"public function saveToDatabase($data)\n {\n }",
"function saveData() {\n\n\t\t$this->getMapper()->saveData();\t\n\t\t\n\t\t\n\t}",
"public function saveToDb()\n\t{\n\t\t$db = \\App\\Db::getInstance('admin');\n\t\t$tablesData = array_intersect_key($this->getData(), $this->changes);\n\t\tforeach ($tablesData as $key => $value) {\n\t\t\t$db->createCommand()->update($this->baseTable, ['value' => $value], ['type' => $this->type, 'name' => $key])->execute();\n\t\t}\n\t}",
"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}",
"function save() {\r\n foreach ($this->_data as $v)\r\n $v -> save();\r\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 }",
"function write_to_db(){\n global $jewelry_name,$quality,$price,$discounts,$user_id,$location_id,$table,$conn_obj;\n $sql_statement = $conn_obj->stmt_init();\n if($sql_statement = $conn_obj->prepare(\"INSERT INTO $table (jewlery_type,quality,price_paid,discount,user_id,location_id) VALUES (?,?,?,?,?,?)\")){\n $sql_statement->bind_param('ssiiii',$jewelry_name,$quality,$price, $discounts,$user_id,$location_id);\n $sql_statement->execute();\n $sql_statement->close();\n }else{\n echo \"Error on connection point 2 ERROR: \".$sql_statement->error;\n }\n }",
"public function saveData()\r\n {\r\n \r\n }",
"public function save() {\n\t\t$sql = \"UPDATE \".$this->tablename.\" SET \";\n\t\t$last = $this->columns[count($this->columns)-1]['db_name'];\n\t\tforeach ($this->columns as $col) {\n\t\t\tswitch($col['type']){\n\t\t\t\tcase 'D':\t//Date, Time, Char, Password, Image all need quotes around the value\n\t\t\t\tcase 'T':\n\t\t\t\tcase 'C':\n\t\t\t\tcase 'I':\n\t\t\t\tcase 'X':\n\t\t\t\tcase 'M':\n\t\t\t\tcase 'E':\n\t\t\t\t\t$sql .= $col['db_name'].\" = '\".$this->data[0][$col['db_name']].\"'\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'P':\n\t\t\t\t\t$sql .= $col['db_name'].\" = AES_ENCRYPT('\".$this->data[0][$col['db_name']].\"','\".la_aes_key.\"')\";\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'N':\t// Number, checkBox, Select, Radio don't need quotes\n\t\t\t\tcase 'B':\n\t\t\t\tcase 'S':\n\t\t\t\tcase 'R':\n\t\t\t\t\t$sql .= $col['db_name'].' = '.$this->data[0][$col['db_name']];\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tif ($col['db_name'] != $last) {\n\t\t\t\t$sql .= ',';\n\t\t\t}\n\t\t}\n\t\t$sql .= \" WHERE \".$this->idcol.\"=\".$this->page->ctrl['record'];\n\t\t$this->error->debug($sql);\n\t\t$this->dbc->exec($sql);\n\t\treturn true;\n\t}",
"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 }",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();",
"abstract public function save();",
"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() {\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 saveMyMonitoringDataToDb()\n {\n //get DB object\n /** @var $db Zend_Db_Adapter_Abstract */\n $dbObject = Zend_Registry::get('DB');\n\n $skipped = false;\n /**\n * @var $monitoringData App_Dto_MonitoringData\n */\n foreach ($this->getMonitoringDataList() as $monitoringData) {\n $dbId = $this->getDbId();\n if ($this->alreadyInDb($monitoringData, $dbId)) {\n $skipped = true; //just needed for the output message\n } else {\n $insert = array(\n 'sourceId' => $dbId,\n 'metricId' => $monitoringData->getMetricId(),\n 'value' => $monitoringData->getValue(),\n 'timestamp' => $monitoringData->getTimestamp()\n );\n\n try {\n $dbObject->insert('Data', $insert);\n } catch (Exception $e) {\n echo $e->getMessage();\n }\n }\n }\n\n if ($skipped) echo \"skipped some data, due to duplicates\\n\";\n\n echo \"\\nsaved!\\n\";\n }",
"public function saveToDb()\n\t{\n\t\t$this->addDocument();\n\t\tparent::saveToDb();\n\t}",
"abstract public function save( $data );",
"public function save_to_db() {\r\n if ($this->id) {\r\n $stmt = $this->pdo->prepare(\"UPDATE contract SET\r\n companyName=:companyName,\r\n Signature=:Signature\r\n WHERE id=:identity\r\n \");\r\n $input_parameters = array(\r\n ':identity' => $this->id,\r\n ':companyName' => $this->companyName,\r\n ':sygnatura' => $this->signature,\r\n );\r\n $upload = $stmt->execute(\r\n $input_parameters\r\n );\r\n }\r\n//po��czenie z baz� i sprawdzenie czy ju� jest taka umowa\r\n else {\r\n $stmt = $this->pdo->prepare(\"SELECT * FROM contract WHERE Signature=:signature\");\r\n $stmt->bindParam(':signature', $this->signature, PDO::PARAM_STR);\r\n\r\n if ($stmt->rowCount() > 0)\r\n return self::SAVE_ERROR_DUPLICATE_SIGNATURE;\r\n $stmt = $this->pdo->prepare(\"INSERT INTO contract VALUES (NULL, :companyName, :signature,NULL, NULL )\");\r\n $upload = $stmt->execute(\r\n array(\r\n ':signature' => $this->signature,\r\n ':companyName' => $this->companyName\r\n )\r\n );\r\n }\r\n// komunikat o zapisie\r\n if ($upload)\r\n return self::SAVE_OK;\r\n else\r\n return self::SAVE_ERROR_DB;\r\n }",
"protected function saveData()\n\t{\n\t\treturn $this->saveDb();\n\t}",
"public function save() {}",
"public function save() {}",
"public function save() {}",
"public abstract function save();",
"function save();",
"function save();",
"static public function save ($data)\r\n {\r\n $con = mysqli_connect(self::$_dbHost, self::$_dbUserName, self::$_dbUserPwd, self::$_dbName);\r\n \r\n // connect to database\r\n if (!$con) {\r\n die('Could not connect: ' . mysql_error());\r\n }\r\n\t\telse{\r\n\t\t\techo \"konek anjing\";\r\n\t\t}\r\n \r\n // mysqli_select_db(self::$_dbName, $con);\r\n \r\n // delete old data\r\n mysqli_query($con, \"DELETE FROM points\");\r\n \r\n // insert data\r\n mysqli_query($con, \"INSERT INTO points (data) VALUES ($data)\");\r\n \r\n // close connection\r\n mysqli_close($con);\r\n }",
"function save() {\n $all_fields = ['id' => $this->id] + ['data' => JSON::encode($this->getData(true))];\n if($this->_just_created) {\n $ps = DB::connect(isset(self::$external_dsn)?self::$external_dsn:null)->prepare(\"\n insert into \".static::$table.\"(\".implode(\",\", array_keys($all_fields)).\")\n values (\".implode(\", \", array_map(function($field) {return \":$field\";}, array_keys($all_fields))).\")\n \");\n } else {\n $ps = DB::connect(isset(self::$external_dsn)?self::$external_dsn:null)->prepare(\"\n update \".static::$table.\"\n set \".implode(\", \", array_map(function($field) {return \"$field = :$field\";}, array_keys($all_fields))).\"\n where id = :id\n \");\n }\n foreach ($all_fields as $field => $value) {\n if (is_bool($value)) {\n $ps->bindValue($field, $value, \\PDO::PARAM_BOOL);\n } else {\n $ps->bindValue($field, $value);\n }\n }\n // Little cheat to get calculated data to be displayed in api call request\n $this->data = $this->getData();\n $ps->execute();\n $this->_just_created = false;\n return $this;\n }",
"public function save()\n {\n $sql = new Sql();\n\n $results = $sql->select(\n \"CALL sp_orders_save(:idorder, :idcart, :iduser, :idstatus, :idaddress, :vltotal)\",\n [\n ':idorder'=>$this->getidorder(),\n ':idcart'=>$this->getidcart(),\n ':iduser'=>$this->getiduser(),\n ':idstatus'=>$this->getidstatus(),\n ':idaddress'=>$this->getidaddress(),\n ':vltotal'=>$this->getvltotal()\n ]\n );\n\n if (count($results) > 0) {\n $this->setData($results[0]);\n }\n }",
"public function save()\n\t {\n\t\tif (isset($this->_advert->date) === true && isset($this->_advert->phone) === true)\n\t\t {\n\t\t\t$bigfile = new BigFile(\"base-\" . $this->_advert->phone, 10);\n\t\t\t$bigfile->addrecord($this->_advert->date);\n\t\t } //end if\n\n\t }",
"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 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 }",
"private function storeToDB() {\r\n\t\tDBQuery::getInstance() -> insert('INSERT INTO `CalculatedDailyNeeds`' . DBUtils2::buildMultipleInsertOnDuplikateKeyUpdate($this -> aArticleData));\r\n\t}",
"public function save()\n {\n $newPackage = [];\n foreach ($this->data as $key => $value){\n if(!isset($this->map[$key]))\n continue;\n $keyMapper = $this->map[$key];\n if(is_subclass_of($value, self::class)){\n $value->save();\n continue;\n }elseif (is_array($value)){\n foreach ($this->data as $model){\n if(is_subclass_of($value, self::class)){\n $model->save();\n }\n }\n }\n $newPackage[$keyMapper] = $value;\n }\n if(isset($this->data['id']) && $this->data['id'])\n $this->db->update($this->table, $newPackage, $this->data['id'], $this->key );\n else\n $this->db->insert($this->table, $newPackage);\n }",
"public function saveToDb()\n\t{\n\t\tparent::saveToDb();\n\t\t$this->insertAttachment();\n\t}",
"private static function save() {\n\t\tif(self::$data===null) throw new Excepton('Save before load!');\n\t\t$fp=fopen(self::$datafile,'w');\n\t\tif(!$fp) throw new Exception('Could not write data file!');\n\t\tforeach (self::$data as $item) {\n\t\t\tfwrite($fp,$item); // we use the __toString() here\n\t\t}\n\t\tfclose($fp);\n\t}",
"public function save($data);",
"public function save($data);",
"public function save($data);",
"public function save(){\n\t\t$v = get_object_vars($this);\n\t\tunset($v['TABLE']);\n\t\tunset($v['IS_UPDATING']);\n\t\t$key_s = \"\";\n\t\t$key_v = \"\";\n\t\tforeach($v as $key => $val){\n\t\t\t$key_s .= \"$key, \";\n\t\t\t$key_v .= \"'$val', \";\n\t\t}\n\t\t$key_s = substr_replace($key_s, '', strlen($key_s)-2);\n\t\t$key_v = substr_replace($key_v, '', strlen($key_v)-2);\n\t\tif($this->IS_UPDATING){\n\t\t\t$str = \"\";\n\t\t\tunset($v['id']);\n\t\t\tforeach($v as $key => $val){\n\t\t\t\t$str .= $key . \"='$val', \";\n\t\t\t}\n\t\t\t$str = substr_replace($str, '', strlen($str)-2);\n\t\t\t$query = \"UPDATE {$this->TABLE} SET $str WHERE id = {$this->id}\";\n\t\t} else {\n\t\t\t$query = \"INSERT INTO {$this->TABLE} ($key_s) VALUES ($key_v)\";\n\t\t}\n\t\t$q = parent::query($query);\n\t\treturn $q;\n\t}",
"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 backupData()\n {\n $this->load->dbutil();\n\n // Backup database dan dijadikan variable\n $backup = $this->dbutil->backup();\n\n // Load file helper dan menulis ke server untuk keperluan restore\n $this->load->helper('file');\n write_file('/backup/database/mybackup.zip', $backup);\n\n // Load the download helper dan melalukan download ke komputer\n $this->load->helper('download');\n force_download('mybackup.zip', $backup);\n }",
"function saveSQL($data,$filename,$remark)\r\n {\r\n $handle = fopen($filename,\"a\");\r\n fwrite($handle,\"-- --\".date(\"D M j G:i:s\").\" $remark\\n \".$data.\"\\n\");\r\n fclose($handle);\r\n }",
"public function save() {\n\t\tif (!empty($this->originalData)) {\n\t\t\t$query=\"UPDATE \";\t\n\t\t\tfor ($i=0; $i<count($this->originalData); $i++) {\n\t\t\t\tif (!isset($this->modifiedData)) {\n\t\t\t\t\t$this->modifiedData = $this->originalData;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\t$query=\"INSERT INTO \";\n\t\t}\n\t\t$query.=$this->table.' SET ';\n\t\tforeach ($this->modifiedData as $key=>$value) {\n\t\t\t$value = mysqli_real_escape_string($this->connection->connection,$value);\n\t\t\t$query.= '`'.$key .\"`='\".$value.'\\',';\n\t\t}\n\t\t$query = substr($query,0,-1);\n\t\tif (!empty($this->originalData)) {\n\t\t\t$query.=' WHERE '.self::$primaryKey[$this->table].'=\\''.$this->originalData[self::$primaryKey[$this->table]].\"'\";\n\t\t}\n\t\t$this->connection->query($query);\n\t\tif ($this->connection->getError()) {\n\t\t\treturn false;\n\t\t}\n\t\tif (empty($this->originalData)) {\n\t\t\t$this->originalData[self::$primaryKey[$this->table]] = $this->connection->getInsertID();\n\t\t}\n\t\t$this->originalData = array_merge($this->originalData,$this->modifiedData);\n\t\treturn true;\n\t}",
"public function save(array $data);",
"public function save()\n {\n if (count($this->toSave) <= 0)\n return;\n \n $columns = [ ];\n $params = [ ];\n $to_save = [ ];\n array_walk($this->toSave, function($value, $key) use (&$columns, &$to_save, &$params) {\n if ($this->insert):\n $columns[] = $key;\n $to_save[] = \"?\";\n else:\n $to_save[] = \"{$key} = ?\";\n endif;\n\n $params[] = $value;\n });\n $to_save = implode(', ', $to_save);\n\n if ($this->insert):\n $columns = implode(', ', $columns);\n $primary_key = database()->run('INSERT INTO ' . $this->table . '(' . $columns . ') VALUES(' . $to_save . ')', $params);\n \n $this->{$this->primaryKey} = $primary_key;\n $this->insert = false;\n else:\n $params[] = $this->{$this->primaryKey};\n database()->run('UPDATE ' . $this->table . ' SET ' . $to_save . ' WHERE ' . $this->primaryKey . ' = ?', $params);\n endif;\n \n $this->toSave = [ ];\n return $this;\n }",
"public function save():void;",
"protected function commit( $table, $data ) {\n\t\t$db_file = $this->root_directory . DIRECTORY_SEPARATOR . $table . '.json';\n\t\tfile_put_contents( $db_file, json_encode( array_values( $data ) ) );\n\t}",
"public function save($data): void;",
"function save() {\n if ($this->nid && $this->license_uri) {\n $data = serialize($this);\n $data = str_replace(\"'\", \"\\'\", $data);\n $result = db_query(\"INSERT INTO {creativecommons} (nid, data) VALUES (%d, '%s')\", $this->nid, $data);\n return $result;\n }\n return;\n }",
"function salva()\n\t{\n\t\trestauraConObj($this->mapa,$this->postgis_mapa);\n\t\t$this->mapa->save($this->arquivo);\n\t}",
"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 }",
"abstract protected function save($data);",
"public function save(PDO $dbh);",
"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_bitacora_dos($data)\n {\n $this->db->insert('bitacora_dos', $data);\n }",
"public function Save(){\r\n\t\t$this->db->save();\r\n\t}",
"public function saveToORM($params);",
"public function save() {\n\t\t\t\n\t\t}",
"public function save_all() {\n\t\t$this->save_api();\n\t\t$this->save_field_map();\n\t\t$this->save_import();\n\t\t$this->save_requirement_set();\n\t}",
"function get_save_code(){\n\t\tif (isset($this->id) && !$this->_new) {\n\t\t\t$sql = \"UPDATE `svg_info` 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 `svg_info` values |('\".addslashes($this->id).\"' , '\".addslashes($this->bf).\"' , '\".addslashes($this->type).\"' , '\".addslashes($this->lid).\"' , '\".addslashes($this->index).\"' , '\".addslashes($this->transform).\"' , '\".addslashes($this->value).\"' , '\".addslashes($this->fontsize).\"' , '\".addslashes($this->color).\"' , '\".addslashes($this->fill).\"' , '\".addslashes($this->stroke).\"' , '\".addslashes($this->points).\"' , '\".addslashes($this->txt).\"')\";\n\t\t}\n\t\treturn $sql;\n\t}",
"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 saving(Dataset $dataset)\n {\n\n }",
"public function saveToDB()\r\n\t{\r\n\t\t$date = new DateTime();\r\n\t\t$this->timestamp = date('Y-m-d H:i:s',$date->getTimestamp());\r\n\t\t$con = db_connect();\r\n\t\t\r\n\t\t//user, game, timestamp, text, building, card, location, icon\r\n\t\t$this->user!=null ? $userid=$this->user->getUserID() : $userid=null;\r\n\t\t$this->game!=null ? $gameID=$this->game->getGameID() : $gameID=null;\r\n\t\t$this->building!=null ? $buildingID=$this->building->getBuildingID() : $buildingID=null;\r\n\t\t$this->card!=null ? $cardID=$this->card->getCardID() : $cardID=null;\r\n\t\t\r\n\t\t$statement = $con->prepare('Insert into logger (user, game, timestamp, text, building, card, location, icon) values (?,?,?,?,?,?,?,?)');\r\n\t\t$statement->execute(array($userid,$gameID,$this->timestamp,$this->Text,$buildingID,$cardID,$this->location->locationID, $this->icon));\r\n\t\t\r\n\t\t$id = $con->lastInsertId();\r\n\t\t$con = null;\r\n\t\treturn $id;\r\n\t}",
"public function save()\n {\n if ( !$this->unsaved ) {\n // either nothing has been changed, or data has not been loaded, so\n // do nothing by returning early\n return;\n }\n\n $this->write();\n $this->unsaved = false;\n }",
"public function save()\n {\n return Query::update('officers', \"`ID`=\".$this->id, $this->initialVars, $this->getDBArray());\n }",
"public function saveDataToFile()\n {\n\n }",
"public function save() {\n\t\ttry {\n\t\t\t$sql = '';\n\n\t\t\tif($this->_state == self::STATE_CHANGED) {\n\t\t\t\t$sql = 'UPDATE ' . self::sanitize($this->_table->getProperty('name')) . ' SET ';\n\t\t\t\t\n\t\t\t\tforeach($this->_columns as $column) {\n\t\t\t\t\t$sql .= $column->name . ' = ';\n\t\t\t\t\t\n\t\t\t\t\tswitch($column->type) {\n\t\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_INT:\n\t\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_FLOAT:\n\t\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_DOUBLE:\n\t\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_DECIMAL:\n\t\t\t\t\t\t\tif($this->_data[$column->name]) {\n\t\t\t\t\t\t\t\t$sql .= $this->_data[$column->name] . ', ';\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$sql .= '\\'\\', ';\n\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\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_BOOL:\n\t\t\t\t\t\t\t$sql .= ($this->_data[$column->name] ? '1' : '0') . ', ';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_DATETIME:\n\t\t\t\t\t\t\tif(!$this->_data[$column->name]) {\n\t\t\t\t\t\t\t\t$sql .= 'NOW(), ';\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$sql .= '\\'' . date('Y-m-d H:i:s', strtotime($this->_data[$column->name])) . '\\', ';\n\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\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_DATE:\n\t\t\t\t\t\t\tif(!$this->_data[$column->name]) {\n\t\t\t\t\t\t\t\t$sql .= 'NOW(), ';\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$sql .= '\\'' . date('Y-m-d', strtotime($this->_data[$column->name])) . '\\', ';\n\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\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_TIME:\n\t\t\t\t\t\t\tif(!$this->_data[$column->name]) {\n\t\t\t\t\t\t\t\t$sql .= 'NOW(), ';\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$sql .= '\\'' . date('H:i:s', strtotime($this->_data[$column->name])) . '\\', ';\n\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\tdefault:\n\t\t\t\t\t\t\t$sql .= '\\'' . self::sanitize($this->_data[$column->name]) . '\\', ';\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$sql = substr($sql, 0, strlen($sql) - 2) . ' WHERE ' . self::sanitize($this->_key_primary->name) . ' = ' . self::sanitize($this->_data[$this->_key_primary->name]);\n\t\t\t}\n\t\t\telseif($this->_state == self::STATE_NEW) {\n\t\t\t\t$sql = 'INSERT INTO ' . self::sanitize($this->_table->getProperty('name')) . ' (';\n\t\t\t\t\n\t\t\t\tforeach($this->_columns as $column) {\n\t\t\t\t\tif(!$column->primary_key) {\n\t\t\t\t\t\t$sql .= self::sanitize($column->name) . ', ';\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$sql = substr($sql, 0, strlen($sql) - 2) . ') VALUES (';\n\t\t\t\t\n\t\t\t\tforeach($this->_columns as $column) {\n\t\t\t\t\tif(!$column->primary_key) {\n\t\t\t\t\t\tswitch($column->type) {\n\t\t\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_INT:\n\t\t\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_FLOAT:\n\t\t\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_DOUBLE:\n\t\t\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_DECIMAL:\n\t\t\t\t\t\t\t\tif($this->_data[$column->name]) {\n\t\t\t\t\t\t\t\t\t$sql .= $this->_data[$column->name] . ', ';\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$sql .= '\\'\\', ';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_BOOL:\n\t\t\t\t\t\t\t\t$sql .= ($this->_data[$column->name] ? '1' : '0') . ', ';\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_DATETIME:\n\t\t\t\t\t\t\t\tif(!$this->_data[$column->name]) {\n\t\t\t\t\t\t\t\t\t$sql .= 'NOW(), ';\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$sql .= '\\'' . date('Y-m-d H:i:s', strtotime($this->_data[$column->name])) . '\\', ';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_DATE:\n\t\t\t\t\t\t\t\tif(!$this->_data[$column->name]) {\n\t\t\t\t\t\t\t\t\t$sql .= 'NOW(), ';\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$sql .= '\\'' . date('Y-m-d', strtotime($this->_data[$column->name])) . '\\', ';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase \\Bedrock\\Model\\Column::FIELD_TYPE_TIME:\n\t\t\t\t\t\t\t\tif(!$this->_data[$column->name]) {\n\t\t\t\t\t\t\t\t\t$sql .= 'NOW(), ';\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$sql .= '\\'' . date('H:i:s', strtotime($this->_data[$column->name])) . '\\', ';\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t$sql .= '\\'' . self::sanitize($this->_data[$column->name]) . '\\', ';\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$sql = substr($sql, 0, strlen($sql) -2) . ')';\n\t\t\t}\n\t\t\t\n\t\t\t\\Bedrock\\Common\\Logger::info('Saving record with query: ' . $sql);\n\t\t\t$this->_connection->exec($sql);\n\t\t\t$this->_state = self::STATE_UNCHANGED;\n\t\t}\n\t\tcatch(\\PDOException $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('There was a problem saving the record to the database.');\n\t\t}\n\t\tcatch(\\Exception $ex) {\n\t\t\t\\Bedrock\\Common\\Logger::exception($ex);\n\t\t\tthrow new \\Bedrock\\Model\\Record\\Exception('An error was encountered and the record could not be saved.');\n\t\t}\n\t}",
"protected function prepareSaveStatement() {\n $fields = implode(',', $this->columns);\n\n $placeholders = [];\n foreach ($this->columns as $column) {\n $placeholders[] = ':' . $column;\n }\n $placeholders = implode(',', $placeholders);\n\n // Prepare our statement.\n return $this->connection->prepare(\"INSERT INTO {$this->table} ($fields) VALUES ($placeholders)\");\n }",
"public function begin(){\n $this->db->exec('SAVEPOINT xyz;');\n }",
"function savedb($code, $titre, $table){\n\t\t$sql = Config::sql_connect();\n\t\t$requete = $sql->prepare(\"INSERT INTO $table(titre, user_id, time, programme) VALUES(:titre, :user_id, :time, :programme)\");\n\t\t$requete->execute(array(\n\t\t\t'titre' => $titre,\n\t\t\t'user_id' => $_SESSION['id'],\n\t\t\t'time' => time(),\n\t\t\t'programme' => $code\n\t\t));\n\t\t$this->saved_db = true;\n\t}",
"function Save();",
"function get_save_code(){\n\t\tif (isset($this->id) && !$this->_new) {\n\t\t\t$sql = \"UPDATE `layer_points` 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 `layer_points` values |('\".addslashes($this->id).\"' , '\".addslashes($this->lid).\"' , '\".addslashes($this->name).\"' , '\".addslashes($this->lat).\"' , '\".addslashes($this->lon).\"' , '\".addslashes($this->alt).\"' , '\".addslashes($this->bf).\"' , '\".addslashes($this->lp_image).\"' , '\".addslashes($this->notes).\"')\";\n\t\t}\n\t\treturn $sql;\n\t}",
"public function save () {\r\n\t\tif (isset($_POST['data'])) {\r\n\t\t\t$data = stripslashes_deep($_POST['data']);\r\n\t\t\tif (!empty($data['preset']) && !empty($data['id'])) $data['preset'] = $data['id']; // Also override whatever preset we're seding\r\n\t\t\t$_POST['data'] = $data;\r\n\t\t}\r\n\t\tparent::save();\r\n\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 }",
"function saveToDb($original_id = \"\")\n\t{\n\t\tglobal $ilDB;\n\n\t\t$this->saveQuestionDataToDb($original_id);\n\n\t\t// save additional data\n\t\t$ilDB->manipulateF(\"DELETE FROM \" . $this->getAdditionalTableName() . \" WHERE question_fi = %s\", \n\t\t\tarray(\"integer\"),\n\t\t\tarray($this->getId())\n\t\t);\n\t\t\n\t\t$ilDB->insert(\n\t\t\t\t$this->getAdditionalTableName(),\n\t\t\t\tarray(\n\t\t\t\t\t'question_fi'\t=> array('integer',(int) $this->getId()),\n\t\t\t\t\t'vip_sub_id'\t=> array('integer',(int) $this->getVipSubId()),\n\t\t\t\t\t'vip_cookie'\t=> array('text',(string) $this->getVipCookie()),\n\t\t\t\t\t'vip_exercise'\t=> array('clob',(string) $this->getVipExercise()),\n\t\t\t\t\t'vip_lang'\t\t=> array('text', (string) $this->getVipLang()),\n\t\t\t\t\t'vip_exercise_id'\t=> array('integer',(string) $this->getVipExerciseId()),\n\t\t\t\t\t'vip_evaluation' => array('clob',(string) $this->getVipEvaluation()),\n\t\t\t\t\t'vip_result_storage' => array('integer',(string) $this->getVipResultStorage()),\n\t\t\t\t\t'vip_auto_scoring' => array('integer', (int) $this->getVipAutoScoring())\n\t\t\t\t)\n\t\t);\n\t\tparent::saveToDb($original_id);\n\t}",
"function saveWywyData($data) {\n if(is_array($data)) {\n $this->db->insert('int_wywy', $data); \n }\n }",
"function saveQuestionsToDb() \n\t{\n\t\tglobal $ilDB;\n\t\t// save old questions state\n\t\t$old_questions = array();\n\t\t$result = $ilDB->queryF(\"SELECT * FROM svy_svy_qst WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\tif ($result->numRows())\n\t\t{\n\t\t\twhile ($row = $ilDB->fetchAssoc($result))\n\t\t\t{\n\t\t\t\t$old_questions[$row[\"question_fi\"]] = $row;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// delete existing question relations\n\t\t$affectedRows = $ilDB->manipulateF(\"DELETE FROM svy_svy_qst WHERE survey_fi = %s\",\n\t\t\tarray('integer'),\n\t\t\tarray($this->getSurveyId())\n\t\t);\n\t\t// create new question relations\n\t\tforeach ($this->questions as $key => $value) \n\t\t{\n\t\t\t$next_id = $ilDB->nextId('svy_svy_qst');\n\t\t\t$affectedRows = $ilDB->manipulateF(\"INSERT INTO svy_svy_qst (survey_question_id, survey_fi, question_fi, heading, sequence, tstamp) VALUES (%s, %s, %s, %s, %s, %s)\",\n\t\t\t\tarray('integer','integer','integer','text','integer','integer'),\n\t\t\t\tarray($next_id, $this->getSurveyId(), $value, (strlen($old_questions[$value][\"heading\"])) ? $old_questions[$value][\"heading\"] : NULL, $key, time())\n\t\t\t);\n\t\t}\n\t}",
"public function save(){\n\n \t$sql = \"INSERT INTO \" . self::TABLENAME . \" (ora_decolare, destinatia, \n \t compania)\n \t\t\tVALUES ('$this->ora_decolare', '$this->destinatia', \n \t\t\t'$this->compania')\";\n\n \t$db = new Database(); // se creeaza conexiunea la baza de date\n \t$db->getConnection()->exec($sql);\n\n \treturn \"Datele au fost introduse cu succes.\";\n }"
] | [
"0.68676674",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.6664512",
"0.66578615",
"0.66575617",
"0.6649983",
"0.6649272",
"0.6627693",
"0.65946406",
"0.65873736",
"0.6572139",
"0.6558904",
"0.65231556",
"0.6506524",
"0.6490644",
"0.6490644",
"0.6490644",
"0.6490644",
"0.6490644",
"0.6463383",
"0.6418125",
"0.63866043",
"0.63863856",
"0.6378992",
"0.6371555",
"0.63697517",
"0.636399",
"0.636399",
"0.6362267",
"0.6311478",
"0.63065344",
"0.63065344",
"0.6257045",
"0.624401",
"0.62383366",
"0.623599",
"0.62122715",
"0.6208163",
"0.6200006",
"0.61989206",
"0.6183228",
"0.6176007",
"0.6165354",
"0.6165354",
"0.6165354",
"0.6149343",
"0.61439145",
"0.6114436",
"0.6110067",
"0.61013675",
"0.610115",
"0.6086521",
"0.60836923",
"0.6077774",
"0.6034047",
"0.60206443",
"0.6013603",
"0.60101974",
"0.60036033",
"0.59933895",
"0.5990342",
"0.5986338",
"0.59852904",
"0.59799653",
"0.597689",
"0.597661",
"0.5974329",
"0.59721893",
"0.5970748",
"0.5963365",
"0.5962799",
"0.59431094",
"0.5940548",
"0.5936474",
"0.5920842",
"0.5918946",
"0.5904085",
"0.58991665",
"0.58970535",
"0.58774847",
"0.5876323",
"0.5874715",
"0.5870716",
"0.5869632",
"0.5858338"
] | 0.0 | -1 |
Get names from RateBeer | function getName($str){
$value = preg_match_all('/<span itemprop=\"name\" class=\"vis\">(.*?)<\/span>/s',$str, $names);
$name = $names[0][0];
$name = strip_tags($name);
return $name;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNames() {}",
"public function getNames() {}",
"public function getNames() {}",
"public function getNames();",
"public function get_names()\n {\n }",
"public function getAllNames() {}",
"public function getNames()\n {\n return $this->_name;\n }",
"public function getNameList() {\n return $this->_get(2);\n }",
"public function getNameList() {\n return $this->_get(2);\n }",
"public function getNameList() {\n return $this->_get(2);\n }",
"public function getNameList() {\n return $this->_get(2);\n }",
"public function getNameList() {\n return $this->_get(2);\n }",
"public function getNameList() {\n return $this->_get(2);\n }",
"public function getNameList() {\n return $this->_get(2);\n }",
"public function getNameList() {\n return $this->_get(1);\n }",
"public function getValueFormatersNames(): array;",
"public function getNames() {\n return $this->names;\n }",
"public function getNameList() {\n return $this->_get(3);\n }",
"public function getNameList() {\n return $this->_get(3);\n }",
"public function getNameList() {\n return $this->_get(3);\n }",
"public function getNames()\n {\n return $this->names;\n }",
"public function getName()\n {\n return $this->_names;\n }",
"public function getNameRepeats()\n {\n return $this->nameRepeats;\n }",
"public function getName()\n {\n return 'Brad Mostert';\n }",
"public function getNameB()\n {\n return $this->name_b;\n }",
"public function getNames() {\n return $this->_names;\n }",
"public function names(): array;",
"public function names(): array;",
"public function __toString(){\n\n return $this->name.\" ( \".$this->rate.\" )\";\n }",
"function getName() ;",
"function getName() ;",
"function getName() ;",
"function getName() ;",
"public function get_name();",
"public function get_name();",
"public function get_name();",
"public function getNames(): array\n {\n $enumeration = $this->enumeration;\n $names = [];\n foreach ($this->getOrdinals() as $ord) {\n $names[] = $enumeration::byOrdinal($ord)->getName();\n }\n return $names;\n }",
"public function getNames() {\n\t\treturn $this->names;\n\t}",
"public function tradingNameList() {\n\n\t\ttry {\n\n\t\t\t$clients = ConnectContentClient::where('station_id', '=', \\Auth::User()->station->id)->whereNotNull('who')->get();\n\t\t\t$tradingNames = array();\n\t\t\tforeach($clients as $client) {\n\t\t\t\t$tradingNames[] = $client->who;\n\t\t\t}\n\n\t\t\treturn response()->json(array('code' => 0, 'msg' => 'Success', 'data' => $tradingNames));\n\n\t\t} catch(\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('code' => -1, 'msg' => $ex->getMessage()));\n\t\t}\n\t}",
"protected function names()\n {\n $names = [];\n\n foreach ($this->data as $key => $value) {\n if (is_int($key)) {\n $names[$value] = str_replace(['-', '_'], ' ', ucfirst(trim($value)));\n } else {\n $names[$key] = $value;\n }\n }\n\n return $names;\n }",
"public function getName() { return $this->data['name']; }",
"public static function allNames()\n {\n static $list;\n\n if ($list === null) {\n $list = [];\n $data = \\ResourceBundle::create(\\Locale::getDefault(), 'ICUDATA-curr')->get('Currencies');\n foreach ($data as $code => $values) {\n $list[$code] = $values[1];\n }\n }\n\n return $list;\n }",
"public function get_name()\n {\n }",
"public function get_name()\n {\n }",
"public function getRbName() {\n $rbNameQuery = \"select rb_number_name rbname from ebulk_rb_detail where rb_detail_id=1\";\n $rbName = $this->getDBRecords($rbNameQuery);\n return $rbName[0]['rbname'];\n }",
"function get_name() {\n\t\treturn $this->get_name_from_vtec();\t\n\t}",
"public function getDriverNames(): array;",
"public function cryptoNames()\n {\n $ticker = $this->ticker();\n\n return array_map(function($o) {\n return $o->name;\n }, $ticker);\n }",
"public function getName_ar()\n {\n return $this->name_ar;\n }",
"public function getName_ar()\n {\n return $this->name_ar;\n }",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"abstract public function get_name();",
"abstract public function get_name();",
"abstract public function get_name();",
"public function get_name()\n {\n // TODO: Implement get_name() method.\n }",
"public function getEventNames()/*# : array */;",
"public function RateType()\n {\n return [\n 'erate' => 'Electronic Rate',\n 'tt' => 'Telegrafic Transfer',\n 'tc' => 'Travellers Cheque',\n 'bn' => 'Bank Notes',\n ];\n }",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();"
] | [
"0.6409532",
"0.6409132",
"0.6409132",
"0.6375934",
"0.62565887",
"0.6104002",
"0.60389507",
"0.5930915",
"0.5930915",
"0.5930915",
"0.5930915",
"0.5930915",
"0.5930915",
"0.5930915",
"0.59252673",
"0.58987516",
"0.58270216",
"0.5816022",
"0.5816022",
"0.5816022",
"0.57544845",
"0.57482755",
"0.57177526",
"0.5714445",
"0.5704018",
"0.5692302",
"0.56840265",
"0.56840265",
"0.56796986",
"0.5636194",
"0.5636194",
"0.5636194",
"0.5636194",
"0.5634277",
"0.5634277",
"0.5634277",
"0.56336445",
"0.5628174",
"0.5570535",
"0.5559179",
"0.55497235",
"0.55494905",
"0.5543622",
"0.5543549",
"0.5537214",
"0.55257237",
"0.5512809",
"0.55090326",
"0.55081916",
"0.55081916",
"0.5501255",
"0.5501255",
"0.5501255",
"0.55001414",
"0.55001414",
"0.5499455",
"0.5499455",
"0.5499455",
"0.5499455",
"0.5499455",
"0.5499455",
"0.5499455",
"0.5499455",
"0.5499455",
"0.5499455",
"0.5499455",
"0.5499455",
"0.5499455",
"0.5499455",
"0.5499455",
"0.54783267",
"0.54783267",
"0.54783267",
"0.5454629",
"0.54517066",
"0.5449058",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964"
] | 0.0 | -1 |
Get names from RateBeer | function getAddress($str){
$street = preg_match_all('/<span itemprop=\"streetAddress\">(.*?)<\/span>/s', $str, $streetInfo);
$city = preg_match_all('/<span itemprop=\"addressLocality\">(.*?)<\/span>/s', $str, $cityInfo);
$state = preg_match_all('/<span itemprop=\"addressRegion\">(.*?)<\/span>/s', $str, $stateInfo);
$country = preg_match_all('/<span itemprop=\"addressCountry\">(.*?)<\/span>/s', $str, $countryInfo);
$postalCode = preg_match_all('/<span itemprop=\"postalCode\">(.*?)<\/span>/s', $str, $zipInfo);
$telephone = preg_match_all('/<span itemprop=\"telephone\">(.*?)<\/span>/s', $str, $telephoneInfo);
$Address['street'] = strip_tags($streetInfo[0][0]);
$Address['city'] = strip_tags($cityInfo[0][0]);
$Address['state'] = strip_tags($stateInfo[0][0]);
$Address['country'] = strip_tags($countryInfo[0][0]);
$Address['zipcode'] = strip_tags($zipInfo[0][0]);
$telephone = strip_tags($telephoneInfo[0][0]);
$Address['telephone'] = preg_replace('/\D+/', '', $telephone);
return $Address;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getNames() {}",
"public function getNames() {}",
"public function getNames() {}",
"public function getNames();",
"public function get_names()\n {\n }",
"public function getAllNames() {}",
"public function getNames()\n {\n return $this->_name;\n }",
"public function getNameList() {\n return $this->_get(2);\n }",
"public function getNameList() {\n return $this->_get(2);\n }",
"public function getNameList() {\n return $this->_get(2);\n }",
"public function getNameList() {\n return $this->_get(2);\n }",
"public function getNameList() {\n return $this->_get(2);\n }",
"public function getNameList() {\n return $this->_get(2);\n }",
"public function getNameList() {\n return $this->_get(2);\n }",
"public function getNameList() {\n return $this->_get(1);\n }",
"public function getValueFormatersNames(): array;",
"public function getNames() {\n return $this->names;\n }",
"public function getNameList() {\n return $this->_get(3);\n }",
"public function getNameList() {\n return $this->_get(3);\n }",
"public function getNameList() {\n return $this->_get(3);\n }",
"public function getNames()\n {\n return $this->names;\n }",
"public function getName()\n {\n return $this->_names;\n }",
"public function getNameRepeats()\n {\n return $this->nameRepeats;\n }",
"public function getName()\n {\n return 'Brad Mostert';\n }",
"public function getNameB()\n {\n return $this->name_b;\n }",
"public function getNames() {\n return $this->_names;\n }",
"public function names(): array;",
"public function names(): array;",
"public function __toString(){\n\n return $this->name.\" ( \".$this->rate.\" )\";\n }",
"function getName() ;",
"function getName() ;",
"function getName() ;",
"function getName() ;",
"public function get_name();",
"public function get_name();",
"public function get_name();",
"public function getNames(): array\n {\n $enumeration = $this->enumeration;\n $names = [];\n foreach ($this->getOrdinals() as $ord) {\n $names[] = $enumeration::byOrdinal($ord)->getName();\n }\n return $names;\n }",
"public function getNames() {\n\t\treturn $this->names;\n\t}",
"public function tradingNameList() {\n\n\t\ttry {\n\n\t\t\t$clients = ConnectContentClient::where('station_id', '=', \\Auth::User()->station->id)->whereNotNull('who')->get();\n\t\t\t$tradingNames = array();\n\t\t\tforeach($clients as $client) {\n\t\t\t\t$tradingNames[] = $client->who;\n\t\t\t}\n\n\t\t\treturn response()->json(array('code' => 0, 'msg' => 'Success', 'data' => $tradingNames));\n\n\t\t} catch(\\Exception $ex) {\n\t\t\t\\Log::error($ex);\n\t\t\treturn response()->json(array('code' => -1, 'msg' => $ex->getMessage()));\n\t\t}\n\t}",
"protected function names()\n {\n $names = [];\n\n foreach ($this->data as $key => $value) {\n if (is_int($key)) {\n $names[$value] = str_replace(['-', '_'], ' ', ucfirst(trim($value)));\n } else {\n $names[$key] = $value;\n }\n }\n\n return $names;\n }",
"public function getName() { return $this->data['name']; }",
"public static function allNames()\n {\n static $list;\n\n if ($list === null) {\n $list = [];\n $data = \\ResourceBundle::create(\\Locale::getDefault(), 'ICUDATA-curr')->get('Currencies');\n foreach ($data as $code => $values) {\n $list[$code] = $values[1];\n }\n }\n\n return $list;\n }",
"public function get_name()\n {\n }",
"public function get_name()\n {\n }",
"public function getRbName() {\n $rbNameQuery = \"select rb_number_name rbname from ebulk_rb_detail where rb_detail_id=1\";\n $rbName = $this->getDBRecords($rbNameQuery);\n return $rbName[0]['rbname'];\n }",
"function get_name() {\n\t\treturn $this->get_name_from_vtec();\t\n\t}",
"public function getDriverNames(): array;",
"public function cryptoNames()\n {\n $ticker = $this->ticker();\n\n return array_map(function($o) {\n return $o->name;\n }, $ticker);\n }",
"public function getName_ar()\n {\n return $this->name_ar;\n }",
"public function getName_ar()\n {\n return $this->name_ar;\n }",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"public function getName() {}",
"abstract public function get_name();",
"abstract public function get_name();",
"abstract public function get_name();",
"public function get_name()\n {\n // TODO: Implement get_name() method.\n }",
"public function getEventNames()/*# : array */;",
"public function RateType()\n {\n return [\n 'erate' => 'Electronic Rate',\n 'tt' => 'Telegrafic Transfer',\n 'tc' => 'Travellers Cheque',\n 'bn' => 'Bank Notes',\n ];\n }",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();",
"public function getName();"
] | [
"0.6409532",
"0.6409132",
"0.6409132",
"0.6375934",
"0.62565887",
"0.6104002",
"0.60389507",
"0.5930915",
"0.5930915",
"0.5930915",
"0.5930915",
"0.5930915",
"0.5930915",
"0.5930915",
"0.59252673",
"0.58987516",
"0.58270216",
"0.5816022",
"0.5816022",
"0.5816022",
"0.57544845",
"0.57482755",
"0.57177526",
"0.5714445",
"0.5704018",
"0.5692302",
"0.56840265",
"0.56840265",
"0.56796986",
"0.5636194",
"0.5636194",
"0.5636194",
"0.5636194",
"0.5634277",
"0.5634277",
"0.5634277",
"0.56336445",
"0.5628174",
"0.5570535",
"0.5559179",
"0.55497235",
"0.55494905",
"0.5543622",
"0.5543549",
"0.5537214",
"0.55257237",
"0.5512809",
"0.55090326",
"0.55081916",
"0.55081916",
"0.5501255",
"0.5501255",
"0.5501255",
"0.55001414",
"0.55001414",
"0.5499455",
"0.5499455",
"0.5499455",
"0.5499455",
"0.5499455",
"0.5499455",
"0.5499455",
"0.5499455",
"0.5499455",
"0.5499455",
"0.5499455",
"0.5499455",
"0.5499455",
"0.5499455",
"0.5499455",
"0.54783267",
"0.54783267",
"0.54783267",
"0.5454629",
"0.54517066",
"0.5449058",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964",
"0.54476964"
] | 0.0 | -1 |
THIS FUNCTION IS SET UP FOR RATEBEER | function getBeerList($str){
$info1 = preg_match_all('/<TR class=dataTableRowAlternate>(.*?)<\/TR>/s', $str, $beerInfo);
$info2 = preg_match_all('/<TR class=>(.*?)<\/TR>/s', $str, $beerInfo2);
$beerList = [];
array_push($beerList, $beerInfo[0]);
array_push($beerList, $beerInfo2[0]);
return $beerList;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function rate()\n {\n\n }",
"public function week_profit_8676fd8c296aaeC19bca4446e4575bdfcm_bitb64898d6da9d06dda03a0XAEQa82b00c02316d9cd4c8coin(){\r\n\t\t$this -> load -> model('account/auto');\r\n\t\t$this -> load -> model('account/customer');\r\n\t\t$this -> load -> model('account/activity');\r\n\t\t// die('Update');\r\n\t\t$date= date('Y-m-d H:i:s');\r\n\t\t$date1 = strtotime($date);\r\n\t\t$date2 = date(\"l\", $date1);\r\n\t\t$date3 = strtolower($date2);\r\n\t\tif (($date3 != \"sunday\")) {\r\n\t\t echo \"Die\";\r\n\t\t die();\r\n\t\t}\r\n\t\t$allPD = $this -> model_account_auto ->getPD20Before();\r\n\t\t$customer_id = '';\r\n\t\t$rate = $this -> model_account_activity -> get_rate_limit();\r\n\t\t// print_r($rate);die();\r\n\t\r\n\t\tintval(count($rate)) == 0 && die('2');\r\n\t\t$percent = floatval($rate['rate']);\r\n\t\t$this -> model_account_auto ->update_rate();\r\n\t\tforeach ($allPD as $key => $value) {\r\n\r\n\t\t\t$customer_id .= ', '.$value['customer_id'];\r\n\t\t\t\r\n\t\t\t$price = $percent/100;\r\n\t\t\t$amount = $price*$value['filled'];\r\n\t\t\t$amount = $amount*1000000;\r\n\t\t\t$this -> model_account_auto ->updateMaxProfitPD($value['id'],$amount);\r\n\t\t\t$this -> model_account_auto -> update_R_Wallet($amount,$value['customer_id']);\r\n\t\t\t$this -> model_account_auto -> update_R_Wallet_payment($amount,$value['id']);\r\n\t\t\t$this -> model_account_customer -> saveTranstionHistorys(\r\n \t$value['customer_id'],\r\n \t'Weekly rates', \r\n \t'+ '.($amount/1000000).' USD',\r\n \t'Earn '.$percent.'% from package '.$value['filled'].' USD',\r\n \t' ');\r\n\r\n\t\t\t$this -> matching_pnode($value['customer_id'], $amount);\r\n\t\t}\r\n\t\t\r\n\t\t// echo $customer_id;\r\n\t\tdie('Ok');\r\n\t\techo '1';\r\n\r\n\t}",
"public function unRate()\n {\n\n }",
"function heartRate ($age, $rest_pulse, $Max_heart_rate)\r\n{\r\n echo \"<div style=\\\"text-align:center\\\">\";\r\n echo \"<br>\";\r\n echo \"<b>Your current Max Heart Rate: </b>\";\r\n echo $Max_heart_rate;\r\n\r\n echo \"<br>\";\r\n echo \"<b>Allowable Max Heart Rate: </b> \";\r\n $maxHeartRate_ShouldBe = 220 - $age; \r\n echo $maxHeartRate_ShouldBe;\r\n\r\n echo \"<br>\";\r\n \r\n\r\n if ($age > 70)\r\n {\r\n echo \"<b>Ideal Target Heart Rate (HR) Zone (60-85%): 90 – 123</b>\";\r\n }\r\n\r\n else if ($age <=70 && $age>65)\r\n {\r\n echo \"<b>Ideal Target Heart Rate (HR) Zone (60-85%): 93 – 132</b>\";\r\n }\r\n\r\n else if ($age <=65 && $age>60)\r\n {\r\n echo \"<b>Ideal Target Heart Rate (HR) Zone (60-85%): 96 – 136</b>\";\r\n }\r\n\r\n else if ($age <=60 && $age>55)\r\n {\r\n echo \"<b>Ideal Target Heart Rate (HR) Zone (60-85%): 99 – 140</b>\";\r\n }\r\n\r\n else if ($age <=55 && $age>50)\r\n {\r\n echo \"<b>Ideal Target Heart Rate (HR) Zone (60-85%): 102 – 145</b>\";\r\n }\r\n\r\n else if ($age <=50 && $age>45)\r\n {\r\n echo \"<b>Ideal Target Heart Rate (HR) Zone (60-85%): 105 – 149</b>\";\r\n }\r\n\r\n else if ($age <=45 && $age>40)\r\n {\r\n echo \"<b>Ideal Target Heart Rate (HR) Zone (60-85%): 108 – 153</b>\";\r\n }\r\n\r\n else if ($age <=40 && $age>35)\r\n {\r\n echo \"<b>Ideal Target Heart Rate (HR) Zone (60-85%): 111 – 157</b>\";\r\n }\r\n\r\n else if ($age <=35 && $age>30)\r\n {\r\n echo \"<b>Ideal Target Heart Rate (HR) Zone (60-85%): 114 – 162</b>\";\r\n }\r\n\r\n else if ($age <=30 && $age>25)\r\n {\r\n echo \"<b>Ideal Target Heart Rate (HR) Zone (60-85%): 117 – 166</b>\";\r\n }\r\n\r\n else if ($age <=25 && $age>20)\r\n {\r\n echo \"<b>Ideal Target Heart Rate (HR) Zone (60-85%): 120 – 170</b>\";\r\n }\r\n\r\n else if ($age <= 20)\r\n {\r\n echo \"<b>Ideal Target Heart Rate (HR) Zone (60-85%): 100 - 120</b>\";\r\n }\r\n\r\n else\r\n {\r\n echo \"<b>Ideal Error in value entered. Please take the test again. Thanks!</b>\";\r\n }\r\n\r\n}",
"Function UpdateRates()\n{\n\t$query = \"SELECT *,NOW()-(last_update) as dif from HB_lastupdate\";\n \t$res = mysql_query($query);\n\t\n\tif(!$res)\n\t{\n\t\treturn;\n\t}\n\t$ar = mysql_fetch_array($res);\n\t$mydif = (int)($ar[dif]/60) - 1440;\n\tprint \"+++++++++++++++++++++\";$mydif;\n\tif($mydif>0)\n\t{\n\t $fp = fopen(\"http://www.bankofcanada.ca/fmd/exchange.htm\",\"r\");\n\t $x=0;$g=0;\n\t while(!feof($fp))\n\t {\n\t $buf = fgets($fp, 4096);\n\t if(eregi(\"U.S. Dollar\",$buf)) $x=4;\n\t if(eregi(\"</PRE>\",$buf)) $x=0;\n\t if($x==4)\n\t {\n if(!eregi(\"US/CA\",$buf))\n {\n \t$ime = explode(\"/\",$buf);\n\t\tprint_r($ime);\n\t\tprint \"<BR>\";\n \t$s = explode(\" \",$ime[1]);\n \t$r = array_reverse ($s);\n\n \tif(eregi(\"Euro de\",$buf))\n \t{\n \t $ime[0]=\"European Monetary Union EURO\";\n \t $s = explode(\" \",$buf);\n \t $r = array_reverse ($s);\n \t}\n\n \tif($ime[0]<>\"\" and $r[0]<>\"\")\n \t{\n \t $g++;\n \t if(eregi(\"U.S. Dollar\",$buf)) {$koef = (float)$r[0];}\n \t $k = ((float)$r[0]/(float)$koef);\n \t $usd = 1/$k;\n \t $res = mysql_query(\"SELECT * FROM HB_rates WHERE sifra=\\\"$ime[0]\\\"\");\n \t $num = mysql_num_rows($res);\n \t if($num > 0)\n\t\t {\n \tmysql_query(\"UPDATE HB_rates SET rate='$usd' WHERE sifra=\\\"$ime[0]\\\"\");\n\t\t }\n\t\t else\n\t\t {\n \t//mysql_query(\"INSERT INTO HB_rates VAUES( \t\t\t\t\t\t NULL,\t\t\t\t\t\t '$usd', sifra=\\\"$ime[0]\\\"\");\n\t\t }\n \t}\n if(eregi(\"Venezuelan Bolivar\",$buf)) $x=0;\n }\n\t }\n\t }\n\t fclose($fp);\n\t mysql_query(\"UPDATE HB_lastupdate SET last_update=NOW();\");\n\t}\n}",
"public function payWayPurchase()\n\t{\n\t}",
"function bill_recharge() {\n\t\t$coupon_id = $_REQUEST['coupon_id'];\n\t\t$coupon_amount = $_REQUEST['coupon_amount'];\n\t\t$recharge_user_id = $_REQUEST['recharge_user_id'];\n\t\t$wt_category = $_REQUEST['wt_category'];\n\t\t// wt_category = 11 pay bill\n\t\t$bill_category_id = $_REQUEST['bill_category_id'];\n\t\t// 1- Water, 2- Movies etc\n\t\t$biller_id = $_REQUEST['biller_id'];\n\t\t$bill_amount = $_REQUEST['bill_amount'];\n\t\t$bill_consumer_no = $_REQUEST['bill_consumer_no'];\n\t\t$wallet_type = 2;\n\t\t// 1- Credit, 2-Debit\n\t\t$bill_pay_status = 1;\n\n\t\t$wallet_category = '4';\n\t\t// 4- Cashback\n\t\t$current_date = date(\"Y-m-d h:i:sa\");\n\n\t\tif ($wt_category == '11') {\n\t\t\t$wt_desc = 'PaY Bill';\n\t\t}\n\n\t\tif (!empty($bill_consumer_no) && !empty($biller_id) && !empty($bill_amount) && !empty($recharge_user_id)) {\n\t\t\t//$bill_records = $this -> conn -> get_table_row_byidvalue('biller_user', 'biller_customer_id_no',$bill_consumer_no);\n\t\t\t$bill_records = $this -> conn -> get_table_field_doubles('biller_user', 'biller_customer_id_no', $bill_consumer_no, 'biller_id', $biller_id);\n\t\t\tif (!empty($bill_records)) {\n\t\t\t\t$bill_user_id = $bill_records['0']['biller_user_id'];\n\t\t\t\t$bill_pay_status = $bill_records['0']['bill_pay_status'];\n\t\t\t\tif ($bill_pay_status == '2') {\n\n\t\t\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $recharge_user_id);\n\t\t\t\t\t$wallet_amount = $records['0']['wallet_amount'];\n\t\t\t\t\t$admin = $this -> conn -> get_all_records('admin');\n\t\t\t\t\t$admin_wallet = $admin['0']['admin_wallet'];\n\t\t\t\t\t$transaction_id = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t$reffer_status = $records['0']['reffer_amount_status'];\n\t\t\t\t\t$reffer_user_id = $records['0']['reffer_user_id'];\n\t\t\t\t\tif ($wallet_amount >= $bill_amount) {\n\t\t\t\t\t\t//$transaction_id='5454';\n\t\t\t\t\t\t$recharge = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc', '\"' . $recharge_user_id . '\",\"' . $current_date . '\",\"' . $wallet_type . '\",\"' . $bill_amount . '\",\"' . $wt_category . '\",\"' . $transaction_id . '\",\"' . $wt_desc . '\"');\n\n\t\t\t\t\t\tif ($recharge) {\n\n\t\t\t\t\t\t\t$walletrecharge = $this -> conn -> insertnewrecords('bill_recharge', 'bill_user_id,bill_transaction_id,bill_category_id, biller_id,bill_consumer_no,bill_amount,bill_pay_date,bill_pay_status', '\"' . $recharge_user_id . '\",\"' . $transaction_id . '\",\"' . $bill_category_id . '\",\"' . $biller_id . '\",\"' . $bill_consumer_no . '\",\"' . $bill_amount . '\",\"' . $current_date . '\",\"' . $bill_pay_status . '\"');\n\n\t\t\t\t\t\t\t// change status of bill///\n\t\t\t\t\t\t\tif (!empty($walletrecharge)) {\n\n\t\t\t\t\t\t\t\t$data_frnd['bill_pay_status'] = 1;\n\t\t\t\t\t\t\t\t$data_frnd['bill_paid_date'] = $current_date;\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('biller_user', 'biller_user_id', $bill_user_id, $data_frnd);\n\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t//reffer amount when user first recharge then beifits add in frnd wallet\n\t\t\t\t\t\t\tif ($reffer_status == '2') {\n\t\t\t\t\t\t\t\t$frnd_records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $reffer_user_id);\n\n\t\t\t\t\t\t\t\t$reffer_records = $this -> conn -> get_all_records('reffer_amount');\n\t\t\t\t\t\t\t\t$refferal_amount = $reffer_records[0]['reffer_amount'];\n\t\t\t\t\t\t\t\t$user11_id = $frnd_records['0']['user_id'];\n\t\t\t\t\t\t\t\t$reffer_code_database = $frnd_records['0']['user_refferal_code'];\n\t\t\t\t\t\t\t\t$wallet = $frnd_records['0']['wallet_amount'];\n\t\t\t\t\t\t\t\t$frnd_number = $frnd_records['0']['user_contact_no'];\n\t\t\t\t\t\t\t\t$current_date = date(\"Y-m-d h:i:sa\");\n\t\t\t\t\t\t\t\t$transaction_id = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t\t\t\t$wt_type = 2;\n\t\t\t\t\t\t\t\t// credit in frnd acconnt\n\t\t\t\t\t\t\t\t$refferamount = $refferal_amount;\n\t\t\t\t\t\t\t\t// reffer amount\n\t\t\t\t\t\t\t\t$wt_category = 9;\n\t\t\t\t\t\t\t\t// refferal amount recieved in wallet\n\t\t\t\t\t\t\t\t$wt_desc = \"Refferal amount add in your wallet using by \" . $mobile;\n\n\t\t\t\t\t\t\t\t$add_reffer_money = $this -> conn -> insertnewrecords('refferal_records', 'refferal_user_id,refferal_frnd_id,refferal_amount,refferal_date', '\"' . $recharge_user_id . '\",\"' . $user11_id . '\",\"' . $refferamount . '\",\"' . $current_date . '\"');\n\n\t\t\t\t\t\t\t\t$add_money = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user11_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $refferamount . '\",\"' . $wt_category . '\",\"' . $transaction_id . '\",\"' . $wt_desc . '\",\"' . $frnd_number . '\"');\n\n\t\t\t\t\t\t\t\t// modify wallet of frnd using reffer code///\n\t\t\t\t\t\t\t\t$data_frnd['wallet_amount'] = $wallet + $refferal_amount;\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $user11_id, $data_frnd);\n\n\t\t\t\t\t\t\t\t// Cahnge user status when refeer amount add in frnd wallet\n\t\t\t\t\t\t\t\t$data12['reffer_amount_status'] = 1;\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $recharge_user_id, $data12);\n\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$cashback_record_id = $recharge_number;\n\t\t\t\t\t\t\tif (!empty($coupon_id)) {\n\n\t\t\t\t\t\t\t\t$coupon_apply = $this -> conn -> insertnewrecords('coupon_details', 'coupon_id, user_id,coupon_apply_date', '\"' . $coupon_id . '\",\"' . $recharge_user_id . '\",\"' . $current_date . '\"');\n\t\t\t\t\t\t\t\tif (!empty($coupon_apply)) {\n\t\t\t\t\t\t\t\t\t$transaction_id = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\n\t\t\t\t\t\t\t\t\t$walletrecharge = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $recharge_user_id . '\",\"' . $current_date . '\",\"' . $wallet_type . '\",\"' . $coupon_amount . '\",\"' . $wallet_category . '\",\"' . $transaction_id . '\",\"' . $w_desc . '\",\"' . $cashback_record_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\t$user_wallet = $wallet_amount - $bill_amount + $coupon_amount;\n\t\t\t\t\t\t\t$data['wallet_amount'] = $user_wallet;\n\n\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $recharge_user_id, $data);\n\t\t\t\t\t\t\t// Admin wallet update\n\t\t\t\t\t\t\t$admin_update_wallet = $admin_wallet + $bill_amount - $coupon_amount;\n\t\t\t\t\t\t\t$data_admin['admin_wallet'] = $admin_update_wallet;\n\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('admin', 'admin_id', 1, $data_admin);\n\n\t\t\t\t\t\t\t$res = file_get_contents(SITE_URL . \"/createpdf/pdf/\" . $bill_consumer_no);\n\t\t\t\t\t\t\t$post = array(\"status\" => \"true\", 'message' => \"Bill Pay Successfully\", \"bill_recharge_id\" => $recharge, 'consumer_no' => $bill_consumer_no, 'bill_amount' => $bill_amount, 'wallet_amount' => $user_wallet, 'bill_pay_date' => $current_date, 'transaction_id' => $transaction_id);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Pay bill failed\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$pay_amount = $recharge_amount - $wallet_amount;\n\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Not sufficent amount in your wallet\", 'wallet_amount' => $wallet_amount, 'bill_amount' => $bill_amount, 'payble_amount' => $pay_amount);\n\t\t\t\t\t\techo $this -> json($post);\n\t\t\t\t\t\texit();\n\t\t\t\t\t\t//$add=$this->add_money_recharge($recharge_user_id,$recharge_amount,$recharge_transaction_id);\n\t\t\t\t\t\t//$this->recharge();\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"These Bill already paid\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"Missing parameter\", 'recharge_user_id' => $recharge_user_id, 'bill_category_id' => $bill_category_id, 'biller_id' => $biller_id, 'wt_category' => $wt_category, 'consumer_no' => $bill_consumer_no, 'bill_amount' => $bill_amount);\n\t\t}\n\t\techo $this -> json($post);\n\t}",
"private function rateIt()\n {\n try\n {\n $request = $_POST;\n\n $types = array('videos','video','v','photos','photo','p','collections','collection','cl','users','user','u');\n\n //check if type sent\n if( !isset($request['type']) || $request['type']==\"\" )\n throw_error_msg(\"type not provided\");\n\n //check valid type\n if(!in_array($request['type'], $types))\n throw_error_msg(\"invalid type\");\n\n //check id \n if( !isset($request['id']) || $request['id']==\"\" )\n throw_error_msg(\"id not provided\"); \n\n //check valid id \n if( !is_numeric($request['id']) )\n throw_error_msg(\"invalid id\"); \n\n //check rating \n if( !isset($request['rating']) || $request['rating']==\"\" )\n throw_error_msg(\"rating not provided\"); \n\n //check valid rating \n if( !is_numeric($request['rating']) )\n throw_error_msg(\"invalid rating\");\n\n $type = mysql_clean($request['type']);\n $id = mysql_clean($request['id']);\n $rating = mysql_clean($request['rating']);\n \n switch($type)\n {\n case \"videos\":\n case \"video\":\n case \"v\":\n {\n global $cbvid;\n $rating = $rating*2;\n $result = $cbvid->rate_video($id,$rating);\n }\n break;\n\n case \"photos\":\n case \"photo\":\n case \"p\":\n {\n global $cbphoto;\n $rating = $rating*2;\n $result = $cbphoto->rate_photo($id,$rating);\n }\n break;\n\n case \"collections\":\n case \"collection\":\n case \"cl\":\n {\n global $cbcollection;\n $rating = $rating*2;\n $result = $cbcollection->rate_collection($id,$rating);\n }\n break;\n\n case \"users\":\n case \"user\":\n case \"u\":\n {\n global $userquery;\n $rating = $rating*2;\n $result = $userquery->rate_user($id,$rating);\n }\n break;\n }\n\n if( error() )\n {\n throw_error_msg(error('single')); \n }\n else\n {\n $data = array('code' => \"204\", 'status' => \"success\", \"msg\" => \"success\", \"data\" => $result);\n $this->response($this->json($data)); \n } \n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage()); \n }\n\n }",
"function interestRate($item_id){\n\t\treturn 0.1;\n\t}",
"function CreateTravelRate() {\r\n $conn = conn();\r\n $sql = \"INSERT INTO `travelrates`(`TravelCode`, `TravelAmount`, `Modified`, `ModifiedBy`) \r\n VALUES ('$this->TravCode','$this->TravRate',NOW(),'$this->ModifiedBy')\";\r\n if ($conn->exec($sql)) {\r\n return 1;\r\n } else {\r\n return 0;\r\n }\r\n $conn = NULL;\r\n }",
"function calculate_rate($rate, $type, $bits) {\n\n\t$output = 0;\n\n\tif ($type == \"overage\") {\n\t\tif ($bits > $rate[\"rate_overage\"][\"threshold\"]) {\n\t\t\t$bits = $bits - $rate[\"rate_overage\"][\"threshold\"];\n\t\t}else{\n\t\t\t$bits = 0;\n\t\t}\t\n\t\t$multi = unit_multi($rate[\"rate_overage\"][\"unit\"]);\n\t\t$output = ($bits / $multi) * $rate[\"rate_overage\"][\"amount\"];\n\t} elseif ($type == \"committed\") {\n\t\tif ($bits > $rate[\"rate_overage\"][\"threshold\"]) {\n\t\t\t$bits = $rate[\"rate_overage\"][\"threshold\"];\n\t\t}\t\n\t\t$multi = unit_multi($rate[\"rate_committed\"][\"unit\"]);\n\t\t$output = ($bits / $multi) * $rate[\"rate_committed\"][\"amount\"];\n\t\tif (isset($rate[\"rate_committed\"][\"minimum\"])) {\n\t\t\tif ($output < $rate[\"rate_committed\"][\"minimum\"]) {\n\t\t\t\t$output = $rate[\"rate_committed\"][\"minimum\"];\n\t\t\t}\n\t\t}\n\t} elseif ($type == \"regular\") {\n\t\t$multi = unit_multi($rate[\"rate\"][\"unit\"]);\n\t\t$output = ($bits / $multi) * $rate[\"rate\"][\"amount\"];\n\t\tif (isset($rate[\"rate\"][\"minimum\"])) {\n\t\t\tif ($output < $rate[\"rate\"][\"minimum\"]) {\n\t\t\t\t$output = $rate[\"rate\"][\"minimum\"];\n\t\t\t}\n\t\t}\n\t} elseif ($type == \"fixed\") {\n\t\t$output = $rate[\"rate_fixed\"][\"amount\"];\n\t}\n\t\n\treturn round($output, 4);\n\n}",
"function intRate($type=null){\n\t\tglobal $driver;\n if($type==2){\n return 11.1;\n }else{\n $sql =\t\"SELECT interestrate FROM settings\"; //Retrieve the interest rate\n if($results\t= $driver->perform_request($sql)):\n $row\t= $driver->load_data($results,MYSQL_ASSOC);\n $interest = ($row['interestrate']>0)?($row['interestrate']):20;\n else:\n die('<p class=\"error\">Interest rate Error: '.mysql_error().'</p>');\n endif;\n return $interest; //The interest rate\n }\n}",
"protected function setOfferValue ()\n {\n $this->request->coupon_benefits[ $this->offerNature ] = $this->offer->rate;\n }",
"function update($mult){\nglobal $hrsPerSample,$sumpRate,$sumpCnt,$rainRate,$rainCnt,$oldRainCnt,$pwrCnt,$curPwrCnt,$pwrTime,$curPwrTime,$StempCnt,$StempAvg,$StempSum,$RtempCnt,$RtempAvg,$RtempSum,$sample,$oldSumpCnt,$daysAgo,$rainTot,$rainTotOld,$rainZero,$rzThresh,$logtime,$lineTS,$now,$WtempCnt,$WtempAvg,$WtempSum,$OtempCnt,$OtempAvg,$OtempSum,$waterRate,$waterCnt,$oldWaterCnt,$waterTot,$waterTotOld,$waterZero,$wzThresh,$spinnerCal;\n\nif ($mult> 100) {$mult=100;} # just in case\n\n// here's a timestamp in days everybody can use, indexed by $sample:\n$daysAgo[]=($lineTS-$now)/(3600*24);\n\n\n//print \"Sample $sample sumpCnt $sumpCnt oldSumpCnt $oldSumpCnt\\n\";\n$sumpRate[$sample]=$mult*($sumpCnt-$oldSumpCnt)/$hrsPerSample; # cycles/hr\nif($sumpRate[$sample]<0){$sumpRate[$sample]=\"\";}\n$oldSumpCnt=$sumpCnt;\n\n\n//$rainRate[$sample]=$mult*((($rainCnt-$oldRainCnt)/$hrsPerSample)/100)+.0048; //inches/hr\n$rainRate[$sample]=$mult*((($rainCnt-$oldRainCnt)/$hrsPerSample)/100); //inches/hr\nif($rainRate[$sample]<0){$rainRate[$sample]=\"\";}\n$oldRainCnt=$rainCnt;\n//print \"$sample:$rainRate[$sample]<br>\\n\";\n\n\nif($rainCnt<$rainTotOld){$rainTotOld=$rainCnt;}\n$rainTot[$sample]=($rainCnt-$rainTotOld)/100;\nif(($rainRate[$sample]==0) && ($rainTot[$sample]>0)){$rainZero++;}\nelse{$rainZero=0;}\nif($rainZero>$rzThresh){$rainTotOld=$rainCnt;}\n//print \"$sample:$rainCnt[$sample]<br>\\n\";\n\t\t\n\t\t\n$waterRate[$sample]=$mult*((($waterCnt-$oldWaterCnt)/$hrsPerSample)/$spinnerCal); //gal/hr?\nif($waterRate[$sample]<0){$waterRate[$sample]=\"\";}\n$oldWaterCnt=$waterCnt;\n//print \"$sample:$rainRate[$sample]<br>\\n\";\n\n\nif($waterCnt<$waterTotOld){$waterTotOld=$waterCnt;}\n$waterTot[$sample]=(($waterCnt-$waterTotOld)/$spinnerCal);\nif(($waterRate[$sample]==0) && ($waterTot[$sample]>0)){$waterZero++;}\nelse{$waterZero=0;}\nif($waterZero>$wzThresh){$waterTotOld=$waterCnt;}\n//print \"$sample:w:$waterTot[$sample]<br>\\n\";\n\t\t\n\t\t\n$pC=$curPwrCnt-$oldPwrCnt;\n$pwrCnt[$sample]=($pC<0)?\"\":$pC;\n$oldPwrCnt=$curPwrCnt;\n\n\n$pT=$curPwrTime-$oldPwrTime;\n$pwrTime[$sample]=($pT<0)?\"\":$pT;\n$oldPwrTime=$curPwrTime;\n\n\nif($StempCnt!=0){$StempAvg[$sample]=$StempSum/$StempCnt+.04;}\nelse{$StempAvg[$sample]=\"\";}\n$StempSum=0;$StempCnt=0;\n\n\t\t\nif($RtempCnt!=0){$RtempAvg[$sample]=$RtempSum/$RtempCnt+.04;}\nelse{$RtempAvg[$sample]=\"\";}\n$RtempSum=0;$RtempCnt=0;\n\t\t\nif($WtempCnt!=0){$WtempAvg[$sample]=$WtempSum/$WtempCnt+.04;}\nelse{$WtempAvg[$sample]=\"\";}\n$WtempSum=0;$WtempCnt=0;\n\n\t\t\nif($OtempCnt!=0){$OtempAvg[$sample]=$OtempSum/$OtempCnt+.04;}\nelse{$OtempAvg[$sample]=\"\";}\n$OtempSum=0;$OtempCnt=0;\n\n//print\"S R W O $StempAvg[$sample] $RtempAvg[$sample] $WtempAvg[$sample] $OtempAvg[$sample] <br>\\n\";\n\t\t\n$sample++;\n//print \".\";\n\n\n}",
"public function payout()\n\t{\n\t}",
"public function getStoreToBaseRate();",
"public function pay();",
"public function deliveryPriceDhaka()\n {\n }",
"public function getExchangeRate();",
"function ciniki_sapos_simpleshiprateUpdate(&$ciniki) {\n //\n // Find all the required and optional arguments\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'prepareArgs');\n $rc = ciniki_core_prepareArgs($ciniki, 'no', array(\n 'tnid'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Tenant'),\n 'rate_id'=>array('required'=>'yes', 'blank'=>'no', 'name'=>'Shipping Rate'),\n 'country'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Country'),\n 'province'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Province'),\n 'city'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'City'),\n 'minimum_amount'=>array('required'=>'no', 'blank'=>'yes', 'name'=>'Invoice Total'),\n 'rate'=>array('required'=>'no', 'blank'=>'no', 'name'=>'Shipping Rate'),\n ));\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $args = $rc['args'];\n if( isset($args['minimum_amount']) ) {\n $args['minimum_amount'] = preg_replace('/[^0-9\\.]/', '', $args['minimum_amount']);\n }\n if( isset($args['rate']) ) {\n $args['rate'] = preg_replace('/[^0-9\\.]/', '', $args['rate']);\n }\n\n //\n // Make sure this module is activated, and\n // check permission to run this function for this tenant\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'sapos', 'private', 'checkAccess');\n $rc = ciniki_sapos_checkAccess($ciniki, $args['tnid'], 'ciniki.sapos.simpleshiprateUpdate');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Start transaction\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionStart');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionRollback');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbTransactionCommit');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'dbAddModuleHistory');\n $rc = ciniki_core_dbTransactionStart($ciniki, 'ciniki.sapos');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the Shipping Rate in the database\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate');\n $rc = ciniki_core_objectUpdate($ciniki, $args['tnid'], 'ciniki.sapos.simpleshiprate', $args['rate_id'], $args, 0x04);\n if( $rc['stat'] != 'ok' ) {\n ciniki_core_dbTransactionRollback($ciniki, 'ciniki.sapos');\n return $rc;\n }\n\n //\n // Commit the transaction\n //\n $rc = ciniki_core_dbTransactionCommit($ciniki, 'ciniki.sapos');\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n\n //\n // Update the last_change date in the tenant modules\n // Ignore the result, as we don't want to stop user updates if this fails.\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'updateModuleChangeDate');\n ciniki_tenants_updateModuleChangeDate($ciniki, $args['tnid'], 'ciniki', 'sapos');\n\n //\n // Update the web index if enabled\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'hookExec');\n ciniki_core_hookExec($ciniki, $args['tnid'], 'ciniki', 'web', 'indexObject', array('object'=>'ciniki.sapos.simpleshiprate', 'object_id'=>$args['rate_id']));\n\n return array('stat'=>'ok');\n}",
"protected function get_email_rate_limit()\n {\n }",
"function formel_kampf($a_count,$v_count,$a_ang,$v_def,$trefferQuote = 10,$rapidfire = 1)\n{\n $schaden = rand(60,100);\n //28.12.2011 - nun echtes RF\n $schuss = $a_count;// * max(1,$rapidfire);\n \n if($schuss < 0)\n\t\techo \"komische anzahl $a_count<br>\";\n\t$treffer = ($schuss * (rand($trefferQuote,100)/100));\n \n\t\n\t$angWert = $treffer * ($schaden / 100) * $a_ang;\n\t\n\t//$iRest = max(round((1 / ($v_def)) * (($v_count * $v_def) - ($angWert)) ),0);\n $iTmp = ((($v_def * $v_count) - $angWert) / ($v_def * $v_count)) * $v_count;\n $iTmp = max($iTmp,0);\n $iAbsorb = $v_def * ($v_count - $iTmp);\n \n $iRest = ceil($iTmp);\n //$iRest = (round(($v_count / ($v_count * $v_def)) * (($v_count * $v_def) - ($angWert)) ));\n\n\t//echo \"($v_count / ($v_count * $v_def)) * (($v_count * $v_def) - ($angWert)) = $iRest<br/>\";\n\t\n\treturn array(\"rest\" => $iRest, \"schuss\" => $schuss, \"treffer\" => $treffer, \"schaden\" => $angWert, \"absorb\" => $iAbsorb);\n}",
"private function _update_currency_conversion_rate(){\n\t\t\t$query = \"SELECT `serial_num`, `\".$this->table_fields['currency_iso_code'].\"` as 'currency_iso_code' FROM `\" . $this->class_settings['database_name'] . \"`.`\".$this->table_name.\"` where `record_status`='1' AND `modification_date` < \".(date(\"U\") - (3600*24));\n\t\t\t$query_settings = array(\n\t\t\t\t'database' => $this->class_settings['database_name'] ,\n\t\t\t\t'connect' => $this->class_settings['database_connection'] ,\n\t\t\t\t'query' => $query,\n\t\t\t\t'query_type' => 'SELECT',\n\t\t\t\t'set_memcache' => 1,\n\t\t\t\t'tables' => array( $this->table_name ),\n\t\t\t);\n \n //get exchange rate\n $all_country_list = execute_sql_query($query_settings);\n\t\t\t$return = array();\n \n\t\t\tif( is_array( $all_country_list ) && ! empty( $all_country_list ) ){\n\t\t\t\t$query_settings['query_type'] = 'UPDATE';\n \n $first = true;\n foreach( $all_country_list as $val ){\n\t\t\t\t\tif( $val['currency_iso_code'] ){\n $json = file_get_contents('http://rate-exchange.appspot.com/currency?from=USD&to='.strtoupper($val['currency_iso_code']) );\n if($json)$cur = json_decode($json, true);\n if( isset( $cur['rate'] ) && $cur['rate'] ){\n $return[] = $cur;\n \n $query_settings['query'] = \"UPDATE `\" . $this->class_settings['database_name'] . \"`.`\".$this->table_name.\"` SET `\".$this->table_fields['conversion_rate'].\"`= '\".$cur['rate'].\"' WHERE `serial_num`='\".$val['serial_num'].\"' \";\n \n execute_sql_query($query_settings);\n \n if( $first ){\n $query_settings['tables'] = array();\n $query_settings['set_memcache'] = 0;\n $first = false;\n }\n }\n }\n\t\t\t\t}\n \n $this->class_settings[ 'do_not_check_cache' ] = 1;\n $this->_get_country_list();\n }\n \n return $return;\n }",
"public function testGetRateLimits()\n {\n }",
"function beforeSave(){\n\t\t\t// Get the rate\n\t\t\t$rate = 1 / $this->_getRate();\n\n\t\t\t// Convert it back to USD\n\t\t\tif(!empty($this->data['Bidbutler']['minimum_price'])){\n\t\t\t\t$this->data['Bidbutler']['minimum_price'] = $this->data['Bidbutler']['minimum_price'] * $rate;\n\t\t\t}\n\n\t\t\tif(!empty($this->data['Bidbutler']['maximum_price'])){\n\t\t\t\t$this->data['Bidbutler']['maximum_price'] = $this->data['Bidbutler']['maximum_price'] * $rate;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}",
"function ateliers_autoriser(){}",
"function adjust_shipping_rate($rates)\n{\n foreach ($rates as $rate) {\n if ($rate->id === 'cdek_shipping_method') {\n if (isset($_COOKIE['shipping_city_cost'])) {\n $rate->cost = $_COOKIE['shipping_city_cost'];\n $rate->label = $_COOKIE['shipping_name'];\n }\n }\n }\n return $rates;\n}",
"public function rate_setting() {\n $data['title'] = \"Channel Rate Settings\";\n $this->settings_model->_table_name = \"tbl_channel_rate\"; //table name\n $this->settings_model->_order_by = \"id\";\n $data['ginfo'] = $this->settings_model->get(); \n $data['subview'] = $this->load->view('admin/gateway/channelrate', $data, TRUE);\n $this->load->view('admin/_layout_main', $data);\n }",
"function applyWallet($Adv,$amount,$lastrate,$transferAmount){ \r\n\t$wallet = Wallet::get(array(\"id_user\" => $_SESSION[\"gak_id\"]));\r\n\t$totalToman = $amount*$lastrate + $lastrate*$transferAmount;\r\n\tif ($wallet->amount < $totalToman){\r\n\t\t$_SESSION['result']=\" موجودی کیف پول شما از مبلغ درخواست کمتر است. \";\r\n\t\t$_SESSION['alert']=\"warning\";\r\n\t\theader(\"location: /dinero/deal?amount=\".$_GET['amount'].\"&id=\".$_GET['id'].\"&balance=low\");\r\n\t}else{\r\n\t\t//update wallet and add transaction\r\n\t\t//insert\r\n\t\t$insert_wallettransaction=array(\r\n\t\t\t\t\"id_wallet\" => $wallet->id,\r\n\t\t\t\t\"type\" => \"withdraw\",\r\n\t\t\t\t\"amount\" => $totalToman,\r\n\t\t\t\t\"status\" => \"confirm\",\r\n\t\t\t\t\"time\" => date(\"Y-m-d H:i:s\")\r\n\t\t);\r\n\t\t$walletTransaction = Wallettransactions::insert($insert_wallettransaction);\r\n\t\t//update\r\n\t\t$arr_update=array(\r\n\t\t\t\t\"id\" => $wallet->id,\r\n\t\t\t\t\"amount\" => $wallet->amount - $totalToman\r\n\t\t);\r\n\t\tWallet::update($arr_update);\r\n\t\t//log\r\n\t\tAccountkitlog::insert(array(\"iduser\" => $_SESSION[\"gak_id\"],\r\n\t\t\t\t\"date\" => date(\"Y-m-d H:i:s\"), \"title\" => \"walletWithdraw\"));\r\n\t\t//trade\r\n\t\t\r\n\t\t$arr_insert=array(\r\n\t\t\t\t\"id_buyer\" => $_SESSION[\"gak_id\"],\r\n\t\t\t\t\"id_seller\" => $Adv->id_user,\r\n\t\t\t\t\"id_adv\" => $Adv->id,\r\n\t\t\t\t\"amount\" => $amount,\r\n\t\t\t\t\"exchange_rate\" => $lastrate,\r\n\t\t\t\t\"time\" => date(\"Y-m-d H:i:s\"),\r\n\t\t\t\t\"trade_status\" => \"buyerpaid\",\r\n\t\t\t\t\"buyerpay_status\" => \"confirm\",\r\n\t\t\t\t\"sellerpay_status\" => \"pending\",\r\n\t\t\t\t\"buyerpay_details\" => \"id:\".$walletTransaction.\"|Payment:Wallet|refID:\".date(\"YmdHis\"),\r\n\t\t\t\t\"sellerpay_details\" => \"\"\r\n\t\t);\r\n\t\t$Trade = Dinerotrade::insert($arr_insert);\r\n\t\t\r\n\t\t//update text transaction wallet\r\n\t\tWallettransactions::update(array(\"id\"=>$walletTransaction, \"text\"=>\"Withdraw from wallet, Trade #\".$Trade*951753 ));\r\n\t\t\r\n\t\t//update adv\r\n\t\t$updateAmount = $Adv->amount - $amount;\r\n\t\t$arr_update=array(\r\n\t\t\t\t\"id\" => $Adv->id,\r\n\t\t\t\t\"amount\" => $updateAmount\r\n\t\t);\r\n\t\tDineroadv::update($arr_update);\r\n\t\t\r\n\t\t//user logs\r\n\t\tAccountkitlog::insert(array(\r\n\t\t\t\t\"iduser\" => $_SESSION[\"gak_id\"],\r\n\t\t\t\t\"date\" => date(\"Y-m-d H:i:s\"),\r\n\t\t\t\t\"title\" => \"tradePaid\"));\r\n\t\t\t\r\n\t\t//send emails and sms\r\n\t\t$checkTrade=Dinerotrade::get(array(\"id\" => $Trade,\"id_buyer\" => $_SESSION[\"gak_id\"]));\r\n\t\t$seller = AccountKit::get(array(\"id\" => $checkTrade->id_seller));\r\n\t\t$buyer = AccountKit::get(array(\"id\" => $checkTrade->id_buyer));\r\n\t\t$sellerFullname = Acountkitparam::get(array(\"iduser\" => $checkTrade->id_seller, \"type\" => \"fullname\"));\r\n\t\t$buyerFullname = Acountkitparam::get(array(\"iduser\" => $checkTrade->id_buyer, \"type\" => \"fullname\"));\r\n\t\t$buyerBankname= Acountkitparam::get(array(\"iduser\" => $checkTrade->id_buyer, \"type\" => \"bankname\"));\r\n\t\t$buyerIban= Acountkitparam::get(array(\"iduser\" => $checkTrade->id_buyer, \"type\" => \"iban\"));\r\n\t\t$transferAmount = findTransferAmount($checkTrade->amount);\r\n\t\t$token = $GLOBALS['GCMS_SETTING']['dinero']['smstoken'];\r\n\t\t$params = array(\r\n\t\t\t\t'to' => $seller->number,\r\n\t\t\t\t'from' => 'Info',\r\n\t\t\t\t'message' => \"Trade for \".$checkTrade->amount .\"€ \"\r\n\t\t\t\t.\"https://24dinero.com/\"\r\n\t\t\t\t,\r\n\t\t);\r\n\t\t//sms_send($params,$token);\r\n\t\t\r\n\t\t//start send email\r\n\t\t$bodyStatusDineroSeller= '\r\n\t\t\t\t\t\t<div>\r\n <a href=\"#\"\r\n style=\"background-color:#D84A38;padding:10px;color:#ffffff;display:inline-block;font-family:tahoma;font-size:13px;font-weight:bold;line-height:33px;text-align:center;text-decoration:none;-webkit-text-size-adjust:none;\">\r\n\t\t\t\t\t\t\t\tدرخواست انتقال یورو، لطفا سریعا اقدام کنید\r\n\t\t\t\t\t\t\t </a>\r\n </div>\r\n\t\t\t\t\t';\r\n\t\t\r\n\t\t$bodyInfoSeller= \"\r\n\t\t\t\t <div>\r\n\t\t\t\t\r\nPayment has confirmed for your advertisements on 24dinero.com.\r\n <br>\r\nTransfer amount:\".$checkTrade->amount .\"€ <br>\r\nBank: \".$buyerBankname->text.\"<br>\r\nBeneficiary Name: \".$buyerFullname->text.\"<br>\r\nIBAN: \".$buyerIban->text.\"<br>\r\n\t\t\r\nYou can confirm or cancel the transaction on the following link: <br>\r\n\t\t\r\n<a href=\\\"https://\".$_SERVER['HTTP_HOST'].\"/dinero/transact/\".$checkTrade->id.\"\\\">\r\n\t\t\t\t\t\thttps://\".$_SERVER['HTTP_HOST'].\"/dinero/transact/\".$checkTrade->id.\"\r\n\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t\t\t\r\n </div>\r\n\t\t\t\t\t\";\r\n\t\t$bodyTransactionSeller= '\r\n\t\t\t\t\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" class=\"w320\" style=\"height:100%;\">\r\n <tr>\r\n <td valign=\"top\" class=\"mobile-padding\" style=\"padding:20px;\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n <tr>\r\n <td style=\"padding-right:20px\">\r\n <b>Euro request</b>\r\n </td>\r\n <td style=\"padding-right:20px\">\r\n <b>Euro Rate</b>\r\n </td>\r\n <td>\r\n <b>Total Toman</b>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n '.number_format($checkTrade->amount).'\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n '.number_format($checkTrade->exchange_rate).'\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n '.number_format($checkTrade->exchange_rate*$checkTrade->amount).'\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n\t\t\t\t\t\t'.number_format(floor($checkTrade->amount*2.5/100)).' <br>\r\n ٪2.5 Commission\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n '.number_format($checkTrade->exchange_rate).'\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n '.number_format((floor($checkTrade->amount*2.5/100)) * $checkTrade->exchange_rate).'\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n \t\t\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n Total amount:\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n <b>'.number_format($checkTrade->exchange_rate*$checkTrade->amount+ (floor($checkTrade->amount*2.5/100)) * $checkTrade->exchange_rate).'</b>\r\n </td>\r\n </tr>\r\n </table>\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n <tr>\r\n <td style=\"padding-top:35px;\">\r\n <table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\r\n <tr>\r\n \t\t\r\n <td style=\"padding:0px 0 15px 30px;\" class=\"mobile-block\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n \t\t\r\n <tr>\r\n <td>Euro Request: </td>\r\n <td> €'.number_format($checkTrade->amount).'</td>\r\n </tr>\r\n \t\t\r\n <tr>\r\n <td>Due by: </td>\r\n <td> '.date(\"Y-m-d\").'</td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n \t\t\r\n </table>\r\n </td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n </table>\r\n\t\t\t\t\t';\r\n\t\t$bodyStatusDineroBuyer= '\r\n\t\t\t\t\t\t<div>\r\n <a href=\"#\"\r\n style=\"background-color:#016910;padding:10px;color:#ffffff;display:inline-block;font-family:tahoma;font-size:13px;font-weight:bold;line-height:33px;text-align:center;text-decoration:none;-webkit-text-size-adjust:none;\">\r\n\t\t\t\t\t\t\t\tدرخواست انتقال یورو\r\n\t\t\t\t\t\t\t </a>\r\n </div>\r\n\t\t\t\t\t';\r\n\t\t\r\n\t\t$bodyInfoBuyer= \"\r\n\t\t\t\t <div>\r\n\t\t\t\t\r\nPayment has confirmed for your trade on 24dinero.com.\r\n <br>\r\nTransfer amount:\".$checkTrade->amount .\"€ <br>\r\nBank: \".$buyerBankname->text.\"<br>\r\nBeneficiary Name: \".$buyerFullname->text.\"<br>\r\nIBAN: \".$buyerIban->text.\"<br>\r\n\t\t\r\nYou can follow the transaction on the following link: <br>\r\n\t\t\r\n<a href=\\\"https://\".$_SERVER['HTTP_HOST'].\"/dinero/trade/\".$checkTrade->id.\"\\\">\r\n\t\t\t\t\t\thttps://\".$_SERVER['HTTP_HOST'].\"/dinero/trade/\".$checkTrade->id.\"\r\n\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t\t\t\r\n </div>\r\n\t\t\t\t\t\";\r\n\t\t$bodyTransactionBuyer= '\r\n\t\t\t\t\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"600\" class=\"w320\" style=\"height:100%;\">\r\n <tr>\r\n <td valign=\"top\" class=\"mobile-padding\" style=\"padding:20px;\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n <tr>\r\n <td style=\"padding-right:20px\">\r\n <b>Euro request</b>\r\n </td>\r\n <td style=\"padding-right:20px\">\r\n <b>Euro Rate</b>\r\n </td>\r\n <td>\r\n <b>Total Toman</b>\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n '.number_format($checkTrade->amount).'\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n '.number_format($checkTrade->exchange_rate).'\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n '.number_format($checkTrade->exchange_rate*$checkTrade->amount).'\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n\t\t\t\t\t\t'.number_format($transferAmount).' <br>\r\n Transfer Amount\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n '.number_format($checkTrade->exchange_rate).'\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n '.number_format($transferAmount* $checkTrade->exchange_rate).'\r\n </td>\r\n </tr>\r\n <tr>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7; \">\r\n \t\t\r\n </td>\r\n <td style=\"padding-top:5px;padding-right:20px; border-top:1px solid #E7E7E7;\">\r\n Total amount:\r\n </td>\r\n <td style=\"padding-top:5px; border-top:1px solid #E7E7E7;\" class=\"mobile\">\r\n <b>'.number_format($checkTrade->exchange_rate*$checkTrade->amount+ $transferAmount* $checkTrade->exchange_rate).'</b>\r\n </td>\r\n </tr>\r\n </table>\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n <tr>\r\n <td style=\"padding-top:35px;\">\r\n <table cellpadding=\"0\" cellspacing=\"0\" width=\"100%\">\r\n <tr>\r\n \t\t\r\n <td style=\"padding:0px 0 15px 30px;\" class=\"mobile-block\">\r\n <table cellspacing=\"0\" cellpadding=\"0\" width=\"100%\">\r\n \t\t\r\n <tr>\r\n <td>Euro Request: </td>\r\n <td> €'.number_format($checkTrade->amount).'</td>\r\n </tr>\r\n \t\t\r\n <tr>\r\n <td>Due by: </td>\r\n <td> '.date(\"Y-m-d\").'</td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n \t\t\r\n </table>\r\n </td>\r\n </tr>\r\n </table>\r\n </td>\r\n </tr>\r\n </table>\r\n\t\t\t\t\t';\r\n\t\t//sendingblue email\r\n\t\trequire_once(__COREROOT__.\"/module/dinero/libs/Mailin.php\");\r\n\t\trequire_once(__COREROOT__.\"/module/dinero/controller/emailTemplate.php\");\r\n\t\t$mailin = new Mailin('https://api.sendinblue.com/v2.0',$GLOBALS['GCMS_SETTING']['dinero']['sendinblueAPIKey']);\r\n\t\t//seller\r\n\t\t$maildata = array( \"to\" => array($seller->email=> $sellerFullname->text),\r\n\t\t\t\t\"from\" => array($GLOBALS['GCMS_SETTING']['dinero']['sendinblueSenderEmail']),\r\n\t\t\t\t\"subject\" => \"Trade Paid \".$_SERVER['HTTP_HOST'],\r\n\t\t\t\t\"html\" => emailTemp($bodyStatusDineroSeller,$bodyInfoSeller,$bodyTransactionSeller),\r\n\t\t\t\t\"headers\" => array(\"Content-Type\"=> \"text/html; charset=iso-8859-1\",\"X-param1\"=> \"value1\", \"X-param2\"=> \"value2\",\"X-Mailin-custom\"=>\"my custom value\", \"X-Mailin-IP\"=> \"102.102.1.2\", \"X-Mailin-Tag\" => \"My tag\")\r\n\t\t);\r\n\t\t$mailin->send_email($maildata);\r\n\t\t//buyer\r\n\t\t$maildata = array( \"to\" => array($buyer->email=> $buyerFullname->text),\r\n\t\t\t\t\"from\" => array($GLOBALS['GCMS_SETTING']['dinero']['sendinblueSenderEmail']),\r\n\t\t\t\t\"subject\" => \"Trade Paid \".$_SERVER['HTTP_HOST'],\r\n\t\t\t\t\"html\" => emailTemp($bodyStatusDineroBuyer,$bodyInfoBuyer,$bodyTransactionBuyer),\r\n\t\t\t\t\"headers\" => array(\"Content-Type\"=> \"text/html; charset=iso-8859-1\",\"X-param1\"=> \"value1\", \"X-param2\"=> \"value2\",\"X-Mailin-custom\"=>\"my custom value\", \"X-Mailin-IP\"=> \"102.102.1.2\", \"X-Mailin-Tag\" => \"My tag\")\r\n\t\t);\r\n\t\t$mailin->send_email($maildata);\r\n\t\t//\\\\\\\\\\end send email\r\n\t\t\r\n\t\t$_SESSION['result']=\"پرداخت شما با موفقیت انجام شد\";\r\n\t\t$_SESSION['alert']=\"success\";\r\n\t\theader(\"location: /dinero/trade/\".$Trade);\r\n\t\t\r\n\t}\r\n\t\r\n}",
"function calculate1($mode,$itemcode,$adate,$warehouse)\n{\n include \"config.php\";\n\t\t if($_SESSION['db'] == \"golden\")\n\t\t {\n\t\t $query9 = \"SELECT iac FROM ims_itemcodes WHERE code = '$code'\";\n $result9 = mysql_query($query9,$conn);\n while($row = mysql_fetch_assoc($result9))\n\t\t\t$iac = $row['iac'];\n\n\t\t\t$query = \"SELECT round((amount/quantity),2) AS price FROM ac_financialpostings WHERE date <= '$adate' AND itemcode = '$itemcode' AND coacode = '$iac' AND crdr = 'Dr' ORDER BY date DESC,id DESC LIMIT 1\";\n\t\t\t$result = mysql_query($query,$conn) or die(mysql_error());\n\t\t\t$rows = mysql_fetch_assoc($result);\n\t\t\t$amount = $rows['price'];\n\t\t\t//echo \"$code/$amount<br>\";\n\t\t\treturn $amount;\n\t\t }\n \n if ( $mode == \"Weighted Average\")\n { $wtqty = 0; \n $wtval = 0;\n\t $rtqty = 0;\n\t $rtval = 0;\n\t $cnt = 0;\n\t // Goods Receipt\n $query2 = \"SELECT * FROM pp_goodsreceipt WHERE code = '$itemcode' and aflag = '1' and adate <='$adate' \";\n $result2 = mysql_query($query2,$conn1);\n\t$cnt1 = mysql_num_rows($result2);\n while($row2 = mysql_fetch_assoc($result2))\n {\n\t $rate= 0;\n $wtqty = $wtqty + $row2['receivedquantity']; \n\t $wtval = $wtval + $row2['totalamount']; \n }\n\t //Initial Stock\n\t$query2 = \"SELECT * FROM ims_initialstock WHERE itemcode = '$itemcode' AND warehouse = '$warehouse'\";\n $result2 = mysql_query($query2,$conn1);\n\t$cnt2 = mysql_num_rows($result2); \n while($row2 = mysql_fetch_assoc($result2))\n {\n\t $rate= 0;\n $wtqty = $wtqty + $row2['quantity']; \n\t $wtval = $wtval + $row2['amount']; \n } \n\t //Direct Purchase\n\t $query2 = \"SELECT * FROM pp_sobi WHERE code = '$itemcode' and dflag = 0 and flag = 1 and warehouse = '$warehouse' and adate <= '$adate' \";\n $result2 = mysql_query($query2,$conn1);\n\t $cnt3 = mysql_num_rows($result2);\n while($row2 = mysql_fetch_assoc($result2))\n {\n\t $rate= 0;\n $wtqty = $wtqty + $row2['receivedquantity']; \n\t $wtval = $wtval + ($row2['receivedquantity'] * $row2['rateperunit']); \n }\n\t \n\t //Production\n\t \n\t $query2 = \"SELECT * FROM breeder_production WHERE itemcode = '$itemcode' and date1 <='$adate' \";\n $result2 = mysql_query($query2,$conn);\n\t $cnt4 = mysql_num_rows($result2);\n while($row2 = mysql_fetch_assoc($result2))\n {\n\t $wtqty = $wtqty + $row2['quantity'];\n\t $query21 = \"select * from ac_financialpostings where itemcode = '$itemcode' and trnum = '$row2[flock]' and type = 'Production' and date = '$row2[date1]'\";\n $result21 = mysql_query($query21,$conn);\n\t while($row21 = mysql_fetch_assoc($result21))\n { \n\t\t $wtval = $wtval + $row21['amount']; \n\t\t }\n\t\t\n }\n\t //PackSlip\n\t /* $query2 = \"SELECT * FROM oc_packslip WHERE itemcode = '$itemcode' and flag = '1' and adate <='$adate' \";\n $result2 = mysql_query($query2,$conn);\n\t $cnt5 = mysql_num_rows($result2);\n while($row2 = mysql_fetch_assoc($result2))\n {\n\t $rtqty = $rtqty + $row2['quantity'];\n\t\t $rtval = $rtval + round(($row2['prodprice'] * $row2['quantity']),2); \n } */\n\t //Direct Sales\n\t //Direct Purchase\n\t $query2 = \"SELECT * FROM oc_cobi WHERE code = '$itemcode' and dflag = 0 and warehosue = '$warehouse' and flag = 1 and adate <= '$adate' \";\n $result2 = mysql_query($query2,$conn);\n\t $cnt6 = mysql_num_rows($result2);\n while($row2 = mysql_fetch_assoc($result2))\n {\n\t $rate= 0;\n $wtqty = $wtqty + $row2['quantity']; \n\t $wtval = $wtval + ($row2['quantity'] * $row2['price']); \n }\n\t \n\t //Consumption\n\t /* $query2 = \"SELECT * FROM breeder_consumption WHERE itemcode = '$itemcode' and date2 <='$adate' \";\n $result2 = mysql_query($query2,$conn);\n\t $cnt7 = mysql_num_rows($result2);\n while($row2 = mysql_fetch_assoc($result2))\n {\n\t $rtqty = $rtqty + $row2['quantity'];\n\t\t $query21 = \"select * from ac_financialpostings where itemcode = '$itemcode' and trnum = '$row2[flock]' and type = 'Consumption' and date = '$row2[date2]' group by trnum \";\n $result21 = mysql_query($query21,$conn);\n\t while($row21 = mysql_fetch_assoc($result21))\n { \n\t\t $rtval = $rtval + $row21['amount']; \n\t\t }\n\t\t\n } */\n\t \n\t if ( $cnt == 0 AND $cnt1 == 0 AND $cnt2 == 0 AND $cnt3 == 0 AND $cnt4 == 0 AND $cnt5 == 0 AND $cnt6 == 0 AND $cnt7 == 0)\n\t {\n\t $val = $row1['stdcost'];\n\t }\n\t else\n\t { \n\t $wtqty = $wtqty;\n\t $wtval = $wtval;\n\t $val = round(($wtval/$wtqty),4);\n\t }\t \n }\n\n\n\n\n if ( $mode == \"Fifo\" )\n {\n $totqty = 0;\n $query2 = \"SELECT sum(quantity) as totqty FROM oc_packslip WHERE itemcode = '$itemcode' and adate <='$adate' \";\n $result2 = mysql_query($query2,$conn);\n\t while($row2 = mysql_fetch_assoc($result2))\n {\n\t $totqty = $row2['totqty'];\n\t }\n\t \n\t $purqty = 0;\n\t $bal = 0;\n\t $fifoval = 0;\n\t $pkqty = $row1['quantity'];\n $dumqty = $pkqty;\n\t $query2 = \"SELECT * FROM pp_goodsreceipt WHERE code = '$itemcode' and adate <='$adate' order by adate \";\n $result2 = mysql_query($query2,$conn);\n\t $cnt = mysql_num_rows($result2);\n while($row2 = mysql_fetch_assoc($result2))\n {\n\t if ( $dumqty > 0)\n\t\t{\n\t\t if ( $totqty > $purqty )\n\t\t {\n\t\t $purqty = $purqty + $row2['receivedquantity'];\n\t\t\t if ( $purqty > $totqty )\n\t\t\t {\n\t\t\t $bal = $purqty - $totqty;\n\t\t\t\t if ( bal > $pkqty )\n\t\t\t\t {\n\t\t\t\t $fifoval = $fifoval + round((round(($row2['totalamount']/$row2['receivedquantity']),4) * $dumqty),4);\n\t\t\t\t\t$dumqty = 0;\n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t $fifoval = $fifoval + $row2['totalamount'];\n\t\t\t\t $dumqty = $pkqty - $bal;\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t\t else\n\t\t {\n\t\t if ($row2['receivedquantity'] > $dumqty )\n\t\t\t{\n\t\t\t $fifoval = $fifoval + round((round(($row2['totalamount']/$row2['receivedquantity']),4) * $dumqty),4);\n\t\t\t $dumqty = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t $fifoval = $fifoval + $row2['totalamount'];\n\t\t\t $dumqty = $dumqty - $row2['receivedquantity'];\n\t\t\t}\t\t \n\t\t }\n\t\t}\n\t \n\t }\n\t if ( $cnt == 0)\n\t {\n\t $val = $row1['stdcost'];\n\t }\n\t else\n\t {\n\t $val = round(($fifoval/$pkqty),4);\n\t }\n\t \n }\n if ( $mode == \"Lifo\")\n {\n $totqty = 0;\n $query2 = \"SELECT sum(quantity) as totqty FROM oc_packslip WHERE itemcode = '$itemcode' and adate <='$adate' \";\n $result2 = mysql_query($query2,$conn);\n\t while($row2 = mysql_fetch_assoc($result2))\n {\n\t $totqty = $row2['totqty'];\n\t }\n\t \n\t $purqty = 0;\n\t $bal = 0;\n\t $fifoval = 0;\n\t $pkqty = $row1['quantity'];\n $dumqty = $pkqty;\n\t $query2 = \"SELECT * FROM pp_goodsreceipt WHERE code = '$itemcode' and adate <='$adate' order by adate DESC \";\n $result2 = mysql_query($query2,$conn);\n\t $cnt = mysql_num_rows($result2);\n while($row2 = mysql_fetch_assoc($result2))\n {\n\t if ( $dumqty > 0)\n\t\t{\n\t\t if ( $totqty > $purqty )\n\t\t {\n\t\t $purqty = $purqty + $row2['receivedquantity'];\n\t\t\t if ( $purqty > $totqty )\n\t\t\t {\n\t\t\t $bal = $purqty - $totqty;\n\t\t\t\t if ( bal > $pkqty )\n\t\t\t\t {\n\t\t\t\t $fifoval = $fifoval + round((round(($row2['totalamount']/$row2['receivedquantity']),4) * $dumqty),4);\n\t\t\t\t\t$dumqty = 0;\n\t\t\t\t }\n\t\t\t\t else\n\t\t\t\t {\n\t\t\t\t $fifoval = $fifoval + $row2['totalamount'];\n\t\t\t\t $dumqty = $pkqty - $bal;\n\t\t\t\t }\n\t\t\t }\n\t\t }\n\t\t else\n\t\t {\n\t\t if ($row2['receivedquantity'] > $dumqty )\n\t\t\t{\n\t\t\t $fifoval = $fifoval + round((round(($row2['totalamount']/$row2['receivedquantity']),4) * $dumqty),4);\n\t\t\t $dumqty = 0;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t $fifoval = $fifoval + $row2['totalamount'];\n\t\t\t $dumqty = $dumqty - $row2['receivedquantity'];\n\t\t\t}\t\t \n\t\t }\n\t\t}\n\t \n\t }\n\t if ( $cnt == 0)\n\t {\n\t $val = $row1['stdcost'];\n\t }\n\t else\n\t {\n\t $val = round(($fifoval/$pkqty),4);\n\t }\n \n }\nreturn $val;\n}",
"private function GENModulation() {\n\n\t\t$this->modulation = 'LORA';\n\n\t\t// set the LORA data rate\n\t\tif ( 'LORA' == $this->modulation ) {\n\t\t\t$dataRates = [\n\t\t\t\t'SF12BW125',\n\t\t\t\t'SF11BW125',\n\t\t\t\t'SF10BW125',\n\t\t\t\t'SF9BW125',\n\t\t\t\t'SF8BW125',\n\t\t\t\t'SF7BW125',\n\t\t\t\t'SF7BW250'\n\t\t\t];\n\n\t\t\t$this->data_rate = $dataRates[mt_rand(0,(sizeof($dataRates)-1))];\n\t\t} else {\n\t\t\t// set the FSK bit rate\n\n\t\t}\n\t}",
"function RBLBankPL($net_salary,$clubbed_emi,$company,$rblcategory,$DOB,$Company_Type,$Primary_Acc, $reqtenure, $reqloanamount)\n\t{\n\t\t $net_salary= $net_salary - $clubbed_emi;\n\t\t list($calterm, $calprint_term) = Calculate_Tenure($DOB, \"5\", \"62\");\n\t\t if(strlen($rblcategory)>1)\n\t\t{\n\t\t\t $category=$rblcategory;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$category=RBLcompanyCategorize($company);\n\t\t}\n\t\t \n\t\t//foir for all\n\t\t//multiplier for pvt ltd\n\t\t//compay catgory wise rates\n\t\t//for reqd tenure////////////////////////////////////////////////////////////////////////\n\t\tif($reqtenure>0)\n\t\t{\n\t\t\tif($reqtenure>$calprint_term)\n\t\t\t{\n\t\t\t\t$term = $calterm;\n\t\t\t\t$print_term = $calprint_term;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$term = $reqtenure*12;\n\t\t\t\t$print_term = $reqtenure;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t}\n\t\tif($term>0)\n\t\t{\n\t\t\tif($net_salary>35000)\n\t\t\t{\n\t\t\t\tif($print_term>60)\n\t\t\t\t{\n\t\t\t\t\t$term=60*12;\n\t\t\t\t\t$print_term=60;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$term=$print_term*12;\n\t\t\t\t\t$print_term=$print_term;\n\t\t\t\t}\n\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($print_term>48)\n\t\t\t\t{\n\t\t\t\t\t$term=48*12;\n\t\t\t\t\t$print_term=48;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$term=$print_term*12;\n\t\t\t\t\t$print_term=$print_term;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//for reqd tenure////////////////////////////////////////////////////////////////////////\n\t\tif($reqtenure>0)\n\t\t{\n\t\t\t$calterm=$term;\n\t\t\t$calprint_term=$print_term;\n\t\t\tif($reqtenure>$calprint_term)\n\t\t\t{\n\t\t\t\t$term = $calterm;\n\t\t\t\t$print_term = $calprint_term;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$term = $reqtenure*12;\n\t\t\t\t$print_term = $reqtenure;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t}\n\t\t//end\n\n\t\tif($category==\"CAT A\")\n\t\t{\n\t\t\tif($net_salary>75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 14;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<=75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 14.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary<=50000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 15;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t}\n\t\telseif($category==\"CAT B\")\n\t\t{\n\t\t\tif($net_salary>75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 14;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<=75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 15;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary<=50000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 15.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t}//CAT B\n\t\telseif($category==\"CAT C\")\n\t\t{\n\t\t\t$Loan_Amount=$reqloanamount;\n\t\t\tif($Loan_Amount>=300000)\n\t\t\t{\n\t\t\tif($net_salary>75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 15;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<=75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 15.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary<=50000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 17;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($net_salary>75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 15.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<=75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 16;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary<=50000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 17.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t}\n\t\t}//CAT C\n\t\telseif($category==\"CAT D\")\n\t\t{\n\t\t\t$Loan_Amount=$reqloanamount;\n\t\t\tif($Loan_Amount>=300000)\n\t\t\t{\n\t\t\tif($net_salary>75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 16;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<=75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 16.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary<=50000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 19;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($net_salary>75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 20;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<=75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 17.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary<=50000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 20;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$Loan_Amount=$reqloanamount;\n\t\t\tif($Loan_Amount>=300000)\n\t\t\t{\n\t\t\tif($net_salary>75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 16;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<=75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 16.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary<=50000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 19;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif($net_salary>75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 20;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<=75000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 17.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary<=50000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 20;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t//CAT D//rates\n\n\t\t//foir\n\t\t$princ=100000;\n\t\t$perlacemi=round($princ * $intr / (1 - (pow(1/(1 + $intr), $term))));\n\t\t\t\tif($net_salary>=100000)\n\t\t\t{\n\t\t\t\t$firstnet_salary=($net_salary* (70/100));\n\t\t\t\t$newnet_salary= $firstnet_salary;\n\t\t\t\t$finalloanamount_dbr=$newnet_salary/$perlacemi * 100000;\n\t\t\t}\n\t\telse if($net_salary>=50000 && $net_salary<100000)\n\t\t\t{\n\t\t\t\t$firstnet_salary=($net_salary* (65/100));\n\t\t\t\t$newnet_salary= $firstnet_salary;\n\t\t\t\t$finalloanamount_dbr=$newnet_salary/$perlacemi * 100000;\n\t\t\t}\n\t\telse if($net_salary>35000 && $net_salary<50000)\n\t\t\t{\n\t\t\t\t$firstnet_salary=($net_salary* (60/100));\n\t\t\t\t$newnet_salary= $firstnet_salary;\n\t\t\t\t$finalloanamount_dbr=$newnet_salary/$perlacemi * 100000;\n\t\t\t}\n\t\t\telse if($net_salary<=35000)\n\t\t\t{\n\t\t\t\t$firstnet_salary=($net_salary* (55/100));\n\t\t\t\t$newnet_salary= $firstnet_salary;\n\t\t\t\t$finalloanamount_dbr=$newnet_salary/$perlacemi * 100000;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$firstnet_salary=($net_salary* (55/100));\n\t\t\t\t$newnet_salary= $firstnet_salary;\n\t\t\t\t$finalloanamount_dbr=$newnet_salary/$perlacemi * 100000;\n\t\t\t} //foir end\n\n\t\t\t//multiplier for pvt. ltd companies only\n\t\t\tif($Company_Type==1)\n\t\t\t{\n\t\t\t\tif($net_salary>=100000)\n\t\t\t\t{\n\t\t\t\t\tif($term>=12 && $term<24)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 6;\n\t\t\t\t\t}\n\t\t\t\t\telseif($term>=24 && $term<36)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 12;\n\t\t\t\t\t}\n\t\t\t\t\telseif($term>=36 && $term<48)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 15;\n\t\t\t\t\t}\n\t\t\t\t\telseif(($term>=48 && $term<60))\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 18;\n\t\t\t\t\t}\n\t\t\t\t\telseif($term==60)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 18;\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$Loan_Amount_Eli=$exactnet_salary * 18;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<100000)\n\t\t\t\t{\n\t\t\t\t\tif($term>=12 && $term<24)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 4;\n\t\t\t\t\t}\n\t\t\t\t\telseif($term>=24 && $term<36)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 11;\n\t\t\t\t\t}\n\t\t\t\t\telseif($term>=36 && $term<48)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 14;\n\t\t\t\t\t}\n\t\t\t\t\telseif(($term>=48 && $term<60))\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 15;\n\n\t\t\t\t\t}\n\t\t\t\t\telseif($term==60)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 15;\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$Loan_Amount_Eli=$exactnet_salary * 15;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif($net_salary<50000)\n\t\t\t\t{\n\t\t\t\t\tif($term>=12 && $term<24)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 3;\n\t\t\t\t\t}\n\t\t\t\t\telseif($term>=24 && $term<36)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 8;\n\t\t\t\t\t}\n\t\t\t\t\telseif($term>=36 && $term<48)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 11;\n\t\t\t\t\t}\n\t\t\t\t\telseif(($term>=48 && $term<60))\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 13;\n\t\t\t\t\t}\n\t\t\t\t\telseif($term==60)\n\t\t\t\t\t{\n\t\t\t\t\t\t$Loan_Amount_Eli=$exactnet_salary * 13;\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$Loan_Amount_Eli=$exactnet_salary * 13;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\tif($finalloanamount_dbr>1 && $Loan_Amount_Eli>1)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($finalloanamount_dbr>$Loan_Amount_Eli)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$getloanamout = $Loan_Amount_Eli;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$getloanamout = $finalloanamount_dbr;\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$getloanamout = $finalloanamount_dbr;\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\t$getloanamout = $finalloanamount_dbr;\n\t\t\t\t}\n\t\t\t\t\n\t\t\tif($reqloanamount>0)\n\t\t\t\t\t{\n\t\t\t\t\t\tif($reqloanamount>$getloanamout)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$getloanamout=$reqloanamount;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t\t\t}\n\t\t\t\n\t\tif ($getloanamout > 0 && $intr > 0) {\n $getemicalc = round($getloanamout * ($intr) / (1 - (pow(1/(1 + ($intr)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } else {\n $getemicalc = 0;\n $interestrate = 0;\n $proc_Fee = 0;\n }\n$getterm=$print_term;\n\t$pro_fee=\"2%\";\n\t\t\t $details['bank_code'] = \"RBL Bank\";\n\t\t\t$details['interest_rate'] = interestRateFormat($interestrate);\n\t\t\t$details['emi'] = $getemicalc;\n\t\t\t$details['emiperlac'] = $emiperlac;\n\t\t\t$details['tenure'] = $getterm;\n\t\t\t$details['loan_amount'] = round($getloanamout);\n\t\t\t$details['processing_fee'] = $pro_fee;\n\t\t\t$details['category'] = $category;\n\t\t\treturn($details);\n\t}",
"function getSpiralCost (&$labor, &$rawCost, $quantity) {\nif ($_POST[\"spiral\"] == \"spiral\") {\n\t\t$spiralLabor = (HOUR * .08333) * $quantity;\n\t\t$spiralCost = ( $quantity * SPIRALCOST);\n\t}\nelse {\n\t$spiralLabor = 0;\n\t$spiralCost = 0;\n\t}\n$labor += $spiralLabor;\n$rawCost += $spiralCost;\n}",
"public function get_rates(){\n\n \n $endpoint = 'live';\n $access_key = '6b976c41ce198b8b5d28f7890bd447f9';\n // Initialize CURL:\n $ch = curl_init('http://apilayer.net/api/'.$endpoint.'?access_key='.$access_key.'');\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\n\n // Store the data:\n $json = curl_exec($ch);\n curl_close($ch);\n\n // Decode JSON response:\n $exchangeRates = json_decode($json, true);\n \n #calculate the inverse rates \n\n #calculate ZAR -> USD Rate \n $zar_usd = 1 / $exchangeRates['quotes']['USDZAR'];\n # ZAR -> GBP\n $gbp_usd = (1 / $exchangeRates['quotes']['USDGBP']);\n $zar_gdp = $zar_usd / $gbp_usd;\n #ZAR->EUR\n $eur_usd = (1 / $exchangeRates['quotes']['USDEUR']);\n $zar_eur = $zar_usd / $eur_usd;\n #ZAR->KES\n $kes_usd = (1 / $exchangeRates['quotes']['USDKES']);\n $zar_kes = $zar_usd / $kes_usd;\n\n \n $updated_rates = array(\n array(\n 'er_id' => 1 , // ZAR -> GBP\n 'er_rate' => $zar_gdp \n ),\n array(\n 'er_id' => 2 , // ZAR -> EUR\n 'er_rate' => $zar_eur\n ),\n array(\n 'er_id' => 3 , // ZAR -> EUR\n 'er_rate' => $zar_kes\n ),\n array(\n 'er_id' => 4 , // ZAR -> EUR\n 'er_rate' => $zar_usd\n )\n );\n \n #batch update db\n $this->ExchangeRate->update_rates($updated_rates);\n\n echo \"Your exchange rates have been successfully updated\";\n\n // else do some exception handling here\n }",
"public function set_credits_discountamount($observer)\n {\n$array2 = Mage::helper('kartparadigm_storecredit')->getCreditRates();\n//Mage::log(Mage::helper('kartparadigm_storecredit')->getRefundDeductConfig() . \" configuration settings \");\n//Mage::log($array2);\n $session = Mage::getSingleton('checkout/session');\n if(Mage::helper('customer')->isLoggedIn()) {\n $customer = Mage::getSingleton('customer/session')->getCustomer();\n $customer_group=Mage::getModel('customer/group')->load(Mage::getSingleton('customer/session')->getCustomerGroupId())->getCustomerGroupCode();\n}\n \n$val1 = Mage::getSingleton('adminhtml/session')->getValue();\nif(isset($val1))\n{\n$amt1 = array();\n$amt1 = Mage::getSingleton('checkout/session')->getCredits();\n$amt = $amt1['totalCredits'];\n$quote = Mage::getSingleton('adminhtml/session_quote')->getQuote();\n}\nelse{\n$amt1 = array();\n $quote = Mage::getModel('checkout/cart')->getQuote();\n$amt1 = Mage::getSingleton('checkout/session')->getCredits();\n$amt = $amt1['discountCredits'];\n}\n $isvirtual=0;\n foreach($quote->getAllItems() as $item){\n if($item->getIsVirtual()==1) {\n $isvirtual=1;\n }\n if(Mage::getModel('catalog/product')->load($item->getProductId())->getTypeId()=='customproduct'){\n $isvirtual=1;\n }\n }\n$total=$quote->getGrandTotal(); \n\n$subTotal = $quote->getSubtotal();\n//Mage::log($quote->getGrandTotal().\"this is grand total store credit\");\n//Mage::log($quote->getSubtotal().\"this is sub total\");\n\n if (!Mage::helper('kartparadigm_storecredit')->getTaxEnabled()){\n$tax = $quote->getShippingAddress()->getData('tax_amount');\n}\n if(!Mage::helper('kartparadigm_storecredit')->getIsShippingEnabled()){\n$shippingPrice = $quote->getShippingAddress()->getShippingAmount();\n}\n$totalCredits1 = array();\n$totalCredits1 = Mage::getSingleton('checkout/session')->getCredits();\n$totalCredits = $totalCredits1['totalCredits'];\n\n$currentTimestamp = Mage::getModel('core/date')->timestamp(time()); \n$nowdate = date('Y-m-d H:m:s', $currentTimestamp); \n//echo $expirydate;\n//echo $nowdate;\n$balance;\n//echo $amt;\n$amt2;\n $amt1;\n \n\nif(isset($amt)){\n/*---------------------Calculating Default Currency Value----------------------- */\n$amt1 = ($array2['basevalue'] * $amt) / $array2['credits'];\n $baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();\n $currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();\n if ($baseCurrencyCode != $currentCurrencyCode) {\n $amt2 = Mage::helper('directory')->currencyConvert($amt1, $baseCurrencyCode, $currentCurrencyCode);\n }\n else{\n $amt2 = $amt1; \n }\n // $amt2 = Mage::helper('core')->currency($amt1, true, false);\n//Mage::log($amt1.\" = amount = \".$amt2 );\n//----------------------------------------------------------------\nif($total > $amt2) {\nif(($total - $tax - $shippingPrice) > $amt2){\n$discountAmount = $amt2;\n$balance = $totalCredits - $amt;\n}else{\n $discountAmount = $subTotal;\n$points = round(($discountAmount * $amt)/$amt2);\n//Mage::log($points.\"Conver Points\");\n$balance = $totalCredits - $points;\n}\n}\nelse {\n$discountAmount = $total - $tax - $shippingPrice;\n$points = round(($discountAmount * $amt)/$amt2);\n//Mage::log($points.\"Conver Points\");\n$balance = $totalCredits - $points;\n}\nMage::getSingleton('core/session')->setBalance($balance);\n\nMage::getSingleton('checkout/session')->setDiscount($totalCredits - $balance);\n$msg = \"Current Credits In Your Account : \" . $balance;\nMage::getSingleton('core/session')->setCredits($msg);\n if ($discountAmount > 0) {\n\n\nif ($baseCurrencyCode != $currentCurrencyCode) {\n \n$allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();\n$rates = Mage::getModel('directory/currency')->getCurrencyRates($baseCurrencyCode, array_values($allowedCurrencies));\n\n$baseDiscount = $discountAmount/$rates[$currentCurrencyCode];\n\n }\nelse{\n $baseDiscount = $discountAmount;\n } \n $total = $quote->getBaseSubtotal();\n $data1 = $quote->getData();\n // Mage::log($data1['entity_id'].\"quote id\");\n $quote->setSubtotal(0);\n $quote->setBaseSubtotal(0);\n $quote->setSubtotalWithDiscount(0);\n $quote->setBaseSubtotalWithDiscount(0);\n $quote->setGrandTotal(0);\n $quote->setBaseGrandTotal(0);\n $canAddItems = $quote->isVirtual() ? ('billing') : ('shipping');\n foreach($quote->getAllAddresses() as $address) {\n $data = $address->getData();\n $address->setSubtotal(0);\n $address->setBaseSubtotal(0);\n $address->setGrandTotal(0);\n $address->setBaseGrandTotal(0);\n $address->collectTotals();\n $quote->setSubtotal((float)$quote->getSubtotal() + $address->getSubtotal());\n $quote->setBaseSubtotal((float)$quote->getBaseSubtotal() + $address->getBaseSubtotal());\n $quote->setSubtotalWithDiscount((float)$quote->getSubtotalWithDiscount() + $address->getSubtotalWithDiscount());\n $quote->setBaseSubtotalWithDiscount((float)$quote->getBaseSubtotalWithDiscount() + $address->getBaseSubtotalWithDiscount());\n $quote->setGrandTotal((float)$quote->getGrandTotal() + $address->getGrandTotal());\n $quote->setBaseGrandTotal((float)$quote->getBaseGrandTotal() + $address->getBaseGrandTotal());\n $quote->setEntityId($data1['entity_id'])->save();\n $quote->setSubtotalWithDiscount($quote->getSubtotal() - $discountAmount)->setBaseSubtotalWithDiscount($quote->getBaseSubtotal() - $baseDiscount)->setEntityId($data1['entity_id'])->save();\n if ($address->getAddressType() == $canAddItems) {\n $address->setSubtotalWithDiscount((float)$data['subtotal_with_discount'] - $discountAmount);\n $address->setGrandTotal((float)$data['grand_total'] - $discountAmount);\n $address->setBaseSubtotalWithDiscount((float)$data['base_subtotal_with_discount'] - $baseDiscount);\n $address->setBaseGrandTotal((float)$data['base_grand_total'] - $baseDiscount);\n if ($data['discount_description']) {\n $address->setDiscountAmount(($data['discount_amount'] - $discountAmount));\n $address->setDiscountDescription($data['discount_description'] . ', Store Credits');\n $address->setBaseDiscountAmount(($data['base_discount_amount'] - $baseDiscount));\n }\n else {\n $address->setDiscountAmount(-($discountAmount));\n $address->setDiscountDescription('Store Credits');\n $address->setBaseDiscountAmount(-($baseDiscount));\n }\n $address->setAddressId($data['address_id'])->save();\n }\n }\n foreach($quote->getAllItems() as $item) {\n\n // We apply discount amount based on the ratio between the GrandTotal and the RowTotal\n $rat = $item->getPriceInclTax() / $quote->getSubtotal();\n $rat1 = $item->getBasePriceInclTax() / $quote->getBaseSubtotal();\n $ratdisc = $discountAmount * $rat;\n $ratdisc1 = $baseDiscount * $rat1;\n//Mage::log($item->getDiscountAmount().\"include tax\".$item->getBaseDiscountAmount());\n // Mage::log($item->getDiscountAmount().\"discount storecredit\");\n$idata = $item->getData();\n Mage::log($item->getDiscountAmount().\"discount amount credit\");\n $item->setDiscountAmount(($item->getDiscountAmount() + $ratdisc) * $item->getQty());\n $item->setBaseDiscountAmount(($item->getBaseDiscountAmount() + $ratdisc1) * $item->getQty())->save();\n }\n }else if($totalCredits == 0){\n\n$msg = \"Sorry You Have No Credits In Your Account\";\nMage::getSingleton('core/session')->setCredits($msg);\n}\n \n \n } \n }",
"public function handelKupon()\n {\n }",
"public function rateAction()\n {\n $html = '';\n $paymentMethod = $this->getRequest()->getParam('paymentMethod');\n $calcValue = $this->getRequest()->getParam('calcValue');\n $ratePayShopId = $this->getRequest()->getParam('ratePayshopId');\n $amount = $this->getRequest()->getParam('amount');\n $ratePayCurrency = $this->getRequest()->getParam('ratePayCurrency');\n $isAdmin = $this->getRequest()->getParam('isAdmin');\n $quoteId = $this->getRequest()->getParam('quoteId');\n $this->loadLayout();\n\n try {\n if (preg_match('/^[0-9]+(\\.[0-9][0-9][0-9])?(,[0-9]{1,2})?$/', $calcValue)) {\n $calcValue = str_replace(\".\", \"\", $calcValue);\n $calcValue = str_replace(\",\", \".\", $calcValue);\n $calcValue = floor($calcValue * 100); //MAGE-363: Use cent instead of floating currency\n\n $client = Mage::getSingleton('payone_core/mapper_apiRequest_payment_genericpayment');\n $ratePayConfigModel = Mage::getSingleton('payone_core/payment_method_ratepay');\n $getConfig = $this->getConfig($ratePayConfigModel, $isAdmin, $quoteId);\n $result = $client->ratePayCalculationRequest($amount, $ratePayShopId, $ratePayCurrency, $calcValue, null, $getConfig, 'calculation-by-rate');\n\n if ($result instanceof Payone_Api_Response_Genericpayment_Ok) {\n $responseData = $result->getPayData()->toAssocArray();\n $initialRateChoice = $this->getRequest()->getParam('calcValue');\n $message = $this->__('lang_calculation_rate_ok');\n\n // if the calculated installment value is different from the choice, we notify the user\n if ($initialRateChoice != $responseData['rate']) {\n // if value is lower than choice AND number of months is at maximum (36)\n // then the choice was too low\n // otherwise, it just got adapted to the closest available installment value\n if (\n $initialRateChoice < $responseData['rate']\n && $responseData['number-of-rates'] == 36\n ) {\n $message = $this->__('lang_calculation_rate_too_low');\n } else {\n $message = $this->__('lang_calculation_rate_not_available');\n }\n }\n $responseData['calculation-result-message'] = $message;\n\n /** @var Payone_Core_Block_Checkout_RatePayInstallmentplan $reviewBlock */\n $reviewBlock = $this->getLayout()->getBlock('payone_ratepay.checkout.installmentplan');\n $reviewBlock->setData($responseData);\n $reviewBlock->setIsAdmin($isAdmin);\n $html = $reviewBlock->toHtml();\n\n //if admin order, some fields are added to store,\n //otherwise, data are stores into session\n if (!$isAdmin) {\n //set payone Session Data\n $this->setSessionData($responseData, $paymentMethod);\n }\n } else {\n $this->unsetSessionData($paymentMethod);\n if($result instanceof Payone_Api_Response_Error) {\n $html = \"<div class='ratepay-result rateError'>\" . $this->__($result->getCustomermessage()) . \"</div>\";\n }\n }\n } else {\n $this->unsetSessionData($paymentMethod);\n $html = \"<div class='ratepay-result rateError'>\" . $this->__('lang_error') . \":<br/>\" . $this->__('lang_wrong_value') . \"</div>\";\n }\n } catch (Exception $e) {\n $this->unsetSessionData($paymentMethod);\n Mage::getSingleton('checkout/session')->addError(\n $this->__('Unable to initialize Rate Pay Installement.')\n );\n Mage::logException($e);\n }\n \n $this->getResponse()\n ->clearHeaders()\n ->setHeader('Content-Type', 'text/html', true)\n ->setBody($html);\n return;\n }",
"private function setPremiumCode(){\n for($i = 0; $i < 7; $i++) {\n $this->premiumCode .= rand(1,9);\n };\n $this->discount = 10;\n }",
"protected function calculatePrices()\n {\n }",
"public function exchangeRate() {\n try{\n $client = new GuzzleHttp\\Client(['base_uri' => 'https://api.exchangeratesapi.io/']);\n // Latest endpoint \n $response = $client->request('GET', 'latest');\n $statusCode = $response->getStatusCode();\n if($statusCode == 200) {\n // Get body of the response and stringify\n $body = (string)$response->getBody();\n // Parse json to ApiResponse Object\n $apiResponse = new ApiResponse($body);\n // Print associative response to console\n print_r($apiResponse);\n }\n }catch(Exception $e){\n echo $e;\n }\n\n }",
"public function getStoreToOrderRate();",
"public function rate($rate)\n {\n // Update API Rate Limiter\n $this->rate = $rate;\n }",
"function GenrateBill($id = array(),$vid = array(),$ketObj ){\n$where = \" where kord.id = \".$id.\"\";\n$BillInfo= $ketObj->runquery( \"SELECT\", \"kord.same_productdetails,kord.mobile,kord.order_time_stamp,kord.shipping_value,kord.oaddress,kord.grossamount,kord.discount,kord.finalamount,kord.payment,kord.dis_type,kord.dis_method,kord.dis_value,kord.coupon_code,kord.tqty,ku.uname\", \"ketechord_\".$vid.\" kord INNER JOIN ketechuser ku ON ku.id = kord.userid\", array(),$where );\n\n$arrayPD = json_decode($BillInfo['0']['same_productdetails'],true);\n/*echo \"<pre>\";\nprint_r( $arrayPD );\ndie();*/\n\nif( $BillInfo['0']['dis_method'] == \"instant\" ){ \n\t\t\t\t\t\t\t$discount = $BillInfo['0']['dis_value'];\n\t\t\t\t\t }else{\n\t\t\t\t\t \t\t$discount = \"0\";\n\t\t\t\t\t }\n$finalamount = \t$BillInfo['0']['grossamount'] + $BillInfo['0']['shipping_value'] - $discount;\t\t\t\t \n\n$pdfBill = \"<table width=\\\"70%\\\">\n\t<thead>\n\t\t<th align=\\\"right\\\">\n\t\t\tBill Information\n\t\t</th>\n\t</thead>\t\n\t\n\t<tbody>\n\t\t<tr>\n\t\t\t<td><table width = \\\"100%\\\">\n\t\t\t\t\t<tr>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\tNAME\n\t\t\t\t\t\t</td>\n\t\t\t\t\t\t<td>\n\t\t\t\t\t\t\t\".$BillInfo['0']['uname'].\"\n\t\t\t\t\t\t</td>\n\t\t\t\t\t</tr>\n\t\t\t\t\t\n\t\t\t\t\t<tr>\n\t\t\t<td>\n\t\t\t\tADDRESS\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t\".$BillInfo['0']['oaddress'].\"\n\t\t\t</td>\n\t\t</tr>\n\t\t\n\t\t<!--<tr>\n\t\t\t<td>\n\t\t\t\tShipping \n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t\".$BillInfo['0']['shipping_value'].\"\n\t\t\t</td>\n\t\t</tr>-->\n\t\t\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\tOrder Date\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t\".$BillInfo['0']['order_time_stamp'].\"\n\t\t</tr>\n\t\t\t</table>\n\t\t\t</td>\n\t\t\t\n\t\t\t<td><table width = \\\"100%\\\">\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t\tCompany Name:\n\t\t\t\t\t</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\tMYCHIRAAG\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t\t<tr>\n\t\t\t\t\t<td>\n\t\t\t\t\t\tAddress:\n\t\t\t\t\t</td>\n\t\t\t\t\t<td>\n\t\t\t\t\t\tMYCHIRAAG Address\n\t\t\t\t\t</td>\n\t\t\t </tr>\n\t\t\t\t\n\t\t\t\t</table>\n\t\t\t</td>\n\t\t</tr>\n\t\t\n\t</tbody>\n</table>\n\n<table border=\\\"1\\\" style = \\\"border-collapse:collapse;width:70%\\\">\n\t<thead>\n\t\t<tr>\t\n\t\t\t<th>\n\t\t\t\tProduct Name\n\t\t\t</th>\n\t\t\t<!--<th>\n\t\t\t\t Category\n\t\t\t</th>-->\n\t\t\t<!--<th>\n\t\t\t\tBase Price\n\t\t\t</th>-->\n\t\t\t\n\t\t\t<th>\n\t\t\t\tSell Price\n\t\t\t</th>\n\t\t\t\n\t\t\t<th>\n\t\t\t\tQty\n\t\t\t\t\n\t\t\t</th>\n\t\t\t<th>\n\t\t\t\tTotal\n\t\t\t</th>\n\t\t\t\n\t\t</tr>\t\n\t</thead>\n\t\n\t<tbody>\";\n\t\n\t$tmphold_first = \"\";\n\t\t\t\tforeach( $arrayPD['0'] as $arrayPDV ) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$singlePtotal = $arrayPDV['quantity']*$arrayPDV['saleprice'];\n\t\t\n\t\t$tmphold_first .= \"<tr>\n\t\t\t\t<td>\n\t\t\t\t\t \".$arrayPDV['name'].\" \n\t\t\t\t</td>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t<td>\n\t\t\t\t\t\".$arrayPDV['saleprice'].\" \n\t\t\t\t</td>\n\t\t\t\t\n\t\t\t\t<td>\n\t\t\t\t\t \".$arrayPDV['quantity'].\" \n\t\t\t\t</td>\n\t\t\t\t\n\t\t\t\t<td>\n\t\t\t\t\t\".$singlePtotal.\"\n\t\t\t\t</td>\n\t\t</tr>\";\n\t\t\n\t\t\n\t\t\t\t\n\t\t\n}\n\t\t\n\t\t\n\t\t$tmphold_second = \"<tr>\n\t\t\t<td colspan=\\\"3\\\" align=\\\"right\\\">\n\t\t\t\tTotal\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t \".$BillInfo['0']['grossamount'].\"\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td colspan=\\\"3\\\" align=\\\"right\\\">\n\t\t\t\tDiscount\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t\n\t\t\t\t\".$discount.\"\n\t\t\t</td>\n\t\t</tr>\n\t\t\n\t\t<tr>\n\t\t\t<td colspan=\\\"3\\\" align=\\\"right\\\">\n\t\t\t\tShipping\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t\".$BillInfo['0']['shipping_value'].\"\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td colspan=\\\"3\\\" align=\\\"right\\\">\n\t\t\t\tPayable\n\t\t\t</td>\n\t\t\t<td>\n\t\t\t\t\".$finalamount.\"\n\t\t\t</td>\n\t\t</tr>\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t</tbody>\t\n\n</table>\";\n\nreturn $pdfBill.\"\".$tmphold_first.\"\".\"\".$tmphold_second;\n}",
"public function run()\n {\n //\n $b_curr=[\"Euro\",\"Euro\",\"Euro\",\"Us Dollar\",\"Swiss Franc\",\"British Pound\"];\n $t_curr=[\"Us Dollar\",\"Swiss Franc\",\"British Pound\",\"JPY\",\"Us Dollar\",\"CAD\"];\n $ex_rates=[1.3764,1.2079,0.8731,76.7200,1.1379,1.5648];\n for ($i = 0; $i <sizeof($b_curr); $i++) {\n ExchangeRate::create([\n 'baseCur' =>$b_curr[$i] ,\n 'targetCur' =>$t_curr[$i],\n 'rate' =>$ex_rates[$i]\n ]);\n ExchangeRate::create([\n 'baseCur' =>$t_curr[$i] ,\n 'targetCur' =>$b_curr[$i],\n 'rate' =>1/$ex_rates[$i]\n ]);\n\n }\n }",
"private function purchaseRestrictionsAwal($ins) {\n \n $dateNow = date('Y-m-d'); // date now\n \n // cek total volume pengisian selama hari ini, apakah >= 100 liter\n $totalVolumeFill = $this->db->query(\"SELECT SUM(liter) AS `total_volume` FROM {$this->transaction_kendaraan} WHERE no_pol = '{$ins['no_pol']}' AND tgl = '{$dateNow}' \")\n ->row_array()['total_volume'];\n \n $lastTotalVolume = floatval($ins['liter']) + floatval($totalVolumeFill);\n \n if($lastTotalVolume > 200) {\n\t $response = [\n\t \"status\" => \"error\", \n\t \"message\" => \"Customer tidak dapat mengisi lebih dari 200 liter ({$lastTotalVolume} liter) dalam satu hari yang sama\"\t \n\t // \"message\" => \"Customer tidak dapat mengisi lebih dari 200 liter ({$lastTotalVolume} liter) dalam pembelian ke - {$ins['numOfBuy']}\", \n\t ];\n\t echo json_encode($response);\n\t \n } else if(floatval($ins['liter']) > 75) {\n\t \n\t $response = [\n\t \"status\" => \"approval\", \n\t \"message\" => \"Customer ingin mengisi lebih dari 75 liter ({$ins['liter']} liter) dalam pembelian {$ins['numOfBuy']}\", \n\t \"question\" => \"Apakah anda setuju melakukan pengisian lebih dari 75 liter ({$ins['liter']} liter) ?\"\n\t ];\n\t echo json_encode($response);\n\t \n } else {\n\t $response = [\n\t \"status\" => \"ok\", \n\t \"message\" => \"Customer ingin mengisi biosolar dengan volume {$ins['liter']} liter pada pembelian ke - {$ins['numOfBuy']}\"\n\t ];\n\t echo json_encode($response);\t \n } \n }",
"public function __construct() {\n\t\t\t\t\t$this->id = 'lalamove_rate_reg'; // Id for your shipping method. Should be uunique.\n\t\t\t\t\t$this->method_title = __( 'Shipping Price' ); // Title shown in admin\n\t\t\t\t\t$this->method_description = __( 'Price base on shipping adress and weight delivery via motorcycle.' ); // Description shown in admin\n \n\t\t\t\t\t$this->enabled = \"yes\"; // This can be added as an setting but for this example its forced enabled\n\t\t\t\t\t$this->title = \"LALAMOVE Rate\"; // This can be added as an setting but for this example its forced.\n \n\t\t\t\t\t$this->init();\n\t\t\t\t}",
"public function getBaseToOrderRate();",
"private function _recalcBanner() {\n // @TODO Here is no params for recalc...?\n }",
"public function placeAndSettleBet();",
"function set1()\n{\n global $ASP1, $ASP2, $SH, $MR, $SB;\n // show 5 options of price APP price drop with 5 rs each\n $m = intval ( $ASP1 / 5 );\n echo \"Target Price | Buy | Buy Rate | Money Needed | Reduction % | Total Held\\n\";\n echo \"------------ --- -------- ------------ ----------- ----------\\n\";\n for($i = 0; $i < 5; $i ++)\n {\n $ASP2 = ($m - $i) * 5;\n aspcalc ();\n }\n $ASP2 = $ASP1 * .5;\n aspcalc ();\n}",
"public function setPrice()\n {\n $price = $this->price;\n $outFix = $this->outFix;\n $outPer = $this->outPer;\n $inPer = $this->inPer;\n $inFix = $this->inFix;\n $flag = $this->flagInOut;\n if ($price < 1) {\n $sumIn = $outFix > 0 ? 1 + $outFix : 1; //outFix\n $sumIn = $outPer > 0 ? $sumIn + ($sumIn * $outPer / 100) : $sumIn; //outPer\n $sumIn = $sumIn / $price; // price\n $sumIn = $inFix > 0 ? $sumIn + $inFix : $sumIn;// inFix\n $ss = $sumIn * $inPer / 100;\n $sumIn = $inPer > 0 ? $sumIn + $ss : $sumIn;\n $this->in = $this->format_amount($sumIn);\n $this->out = $flag ? 1 : 0;\n } else {\n $val = $inFix > 0 ? 1 - $inFix : 1;\n $val = $inPer > 0 ? $val - $val * ($inPer / 100) : $val;\n $sumOut = $price * $val;\n $sumOut = $outFix > 0 ? $sumOut - $outFix : $sumOut;\n $sumOut = $outPer > 0 ? $sumOut - $outPer / 100 * $sumOut : $sumOut;\n $this->out = $this->format_amount($sumOut);\n $this->in = $flag ? 1 : 0;\n }\n $this->price = (float)$price;\n }",
"function initSpCost(){\r\n\t$SP_Cost = 0;\r\n}",
"public function userwise_payspec(){\n\t\t//restricted this area, only for admin\n\t\tpermittedArea();\n\t\t\t\t\n\t\t$data['userDebit'] = $this->ledger_model->userDebit();\n\t\t$data['userCredit'] = $this->ledger_model->userCredit();\n\t\t\n\t\t\t\n\t\t\n\t\ttheme('userwise_payspec',$data);\n\t}",
"function tep_get_tax_rate($class_id, $country_id = -1, $zone_id = -1) {\n\n \n//Eversun mod for sppc and qty price breaks\n// global $customer_zone_id, $customer_country_id;\n global $customer_zone_id, $customer_country_id, $sppc_customer_group_tax_exempt;\n\n if(!tep_session_is_registered('sppc_customer_group_tax_exempt')) {\n $customer_group_tax_exempt = '0';\n } else {\n $customer_group_tax_exempt = $sppc_customer_group_tax_exempt;\n }\n\n if ($customer_group_tax_exempt == '1') {\n return 0;\n }\n//Eversun mod end for sppc and qty price breaks\n if ( ($country_id == -1) && ($zone_id == -1) ) {\n if (!tep_session_is_registered('customer_id')) {\n $country_id = STORE_COUNTRY;\n $zone_id = STORE_ZONE;\n } else {\n $country_id = $customer_country_id;\n $zone_id = $customer_zone_id;\n }\n }\n\n $tax_query = tep_db_query(\"select sum(tax_rate) as tax_rate from \" . TABLE_TAX_RATES . \" tr left join \" . TABLE_ZONES_TO_GEO_ZONES . \" za on (tr.tax_zone_id = za.geo_zone_id) left join \" . TABLE_GEO_ZONES . \" tz on (tz.geo_zone_id = tr.tax_zone_id) where (za.zone_country_id is null or za.zone_country_id = '0' or za.zone_country_id = '\" . (int)$country_id . \"') and (za.zone_id is null or za.zone_id = '0' or za.zone_id = '\" . (int)$zone_id . \"') and tr.tax_class_id = '\" . (int)$class_id . \"' group by tr.tax_priority\");\n if (tep_db_num_rows($tax_query)) {echo \"}}}}{{{{{\";\n $tax_multiplier = 1.0;\n while ($tax = tep_db_fetch_array($tax_query)) {\n $tax_multiplier *= 1.0 + ($tax['tax_rate'] / 100);\n }\n return ($tax_multiplier - 1.0) * 100;\n } else {\n return 0;\n }\n }",
"public function getBaseToGlobalRate();",
"function bill_pay_from_card() {\n\t\t$coupon_id = $_REQUEST['coupon_id'];\n\t\t$coupon_amount = $_REQUEST['coupon_amount'];\n\t\t$recharge_user_id = $_REQUEST['recharge_user_id'];\n\t\t$wt_category = $_REQUEST['wt_category'];\n\t\t// wt_category = 11 pay bill\n\t\t$bill_category_id = $_REQUEST['bill_category_id'];\n\t\t// 1- Water, 2- Movies etc\n\t\t$biller_id = $_REQUEST['biller_id'];\n\t\t$bill_amount = $_REQUEST['bill_amount'];\n\t\t$bill_consumer_no = $_REQUEST['bill_consumer_no'];\n\t\t$card_no = $_REQUEST['card_number'];\n\t\t$cvv_no = $_REQUEST['cvv_no'];\n\t\t$wallet_type = 2;\n\t\t// 1- Credit, 2-Debit\n\t\t$bill_pay_status = 1;\n\n\t\t$wallet_category = '4';\n\t\t// 4- Cashback\n\t\t$current_date = date(\"Y-m-d h:i:sa\");\n\t\t$wt_desc = 'PaY Bill';\n\t\tif (!empty($bill_consumer_no) && !empty($biller_id) && !empty($bill_amount) && !empty($recharge_user_id)) {\n\t\t\t$bill_records = $this -> conn -> get_table_field_doubles('biller_user', 'biller_customer_id_no', $bill_consumer_no, 'biller_id', $biller_id);\n\t\t\t//$bill_records = $this -> conn -> get_table_row_byidvalue('biller_user', 'biller_customer_id_no', $bill_consumer_no);\n\t\t\t//print_r($bill_records);\n\t\t\tif (!empty($bill_records)) {\n\t\t\t\t$bill_user_id = $bill_records['0']['biller_user_id'];\n\t\t\t\t$bill_pay_status = $bill_records['0']['bill_pay_status'];\n\t\t\t\tif ($bill_pay_status == '2') {\n\t\t\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $recharge_user_id);\n\t\t\t\t\t$wallet_amount = $records['0']['wallet_amount'];\n\t\t\t\t\t$reffer_status = $records['0']['reffer_amount_status'];\n\t\t\t\t\t$reffer_user_id = $records['0']['reffer_user_id'];\n\t\t\t\t\t$admin = $this -> conn -> get_all_records('admin');\n\t\t\t\t\t$admin_wallet = $admin['0']['admin_wallet'];\n\t\t\t\t\t$transaction_id = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t$recharge = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc', '\"' . $recharge_user_id . '\",\"' . $current_date . '\",\"' . $wallet_type . '\",\"' . $bill_amount . '\",\"' . $wt_category . '\",\"' . $transaction_id . '\",\"' . $wt_desc . '\"');\n\n\t\t\t\t\tif ($recharge) {\n\t\t\t\t\t\t$walletrecharge = $this -> conn -> insertnewrecords('bill_recharge', 'bill_user_id,bill_transaction_id,bill_category_id, biller_id,bill_consumer_no,bill_amount,bill_pay_date,bill_pay_status', '\"' . $recharge_user_id . '\",\"' . $transaction_id . '\",\"' . $bill_category_id . '\",\"' . $biller_id . '\",\"' . $bill_consumer_no . '\",\"' . $bill_amount . '\",\"' . $current_date . '\",\"' . $bill_pay_status . '\"');\n\n\t\t\t\t\t\tif (!empty($walletrecharge)) {\n\n\t\t\t\t\t\t\t$data_frnd['bill_paid_date'] = $current_date;\n\t\t\t\t\t\t\t$data_frnd['bill_pay_status'] = 1;\n\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('biller_user', 'biller_user_id', $bill_user_id, $data_frnd);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t//reffer amount when user first recharge then beifits add in frnd wallet\n\t\t\t\t\t\tif ($reffer_status == '2') {\n\t\t\t\t\t\t\t$frnd_records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $reffer_user_id);\n\n\t\t\t\t\t\t\t$reffer_records = $this -> conn -> get_all_records('reffer_amount');\n\t\t\t\t\t\t\t$refferal_amount = $reffer_records[0]['reffer_amount'];\n\t\t\t\t\t\t\t$user11_id = $frnd_records['0']['user_id'];\n\t\t\t\t\t\t\t$reffer_code_database = $frnd_records['0']['user_refferal_code'];\n\t\t\t\t\t\t\t$wallet = $frnd_records['0']['wallet_amount'];\n\t\t\t\t\t\t\t$frnd_number = $frnd_records['0']['user_contact_no'];\n\t\t\t\t\t\t\t$current_date = date(\"Y-m-d h:i:sa\");\n\t\t\t\t\t\t\t$transaction_id = strtotime(\"now\") . mt_rand(10000000, 99999999);\n\t\t\t\t\t\t\t$wt_type = 2;\n\t\t\t\t\t\t\t// credit in frnd acconnt\n\t\t\t\t\t\t\t$refferamount = $refferal_amount;\n\t\t\t\t\t\t\t// reffer amount\n\t\t\t\t\t\t\t$wt_category = 9;\n\t\t\t\t\t\t\t// refferal amount recieved in wallet\n\t\t\t\t\t\t\t$wt_desc = \"Refferal amount add in your wallet using by \" .$mobile;\n\n\t\t\t\t\t\t\t$add_reffer_money = $this -> conn -> insertnewrecords('refferal_records', 'refferal_user_id,refferal_frnd_id,refferal_amount,refferal_date', '\"' . $recharge_user_id . '\",\"' . $user11_id . '\",\"' . $refferamount . '\",\"' . $current_date . '\"');\n\n\t\t\t\t\t\t\t$add_money = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user11_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $refferamount . '\",\"' . $wt_category . '\",\"' . $transaction_id . '\",\"' . $wt_desc . '\",\"' . $frnd_number . '\"');\n\n\t\t\t\t\t\t\t// modify wallet of frnd using reffer code///\n\t\t\t\t\t\t\t$data_frnd['wallet_amount'] = $wallet + $refferal_amount;\n\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $user11_id, $data_frnd);\n\n\t\t\t\t\t\t\t// Cahnge user status when refeer amount add in frnd wallet\n\t\t\t\t\t\t\t$data12['reffer_amount_status'] = 1;\n\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $recharge_user_id, $data12);\n\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$cashback_record_id = $recharge_number;\n\t\t\t\t\t\tif (!empty($coupon_id)) {\n\n\t\t\t\t\t\t\t$coupon_apply = $this -> conn -> insertnewrecords('coupon_details', 'coupon_id, user_id,coupon_apply_date', '\"' . $coupon_id . '\",\"' . $recharge_user_id . '\",\"' . $current_date . '\"');\n\t\t\t\t\t\t\tif (!empty($coupon_apply)) {\n\n\t\t\t\t\t\t\t\t$walletrecharge = $this -> conn -> insertnewrecords('wallet_transaction', 'wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $recharge_user_id . '\",\"' . $current_date . '\",\"' . $wallet_type . '\",\"' . $coupon_amount . '\",\"' . $wallet_category . '\",\"' . $transaction_id . '\",\"' . $w_desc . '\",\"' . $cashback_record_id . '\"');\n\t\t\t\t\t\t\t\t$user_wallet = $wallet_amount + $coupon_amount;\n\t\t\t\t\t\t\t\t$data['wallet_amount'] = $user_wallet;\n\n\t\t\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('user', 'user_id', $recharge_user_id, $data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Admin wallet update\n\t\t\t\t\t\t$admin_update_wallet = $admin_wallet + $recharge_amount;\n\t\t\t\t\t\t$data_admin['admin_wallet'] = $admin_update_wallet;\n\t\t\t\t\t\t$update_toekn = $this -> conn -> updatetablebyid('admin', 'admin_id', 1, $data_admin);\n\t\t\t\t\t\t$res = file_get_contents(SITE_URL . \"/createpdf/pdf/\" . $bill_consumer_no);\n\t\t\t\t\t\t$post = array(\"status\" => \"true\", 'message' => \"Bill Pay Successfully\", \"bill_recharge_id\" => $recharge, 'consumer_no' => $bill_consumer_no, 'bill_amount' => $bill_amount, 'wallet_amount' => $wallet_amount, 'bill_pay_date' => $current_date, 'transaction_id' => $transaction_id);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"Pay Bill failed\");\n\t\t\t\t\t}\n\n\t\t\t\t} else {\n\t\t\t\t\t$post = array('status' => \"false\", \"message\" => \"These Bill already paid\");\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$post = array('status' => \"false\", \"message\" => \"Missing parameter\", 'recharge_user_id' => $recharge_user_id, 'bill_category_id' => $bill_category_id, 'biller_id' => $biller_id, 'wt_category' => $wt_category, 'consumer_no' => $bill_consumer_no, 'bill_amount' => $bill_amount);\n\t\t}\n\t\techo $this -> json($post);\n\n\t}",
"public function cek_pembelian() {\n\t $ins['id_bbm'] = $this->input->post('id_bbm');\n\t $ins['no_pol'] = str_replace(\" \",\"\",$this->input->post('no_pol'));\n\t $ins['liter'] = str_replace(\",\",\".\",$this->input->post('liter'));\n\t $ins['odometer'] = str_replace(\" \",\"\",$this->input->post('odometer'));\n\t $ins['numOfFill'] = $this->input->post('num_of_fill'); // frekuensi pengisian (berapa kali isi bensin dalam sehari?)\n $ins['numOfBuy'] = $ins['numOfFill'] + 1;\n\t \n\t // if odometer konsumen > 99999999\n\t if($ins['odometer'] > 99999999) {\n\t $response = [\n\t \"status\" => \"approval\", \n\t \"message\" => \"Mohon untuk melakukan approval reset odometer\", \n\t \"question\" => \"Apakah anda setuju melakukan reset odometer ?\"\n\t ];\n echo json_encode($response);\n\t } else {\n\t // filter pembatasan pembelian jika odometer masih < 99999999\n\t $this->purchaseRestrictionsAwal($ins);\n\t }\n\t \n }",
"function get_installment($rate, $pricipal, $installment, $interest_method = 1, $interval = 1) {\n\n $amount = 0;\n $rate_required = 0;\n if ($interval == 1) {\n //monthly\n $rate_required = (($rate / 12) / 100);\n }else if($interval == 2){\n //weekly\n $rate_required = (($rate / 52) / 100); \n }\n\n if ($interest_method == 1) {\n $up = pow((1 + $rate_required), $installment);\n\n $down = (pow((1 + $rate_required), $installment) - 1);\n\n $amount = (($pricipal * ($up / $down)) * $rate_required);\n } else if ($interest_method == 2) {\n $interest_per_month = $rate_required * $pricipal;\n $amount = ($pricipal / $installment) + $interest_per_month;\n }\n\n return round($amount, 2);\n }",
"private function sellTrasactionPendingAddsMoney(){\n\n }",
"public function gopayAction()\n {\n \t$uid = $this->uid;\n $buy_type = $_GET;\n $buy_type = array_keys($buy_type);\n\n //$buy_type\n //[\"callback\\/apipay\",\"btnOrder1\",\"uid\"]\n $buy_type = str_replace('btnOrder', '', $buy_type[1]);\n\n //check buy_type\n $price = 0;\n\n\t\t//加码\n\t\t$nowTime = time();\n\t\t$changeStartTime = strtotime('2012-01-18 00:00:01');\n\t\t$changeEndTime = strtotime('2012-01-26 23:59:59');\n\n\t\tif (($nowTime >= $changeStartTime) && ($nowTime <= $changeEndTime)) {\n\t\t\t$changestatus = 1;\n\t\t} else {\n\t\t\t$changestatus = 2;\n\t\t}\n\n //以分为单位\n\t\tif ($changestatus == 1) {\n\t\t\t$payment = $this->_aryPayDay;\n\t\t} else {\n\t\t\t$payment = $this->_aryPay;\n\t\t}\n\n $gold = 0;\n $itemName = '';\n foreach ($payment as $item) {\n if ($buy_type == $item['id']) {\n $price = $item['price'];\n $gold = $item['gold'];\n $itemName = $item['name'];\n break;\n }\n }\n\n if ($price <= 0 || empty($buy_type) || empty($itemName)) {\n exit;\n }\n\n $rowUser = Hapyfish2_Platform_Bll_User::getUser($uid);\n $orderId = Hapyfish2_Island_Bll_Payment::createPayOrderId($rowUser['puid']);\n $buyer_time = time();\n //call api\n $params = array();\n $params['format'] = 'json';\n $params['item_id'] = $buy_type;\n $params['item_version_id'] = 2;\n $params['total_price'] = $price;\n \t \t/*if ($uid == 10650884) {\n \t$params['total_price'] = 1;\n }*/\n $params['item_name'] = $itemName;\n $params['item_version_name'] = '宝石';\n $params['page_ret_url'] = HOST . '/callback/paydone?';\n $params['proxy_code'] = 'HAPPYFISH';\n $params['outer_order_id'] = $orderId;\n $params['buyer_time'] = $buyer_time;\n $params['description'] = '';\n $params['alipay_id'] = '374052723';//'2088302111803535';\n $rest = Taobao_Rest::getInstance();\n $rest->setUser($puid, $this->info['session_key']);\n $data = $rest->jianghu_getVasIsvUrl($params);\n if (empty($data) || !is_array($data) || !isset($data['vas_isv_url_get_response']['vas_isv_url'])) {\n info_log('101' ,'tb2payfailed');\n \techo '<html><body>request timeout,please try again later.</body></html>';\n exit;\n }\n \t\t$dataUrl = $data['vas_isv_url_get_response']['vas_isv_url'];\n try {\n\t if (isset($dataUrl['aplipay_isv_address'])) {\n\t\t //create pay order\n\t\t $amount = (int)($price/100);\n\t\t $tradeNo = $dataUrl['order_id'];\n\t\t $rst = Hapyfish2_Island_Bll_Payment::createOrder($orderId, $uid, $amount, $gold, $tradeNo, $buyer_time);\n if ($rst) {\n return $this->_redirect($dataUrl['aplipay_isv_address']);\n }\n info_log('102' ,'tb2payfailed');\n\t\t $msg = isset($dataUrl['message']) ? $dataUrl['message'] : '支付失败';\n \t\techo \"<html><body>$msg</body></html>\";\n\t exit;\n\t\t }\n\t else {\n\t \tif (1 == $dataUrl['status']) {\n \t \t//create pay order\n \t\t $amount = (int)($price/100);\n \t\t $tradeNo = $dataUrl['order_id'];\n \t\t $rst = Hapyfish2_Island_Bll_Payment::createOrder($orderId, $uid, $amount, $gold, $tradeNo, $buyer_time);\n if ($rst) {\n $order = Hapyfish2_Island_Bll_Payment::getOrder($uid, $orderId);\n if ($order['status'] == 1) {\n return $this->_redirect('/pay/payfinish');\n }\n $payRst = Hapyfish2_Island_Bll_Payment::completeOrder($uid, $order);\n if ($payRst == 0) {\n $log = Hapyfish2_Util_Log::getInstance();\n\t\t $log->report('tb2paydone', array($orderId, $amount, $tradeNo, $uid, 1));\n return $this->_redirect('/pay/payfinish');\n }\n else {\n info_log('103' ,'tb2payfailed');\n }\n }\n else {\n info_log('102' ,'tb2payfailed');\n }\n\t\t\t //$msg = $dataUrl['message'];\n\t\t\t $msg = isset($dataUrl['message']) ? $dataUrl['message'] : '支付失败';\n\t \t\techo \"<html><body>$msg</body></html>\";\n\t\t exit;\n\t \t}\n\t \telse {\n\t \t //info_log('104:'.json_encode($dataUrl) ,'tb2payfailed');\n\t \t info_log('104:'.json_encode($data) ,'tb2payfailed');\n\t \t\t$msg = isset($dataUrl['message']) ? $dataUrl['message'] : '支付失败';\n\t \t\treturn $this->_redirect('http://pay.taobao.com/account/pay_for_account.htm');\n\t \t\t//echo \"<html><body>$msg</body></html>\";\n\t\t exit;\n\t \t}\n\t }\n } catch (Exception $e) {\n echo '-100';\n exit;\n }\n\n info_log('105' ,'tb2payfailed');\n\t\techo \"<html><body>Please retry.</body></html>\";\n\t\texit;\n }",
"public function rateBuyer()\n\t{\n $username = Input::get('username');\n $posting_id = Input::get('posting_id');\n $loggedin_user = Session::get('user');\n\n $posting_info = App::make('User')->getSellerAndFlags($posting_id);\n if(!count($posting_info))\n {\n return Redirect::to('/outputMessage')->with('message', 'Sorry, but that user does not exist.');\n }\n\n //if logged in user is seller and seller_has_rated flag is set, don't rate again!\n //if logged in user isn't seller and buyer_has_rated flag is set, also don't rate\n $seller_or_buyer = 'buyer';\n\n if ($loggedin_user == $posting_info[0]->username) {\n $seller_or_buyer = 'seller';\n }\n\n if((($seller_or_buyer == 'seller') && ($posting_info[0]->seller_has_rated == '1')) ||\n (($seller_or_buyer == 'buyer') && ($posting_info[0]->buyer_has_rated == '1')) ) {\n return Redirect::to('/outputMessage')->with('message', 'You have already rated this transaction!');\n }\n\n if( $posting_info[0]->hide_post == '0') {\n return Redirect::to('/outputMessage')->with('message', 'This transaction must be marked as complete before rating!');\n }\n\n\n if(Input::has('like')){\n App::make('User')->thumbsUp($username, $posting_id, $seller_or_buyer);\n return Redirect::to('/outputMessage')->with('message', 'Thank you for providing feedback. You liked '.$username.'.');\n }\n else if(Input::has('dislike')){\n App::make('User')->thumbsDown($username, $posting_id, $seller_or_buyer);\n return Redirect::to('/outputMessage')->with('message', 'Thank you for providing feedback. You disliked '.$username.'.');\n }\n return Redirect::to('/outputMessage')->with('message', 'Submitted');\n\t}",
"function editAlterRate($design_no, $suit_rate,$dupatta_rate, $ghagra_rate, $blause_rate, $total_rate)\n\t\n\t{\n\t\t/*$stock_id\t\t\t =\tmysql_real_escape_string(trim($stock_id));*/\n\t\t$design_no\t \t\t=\ttrim($design_no);\n\t\t$suit_rate\t\t\t \t\t= mysql_real_escape_string(trim($suit_rate));\n\t\t$dupatta_rate\t\t\t =\tmysql_real_escape_string(trim($dupatta_rate));\n\t\t$ghagra_rate\t\t =\tmysql_real_escape_string(trim($ghagra_rate));\n\t\t$blause_rate\t\t =\tmysql_real_escape_string(trim($blause_rate));\n\t\t$total_rate\t\t\t =\tmysql_real_escape_string(trim($total_rate));\n\t\t\n\t\t//update stock description\n\t\t$edit = \"UPDATE alter_rate\n\t\t\t\tSET\n\t\t\t\tdesign_no\t\t \t= '$design_no',\n\t\t\t\tsuit_rate\t\t\t= '$suit_rate',\n\t\t\t\tdupatta_rate\t\t= '$dupatta_rate',\n\t\t\t\tghagra_rate \t\t= '$ghagra_rate',\n\t\t\t\tblause_rate \t\t= '$blause_rate',\n\t\t\t\ttotal_rate\t\t = '$total_rate',\n\t\t\t\tmodified_on\t\t\t= now()\n\t\t\t\tWHERE\n\t\t\t\trate_id \t\t\t= '$rate_id'\n\t\t\t\t\";\n\t\t$query = mysql_query($edit);\n\t\t//echo $edit.mysql_error();exit;\n\t\t\n\t}",
"function setReward($points, $rewardArray, $name, $email){\n\t\tif(($rewardArray['500'] != 500) && ($points >= 500)){ //one time award at 500 points\n\t\t\t$rewardArray['100'] += 100;\n\t\t\t$reward = \"100 => \".$rewardArray['100'].\", 250 => \".$rewardArray['250'].\", 500 => 500\";\n\t\t\t$sql = \"UPDATE users SET reward = '$reward' \";\n\t\t\t$result = $this->db->query($sql);\n\n\t\t\t$code = 'Chat_'.RandomString(10);\n\t\t\t$ckey = '';\n\n\t\t\t$this->createCoupon($code, $ckey, $email);\n\t\t\t$this->sendReward('Have an interview with our expert staff and be highlighted on our blog and homepage.', $name, $email, $code);\n\t\t} elseif($points >= $rewardArray['100']){ // every 100\n\t\t\t$rewardArray['100'] += 100;\n\t\t\t$reward = \"100 => \".$rewardArray['100'].\", 250 => \".$rewardArray['250'].\", 500 =>\".$rewardArray['500'];\n\t\t\t$sql = \"UPDATE users SET reward = '$reward' \";\n\t\t\t$result = $this->db->query($sql);\n\n\t\t\t$code = 'rew_'.RandomString(16);\n\t\t\t$ckey = 6;\n\n\t\t\t$this->createCoupon($code, $ckey, $email);\n\t\t\t$this->sendReward('20% off any single non-sale item', $name, $email, $code); \n\t\t}\n\t\t\n\t\tif($points > $rewardArray['250']){ //every 250\n\t\t\t$rewardArray['250'] += 250;\n\t\t\t$reward = \"100 => \".$rewardArray['100'].\", 250 => \".$rewardArray['250'].\", 500 =>\".$rewardArray['500'];\n\t\t\t$sql = \"UPDATE users SET reward = '$reward' \";\n\t\t\t$result = $this->db->query($sql);\n\n\t\t\t$code = 'rew_'.RandomString(16);\n\t\t\t$ckey = 2;//free shipping coupon\n\n\t\t\t$this->createCoupon($code, $ckey, $email);\n\t\t\t$this->sendReward('Free Ground shipping for US domestic or $10 off intenational shipping', $name, $email, $code);\n\t\t}\n\t\t\n\t}",
"public function getBitRate() {}",
"public function calculatePayment()\n {\n }",
"public function clear_rate($id) {\n if ($id > 0) {\n $data = Input::all();//echo \"<pre>\";print_r($data);exit();\n $CompanyID = User::get_companyID();\n $username = User::get_user_full_name();\n $EffectiveDate = $EndDate = $Rate = $RateN = $Interval1 = $IntervalN = $ConnectionFee = 'NULL';\n try {\n DB::beginTransaction();\n $p_criteria = 0;\n $action = 2; //delete action\n $criteria = json_decode($data['criteria'], true);\n\n $criteria['Code'] = !empty($criteria['Code']) && $criteria['Code'] != '' ? \"'\" . $criteria['Code'] . \"'\" : 'NULL';\n $criteria['Description'] = !empty($criteria['Description']) && $criteria['Description'] != '' ? \"'\" . $criteria['Description'] . \"'\" : 'NULL';\n $criteria['Country'] = !empty($criteria['Country']) && $criteria['Country'] != '' && $criteria['Country'] != 'All' ? \"'\" . $criteria['Country'] . \"'\" : 'NULL';\n $criteria['Effective'] = !empty($criteria['Effective']) && $criteria['Effective'] != '' ? \"'\" . $criteria['Effective'] . \"'\" : 'NULL';\n $criteria['TrunkID'] = !empty($criteria['Trunk']) && $criteria['Trunk'] != '' ? \"'\" . $criteria['Trunk'] . \"'\" : 'NULL';\n $criteria['TimezonesID'] = !empty($criteria['Timezones']) && $criteria['Timezones'] != '' ? \"'\" . $criteria['Timezones'] . \"'\" : 'NULL';\n\n if(empty($criteria['TimezonesID']) || $criteria['TimezonesID'] == 'NULL') {\n $criteria['TimezonesID'] = $data['TimezonesID'];\n }\n\n if(empty($criteria['TrunkID']) || $criteria['TrunkID'] == 'NULL') {\n $criteria['TrunkID'] = $data['TrunkID'];\n }\n\n $AccountID = $id;\n $VendorRateID = $data['VendorRateID'];\n\n if (empty($data['VendorRateID']) && !empty($data['criteria'])) {\n $p_criteria = 1;\n }\n\n $query = \"call prc_VendorRateUpdateDelete (\" . $CompanyID . \",\" . $AccountID . \",'\" . $VendorRateID . \"',\" . $EffectiveDate . \",\" . $EndDate . \",\" . $Rate . \",\" . $RateN . \",\" . $Interval1 . \",\" . $IntervalN . \",\" . $ConnectionFee . \",\" . $criteria['Country'] . \",\" . $criteria['Code'] . \",\" . $criteria['Description'] . \",\" . $criteria['Effective'] . \",\" . $criteria['TrunkID'] . \",\" . $criteria['TimezonesID'] . \",'\" . $username . \"',\".$p_criteria.\",\".$action.\")\";\n Log::info($query);\n $results = DB::statement($query);\n\n if ($results) {\n DB::commit();\n return Response::json(array(\"status\" => \"success\", \"message\" => \"Rates Successfully Deleted\"));\n } else {\n return Response::json(array(\"status\" => \"failed\", \"message\" => \"Problem Deleting Vendor Rates.\"));\n }\n } catch (Exception $ex) {\n DB::rollback();\n return Response::json(array(\"status\" => \"failed\", \"message\" => $ex->getMessage()));\n }\n\n }\n }",
"function statRiskChargeBackPaymentMethod()\n{\n $post = getPostInfo();\n $startTime= isset($post['startdate'])?$post['startdate']:'2016-12-19';//'2016-08-01';//'2016-12-23';\n $endTime = isset($post['enddate'])?$post['enddate']:'2017-01-23';//'2017-01-01';//'2017-01-22';\n $duration = isset($post['granularity'])?$post['granularity']:'week';//'month';//'day'; // day month week\n\n $condition = '';\n if (isset($post['paymentMethod']) && trim($post['paymentMethod']))\n {\n $paymentMethod = trim($post['paymentMethod']);\n if (!empty($condition)) {\n $condition .= \" AND `PaymentMethod`='{$paymentMethod}' \";\n } else {\n $condition = \" `PaymentMethod`='{$paymentMethod}' \";\n }\n }\n if (isset($post['shopperInteraction']) && trim($post['shopperInteraction']))\n {\n $shopperInteraction = trim($post['shopperInteraction']);\n if (!empty($condition)) {\n $condition .= \" AND `Shopper`='{$shopperInteraction}' \";\n } else {\n $condition = \" `Shopper`='{$shopperInteraction}' \";\n }\n }\n if (isset($post['countryFilter']) && trim($post['countryFilter']))\n {\n $countryFilter = trim($post['countryFilter']);\n if (!empty($condition)) {\n $condition .= \" AND `Country`='{$countryFilter}' \";\n } else {\n $condition = \" `Country`='{$countryFilter}' \";\n }\n }\n\n if ($duration == 'day') {\n $endTime = date('Y-m-d', strtotime(\"$endTime -1 day\"));\n $dateArr = parseDate($startTime, $endTime);\n }\n if ($duration == 'month') {\n $endTime = date('Y-m-d', strtotime(\"$endTime -1 day\"));\n $dateArr = parseDate($startTime, $endTime);\n }\n if ($duration == 'week') {\n $dateArr = parseDate($startTime, $endTime);\n }\n\n if (!empty($condition)) {\n $condition .= \" AND `CreateDate` BETWEEN '{$dateArr['start']}' AND '{$dateArr['end']}' \";\n } else {\n $condition = \" `CreateDate` BETWEEN '{$dateArr['start']}' AND '{$dateArr['end']}' \";\n }\n\n $sql = \"\n SELECT DISTINCT `PaymentMethod` as PaymentMethod\n FROM `risk`\n WHERE $condition\n \";\n $pageInfo = DB::fetchAll(DB_NUMBER, $sql);\n $payments = [];\n if ($pageInfo)\n {\n foreach($pageInfo as $item)\n {\n if(isset($item['PaymentMethod']) && $item['PaymentMethod'])\n {\n $payments[] = $item['PaymentMethod'];\n }\n }\n }\n return $payments;\n}",
"public function redeembp(){\n\t\t$this->db->where('CustomerMail', $this->session->userdata('useremail'));\n\t\t$this->db->select_sum('EarnedPotint');\n\t\t$this->db->from('tbl_bvpoint_data');\n\t\t$query = $this->db->get();\n\t\t$sumvalue=$query->row()->EarnedPotint;\n\t\t//echo $sumvalue;\n\t\tif($sumvalue>100){\n\t\t\t$redeempoint=100;\n\t\t}\n\t\telse{\n\t\t\t$redeempoint=$sumvalue;\n\t\t}\n\t\treturn round($redeempoint*0.25);\n\t}",
"function on_buy()\r\n\t{\r\n\t}",
"function beforeSave(){\n\t\t\t// Get the rate\n\t\t\t$rate = 1 / $this->_getRate();\n\n\t\t\t// Convert it back to USD\n\t\t\tif(!empty($this->data['Product']['rrp'])){\n\t\t\t\t$this->data['Product']['rrp'] = $this->data['Product']['rrp'] * $rate;\n\t\t\t}\n\n\t\t\tif(!empty($this->data['Product']['start_price'])){\n\t\t\t\t$this->data['Product']['start_price'] \t= $this->data['Product']['start_price'] * $rate;\n\t\t\t}\n\n\t\t\tif(!empty($this->data['Product']['delivery_cost'])){\n\t\t\t\t$this->data['Product']['delivery_cost'] = $this->data['Product']['delivery_cost'] * $rate;\n\t\t\t}\n\n\t\t\tif(!empty($this->data['Product']['fixed_price'])){\n\t\t\t\t$this->data['Product']['fixed_price'] \t= $this->data['Product']['fixed_price'] * $rate;\n\t\t\t}\n\n\t\t\tif(!empty($this->data['Product']['minimum_price'])){\n\t\t\t\t$this->data['Product']['minimum_price'] = $this->data['Product']['minimum_price'] * $rate;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}",
"public function testUpdatePayrun()\n {\n }",
"function mlmRegularBonus()\n{\n\t$table_prefix = mlm_core_get_table_prefix();\n\t\n\t$error = '';\n\t$chk = 'error';\n\t\n\t//get no. of level\n\t$mlm_general_settings = get_option('wp_mlm_general_settings');\n\t$mlm_no_of_level=$mlm_general_settings['mlm-level'];\n\t\n\t\n\t//most outer if condition\n\tif(isset($_POST['mlm_regular_bonus_settings']))\n\t{\n\n\t\t$per_ref = count(array_filter($_POST['per_ref']));\n\t\n\n\t\t$pay_value = count(array_filter($_POST['pay_value']));\n\n\t\t\n\t\tif ( $per_ref==0 ) \n\t\t\t$error .= \"\\n Please Specify No. of Personal Referral.\";\n\t\t\t\t\t\n\t\tif ( $pay_value==0 ) \n\t\t\t$error .= \"\\n Please Specify Payout Value.\";\n\n\n\t\t\n\t\t//if any error occoured\n\t\tif(!empty($error))\n\t\t\t$error = nl2br($error);\n\t\telse\n\t\t{\n\t\t\t$chk = '';\n\t\t\t\n\t\t\tupdate_option('wp_mlm_regular_bonus_settings', $_POST);\n\t\t\t$url = get_bloginfo('url').\"/wp-admin/admin.php?page=admin-settings&tab=royalty_bonus\";\n\t\t\t_e(\"<script>window.location='$url'</script>\");\n\t\t\t$msg = _e(\"<span style='color:green;'>Your bonus has been successfully updated.</span>\",'unilevel-mlm-pro');\n\t\t}\n\t}// end outer if condition\n\tif($chk!='')\n\t{\n\t\t$mlm_settings = get_option('wp_mlm_regular_bonus_settings');\n?>\n<div class='wrap1'>\n\t<h2><?php _e('Regular Bonus Settings','unilevel-mlm-pro');?> </h2>\n\t<div class=\"notibar msginfo\">\n\t\t<a class=\"close\"></a>\n\t\t<p><?php _e('Regular bonus is a one time payment made to a member in the network based on the number of personal referrers. To add a new bonus slab click the Add Row Button. To delete a particular bonus slab, select the checkbox against the slab and click the Delete Row Button.','unilevel-mlm-pro');?></p>\n<p><strong><?php _e('No. of Personal Referrers','unilevel-mlm-pro');?> - </strong><?php _e('This is the value of the personal referrers which would trigger a bonus distribution in the network. If the first slab has a value of 5 personal referrers while the next slab has 10 personal referrers, this implies that the member has to sponsor 5 members to get the bonus of Slab1 and a total of 15 members (10 more members) in the network in order to get the bonus for the\nSlab2.','unilevel-mlm-pro');?></p>\n<p><strong><?php _e('Payout Value','unilevel-mlm-pro');?> -</strong> <?php _e('This is the fixed payout amount paid to the member on achieving the milestone.','unilevel-mlm-pro');?></p>\n\n\t</div>\n\t\n\t<?php if($error) :?>\n\t<div class=\"notibar msgerror\">\n\t\t<a class=\"close\"></a>\n\t\t<p> <strong><?php _e('Please Correct the following Error','unilevel-mlm-pro');?> :</strong> <?php _e($error); ?></p>\n\t</div>\n\t<?php endif; ?>\n\t<?php if(!empty($msg)) :?>\n\t<div class=\"notibar msgerror\">\n\t\t<a class=\"close\"></a>\n\t\t<p><?php _e($msg); ?></p>\n\t</div>\n\t<?php endif; ?>\n\t\n\n<?php\n\tif(empty($mlm_settings))\n\t{\n?>\n<form name=\"admin_bonus_settings\" method=\"post\" action=\"\">\n\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" class=\"form-table\">\n\t\t\n\t\t\n\t\t<tr>\n\n\t\t\t<td>\n\t\t\t\t<INPUT type=\"button\" value=\"<?php _e('Add Row','unilevel-mlm-pro')?>\" onclick=\"addRow('dataTable')\" class='button-primary' />\n \t\t\t<INPUT type=\"button\" value=\"<?php _e('Delete Row','unilevel-mlm-pro')?>\" onclick=\"deleteRow('dataTable')\" class='button-primary' />\n\t\t\t\t<div class=\"toggle-visibility\" id=\"admin-mlm-bonus-slab\"><?php _e('Add or remove bonus slab.','unilevel-mlm-pro');?></div>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr><td> </td></tr>\n\t</table>\n\t<TABLE id=\"dataTableheading\" cellspacing=\"5\" cellpadding=\"5\" border=\"0\" width=\"450\">\n\t\t<TR>\n\t\t\t<TD align=\"left\" width=\"12%\"><strong><?php _e('Select','unilevel-mlm-pro');?></strong></TD>\n\t\t\t<TD align=\"left\" width=\"44%\"> <strong><?php _e('No. of Personal Referrals','unilevel-mlm-pro');?></strong></TD>\n\t\t\t\n\t\t\t<TD align=\"left\" width=\"44%\"> <strong><?php _e('Payout Value','unilevel-mlm-pro');?></strong></TD>\n\t\t</TR>\n\t</TABLE>\n\t<br\\>\n\t<TABLE id=\"dataTable\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" width=\"450\">\n\t\t<TR>\n\t\t\t<TD align=\"left\" width=\"12%\"><INPUT type=\"checkbox\" name=\"chk[]\"/></TD>\n\t\t\t<TD align=\"left\" width=\"44%\"> <INPUT type=\"text\" name=\"per_ref[]\" size=\"15\" /> </TD>\n\t\t\t\n\t\t\t<TD align=\"left\" width=\"44%\"> <INPUT type=\"text\" name=\"pay_value[]\" size=\"15\" /> </TD>\n\t\t\t\n\t\t</TR>\n\t</TABLE>\n\t\n\t<table border=\"0\" width=\"100%\">\t\n\t\t<tr>\n\t\t\t<td>\n\t\t<p class=\"submit\">\n\t<input type=\"submit\" name=\"mlm_regular_bonus_settings\" id=\"mlm_regular_bonus_settings\" value=\"<?php _e('Update Options', 'unilevel-mlm-pro');?> »\" class='button-primary' onclick=\"needToConfirm = false;\">\n\t</p>\n\t\t\t</td>\n\t\t<tr>\n\t</table>\n</form>\n</div>\n<script language=\"JavaScript\">\n populateArrays();\n</script>\n<?php\n\t\t}\n\t\telse if(!empty($mlm_settings))\n\t\t{\n\t\t\t?>\n\t\t\n\t\t\t<form name=\"admin_bouns_settings\" method=\"post\" action=\"\">\n\t<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" width=\"100%\" class=\"form-table\">\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t<INPUT type=\"button\" value=\"<?php _e('Add Row','unilevel-mlm-pro')?>\" onclick=\"addRow('dataTable')\" class='button-primary'/>\n \t\t\t<INPUT type=\"button\" value=\"<?php _e('Delete Row','unilevel-mlm-pro')?>\" onclick=\"deleteRow('dataTable')\" class='button-primary'/>\n\t\t\t\t<div class=\"toggle-visibility\" id=\"admin-mlm-bonus-slab\"><?php _e('Add or remove bonus slab.','unilevel-mlm-pro');?></div>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr><td> </td></tr>\n\t</table>\n\t<TABLE id=\"dataTableheading\" cellspacing=\"5\" cellpadding=\"5\" border=\"0\" width=\"450\" >\n\t\t<TR>\n\t\t\t<TD align=\"left\" width=\"12%\"><strong><?php _e('Select','unilevel-mlm-pro');?></strong></TD>\n\t\t\t<TD align=\"left\" width=\"44%\"> <strong><?php _e('No. of Personal Referrals','unilevel-mlm-pro');?></strong></TD>\n\t\t\t<TD align=\"left\" width=\"44%\"> <strong><?php _e('Payout Value','unilevel-mlm-pro');?></strong></TD>\n\t\t\t\n\t\t</TR>\n\t</TABLE>\n\t<br\\>\n\t\t<TABLE id=\"dataTable\" cellspacing=\"5\" cellpadding=\"5\" border=\"0\" width=\"450\">\n\t\t<?php\n\t\t\t$i = 0;\n\t\t\twhile( $i<count($mlm_settings['per_ref']) )\n\t\t\t{\n\t\t?>\n \t<TR>\n \t\t<TD align=\"left\" width=\"12%\"><INPUT type=\"checkbox\" name=\"chk[]\"/></TD>\n\t\t\t\t<TD align=\"left\" width=\"44%\"> <INPUT type=\"text\" name=\"per_ref[]\" size=\"15\" value=\"<?= $mlm_settings['per_ref'][$i]?>\"/> </TD>\n\t\t\t\t\n\t\t\t\t<TD align=\"left\" width=\"44%\"> <INPUT type=\"text\" name=\"pay_value[]\" size=\"15\" value=\"<?= $mlm_settings['pay_value'][$i]?>\"/> </TD>\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\n \t</TR> \t\n\t\t<?php\n\t\t\t\t$i++;\n\t\t\t}\n\t\t?>\n\t\t</TABLE>\n\t\n\t<p class=\"submit\">\n\t<input type=\"submit\" name=\"mlm_regular_bonus_settings\" id=\"mlm_regular_bonus_settings\" value=\"<?php _e('Update Options', 'unilevel-mlm-pro');?> »\" class='button-primary' onclick=\"needToConfirm = false;\">\n\t</p>\n</form>\n</div>\n<script language=\"JavaScript\">\n populateArrays();\n</script>\n\t\t\t<?php\n\t\t}\n\t\n\t} // end if statement\n\telse\n\t\t _e($msg);\n}",
"public function charges();",
"function HdfcBankPL($net_salary, $clubbed_emi, $company, $category, $DOB, $Company_Type, $Primary_Acc, $reqtenure, $reqloanamount) {\n $exactnet_salary = $net_salary;\n $exactnet_salaryTO = $net_salary - $clubbed_emi;\n list($calterm, $calprint_term) = Calculate_Tenure($DOB, \"5\", \"62\");\n\t\t//for reqd tenure////////////////////////////////////////////////////////////////////////\n\t\tif($reqtenure>0)\n\t\t{\n\t\t\tif($reqtenure>$calprint_term)\n\t\t\t{\n\t\t\t\t$term = $calterm;\n\t\t\t\t$print_term = $calprint_term;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$term = $reqtenure*12;\n\t\t\t\t$print_term = $reqtenure;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t}\n\t\t//for reqd tenure end////////////////////////////////////////////////////////////////////////\n $interestrate = '';\n $getemicalc = 0;\n $pro_fee = '';\n $getterm = 0;\n $getloanamout = 0;\n $crprecordcount = 0;\n\t\t$gtcropcomp=\"Select interest_rate_csa ,interest_rate_noncsa From pl_company_hdfc Where (company_name like '%\".$company.\"%' and status=1)\";\n\t\tlist($alreadyExist,$hdfcrowar)=Mainselectfunc($gtcropcomp,$array = array());\n\n if (count($hdfcrowar) > 0) {\n $icicirow = array(\"interest_rate_csa\" => $hdfcrowar[\"interest_rate_csa\"], \"interest_rate_noncsa\" => $hdfcrowar[\"interest_rate_noncsa\"]);\n $crprecordcount = $icicirow[\"interest_rate_csa\"];\n }\n\t\t\t\telse\n\t\t\t{\n\t\t\t\t\t$crprecordcount=0;\n\t\t\t}\n \n if ($crprecordcount > 0) {\n if ($Primary_Acc == \"HDFC\" || $Primary_Acc == \"HDFC Bank\" || $Primary_Acc == \"hdfc\") {\n list($main, $gen) = explode('.', $icicirow[\"interest_rate_csa\"]);\n if ($gen == 00) {\n $interestrate = $main . \" \";\n } else {\n $interestrate = $icicirow[\"interest_rate_csa\"] . \" \";\n }\n\n $intr = $icicirow[\"interest_rate_csa\"];\n } else {\n list($main, $gen) = explode('.', $icicirow[\"interest_rate_noncsa\"]);\n if ($gen == 00) {\n $interestrate = $main . \"\";\n } else {\n $interestrate = $icicirow[\"interest_rate_noncsa\"];\n }\n\n $intr = $icicirow[\"interest_rate_noncsa\"];\n }\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 10;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 14;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 16;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n $pro_fee = \"Rs. 1000 - 1.75%\";\n } else {\n $getloanamout = 0;\n if ($category == \"Super A\" || $category == \"SUPER A\") {\n if ($exactnet_salary <= 35000) {\n $interestrate = \"17.85\";\n $intr = 17.85;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 10;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 14;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 16;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n }\n\n\n $getloanamout = $Loan_Amount_Eli;\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 35000 && $exactnet_salary <= 50000) {\n $interestrate = \"15.75\";\n $intr = 15.75;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 6;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 10;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 16;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 16;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 20;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 20;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 50000 && $exactnet_salary <= 75000) {\n $interestrate = \"15.75\";\n $intr = 15.75;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 12;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 16;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 21;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 21;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 75000) {\n $interestrate = \"15.65\";\n $intr = 15.65;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 21;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 22;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 22;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } else {\n $interestrate = 0;\n $int = 0;\n $getloanamout = 0;\n }\n }//SUPER A\n elseif ($category == \"Cat A\" || $category == \"CAT A\" || $category == \"CSA A\") {\n if ($exactnet_salary <= 35000) {\n $interestrate = \"17.85\";\n $intr = 17.85;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 10;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 14;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 16;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 35000 && $exactnet_salary <= 50000) {\n $interestrate = \"15.85\";\n $intr = 15.85;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 6;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 10;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 14;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 17;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 20;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 20;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 50000 && $exactnet_salary <= 75000) {\n $interestrate = \"15.75\";\n $intr = 15.75;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 11;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 20;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 20;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 75000) {\n $interestrate = \"15.65\";\n $intr = 15.65;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 11;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 16;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 22;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 22;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } else {\n $interestrate = 0;\n $int = 0;\n $getloanamout = 0;\n }\n }//CAT A CSA A\n elseif ($category == \"CAT GB\" || $category == \"GOVT\" || $Company_Type == 4 || $Company_Type == 5 || $Company_Type == 6) {\n if ($exactnet_salary >= 75000) {\n if (($company == \"ALLAHABAD BANK\" || $company == \"ANDHRA BANK\" || $company == \"BANK OF BARODA\" || $company == \"BANK OF INDIA\" || $company == \"CANARA BANK\" || $company == \"CORPORATION BANK\" || $company == \"KARNATAKA BANK LTD\" || $company == \"PUNJAB NATIONAL BANK\" || $company == \"STATE BANK OF INDIA\" || $company == \"SYNDICATE BANK\" || $company == \"VIJAYA BANK\" || $company == \"UNION BANK OF INDIA\")) {\n $interestrate = \"15.5\";\n $intr = 15.5;\n } else {\n $interestrate = \"15.5\";\n $intr = 15.5;\n }\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 10;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 17;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } else {\n $interestrate = 0;\n $int = 0;\n $getloanamout = 0;\n }\n if ($exactnet_salary >= 50000 && $exactnet_salary < 75000) {\n if (($company == \"ALLAHABAD BANK\" || $company == \"ANDHRA BANK\" || $company == \"BANK OF BARODA\" || $company == \"BANK OF INDIA\" || $company == \"CANARA BANK\" || $company == \"CORPORATION BANK\" || $company == \"KARNATAKA BANK LTD\" || $company == \"PUNJAB NATIONAL BANK\" || $company == \"STATE BANK OF INDIA\" || $company == \"SYNDICATE BANK\" || $company == \"VIJAYA BANK\" || $company == \"UNION BANK OF INDIA\")) {\n $interestrate = \"15.5\";\n $intr = 15.5;\n } else {\n $interestrate = \"15.5\";\n $intr = 15.5;\n }\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 10;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 17;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 19;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $getemicalc = round($getloanamout * ($intr1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary >= 35000 && $exactnet_salary < 50000) {\n if (($company == \"ALLAHABAD BANK\" || $company == \"ANDHRA BANK\" || $company == \"BANK OF BARODA\" || $company == \"BANK OF INDIA\" || $company == \"CANARA BANK\" || $company == \"CORPORATION BANK\" || $company == \"KARNATAKA BANK LTD\" || $company == \"PUNJAB NATIONAL BANK\" || $company == \"STATE BANK OF INDIA\" || $company == \"SYNDICATE BANK\" || $company == \"VIJAYA BANK\" || $company == \"UNION BANK OF INDIA\")) {\n $interestrate = \"15.75\";\n $intr = 15.75;\n } else {\n $interestrate = \"15.75\";\n $intr = 15.75;\n }\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary < 35000) {\n if (($company == \"ALLAHABAD BANK\" || $company == \"ANDHRA BANK\" || $company == \"BANK OF BARODA\" || $company == \"BANK OF INDIA\" || $company == \"CANARA BANK\" || $company == \"CORPORATION BANK\" || $company == \"KARNATAKA BANK LTD\" || $company == \"PUNJAB NATIONAL BANK\" || $company == \"STATE BANK OF INDIA\" || $company == \"SYNDICATE BANK\" || $company == \"VIJAYA BANK\" || $company == \"UNION BANK OF INDIA\") && $exactnet_salary >= 20000) {\n $interestrate = \"17.75\";\n $intr = 17.75;\n } else {\n $interestrate = \"17.75\";\n $intr = 17.75;\n }\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n }\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } else {\n $interestrate = 0;\n $int = 0;\n $getloanamout = 0;\n }\n if ($Primary_Acc == 'HDFC') {\n $pro_fee = \"2%\";\n } else {\n $pro_fee = \"2.5%\";\n }\n } elseif ($category == \"CAT B\" || $category == \"CSA B\") {\n if ($exactnet_salary <= 35000) {\n $interestrate = \"17.85\";\n $intr = 17.85;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 4;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 4;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n }\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 35000 && $exactnet_salary <= 50000) {\n $interestrate = \"15.85\";\n $intr = 15.85;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n }\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 50000 && $exactnet_salary <= 75000) {\n $interestrate = \"15.75\";\n $intr = 15.75;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 75000) {\n $interestrate = \"15.65\";\n $intr = 15.65;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 15;\n $getterm = 4;\n } elseif ($term == 60) {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 18;\n $getterm = 5;\n }\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } else {\n $interestrate = 0;\n $int = 0;\n $getloanamout = 0;\n }\n } elseif ($category == \"CAT C\" || $category == \"CSA C\") {\n if ($exactnet_salary >= 75000) {\n $interestrate = \"15.65\";\n $intr = 15.65;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 6;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 11;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 4;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 4;\n }\n } elseif ($exactnet_salary >= 50000 && ($exactnet_salary < 75000)) {\n $interestrate = \"15.75\";\n $intr = 15.75;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 11;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 4;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 13;\n $getterm = 4;\n }\n } elseif ($exactnet_salary >= 35000 && ($exactnet_salary < 50000)) {\n $interestrate = \"15.85\";\n $intr = 15.85;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 11;\n $getterm = 4;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 11;\n $getterm = 4;\n }\n } elseif ($exactnet_salary >= 25000 && ($exactnet_salary < 35000)) {\n $interestrate = \"17.85\";\n $intr = 17.85;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n } elseif (($term >= 48 && $term < 60)) {\n $Loan_Amount_Eli = $exactnet_salary * 11;\n $getterm = 4;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 11;\n $getterm = 4;\n }\n } else {\n $interestrate = 0;\n $int = 0;\n $getloanamout = 0;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n }//CAT C\n elseif ($category == \"Cat D\" || $category == \"CAT D\" || $category == \"CSA D\") {\n if ($exactnet_salary < 35000) {\n $interestrate = \"17.85\";\n $intr = 17.85;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary >= 35000 && $exactnet_salary <= 50000) {\n $interestrate = \"15.85\";\n $intr = 15.85;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 50000 && $exactnet_salary <= 75000) {\n $interestrate = \"15.75\";\n $intr = 15.75;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n }\n\n $getloanamout = $Loan_Amount_Eli;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } elseif ($exactnet_salary > 75000) {\n $interestrate = \"15.65\";\n $intr = 15.65;\n\n if ($term >= 12 && $term < 24) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term >= 24 && $term < 36) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 2;\n } elseif ($term >= 36 && $term < 48) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n }\n $getloanamout = $Loan_Amount_Eli;\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n } elseif ($getterm == 5) {\n $term = 60;\n }\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n } else {\n $interestrate = 0;\n $int = 0;\n $getloanamout = 0;\n }\n } else {\n if ($exactnet_salary >= 25000) {\n $interestrate = \"19.50\";\n $intr = 19.50;\n\n if ($term == 12) {\n $Loan_Amount_Eli = $exactnet_salary * 5;\n $getterm = 1;\n } elseif ($term == 24) {\n $Loan_Amount_Eli = $exactnet_salary * 7;\n $getterm = 2;\n } elseif ($term == 36) {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n } else {\n $Loan_Amount_Eli = $exactnet_salary * 9;\n $getterm = 3;\n }\n // ASK//\n if ($Primary_Acc == 'HDFC') {\n if ($Loan_Amount_Eli > 150000) {\n $getloanamout = 150000;\n } else {\n $getloanamout = $Loan_Amount_Eli;\n }\n $pro_fee = \"2%\";\n } else {\n if ($Loan_Amount_Eli > 75000) {\n $getloanamout = 75000;\n } else {\n $getloanamout = $Loan_Amount_Eli;\n }\n $pro_fee = \"2.5%\";\n }\n } else {\n $getloanamout = 0;\n $intr = 0;\n $interestrate = 0;\n }\n }\n } //special companies\n\t\t\t\n\t\t\t////////////////////////////////////////////////////////\n\t\t\tif($reqloanamount>0)\n\t\t\t{\n\t\t\t\tif($reqloanamount>$getloanamout)\n\t\t\t\t{\n\t\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$getloanamout=$reqloanamount;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t}\n\t\t\t///////////////////////////////////////////////////////\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n\t\t\t\n //for clause above 10lacs\n if (($category == \"CAT A\" || $category == \"CAT B\" || $category == \"CAT C\" || $category == \"CAT D \" || $category == \"CAT GB\" || $category == \"CSA A\" || $category == \"CSA B\" || $category == \"CSA C\" || $category == \"CSA D\" || $category == \"GOVT\" || $category == \"Super A\" || $Company_Type == 4 || $Company_Type == 5 || $Company_Type == 6)) {\n if ($getloanamout >= 1000000 && $exactnet_salary >= 75000) {\n if ($getloanamout >= 2000000) {\n $interestrate = \"11.49\";\n $intr = 11.49;\n $pro_fee = \"Rs. 2999\";\n } elseif ($getloanamout >= 1500000 && $getloanamout < 2000000) {\n $interestrate = \"12.75\";\n $intr = 12.75;\n $pro_fee = \"Rs. 3999\";\n } elseif ($getloanamout >= 1000000 && $getloanamout < 1500000) {\n $interestrate = \"12.99\";\n $intr = 12.99;\n $pro_fee = \"Rs. 4999\";\n } else {\n $interestrate = 0;\n $intr = 0;\n }\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n $spl_category = 1;\n } else {\n $chkclause = 14.5 / 1200;\n if ((($exactnet_salary >= 40000 && $exactnet_salary < 75000) && ($getloanamout >= 500000 && $getloanamout <= 1000000)) && ($category == \"CAT B\" || $category == \"CAT A\" || $category == \"Super A\" || $category == \"CSA A\" || $category == \"CSA B\" || $category == \"CAT C\" || $category == \"CSA C\") && $intr > $chkclause) {\n $interestrate = \"14.5\";\n $intr = 14.5;\n $pro_fee = \"0.8%\";\n } else {\n $getloanamout = $getloanamout;\n\n if ($getterm == 1) {\n $term = 12;\n } elseif ($getterm == 2) {\n $term = 24;\n } elseif ($getterm == 3) {\n $term = 36;\n } elseif ($getterm == 4) {\n $term = 48;\n }\n\n $getemicalc = round($getloanamout * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($getloanamout, $intr, $term);\n if ($Primary_Acc == 'HDFC') {\n $pro_fee = \"2%\";\n } else {\n $pro_fee = \"Rs. 999\";\n }\n }\n }\n }\n \n if (($category == \"CAT A\" || $category == \"CAT B\" || $category == \"CAT C\" || $category == \"CAT D \" || $category == \"CAT GB\" || $category == \"CSA A\" || $category == \"CSA B\" || $category == \"CSA C\" || $category == \"CSA D\" || $category == \"GOVT\" || $category == \"Super A\") && $spl_category = \"\") {\n if ($exactnet_salary >= 50000) {\n $pro_fee = \"0.80%\";\n } else {\n $pro_fee = \"Rs. 999\";\n }\n }\n\n $alac = 100000;\n $peremicalc = round($alac * ($intr/1200) / (1 - (pow(1/(1 + ($intr/1200)), $term))));//getController()->Common()->getEMI($alac, $intr, $term);\n $tilldate = Date('Y-m-d');\n if ($tilldate <= '2016-08-16') {\n $pro_fee = \"0% (Till 16th Aug*)\";\n }\n\t\t$emiperlac = round(100000 * ($interestrate/1200) / (1 - (pow(1/(1 + ($interestrate/1200)), $term))));\n $details['bank_code'] = \"HDFC Bank\";\n $details['interest_rate'] = interestRateFormat($interestrate);\n $details['emi'] = $getemicalc;\n $details['emiperlac'] = $emiperlac;\n $details['tenure'] = $getterm;\n $details['loan_amount'] = round($getloanamout);\n $details['processing_fee'] = $pro_fee;\n $details['category'] = $category;\n return($details);\n\t\t}",
"public function pay_little(){\n if(!$this->session->has_userdata('pay_little') or $this->session->userdata('pay_little') != TRUE){\n show_404();\n }\n $deal_id = $this->uri->segment(3);\n $red = $this->uri->segment(4);\n if(isset($deal_id) and is_numeric($deal_id)){\n $deal = $this->base_model->run_query(\"SELECT d.id , d.pay , d.volume , d.rest , d.customer_id , c.fullname FROM deal d LEFT JOIN customer c ON d.customer_id = c.id WHERE d.id = $deal_id\" , 'row');\n if(empty($deal)){\n show_404();\n }\n if($red == 'group'){\n $red1 = 'deal'; \n $red2 = 'profile';\n $red3 = $deal->customer_id; \n }else if($red == 'rest'){\n $red1 = 'settings';\n $red2 = 'rest_unit';\n $red3 = '';\n }else{\n $red1 = 'deal';\n $red2 = 'archive';\n $red3 = '';\n }\n $check = abs($deal->volume - $deal->pay);\n if($check <= 50000 && $check != 0 && $deal->rest != 0 && $deal->pay != 0){\n $date = $this->convertdate->convert(time());\n $updeal['rest'] = 0;\n $log['user_id'] = $this->session->userdata('id');\n $log['date_log'] = $date['dd'];\n $log['time_log'] = $date['t'];\n $log['activity_id'] = 28;\n $log['explain'] = \" شناسه معامله : \".$deal->id.\" | نام مشتری : \".$deal->fullname.\"</br> حجم معامله : \".number_format($deal->volume).\" | حجم پرداخت شده \".number_format($deal->pay).\" | حجم باقی مانده : \".number_format($deal->rest).\"</br> مبلغ باقی مانده به اندازه \".number_format($check).\" توسط کاربر صفر گردید \";\n $log['customer_id'] = $deal->customer_id;\n $this->base_model->insert_data('log' , $log);\n $this->base_model->update_data('deal' , $updeal , array('id'=>$deal->id));\n $message['msg'][0] = ' مبلغ '.number_format($check).\" به صورت خرد پرداخت شد \";\n $message['msg'][1] = 'success';\n $this->session->set_flashdata($message);\n redirect($red1.\"/\".$red2.\"/\".$red3);\n }else{\n $message['msg'][0] = 'خطا در سیستم';\n $message['msg'][1] = 'danger';\n $this->session->set_flashdata($message);\n redirect($red1.\"/\".$red2.\"/\".$red3);\n }\n }else{\n show_404();\n }\n }",
"function getOutletDiscountRate()\n {\n $dayOfMonth = date('j');\n return 20 + $dayOfMonth;\n }",
"function IIFLbankPL($net_salary,$clubbed_emi,$company,$category,$DOB,$Company_Type, $reqtenure, $reqloanamount)\n\t{\n\t\t $net_salary= $net_salary - $clubbed_emi;\n\t\tlist($calterm, $calprint_term) = Calculate_Tenure($DOB, \"5\", \"60\");\n\n\tif($category==\"SUPER CAT A\")\n\t\t{\n\t\t\tif($net_salary>65000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 13;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<=65000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 13.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary>35000 && $net_salary<=50000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 14;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 0;\n\t\t\t\t\t$intr=0;\n\t\t\t\t}\n\t\t\t\t$proc_Fee=\"1%\";\n\n\t\t\t}\n\t\telseif($category==\"CAT A\" || $category==\"CAT B\")\n\t\t{\n\t\t\tif($net_salary>65000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 13.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<=65000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 14;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary>35000 && $net_salary<=50000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 14.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 0;\n\t\t\t\t\t$intr=0;\n\t\t\t\t}\n\t\t\t\t$proc_Fee=\"1%\";\n\t\t\t\t//tenure\n\t\t\t\tif($category==\"CAT A\")\n\t\t\t\t{\n\t\t\t\t\tif($calterm>48)\n\t\t\t\t\t{\n\t\t\t\t\t\t$calterm=48;\n\t\t\t\t\t\t$calprint_term=4;\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$calterm=$calterm;\n\t\t\t\t\t\t$calprint_term=$calprint_term;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif($category==\"CAT B\")\n\t\t\t\t{\n\t\t\t\t\tif($calterm>36)\n\t\t\t\t\t{\n\t\t\t\t\t\t$calterm=36;\n\t\t\t\t\t\t$calprint_term=3;\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$calterm=$calterm;\n\t\t\t\t\t\t$calprint_term=$calprint_term;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t}//CAT B\n\t\telse\n\t\t{\n\t\t\tif($net_salary>65000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 15;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t\t}\n\t\t\t\telseif($net_salary>50000 && $net_salary<=65000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 15.50;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telseif($net_salary>35000 && $net_salary<=50000)\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 16;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$interestrate = 16;\n\t\t\t\t\t$intr=$interestrate/1200;\n\t\t\t\t}\n\t\t\t\t$proc_Fee=\"1.50%\";\n\t\t\t\tif($calterm>36)\n\t\t\t\t\t{\n\t\t\t\t\t\t$calterm=36;\n\t\t\t\t\t\t$calprint_term=3;\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$calterm=$calterm;\n\t\t\t\t\t\t$calprint_term=$calprint_term;\n\t\t\t\t\t}\n\t\t}\n\t\t//non cat company\n\t\t$term=$calterm;\n\t\t$print_term=$calprint_term;\n\t\t\n\t\tif($reqtenure>0)\n\t\t{\n\t\t\tif($reqtenure>$calprint_term)\n\t\t\t{\n\t\t\t\t$term = $calterm;\n\t\t\t\t$print_term = $calprint_term;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$term = $reqtenure*12;\n\t\t\t\t$print_term = $reqtenure;\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$term = $calterm;\n\t\t\t$print_term = $calprint_term;\n\t\t}\n\t\t//foir\n\t\t$princ=100000;\n\t\t$perlacemi=round($princ * $intr / (1 - (pow(1/(1 + $intr), $term))));\n\n\t\tif($category==\"SUPER CAT A\" || $category==\"CAT A\")\n\t\t{\n\t\t\t\t$firstnet_salary=($net_salary* (60/100));\n\t\t\t\t$newnet_salary= $firstnet_salary;\n\t\t\t\t$finalloanamount_dbr=$newnet_salary/$perlacemi * 100000;\n\t\t}elseif($category==\"CAT B\")\n\t\t{\n\t\t\t\t$firstnet_salary=($net_salary* (55/100));\n\t\t\t\t$newnet_salary= $firstnet_salary;\n\t\t\t\t$finalloanamount_dbr=$newnet_salary/$perlacemi * 100000;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$firstnet_salary=($net_salary* (50/100));\n\t\t\t\t$newnet_salary= $firstnet_salary;\n\t\t\t\t$finalloanamount_dbr=$newnet_salary/$perlacemi * 100000;\n\t\t}//foir end\n\t\t\n\t\tif($category==\"SUPER CAT A\")\n\t\t{\n\t\t\tif($finalloanamount_dbr>2500000)\n\t\t\t\t{\n\t\t\t\t\t$getloanamout = 2500000;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$getloanamout = $finalloanamount_dbr;\t\n\t\t\t\t}\n\t\t}\n\t\telseif($category==\"CAT A\")\n\t\t{\n\t\t\tif($finalloanamount_dbr>2000000)\n\t\t\t\t{\n\t\t\t\t\t$getloanamout = 2000000;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$getloanamout = $finalloanamount_dbr;\t\n\t\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif($finalloanamount_dbr>1500000)\n\t\t\t\t{\n\t\t\t\t\t$getloanamout = 1500000;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$getloanamout = $finalloanamount_dbr;\t\n\t\t\t\t}\n\t\t}\n\n\t\tif($reqloanamount>0)\n\t\t\t{\n\t\t\t\tif($reqloanamount>$getloanamout)\n\t\t\t\t{\n\t\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$getloanamout=$reqloanamount;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$getloanamout=$getloanamout;\n\t\t\t}\n\n\t\t$getterm=$print_term;\n\t\t$getemicalc=round($getloanamout * $intr / (1 - (pow(1/(1 + $intr), $term))));\n\t\t\t\n\t\t\t$details['bank_code'] = \"IIFL\";\n\t\t\t$details['interest_rate'] = interestRateFormat($interestrate);\n\t\t\t$details['emi'] = $getemicalc;\n\t\t\t$details['emiperlac'] = $emiperlac;\n\t\t\t$details['tenure'] = $getterm;\n\t\t\t$details['loan_amount'] = round($getloanamout);\n\t\t\t$details['processing_fee'] = $proc_Fee;\n\t\t\t$details['category'] = $category;\n\t\t\treturn($details);\n\t}",
"function pricing() {\n\t\t\tparent::controller();\n\t\t\t\n\t\t}",
"public function checkCreditLimit() {\n \n Mage::getModel('storesms/apiClient')->checkCreditLimit(); \n \n }",
"public function setRate($rate) {\n $this->rate = $rate;\n }",
"function uspsRate($weight, $dest_zip, $origin_zip) { \n $userName = '628NORTH2278'; // Your USPS Username\n $url = \"http://Production.ShippingAPIs.com/ShippingAPI.dll\";\n $ch = curl_init();\n\n // set the target url\n curl_setopt($ch, CURLOPT_URL, $url);\n curl_setopt($ch, CURLOPT_HEADER, 1);\n curl_setopt($ch,CURLOPT_RETURNTRANSFER, 1);\n\n // parameters to post\n curl_setopt($ch, CURLOPT_POST, 1);\n\n $data = \"API=RateV4&XML=<RateV4Request USERID=\\\"$userName\\\"><Package ID=\\\"1ST\\\"><Service>PRIORITY</Service><ZipOrigination>\";\n\t$data .= $origin_zip;\n\t$data .= \"</ZipOrigination><ZipDestination>\";\n\t$data .= $dest_zip;\n\t$data .= \"</ZipDestination><Pounds>\";\n\t$data .= $weight;\n \t$data .= \"</Pounds><Ounces>0</Ounces><Container>VARIABLE</Container><Size>REGULAR</Size><Machinable>TRUE</Machinable></Package></RateV4Request>\";\n\n // send the POST values to USPS\n curl_setopt($ch, CURLOPT_POSTFIELDS, $data);\n\n $result=curl_exec ($ch);\n $data = strstr($result, '<?');\n\n // echo '<!-- '. $data. ' -->'; // TESTING USE ONLY\n\n $xml_parser = xml_parser_create();\n xml_parse_into_struct($xml_parser, $data, $vals, $index);\n xml_parser_free($xml_parser);\n $params = array();\n $level = array();\n foreach ($vals as $xml_elem) {\n if ($xml_elem['type'] == 'open') {\n if (array_key_exists('attributes',$xml_elem)) {\n list($level[$xml_elem['level']],$extra) = array_values($xml_elem['attributes']);\n } else {\n $level[$xml_elem['level']] = $xml_elem['tag'];\n }\n }\n if ($xml_elem['type'] == 'complete') {\n $start_level = 1;\n $php_stmt = '$params';\n while($start_level < $xml_elem['level']) {\n $php_stmt .= '[$level['.$start_level.']]';\n $start_level++;\n }\n $php_stmt .= '[$xml_elem[\\'tag\\']] = $xml_elem[\\'value\\'];';\n eval($php_stmt);\n }\n }\n curl_close($ch);\n // echo '<pre>'; print_r($params); echo'</pre>'; // Uncomment to see xml tags\n return $params['RATEV4RESPONSE']['1ST']['1']['RATE'];\n}",
"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 }",
"function __lineItemTotal($qty, $price, $rate) {\n\n\n\n\n\n\n\n// if ($curency_id == 2)\n// $currency = 1;\n//\n// if ($curency_id == 1)\n// $currency = 4.17;\n//\n// if ($curency_id == 3)\n// $currency = 4.50;\n\n\n\n $line_total = $qty * $price * $rate;\n\n //$line_total = $line_total + (($line_total * $taxRate) / 100);\n\n\n\n return $line_total;\n }",
"function get_cost($from, $to,$weight)\r\n{\r\n require_once 'REST_Ongkir.php';\r\n \r\n $rest = new REST_Ongkir(array(\r\n 'server' =&gt; 'http://api.ongkir.info/'\r\n ));\r\n \r\n//ganti API-Key dibawah ini sesuai dengan API Key yang anda peroleh setalah mendaftar di ongkir.info\r\n $result = $rest-&gt;post('cost/find', array(\r\n 'from' =&gt; $from,\r\n 'to' =&gt; $to,\r\n 'weight' =&gt; $weight.'000',\r\n 'courier' =&gt; 'jne',\r\n'API-Key' =&gt;'ABCDEFGHIJKLMNOPQRSTUVWXYZ123456'\r\n ));\r\n \r\n try\r\n {\r\n $status = $result['status'];\r\n \r\n // Handling the data\r\n if ($status-&gt;code == 0)\r\n {\r\n $prices = $result['price'];\r\n $city = $result['city'];\r\n \r\n echo 'Ongkos kirim dari ' . $city-&gt;origin . ' ke ' . $city-&gt;destination . '&lt;br /&gt;&lt;br /&gt;';\r\n \r\n foreach ($prices-&gt;item as $item)\r\n {\r\n echo 'Layanan: ' . $item-&gt;service . ', dengan harga : Rp. ' . $item-&gt;value . ',- &lt;br /&gt;';\r\n }\r\n }\r\n else\r\n {\r\n echo 'Tidak ditemukan jalur pengiriman dari surabaya ke jakarta';\r\n }\r\n \r\n }\r\n catch (Exception $e)\r\n {\r\n echo 'Processing error.';\r\n }\r\n}",
"function recharge_from_wallet_with_card(){\n\t\t\t$coupon_id=$_REQUEST['coupon_id'];\n\t\t\t$coupon_amount=$_REQUEST['coupon_amount'];\n\t\t\t$recharge_user_id = $_REQUEST['recharge_user_id'];\n\t\t\t$card_no=$_REQUEST['card_number'];\n\t\t\t$cvv_no=$_REQUEST['cvv_no'];\n\t\t\t$transaction_id= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t\t//$recharge_transaction_id=$_POST['recharge_transaction_id'];\n\t\t\t$recharge_category_id = $_REQUEST['recharge_category_id']; //1- Mobile,2-DTH\n\t\t\t$operator_id = $_REQUEST['operator_id'];\n\t\t\t$rec_number=$_REQUEST['recharge_number'];\n\t\t\t$recharge_number = country_code.$_REQUEST['recharge_number'];\n\t\t\t$recharge_amount = $_REQUEST['recharge_amount'];\n\t\t\t$wallet_type = 2; // 1- Credit, 2-Debit\n\t\t\t$recharge_status = 1;\n\t\t\t$wt_category='2';// 1-Add money,2-Recharge\n\t\t\t$wallet_category='4'; // 4- Cashback\n\t\t\t$current_date=date(\"Y-m-d h:i:sa\");\n\t\t\t\tif(!empty($recharge_user_id) && !empty($operator_id)&& !empty($recharge_number)&& !empty($recharge_amount))\n\t\t{\n\t\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $recharge_user_id);\n\t\t\t\t$wallet_amount = $records['0']['wallet_amount'];\n\t\t\t\t$wallet_used_amount = $records['0']['wallet_amount'];\n\t\t\t\t$reffer_status = $records['0']['reffer_amount_status'];\n\t\t\t\t$reffer_user_id = $records['0']['reffer_user_id'];\n\t\t\t\t$card_deduct_amount=$recharge_amount-$wallet_amount;\n\t\t\t\t\n\t\t\t\t$admin=$this->conn->get_all_records('admin');\n\t\t\t\t$admin_wallet = $admin['0']['admin_wallet'];\n\t\t\n\t\t\t$recharge = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,user_wallet_rec_amount,user_card_card_rec_amount', '\"' . $recharge_user_id . '\",\"' . $current_date . '\",\"' . $wallet_type . '\",\"' . $recharge_amount . '\",\"' . $wt_category . '\",\"' .$transaction_id . '\",\"' . $wt_desc . '\",\"' .$wallet_amount . '\",\"' . $card_deduct_amount . '\"');\n\t\t\t\t\t\t\n\t\t\t\tif($recharge){\n\t\t\t\t\t$walletrecharge = $this -> conn -> insertnewrecords('recharge','recharge_transaction_id,recharge_user_id, rechage_category,operator_id,rechage_type,recharge_number,recharge_amount,recharge_date,recharge_status','\"'.$transaction_id . '\",\"' . $recharge_user_id . '\",\"' . $recharge_category_id . '\",\"' . $operator_id . '\",\"' . $recharge_type_id . '\",\"' . $recharge_number . '\",\"' . $recharge_amount . '\",\"' . $current_date . '\",\"' . $recharge_status . '\"');\n\t\t\t\t\t\n\t\t\t\t\t\t\t//reffer amount when user first recharge then beifits add in frnd wallet\n\t\t\t\t\tif($reffer_status=='2'){\n\t\t\t\t\t\t$frnd_records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $reffer_user_id);\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t$reffer_records = $this -> conn -> get_all_records('reffer_amount');\n\t\t\t\t\t\t\t$refferal_amount = $reffer_records[0]['reffer_amount'];\n\t\t\t\t\t\t\t\t\t\t$user11_id = $frnd_records['0']['user_id'];\n\t\t\t\t\t\t\t\t\t\t$reffer_code_database = $frnd_records['0']['user_refferal_code'];\n\t\t\t\t\t\t\t\t\t\t\t$wallet = $frnd_records['0']['wallet_amount'];\n\t\t\t\t\t\t\t\t\t\t\t$frnd_number = $frnd_records['0']['user_contact_no'];\n\t\t\t\t\t\t\t\t\t\t\t$current_date=date(\"Y-m-d h:i:sa\");\n\t\t\t\t\t\t\t\t\t\t\t$transaction_id= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t\t\t\t\t\t\t\t\t\t$wt_type=2; // credit in frnd acconnt\n\t\t\t\t\t\t\t\t\t\t\t$refferamount=$refferal_amount; // reffer amount\n\t\t\t\t\t\t\t\t\t\t\t$wt_category=9; // refferal amount recieved in wallet\n\t\t\t\t\t\t\t\t\t\t\t$wt_desc=\"Refferal amount add in your wallet using by \".substr($mobile,4);\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$add_reffer_money = $this -> conn -> insertnewrecords('refferal_records','refferal_user_id,refferal_frnd_id,refferal_amount,refferal_date', '\"' . $recharge_user_id . '\",\"' . $user11_id . '\",\"' . $refferamount . '\",\"' . $current_date . '\"');\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t$add_money = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user11_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $refferamount . '\",\"' . $wt_category . '\",\"' . $transaction_id . '\",\"' . $wt_desc . '\",\"' . $frnd_number . '\"');\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// modify wallet of frnd using reffer code///\n\t\t\t\t\t\t$data_frnd['wallet_amount']=$wallet+$refferal_amount;\n\t\t\t\t\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$user11_id, $data_frnd);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t// Cahnge user status when refeer amount add in frnd wallet\n\t\t\t\t\t\t\t\t\t\t\t$data12['reffer_amount_status']=1;\n\t\t\t\t\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$recharge_user_id, $data12);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$cashback_record_id=$recharge_number;\n\t\t\t\tif(!empty($coupon_id)){\n\t\t\t\t\t\n\t\t\t\t\t$coupon_apply = $this -> conn -> insertnewrecords('coupon_details','coupon_id, user_id,coupon_apply_date', '\"' . $coupon_id . '\",\"' . $recharge_user_id . '\",\"' . $current_date . '\"');\n\t\t\t\t\t\tif(!empty($coupon_apply)){\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t$walletrecharge = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $recharge_user_id . '\",\"' . $current_date . '\",\"' . $wallet_type . '\",\"' . $coupon_amount . '\",\"' . $wallet_category . '\",\"' .$transaction_id . '\",\"' . $w_desc . '\",\"' . $cashback_record_id . '\"');\n\t\t\t\t\t\n\t\t\t\t\t// wallet amont set zero \n\t\t\t\t\t$wallet_amount=0;\t\t\n\t\t\t\t\t$user_wallet=$wallet_amount+$coupon_amount;\n\t\t\t\t\t$data['wallet_amount']=$user_wallet;\n\t\t\t\t\t\n\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$recharge_user_id, $data);\n\t\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$wallet_amount=0;\t\t\n\t\t\t\t\t$user_wallet=$wallet_amount+$coupon_amount;\n\t\t\t\t\t$data['wallet_amount']=$user_wallet;\n\t\t\t\t\t\n\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user', 'user_id',$recharge_user_id, $data);\n\t\t\t\t}\n\t\t\t\t\t// Admin wallet update\n\t\t\t\t\t$admin_update_wallet=$admin_wallet+$recharge_amount;\n\t\t\t\t\t$data_admin['admin_wallet']=$admin_update_wallet;\n\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('admin', 'admin_id',1, $data_admin);\n\t\t\t\t\t$post = array(\"status\" => \"true\",'message'=>\"Recharge Successfully\", \"recharge_id\" => $recharge,'recharge_number'=>$rec_number,'recharge_amount'=>$recharge_amount,'wallet_used_amount'=>$wallet_used_amount,'card_used_amount'=>$card_deduct_amount,'wallet_amount'=>$wallet_amount,'recharge_date'=>$current_date,'transaction_id'=>$transaction_id);\n\t\t\t\t}else{\n\t\t\t\t\t\t$post = array('status' => \"false\",\"message\" => \"Recharge failed\");\n\t\t\t\t}\n\t\t\n\t\t\t\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$post = array('status' => \"false\",\"message\" => \"Missing parameter\",'recharge_user_id'=>$recharge_user_id,'recharge_category_id'=>$recharge_category_id,'operator_id'=>$operator_id,'recharge_type_id'=>$recharge_type_id,'recharge_number'=>$recharge_number,'recharge_amount'=>$recharge_amount);\n\t\t}\n\t\techo $this -> json($post);\n\t\t\t\n\t\t\t\n\t\t\t\n}",
"function cjpopups_get_exchange_rate($from = 'USD', $to = 'INR'){\n\t$exchange_rate_data = wp_remote_get('http://rate-exchange.appspot.com/currency?from='.$from.'&to='.$to);\n\tif(!is_wp_error( $exchange_rate_data )){\n\t\t$return = json_decode($exchange_rate_data['body']);\n\t\treturn $return->rate;\n\t}else{\n\t\treturn 62;\n\t}\n}",
"function add_money(){\n\t\t$coupon_id=$_REQUEST['coupon_id'];\n\t\t$coupon_amount=$_REQUEST['coupon_amount'];\n\t\t$user_id=$_REQUEST['recharge_user_id'];\n\t\t$user_amount=$_REQUEST['recharge_amount'];\n\t\t$final_amount=$coupon_amount+$user_amount;\n\t//\t$wt_type=$_POST['wt_type']; //1- debit in account, 2- credit in account\n\t\t$wt_type=1; // credit\n\t\t$current_date=date(\"Y-m-d h:i:sa\");\n\t\t$wt_category=1; // 1-Add moeny, 2-Recharge\n\t\t$w_category=6; // Amount Recieved when coupon code apply\n\t\t//$card_no=$_REQUEST['card_number'];\n\t\t//$cvv_no=$_REQUEST['cvv_no'];\n\t\t$w_desc=\"Amount Recieved when add money \".$user_amount .\" with get amount \".$coupon_amount;\n\t\t\t$transaction_id= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t//$transaction_id =$_POST['recharge_transaction_id']; // if wt_category=1 then payment gateway transaction id and 2 for recharge id;\n\t\t$wt_desc=\"Add Money\"; // description of transaction like as add moeny, recharge;\n\t\tif(!empty($user_id) && !empty($user_amount) && !empty($transaction_id)){\n\t\t\t$records = $this -> conn -> get_table_row_byidvalue('user', 'user_id', $user_id);\n\t\t\t$wallet_amount = $records['0']['wallet_amount'];\n\t\t\t$user_wallet=$wallet_amount + $final_amount;\n\t\t\t\t\t$add_money = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id, wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $user_amount . '\",\"' . $wt_category . '\",\"' . $transaction_id . '\",\"' . $wt_desc . '\"');\n\t\t\tif(!empty($add_money)){\n\t\t\t\tif(!empty($coupon_id)){\n\t\t\t\t\t\n\t\t\t\t\t$add_money = $this -> conn -> insertnewrecords('coupon_details','coupon_id, user_id,coupon_apply_date', '\"' . $coupon_id . '\",\"' . $user_id . '\",\"' . $current_date . '\"');\n\t\t\t\t\tif($add_money){\n\t\t\t\t\t\t$transaction_ids= strtotime(\"now\").mt_rand(10000000, 99999999);\n\t\t\t\t\t\t$walletrecharge = $this -> conn -> insertnewrecords('wallet_transaction','wt_user_id,wt_datetime,wt_type,wt_amount,wt_category,transaction_id,wt_desc,cashbackrecord_id', '\"' . $user_id . '\",\"' . $current_date . '\",\"' . $wt_type . '\",\"' . $coupon_amount . '\",\"' . $w_category . '\",\"' .$transaction_ids . '\",\"' . $w_desc . '\",\"' . $transaction_id . '\"');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\t $data['wallet_amount']=$user_wallet;\n\t\t\t\t\t$update_toekn=$this -> conn -> updatetablebyid('user','user_id',$user_id, $data);\n\t\t\t\t\t$post = array(\"status\" => \"true\",'message'=>\"Add amount successfully\", \"transaction_id\" =>$transaction_id,'add_amount'=>$user_amount,'wallet_amount'=>$user_wallet,'transaction_date'=>$current_date,'card_no'=>$card_no);\n\t\t\t\t\t\n\t\t\t}else{\n\t\t\t\t$post = array('status' => \"false\",\"message\" => \"Transaction Failed\");\n\t\t\t}\n\t\t}else{\n\t\t$post = array('status' => \"false\",\"message\" => \"Missing parameter\",'recharge_user_id'=>$user_id,'recharge_amount'=>$user_amount,'card_number'=>$card_no,'cvv_no'=>$cvv_no);\n\t\t}\n\t\techo $this -> json($post);\n\t}",
"function ratelimit(array $data);",
"function calculate_fee_form18_re($FORMATION_PROPRIETORY_DATE){\r\nglobal $conn2;\r\n$fee = array();\r\n\r\nif($FORMATION_PROPRIETORY_DATE != '' && $FORMATION_PROPRIETORY_DATE != '0000-00-00'){\r\n\r\n$current_date = date('Y-m-d');\r\n$FORMATION_PROPRIETORY_DATE = new DateTime($FORMATION_PROPRIETORY_DATE);\r\n$current_date = new DateTime($current_date);\r\n$days_from_current_date = $FORMATION_PROPRIETORY_DATE->diff($current_date)->format(\"%r%a\");\r\nif($days_from_current_date > 30 && $days_from_current_date <= 60){\r\n$fee['DELAY_FEE'] = 100;\r\n}elseif($days_from_current_date > 60 && $days_from_current_date <= 180){\r\n$fee['DELAY_FEE'] = 300;\r\n}elseif($days_from_current_date > 180){\r\n$fee['DELAY_FEE'] = 1000;\r\n}else{\r\n$fee['DELAY_FEE'] = 0;\r\n}\r\n\r\n}\r\n\r\n//$fee['S109'] = 1000;\r\n//$fee['S110'] = 1000;\r\n$fee['TOTAL_AMT'] = $fee['DELAY_FEE'];\r\n//print_r($fee);die;\r\nreturn $fee;\r\n\r\n}",
"function externalapis()\n\n {\n //get usd rate\n\n\n //koinok value\n $koinok = koinokapi();\n\n //idex\n $idex = idexapi();\n\n //mercatox\n $mercatox = mercatoxapi();\n\n //etherflyer\n $etherflyer = etherflyerapi();\n\n //bancor\n $bancor = bancorapi();\n// echo json_encode($koinok);\n\n $result = array('IDEX'=>$idex,'KOINOK'=>$koinok,'MERCATOX'=>$mercatox,'ETHERFLYER'=>$etherflyer,'BANCOR'=>$bancor);\n echo json_encode($result);\n\n }",
"public function getRefreshRate() { return 0; }",
"private function changesku(){\t \r\n\t $this->chartValue(); //adding to output\r\n\t $this->idleStHealthChk(); //adding to output\r\n\t}",
"function setBlowdownRate($blowdownRate){\n $this->blowdownRate = $blowdownRate;\n $this->feedwater->setMassFlow(\n $this->outletSteam->massFlow / (1 - $this->blowdownRate));\n $this->blowdown->setMassFlow(\n $this->feedwater->massFlow * $this->blowdownRate); \n $this->calculateEnergyUse();\n }",
"public function rateUser(Request $request)\n {\n\n //find ride request \n $rideRequest = $this->rideRequest->where('id', $request->ride_request_id)\n ->where('driver_id', $request->auth_driver->id)\n ->whereIn('ride_status', [Ride::TRIP_ENDED, Ride::COMPLETED])\n ->first();\n\n\n if(!$rideRequest || !$rideRequest->user) {\n return $this->api->json(false, 'INVALID_REQUEST', 'Invalid Request, Try again.');\n }\n\n //validate rating number\n if(!$request->has('rating') || !in_array($request->rating, Ride::RATINGS)) {\n return $this->api->json(false, 'INVALID_RATING', 'You must have give rating within '.implode(',', Ride::RATINGS));\n }\n\n\n /** driver cannot give rating until user payment complete */\n if($rideRequest->payment_status == Ride::NOT_PAID) {\n return $this->api->json(false, 'USER_NOT_PAID', 'Ask user to pay before give rating');\n }\n\n\n //updatig both driver and ride request table\n try {\n\n \\DB::beginTransaction();\n\n //saving ride request rating\n $rideRequest->user_rating = $request->rating;\n $rideRequest->save(); \n\n /** push user rating calculation to job */\n ProcessUserRating::dispatch($rideRequest->user_id);\n\n\n //making availble driver\n $driver = $rideRequest->driver;\n $driver->is_available = 1;\n $driver->save();\n\n\n\n \\DB::commit();\n\n } catch(\\Exception $e) {\n \\DB::rollback();\n \\Log::info('USER_RATING');\n \\Log::info($e->getMessage());\n return $this->api->unknownErrResponse();\n }\n \n\n /** send user that you made the payment message */\n $user = $rideRequest->user;\n $currencySymbol = $this->setting->get('currency_symbol');\n $websiteName = $this->setting->get('website_name');\n $invoice = $rideRequest->invoice;\n if($rideRequest->payment_mode == Ride::CASH) {\n $user->sendSms(\"Thank you!! We hope you enjoyed {$websiteName} service. See you next time.\");\n } \n // else {\n // $user->sendSms(\"We hope you enjoyed {$websiteName} service. Please make the payment of {$currencySymbol}\".$invoice->total);\n // }\n\n\n return $this->api->json(true, 'RATED', 'User rated successfully.');\n\n }",
"function wyz_new_bus_rate_ajax() {\n\t$nonce = filter_input( INPUT_POST, 'nonce' );\n\n\tif ( ! wp_verify_nonce( $nonce, 'wyz_ajax_custom_nonce' ) ) {\n\t\twp_die( 'busted' );\n\t}\n\n\t$_bus_id = intval( $_POST['bus-id'] );\n\t$_user_id = get_current_user_id();\n\t$_rate = intval( $_POST['rate'] );\n\t$_rate_cat = intval( $_POST['rate_cat'] );\n\t$_rate_txt = $_POST['rate_txt'];\n\n\tif ( ! $_bus_id || '' === $_bus_id || ! $_user_id || '' === $_user_id || ! $_rate || '' === $_rate ||\n\t\t$_rate < 0 || $_rate > 5 || ( $_rate < 3 && '' == $_rate_txt ) ) {\n\t\twp_die( false );\n\t}\n\n\t$taxonomies = array();\n\t$taxonomy = 'wyz_business_rating_category';\n\t$tax_terms = get_terms( $taxonomy, array( 'hide_empty' => false ) );\n\t$length = count( $tax_terms );\n\n\tif ( !$length ){\n\t\twp_die( false );\n\t}\n\t\n\tfor ( $i = 0; $i < $length; $i++ ) {\n\t\tif ( ! isset( $tax_terms[ $i ] ) ) {\n\t\t\tcontinue;\n\t\t}\n\t\t$obj = $tax_terms[ $i ];\n\t\t$taxonomies[] = $obj->term_id;\n\t}\n\n\tif ( ! in_array( $_rate_cat, $taxonomies ) ) {\n\t\twp_die( false );\n\t}\n\n\t$is_current_user_author = WyzHelpers::wyz_is_current_user_author( $_bus_id );\n\t$all_business_ratings = get_post_meta( $_bus_id, 'wyz_business_ratings', true );\n\tif ( ! $all_business_ratings || '' == $all_business_ratings ) {\n\t\t$all_business_ratings = array();\n\t}\n\tif ( ! empty( $all_business_ratings ) ) {\n\t\t$args = array(\n\t\t\t'post_type' => 'wyz_business_rating',\n\t\t\t'author' => $_user_id,\n\t\t\t'post_status' => 'publish',\n\t\t\t'post__in' => $all_business_ratings,\n\t\t\t'posts_per_page' => 1,\n\t\t);\n\t\t$query = new WP_Query( $args );\n\t\t$user_can_rate = ! $query->have_posts();\n\t\twp_reset_postdata();\n\t} else {\n\t\t$user_can_rate = true;\n\t}\n\n\tif ( ! $user_can_rate || $is_current_user_author ) {\n\t\twp_die( false );\n\t}\n\n\t$post_data = array(\n\t\t'post_title' => wp_filter_nohtml_kses( get_the_title( $_bus_id ) . '-' . $_rate . 'stars-' . date( 'd_m_y-H:m:s' ) ),\n\t\t'post_type' => 'wyz_business_rating',\n\t\t'post_content' => $_rate_txt,\n\t\t'post_status' => 'publish',\n\t\t'comment_status' => 'closed',\n\t);\n\t$new_submission_id = wp_insert_post( $post_data, true );\n\n\t// If we hit a snag, update the user.\n\tif ( is_wp_error( $new_submission_id ) ) {\n\t\twp_die( false );\n\t}\n\n\tupdate_post_meta( $new_submission_id, 'wyz_business_rate', $_rate );\n\tupdate_post_meta( $new_submission_id, 'business_id', $_bus_id );\n\twp_set_object_terms( $new_submission_id, $_rate_cat, 'wyz_business_rating_category' );\n\n\t$all_business_ratings[] = $new_submission_id;\n\tupdate_post_meta( $_bus_id, 'wyz_business_ratings', $all_business_ratings );\n\n\n\t$_rate_count = intval( get_post_meta( $_bus_id, 'wyz_business_rates_count', true ) );\n\t$_rate_sum = intval( get_post_meta( $_bus_id, 'wyz_business_rates_sum', true ) );\n\n\tif ( ! $_rate_count ) {\n\t\t$_rate_count = 0;\n\t}\n\tif ( ! $_rate_sum ) {\n\t\t$_rate_sum = 0;\n\t}\n\n\t$_rate_count++;\n\t$_rate_sum += intval( $_rate );\n\n\tupdate_post_meta( $_bus_id, 'wyz_business_rates_count', $_rate_count );\n\tupdate_post_meta( $_bus_id, 'wyz_business_rates_sum', $_rate_sum );\n\n\twp_die( WyzBusinessRating::wyz_create_rating( $new_submission_id ) );\n}",
"public function update_ratting_data() {\n\t\tglobal $wpdb;\n\t\t$sso = new Top_Ratter_SSO ();\n\t\t// get the ratting data from sso class\n\t\t$journal_records=$sso->esi_api_gather_ratted_isk_amount();\n\t\t\n\t\tif ($journal_records == null) {\n\t\t echo'<p>Problem with API :(</p>';\n\t\t\treturn;\n\t\t}\n\t\tif($journal_records=='no_officer_token'){\n\t\t echo'<p>There is no officer token, inform officers. Pretty please?</p>';\n\t\t return;\n\t\t}\n\n\t\t$bounties_array = $this->filter_ratting_data ( $journal_records);\n\t\t$structures_array = $this->filter_ratting_data ( $journal_records,true);\n\t\t\n\t\t/*\n\t\t * Bounties akka ratting data to be inserted.\n\t\t */\n\t\tif($bounties_array){\n\t\t \n\t\t $this->insert_new_characters_in_database($bounties_array);\n\t\t \n\t\t $bounties_to_insert=null;\n\t\t \n\t\t $sql_max_ref_id=\"SELECT MAX(`ref_id`) AS ref_id FROM `\" . $wpdb->prefix . \"tr_ratting_data`\";\n\t\t $max_ref_id=$wpdb->get_row($sql_max_ref_id,ARRAY_A); \n\t\t \n\t\t if($max_ref_id['ref_id']!==NULL){\n\t\t foreach($bounties_array as $bounty_record){\n\t\t // select only those that is not in the db\n\t\t if($bounty_record['ref_id']>(float)$max_ref_id['ref_id']){\n\t\t //this is new record that is not in the db yet\n\t\t $bounties_to_insert[]=$bounty_record;\n\t\t } \n\t\t }\n\t\t }else{\n // insert all since nothing in db\n\t\t $bounties_to_insert=$bounties_array;\n\t\t }\n\t\t \n\t\t if($bounties_to_insert){\n\t\t $sql=\"INSERT INTO `\" . $wpdb->prefix . \"tr_ratting_data`(`owner_id`, `date_acquired`, `amount`, `system_id`, `npc_kills`, `ref_id`) VALUES\";\n\t\t $count=count($bounties_to_insert);\n\t\t $i=1;\n\t\t foreach($bounties_to_insert as $record){\n\t\t $system_id=0;\n\t\t if($record['extra_info']['system_id']){\n\t\t $system_id=$record['extra_info']['system_id'];\n\t\t }\n\t\t $sql.='(\"'.$record['second_party_id'].'\",\"'.$record['date'].'\",\"'.$record['tax'].'\",\"'.$system_id.'\",\"'.$record['npc_kills'].'\",\"'.$record['ref_id'].'\")';\n\t\t \n\t\t if($i==$count){\n\t\t $sql.='';\n\t\t }else{\n\t\t $sql.=',';\n\t\t }\n\t\t $i++;\n\t\t }\n\t\t $sql.=';';\n\t\t $wpdb->query($sql);\n\t\t } \n\t\t}\n\t\t\n\t\t/*\n\t\t * Structures data insert starts here\n\t\t */\n\t\tif($structures_array){\n\t\t $sql=\"INSERT INTO `\" . $wpdb->prefix . \"tr_structures_income`(`ref_id`, `date_acquired`, `amount`, `ref_type`) VALUES\";\n\t\t $count=count($structures_array);\n\t\t $i=1;\n\t\t foreach($structures_array as $record){\n\t\t \n\t\t $sql.='(\"'.$record['ref_id'].'\",\"'.$record['date'].'\",\"'.$record['amount'].'\",\"'.$record['ref_type'].'\")';\n\t\t \n\t\t if($i==$count){\n\t\t $sql.='';\n\t\t }else{\n\t\t $sql.=',';\n\t\t }\n\t\t $i++;\n\t\t }\n\t\t $sql.=';';\n\t\t $wpdb->query($sql); \n\t\t}\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t}",
"function user_subscription_plans()\n {\n global $ilance, $phrase, $ilconfig;\n \n $notice = $failedrenewalusernames = $noautopayrenewalusernames = $paidrenewalusernames = $freerenewalusernames = '';\n $failedrenewalcount = $noautopayrenewalcount = $paidrenewalcount = $freerenewalcount = 0;\n $slng = isset($_SESSION['ilancedata']['user']['slng']) ? $_SESSION['ilancedata']['user']['slng'] : 'eng'; \n \n\t\t// find all plans that have expired- don't include recurring subscriptions..\n $subscriptioncheck = $ilance->db->query(\"\n SELECT u.*, s.id, s.subscriptionid, s.user_id, s.paymethod, s.startdate, s.renewdate, s.autopayment as subscription_autopayment, s.active, s.cancelled, s.migrateto, s.migratelogic, s.recurring, s.invoiceid, s.roleid, s.autorenewal\n FROM \" . DB_PREFIX . \"subscription_user AS s,\n \" . DB_PREFIX . \"users AS u\n WHERE u.user_id = s.user_id\n AND s.renewdate <= '\" . DATETODAY . \" \" . TIMENOW . \"'\n AND s.cancelled = '0'\n AND s.recurring = '0'\n AND u.status = 'active'\n GROUP BY u.user_id\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($subscriptioncheck) > 0)\n {\n \t\n\t\t\t\n while ($res_subscription_check = $ilance->db->fetch_array($subscriptioncheck, DB_ASSOC))\n {\n // #### AUTO SUBSCRIPTION MIGRATION ############\n // did admin specify this subscription plan will migrate the user to another?\n if ($res_subscription_check['migrateto'] > 0)\n {\n $sql_subscription_plan = $ilance->db->query(\"\n SELECT subscriptionid, title_\" . $slng . \" AS title, description_\" . $slng . \" AS description, cost, length, units, subscriptiongroupid, roleid, active, canremove, visible_registration, visible_upgrade, icon, migrateto, migratelogic\n FROM \" . DB_PREFIX . \"subscription\n WHERE subscriptionid = '\" . $res_subscription_check['migrateto'] . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql_subscription_plan) > 0)\n {\n $subscription_plan_result = $ilance->db->fetch_array($sql_subscription_plan, DB_ASSOC);\n $sql_user = $ilance->db->query(\"\n SELECT user_id, email, username\n FROM \" . DB_PREFIX . \"users\n WHERE user_id = '\" . $res_subscription_check['user_id'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql_user) > 0)\n {\n $res_user = $ilance->db->fetch_array($sql_user, DB_ASSOC);\n switch ($res_subscription_check['migratelogic'])\n {\n\t\t\t\t\t\t\t\t// no transaction will be created\n case 'none':\n {\n $subscription_length = $this->subscription_length($subscription_plan_result['units'], $subscription_plan_result['length']);\n $subscription_renew_date = print_subscription_renewal_datetime($subscription_length);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"subscription_user\n SET active = 'yes',\n renewdate = '\" . $subscription_renew_date . \"',\n startdate = '\" . DATETIME24H . \"',\n subscriptionid = '\" . $subscription_plan_result['subscriptionid'] . \"',\n migrateto = '\" . $subscription_plan_result['migrateto'] . \"',\n migratelogic = '\" . $subscription_plan_result['migratelogic'] . \"',\n invoiceid = '0'\n WHERE user_id = '\" . $res_user['user_id'] . \"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $freerenewalusernames .= $res_user['username'] . ', ';\n $freerenewalcount++;\n break;\n } \n // insert waived transaction & activate new subscription plan\n\t\t\t\t\t\t\t\tcase 'waived':\n {\n $renewed_invoice_id = $ilance->accounting->insert_transaction(\n intval($res_subscription_check['subscriptionid']),\n 0,\n 0,\n intval($res_user['user_id']),\n 0,\n 0,\n 0,\n '{_subscription_payment_for} ' . $subscription_plan_result['title'] . ' (' . $subscription_plan_result['length'] . print_unit($subscription_plan_result['units']) . ')',\n '0.00',\n '0.00',\n 'paid',\n 'subscription',\n $res_subscription_check['paymethod'],\n DATETIME24H,\n DATEINVOICEDUE,\n DATETIME24H,\n '{_subscription_plan_migrated_to} ' . $subscription_plan_result['title'],\n 0,\n 0,\n 1\n );\n $subscription_length = $this->subscription_length($subscription_plan_result['units'], $subscription_plan_result['length']);\n $subscription_renew_date = print_subscription_renewal_datetime($subscription_length);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"subscription_user\n SET active = 'yes',\n renewdate = '\" . $subscription_renew_date . \"',\n startdate = '\" . DATETIME24H . \"',\n subscriptionid = '\" . $subscription_plan_result['subscriptionid'] . \"',\n migrateto = '\" . $subscription_plan_result['migrateto'] . \"',\n migratelogic = '\" . $subscription_plan_result['migratelogic'] . \"',\n invoiceid = '\" . $renewed_invoice_id.\"'\n WHERE user_id = '\" . $res_user['user_id'].\"'\n LIMIT 1\n \", 0, null, __FILE__, __LINE__);\n $freerenewalusernames .= $res_user['username'] . ', ';\n $freerenewalcount++;\n break;\n } \n // insert unpaid transaction & deactivate new subscription plan\n\t\t\t\t\t\t\t\tcase 'unpaid':\n {\n\t\t\t\t\t\t\t\t\tif ($res_subscription_check['active'] == 'yes')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t// customer may log-in and make payment via online account\n\t\t\t\t\t\t\t\t\t\t$renewed_invoice_id = $ilance->accounting->insert_transaction(\n\t\t\t\t\t\t\t\t\t\t\t$res_subscription_check['subscriptionid'],\n\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t$res_user['user_id'],\n\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t'{_subscription_payment_for} ' . $subscription_plan_result['title'] . ' (' . $subscription_plan_result['length'] . print_unit($subscription_plan_result['units']) . ')',\n\t\t\t\t\t\t\t\t\t\t\tsprintf(\"%01.2f\", $subscription_plan_result['cost']),\n\t\t\t\t\t\t\t\t\t\t\t'',\n\t\t\t\t\t\t\t\t\t\t\t'scheduled',\n\t\t\t\t\t\t\t\t\t\t\t'subscription',\n\t\t\t\t\t\t\t\t\t\t\t$res_subscription_check['paymethod'],\n\t\t\t\t\t\t\t\t\t\t\tDATETIME24H,\n\t\t\t\t\t\t\t\t\t\t\tDATEINVOICEDUE,\n\t\t\t\t\t\t\t\t\t\t\t'',\n\t\t\t\t\t\t\t\t\t\t\t'{_subscription_plan_migrated_to} ' . $subscription_plan_result['title'],\n\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t1\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t// update subscription table\n\t\t\t\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"subscription_user\n\t\t\t\t\t\t\t\t\t\t\tSET active = 'no',\n\t\t\t\t\t\t\t\t\t\t\tsubscriptionid = '\" . $subscription_plan_result['subscriptionid'] . \"',\n\t\t\t\t\t\t\t\t\t\t\tmigrateto = '\" . $subscription_plan_result['migrateto'] . \"',\n\t\t\t\t\t\t\t\t\t\t\tmigratelogic = '\" . $subscription_plan_result['migratelogic'] . \"',\n\t\t\t\t\t\t\t\t\t\t\tinvoiceid = '\" . $renewed_invoice_id . \"'\n\t\t\t\t\t\t\t\t\t\t\tWHERE user_id = '\" . $res_user['user_id'] . \"'\n\t\t\t\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\t// log subscription email for today so we do not resend\n\t\t\t\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\tINSERT INTO \" . DB_PREFIX . \"subscriptionlog\n\t\t\t\t\t\t\t\t\t\t\t(subscriptionlogid, user_id, date_sent)\n\t\t\t\t\t\t\t\t\t\t\tVALUES(\n\t\t\t\t\t\t\t\t\t\t\tNULL,\n\t\t\t\t\t\t\t\t\t\t\t'\" . $res_user['user_id'] . \"',\n\t\t\t\t\t\t\t\t\t\t\t'\" . DATETODAY . \"')\n\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\t// insert subscription invoice reminder so we don't resend again today\n\t\t\t\t\t\t\t\t\t\t$dateremind = $ilance->datetimes->fetch_date_fromnow($ilconfig['invoicesystem_daysafterfirstreminder']);\n\t\t\t\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\tINSERT INTO \" . DB_PREFIX . \"invoicelog\n\t\t\t\t\t\t\t\t\t\t\t(invoicelogid, user_id, invoiceid, invoicetype, date_sent, date_remind)\n\t\t\t\t\t\t\t\t\t\t\tVALUES(\n\t\t\t\t\t\t\t\t\t\t\tNULL,\n\t\t\t\t\t\t\t\t\t\t\t'\" . $res_subscription_check['user_id'] . \"',\n\t\t\t\t\t\t\t\t\t\t\t'\" . $renewed_invoice_id . \"',\n\t\t\t\t\t\t\t\t\t\t\t'subscription',\n\t\t\t\t\t\t\t\t\t\t\t'\" . DATETODAY . \"',\n\t\t\t\t\t\t\t\t\t\t\t'\" . $dateremind . \"')\n\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t}\n $failedrenewalusernames .= $res_user['username'] . ', ';\n $failedrenewalcount++;\n break;\n } \n // create paid transaction\n\t\t\t\t\t\t\t\tcase 'paid':\n {\n $renewed_invoice_id = $ilance->accounting->insert_transaction(\n intval($res_subscription_check['subscriptionid']),\n 0,\n 0,\n intval($res_user['user_id']),\n 0,\n 0,\n 0,\n '{_subscription_payment_for} ' . $subscription_plan_result['title'] . ' (' . $subscription_plan_result['length'] . print_unit($subscription_plan_result['units']) . ')',\n sprintf(\"%01.2f\", $subscription_plan_result['cost']),\n sprintf(\"%01.2f\", $subscription_plan_result['cost']),\n 'paid',\n 'subscription',\n $res_subscription_check['paymethod'],\n DATETIME24H,\n DATEINVOICEDUE,\n DATETIME24H,\n '{_subscription_plan_migrated_to} ' . $subscription_plan_result['title'],\n 0,\n 0,\n 1\n );\n $subscription_length = $this->subscription_length($subscription_plan_result['units'], $subscription_plan_result['length']);\n $subscription_renew_date = print_subscription_renewal_datetime($subscription_length);\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"subscription_user\n SET active = 'yes',\n renewdate = '\" . $subscription_renew_date . \"',\n startdate = '\" . DATETIME24H . \"',\n subscriptionid = '\" . $subscription_plan_result['subscriptionid'] . \"',\n migrateto = '\" . $subscription_plan_result['migrateto'] . \"',\n migratelogic = '\" . $subscription_plan_result['migratelogic'] . \"',\n invoiceid = '\" . $renewed_invoice_id . \"'\n WHERE user_id = '\" . $res_user['user_id'] . \"'\n \", 0, null, __FILE__, __LINE__);\n $paidrenewalusernames .= $res_user['username'] . ', ';\n $paidrenewalcount++;\n break;\n }\n }\n if ($res_subscription_check['migratelogic'] != 'none' AND $res_subscription_check['active'] == 'yes')\n {\n\t\t\t\t\t\t\t\t// obtain any unpaid subscription migration invoice\n\t\t\t\t\t\t\t\t$sql_new_invoice = $ilance->db->query(\"\n\t\t\t\t\t\t\t\t\tSELECT amount, invoiceid, description\n\t\t\t\t\t\t\t\t\tFROM \" . DB_PREFIX . \"invoices\n\t\t\t\t\t\t\t\t\tWHERE invoiceid = '\" . intval($renewed_invoice_id) . \"'\n\t\t\t\t\t\t\t\t\t\tAND (status = 'unpaid' OR status = 'scheduled')\n\t\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\tif ($ilance->db->num_rows($sql_new_invoice) > 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$res_new_invoice = $ilance->db->fetch_array($sql_new_invoice, DB_ASSOC);\n\t\t\t\t\t\t\t\t\tif ($res_subscription_check['subscription_autopayment'] == '1')\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t// subscription log > did we already sent an email to this customer?\n\t\t\t\t\t\t\t\t\t\t$senttoday = $ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\tSELECT subscriptionlogid\n\t\t\t\t\t\t\t\t\t\t\tFROM \" . DB_PREFIX . \"subscriptionlog\n\t\t\t\t\t\t\t\t\t\t\tWHERE user_id = '\" . $res_user['user_id'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t AND date_sent = '\" . DATETODAY . \"'\n\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\tif ($ilance->db->num_rows($senttoday) == 0)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t// log subscription email for today and send email to customer\n\t\t\t\t\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\t\tINSERT INTO \" . DB_PREFIX . \"subscriptionlog\n\t\t\t\t\t\t\t\t\t\t\t\t(subscriptionlogid, user_id, date_sent)\n\t\t\t\t\t\t\t\t\t\t\t\tVALUES(\n\t\t\t\t\t\t\t\t\t\t\t\tNULL,\n\t\t\t\t\t\t\t\t\t\t\t\t'\" . $res_user['user_id'] . \"',\n\t\t\t\t\t\t\t\t\t\t\t\t'\" . DATETODAY . \"')\n\t\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\t\t// subscription renewal via online account balance\n\t\t\t\t\t\t\t\t\t\t\t$sq1_account_balance = $ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\t\tSELECT available_balance, total_balance\n\t\t\t\t\t\t\t\t\t\t\t\tFROM \" . DB_PREFIX . \"users\n\t\t\t\t\t\t\t\t\t\t\t\tWHERE user_id = '\" . $res_user['user_id'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\t\tif ($ilance->db->num_rows($sq1_account_balance) > 0)\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t$get_account_array = $ilance->db->fetch_array($sq1_account_balance, DB_ASSOC);\n\t\t\t\t\t\t\t\t\t\t\t\tif ($get_account_array['available_balance'] >= $res_new_invoice['amount'])\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$now_total = $get_account_array['total_balance'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$now_avail = $get_account_array['available_balance'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$new_total = ($now_total - $res_new_invoice['amount']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$new_avail = ($now_avail - $res_new_invoice['amount']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t// re-adjust customers online account balance (minus subscription fee amount)\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"users\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSET available_balance = '\" . sprintf(\"%01.2f\", $new_avail) . \"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\ttotal_balance = '\" . sprintf(\"%01.2f\", $new_total) . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE user_id = '\" . $res_user['user_id'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\t\t\t\t// pay existing subscription invoice via online account\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"invoices\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSET status = 'paid',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaid = '\" . sprintf(\"%01.2f\", $res_new_invoice['amount']) . \"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaiddate = '\" . DATETIME24H . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE user_id = '\" . $res_user['user_id'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t AND invoiceid = '\" . $res_new_invoice['invoiceid'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\t\t\t\t// adjust members total amount received for referral payments from admin\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->accounting_payment->insert_income_reported($res_user['user_id'], sprintf(\"%01.2f\", $res_new_invoice['amount']), 'credit');\n\t\t\t\t\t\t\t\t\t\t\t\t\t// update customer subscription table with new subscription information\n\t\t\t\t\t\t\t\t\t\t\t\t\t$subscription_length = $this->subscription_length($subscription_plan_result['units'], $subscription_plan_result['length']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$subscription_renew_date = print_subscription_renewal_datetime($subscription_length);\n\t\t\t\t\t\t\t\t\t\t\t\t\t// update subscription table\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"subscription_user\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tSET active = 'yes',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\trenewdate = '\" . $subscription_renew_date . \"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartdate = '\" . DATETIME24H . \"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tsubscriptionid = '\" . $subscription_plan_result['subscriptionid'] . \"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmigrateto = '\" . $subscription_plan_result['migrateto'] . \"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tmigratelogic = '\" . $subscription_plan_result['migratelogic'] . \"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tinvoiceid = '\" . $res_new_invoice['invoiceid'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE user_id = '\" . $res_user['user_id'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->email->mail = $res_user['email'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->email->slng = fetch_user_slng($res_user['user_id']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->email->get('subscription_payment_renewed');\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->email->set(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'{{customer}}' => $res_user['username'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'{{amount}}' => $ilance->currency->format($res_new_invoice['amount']),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t'{{description}}' => $res_new_invoice['description'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->email->send();\n\t\t\t\t\t\t\t\t\t\t\t\t\t$paidrenewalusernames .= $res_user['username'] . ', ';\n\t\t\t\t\t\t\t\t\t\t\t\t\t$paidrenewalcount++; \n\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n }\n }\n }\n }\n // #### REGULAR SUBSCRIPTION RENEWAL [NO AUTO-MIGRATION] #######\n else\n {\n $sql_user = $ilance->db->query(\"\n SELECT first_name, last_name, username, email, user_id\n FROM \" . DB_PREFIX . \"users\n WHERE user_id = '\" . $res_subscription_check['user_id'] . \"'\n \", 0, null, __FILE__, __LINE__);\n if ($ilance->db->num_rows($sql_user) > 0)\n {\n $res_user = $ilance->db->fetch_array($sql_user, DB_ASSOC);\n $ilance->subscription_plan->deactivate_subscription_plan($res_subscription_check['user_id']);\n if ($res_subscription_check['autorenewal'] > 0)\n {\n\t\t\t\t\t\t\t// obtain customer subscription plan information\n\t\t\t\t\t\t\t$sql_subscription_plan = $ilance->db->query(\"\n\t\t\t\t\t\t\t\tSELECT cost, title_\" . $slng . \" AS title, length, units, migrateto, migratelogic, subscriptionid\n\t\t\t\t\t\t\t\tFROM \" . DB_PREFIX . \"subscription\n\t\t\t\t\t\t\t\tWHERE subscriptionid = '\" . $res_subscription_check['subscriptionid'] . \"'\n\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\tif ($ilance->db->num_rows($sql_subscription_plan) > 0)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$subscription_plan_result = $ilance->db->fetch_array($sql_subscription_plan, DB_ASSOC);\n\t\t\t\t\t\t\t\t// if the subscription plan's cost is free, auto-renew subscription for this user\n\t\t\t\t\t\t\t\tif ($subscription_plan_result['cost'] > 0)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$senttoday = $ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\tSELECT user_id\n\t\t\t\t\t\t\t\t\t\tFROM \" . DB_PREFIX . \"subscriptionlog\n\t\t\t\t\t\t\t\t\t\tWHERE user_id = '\" . $res_subscription_check['user_id'] . \"'\n\t\t\t\t\t\t\t\t\t\t AND date_sent = '\" . DATETODAY . \"'\n\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\tif ($ilance->db->num_rows($senttoday) == 0)\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t// log subscription email for today and send email to customer\n\t\t\t\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\tINSERT INTO \" . DB_PREFIX . \"subscriptionlog\n\t\t\t\t\t\t\t\t\t\t\t(subscriptionlogid, user_id, date_sent)\n\t\t\t\t\t\t\t\t\t\t\tVALUES(\n\t\t\t\t\t\t\t\t\t\t\tNULL,\n\t\t\t\t\t\t\t\t\t\t\t'\" . $res_subscription_check['user_id'] . \"',\n\t\t\t\t\t\t\t\t\t\t\t'\" . DATETODAY . \"')\n\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\t// do we already have a scheduled subscription invoice for this customer?\n\t\t\t\t\t\t\t\t\t\t$sqlpaidchk = $ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\tSELECT invoiceid\n\t\t\t\t\t\t\t\t\t\t\tFROM \" . DB_PREFIX . \"invoices\n\t\t\t\t\t\t\t\t\t\t\tWHERE user_id = '\" . $res_user['user_id'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\tAND subscriptionid = '\" . $res_subscription_check['subscriptionid'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\tAND (status = 'scheduled' OR status = 'unpaid')\n\t\t\t\t\t\t\t\t\t\t\t\tAND invoicetype = 'subscription'\n\t\t\t\t\t\t\t\t\t\t\t\tAND (paid = '0.00' OR paid = '' OR paid = '0')\n\t\t\t\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\tif ($ilance->db->num_rows($sqlpaidchk) > 0)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t// yes customer already has pending subscription transaction associated to this subscription id so use this instead\n\t\t\t\t\t\t\t\t\t\t\t$respaid = $ilance->db->fetch_array($sqlpaidchk, DB_ASSOC);\n\t\t\t\t\t\t\t\t\t\t\t$renewed_invoice_id = $respaid['invoiceid'];\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\t$renewed_invoice_id = $ilance->accounting->insert_transaction(\n\t\t\t\t\t\t\t\t\t\t\t\tintval($res_subscription_check['subscriptionid']),\n\t\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t\tintval($res_user['user_id']),\n\t\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t\t'{_subscription_payment_for}' . ' ' . $subscription_plan_result['title'] . ' (' . $subscription_plan_result['length'] . print_unit($subscription_plan_result['units']) . ')',\n\t\t\t\t\t\t\t\t\t\t\t\tsprintf(\"%01.2f\", $subscription_plan_result['cost']),\n\t\t\t\t\t\t\t\t\t\t\t\t'',\n\t\t\t\t\t\t\t\t\t\t\t\t'scheduled',\n\t\t\t\t\t\t\t\t\t\t\t\t'subscription',\n\t\t\t\t\t\t\t\t\t\t\t\t$res_subscription_check['paymethod'],\n\t\t\t\t\t\t\t\t\t\t\t\tDATETIME24H,\n\t\t\t\t\t\t\t\t\t\t\t\tDATEINVOICEDUE,\n\t\t\t\t\t\t\t\t\t\t\t\t'',\n\t\t\t\t\t\t\t\t\t\t\t\t'',\n\t\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t\t\t1\n\t\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t// insert subscription invoice reminder so we don't resend again today\n\t\t\t\t\t\t\t\t\t\t$dateremind = $ilance->datetimes->fetch_date_fromnow($ilconfig['invoicesystem_daysafterfirstreminder']);\n\t\t\t\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\tINSERT INTO \" . DB_PREFIX . \"invoicelog\n\t\t\t\t\t\t\t\t\t\t\t(invoicelogid, user_id, invoiceid, invoicetype, date_sent, date_remind)\n\t\t\t\t\t\t\t\t\t\t\tVALUES(\n\t\t\t\t\t\t\t\t\t\t\tNULL,\n\t\t\t\t\t\t\t\t\t\t\t'\" . $res_subscription_check['user_id'] . \"',\n\t\t\t\t\t\t\t\t\t\t\t'\" . intval($renewed_invoice_id) . \"',\n\t\t\t\t\t\t\t\t\t\t\t'subscription',\n\t\t\t\t\t\t\t\t\t\t\t'\" . DATETODAY . \"',\n\t\t\t\t\t\t\t\t\t\t\t'\" . $dateremind . \"')\n\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\t// obtain invoice information once again\n\t\t\t\t\t\t\t\t\t\t$sql_new_invoice = $ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\tSELECT totalamount, invoiceid, amount, description\n\t\t\t\t\t\t\t\t\t\t\tFROM \" . DB_PREFIX . \"invoices\n\t\t\t\t\t\t\t\t\t\t\tWHERE invoiceid = '\" . intval($renewed_invoice_id) . \"'\n\t\t\t\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\tif ($ilance->db->num_rows($sql_new_invoice) > 0)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$res_new_invoice = $ilance->db->fetch_array($sql_new_invoice, DB_ASSOC);\n\t\t\t\t\t\t\t\t\t\t\t// auto-payments checkup (user sets this option via subscription menu)\n\t\t\t\t\t\t\t\t\t\t\tif ($res_subscription_check['subscription_autopayment'] == '1')\n\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t// subscription renewal via online account balance\n\t\t\t\t\t\t\t\t\t\t\t\t$sq1_account_balance = $ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tSELECT available_balance, total_balance\n\t\t\t\t\t\t\t\t\t\t\t\t\tFROM \" . DB_PREFIX . \"users\n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE user_id = '\" . $res_user['user_id'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\t\t\tif ($ilance->db->num_rows($sq1_account_balance) > 0)\n\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t$get_account_array = $ilance->db->fetch_array($sq1_account_balance, DB_ASSOC);\n\t\t\t\t\t\t\t\t\t\t\t\t\t// #### ONLINE ACCOUNT BALANCE CHECK UP ####################################\n\t\t\t\t\t\t\t\t\t\t\t\t\tif ($get_account_array['available_balance'] >= $res_new_invoice['totalamount'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$now_total = $get_account_array['total_balance'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$now_avail = $get_account_array['available_balance'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$new_total = ($now_total - $res_new_invoice['totalamount']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$new_avail = ($now_avail - $res_new_invoice['totalamount']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// re-adjust customers online account balance (minus subscription fee amount)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"users\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSET available_balance = '\" . sprintf(\"%01.2f\", $new_avail) . \"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttotal_balance = '\" . sprintf(\"%01.2f\", $new_total) . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE user_id = '\" . $res_user['user_id'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// pay existing subscription invoice via online account\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"invoices\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSET status = 'paid',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaid = '\" . sprintf(\"%01.2f\", $res_new_invoice['totalamount']) . \"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tpaiddate = '\" . DATETIME24H . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE user_id = '\" . $res_user['user_id'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t AND invoiceid = '\" . $res_new_invoice['invoiceid'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// record spending habits for this user\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->accounting_payment->insert_income_spent($res_user['user_id'], sprintf(\"%01.2f\", $res_new_invoice['totalamount']), 'credit');\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t// update customer subscription table with new subscription information\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$subscription_length = $this->subscription_length($subscription_plan_result['units'], $subscription_plan_result['length']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$subscription_renew_date = print_subscription_renewal_datetime($subscription_length);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"subscription_user\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tSET active = 'yes',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trenewdate = '\" . $subscription_renew_date . \"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tstartdate = '\" . DATETIME24H . \"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmigrateto = '\" . $subscription_plan_result['migrateto'] . \"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tmigratelogic = '\" . $subscription_plan_result['migratelogic'] . \"',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tinvoiceid = '\" . $res_new_invoice['invoiceid'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE user_id = '\" . $res_user['user_id'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t AND subscriptionid = '\" . $subscription_plan_result['subscriptionid'] . \"'\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->email->mail = $res_user['email'];\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->email->slng = fetch_user_slng($res_user['user_id']);\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->email->get('subscription_payment_renewed');\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->email->set(array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'{{customer}}' => $res_user['username'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'{{amount}}' => $ilance->currency->format($res_new_invoice['amount']),\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'{{description}}' => $res_new_invoice['description'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t));\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$ilance->email->send();\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$paidrenewalusernames .= $res_user['username'] . ', ';\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$paidrenewalcount++; \n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t} \n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t// create waived transaction\n\t\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\t$renewed_invoice_id = $ilance->accounting->insert_transaction(\n\t\t\t\t\t\t\t\t\t\tintval($res_subscription_check['subscriptionid']),\n\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\tintval($res_user['user_id']),\n\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t'{_subscription_payment_for}' . ' ' . $subscription_plan_result['title'] . ' (' . $subscription_plan_result['length'] . print_unit($subscription_plan_result['units']) . ')',\n\t\t\t\t\t\t\t\t\t\t'0.00',\n\t\t\t\t\t\t\t\t\t\t'0.00',\n\t\t\t\t\t\t\t\t\t\t'paid',\n\t\t\t\t\t\t\t\t\t\t'subscription',\n\t\t\t\t\t\t\t\t\t\t'account',\n\t\t\t\t\t\t\t\t\t\tDATETIME24H,\n\t\t\t\t\t\t\t\t\t\tDATEINVOICEDUE,\n\t\t\t\t\t\t\t\t\t\tDATETIME24H,\n\t\t\t\t\t\t\t\t\t\t'{_subscription_plan_was_renewed}',\n\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t0,\n\t\t\t\t\t\t\t\t\t\t1\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t// update subscription table\n\t\t\t\t\t\t\t\t\t$subscription_length = $this->subscription_length($subscription_plan_result['units'], $subscription_plan_result['length']);\n\t\t\t\t\t\t\t\t\t$subscription_renew_date = print_subscription_renewal_datetime($subscription_length);\n\t\t\t\t\t\t\t\t\t$ilance->db->query(\"\n\t\t\t\t\t\t\t\t\t\tUPDATE \" . DB_PREFIX . \"subscription_user\n\t\t\t\t\t\t\t\t\t\tSET active = 'yes',\n\t\t\t\t\t\t\t\t\t\trenewdate = '\" . $subscription_renew_date . \"',\n\t\t\t\t\t\t\t\t\t\tstartdate = '\" . DATETIME24H . \"',\n\t\t\t\t\t\t\t\t\t\tsubscriptionid = '\" . $subscription_plan_result['subscriptionid'] . \"',\n\t\t\t\t\t\t\t\t\t\tmigrateto = '\" . $subscription_plan_result['migrateto'] . \"',\n\t\t\t\t\t\t\t\t\t\tmigratelogic = '\" . $subscription_plan_result['migratelogic'] . \"',\n\t\t\t\t\t\t\t\t\t\tinvoiceid = '\" . $renewed_invoice_id . \"'\n\t\t\t\t\t\t\t\t\t\tWHERE user_id = '\" . $res_user['user_id'] . \"'\n\t\t\t\t\t\t\t\t\t\tLIMIT 1\n\t\t\t\t\t\t\t\t\t\", 0, null, __FILE__, __LINE__);\n\t\t\t\t\t\t\t\t\t$freerenewalusernames .= $res_subscription_check['username'] . ', ';\n\t\t\t\t\t\t\t\t\t$freerenewalcount++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n \t\t} \n\t }\n }\n }\n if (!empty($paidrenewalusernames))\n {\n $paidrenewalusernames = mb_substr($paidrenewalusernames, 0, -2);\n }\n else\n {\n $paidrenewalusernames = 'None';\n }\n $notice .= \"Renewed $paidrenewalcount paid subscription plans for the following users: $paidrenewalusernames. \";\n if (!empty($freerenewalusernames))\n {\n $freerenewalusernames = mb_substr($freerenewalusernames, 0, -2);\n }\n else\n {\n $freerenewalusernames = 'None';\n }\n $notice .= \"Renewed $freerenewalcount free subscription plans for the following users: $freerenewalusernames. \";\n }\n else\n {\n $notice .= \"No user subscription plans to expire at this time.\"; \n }\n return $notice;\n }",
"function addAlterRate($design_no, $particulars,$particular_rate)\n\t\n\t{\n\t\t/*$stock_id\t\t\t =\tmysql_real_escape_string(trim($stock_id));*/\n\t\t$design_no\t \t\t =\ttrim($design_no);\n\t\t$particulars\t\t\t \t\t= mysql_real_escape_string(trim($particulars));\n\t\t$particular_rate\t\t\t =\tmysql_real_escape_string(trim($particular_rate));\n\t\t\n\t\t//satement to insert in stock table\n\t\t$insert\t\t= \"INSERT INTO alter_rate\n\t\t\t\t\t\t(design_no, particulars, particular_rate, added_on)\n\t\t\t\t\t\t\t\n\t\t\t\t\t\tVALUES\n\t\t\t\t\t\t('$design_no', '$particulars', '$particular_rate', \n\t\t\t\t\t\t\tnow())\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\";\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t//execute quary\n\t\t$query\t\t= mysql_query($insert);\n\t\t//echo $insert.mysql_error();exit;\n\t\t//get the product id\n\t\t$arate_id\t= mysql_insert_id();\n\t\t\n\t\t//return primary key\n\t\treturn $arate_id;\n\n\t}",
"public function serch()\n {\n }",
"public function cost(){\n\t\t\n\t\treturn 200;\n\t}",
"function getExchangeRate($currency);"
] | [
"0.6772126",
"0.6473427",
"0.6347878",
"0.61643046",
"0.6027342",
"0.6019018",
"0.5917252",
"0.59120256",
"0.5902944",
"0.58463955",
"0.58428925",
"0.5840674",
"0.58186555",
"0.5809963",
"0.58029455",
"0.5792277",
"0.57912636",
"0.5774024",
"0.57708704",
"0.57642686",
"0.57602197",
"0.5757032",
"0.5745087",
"0.574287",
"0.5738011",
"0.5725172",
"0.57194823",
"0.57192737",
"0.5709942",
"0.5708793",
"0.57012814",
"0.5691493",
"0.5647748",
"0.5645903",
"0.56458557",
"0.5629235",
"0.56241226",
"0.5620791",
"0.56041455",
"0.55984145",
"0.5582347",
"0.5575939",
"0.55736995",
"0.5564351",
"0.5553065",
"0.5546312",
"0.5540165",
"0.5526487",
"0.5522949",
"0.5517547",
"0.54981816",
"0.5497734",
"0.5486483",
"0.54860747",
"0.5478998",
"0.547596",
"0.546848",
"0.54674184",
"0.5464372",
"0.54623926",
"0.54582113",
"0.54520833",
"0.54489434",
"0.5446644",
"0.54402345",
"0.54271114",
"0.54173803",
"0.54156023",
"0.5401068",
"0.5400174",
"0.5398417",
"0.53931576",
"0.5389043",
"0.53881276",
"0.53807795",
"0.5372375",
"0.53722936",
"0.53721195",
"0.53663385",
"0.5361203",
"0.5357146",
"0.5357085",
"0.53559065",
"0.5354349",
"0.5350894",
"0.5348214",
"0.5345112",
"0.5343012",
"0.53362894",
"0.53325844",
"0.5331384",
"0.5329185",
"0.5327221",
"0.53223264",
"0.5320862",
"0.5320457",
"0.5319532",
"0.53156155",
"0.5314973",
"0.53132224",
"0.53123724"
] | 0.0 | -1 |
THIS FUNCTION IS SET UP TO ACCESS BEER ADVOCATE | function getMenu($str){
$str = str_replace(' align="left"', '', $str);
$str = str_replace(' valign="top"', '', $str);
$value = preg_match_all('/<td class=\"hr_bottom_light\">(.*?)<\/td>/s',$str, $menuItems);
$menuItem = [];
$maxCount = 5;
$currentCount = 0;
$listItems = [];
$group = 0;
foreach($menuItems[0] as $key => $value){
$data[$key] = $value;
}
foreach($data as $key => $value) {
switch ($currentCount) {
case 0:
$menuItem[$group]['name'] = $value;
break;
case 1:
$menuItem[$group]['type'] = $value;
break;
case 2:
$menuItem[$group]['abv'] = $value;
break;
case 3:
$menuItem[$group]['rating'] = $value;
break;
case 4:
$menuItem[$group]['hads'] = $value;
break;
case 5:
$menuItem[$group]['bros'] = $value;
break;
}
if($currentCount == $maxCount){
$currentCount = 0;
$group++;
}
else {
$currentCount++;
}
}
// echo '<pre>';
// print_r($menuItem);
// echo '</pre>';
return $menuItem;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function access();",
"public function obtener()\n {\n }",
"public abstract function Ataca();",
"public function helper()\n\t{\n\t\n\t}",
"public function pasaje_abonado();",
"protected function serviceAccessGates()\n {\n //\n }",
"public function attaquerAdversaire() {\n\n }",
"public function + aire()\n {\n // section -64--88--103-1-2c9bd139:16deeff2ef5:-8000:00000000000009A4 begin\n // section -64--88--103-1-2c9bd139:16deeff2ef5:-8000:00000000000009A4 end\n }",
"function factures_autoriser(){}",
"function rang_autoriser(){}",
"function vimport_abonnes_autoriser() {\n}",
"public function boleta()\n\t{\n\t\t//\n\t}",
"public function truycapvao_private_cha(){\n }",
"function hal_autoriser() {\n}",
"public function extra();",
"function livraison_autoriser() {}",
"public function serch()\n {\n }",
"private function __() {\n }",
"public function elso()\n {\n }",
"function mots_autoriser() {\n}",
"function cl_autoriser(){}",
"private function public_hooks()\n\t{\n\t}",
"protected function init() {return;}",
"function cilien_autoriser(){}",
"public function getAceite();",
"function beManaged()\n {\n }",
"public function get_data()\n\t\t{\t\t// Should there be a common method for this?\n\t\t}",
"private function _i() {\n }",
"function medias_autoriser(){}",
"protected function collectInformation() {}",
"public function extra_voor_verp()\n\t{\n\t}",
"public function otherObject(){\n\t\t//Ex : tableau\n\t\t\n\t}",
"function grappes_autoriser() {\n}",
"public function alimentar()\n {\n }",
"public function __init(){}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"public function Emprunter()\n {\n // section -64--88-56-1-313d700b:16f04d7fd4a:-8000:00000000000009BA begin\n // section -64--88-56-1-313d700b:16f04d7fd4a:-8000:00000000000009BA end\n }",
"abstract protected function external();",
"abstract public function getClientInformation();",
"public function aaa() {\n\t}",
"function plugonet_autoriser() {}",
"private function __construct()\t{}",
"function cl_sau_agendaexames() {\n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"sau_agendaexames\");\n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }",
"public function ogs()\r\n {\r\n }",
"protected function get_authority()\n {\n }",
"protected function get_authority()\n {\n }",
"protected function _init()\r\n\t{\r\n\t}",
"public function abono();",
"public function hapus_toko(){\n\t}",
"private function __construct() {\r\n\t\t\r\n\t}",
"public function get_data()\n {\n }",
"public function get_data()\n {\n }",
"public function get_data()\n {\n }",
"public function get_data()\n {\n }",
"abstract public function getPasiekimai();",
"private function metodo_privado() {\n }",
"private function __construct() {\r\n\t\r\n\t}",
"public function andar()\n {\n }",
"private function __construct()\r\n {\r\n }",
"private function __construct()\r\n {\r\n }",
"abstract protected function doGetAdapter();",
"public function get_data()\n {\n\n\n }",
"public function nadar()\n {\n }",
"protected function _request() {}",
"public function getAlternate() {}",
"public function getA() {}",
"protected function __init__() { }",
"private function __construct() { \n\t\t\n\n\t}",
"protected function init()\n\t{\n\t\t\n\t}",
"public function leer(){\n }",
"public function masodik()\n {\n }",
"public function acessarRelatorios(){\n\n }",
"function cl_sau_agendaexames() { \n //classes dos rotulos dos campos\n $this->rotulo = new rotulo(\"sau_agendaexames\"); \n $this->pagina_retorno = basename($GLOBALS[\"HTTP_SERVER_VARS\"][\"PHP_SELF\"]);\n }",
"function notation_autoriser(){}",
"public function init() {\t\t\n\n }",
"public function linkPass()\n {\n }",
"public function __construct()\n\t\t{\t\t\t\n\t\t}",
"abstract protected function attributes();",
"public function acp();",
"function getFrom();",
"public static function via();",
"protected function __construct(){}",
"protected function __construct(){}",
"protected function __construct(){}",
"protected function _response() {}",
"private function __construct(){\n\t\t }",
"abstract protected function getDirectGetters();",
"public function aObjeto() {\t}",
"final private function __construct(){\r\r\n\t}",
"public function library()\n\t{\n\t\n\t}"
] | [
"0.5906017",
"0.5905525",
"0.5864181",
"0.58463454",
"0.57384217",
"0.56790704",
"0.56567615",
"0.56065696",
"0.55538094",
"0.55462426",
"0.5543906",
"0.5522392",
"0.5493123",
"0.5484569",
"0.5477034",
"0.54596615",
"0.54414576",
"0.5418984",
"0.5418915",
"0.5417625",
"0.5409676",
"0.5398534",
"0.53737986",
"0.53698134",
"0.53543115",
"0.5351866",
"0.5338699",
"0.53174216",
"0.5311149",
"0.530384",
"0.52978575",
"0.5294026",
"0.52733016",
"0.5266312",
"0.52541304",
"0.5252187",
"0.5252187",
"0.5252187",
"0.5252187",
"0.5251961",
"0.5251961",
"0.5251961",
"0.5251961",
"0.5251961",
"0.5251961",
"0.52515596",
"0.52515596",
"0.52424425",
"0.5242013",
"0.5240184",
"0.5231549",
"0.52249336",
"0.52145517",
"0.52115965",
"0.5210126",
"0.520339",
"0.5203063",
"0.51953655",
"0.51951873",
"0.5189046",
"0.5188929",
"0.518445",
"0.51840717",
"0.51840717",
"0.51840717",
"0.5177911",
"0.51755583",
"0.51585877",
"0.5156427",
"0.51563257",
"0.51563257",
"0.51562864",
"0.5155358",
"0.51548845",
"0.5149007",
"0.51487666",
"0.51450557",
"0.5140291",
"0.5137829",
"0.5131267",
"0.513052",
"0.5130347",
"0.5129838",
"0.51276815",
"0.51253086",
"0.5120585",
"0.51173997",
"0.510734",
"0.51064515",
"0.51028883",
"0.5095847",
"0.5094834",
"0.5093826",
"0.5093826",
"0.5093826",
"0.508855",
"0.5088474",
"0.50872463",
"0.5082487",
"0.5081888",
"0.50804514"
] | 0.0 | -1 |
Instantiate a new new controller instance. | public function __construct()
{
// authenticate on all routes
$this->middleware('jwt.auth')
->except('home');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"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->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 $this->createClass('controller');\n }",
"public static function newController($controller)\n\t{\n\t\t$objController = \"App\\\\Controllers\\\\\".$controller;\n\t\treturn new $objController;\n\t}",
"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 }",
"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 loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}",
"private function instanceController( string $controller_class ): Controller {\n\t\treturn new $controller_class( $this->request, $this->site );\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}",
"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 $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 }",
"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}",
"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 __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\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($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}",
"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 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 }",
"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}",
"protected function createDefaultController() {\n Octopus::requireOnce($this->app->getOption('OCTOPUS_DIR') . 'controllers/Default.php');\n return new DefaultController();\n }",
"protected function instantiateController($class)\n {\n return new $class($this->routesMaker);\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 }",
"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 }",
"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 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 __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 }",
"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 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}",
"public function createController( ezcMvcRequest $request );",
"public function __construct()\n {\n $this->controller = new DHTController();\n }",
"public function __construct()\n {\n // and $url[1] is a controller method\n if ($_GET['url'] == NULL) {\n $url = explode('/', env('defaultRoute'));\n } else {\n $url = explode('/', rtrim($_GET['url'],'/'));\n }\n\n $file = 'controllers/' . $url[0] . '.php';\n if (file_exists($file)) {\n require $file;\n $controller = new $url[0];\n\n if (isset($url[1])) {\n $controller->{$url[1]}();\n }\n } else {\n echo \"404 not found\";\n }\n }",
"public 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 }",
"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 }",
"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 }",
"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 }",
"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 __construct() {\r\n $this->controllerLogin = new ControllerLogin();\r\n $this->controllerGame = new ControllerGame();\r\n $this->controllerRegister = new ControllerRegister();\r\n }",
"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 }",
"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 }",
"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 }",
"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 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}",
"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 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 createController($controllerClass)\n {\n $cls = new ReflectionClass($controllerClass);\n return $cls->newInstance($this->environment);\n }",
"public function __construct() {\n if (isset($_GET['rc'])) {\n $this->url = rtrim($_GET['rc'], '/'); // We don't want no empty arg\n $this->args = explode('/', $this->url);\n }\n \n // Load index controller by default, or first arg if specified\n $controller = ($this->url === null) ? 'null' : array_shift($this->args);\n $this->controllerName = ucfirst($controller);\n\n // Create controller and call method\n $this->route();\n // Make the controller display something\n $this->controllerClass->render();\n }",
"private function loadCurrentController() {\r\n\t\t$controller_name = ucfirst($this->url[0]) . CONTROLLER_SUFFIX;\r\n\t\t$controller_path = CONTROLLERS_PATH . $controller_name . '.php';\r\n\t\t\r\n\t\tif (file_exists($controller_path)) {\r\n\t\t\trequire $controller_path;\r\n\t\t} else { //Controller not found.\r\n\t\t\t$this->error(); \r\n\t\t}\r\n\t\t\r\n\t\ttry {\r\n\t\t\t$this->controller = new $controller_name;\r\n\t\t} catch (Exception $e) { //Any error.\r\n\t\t\t$msg = $e->getMessage();\r\n\t\t\tif ($msg == \"\")\r\n\t\t\t\t$msg = \"An error occuring during execution\";\r\n\t\t\t\r\n\t\t\t$this->error($msg . \" ( \" . $e->getFile() . \": line \" . $e->getLine() . \")\");\r\n\t\t}\r\n\t}",
"public function __construct(){\n\t\t$url = $this->processUrl();\n\n\t\t//this if statement unsets the defaultController so we can use the one that is being talked to.\n\t\tif(file_exists('../app/controllers/'.$url[0].'.php')){\n\t\t\t$this->defaultController = $url[0];\n\t\t\tunset($url[0]);\n\t\t}\n\n\t\trequire_once('../app/controllers/' .$this->defaultController.'.php');\n\n\t\t$this->defaultController = new $this->defaultController;//instantiate and make it an object\n\n\t\tif(isset($url[1])){\n\t\t\tif(method_exists($this->defaultController,$url[1])){\n\t\t\t$this->defaultMethod = $url[1];\n\t\t\tunset($url[1]);\n\t\t\t}\t\n\t\t}\n\n\t\t\n\t\t$this->parameters = $url ? array_values($url):[];\n\t\t// print_r($this->parameters);\n\n\t\tcall_user_func_array([$this->defaultController,$this->defaultMethod],$this->parameters);\n\t}",
"public function 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 }",
"protected function initializeController() {}",
"private function create_mock_controller() {\n eval('class TestController extends cyclone\\request\\SkeletonController {\n function before() {\n DispatcherTest::$beforeCalled = TRUE;\n DispatcherTest::$route = $this->_request->route;\n }\n\n function after() {\n DispatcherTest::$afterCalled = TRUE;\n }\n\n function action_act() {\n DispatcherTest::$actionCalled = TRUE;\n }\n}');\n }",
"public function getController( );",
"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 __construct()\n {\n $this->dataController = new DataController;\n }",
"public function show()\n {\n new $this->controller();\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 __construct()\n {\n $url = $this->getUrl();\n /**Tomamos el primer valor para el Controlador y \n * verificamos si existe el archivo.\n * Ponemos en Mayúscula primer letra de la Palabra\n **/\n \n if (file_exists('../app/controllers/' . ucwords($url[0]) . 'Controller.php')) {\n /**Si existe seteamos el controlador y blanqueamos \n * la primer posición del array $url.\n **/\n $this->currentController = ucwords($url[0]).'Controller';\n unset($url[0]);\n }\n\n /**\n * Requerimos el Controlador y lo Intanciamos.\n */\n require_once '../app/controllers/' . $this->currentController.'.php';\n $this->currentController = new $this->currentController;\n\n /**\n * Verificamos la segunda parte de la url.\n * Para ver si estamos pasando un método.\n */\n if (isset($url[1])) {\n /**Verificamos si el Método existe en la clase.\n * Si existe o Seteamos.\n * Blanqueamos la posición del array url.\n */\n if (method_exists($this->currentController, $url[1])) {\n $this->currentMethod = $url[1];\n unset($url[1]);\n }\n }\n\n /**\n * Verificamos si el array url tiene valores.\n * Si tiene seteamos params, sino lo dejamos vacío.\n */\n $this->params = $url ? array_values($url) : [];\n\n /**\n * Llamamos al método con un array de parámetros.\n */\n call_user_func_array([$this->currentController, $this->currentMethod], $this->params);\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ó 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}",
"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 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 }",
"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 }",
"public function __construct()\n {\n $url = $this->getUrl();\n // Look in controllers folder for first value and ucwords(); will capitalise first letter \n if (isset($url[0]) && file_exists('../app/controllers/' . ucwords($url[0]) . '.php')) {\n $this->currentController = ucwords($url[0]); // Setting the current controllers name to the name capitilised first letter\n unset($url[0]); \n }\n\n // Require the controller\n require_once '../app/controllers/' . $this->currentController . '.php';\n // Taking the current controller and instantiating the controller class \n $this->currentController = new $this->currentController;\n // This is checking for the second part of the URL\n if (isset($url[1])) {\n if (method_exists($this->currentController, $url[1])) { // Checking the seond part of the url which is the corresponding method from the controller class\n $this->currentMethod = $url[1];\n unset($url[1]);\n }\n }\n\n // Get params, if no params, keep it empty\n $this->params = $url ? array_values($url) : []; \n\n // Call a callback with array of params\n call_user_func_array([$this->currentController, $this->currentMethod], $this->params);\n }",
"public function testInstantiateSessionController()\n {\n $controller = new SessionController();\n\n $this->assertInstanceOf(\"App\\Http\\Controllers\\SessionController\", $controller);\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}",
"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 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 }",
"private static function controller()\n {\n $files = ['Controller'];\n $folder = static::$root.'MVC'.'/';\n\n self::call($files, $folder);\n }",
"public function __construct() {\n\t\tparent::__construct();\n\t\t$this->view = new ViewController();\t\t\n\t}",
"protected function loadController($class)\n {\n /** @var Controller $controller */\n $controller = new $class($this->config, $this->request);\n\n $controller->init();\n\n return $controller;\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 AController() {\r\n\t}",
"public function __construct()\n {\n // echo \"application 호출 성공\";\n // application 의 가장 중요한 역활은 url routing 입니다.\n // url을 받으면 다음과 같은 방식으로 URL을 분석하여\n // 배엘에 저장을 하게 됩니다.\n\n $url = \"\";\n\n // 1. url이 있는지 확인 합니다.\n if (isset($_GET['url'])) {\n $url = rtrim($_GET['url'],'/');\n $url = filter_var($url, FILTER_SANITIZE_URL);\n }\n\n // 2. URL을 분석합니다.\n $params = explode('/', $url);\n $counts = count($params);\n\n $param['menu'] = (!isset($params[0]) || $params[0] == '') ? \"home\" : $params[0];\n $param['action'] = (!isset($params[1]) || $params[1] == '') ? \"index\" : $params[1];\n $param['catagory'] = (!isset($params[2]) || $params[2] == '') ? \"story\" : $params[2];\n $param['contentNo'] = (!isset($params[3]) || $params[3] == '') ? 1 : $params[3];\n $param['pageNo'] = (!isset($params[4]) || $params[4] == '') ? 1 : $params[4];\n\n // 3. 해당 URL을 기준으로 controller를 호출합니다.\n $controllerName = '\\application\\controllers\\\\'.$param['menu'].'controller';\n new $controllerName($param['action'], $param['catagory'], $param['contentNo'], $param['pageNo']);\n //new \\application\\controllers\\BoardController($param['action'], $param['catagory'], $param['contentNo'], $param['pageNo']);\n }",
"public function create()\n {\n $output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n $output->writeln(\"<info>Controller Create</info>\");\n }",
"function __construct() {\n //con esta linea se hereda el constructor de la clase Controller\n parent::__construct();\n }",
"public static function createFrontController()\n {\n return self::createInjectorWithBindings(self::extractArgs(func_get_args()))\n ->getInstance('net::stubbles::websites::stubFrontController');\n }",
"public function __construct() {\n $this->twitterController = new TwitterController;\n\t}",
"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 loadController($controller) {\n\t\t$name = (!preg_match('#Controller$#', $controller)) ? $controller.'Controller' : $controller;\n\t\t$file = __APP_PATH . DS . 'controller' . DS . $name . '.php';\n\t\tif(!file_exists($file)){\n\t\t\tthrow new Exception ('Le controller '.$controller.' n\\'existe pas dans '.$file);\n\t\t}\n\t\trequire $file; \n\t\treturn new $name(); \n\t}",
"function Controller()\n\t{\t\t\n\t\t$this->method = \"showView\";\n\t\tif (array_key_exists(\"method\", $_REQUEST))\n\t\t\t$this->method = $_REQUEST[\"method\"];\n\t\t\t\t\n\t\t$this->icfTemplating = new IcfTemplating();\n\t\t$this->tpl =& $this->icfTemplating->getTpl();\n\t\t$this->text =& $this->icfTemplating->getText();\t\t\n\t\t$this->controllerMessageArray = array();\n\t\t$this->pageTitle = \"\";\n\t\t$this->dateFormat = DateFormatFactory::getDateFormat();\n\t\t$this->controllerData =& $this->newControllerData();\n\t}",
"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 }",
"public function newInstance();",
"public function newInstance();",
"public function makeTestController(TestController $controller)\r\n\t{\r\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 controller()\n\t{\n\t\n\t}",
"public function testCreateTheControllerClass()\n {\n $controller = new Game21Controller();\n $this->assertInstanceOf(\"\\App\\Http\\Controllers\\Game21Controller\", $controller);\n }",
"protected function getController()\n {\n $uri = WingedLib::clearPath(static::$parentUri);\n if (!$uri) {\n $uri = './';\n $explodedUri = ['index', 'index'];\n } else {\n $explodedUri = explode('/', $uri);\n if (count($explodedUri) == 1) {\n $uri = './' . $explodedUri[0] . '/';\n } else {\n $uri = './' . $explodedUri[0] . '/' . $explodedUri[1] . '/';\n }\n }\n\n $indexUri = WingedLib::clearPath(\\WingedConfig::$config->INDEX_ALIAS_URI);\n if ($indexUri) {\n $indexUri = explode('/', $indexUri);\n }\n\n if ($indexUri) {\n if ($explodedUri[0] === 'index' && isset($indexUri[0])) {\n static::$controllerName = Formater::camelCaseClass($indexUri[0]) . 'Controller';\n $uri = './' . $indexUri[0] . '/';\n }\n if (isset($explodedUri[1]) && isset($indexUri[1])) {\n if ($explodedUri[1] === 'index') {\n static::$controllerAction = 'action' . Formater::camelCaseMethod($indexUri[1]);\n $uri .= $indexUri[1] . '/';\n }\n } else {\n $uri .= 'index/';\n }\n }\n\n $controllerDirectory = new Directory(static::$parent . 'controllers/', false);\n if ($controllerDirectory->exists()) {\n $controllerFile = new File($controllerDirectory->folder . static::$controllerName . '.php', false);\n if ($controllerFile->exists()) {\n include_once $controllerFile->file_path;\n if (class_exists(static::$controllerName)) {\n $controller = new static::$controllerName();\n if (method_exists($controller, static::$controllerAction)) {\n try {\n $reflectionMethod = new \\ReflectionMethod(static::$controllerName, static::$controllerAction);\n $pararms = [];\n foreach ($reflectionMethod->getParameters() as $parameter) {\n $pararms[$parameter->getName()] = $parameter->isOptional();\n }\n } catch (\\Exception $exception) {\n $pararms = [];\n }\n return [\n 'uri' => $uri,\n 'params' => $pararms,\n ];\n }\n }\n }\n }\n return false;\n }",
"public function _construct($controller,$view){\r\n $this->controller = $controller;\r\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 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 DiceGame();\n $this->assertInstanceOf(\"\\Ampheris\\ampController\\DiceGame\", $controller);\n }",
"function load_controller($controller) {\n require_once \"{$this->trails_root}/controllers/{$controller}.php\";\n $class = Trails_Inflector::camelize($controller) . 'Controller';\n if (!class_exists($class)) {\n throw new Trails_UnknownController(\"Controller missing: '$class'\");\n }\n return new $class($this);\n }",
"private function getControllerToRun()\n {\n $routing = $this->getRouting();\n $module = strtolower($this->urlParams[self::PARAM_CONTROLLER]);\n \n $module = strtr($module, '-', '_');\n \n // Check if we have routing to this module\n if (isset($routing[$this->apiType][$module])) {\n $controllerName = $routing[$this->apiType][$module];\n } else {\n // Call default controller\n $controllerName = $routing[$this->apiType][self::DEFAULT_CONTROLLER_ROUTE_NAME];\n }\n \n if (class_exists($controllerName)) {\n return new $controllerName();\n }\n \n self::debug(\"Fatal error: Controller ({$controllerName}) not found\");\n }",
"public function __construct()\n {\n $this->controller = new Controller;\n $this->error_message = 'bad request or duplicate data';\n }",
"public function __construct()\n {\n $this->art = new Article();\n $this->img = new Image();\n $this->article = new ArticlesController($this->art);\n $this->image = new ImagesController();\n $this->landing = new ConfigurationsController();\n $this->cover = new CoversController();\n $this->video = new Video();\n }",
"function &getInstance (&$controller) {\n\n\t\tstatic $instance;\n\t\tif (!isset($instance)) {\n\n\t\t\t$c = __CLASS__;\n\t\t\t$instance = new $c();\n\t\t\t$instance->_controller =& $controller;\n\t\t}\n\t\treturn $instance;\n\t}",
"static function start()\n {\n $controller_name = 'Main';\n $action_name = 'Index';\n\n $routes = explode('/', $_SERVER['REQUEST_URI']);\n\n // get the name of the controller\n if (!empty($routes[1])) {\n $controller_name = ucfirst($routes[1]);\n }\n\n // get the name of the action\n if (!empty($routes[2])) {\n $action_name = ucfirst($routes[2]);\n }\n\n // add prefixes\n $controller_name = 'Controller' . $controller_name;\n $action_name = 'action' . $action_name;\n\n // take file with controller class\n $controller_file = $controller_name . '.php';\n $controller_path = \"../app/controllers/\" . $controller_file;\n\n try {\n if (!file_exists($controller_path)) {\n throw new \\Exception('Could not find file');\n }\n include \"../app/controllers/\" . $controller_file;\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n\n // create a controller\n $controller_name = \"App\\\\Controllers\\\\\" . $controller_name;\n $controller = new $controller_name();\n $action = $action_name;\n\n try {\n if (!method_exists($controller, $action)) {\n throw new \\Exception('Could not find method');\n }\n // call the controller action\n $controller->$action();\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n }",
"function __construct()\n {\n parent::Controller();\n }"
] | [
"0.7746166",
"0.7515459",
"0.7438831",
"0.7266114",
"0.72363627",
"0.7091491",
"0.70629483",
"0.7040762",
"0.6971043",
"0.6957444",
"0.69054586",
"0.68539304",
"0.67931736",
"0.6791609",
"0.6775194",
"0.6774169",
"0.67478454",
"0.6728726",
"0.67086864",
"0.67013943",
"0.6666619",
"0.6658756",
"0.66346645",
"0.66279703",
"0.65992224",
"0.6587726",
"0.6549403",
"0.6545398",
"0.6543301",
"0.65350056",
"0.6507868",
"0.6506678",
"0.6505957",
"0.64986575",
"0.6492009",
"0.64829665",
"0.6474187",
"0.64624137",
"0.64578325",
"0.644296",
"0.6432364",
"0.64093983",
"0.64082134",
"0.63960105",
"0.6383497",
"0.6379962",
"0.63683116",
"0.63671136",
"0.63520736",
"0.63346523",
"0.6322982",
"0.62827307",
"0.62700015",
"0.62653506",
"0.6257545",
"0.62545854",
"0.6233139",
"0.6231104",
"0.62270325",
"0.61989975",
"0.61971766",
"0.61939263",
"0.61706895",
"0.614811",
"0.61449534",
"0.6137064",
"0.6135203",
"0.6123079",
"0.6111791",
"0.60927624",
"0.60867965",
"0.6083971",
"0.6073956",
"0.6073946",
"0.60346216",
"0.60338646",
"0.6030775",
"0.60302657",
"0.60295445",
"0.60098875",
"0.60051525",
"0.60042226",
"0.6002232",
"0.59936404",
"0.59936404",
"0.5986676",
"0.5986368",
"0.5985954",
"0.59829235",
"0.59770876",
"0.5975557",
"0.59746903",
"0.59702426",
"0.59699464",
"0.59630483",
"0.5949088",
"0.5946997",
"0.59455",
"0.5944386",
"0.5940403",
"0.5933076"
] | 0.0 | -1 |
Display a listing of the resource. | public function index(Request $request)
{
if ($request->has('slug')) {
$params = $this->validateQueryParams($request, ['slug' => 'string']);
$teams = Team::where('slug', '=', $params['slug'])
->get();
} else {
$user = JWTAuth::parseToken()->authenticate();
$teams = Team::orderBy('name')
->where('user_id', '=', $user->id)
->get();
}
// generate resource
$resource = new Collection($teams, new TeamTransformer(), 'teams');
return $this->jsonResponse($resource, 200);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }",
"public function listing();",
"function index() {\n\t\t$this->show_list();\n\t}",
"public function actionList() {\n $this->_getList();\n }",
"public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }",
"public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }",
"public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }",
"function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}",
"public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }",
"public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }",
"public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}",
"function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}",
"public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }",
"public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}",
"public function actionRestList() {\n\t $this->doRestList();\n\t}",
"public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}",
"public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }",
"public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }",
"public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}",
"public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}",
"public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }",
"public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }",
"public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }",
"public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }",
"public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}",
"public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }",
"public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}",
"public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }",
"public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}",
"public function index()\n {\n $this->list_view();\n }",
"public function index()\n {\n $this->list_view();\n }",
"public function index()\n {\n $this->list_view();\n }",
"public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }",
"public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }",
"public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}",
"public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }",
"public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }",
"public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }",
"public function index()\n {\n return Resources::collection(Checking::paginate());\n }",
"public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }",
"public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }",
"public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }",
"public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }",
"public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }",
"public function 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 index()\n {\n $this->indexPage('list-product', 'List Product');\n }",
"public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }",
"public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }",
"public function executeList()\n {\n $this->setTemplate('list');\n }",
"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 doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}",
"public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }",
"public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }",
"public function _index(){\n\t $this->_list();\n\t}",
"public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}",
"function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}",
"public function index()\n {\n $this->booklist();\n }",
"public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }",
"public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }",
"public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }",
"public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }",
"public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }",
"public function indexAction() {\n $this->_forward('list');\n }",
"public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }",
"public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }",
"public function 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 index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }",
"public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }",
"public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }",
"public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }",
"public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }",
"public function 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 return ProductResource::collection(Product::latest()->paginate(10));\n }",
"public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }",
"public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }",
"public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }",
"public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }",
"public function index()\n {\n return view('admin.resources.index');\n }",
"public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}"
] | [
"0.7446838",
"0.7361646",
"0.7299749",
"0.7246801",
"0.7163394",
"0.7148201",
"0.71318537",
"0.7104601",
"0.7101873",
"0.709985",
"0.70487136",
"0.69936216",
"0.6988242",
"0.69347453",
"0.68989795",
"0.68988764",
"0.68909055",
"0.68874204",
"0.68650436",
"0.6848891",
"0.6829478",
"0.6801521",
"0.67970383",
"0.6794992",
"0.678622",
"0.67595136",
"0.67416173",
"0.6730242",
"0.67248064",
"0.6724347",
"0.6724347",
"0.6724347",
"0.6717754",
"0.67069757",
"0.67046493",
"0.67045283",
"0.66652155",
"0.6662764",
"0.6659929",
"0.6659647",
"0.665744",
"0.6653796",
"0.66483474",
"0.6620148",
"0.6619058",
"0.66164845",
"0.6606442",
"0.66005665",
"0.65998816",
"0.6593891",
"0.6587057",
"0.6584887",
"0.65822107",
"0.65806025",
"0.6576035",
"0.65731865",
"0.6571651",
"0.65702003",
"0.6569641",
"0.6564336",
"0.65618914",
"0.65526754",
"0.6552204",
"0.6545456",
"0.653638",
"0.65332466",
"0.65329266",
"0.65268785",
"0.6525191",
"0.652505",
"0.65196913",
"0.6517856",
"0.6517691",
"0.65152586",
"0.6515112",
"0.6507232",
"0.65038383",
"0.65013176",
"0.64949673",
"0.6491598",
"0.6486873",
"0.64857864",
"0.6484881",
"0.6483896",
"0.64777964",
"0.6476692",
"0.64711976",
"0.6469358",
"0.64685416",
"0.64659655",
"0.6462483",
"0.6461606",
"0.6459046",
"0.6457556",
"0.6454214",
"0.6453915",
"0.64524966",
"0.64499927",
"0.6448528",
"0.6447461",
"0.6445687"
] | 0.0 | -1 |
Store a newly created resource in storage. | public function store(TeamRequest $request)
{
// fetch the data
$data = $request->input('data');
// check paid
if ($data['attributes']['paid'] == true) {
// make sure the user is an admin to set paid == true
$authUser = JWTAuth::parseToken()->authenticate();
if ($authUser->role != 'admin') {
$data['attributes']['paid'] = false;
}
}
// create the team
$team = new Team($data['attributes']);
// set the user relation
$team->user_id = $data['relationships']['user']['data']['id'];
$team->save();
// generate resource
$resource = new Item($team, new TeamTransformer(), 'teams');
return $this->jsonResponse($resource, 201);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store($data, Resource $resource);",
"public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }",
"public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }",
"public function createStorage();",
"public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }",
"public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }",
"public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }",
"function storeAndNew() {\n $this->store();\n }",
"public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }",
"public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }",
"public function store()\n\t{\n\t\t\n\t\t//\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}"
] | [
"0.7286258",
"0.71454436",
"0.7132821",
"0.6640289",
"0.6621105",
"0.6566493",
"0.65255576",
"0.65087926",
"0.6448317",
"0.63752604",
"0.63736314",
"0.6365631",
"0.6365631",
"0.6365631",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229",
"0.634229"
] | 0.0 | -1 |
Display the specified resource. | public function show(Team $team)
{
// generate resource
$resource = new Item($team, new TeamTransformer(), 'teams');
return $this->jsonResponse($resource, 200);
} | {
"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 |
Update the specified resource in storage. | public function update(TeamRequest $request, Team $team)
{
// fetch the data
$data = $request->input('data');
// unset paid if user is not an admin
if (isset($data['attributes']['paid']) && JWTAuth::parseToken()->authenticate()->role != 'admin') {
unset($data['attributes']['paid']);
}
// update the team
$team->update($data['attributes']);
// update the user relation
$team->user_id = $data['relationships']['user']['data']['id'];
$team->save();
// generate resource
$resource = new Item($team, new TeamTransformer(), 'teams');
return $this->jsonResponse($resource, 200);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }",
"public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }",
"public function update(Request $request, Resource $resource)\n {\n //\n }",
"public function updateStream($resource);",
"public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }",
"protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }",
"public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }",
"public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }",
"public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}",
"public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }",
"public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }",
"protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }",
"public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }",
"public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }",
"public function update($path);",
"public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }",
"public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }",
"public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }",
"public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}",
"public function updateStream($path, $resource, Config $config)\n {\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }",
"public function update($data) {}",
"public function update($data) {}",
"public function putStream($resource);",
"public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }",
"public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }",
"public function update($entity);",
"public function update($entity);",
"public function setResource($resource);",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }",
"public function isUpdateResource();",
"public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }",
"public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }",
"public function store($data, Resource $resource);",
"public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }",
"public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }",
"public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }",
"public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }",
"public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }",
"public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }",
"public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }",
"public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }",
"public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }",
"public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }",
"public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }",
"public function update(Qstore $request, $id)\n {\n //\n }",
"public function update(IEntity $entity);",
"protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }",
"public function update($request, $id);",
"function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}",
"public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }",
"public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }",
"protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }",
"abstract public function put($data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function testUpdateSupplierUsingPUT()\n {\n }",
"public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }",
"public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }",
"public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }",
"public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }",
"public abstract function update($object);",
"public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }",
"public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }",
"public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }",
"public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }",
"public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }",
"public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }",
"public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }",
"public function update($entity)\n {\n \n }",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }",
"public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }",
"public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }",
"public function update($id, $input);",
"public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }",
"public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}",
"public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }",
"public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }",
"public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }",
"public function update($id);",
"public function update($id);",
"private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }",
"public function put($path, $data = null);",
"public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }",
"public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }",
"public function update(Entity $entity);",
"public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }",
"public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}",
"public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }",
"public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }",
"public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }",
"public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }",
"public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }"
] | [
"0.7425105",
"0.70612276",
"0.70558053",
"0.6896673",
"0.6582159",
"0.64491373",
"0.6346954",
"0.62114537",
"0.6145042",
"0.6119944",
"0.61128503",
"0.6099993",
"0.6087866",
"0.6052593",
"0.6018941",
"0.60060275",
"0.59715486",
"0.5946516",
"0.59400934",
"0.59377414",
"0.5890722",
"0.5860816",
"0.5855127",
"0.5855127",
"0.58513457",
"0.5815068",
"0.5806887",
"0.57525045",
"0.57525045",
"0.57337505",
"0.5723295",
"0.5714311",
"0.5694472",
"0.5691319",
"0.56879413",
"0.5669989",
"0.56565005",
"0.56505877",
"0.5646085",
"0.5636683",
"0.5633498",
"0.5633378",
"0.5632906",
"0.5628826",
"0.56196684",
"0.5609126",
"0.5601397",
"0.55944353",
"0.5582592",
"0.5581908",
"0.55813426",
"0.5575312",
"0.55717176",
"0.55661047",
"0.55624634",
"0.55614686",
"0.55608666",
"0.55599797",
"0.55599797",
"0.55599797",
"0.55599797",
"0.55599797",
"0.55573726",
"0.5556878",
"0.5554201",
"0.5553069",
"0.55530256",
"0.5543788",
"0.55435944",
"0.55412996",
"0.55393505",
"0.55368495",
"0.5535236",
"0.5534954",
"0.55237365",
"0.5520468",
"0.55163723",
"0.55125296",
"0.5511168",
"0.5508345",
"0.55072427",
"0.5502385",
"0.5502337",
"0.5501029",
"0.54995877",
"0.54979175",
"0.54949397",
"0.54949397",
"0.54946727",
"0.5494196",
"0.54941916",
"0.54925025",
"0.5491807",
"0.5483321",
"0.5479606",
"0.5479408",
"0.5478678",
"0.54667485",
"0.5463411",
"0.5460588",
"0.5458525"
] | 0.0 | -1 |
Remove the specified resource from storage. | public function destroy(Team $team)
{
// make sure it can be deleted
$this->authorize('delete', $team);
// delete the team
$team->delete();
// return empty response
return response()->json([], 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}",
"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 function delete(): void\n {\n unlink($this->path);\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 $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 File::find($id)->remove();\n \n return redirect()->route('files.index');\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 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 removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\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 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 removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}",
"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 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 deleted(Storage $storage)\n {\n //\n }",
"public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }",
"public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }",
"function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}",
"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 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 }",
"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();",
"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()\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.6673811",
"0.66624975",
"0.66376764",
"0.66351163",
"0.66280866",
"0.65443397",
"0.6543099",
"0.64656305",
"0.62881804",
"0.61755043",
"0.61278707",
"0.6089098",
"0.60534257",
"0.6043048",
"0.6006416",
"0.593359",
"0.5929751",
"0.5923406",
"0.59201753",
"0.5904145",
"0.58963126",
"0.5895338",
"0.589437",
"0.589437",
"0.589437",
"0.589437",
"0.58819216",
"0.58684987",
"0.5864614",
"0.58097607",
"0.57739484",
"0.5761358",
"0.57558876",
"0.5750673",
"0.5741367",
"0.5734089",
"0.57264656",
"0.5715195",
"0.5711313",
"0.5707201",
"0.57057804",
"0.57053447",
"0.5702519",
"0.5698952",
"0.56844676",
"0.56844676",
"0.56783324",
"0.5677608",
"0.56581664",
"0.564899",
"0.5648674",
"0.5647576",
"0.5641079",
"0.5636559",
"0.56325674",
"0.5619814",
"0.5615794",
"0.5607223",
"0.56022006",
"0.5601402",
"0.5601336",
"0.56004316",
"0.5590177",
"0.55810463",
"0.55665016",
"0.5565872",
"0.5565398",
"0.5563011",
"0.55565405",
"0.5556361",
"0.5549312",
"0.5544914",
"0.554211",
"0.5540394",
"0.5540394",
"0.5537265",
"0.5536237",
"0.55310345",
"0.55295527",
"0.5529016",
"0.5527304",
"0.5527274",
"0.5527126",
"0.5527044",
"0.5527044",
"0.5527044",
"0.5527044",
"0.5527044",
"0.5527044",
"0.5527044",
"0.5527044",
"0.5527044",
"0.5527044",
"0.5527044",
"0.5527044",
"0.5527044",
"0.5527044",
"0.5527044",
"0.5523294",
"0.55231583",
"0.55181384"
] | 0.0 | -1 |
Method to set the identifier | function setId($id)
{
// Set event id and wipe data
$this->_id = $id;
$this->_data = null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function setIdentifier($val) {\n $this->identifier = $this->updateDB('identifier', $val);\n }",
"public function setIdentifier(){\n\n \t$this->fileIdentifier = $this->getIdentifier();\n }",
"public function setIdentifier($identifier) {\n\t\t$this->_identifier = $identifier;\n\t}",
"public function setIdentifier($identifier) {\n\t\t$this->identifier = $identifier;\n\t}",
"public function setIdentifier ($identifier)\n {\n $this->identifier = file_get_contents($identifier);\n }",
"public function setIdentifier($identifier)\n\t{\n\t\t$this->identifier = $identifier;\n\t}",
"public function setId(string $identifier);",
"public function set_identifier($identifier) {\n $this->identifier = $identifier;\n }",
"public function setIdentifier($identifier)\n {\n $this->_identifier = $identifier;\n }",
"public function setIdentifier($identifier) {\n $this->identifier = $identifier;\n }",
"public function setIdentifier($identifier)\n {\n $this->identifier = $identifier;\n }",
"public function setIdentifier($identifier)\n {\n $this->identifier = $identifier;\n }",
"public function setIdentifier($id)\n {\n if (!$this->Identifier) {\n $this->setField('Identifier', $id);\n }\n }",
"function SetId($value) { $this->id=$value; }",
"public function setIdentifier($record){\n\t\t$record->writeAttribute($this->_identityColumn, $this->generateUUID());\n\t}",
"public function setId($x) { $this->id = $x; }",
"public function setIdentifier($id)\n {\n $this->uid = (int)$id;\n }",
"public function setCustomIdentifier($input) {\n\t\t$this->_identifier = $input;\n\t}",
"public function setID($value) {\r\n //if (!is_numeric($value)) die(\"setID() only accepts a numerical ID value\");\r\n $this->id = $value;\r\n }",
"public function setNameAndId() {}",
"public function setIdentifier($identifier)\n {\n $this->store->setIdentifier($identifier);\n }",
"public function setId()\n\t{\n\t}",
"protected function setInternalIdentifier($id)\n {\n $this->_id = $id;\n }",
"public function set_id($setid){\n $this->id = $setid;\n }",
"function setId($id) {\n\t\t$this->_id = $id;\n\t}",
"function setId($id) {\r\n $this->_id = $id;\r\n }",
"public function setId($id){\n\t\tself::$_id[get_class($this)] = $id;\n\t}",
"public function identifier(string $identifier);",
"public function setId($var){\n\t\t$this->id=$var;\n\t}",
"function set_id($id) {\n\t\t$this->id = $id;\n\t}",
"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}",
"protected function defineNameId(){\n list($name,$id)=$this->resolveNameID();\n $this->_id=$this->htmlOptions['id']=$id;\n\t\t$this->_name=$this->htmlOptions['name']=$name;\n }",
"public function getIdentifier();",
"public function getIdentifier();",
"public function getIdentifier();",
"public function getIdentifier();",
"public function getIdentifier();",
"public function getIdentifier();",
"public function getIdentifier();",
"public function getIdentifier();",
"public function getIdentifier();",
"function setId($value) {\n $this->_id = intval($value);\n }",
"public function setId($id){\n $this->_id = $id;\n }",
"function setId($id){\n\t\t$this->id = $id;\n\t}",
"function setId($id){\r\n\t\t$this->id = $id;\r\n\t}",
"public function setId()\n {\n $apiKey = new ApiKey;\n $apiKey->setId();\n $this->id = $apiKey->getId();\n }",
"private function SetID($value)\n\t\t{\n\t\t\t$this->id = $value;\n\t\t}",
"public function setID($_id) \n \t{\n \t\t$this->_id = $_id;\n \t}",
"public abstract function getIdentifier();",
"public function setId($_id);",
"abstract public function getIdentifier();",
"public function setID($id) {\n $this->id = $id; \n }",
"public function getIdentifier() {}",
"public function getIdentifier() {}",
"public function getIdentifier() {}",
"public function getIdentifier() {}",
"public function getIdentifier() {}",
"public function getIdentifier() {}",
"public function getIdentifier() {}",
"public function getIdentifier() {}",
"function setId($id) {\n $this->id = $id;\n }",
"function setId($id) {\n $this->id = $id;\n }",
"private function setID($id) {\r\n\t\t$this->id = $id;\r\n\t}",
"public function getIdentifier()\n {\n }",
"public function setId($id) { $this->id = $id; }",
"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}",
"function set_id($id)\n {\n $this->id = $id;\n }",
"public function setID($id){\n $this->ID = $id;\n }",
"function setId($id) {\r\n\t\t$this->setAttributeNS(self :: TEXT, 'text:id', $id);\r\n\t}",
"public function setIdentifyingAttribute($string);",
"public function setID($_id) \n\t{\n\t\t$this->_id = $_id;\n\t}",
"function setId($id)\n {\n $this->id = $id;\n }",
"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 function setID($id){\n $this->id = $id;\n }",
"public function setId($id){\n $this->id = (string) $id;\n }",
"public function setId($id){\n\t\t$this->id = $id;\n\t}",
"public function setId($id) {\r\n $this->_id = $id;\r\n }",
"public function setId($id) \n {\n $this->id = $id;\n }",
"function setId($id)\n\t{\n\t\t// Set id\n\t\t$this->_id\t = $id;\n\t}",
"public function setId($id) {\n $this->id = $id;\n }",
"public function setId( $id ) {\n\t\t$this->id = $id;\n\t}",
"public function setId( $id ) {\n\t\t$this->id = $id;\n\t}",
"function getIdentifier();",
"function getIdentifier();",
"public function setId($id)\n {\n $this->id = $id;\n\n \n }",
"public function setId( $id )\n {\n $this->id = $id;\n }",
"function setId($id) {\n\t\t$this->setData('id', $id);\n\t}",
"public function getIdentifier()\n {\n // TODO: Implement getIdentifier() method.\n }",
"public function setID($id);",
"public function newIdentifier(): string;",
"public function identifierWorkaround()\n {\n $this->isUniqueIdentifier = $this->isUniqueIdentifer;\n }",
"public function setId($id)\n {\n $this->id = $id;\n }",
"function setID($path);",
"public function setId($id) {\n\t\t$this->id = $id;\n\t}",
"public function setId($id) {\n\t\t$this->id = $id;\n\t}",
"public function setId($id) {\n\t\t$this->id = $id;\n\t}",
"public function setId($id) {\n\t\t$this->id = $id;\n\t}",
"public function setId($id) {\n\t\t$this->id = $id;\n\t}",
"private function setId($id)\n {\n $this->id = $id;\n }"
] | [
"0.8087153",
"0.79813194",
"0.7700912",
"0.76420516",
"0.76277244",
"0.7592056",
"0.7582691",
"0.75577664",
"0.75145376",
"0.7458617",
"0.7411677",
"0.7411677",
"0.73755467",
"0.7362744",
"0.7303102",
"0.7294954",
"0.7243837",
"0.7165244",
"0.70649076",
"0.7064087",
"0.7026007",
"0.6994205",
"0.69939554",
"0.69752926",
"0.6923574",
"0.6917153",
"0.69115996",
"0.68927985",
"0.68876255",
"0.688707",
"0.68822515",
"0.68772036",
"0.6875585",
"0.6875585",
"0.6875585",
"0.6875585",
"0.6875585",
"0.6875585",
"0.6875585",
"0.6875585",
"0.6875585",
"0.68559283",
"0.68547416",
"0.683084",
"0.6799963",
"0.6794323",
"0.67885464",
"0.67824847",
"0.67806214",
"0.67764467",
"0.6775527",
"0.6756503",
"0.67274404",
"0.6726749",
"0.6726749",
"0.6726749",
"0.6726749",
"0.6726749",
"0.67260414",
"0.67260414",
"0.6721552",
"0.6721552",
"0.67184436",
"0.67103684",
"0.6704883",
"0.6698596",
"0.66901433",
"0.66679233",
"0.66377115",
"0.66296345",
"0.6627437",
"0.6623308",
"0.66168517",
"0.66168517",
"0.66168517",
"0.6597061",
"0.65902954",
"0.6590163",
"0.658598",
"0.65643126",
"0.6563316",
"0.6563159",
"0.6553101",
"0.6553101",
"0.65447724",
"0.65447724",
"0.6529367",
"0.6515772",
"0.65118533",
"0.65069604",
"0.65005577",
"0.64961344",
"0.6494916",
"0.64856416",
"0.6483707",
"0.6476754",
"0.6476754",
"0.6476754",
"0.6476754",
"0.6476754",
"0.6467899"
] | 0.0 | -1 |
Logic for the event edit screen | function &getData()
{
if ($this->_loadData())
{
}
else $this->_initData();
return $this->_data;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function postEventedit();",
"public function edit(Event $event)\n {\n //\n }",
"public function edit(Event $event)\n {\n //\n }",
"public function edit(Event $event)\n {\n //\n }",
"public function edit(Event $event)\n {\n //\n }",
"public function edit(Event $event)\n {\n //\n }",
"public function edit(Event $event)\n {\n //\n }",
"public function edit(Event $event)\n {\n //\n }",
"public function edit(Event $event)\n {\n //\n }",
"public function edit(Event $event)\n {\n //\n }",
"public function action_edit()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t\tthrow new HTTP_Exception_404;\r\n\t\t\r\n\t\t// Can user edit this event's details?\r\n\t\tif ( ! $this->user->can('event_edit', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.edit.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// Valid csrf, etc.\r\n\t\tif ($this->valid_post())\r\n\t\t{\r\n\t\t\t// Get event data from $_POST\r\n\t\t\t$event_post = Arr::get($this->request->post(), 'event', array());\r\n\t\t\t\r\n\t\t\ttry\r\n\t\t\t{\r\n\t\t\t\t// Save data to event object\r\n\t\t\t\t$event->edit_event($event_post);\r\n\t\t\t\t\r\n\t\t\t\tNotices::success('event.edit.success');\r\n\t\t\t\t\r\n\t\t\t\t// Display edited event\r\n\t\t\t\t$this->request->redirect(Route::url('event').'#'.$event->id);\r\n\t\t\t}\r\n\t\t\tcatch(ORM_Validation_Exception $e)\r\n\t\t\t{\r\n\t\t\t\t$this->view->errors = $e->errors('event');\r\n\t\t\t\t$this->view->values = $event_post;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$this->view->values = $event->as_array();\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event object 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\t\r\n\t}",
"public function edit(Events $events)\n {\n //\n }",
"public function edit(Events $events)\n {\n //\n }",
"public function edit(Events $events)\n {\n //\n }",
"public function edit(events $events)\n {\n //\n }",
"public function edit_event( $options=array() ){\n\t\t\t//length = 255\n\t\t\t//must have id\n\t\t\n\t\t$error_append = \" CLASS[\".__CLASS__.\"] METHOD[\".__METHOD__.\"] DATE[\".date('Y-m-d H:i:s').\"]\";\n\t\t$values = array();\n\t\t\n\t\tif( empty( $options['id'] ) ){\n\t\t\t$error = Core::error($this->errors, 1);\n\t\t\t$error['error_msg'] .= $error_append;\n\t\t\treturn $error;\n\t\t}\n\t\thttp://gamo-framework.local/?a=create_event&title=Test&description=random&date=2013-07-12%2011:00\n\t\tCore::ensure_defaults(array(\n\t\t\t\t'title_unique' => 1\n\t\t\t), $options\n\t\t);\n\t\t\n\t\t\n\t\tif( isset($options['title']) ){ \n\t\t\t$values['title'] = $this->validate_title( array('title' => $options['title']) );\n\t\t\tif(Core::has_error( $values['title'] )){\n\t\t\t\treturn $values['title'] ;\n\t\t\t}\n\t\t\t\n\t\t\tif($options['title_unique']){\n\t\t\t\t//TODO:Check if the title unique\n\t\t\t\tif( !Core::db_count( array(\n\t\t\t\t\t\t'table' => CORE_DB.\".\".self::$table_name,\n\t\t\t\t\t\t'values' => array(\n\t\t\t\t\t\t\t\t'title' => $values['title']\n\t\t\t\t\t\t)\n\t\t\t\t))){\n\t\t\t\t\t$error = Core::error($this->errors, 7);\n\t\t\t\t\t$error['error_msg'] .= 'Event title must be unique. ';\n\t\t\t\t\t$error['error_msg'] .= $error_append;\n\t\t\t\t\treturn $error;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( isset($options['description']) ){\n\t\t\t$values['description'] = $this->validate_description( array('description' => $options['description']) );\n\t\t\tif(Core::has_error( $values['description'] )){\n\t\t\t\treturn $values['description'];\n\t\t\t}\n\t\t}\n\t\t\n\t\tif( isset($options['date']) ){\n\t\t\t$values['date_time'] = $this->validate_event_date( array('date' => $options['date']) );\n\t\t\tif(Core::has_error( $values['date_time'] )){\n\t\t\t\treturn $values['date_time'];\n\t\t\t}\n\t\t}\n\t\t\n\t\t$result = Core::db_update( array(\n\t\t\t'table' => CORE_DB.\".\".self::$table_name,\n\t\t\t'values' => $values,\n\t\t\t'where' => array(\n\t\t\t\t'id' => $options['id']\n\t\t\t)\n\t\t));\n\t\t\n\t\tif( Core::has_error($result) or empty($result) ){\n\t\t\t$result['error_msg'] .= $error_append;\n\t\t\treturn $result;\n\t\t}\n\t\t\n\t\treturn $result;\n\t\t\n\t}",
"public function edit(Events $Events)\n {\n //\n }",
"public function editEvent($event_id, array $event_edits);",
"function eventclass_TambahPergerakan()\n\t{\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\n//\tonscreen events\n\n\n\t}",
"public function postEventedit(){\n\t\t$this->set_purpose(self::EDIT);\n\t\t$data = Input::all() ;\n $id = Input::get('id');\n\t\t$rules = $this->get_rules(true);\n \t$validator = Validator::make($data, $rules);\n\t\tif ($validator->fails()) {\n\t\t\t$messages = $validator->messages();\n\t\t\t$message = sprintf('<span class=\"label label-danger\">%1$s</span>' ,\n\t\t\t\t\t\t\t $this->make_message( $messages->all() ));\n\t\t\t$this->set_error_message($message);\n\t\t\treturn $this->getEventedit( $id , $data , $message);\n\t\t}\n else{\n\t\t\treturn $this->will_edit_to_db($data);\n }\n }",
"function RenderHtmlTemplateInvoiceRunEventsEdit()\n\t{\n\t\treturn $this->RenderHtmlTemplateInvoiceRunEvents(HTML_CONTEXT_EDIT);\n\t}",
"public function edit(evento $evento)\n {\n //\n }",
"function editEvent($req, &$t) {\n\n\t\t$t['picForm'] = $this->_loadPictureForm();\n\t}",
"public function edit() {\n $this->authorize(PermissionEnum::getInstance(PermissionEnum::EventBookingImmediate)->key, User::class);\n $events = auth()->user()->eventsToBook()->getModels();\n return view('events.my', ['events' => $events]);\n }",
"public function edit(Evento $evento)\n {\n //\n }",
"abstract protected function renderEdit();",
"public function edit()\n\t{\n\t\t//\n\t}",
"public function edit_event() {\n\t\n\t\tif($this->input->post('edit_type')=='event') {\n\t\t\t\n\t\t$id = $this->uri->segment(4);\t\t\n\t\t/* Define return | here result is used to return user data and error for error message */\n\t\t$Return = array('result'=>'', 'error'=>'', 'csrf_hash'=>'');\n\t\t$Return['csrf_hash'] = $this->security->get_csrf_hash();\n\t\t\n\t\t$event_date = $this->input->post('event_date');\n\t\t$current_date = date('Y-m-d');\n\t\t$event_note = $this->input->post('event_note');\n\t\t$ev_date = strtotime($event_date);\n\t\t$ct_date = strtotime($current_date);\n\t\t$qt_event_note = htmlspecialchars(addslashes($event_note), ENT_QUOTES);\n\t\t\t\n\t\t/* Server side PHP input validation */\t\t\n\t\tif($this->input->post('event_title')==='') {\n \t$Return['error'] = $this->lang->line('xin_error_event_title_field');\n\t\t} else if($this->input->post('event_date')==='') {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_event_date_field');\n\t\t} else if($ev_date < $ct_date) {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_event_date_current_date');\n\t\t} else if($this->input->post('event_time')==='') {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_event_time_field');\n\t\t}\n\t\t\t\t\n\t\tif($Return['error']!=''){\n \t\t$this->output($Return);\n \t}\n\t\n\t\t$data = array(\n\t\t'event_title' => $this->input->post('event_title'),\n\t\t'event_date' => $this->input->post('event_date'),\n\t\t'event_time' => $this->input->post('event_time'),\n\t\t'event_color' => $this->input->post('event_color'),\n\t\t'event_note' => $qt_event_note\n\t\t);\n\t\t$result = $this->Events_model->update_record($data,$id);\n\t\t\t\t\n\t\tif ($result == TRUE) {\n\t\t\t$Return['result'] = $this->lang->line('xin_hr_success_event_updated');\n\t\t} else {\n\t\t\t$Return['error'] = $this->lang->line('xin_error_msg');\n\t\t}\n\t\t$this->output($Return);\n\t\texit;\n\t\t}\n\t}",
"public function editEvent() {\n\n /* Searching the event */\n $event = EventDCI::find(Input::get('id'));\n\n if(is_null($event)) {\n Mail::send('errors.editevent',\n array(\n 'error' => 'No existe el evento especificado',\n 'user' => json_encode(Auth::user()),\n 'event' => json_encode(Input::all()),\n ),\n function($message) {\n $message->to('[email protected]')->subject('Error al editar evento - DCI');\n $message->to('[email protected]')->subject('Error al editar evento - DCI');\n }\n\n );\n\n return Redirect::to('dashboard')\n ->with('alert', 'No existe el evento especificado')\n ->with('FORM_ENABLED','true')\n ->with('action', 'edit')\n ->withInput();\n }\n\n /* Validating that the event belongs to the user login user */\n if($event->user_id != Auth::user()->id) {\n return Redirect::to('dashboard')\n ->with('alert', 'Usted no tiene permisos para modificar el evento especificado')\n ->with('FORM_ENABLED','true')\n ->with('action', 'edit')\n ->withInput();\n }\n\n /* Verifying that event has a correct and valid data */\n $validation = $this->validateEvent();\n\n if(!$validation['isValid']) {\n return Redirect::to('dashboard')\n ->with('alert', $validation['message'])\n ->with('FORM_ENABLED','true')\n ->with('action', 'edit')\n ->withInput();\n }\n\n /* Updating the event */\n $event->name = Input::get('name');\n $event->start_day = Input::get('start_day');\n $event->end_day = Input::get('end_day');\n $event->time = Input::get('time');\n $event->place = Input::get('place');\n $event->link = Input::get('link');\n $event->directed_to = Input::get('directed_to');\n $event->has_cost = !Input::has('has_cost');\n $event->description = Input::get('description');\n $event->save();\n\n $now = new DateTime();\n\n /* Getting old services, resources sources and witeness to the event */\n $old_services = $event->services()->get();\n $old_resources_sources = $event->resources_sources()->get();\n $old_witnesses = $event->witnesses()->get();\n $old_pdi_programs = $event->pdi_programs()->get();\n\n /* Deactivating old services */\n foreach ($old_services as $old_service) {\n $event->services()->updateExistingPivot($old_service->id, array('deleted_at' => $now));\n }\n\n /* Deactivateing old resources sources */\n foreach ($old_resources_sources as $old_resource_source) {\n $event->resources_sources()->updateExistingPivot($old_resource_source->id, array('deleted_at' => $now));\n }\n\n /* Deactivateing old resources sources */\n foreach ($old_witnesses as $old_witness) {\n $event->witnesses()->updateExistingPivot($old_witness->id, array('deleted_at' => $now));\n }\n\n /* Deactivateing old PDI programs */\n foreach ($old_pdi_programs as $old_pdi_program) {\n $event->pdi_programs()->updateExistingPivot($old_pdi_program->id, array('deleted_at' => $now));\n }\n\n /* Getting information about diffusion */\n if(Input::has('services')) {\n\n /* Getting new services to the event */\n $new_services = Input::get('services');\n\n /* Updating old services and adding new services */\n foreach ($new_services as $new_service) {\n if($this->validateArrayElement($new_service, 'string')) {\n $service_exist = false;\n foreach ($old_services as $old_service) {\n if($old_service['original']['pivot_service_id'] == $new_service) {\n $service_exist = true;\n $event->services()->updateExistingPivot($old_service->id, array('deleted_at' => NULL));\n break;\n }\n }\n if(!$service_exist) {\n $data_services = array(\n 'start_service' => Input::get('start_day'),\n 'end_service' => Input::get('end_day'),\n );\n\n $event->services()->attach($new_service, $data_services);\n }\n }\n else {\n return Redirect::to('dashboard')\n ->with('alert', 'Los servicios actualizados no son válidos')\n ->with('FORM_ENABLED','true')\n ->with('action','edit')\n ->withInput();\n }\n }\n\n /* Sending email to all boss that have relation with the services */\n $departments_sended_mail = array();\n foreach ($event->services()->wherePivot('deleted_at', '=', NULL)->get() as $service) {\n /* Getting the departments associated to the services */\n $department = $service->department()->first();\n\n if(!in_array($department->id, $departments_sended_mail)) {\n /* Getting the users associated to a department that they are bosses */\n $bosses = $department->users()->where('user_type_id', '=', 3)->where('status', '=', 1)->get();\n\n if($bosses->isEmpty()) {\n /* Getting the admin users */\n $admins = User::where('user_type_id', '=', 4)->where('status', '=', 1)->get();\n\n /* Sending email to admins */\n foreach ($admins as $admin) {\n Mail::send('emails.notification.editeventnoboss',\n array(\n 'event' => $event->name,\n 'department' => $department->name,\n ),\n function($message) use($admin) {\n $message->to($admin->email)->subject('Evento editado (Revisar detalle) - DCI');\n }\n\n );\n }\n }\n else {\n /* Sending email to bosses */\n foreach ($bosses as $boss) {\n Mail::send('emails.notification.editevent',\n array(\n 'event' => $event->name,\n ),\n function($message) use($boss) {\n $message->to($boss->email)->subject('Evento editado - DCI');\n }\n\n );\n }\n }\n\n array_push($departments_sended_mail, $department->id);\n }\n }\n\n /* Updating support material to the event */\n $support_materials_aux = Input::get('support_materials');\n $new_support_materials = empty($support_materials_aux) ? array() : Input::get('support_materials');\n $old_support_materials = $event->support_materials()->get();\n\n /* Soft deleting to files deleted by user */\n foreach ($old_support_materials as $old_support_material) {\n if(!in_array($old_support_material->file, $new_support_materials)) {\n $old_support_material->delete();\n }\n }\n\n /* Inserting new files added by user */\n if(Input::hasFile('files')) {\n $files = Input::file('files');\n\n foreach ($files as $file) {\n $new_name = str_random(20).'.'.$file->getClientOriginalExtension();\n $file->move('./support_materials', $new_name);\n\n $support_material_data = array(\n 'original_name' => $file->getClientOriginalName(),\n 'file' => 'support_materials/'.$new_name,\n );\n\n $support_material = new SupportMaterial($support_material_data);\n $event->support_materials()->save($support_material);\n }\n }\n\n }\n\n if(Input::has('resources_sources')) {\n\n /* Getting new resources sources to the event */\n $new_resources_sources = Input::get('resources_sources');\n\n /* Updating old resources sources and adding new resources sources */\n foreach ($new_resources_sources as $new_resource_source) {\n if($this->validateArrayElement($new_resource_source, 'string')) {\n $resource_source_exist = false;\n foreach ($old_resources_sources as $old_resource_source) {\n if($old_resource_source['original']['pivot_resource_source_id'] == $new_resource_source) {\n $resource_source_exist = true;\n $event->resources_sources()->updateExistingPivot($old_resource_source->id, array('deleted_at' => NULL));\n break;\n }\n }\n if(!$resource_source_exist) {\n $event->resources_sources()->attach($new_resource_source);\n }\n }\n else {\n return Redirect::to('dashboard')\n ->with('alert', 'Las fuentes de recursos actualizadas no son válidas')\n ->with('FORM_ENABLED','true')\n ->with('action','edit')\n ->withInput();\n }\n }\n\n }\n\n if(Input::has('witnesses')) {\n\n /* Getting new resources sources to the event */\n $new_witnesses = Input::get('witnesses');\n\n /* Updating old resources sources and adding new resources sources */\n foreach ($new_witnesses as $new_witness) {\n if($this->validateArrayElement($new_witness, 'string')) {\n $witnesses_exist = false;\n foreach ($old_witnesses as $old_witness) {\n if($old_witness['original']['pivot_witness_id'] == $new_witness) {\n $witnesses_exist = true;\n $event->witnesses()->updateExistingPivot($old_witness->id, array('deleted_at' => NULL));\n break;\n }\n }\n if(!$witnesses_exist) {\n $event->witnesses()->attach($new_witness);\n }\n }\n else {\n return Redirect::to('dashboard')\n ->with('alert', 'Los testigos actualizados no son válidos')\n ->with('FORM_ENABLED','true')\n ->with('action','edit')\n ->withInput();\n }\n }\n }\n\n if(Input::has('pdi_programs')) {\n\n /*Getting new PDI programs to the event*/\n $new_pdi_programs = Input::get('pdi_programs');\n\n /* Updating old PDI programs and adding new PDI programs */\n foreach ($new_pdi_programs as $new_pdi_program) {\n if($this->validateArrayElement($new_pdi_program, 'string')) {\n $pdi_programs_exist = false;\n foreach ($old_pdi_programs as $old_pdi_program) {\n if($old_pdi_program['original']['pivot_pdi_program_id'] == $new_pdi_program) {\n $pdi_programs_exist = true;\n $event->pdi_programs()->updateExistingPivot($old_pdi_program->id, array('deleted_at' => NULL));\n break;\n }\n }\n if(!$pdi_programs_exist) {\n $event->pdi_programs()->attach($new_pdi_program);\n }\n }\n else {\n return Redirect::to('dashboard')\n ->with('alert', 'Los testigos actualizados no son válidos')\n ->with('FORM_ENABLED','true')\n ->with('action','edit')\n ->withInput();\n }\n }\n\n }\n\n return Redirect::to('dashboard')->with('alert', 'Evento editado exitosamente ' . $event->id_dci);\n\n }",
"function edit()\n\t{\n\t\t$db = JFactory::getDbo();\n\t\t\n\t\tif ($_SERVER['REQUEST_METHOD'] == \"GET\") {\n\t\t\t\n\t\t\t//render the edit form\n\t\t\t$view = $this->getView('manage','html');\n\t\t\t\n\t\t\t//load data\n\t\t\t$db->setQuery('select * from #__shbesuche_config');\n\t\t\t$view->config = $db->loadObject();\n\t\t\t$db->setQuery('select * from #__pbbooking_events where id = '.$db->escape(JRequest::getInt('id')));\n\t\t\t$view->event = $db->loadObject();\n\t\t\t$db->setQuery('select * from #__pbbooking_treatments');\n\t\t\t$view->services = $db->loadObjectList();\n\t\t\t$db->setQuery('select * from #__pbbooking_cals');\n\t\t\t$view->cals = $db->loadObjectList();\n\t\t\tif ($view->config->consolidated_view == 1) { \n\t\t\t\t$db->setQuery('select * from #__pbbooking_cals where out_cal = 1');\n\t\t\t\t$view->outcal = $db->loadObject();\n\t\t\t}\n\t\t\t//sort out openign and closing times\n\t\t\t$opening_hours = json_decode($view->config->trading_hours,true);\n\t\t\t$opening_time_arr = str_split($opening_hours[date_create($view->event->dtstart, new DateTimeZone(SHBESUCHE_TIMEZONE))->format('w')]['open_time'],2);\n\t\t\t$closing_time_arr = str_split($opening_hours[date_create($view->event->dtstart, new DateTimeZone(SHBESUCHE_TIMEZONE))->format('w')]['close_time'],2);\n\t\t\t$view->dt_start = date_create($view->event->dtstart,new DateTimeZone(SHBESUCHE_TIMEZONE));\n\t\t\t$view->dt_end = date_create($view->event->dtstart,new DateTimeZone(SHBESUCHE_TIMEZONE));\n\t\t\t$view->dt_start->setTime($opening_time_arr[0],$opening_time_arr[1]);\n\t\t\t$view->dt_end->setTime($closing_time_arr[0],$closing_time_arr[1]);\n\t\t\t\n\t\t\t//display the view\n\t\t\t$view->setLayout('edit_event');\n\t\t\tJToolbarHelper::save('edit',Jtext::_('COM_SHBESUCHE_SAVE_CHANGES'));\n\t\t\tJToolbarHelper::trash('delete',Jtext::_('COM_SHBESUCHE_DELETE_EVENT'),false);\n\t\t\tJToolbarHelper::custom('view_ical','view_ics','',Jtext::_('COM_SHBESUCHE_VIEW_ICS'),false);\n\t\t\tJToolbarHelper::cancel();\n\t\t\t$view->display();\n\t\t}\n\t\t\n\t\tif ($_SERVER['REQUEST_METHOD'] == \"POST\") {\n\t\t\t$db->setQuery('select * from #__pbbooking_events where id = '.$db->escape(JRequest::getInt('id')));\n\t\t\t$event = $db->loadObject();\n\t\t\t$db->setQuery('select * from #__pbbooking_treatments where id = '.$db->escape($event->service_id));\n\t\t\t$service = $db->loadObject();\n\t\t\t\n\t\t\t$treatment_time = JRequest::getVar('treatment-time');\n\t\t\t$times_arr = str_split($treatment_time,2);\n\t\t\t$dtstart = date_create(JRequest::getVar('date'),new DateTimeZone(SHBESUCHE_TIMEZONE));\n\t\t\t$dtstart->setTime((int)ltrim($times_arr[0],'0'),(int)ltrim($times_arr[1],'0'),0);\n\t\t\t$dtend = date_create($dtstart->format(DATE_ATOM),new DateTimeZone(SHBESUCHE_TIMEZONE));\n\t\t\t$dtend->modify('+'.$service->duration.' minutes');\n\t\t\t\n\t\t\t$event->summary = JRequest::getVar('summary');\n\t\t\t$event->description = JRequest::getVar('description');\n\t\t\t$event->dtstart = $dtstart->format('Y-m-d H:i:s');\n\t\t\t$event->dtend = $dtend->format('Y-m-d H:i:s');\n\n\n\t\t\tif ((int)$_POST['reccur'] == 1) {\n\t\t\t\t$event->r_int = JRequest::getVar('interval');\n\t\t\t\t$event->r_freq = JRequest::getVar('frequency');\n\t\t\t\t$event->r_end = JRequest::getVar('recur_end');\n \t\t\t}\t\n\n\t\t\tif (isset($_POST['cal_id'])) $event->cal_id = JRequest::getInt('cal_id');\n\t\t\tif ($db->updateObject('#__pbbooking_events',$event,'id')) {\n\t\t\t\t$this->setRedirect('index.php?option=com_pbbooking&controller=manage&date='.JRequest::getVar('date'),Jtext::_('COM_SHBESUCHE_EDIT_SUCCESS'));\n\t\t\t} else {\n\t\t\t\techo $db->getErrorMsg();\n\t\t\t}\n\t\t\t\n\t\t}\n\t\n\t}",
"public function process()\n\t{\n\t\tPhpfox::isUser(true);\n\t\tPhpfox::getUserParam('event.can_create_event', true);\n\t\t\n\t\t$bIsEdit = false;\n\t\t$bIsSetup = ($this->request()->get('req4') == 'setup' ? true : false);\n\t\t$sAction = $this->request()->get('req3');\n\t\t$aCallback = false;\t\t\n\t\t$sModule = $this->request()->get('module', false);\n\t\t$iItem = $this->request()->getInt('item', false);\n\t\t\n\t\tif ($iEditId = $this->request()->get('id'))\n\t\t{\n\t\t\tif (($aEvent = Phpfox::getService('event')->getForEdit($iEditId)))\n\t\t\t{\n\t\t\t\t$bIsEdit = true;\n\t\t\t\t$this->setParam('aEvent', $aEvent);\n\t\t\t\t$this->setParam(array(\n\t\t\t\t\t\t'country_child_value' => $aEvent['country_iso'],\n\t\t\t\t\t\t'country_child_id' => $aEvent['country_child_id']\n\t\t\t\t\t)\n\t\t\t\t);\t\t\t\t\n\t\t\t\t$this->template()->setHeader(array(\n\t\t\t\t\t\t\t'<script type=\"text/javascript\">$Behavior.eventEditCategory = function(){ var aCategories = explode(\\',\\', \\'' . $aEvent['categories'] . '\\'); for (i in aCategories) { $(\\'#js_mp_holder_\\' + aCategories[i]).show(); $(\\'#js_mp_category_item_\\' + aCategories[i]).attr(\\'selected\\', true); } }</script>'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t\t->assign(array(\n\t\t\t\t\t\t'aForms' => $aEvent,\n\t\t\t\t\t\t'aEvent' => $aEvent\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\t\n\t\t\t\tif ($aEvent['module_id'] != 'event')\n\t\t\t\t{\n\t\t\t\t\t$sModule = $aEvent['module_id'];\n\t\t\t\t\t$iItem = $aEvent['item_id'];\t\n\t\t\t\t}\n\t\t\t}\n\t\t}\t\t\n\t\t\n\t\tif ($sModule && $iItem && Phpfox::hasCallback($sModule, 'viewEvent'))\n\t\t{\n\t\t\t$aCallback = Phpfox::callback($sModule . '.viewEvent', $iItem);\t\t\n\t\t\t$this->template()->setBreadcrumb($aCallback['breadcrumb_title'], $aCallback['breadcrumb_home']);\n\t\t\t$this->template()->setBreadcrumb($aCallback['title'], $aCallback['url_home']);\t\t\n\t\t\tif ($sModule == 'pages' && !Phpfox::getService('pages')->hasPerm($iItem, 'event.share_events'))\n\t\t\t{\n\t\t\t\treturn Phpfox_Error::display(Phpfox::getPhrase('event.unable_to_view_this_item_due_to_privacy_settings'));\n\t\t\t}\t\t\t\t\n\t\t}\t\t\n\t\t\n\t\t$aValidation = array(\n\t\t\t'title' => Phpfox::getPhrase('event.provide_a_name_for_this_event'),\n\t\t\t// 'country_iso' => Phpfox::getPhrase('event.provide_a_country_location_for_this_event'),\t\t\t\n\t\t\t'location' => Phpfox::getPhrase('event.provide_a_location_for_this_event')\n\t\t);\n\t\t\n\t\t$oValidator = Phpfox::getLib('validator')->set(array(\n\t\t\t\t'sFormName' => 'js_event_form',\n\t\t\t\t'aParams' => $aValidation\n\t\t\t)\n\t\t);\t\t\n\t\t\n\t\tif ($aVals = $this->request()->get('val'))\n\t\t{\n\t\t\tif ($oValidator->isValid($aVals))\n\t\t\t{\t\t\t\t\n\t\t\t\tif ($bIsEdit)\n\t\t\t\t{\n\t\t\t\t\tif (Phpfox::getService('event.process')->update($aEvent['event_id'], $aVals, $aEvent))\n\t\t\t\t\t{\n\t\t\t\t\t\tswitch ($sAction)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tcase 'customize':\n\t\t\t\t\t\t\t\t$this->url()->send('event.add.invite.setup', array('id' => $aEvent['event_id']), Phpfox::getPhrase('event.successfully_added_a_photo_to_your_event'));\t\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tcase 'invite':\n\t\t\t\t\t\t\t\t$this->url()->permalink('event', $aEvent['event_id'], $aEvent['title'], true, Phpfox::getPhrase('event.successfully_invited_guests_to_this_event'));\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t$this->url()->send('event.add', array('id' => $aEvent['event_id']), Phpfox::getPhrase('event.event_successfully_updated'));\t\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\t\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$aVals['event_id'] = $aEvent['event_id'];\n\t\t\t\t\t\t$this->template()->assign(array('aForms' => $aVals, 'aEvent' => $aVals));\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\tif (($iFlood = Phpfox::getUserParam('event.flood_control_events')) !== 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$aFlood = array(\n\t\t\t\t\t\t\t'action' => 'last_post', // The SPAM action\n\t\t\t\t\t\t\t'params' => array(\n\t\t\t\t\t\t\t\t'field' => 'time_stamp', // The time stamp field\n\t\t\t\t\t\t\t\t'table' => Phpfox::getT('event'), // Database table we plan to check\n\t\t\t\t\t\t\t\t'condition' => 'user_id = ' . Phpfox::getUserId(), // Database WHERE query\n\t\t\t\t\t\t\t\t'time_stamp' => $iFlood * 60 // Seconds);\t\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\t \t\t\t\n\t\t\t\t\t\t// actually check if flooding\n\t\t\t\t\t\tif (Phpfox::getLib('spam')->check($aFlood))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tPhpfox_Error::set(Phpfox::getPhrase('event.you_are_creating_an_event_a_little_too_soon') . ' ' . Phpfox::getLib('spam')->getWaitTime());\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\tif (Phpfox_Error::isPassed())\n\t\t\t\t\t{\t\n\t\t\t\t\t\tif ($iId = Phpfox::getService('event.process')->add($aVals, ($aCallback !== false ? $sModule : 'event'), ($aCallback !== false ? $iItem : 0)))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$aEvent = Phpfox::getService('event')->getForEdit($iId);\n\t\t\t\t\t\t\t$this->url()->permalink('event', $aEvent['event_id'], $aEvent['title'], true, Phpfox::getPhrase('event.event_successfully_added'));\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$sStep = (isset($aVals['step']) ? $aVals['step'] : '');\n\t\t\t$sAction = (isset($aVals['action']) ? $aVals['action'] : '');\t\n\t\t\t$this->template()->assign('aForms', $aVals);\t\t\n\t\t}\t\t\n\t\t\n\t\tif ($bIsEdit)\n\t\t{\n\t\t\t$aMenus = array(\n\t\t\t\t'detail' => Phpfox::getPhrase('event.event_details'),\n\t\t\t\t'customize' => Phpfox::getPhrase('event.photo'),\n\t\t\t\t'invite' => Phpfox::getPhrase('event.invite_guests')\n\t\t\t);\n\t\t\t// Dont show the photo upload for iOS\n\t\t\tif ($this->request()->isIOS())\n\t\t\t{\n\t\t\t\tunset($aMenus['customize']);\n\t\t\t}\n\t\t\tif (!$bIsSetup)\n\t\t\t{\n\t\t\t\t$aMenus['manage'] = Phpfox::getPhrase('event.manage_guest_list');\n\t\t\t\t$aMenus['email'] = Phpfox::getPhrase('event.mass_email');\n\t\t\t}\n\t\t\t\n\t\t\t$this->template()->buildPageMenu('js_event_block', \n\t\t\t\t$aMenus,\n\t\t\t\tarray(\n\t\t\t\t\t'link' => $this->url()->permalink('event', $aEvent['event_id'], $aEvent['title']),\n\t\t\t\t\t'phrase' => Phpfox::getPhrase('event.view_this_event')\n\t\t\t\t)\t\t\t\t\n\t\t\t);\t\t\n\t\t}\n\t\t\n\t\t$this->template()->setTitle(($bIsEdit ? Phpfox::getPhrase('event.managing_event') . ': ' . $aEvent['title'] : Phpfox::getPhrase('event.create_an_event')))\n\t\t\t->setFullSite()\t\t\t\n\t\t\t->setBreadcrumb(Phpfox::getPhrase('event.events'), ($aCallback === false ? $this->url()->makeUrl('event') : $this->url()->makeUrl($aCallback['url_home_pages'])))\n\t\t\t->setBreadcrumb(($bIsEdit ? Phpfox::getPhrase('event.managing_event') . ': ' . $aEvent['title'] : Phpfox::getPhrase('event.create_new_event')), ($bIsEdit ? $this->url()->makeUrl('event.add', array('id' => $aEvent['event_id'])) : $this->url()->makeUrl('event.add')), true)\n\t\t\t->setEditor()\n\t\t\t->setPhrase(array(\n\t\t\t\t\t'core.select_a_file_to_upload'\n\t\t\t\t)\n\t\t\t)\t\t\t\t\n\t\t\t->setHeader('cache', array(\t\n\t\t\t\t\t'add.js' => 'module_event',\n\t\t\t\t\t'pager.css' => 'style_css',\n\t\t\t\t\t'progress.js' => 'static_script',\t\t\t\t\t\n\t\t\t\t\t'country.js' => 'module_core'\t\t\t\t\t\n\t\t\t\t)\n\t\t\t)\t\t\t\n\t\t\t->setHeader(array(\n\t\t\t\t\t'<script type=\"text/javascript\">$Behavior.eventProgressBarSettings = function(){ if ($Core.exists(\\'#js_event_block_customize_holder\\')) { oProgressBar = {holder: \\'#js_event_block_customize_holder\\', progress_id: \\'#js_progress_bar\\', uploader: \\'#js_progress_uploader\\', add_more: false, max_upload: 1, total: 1, frame_id: \\'js_upload_frame\\', file_id: \\'image\\'}; $Core.progressBarInit(); } }</script>'\n\t\t\t\t)\n\t\t\t)\n\t\t\t->assign(array(\n\t\t\t\t\t'sCreateJs' => $oValidator->createJS(),\n\t\t\t\t\t'sGetJsForm' => $oValidator->getJsForm(false),\n\t\t\t\t\t'bIsEdit' => $bIsEdit,\n\t\t\t\t\t'bIsSetup' => $bIsSetup,\n\t\t\t\t\t'sCategories' => Phpfox::getService('event.category')->get(),\n\t\t\t\t\t'sModule' => ($aCallback !== false ? $sModule : ''),\n\t\t\t\t\t'iItem' => ($aCallback !== false ? $iItem : ''),\n\t\t\t\t\t'aCallback' => $aCallback,\n\t\t\t\t\t'iMaxFileSize' => (Phpfox::getUserParam('event.max_upload_size_event') === 0 ? null : Phpfox::getLib('phpfox.file')->filesize((Phpfox::getUserParam('event.max_upload_size_event') / 1024) * 1048576)),\n\t\t\t\t\t'bCanSendEmails' => ($bIsEdit ? Phpfox::getService('event')->canSendEmails($aEvent['event_id']) : false),\n\t\t\t\t\t'iCanSendEmailsTime' => ($bIsEdit ? Phpfox::getService('event')->getTimeLeft($aEvent['event_id']) : false),\n\t\t\t\t\t'sJsEventAddCommand' => (isset($aEvent['event_id']) ? \"if (confirm('\" . Phpfox::getPhrase('event.are_you_sure', array('phpfox_squote' => true)) . \"')) { $('#js_submit_upload_image').show(); $('#js_event_upload_image').show(); $('#js_event_current_image').remove(); $.ajaxCall('event.deleteImage', 'id={$aEvent['event_id']}'); } return false;\" : ''),\n\t\t\t\t\t'sTimeSeparator' => Phpfox::getPhrase('event.time_separator')\n\t\t\t\t)\n\t\t\t);\t\t\n\t}",
"function BeforeEdit(&$values, $where, &$oldvalues, &$keys, &$message, $inline, &$pageObject)\n{\n\n\t\t$ret = true;\ncalendar_tempValidateEvent($values, $ret, $message);\n\n$values[\"OwnerID\"]=$_SESSION[\"UserID\"];\n\n\nreturn $ret;\n;\t\t\n}",
"public function edit(Event $event)\n {\n //dd($events);\n // return view('events.edit',['events'=>$event]);\n \n }",
"public function showEvent()\n {\n switch($this->logo){\n case 'default':\n $logo = '<img src=\"public/img/default/event.png\" alt=\"WorldEsport logo\">';\n break;\n default:\n $logo = '<img src=\"inc/img/imgempevents.php?imgname='. $this->logo .'&u='. $this->currentUser->pk_iduser .'\" alt=\"WorldEsport employee events logo\">';\n }\n\n //test de la presence de description ou non\n switch($this->description){\n case true:\n $description = '<div class=\"info-line collapse\" id=\"collapse'. substr(str_replace($this->unauthorizedChar,'',$this->name),0,15) . str_replace($this->unauthorizedChar,'',$this->startdate) .'\">\n <p class=\"info-decription\">' . $this->description . '</p>\n </div>';\n $btcollapse = '<div class=\"bt-more-container\">\n <button class=\"share-button bt\" data-toggle=\"collapse\" href=\"#collapse'. substr(str_replace($this->unauthorizedChar,'',$this->name),0,15) . str_replace($this->unauthorizedChar,'',$this->startdate) .'\">\n '. $this->langFile[$this->pageName]->bt_myprofile_gamer_moredetails .'\n </button>\n </div>';\n break;\n default:\n $description = '<div class=\"info-line collapse\">\n <p class=\"info-decription\">' . $this->description . '</p>\n </div>';\n $btcollapse = '';\n }\n\n $content = ' <div class=\"profile-elem profil-event-container col-md-12\" data-elem=\"'.$this->id.'\">\n <div class=\"profile-aside-container\">\n <div class=\"loader-container loader-elem-bloc loader-profile-elem\">\n <div class=\"loader-double-container\">\n <span class=\"loader loader-double\">\n </span>\n </div>\n </div>\n <div class=\"edit-container\">\n <div class=\"edit-ico-container\">\n <div class=\"edit-gear edit-profile-bloc-elem ico-gear\"></div> \n </div>\n <div class=\"edit-options\">\n \n </div>\n </div>\n <div class=\"profile-bloc-elem-left col-md-9\">\n <div class=\"infos-container col-md-12\">\n <div class=\"info-line\">\n <p class=\"info\">'. $this->name .'</p>\n </div>\n <div class=\"info-line\">\n <p class=\"info\">'. $this->jobtitle .' '. $this->langGenerals->word_at .' </p><p class=\"info\">'. $this->company .'</p>\n </div> \n <div class=\"info-line\">\n <p class=\"info\">' . $this->dayStart . ' ' . $this->monthStart . ' ' . $this->yearStart . ' - </p><p class=\"info\">' . $this->dayEnd . ' ' . $this->monthEnd . ' ' . $this->yearEnd . '</p>\n </div>\n '. $description .' \n </div> \n '. $btcollapse .' \n </div> \n <div class=\"profile-bloc-elem-right col-md-3\">\n <div class=\"pic\">\n '. $logo .'\n </div>\n </div>\n </div> \n </div>';\n\n return $content;\n }",
"function loadEditEvent($evID) {\n $event = Event::find($evID);\n if ($event == null) {\n return view('cms.error', ['message' => 'Event not found!']);\n }\n $places = Place::all(['placeID', 'title_en']);\n $categories = Category::all(['ctgID', 'name_en']);\n return view('cms.events.create.event', ['event' => $event, 'places' => $places, 'categories' => $categories]);\n }",
"function edit($tpl = null)\n\t{\n\t\tHTMLHelper::_('jquery.framework');\n\t\t\n\t\t$app = Factory::getApplication();\n\t\t$input = $app->input;\n\n\t\t$document = Factory::getDocument();\n\t\t$user = Factory::getUser();\n\n\t\t// Set editstrings var just in case and to avoid IDE reporting not set.\n\t\t$editStrings = \"\";\n\t\tinclude(JEV_ADMINLIBS . \"/editStrings.php\");\n\t\t$document->addScriptDeclaration($editStrings);\n\n\t\tJEVHelper::script('editicalJQ.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/');\n\t\t$params = ComponentHelper::getParams(JEV_COM_COMPONENT);\n\t\tif (!GSLMSIE10 && $params->get(\"newfrontendediting\", 1) == 1)\n\t\t{\n\t\t\tJEVHelper::script('editicalGSL.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/');\n\t\t}\n\t\telse if (!GSLMSIE10 && $params->get(\"newfrontendediting\", 1) == 2)\n\t\t{\n\t\t\tJEVHelper::script('editicalUIKIT.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/');\n\t\t}\n\t\tJEVHelper::script('JevStdRequiredFieldsJQ.js', 'components/' . JEV_COM_COMPONENT . '/assets/js/');\n\n\t\tif (strlen($this->row->title()) > 0)\n\t\t{\n\t\t\t// Set toolbar items for the page\n\t\t\tJToolbarHelper::title(Text::_('EDIT_ICAL_EVENT'), 'jevents');\n\t\t\t$document->setTitle(Text::_('EDIT_ICAL_EVENT'));\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Set toolbar items for the page\n\t\t\tJToolbarHelper::title(Text::_('CREATE_ICAL_EVENT'), 'jevents');\n\t\t\t$document->setTitle(Text::_('CREATE_ICAL_EVENT'));\n\t\t}\n\n\t\t$bar = JToolBar::getInstance('toolbar');\n\n\t\tif ($this->id > 0)\n\t\t{\n\t\t\tif ($this->editCopy)\n\t\t\t{\n\n\t\t\t\tif (JEVHelper::isEventEditor() || JEVHelper::canEditEvent($this->row))\n\t\t\t\t{\n\t\t\t\t\t$this->toolbarConfirmButton(\"icalevent.apply\", Text::_(\"JEV_SAVE_COPY_WARNING\"), 'apply', 'apply', 'JEV_SAVE', false);\n\t\t\t\t}\n\t\t\t\t$this->toolbarConfirmButton(\"icalevent.save\", Text::_(\"JEV_SAVE_COPY_WARNING\"), 'save', 'save', 'JEV_SAVE_CLOSE', false);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif (JEVHelper::isEventEditor() || JEVHelper::canEditEvent($this->row))\n\t\t\t\t{\n\t\t\t\t\t$this->toolbarConfirmButton(\"icalevent.apply\", Text::_(\"JEV_SAVE_ICALEVENT_WARNING\"), 'apply', 'apply', 'JEV_SAVE', false);\n\t\t\t\t}\n\t\t\t\t$this->toolbarConfirmButton(\"icalevent.save\", Text::_(\"JEV_SAVE_ICALEVENT_WARNING\"), 'save', 'save', 'JEV_SAVE_CLOSE', false);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$canEditOwn = false;\n\t\t\t$params = ComponentHelper::getParams(JEV_COM_COMPONENT);\n\t\t\tif (!$params->get(\"authorisedonly\", 0))\n\t\t\t{\n\t\t\t\t$juser = Factory::getUser();\n\t\t\t\t$canEditOwn = $juser->authorise('core.edit.own', 'com_jevents');\n\t\t\t}\n\t\t\telse if (JEVHelper::canEditOwnEventNewEventOnlyCheck())\n\t\t\t{\n\t\t\t\t$canEditOwn = true;\n\t\t\t}\n\t\t\tif (JEVHelper::isEventEditor() || $canEditOwn)\n\t\t\t{\n\t\t\t\t$this->toolbarButton(\"icalevent.apply\", 'apply', 'apply', 'JEV_SAVE', false);\n\t\t\t}\n\t\t\t$this->toolbarButton(\"icalevent.save\", 'save', 'save', 'JEV_SAVE_CLOSE', false);\n\t\t}\n\n\t\t$params = ComponentHelper::getParams(JEV_COM_COMPONENT);\n\n\t\t$evedrd = 'icalevent.edit_cancel';\n\n //Set previous page\n $session = Factory::getSession();\n $sinput = new \\Joomla\\Input\\Input($_SERVER);\n $referer = $sinput->getString('HTTP_REFERER', null);\n $current = Uri::getInstance();\n $current = $current->toString(array('scheme', 'host', 'port', 'path', 'query'));\n if ($referer && $referer !== $current) {\n $session->set('jev_referer', $referer, 'extref');\n }\n\t\telse {\n\t\t\t$session->set('jev_referer', '', 'extref');\n\t\t}\n\t\t$ref = $session->get('jev_referer', 'blank', 'extref');\n\t\t//echo \"ref = $ref $referer $current<br>\";\n\n\t\tif ($params->get(\"editpopup\", 0))\n\t\t{\n\t\t\t$document->addStyleDeclaration(\"div#toolbar-box{margin:10px 10px 0px 10px;} div#jevents {margin:0px 10px 10px 10px;} \");\n\t\t\t$this->toolbarButton(\"icalevent.close\", 'cancel', 'cancel', 'JEV_SUBMITCANCEL', false);\n\t\t\t$input->set('tmpl', 'component'); //force the component template\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($this->id > 0)\n\t\t\t{\n\t\t\t\t$this->toolbarButton(\"icalrepeat.detail\", 'cancel', 'cancel', 'JEV_SUBMITCANCEL', false);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->toolbarButton($evedrd, 'cancel', 'cancel', 'JEV_SUBMITCANCEL', false);\n\t\t\t}\n\t\t}\n\n\t\t// I pass in the rp_id so that I can return to the repeat I was viewing before editing\n\t\t$this->rp_id = $input->getInt(\"rp_id\", 0);\n\n\t\tif (!$params->get(\"newfrontendediting\", 1))\n\t\t{\n\t\t\t$this->_adminStart();\n\t\t}\n\n\t\t// load Joomla javascript classes\n\t\tHTMLHelper::_('behavior.core');\n\t\t$this->setLayout(\"edit\");\n\n\t\tJEVHelper::componentStylesheet($this, \"editextra.css\");\n\t\tjimport('joomla.filesystem.file');\n\n\t\t// Lets check if we have editted before! if not... rename the custom file.\n\t\tif (File::exists(JPATH_SITE . \"/components/com_jevents/assets/css/jevcustom.css\"))\n\t\t{\n\t\t\t// It is definitely now created, lets load it!\n\t\t\tJEVHelper::stylesheet('jevcustom.css', 'components/' . JEV_COM_COMPONENT . '/assets/css/');\n\t\t}\n\n $this->setupEditForm();\n\n\t\tparent::displaytemplate($tpl);\n\n\t\tif (!$params->get(\"newfrontendediting\", 1))\n\t\t{\n \t\t$this->_adminEnd();\n\t\t}\n\t}",
"public function edit() {\n\t\t\t\n\t\t}",
"function admin_edit($id=null) {\n\t\tif (!$id && empty($this->data)) {\n\t\t\t$this->Session->setFlash('Invalid Event to edit');\n\t\t\t$this->redirect(array('action'=>'admin_index'),null,true);\n\t\t} \n\t\tif (!empty($this->data)) {\n\t\t\tif ($this->Event->save($this->data)) {\n\t\t\t\t$this->Session->setFlash('The Event has been saved.');\n\t\t\t\t$this->redirect(array('action'=>'admin_index'),null,true);\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash('Sorry, the Event could not be saved.');\n\t\t\t}\n\t\t}\n\t\tif (empty($this->data)) {\n\t\t\t$this->data = $this->Event->read(null,$id);\n\t\t}\n\t\t$tags = $this->Event->Tag->find('list');\n\t\t$this->set(compact('tags'));\n\t}",
"public function edit(Riesgo_evento $riesgo_evento)\n {\n //\n }",
"protected function editTaskAction() {}",
"public function onAttendeesEdit()\n\t{\n\t\tif ($this->perms->edit)\n\t\t{\n\t\t\tJToolBarHelper::save();\n\t\t}\n\n\t\tJToolBarHelper::cancel();\n\t\t$this->setToolbarTitle('Edit');\n\t}",
"public function pageAdmin()\r\n\t{\r\n\t\t// Donnees\r\n\t\t$eventId = Bn::getValue('event_id');\r\n\t\t$oEvent = new Oevent($eventId);\r\n\t\t$oExtras = new Oeventextra($eventId);\r\n\r\n\t\t// Controle de l'autorisation\r\n\t\tif ( $oEvent->getVal('ownerid') != Bn::getValue('user_id') && !Oaccount::isLoginAdmin() ) return false;\r\n\r\n\t\t// Preparer les champs de saisie\r\n\t\t$body = new Body();\r\n\r\n\t\t// Titres\r\n\t\t$t = $body->addP('', '', 'bn-title-2');\r\n\t\t$t->addBalise('span', '', LOC_ITEM_GENERAL);\r\n\r\n\t\t// Infos generales\r\n\t\t$form = $body->addForm('frmAdmin', BPREF_UPDATE_ADMIN, 'targetDlg');\r\n\t\t$form->getForm()->addMetadata('success', \"updated\");\r\n\t\t$form->getForm()->addMetadata('dataType', \"'json'\");\r\n\r\n\t\t$div = $form->addDiv('', 'bn-div-left');\r\n\t\t$edt = $div->addEdit('nameevent', LOC_LABEL_EVENT_NAME, $oEvent->getVal('name'), 255);\r\n\t\t$edt->tooltip(LOC_TOOLTIP_EVENT_NAME);\r\n\r\n\t\t$edt = $div->addEdit('place', LOC_LABEL_EVENT_PLACE, $oEvent->getVal('place'), 25);\r\n\t\t$edt->tooltip(LOC_TOOLTIP_EVENT_PLACE);\r\n\r\n\t\t$edt = $div->addEdit('dateevent', LOC_LABEL_EVENT_DATE, $oEvent->getVal('date'), 25);\r\n\t\t$edt->tooltip(LOC_TOOLTIP_EVENT_DATE);\r\n\r\n\t\t$edt = $div->addEdit('numauto', LOC_LABEL_EVENT_NUMAUTO, $oEvent->getVal('numauto'), 50);\r\n\r\n\t\t$edt = $div->addEdit('organizer', LOC_LABEL_EVENT_ORGANIZER, $oEvent->getVal('organizer'), 75);\r\n\t\t$edt->noMandatory();\r\n\t\t//$edt->tooltip(LOC_TOOLTIP_EVENT_ORGANIZER);\r\n\r\n\t\t/* Region */\r\n\t\t$cbo = $div->addSelect('regionid', LOC_LABEL_EVENT_REGION);\r\n\t\t//$cbo->tooltip(LOC_TOOLTIP_EVENT_REGION);\r\n\t\t$regs = Ogeo::getRegions(-1, LOC_LABEL_SELECT_REGION);\r\n\t\t$cbo->addOptions($regs, $oExtras->getVal('regionid'));\r\n\r\n\t\t/* Departement */\r\n\t\t$cbo = $div->addSelect('deptid', LOC_LABEL_EVENT_DPT);\r\n\t\t//$cbo->tooltip(LOC_TOOLTIP_EVENT_DPT);\r\n\t\t$codeps = Ogeo::getDepts(-1, LOC_LABEL_SELECT_DPT);\r\n\t\t$cbo->addOptions($codeps, $oExtras->getVal('deptid'));\r\n\r\n\t\t$d = $div->addDiv('', 'bn-div-line');\r\n\t\t$edt = $d->addEditDate('firstday', LOC_LABEL_EVENT_FIRSTDAY, Bn::date($oEvent->getVal('firstday'), 'd-m-Y'));\r\n\t\t$edt->addOption('onSelect', 'selectFirstDay');\r\n\t\t$edt->addOption('maxDate', 'new Date(' . Bn::date($oEvent->getVal('lastday'), 'Y,m-1,d') .')');\r\n\t\t$edt = $d->addEditDate('lastday', LOC_LABEL_EVENT_LASTDAY, Bn::date($oEvent->getVal('lastday'), 'd-m-Y'));\r\n\t\t$edt->addOption('onSelect', 'selectLastDay');\r\n\t\t$edt->addOption('minDate', 'new Date(' . Bn::date($oEvent->getVal('firstday'), 'Y,m-1,d') .')');\r\n\r\n\t\t$d->addBreak();\r\n\r\n\t\t$d = $form->addDiv('', 'bn-div-btn');\r\n\t\t$d->addButtonValid('', LOC_BTN_UPDATE);\r\n\r\n\t\t// Envoi au navigateur\r\n\t\t$body->display();\r\n\t\treturn false;\r\n\t}",
"function OnBeforeEdit(){\n }",
"function event__add_edit_event($type, $event, $id = null)\n {\n $_next_day = date('n/j/Y', strtotime($event['start_date'] . ' +1 day'));\n if (empty($event['end_date']))\n {\n if (empty($event['end_time']))\n {\n $event['end_date'] = (empty($event['start_time']) ? $_next_day : $event['start_date']);\n }\n else\n {\n $event['end_date'] = $event['start_date'];\n }\n }\n if (empty($event['start_time'])) $event['start_time'] = '12 am';\n if (empty($event['end_time'])) $event['end_time'] = $event['start_time'];\n\n // Manipulate dates based on checkbox states\n if (!empty($event['no_end_date']))\n {\n $event['end_date'] = (!empty($event['all_day_event']) ? $_next_day : $event['start_date']);\n $event['end_time'] = $event['start_time'];\n }\n elseif (!empty($event['all_day_event']))\n {\n $event['end_date'] = (!empty($event['end_date']) ? $event['end_date'] : $_next_day);\n $event['end_time'] = '12 am';\n }\n $event['date_start'] = date('Y-m-d H:i:s', strtotime($event['start_date'] . ' ' . $event['start_time']));\n $event['date_end'] = date('Y-m-d H:i:s', strtotime($event['end_date'] . ' ' . $event['end_time']));\n unset($event['start_date']);\n unset($event['start_time']);\n unset($event['end_date']);\n unset($event['end_time']);\n\n // Correct for blank latitude/longitude\n if (empty($event['latitude'])) $event['latitude'] = null;\n if (empty($event['longitude'])) $event['longitude'] = null;\n\n // Change '-' to null\n if ($event['status'] == '-') $event['status'] = null;\n\n // Add recordkeeping fields\n $event['date_last_updated'] = date('Y-m-d H:i:s');\n $event['last_updated_by'] = $this->session->userdata('member_id');\n\n // Initialize return variable (null for calls as void function)\n $return = null;\n\n // Determine database calls and some event values based on type\n switch ($type)\n {\n case 'edit':\n // Boolean fields\n if (empty($event['all_day_event'])) $event['all_day_event'] = 0;\n if (empty($event['multiday_event'])) $event['multiday_event'] = 0;\n if (empty($event['rsvp_only'])) $event['rsvp_only'] = 0;\n if (empty($event['hide_address'])) $event['hide_address'] = 0;\n\n // Update event in database\n $this->db->where('id', $id);\n $this->db->update('events', $event);\n\n break;\n case 'add':\n default:\n // Creation recordkeeping\n $event['date_added'] = date('Y-m-d H:i:s');\n $event['added_by'] = $this->session->userdata('member_id');\n\n // Add slug\n $event['slug'] = url_title($event['name'], '-', true);\n\n // Add event to database\n $this->db->insert('events', $event);\n\n // Set return variable to insert ID\n $return = $this->db->insert_id();\n\n break;\n }\n\n // Return insert ID\n return $return;\n }",
"public function edit(Event $event)\n {\n if(auth()->user()->isAdmin())\n {\n\n }else{\n return redirect()->back();\n }\n }",
"public function edit( )\r\n {\r\n //\r\n }",
"public function edit()\n\t{\n\t\t\n\t}",
"public function edit(Event $event)\n {\n if ($event->user_id == Auth::id() or Auth::user() == \"admin\") {\n return view(\"admin.event_edit\")->with([\n \"event\" => $event\n ]);\n }else{\n return redirect(route(\"event.index\"))->withErrors([\n \"alert\" => \"No permission!\",\n \"alert_message\" => \"You are not allowed to edit this event\"\n ])->withInput();\n }\n }",
"protected function edit(array $data, $event)\n { \n $user = Auth::user();\n \n $event->date = $data['date'];\n $event->reservations = $data['reservations']; \n $event->placeID = $data['place'];\n \n $event->article->title_en = $data['title_en'];\n $event->article->title_sr = $data['title_sr'];\n $event->article->description_en = $data['description_en'];\n $event->article->description_sr = $data['description_sr'];\n $event->article->updated_at = Carbon::now();\n $event->article->userID = $user->userID;\n $event->article->ctgID = $data['category'];\n \n $event->article->save();\n $event->save();\n \n return $event;\n }",
"public function edit(Event $event)\n { \n // $event = Event::findOrFail($id);\n return view('events.edit',compact('event'));\n }",
"public function onEdit($param)\n {\n try\n {\n if (isset($param['key']))\n {\n // get the parameter $key\n $key=$param['key'];\n \n // open a transaction with database 'samples'\n TTransaction::open('samples');\n \n // instantiates object CalendarEvent\n $object = new CalendarEvent($key);\n \n $data = new stdClass;\n $data->id = $object->id;\n $data->color = $object->color;\n $data->title = $object->title;\n $data->description = $object->description;\n $data->start_date = substr($object->start_time,0,10);\n $data->start_hour = substr($object->start_time,11,2);\n $data->start_minute = substr($object->start_time,14,2);\n $data->end_date = substr($object->end_time,0,10);\n $data->end_hour = substr($object->end_time,11,2);\n $data->end_minute = substr($object->end_time,14,2);\n $data->view = $param['view'];\n \n // fill the form with the active record data\n $this->form->setData($data);\n \n // close the transaction\n TTransaction::close();\n }\n else\n {\n $this->form->clear();\n }\n }\n catch (Exception $e) // in case of exception\n {\n // shows the exception error message\n new TMessage('error', $e->getMessage());\n \n // undo all pending operations\n TTransaction::rollback();\n }\n }",
"function BeforeEdit(&$values, $where, &$oldvalues, &$keys, &$message, $inline, &$pageObject)\n{\n\n\t\t\n\n$fh=$values[\"FirstHalf\"];\n$sh=$values[\"SecondHalf\"];\n$fd=$values[\"FromDate\"];\n$td=$values[\"ToDate\"];\n\n$fd1=strtotime($fd);\n$td1= strtotime($td);\n\nif ($fd1>$td1) {\n\n$message = \"FromDate should be equal less than ToDate.\";\n\n$message;\n\nreturn false;\n\n\n}\n\n\nelseif ($fh!=1 and $sh!=1) {\n\n$message = \"Please select one or both FirstHalf or SecondHalf\";\n\n$message;\n\nreturn false;\n\n}\n\nelse\n{\nreturn True;\n};\n\n\n\n\n// Place event code here.\n// Use \"Add Action\" button to add code snippets.\n\n\n;\t\t\n}",
"public function getEventedit($id , $values = array() , $message = \"\");",
"public function editAction() {}",
"public function updateAdmin()\r\n\t{\r\n\t\t// Donnees\r\n\t\t$eventId = Bn::getValue('event_id');\r\n\t\t$oEvent = new Oevent($eventId);\r\n\t\t// Controle de l'autorisation\r\n\t\tif ( $oEvent->getVal('ownerid') != Bn::getValue('user_id') && !Oaccount::isLoginAdmin() ) return false;\r\n\r\n\t\t// Donnees du tournoi\r\n\t\t$oEvent->setVal('name', Bn::getValue('nameevent'));\r\n\t\t$oEvent->setVal('date', Bn::getValue('dateevent'));\r\n\t\t$oEvent->setVal('organizer', Bn::getValue('organizer'));\r\n\t\t$oEvent->setVal('place', Bn::getValue('place'));\r\n\t\t$oEvent->setVal('numauto', Bn::getValue('numauto'));\r\n\t\t$oEvent->setVal('firstday', Bn::getValue('firstday'));\r\n\t\t$oEvent->setVal('lastday', Bn::getValue('lastday'));\r\n\t\t$season = Oseason::getSeason(Bn::getValue('firstday'));\r\n\t\t$oEvent->setVal('season', $season);\r\n\t\t$oEvent->save();\t\t\r\n\r\n\t\t$oExtras = new Oeventextra($eventId);\r\n\t\t$oExtras->setVal('regionid', Bn::getValue('regionid'));\r\n\t\t$oExtras->setVal('deptid', Bn::getValue('deptid'));\r\n\t\t$oExtras->save();\r\n\r\n\t\t// Message de fin\r\n\t\t// Preparer les champs de saisie\r\n\t\t$body = new Body();\r\n\t\t$body->addWarning(LOC_LABEL_PREF_REGISTERED);\r\n\t\t$d = $body->addDiv('', 'bn-div-btn');\r\n\t\t$d->addButtonCancel('btnCancel', LOC_BTN_CLOSE);\r\n\r\n\t\t// Envoi au navigateur\r\n\t\t$res = array('content' => $body->toHtml(),\r\n\t\t\t\t\t'title' => LOC_ITEM_GENERAL);\r\n\t\techo Bn::toJson($res);\r\n\t\treturn false;\r\n\t}",
"public function edit()\r\n {\r\n //\r\n }",
"public function edit()\r\n {\r\n //\r\n }",
"public function edit(Eventpartners $eventpartners)\n {\n //\n }",
"public function change_event()\r\n\t{\r\n\t\t// get post data\r\n\t\t$data['post'] = $this->input->post();\r\n\t\t// update db\r\n\t\t$this->caifmodel->edit_event($data['post']);\t\r\n\t\t// redirect\r\n\t\tredirect(base_url().'events','location');\r\n\t}",
"function OnAfterEdit(){\n }",
"public function edit()\n {\n \n }",
"function showEvent() \n {\n if (isset($_SESSION['eventid']) AND isset($_SESSION['eventguest'])) {\n // event und gast informationen\n echo \"<div class=''>\";\n echo \"<div class='rightBody'>\";\n $this->askUserForZusage($_SESSION['eventid']);\n $this->askUserForCount($_SESSION['eventid']);\n $this->showSmallGuestList();\n echo \"</div>\";\n echo \"<div class='innerBody'>\";\n echo \"<ul class='finanzNAV'>\";\n $this->eventAdministration();\n echo \"</ul>\";\n $eventname = $this->getEventname($_SESSION['eventid']);\n echo \"<h1><a href='event.php'>\" .$eventname . \"</a></h1>\";\n echo \"<h2>Willkommen \" . $this->getGuestName($_SESSION['eventguest']) . \"</h2>\";\n $this->showWelcomeMessage($_SESSION['eventid']);\n $this->showCountdowns($_SESSION['eventid']);\n $this->showBlogMessages($_SESSION['eventid']);\n echo \"</div>\";\n echo \"</div>\";\n \n }\n }",
"public function showEdit()\n {\n\n }",
"public function saveEvent(){\n\t\t$this->load->database();\n\t\t//if this object is new event : insert it to db\n\t\tif($this->id === -1){\n\t\t\t$this->db->query(\"INSERT INTO event (title,des,image,author,postdate,duedate) \n\t\t\t\n\t\t\tVALUES ('$this->title',\n\t\t\t\t\t'$this->des',\n\t\t\t\t\t'$this->image',\n\t\t\t\t\t'$this->author',\n\t\t\t\t\t'$this->postdate',\n\t\t\t\t\t'$this->duedate'\n\t\t\t\t\t)\");\n\t\t}\n\t\t//if this object is exist event : edit it\n\t\telse{\n\t\t\t$this->db->query(\"UPDATE event SET \n\t\t\t\t\n\t\t\t\ttitle='$this->title',\n\t\t\t\tdes='$this->des',\n\t\t\t\timage='$this->image',\n\t\t\t\tpostdate='$this->postdate',\n\t\t\t\tduedate='$this->duedate' \n\t\t\t\t\n\t\t\t\tWHERE id='$this->id'\");\n\t\t}\n\t}",
"public function manage_events()\n {\n if($this->Auth->user('level') != \"Officer\" && $this->Auth->user('level') != \"Admin\")\n $this->redirect(\n array('controller' => 'Users', 'action' => 'profilehub/' . $this->Auth->user('id')));\n \n $allRsvps = $this->Event->EventsUser->find('all');\n $this->set('rsvps', $allRsvps);\n \n $this->EventHelper(); \n \n $this->layout = 'hero-ish';\n $this->Session->write('Page', 'Hub');\n }",
"public function edit(Evange $evange)\n {\n //\n }",
"public function onEdit(KEvent $config)\n\t{\t \n\t\t$actor \t = $config->actor;\n\t\t\n\t\tif ( !is_person($actor) )\n\t\t\treturn;\n\t\t\t\n\t\t$actor_profile = KService::get('repos:stonewall.profile')->findOrCreate(array('person'=>$actor))->reset();\n\t\t$actor_profile->reset();\n\t\t$html \t\t= KService::get('com:base.template.helper.html');\n\t\t$sections\t= array();\n\t\t$groups = $this->_getFields();\n\t\t\n\t\tforeach($groups as $group_name => $fields)\n\t\t{\t\t\n\t\t\t$sections[$group_name] = array();\t\n\t\t\tforeach($fields as $variable => $type )\n\t\t\t{\n\t\t\t\t$data = $actor_profile->$variable;\t\t\t\n\t\t\t\t$name = 'stonewall['.$variable.']';\n\t\t\t\t$label = implode('-', KInflector::explode($variable));\n\t\t\t\tif ( is_array($type) ) \n\t\t\t\t{\n\t\t\t\t\t$values = array_combine($type, $type);\n\t\t\t\t\tarray_unshift($values, 'DO-NOT-SHOW');\n\t\t\t\t\tforeach($values as $key => $value) \n\t\t\t\t\t\t$values[$key] = JText::_($value);\n\t\t\t\t\t\t\n\t\t\t\t\t$value = $html->select($name, array('options'=>$values, 'selected'=>$data));\n\t\t\t\t}\n\t\t\t\telseif ( $type == 'date' ) \n\t\t\t\t{\n\t\t\t\t\t$data = explode('-', $data);\n\t\t\t\t\t\n\t\t\t\t\t$selector = KService::get('com:base.template.helper.selector');\n\t\t\t\t\t$date = new KDate(new KConfig());\n\t\t\t\t\t$value = $selector->month(array('name'=>$name.'[month]', 'selected'=>(int) @$data[1]))->class('input-medium').' '.\n\t\t\t\t\t\t\t $selector->day(array('name'=>$name.'[day]', 'selected'=>(int) @$data[2]))->class('input-medium').' '.\n\t\t\t\t\t\t\t $selector->year(array('name'=>$name.'[year]', 'start'=>1920, 'end'=>$date->year - 10, 'selected'=>(int) @$data[0]))->class('input-medium');\n\t\t\t\t\t\n\t\t\t\t\t\t\t $value = $html->tag('span', $value);\n\t\t\t\t}\t\t\t\t\n\t\t\t\telse $value = $html->$type($name, $data);\n\t\t\t\t\n\t\t\t\tif($value->name == 'textarea')\n\t\t\t\t\t$value->dataValidators('maxLength:500');\n\t\t\t\t\n\t\t\t\t$sections[$group_name][$label] = $value;\n\t\t\t}\n\t\t}\n\t\t\n\t\t$config->profile->append($sections);\n\t}",
"public function edit() {\n }",
"public function editEve($u_event_title,$u_event_date,$u_event_detail,$event_id){\n //check if it is same event or not\n // $check_sql=\"SELECT * FROM `events` WHERE `event_name`='$u_event_title'\";\n // $result_check=$this->conn->query($check_sql);\n\n // if($result_check->num_rows>0){\n // echo \"<div class='alert alert-danger text-center'>The event is already in the table.</div>\";\n\n // }else{\n // update the data\n $sql=\"UPDATE `events` SET `event_title`='$u_event_title',`event_detail`='$u_event_detail',`event_date`='$u_event_date' WHERE `event_id`='$event_id'\";\n $result=$this->conn->query($sql);\n\n if($result==true){\n header(\"location:edit_event.php?event_id=$event_id&success=1&message=The event was successfully modified\");\n\n }else{\n header(\"location:edit_event.php?event_id=$event_id&success=0&message=Error occurd.Try it again.\");\n\n }\n // }\n }",
"public function onDisplayPagesEdit($event)\r\n {\r\n $item = $event->getArgument('item');\r\n $tabs = $event->getArgument('tabs');\r\n $content = $event->getArgument('content');\r\n \r\n $view = \\Dsc\\System::instance()->get('theme');\r\n $shop_content = $view->renderLayout('Shop/Admin/Views::listeners/fields_related_products.php');\r\n \r\n $tabs['shop'] = 'Shop';\r\n $content['shop'] = $shop_content;\r\n \r\n $event->setArgument('tabs', $tabs);\r\n $event->setArgument('content', $content);\r\n }",
"public function londontec_event(){\n\t \n\t\t$id = $this->uri->segment(3);\n\t\t$headerData = null;\n\t\t$sidebarData = null;\n\t\t$page = 'admin/add_londontec_event';\n\t\t$mainData = array(\n\t\t\t'pagetitle' => 'Create londotec event',\n\t\t);\n\t\t$footerData = null;\n\n\t\t$this->template($headerData, $sidebarData, $page, $mainData, $footerData);\n \n\t}",
"function handleEditProgramItem(EventContext $context)\n {\n $program_item_id = fmGetVar('program_item_id');\n $program_item_class = fmGetVar('program_item_class');\n $_SESSION['current_program_item'] = ProgramItem::getProgramItem($program_item_id);\n $_SESSION['current_program_item_class'] = $program_item_class;\n $context->setForward(dirname(__FILE__) . \"/program_item_editor.php\");\n }",
"public function edit()\n {\n }",
"public function edit()\n {\n }",
"public function edit()\n {\n }",
"public function edit()\n {\n \n \n }",
"public function edit()\n {\n \n }",
"public function edit()\n {\n \n }",
"public function edit()\n {\n \n }",
"public function actionEventManagement(){\n $accessUser = [role::ADMIN, role::MEMBER]; // which user(role_id) has permission to join the page\n User::checkUserPermissionForPage($accessUser);\n\n\n $this->_params['title'] = 'Eventverwaltung';\n\n if(isset($_GET['eventId'])) {\n $dataDir = 'assets/images/upload/events/';\n unlink($dataDir . $_GET['pictureName']);\n Booking::deleteWhere('EVENT_ID = '.$_GET['eventId']);\n Event::deleteWhere('ID = ' . $_GET['eventId']);\n sendHeaderByControllerAndAction('event', 'EventManagement');\n }\n\n\n $sortEvent = 'ORDER BY DATE';\n $sortEventOld = 'ORDER BY DATE';\n\n if(isset($_GET['sortEvent'])) {\n $sortEvent = Event::generateSortClauseForEvent($_GET['sortEvent']);\n }\n\n if(isset($_GET['sortEventOld'])) {\n $sortEventOld = Event::generateSortClauseForEvent($_GET['sortEventOld']);\n }\n\n\n $this->_params['eventList'] = Event::find('DATE >= CURDATE()', null, $sortEvent);\n $this->_params['eventListOld'] = Event::find('DATE < CURDATE()', null, $sortEventOld);\n\n }",
"public function edit(Evolution $evolution)\n {\n //\n }",
"public function edit($id) {\n $event = Event::find($id);\n if ($event && $event->status && $event->user_id == Auth::id()) { // check if event belgongs to this user\n $categories = \\App\\Category::orderBy('title')->pluck('title', 'id')->toArray();\n return view('event.edit')->with(array('event' => $event, 'categories' => $categories));\n } else {\n return redirect(route('profile.events')); // redirect to user profile\n }\n }",
"public function edit($id)\n\t{\n try\n {\n $event = StorageEvents::findOrFail($id);\n return $this->view('events.edit', compact('event'));\n }\n catch(ModelNotFoundException $e)\n {\n return $this->redirectNotFound();\n }\n\t}",
"protected function canEdit() {}",
"protected function handlePageEditing() {}",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"public function edit()\n {\n //\n }",
"function edit_event_load() {\n\n\t\tadd_filter( 'request', array( $this, 'sort_events' ) );\n\t}",
"function editEvent($idevent, $comment = null, $htmlComment = null, $indexableContent = null, $attributes = null) {\n\n\t\t\t$method = WALL . \"/feed/$idevent\";\n\n\t\t\t$verbmethod = \"POST\";\n\n\t\t\t$params = array(\"comment\" => $comment,\n\t\t\t\t\t\t\t \"htmlComment\" => $htmlComment,\n\t\t\t\t\t\t\t \"indexableContent\" => $indexableContent,\n\t\t\t\t\t\t\t \"attributes\" => $attributes);\n\n\t\t\t$params = array_filter($params, function($item) { return !is_null($item); });\n\n\t\t\t$response = $this->zyncroApi->callApi($method, $params, $verbmethod);\n\n\t\t\treturn $response;\n\t\t}",
"function __construct()\n\t{\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\n//\tonscreen events\n\n\t}",
"public function action_updatedo()\n {\n\t $this->template = View::forge('template-admin');\n\n $post = Input::post();\n\t\t$id = $post[\"id\"];\n $entry = Model_Event::find_by_pk($post[\"id\"]);\n if($entry){\n\t\t\t$entry[\"venue\"] = $post[\"venue\"];\n\t\t\t$entry[\"post\"] = $post[\"post\"];\n\t\t\t$entry[\"dating\"] = $post[\"dating\"];\n\t\t\t$entry[\"content\"] = $post[\"content\"];\n\t\t\t$entry[\"name\"] = $post[\"name\"];\n\t\t\t$entry[\"man_num\"] = $post[\"man_num\"];\n\t\t\t$entry[\"woman_num\"] = $post[\"woman_num\"];\n\t\t\t$entry[\"visitors_num\"] = $post[\"visitors_num\"];\n\t\t\tif(!$entry->save()){\n\t\t\t\t$data[\"msg\"] = \"更新に失敗しました。\";\n\t\t\t\t$data[\"details\"] = Model_Event::find_by('id',$id);\n\t\t\t\t$this->template->title = \"イベント一覧\";\n\t\t\t\t$this->template->content = View::forge('event/index', $data);\n\t\t\t}\n }\n\t\t$data[\"details\"] = Model_Event::find_by('id',$id);\n\t\t$this->template->title = \"イベント一覧\";\n\t\t$this->template->content = View::forge('event/index', $data);\n\t}"
] | [
"0.77536327",
"0.71166676",
"0.71166676",
"0.71166676",
"0.71166676",
"0.71166676",
"0.71166676",
"0.71166676",
"0.71166676",
"0.71166676",
"0.7045114",
"0.69039947",
"0.69039947",
"0.69039947",
"0.6901066",
"0.68628985",
"0.66963285",
"0.66921026",
"0.66621166",
"0.6643227",
"0.66211605",
"0.66133183",
"0.6608243",
"0.6566311",
"0.6539743",
"0.651905",
"0.6483574",
"0.64679414",
"0.6462472",
"0.6432762",
"0.6347329",
"0.6332457",
"0.6332045",
"0.632768",
"0.63236165",
"0.63098365",
"0.63035166",
"0.62927693",
"0.6271979",
"0.62719005",
"0.6268976",
"0.6268368",
"0.62502813",
"0.62426645",
"0.6238707",
"0.62321365",
"0.6221799",
"0.618192",
"0.6174206",
"0.61726487",
"0.6164244",
"0.61611146",
"0.6160878",
"0.6145268",
"0.61180216",
"0.6106121",
"0.6106121",
"0.6099412",
"0.6098236",
"0.6082896",
"0.60627097",
"0.605912",
"0.60570955",
"0.6048774",
"0.60476846",
"0.6040249",
"0.6036511",
"0.60338104",
"0.6020867",
"0.6017763",
"0.6005781",
"0.59867156",
"0.59833854",
"0.59833854",
"0.59833854",
"0.5972763",
"0.5960992",
"0.5960992",
"0.5960992",
"0.59483093",
"0.59442884",
"0.59433115",
"0.5941961",
"0.59338534",
"0.59335285",
"0.59290946",
"0.59290946",
"0.59290946",
"0.59290946",
"0.59290946",
"0.59290946",
"0.59290946",
"0.59290946",
"0.59290946",
"0.59290946",
"0.59290946",
"0.59290946",
"0.5918839",
"0.59186363",
"0.5914686",
"0.59123224"
] | 0.0 | -1 |
Method to load content event data | function _loadData()
{
// Lets load the content if it doesn't already exist
if (empty($this->_data))
{
$query = 'SELECT e.*, v.venue'
. ' FROM #__eventlist_events AS e'
. ' LEFT JOIN #__eventlist_venues AS v ON v.id = e.locid'
. ' WHERE e.id = '.$this->_id
;
$this->_db->setQuery($query);
$this->_data = $this->_db->loadObject();
return (boolean) $this->_data;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _initData()\r\n\t{\r\n\t\t// Lets load the content if it doesn't already exist\r\n\t\tif (empty($this->_data))\r\n\t\t{\r\n\t\t\t$event = new stdClass();\r\n\t\t\t$event->id\t\t\t\t\t= 0;\r\n\t\t\t$event->locid\t\t\t\t= 0;\r\n\t\t\t$event->catsid\t\t\t\t= 0;\r\n\t\t\t$event->dates\t\t\t\t= null;\r\n\t\t\t$event->enddates\t\t\t= null;\r\n\t\t\t$event->times\t\t\t\t= null;\r\n\t\t\t$event->endtimes\t\t\t= null;\r\n\t\t\t$event->title\t\t\t\t= null;\r\n\t\t\t$event->alias\t\t\t\t= null;\r\n\t\t\t$event->created\t\t\t\t= null;\r\n\t\t\t$event->author_ip\t\t\t= null;\r\n\t\t\t$event->created_by\t\t\t= null;\r\n\t\t\t$event->published\t\t\t= 1;\r\n\t\t\t$event->registra\t\t\t= 0;\r\n\t\t\t$event->unregistra\t\t\t= 0;\r\n\t\t\t$event->datdescription\t\t= null;\r\n\t\t\t$event->meta_keywords\t\t= null;\r\n\t\t\t$event->meta_description\t= null;\r\n\t\t\t$event->recurrence_number\t= 0;\r\n\t\t\t$event->recurrence_type\t\t= 0;\r\n\t\t\t$event->recurrence_counter\t= '0000-00-00';\r\n\t\t\t$event->datimage\t\t\t= JText::_('SELECTIMAGE');\r\n\t\t\t$event->venue\t\t\t\t= JText::_('SELECTVENUE');\r\n\t\t\t$this->_data\t\t\t\t= $event;\r\n\t\t\treturn (boolean) $this->_data;\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"public function loadDataAction()\n {\n $contentService = Dm_Session::GetServiceFactory()->getContentService();\n\n $filter = new Service_Api_Filter_Content();\n\n $filter->id = $this->_getParam('id');\n $filter->mimeType = $this->_getParam('mimeType');\n $filter->limit = $this->_getParam('limit');\n $filter->offset = $this->_getParam('offset');\n $filter->search = $this->_getParam('search');\n $filter->sources = $this->_getParam('sources');\n $filter->format = $this->_getParam('dim');\n $filter->properties = $this->_getParam('properties');\n $contents = $contentService->contentsRead($filter);\n $this->view->data = $contents;\n }",
"public function loadContents() {}",
"public function loadContents() {}",
"public function loadContents() {}",
"public function loadContents() {}",
"function content_function(){ load_schedule(); }",
"public function postLoad() {}",
"protected function postLoad(){\n\t\t\t\n\t\t}",
"public function postLoad() { }",
"function loadActivity(){\n\t\t\t$this->articleEvents->add( $this->db->getUserActivity($this->getName()) ,true );\t\t\t\n\t\t}",
"abstract public function loadData();",
"function initData() {\n\t\t$navigationMenuItemDao = DAORegistry::getDAO('NavigationMenuItemDAO');\n\t\t$navigationMenuItem = $navigationMenuItemDao->getById($this->navigationMenuItemId);\n\n\t\tif ($navigationMenuItem) {\n\t\t\t$this->_data = array(\n\t\t\t\t'path' => $navigationMenuItem->getPath(),\n\t\t\t\t'title' => $navigationMenuItem->getTitle(null),\n\t\t\t\t'url' => $navigationMenuItem->getUrl(),\n\t\t\t\t'menuItemType' => $navigationMenuItem->getType(),\n\t\t\t);\n\t\t\t$this->setData('content', $navigationMenuItem->getContent(null)); // Localized\n\t\t} \n\t}",
"public function onContentLoaded(&$rawContent)\n {\n $this->triggerEvent('after_load_content', array(&$this->requestFile, &$rawContent));\n }",
"function edit_event_load() {\n\n\t\tadd_filter( 'request', array( $this, 'sort_events' ) );\n\t}",
"function loadContents() ;",
"function main($content, $conf)\t{\n\t\t//global $GLOBALS;\n\t\t//debug(t3lib_extMgm::extPath('myevents'));\n\t\t$this->LLkey='de';\n\t\t$this->pi_loadLL();\t\n\t\t$this->pi_initPIflexForm();\n\t\tif(!$this->flexIndex)$this->indexFlex();\n\t\t//debug($conf);\n\t\t$conf=$this->includeFlexInTS($conf);\n\t\t\t\n\t\t//debug($conf,'event_conf_received');\n\t\t//$conf=$this->resolveConf($conf);\n\t\t//if($conf['renderModel.'])$content=$this->cObj->cObjGet($conf['renderModel.']);\n\t\tif($conf['renderModel'])$name=$conf['renderModel'];else $name='COA';\n\t\t$content=$this->cObj->cObjGetSingle($name,$conf['renderModel.']);\n\t\t//debug($content);\n\t\t\n\t\treturn $content;\n\t\t\n\t}",
"function setEventContent($year,$month,$day,$content,$url=false,$id=false){\n$eventTime=$this->mkActiveTime(0,0,1,$month,$day,$year);\n$eventContent[$eventTime]=$content;\n$this->calEventContent[]=$eventContent;\n\tif (!$id) $id=$this->cssEventContent;\n$this->calEventContentId[]=$id;\n\tif ($url) $this->calEventContentUrl[]=$url;\n\telse $this->calEventContentUrl[]=$this->calInit++;\n}",
"public function load($data);",
"public function load()\n {\n }",
"public function load()\n {\n }",
"public function load()\n {\n }",
"public function load()\n {\n }",
"public function load()\n {\n }",
"function page_content()\n {\n //This needs to deliver page data that is requested by the ROUTE.\n }",
"private function loadEvent()\n {\n $api_event = $this->product->getWebUrlApi() . \"segments?_sort=id&_order=desc&_start=0&_end=26&is_displayed=1\";\n $api_event = $this->httpClient->get($api_event);\n $api_event = json_decode($api_event->getRawBody(), true);\n return $api_event;\n }",
"protected function loadData()\n {\n\n $this->jsonUrl = 'https://api.srgssr.ch/audiometadata/v2/livestreams';\n parent::loadData();\n\n }",
"public function load()\n {\n ObserverHandler::addMHook('init_view_registered_engines', $this->getName(), 'init_view_registered_engines');\n ObserverHandler::addMHook('result_search', $this->getName(), 'result_search');\n }",
"function _loadData()\n\t{\n\t\t// Lets load the content if it doesn't already exist\n\t\tif (!$this->_data)\n\t\t{\n\t\t\t$options = array('lite' => '1');\n\t\t\t$xmlDoc = & JFactory::getXMLparser('dom', $options);\n\t\t\tif ($xmlDoc == false) {\n\t\t\t\t$this->setError(JText::_('Error: Cannot create XML doc'));\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$content = $xmlDoc->getTextFromFile(JPATH_ADMINISTRATOR.DS.'components'.DS.'com_weblinks'.DS.'models'.DS.'snapshotsources.xml');\n\t\t\tif (!$content) {\n\t\t\t\t$this->setError(JText::_('Error: Cannot load document'));\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$status = $xmlDoc->parseXML($content);\n\t\t\tif ($status == false) {\n\t\t\t\t$this->setError(JText::_('Error: Cannot parse XML doc'));\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$config = &$xmlDoc->documentElement;\n\t\t\tif ($config->nodeName != 'config') {\n\t\t\t\t$this->setError(JText::_('Error: Root incorrect'));\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$sitesNode = &$config->firstChild;\n\t\t\tif ($sitesNode->nodeName != 'sites') {\n\t\t\t\t$this->setError(JText::_('Error: Sites incorrect'));\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$sites = array();\n\t\t\t$siteNode = & $sitesNode->firstChild;\n\t\t\twhile ($siteNode) {\n\t\t\t\tif ($siteNode->nodeName != 'site') {\n\t\t\t\t\t$this->setError(JText::_('Error: Invalid site format'));\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\t$siteInfo = & $siteNode->attributes;\n\t\t\t\t$site = new stdClass();\n\t\t\t\t$site->name = $siteInfo['name'];\n\t\t\t\t$siteItem = & $siteNode->firstChild;\n\t\t\t\twhile ($siteItem) {\n\t\t\t\t\tswitch ($siteItem->nodeName) {\n\t\t\t\t\t\tcase 'url':\n\t\t\t\t\t\t\t$site->url = $siteItem->firstChild->nodeValue;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'website':\n\t\t\t\t\t\t\t$site->website = $siteItem->firstChild->nodeValue;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'website-url':\n\t\t\t\t\t\t\t$site->website_url = $siteItem->firstChild->nodeValue;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'pic':\n\t\t\t\t\t\t\t$site->pic = $siteItem->firstChild->nodeValue;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'submit':\n\t\t\t\t\t\t\t$site->submit = $siteItem->firstChild->nodeValue;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 'valid':\n\t\t\t\t\t\t\t$site->valid = $siteItem->firstChild->nodeValue;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t$this->setError(JText::_('Error: Invalid site parameter'));\n\t\t\t\t\t\t\treturn false;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t\t$siteItem = & $siteItem->nextSibling;\n\t\t\t\t}\n\t\t\t\t$sites[] = $site;\n\t\t\t\t$siteNode = & $siteNode->nextSibling;\n\t\t\t}\n\n\t\t\t$this->_data = $sites;\n\t\t\treturn (boolean) $this->_data;\n\t\t}\n\t\treturn true;\n\t}",
"public function events()\n\t{\n\t\t// -------------------------------------\n\t\t// Set dynamic=\"off\", lest Weblog get uppity and try\n\t\t// to think that it's in charge here.\n\t\t// -------------------------------------\n\n\t\t//default off.\n\t\tif ( $this->check_yes( ee()->TMPL->fetch_param('dynamic') ) )\n\t\t{\n\t\t\tee()->TMPL->tagparams['dynamic'] \t='yes';\n\t\t}\n\t\telse\n\t\t{\n\t\t\tee()->TMPL->tagparams['dynamic'] \t= 'no';\n\t\t}\n\n\t\t// -------------------------------------\n\t\t//\tcategory url titles?\n\t\t// -------------------------------------\n\n\t\tif (isset(ee()->TMPL->tagparams['category']))\n\t\t{\n\t\t\t$this->convert_category_titles();\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tdetect special cases\n\t\t//--------------------------------------------\n\n\t\tif ( ! $this->parent_method)\n\t\t{\n\t\t\t$this->parent_method = __FUNCTION__;\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Load 'em up\n\t\t// -------------------------------------\n\n\t\t$this->load_calendar_datetime();\n\t\t$this->load_calendar_parameters();\n\n\t\t// -------------------------------------\n\t\t// Prep the parameters\n\t\t// -------------------------------------\n\n\t\t$params = array(\n\t\t\tarray(\t'name' => 'category',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'site_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'min_value' => 1,\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'default' => $this->data->get_site_id()\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'calendar_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'calendar_name',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'event_id',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'event_name',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'status',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'multi' => TRUE,\n\t\t\t\t\t'default' => 'open'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'date_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'date_range_end',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'date'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'show_days',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'show_weeks',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'show_months',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'show_years',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'time_range_start',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'time',\n\t\t\t\t\t'default' => '0000'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'time_range_end',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'time',\n\t\t\t\t\t'default' => '2400'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'prior_occurrences_limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'prior_exceptions_limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'upcoming_occurrences_limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'upcoming_exceptions_limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'event_limit',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'event_offset',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'integer',\n\t\t\t\t\t'default' => 0\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'orderby',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'default' => 'event_start_date'\n\t\t\t\t\t),\n\t\t\tarray(\t'name' => 'sort',\n\t\t\t\t\t'required' => FALSE,\n\t\t\t\t\t'type' => 'string',\n\t\t\t\t\t'default' => 'ASC'\n\t\t\t\t\t)\n\t\t\t);\n\n\t\t//ee()->TMPL->log_item('Calendar: Processing parameters');\n\n\t\t$this->add_parameters($params);\n\n\t\t// -------------------------------------\n\t\t// Do some voodoo on P\n\t\t// -------------------------------------\n\n\t\t$this->process_events_params();\n\n\t\t// -------------------------------------\n\t\t// For the purposes of this method, if an event_id or event_name\n\t\t// has been specified, we want to ignore date range parameters.\n\t\t// -------------------------------------\n\t\t/*\n\t\tif ($this->P->value('event_id') !== FALSE OR $this->P->value('event_name') !== FALSE)\n\t\t{\n\t\t\t$this->P->set('date_range_start', FALSE);\n\t\t\t$this->P->set('date_range_end', FALSE);\n\t\t}\n\t\t*/\n\n\t\t// -------------------------------------\n\t\t// Let's go fetch some events\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Fetching events');\n\n\t\t$ids = $this->data->fetch_event_ids($this->P);\n\n\t\t/*$category = FALSE;\n\n\t\tif (FALSE AND isset(ee()->TMPL) AND\n\t\t\t is_object(ee()->TMPL) AND\n\t\t\t ee()->TMPL->fetch_param('category') !== FALSE AND\n\t\t\t ee()->TMPL->fetch_param('category') != ''\n\t\t)\n\t\t{\n\t\t\t$category = ee()->TMPL->fetch_param('category');\n\n\t\t\tunset(ee()->TMPL->tagparams['category']);\n\t\t}\n\n\t\t$ids = $this->data->fetch_event_ids($this->P, $category);*/\n\n\t\t// -------------------------------------\n\t\t// No events?\n\t\t// -------------------------------------\n\n\t\tif (empty($ids))\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: No events, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// We also need the \"parent\" entry id, if it hasn't been provided\n\t\t// -------------------------------------\n\n\t\tforeach ($ids as $k => $v)\n\t\t{\n\t\t\tif (! isset($ids[$v]))\n\t\t\t{\n\t\t\t\t$ids[$v] = $v;\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------------\n\t\t// 'calendar_events_event_ids' hook.\n\t\t// - Do something with the event IDs\n\n\t\tif (ee()->extensions->active_hook('calendar_events_event_ids') === TRUE)\n\t\t{\n\t\t\t$ids = ee()->extensions->call('calendar_events_event_ids', $ids);\n\t\t\tif (ee()->extensions->end_script === TRUE) return;\n\t\t}\n\t\t//\n\t\t// -------------------------------------------\n\n\n\t\t//--------------------------------------------\n\t\t//\tremove pagination before we start\n\t\t//--------------------------------------------\n\n\t\t//has tags?\n\t\tif (preg_match(\n\t\t\t\t\"/\" . LD . \"calendar_paginate\" . RD . \"(.+?)\" .\n\t\t\t\t\t LD . preg_quote(T_SLASH, '/') . \"calendar_paginate\" . RD . \"/s\",\n\t\t\t\tee()->TMPL->tagdata\t,\n\t\t\t\t$match\n\t\t\t))\n\t\t{\n\t\t\t$this->paginate_tagpair_data\t= $match[0];\n\t\t\tee()->TMPL->tagdata\t\t\t\t= str_replace( $match[0], '', ee()->TMPL->tagdata );\n\t\t}\n\t\t//prefix comes first\n\t\telse if (preg_match(\n\t\t\t\t\"/\" . LD . \"paginate\" . RD . \"(.+?)\" . LD . preg_quote(T_SLASH, '/') . \"paginate\" . RD . \"/s\",\n\t\t\t\tee()->TMPL->tagdata\t,\n\t\t\t\t$match\n\t\t\t))\n\t\t{\n\t\t\t$this->paginate_tagpair_data\t= $match[0];\n\t\t\tee()->TMPL->tagdata\t\t\t\t= str_replace( $match[0], '', ee()->TMPL->tagdata );\n\t\t}\n\n\n\t\t// -------------------------------------\n\t\t// Prepare tagdata for Calendar-specific variable pairs, which\n\t\t// we will process later.\n\t\t// -------------------------------------\n\n\t\tee()->TMPL->var_single['entry_id'] = 'entry_id';\n\n\t\t$var_pairs = array(\n\t\t\t'occurrences',\n\t\t\t'exceptions',\n\t\t\t'rules'\n\t\t);\n\n\t\tforeach (ee()->TMPL->var_pair as $name => $params)\n\t\t{\n\t\t\tif (in_array($name, $var_pairs))\n\t\t\t{\n\t\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\t\tLD.$name.RD,\n\t\t\t\t\tLD.$name.' id=\"'.LD.'entry_id'.RD.'\"'.RD,\n\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t);\n\n\t\t\t\tee()->TMPL->var_pair[$name]['id'] = '';\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tforeach ($var_pairs as $pair)\n\t\t\t{\n\t\t\t\tif (strpos($name.' ', $pair) !== 0)\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$new_name = $name.' id=\"\"';\n\n\t\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\t\tLD.$name.RD,\n\t\t\t\t\tLD.$name.' id=\"'.LD.'entry_id'.RD.'\"'.RD,\n\t\t\t\t\tee()->TMPL->tagdata\n\t\t\t\t);\n\n\t\t\t\tee()->TMPL->var_pair[] \t\t\t\t\t= ee()->TMPL->var_pair[$name];\n\t\t\t\tee()->TMPL->var_pair[$new_name]['id'] \t= '';\n\t\t\t\t// Leave the old name behind so we can pick it up later and use it\n\t\t\t\tee()->TMPL->var_pair[$pair] \t\t\t= $name;\n\n\t\t\t\tunset(ee()->TMPL->var_pair[$name]);\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Prepare tagdata for Calendar-specific date variables, which\n\t\t// we will process later.\n\t\t// -------------------------------------\n\n\t\t$var_dates = array(\n\t\t\t'event_start_date'\t=> FALSE,\n\t\t\t'event_start_time'\t=> FALSE,\n\t\t\t'event_end_date'\t=> FALSE,\n\t\t\t'event_end_time'\t=> FALSE,\n\t\t\t'event_first_date'\t=> FALSE,\n\t\t\t'event_last_date'\t=> FALSE,\n\t\t);\n\n\t\tforeach (ee()->TMPL->var_single as $k => $v)\n\t\t{\n\t\t\tif (($pos = strpos($k, ' format')) !== FALSE)\n\t\t\t{\n\t\t\t\t$name = substr($k, 0, $pos);\n\n\t\t\t\tif (array_key_exists($name, $var_dates))\n\t\t\t\t{\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t//\thash fix for EE 2.8.2\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t//\tDue to the new conditionals parser\n\t\t\t\t\t//\teverything is just whack, so we have\n\t\t\t\t\t//\tto hash and replace formats because\n\t\t\t\t\t//\tEE is just barfing on it now :/.\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t//EE 2.9+ converting quotes and escaping on its conditional\n\t\t\t\t\t//tokenizer so we now have to match escaped quotes\n\t\t\t\t\t//This should be backward compatible.\n\t\t\t\t\tpreg_match(\"/format=(\\\\\\'|\\'|\\\\\\\"|\\\"])(.*)?\\\\1/i\", $k, $matches);\n\n\t\t\t\t\tif ( ! empty($matches))\n\t\t\t\t\t{\n\t\t\t\t\t\t$old_k = $k;\n\t\t\t\t\t\t$k = str_replace($matches[0], md5($matches[0]), $k);\n\t\t\t\t\t\tee()->TMPL->tagdata = str_replace($old_k, $k, ee()->TMPL->tagdata);\n\n\t\t\t\t\t\t//EE 2.9's new conditional parser also screws with how\n\t\t\t\t\t\t//template variables were pulling out the formats for\n\t\t\t\t\t\t//us due to the quote conversion and escaping\n\t\t\t\t\t\t//so we are fixing it here with this since we are\n\t\t\t\t\t\t//capturing it ourselves and converting to hashes\n\t\t\t\t\t\t//anyway.\n\t\t\t\t\t\tif ($v == false)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$v = $matches[2];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t$var_dates[$name][$k] = $v;\n\t\t\t\t\tee()->TMPL->var_single[$k] = $k;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t//\t----------------------------------------\n\t\t//\tInvoke Channel class\n\t\t//\t----------------------------------------\n\n\t\tif ( ! class_exists('Channel') )\n\t\t{\n\t\t\trequire PATH_MOD.'/channel/mod.channel.php';\n\t\t}\n\n\t\t$channel = new Channel;\n\n\n\t\t//need to remove limit here so huge amounts of events work\n\t\t$channel->limit = 1000000;\n\n\t\t// --------------------------------------------\n\t\t// Invoke Pagination for EE 2.4 and Above\n\t\t// --------------------------------------------\n\n\t\t$channel = $this->add_pag_to_channel($channel);\n\n\t\t// -------------------------------------\n\t\t// Prepare parameters\n\t\t// -------------------------------------\n\n\t\tee()->TMPL->tagparams['entry_id'] \t\t\t= implode('|', array_keys($ids));\n\n\t\t//if we have event names, lets set them for the URL title\n\t\tif ( ! in_array(ee()->TMPL->fetch_param('event_name'), array(FALSE, ''), TRUE))\n\t\t{\n\t\t\tee()->TMPL->tagparams['url_title'] = ee()->TMPL->fetch_param('event_name');\n\t\t}\n\n\t\tee()->TMPL->tagparams[$this->sc->channel] \t= CALENDAR_EVENTS_CHANNEL_NAME;\n\n\t\t// -------------------------------------\n\t\t// Pre-process related data\n\t\t// -------------------------------------\n\n\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t{\n\t\t\tee()->TMPL->tagdata = ee()->TMPL->assign_relationship_data(\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\t\t}\n\n\t\tee()->TMPL->var_single \t\t= array_merge( ee()->TMPL->var_single, ee()->TMPL->related_markers );\n\n\t\t// -------------------------------------\n\t\t// Execute needed methods\n\t\t// -------------------------------------\n\n\t\t$channel->fetch_custom_channel_fields();\n\n\t\t$channel->fetch_custom_member_fields();\n\n\t\t// --------------------------------------------\n\t\t// Pagination Tags Parsed Out\n\t\t// --------------------------------------------\n\n\t\t$channel = $this->fetch_pagination_data($channel);\n\n\t\t// -------------------------------------\n\t\t// Querification\n\t\t// -------------------------------------\n\n\t\t$channel->build_sql_query();\n\n\t\tif ($channel->sql == '')\n\t\t{\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t$channel->query = ee()->db->query($channel->sql);\n\n\t\tif ($channel->query->num_rows() == 0)\n\t\t{\n//ee()->TMPL->log_item('Calendar: Channel module says no results, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t$channel->query->result\t= $channel->query->result_array();\n\n\t\t// -------------------------------------------\n\t\t// 'calendar_events_channel_query' hook.\n\t\t// - Do something with the channel query\n\n\t\tif (ee()->extensions->active_hook('calendar_events_channel_query') === TRUE)\n\t\t{\n\t\t\t$channel->query = ee()->extensions->call('calendar_events_channel_query', $channel->query, $ids);\n\t\t\tif (ee()->extensions->end_script === TRUE) return;\n\t\t}\n\t\t//\n\t\t// -------------------------------------------\n\n\t\t// -------------------------------------\n\t\t// Trim IDs and build events\n\t\t// -------------------------------------\n\n\t\t$new_ids = array();\n\n\t\tforeach ($channel->query->result as $k => $row)\n\t\t{\n\t\t\t$new_ids[$row['entry_id']] = $ids[$row['entry_id']];\n\t\t}\n\n\t\t$event_data = $this->data->fetch_all_event_data($new_ids);\n\n\t\t// -------------------------------------\n\t\t// Turn these IDs into events\n\t\t// -------------------------------------\n\n\t\t$events = array();\n\n\t\t//ee()->TMPL->log_item('Calendar: Fetching Calendar_event class');\n\n\t\tif ( ! class_exists('Calendar_event'))\n\t\t{\n\t\t\trequire_once CALENDAR_PATH.'calendar.event.php';\n\t\t}\n\n\t\t$calendars = array();\n\n\t\t//ee()->TMPL->log_item('Calendar: Creating events');\n\n\t\tforeach ($event_data as $k => $edata)\n\t\t{\n\t\t\t$start_ymd\t= ($this->P->value('date_range_start') !== FALSE) ?\n\t\t\t\t\t\t\t$this->P->value('date_range_start', 'ymd') : '';\n\t\t\t$end_ymd\t= ($this->P->value('date_range_end') !== FALSE) ?\n\t\t\t\t\t\t\t$this->P->value('date_range_end', 'ymd') :\n\t\t\t\t\t\t\t$this->P->value('date_range_start', 'ymd');\n\n\t\t\t$temp\t\t= new Calendar_event($edata, $start_ymd, $end_ymd);\n\n\t\t\tif (! empty($temp->dates))\n\t\t\t{\n\t\t\t\t$temp->prepare_for_output();\n\n\t\t\t\t// -------------------------------------\n\t\t\t\t// Eliminate times we don't care about\n\t\t\t\t// -------------------------------------\n\n\t\t\t\tif ($this->P->value('date_range_start', 'ymd') != '')\n\t\t\t\t{\n\t\t\t\t\tforeach ($temp->dates as $ymd => $times)\n\t\t\t\t\t{\n\t\t\t\t\t\tforeach ($times as $range => $data)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tif ($data['end_date']['ymd'].$data['end_date']['time'] <\n\t\t\t\t\t\t\t\t$this->P->value('date_range_start', 'ymd') .\n\t\t\t\t\t\t\t\t$this->P->value('date_range_start', 'time'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tunset($temp->dates[$ymd][$range]);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\telseif ($data['date']['ymd'].$data['date']['time'] >\n\t\t\t\t\t\t\t\t\t$this->P->value('date_range_end', 'ymd') .\n\t\t\t\t\t\t\t\t\t$this->P->value('date_range_end', 'time'))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tunset($temp->dates[$ymd][$range]);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (empty($temp->dates[$ymd]))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tunset($temp->dates[$ymd]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// -------------------------------------\n\t\t\t\t// Recheck to ensure our dates array isn't empty now\n\t\t\t\t// -------------------------------------\n\n\t\t\t\tif ( ! empty($temp->dates))\n\t\t\t\t{\n\t\t\t\t\t$events[$edata['entry_id']] = $temp;\n\t\t\t\t\t$calendars[$events[$edata['entry_id']]->default_data['calendar_id']] = array();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// No point in stressing ourselves out if $calendars is empty\n\t\t// -------------------------------------\n\n\t\tif (empty($calendars))\n\t\t{\n\t\t\t//ee()->TMPL->log_item('Calendar: No calendars, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Fetch information about the calendars\n\t\t// -------------------------------------\n\n\t\t$calendars = $this->data->fetch_calendar_data_by_id(array_keys($calendars));\n\n\t\t// -------------------------------------\n\t\t// Prep variable aliases\n\t\t// -------------------------------------\n\n\t\t$variables = array(\n\t\t\t'title'\t\t\t=> 'event_title',\n\t\t\t'url_title'\t\t=> 'event_url_title',\n\t\t\t'entry_id'\t\t=> 'event_id',\n\t\t\t'author_id'\t\t=> 'event_author_id',\n\t\t\t'author'\t\t=> 'event_author',\n\t\t\t'status'\t\t=> 'event_status'\n\t\t);\n\n\t\t//custom variables with the letters 'url' are borked in\n\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$variables['url_title'] = 'event_borked_title';\n\n\t\t\tee()->TMPL->var_single['event_borked_title'] = 'event_borked_title';\n\n\t\t\tunset(ee()->TMPL->var_single['event_url_title']);\n\n\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_url_title' . RD,\n\t\t\t\t\t'\"event_url_title\"',\n\t\t\t\t\t\"'event_url_title'\"\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_borked_title' . RD,\n\t\t\t\t\t'\"event_borked_title\"',\n\t\t\t\t\t\"'event_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\n\t\t\tee()->TMPL->var_single['event_calendar_borked_title'] = 'event_calendar_borked_title';\n\n\t\t\tunset(ee()->TMPL->var_single['event_calendar_url_title']);\n\n\t\t\tee()->TMPL->tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_url_title' . RD,\n\t\t\t\t\t'\"event_calendar_url_title\"',\n\t\t\t\t\t\"'event_calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_borked_title' . RD,\n\t\t\t\t\t'\"event_calendar_borked_title\"',\n\t\t\t\t\t\"'event_calendar_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tee()->TMPL->tagdata\n\t\t\t);\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Prepare to reorder based on Calendar parameters\n\t\t// -------------------------------------\n\n\t\t$calendar_orderby_params = array(\n\t\t\t'event_title',\n\t\t\t'event_start_date',\n\t\t\t'event_start_hour',\n\t\t\t'event_start_time',\n\t\t\t'occurrence_start_date'\n\t\t);\n\n\t\t$orders \t\t\t\t= explode('|', $this->P->value('orderby'));\n\t\t$sorts \t\t\t\t\t= explode('|', $this->P->value('sort'));\n\t\t$calendar_orders \t\t= array();\n\t\t$calendar_order_data \t= array();\n\n\t\tforeach ($orders as $k => $order)\n\t\t{\n\t\t\tif (in_array($order, $calendar_orderby_params))\n\t\t\t{\n\t\t\t\t$sort = (isset($sorts[$k])) ? $sorts[$k] : 'desc';\n\t\t\t\t$calendar_orders[$order] = $sort;\n\t\t\t\t$calendar_order_data[$order] = array();\n\t\t\t}\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tremove non-existant entry ids first\n\t\t//--------------------------------------------\n\n\t\tforeach ($channel->query->result as $k => $row)\n\t\t{\n\t\t\tif ( ! isset($events[$row['entry_id']]))\n\t\t\t{\n\t\t\t\tunset($channel->query->result[$k]);\n\t\t\t}\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tcalculate offset and event timeframe\n\t\t//\ttotal before we parse tags\n\t\t//--------------------------------------------\n\n\t\t$offset = ($this->P->value('event_offset') > 0) ? $this->P->value('event_offset') : 0;\n\n\t\t$this->event_timeframe_total = count($channel->query->result) - $offset;\n\n\t\t// -------------------------------------\n\t\t// Add variables to the query result\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Adding variables to channel query result');\n\n\t\tforeach ($channel->query->result as $k => $row)\n\t\t{\n\n\t\t\t$channel->query->result[$k]['author'] = ($row['screen_name'] != '') ?\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$row['screen_name'] :\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t$row['username'];\n\n\t\t\t$channel->query->result[$k]['event_timeframe_total'] = $this->event_timeframe_total;\n\n\t\t\t$entry_id = $row['entry_id'];\n\n\t\t\t// -------------------------------------\n\t\t\t// Alias\n\t\t\t// -------------------------------------\n\n\t\t\tforeach ($variables as $old => $new)\n\t\t\t{\n\t\t\t\t$channel->query->result[$k][$new] = $channel->query->result[$k][$old];\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Event variables\n\t\t\t// -------------------------------------\n\n\t\t\tforeach ($events[$entry_id]->default_data as $key => $val)\n\t\t\t{\n\t\t\t\tif (! is_array($val))\n\t\t\t\t{\n\t\t\t\t\tif ($val === 'y' OR $val === 'n')\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->query->result[$k]['event_'.$key] = ($val == 'y') ? TRUE : FALSE;\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$channel->query->result[$k]['event_'.$key] = $val;\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\tforeach ($val as $vkey => $vval)\n\t\t\t\t\t{\n\t\t\t\t\t\tif ($vval === 'y' OR $vval === 'n')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$channel->query->result[$k][\n\t\t\t\t\t\t\t\t'event_'.$key.'_'.$vkey\n\t\t\t\t\t\t\t] = ($vval == 'y') ? TRUE : FALSE;\n\t\t\t\t\t\t}\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$channel->query->result[$k]['event_'.$key.'_'.$vkey] = $vval;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Prepare to orderby event_start_date\n\t\t\t// -------------------------------------\n\n\t\t\tif (isset($calendar_orders['event_start_date']))\n\t\t\t{\n\t\t\t\t$calendar_order_data['event_start_date'][$k] =\n\t\t\t\t\t$events[$entry_id]->default_data['start_date'] .\n\t\t\t\t\t$events[$entry_id]->default_data['start_time'];\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Prepare to orderby occurrence_start_date\n\t\t\t// -------------------------------------\n\n\t\t\tif (isset($calendar_orders['occurrence_start_date']))\n\t\t\t{\n\t\t\t\t$date = reset(reset($events[$entry_id]->dates));\n\t\t\t\t$time = (isset($date['start_time'])) ? $date['start_time'] : $date['date']['time'];\n\t\t\t\t$date = $date['date']['ymd'];\n\t\t\t\t$calendar_order_data['occurrence_start_date'][$k] = $date.$time;\n\t\t\t}\n\n\t\t\t//--------------------------------------------\n\t\t\t//\tsort by occurrence start time\n\t\t\t//--------------------------------------------\n\n\t\t\tif (isset($calendar_orders['event_start_time']))\n\t\t\t{\n\t\t\t\tif ($events[$entry_id]->default_data['start_time'] == 0)\n\t\t\t\t{\n\t\t\t\t\t$calendar_order_data['event_start_time'][$k] = '0000';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$calendar_order_data['event_start_time'][$k] = $events[$entry_id]->default_data['start_time'];\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//--------------------------------------------\n\t\t\t//\tsort by occurrence start hour\n\t\t\t//--------------------------------------------\n\n\t\t\tif (isset($calendar_orders['event_start_hour']))\n\t\t\t{\n\t\t\t\tif ($events[$entry_id]->default_data['start_time'] == 0)\n\t\t\t\t{\n\t\t\t\t\t$calendar_order_data['event_start_hour'][$k] = '00';\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$calendar_order_data['event_start_hour'][$k] \t= substr($events[$entry_id]->default_data['start_time'], 0, 2);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//--------------------------------------------\n\t\t\t//\tsort by event title\n\t\t\t//--------------------------------------------\n\n\t\t\tif (isset($calendar_orders['event_title']))\n\t\t\t{\n\t\t\t\t$calendar_order_data['event_title'][$k] = $channel->query->result[$k]['title'];\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Occurrence variables\n\t\t\t// -------------------------------------\n\n\t\t\t$channel->query->result[$k]['event_occurrence_total'] \t= count($events[$entry_id]->occurrences);\n\t\t\t$channel->query->result[$k]['event_has_occurrences'] \t= (\n\t\t\t\t$channel->query->result[$k]['event_occurrence_total'] > 0\n\t\t\t) ? TRUE : FALSE;\n\n\t\t\t// -------------------------------------\n\t\t\t// Exception variables\n\t\t\t// -------------------------------------\n\n\t\t\t$channel->query->result[$k]['event_exception_total'] \t= count($events[$entry_id]->exceptions);\n\t\t\t$channel->query->result[$k]['event_has_exceptions'] \t= (\n\t\t\t\t$channel->query->result[$k]['event_exception_total'] > 0\n\t\t\t) ? TRUE : FALSE;\n\n\t\t\t// -------------------------------------\n\t\t\t// Rule variables\n\t\t\t// -------------------------------------\n\n\t\t\t$channel->query->result[$k]['event_rule_total'] \t\t= count($events[$entry_id]->rules);\n\t\t\t$channel->query->result[$k]['event_has_rules'] \t\t\t= (\n\t\t\t\t$channel->query->result[$k]['event_rule_total'] > 0\n\t\t\t) ? TRUE : FALSE;\n\n\t\t\t//-------------------------------------\n\t\t\t// Does the event end?\n\t\t\t// we have to check all rules to make sure\n\t\t\t// in case this is a complex rule\n\t\t\t//-------------------------------------\n\n\t\t\t$never_ending = $channel->query->result[$k]['event_never_ends'] = FALSE;\n\n\t\t\tif ($channel->query->result[$k]['event_recurs'] == 'y')\n\t\t\t{\n\t\t\t\tforeach ($events[$entry_id]->rules as $event_rule)\n\t\t\t\t{\n\t\t\t\t\tif ($event_rule['rule_type'] == '+' AND\n\t\t\t\t\t\t($event_rule['repeat_years'] != 0 OR\n\t\t\t\t\t\t $event_rule['repeat_months'] != 0 OR\n\t\t\t\t\t\t $event_rule['repeat_days'] != 0 OR\n\t\t\t\t\t\t $event_rule['repeat_weeks'] != 0) AND\n\t\t\t\t\t\t$event_rule['last_date'] == 0 \tAND\n\t\t\t\t\t\t$event_rule['stop_after'] == 0\n\t\t\t\t\t )\n\t\t\t\t\t{\n\t\t\t\t\t\t$never_ending = $channel->query->result[$k]['event_never_ends'] = TRUE;\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t/*$never_ending = $channel->query->result[$k]['event_never_ends'] = (\n\t\t\t\t$channel->query->result[$k]['event_last_date'] == 0 AND\n\t\t\t\t$channel->query->result[$k]['event_recurs'] == 'y'\n\t\t\t);*/\n\n\t\t\t// -------------------------------------\n\t\t\t// Calendar variables\n\t\t\t// -------------------------------------\n\n\t\t\tif (isset($calendars[$events[$entry_id]->default_data['calendar_id']]))\n\t\t\t{\n\t\t\t\tforeach ($calendars[$events[$entry_id]->default_data['calendar_id']] as $key => $val)\n\t\t\t\t{\n\t\t\t\t\tif (substr($key, 0, 9) != 'calendar_')\n\t\t\t\t\t{\n\t\t\t\t\t\t$key = 'calendar_'.$key;\n\t\t\t\t\t}\n\n\t\t\t\t\t//add in calendar data\n\t\t\t\t\t$channel->query->result[$k][$key] = $val;\n\n\t\t\t\t\tif ($key == 'calendar_url_title' AND\n\t\t\t\t\t\tversion_compare($this->ee_version, '2.6.0', '>='))\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->query->result[$k]['event_calendar_borked_title'] = $val;\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//really?\n\t\t\t\t\t\t$channel->query->result[$k]['event_'.$key] = $val;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// -------------------------------------\n\t\t\t// Date variables\n\t\t\t// -------------------------------------\n\n\t\t\tforeach ($var_dates as $name => $vals)\n\t\t\t{\n\t\t\t\t$which = '';\n\n\t\t\t\tif ($vals === FALSE)\n\t\t\t\t{\n\t\t\t\t\t$vals = array();\n\t\t\t\t}\n\n\t\t\t\tif ($name == 'event_last_date')\n\t\t\t\t{\n\t\t\t\t\tif ( ! empty($vals))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->CDT->change_ymd($channel->query->result[$k]['event_last_date']);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\telseif ($name == 'event_first_date')\n\t\t\t\t{\n\t\t\t\t\t$channel->query->result[$k]['event_first_date']\t= $channel->query->result[$k]['event_start_ymd'];\n\n\t\t\t\t\tif ( ! empty($vals))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->CDT->change_ymd($channel->query->result[$k]['event_first_date']);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$which\t= ($name == 'event_first_date' OR strpos($name, '_start_') !== FALSE) ? 'start' : 'end';\n\t\t\t\t$year\t= $events[$entry_id]->default_data[$which.'_year'];\n\t\t\t\t$month\t= $events[$entry_id]->default_data[$which.'_month'];\n\t\t\t\t$day\t= $events[$entry_id]->default_data[$which.'_day'];\n\n\t\t\t\t$time \t= $events[$entry_id]->default_data[$which.'_time'];\n\n\t\t\t\tif ($time == 0)\n\t\t\t\t{\n\t\t\t\t\tif ($which == 'start')\n\t\t\t\t\t{\n\t\t\t\t\t\t$hour \t= '00';\n\t\t\t\t\t\t$minute = '00';\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$hour\t= '23';\n\t\t\t\t\t\t$minute = '59';\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$minute = substr($time, -2, 2);\n\t\t\t\t\t$hour \t= substr($time, 0, strlen($time) - 2);\n\t\t\t\t}\n\n\t\t\t\t//year month and day are a tad fubar when\n\t\t\t\t//we are looking at a repeat occurence with an enddate\n\t\t\t\t//because the end time is indeed correct, but end date\n\t\t\t\t//is expected to be the end of all of the occurrences\n\t\t\t\t//however, if this is never ending, thats different\n\n\t\t\t\t$end_time_dta \t= $this->CDT->datetime_array();\n\n\t\t\t\tif ( ! $never_ending AND\n\t\t\t\t\t $name = \"event_last_date\")\n\t\t\t\t{\n\t\t\t\t\t$real_end_date = ($channel->query->result[$k]['event_last_date'] != 0) ?\n\t\t\t\t\t\t\t\t\t\t$channel->query->result[$k]['event_last_date'] :\n\t\t\t\t\t\t\t\t\t\t$events[$entry_id]->default_data['end_date']['ymd'];\n\n\n\t\t\t\t\t$end_time_year \t= substr($real_end_date, 0, 4);\n\t\t\t\t\t$end_time_month = substr($real_end_date, 4, 2);\n\t\t\t\t\t$end_time_day \t= substr($real_end_date, 6, 2);\n\n\t\t\t\t\t$this->CDT->change_datetime(\n\t\t\t\t\t\t$end_time_year,\n\t\t\t\t\t\t$end_time_month,\n\t\t\t\t\t\t$end_time_day,\n\t\t\t\t\t\t$hour,\n\t\t\t\t\t\t$minute\n\t\t\t\t\t);\n\n\t\t\t\t\t$end_time_dta \t= $this->CDT->datetime_array();\n\t\t\t\t}\n\n\t\t\t\t$this->CDT->change_datetime($year, $month, $day, $hour, $minute);\n\n\t\t\t\tforeach ($vals as $key => $format)\n\t\t\t\t{\n\t\t\t\t\t//special treatment on end dates of occurrences if its not infinite\n\t\t\t\t\tif ( ! $never_ending AND stristr($key, 'event_last_date'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->query->result[$k][$key] = $this->cdt_format_date_string(\n\t\t\t\t\t\t\t$end_time_dta,\n\t\t\t\t\t\t\t$format,\n\t\t\t\t\t\t\t'%'\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\t//else, parse as normal\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$channel->query->result[$k][$key] = $this->cdt_format_date_string(\n\t\t\t\t\t\t\t$this->CDT->datetime_array(),\n\t\t\t\t\t\t\t$format,\n\t\t\t\t\t\t\t'%'\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\n\t\t\t\t/*\n\t\t\t\t$this->CDT->change_datetime($year, $month, $day, $hour, $minute);\n\n\t\t\t\tforeach ($vals as $key => $format)\n\t\t\t\t{\n\n\t\t\t\t\t$channel->query->result[$k][$key] = $this->cdt_format_date_string(\n\t\t\t\t\t\t$this->CDT->datetime_array(),\n\t\t\t\t\t\t$format,\n\t\t\t\t\t\t'%'\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\t*/\n\n\t\t\t\t// -------------------------------------\n\t\t\t\t// Shorthand date/time variables\n\t\t\t\t// -------------------------------------\n\n\t\t\t\tif ($which)\n\t\t\t\t{\n\t\t\t\t\t$channel->query->result[$k]['event_'.$which.'_hour']\t= $this->cdt_format_date_string($this->CDT->datetime_array(), 'H');\n\t\t\t\t\t$channel->query->result[$k]['event_'.$which.'_minute']\t= $this->cdt_format_date_string($this->CDT->datetime_array(), 'i');\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// The foreach may have emptied the query results\n\t\t// -------------------------------------\n\n\t\tif (empty($channel->query->result))\n\t\t{\n//ee()->TMPL->log_item('Calendar: Weblog query is empty, bailing');\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\tunset($CDT);\n\n\t\t// -------------------------------------\n\t\t// Reorder based on Calendar parameters\n\t\t// -------------------------------------\n\n\t\tif ( ! empty($calendar_order_data))\n\t\t{\n\t\t\tee()->TMPL->log_item('Calendar: Reordering');\n\n\t\t\t$args \t= array();\n\t\t\t$temps \t= array();\n\n\t\t\tforeach ($calendar_orders as $k => $v)\n\t\t\t{\n\t\t\t\t//add order array\n\t\t\t\t$args[] =& $calendar_order_data[$k];\n\n\t\t\t\t//constant for order type\n\n\t\t\t\t//contants cannot be passed by ref because its not a variable\n\t\t\t\t$temps[$k] = constant('SORT_'.strtoupper($v));\n\n\t\t\t\t$args[] =& $temps[$k];\n\t\t\t}\n\n\t\t\t//this will order the result\n\t\t\t$args[] =& $channel->query->result;\n\n\t\t\tcall_user_func_array('array_multisort', $args);\n\n\t\t\t//cleanup\n\t\t\tunset($args);\n\t\t\tunset($temps);\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tpagination for the events tag\n\t\t//--------------------------------------------\n\t\t//\tany tags using this might have different needs\n\t\t//\tso we only want to paginate for original events\n\t\t//\ttag usage\n\t\t//--------------------------------------------\n\n\t\t$this->paginate = FALSE;\n\n\t\t//$this->event_timeframe_total = count($channel->query->result);\n\n\t\tif ($this->parent_method === 'events' AND\n\t\t\t$this->P->value('event_limit') > 0 AND\n\t\t\t$this->event_timeframe_total > $this->P->value('event_limit'))\n\t\t{\n\t\t\t//get pagination info\n\t\t\t$pagination_data = $this->universal_pagination(array(\n\t\t\t\t'total_results'\t\t\t=> $this->event_timeframe_total,\n\t\t\t\t//had to remove this jazz before so it didn't get iterated over\n\t\t\t\t'tagdata'\t\t\t\t=> ee()->TMPL->tagdata . $this->paginate_tagpair_data,\n\t\t\t\t'limit'\t\t\t\t\t=> $this->P->value('event_limit'),\n\t\t\t\t'uri_string'\t\t\t=> ee()->uri->uri_string,\n\t\t\t\t'paginate_prefix'\t\t=> 'calendar_'\n\t\t\t));\n\n\t\t\t// -------------------------------------------\n\t\t\t// 'calendar_events_create_pagination' hook.\n\t\t\t// - Let devs maniuplate the pagination display\n\n\t\t\tif (ee()->extensions->active_hook('calendar_events_create_pagination') === TRUE)\n\t\t\t{\n\t\t\t\t$pagination_data = ee()->extensions->call(\n\t\t\t\t\t'calendar_events_create_pagination',\n\t\t\t\t\t$this,\n\t\t\t\t\t$pagination_data\n\t\t\t\t);\n\t\t\t}\n\t\t\t//\n\t\t\t// -------------------------------------------\n\n\t\t\t//if we paginated, sort the data\n\t\t\tif ($pagination_data['paginate'] === TRUE)\n\t\t\t{\n\t\t\t\t$this->paginate\t\t\t= $pagination_data['paginate'];\n\t\t\t\t$this->page_next\t\t= $pagination_data['page_next'];\n\t\t\t\t$this->page_previous\t= $pagination_data['page_previous'];\n\t\t\t\t$this->p_page\t\t\t= $pagination_data['pagination_page'];\n\t\t\t\t$this->current_page \t= $pagination_data['current_page'];\n\t\t\t\t$this->pager \t\t\t= $pagination_data['pagination_links'];\n\t\t\t\t$this->basepath\t\t\t= $pagination_data['base_url'];\n\t\t\t\t$this->total_pages\t\t= $pagination_data['total_pages'];\n\t\t\t\t$this->paginate_data\t= $pagination_data['paginate_tagpair_data'];\n\t\t\t\t$this->page_count\t\t= $pagination_data['page_count'];\n\t\t\t\t//ee()->TMPL->tagdata\t\t= $pagination_data['tagdata'];\n\t\t\t}\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\tevent limiter\n\t\t//--------------------------------------------\n\n\t\t$page \t= (($this->current_page -1) * $this->P->value('event_limit'));\n\n\t\tif ($page > 0)\n\t\t{\n\t\t\t$offset += $page;\n\t\t}\n\n\n\t\t// -------------------------------------\n\t\t// Apply event_limit=\"\" parameter\n\t\t// -------------------------------------\n\n\t\tif ($this->P->value('event_limit'))\n\t\t{\n\t\t\t$channel->query->result\t= array_slice(\n\t\t\t\t$channel->query->result,\n\t\t\t\t$offset,\n\t\t\t\t$this->P->value('event_limit')\n\t\t\t);\n\t\t}\n\t\telse if ($offset > 0)\n\t\t{\n\t\t\t$channel->query->result\t= array_slice(\n\t\t\t\t$channel->query->result,\n\t\t\t\t$offset\n\t\t\t);\n\t\t}\n\n\t\t//--------------------------------------------\n\t\t//\toffset too much? buh bye\n\t\t//--------------------------------------------\n\n\t\tif (empty($channel->query->result))\n\t\t{\n\t\t\treturn $this->no_results();\n\t\t}\n\n\t\t//\t----------------------------------------\n\t\t//\tRedeclare\n\t\t//\t----------------------------------------\n\t\t// \tWe will reassign the $channel->query->result with our\n\t\t// \treordered array of values.\n\t\t//\t----------------------------------------\n\n\t\t$channel->query->result_array = $channel->query->result;\n\n\t\t// --------------------------------------------\n\t\t// Typography\n\t\t// --------------------------------------------\n\n\t\tee()->load->library('typography');\n\t\tee()->typography->initialize();\n\t\tee()->typography->convert_curly = FALSE;\n\n\t\t$channel->fetch_categories();\n\n\t\t// -------------------------------------\n\t\t// Parse\n\t\t// -------------------------------------\n\n\t\t$occurrence_hash = '9b8b2cde1a14e29a8791ceccdaab6cf9d92b37a4';\n\n\t\t//we have to prevent occurrenct count from being borked\n\t\tee()->TMPL->tagdata = str_replace('occurrence_count', $occurrence_hash, ee()->TMPL->tagdata);\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing, via channel module');\n\n\t\t$channel->parse_channel_entries();\n\n\t\t$channel->return_data = str_replace($occurrence_hash, 'occurrence_count', $channel->return_data);\n\n\t\t// -------------------------------------\n\t\t// Parse Calendar variable pairs\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing variable pairs');\n\n\t\tforeach ($var_pairs as $var)\n\t\t{\n\t\t\tif (isset(ee()->TMPL->var_pair[$var]))\n\t\t\t{\n\t\t\t\t// -------------------------------------\n\t\t\t\t// Iterate through the events\n\t\t\t\t// -------------------------------------\n\n\t\t\t\tforeach ($events as $k => $data)\n\t\t\t\t{\n\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t// Does this event have this var pair?\n\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\tif (strpos($channel->return_data, LD.$var.' ') !== FALSE)\n\t\t\t\t\t{\n\t\t\t\t\t\t$var_tag = (! is_array(ee()->TMPL->var_pair[$var])) ? ee()->TMPL->var_pair[$var] : $var;\n\n\t\t\t\t\t\tif (preg_match_all(\"/\".LD.$var_tag.' id=\"'.$k.'\"'.RD.'(.*?)'.LD.preg_quote(T_SLASH, '/').$var.RD.'/s', $channel->return_data, $matches))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t// -------------------------------------\n\t\t\t\t\t\t\t// Iterate through the variables associated with this pair\n\t\t\t\t\t\t\t// -------------------------------------\n\n\t\t\t\t\t\t\tforeach ($matches[1] as $key => $match)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$method = \"prep_{$var}_output\";\n\t\t\t\t\t\t\t\t$match = $this->$method($match, $data, FALSE);\n\t\t\t\t\t\t\t\t$channel->return_data = str_replace($matches[0][$key], $match, $channel->return_data);\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\n\t\t// -------------------------------------\n\t\t// Paginate\n\t\t// -------------------------------------\n\n\t\t//$channel->add_pagination_data();\n\n\t\t// -------------------------------------\n\t\t// Related entries\n\t\t// -------------------------------------\n\n\t\t//ee()->TMPL->log_item('Calendar: Parsing related entries, via channel module');\n\n\t\tif (version_compare($this->ee_version, '2.6.0', '<'))\n\t\t{\n\t\t\tif (count(ee()->TMPL->related_data) > 0 AND\n\t\t\t\tcount($channel->related_entries) > 0)\n\t\t\t{\n\t\t\t\t$channel->parse_related_entries();\n\t\t\t}\n\n\t\t\tif (count(ee()->TMPL->reverse_related_data) > 0 AND\n\t\t\t\tcount($channel->reverse_related_entries) > 0)\n\t\t\t{\n\t\t\t\t$channel->parse_reverse_related_entries();\n\t\t\t}\n\t\t}\n\n\t\t// -------------------------------------\n\t\t// Send 'em home\n\t\t// -------------------------------------\n\n\t\t$tagdata = $this->parse_pagination($channel->return_data);\n\n\t\t//ee()->TMPL->log_item('Calendar: Done!');\n\n\t\t// -------------------------------------\n\t\t//\tlets reverse any unparsed items\n\t\t//\tin case someone is actually writing\n\t\t//\tout the phrase 'event_url_title'\n\t\t// -------------------------------------\n\n\t\t//custom variables with the letters 'url' are borked in\n\t\t//EE 2.6. Bug reported, but this should fix.\n\t\t//https://support.ellislab.com/bugs/detail/19337\n\t\tif (version_compare($this->ee_version, '2.6.0', '>='))\n\t\t{\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_borked_title' . RD,\n\t\t\t\t\t'\"event_borked_title\"',\n\t\t\t\t\t\"'event_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_url_title' . RD,\n\t\t\t\t\t'\"event_url_title\"',\n\t\t\t\t\t\"'event_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\n\n\t\t\t$tagdata = str_replace(\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_borked_title' . RD,\n\t\t\t\t\t'\"event_calendar_borked_title\"',\n\t\t\t\t\t\"'event_calendar_borked_title'\"\n\n\t\t\t\t),\n\t\t\t\tarray(\n\t\t\t\t\tLD . 'event_calendar_url_title' . RD,\n\t\t\t\t\t'\"event_calendar_url_title\"',\n\t\t\t\t\t\"'event_calendar_url_title'\"\n\t\t\t\t),\n\t\t\t\t$tagdata\n\t\t\t);\n\t\t}\n\n\t\treturn $tagdata;\n\t}",
"function events(){\n if(!$this->session->userdata('logged_in') || $this->session->userdata('role') != 'student'):\n redirect('/');\n endif;\n\n $data = array(\n 'events' => $this->admin_model->browse(array('module' => 'events'))\n );\n //load content\n $this->template->content->view('/students/content/events', $data);\n\n //add js file\n $this->template->publish('layouts/app');\n }",
"protected function setContent() {}",
"private function loadContent($viewName, $data = null)\n {\n $data['$timestamp'] = time();\n View::load($viewName, $data);\n }",
"public function doLoad()\n {\n $this->DataSourceInstance->doLoad();\n }",
"protected function childLoad() {}",
"function getData()\n\t{\n\t\t// Lets load the content if it doesn't already exist\n\t\tif (empty($this->_data))\n\t\t{\n\t\t $config = EventBookingHelper::getConfig() ;\t\t \n\t\t $user = & JFactory::getUser();\n\t\t $nullDate = $this->_db->getNullDate() ;\n\t\t\t$query = $this->_buildQuery();\t\t\t\t\t\t\n\t\t\t$this->_db->setQuery($query);\t\t\t\t\t\t\n\t\t\t$rows = $this->_getList($query, $this->getState('limitstart'), $this->getState('limit'));\t\t\t\t\t\t\t\t\t\t\t\n\t\t\tif ($user->get('id')) {\n\t\t\t\t$userId = $user->get('id');\t\t\t\t\n\t\t\t\tfor ($i = 0 , $n = count($rows) ; $i < $n ; $i++) {\n\t\t\t\t\t$row = $rows[$i] ;\n\t\t\t\t\t$sql = 'SELECT COUNT(id) FROM #__eb_registrants WHERE user_id='.$userId.' AND event_id='.$row->id.' AND (published=1 OR (payment_method=\"os_offline\" AND published != 2))';\n\t\t\t\t\t$this->_db->setQuery($sql) ;\n\t\t\t\t\t$row->user_registered = $this->_db->loadResult() ;\t\t\t\t\t\n\t\t\t\t\t//Canculate discount price\t\t\t\t\t\n\t\t\t\t\tif ($config->show_discounted_price) {\n\t\t\t\t\t $discount = 0 ;\n\t\t\t\t\t if (($row->early_bird_discount_date != $nullDate) && ($row->date_diff >=0)) {\n \t\t if ($row->early_bird_discount_type == 1) { \t\t \t\t \n \t\t\t\t\t$discount += $row->individual_price*$row->early_bird_discount_amount/100 ;\t\t\t\t\t\t\n \t\t\t\t} else { \t\t\t\t \n \t\t\t\t\t$discount += $row->early_bird_discount_amount ;\n \t\t\t\t} \t\t\t\t\n\t\t\t\t\t }\n\t\t\t\t\t if ($row->discount > 0) {\t\t\t\t\t \n \t\t\t\tif ($row->discount_type == 1) { \t\t\t\t \n \t\t\t\t\t$discount += $row->individual_price*$row->discount/100 ;\t\t\t\t\t\t\n \t\t\t\t} else { \t\t\t\t \n \t\t\t\t\t$discount += $row->discount ;\n \t\t\t\t}\n \t\t\t} \t\t\t \t\t\t \n \t\t\t$row->discounted_price = $row->individual_price - $discount ; \t\t\t\n\t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t}\t\t\t\t\n\t\t\t} else {\n\t\t\t //Calculate discounted price\n\t\t\t if ($config->show_discounted_price) {\t\t\t \n \t\t\t for ($i = 0 , $n = count($rows) ; $i < $n ; $i++) {\n \t\t\t\t\t$row = $rows[$i] ; \t\t\t\t\t\t\t\t\t \t\t\t\t\t\n \t\t\t\t\tif ($config->show_discounted_price) {\n \t\t\t\t\t $discount = 0 ;\n \t\t\t\t\t if (($row->early_bird_discount_date != $nullDate) && ($row->date_diff >=0)) {\n \t\t if ($row->early_bird_discount_type == 1) { \t\t \t\t \n \t\t\t\t\t$discount += $row->individual_price*$row->early_bird_discount_amount/100 ;\t\t\t\t\t\t\n \t\t\t\t} else { \t\t\t\t \n \t\t\t\t\t$discount += $row->early_bird_discount_amount ;\n \t\t\t\t} \t\t\t\t\n \t\t\t\t\t } \t\t\t\t\t \t\t\t\n \t\t\t$row->discounted_price = $row->individual_price - $discount ; \t\t\t\n \t\t\t\t\t}\t\t\t\t\t\t\t\t\t\t\n \t\t\t\t}\t\t\t \t\t\t \t\t\t \t\t\t \t\t\t \n\t\t\t }\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t\t$this->_data = $rows ;\t\t\t\t\t\t\n\t\t}\n\t\t\n\t\treturn $this->_data;\n\t}",
"private function load($content){\r\n\t\t\treturn $this->module_load($content);\r\n\t}",
"public function loadEvent($id){\n\t\t//get data from DB\n\t\t$this->load->database();\n\t\t$tmp_event = $this->db->query(\"SELECT * FROM event WHERE id='$id'\");\n\t\t$tmp_event = $tmp_event->row_array();\n\t\t//assign data to object attr\n\t\t$this->title = $tmp_event['title'];\n\t\t$this->des = $tmp_event['des'];\n\t\t$this->image = $tmp_event['image'];\n\t\t$this->author = $tmp_event['author'];\n\t\t$this->postdate = $tmp_event['postdate'];\n\t\t$this->duedate = $tmp_event['duedate'];\n\t}",
"public function load() { }",
"public function afterLoad() { }",
"public function load()\n {\n }",
"public function load()\n {\n }",
"function load() {\n\n\t}",
"function _on_initialize()\n {\n $this->_request_data['content_topic'] = $this->_topic;\n\n /**\n * Prepare the request switch, which contains URL handlers for the component\n */\n\n // Handle /config\n $this->_request_switch['config'] = array\n (\n 'handler' => array('midcom_core_handler_configdm2', 'config'),\n 'schema' => 'config',\n 'fixed_args' => array('config'),\n );\n\n // Handle /\n $this->_request_switch['index'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_index', 'index'),\n );\n \n /* Crud for events */\n // Handle /create_event/<schema name>\n $this->_request_switch['create_event'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_event', 'create'),\n 'fixed_args' => array('create_event'),\n 'variable_args' => 1,\n );\n // Handle /view_event/<event_guid>\n $this->_request_switch['view_event'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_event', 'read'),\n 'fixed_args' => array('view_event'),\n 'variable_args' => 1,\n );\n // Handle /edit_event/<event_guid>\n $this->_request_switch['edit_event'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_event', 'update'),\n 'fixed_args' => array('edit_event'),\n 'variable_args' => 1,\n );\n // Handle /delete_event/<event_guid>\n $this->_request_switch['delete_event'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_event', 'delete'),\n 'fixed_args' => array('delete_event'),\n 'variable_args' => 1,\n );\n \n // /archive/between/<from date>/<to date> shows all events of selected week\n // in Archive mode, only relevant for style code, it sets a flag\n // which allows better URL handling: The request context key 'archive_mode'\n // will be true in this case.\n $this->_request_switch['archive-between'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_list', 'between'),\n 'fixed_args' => array('archive', 'between'),\n 'variable_args' => 2,\n );\n\n // /archive Main archive page\n $this->_request_switch['archive-welcome'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_archive', 'welcome'),\n 'fixed_args' => array('archive'),\n );\n\n // /archive/view/<event GUID> duplicate of the view handler for archive\n // operation, only relevant for style code, it sets a flag\n // which allows better URL handling: The request context key 'archive_mode'\n // will be true in this case.\n $this->_request_switch['archive-view'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_event', 'view'),\n 'fixed_args' => array('archive', 'view'),\n 'variable_args' => 1,\n );\n // Handle /upcoming/trips/<count>\n $this->_request_switch['upcoming_trips'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_list', 'upcoming'),\n 'fixed_args' => array('upcoming', 'trips'),\n 'variable_args' => 1,\n );\n // Handle /upcoming/meetings/<count>\n $this->_request_switch['upcoming_meetings'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_list', 'upcoming'),\n 'fixed_args' => array('upcoming', 'meetings'),\n 'variable_args' => 1,\n );\n \n /* Crud for location */\n // Handle /location/create/<schema name>\n $this->_request_switch['create_location'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_location', 'create'),\n 'fixed_args' => array('location', 'create'),\n 'variable_args' => 1,\n );\n // Handle /location/view/<location_guid>\n $this->_request_switch['view_location'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_location', 'read'),\n 'fixed_args' => array('location', 'view'),\n 'variable_args' => 1,\n );\n // Handle /location/dl_view/<location_guid>\n $this->_request_switch['view_location_dl'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_location', 'read'),\n 'fixed_args' => array('location', 'dl_view'),\n 'variable_args' => 1,\n );\n // Handle /location/edit/<location_guid>\n $this->_request_switch['edit_location'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_location', 'update'),\n 'fixed_args' => array('location', 'edit'),\n 'variable_args' => 1,\n );\n // Handle /location/delete/<location_guid>\n $this->_request_switch['delete_location'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_location', 'delete'),\n 'fixed_args' => array('location', 'delete'),\n 'variable_args' => 1,\n );\n \n // Handle /locations\n $this->_request_switch['locations'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_location', 'index'),\n 'fixed_args' => array('locations'),\n 'variable_args' => 0,\n );\n \n // / shows next N (configured number) events in RSS format\n $this->_request_switch['feed-rss2'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_feed', 'rss'),\n 'fixed_args' => array('rss.xml'),\n );\n\n\t // / shows next N (configured number) events in RSS format\n\t $this->_request_switch['feed-rss2-user'] = Array\n\t (\n\t 'handler' => array('fi_kilonkipinat_events_handler_feed', 'rss'),\n\t 'fixed_args' => array('user', 'rss.xml'),\n\t );\n \n // / shows next N (configured number) events in RSS format\n $this->_request_switch['feed-ical'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_feed', 'ical'),\n 'fixed_args' => array('ical.ics'),\n );\n \n // / shows next N (configured number) meetings in RSS format\n $this->_request_switch['feed-ical-meetings'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_feed', 'ical'),\n 'fixed_args' => array('meetings','ical.ics'),\n );\n \n // / shows next N (configured number) events in RSS format\n $this->_request_switch['feed-ical-trips'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_feed', 'ical'),\n 'fixed_args' => array('trips','ical.ics'),\n );\n\n\t // / shows next N (configured number) events in RSS format\n\t $this->_request_switch['feed-ical-user'] = Array\n\t (\n\t 'handler' => array('fi_kilonkipinat_events_handler_feed', 'ical'),\n\t 'fixed_args' => array('user', 'ical.ics'),\n\t );\n \n\t // / shows next N (configured number) meetings in RSS format\n\t $this->_request_switch['feed-ical-meetings-user'] = Array\n\t (\n\t 'handler' => array('fi_kilonkipinat_events_handler_feed', 'ical'),\n\t 'fixed_args' => array('user', 'meetings','ical.ics'),\n\t );\n \n\t // / shows next N (configured number) events in RSS format\n\t $this->_request_switch['feed-ical-trips-user'] = Array\n\t (\n\t 'handler' => array('fi_kilonkipinat_events_handler_feed', 'ical'),\n\t 'fixed_args' => array('user', 'trips','ical.ics'),\n\t );\n \n $this->_request_switch['feeds'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_feed', 'index'),\n 'fixed_args' => array('feeds'),\n );\n }",
"public function loadData()\n {\n $this->sendApiCall(self::ACTION_RETRIEVE, $this->getCreateUrl());\n }",
"final public function load() {\n $this->childLoad();\n \\add_action('admin_menu', [$this, 'addAdminMenuEntries']);\n }",
"public function loadForView();",
"public function preload_component() {\n\n $content_hook = array(\n \t'page_construct_object' => 'AccessibilityContentUtility::page_construct_object',\n 'content_call_add_functions' => 'AccessibilityContentUtility::content_call_add_functions'\n );\n\n return $content_hook;\n\n }",
"public function handleLoadDataContainer(LoadDataContainerEvent $event)\n {\n parent::loadDataContainer($event->getName(), $event->isCacheIgnored());\n }",
"private function getData()\n {\n $data = array();\n\n $data = array_merge($data,\n $this->services->CalendarData->currentUserData(),\n $this->services->Common->subPageName( $this->timber->translator->trans('Calendar') . \" | \" ),\n $this->services->Common->runtimeScripts( 'calendar' ),\n $this->services->Common->injectScripts(array(\n 'projectsEvents' => $this->services->CalendarData->projectsEvents(),\n 'tasksEvents' => $this->services->CalendarData->tasksEvents(),\n 'projectsEventsColor' => '#ecf0f1',\n 'projectsEventsTextColor' => '#2c3e50',\n 'tasksEventsColor' => '#bdc3c7',\n 'tasksEventsTextColor' => '#2980b9',\n 'calEvent_id' => $this->timber->translator->trans('ID'),\n 'calEvent_iden' => $this->timber->translator->trans('Identifier'),\n 'calEvent_type' => $this->timber->translator->trans('Type'),\n 'calEvent_mi_id' => $this->timber->translator->trans('Milestone ID'),\n 'calEvent_mi_title' => $this->timber->translator->trans('Milestone Title'),\n 'calEvent_pr_id' => $this->timber->translator->trans('Project ID'),\n 'calEvent_owner_id' => $this->timber->translator->trans('Owner ID'),\n 'calEvent_assign_to' => $this->timber->translator->trans('Assignee ID'),\n 'calEvent_assign_to_name' => $this->timber->translator->trans('Assignee Name'),\n 'calEvent_assign_to_email' => $this->timber->translator->trans('Assignee Email'),\n 'calEvent_title' => $this->timber->translator->trans('Title'),\n 'calEvent_description' => $this->timber->translator->trans('Description'),\n 'calEvent_status' => $this->timber->translator->trans('Status'),\n 'calEvent_progress' => $this->timber->translator->trans('Progress'),\n 'calEvent_priority' => $this->timber->translator->trans('Priority'),\n 'calEvent_start_at' => $this->timber->translator->trans('Start at'),\n 'calEvent_end_at' => $this->timber->translator->trans('End at'),\n 'calEvent_created_at' => $this->timber->translator->trans('Created at'),\n 'calEvent_updated_at' => $this->timber->translator->trans('Updated at'),\n 'calEvent_currency' => $this->timber->translator->trans('Currency'),\n 'calEvent_reference' => $this->timber->translator->trans('Reference'),\n 'calEvent_ref_id' => $this->timber->translator->trans('Reference ID'),\n 'calEvent_version' => $this->timber->translator->trans('Version'),\n 'calEvent_budget' => $this->timber->translator->trans('Budget'),\n 'calEvent_tax_value' => $this->timber->translator->trans('Tax Value'),\n 'calEvent_tax_type' => $this->timber->translator->trans('Tax Type'),\n 'calEvent_discount_value' => $this->timber->translator->trans('Discount Value'),\n 'calEvent_discount_type' => $this->timber->translator->trans('Discount Type'),\n 'calEvent_attach' => $this->timber->translator->trans('Attachments'),\n 'calEvent_owners' => $this->timber->translator->trans('Owners'),\n 'calEvent_staff' => $this->timber->translator->trans('Staff'),\n 'calEvent_clients' => $this->timber->translator->trans('Clients'),\n 'calEvent_staff_ids' => $this->timber->translator->trans('Staff IDs'),\n 'calEvent_clients_ids' => $this->timber->translator->trans('Clients IDs'),\n ))\n );\n\n return $data;\n }",
"public function load(){\n // Return null/error text\n\n $this->_data=[\n 'id'=>$this->id,\n 'photo'=>'test'.$this->id.'.png',\n 'descr'=>'The description of '.$this->id.' post.'\n ];\n return null;\n// return 'Data loading error';\n }",
"public function get_content() {\n $event = Event::factory('response.get_content', array('content' => $this->_content))->notify_all();\n $data = $event->get_data();\n return $data['content'];\n }",
"function load()\n {\n }",
"public function onLoad() {\n \n }",
"protected function loadData()\n\t{\n\t\t$delimiter = \"|||---|||---|||\";\n\t\t$command = 'show --pretty=format:\"%an'.$delimiter.'%ae'.$delimiter.'%cd'.$delimiter.'%s'.$delimiter.'%B'.$delimiter.'%N\" ' . $this->hash;\n\n\t\t$response = $this->repository->run($command);\n\n\t\t$parts = explode($delimiter,$response);\n\t\t$this->_authorName = array_shift($parts);\n\t\t$this->_authorEmail = array_shift($parts);\n\t\t$this->_time = array_shift($parts);\n\t\t$this->_subject = array_shift($parts);\n\t\t$this->_message = array_shift($parts);\n\t\t$this->_notes = array_shift($parts);\n\t}",
"public final function get_content()\n {\n }",
"public final function get_content()\n {\n }",
"public final function get_content()\n {\n }",
"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();",
"function public_load() {\n\n\t}",
"public function load(){\n\t\treturn parent::load();\n\t}",
"function load()\n{\n\t\n}",
"public function fetchEvents()\n {\n // TODO: Implement fetchEvents() method.\n }",
"public function loadContent($page_name)\n\t{\n\t\tinclude(\"resource/view/\".$page_name.\".php\");\n\t}",
"public function load() {\n $filename = STORAGE_PATH.$this->id.'.fba';\n if (file_exists($filename)) {\n\n // Split the file where the blocks terminate '<!--SPLITME-->'\n $text = file_get_contents($filename);\n $array = explode('<!--SPLITME-->',$text);\n\n // Set the texts for this article\n $this->article_title = $array[0];\n $this->article_body = $array[1];\n $this->article_comments = $array[2];\n if(strpos($this->article_body, '<!--DESCRIPTION-->')) {\n $this->article_description = strip_tags((explode('<!--DESCRIPTION-->', $this->article_body))[0]);\n } else {\n $this->article_description = '';\n }\n // Confirm the existence of the article\n $this->existence = true;\n }\n }",
"public function preload_component() {\n\n $content_hook = array(\n 'vce_call_add_functions' => 'CronTask::vce_call_add_functions',\n );\n\n return $content_hook;\n\n }",
"public function ajax_get_content() {\n\n\t\t\tif ( ! function_exists( 'jet_engine' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tadd_filter( 'jet-engine/listing/grid/posts-query-args', array( $this, 'add_query_args' ), 10, 2 );\n\t\t\tadd_filter( 'jet-engine/listing/grid/custom-settings', array( $this, 'add_settings' ), 10, 2 );\n\n\t\t\tif ( ! class_exists( 'Elementor\\Jet_Listing_Grid_Widget' ) ) {\n\t\t\t\tif ( version_compare( jet_engine()->get_version(), '2.0', '<' ) ) {\n\t\t\t\t\trequire_once jet_engine()->plugin_path( 'includes/listings/static-widgets/grid.php' );\n\t\t\t\t} else {\n\t\t\t\t\trequire_once jet_engine()->plugin_path( 'includes/components/elementor-views/static-widgets/grid.php' );\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ( ! class_exists( 'Elementor\\Jet_Listing_Calendar_Widget' ) ) {\n\t\t\t\tif ( version_compare( jet_engine()->get_version(), '2.0', '<' ) ) {\n\t\t\t\t\trequire_once jet_engine()->modules->modules_path( 'calendar/calendar.php' );\n\t\t\t\t} else {\n\t\t\t\t\trequire_once jet_engine()->modules->modules_path( 'calendar/widget.php' );\n\t\t\t\t}\n\n\t\t\t}\n\n\t\t\tElementor\\Plugin::instance()->frontend->start_excerpt_flag( null );\n\n\t\t\t$widget = new Elementor\\Jet_Listing_Calendar_Widget( array(\n\t\t\t\t'id' => null,\n\t\t\t\t'elType' => 'widget',\n\t\t\t\t'settings' => jet_smart_filters()->query->get_query_settings(),\n\t\t\t\t'elements' => array(),\n\t\t\t\t'widgetType' => 'jet-listing-calendar',\n\t\t\t), array() );\n\n\t\t\t$widget->render_posts();\n\n\t\t}",
"private function loadBasicData()\n\t{\n\t\t$this->filename = basename($this->filepath);\n\t\t$this->title = $this->filename;\n\t\t$this->description = $this->filename;\n\t\t$this->mimetype = mime_content_type($this->filepath);\n\t\t$this->dateGathered = date('Y-m-d').'T'.date('h:i:s');\n\t\t$this->filesize = filesize($this->filepath);\n\n\t\t$this->data['path'] = $this->filepath;\n\t\t$this->data['name'] = basename($this->data['path']);\n\n\t\t$this->data['sizeExact'] = filesize($this->data['path']);\n\t\t$this->data['size'] = Utilities::filesizeInterpreter($this->data['sizeExact']);\n\n\t\t$this->data['accessDateExact'] = fileatime($this->data['path']);\n\t\t$this->data['accessDate'] = date(\"F d Y H:i:s.\", $this->data['accessDateExact']);\n\n\t\t$this->data['modifyDateExact'] = filemtime($this->data['path']);\n\t\t$this->data['modifyDate'] = date(\"F d Y H:i:s.\", $this->data['modifyDateExact']);\n\n\t\t$this->data['mimetype'] = mime_content_type($this->data['path']);\n\t\t$this->data['mimetypeType'] = explode(\"/\", $this->data['mimetype'])[0];\n\n\n\t}",
"public function loadData()\n\t{\n\t\t$this->load->view('data_page');\n\t}",
"function main($content, $conf) {\n\n\t\t// some basic stuff:\n\t\t$ts = time();\n\t\t$base_url = $GLOBALS['TSFE']->tmpl->setup['config.']['baseURL'];\n\t\t$this->eventRecordPid = $conf['eventRecordPid'];\n\t\t\n\t\t$content = '<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n\t\t<rss version=\"2.0\" >\n\t\t<channel>';\n\t\t\n\t\t$content .= '<title>RSS Feed YOURWEBSITE.TLD</title>\n\t\t\t\t\t<link>http://www.YOURWEBSITE.TLD</link>\n\t\t\t\t\t<description>Alle Veranstaltungen im Ueberblick</description>';\n\t\t$content .= '<language>de-de</language>\n\t\t\t\t\t<copyright>'. date('Y') .' by YOURWEBSITE.TLD</copyright>';\n\t\t\n\t\t$content .= '<image>\n\t\t\t<title>Aktuelle Veranstaltungen</title>\n\t\t\t<url>http://YOURWEBSITE.TLD/typo3conf/ext/kb_eventboard/res/rss_icon_16x16.gif</url>\n\t\t\t<link>http://www.YOURWEBSITE.TLD/</link>\n\t\t\t<width>16</width>\n\t\t\t<height>16</height>\n\t\t\t<description>Aktuelle Veranstaltungen</description>\n\t\t</image>';\n\n\t\t\t\t\n\t\t\t\t$select_fields = '*';\n\t\t\t\t$from_table = 'tx_kbeventboard_events'; // table of your extension\n\t\t\t\t$where = \"pid = \".$this->eventRecordPid.\" AND deleted = 0 AND hidden = 0 AND datebegin > \".$ts.\"\";\n\t\n\t\t\t\t$group = '';\n\t\t\t\t$order = 'datebegin ASC';\n\t\t\t\t$limit = '40';\n\t\t\t\t$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery($select_fields, $from_table, $where, $group, $order, $limit);\n\t\t\t\t\n\t\t\t\t$sql = $GLOBALS['TYPO3_DB']->SELECTquery($select_fields, $from_table, $where, $group, $order, $limit);\n\n\n\t\t\t\t// now put in all the items:\n\t\t\t\twhile($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)){\n\n\t\t\t\t\t$pubDate = date('D, d M Y H:i:s O', $row[\"datebegin\"]); // timestamp in the correct format for the rss feed\n\t\t\t\t\t$link_to_detailpage = $base_url . 'index.php?id='.$conf[\"singlePid\"].'&tx_kbeventboard_pi1[evt]='.$row[\"uid\"]; // link to the page with the detail view\n\t\t\t\t\t$description = substr(strip_tags($row[\"eventdescription\"]), 0, $conf[\"maxChars\"]) . ' [...]';\n\t\t\t\t\t$eventTitle = strip_tags($row[\"eventname\"]);\n\t\t\t\t\t\n\t\t\t\t\t$filter = array(\n\t\t\t\t\t\t\t\t' '=>'', '"e;'=>'\"', '& ' => ' +'\n\t\t\t\t\t);\n\n\t\t\t\t\tforeach ($filter as $from => $to) {\n\t\t\t\t\t\t$description = str_replace($from, $to, $description);\n\t\t\t\t\t\t$eventTitle = str_replace($from, $to, $eventTitle);\n\t\t\t\t\t}\n\t\t\t\t\t\n\n\t\t\t\t\t$content .= '<item>' . \"\\n\";\n\t\t\t\t\t\t$content .= '<title>'.date('d-m-Y',$row[\"datebegin\"]).': '.$eventTitle.'</title>' . \"\\n\";\n\t\t\t\t\t\t$content .= '<link>'.$link_to_detailpage.'</link>' . \"\\n\";\n\t\t\t\t\t\t$content .= '<description>'.$description.'</description>' . \"\\n\";\n\t\t\t\t\t\t$content .= '<guid>'.$link_to_detailpage.'</guid>' . \"\\n\";\n\t\t\t\t\t\t$content .= '<pubdate>'.$pubDate.'</pubdate>' . \"\\n\";\n\t\t\t\t\t$content .= '</item>';\n\t\t\t\t}\n\n\t\t\t$content .= '</channel>';\n\t\t$content .= '</rss>';\n\n\t\treturn $content;\n\t}",
"function getContent() ;",
"protected function afterLoad()\n {\n }",
"protected function loadMetaData() {}",
"protected function load()\n {\n if ($this->contentLoaded) {\n return;\n }\n\n $content = file_get_contents($this->path);\n\n if (!$content) {\n $this->contentLoaded = true;\n return;\n }\n\n preg_match_all('/\\@([a-z]+)\\s([^\\r\\n\\@]+)/i', $content, $matches, PREG_SET_ORDER);\n\n foreach ($matches as $match) {\n $fullMatch = $match[0];\n $variable = $match[1];\n $value = $match[2];\n\n $content = str_replace($fullMatch, '', $content);\n $this->metadata[$variable] = $value;\n }\n\n $this->content = trim($content, \"\\r\\n\");\n $this->contentLoaded = true;\n }",
"public function loadFromContentID( $id=null );",
"public function loadModuleData() {}",
"function ReadEvents()\n {\n $this->ApplicationObj()->Events=\n $this->Sql_Select_Hashes\n (\n $this->ApplicationObj()->HtmlEventsWhere(),\n array(),\n array(\"StartDate\",\"ID\")\n );\n \n $this->ApplicationObj()->Events=array_reverse($this->ApplicationObj()->Events);\n }",
"public function getSubscribedEvents()\n {\n return ['postLoad'];\n }",
"public function load() {\n\t\t$this->init();\n\t\t$action = $this->action;\n\t\t$view = $this->$action();\n\n\t\tif ($view instanceof View && !$this->app->isErrorPage()):\n\t\t\t$this->app->view = $view;\n\t\tendif;\n\n\t\t$this->app->view->mergeData($this->data);\n\t\t$this->app->view->validate();\n\t}",
"function main_content()\n{\n?>\n <h2>Events</h2>\n\n <div class=\"box\"><b>Where and When</b><br />\n Events take place in Room 86-01 of Portland State's \n <a href=\"http://www.fap.pdx.edu/floorplans/detail2.php?buildingID=12\">Fourth Avenue Building (FAB)</a>\n from 4:30pm to 5:30pm, unless circumstances dictate otherwise.</div>\n<?php\n\n// Are you looking for the events?\n/* To add the functionality the events section now enjoys, unfortunatly I\n * had to break the normal design style and add all the event handling to\n * the body.php script, with the actual events information stored in the \n * events_list.php script. \n * \n * events are stored in events_list.php for two reasons; so that the\n * sidebar can access them without accessing this page every time, and\n * so there is one file that is purely events information. In the future,\n * if we ever use a database to store events information, the \n * events_list.php script is the only script that would need to change.\n * \n * I would have gone with just using SQL, but it's easier to show new\n * people how to edit a text file than it is to create, maintain, and use\n * a secure form or other interface for SQL. Anyone can edit a text file,\n * but not everyone can use SQL.\n *\n * So why not call events_list.php from here and use this page to display\n * it? honestly I couldn't figure out how to. I tried and tried, but \n * aparently my understanding of php is not good enough to get it to work.\n * It seems to have something to do with how the main_content function is\n * actually run in body.php causing some scope issues. Anyways I suffered\n * enough trying to make it work that way. Give it a try if you feel like\n * it, I'm done struggling with it for now.\n *\n*/\n\n\n// Google calendar, which is now redundant.\n/*\n <!--<iframe src=\"https://www.google.com/calendar/embed?height=400&wkst=1&bgcolor=%23FFFFFF&src=psuacm%40cs.pdx.edu&color=%23B1440E&ctz=America%2FLos_Angeles\" style=\" border-width:0 \" width=\"600\" height=\"400\" frameborder=\"0\" scrolling=\"no\"></iframe>\n\n <p>\n Sign up for the\n <a href=\"https://mailhost.cecs.pdx.edu/cgi-bin/mailman/listinfo/acm-members\">ACM Mailing List</a>\n to get messages about upcoming events.\n </p>-->\n*/\n}",
"public function onLoad() {\n\t}",
"protected function after_load(){\n\n\n }",
"protected function loadFormData()\n\t{\n\t}",
"private function load()\n\t{\n\t\tglobal $mediaWiki;\n\t\t\n\t\t$title = Title::newFromText( $this->title );\n\t\t \n\t\t// Can't load page if title is invalid.\n\t\tif ($title == null)\n\t\t\treturn;\n\t\t\n\t\t$article = $mediaWiki->articleFromTitle($title);\n\t\t\n\t\t// Also, if article can't be found, bail out.\n\t\tif ($article == null )\n\t\t\treturn;\n\t\t\n\t\t// Let's try fetching the page content.\n\t\t$article->loadContent();\n\t\t\n\t\t// V1.3 security feature.\n\t\t// At this point, the page's restriction\n\t\t// is loaded. Get 'edit' protection state.\n\t\t$state = $title->getRestrictions('edit');\n $this->protectState = false;\n $state = $title->getRestrictions('edit');\n foreach ($state as $index => $group )\n if ( $group == 'sysop' )\n $this->protectState = true;\n\t\t\n\t\tif (! $this->protectState)\n\t\t\treturn; \n\t\t\n\t\t# if no page or an empty one\n\t\tif (!$article->mDataLoaded)\n\t\t\treturn;\n\t\t \n\t\t$this->content = $article->mContent;\n\t\t$this->raw = $article->mContent;\n\t\t\n\t\t// Now, let's analyse the page\n\t\t// to determine things like page type.\n\t\t$this->analyse();\n\t}",
"public function load($post);",
"public function loadFromCache() {\n parent::loadFromCache();\n $this->historyLinks = $this->data;\n }",
"public function ee_breakouts_page_load() {}",
"function get_data()\n {\n }"
] | [
"0.667174",
"0.6552933",
"0.62384725",
"0.62373495",
"0.62373495",
"0.623723",
"0.62293065",
"0.6036788",
"0.603087",
"0.59994173",
"0.59653",
"0.5892774",
"0.58212155",
"0.58128595",
"0.5789365",
"0.5758977",
"0.5755792",
"0.57541746",
"0.57433695",
"0.5724893",
"0.57237333",
"0.57237214",
"0.57237214",
"0.57237214",
"0.57147473",
"0.5694114",
"0.56531125",
"0.56388295",
"0.5613412",
"0.56108326",
"0.5609473",
"0.56008667",
"0.5588979",
"0.5578562",
"0.55647534",
"0.5551802",
"0.5538127",
"0.55369633",
"0.55350804",
"0.5511618",
"0.5507624",
"0.5507624",
"0.54889834",
"0.5474678",
"0.5469846",
"0.5466845",
"0.5464781",
"0.54492",
"0.5433134",
"0.5399805",
"0.53977096",
"0.53940326",
"0.53863287",
"0.53810024",
"0.53796136",
"0.5375748",
"0.5375748",
"0.5374299",
"0.5360035",
"0.5360035",
"0.5360035",
"0.5360035",
"0.5360035",
"0.5360035",
"0.5360035",
"0.5360035",
"0.5360035",
"0.5360035",
"0.5360035",
"0.5360035",
"0.5360035",
"0.535955",
"0.53561693",
"0.53464615",
"0.533882",
"0.53376216",
"0.532707",
"0.5326789",
"0.53250235",
"0.5318842",
"0.5317858",
"0.52907634",
"0.5288782",
"0.5279147",
"0.5278731",
"0.52753055",
"0.52594745",
"0.52561533",
"0.5255506",
"0.5252039",
"0.52501357",
"0.52367604",
"0.5232917",
"0.52324265",
"0.52148825",
"0.52118427",
"0.52015305",
"0.51974106",
"0.51666003",
"0.516443"
] | 0.5923792 | 11 |
Method to get the category data | function &getCategories()
{
$query = 'SELECT id AS value, catname AS text'
. ' FROM #__eventlist_categories'
. ' WHERE published = 1'
. ' ORDER BY ordering'
;
$this->_db->setQuery( $query );
$this->_categories = $this->_db->loadObjectList();
return $this->_categories;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getCategory() {}",
"public function getCategoryData()\n {\n $_category = Mage::registry('current_category');\n $data = array();\n if ($_category) {\n $data['categoryId'] = $_category->getId();\n $data['categoryName'] = $_category->getName();\n }\n return $data;\n }",
"public function getCategory();",
"public function getCategory();",
"public static function getCategoryData()\n\t{\n\n\t\tstatic $cats;\n\n\t\t$app = Factory::getApplication();\n\n\t\tif (!isset($cats))\n\t\t{\n\t\t\t$db = Factory::getDbo();\n\n\t\t\t$sql = \"SELECT c.* FROM #__categories as c WHERE extension='\" . JEV_COM_COMPONENT . \"' order by c.lft asc\";\n\t\t\t$db->setQuery($sql);\n\t\t\t$cats = $db->loadObjectList('id');\n\t\t\tforeach ($cats as &$cat)\n\t\t\t{\n\t\t\t\t$cat->name = $cat->title;\n\t\t\t\t$params = new JevRegistry($cat->params);\n\t\t\t\t$cat->color = $params->get(\"catcolour\", \"\");\n\t\t\t\t$cat->overlaps = $params->get(\"overlaps\", 0);\n\t\t\t}\n\t\t\tunset ($cat);\n\n\t\t\t$app->triggerEvent('onGetCategoryData', array(& $cats));\n\n\t\t}\n\n\t\t$app->triggerEvent('onGetAccessibleCategories', array(& $cats, false));\n\n\n\t\treturn $cats;\n\t}",
"public function getCategory()\n {\n }",
"public function getCategory()\n\t{\n\t\treturn $this->data['category'];\n\t}",
"public function getCategories();",
"public function getCategories();",
"public function get_category() {\n $data['get_category'] = $this->Category_model->get_category();\n return $data['get_category'];\n }",
"public function getcategory()\r\n{\r\n {\r\n $sql = \"select * from categories\";\r\n $result = $this->connect()->query($sql);\r\n if ($result->rowCount() > 0) {\r\n while ($row = $result->fetch()) {\r\n $data[] = $row;\r\n\r\n }\r\n return $data;\r\n }\r\n }\r\n}",
"public function getCategory() {\n $productModel = new productModel();\n $categories = $productModel->getCategoryList();\n $this->JsonCall($categories);\n }",
"public function getCat()\n {\n $query = $this->db->get('categories');\n\n return $query->result();\n }",
"function getCategoryDataAction()\n {\n $siteId = $this->request->categoryId;\n $site = $this->category->findByPk($siteId);\n $this->set($site->toArray());\n $this->viewClass = \"JsonView\";\n }",
"public function getCategories(){\n\t\t// preapres the request\n\t\t$ch = curl_init();\n\t\tcurl_setopt($ch, CURLOPT_HTTPHEADER, array('Authorization: ' . TOKEN));\n\t\tcurl_setopt($ch, CURLOPT_URL, \"http://\" . IP . \"/bde_site/api/category/\");\n\t\tcurl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n\n\t\t// send the request\n\t\t$output = curl_exec($ch);\n\t\t$info = curl_getinfo($ch);\n\t\tcurl_close($ch);\n\n\t\t// decode the answer into a php object\n\t\t$categories = json_decode($output, true);\n\n\t\treturn $categories;\n\t}",
"function getCategory(){\n\t\t\t$data = array(); \n\t\t\t$query = \"select * from packages_category\";\n\t\t\t$result = mysql_query($query);\n\t\t \n\t\t\tif($result){\n\t\t\t\twhile($row = mysql_fetch_assoc($result)){\n\t\t\t\t\tarray_push($data,$row);\n\t\t\t\t}\n\t\t\t\treturn $data;\n\t\t\t}else{\n\t\t\t\tdie(\"error in mysql query \" . mysql_error());\n\t\t\t}\n\t\t}",
"public function getCat() {\n return DB::q_array(\"SELECT id, title, image FROM news_category WHERE published = 1\");\n }",
"public function getCategory()\n\t\t{\n\t\t\t$sql = \"SELECT id_category,name_cate FROM tbl_category_products\";\n\t\t\t$pre = $this->pdo->prepare($sql);\n\t\t\t$pre->execute();\n\n\t\t\treturn $pre->fetchAll(PDO::FETCH_ASSOC);\n\t\t}",
"private function getCategory() {\n\n $category = Category::with('records');\n /**\n * Filter slug\n */\n $category = Category::where('slug', $this->property('categorySlug'));\n\n /**\n * Filter active only\n */\n if( $this->property('activeOnly') ) {\n $category->isActive();\n }\n\n $categoryDetail = $category->first();\n\n return $categoryDetail;\n\n }",
"public function getCategory(){\n\t\t$stmt = $this->bdd->prepare('SELECT * FROM categorie');\n\t\t$stmt->execute();\n\t\treturn $stmt->fetchAll();\n\t}",
"function get_cat() {\r\n \r\n $query = $this->db->get('categories');\r\n return $query->result_array();\r\n }",
"public function getCategory(){\n return $this->category;\n }",
"public function getCategory()\n {\n \t$cat = Category::with('child')->get();\n return response()->json( [ 'cat' => $cat ] );\n }",
"function getAllCategories()\n {\n return $this->data->getAllCategories();\n }",
"function getCategory() \n {\n return $this->instance->getCategory();\n }",
"public function getCategories(){\n\t\t$query = \"SELECT * FROM final_categoria\";\n\t\treturn $this->con->action($query);\n\t}",
"public function get_category(){\n\t\treturn $this->category;\n\t}",
"public function getCategory()\n {\n\t\treturn self::$categories[ $this->category ];\n }",
"function getCategory()\r\n\t\t{\r\n\t\t\treturn $this->category;\r\n\t\t\t\r\n\t\t}",
"public function getCategory()\n {\n $get_property_category =Category::get();\n return $get_property_category->tojson();\n }",
"function Categories() {\n\t\treturn DataObject::get('categoryobject', '', 'Title');\n\t}",
"public function category() {\n\t\treturn $this->get_category();\n\t}",
"function getCategory() {\n\t\t$categoryId = JRequest::getInt('category_id', 0) ;\n\t\t$sql = 'SELECT * FROM #__eb_categories WHERE id='.$categoryId;\n\t\t$this->_db->setQuery($sql) ;\n\t\treturn $this->_db->loadObject();\t\t\t\n\t}",
"function category()\n\t{\n\n\t\t//$CI =& get_instance();\n\t\t$this->load->model('shop/categories_m');\n\n\t\t$id = $this->attribute('id', '');\n\t\t$field = $this->attribute('field', '');\n\n\t\t$category = $this->categories_m->get( $id );\n\t\n\n\t\tif($category)\n\t\t{\n\t\t\tif($field != '')\n\t\t\t{\n\t\t\t\treturn array('result' => $category->$field );\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn (array) $category;\n\t\t\t}\n\t\t}\n\n\t\treturn array('result' => '');\n\n\t}",
"public function get_category()\n\t{\n\t\tglobal $module_name, $nv_Cache;\n\n\t\t$category = array();\n\n\t\t$sql = \"SELECT * FROM \" . $this->table_prefix . \"_category ORDER BY weight ASC\";\n\t\t$result = $this->db_cache( $sql, 'id', $module_name );\n\n\t\t$category[0] = array(\n\t\t\t'id' => 0,\n\t\t\t'title' => $this->lang('unknow'),\n\t\t\t'keywords' => '',\n\t\t\t'description' => ''\n\t\t);\n\n\t\tif( ! empty( $result ) )\n\t\t{\n\t\t\tforeach( $result as $row )\n\t\t\t{\n\t\t\t\t$category[$row['id']] = array(\n\t\t\t\t\t'id' => $row['id'],\n\t\t\t\t\t'title' => $row['title'],\n\t\t\t\t\t'keywords' => $row['keywords'],\n\t\t\t\t\t'description' => $row['description']\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\n\t\treturn $category;\n\t}",
"public function getCategoryData()\n\t\t{\n\t\t\t$this->load->helper('pagination_helper');\n\t\t\t$pagination=Pagination_helper::getInstance();\n\t\t\t$data['limit']='5';\n\t\t\t$ajax= isset($_REQUEST['ajax']) ? $_REQUEST['ajax'] : '0';\n\t\t\t$data['page'] = isset($_REQUEST['page']) ? $_REQUEST['page'] : '1';\n\t\t\t$data['page'] =($data['page']==false) ? 1 : $data['page']; \n\t\t\t$data['offSet'] = ($data['page']>1) ? ($data['page']-1)* $data['limit'] : 0;\n\t\t\t\n\t\t\t$categoryId= $this->input->get_post('category_id');\n\t\t\t$userId= $this->input->get_post('user_id');\n\t\t\t\n\t\t\ttry{\n\t\t\t\tif($categoryId > 0 && $categoryId <= 9 ){\n\t\t\t\t\t$data = $this->userModel->getAllBets($categoryId,$userId,$data);\n\t\t\t\t\t$data['getAllBetsCount']=$this->userModel->getAllBetsCount($categoryId,$userId,$data);\n\t\t\t\t\t$this->_jsonData['status']=\"SUCCESS\";\n\t\t\t\t\t$this->_jsonData['message']=\"Bets Selected\";\n\t\t\t\t\t$this->_jsonData['data']=$data;\n\t\t\t\t}else{\n\t\t\t\t\t$this->_jsonData['status']=\"FAILURE\";\n\t\t\t\t\t$this->_jsonData['message']=\"Category Id is Missing\";\n\t\t\t\t}\n\t\t\t}catch(Exception $e){\n\t\t\t\t$this->_jsonData['status']=\"FAILURE\";\n\t\t\t\t$this->_jsonData['message']=\"Error Occured\";\n\t\t\t}\n\t\t\t\techo json_encode($this->_jsonData);\n\t\t\t$this->ServicesModel->createService($_REQUEST,$this->_jsonData,$_SERVER['SERVER_ADDR'],'getCategoryData',$_FILES);\n\n\t\t}",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"private function getCategory()\n {\n $catobj = (object)Array();\n $catobj->preview = $this->getFilePath('preview');\n $catobj->category = $this->category_number;\n $catobj->html = $this->getContent();\n $catobj->googleFonts = [];\n $catobj->contentCss = $this->getFilePath('relative_css');\n $catobj->contentClass = $this->getCSSClass($this->getFilePath('css'));\n return $catobj;\n }",
"function GetCategories()\n\t{\n\t\t$result = $this->sendRequest(\"GetCategories\", array());\t\n\t\treturn $this->getResultFromResponse($result);\n\t}",
"public function categoryDetails() {\n\t\t$this->load->model(\"homeModel\");\n\t\t$response = array(\"error\" => FALSE);\n\n\t\t$output = array();\n\n\t\t$post = $this->input->raw_input_stream;\n\t\t$post = json_decode($post);\n\t\t$category = $post->category;\n\n\n\t\t$packages = $this->homeModel->getPackagesInCategory($category);\n\t\tif ($packages != null) {\n\t\t\tforeach ($packages as $key => $value) {\n\t\t\t\t$subPackages = $this->homeModel->getSubpackagesInCategory($value->id);\n\t\t\t\t$services = array();\n\n\t\t\t\tif ($subPackages != null) {\n\t\t\t\t\tforeach ($subPackages as $key => $sub) {\n\t\t\t\t\t\t$services = $this->homeModel->getServicesInSubpackage($sub->id);\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$row['package'] = $value;\n\t\t\t\t$row['sub_packages'] = $subPackages;\n\t\t\t\t$row['services'] = $services;\n\n\t\t\t\t$output[] = $row;\n\t\t\t}\n\t\t}\n\n\t\t$response['packages'] = $packages;\n\t\t$response['data'] = $output;\n\t\techo json_encode($response);\n\t}",
"public function get($category_id);",
"public function getCategory() {\n\t\t$categories = Category::all();\n\t\treturn Response::json($categories);\n\t}",
"public function getAllCategories(){\r\n\t\treturn $this->query(\"SELECT * FROM category\");\r\n\t}",
"public function getCategory() {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory()\n {\n return $this->category;\n }",
"public function getCategory() {\r\n return $this->catList->find('id', $this->categoryId)[0];\r\n }",
"public function data()\n {\n return response()->json(Category::All(), 200);\n }",
"public function getCategory()\n {\n return $this->_category;\n }",
"function get_Category()\n {\n try {\n return $this->mCategory;\n }catch(Exception $e){\n $this->error->throwException('303', 'No s`ha pogut retornar la informació', $e);\n }\n }",
"public static function getCategories() {\n $top_level_cats = array();\n//Select all top level categories\n Db_Actions::DbSelect(\"SELECT * FROM cscart_categories LEFT OUTER JOIN cscart_category_descriptions ON cscart_categories.category_id = cscart_category_descriptions.category_id WHERE cscart_categories.parent_id=0\");\n $result = Db_Actions::DbGetResults();\n if (!isset($result->empty_result)) {\n foreach ($result as $cat) {\n $top_level_cats[] = array('id' => $cat->category_id,\n 'cat_name' => $cat->category,\n 'company_id' => $cat->company_id,\n 'status' => $cat->status,\n 'product_count' => $cat->product_count,\n 'is_op' => $cat->is_op,\n 'usergroup_ids' => $cat->usergroup_ids);\n }\n }\n if (!isset($result->empty_result)) {\n return $result;\n }\n else {\n return new stdClass();\n }\n }",
"public function getCategories()\n\t{\n\t\t$categoryId = $this->input->get_post('category_id');\n\t\ttry{\n\t\t\t\t$category = $this->userModel->getCategory();\n\t\t\t\t$this->_jsonData['status']=\"SUCCESS\";\n\t\t\t\t$this->_jsonData['message']=\"Categories Data\";\n\t\t\t\t$this->_jsonData['data']=$category;\n\t\t}catch(Exception $e){\n\t\t\t\t$this->_jsonData['status']=\"FAILURE\";\n\t\t\t\t$this->_jsonData['message']=\"Error Occured\";\n\t\t\t\t$this->_jsonData['data']='';\n\t\t}\n\t\t\techo json_encode($this->_jsonData);\n\t\t\t$this->ServicesModel->createService($_REQUEST,$this->_jsonData,$_SERVER['SERVER_ADDR'],'getCategories',$_FILES);\n\t}",
"public function getAllCategories();",
"public function GetCategories() {\n // Setup the Query\n $this->sql = \"SELECT *\n FROM categories\";\n \n // Run the query \n $this->RunBasicQuery();\n }",
"public function getCategoryList()\n\t{\n\t\tif (cookie('staffAccount') != '') {\n\t\t\t// sql\n\t\t\t$category = D('Category');\n\t\t\t$sql = \"SELECT * FROM lib_category;\";\n\t\t\t$return = $category->query($sql);\n\t\t\t$result = array();\n\t\t\tfor ($k = 0; $k < count($return); $k++) {\n\t\t\t\tarray_push($result, $return[$k]['category']);\n\t\t\t}\n\t\t\tif ($return) {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'success',\n\t\t\t\t\t'data' => json_encode($return),\n\t\t\t\t\t'cat' => json_encode($result)\n\t\t\t\t));\n\t\t\t\techo $json;\n\t\t\t} else {\n\t\t\t\t$json = json_encode(array(\n\t\t\t\t\t'code' => 'fail',\n\t\t\t\t\t'msg' => 'SQL Error!'\n\t\t\t\t));\n\t\t\t}\n\t\t} else {\n\t\t\t$json = json_encode(array(\n\t\t\t\t'code' => 'fail',\n\t\t\t\t'msg' => 'Please Login!'\n\t\t\t));\n\t\t\techo $json;\n\t\t}\n\t}",
"public function getCategories() : array;",
"function getAllCategories() {\n\t\t$url = $this->apiURL . \"categories/\" . $this->yourID . \"/\" . $this->yourAPIKey;\n\t\treturn $this->_curl_get($url);\n\t}",
"private function getCategoryFullInfo(){\n return Db::select(CATEGORY_TABLE_NAME,\"id='$this->categoryId'\",\"single\");\n }",
"public function getCategories(){\n\t\t$stmt = $this->db->query(\"SELECT * FROM products_categories WHERE clientId = '{$this->clientId}'\");\n\t\treturn $stmt->fetchAll(PDO::FETCH_OBJ);\n\t}",
"public function getCategoryCloud()\n {\n $sql = \"\n SELECT\n PC.id as cat_id,\n PC.category,\n P2C.id,\n P2C.cat_id,\n COUNT(P2C.id) AS amount\n FROM Prod2Cat AS P2C\n LEFT OUTER JOIN ProdCategory AS PC\n ON PC.id = P2C.cat_id\n GROUP BY P2C.cat_id\n -- ORDER BY amount DESC\n \";\n\n $this->db->execute($sql);\n $res = $this->db->fetchAll();\n return $res;\n }",
"public function getCategory() {\n return $this->category;\n }",
"public function get_allCategory_get(){\n\t\t$result = $this->dashboard_model->get_allCategory();\n\t\treturn $this->response($result);\t\t\t\n\t}",
"public function get_category_permastruct()\n {\n }",
"public function getAllWithCategory();",
"public function fetch_postcategory()\n\t\t{\n\t\t\t$query = $this->db->query('SELECT * FROM table_postcategory');\n\n foreach ($query->result() as $row)\n {\n $data[] = $row;\n }\n return $data;\n\t\t}",
"public function getCategory()\n {\n return $this->category;\n }",
"public function get_category(){\n\t\t$this->load->model('seller/product_model');\n\t\t$category = $this->product_model->get_category();\n\t\treturn $category;\n\t}",
"public function getCategory(): string;",
"protected function fetchCategory()\n {\n return $this->fetch([\n 'model' => Category::class,\n 'query' => function ($model) {\n return $model->orderBy('name', 'ASC');\n },\n ]);\n }",
"public function categoryList()\n {\n $data = [];\n $categories = Category::where('parent', 0)->get();\n if($categories){\n $data = ['status' => true, 'code' => 200, 'data'=>$categories];\n }else{\n $data = ['status' => false, 'code' => 404, 'message' => \"data not found\"];\n }\n return $data;\n }",
"public function getCategoryDataFront()\n {\n // Get Categorys\n $categories = CategoryWiseSpecification::orderBy('updated_at', 'desc')->Where('deactivate', 0)->take(4)->get();\n\n foreach($categories as $categoryWiseResource)\n {\n $files = explode(\",\", $categoryWiseResource['file']);\n $categoryWiseResource['attachments'] = Attachment::WhereIn('id', $files)->get();\n }\n \n // Return collection of Categorys as a resource\n return CategoryWiseSpecificationResouerce::collection($categories);\n }",
"function getCategories() {\r\n\t\t$categories = $this->find('all');\r\n\t\t$result = array();\r\n\t\tforeach ($categories as $category) {\r\n\t\t\t$result[$category['NbCategory']['id']] = array(\r\n\t\t\t\t'probability' => $category['NbCategory']['probability'],\r\n\t\t\t\t'word_count' => $category['NbCategory']['word_count']\r\n\t\t\t);\r\n\t\t}\r\n\t\treturn $result;\r\n\t}",
"public function getCategory()\n {\n\n return $this->category;\n }",
"public function getCategoryList()\n {\n// return $this->categoryList = DB::table('categories')->get();\n return $this->categoryList = Categories::all();\n }",
"public function getAllCategory()\n {\n $sql = \"SELECT * FROM categories\";\n $stmt = $this->connect()->prepare($sql);\n $stmt->execute();\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n $id = '';\n $items = $result;\n return $items;\n }",
"private function __getCats() {\n\n\t\t$rootcatID = Mage::app()->getStore()->getRootCategoryId();\n\n\t\t$categories = Mage::getModel('catalog/category')\n\t\t\t\t\t\t\t->getCollection()\n\t\t\t\t\t\t\t->addAttributeToSelect('*')\n\t\t\t\t\t\t\t->addIsActiveFilter();\n $data = array();\n foreach ($categories as $attribute) {\n\t\t\t$data[] = array(\n\t\t\t\t'value' => $attribute->getId(),\n\t\t\t\t'label' => $attribute->getName()\n\t\t\t);\n }\n return $data;\n }",
"function getCategories(){\n\treturn dbSelect('categories');\n}",
"public function getCategory()\n\t{\n\t\treturn $this->category;\n\t}",
"function getCategory() {\n // Load categories.\n $categories = userpoints_get_categories();\n return isset($categories[$this->getTid()]) ? $categories[$this->getTid()] : $categories[userpoints_get_default_tid()];\n }",
"public function getCategory() {\n\t\treturn $this->category;\n\t}",
"public static function getCategory()\n {\n return self::$category;\n }",
"public function getCategories()\n {\n $request = \"SELECT * FROM category\";\n $request = $this->connexion->query($request);\n $categories = $request->fetchAll(PDO::FETCH_ASSOC);\n return $categories;\n }",
"function readCategories()\n{\n return readJsonFile(CATEGORIES_PATH);\n}",
"public function ajax_get_category()\n {\n $cat_id = ee()->input->get('cat_id');\n $group_id = ee()->input->get('group_id');\n $status = ee()->input->get('publisher_view_status') ? ee()->input->get('publisher_view_status') : PUBLISHER_STATUS_OPEN;\n\n $data = array(\n 'cat_id' => $cat_id,\n 'status' => $status\n );\n\n $vars = ee()->publisher_helper->get_toolbar_options('category', $data, FALSE);\n\n $vars['cat_id'] = $cat_id;\n $vars['group_id'] = $group_id;\n $vars['data'] = ee()->publisher_category->get_translations($cat_id, $group_id, $status);\n $vars['save_url'] = ee()->publisher_helper_cp->mod_link('ajax_save_category', array(), TRUE);\n $vars['custom_fields'] = ee()->publisher_category->get_custom_fields($group_id);\n\n // Load core lang file so views are translated\n ee()->lang->loadfile('content');\n\n if (ee()->input->get('publisher_view_status'))\n {\n $data = ee()->load->view('category/edit_form', $vars, TRUE);\n }\n else\n {\n $data = ee()->load->view('category/edit', $vars, TRUE);\n }\n\n ee()->publisher_helper->send_ajax_response($data);\n }",
"public function getCategories(){\n return Category::get();\n }"
] | [
"0.80687743",
"0.798713",
"0.79618174",
"0.79618174",
"0.7890699",
"0.7785303",
"0.7698785",
"0.7583284",
"0.7583284",
"0.75418496",
"0.75393075",
"0.74915206",
"0.74829",
"0.7455358",
"0.74295855",
"0.73839587",
"0.7342399",
"0.73372525",
"0.73087883",
"0.72982645",
"0.7259669",
"0.7247168",
"0.7234963",
"0.7234239",
"0.72335345",
"0.7206866",
"0.7206231",
"0.7203854",
"0.71962297",
"0.7190991",
"0.7180014",
"0.7171357",
"0.7154613",
"0.7152888",
"0.7140566",
"0.7140355",
"0.71310484",
"0.71310484",
"0.71248454",
"0.71191347",
"0.7112828",
"0.71114683",
"0.710615",
"0.7106025",
"0.7105282",
"0.709569",
"0.709569",
"0.709569",
"0.709569",
"0.709569",
"0.709569",
"0.709569",
"0.709569",
"0.709569",
"0.709569",
"0.709569",
"0.709569",
"0.709569",
"0.709569",
"0.709569",
"0.709569",
"0.70860386",
"0.70860296",
"0.7084987",
"0.70661545",
"0.7064065",
"0.70606726",
"0.7056525",
"0.70557517",
"0.705037",
"0.704603",
"0.7021885",
"0.7021848",
"0.70135343",
"0.70055693",
"0.70010364",
"0.70001966",
"0.6999174",
"0.6989468",
"0.6981362",
"0.6976357",
"0.6971839",
"0.69710207",
"0.6961332",
"0.6942661",
"0.69325405",
"0.6930757",
"0.69301283",
"0.6909237",
"0.68919563",
"0.688772",
"0.68780184",
"0.6875756",
"0.68737096",
"0.6872475",
"0.6862642",
"0.6862408",
"0.6857895",
"0.685543",
"0.6851858"
] | 0.6903046 | 89 |
Method to initialise the event data | function _initData()
{
// Lets load the content if it doesn't already exist
if (empty($this->_data))
{
$event = new stdClass();
$event->id = 0;
$event->locid = 0;
$event->catsid = 0;
$event->dates = null;
$event->enddates = null;
$event->times = null;
$event->endtimes = null;
$event->title = null;
$event->alias = null;
$event->created = null;
$event->author_ip = null;
$event->created_by = null;
$event->published = 1;
$event->registra = 0;
$event->unregistra = 0;
$event->datdescription = null;
$event->meta_keywords = null;
$event->meta_description = null;
$event->recurrence_number = 0;
$event->recurrence_type = 0;
$event->recurrence_counter = '0000-00-00';
$event->datimage = JText::_('SELECTIMAGE');
$event->venue = JText::_('SELECTVENUE');
$this->_data = $event;
return (boolean) $this->_data;
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __create()\n {\n $this->eventPath = $this->data('event_path');\n $this->eventName = $this->data('event_name');\n $this->eventInstance = $this->data('event_instance');\n $this->eventFilter = $this->data('event_filter');\n }",
"public function __construct($data)\n {\n $this->event = $data;\n }",
"function __construct()\n\t{\n\t\t$this->events[\"BeforeShowList\"]=true;\n\n\t\t$this->events[\"BeforeProcessList\"]=true;\n\n\t\t$this->events[\"BeforeProcessPrint\"]=true;\n\n\t\t$this->events[\"BeforeShowPrint\"]=true;\n\n\t\t$this->events[\"BeforeQueryList\"]=true;\n\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeProcessEdit\"]=true;\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"BeforeProcessView\"]=true;\n\n\t\t$this->events[\"BeforeShowView\"]=true;\n\n\n\n\n\t\t$this->events[\"ProcessValuesView\"]=true;\n\n\t\t$this->events[\"ProcessValuesEdit\"]=true;\n\n\t\t$this->events[\"CustomAdd\"]=true;\n\n\t\t$this->events[\"CustomEdit\"]=true;\n\n\t\t$this->events[\"ProcessValuesAdd\"]=true;\n\n\t\t$this->events[\"BeforeQueryEdit\"]=true;\n\n\t\t$this->events[\"BeforeQueryView\"]=true;\n\n\n\t\t$this->events[\"BeforeProcessAdd\"]=true;\n\n\n//\tonscreen events\n\t\t$this->events[\"calmonthly_snippet2\"] = true;\n\t\t$this->events[\"calmonthly_snippet1\"] = true;\n\t\t$this->events[\"Monthly_Next_Prev\"] = true;\n\n\t}",
"public function __construct()\n {\n parent::__construct();\n\n $this->events = Events::getInstance();\n\n // Setup the Data Entries.\n $this->data = array(\n 'headerMetaData' => array(),\n 'headerCSSheets' => array(),\n 'headerJScripts' => array(),\n 'footerJScripts' => array(),\n );\n }",
"public function initialize()\n\t{\n\t\t$this->data = new stdClass();\n\t}",
"public function initialize()\r\n {\r\n $this->setSchema(\"test\");\r\n $this->setSource(\"event\");\r\n }",
"public function initialize()\n {\n $this->data = new stdClass();\n }",
"public function __construct()\n {\n if (2 == func_num_args()) {\n $this->events = func_get_arg(0);\n $this->attributes = func_get_arg(1);\n }\n }",
"function _init(&$event)\r\n\t\t{\r\n\t\t\tparent::_init($event);\r\n\t\t\t\r\n\t\t\t$this->inp\t\t\t\t=\t&$event->object('input_validation', array(&$event));\r\n\t\t\t$this->data_validation\t=\t&$event->object('data_validation', array(&$event));\r\n\t\t}",
"public function initEvent()\n {\n $this->owner->{$this->createdAtField} = date($this->format);\n $this->owner->{$this->updatedAtField} = date($this->format);\n }",
"function __construct()\n\t{\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\n\t}",
"function initData() {\n\t\t$navigationMenuItemDao = DAORegistry::getDAO('NavigationMenuItemDAO');\n\t\t$navigationMenuItem = $navigationMenuItemDao->getById($this->navigationMenuItemId);\n\n\t\tif ($navigationMenuItem) {\n\t\t\t$this->_data = array(\n\t\t\t\t'path' => $navigationMenuItem->getPath(),\n\t\t\t\t'title' => $navigationMenuItem->getTitle(null),\n\t\t\t\t'url' => $navigationMenuItem->getUrl(),\n\t\t\t\t'menuItemType' => $navigationMenuItem->getType(),\n\t\t\t);\n\t\t\t$this->setData('content', $navigationMenuItem->getContent(null)); // Localized\n\t\t} \n\t}",
"public function initializeFacebookEvent()\n {\n $this->trackingName = $this->ifVariableSet($this->parameters['tracking'],null);\n $this->numberGiftEarned = $this->ifVariableSet($this->parameters['numberGiftEarned'],0);\n $this->numberGiftSent = $this->ifVariableSet($this->parameters['numberGiftSent'],0);\n $this->numberGiftReceived = $this->ifVariableSet($this->parameters['numberGiftReceived'],0);\n $this->fbAccessToken = $this->ifVariableSet($this->userProfile['fbAccessToken'],0);\n $this->casinoUserId = $this->ifVariableSet($this->userProfile['casinoUserId'],0);\n $this->FBUserId = $this->ifVariableSet($this->userProfile['FBUserId'],0);\n $this->customEventsFields = array(\n '_appVersion' => urlencode('DIGIPRESENCE'),\n 'casinoUserId' => urlencode($this->casinoUserId),\n 'FBUserId' => urlencode($this->FBUserId),\n 'numberGiftSent' => urlencode($this->numberGiftSent),\n 'numberGiftReceived' => urlencode($this->numberGiftReceived),\n 'numberGiftEarned' => urlencode($this->numberGiftEarned),\n '_eventName' => urlencode($this->trackingName)\n );\n }",
"function __construct($event) {\n $this->init($event);\n }",
"function __construct()\n\t{\n\n\t\t$this->events[\"BeforeEdit\"]=true;\n\n\n\t\t$this->events[\"BeforeShowAdd\"]=true;\n\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"IsRecordEditable\"]=true;\n\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\t\t$this->events[\"BeforeAdd\"]=true;\n\n\t\t$this->events[\"AfterDelete\"]=true;\n\n\t\t$this->events[\"AfterEdit\"]=true;\n\n\t\t$this->events[\"BeforeMoveNextList\"]=true;\n\n\n//\tonscreen events\n\n\t}",
"public function initData()\n {\n $this->appliedNumberingData = array();\n $this->currHyperlink = null;\n }",
"public function __construct()\n {\n $this->events = new ArrayCollection();\n }",
"public function initEvents()\n\t{\n\t\t$this->collEvents = new PropelObjectCollection();\n\t\t$this->collEvents->setModel('Event');\n\t}",
"protected function initEvent()\n {\n $locales = $this->container->getParameter('event.locales');\n $event = $this->getRepository('EventEventBundle:Event')->getEvent();\n $now = new \\DateTime();\n\n if (!$event) {\n $event = new Event();\n $event\n ->setTitle('My Event')\n ->setDescription('My another awesome event!')\n ->setStartDate($now)\n ->setEndDate($now->modify('+1 day'))\n ->setVenue('Burj Khalifa Tower')\n ->setEmail('[email protected]')\n ;\n\n $speaker = new Speaker();\n $speaker\n ->setFirstName('Phill')\n ->setLastName('Pilow')\n ->setCompany('Reseach Supplier')\n ;\n\n if ($locales) {\n foreach ($locales as $locale => $title) {\n $eventTranslation = new EventTranslation();\n $eventTranslation->setEvent($event);\n $eventTranslation->setlocale($locale);\n\n $this->getManager()->persist($eventTranslation);\n\n $speakerTranslation = new SpeakerTranslation();\n $speakerTranslation->setSpeaker($speaker);\n $speakerTranslation->setlocale($locale);\n\n $this->getManager()->persist($speakerTranslation);\n }\n }\n\n $this->getManager()->persist($event);\n $this->getManager()->persist($speaker);\n $this->getManager()->flush();\n }\n }",
"public function init() {\n extract($this->data);\n\n // Generate unique ID\n $this->data['id'] = uniqid();\n }",
"function __construct()\r\n\t{\r\n\t\t$this->events[\"BeforeAdd\"]=true;\r\n\r\n\r\n\t}",
"public function init()\n {\n $this->shipping_method_data = (new sampleData())->shipping_method_data();\n $this->zone_data = (new sampleData())->zone_data();\n }",
"function __construct()\n\t{\n\t\t$this->events[\"BeforeShowEdit\"]=true;\n\n\t\t$this->events[\"BeforeMoveNextList\"]=true;\n\n\t\t$this->events[\"BeforeShowView\"]=true;\n\n\n//\tonscreen events\n\n\t}",
"public function initialize()\n {\n // attributes\n $this->setName('event');\n $this->setPhpName('Event');\n $this->setClassname('ArtRequestORM\\\\Event');\n $this->setPackage('ArtRequest');\n $this->setUseIdGenerator(true);\n // columns\n $this->addPrimaryKey('EVENT_ID', 'EventId', 'INTEGER', true, null, null);\n $this->addColumn('EVENT_TITLE', 'EventTitle', 'VARCHAR', true, 100, null);\n $this->addColumn('EVENT_DESCRIPTION', 'EventDescription', 'LONGVARCHAR', true, null, null);\n $this->addColumn('EVENT_LOCATION', 'EventLocation', 'VARCHAR', true, 100, null);\n $this->addColumn('EVENT_SPONSOR_NAME', 'EventSponsorName', 'VARCHAR', true, 100, null);\n $this->addColumn('EVENT_START_TIME', 'EventStartTime', 'VARCHAR', true, 10, null);\n $this->addColumn('EVENT_END_TIME', 'EventEndTime', 'VARCHAR', true, 10, null);\n $this->addColumn('EVENT_START_DATE', 'EventStartDate', 'DATE', true, null, null);\n $this->addColumn('EVENT_END_DATE', 'EventEndDate', 'DATE', true, null, null);\n $this->addColumn('EVENT_PRICING_MEMBER', 'EventPricingMember', 'DECIMAL', true, null, null);\n $this->addColumn('EVENT_PRICING_STAFF', 'EventPricingStaff', 'DECIMAL', true, null, null);\n $this->addColumn('EVENT_PRICING_STUDENT', 'EventPricingStudent', 'DECIMAL', true, null, null);\n $this->addColumn('EVENT_PRICING_PUBLIC', 'EventPricingPublic', 'DECIMAL', true, null, null);\n // validators\n }",
"function init() {\n\t\t$this->processIncomingData();\n\t}",
"function __construct()\n\t{\n\t\t$this->events[\"AfterAdd\"]=true;\n\n\n\t}",
"public function __construct($dataEvent)\n {\n Log:info('Broadcast notifikasi event laporan rincian prognosis | channel-name-'.$dataEvent['inputBy']);\n $this->queue = 'notifikasi';\n $this->inputBy = $dataEvent['inputBy'];\n $this->idProsesLaporan = $dataEvent['idProsesLaporan'];\n $this->status = $dataEvent['status'];\n $this->labelHtml = statusProses($dataEvent['status']);\n $this->direktoriFile = $dataEvent['direktoriFile'];\n $this->createdAt = $dataEvent['createdAt'];\n $this->kodeOrganisasi = $dataEvent['kodeOrganisasi'];\n }",
"public function init()\n {\n parent::init();\n $this->trigger(self::EVENT_INIT);\n }",
"public function init()\n {\n parent::init();\n $this->trigger(self::EVENT_INIT);\n }",
"public function init()\n {\n parent::init();\n $this->trigger(self::EVENT_INIT);\n }",
"public function init()\n {\n parent::init();\n $this->trigger(self::EVENT_INIT);\n }",
"function initData() {\n\t\tif (isset($this->journalId)) {\n\t\t\t$journalDao =& DAORegistry::getDAO('JournalDAO');\n\t\t\t$journal =& $journalDao->getById($this->journalId);\n\n\t\t\tif ($journal != null) {\n\t\t\t\t$this->_data = array(\n\t\t\t\t\t'title' => $journal->getSetting('title', null), // Localized\n\t\t\t\t\t'description' => $journal->getSetting('description', null), // Localized\n\t\t\t\t\t'journalPath' => $journal->getPath(),\n\t\t\t\t\t'enabled' => $journal->getEnabled()\n\t\t\t\t);\n\n\t\t\t} else {\n\t\t\t\t$this->journalId = null;\n\t\t\t}\n\t\t}\n\t\tif (!isset($this->journalId)) {\n\t\t\t$this->_data = array(\n\t\t\t\t'enabled' => 1\n\t\t\t);\n\t\t}\n\t}",
"public function init() {\n\n //AUTHORIZATION CHECK\n if (!$this->_helper->requireAuth()->setAuthParams('siteevent_event', null, \"view\")->isValid())\n $this->respondWithError('unauthorized');\n\n //RETURN IF SUBJECT IS ALREADY SET\n if (Engine_Api::_()->core()->hasSubject())\n $this->respondWithError('unauthorized');\n\n //SET TOPIC OR EVENT SUBJECT\n if (0 != ($organizer_id = (int) $this->_getParam('organizer_id')) &&\n null != ($organizer = Engine_Api::_()->getItem('siteevent_organizer', $organizer_id))) {\n Engine_Api::_()->core()->setSubject($organizer);\n }\n }",
"function initData() {\n\t\t$representative =& $this->getRepresentative();\n\n\t\tif ($representative) {\n\t\t\t$this->_data = array(\n\t\t\t\t'representativeId' => $representative->getId(),\n\t\t\t\t'role' => $representative->getRole(),\n\t\t\t\t'representativeIdType' => $representative->getRepresentativeIdType(),\n\t\t\t\t'representativeIdValue' => $representative->getRepresentativeIdValue(),\n\t\t\t\t'name' => $representative->getName(),\n\t\t\t\t'phone' => $representative->getPhone(),\n\t\t\t\t'fax' => $representative->getFax(),\n\t\t\t\t'email' => $representative->getEmail(),\n\t\t\t\t'url' =>$representative->getUrl(),\n\t\t\t\t'isSupplier' => $representative->getIsSupplier(),\n\t\t\t);\n\t\t}\n\t}",
"function __construct()\n {\n $this->_data = array();\n }",
"function init()\n {\n $this->defineAttribute('data', true, '', COMPONENT_TYPE_STRING);\n $this->defineAttribute('stru', false, '', COMPONENT_TYPE_STRING);\n parent::init();\n }",
"function initData($args, &$request) {\n\t\t$press =& $request->getPress();\n\n\t\t$divisionDao =& DAORegistry::getDAO('DivisionDAO');\n\t\t$seriesDao =& DAORegistry::getDAO('SeriesDAO');\n\n\t\t$divisions =& $divisionDao->getByPressId($press->getId());\n\n\t\t$divisionsArray = array();\n\t\twhile ($division =& $divisions->next()) {\n\t\t\t$divisionsArray[] = array('id' => $division->getId(), 'title' => $division->getLocalizedTitle());\n\t\t\tunset($division);\n\t\t}\n\n\t\tif($this->seriesId) {\n\t\t\t$series =& $seriesDao->getById($this->seriesId);\n\t\t}\n\n\t\tif (isset($series) ) {\n\t\t\t$this->_data = array(\n\t\t\t\t'seriesId' => $this->seriesId,\n\t\t\t\t'title' => $series->getTitle(null),\n\t\t\t\t'divisions' => $divisionsArray,\n\t\t\t\t'currentDivision' => $series->getDivisionId(),\n\t\t\t\t'affiliation' => $series->getAffiliation(null)\n\t\t\t);\n\t\t} else {\n\t\t\t$this->_data = array(\n\t\t\t\t'title' => '',\n\t\t\t\t'divisions' => $divisionsArray,\n\t\t\t\t'affiliation' => ''\n\t\t\t);\n\t\t}\n\n\t\t// grid related data\n\t\t$this->_data['gridId'] = $args['gridId'];\n\t\t$this->_data['rowId'] = isset($args['rowId']) ? $args['rowId'] : null;\n\t}",
"public function __construct()\n {\n $args = func_get_args ();\n if (empty ( $args [0] )) {\n $args [0] = array ();\n }\n $this->_data = $args [0];\n }",
"public function __construct(array $event = array())\n {\n $this\n ->setEvent($event);\n }",
"public function init()\n {\n extract($this->data);\n\n //Set default values to items array\n $this->data['items'] = $this->fillItemsData($items);\n\n //Endpoint for async fetching\n if(isset($endpoint)) {\n $this->data['attributeList']['data-endpoint'] = $endpoint; \n }\n\n //Add unlist class\n $this->data['classList'][] = \"unlist\"; \n\n //Direction of nav\n if($direction) {\n $this->data['classList'][] = $this->getBaseClass() . \"--\" . $direction; \n }\n\n //Attributes\n $this->data['attributeList']['aria-orientation'] = $direction; \n }",
"public function onInitialize(DevoirEventInterface $event);",
"private function init()\n {\n // get sync status object\n $this->currentStatus = $this->getObject();\n\n // if sum of last processed ids is then we can assume that we are doing \n // a new sync. So we want to clear old data files so we can make new ones.\n // if ($this->currentStatus->getLastCustomerId() == 0 \n // && $this->currentStatus->getLastOrderId() == 0\n // && $this->currentStatus->getLastSubscriptionId() == 0\n // )\n // Mage::helper('marketingsoftware/DataWriter')->clearDataFiles();\n\n // store start time for this event\n $this->startTime = microtime(true);\n }",
"private function __construct() {\n\t\t$action = isset($_GET['action']) ? sanitize_key($_GET['action']) : '';\n\t\t$copy = isset($_GET['copy']) ? intval($_GET['copy']) : 0;\n\t\tif(!empty($copy)) {\n\t\t\t$this->copy_event = new EL_Event($copy);\n\t\t\tadd_filter('get_object_terms', array(&$this, 'set_copied_categories'));\n\t\t}\n\n\t\t$this->options = &EL_Options::get_instance();\n\t\t$this->is_new = 'edit' !== $action;\n\n\t\tadd_action('add_meta_boxes', array(&$this, 'add_eventdata_metabox'));\n\t\tadd_action('edit_form_top', array(&$this, 'form_top_content'));\n\t\tadd_action('edit_form_after_title', array(&$this, 'form_after_title_content'));\n\t\tadd_action('admin_print_scripts', array(&$this, 'embed_scripts'));\n\t\tadd_action('save_post_el_events', array(&$this, 'save_eventdata'), 10, 3);\n\t\tadd_filter('enter_title_here', array(&$this, 'change_default_title'));\n\t\tadd_filter('post_updated_messages', array(&$this, 'updated_messages'));\n\t}",
"function initData() {\t\n\t\tif (isset($this->registrationId)) {\n\t\t\t$registrationOptionDao =& DAORegistry::getDAO('RegistrationOptionDAO');\n\t\t\t$registrationDao =& DAORegistry::getDAO('RegistrationDAO');\n\t\t\t$registration =& $registrationDao->getRegistration($this->registrationId);\n \n $registrationTypeDao =& DAORegistry::getDAO('RegistrationTypeDAO');\n $registrationType =& $registrationTypeDao->getRegistrationType($registration->getTypeId());\n $surveyConfig = $registrationType->getLocalizedData(\"survey\");\n\n\t\t\tif ($registration != null) {\n\t\t\t\t$this->_data = array(\n\t\t\t\t\t'userId' => $registration->getUserId(),\n\t\t\t\t\t'typeId' => $registration->getTypeId(),\n\t\t\t\t\t'membership' => $registration->getMembership(),\n\t\t\t\t\t'domain' => $registration->getDomain(),\n\t\t\t\t\t'ipRange' => $registration->getIPRange(),\n 'applicationForm' => $registration->getApplicationForm(),\n 'surveyConfig' => $surveyConfig,\n 'survey' => $registration->getSurvey(),\n\t\t\t\t\t'specialRequests' => $registration->getSpecialRequests(),\n\t\t\t\t\t'datePaid' => $registration->getDatePaid(),\n\t\t\t\t\t'registrationOptionIds' => $registrationOptionDao->getRegistrationOptions($this->registrationId)\n\t\t\t\t);\n\n\t\t\t} else {\n\t\t\t\t$this->registrationId = null;\n\t\t\t}\n\t\t}\n\t}",
"public function init()\n {\n// $eventSystem = $this->_bootstrap->getResource('EventSystem');\n// $eventSystem->raiseEvent($event);\n\n }",
"function __construct( $data = false ){\n\t\tif( is_object($data) && get_class($data) == \"EM_Event\" ){ //Creates a blank bookings object if needed\n\t\t\t$this->event_id = $data->event_id;\n\t\t}elseif( is_array($data) ){\n\t\t\tforeach( $data as $EM_Booking ){\n\t\t\t\tif( get_class($EM_Booking) == 'EM_Booking'){\n\t\t\t\t\t$this->bookings[] = $EM_Booking;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"protected function set_up()\n {\n $eventFeedText = file_get_contents(\n 'Zend/Gdata/Calendar/_files/EventFeedCompositeSample1.xml',\n true\n );\n $this->eventFeed = new Zend_Gdata_Calendar_EventFeed($eventFeedText);\n }",
"function __construct()\n\t{\n\t\t$this->events[\"BeforeInsert\"]=true;\n\n\n//\tonscreen events\n\n\t}",
"protected function initializeEvents()\n\t{\n\t\tparent::initializeEvents();\n\t\t$this->events->add('beforeRender');\n\t\t$this->events->add('render');\n\t}",
"public function __construct($event)\n {\n $this->event = $event;\n }",
"public function __construct($event)\n {\n $this->event = $event;\n }",
"public function __construct( $data ){\n\t\t\t\n\t\t\t$this->init( $data );\n\t\t}",
"public function init(){\n $this->on(SELF::EVENT_NEW_USER,[$this,'SendMailToAdmin']);\n\t\t$this->created_at = time();\n\t}",
"public function init()\n\t{\n\t\tEvents::register('user_insert', array($this, 'user_insert'));\n\t\tEvents::register('user_insert_ldap', array($this, 'user_insert_ldap'));\n\t\tEvents::register('user_update', array($this, 'user_update'));\n\t\tEvents::register('user_delete', array($this, 'user_delete'));\n\t\tEvents::register('users_import', array($this, 'users_import'));\n\t}",
"protected function initData()\n {\n foreach (['data', 'uploads'] as $option) {\n $value = $this->option($option);\n if ($value) {\n $this->info[$option] = explode(',', $value);\n }\n }\n }",
"private function initEvents() : void {\n\n $arenas = MineceitCore::getArenas()->getEventArenas();\n\n foreach($arenas as $arena) {\n $this->createEvent($arena);\n }\n }",
"public function __construct()\n {\n // default event state\n $this->set_state(self::STATE_INACTIVE);\n }",
"function __construct() {\n\t\t\n\t\t// Get the displayed event\n\t\t$this->post \t\t= get_queried_object();\n\t\t$this->post_id \t\t= $this->post->ID;\n\n\t\t// Get the event's calendars\n\t\t$this->get_calendars();\n\n\t\t// Get the event meta\n\t\t$this->get_meta();\n\n\t\t// Process calendar replies\n\t\tif ( isset ( $_POST['submit'] ) && wp_verify_nonce( $_POST['event_rsvp_nonce'] , 'event-rsvp' ) )\n\t\t\t$this->new_rsvp();\n\t}",
"function __construct()\n\t{\n\t\t$this->events[\"AfterSuccessfulLogin\"]=true;\n\n\n\t\t$this->events[\"ModifyMenuItem\"]=true;\n\n\n//\tonscreen events\n\n\n\t\t$this->events[\"IsRecordEditable\"][\"demo_user\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"indschedule\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"loans\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"payroll\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"payrolltab\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"earningadjustment\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"payrollearnadj\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"payrolldeductions\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"payrollstatutories\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"payrolltax\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"payroll21\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"leaves11\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"leavesapp\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"indschedrange\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"empdtr\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"overtimefile\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"payrolldiv\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"leavesapp2\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"filelog\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"filelog1\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"filelog2\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"filelog3\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"demo_user_open\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"overtimefileapp\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"overtimefileapp2\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"demo_useremp\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"payrolltab1\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"indscheduleemp\"] = true;\n\t\t$this->events[\"IsRecordEditable\"][\"demo_useractive\"] = true;\n\n\t\t}",
"private function initData()\n {\n $data = $this->cache->load($this->cacheId);\n if (false === $data) {\n /** @var Reader $reader */\n $reader = $this->readerFactory->create(\n ['fileName' => sprintf(self::SEARCH_PATTERN, $this->componentName)]\n );\n $data = $reader->read();\n $this->cache->save($this->serializer->serialize($data), $this->cacheId);\n } else {\n $data = $this->serializer->unserialize($data);\n }\n\n if (!empty($data)) {\n $this->data[$this->componentName] = [Converter::DATA_ATTRIBUTES_KEY => ['name' => $this->componentName]];\n $this->merge([$this->componentName => $data]);\n $this->data = $this->evaluateComponentArguments($this->data);\n }\n }",
"protected function populateDatastreamInfo() {\n $this->datastreamHistory = $this->getDatastreamHistory();\n $this->datastreamInfo = $this->datastreamHistory[0];\n }",
"public static function initialize()\n {\n date_default_timezone_set('Asia/Shanghai');\n //注册自定义异常\n Di::getInstance()->set(SysConst::HTTP_EXCEPTION_HANDLER,[ExceptionHandler::class,'handle']);\n\n //自定义事件注册\n// TestEvent::getInstance()->set('test', function () {\n// echo 'test event';\n// });\n //TestEvent::getInstance()->set('test','\\App\\Service\\TaskService');//相当于注册一个容器\n\n }",
"protected function __construct() {\n $this->load_data();\n add_action( 'init', array( $this, 'init' ), 0 );\n }",
"public function __construct()\n {\n // Setup internal data arrays\n self::internals();\n }",
"public function initData()\r\n {\r\n $this->data['page_class'] = strtolower('page-' . $this->classname . '-' . $this->methodname) . ' ';\r\n $this->data['class_name'] = $this->classname;\r\n $this->data['method_name'] = $this->methodname;\r\n\r\n //default description and keyword\r\n $this->data['keywords'] = '';\r\n $this->data['description'] = '';\r\n \r\n $this->data['language'] = $this->session->userdata('language');\r\n\r\n if ($this->config->item('test_mode') == TRUE)\r\n {\r\n $this->output->enable_profiler('true');\r\n }\r\n \r\n //see any notifications to display\r\n if (!empty($this->session->flashdata('notification'))) {\r\n $this->data['notification'] = $this->session->flashdata('notification');\r\n $this->data['notification_type'] = $this->session->flashdata('notification_type');\r\n }\r\n\r\n // set csrf\r\n $this->data['csrf'] = array(\r\n 'token_name' => $this->security->get_csrf_token_name(),\r\n 'hash' => $this->security->get_csrf_hash(),\r\n 'cookie_name' => $this->config->item('csrf_cookie_name'),\r\n );\r\n }",
"protected function prepareData()\n {\n parent::prepareData();\n $this->prepareConfigurableProductOptions();\n $this->prepareAttributeSet();\n }",
"public static function init($event) {\n\n\t\t$coupon = $event->getSubject();\n $app = $coupon->app;\n\n $coupon->params = $app->parameter->create($coupon->params);\n\n\t}",
"public function setDatas()\n\t{\n\t\t$this->data[\"skeleton\"] = $this->getSkeleton();\n\t\t$this->data[\"css\"] = $this->getCss();\n\t\t$this->data[\"javascript\"] = $this->getJavascript();\n\t\t$this->data[\"module\"] = $this->getModule();\n\t\t$this->data[\"site\"] = $this->getSite();\n\t\t\t\t\t\t\n\t\t$this->_nodeName = $this->getNodeName();\n\t\t$this->_value = $this->getNodeValue();\n\t}",
"function form_init_data()\r\n {\r\n // Initialize the form fields\r\n\r\n $this->set_hidden_element_value(\"_action\", FT_ACTION_ADD) ;\r\n\r\n $this->set_element_value(\"Meet Start\", array(\"year\" => date(\"Y\"),\r\n \"month\" => date(\"m\"), \"day\" => date(\"d\"))) ;\r\n $this->set_element_value(\"Meet End\", array(\"year\" => date(\"Y\"),\r\n \"month\" => date(\"m\"), \"day\" => date(\"d\"))) ;\r\n\r\n // If the config is set to US only, initialize the country\r\n\r\n if (FT_US_ONLY)\r\n $this->set_element_value(\"Meet Country\",\r\n FT_SDIF_COUNTRY_CODE_UNITED_STATES_OF_AMERICA_VALUE) ;\r\n\r\n $this->set_element_value(\"Pool Altitude\", \"0\") ;\r\n }",
"public function init() {\n\t\tparent::init();\n\t\tadd_action( 'gform_after_submission', array( $this, 'after_submission' ), 10, 2 );\n\t\tadd_filter( 'gform_pre_render', [ $this, 'populate_posts' ] );\n\t\tadd_filter( 'gform_pre_validation', [ $this, 'populate_posts' ] );\n\t\tadd_filter( 'gform_pre_submission_filter', [ $this, 'populate_posts' ] );\n\t\tadd_filter( 'gform_admin_pre_render', [ $this, 'populate_posts' ] );\n\t\tadd_action( 'save_post_tribe_events', [ $this, 'maybe_create_venue' ], 10, 2 );\n\t}",
"public function __construct($data = array())\n {\n $this->setData($data);\n }",
"public function __construct()\n {\n parent::__construct();\n\n // Set data types\n $this->data_types = array(\n 'title' => 'string',\n 'url' => 'url',\n 'url_key' => 'md5',\n 'embed' => 'string',\n 'created_on' => 'datetime'\n );\n\n }",
"function _on_initialize()\n {\n $this->_request_data['content_topic'] = $this->_topic;\n\n /**\n * Prepare the request switch, which contains URL handlers for the component\n */\n\n // Handle /config\n $this->_request_switch['config'] = array\n (\n 'handler' => array('midcom_core_handler_configdm2', 'config'),\n 'schema' => 'config',\n 'fixed_args' => array('config'),\n );\n\n // Handle /\n $this->_request_switch['index'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_index', 'index'),\n );\n \n /* Crud for events */\n // Handle /create_event/<schema name>\n $this->_request_switch['create_event'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_event', 'create'),\n 'fixed_args' => array('create_event'),\n 'variable_args' => 1,\n );\n // Handle /view_event/<event_guid>\n $this->_request_switch['view_event'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_event', 'read'),\n 'fixed_args' => array('view_event'),\n 'variable_args' => 1,\n );\n // Handle /edit_event/<event_guid>\n $this->_request_switch['edit_event'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_event', 'update'),\n 'fixed_args' => array('edit_event'),\n 'variable_args' => 1,\n );\n // Handle /delete_event/<event_guid>\n $this->_request_switch['delete_event'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_event', 'delete'),\n 'fixed_args' => array('delete_event'),\n 'variable_args' => 1,\n );\n \n // /archive/between/<from date>/<to date> shows all events of selected week\n // in Archive mode, only relevant for style code, it sets a flag\n // which allows better URL handling: The request context key 'archive_mode'\n // will be true in this case.\n $this->_request_switch['archive-between'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_list', 'between'),\n 'fixed_args' => array('archive', 'between'),\n 'variable_args' => 2,\n );\n\n // /archive Main archive page\n $this->_request_switch['archive-welcome'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_archive', 'welcome'),\n 'fixed_args' => array('archive'),\n );\n\n // /archive/view/<event GUID> duplicate of the view handler for archive\n // operation, only relevant for style code, it sets a flag\n // which allows better URL handling: The request context key 'archive_mode'\n // will be true in this case.\n $this->_request_switch['archive-view'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_event', 'view'),\n 'fixed_args' => array('archive', 'view'),\n 'variable_args' => 1,\n );\n // Handle /upcoming/trips/<count>\n $this->_request_switch['upcoming_trips'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_list', 'upcoming'),\n 'fixed_args' => array('upcoming', 'trips'),\n 'variable_args' => 1,\n );\n // Handle /upcoming/meetings/<count>\n $this->_request_switch['upcoming_meetings'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_list', 'upcoming'),\n 'fixed_args' => array('upcoming', 'meetings'),\n 'variable_args' => 1,\n );\n \n /* Crud for location */\n // Handle /location/create/<schema name>\n $this->_request_switch['create_location'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_location', 'create'),\n 'fixed_args' => array('location', 'create'),\n 'variable_args' => 1,\n );\n // Handle /location/view/<location_guid>\n $this->_request_switch['view_location'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_location', 'read'),\n 'fixed_args' => array('location', 'view'),\n 'variable_args' => 1,\n );\n // Handle /location/dl_view/<location_guid>\n $this->_request_switch['view_location_dl'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_location', 'read'),\n 'fixed_args' => array('location', 'dl_view'),\n 'variable_args' => 1,\n );\n // Handle /location/edit/<location_guid>\n $this->_request_switch['edit_location'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_location', 'update'),\n 'fixed_args' => array('location', 'edit'),\n 'variable_args' => 1,\n );\n // Handle /location/delete/<location_guid>\n $this->_request_switch['delete_location'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_location', 'delete'),\n 'fixed_args' => array('location', 'delete'),\n 'variable_args' => 1,\n );\n \n // Handle /locations\n $this->_request_switch['locations'] = array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_location', 'index'),\n 'fixed_args' => array('locations'),\n 'variable_args' => 0,\n );\n \n // / shows next N (configured number) events in RSS format\n $this->_request_switch['feed-rss2'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_feed', 'rss'),\n 'fixed_args' => array('rss.xml'),\n );\n\n\t // / shows next N (configured number) events in RSS format\n\t $this->_request_switch['feed-rss2-user'] = Array\n\t (\n\t 'handler' => array('fi_kilonkipinat_events_handler_feed', 'rss'),\n\t 'fixed_args' => array('user', 'rss.xml'),\n\t );\n \n // / shows next N (configured number) events in RSS format\n $this->_request_switch['feed-ical'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_feed', 'ical'),\n 'fixed_args' => array('ical.ics'),\n );\n \n // / shows next N (configured number) meetings in RSS format\n $this->_request_switch['feed-ical-meetings'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_feed', 'ical'),\n 'fixed_args' => array('meetings','ical.ics'),\n );\n \n // / shows next N (configured number) events in RSS format\n $this->_request_switch['feed-ical-trips'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_feed', 'ical'),\n 'fixed_args' => array('trips','ical.ics'),\n );\n\n\t // / shows next N (configured number) events in RSS format\n\t $this->_request_switch['feed-ical-user'] = Array\n\t (\n\t 'handler' => array('fi_kilonkipinat_events_handler_feed', 'ical'),\n\t 'fixed_args' => array('user', 'ical.ics'),\n\t );\n \n\t // / shows next N (configured number) meetings in RSS format\n\t $this->_request_switch['feed-ical-meetings-user'] = Array\n\t (\n\t 'handler' => array('fi_kilonkipinat_events_handler_feed', 'ical'),\n\t 'fixed_args' => array('user', 'meetings','ical.ics'),\n\t );\n \n\t // / shows next N (configured number) events in RSS format\n\t $this->_request_switch['feed-ical-trips-user'] = Array\n\t (\n\t 'handler' => array('fi_kilonkipinat_events_handler_feed', 'ical'),\n\t 'fixed_args' => array('user', 'trips','ical.ics'),\n\t );\n \n $this->_request_switch['feeds'] = Array\n (\n 'handler' => array('fi_kilonkipinat_events_handler_feed', 'index'),\n 'fixed_args' => array('feeds'),\n );\n }",
"public function __construct($data = array()){\r\n\r\n\t\t$this->data = $data;\r\n\r\n\t}",
"public function init() {\n extract($this->data);\n\n //Default link\n if(!$href) {\n $this->data['href'] = \"\";\n }\n\n if($href) {\n $this->data['attributeList']['role'] = \"link\";\n }\n }",
"protected function __construct()\n {\n parent::__construct(\n 'Event',\n array(\n TextField::create(\n 'title',\n array(\n 'mandatory' => true,\n )\n ),\n TextareaField::create(\n 'description',\n array(\n 'use_markdown' => true,\n )\n ),\n TextField::create(\n 'date',\n array()\n ),\n ReferenceField::create(\n 'guest_lists',\n array(\n 'references' => array(\n array(\n 'module' => '\\\\Honeybee\\\\Domain\\\\Guestlist\\\\GuestlistModule',\n 'identity_field' => 'identifier',\n 'display_field' => 'title',\n ),\n ),\n )\n ),\n ReferenceField::create(\n 'assignee',\n array(\n 'max' => 1,\n 'references' => array(\n array(\n 'module' => '\\\\Honeybee\\\\Domain\\\\User\\\\UserModule',\n 'identity_field' => 'identifier',\n 'display_field' => 'username',\n ),\n ),\n )\n ),\n KeyValueField::create(\n 'meta',\n array(\n 'constraints' => array(\n 'value_type' => 'dynamic',\n ),\n )\n ),\n AggregateField::create(\n 'workflowTicket',\n array(\n 'modules' => array(\n '\\\\Honeybee\\\\Domain\\\\Event\\\\WorkflowTicketModule',\n ),\n )\n ),\n ),\n array(\n 'prefix' => 'event',\n 'identifier_field' => 'identifier',\n 'slugPattern' => 'event-{shortId}',\n )\n );\n }",
"public function init($event, $source, $data = null)\n {\n $this->view(__FUNCTION__, [$event, $source, $data]);\n }",
"protected function initialize()\n {\n $this->data = new stdClass();\n $this->data->ownId = null;\n $this->data->amount = new stdClass();\n $this->data->amount->currency = self::AMOUNT_CURRENCY;\n $this->data->amount->subtotals = new stdClass();\n $this->data->items = [];\n $this->data->receivers = [];\n }",
"protected function onInit()\n {\n $this->dataFormat = trim(\n strtolower(\n Utility::get($this->params, \"dataFormat\", \"associate\")\n )\n );\n }",
"function on_creation() {\n $this->init();\n }",
"public function __construct($initialData = array()) {\r\n\t\t\t$this->setData($initialData);\r\n\t\t}",
"protected function init()\n {\n $this->autoRefresh = $this->createAutoRefreshSetting();\n\n // User setting --> textbox converted to int defining a validator and filter\n $this->refreshInterval = $this->createRefreshIntervalSetting();\n\n // User setting --> radio\n $this->color = $this->createColorSetting();\n }",
"public function init()\n {\n parent::init();\n self::$plugin = $this;\n\n Event::on(DataTypes::class, DataTypes::EVENT_AFTER_FETCH_FEED, function(FeedDataEvent $event) {\n if ($event->response['success']) {\n $this->_processFeed($event);\n }\n });\n\n Event::on(DataTypes::class, DataTypes::EVENT_AFTER_PARSE_FEED, function(FeedDataEvent $event) {\n if ($event->response['success']) {\n $this->_enhanceFeed($event);\n }\n });\n }",
"public function __construct()\n {\n $this->templateData = array(\n // Any data that belongs to every template.\n );\n $this->before();\n }",
"public function __construct()\n\t{\n\t\t$this->delegate = Delegate_1::fromMethod($this, 'onEvent');\n\t}",
"protected function onInit() {}",
"public function __construct($data)\n {\n // notice it's not included in the \"toArray\" method.\n $this->instance = $data['instance'];\n $this->id = $data['id'];\n $this->dom = $data['dom'];\n $this->data = $data['data'];\n $this->name = $data['name'];\n $this->checksum = $data['checksum'];\n $this->children = $data['children'];\n $this->events = $data['events'];\n }",
"function __construct($data) {\r\n\t\t$this->annee = (isset($data['annee'])) ? $data['annee'] : \"\";\r\n\t\t$this->tDate = (isset($data['tDate'])) ? $data['tDate'] : \"\";\r\n\t}",
"protected function init() {\n switch ($this->requestType) {\n case 'get':\n $this->getData();\n break;\n\t\t\t\t\n\t\t\tcase 'sendTesteEmail':\n $this->sendTesteEmail();\n break;\n\t\t\t\t\n\t\t\tcase 'sendCreatedIndicationEmail':\n $this->sendCreatedIndicationEmail();\n break;\n }\n }",
"function __construct(){\n $this->sId = Base::getId();\n \n $this->setMostraBarraPerspectivas(true);\n $this->setMostraPerspectivaDia(true);\n $this->setMostraPerspectivaSemana(true);\n $this->setMostraPerspectivaMes(true);\n $this->setMostraHora(true);\n $this->setMostraCabecalhoMes(true);\n $this->setMostraLinksSemana(true);\n $this->setMostraNumerosSemana(false);\n \n $this->oStoreTipoEvento = new Store($this->getId().'-tipo-evento');\n $this->oStoreEvento = new Store($this->getId().'-evento');\n \n $this->aListener = array();\n $this->aAgenda = array();\n }",
"public function __construct() {\n parent::__construct();\n $this->setOdataType('#microsoft.graph.callStartedEventMessageDetail');\n }",
"public function init()\n {\n }",
"public function init()\n {\n }",
"public function init()\n {\n }",
"public function init()\n {\n }",
"public function init()\n {\n }",
"public function init()\n {\n }",
"public function init()\n {\n }",
"public function init()\n {\n }",
"public function init()\n {\n }"
] | [
"0.74530226",
"0.735679",
"0.6879214",
"0.68724734",
"0.6731587",
"0.67141885",
"0.67000586",
"0.663197",
"0.66079795",
"0.6539136",
"0.65346944",
"0.65257126",
"0.6476815",
"0.64699435",
"0.6465292",
"0.6430254",
"0.6416313",
"0.64124554",
"0.64093155",
"0.64049137",
"0.6403957",
"0.63897187",
"0.6376661",
"0.63720685",
"0.6365263",
"0.6347734",
"0.6336094",
"0.6299874",
"0.6299874",
"0.6299874",
"0.6299874",
"0.62936735",
"0.62772584",
"0.6272847",
"0.62428355",
"0.62203526",
"0.6193169",
"0.61478716",
"0.6143586",
"0.613751",
"0.6128278",
"0.6121502",
"0.6118474",
"0.6115697",
"0.6110011",
"0.6092459",
"0.6086552",
"0.6068635",
"0.6053563",
"0.6042386",
"0.6042386",
"0.60226285",
"0.6018663",
"0.60130006",
"0.6011685",
"0.60082746",
"0.5995016",
"0.59921926",
"0.5982968",
"0.59816074",
"0.59700525",
"0.5968875",
"0.59674615",
"0.5966556",
"0.59645903",
"0.5962075",
"0.59580845",
"0.5957894",
"0.5954994",
"0.59526765",
"0.5943705",
"0.5933188",
"0.5932493",
"0.59265614",
"0.59128386",
"0.58939636",
"0.58895296",
"0.5887019",
"0.58799505",
"0.58733255",
"0.58642757",
"0.5856466",
"0.585521",
"0.58531076",
"0.5849745",
"0.5847286",
"0.5846547",
"0.5835013",
"0.5828478",
"0.58217627",
"0.58127904",
"0.5811827",
"0.5811827",
"0.58100575",
"0.58099383",
"0.5809237",
"0.5809237",
"0.5809237",
"0.5809237",
"0.5809237"
] | 0.6940052 | 2 |
Method to checkin/unlock the item | function checkin()
{
if ($this->_id)
{
$event = & JTable::getInstance('eventlist_events', '');
return $event->checkin($this->_id);
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function checkin() {\r\n\t\tif ($this->_id) {\r\n\t\t\t$item = & JTable::getInstance('flexicontent_items', '');\r\n\t\t\treturn $item->checkin($this->_id);\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public function testDestiny2SetItemLockState()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function unlockItem($list_id, $item_id) {\n \\App\\Libraries\\DBHelper::unlockItem($list_id, $item_id);\n return response()->json(['success' => 1]);\n }",
"public function action_checkin()\n\t{\n\t\t$user_id = $this->request->param('id');\n\n\t\t// Check if user already logged in\n\t\t$access = ORM::factory('Access')\n\t\t\t->where('user_id', '=', $user_id)\n\t\t\t->where('checkout', '=', NULL)\n\t\t\t->find();\n\n\t\tif ($access->loaded())\n\t\t{\n\t\t\treturn $this->_flash_success(\n\t\t\t\t'Member has already checkin.',\n\t\t\t\t'admin/member/info/'.$user_id);\n\t\t}\n\n\t\t$access->values(array('user_id' => $user_id, 'checkin' => time()))\n\t\t\t->save();\n\n\t\treturn $this->_flash_success(\n\t\t\t\t'Member has checkin.',\n\t\t\t\t'admin/member/info/'.$user_id);\n\t}",
"public function readunlock() {}",
"function unlock_offer() {\n\n $collectorId = $_SESSION['demo']['user_id'];\n $offerId = $_GET['offerId'];\n $check = mysql_query(\"SELECT status from offer WHERE offer_ID='$offerId'\");\n if ($check) {\n if (mysql_result($check, 0, 'status') == \"booked\") {\n if (mysql_query(\"UPDATE offer SET status ='available' WHERE offer_ID ='$offerId'\"))\n return 1;\n else\n return -1;\n }\n else\n return -1;\n } else {\n return -1;\n }\n}",
"public function walletlock()\n\t{\n\t\treturn $this->_get_error($this->connect('walletlock'));\n\t}",
"function post_restoreItem() {\n\n if ((isset($this->input['_no_history']) && $this->input['_no_history'])\n || (!static::$logs_for_item_1\n && !static::$logs_for_item_2)) {\n return;\n }\n\n if ($this->useDeletedToLockIfDynamic()\n && $this->isDynamic()) {\n $item1 = $this->getConnexityItem(static::$itemtype_1, static::$items_id_1);\n $item2 = $this->getConnexityItem(static::$itemtype_2, static::$items_id_2);\n\n if (($item1 !== false)\n && ($item2 !== false)) {\n if ($item1->dohistory\n && static::$logs_for_item_1) {\n $changes[0] = '0';\n $changes[1] = '';\n $changes[2] = addslashes($this->getHistoryNameForItem1($item2, 'unlock'));\n\n Log::history($item1->getID(), $item1->getType(), $changes, $item2->getType(),\n static::$log_history_1_unlock);\n }\n\n if ($item2->dohistory\n && static::$logs_for_item_2) {\n $changes[0] = '0';\n $changes[1] = '';\n $changes[2] = addslashes($this->getHistoryNameForItem2($item1, 'unlock'));\n Log::history($item2->getID(), $item2->getType(), $changes, $item1->getType(),\n static::$log_history_2_unlock);\n }\n }\n\n }\n }",
"public function checkOut()\n {\n $this->update(['book_status' => 'checkedout']);\n }",
"public function unlock(): void;",
"public function writeunlock() {}",
"public function isLocked() {}",
"function unlockAccount($userid){\n $query = \"UPDATE users_account SET status ='Active' WHERE userid = ?\";\n $paramType = \"i\";\n $paramValue = array(\n $userid\n );\n $this->db_handle->update($query, $paramType, $paramValue);\n }",
"public function a_book_can_be_checked_out()\n {\n $book = Book::factory()->create();\n $user = User::factory()->create();\n\n $book->checkout($user);\n\n $this->assertCount(1, Reservation::all());\n\n $reservation = Reservation::first();\n $this->assertEquals($user->id, $reservation->user_id);\n $this->assertEquals($book->id, $reservation->book_id);\n $this->assertEquals(now(), $reservation->checked_out_at);\n $this->assertNull($reservation->checked_in_at);\n }",
"public function lockItem($list_id, $item_id) {\n \n $this->setFormsRightsMode($list_id, $item_id);\n \n \\App\\Libraries\\DBHelper::lockItem($list_id, $item_id);\n \n return response()->json(['success' => 1]);\n }",
"public function hasUnlock(){\n return $this->_has(3);\n }",
"abstract protected function manage(LockableInterface $resource);",
"public function lock($drop, Cart $cart)\n\t{\n\t}",
"public function unlock() {\n }",
"public function checkLock() {\n\t\t$this->autoRender = false;\n\t\t\n\t\t$HttpSocket = new HttpSocket();\n\t\t$results = $HttpSocket->get('https://api.dropbox.com/1/search/auto/',\n\t\t\tarray(\n\t\t\t\t'query' => 'SystemIsLocked',\n\t\t\t\t'access_token' => 'YOUR_ACCESS_TOKEN'\n\t\t\t)\n\t\t);\n\t\t\n\t\tif(empty(json_decode($results->body))) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"public function isLocked();",
"public function isLocked();",
"public function isLocked();",
"function lockAccount($userid){\n $query = \"UPDATE users_account SET status ='Locked' WHERE userid = ?\";\n $paramType = \"i\";\n $paramValue = array(\n $userid\n );\n $this->db_handle->update($query, $paramType, $paramValue);\n }",
"public function testMethodIsLocked()\n {\n $scorebox = new Scorebox();\n\n $scorebox->setLocked(true);\n\n $status = $scorebox->isLocked();\n\n $expStatus = true;\n\n $this->assertEquals($status, $expStatus);\n }",
"public function unlock(): void {}",
"public function unlock(): void {}",
"public function unlock(): void {}",
"public function unlock(): void {}",
"public function unlock(): void {}",
"public function lock()\n {\n $this->isLocked = true;\n }",
"private function refreshLockInformation()\n {\n $result = self::$db->fetchOne(\n 'SELECT lock, locktime FROM jukebox.playlists WHERE playlistid=$1',\n [$this->getID()]\n );\n $this->lock = empty($result['lock']) ? null : MyRadio_User::getInstance($result['lock']);\n $this->locktime = (int) $result['locktime'];\n }",
"function Unlock($UserID)\n\t{\n\t\tj::SQL(\"UPDATE jfp_xuser SET LockTimeout=? , FailedLoginAttempts=0 WHERE ID=? LIMIT 1\",time(),$UserID);\n\t}",
"public function testMethodSetLocked()\n {\n $scorebox = new Scorebox();\n\n $scorebox->setLocked(true);\n\n $status = $scorebox->isLocked();\n\n $expStatus = true;\n\n $this->assertEquals($status, $expStatus);\n }",
"public function messageLockAction()\n {\n $params=$this->_request->getParams();\n $messageId=$params['messageId'];\n $change_status=$params['status'];\n $usertype=$this->adminLogin->type;\n if($messageId && $change_status=='lock')\n {\n $message=new Ep_Message_Message();\n $status=$message->checkMasterLockstatus($messageId);\n if($status=='unlocked')\n {\n $data['locked_user']=$this->adminLogin->userId;\n $message->updateLockstatus($messageId,$data);\n $this->_redirect(\"/mastermails/master-inbox-ep?submenuId=ML6-SL2\");\n }\n else\n $this->_redirect(\"/mastermails/master-inbox-ep?submenuId=ML6-SL2\");\n }\n elseif($messageId && $change_status=='unlock')\n {\n $message=new Ep_Message_Message();\n $status=$message->checkMasterLockstatus($messageId);\n if($status!='unlocked')\n {\n $data['locked_user']=NULL;\n $message->updateLockstatus($messageId,$data);\n $this->_redirect(\"/mastermails/master-inbox-ep?submenuId=ML6-SL2\");\n }\n else\n $this->_redirect(\"/mastermails/master-inbox-ep?submenuId=ML6-SL2\");\n }\n }",
"public function updateSellIn(): void\n {\n $this->getItem()->sell_in--;\n }",
"function addItem(){\r\n// this means, lets say last week i created a item with code x. then i deleted it.(set lock_item=1)\r\n// today as that item_name doesnt exist anymore, i want to reuse it to another item. i cant do \r\n// insert item query as it will lead to unique index criteria erro. so i must update earlier row.\r\n// current addItem function only sets lock_item=0, but doesnt update other rows.\r\n\r\n\tglobal $item, $lab, $item_name, $cost, $status, $comments, $operation, $connection, $result, $bill_serial,\r\n\t$iv_serial, $product_code, $tequip, $vendor,$comments_sql, $item_name_sql, $product_code_sql;\r\n\tif($item==-1||$lab==-1||$bill_serial==-1){\r\n\t\taddToToast(\"please select Lab/Vendor/Apparatus from dropdown\",0);\r\n\t}\r\n\telse{ \r\n\t\t/*\t\t\tInserting items one by one \t\t\t\t*/\r\n\t\tforeach ($item_name_sql as $key => $value) {\r\n\t\t //checking if the item is presenet in the inventory\r\n\t\t\tif(!doesItemExist(\"inventory\", \"item_code\", $item_name_sql[$key])){ //if item is not present in inventory\r\n\t\t\t\t$query=\"\r\n\t\t\t\tINSERT INTO \r\n\t\t\t\tinventory (\tlab_serial, \r\n\t\t\t\tserial_item, \r\n\t\t\t\titem_code,\r\n\t\t\t\tproduct_code, \r\n\t\t\t\ttequip, \r\n\t\t\t\tcost, \r\n\t\t\t\tstatus,\r\n\t\t\t\treceipt_serial,\r\n\t\t\t\tlast_operation\r\n\t\t\t\t) \r\n\t\t\t\tvalues(\r\n\t\t\t\t{$lab},\r\n\t\t\t\t{$item}, \r\n\t\t\t\t'{$item_name_sql[$key]}',\r\n\t\t\t\t'{$product_code_sql[$key]}',\r\n\t\t\t\t{$tequip}, \r\n\t\t\t\t{$cost},\r\n\t\t\t\t{$status},\r\n\t\t\t\t{$bill_serial},\r\n\t\t\t\t{$operation}\r\n\t\t\t) \";\r\n\t\t\tperform_query($connection, $query, \"failed to insert into inventory\");\r\n\t\t\t\t // to insert into inventory log, but we need serial of that item_code\r\n\t\t\t$iv_serial=mysqli_insert_id($connection);\r\n\t\t\tinventoryLog();\r\n\t\t\taddToToast(\"Created new apparatus of name {$item_name[$key]} of cost {$cost}\",1);\r\n\t\t}\r\n\t\telse{ \t\t\r\n\t\t\t //if item is already present, it may be an error\r\n\t\t\t \t\t\t//probability is that the item may have been locked and now needs to be unlocked\r\n\t\t\t$row=mysqli_fetch_assoc($result);\r\n\t\t\tif(1==$row['lock_item']){\r\n\t\t\t\t$date= date(\"Y-m-d H:i:s\");\r\n\t\t\t\t$query=\"SELECT serial from inventory where item_code={$item_name_sql[$key]}\";\r\n\t\t\t\t$result=perform_query($connection, $query, \"failed to get serial\");\r\n\t\t\t\t$row=mysqli_fetch_assoc($result);\r\n\t\t\t\t$iv_serial=$row['serial'];\r\n\t\t\t\t$query=\"UPDATE \r\n\t\t\t\tinventory \r\n\t\t\t\tset \r\n\t\t\t\tlock_item=0, \r\n\t\t\t\tupdated='{$date}', \r\n\t\t\t\tlab_serial={$lab}, \r\n\t\t\t\tcost={$cost} \r\n\t\t\t\twhere \r\n\t\t\t\titem_code='{$item_name_sql[$key]}'\";\r\n\t\t\t\tperform_query($connection, $query, \"failed to update\");\r\n\t\t\t\t$comments.=\" item was unlocked\";\r\n\t\t\t\tinventoryLog();\r\n\t\t\t\taddToToast(\"{$comments}\",1);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\taddToToast(\"its already present \",0);\r\n\t\t}\t\r\n\t}\r\n\r\n} \r\n}",
"abstract public function checkAccess($userId, $itemName, $params = array());",
"protected function editLockPermissions() {}",
"public function lockCheck($postValues) {\n try {\n if (!empty($postValues)) {\n @$password = $postValues->password;\n\n $fields[] = 'iAdminID';\n\n $condition[] = 'iAdminID = \"' . $this->session->userdata('ADMINID') . '\"';\n $condition[] = 'vPassword = \"' . md5($password) . '\"';\n\n $fields = implode(',', $fields);\n $condition = ' WHERE ' . implode(' AND ', $condition);\n\n $qry = 'SELECT ' . $fields . ' FROM ' . $this->tbl . $condition;\n $res = $this->db->query($qry);\n if ($res->num_rows() > 0) {\n $this->session->set_userdata(array('LOCKED' => FALSE));\n return 1;\n } else {\n $fields = $condition = array();\n $fields[] = 'iUserID';\n\n $condition[] = 'iUserID = \"' . $this->session->userdata('ADMINID') . '\"';\n $condition[] = 'vPassword = \"' . md5($password) . '\"';\n\n $fields = implode(',', $fields);\n $condition = ' WHERE ' . implode(' AND ', $condition);\n\n $qry = 'SELECT ' . $fields . ' FROM tbl_user ' . $condition;\n $res = $this->db->query($qry);\n if ($res->num_rows() > 0) {\n $this->session->set_userdata(array('LOCKED' => FALSE));\n return 1;\n }\n } return -1;\n } return 0;\n } catch (Exception $ex) {\n throw new Exception('Login Model : Error in loginCheck function - ' . $ex);\n }\n }",
"public function unlock()\r\n {\r\n frameEbbs::_()->getModule('backup')->unlock();\r\n }",
"function lock(Sabre_DAV_Locks_LockInfo $lockInfo);",
"private function userUnblock()\n\t{\n\t\t// Make sure the payment is complete\n\t\tif($this->state != 'C') return;\n\t\t\n\t\t// Make sure the subscription is enabled\n\t\tif(!$this->enabled) return;\n\t\t\n\t\t// Paid and enabled subscription; enable the user if he's not already enabled\n\t\t$user = JFactory::getUser($this->user_id);\n\t\tif($user->block) {\n\t\t\t// Check the confirmfree component parameter and subscription level's price\n\t\t\t// If it's a free subscription do not activate the user.\n\t\t\tif(!class_exists('AkeebasubsHelperCparams')) {\n\t\t\t\trequire_once JPATH_ADMINISTRATOR.'/components/com_akeebasubs/helpers/cparams.php';\n\t\t\t}\n\t\t\t$confirmfree = AkeebasubsHelperCparams::getParam('confirmfree', 0);\n\t\t\tif($confirmfree) {\n\t\t\t\t$level = FOFModel::getTmpInstance('Levels', 'AkeebasubsModel')\n\t\t\t\t\t->getItem($this->akeebasubs_level_id);\n\t\t\t\tif($level->price < 0.01) {\n\t\t\t\t\t// Do not activate free subscription\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$updates = array(\n\t\t\t\t'block'\t\t\t=> 0,\n\t\t\t\t'activation'\t=> ''\n\t\t\t);\n\t\t\t$user->bind($updates);\n\t\t\t$user->save($updates);\n\t\t}\n\t}",
"protected function lock()\n {\n $this->isStateLocked = true;\n }",
"public function lock_get()\n\t{\n\t\ttry{\n\n\t\t\t$this->checkCanCandidateId();\n\t\t\t$id = $this->getParameterId();\n\t\t\t$code = 0;\n \n $filters = array(\n \"id\" => $id,\n \"{$this->_candidateIdFkKey}\" =>$this->getCanCandidateId()\n );\n \n\t\t\t// if Lock flag is ON\n\t\t\t// Get object by normal way\n\t\t\t// and check is that the object locked by their-self or another\n\t\t\tif ($this->_model->getLockFlag() == LOCK_FLAG_ON){\n\t\t\t\t\n $objects = $this->_model->getBy($filters);\n if (count($objects)==0){\n throw new Exception ('対象が存在していません。', REST_ER_PAGE_NOTFOUND);\n }\n \n\t\t\t\t//if the current object locked equal this id then this object locked by their self s\n\t\t\t\tif ($id != $this->getCurrentObjectId()){\n\t\t\t\t\t// The object locked by another\n\t\t\t\t\t$code = REST_RESPOND_CANNOT_LOCK;\n\t\t\t\t}\n\t\t\t\t$data = array();\n\t\t\t\tif (count($objects)>0)\n\t\t\t\t\t$data = $objects[0];\n\t\t\t}else {\n $objects = $this->_model->getBy($filters);\n if (count($objects)==0){\n throw new Exception ('対象が存在していません。', REST_ER_PAGE_NOTFOUND);\n }\n \n\t\t\t\t// if the lock flag is off\n\t\t\t\t// get and lock this object\n\t\t\t\t$result = $this->_model->getByIdAndLock($id);\n\t\t\t\tif ($result['transStatus']){\n\t\t\t\t\t// set the current locked object id\n\t\t\t\t\t$this->setCurrentObjectId($id);\n\t\t\t\t}else {\n\t\t\t\t\tthrow new Exception('ロック処理に失敗しました。', REST_ER_TRANSACTION_ERROR);\n\t\t\t\t}\n\t\t\t\t$data = $result['data'];\n\n\t\t\t}\n\t\t\t$respond = array(\n\t\t\t\t'code' => $code,\n\t\t\t\t'datetime'=> date('Y-m-d H:i:s', time()),\n\t\t\t\t'data' => $data\n\t\t\t);\n\t\t\t$this->response($respond);\n\t\t}catch( Exception $e ){\n\t\t\t$message = $e->getMessage();\n\t\t\t$code = $e->getCode();\n\t\t\t$this->error_response($message,$code);\n\t\t}\n\n\t}",
"public function edit(CheckIn $checkIn)\n {\n //\n }",
"public function unlockAction()\r\n {\r\n $timesheet = $this->byId();\r\n $this->projectService->unlockTimesheet($timesheet);\r\n $this->redirect('timesheet', 'edit', array('clientid'=>$timesheet->clientid, 'projectid'=>$timesheet->projectid, 'id'=>$timesheet->id));\r\n }",
"function checkout($uid = null) {\r\n\t\tif ($this->_id) {\r\n\t\t\t// Make sure we have a user id to checkout the group with\r\n\t\t\tif (is_null($uid)) {\r\n\t\t\t\t$user\t=& JFactory::getUser();\r\n\t\t\t\t$uid\t= $user->get('id');\r\n\t\t\t}\r\n\t\t\t// Lets get to it and checkout the thing...\r\n\t\t\t$item = & JTable::getInstance('flexicontent_items', '');\r\n\t\t\treturn $item->checkout($uid, $this->_id);\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"protected function do_unlock($obj) {\n\t\t$this->debug(\"-- do_unlock($obj)\");\n\n\t\t$this->send(self::REQ_REL_LOCK, $obj);\n\n\t\tlist($op, $p) = $this->receive();\n\n\t\tif ($op != self::REP_LOCK_RELEASED) {\n\t\t\tthrow new LockException($this->decode_reply($op) . \": \" . $p);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public function lock()\r\n {\r\n frameEbbs::_()->getModule('backup')->lock();\r\n }",
"public function approveItem()\n {\n if ($this->getItem()->getType() == \\Apprecie\\Library\\Items\\ItemTypes::EVENT) {\n if ($this->getStatus() == \\Apprecie\\Library\\Items\\ApprovalState::APPROVED) {\n return true;\n }\n\n $org = Organisation::getActiveUsersOrganisation();\n $event = Event::findFirstBy('itemId', $this->getItemId());\n\n $event->setState(\\Apprecie\\Library\\Items\\ItemState::APPROVED);\n $event->update();\n\n if (!$org->addEventToVault($event)) {\n $this->appendMessageEx($org);\n $this->logActivity('Failed xx addEventToVault() inside approve method', 'messages ' . _ms($org));\n return false;\n } //@todo gh use transaction\n\n $this->setStatus(\\Apprecie\\Library\\Items\\ApprovalState::APPROVED);\n $this->setVerifiedByUserId($this->getDI()->getDefault()->get('auth')->getAuthenticatedUser()->getUserId());\n $this->update();\n } else {\n throw new \\Phalcon\\Exception('approveItem work flow not implemented for non events');\n }\n }",
"public function update_account() {\n global $dbconfig;\n\n $user_id = $this->params['user_id'];\n $status = isset($this->params['status']) ? $this->params['status'] : BLOCKED;\n $account_dbobj = $this->params['account_dbobj'];\n $user_status = BLOCKED;\n $store_status = PENDING;\n\n if($status === ACTIVATED) {\n $user_status = CREATED;\n $store_status = PENDING;\n }\n\n // update users table\n $user_obj = new User($account_dbobj, $user_id);\n $user_obj->setStatus($status);\n $user_obj->save();\n\n $user = BaseModel::findCachedOne($dbconfig->account->name . \".user?id=$user_id\");\n if(!empty($user['store_id'])){\n $store_id = $user['store_id'];\n // store need to manually launch\n $store_obj = new Store($account_dbobj, $store_id);\n if($store_obj->getId()) {\n $store_obj->setStatus($store_status);\n $store_obj->save();\n if($store_status != ACTIVATED){\n GlobalProductsMapper::deleteProductsInStore($account_dbobj, $store_id);\n }\n }\n }\n }",
"static function unlock_account() {\n $model = \\Auth::$model;\n\n # hash GET param exists\n if ($hash = data('hash')) {\n\n # verificando se ha algum usuário com a hash.\n $user = $model::first(array(\n 'fields' => 'id, hash_unlock_account',\n 'where' => \"hash_unlock_account = '$hash'\"\n ));\n\n if (!empty($user)) {\n $user->hash_unlock_account = '';\n $user->login_attempts = 0;\n\n $user->edit() ?\n flash('Sua conta foi desbloqueada.') :\n flash('Algo ocorreu errado. Tente novamente mais tarte.', 'error');\n }\n }\n\n go('/');\n }",
"public function handleCheckoutLocker() {\n // Ensure the required parameters exist\n $this->requireParam('lockerId');\n\t\t$this->requireParam('userId');\n\t\t$this->requireParam('messageId');\n $body = $this->requestBody;\n\n\t\t$user = $this->userDao->getUserbyId($body['userId']);\n\t\t$locker = $this->lockerDao->getLockerByID($body['lockerId']);\n\t\t$message = $this->messageDao->getMessageByID($body['messageId']);\n\n\t\t // Update the Message\n $locker->setUserId($body['userId']);\n \n $ok = $this->lockerDao->updateLocker($locker);\n if(!$ok) {\n $this->respond(new Response(Response::INTERNAL_SERVER_ERROR, 'Locker Failed to Checkout'));\n }\n\n\t\t$mailer = New TekBotsMailer('[email protected]');\n $ok = $mailer->sendLockerEmail($user, $locker, $message);\n\t\tif(!$ok) {\n $this->respond(new Response(Response::INTERNAL_SERVER_ERROR, 'Email sned Failed'));\n }\n\n $this->respond(new Response(Response::OK, 'Locker Checkout Sucessful'));\n\n }",
"public function toggleUserLock($userid) {\n\t\t$adminModel = $this->loadModel('admin');\n\t\t$user = $adminModel->getUser($userid);\n\t\tif ($user->user_status == 1) {\n\t\t\t$adminModel->setUserStatus($userid, 2);\n\t\t} elseif ($user->user_status == 2) {\n\t\t\t$adminModel->setUserStatus($userid, 1);\n\t\t}\n\t\theader('Location: '.URL.'admin/users');\n\t}",
"public function LockUser($email)\n\t {\n $sql = \"Update user \"\n\t\t\t\t. \" SET islocked = '0'\"\n\t\t\t\t. \" WHERE email = '\"\n\t\t\t\t. $email . \"'\";\n \n return parent::execute($sql);\n\n }",
"function lockout($username = \"\") {\n\t\tglobal $wpdb;\n\n\t\t$ip = $this->get_user_ip();;\n\n\t\t$username = sanitize_user($username);\n\n\t\t$user = get_user_by( 'login', $username );\n\n\t\tif ( !$user ) { \n\t\t\t$user = new stdClass();\n\t\t\t$user->ID = 0;\n\t\t}\n\n\t\t$sql = \"insert into \" . $this->lock_table . \" (user_id, lockdown_date, release_date, lockdown_IP) \" .\n\t\t\t \"values ('\" . $user->ID . \"', NOW(), date_add( NOW(), interval \" .\n\t\t\t $this->ll_options['lockout_length'] . \" MINUTE), '\" . $wpdb->escape($ip) . \"')\";\n\n\t\t$wpdb->query($sql);\n\n\t\tif ( 'yes' == $this->ll_options['notify_admins'] )\n\t\t\t$this->ll_notify_admins( $ip, $username );\n\n\t}",
"public function unlockTeam()\n\t\t{\n\t\t\t$lockedteam = array();\n\t\t\t$lockedteam['id'] = $this->team->id;\n\t\t\t$lockedteam['teamvalue'] = ($this->players[0]->playervalue)+($this->team->RR)*($this->team->RRcost)+($this->team->FF)*10000+($this->team->A_Coach)*10000+($this->team->CheerLeader)*10000+($this->team->Apoth)*50000;\n\t\t\t$lockedteam['locked'] = 0;\n\t\t\t$table = $this->getTable('Teams','BloodBowlTable');\n\t\t\treturn $table->updTeam($lockedteam);\n\t\t\t//return true;\n\t\t}",
"public function edit(CheckOut $checkOut)\n {\n //\n }",
"function wp_check_post_lock($post)\n {\n }",
"public function tree_lock() {\n global $db, $uid;\n\n if (($this->lock_user != false) && ($this->lock_user != $uid)) {\n // Baum ist bereits von einem anderen Benutzer gesperrt\n $lock_stamp = false;\n $this->error = \"ERR_ALREADY_LOCKED\";\n return false;\n } else if (($this->lock_user != false) && ($this->lock_user == $uid)) {\n // Eigene Sperre bereits aktiv\n $this->lock_stamp = time();\n $this->lock_expire = time() + 300;\n $result = $db->querynow(\"UPDATE `lock` SET STAMP_UPDATE='\".date('Y-m-d H:i:s', $this->lock_stamp).\"',\n STAMP_EXPIRE='\".date('Y-m-d H:i:s', $this->lock_expire).\"'\n WHERE FK_USER=\".$uid.\" AND IDENT='\".$this->table.$this->root.\"'\");\n if (!$result['str_error']) {\n $this->lock_user = $uid;\n return true;\n } else {\n $this->error = \"ERR_LOCK_FAILED\";\n $this->lock_stamp = 0;\n $this->lock_expire = 0;\n $this->lock_user = false;\n return false;\n }\n } else {\n // Baum nicht gesperrt, Sperre hinzu\n $this->lock_stamp = time();\n $this->lock_expire = time() + 300;\n $result = $db->querynow(\"INSERT INTO `lock` (FK_USER, IDENT, STAMP_UPDATE, STAMP_EXPIRE) VALUES\n (\".$uid.\",'\".$this->table.$this->root.\"', '\".date('Y-m-d H:i:s', $this->lock_stamp).\"', '\".\n date('Y-m-d H:i:s', $this->lock_expire).\"')\");\n if (!$result['str_error']) {\n $this->lock_user = $uid;\n return true;\n } else {\n $this->error = \"ERR_LOCK_FAILED\";\n $this->lock_user = false;\n return false;\n }\n }\n }",
"public function UserListChangeStatus(): void{\n \n if(!ArtworkVerifier::setStatusList($_POST) || !Session::isLogin()){\n exit;\n }\n \n if(isset(UserList::where('user_list.user_id', Session::getUser()['id'])->where('user_list.artwork_id', $_POST['artwork_id'])->getOne()->id)){\n UserList::values([ 'user_list.status' => $_POST['status'] ])\n ->where('user_id' ,Session::getUser()['id'])\n ->where('artwork_id', $_POST['artwork_id'])\n ->update();\n exit;\n }\n }",
"private function getLock( & $article )\n {\n // lock the user to edit\n $result = $this->model->action('article','lock',\n array('job' => 'is_locked',\n 'id_article' => (int)$article['id_article'],\n 'by_id_user' => (int)$this->viewVar['loggedUserId']) );\n \n if(($result !== TRUE) && ($result !== FALSE))\n {\n $article['lock'] = TRUE; \n } \n else\n {\n $article['lock'] = FALSE; \n } \n }",
"function block(Request $request)\n {\n DB::table('users')\n ->where('id', $request->id)\n ->update([\n 'active' => '0',\n ]); \n\n AuditTrail::create(['user_id' => Auth::user()->id,\n 'username' => Auth::user()->username,\n 'form_name' => 'Account',\n 'activity' => 'Locked ' . 'Account ' . $request->username, \n ]);\n\n return redirect()->back();\n }",
"public function unlockgroupAction()\n {\n \t//Don't display a new view\n \t$this->_helper->viewRenderer->setNoRender();\n \t//Don't use the default layout since this isn't a view call\n \t$this->_helper->layout->disableLayout();\n \n \t$group = GroupNamespace::getCurrentGroup();\n \t$date = $this->getRequest()->getParam('unlockuntildateinput');\n \t$zenddate = new Zend_Date($date, ACORNConstants::$ZEND_DATE_FORMAT);\n \t$date = $zenddate->toString(ACORNConstants::$ZEND_INTERNAL_DATE_FORMAT);\n \n \t$items = $group->getRecords();\n \t$success = UnlockedItemsDAO::getUnlockedItemsDAO()->unlockItems($items, $date);\n \t\n \tif ($success)\n \t{\n \t\t$group = GroupDAO::getGroupDAO()->getGroup($group->getPrimaryKey());\n \t\tGroupNamespace::setCurrentGroup($group);\n \t}\n \n \t$jsonstring = Zend_Json::encode(array('UnlockSuccessful' => $success));\n \t$this->getResponse()->setHeader('Content-Type', 'application/json')\n \t->setBody($jsonstring);\n }",
"public function checkin( $oid=null );",
"public function buy($itemid)\n {\n //check for valid id for eg. it should be numeric\n //do buying\n\n }",
"public function lockPayments()\n {\n $this -> lock_payments = true;\n $this -> save();\n }",
"public function claim($time = 600) {\n $this->locked = time() + $time;\n $this->save();\n }",
"public function claim($time = 600) {\n $this->locked = time() + $time;\n $this->save();\n }",
"public function sellItem($ItemID)\n {\n $Item = $this->getItem($ItemID);\n if (!$Item) {\n return false;\n }\n\n if ($Item->delete()) {\n return $this->mysql->QUERY(\n 'UPDATE player_data SET CREDITS = CREDITS + ? WHERE USER_ID = ? AND PLAYER_ID = ?',\n [\n $Item->SELLING_CREDITS,\n $this->user->USER_ID,\n $this->user->PLAYER_ID,\n ]\n );\n } else {\n return false;\n }\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 isDisabled()\n{\n $obDB = new cstDB();\n $obDB->doQuery('SELECT ownerID from AuctionItems where itemID='.$_GET[\"itemID\"].' LIMIT 1');\n $result=$obDB->fetchAssocResult();\n \n \n if(!isset($_SESSION[\"user\"]) )\n {\n return \"disabled\";\n }\n else if(count($result)!=0)\n {\n if($result[0][\"ownerID\"]==$_SESSION[\"user\"])\n {\n return \"disabled\";\n }\n }\n \n return \"\";\n}",
"public function updateUser(ItemRequest $request,$id)\n {\n $user = User::find($id);\n if($user){\n $user->blocked = 1;\n $user->blocked = 0; \n $user->save();\n $status = 1/0;\n\n event(new AddLogs(Auth::user()->id,'ID: '.$user->id.' Status: '.$status));\n return redirect()->back()->with('message','saved');\n }\n return redirect()->back()->with('errMessage','error');\n }",
"public function approve_swap($data){\n $query = $this->db->query('UPDATE swap_reqs SET swap_status=\"Completed\", `end_time`=CURRENT_TIMESTAMP WHERE swap_UID= \"'.$data['swap_UID'].'\" ');\n //this will make book 1 unavailable\n $query = $this->db->query('UPDATE user_books SET `availability`=0 WHERE `UID`=\"'.$data['b1_UID'].'\" ');\n //this will make book 2 unavailable\n $query = $this->db->query('UPDATE user_books SET `availability`=0 WHERE `UID`=\"'.$data['b2_UID'].'\" ');\n }",
"public function maybeLockouts() {\n\t\tdo_action( 'wd_before_lockout' );\n\t\t$settings = Settings::instance();\n\t\t$isTest = HTTP_Helper::retrieveGet( 'def-lockout-demo', false ) == 1;\n\t\tif ( $isTest ) {\n\t\t\t$message = null;\n\t\t\t$type = HTTP_Helper::retrieveGet( 'type' );\n\t\t\tswitch ( $type ) {\n\t\t\t\tcase 'login':\n\t\t\t\t\t$message = $settings->login_protection_lockout_message;\n\t\t\t\t\tbreak;\n\t\t\t\tcase '404':\n\t\t\t\t\t$message = $settings->detect_404_lockout_message;\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'blacklist':\n\t\t\t\t\t$message = $settings->ip_lockout_message;\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$message = __( \"Demo\", \"defender-security\" );\n\t\t\t}\n\t\t\t$this->renderPartial( 'locked', array(\n\t\t\t\t'message' => $message\n\t\t\t) );\n\t\t\tdie;\n\t\t}\n\t\t\n\t\t$ip = $this->getUserIp();\n\t\t$arr = $this->defaultWhiteListIps();\n\t\t$cache = WP_Helper::getCache();\n\t\t$temp_whitelist = $cache->get( 'staff_ips', [] );\n\t\tif ( $this->listenToStaffAccess() ) {\n\t\t\t//tmp whitelist this ip till the access end\n\t\t\t$temp_whitelist[] = $ip;\n\t\t\t$temp_whitelist = array_unique( $temp_whitelist );\n\t\t\t$temp_whitelist = array_filter( $temp_whitelist );\n\t\t\t$cache->set( 'staff_ips', $temp_whitelist, DAY_IN_SECONDS );\n\t\t\tUtils::instance()->log( sprintf( 'Temporary whitelist ip %s', $ip ), 'lockout' );\n\t\t}\n\t\t$arr = array_merge( $arr, $temp_whitelist );\n\t\t\n\t\tif ( in_array( $ip, $arr ) ) {\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif ( $settings->isWhitelist( $ip ) ) {\n\t\t\treturn;\n\t\t} elseif ( $settings->isBlacklist( $ip ) ) {\n\t\t\tif ( ! defined( 'DONOTCACHEPAGE' ) ) {\n\t\t\t\tdefine( 'DONOTCACHEPAGE', true );\n\t\t\t}\n\t\t\theader( 'HTTP/1.0 403 Forbidden' );\n\t\t\theader( 'Cache-Control: private' );\n\t\t\t$this->renderPartial( 'locked', array(\n\t\t\t\t'message' => $settings->ip_lockout_message\n\t\t\t) );\n\t\t\tdie;\n\t\t} elseif ( $settings->isCountryBlacklist() ) {\n\t\t\tif ( ! defined( 'DONOTCACHEPAGE' ) ) {\n\t\t\t\tdefine( 'DONOTCACHEPAGE', true );\n\t\t\t}\n\t\t\theader( 'HTTP/1.0 403 Forbidden' );\n\t\t\theader( 'Cache-Control: private' );\n\t\t\t$this->renderPartial( 'locked', array(\n\t\t\t\t'message' => $settings->ip_lockout_message\n\t\t\t) );\n\t\t\tdie;\n\t\t} else {\n\t\t\tif ( is_user_logged_in() ) {\n\t\t\t\t//if current user can logged in, and no blacklisted we don't need to check the ip\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t\n\t\t\t$model = IP_Model::findOne( array(\n\t\t\t\t'ip' => $ip\n\t\t\t) );\n\t\t\tif ( is_object( $model ) && $model->is_locked() ) {\n\t\t\t\tif ( ! defined( 'DONOTCACHEPAGE' ) ) {\n\t\t\t\t\tdefine( 'DONOTCACHEPAGE', true );\n\t\t\t\t}\n\t\t\t\theader( 'HTTP/1.0 403 Forbidden' );\n\t\t\t\theader( 'Cache-Control: private' );\n\t\t\t\t$this->renderPartial( 'locked', array(\n\t\t\t\t\t'message' => $model->lockout_message\n\t\t\t\t) );\n\t\t\t\tdie;\n\t\t\t}\n\t\t}\n\t}",
"public function lockToNormal() {}",
"function _admin_notice_post_locked()\n {\n }",
"function approve_return($item_id) {\n $this->db->where('item_id', $item_id);\n $this->db->update('items', array('status' => 0)); // set the item status to returned\n //delete the item \n return $this->db->delete('items_collection', array('item_id' => $item_id));\n }",
"public function checkin($id = null)\n\t{\n\t}",
"public function enableLocked()\n\t{\n\t\t$this->_locked = true;\n\t}",
"function update_basket (array $data)\n {\n// debug_print ('INFO: Update Basket', $data);\n global $connection;\n// $member_id_you = $_SESSION['member_id'];\n $producer_id_you = $_SESSION['producer_id_you'];\n // Allow admins to override certain checks if the requested action is not for themselves\n $admin_override = true;\n if ($member_id_you == $data['member_id'] || ! CurrentMember::auth_type('cashier'))\n {\n $admin_override = false;\n }\n// Set this value manually when converting from transactions to ledger accounting\n$admin_override = true;\n // Set flags for needed validations and operations\n switch ($data['action'])\n {\n // checkout will checkout all the items in the basket\n case 'checkout':\n $test_for_membership_privilege = true;\n $test_customer_ordering_window = true;\n $initiate_set_checkout = true;\n $initiate_checkout_items = true;\n break;\n // same as \"checkout\" but only synchs items that were already checked out\n case 'synch_ledger_items':\n $test_for_membership_privilege = true;\n $test_customer_ordering_window = true;\n $initiate_set_checkout = true;\n $synch_ledger_items = true;\n break;\n // set_uncheckout is currently disabled\n case 'set_checkout':\n $test_for_membership_privilege = true;\n $test_customer_ordering_window = true;\n $initiate_set_checkout = true;\n break;\n // un_checkout is currently disabled\n case 'un_checkout':\n $test_customer_ordering_window = true;\n $initiate_un_checkout = true;\n break;\n // update the site (Pickup|Home|Work)\n case 'set_site':\n $update_site = true;\n break;\n default:\n die(debug_print('ERROR: 679217 ', 'unexpected request', basename(__FILE__).' LINE '.__LINE__));\n break;\n }\n // Get information about the basket for this member\n // Prefer to access basket by basket_id\n if ($data['basket_id'] != 0)\n {\n $basket_info = get_basket ($data['basket_id']);\n }\n // Then try with member_id/delivery_id combination\n elseif ($data['member_id'] != 0 && $data['delivery_id'] != 0)\n {\n $basket_info = get_basket ($data['member_id'], $data['delivery_id']);\n }\n // Otherwise we don't know enough to get the basket\n else\n {\n die(debug_print('ERROR: 970893 ', 'incomplete information to locate basket', basename(__FILE__).' LINE '.__LINE__));\n }\n // Check that we actually got some basket information\n if (! is_array ($basket_info))\n {\n die(debug_print('ERROR: 701854 ', 'basket does not exist', basename(__FILE__).' LINE '.__LINE__));\n }\n // Check that the member is not pending or discontinued\n if ($test_for_membership_privilege && ! $admin_override)\n {\n if ($member_info['pending'] == 1 || $member_info['membership_discontinued'] == 1)\n {\n die(debug_print('ERROR: 974383 ', 'incorrect privilege to order', basename(__FILE__).' LINE '.__LINE__));\n }\n }\n // Check if shopping is closed for this order\n if ($test_customer_ordering_window && ! $admin_override && !(new ActiveCycle())->is_open_for_ordering())\n {\n die(debug_print('ERROR: 823186 ', 'customer ordering period is not in effect', basename(__FILE__).' LINE '.__LINE__));\n }\n // Update the basket with a new site and information related to the new site\n if ($update_site)\n {\n\ndebug_print (\"ERROR: 892573 \", \"UPDATE DELCODE\", basename(__FILE__).' LINE '.__LINE__);\n\n if ($data['delivery_type'] == 'H' || $data['delivery_type'] == 'W') $query_delivery_type = 'D'; // H[ome] and W[ork] --> D[elivery]\n else $query_delivery_type = $data['delivery_type']; // P[ickup]\n // Could check for changes and abort otherwise, but this will force updating\n // delivery_postal_code just in case it might have changed.\n $query_site = '\n SELECT\n delivery_charge,\n delivery_postal_code\n FROM '.NEW_TABLE_SITES.'\n WHERE\n site_id = \"'.mysql_real_escape_string($data['site_id']).'\"\n AND delivery_type = \"'.$query_delivery_type.'\"\n AND inactive = \"0\"\n AND site_type = \"customer\"';\n $result_site = mysql_query($query_site, $connection) or die(debug_print (\"ERROR: 892573 \", array ($query_site,mysql_error()), basename(__FILE__).' LINE '.__LINE__));\n // Got we some information, then post the new information\n if ($row_site = mysql_fetch_array($result_site))\n {\n\n $query_update_basket = '\n UPDATE '.NEW_TABLE_BASKETS.'\n SET\n delivery_cost = \"'.mysql_real_escape_string($row_site['delivery_charge']).'\",\n delivery_postal_code = \"'.mysql_real_escape_string($row['delivery_postal_code']).'\",\n site_id = \"'.mysql_real_escape_string($data['site_id']).'\",\n delivery_type = \"'.mysql_real_escape_string($data['delivery_type']).'\"\n WHERE basket_id = \"'.mysql_real_escape_string($basket_info['basket_id']).'\"';\n $result_update_basket = mysql_query($query_update_basket, $connection) or die(debug_print (\"ERROR: 892764 \", array ($query_update_basket,mysql_error()), basename(__FILE__).' LINE '.__LINE__));\n\ndebug_print (\"INFO: 892573 \", $query_update_basket, basename(__FILE__).' LINE '.__LINE__);\n\n // Update the $basket_info with changes\n $basket_info['delivery_cost'] = $row_site['delivery_charge'];\n $initiate_delivery_charge = true;\n }\n // Otherwise error\n else\n {\n die(debug_print('ERROR: 898952 ', 'requested site does not exist or is not available', basename(__FILE__).' LINE '.__LINE__));\n }\n }\n // Change the checked_out setting on the basket\n // Do this early so the update_basket_item will process the ledger items (only if they are in a checked-out state)\n if ($initiate_set_checkout)\n {\n // Get the number of items in the basket that are checked out\n $query = '\n SELECT\n '.NEW_TABLE_PRODUCTS.'.tangible,\n COUNT('.NEW_TABLE_BASKET_ITEMS.'.bpid) AS count\n FROM\n '.NEW_TABLE_BASKET_ITEMS.'\n LEFT JOIN\n '.NEW_TABLE_PRODUCTS.' USING(product_id,product_version)\n WHERE\n '.NEW_TABLE_BASKET_ITEMS.'.basket_id = \"'.mysql_real_escape_string($basket_info['basket_id']).'\"\n GROUP BY\n '.NEW_TABLE_PRODUCTS.'.tangible';\n $result = mysql_query($query, $connection) or die(debug_print (\"ERROR: 758023 \", array ($query,mysql_error()), basename(__FILE__).' LINE '.__LINE__));\n while ($row = mysql_fetch_array($result))\n {\n if ($row['tangible'] == '0') $intangible_count = $row['count'];\n if ($row['tangible'] == '1') $tangible_count = $row['count'];\n }\n // Preference is to set basket count to the number of *tangible* items in the basket\n if ($tangible_count > 0) $checked_out = $tangible_count;\n // Otherwise if there are no tangible items, we set to [negative] the number of *intangible* items in the basket\n elseif ($intangible_count > 0) $checked_out = 0 - $intangible_count;\n // Otherwise the basket is empty.\n else $checked_out = 0;\n $query = '\n UPDATE '.NEW_TABLE_BASKETS.'\n SET checked_out = \"'.mysql_real_escape_string($checked_out).'\"\n WHERE basket_id = \"'.mysql_real_escape_string($basket_info['basket_id']).'\"';\n $result = mysql_query($query, $connection) or die(debug_print (\"ERROR: 892764 \", array ($query,mysql_error()), basename(__FILE__).' LINE '.__LINE__));\n // Sync the variable we just changed\n $basket_info['checked_out'] = $checked_out ;\n\n // If there is an order cost (fixed), then post it (or clear it if wrongly set).\n if ($basket_info['order_cost'] != 0 &&\n $basket_info['order_cost_type'] == 'fixed' &&\n $basket_info['checked_out'] != 0)\n {\n // Add the order cost to the ledger for this basket\n $ledger_status = basket_item_to_ledger(array (\n 'transaction_group_id' => $data['transaction_group_id'],\n 'source_type' => 'member',\n 'source_key' => $data['member_id'],\n 'target_type' => 'internal',\n 'target_key' => 'order_cost',\n 'amount' => $basket_info['order_cost'],\n 'text_key' => 'order cost',\n 'posted_by' => $_SESSION['member_id'],\n 'basket_id' => $basket_info['basket_id'],\n 'site_id' => $basket_info['site_id'],\n 'delivery_id' => $basket_info['delivery_id'],\n 'match_keys' => array ('source_type','source_key','target_type','target_key','text_key','basket_id')\n ));\n }\n // If there is an order cost (percent), then post it (or clear it if wrongly set).\n elseif ($basket_info['order_cost'] != 0 &&\n $basket_info['order_cost_type'] == 'percent' &&\n $basket_info['checked_out'] != 0)\n {\n // First need to know the basket total to calculate the percent cost\n $query = '\n SELECT\n SUM(amount) AS order_total\n FROM\n '.NEW_TABLE_LEDGER.'\n WHERE\n basket_id = \"'.mysql_real_escape_string($basket_info['basket_id']).'\"\n AND (text_key = \"quantity cost\"\n OR text_key = \"weight cost\")';\n $result = mysql_query($query, $connection) or die(debug_print (\"ERROR: 678304 \", array ($query,mysql_error()), basename(__FILE__).' LINE '.__LINE__));\n if ($row = mysql_fetch_array($result))\n {\n $order_total = $row['order_total'];\n $order_cost_total = round ($row['order_total'] * $basket_info['order_cost'] / 100, 2);\n }\n // Add the order cost to the ledger for this basket\n $ledger_status = basket_item_to_ledger(array (\n 'transaction_group_id' => $data['transaction_group_id'],\n 'source_type' => 'member',\n 'source_key' => $data['member_id'],\n 'target_type' => 'internal',\n 'target_key' => 'order_cost',\n 'amount' => $basket_info['order_cost'],\n 'text_key' => 'order cost',\n 'posted_by' => $_SESSION['member_id'],\n 'basket_id' => $basket_info['basket_id'],\n 'site_id' => $basket_info['site_id'],\n 'delivery_id' => $basket_info['delivery_id'],\n 'match_keys' => array ('source_type','source_key','target_type','target_key','text_key','basket_id')\n ));\n }\n }\n // For checkout, synchronize ledger entries to all basket_items\n if ($initiate_checkout_items || $synch_ledger_items)\n {\n // $initiate_checkout_items: check out all items and synch ledger\n // $synch_ledger_items: repost existing checked_out items to the ledger\n if ($synch_ledger_items)\n {\n // Restrict to just the checked_out items\n $query_where = '\n AND checked_out != \"0\"';\n }\n // Get the items currently in the basket\n $query_basket_items = '\n SELECT\n bpid,\n product_id,\n product_version\n FROM '.NEW_TABLE_BASKET_ITEMS.'\n WHERE basket_id = \"'.mysql_real_escape_string($basket_info['basket_id']).'\"'.\n $query_where;\n $result_basket_items = mysql_query($query_basket_items, $connection) or die(debug_print (\"ERROR: 892785 \", array ($query_basket_items,mysql_error()), basename(__FILE__).' LINE '.__LINE__));\n // Go through all the basket items (or all the checked_out items)\n while ($row_basket_items = mysql_fetch_array($result_basket_items))\n {\n $basket_item_info = update_basket_item (array(\n 'action' => 'synch_ledger',\n 'delivery_id' => $data['delivery_id'],\n 'member_id' => $data['member_id'],\n 'product_id' => $row_basket_items['product_id'],\n 'product_version' => $row_basket_items['product_version']\n ));\n if (! is_array($basket_item_info))\n {\n $basket_info['checked_out'] = 0;\n die(debug_print (\"ERROR: 902784 \", 'update_basket_item() did not return array.', basename(__FILE__).' LINE '.__LINE__));\n }\n }\n }\n // This is done for any/all changes, so not conditional except for baskets that are not checked-out.\n if ($basket_info['checked_out'] != 0)\n {\n // If there is a delivery charge, then post it (or clear it if wrongly set).\n if ($basket_info['delivery_cost'] != 0 || $initiate_delivery_charge)\n {\n // Add the delivery cost to the ledger for this basket\n $ledger_status = basket_item_to_ledger(array (\n 'transaction_group_id' => $data['transaction_group_id'],\n 'source_type' => 'member',\n 'source_key' => $data['member_id'],\n 'target_type' => 'internal',\n 'target_key' => 'delivery_cost',\n 'amount' => $basket_info['delivery_cost'],\n 'text_key' => 'delivery cost',\n 'posted_by' => $_SESSION['member_id'],\n 'basket_id' => $basket_info['basket_id'],\n 'site_id' => $basket_info['site_id'],\n 'delivery_id' => $basket_info['delivery_id'],\n 'match_keys' => array ('source_type','source_key','target_type','target_key','text_key','basket_id')\n ));\n }\n }\n\n// // For un_checkout, clear all ledger entries related to the basket and basket_items\n// // This will remove or clear the cost of ledger entries for all products in the basket\n// if ($initiate_un_checkout)\n// {\n// // Get the items currently in the basket\n// $query_basket_items = '\n// SELECT\n// bpid,\n// product_id,\n// product_version\n// FROM '.NEW_TABLE_BASKET_ITEMS.'\n// WHERE basket_id = \"'.mysql_real_escape_string($basket_info['basket_id']).'\"';\n// $result_basket_items = mysql_query($query_basket_items, $connection) or die(debug_print (\"ERROR: 892785 \", array ($query_basket_items,mysql_error()), basename(__FILE__).' LINE '.__LINE__));\n// // Go through all the basket items\n// while ($row_basket_items = mysql_fetch_array($result_basket_items))\n// {\n// // Problem: clear_item removes all quantity from the basket. We would like to leave the basket unchanged.\n// // ... but if we define that as the desired behavior, then we have something, at least...\n// $basket_item_info = update_basket_item (array(\n// 'action' => 'un_checkout',\n// 'delivery_id' => $data['delivery_id'],\n// 'member_id' => $data['member_id'],\n// 'product_id' => $row_basket_items['product_id'],\n// 'product_version' => $row_basket_items['product_version'],\n// 'post_even_if_zero' => 'YES'\n// ));\n// if ($basket_item_info != 'clear_item:'.$row_basket_items['bpid'])\n// {\n// return('error 100: expected \"clear_item:'.$row_basket_items['bpid'].'\" but got \"'.$basket_item_info.'\"');\n// }\n// }\n// // And un-checkout the basket as well\n// // Remove the delivery cost from the ledger for this basket\n// $ledger_status = basket_item_to_ledger(array (\n// 'source_type' => 'member',\n// 'source_key' => $data['member_id'],\n// 'target_type' => 'internal',\n// 'target_key' => 'delivery_cost',\n// 'amount' => 0,\n// 'text_key' => 'delivery cost',\n// 'posted_by' => $_SESSION['member_id'],\n// 'basket_id' => $basket_info['basket_id'],\n// 'site_id' => $basket_info['site_id'],\n// 'delivery_id' => $basket_info['delivery_id'],\n// 'match_keys' => array ('source_type','source_key','target_type','target_key','text_key','basket_id')\n// ));\n// }\n// // Change the checked_out setting on the basket\n// // Do this last so the update_basket_item will clear ledger items (only if they are in a checked-out state)\n// if ($initiate_un_checkout)\n// {\n// $query = '\n// UPDATE '.NEW_TABLE_BASKETS.'\n// SET checked_out = \"0\"\n// WHERE basket_id = \"'.mysql_real_escape_string($basket_info['basket_id']).'\"';\n// $result = mysql_query($query, $connection) or die(debug_print (\"ERROR: 892764 \", array ($query,mysql_error()), basename(__FILE__).' LINE '.__LINE__));\n// $basket_info['checked_out'] = 0;\n// }\n\n // At this point, all basket information has been updated, so we need to consider any changes to the ledger.\n// * messages link a message to this transaction\n// * post_even_if_zero 'YES' will delete the transaction is zero and a singleton\n\n\n// NEED TO ADD PAYPAL SURCHARGE CALCULATION\n\n // Return the new (possibly changed) basket_info array\n return ($basket_info);\n }",
"protected function doExit() {\n\t\tif (FLOW_SAPITYPE === 'Web') {\n\t\t\theader('HTTP/1.1 503 Service Temporarily Unavailable');\n\t\t\treadfile(FLOW_PATH_FLOW . 'Resources/Private/Core/LockHoldingStackPage.html');\n\t\t} else {\n\t\t\t$expiresIn = abs((time() - self::LOCKFILE_MAXIMUM_AGE - filemtime($this->lockFlagPathAndFilename)));\n\t\t\techo 'Site is currently locked, exiting.' . PHP_EOL . 'The current lock will expire after ' . $expiresIn . ' seconds.' . PHP_EOL;\n\t\t}\n\t\texit(1);\n\t}",
"function canUpdateItem() {\n\n $ticket = new Ticket();\n if (!$ticket->getFromDB($this->fields['tickets_id'])) {\n return false;\n }\n\n // you can't change if your answer > 12h\n if (!is_null($this->fields['date_answered'])\n && ((strtotime(\"now\") - strtotime($this->fields['date_answered'])) > (12*HOUR_TIMESTAMP))) {\n return false;\n }\n\n if ($ticket->isUser(CommonITILActor::REQUESTER, Session::getLoginUserID())\n || ($ticket->fields[\"users_id_recipient\"] === Session::getLoginUserID() && Session::haveRight('ticket', Ticket::SURVEY))\n || (isset($_SESSION[\"glpigroups\"])\n && $ticket->haveAGroup(CommonITILActor::REQUESTER, $_SESSION[\"glpigroups\"]))) {\n return true;\n }\n return false;\n }",
"public function checkout($item_id)\n {\n // second step is getting signature - https://github.com/williammalone/Simple-HTML5-Drawing-App\n if (!$this->_isAuthorized()) {\n redirect('auth/login');\n }\n $data['item'] = $this->inventory_model->getitem($item_id);\n $data['users'] = $this->_prepareUsers();\n $data['title'] = 'Item checkout STEP 1';\n $data['error'] = false;\n $this->load->library('form_validation');\n $this->load->helper('form');\n $this->form_validation->set_rules('datedue', 'Date due', 'callback_valid_date');\n $this->form_validation->set_rules('user_id', 'Student email', 'callback_valid_student');\n if ($data['item']->accessories) {\n $i=0;\n foreach ($data['item']->accessories as $acc) {\n $this->form_validation->set_rules('accessories'.$i++, 'Accessories', 'required');\n }\n }\n if ($this->form_validation->run()) {\n //$success = $this->inventory_model->checkout();\n $success = true;\n if ($success) {\n $data['msg'] = \"The item has been checked out. Please enter signature now.\";\n } else {\n $data['msg'] = \"An unexpected error occurred.\";\n }\n } else {\n $data['item'] = $this->inventory_model->getitem($item_id);\n }\n $data['categories'] = $this->_prepareCategories();\n $this->load->view('templates/header', $data);\n $this->load->view('inventory/checkout', $data);\n $this->load->view('templates/footer');\n }",
"public function tree_unlock() {\n global $db, $uid;\n\n if (($this->lock_user != false) && ($this->lock_user != $uid)) {\n // Ein anderer User hat den Baum gesperrt\n $this->error = \"ERR_ALREADY_LOCKED\";\n $this->reload = true;\n return false;\n } else if ($this->lock_user == $uid) {\n // Eigene Sperre, entfernen\n $this->lock_user = false;\n $db->querynow(\"DELETE FROM `lock` WHERE FK_USER=\".$uid.\" AND IDENT='\".$this->table.$this->root.\"'\");\n return true;\n }\n // Baum ist nicht gesperrt\n return true;\n }",
"function Lock($UserID)\n\t{\n\t\tj::SQL(\"UPDATE jfp_xuser SET LockTimeout=? , FailedLoginAttempts=0 WHERE ID=? LIMIT 1\",time()+$this->LockInterval,$UserID);\n\t}",
"public function check_out($id)\n {\n $data['public_space'] = $this->m_visitor->get_user('public_space', 'id', $id);\n if ($data['public_space']) {\n if ($id == $this->session->userdata('public_space_id')) {\n\n $phone = $this->session->userdata('phone');\n $public_space_id = $this->session->userdata('public_space_id');\n\n $is_checkin = $this->m_visitor->is_checkin($phone);\n\n if ($is_checkin == NULL) {\n $this->session->set_flashdata('message', 'checkout-error');\n redirect('visitor');\n } else {\n\n $data = [\"check_out\" => date(\"Y-m-d H:i:s\")];\n $this->m_visitor->update('record', $data, 'id', $is_checkin['id']);\n\n $this->session->unset_userdata('public_space_id');\n $this->session->set_userdata('status', 'out');\n $this->session->set_flashdata('message', 'checkout-success');\n\n redirect('visitor');\n }\n } else {\n $this->session->set_flashdata('message', 'checkout-error');\n redirect('visitor');\n }\n } else {\n $this->load->view('404');\n }\n }",
"public function edit(Checkin $checkin)\n {\n //\n }",
"public function listLockUnspent();",
"function lock()\n{\n}",
"private function _update(){\n\t\tif($this->dao->update($this->user->getID(), $this->ident, $this->datahandler)){\n\t\t\t$this->read();\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function bloquearUsuario() {\n $valor=1;\n if($this->input->post(\"lock\")==1){\n $valor=0;\n }\n \n $this->db->where('usuario', $this->input->post(\"usuario\"));\n $data_table = array(\n 'status' => $valor,\n 'status_a' => $valor\n );\n $this->db->update('usuarios', $data_table);\n return \"true\";\n }",
"public function lock()\n {\n $this->locked = true;\n }",
"public function lockUnspent(array $lock);",
"public function lockMayBeAvailable($name);",
"function lock() {\n global $_Query_lock_depth;\n if ($_Query_lock_depth < 0) {\n Fatal::internalError('Negative lock depth');\n }\n if ($_Query_lock_depth == 0) {\n $row = $this->select1($this->mkSQL('select get_lock(%Q, %N) as locked',\n OBIB_LOCK_NAME, OBIB_LOCK_TIMEOUT));\n if (!isset($row['locked']) or $row['locked'] != 1) {\n Fatal::cantLock();\n }\n }\n $_Query_lock_depth++;\n }",
"public function unlock(int $id): bool\n {\n // Execute query.\n $result = $this->wpdb->update(\n $this->blacklist_table,\n ['release_time' => \\date(self::MYSQL_DATETIME_FORMAT, current_time('timestamp'))],\n ['id' => $id],\n ['%s'],\n ['%d']\n );\n // Return status.\n return $result !== false;\n }",
"function update_item($data){\n if(check_token($data['crf_code'],'check')){\n $data = clean_security($data);\n \n if (!empty($data['id'])) {\n // update \n $old_item = mysqli_result_(mysqli_query_(\"select item_name from items where id={$data['id']}\"),0);\n\n mysqli_query_(\"UPDATE `items` set price='{$data['price']}', item_name='{$data['item_name']}' where id={$data['id']}\"); \n mysqli_query_(\"update customer_items set item_name='{$data['item_name']}' where item_name='$old_item'\");\n mysqli_query_(\"update recieved_history set item_name='{$data['item_name']}' where item_name='$old_item'\");\n \n return 'ok'; \n\n }\n \n // remove_crf\n check_token($data['crf_code'],''); \n\n return 'ok'; \n \n }else{\n return 'login';\n }\n}",
"public function onAccountLocked($event) {\n EventController::save('User account ' . ($event->user->is_locked ? '' : 'un') . 'locked', 2, 'Account for user with ID: ' . $event->user->user_id . ' has been ' . ($event->user->is_locked ? '' : 'un') . 'locked by user with ID: ' . $event->admin->user_id, __FILE__);\n }"
] | [
"0.63259804",
"0.6074651",
"0.5806185",
"0.5789171",
"0.57007205",
"0.56630343",
"0.5626349",
"0.5626118",
"0.5612805",
"0.5603608",
"0.5576718",
"0.5560617",
"0.553384",
"0.5532361",
"0.5532181",
"0.55283535",
"0.55232006",
"0.55149806",
"0.55062294",
"0.5489844",
"0.54745847",
"0.54745847",
"0.54745847",
"0.54705906",
"0.5460981",
"0.5459903",
"0.5459903",
"0.5459903",
"0.5459903",
"0.5459903",
"0.5456295",
"0.5422311",
"0.54182965",
"0.5418046",
"0.5416001",
"0.5394398",
"0.53556025",
"0.5312926",
"0.53069437",
"0.53064114",
"0.530498",
"0.5302025",
"0.52991897",
"0.5280773",
"0.5277738",
"0.5273443",
"0.52675813",
"0.5257906",
"0.52490264",
"0.5223891",
"0.5222707",
"0.5204571",
"0.52012813",
"0.51918924",
"0.51887035",
"0.5184567",
"0.5183841",
"0.51802963",
"0.5178292",
"0.51769274",
"0.5173054",
"0.5168297",
"0.5160239",
"0.5155707",
"0.51422834",
"0.51281834",
"0.51258105",
"0.5116599",
"0.51147455",
"0.51147455",
"0.51122963",
"0.51109415",
"0.5110889",
"0.50990856",
"0.5091891",
"0.5073115",
"0.5063611",
"0.5062733",
"0.5054963",
"0.5049023",
"0.50470364",
"0.50406915",
"0.50404733",
"0.50399154",
"0.5024932",
"0.50236684",
"0.5021998",
"0.50152653",
"0.50121194",
"0.5008802",
"0.49893776",
"0.4983731",
"0.49774426",
"0.4974133",
"0.49695447",
"0.49679735",
"0.4962745",
"0.495882",
"0.49571946",
"0.49553484"
] | 0.5020224 | 87 |
Method to checkout/lock the item | function checkout($uid = null)
{
if ($this->_id)
{
// Make sure we have a user id to checkout the event with
if (is_null($uid)) {
$user =& JFactory::getUser();
$uid = $user->get('id');
}
// Lets get to it and checkout the thing...
$event = & JTable::getInstance('eventlist_events', '');
return $event->checkout($uid, $this->_id);
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testDestiny2SetItemLockState()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function lockItem($list_id, $item_id) {\n \n $this->setFormsRightsMode($list_id, $item_id);\n \n \\App\\Libraries\\DBHelper::lockItem($list_id, $item_id);\n \n return response()->json(['success' => 1]);\n }",
"public function lock($drop, Cart $cart)\n\t{\n\t}",
"public function lock()\n {\n $this->isLocked = true;\n }",
"function lock(Sabre_DAV_Locks_LockInfo $lockInfo);",
"public function lock()\r\n {\r\n frameEbbs::_()->getModule('backup')->lock();\r\n }",
"protected function lock()\n {\n $this->isStateLocked = true;\n }",
"public function lock()\n\t{\n\t\t$this->immutable = true;\n\t}",
"public function walletlock()\n\t{\n\t\treturn $this->_get_error($this->connect('walletlock'));\n\t}",
"function post_restoreItem() {\n\n if ((isset($this->input['_no_history']) && $this->input['_no_history'])\n || (!static::$logs_for_item_1\n && !static::$logs_for_item_2)) {\n return;\n }\n\n if ($this->useDeletedToLockIfDynamic()\n && $this->isDynamic()) {\n $item1 = $this->getConnexityItem(static::$itemtype_1, static::$items_id_1);\n $item2 = $this->getConnexityItem(static::$itemtype_2, static::$items_id_2);\n\n if (($item1 !== false)\n && ($item2 !== false)) {\n if ($item1->dohistory\n && static::$logs_for_item_1) {\n $changes[0] = '0';\n $changes[1] = '';\n $changes[2] = addslashes($this->getHistoryNameForItem1($item2, 'unlock'));\n\n Log::history($item1->getID(), $item1->getType(), $changes, $item2->getType(),\n static::$log_history_1_unlock);\n }\n\n if ($item2->dohistory\n && static::$logs_for_item_2) {\n $changes[0] = '0';\n $changes[1] = '';\n $changes[2] = addslashes($this->getHistoryNameForItem2($item1, 'unlock'));\n Log::history($item2->getID(), $item2->getType(), $changes, $item1->getType(),\n static::$log_history_2_unlock);\n }\n }\n\n }\n }",
"public function lockToNormal() {}",
"public function lock()\n {\n $this->locked = true;\n }",
"function lock() {\n global $_Query_lock_depth;\n if ($_Query_lock_depth < 0) {\n Fatal::internalError('Negative lock depth');\n }\n if ($_Query_lock_depth == 0) {\n $row = $this->select1($this->mkSQL('select get_lock(%Q, %N) as locked',\n OBIB_LOCK_NAME, OBIB_LOCK_TIMEOUT));\n if (!isset($row['locked']) or $row['locked'] != 1) {\n Fatal::cantLock();\n }\n }\n $_Query_lock_depth++;\n }",
"function checkout($uid = null) {\r\n\t\tif ($this->_id) {\r\n\t\t\t// Make sure we have a user id to checkout the group with\r\n\t\t\tif (is_null($uid)) {\r\n\t\t\t\t$user\t=& JFactory::getUser();\r\n\t\t\t\t$uid\t= $user->get('id');\r\n\t\t\t}\r\n\t\t\t// Lets get to it and checkout the thing...\r\n\t\t\t$item = & JTable::getInstance('flexicontent_items', '');\r\n\t\t\treturn $item->checkout($uid, $this->_id);\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"private function lockLink()\n {\n return $this->model->action('link','lock',\n array('job' => 'lock',\n 'id_link' => (int)$_REQUEST['id_link'],\n 'by_id_user' => (int)$this->viewVar['loggedUserId']) ); \n }",
"function checkin() {\r\n\t\tif ($this->_id) {\r\n\t\t\t$item = & JTable::getInstance('flexicontent_items', '');\r\n\t\t\treturn $item->checkin($this->_id);\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public function lockAction() {\n $id = $this->getRequest()->getParam('id');\n $mid = $this->getRequest()->getParam('mid');\n $data = $this->model->lockContent($id);\n $this->redirect('materialcontent/index/id/' . $mid);\n }",
"public function messageLockAction()\n {\n $params=$this->_request->getParams();\n $messageId=$params['messageId'];\n $change_status=$params['status'];\n $usertype=$this->adminLogin->type;\n if($messageId && $change_status=='lock')\n {\n $message=new Ep_Message_Message();\n $status=$message->checkMasterLockstatus($messageId);\n if($status=='unlocked')\n {\n $data['locked_user']=$this->adminLogin->userId;\n $message->updateLockstatus($messageId,$data);\n $this->_redirect(\"/mastermails/master-inbox-ep?submenuId=ML6-SL2\");\n }\n else\n $this->_redirect(\"/mastermails/master-inbox-ep?submenuId=ML6-SL2\");\n }\n elseif($messageId && $change_status=='unlock')\n {\n $message=new Ep_Message_Message();\n $status=$message->checkMasterLockstatus($messageId);\n if($status!='unlocked')\n {\n $data['locked_user']=NULL;\n $message->updateLockstatus($messageId,$data);\n $this->_redirect(\"/mastermails/master-inbox-ep?submenuId=ML6-SL2\");\n }\n else\n $this->_redirect(\"/mastermails/master-inbox-ep?submenuId=ML6-SL2\");\n }\n }",
"public function lock()\n {\n if ( !($this->_state & self::LOADED) ) {\n $this->_memManager->load($this, $this->_id);\n $this->_state |= self::LOADED;\n }\n\n $this->_state |= self::LOCKED;\n\n /**\n * @todo\n * It's possible to set \"value\" container attribute to avoid modification tracing, while it's locked\n * Check, if it's more effective\n */\n }",
"public function lock()\n {\n $this->lock = true;\n }",
"abstract protected function lock(): void;",
"function lock()\n{\n}",
"function addItem(){\r\n// this means, lets say last week i created a item with code x. then i deleted it.(set lock_item=1)\r\n// today as that item_name doesnt exist anymore, i want to reuse it to another item. i cant do \r\n// insert item query as it will lead to unique index criteria erro. so i must update earlier row.\r\n// current addItem function only sets lock_item=0, but doesnt update other rows.\r\n\r\n\tglobal $item, $lab, $item_name, $cost, $status, $comments, $operation, $connection, $result, $bill_serial,\r\n\t$iv_serial, $product_code, $tequip, $vendor,$comments_sql, $item_name_sql, $product_code_sql;\r\n\tif($item==-1||$lab==-1||$bill_serial==-1){\r\n\t\taddToToast(\"please select Lab/Vendor/Apparatus from dropdown\",0);\r\n\t}\r\n\telse{ \r\n\t\t/*\t\t\tInserting items one by one \t\t\t\t*/\r\n\t\tforeach ($item_name_sql as $key => $value) {\r\n\t\t //checking if the item is presenet in the inventory\r\n\t\t\tif(!doesItemExist(\"inventory\", \"item_code\", $item_name_sql[$key])){ //if item is not present in inventory\r\n\t\t\t\t$query=\"\r\n\t\t\t\tINSERT INTO \r\n\t\t\t\tinventory (\tlab_serial, \r\n\t\t\t\tserial_item, \r\n\t\t\t\titem_code,\r\n\t\t\t\tproduct_code, \r\n\t\t\t\ttequip, \r\n\t\t\t\tcost, \r\n\t\t\t\tstatus,\r\n\t\t\t\treceipt_serial,\r\n\t\t\t\tlast_operation\r\n\t\t\t\t) \r\n\t\t\t\tvalues(\r\n\t\t\t\t{$lab},\r\n\t\t\t\t{$item}, \r\n\t\t\t\t'{$item_name_sql[$key]}',\r\n\t\t\t\t'{$product_code_sql[$key]}',\r\n\t\t\t\t{$tequip}, \r\n\t\t\t\t{$cost},\r\n\t\t\t\t{$status},\r\n\t\t\t\t{$bill_serial},\r\n\t\t\t\t{$operation}\r\n\t\t\t) \";\r\n\t\t\tperform_query($connection, $query, \"failed to insert into inventory\");\r\n\t\t\t\t // to insert into inventory log, but we need serial of that item_code\r\n\t\t\t$iv_serial=mysqli_insert_id($connection);\r\n\t\t\tinventoryLog();\r\n\t\t\taddToToast(\"Created new apparatus of name {$item_name[$key]} of cost {$cost}\",1);\r\n\t\t}\r\n\t\telse{ \t\t\r\n\t\t\t //if item is already present, it may be an error\r\n\t\t\t \t\t\t//probability is that the item may have been locked and now needs to be unlocked\r\n\t\t\t$row=mysqli_fetch_assoc($result);\r\n\t\t\tif(1==$row['lock_item']){\r\n\t\t\t\t$date= date(\"Y-m-d H:i:s\");\r\n\t\t\t\t$query=\"SELECT serial from inventory where item_code={$item_name_sql[$key]}\";\r\n\t\t\t\t$result=perform_query($connection, $query, \"failed to get serial\");\r\n\t\t\t\t$row=mysqli_fetch_assoc($result);\r\n\t\t\t\t$iv_serial=$row['serial'];\r\n\t\t\t\t$query=\"UPDATE \r\n\t\t\t\tinventory \r\n\t\t\t\tset \r\n\t\t\t\tlock_item=0, \r\n\t\t\t\tupdated='{$date}', \r\n\t\t\t\tlab_serial={$lab}, \r\n\t\t\t\tcost={$cost} \r\n\t\t\t\twhere \r\n\t\t\t\titem_code='{$item_name_sql[$key]}'\";\r\n\t\t\t\tperform_query($connection, $query, \"failed to update\");\r\n\t\t\t\t$comments.=\" item was unlocked\";\r\n\t\t\t\tinventoryLog();\r\n\t\t\t\taddToToast(\"{$comments}\",1);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t\taddToToast(\"its already present \",0);\r\n\t\t}\t\r\n\t}\r\n\r\n} \r\n}",
"public function lock() {}",
"public function lockPayments()\n {\n $this -> lock_payments = true;\n $this -> save();\n }",
"private function refreshLockInformation()\n {\n $result = self::$db->fetchOne(\n 'SELECT lock, locktime FROM jukebox.playlists WHERE playlistid=$1',\n [$this->getID()]\n );\n $this->lock = empty($result['lock']) ? null : MyRadio_User::getInstance($result['lock']);\n $this->locktime = (int) $result['locktime'];\n }",
"function lockCacheObject ()\n {\n return copy($this->cacheObjectId, $this->cacheObjectId.'.lock');\n }",
"private function getLock( & $article )\n {\n // lock the user to edit\n $result = $this->model->action('article','lock',\n array('job' => 'is_locked',\n 'id_article' => (int)$article['id_article'],\n 'by_id_user' => (int)$this->viewVar['loggedUserId']) );\n \n if(($result !== TRUE) && ($result !== FALSE))\n {\n $article['lock'] = TRUE; \n } \n else\n {\n $article['lock'] = FALSE; \n } \n }",
"public function lock($lockType)\n {\n /* @var Mage_Core_Model_Resource $resource */\n $resource = Mage::getSingleton('core/resource');\n $resource->getConnection('core_write')->update(\n $resource->getTableName('wallee_payment/lock'), array(\n 'locked_at' => date(\"Y-m-d H:i:s\")\n ), array(\n 'lock_type = ?' => $lockType\n )\n );\n }",
"public function lock(): void;",
"abstract protected function manage(LockableInterface $resource);",
"public function tree_lock() {\n global $db, $uid;\n\n if (($this->lock_user != false) && ($this->lock_user != $uid)) {\n // Baum ist bereits von einem anderen Benutzer gesperrt\n $lock_stamp = false;\n $this->error = \"ERR_ALREADY_LOCKED\";\n return false;\n } else if (($this->lock_user != false) && ($this->lock_user == $uid)) {\n // Eigene Sperre bereits aktiv\n $this->lock_stamp = time();\n $this->lock_expire = time() + 300;\n $result = $db->querynow(\"UPDATE `lock` SET STAMP_UPDATE='\".date('Y-m-d H:i:s', $this->lock_stamp).\"',\n STAMP_EXPIRE='\".date('Y-m-d H:i:s', $this->lock_expire).\"'\n WHERE FK_USER=\".$uid.\" AND IDENT='\".$this->table.$this->root.\"'\");\n if (!$result['str_error']) {\n $this->lock_user = $uid;\n return true;\n } else {\n $this->error = \"ERR_LOCK_FAILED\";\n $this->lock_stamp = 0;\n $this->lock_expire = 0;\n $this->lock_user = false;\n return false;\n }\n } else {\n // Baum nicht gesperrt, Sperre hinzu\n $this->lock_stamp = time();\n $this->lock_expire = time() + 300;\n $result = $db->querynow(\"INSERT INTO `lock` (FK_USER, IDENT, STAMP_UPDATE, STAMP_EXPIRE) VALUES\n (\".$uid.\",'\".$this->table.$this->root.\"', '\".date('Y-m-d H:i:s', $this->lock_stamp).\"', '\".\n date('Y-m-d H:i:s', $this->lock_expire).\"')\");\n if (!$result['str_error']) {\n $this->lock_user = $uid;\n return true;\n } else {\n $this->error = \"ERR_LOCK_FAILED\";\n $this->lock_user = false;\n return false;\n }\n }\n }",
"public function lock_get()\n\t{\n\t\ttry{\n\n\t\t\t$this->checkCanCandidateId();\n\t\t\t$id = $this->getParameterId();\n\t\t\t$code = 0;\n \n $filters = array(\n \"id\" => $id,\n \"{$this->_candidateIdFkKey}\" =>$this->getCanCandidateId()\n );\n \n\t\t\t// if Lock flag is ON\n\t\t\t// Get object by normal way\n\t\t\t// and check is that the object locked by their-self or another\n\t\t\tif ($this->_model->getLockFlag() == LOCK_FLAG_ON){\n\t\t\t\t\n $objects = $this->_model->getBy($filters);\n if (count($objects)==0){\n throw new Exception ('対象が存在していません。', REST_ER_PAGE_NOTFOUND);\n }\n \n\t\t\t\t//if the current object locked equal this id then this object locked by their self s\n\t\t\t\tif ($id != $this->getCurrentObjectId()){\n\t\t\t\t\t// The object locked by another\n\t\t\t\t\t$code = REST_RESPOND_CANNOT_LOCK;\n\t\t\t\t}\n\t\t\t\t$data = array();\n\t\t\t\tif (count($objects)>0)\n\t\t\t\t\t$data = $objects[0];\n\t\t\t}else {\n $objects = $this->_model->getBy($filters);\n if (count($objects)==0){\n throw new Exception ('対象が存在していません。', REST_ER_PAGE_NOTFOUND);\n }\n \n\t\t\t\t// if the lock flag is off\n\t\t\t\t// get and lock this object\n\t\t\t\t$result = $this->_model->getByIdAndLock($id);\n\t\t\t\tif ($result['transStatus']){\n\t\t\t\t\t// set the current locked object id\n\t\t\t\t\t$this->setCurrentObjectId($id);\n\t\t\t\t}else {\n\t\t\t\t\tthrow new Exception('ロック処理に失敗しました。', REST_ER_TRANSACTION_ERROR);\n\t\t\t\t}\n\t\t\t\t$data = $result['data'];\n\n\t\t\t}\n\t\t\t$respond = array(\n\t\t\t\t'code' => $code,\n\t\t\t\t'datetime'=> date('Y-m-d H:i:s', time()),\n\t\t\t\t'data' => $data\n\t\t\t);\n\t\t\t$this->response($respond);\n\t\t}catch( Exception $e ){\n\t\t\t$message = $e->getMessage();\n\t\t\t$code = $e->getCode();\n\t\t\t$this->error_response($message,$code);\n\t\t}\n\n\t}",
"public function walletlock(){\n return $this->bitcoin->walletlock();\n }",
"public function lock(): void {}",
"public function lock(): void {}",
"public function lock(): void {}",
"public function lock(): void {}",
"public function lock(): void {}",
"function cera_grimlock_single() {\n\t\tdo_action( 'grimlock_single' );\n\t}",
"public function lockShared($lock_waiting_option = null) {}",
"public function lock($key=null,$value=null){\n return $this->methodsData(\"lock\",$key,$value);\n }",
"public function checkout($item_id)\n {\n // second step is getting signature - https://github.com/williammalone/Simple-HTML5-Drawing-App\n if (!$this->_isAuthorized()) {\n redirect('auth/login');\n }\n $data['item'] = $this->inventory_model->getitem($item_id);\n $data['users'] = $this->_prepareUsers();\n $data['title'] = 'Item checkout STEP 1';\n $data['error'] = false;\n $this->load->library('form_validation');\n $this->load->helper('form');\n $this->form_validation->set_rules('datedue', 'Date due', 'callback_valid_date');\n $this->form_validation->set_rules('user_id', 'Student email', 'callback_valid_student');\n if ($data['item']->accessories) {\n $i=0;\n foreach ($data['item']->accessories as $acc) {\n $this->form_validation->set_rules('accessories'.$i++, 'Accessories', 'required');\n }\n }\n if ($this->form_validation->run()) {\n //$success = $this->inventory_model->checkout();\n $success = true;\n if ($success) {\n $data['msg'] = \"The item has been checked out. Please enter signature now.\";\n } else {\n $data['msg'] = \"An unexpected error occurred.\";\n }\n } else {\n $data['item'] = $this->inventory_model->getitem($item_id);\n }\n $data['categories'] = $this->_prepareCategories();\n $this->load->view('templates/header', $data);\n $this->load->view('inventory/checkout', $data);\n $this->load->view('templates/footer');\n }",
"private function makeItemPurchase() : void\n {\n $this->item->available = $this->item->available - 1;\n $this->coinService->setCoinCount(\n $this->coinService->getCurrenCoinCount() - $this->item->cost\n );\n $this->item->save();\n }",
"public function lockAction()\r\n {\r\n $timesheet = $this->byId();\r\n \r\n $this->projectService->lockTimesheet($timesheet);\r\n \r\n $this->redirect('timesheet', 'edit', array('clientid'=>$timesheet->clientid, 'projectid'=>$timesheet->projectid, 'id'=>$timesheet->id));\r\n }",
"public function enableLocked()\n\t{\n\t\t$this->_locked = true;\n\t}",
"protected function updateLock() \n {\n $log = FezLog::get();\n $db = DB_API::get();\n \n $my_process = $this->getProcessInfo();\n $my_pid = $my_process['pid'];\n\n if (!is_numeric($my_pid)) {\n $my_pid = 'null';\n }\n\n $db->beginTransaction();\n\n $stmt = \"SELECT \".$this->_dblp.\"value, \".$this->_dblp.\"pid FROM \".$this->_dbtp.\"locks \".\n \"WHERE \".$this->_dblp.\"name=?\";\n \n try {\n $res = $db->fetchRow($stmt, $this->_lock, Zend_Db::FETCH_ASSOC);\n \n $pid = $res[$this->_dblp.'pid'];\n $lock_value = $res[$this->_dblp.'value'];\n $acquire_lock = true;\n $log->debug(\n \"Queue got lockValue=\".$lock_value.\", pid=\".$pid.\" with \".$stmt.\" and \".print_r($res, true)\n );\n \n if ($lock_value != -1 && (!empty($pid)) && is_numeric($pid)) {\n // check if process is still running or if this is an invalid lock\n $psinfo = $this->getProcessInfo($pid);\n $log->debug(\"checking for lock on lock \".$pid);\n $log->debug(array(\"psinfo\",$psinfo));\n if (!empty($psinfo)) {\n // override existing lock\n $acquire_lock = false;\n $log->debug(\"overriding existing lock \".$psinfo);\n }\n }\n \n // worst case: a background process is started, but the queue already\n // empty at this point\n if ($acquire_lock) {\n $sql = \"UPDATE \".$this->_dbtp.\"locks SET \".$this->_dblp.\"pid=? \".\n \"WHERE \".$this->_dblp.\"name=?\"; \n $db->query($sql, array($my_pid, $this->_lock));\n $db->commit();\n } else {\n return false;\n }\n }\n catch(Exception $ex) {\n $db->rollBack(); \n $log->err($ex);\n return false;\n }\n return true;\n }",
"function set_qty_item( $params ) {\n\t\textract( $params );\n\n\t\t$this->db->query( \"LOCK TABLES cart_items WRITE, stock WRITE\" );\n\n\t\t// Changing the current qty means putting back first the previous qty to stock then removing the new one\n\t\t$aqty = $this->db->query( \"SELECT qty, sku FROM cart_items WHERE id='\".$id.\"'\" )->row_array();\n\t\t$this->db->query( \"UPDATE stock SET qty=qty+{$aqty['qty']}-\".$qty.\" WHERE sku='{$aqty['sku']}'\" );\n\n\t\t$res = $this->db->query( \"UPDATE cart_items SET qty='\".$qty.\"' WHERE id='\".$id.\"' AND user='\".$user_no.\"'\" );\n\n\t\t$this->db->query( \"UNLOCK TABLES\" );\n\t\treturn $res;\n\t}",
"public function handleCheckoutLocker() {\n // Ensure the required parameters exist\n $this->requireParam('lockerId');\n\t\t$this->requireParam('userId');\n\t\t$this->requireParam('messageId');\n $body = $this->requestBody;\n\n\t\t$user = $this->userDao->getUserbyId($body['userId']);\n\t\t$locker = $this->lockerDao->getLockerByID($body['lockerId']);\n\t\t$message = $this->messageDao->getMessageByID($body['messageId']);\n\n\t\t // Update the Message\n $locker->setUserId($body['userId']);\n \n $ok = $this->lockerDao->updateLocker($locker);\n if(!$ok) {\n $this->respond(new Response(Response::INTERNAL_SERVER_ERROR, 'Locker Failed to Checkout'));\n }\n\n\t\t$mailer = New TekBotsMailer('[email protected]');\n $ok = $mailer->sendLockerEmail($user, $locker, $message);\n\t\tif(!$ok) {\n $this->respond(new Response(Response::INTERNAL_SERVER_ERROR, 'Email sned Failed'));\n }\n\n $this->respond(new Response(Response::OK, 'Locker Checkout Sucessful'));\n\n }",
"public function lockAndBlock()\n {\n $this->lock();\n }",
"public function approveItem()\n {\n if ($this->getItem()->getType() == \\Apprecie\\Library\\Items\\ItemTypes::EVENT) {\n if ($this->getStatus() == \\Apprecie\\Library\\Items\\ApprovalState::APPROVED) {\n return true;\n }\n\n $org = Organisation::getActiveUsersOrganisation();\n $event = Event::findFirstBy('itemId', $this->getItemId());\n\n $event->setState(\\Apprecie\\Library\\Items\\ItemState::APPROVED);\n $event->update();\n\n if (!$org->addEventToVault($event)) {\n $this->appendMessageEx($org);\n $this->logActivity('Failed xx addEventToVault() inside approve method', 'messages ' . _ms($org));\n return false;\n } //@todo gh use transaction\n\n $this->setStatus(\\Apprecie\\Library\\Items\\ApprovalState::APPROVED);\n $this->setVerifiedByUserId($this->getDI()->getDefault()->get('auth')->getAuthenticatedUser()->getUserId());\n $this->update();\n } else {\n throw new \\Phalcon\\Exception('approveItem work flow not implemented for non events');\n }\n }",
"public function lock()\n {\n if ($this->isLocked()) {\n throw new RuntimeException('Cannot lock: already locked');\n }\n\n $this->conn->set('lock:' . $this->name, $this->id);\n }",
"public function checkout( $who, $oid=null );",
"public function handle_override_changeset_lock_request()\n {\n }",
"public function unlockItem($list_id, $item_id) {\n \\App\\Libraries\\DBHelper::unlockItem($list_id, $item_id);\n return response()->json(['success' => 1]);\n }",
"public function checkLock() {\n\t\t$this->autoRender = false;\n\t\t\n\t\t$HttpSocket = new HttpSocket();\n\t\t$results = $HttpSocket->get('https://api.dropbox.com/1/search/auto/',\n\t\t\tarray(\n\t\t\t\t'query' => 'SystemIsLocked',\n\t\t\t\t'access_token' => 'YOUR_ACCESS_TOKEN'\n\t\t\t)\n\t\t);\n\t\t\n\t\tif(empty(json_decode($results->body))) {\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\treturn true;\n\t}",
"private function lock() {\n\t\tif (file_exists($this -> lockfile)) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn file_put_contents($this -> lockfile, 'I am locked!') !== false;\n\t}",
"function lockAccount($userid){\n $query = \"UPDATE users_account SET status ='Locked' WHERE userid = ?\";\n $paramType = \"i\";\n $paramValue = array(\n $userid\n );\n $this->db_handle->update($query, $paramType, $paramValue);\n }",
"public function lock($name) {\n\t\t\n\t\t/*$b = mysql_query('show tables');\n\t\t$d = '';\n\t\t$d .= 'LOCK TABLES';\n\t\twhile( $c = mysql_fetch_array($b) ) {\n\t\t\t$d .= '\n\t\t`'.$c[0].'` WRITE , ';\n\t\t}\n\t\t\n\t\t$d = rtrim($d,' , ').';';\n\t\t//if( $this->info['id'] == 12345 ) {\n\t\t\tif( $name == 'reflesh.useitems' || $name == 'reflesh-heal' ) {\n\t\t\t\tmysql_query($d);\n\t\t\t}\n\t\t//}*/\n\t}",
"public function isLocked() {}",
"public static function setLocked()\n {\n self::$locked = true;\n }",
"private function setLock($status) {\n $this->status->is_locked = $status;\n $this->status->save();\n }",
"public function restorethisitem()\n {\n $id_item = $this->request->getParameter(\"id\");\n $this->item->restoreItem($id_item);\n $this->message->extendedCardRestored();\n }",
"function lock(string $key): void;",
"public function setLocked($locked = true) {}",
"function receiveLocked($hexAddress,$amount,$commodity,$entityID=0){\n\t\n\tglobal $dz;\n\t\n\t// Find that address - if it exists, it must be the same commodity. If it doesn't exist, create it now.\n\t$com=$dz->get_row('select `Commodity`,`Entity` from `Root.Balances` where `Key`=UNHEX(\"'.$hexAddress.'\")');\n\n\tif($com){\n\t\t\n\t\t// Make sure it matches and so does the entity:\n\t\tif($com['Commodity']!=$commodity){\n\t\t\t\n\t\t\t// Wrong commodity!\n\t\t\terror('balance/wrongcommodity');\n\t\t\t\n\t\t}\n\t\t\n\t\tif($entityID!=0 && $com['Entity']!=$entityID){\n\t\t\t\n\t\t\t// Wrong owner!\n\t\t\terror('balance/wrongowner');\n\t\t\t\n\t\t}\n\t\t\n\t\t// Lock the amount now. This is because if the balance goes empty during this issue request\n\t\t// the balance row is deleted. If we lock the amount, that can't happen.\n\t\t$dz->query('update `Root.Balances` set LockedBalance=LockedBalance+'.$amount.' where `Key`=UNHEX(\"'.$hexAddress.'\")');\n\t\t\n\t}else{\n\t\t\n\t\t// Create it now, with the locked amount:\n\t\t$dz->query('insert into `Root.Balances`(`Commodity`,`Key`,`Entity`,`LockedBalance`) values (\"'.$commodity.'\",UNHEX(\"'.$hexAddress.'\"),'.$entityID.','.$amount.')');\n\t\t\n\t}\n\t\n}",
"protected function confirmLockingBeforeSaving()\n\t{\n\t\tif( !$this->lockingObj )\n\t\t\treturn true;\n\t\t$lockmessage = \"\";\n\t\tif( $this->keysChanged )\n\t\t{\n\t\t\t//\tconfirm and acquire locks on both old and new sets of keys\n\t\t\t$lockConfirmed = $this->lockingObj->ConfirmLock($this->tName, $this->oldKeys, $lockmessage);\n\t\t\tif( $lockConfirmed )\n\t\t\t\t$lockConfirmed = $this->lockingObj->LockRecord($this->tName, $this->keys);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t//\tconfirm lock on the edited record\n\t\t\t$lockConfirmed = $this->lockingObj->ConfirmLock($this->tName, $this->oldKeys, $lockmessage);\n\t\t}\n\n\t\tif( !$lockConfirmed )\n\t\t{\n\t\t\t$this->lockingMessageStyle = \"display:block\";\n\t\t\tif( $this->mode == EDIT_INLINE )\n\t\t\t{\n\t\t\t\tif( IsAdmin() || $_SESSION[\"AccessLevel\"] == ACCESS_LEVEL_ADMINGROUP )\n\t\t\t\t\t$lockmessage = $this->lockingObj->GetLockInfo($this->tName, $this->oldKeys, false, $this->id);\n\n\t\t\t\t$returnJSON['success'] = false;\n\t\t\t\t$returnJSON['message'] = $lockmessage;\n\t\t\t\t$returnJSON['enableCtrls'] = false;\n\t\t\t\t$returnJSON['confirmTime'] = $this->lockingObj->ConfirmTime;\n\t\t\t\techo printJSON($returnJSON);\n\t\t\t\texit();\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif( IsAdmin() || $_SESSION[\"AccessLevel\"] == ACCESS_LEVEL_ADMINGROUP )\n\t\t\t\t\t$this->lockingMessageText = $this->lockingObj->GetLockInfo($this->tName, $this->oldKeys, true, $id);\n\t\t\t\telse\n\t\t\t\t\t$this->lockingMessageText = $lockmessage;\n\t\t\t}\n\t\t\t$this->readEditValues = true;\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"private function lockConcurrentExecution()\n\t{\n\t\t$tag = $this->getLockTag();\n\t\t$app = \\Bitrix\\Main\\Application::getInstance();\n\t\t$managedCache = $app->getManagedCache();\n\t\t$managedCache->clean($tag);\n\t\t$managedCache->read(self::LOCK_TTL, $tag);\n\t\t$managedCache->setImmediate($tag, true);\n\t}",
"function wp_check_post_lock($post)\n {\n }",
"function approve_return($item_id) {\n $this->db->where('item_id', $item_id);\n $this->db->update('items', array('status' => 0)); // set the item status to returned\n //delete the item \n return $this->db->delete('items_collection', array('item_id' => $item_id));\n }",
"public function lockJob() {\n \t\t//structure id,jobId,serverId (job id is unique entry)\n\n \t}",
"function checkout_check() {\n\t\treturn false;\n\t}",
"public function lockSiteOrExit() {\n\t\ttouch($this->lockFlagPathAndFilename);\n\t\t$this->lockResource = fopen($this->lockPathAndFilename, 'w+');\n\t\tif (!flock($this->lockResource, LOCK_EX | LOCK_NB)) {\n\t\t\tfclose($this->lockResource);\n\t\t\t$this->doExit();\n\t\t}\n\t}",
"public function buy($itemid)\n {\n //check for valid id for eg. it should be numeric\n //do buying\n\n }",
"protected function hashLockClause() {}",
"function _lock_tree_table()\n\t{\n\t\tee()->db->query(\"LOCK TABLE \" .$this->tree_table . \" WRITE\");\n\t}",
"function setLocked($l) {\n\t\t$this->set(\"locked\",$l);\n\t}",
"public function readunlock() {}",
"public function trylock() {}",
"public function lock($entity, $lockMode, $lockVersion = null)\n {\n parent::lock($entity, $lockMode, $lockVersion);\n $this->refresh($entity);\n }",
"function cmd_lock($db, $params, $computer) {\n global $glo_dirname;\n\t\tif (!isset($params['lock'])) {\n throw new NuboException(ERROR_MISSING_PARAMETER);\n }\n $mutex = fopen(\"./$glo_dirname/lock\", \"w+\");\n if (!$mutex) {\n throw new NuboException(ERROR_INTERNAL);\n }\n try {\n flock($mutex, LOCK_EX);\n if ($params['lock']) {\n $result = $db->select('SELECT computer_id FROM tbl_computer WHERE lock IS NOT NULL');\n if (reset($result) !== false) {\n $status = 'busy';\n } else {\n $db->execute('UPDATE tbl_computer SET lock=:ltime WHERE computer_id=:id', ['id/int' => $computer, 'ltime/int' => time()]);\n $status = 'locked';\n }\n } else {\n $db->execute('UPDATE tbl_computer SET lock=NULL WHERE computer_id=:id', ['id/int' => $computer]);\n $status = 'unlocked';\n }\n } finally {\n flock($mutex, LOCK_UN);\n fclose($mutex);\n }\n\t\treturn ['status' => $status];\n\t}",
"public function lockExclusive($lock_waiting_option = null) {}",
"function holdCurrent()\n {\n $this->holdCount++;\n $this->currentTcb->markAsHeld();\n return $this->currentTcb->link;\n }",
"public function acquireExclusiveLock() {}",
"function OnDoEditItem(){\n if (! $this->error) {\n $this->_data = $this->GetFieldsData();\n $this->_data[$this->key_field] = $this->item_id;\n\n $this->ValidateBeforeAdd();\n\n $item = $this->Storage->{$this->GetItemMethod}(array(\n $this->key_field => $this->item_id));\n //set system fields\n $this->setItemSystemFields($this->_data, $item);\n\n //check for unique fields\n if ($this->listSettings->HasItem(\"MAIN\", \"UNIQUE_FIELDS\")) {\n $this->checkForDuplicateUnique();\n }\n\n if ($this->disabled_edit) {\n if (strlen($this->host_library_ID)) {\n $this->library_ID = $this->host_library_ID;\n }\n $this->AfterSubmitRedirect(\"?\".($this->Package!=\"\" ? \"package=\".$this->Package.\"&\" : \"\").\"page=\" . $this->listHandler . \"&\" . $this->library_ID . \"_start=\" . $this->start . \"&\" . $this->library_ID . \"_order_by=\" . $this->order_by . \"&library=\" . $this->library_ID . \"&\" . $this->library_ID . \"_parent_id=\" . $this->parent_id . \"&MESSAGE[]=LIBRARY_DISABLED_EDIT\" . \"&\" . $this->restore);\n }\n if (empty($this->validator->formerr_arr) && ! $this->child_error) {\n if (strlen($this->host_library_ID)) {\n $this->library_ID = $this->host_library_ID;\n $this->parent_id = $this->Request->ToNumber(\"custom_val\", 0);\n }\n //before edit event handler call\n $this->OnBeforeEdit();\n $this->UpdateRadioFields();\n $_result = $this->Storage->Update($this->_data);\n if ($_result){\n $this->InsertNotOrdinaryFields($this->_data);\n //after edit event handler call\n $this->OnAfterEdit();\n if ($this->is_context_frame)\n \t$url = \"?package=context&page=contextframe&event=refresh&MESSAGE[]=EDIT_ITEM_SAVED\";\n else\n \t$url = \"?\".($this->Package!=\"\" ? \"package=\".$this->Package.\"&\" : \"\").\"page=\" . $this->listHandler . \"&\" . $this->library_ID . \"_start=\" . $this->start . \"&\" . $this->library_ID . \"_order_by=\" . $this->order_by . \"&library=\" . $this->library_ID . \"&\" . $this->library_ID . \"_parent_id=\" . $this->parent_id . \"&MESSAGE[]=EDIT_ITEM_SAVED\" . \"&\" . $this->restore;\n\n $this->AfterSubmitRedirect($url);\n }\n }\n else {\n $this->event = \"EditItem\";\n }\n $this->OnBeforeCreateEditControl();\n $this->InitItemsEditControl();\n }\n }",
"public function testSetCollectionItemTimelock()\n {\n // TODO: implement\n $this->markTestIncomplete('Not implemented');\n }",
"public function lock(): MorphOne\n {\n return $this->morphOne(Lock::class, 'lockable')\n ->where('state_id', Lock::STATE_ACTIVE_ID);\n }",
"public function edit(ProductLock $productLock)\n {\n //\n }",
"public function isLocked();",
"public function isLocked();",
"public function isLocked();",
"public function checkout($version);",
"protected function do_lock($obj) {\n\t\t$this->debug(\"-- do_lock($obj))\";\n\n\t\t$this->send(self::REQ_ACQ_LOCK, $obj);\n\n\t\tlist($op, $p) = $this->receive();\n\n\t\tif ($op == self::REP_ACK) {\n\t\t\t// wait for a definitive answer\n\t\t\tlist($op, $p) = $this->receive();\n\t\t}\n\t\tif ($op != self::REP_LOCK_ACQUIRED) {\n\t\t\treturn false;\n\t\t\tthrow new LockException($this->decode_reply($op) . \": \" . $p);\n\t\t}\n\t\treturn true;\n\t}",
"function lock($db, $id, $table='activity') {\n if ($id<0) return -1; # ignore 'new' entries.\n $q='UPDATE '.$table.' set editlock=datetime(\\'now\\',\\'+5 minutes\\') WHERE editlock < datetime(\\'now\\') AND id='.$id.';';\n if ($db->exec($q) == 1) return -1;\n\n $q='SELECT editlock from '.$table.' WHERE id='.$id.';';\n $res=$db->query($q);\n if (!$res) return 0; # XXX error\n $r=$res->fetch(PDO::FETCH_ASSOC);\n return $r['editlock'];\n }",
"public function lock_cp()\n\t{\n\t\tif (ee()->session->userdata('admin_sess') == 0)\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tee()->db->set('admin_sess', 0)\n\t\t\t->where('session_id', $this->userdata['session_id'])\n\t\t\t->update('sessions');\n\t}",
"public function testMethodSetLocked()\n {\n $scorebox = new Scorebox();\n\n $scorebox->setLocked(true);\n\n $status = $scorebox->isLocked();\n\n $expStatus = true;\n\n $this->assertEquals($status, $expStatus);\n }",
"public function lock()\n {\n return view('pages.example_pages.lock');\n }",
"public function transaction_held() {\n\n\t\treturn false;\n\t}",
"function update_basket (array $data)\n {\n// debug_print ('INFO: Update Basket', $data);\n global $connection;\n// $member_id_you = $_SESSION['member_id'];\n $producer_id_you = $_SESSION['producer_id_you'];\n // Allow admins to override certain checks if the requested action is not for themselves\n $admin_override = true;\n if ($member_id_you == $data['member_id'] || ! CurrentMember::auth_type('cashier'))\n {\n $admin_override = false;\n }\n// Set this value manually when converting from transactions to ledger accounting\n$admin_override = true;\n // Set flags for needed validations and operations\n switch ($data['action'])\n {\n // checkout will checkout all the items in the basket\n case 'checkout':\n $test_for_membership_privilege = true;\n $test_customer_ordering_window = true;\n $initiate_set_checkout = true;\n $initiate_checkout_items = true;\n break;\n // same as \"checkout\" but only synchs items that were already checked out\n case 'synch_ledger_items':\n $test_for_membership_privilege = true;\n $test_customer_ordering_window = true;\n $initiate_set_checkout = true;\n $synch_ledger_items = true;\n break;\n // set_uncheckout is currently disabled\n case 'set_checkout':\n $test_for_membership_privilege = true;\n $test_customer_ordering_window = true;\n $initiate_set_checkout = true;\n break;\n // un_checkout is currently disabled\n case 'un_checkout':\n $test_customer_ordering_window = true;\n $initiate_un_checkout = true;\n break;\n // update the site (Pickup|Home|Work)\n case 'set_site':\n $update_site = true;\n break;\n default:\n die(debug_print('ERROR: 679217 ', 'unexpected request', basename(__FILE__).' LINE '.__LINE__));\n break;\n }\n // Get information about the basket for this member\n // Prefer to access basket by basket_id\n if ($data['basket_id'] != 0)\n {\n $basket_info = get_basket ($data['basket_id']);\n }\n // Then try with member_id/delivery_id combination\n elseif ($data['member_id'] != 0 && $data['delivery_id'] != 0)\n {\n $basket_info = get_basket ($data['member_id'], $data['delivery_id']);\n }\n // Otherwise we don't know enough to get the basket\n else\n {\n die(debug_print('ERROR: 970893 ', 'incomplete information to locate basket', basename(__FILE__).' LINE '.__LINE__));\n }\n // Check that we actually got some basket information\n if (! is_array ($basket_info))\n {\n die(debug_print('ERROR: 701854 ', 'basket does not exist', basename(__FILE__).' LINE '.__LINE__));\n }\n // Check that the member is not pending or discontinued\n if ($test_for_membership_privilege && ! $admin_override)\n {\n if ($member_info['pending'] == 1 || $member_info['membership_discontinued'] == 1)\n {\n die(debug_print('ERROR: 974383 ', 'incorrect privilege to order', basename(__FILE__).' LINE '.__LINE__));\n }\n }\n // Check if shopping is closed for this order\n if ($test_customer_ordering_window && ! $admin_override && !(new ActiveCycle())->is_open_for_ordering())\n {\n die(debug_print('ERROR: 823186 ', 'customer ordering period is not in effect', basename(__FILE__).' LINE '.__LINE__));\n }\n // Update the basket with a new site and information related to the new site\n if ($update_site)\n {\n\ndebug_print (\"ERROR: 892573 \", \"UPDATE DELCODE\", basename(__FILE__).' LINE '.__LINE__);\n\n if ($data['delivery_type'] == 'H' || $data['delivery_type'] == 'W') $query_delivery_type = 'D'; // H[ome] and W[ork] --> D[elivery]\n else $query_delivery_type = $data['delivery_type']; // P[ickup]\n // Could check for changes and abort otherwise, but this will force updating\n // delivery_postal_code just in case it might have changed.\n $query_site = '\n SELECT\n delivery_charge,\n delivery_postal_code\n FROM '.NEW_TABLE_SITES.'\n WHERE\n site_id = \"'.mysql_real_escape_string($data['site_id']).'\"\n AND delivery_type = \"'.$query_delivery_type.'\"\n AND inactive = \"0\"\n AND site_type = \"customer\"';\n $result_site = mysql_query($query_site, $connection) or die(debug_print (\"ERROR: 892573 \", array ($query_site,mysql_error()), basename(__FILE__).' LINE '.__LINE__));\n // Got we some information, then post the new information\n if ($row_site = mysql_fetch_array($result_site))\n {\n\n $query_update_basket = '\n UPDATE '.NEW_TABLE_BASKETS.'\n SET\n delivery_cost = \"'.mysql_real_escape_string($row_site['delivery_charge']).'\",\n delivery_postal_code = \"'.mysql_real_escape_string($row['delivery_postal_code']).'\",\n site_id = \"'.mysql_real_escape_string($data['site_id']).'\",\n delivery_type = \"'.mysql_real_escape_string($data['delivery_type']).'\"\n WHERE basket_id = \"'.mysql_real_escape_string($basket_info['basket_id']).'\"';\n $result_update_basket = mysql_query($query_update_basket, $connection) or die(debug_print (\"ERROR: 892764 \", array ($query_update_basket,mysql_error()), basename(__FILE__).' LINE '.__LINE__));\n\ndebug_print (\"INFO: 892573 \", $query_update_basket, basename(__FILE__).' LINE '.__LINE__);\n\n // Update the $basket_info with changes\n $basket_info['delivery_cost'] = $row_site['delivery_charge'];\n $initiate_delivery_charge = true;\n }\n // Otherwise error\n else\n {\n die(debug_print('ERROR: 898952 ', 'requested site does not exist or is not available', basename(__FILE__).' LINE '.__LINE__));\n }\n }\n // Change the checked_out setting on the basket\n // Do this early so the update_basket_item will process the ledger items (only if they are in a checked-out state)\n if ($initiate_set_checkout)\n {\n // Get the number of items in the basket that are checked out\n $query = '\n SELECT\n '.NEW_TABLE_PRODUCTS.'.tangible,\n COUNT('.NEW_TABLE_BASKET_ITEMS.'.bpid) AS count\n FROM\n '.NEW_TABLE_BASKET_ITEMS.'\n LEFT JOIN\n '.NEW_TABLE_PRODUCTS.' USING(product_id,product_version)\n WHERE\n '.NEW_TABLE_BASKET_ITEMS.'.basket_id = \"'.mysql_real_escape_string($basket_info['basket_id']).'\"\n GROUP BY\n '.NEW_TABLE_PRODUCTS.'.tangible';\n $result = mysql_query($query, $connection) or die(debug_print (\"ERROR: 758023 \", array ($query,mysql_error()), basename(__FILE__).' LINE '.__LINE__));\n while ($row = mysql_fetch_array($result))\n {\n if ($row['tangible'] == '0') $intangible_count = $row['count'];\n if ($row['tangible'] == '1') $tangible_count = $row['count'];\n }\n // Preference is to set basket count to the number of *tangible* items in the basket\n if ($tangible_count > 0) $checked_out = $tangible_count;\n // Otherwise if there are no tangible items, we set to [negative] the number of *intangible* items in the basket\n elseif ($intangible_count > 0) $checked_out = 0 - $intangible_count;\n // Otherwise the basket is empty.\n else $checked_out = 0;\n $query = '\n UPDATE '.NEW_TABLE_BASKETS.'\n SET checked_out = \"'.mysql_real_escape_string($checked_out).'\"\n WHERE basket_id = \"'.mysql_real_escape_string($basket_info['basket_id']).'\"';\n $result = mysql_query($query, $connection) or die(debug_print (\"ERROR: 892764 \", array ($query,mysql_error()), basename(__FILE__).' LINE '.__LINE__));\n // Sync the variable we just changed\n $basket_info['checked_out'] = $checked_out ;\n\n // If there is an order cost (fixed), then post it (or clear it if wrongly set).\n if ($basket_info['order_cost'] != 0 &&\n $basket_info['order_cost_type'] == 'fixed' &&\n $basket_info['checked_out'] != 0)\n {\n // Add the order cost to the ledger for this basket\n $ledger_status = basket_item_to_ledger(array (\n 'transaction_group_id' => $data['transaction_group_id'],\n 'source_type' => 'member',\n 'source_key' => $data['member_id'],\n 'target_type' => 'internal',\n 'target_key' => 'order_cost',\n 'amount' => $basket_info['order_cost'],\n 'text_key' => 'order cost',\n 'posted_by' => $_SESSION['member_id'],\n 'basket_id' => $basket_info['basket_id'],\n 'site_id' => $basket_info['site_id'],\n 'delivery_id' => $basket_info['delivery_id'],\n 'match_keys' => array ('source_type','source_key','target_type','target_key','text_key','basket_id')\n ));\n }\n // If there is an order cost (percent), then post it (or clear it if wrongly set).\n elseif ($basket_info['order_cost'] != 0 &&\n $basket_info['order_cost_type'] == 'percent' &&\n $basket_info['checked_out'] != 0)\n {\n // First need to know the basket total to calculate the percent cost\n $query = '\n SELECT\n SUM(amount) AS order_total\n FROM\n '.NEW_TABLE_LEDGER.'\n WHERE\n basket_id = \"'.mysql_real_escape_string($basket_info['basket_id']).'\"\n AND (text_key = \"quantity cost\"\n OR text_key = \"weight cost\")';\n $result = mysql_query($query, $connection) or die(debug_print (\"ERROR: 678304 \", array ($query,mysql_error()), basename(__FILE__).' LINE '.__LINE__));\n if ($row = mysql_fetch_array($result))\n {\n $order_total = $row['order_total'];\n $order_cost_total = round ($row['order_total'] * $basket_info['order_cost'] / 100, 2);\n }\n // Add the order cost to the ledger for this basket\n $ledger_status = basket_item_to_ledger(array (\n 'transaction_group_id' => $data['transaction_group_id'],\n 'source_type' => 'member',\n 'source_key' => $data['member_id'],\n 'target_type' => 'internal',\n 'target_key' => 'order_cost',\n 'amount' => $basket_info['order_cost'],\n 'text_key' => 'order cost',\n 'posted_by' => $_SESSION['member_id'],\n 'basket_id' => $basket_info['basket_id'],\n 'site_id' => $basket_info['site_id'],\n 'delivery_id' => $basket_info['delivery_id'],\n 'match_keys' => array ('source_type','source_key','target_type','target_key','text_key','basket_id')\n ));\n }\n }\n // For checkout, synchronize ledger entries to all basket_items\n if ($initiate_checkout_items || $synch_ledger_items)\n {\n // $initiate_checkout_items: check out all items and synch ledger\n // $synch_ledger_items: repost existing checked_out items to the ledger\n if ($synch_ledger_items)\n {\n // Restrict to just the checked_out items\n $query_where = '\n AND checked_out != \"0\"';\n }\n // Get the items currently in the basket\n $query_basket_items = '\n SELECT\n bpid,\n product_id,\n product_version\n FROM '.NEW_TABLE_BASKET_ITEMS.'\n WHERE basket_id = \"'.mysql_real_escape_string($basket_info['basket_id']).'\"'.\n $query_where;\n $result_basket_items = mysql_query($query_basket_items, $connection) or die(debug_print (\"ERROR: 892785 \", array ($query_basket_items,mysql_error()), basename(__FILE__).' LINE '.__LINE__));\n // Go through all the basket items (or all the checked_out items)\n while ($row_basket_items = mysql_fetch_array($result_basket_items))\n {\n $basket_item_info = update_basket_item (array(\n 'action' => 'synch_ledger',\n 'delivery_id' => $data['delivery_id'],\n 'member_id' => $data['member_id'],\n 'product_id' => $row_basket_items['product_id'],\n 'product_version' => $row_basket_items['product_version']\n ));\n if (! is_array($basket_item_info))\n {\n $basket_info['checked_out'] = 0;\n die(debug_print (\"ERROR: 902784 \", 'update_basket_item() did not return array.', basename(__FILE__).' LINE '.__LINE__));\n }\n }\n }\n // This is done for any/all changes, so not conditional except for baskets that are not checked-out.\n if ($basket_info['checked_out'] != 0)\n {\n // If there is a delivery charge, then post it (or clear it if wrongly set).\n if ($basket_info['delivery_cost'] != 0 || $initiate_delivery_charge)\n {\n // Add the delivery cost to the ledger for this basket\n $ledger_status = basket_item_to_ledger(array (\n 'transaction_group_id' => $data['transaction_group_id'],\n 'source_type' => 'member',\n 'source_key' => $data['member_id'],\n 'target_type' => 'internal',\n 'target_key' => 'delivery_cost',\n 'amount' => $basket_info['delivery_cost'],\n 'text_key' => 'delivery cost',\n 'posted_by' => $_SESSION['member_id'],\n 'basket_id' => $basket_info['basket_id'],\n 'site_id' => $basket_info['site_id'],\n 'delivery_id' => $basket_info['delivery_id'],\n 'match_keys' => array ('source_type','source_key','target_type','target_key','text_key','basket_id')\n ));\n }\n }\n\n// // For un_checkout, clear all ledger entries related to the basket and basket_items\n// // This will remove or clear the cost of ledger entries for all products in the basket\n// if ($initiate_un_checkout)\n// {\n// // Get the items currently in the basket\n// $query_basket_items = '\n// SELECT\n// bpid,\n// product_id,\n// product_version\n// FROM '.NEW_TABLE_BASKET_ITEMS.'\n// WHERE basket_id = \"'.mysql_real_escape_string($basket_info['basket_id']).'\"';\n// $result_basket_items = mysql_query($query_basket_items, $connection) or die(debug_print (\"ERROR: 892785 \", array ($query_basket_items,mysql_error()), basename(__FILE__).' LINE '.__LINE__));\n// // Go through all the basket items\n// while ($row_basket_items = mysql_fetch_array($result_basket_items))\n// {\n// // Problem: clear_item removes all quantity from the basket. We would like to leave the basket unchanged.\n// // ... but if we define that as the desired behavior, then we have something, at least...\n// $basket_item_info = update_basket_item (array(\n// 'action' => 'un_checkout',\n// 'delivery_id' => $data['delivery_id'],\n// 'member_id' => $data['member_id'],\n// 'product_id' => $row_basket_items['product_id'],\n// 'product_version' => $row_basket_items['product_version'],\n// 'post_even_if_zero' => 'YES'\n// ));\n// if ($basket_item_info != 'clear_item:'.$row_basket_items['bpid'])\n// {\n// return('error 100: expected \"clear_item:'.$row_basket_items['bpid'].'\" but got \"'.$basket_item_info.'\"');\n// }\n// }\n// // And un-checkout the basket as well\n// // Remove the delivery cost from the ledger for this basket\n// $ledger_status = basket_item_to_ledger(array (\n// 'source_type' => 'member',\n// 'source_key' => $data['member_id'],\n// 'target_type' => 'internal',\n// 'target_key' => 'delivery_cost',\n// 'amount' => 0,\n// 'text_key' => 'delivery cost',\n// 'posted_by' => $_SESSION['member_id'],\n// 'basket_id' => $basket_info['basket_id'],\n// 'site_id' => $basket_info['site_id'],\n// 'delivery_id' => $basket_info['delivery_id'],\n// 'match_keys' => array ('source_type','source_key','target_type','target_key','text_key','basket_id')\n// ));\n// }\n// // Change the checked_out setting on the basket\n// // Do this last so the update_basket_item will clear ledger items (only if they are in a checked-out state)\n// if ($initiate_un_checkout)\n// {\n// $query = '\n// UPDATE '.NEW_TABLE_BASKETS.'\n// SET checked_out = \"0\"\n// WHERE basket_id = \"'.mysql_real_escape_string($basket_info['basket_id']).'\"';\n// $result = mysql_query($query, $connection) or die(debug_print (\"ERROR: 892764 \", array ($query,mysql_error()), basename(__FILE__).' LINE '.__LINE__));\n// $basket_info['checked_out'] = 0;\n// }\n\n // At this point, all basket information has been updated, so we need to consider any changes to the ledger.\n// * messages link a message to this transaction\n// * post_even_if_zero 'YES' will delete the transaction is zero and a singleton\n\n\n// NEED TO ADD PAYPAL SURCHARGE CALCULATION\n\n // Return the new (possibly changed) basket_info array\n return ($basket_info);\n }",
"public function ownsLock()\n {\n return $this->owner() === $this->id;\n }",
"public function acquireSharedLock() {}"
] | [
"0.6322171",
"0.6227839",
"0.61334705",
"0.60521877",
"0.59534293",
"0.59472394",
"0.5944582",
"0.5873581",
"0.5862989",
"0.58301544",
"0.57748145",
"0.57735854",
"0.5766947",
"0.5724643",
"0.57244474",
"0.56988204",
"0.56532604",
"0.56275815",
"0.55933475",
"0.55849653",
"0.5576252",
"0.5554069",
"0.555307",
"0.552693",
"0.5510453",
"0.54923254",
"0.5478492",
"0.5477541",
"0.5475659",
"0.54673624",
"0.5460874",
"0.5452305",
"0.5448054",
"0.5438975",
"0.5433313",
"0.5433313",
"0.5433313",
"0.5433313",
"0.5433313",
"0.54260033",
"0.53901964",
"0.5372809",
"0.53510517",
"0.5330751",
"0.53193706",
"0.5314194",
"0.5312623",
"0.53052855",
"0.5294387",
"0.52721953",
"0.52554095",
"0.524873",
"0.52452815",
"0.52377737",
"0.52357674",
"0.52291566",
"0.5225356",
"0.5217756",
"0.5202505",
"0.51967317",
"0.518929",
"0.5180316",
"0.5159332",
"0.51388264",
"0.5138282",
"0.51303786",
"0.510544",
"0.5103942",
"0.50997144",
"0.5076636",
"0.50725514",
"0.5070014",
"0.5069023",
"0.5067516",
"0.50635827",
"0.5063188",
"0.5052589",
"0.50523895",
"0.5050794",
"0.50461113",
"0.50415325",
"0.5040714",
"0.503115",
"0.50252074",
"0.502326",
"0.5022462",
"0.5018644",
"0.501443",
"0.5014377",
"0.5014377",
"0.5014377",
"0.5010727",
"0.50068235",
"0.49734494",
"0.49708328",
"0.4970114",
"0.49601424",
"0.49542087",
"0.49399012",
"0.49355718",
"0.4933584"
] | 0.0 | -1 |
Tests if the event is checked out | function isCheckedOut( $uid=0 )
{
if ($this->_loadData())
{
if ($uid) {
return ($this->_data->checked_out && $this->_data->checked_out != $uid);
} else {
return $this->_data->checked_out;
}
} elseif ($this->_id < 1) {
return false;
} else {
JError::raiseWarning( 0, 'Unable to Load Data');
return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isEvent()\n {\n return isset($this->status_changed) && ! is_null($this->status_changed);\n }",
"function checkin()\r\n\t{\r\n\t\tif ($this->_id)\r\n\t\t{\r\n\t\t\t$event = & JTable::getInstance('eventlist_events', '');\r\n\t\t\treturn $event->checkin($this->_id);\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"function isCheckedOut( $uid=0 ) {\r\n\t\tif ($item = $this->getItem()) {\r\n\t\t\tif ($uid) {\r\n\t\t\t\treturn ($item->checked_out && $item->checked_out != $uid);\r\n\t\t\t} else {\r\n\t\t\t\treturn $item->checked_out;\r\n\t\t\t}\r\n\t\t} elseif ($this->_id < 1) {\r\n\t\t\treturn false;\r\n\t\t} else {\r\n\t\t\tJError::raiseWarning( 0, 'UNABLE LOAD DATA');\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"public function a_book_can_be_checked_out()\n {\n $book = Book::factory()->create();\n $user = User::factory()->create();\n\n $book->checkout($user);\n\n $this->assertCount(1, Reservation::all());\n\n $reservation = Reservation::first();\n $this->assertEquals($user->id, $reservation->user_id);\n $this->assertEquals($book->id, $reservation->book_id);\n $this->assertEquals(now(), $reservation->checked_out_at);\n $this->assertNull($reservation->checked_in_at);\n }",
"function checkout($uid = null)\r\n\t{\r\n\t\tif ($this->_id)\r\n\t\t{\r\n\t\t\t// Make sure we have a user id to checkout the event with\r\n\t\t\tif (is_null($uid)) {\r\n\t\t\t\t$user\t=& JFactory::getUser();\r\n\t\t\t\t$uid\t= $user->get('id');\r\n\t\t\t}\r\n\t\t\t// Lets get to it and checkout the thing...\r\n\t\t\t$event = & JTable::getInstance('eventlist_events', '');\r\n\t\t\treturn $event->checkout($uid, $this->_id);\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"public function CheckOut() {\n\n\t\tif ($this->parameter_check) {\n\n\t\t\t/* DATABASE CONNECTION */\n\t\t\t$db=$GLOBALS['db'];\n\n\t\t\t/* DESCRIPTION MUST ALWAYS COME FIRST BEFORE WE DELETE THE RECORDS */\n\t\t\t$description=GetColumnValue(\"filename\",\"document_files\",\"document_id\",$this->document_id,\"\"). \" - checked out\";\n\n\t\t\t$sql=\"UPDATE \".$GLOBALS['database_prefix'].\"document_files\n\t\t\t\t\t\tSET checked_out = 'y',\n\t\t\t\t\t\tuser_id_checked_out = \".$_SESSION['user_id'].\",\n\t\t\t\t\t\tdate_checked_out = now()\n\t\t\t\t\t\tWHERE document_id = \".$this->document_id.\"\n\t\t\t\t\t\t\";\n\t\t\t//echo $sql;\n\t\t\t$result=$db->Query($sql);\n\t\t\tif ($db->AffectedRows($result) > 0) {\n\t\t\t\t/* CALL THE UNLOCK FEATURE */\n\t\t\t\t$this->UnLockDocument();\n\t\t\t\t/* CALL THE UNDO CUT FEATURE */\n\t\t\t\t$this->DocumentUndoCut();\n\t\t\t\t/* LOG THE HISTORY */\n\t\t\t\tLogDocumentFileHistory($this->GetColVal(\"filename\"),$this->GetColVal(\"category_id\"),$this->GetColVal(\"version_number\"),$description);\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}\n\t\telse {\n\t\t\t$this->Errors(\"Parameter check failed\");\n\t\t\treturn False;\n\t\t}\n\t}",
"public function eventExists()\n {\n return $this->getTalk()->getSpeaker()->exists();\n }",
"function isCheckedOut($media_id)\n\t{\n\t\treturn $this->query->isCheckedOut($media_id);\n\t}",
"private function checkEventExists(){\n $event = Event::find($this->id);\n\n return(!is_null($event));\n }",
"public function checkOut()\n {\n $this->update(['book_status' => 'checkedout']);\n }",
"public function isDone()\n\t{\n\t $today = Carbon::now()->setTimezone('America/Los_Angeles')->startOfDay();\n\t return $today->gte($this->event_date->endOfDay());\n\t}",
"private function checkEventDateNotDue(){\n $event = Event::find($this->id);\n $now = Carbon::now();\n \n $startTime = Carbon::createFromFormat('Y-m-d H:i:s', $event->start_time);\n return $startTime->gt($now);\n }",
"public function hasEvents()\n {\n return count($this->events) > 0 ? true : false;\n }",
"public function check_last_event( $event_name ) {\n\t\t\treturn $event_name === $this->last_event;\n\t\t}",
"public function checkSignal()\n {\n if($this->current_signal){\n $this->fire($this->current_signal); \n }\n }",
"public function isEventRecurs() {\n\t\treturn ($this->eventRecurs);\n\t}",
"public function getHasBeenRejectedBefore(): bool;",
"function getHasEvent() {\n\t\treturn $this->_HasEvent;\n\t}",
"public function fireEventCancel(string $eventName): bool;",
"function eo_reoccurs($id=''){\n\tglobal $post;\n\t$event = $post;\n\n\tif(isset($id)&&$id!='') $event = eo_get_by_postid($id);\n\n\tif(isset($event->event_schedule)&&$event->event_schedule!='once')\n\t\treturn true;\n\n\treturn false;\n}",
"public function testGetAccountEventCheckOut()\n {\n // Grab Page\n $result = $this->visit('account/event/check-in')\n ->see('create your suaray account')\n ->see('welcome to suaray')\n ->seePageIs('/account/register');\n }",
"public function hasEventQueue(/*# string */ $eventName)/*# : bool */;",
"public static function event_method()\n {\n return true;\n }",
"public function isChecked() {}",
"public function test_showCheckOut_UserIsNotNullAndAvailableToCheckOutAndUserHasNotCheckedItOut_returnTrue()\r\n\t{\r\n\t\t$this->prepareisCheckOutAvailable(true);\r\n\t\t$this->prepareCheckedOutByPatron(false);\r\n\t\t\r\n\t\t$actual = $this->service->showCheckOut($this->userMock);\r\n\t\t$this->assertTrue($actual);\r\n\t}",
"public function isClicked() : bool {\n return $this->delivery_status === WebhookEvent::EVENT_CLICK;\n }",
"public function test_showCheckOut_UserIsNotNullAndAvailableToCheckOutAndUserHasNotCheckedItOut_returnFalse()\r\n\t{\r\n\t\t$patronID = \"aDummyPatronId\";\r\n\t\t$this->prepareisCheckOutAvailable(true);\r\n\t\t$this->prepareCheckedOutByPatron(true);\r\n\t\r\n\t\t$actual = $this->service->showCheckOut($this->userMock);\r\n\t\t$this->assertFalse($actual);\r\n\t}",
"public function isCancelable(): bool;",
"public function hasIsCheckIn(){\n return $this->_has(3);\n }",
"public function hasPendingActions()\r\n {\r\n }",
"public function checkOrdersForUpdateCheckouts()\n {\n $orderCollection = Mage::getModel(\"sales/order\")->getCollection();\n\n //get current timestamp\n $nowTime = new DateTime(null, new DateTimeZone(\"UTC\"));\n $nowTimestamp = $nowTime->getTimestamp();\n\n foreach ($orderCollection as $order) {\n $isTriggered = $order->getUrbitTriggered();\n\n if (isset($isTriggered) && $isTriggered == 'false') {\n $orderUpdateCheckoutTime = $order->getUrbitUpdateCheckoutTime();\n\n if (isset($orderUpdateCheckoutTime) && $orderUpdateCheckoutTime != \"\" && (int)$orderUpdateCheckoutTime <= $nowTimestamp) {\n $this->sendUpdateCheckout($order->getId());\n $order->setData('urbit_triggered', 'true');\n $order->save();\n }\n }\n }\n }",
"public function event_has_run($name)\r\n\t{\r\n\t\treturn isset($this->observer_has_run[$name]);\r\n\t}",
"public function isUserEvent()\n {\n return $this->baseEvent->isUserEvent();\n }",
"public function has($name)\r\n {\r\n return isset($this->_events[$name]);\r\n }",
"protected function mustTakeAction(string $eventName): bool\n {\n }",
"public function isUnknownEvent()\n {\n return $this->baseEvent->isUnknownEvent();\n }",
"protected function observed($event)\n {\n return $this->hasListeners($this->buildEventName($event));\n }",
"public function hasFinishState(){\n return $this->_has(5);\n }",
"public function valid()\n {\n return (false !== \\next($this->events)) ? current($this->events) : false;\n }",
"private function checkEventNotBookedByCreator(){\n $event = Event::find($this->id);\n\n return($event->host != Auth::id());\n }",
"public function test_showCheckOut_UserIdIsNullCanNotBeCheckOut_returnTrue()\r\n\t{\r\n\t\t$this->prepareisCheckOutAvailable(false);\t\r\n\t\t$actual = $this->service->showCheckOut();\r\n\t\t$this->assertFalse($actual);\r\n\t}",
"public function hasEventListeners($event);",
"function signed_off_by_checker($commit, $config, &$msg_out)\n{\n # Skip this commit if it's a merge commit and we've been told to\n # skip merge commits.\n if (isset($config[\"ignore merge commits\"]) &&\n $config[\"ignore merge commits\"] &&\n count($commit->{\"parents\"}) > 1) {\n return true;\n }\n\n if (preg_match(\"/Signed-off-by: /\", $commit->{\"commit\"}->{\"message\"})) {\n return true;\n } else {\n $msg_out = $config[\"gwc one bad msg\"];\n return false;\n }\n}",
"public function isOngoing() {\n return ($this->hasStarted() && !$this->isFinished());\n }",
"public function isDue(): bool\n {\n $this->schedule($this->event());\n\n return $this->event->isDue(app());\n }",
"public function hasOnChange(): bool\n {\n return ! empty($this->onChange);\n }",
"public function testCheckReturnsTrueIfNoOrganizationOrOwner()\n {\n $target = new CheckJobCreatePermissionListener();\n\n $org = $this->getMockBuilder('\\Organizations\\Entity\\OrganizationReference')\n ->disableOriginalConstructor()\n ->getMock();\n\n $org->expects($this->exactly(2))\n ->method('hasAssociation')\n ->will($this->onConsecutiveCalls(false, true));\n\n $org->expects($this->once())\n ->method('isOwner')\n ->willReturn(true);\n\n $role = new User();\n $role->setOrganization($org);\n\n $e = new AssertionEvent();\n $e->setRole($role);\n\n $this->assertTrue($target->checkCreatePermission($e));\n $this->assertTrue($target->checkCreatePermission($e));\n }",
"private function _isRejected($event)\n {\n return in_array(\n $event,\n array('catalogsearch_advanced_result', 'catalogsearch_advanced_index')\n );\n }",
"function checkout_check() {\n\t\treturn false;\n\t}",
"public function testGetAccountEventCheckInUpdateOut()\n {\n // Grab Page\n $result = $this->visit('account/event/check-in/update')\n ->see('create your suaray account')\n ->see('welcome to suaray')\n ->seePageIs('/account/register');\n }",
"public function eventExists(Event $event){\r\n //echo $event->getType();\r\n $stmt = $this->db->prepare(\"SELECT COUNT(*) as count FROM event WHERE type = ? AND name = ? AND date = ? AND observations = ? AND guests = ?\");\r\n $stmt->execute(array($event->getType(), $event->getName(), $event->getDate(), $event->getObservations(), $event->getGuests()));\r\n $data = $stmt->fetch(PDO::FETCH_ASSOC);\r\n\r\n if($data['count'] == 0){\r\n $exists = false;\r\n }else{\r\n $exists = true;\r\n }\r\n return $exists;\r\n }",
"public function events_ispresent($name)\n\t{\n\t\t$result = $this->db->query(\"SELECT * FROM event_master WHERE event_name = '\".ucfirst($name).\"' AND is_deleted = 0\");\n\t\treturn $result->result();\n\t}",
"public function shouldntRaiseAnEvent()\n {\n }",
"public function testIsChecked() {\r\n $this->timer = new Timer(function() {\r\n $this->assertEquals(FALSE, $this->checkbox->isChecked());\r\n\r\n $this->checkbox->setChecked(TRUE);\r\n $this->assertEquals(TRUE, $this->checkbox->isChecked());\r\n\r\n $this->checkbox->setChecked(FALSE);\r\n $this->assertEquals(FALSE, $this->checkbox->isChecked());\r\n\r\n $this->timer->destroy();\r\n\r\n $this->application->stop();\r\n }, $this->application->getWindow(), Timer::TEST_TIMEOUT);\r\n\r\n $this->timer->start();\r\n\r\n $this->application->start();\r\n }",
"public function isCheckedOut($juserId = 0)\n\t{\n\t\tif ($juserId === 0) {\n\t\t\t$user\t\t= &JFactory::getUser();\n\t\t\t$juserId\t= (int) $user->get('id');\n\t\t}\n\n\t\t$userID = (int) $this->getState('account.userID');\n\n\t\tif (empty($userID)) {\n\t\t\treturn true;\n\t\t}\n\n\t\t$table = &$this->getAccount();\n\n\t\t$return = $table->load($userID);\n\n\t\tif ($return === false && $table->getError()) {\n\t\t\t$this->setError($table->getError());\n\t\t\treturn false;\n\t\t}\n\n\t\treturn $table->isCheckedOut($juserId);\n\t}",
"public function hasChanged(): bool;",
"public function hasChanged(): bool;",
"function isPastEvent($newEventID){\r\n\t\tif(!$this->DBLogin()){\r\n $this->HandleError(\"Database login failed!\");\r\n return false;\r\n }\r\n\t\t\r\n\t\t//check that the event is not a past event.\r\n\t\t//the user should not be able to edit the event when it is past.\r\n\t\t\r\n\t\t\r\n\t\t\r\n if(!$this->EnsureRegTable()){\r\n return false;\r\n }\r\n\t\t\r\n\t\tif(!$this->EnsureMyEventsTable($formvars['UuserName'])){\r\n return false;\r\n }\r\n\t\t\r\n if(!$this->IsFieldUnique($formvars, 'email')){\r\n $this->HandleError(\"This email is already registered\");\r\n return false;\r\n }\r\n \r\n if(!$this->IsFieldUnique($formvars, 'username')){\r\n $this->HandleError(\"This UserName is already used. Please try another username\");\r\n return false;\r\n }\r\n \r\n if(!$this->InsertIntoEventAdvisorDB($formvars)){\r\n $this->HandleError(\"Inserting to Database failed!\");\r\n return false;\r\n }\r\n return true;\r\n\t}",
"public function hasChangedTargetGroup();",
"public function getEventStatus($event)\n {\n $url = $this->getNetwork()->getConfigData('pushd.url');\n $url .= 'event/'.$event;\n $result = file_get_contents($url);\n if (false === $result) {\n return true;\n } else {\n return false;\n }\n }",
"public function isOngoing()\n {\n if (empty($this->eventdatetime->endtime)) {\n return false;\n }\n\n $start = date('m-d-Y', strtotime($this->eventdatetime->starttime));\n $end = date('m-d-Y', strtotime($this->eventdatetime->endtime));\n\n //It is not an ongoing event if it starts and ends on the same day.\n if ($start == $end) {\n return false;\n }\n\n return true;\n }",
"static protected function eventExists($uid) {\n return array_key_exists($uid, self::$events);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function hasState(){\n return $this->_has(1);\n }",
"public function test_showPlaceHold_UserIsNotNullCanPlaceHoldItemHasBeenCheckedOutByPatron_returnTrue()\r\n\t{\r\n\t\t$patronId = \"aDummyPatronId\";\r\n\t\t$this->prepareIsPlaceHoldAvailable(true);\r\n\t\t$this->prepareCheckedOutByPatron(true);\r\n\t\r\n\t\t$actual = $this->service->showPlaceHold($this->userMock);\r\n\t\t$this->assertFalse($actual);\r\n\t}",
"function hasCallbacks($event) {\n return Event::hasCallbacks($event);\n }",
"public function testEventStatus()\n {\n $feed = $this->eventFeed;\n\n // Assert that all entry's have an eventStatus object\n foreach ($feed as $entry) {\n $this->assertTrue($entry->getEventStatus() instanceof Zend_Gdata_Extension_EventStatus);\n }\n\n // Assert one of the entries values\n $entry = $feed[2];\n $this->verifyProperty2($entry, \"eventStatus\", \"value\", \"http://schemas.google.com/g/2005#event.confirmed\");\n }",
"public function checkForFollowUpNotClicked()\n {\n $now = Carbon::now();\n $logs = $this->getNotClickedMessagesToFollow();\n foreach($logs as $log) {\n MailLog::info(sprintf('Trigger sending follow-up not clicked email for automation `%s`, subscriber: %s, event ID: %s', $this->automation->name, $log->subscriber_id, $this->id));\n $this->fire(collect([$log->subscriber]));\n // a more verbal way is: fire(Subscriber::where('id', $log->subscriber_id)\n }\n }",
"function isEventEnding( $event )\n {\n // Settings\n $ini = eZINI::instance( \"bceventnotifications.ini\" );\n $eventClassIdentifier = $ini->variable( \"EventNotificationsSettings\", \"EventClassIdentifier\" );\n $eventEndDateTimeIdentifier = $ini->variable( \"EventNotificationsSettings\", \"EventClassAttributeIdentifierEndDateTime\" );\n\n if( $eventClassIdentifier == $event->ClassIdentifier )\n {\n // Event Start Attribute\n $dm=$event->dataMap();\n $eventStartDateAttribute=$dm[$eventEndDateTimeIdentifier];\n $eventStartDate=$eventStartDateAttribute->content();\n\n // Event Start DateTime Object\n $ct = new eZDateTime();\n $ts = $ct->timeStamp();\n\n // Event Start DateTime Object\n $eventDateTime = new eZDateTime();\n $eventDateTime->setTimeStamp( $eventStartDate->timeStamp() );\n $eventDateTimeString = $eventDateTime->timeStamp();\n\n // Start time, Start of Hour\n $startOfCurrentHour = new eZDateTime();\n $startOfCurrentHour->adjustDateTime( -1, 0, 0, 0, 0, 0 );\n // $startOfCurrentHour->setMinute( 0 );\n // $startOfCurrentHour->setSecond( 0 );\n $startOfCurrentHourString = $startOfCurrentHour->timeStamp();\n\n // End time, End of Hour\n $endOfCurrentHour = new eZDateTime();\n $endOfCurrentHour->setMinute( 0 );\n $endOfCurrentHour->setSecond( 0 );\n $endOfCurrentHour->adjustDateTime( -1, 59, 59, 0, 0, 0 );\n $endOfCurrentHourString = $endOfCurrentHour->timeStamp();\n\n // Debug\n $eventName = $event->attribute('name');\n print_r( 'Name: '. $eventName );\n print_r(\"\\n\" );\n\n if( $eventDateTime->isGreaterThan( $startOfCurrentHour, true ) && $eventDateTimeString <= $ts )\n {\n $ret = true;\n print_r(\"Notify users: TRUE\\n\");\n\n // Debug\n /*\n\n // Fetch current datetime object\n $cDateTime = new eZDateTime();\n $cDateTimeString = $cDateTime->timeStamp();\n\n\n print_r(\"\\neventDateTime : $eventDateTimeString\\n\\n\");\n print_r(\"Now : $cDateTimeString\\n\");\n print_r(\"(lte) startOfCurrentHour: $startOfCurrentHourString \\n\");\n print_r(\"(lte) endOfCurrentHour: $endOfCurrentHourString \\n\\n\");\n\n\n print_r(\"\\n\" );\n print_r( 'Now: '. $cDateTimeString .' == '. $cDateTime->toString() );\n print_r(\"\\n\");\n\n\n print_r( 'cStart: '. $startOfCurrentHourString .' == '. $startOfCurrentHour->toString() );\n print_r(\"\\n\");\n\n print_r( 'cEnd: '. $endOfCurrentHourString .' == '. $endOfCurrentHour->toString() );\n print_r(\"\\n\\n\");\n\n print_r( 'Event Time: '. $eventDateTimeString .' == '. $eventDateTime->toString() );\n print_r(\"\\n\");\n\n print_r( 'eStart: '. $startEventDateRangeString .' == '. $startEventDateRange->toString() );\n print_r(\"\\n\");\n\n print_r( 'eEnd: '. $endEventDateRangeString .' == '. $endEventDateRange->toString() );\n print_r(\"\\n\\n\");\n */\n }\n }\n return $ret;\n }",
"public function isCancelable()\n {\n\t\treturn !in_array($this->status, [self::STATUS_COMPLETED, self::STATUS_CANCELED]);\n }",
"public function testGetAccountEventCheckInConfirmOut()\n {\n // Grab Page\n $result = $this->visit('account/event/check-in/confirm')\n ->see('create your suaray account')\n ->see('welcome to suaray')\n ->seePageIs('/account/register');\n }",
"Public function isEvent( $cat ) {\r\n\t\treturn isset( $this->events[ $cat ] );\r\n\t}",
"protected function stateHasAfterCallback($state)\n {\n return isset($this->afterMaking[$this->class][$state])\n || isset($this->afterCreating[$this->class][$state]);\n }",
"public function test_showCheckOut_cannotBeCheckedOut_returnFalse($user)\r\n\t{\r\n\t\t$this->prepareisCheckOutAvailable(false);\r\n\t\t$actual = $this->service->showCheckOut($user);\r\n\t\t$this->assertFalse($actual);\r\n\t}",
"public function hasActions();",
"public function isSetEventDate()\n {\n return !is_null($this->_fields['EventDate']['FieldValue']);\n }",
"public function isValueChanged();",
"protected function assertCancelingEvent($event_type) {\n return !empty($this->configuration['event_settings'][$event_type]);\n }",
"function is_event($p = null) {\n\tglobal $post;\n\t$p = ($p == null) ? $post : $p;\n\t$cat = get_the_category($p->ID);\n\t$option_category = get_it_option('event_category');\n\t\n\treturn $cat[0]->cat_ID == $option_category ||\n\t\t\tget_top_parent_cat_ID($cat[0]) == $option_category;\n}",
"public function handle(Event $event): bool\n {\n switch ($event->getType()) {\n case Event::EVENT_COLLISION:\n $this->hit($event);\n return true;\n case Event::EVENT_OUT:\n $this->out();\n return true;\n default:\n return parent::handle($event);\n }\n }"
] | [
"0.64039415",
"0.6395539",
"0.6377019",
"0.6163626",
"0.6108217",
"0.5880456",
"0.58639574",
"0.5807477",
"0.57964987",
"0.5790323",
"0.5733801",
"0.5634129",
"0.56307447",
"0.56082547",
"0.55301434",
"0.55096173",
"0.5508735",
"0.549131",
"0.5482167",
"0.5473836",
"0.54520357",
"0.5425924",
"0.5404549",
"0.5392789",
"0.5377499",
"0.5366102",
"0.5355348",
"0.5345299",
"0.5344733",
"0.5330884",
"0.5326315",
"0.5319364",
"0.5315799",
"0.5302087",
"0.5293132",
"0.5291065",
"0.5264103",
"0.5261063",
"0.52591664",
"0.5247595",
"0.5245657",
"0.5239537",
"0.5231931",
"0.52318597",
"0.52305734",
"0.52280354",
"0.52191114",
"0.5203109",
"0.52020544",
"0.5195242",
"0.5189194",
"0.5188012",
"0.5158195",
"0.51541066",
"0.51413286",
"0.51403093",
"0.51403093",
"0.5140047",
"0.5137053",
"0.5133521",
"0.51267433",
"0.51230997",
"0.5120911",
"0.5120911",
"0.5120911",
"0.5120911",
"0.5120911",
"0.5120911",
"0.5120911",
"0.5120911",
"0.5120911",
"0.5120911",
"0.5120911",
"0.5120911",
"0.5120911",
"0.5120911",
"0.5120911",
"0.5120911",
"0.5120911",
"0.5120911",
"0.5120911",
"0.5120911",
"0.5120911",
"0.5120911",
"0.5105321",
"0.5104006",
"0.509565",
"0.5092064",
"0.5081325",
"0.5077603",
"0.50747156",
"0.50676334",
"0.5065795",
"0.5058251",
"0.50544834",
"0.50513047",
"0.5045302",
"0.5044622",
"0.502893",
"0.5026721"
] | 0.6438064 | 0 |
Method to store the event | function store($data)
{
global $mainframe;
$elsettings = ELAdmin::config();
$user = & JFactory::getUser();
$tzoffset = $mainframe->getCfg('offset');
$row =& JTable::getInstance('eventlist_events', '');
// Bind the form fields to the table
if (!$row->bind($data)) {
$this->setError($this->_db->getErrorMsg());
return false;
}
// Check/sanitize the metatags => done in joomla filterinput
//$row->meta_description = htmlspecialchars(trim(addslashes($row->meta_description)));
if (JString::strlen($row->meta_description) > 255) {
$row->meta_description = JString::substr($row->meta_description, 0, 254);
}
// sanitize => done in joomla filterinput
//$row->meta_keywords = htmlspecialchars(trim(addslashes($row->meta_keywords)));
if (JString::strlen($row->meta_keywords) > 200) {
$row->meta_keywords = JString::substr($row->meta_keywords, 0, 199);
}
//Check if image was selected
jimport('joomla.filesystem.file');
$format = JFile::getExt('JPATH_SITE/images/eventlist/events/'.$row->datimage);
$allowable = array ('gif', 'jpg', 'png');
if (in_array($format, $allowable)) {
$row->datimage = $row->datimage;
} else {
$row->datimage = '';
}
// sanitise id field
$row->id = (int) $row->id;
$nullDate = $this->_db->getNullDate();
// Are we saving from an item edit?
if ($row->id) {
$row->modified = gmdate('Y-m-d H:i:s');
$row->modified_by = $user->get('id');
} else {
$row->modified = $nullDate;
$row->modified_by = '';
//get IP, time and userid
$row->created = gmdate('Y-m-d H:i:s');
$row->author_ip = $elsettings->storeip ? getenv('REMOTE_ADDR') : 'DISABLED';
$row->created_by = $user->get('id');
}
// Make sure the data is valid
if (!$row->check($elsettings)) {
$this->setError($row->getError());
return false;
}
// Store the table to the database
if (!$row->store(true)) {
$this->setError($this->_db->getErrorMsg());
return false;
}
return $row->id;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function storeEvent(){\n \t$eventStore = new Event_Store();\n\n\t\t$eventStore->command = $this->command; \t\n\t\t$eventStore->event = $this->event;\n\t\t$eventStore->status = \"published\";\n\t\t$eventStore->created_at = now();\n\t\t$eventStore->updated_at = now();\n\n\n\t\t$eventStore->save();\n }",
"public function save()\n {\n $data = [\n 'eventKey' => $this->eventKey,\n 'eventType' => $this->getEventType(),\n 'eventAction' => $this->getEventAction(),\n 'eventSubjectID' => $this->getSubjectID(),\n 'eventSubjectData' => trim($this->getSubjectData()),\n 'eventUserID' => ($this->user) ? $this->user->id() : 0,\n 'eventTriggered' => date('Y-m-d H:i:s')\n ];\n\n $PerchAPI = new PerchAPI(1.0, 'redfinch_logger');\n $Events = new RedFinchLogger_Events($PerchAPI);\n\n return $Events->create($data);\n }",
"public function postEventadd();",
"public function storeEvent($event)\n {\n $this->entityManager->persist($event);\n $this->entityManager->flush();\n }",
"public function saveAction()\r\n\t{\r\n\t\t$eventId = $this->getRequest()->getParam('event_id');\r\n\t\t$eventModel = Mage::getModel('master_example/event')->load($eventId);\r\n\r\n\t\tif($data = $this->getRequest()->getPost()){\r\n\t\t\ttry{\r\n\t\t\t\t$eventModel->addData($data)\r\n\t\t\t\t\t->save();\r\n\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addSuccess($this->__(\"your event has been saved\"));\r\n\t\t\t} catch (Exception $e){\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->addError($e->getMessage());\r\n\t\t\t\tMage::getSingleton('adminhtml/session')->setEventFormData($data); // persist the values\r\n\t\t\t\t$this->_redirect('*/*/edit', array('_current' => true));\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->_redirect('*/*/index');\t\r\n\t}",
"public function store()\n\t{\n\t\t// Create New Event\n\n\t\t$evnt = new Events;\n\t\t$evnt->user_id = Auth::id();\n\t\t$evnt->name = Input::get('name');\n\t\t$evnt->size = Input::get('size');\n\t\t$evnt->time_start = Input::get('start');\n\t\t$evnt->time_end = Input::get('end');\n\t\t$evnt->detail = Input::get('detail');\n\t\t$evnt->location = Input::get('loca');\n\t\t$evnt->category = Input::get('cate');\n\t\t$evnt->save();\n\n\t\t$eid = DB::select('select event_id from event where event_id = (select max(event_id) from event)');\n\t\t$join = new JoinEvent;\n\t\t$join->event_id = $eid[0]->event_id;\n\t\t$join->user_id = Auth::id();\n\t\t$join->active = 1;\n\t\t$join->status = 'owner';\n\t\t$join->save();\t\t\n\n\n\t\treturn Redirect::to('/myevent/create');\n\t\t// return $join;\n\t}",
"protected function manageEvent()\n {\n // Manage the incoming session\n $this->manageSession();\n\n // Get the event data from the incoming request\n $eventData = $this->eventRequest->getEvent();\n\n // Get the entity data from the event\n $entityData = $eventData->get('entity');\n\n if (!is_array($entityData)) $entityData = [];\n\n // Hydrate the event entity\n $this->eventEntity = $this->hydrateEntity($entityData);\n\n // Create the event object\n $this->event = new WebsiteEvent();\n\n // Format the action\n $action = $eventData->get('action');\n $this->setDefaultAction($action);\n\n $this->event->setAction($action);\n $this->event->setEntity($this->eventEntity);\n $this->event->setCreatedAt(time());\n\n if (!is_null($eventData->get('data'))) {\n $this->event->setData($eventData->get('data'));\n }\n\n // Set any related entities to the event\n $relatedEntityData = $eventData->get('relatedEntities');\n if (is_array($relatedEntityData) && !empty($relatedEntityData)) {\n foreach ($relatedEntityData as $relatedEntity) {\n $relEntityObj = $this->hydrateEntity($relatedEntity);\n $this->event->addRelatedEntity($relEntityObj);\n\n }\n }\n // Set the session to the event\n $this->event->setSession($this->session);\n }",
"public function 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 store()\n\t{\n\t\t\n\t\t//\n\t}",
"function storeEventDetail() // OK\n {\n $dt = $this->_eventDetail->getEventDetail(); \t \n $sql = \"INSERT INTO events\n ( event_id, \n event_type, \n event_date, \n user_id, \n company)\n VALUES ( '{$this->_eventId}',\n '{$this->_eventType}',\n to_date('{$dt['CURRENT_DATE']}', 'MM/DD/YYYY HH24:MI:SS'),\n '{$dt['USER_ID']}',\n '{$dt['COMPANY']}'\n )\";\n if (! db_execute($sql))\n {\n $this->_errors->addError('Error inserting master event record.');\n return false;\n }\n return true;\n }",
"public static function saved($event) {\n\n\t\t$account = $event->getSubject();\n\t\t$new = $event['new'];\n\n\t}",
"public function addEvent($event){\n $this->events[]=$event;\n }",
"public function store()\n\t {\n\t //\n\t }",
"public function store(EventRequest $request) {\n if (Auth::user()->profile != 'admin') {\n abort(403);\n } else {\n \\App\\Event::create([\n 'name' => $request->name,\n 'event' => $request->event,\n 'point' => $request->point,\n 'start' => $request->start,\n 'end' => $request->end,\n ]);\n $request->session()->flash('alert', 'success');\n $request->session()->flash('status', 'เพิ่มข้อมูลกิจกรรมเรียบร้อยแล้ว');\n return redirect()->back();\n }\n }",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"function _entryapi_ui_event_form_save_event($form, &$form_state, $location, $organiser) {\n\n $values = $form_state['values'];\n\n $update = FALSE;\n if (isset($form['#event'])) {\n $update = TRUE;\n $event = $form['#event'];\n }\n else {\n $event = new CultureFeed_Cdb_Item_Event();\n }\n\n // Publication date\n if ($values['publication_date']) {\n $event->setPublicationDate($values['publication_date']);\n }\n\n // Age\n $event->setAgeFrom(($values['age'] ? $values['age'] : 0));\n\n // Timestamps as calendar.\n if ($values['when'] == 'one_day' || $values['when'] == 'multiple_days') {\n _entry_api_ui_event_save_timestamps($event, $values);\n }\n\n // Period or permanent as calendar.\n elseif ($values['when'] == 'period' || $values['when'] == 'permanent') {\n _entry_api_ui_event_save_weekscheme($event, $values);\n }\n\n // Categories.\n $category_values = $values['kijken_en_luisteren'];\n $category_values += $values['doen'];\n $category_values += $values['bezoeken'];\n $category_options = $form['what']['kijken_en_luisteren']['#options'];\n $category_options += $form['what']['doen']['#options'];\n $category_options += $form['what']['bezoeken']['#options'];\n\n $categories = new CultureFeed_Cdb_Data_CategoryList();\n foreach ($category_values as $key => $value) {\n if ($value) {\n $categories->add(new CultureFeed_Cdb_Data_Category(CultureFeed_Cdb_Data_Category::CATEGORY_TYPE_EVENT_TYPE, $value, $category_options[$value]));\n }\n }\n $event->setCategories($categories);\n\n // Event details.\n $detail = new CultureFeed_Cdb_Data_EventDetail();\n $detail->setTitle($values['title']);\n if (!empty($values['short_description'])) {\n $detail->setShortDescription($values['short_description']);\n }\n $detail->setLanguage(culturefeed_search_get_preferred_language());\n\n $details = new CultureFeed_Cdb_Data_EventDetailList();\n $details->add($detail);\n $event->setDetails($details);\n\n // Location / Address.\n $addresses = $location->getEntity()->getContactInfo()->getAddresses();\n $address = $addresses[0];\n\n // Event location\n $cdbLocation = new CultureFeed_Cdb_Data_Location($address);\n $cdbLocation->setLabel($values['location']);\n $cdbLocation->setCdbid($location->getId());\n $event->setLocation($cdbLocation);\n\n // Event organiser.\n $organiser_object = new CultureFeed_Cdb_Data_Organiser();\n $organiser_object->setLabel($values['organiser']);\n $organiser_object->setCdbid($organiser->getId());\n $event->setOrganiser($organiser_object);\n\n // Contact info.\n $physical_address = $address->getPhysicalAddress();\n $contact_object = new CultureFeed_Cdb_Data_ContactInfo();\n $contact_object->addAddress(new CultureFeed_Cdb_Data_Address($physical_address));\n\n foreach ($values['contacts'] as $contact) {\n\n if (!empty($contact['text'])) {\n switch ($contact['type']) {\n\n case 'website':\n $contact_object->addUrl(new CultureFeed_Cdb_Data_Url($contact['text'], FALSE, $contact['reservation']));\n break;\n\n case 'email':\n $contact_object->addMail(new CultureFeed_Cdb_Data_Mail($contact['text'], FALSE, $contact['reservation']));\n break;\n\n case 'phone':\n $contact_object->addPhone(new CultureFeed_Cdb_Data_Phone($contact['text'], CultureFeed_Cdb_Data_Phone::PHONE_TYPE_PHONE, FALSE, $contact['reservation']));\n break;\n\n }\n }\n\n\n }\n\n $event->setContactInfo($contact_object);\n\n try {\n\n if ($update) {\n DrupalCultureFeed_EntryApi::updateEvent($event);\n $form_state['#event_id'] = $event->getCdbId();\n }\n else {\n $form_state['#event_id'] = DrupalCultureFeed_EntryApi::createEvent($event);\n }\n\n $form_state['#update_event'] = $update;\n\n }\n catch (Exception $e) {\n watchdog_exception('entry_api_ui', $e);\n form_set_error('', 'Er ging iets fout tijdens het bewaren.');\n }\n\n}",
"public function saveEvent(){\n\t\t$this->load->database();\n\t\t//if this object is new event : insert it to db\n\t\tif($this->id === -1){\n\t\t\t$this->db->query(\"INSERT INTO event (title,des,image,author,postdate,duedate) \n\t\t\t\n\t\t\tVALUES ('$this->title',\n\t\t\t\t\t'$this->des',\n\t\t\t\t\t'$this->image',\n\t\t\t\t\t'$this->author',\n\t\t\t\t\t'$this->postdate',\n\t\t\t\t\t'$this->duedate'\n\t\t\t\t\t)\");\n\t\t}\n\t\t//if this object is exist event : edit it\n\t\telse{\n\t\t\t$this->db->query(\"UPDATE event SET \n\t\t\t\t\n\t\t\t\ttitle='$this->title',\n\t\t\t\tdes='$this->des',\n\t\t\t\timage='$this->image',\n\t\t\t\tpostdate='$this->postdate',\n\t\t\t\tduedate='$this->duedate' \n\t\t\t\t\n\t\t\t\tWHERE id='$this->id'\");\n\t\t}\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\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.7513963",
"0.65146375",
"0.65031177",
"0.64558667",
"0.6332417",
"0.62648046",
"0.6127974",
"0.6126743",
"0.6125723",
"0.61129177",
"0.6083331",
"0.6068194",
"0.6053052",
"0.6042811",
"0.6026723",
"0.6026723",
"0.6026723",
"0.6022508",
"0.60123247",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967",
"0.60008967"
] | 0.0 | -1 |
Registers a new menu page | function add_menu_page() {
add_menu_page(
__( 'Theme Panel - Addons', 'athen_transl' ),
'Theme Panel - Addons', // menu title - can't be translated because it' used for the $hook prefix
'manage_options',
ATHEN_THEME_PANEL_SLUG,
'',
'dashicons-admin-generic',
null
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function add_menu_page()\n\t{\n\t\tadd_menu_page( \n\t\t\t'mmenu',\n\t\t\t'mmenu',\n\t\t\t'manage_options',\n\t\t\t'mmenu',\n\t\t\tarray( $this, 'create_admin_page' ),\n\t\t\t'dashicons-menu'\n\t\t);\n\t}",
"public function addMenu(){\n\t\tadd_menu_page(\n\t\t\t$this->plugin->name,\n\t\t\t$this->plugin->name,\n\t\t\t'publish_pages',\n\t\t\t$this->plugin->varName,\n\t\t\tarray($this, 'page'),\n\t\t\t$this->plugin->uri . 'assets/images/icn-menu.png'\n\t\t);\n\t}",
"protected function registerMenu()\n {\n }",
"function add_menu() {\n add_menu_page(\"Polls\", \"Polls\", \"administrator\", \"polls\", \"managePollsPage\");\n}",
"function add_menu_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $icon_url = '', $position = \\null)\n {\n }",
"public static function add_page() {\n\t\tadd_submenu_page(\n\t\t\tWPEX_THEME_PANEL_SLUG,\n\t\t\tesc_html__( 'Under Construction', 'total' ),\n\t\t\tesc_html__( 'Under Construction', 'total' ),\n\t\t\t'administrator',\n\t\t\tWPEX_THEME_PANEL_SLUG . '-under-construction',\n\t\t\tarray( 'WPEX_Under_Construction', 'create_admin_page' )\n\t\t);\n\t}",
"function scoreSystemManager_add_pages() {\r\n // Add a new top-level menu (ill-advised):\r\n add_menu_page('Score System', 'Score System', 'edit_pages', 'scoreSystemManager-dashboard', 'scoreSystemManager_dashboard');\r\n}",
"function mkRegisterMenu() {\n \n register_nav_menu('primary', 'Main Menu');\n \n }",
"public function add_page() {\n\t\t\tadd_submenu_page(\n\t\t\t\tWPEX_THEME_PANEL_SLUG,\n\t\t\t\t__( 'Theme Skins', 'wpex' ),\n\t\t\t\t__( 'Theme Skins', 'wpex' ),\n\t\t\t\t'administrator',\n\t\t\t\tWPEX_THEME_PANEL_SLUG .'-skins',\n\t\t\t\tarray( $this, 'create_admin_page' )\n\t\t\t);\n\t\t}",
"public function add_page() {\n\t\tadd_submenu_page(\n\t\t\t'oceanwp-panel',\n\t\t\tesc_html__( 'Rec. Plugins', 'ocean-extra' ),\n\t\t\tesc_html__( 'Rec. Plugins', 'ocean-extra' ),\n\t\t\t'manage_options',\n\t\t\t'oceanwp-panel-rec-plugins',\n\t\t\tarray( $this, 'create_admin_page' )\n\t\t);\n\t}",
"public function KemiSitemap_add_menu_page()\n {\n add_options_page(\n 'Kemi Creative Sitemap',\n 'Kemi Sitemap',\n 'manage_options',\n KEMISITEMAP_SLUG,\n array( $this, 'KemiSitemap_options_page' )\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 register_menu() {\n $parent_slug = 'comparrot';\n $capability = 'manage_options';\n\n add_menu_page( 'Comparrot', 'Comparrot', $capability, $parent_slug, [$this, 'import_from_csv_page'], 'dashicons-admin-page', 2 );\n\n add_submenu_page( $parent_slug, __( 'Import from CSV', 'comparrot' ), __( 'Import from CSV', 'comparrot' ), $capability, $parent_slug, [$this, 'import_from_csv_page'] );\n add_submenu_page( $parent_slug, __( 'General settings', 'comparrot' ), __( 'General settings', 'comparrot' ), $capability, 'comparrot-general-settings', [$this, 'general_settings_page'] );\n }",
"public function addAdminMenuPage()\n\t{\n\t\t$menuPage = &ModelAdminMenu::getScheme();\n\n\t\tforeach ( $menuPage as $menu ) {\n\t\t\t$callback = array_keys( $menu );\n\t\t\t$paramArr = array_values( $menu );\n\n\t\t\t$this->_adminMenuPage( $callback[0], $paramArr[0]['parameters'] );\n\t\t}\n\t}",
"public function winespace_welcome_register_menu() {\n\t\tadd_theme_page( 'winespace', 'winespace', 'read', 'winespace-welcome', array( $this, 'winespace_welcome_screen' ) );\n\t}",
"public function register_page() {\n\n\t\t\tadd_menu_page(\n\t\t\t\tesc_html__( 'Set Data For Network', 'wapu-core' ),\n\t\t\t\tesc_html__( 'Set For Network', 'wapu-core' ),\n\t\t\t\t'manage_network',\n\t\t\t\t$this->slug,\n\t\t\t\tarray( $this, 'render_page' )\n\t\t\t);\n\n\t\t}",
"public function add_menus() {\n add_action( 'admin_menu', array( 'Hotmembers3\\Admin_Pages_Creator', 'create_pages') );\n }",
"public function add_menu_page() {\n\t\tadd_submenu_page(\n\t\t\tCT_Ultimate_GDPR::instance()->get_admin_controller()->get_option_name(),\n\t\t\tesc_html__( 'Right To Be Forgotten', 'ct-ultimate-gdpr' ),\n\t\t\tesc_html__( 'Right To Be Forgotten', 'ct-ultimate-gdpr' ),\n\t\t\t'manage_options',\n\t\t\t$this->get_id(),\n\t\t\tarray( $this, 'render_menu_page' )\n\t\t);\n\n\t}",
"public function add_menu_page() {\n\n\t\tadd_submenu_page(\n\t\t\tCT_Ultimate_GDPR::instance()->get_admin_controller()->get_option_name(),\n\t\t\tesc_html__( 'Privacy Policy', 'ct-ultimate-gdpr' ),\n\t\t\tesc_html__( 'Privacy Policy', 'ct-ultimate-gdpr' ),\n\t\t\t'manage_options',\n\t\t\t$this->get_id(),\n\t\t\tarray( $this, 'render_menu_page' )\n\t\t);\n\t}",
"public function setPageMenu() {\n\t\t\tglobal $factory_impressive_page_menu;\n\n\t\t\t$dashicon = ( ! empty( $this->page_menu_dashicon ) ) ? ' ' . $this->page_menu_dashicon : '';\n\t\t\t$short_description = ( ! empty( $this->page_menu_short_description ) ) ? ' ' . $this->page_menu_short_description : '';\n\n\t\t\tif ( is_multisite() && is_network_admin() && ! $this->network ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$factory_impressive_page_menu[ $this->getMenuScope() ][ $this->getResultId() ] = [\n\t\t\t\t'type' => $this->type, // page, options\n\t\t\t\t'url' => $this->getBaseUrl(),\n\t\t\t\t'title' => $this->getPageTitle() . ' <span class=\"dashicons' . $dashicon . '\"></span>',\n\t\t\t\t'short_description' => $short_description,\n\t\t\t\t'position' => $this->page_menu_position,\n\t\t\t\t'parent' => $this->page_parent_page\n\t\t\t];\n\t\t}",
"function mt_add_pages() {\n\n add_menu_page(__('Manage Options','alpha'), __('Mange Options','alpha'), 'manage_options', 'mange-options', 'manage_option_page' );\n}",
"public function register() {\n\t\tcall_user_func_array( 'add_submenu_page', $this->get_page_arguments() );\n\t}",
"public function register_menu()\n {\n add_menu_page('Coupons Settings', 'Coupons Settings', 'edit_others_posts', 'wpm_coupons_settings');\n add_submenu_page('wpm_coupons_settings', 'Coupons Settings', 'Coupons Settings', 'manage_options', 'wpm_coupons_settings', function () {\n $settings = json_decode(get_option('api_settings', true), true);\n\n include 'templates/settings_template.php';\n });\n }",
"function add_management_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \\null)\n {\n }",
"function registrar_menu() {\nregister_nav_menu('menuprincipal', __('Menu Principal'));\n}",
"function add_courses_page(){\n add_menu_page(__('Register Course', SHORT_NAME), // Page title\n __('Register Course', SHORT_NAME), // Menu title\n 'manage_options', // Capability - see: http://codex.wordpress.org/Roles_and_Capabilities#Capabilities\n 'nvt_courses', // menu id - Unique id of the menu\n 'theme_courses_page',// render output function\n null, // URL icon, if empty default icon\n null // Menu position - integer, if null default last of menu list\n );\n}",
"function add_pages_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \\null)\n {\n }",
"function thrive_page_template_add_menu_page()\r\n {\r\n $icon_url = tve_editor_url() . '/editor/css/images/tcb-logo.png';\r\n add_menu_page(\"Font Manager\", \"Font Manager\", \"edit_theme_options\", \"thrive_font_manager\", \"thrive_font_manager\", $icon_url);\r\n }",
"public function parallax_one_welcome_register_menu() {\n\t\tadd_theme_page( 'About Parallax One', 'About Parallax One', 'activate_plugins', 'parallax-one-welcome', array( $this, 'parallax_one_welcome_screen' ) );\n\t}",
"public function addPage() {\n $item = menu_get_item();\n $content = system_admin_menu_block($item);\n\n if (count($content) == 1) {\n $item = array_shift($content);\n drupal_goto($item['href']);\n }\n\n return theme('thumbwhere_host_add_list', array('content' => $content));\n }",
"public function add_my_menu_page() {\r\n\t\tadd_menu_page('WPide', 'WPide', 'manage_network_themes', \"wpide\", array( &$this, 'my_menu_page' ));\r\n\t}",
"function tv_add_menu_items(){\n $reports_page = \"contact_reports.php\";\n // add_menu_page('Reports', 'Reports', 'manage_options', 'contact_reports.php', 'tv_render_list_page', 'dashicons-clipboard', 6);\n add_menu_page('Reports', 'Reports', 'manage_options', $reports_page, 'tv_render_list_page', 'dashicons-clipboard', 6);\n}",
"function admin_landing_page() {\n add_menu_page( 'Welcome | All Cycles Admin', 'Welcome', 'manage_options', 'admin_landing_page', 'create_admin_page', 'dashicons-menu', 5 );\n}",
"function pewc_register_menu_page() {\n add_menu_page(\n __( 'Product Add-Ons', 'pewc' ),\n __( 'Product Add-Ons', 'pewc' ),\n 'edit_others_shop_orders',\n 'pewc_home',\n 'pewc_home_page',\n 'dashicons-plus-alt',\n \tapply_filters( 'pewc_menu_position', 56 )\n );\n\n\tadd_submenu_page('pewc_home', 'Home', 'Home', 'edit_others_shop_orders', 'pewc_home' );\n}",
"function register_my_menu() {\n register_nav_menu('main-menu',__( 'Navegador Primario' ));\n }",
"function _wp_auto_add_pages_to_menu($new_status, $old_status, $post)\n {\n }",
"function register_menu() {\n\n register_nav_menu('header-menu',__('Header Menu'));\n\n}",
"public function register_admin_page()\n {\n }",
"public function addPage() {\n $item = menu_get_item();\n $content = system_admin_menu_block($item);\n\n if (count($content) == 1) {\n $item = array_shift($content);\n drupal_goto($item['href']);\n }\n\n return theme('thumbwhere_contentcollection_add_list', array('content' => $content));\n }",
"public function welcome_register_menu() {\n\t\t\t\t$action_count = get_option('swing_plugin_installed_notif');\n\t\t\t\t$title = $action_count > 0 ? esc_html($this->strings['welcome_menu_text']) . '<span class=\"badge pending-tasks\">' . esc_html( $action_count ) . '</span>' : esc_html($this->strings['welcome_menu_text']);\n\t\t\t\tadd_theme_page( esc_html($this->strings['welcome_menu_text']), $title , 'edit_theme_options', 'vmagazine-lite-welcome', array( $this, 'welcome_screen' ));\n\t\t\t}",
"function register_ba_menu_page(){\n add_menu_page(__( 'Banners', 'banner-advertise' ),'Banners','manage_options','banner_advertise','ba_menu_page','dashicons-format-image',26); \n add_submenu_page( 'banner_advertise', __( 'shortcodes', 'banner-advertise' ), 'shortcodes', 'manage_options', 'ba_shortcodes', 'ba_short_page');\n \n // Register the hidden submenu.\n add_submenu_page(null, __( 'Add New Banner', 'banner-advertise' ), '', 'manage_options', 'banner_insert', 'ba_insert_page');\n add_submenu_page(null, __( 'Banner Edit', 'banner-advertise' ), '', 'manage_options', 'banner_edit', 'ba_edit_page');\n}",
"public function registerMenu()\n\t\t{\n\t\t\tadd_options_page( 'Thingdom Settings', 'Thingdom Settings', 'manage_options', $this->slug, array($this, 'loadSettings')); \n\t\t\tadd_action('admin_init', array($this, 'registerSettings'));\n\t\t}",
"function at_try_menu()\n{\n add_menu_page('signup_list', //page title\n 'Sign Up List', //menu title\n 'manage_options', //capabilities\n 'Signup_List', //menu slug\n Signup_list //function\n );\n}",
"function add_lcars_page() {\n\n\t\t$menu = $this->menu_settings();\n\t\t$this->lcars_screen = add_theme_page( $menu['page_title'], $menu['menu_title'], $menu['capability'], $menu['menu_slug'], array( $this, 'lcars_page' ) );\n\n\t}",
"function lepetitfleur_register_nav_menu() {\n\tregister_nav_menu('primary', 'Header Navigtion Menu' );\n}",
"public function create_menu() {\n\t\tif ( get_network()->site_id !== get_current_blog_id() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t//create new top-level menu\n\t\tadd_management_page(\n\t\t\t__( 'Sync newsletter', 'elemarjr' ),\n\t\t\t__( 'Sync newsletter', 'elemarjr' ),\n\t\t\t'manage_options',\n\t\t\t'sync-newsletter',\n\t\t\tarray( $this, 'display_submenu_page' ),\n\t\t\t6\n\t\t);\n\t}",
"function register_menu() {\n\tregister_nav_menu('primary-menu', __('Primary Menu'));\n}",
"public function panel_register_menu() {\n\t\tadd_menu_page( Theme_Name, 'Theme Options', 'manage_options', 'optionsframework');\n\t}",
"public function addPage() {\n $item = menu_get_item();\n $content = system_admin_menu_block($item);\n\n if (count($content) == 1) {\n $item = array_shift($content);\n drupal_goto($item['href']);\n }\n\n return theme('thumbwhere_contentcollectionitem_add_list', array('content' => $content));\n }",
"function csdb_add_menu_page(){\n\tadd_menu_page(\n\t\t'CSDB',\n\t\t'CSDB',\n\t\t'read',\n\t\t'csdb_plugin',\n\t\t'csdb_menu_page_callback',\n\t\t'dashicons-admin-tools',\n\t\t60\n\t);\n\t\n\t\n\t\n\t\n}",
"public function register_menu_item() {\n\t\t$cpt = get_post_type_object( Tribe__Events__Main::POSTTYPE );\n\t\t$this->ID = add_submenu_page(\n\t\t\t$this->get_url( array( 'page' => null ), true ),\n\t\t\tesc_html( $this->get_page_title() ),\n\t\t\tesc_html( $this->get_menu_label() ),\n\t\t\t$cpt->cap->publish_posts,\n\t\t\tself::$slug,\n\t\t\tarray( $this, 'render' )\n\t\t);\n\n\t\treturn $this->ID;\n\t}",
"function pantomime_register_menu(){\n\tif ( function_exists( 'register_nav_menus' ) ) {\n\t\tregister_nav_menus(\n\t\t\tarray(\n\t\t\t 'main_nav' => 'Main Navigation'\n\t\t\t)\n\t\t);\n\t}\t\n}",
"public function add_page() {\n\t\tadd_theme_page(\n\t\t\t\t__('Manage Sidebars', self::TEXT_DOMAIN),\n\t\t\t\t__('Manage Sidebars', self::TEXT_DOMAIN),\n\t\t\t\t'edit_theme_options',\n\t\t\t\t'ups_sidebars',\n\t\t\t\tarray( $this, 'admin_page' )\n\t\t\t);\n\t}",
"public function add_menu() {\n\t\t\tadd_menu_page(\n\t\t\t\t'Amazon Affiliate | Products',\n\t\t\t\t'Products',\n\t\t\t\t'manage_options',\n\t\t\t\t'amz-affiliate/pages/product.php',\n\t\t\t\tarray( &$this, 'load_product_page' ),\n\t\t\t\tplugins_url( 'amz-affiliate/img/icon.png' ),\n\t\t\t\t50\n\t\t\t);\n\t\t\tadd_submenu_page(\n\t\t\t\t'amz-affiliate/pages/product.php',\n\t\t\t\t'Amazon Affiliate | Tables',\n\t\t\t\t'Tables',\n\t\t\t\t'manage_options',\n\t\t\t\t'amz-affiliate/pages/table.php',\n\t\t\t\tarray( &$this, 'load_table_page' )\n\t\t\t);\n\t\t}",
"function omega_register_menus() {\n\tregister_nav_menu( 'primary', _x( 'Primary', 'nav menu location', 'omega' ) );\n}",
"public function addMenuItem() {\n add_menu_page(__('Visual Chat', 'WP_Visual_Chat'), 'Visual Chat', 'visual_chat', 'vcht-console', array($this, 'viewChatBackend'), 'dashicons-format-chat');\n }",
"public function registerMenu()\n\t{\n\t\t$permission = 'manage_network';\n\t\t$renderMethodName = 'renderNetwork';\n\t\t$networkMenuTitle = esc_html__('Active Directory Integration', 'next-active-directory-integration');\n\t\t$networkMenuSlug = $this->blogProfileRelationshipPage->getSlug(); // the header of the group must have the slug of the first item\n\n\t\t// add menu header\n\t\tadd_menu_page($networkMenuTitle, $networkMenuTitle, $permission, $networkMenuSlug);\n\n\t\t// add sub menus\n\t\t$this->addSubMenu($networkMenuSlug, $permission, $this->blogProfileRelationshipPage, $renderMethodName);\n\t\t$profileConfigurationPage = $this->addSubMenu($networkMenuSlug, $permission, $this->profileConfigurationPage, $renderMethodName);\n\n\t\tadd_action('admin_enqueue_scripts', array($this, 'loadScriptsAndStyle'));\n\t\tadd_action('load-' . $profileConfigurationPage, array($this, 'addHelpTab'));\n\t}",
"public function create_menu()\n\t{\n\t\t$obj = $this; // PHP 5.3 doesn't allow $this usage in closures\n\n\t\t// Add main menu page\n\t\tadd_menu_page(\n\t\t\t'Testimonials plugin', // page title\n\t\t\t'Testimonials', // menu title\n\t\t\t'manage_options', // minimal capability to see it\n\t\t\t'jststm_main_menu', // unique menu slug\n\t\t\tfunction() use ($obj){\n\t\t\t\t$obj->render('main_menu'); // render main menu page template\n\t\t\t},\n\t\t\tplugins_url('images/theater.png', dirname(__FILE__)), // dashboard menu icon\n\t\t\t'25.777' // position in the dahsboard menu (just after the Comments)\n\t\t);\n\t\t// Add help page\n\t\tadd_submenu_page(\n\t\t\t'jststm_main_menu', // parent page slug\n\t\t\t'Testimonials plugin help', // page title\n\t\t\t'What is this?', // menu title\n\t\t\t'manage_options', // capability\n\t\t\t'jststm_help', // slug\n\t\t\tfunction() use ($obj){\n\t\t\t\t$obj->render('help_page');\n\t\t\t}\n\t\t);\n\t}",
"function mt_add_pages() {\n // Add a new submenu under Tools:\n add_management_page( __('KML Upload','menu-test'), __('KML Upload','menu-test'), 'manage_options', 'kmlupload', 'mt_tools_page');\n}",
"public function add_menu_item() {\n\t\t$screen_hook = add_options_page(\n\t\t\t__( 'SatisPress', 'satispress' ),\n\t\t\t__( 'SatisPress', 'satispress' ),\n\t\t\t'manage_options',\n\t\t\t'satispress',\n\t\t\tarray( $this, 'render_screen' )\n\t\t);\n\n\t\tadd_action( 'load-' . $screen_hook, array( $this, 'setup_screen' ) );\n\t}",
"function registerPages() {\n\t \\Idno\\Core\\site()->addPageHandler('\\_known/callback', '\\IdnoPlugins\\Known\\Pages\\Callback');\n\t // Register admin settings\n\t \\Idno\\Core\\site()->addPageHandler('admin/known', '\\IdnoPlugins\\Known\\Pages\\Admin');\n\t // Register settings page\n\t \\Idno\\Core\\site()->addPageHandler('account/known', '\\IdnoPlugins\\Known\\Pages\\Account');\n\n\t /** Template extensions */\n\t // Add menu items to account & administration screens\n\t \\Idno\\Core\\site()->template()->extendTemplate('admin/menu/items', 'admin/known/menu');\n\t \\Idno\\Core\\site()->template()->extendTemplate('account/menu/items', 'account/known/menu');\n\t}",
"public function register() {\n\t\t$this->page_hook = add_submenu_page(\n\t\t\t'sites.php',\n\t\t\t$this->view->get_title(),\n\t\t\t$this->view->get_title(),\n\t\t\t'manage_sites',\n\t\t\t$this->page_slug,\n\t\t\t[ $this->view, 'render' ]\n\t\t);\n\n\t\tadd_action( 'load-' . $this->page_hook, [ $this, 'action' ] );\n\t}",
"public function add_options_page() {\n $this->options_page = add_menu_page( $this->title, $this->title, 'manage_options', $this->key, array( $this, 'admin_page_display' ) );\n }",
"function addMenu()\n{\n add_menu_page (\"Members and Email\", \"Members / Email\", 4, \"members-email-1\", \"MeMenu\" );\n add_submenu_page(\"members-email-1\", \"Email List\", \"Email\", 4, \"members-email-sub-1\", \"MeMenuSub1\");\n add_submenu_page(\"members-email-1\", \"Tracking\", \"Tracking Scripts\", 4, \"tracking-scripts-1\", \"MeMenuSub2\");\n\n\n}",
"function add_object_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $icon_url = '')\n {\n }",
"public function register_menus() {\n\t\t\tadd_management_page(\n\t\t\t\t__( 'Child Theme Generator', 'if-child-gen' ),\n\t\t\t\t__( 'Child Theme Generator', 'if-child-gen' ),\n\t\t\t\t'edit_theme_options',\n\t\t\t\t$this->plugin_slug,\n\t\t\t\tarray( $this, 'options_page_output' )\n\t\t\t);\n\t\t}",
"function add_users_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \\null)\n {\n }",
"public function create_menu_page() {\n\tadd_menu_page(__( 'Donation Settings', 'client_to_google_sheet' ),\n __( 'Donation Settings', 'client_to_google_sheet' ), 'administrator',\n __FILE__, [ $this,'main_settings_page'] ,\n 'dashicons-editor-table' );\n\n\t//call register settings function\n\tadd_action( 'admin_init', [ $this,'register_plugin_settings'] );\n}",
"function add_dashboard_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \\null)\n {\n }",
"function register_nav_menu($location, $description)\n {\n }",
"function article_plugin_setup_menu(){\n\tadd_menu_page( 'New Article Page', 'New Article', 'manage_options', 'faculty-plugin', 'create_form' );\n\t}",
"public static function wpa_add_menu() {\n add_menu_page('Main Menu','Home','manage_options','Sub-menu');\n add_submenu_page('Sub-menu','User List','User List','manage_options','menu-list',array( __CLASS__,'wpa_page_file_path'));\n add_submenu_page('Sub-menu','Add User','Add User','manage_options','menu-add',array(__CLASS__,'wpa_page_file_path'));\n }",
"public function custom_menu_page() {\n\t\tadd_menu_page(\n\t\t\t__( 'Options', 'plugintest' ),\n\t\t\t__( 'Options', 'plugintest' ),\n\t\t\t'manage_options',\n\t\t\t'options',\n\t\t\tarray( $this, 'view_option_page' )\n\t\t);\n\t}",
"function mmdyk_add_menu() {\n\n\t// Add the menu page\n\tadd_submenu_page('options-general.php', 'MM Did You Know?', 'MM Did You Know?', 10, __FILE__, 'mmdyk_page');\n}",
"function cbp_add_pages() {\n\tadd_menu_page(\"Chibipaint Integration\", \"Chibipaint\", \"manage_options\", \"chibipaint\", \"cbp_display_front_page\");\n\tadd_submenu_page(\"chibipaint\", \"Chibipaint Integration Options\", \"Options\", \"manage_options\", \"cbp_options\", \"cbp_display_options_page\");\n\tadd_submenu_page(\"chibipaint\", \"Chibipaint Help\", \"Help\", \"manage_options\", \"cbp_help\", \"cbp_display_help_page\");\n}",
"public function add_page() {\n\t\t\tif ( ! defined( 'WPEX_THEME_PANEL_SLUG' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Add page\n\t\t\tadd_submenu_page(\n\t\t\t\tWPEX_THEME_PANEL_SLUG,\n\t\t\t\t__( 'Demo Importer', 'total' ),\n\t\t\t\t__( 'Demo Importer', 'total' ),\n\t\t\t\t'administrator',\n\t\t\t\tWPEX_THEME_PANEL_SLUG .'-demo-importer',\n\t\t\t\tarray( $this, 'demos_page' )\n\t\t\t);\n\n\t\t}",
"function add_menu_subpage(){\n add_submenu_page(\n 'wpex-general',\n __( 'General', 'athen_transl' ),\n __( 'General', 'athen_transl' ),\n 'manage_options',\n ATHEN_THEME_PANEL_SLUG,\n array( $this, 'create_admin_page' )\n );\n }",
"public function createBackendMenu(){\n\t\tadd_menu_page( 'Stackoverflow', 'Stackoverflow', 'manage_options', 'stackoverflowStats', array($this, 'settingsPage') );\n\t}",
"public function add_options_page() {\n $this->options_page = add_menu_page( $this->title, $this->title, 'manage_options', self::$key, array( $this, 'admin_page_display' ) );\n }",
"function anipics_add_main_menu(){\n register_nav_menu('main_menu', 'Menu principal');\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 page_setup(){\n add_menu_page( PLUGIN_NAME, PLUGIN_NAME, 'manage_options', sanitize_key(PLUGIN_NAME), array($this, 'admin_page'), $this->icon, 3 );\n }",
"function add_theme_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \\null)\n {\n }",
"function registerMenus() {\n\t\t\tregister_nav_menu( 'nav-1', __( 'Top Navigation' ) );\n\t\t}",
"public function register_admin_menu() {\n\n\t\t\t$page_header_capability = apply_filters( 'astra_page_header_capability', 'edit_theme_options' );\n\n\t\t\tadd_submenu_page(\n\t\t\t\t'themes.php',\n\t\t\t\t__( 'Page Headers', 'astra-addon' ),\n\t\t\t\t__( 'Page Headers', 'astra-addon' ),\n\t\t\t\t$page_header_capability,\n\t\t\t\t'edit.php?post_type=astra_adv_header'\n\t\t\t);\n\t\t}",
"function register_my_menu() {\n register_nav_menu('header-menu',__( 'Header Menu' ));\n}",
"function folio_register_nav_menu()\n{\n register_nav_menu('primary', 'Sidebar Menu');\n}",
"public function add_menu_item() {\n\t\t\tglobal $cherry_wizard;\n\t\t\tadd_options_page( \n\t\t\t\t__( 'Single page BG', 'croco-single-page-bg' ),\n\t\t\t\t__( 'Single page BG', 'croco-single-page-bg' ),\n\t\t\t\t'manage_options',\n\t\t\t\t'croco-single-page-bg',\n\t\t\t\tarray( $this, 'display_plugin_admin_page' )\n\t\t\t);\n\t\t}",
"function eventoni_create_menu() {\n\n\t//create new top-level menu\n\tadd_menu_page('Eventoni', 'Eventoni', 'administrator', __FILE__, 'eventoni_settings_page');\n\n\t//call register settings function\n\tadd_action( 'admin_init', 'register_mysettings' );\n}",
"public function registerMenus() {\n $locations = array();\n foreach (Project::$menus as $slug => $name) {\n $locations[$slug] = __($name, Project::$projectNamespace);\n }\n register_nav_menus($locations);\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}",
"static function create_menu() {\n add_submenu_page('plugins.php', 'Luminous Settings', 'Luminous settings',\n 'administrator', 'luminous-handle', 'luminouswp::settings_view');\n }",
"function register_plugin_page(){\n wp_create_category('casoClinico');\n add_menu_page( 'Admin Quiz', 'Admin Quiz', 'edit_others_posts', __DIR__.'/views/admin/quizAdmin.php', '','dashicons-welcome-write-blog' );;\n}",
"function mt_add_pages(){\r\n\t// Add a new submenu under Options:\r\n\tadd_options_page('theVerse', 'theVerse', 8, 'theverse', 'mt_options_page');\r\n}",
"function add_posts_page($page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \\null)\n {\n }",
"function book_add_page() {\n add_submenu_page('edit.php?post_type=book', 'Book Admin', 'Book Settings', 'edit_posts', basename(__FILE__), 'book_s');\n}",
"function cg_create_menu() {\n\tadd_menu_page( \n\t__('CityGrid', EMU2_I18N_DOMAIN),\n\t__('CityGrid', EMU2_I18N_DOMAIN),\n\t0,\n\tCG_PLUGIN_DIRECTORY.'/cg-main.php',\n\t'',\n\tplugins_url('/images/icon.png', __FILE__));\n\t\n\t\n\tadd_submenu_page( \n\tCG_PLUGIN_DIRECTORY.'/cg-main.php',\n\t__(\"Main\", EMU2_I18N_DOMAIN),\n\t__(\"Main\", EMU2_I18N_DOMAIN),\n\t0,\n\tCG_PLUGIN_DIRECTORY.'/cg-main.php'\n\t);\t\n\t\n\tadd_submenu_page( \n\tCG_PLUGIN_DIRECTORY.'/cg-main.php',\n\t__(\"Settings\", EMU2_I18N_DOMAIN),\n\t__(\"Settings\", EMU2_I18N_DOMAIN),\n\t0,\n\tCG_PLUGIN_DIRECTORY.'/cg-settings.php'\n\t);\t\t\n\t\n\tif(!get_option('directory_label'))\n\t\t{\n\t\t$the_page_title = \"Directory\";\n\t\t}\t\n\telse\n\t\t{\n\t\t$the_page_title = get_option('directory_label');\n\t\t}\n\t//echo \"HERE: \" . $the_page_title . \"<br />\";\n\t$the_page = get_page_by_title( $the_page_title );\n\t\n\tif ( ! $the_page ) {\n\t\n\t $_p = array();\n\t $_p['post_title'] = $the_page_title;\n\t $_p['post_content'] = \"<p>Welcome to the CityGrid Hyp3rL0cal Directory</p>\";\n\t $_p['post_status'] = 'publish';\n\t $_p['post_type'] = 'page';\n\t $_p['comment_status'] = 'closed';\n\t\n\t // Insert the post into the database\n\t $the_page_id = wp_insert_post( $_p );\n\t \n\t update_post_meta( $the_page_id, '_wp_page_template', 'cg-directory.php' );\n\t \n\t}\t\n\t\n}",
"public function add_menu()\n {\n add_options_page(__('Master Link Plugin Settings'), __('Master Link Plugin'), 'manage_options', 'master_link_plugin', array(\n &$this,\n 'plugin_settings_page'\n ));\n }",
"public function initializePage()\n\t{\n\t\tadd_menu_page('Thema opties', 'Thema opties', 'manage_options', 'theme-options');\n\t}",
"function wpms_home_create_menu() {\n\tdo_action(\"wpms_create_top_menu\");\n\tadd_menu_page( __('Coco\\'s parameters','wp-multilingual-slider'), 'Coco Slider', 'edit_pages', 'settings_page_wp-multilingual-slider', 'home_settings_page', WPMS_DIR.'/images/accueil.png');\n}"
] | [
"0.75405157",
"0.74335533",
"0.73814523",
"0.73437905",
"0.73314583",
"0.7311121",
"0.7273814",
"0.7253663",
"0.7156476",
"0.7125892",
"0.7110733",
"0.7107182",
"0.7084438",
"0.7070258",
"0.7056448",
"0.7054855",
"0.70368207",
"0.7010839",
"0.6909022",
"0.6902368",
"0.6892679",
"0.6887844",
"0.6882935",
"0.68751967",
"0.6851987",
"0.6847205",
"0.6846581",
"0.68078434",
"0.6806545",
"0.6795162",
"0.6775791",
"0.6775473",
"0.675424",
"0.67515254",
"0.6750871",
"0.674791",
"0.6740669",
"0.6737717",
"0.6737031",
"0.6733976",
"0.6728172",
"0.67207354",
"0.6718719",
"0.671775",
"0.67091095",
"0.6700696",
"0.6696491",
"0.6683192",
"0.6668429",
"0.66470706",
"0.6646624",
"0.66439676",
"0.6643377",
"0.6636394",
"0.66311485",
"0.6627956",
"0.66173565",
"0.6615948",
"0.6615582",
"0.6608883",
"0.66082895",
"0.6600499",
"0.6584584",
"0.6580265",
"0.65789235",
"0.6575044",
"0.65744984",
"0.6574444",
"0.6573297",
"0.65702176",
"0.6570083",
"0.6567441",
"0.656506",
"0.65630734",
"0.6524474",
"0.65199655",
"0.6518425",
"0.6515816",
"0.6506902",
"0.6502735",
"0.64935184",
"0.6493245",
"0.6489146",
"0.6486765",
"0.6483425",
"0.64651364",
"0.6461272",
"0.64586216",
"0.64558464",
"0.64556986",
"0.6445358",
"0.6434454",
"0.6426294",
"0.6415933",
"0.6415326",
"0.64123946",
"0.64122415",
"0.64039725",
"0.64002216",
"0.6398131"
] | 0.7088957 | 12 |
Registers a new submenu page | function add_menu_subpage(){
add_submenu_page(
'wpex-general',
__( 'General', 'athen_transl' ),
__( 'General', 'athen_transl' ),
'manage_options',
ATHEN_THEME_PANEL_SLUG,
array( $this, 'create_admin_page' )
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function add_page() {\n\t\tadd_submenu_page(\n\t\t\tWPEX_THEME_PANEL_SLUG,\n\t\t\tesc_html__( 'Under Construction', 'total' ),\n\t\t\tesc_html__( 'Under Construction', 'total' ),\n\t\t\t'administrator',\n\t\t\tWPEX_THEME_PANEL_SLUG . '-under-construction',\n\t\t\tarray( 'WPEX_Under_Construction', 'create_admin_page' )\n\t\t);\n\t}",
"public function add_page() {\n\t\t\tadd_submenu_page(\n\t\t\t\tWPEX_THEME_PANEL_SLUG,\n\t\t\t\t__( 'Theme Skins', 'wpex' ),\n\t\t\t\t__( 'Theme Skins', 'wpex' ),\n\t\t\t\t'administrator',\n\t\t\t\tWPEX_THEME_PANEL_SLUG .'-skins',\n\t\t\t\tarray( $this, 'create_admin_page' )\n\t\t\t);\n\t\t}",
"public function add_submenu_page() {\n\t\tadd_submenu_page(\n\t\t\t'edit.php?post_type=slack_integration',\n\t\t\t__( 'Post types', 'slack-post-types' ),\n\t\t\t__( 'Post types', 'slack-post-types' ),\n\t\t\t'manage_options',\n\t\t\t'slack-post-types',\n\t\t\tarray( $this, 'display_admin_page' )\n\t\t);\n\t}",
"function addSubMenus() {\n \tif($this->checkPermissions()) {\n\t\t \t$first_item_parent = $this->isTeacherFeatures() ? 'lepress-my-subscriptions' : 'lepress';\n\t\t \tadd_submenu_page('lepress', __(\"Manage my subscriptions\", lepress_textdomain),__(\" My subscriptions\", lepress_textdomain).'<span id=\"lepress-student-subs-count\"></span>',3, $first_item_parent,array(&$this, 'getSubMenuPageContent' ));\n\t\t \tadd_submenu_page('lepress', __(\"Manage assignments\", lepress_textdomain),__(\"Assignments\", lepress_textdomain).'<span id=\"lepress-student-assignments-count\"></span>',3, 'lepress-assignments',array(&$this, 'getSubMenuPageContent' ));\n\t\t \t//add_submenu_page('lepress', __(\"Manage groups\", lepress_textdomain),__(\"My groups\", lepress_textdomain),3, 'lepress-groups',array(&$this, 'getSubMenuPageContent' ));\n \t}\n }",
"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 static function add_submenu_page() {\n\t\tadd_submenu_page( null, __( 'Importing Nutrition', 'wp-recipe-maker' ), __( 'Importing Nutrition', 'wp-recipe-maker' ), WPRM_Settings::get( 'features_tools_access' ), 'wprm_wpurp_nutrition', array( __CLASS__, 'wpurp_nutrition' ) );\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 create_submenu() {\n\t\tadd_submenu_page(\n\t\t\t'options-general.php',\n\t\t\t__('CHAOS Client','wpchaosclient'),\n\t\t\t__('CHAOS','wpchaosclient'),\n\t\t\t'manage_options',\n\t\t\t$this->menu_page,\n\t\t\tarray(&$this,'create_submenu_page')\n\t\t);\n\t}",
"public function register_sub_menu()\n {\n add_submenu_page(\n 'edit.php?post_type=book',\n 'Book Setting',\n 'Settings',\n 'manage_options',\n 'submenu-page',\n array($this, 'custom_submenu_page')\n );\n //register settings\n add_action('admin_init', array($this, 'register_settings'));\n\n }",
"public function add_menu_page() {\n\n\t\tadd_submenu_page(\n\t\t\tCT_Ultimate_GDPR::instance()->get_admin_controller()->get_option_name(),\n\t\t\tesc_html__( 'Privacy Policy', 'ct-ultimate-gdpr' ),\n\t\t\tesc_html__( 'Privacy Policy', 'ct-ultimate-gdpr' ),\n\t\t\t'manage_options',\n\t\t\t$this->get_id(),\n\t\t\tarray( $this, 'render_menu_page' )\n\t\t);\n\t}",
"public function add_page() {\n\t\tadd_submenu_page(\n\t\t\t'oceanwp-panel',\n\t\t\tesc_html__( 'Rec. Plugins', 'ocean-extra' ),\n\t\t\tesc_html__( 'Rec. Plugins', 'ocean-extra' ),\n\t\t\t'manage_options',\n\t\t\t'oceanwp-panel-rec-plugins',\n\t\t\tarray( $this, 'create_admin_page' )\n\t\t);\n\t}",
"function add_submenu_page($parent_slug, $page_title, $menu_title, $capability, $menu_slug, $callback = '', $position = \\null)\n {\n }",
"function news_submenu_page(){\n\tadd_submenu_page(\n\t\t'edit.php?post_type=news',\n\t\t'Order news',\n\t\t'Order News',\n\t\t'order_posts',\n\t\t'order-posts-page',\n\t\t'post_order_submenu_page' );\n}",
"public function add_menu_page() {\n\t\tadd_submenu_page(\n\t\t\tCT_Ultimate_GDPR::instance()->get_admin_controller()->get_option_name(),\n\t\t\tesc_html__( 'Right To Be Forgotten', 'ct-ultimate-gdpr' ),\n\t\t\tesc_html__( 'Right To Be Forgotten', 'ct-ultimate-gdpr' ),\n\t\t\t'manage_options',\n\t\t\t$this->get_id(),\n\t\t\tarray( $this, 'render_menu_page' )\n\t\t);\n\n\t}",
"function addMenu()\n{\n add_menu_page (\"Members and Email\", \"Members / Email\", 4, \"members-email-1\", \"MeMenu\" );\n add_submenu_page(\"members-email-1\", \"Email List\", \"Email\", 4, \"members-email-sub-1\", \"MeMenuSub1\");\n add_submenu_page(\"members-email-1\", \"Tracking\", \"Tracking Scripts\", 4, \"tracking-scripts-1\", \"MeMenuSub2\");\n\n\n}",
"function add_menu() {\n add_menu_page(\"Polls\", \"Polls\", \"administrator\", \"polls\", \"managePollsPage\");\n}",
"public function register_menu()\n {\n add_menu_page('Coupons Settings', 'Coupons Settings', 'edit_others_posts', 'wpm_coupons_settings');\n add_submenu_page('wpm_coupons_settings', 'Coupons Settings', 'Coupons Settings', 'manage_options', 'wpm_coupons_settings', function () {\n $settings = json_decode(get_option('api_settings', true), true);\n\n include 'templates/settings_template.php';\n });\n }",
"public function create_menu() {\n\t\tif ( get_network()->site_id !== get_current_blog_id() ) {\n\t\t\treturn;\n\t\t}\n\n\t\t//create new top-level menu\n\t\tadd_management_page(\n\t\t\t__( 'Sync newsletter', 'elemarjr' ),\n\t\t\t__( 'Sync newsletter', 'elemarjr' ),\n\t\t\t'manage_options',\n\t\t\t'sync-newsletter',\n\t\t\tarray( $this, 'display_submenu_page' ),\n\t\t\t6\n\t\t);\n\t}",
"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}",
"function pages_submenu_page(){\n\tadd_submenu_page(\n\t\t'edit.php?post_type=page',\n\t\t'Order pages',\n\t\t'Order Pages',\n\t\t'order_posts',\n\t\t'order-posts-page',\n\t\t'post_order_submenu_page' );\n}",
"public function register() {\n\t\tcall_user_func_array( 'add_submenu_page', $this->get_page_arguments() );\n\t}",
"public static function wpa_add_menu() {\n add_menu_page('Main Menu','Home','manage_options','Sub-menu');\n add_submenu_page('Sub-menu','User List','User List','manage_options','menu-list',array( __CLASS__,'wpa_page_file_path'));\n add_submenu_page('Sub-menu','Add User','Add User','manage_options','menu-add',array(__CLASS__,'wpa_page_file_path'));\n }",
"function mt_add_pages() {\n // Add a new submenu under Tools:\n add_management_page( __('KML Upload','menu-test'), __('KML Upload','menu-test'), 'manage_options', 'kmlupload', 'mt_tools_page');\n}",
"function book_add_page() {\n add_submenu_page('edit.php?post_type=book', 'Book Admin', 'Book Settings', 'edit_posts', basename(__FILE__), 'book_s');\n}",
"public function register_menu() {\n $parent_slug = 'comparrot';\n $capability = 'manage_options';\n\n add_menu_page( 'Comparrot', 'Comparrot', $capability, $parent_slug, [$this, 'import_from_csv_page'], 'dashicons-admin-page', 2 );\n\n add_submenu_page( $parent_slug, __( 'Import from CSV', 'comparrot' ), __( 'Import from CSV', 'comparrot' ), $capability, $parent_slug, [$this, 'import_from_csv_page'] );\n add_submenu_page( $parent_slug, __( 'General settings', 'comparrot' ), __( 'General settings', 'comparrot' ), $capability, 'comparrot-general-settings', [$this, 'general_settings_page'] );\n }",
"public function setLoadControllerMenuSub()\r\n {\r\n add_submenu_page(\r\n $_SESSION['controller_data_sub']['page_slug_current'],\r\n $_SESSION['controller_data_sub']['page_title'], // Title of the page\r\n $_SESSION['controller_data_sub']['page_menu_text'], // Text to show on the menu link\r\n $_SESSION['controller_data_sub']['page_capability'], // Capability requirement to see the link\r\n $_SESSION['controller_data_sub']['page_slug'],\r\n $_SESSION['controller_data_sub']['page_render'],\r\n $_SESSION['controller_data_sub']['page_menu_position']\r\n );\r\n }",
"public function admin_menu_add() \n\t{\n\t\tadd_submenu_page(\n\t\t\t'themes.php'\n\t\t\t, __('9spot Settings', '9spot')\n\t\t\t, __('Theme Layouts', '9spot')\n\t\t\t, 0\n\t\t\t, $this->layout_page\n\t\t\t, array(&$this, 'admin_layout')\n\t\t);\n\t}",
"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 }",
"function custom_sub_menu_function() \n {\n add_theme_page('sub Title name', 'sub Menu name', 'manage_options', 'sub-menu-slug', 'sub_menu_panel');\n }",
"function tutorials_submenu_page(){\n\tadd_submenu_page(\n\t\t'edit.php?post_type=tutorials',\n\t\t'Order tutorials',\n\t\t'Order Tutorials',\n\t\t'order_posts',\n\t\t'order-posts-page',\n\t\t'post_order_submenu_page' );\n}",
"static function create_menu() {\n add_submenu_page('plugins.php', 'Luminous Settings', 'Luminous settings',\n 'administrator', 'luminous-handle', 'luminouswp::settings_view');\n }",
"public function add_subpages() {\n\n\t\t$this->settings_page_id = add_submenu_page(\n\t\t\t'edit.php?post_type=schedule',\n\t\t\t__( 'Conference Schedule Settings', 'conf-schedule' ),\n\t\t\t__( 'Settings', 'conf-schedule' ),\n\t\t\t'edit_posts',\n\t\t\t'conf-schedule-settings',\n\t\t\t[ $this, 'print_settings_page' ]\n\t\t);\n\n\t\t$this->preview_page_id = add_submenu_page(\n\t\t\t'edit.php?post_type=schedule',\n\t\t\t__( 'Conference Schedule Preview', 'conf-schedule' ),\n\t\t\t__( 'Preview', 'conf-schedule' ),\n\t\t\t'edit_posts',\n\t\t\t'conf-schedule-preview',\n\t\t\t[ $this, 'print_preview_page' ]\n\t\t);\n\n\t\t$this->downloads_page_id = add_submenu_page(\n\t\t\t'edit.php?post_type=schedule',\n\t\t\t__( 'Conference Schedule Downloads', 'conf-schedule' ),\n\t\t\t__( 'Downloads', 'conf-schedule' ),\n\t\t\t'edit_posts',\n\t\t\t'conf-schedule-downloads',\n\t\t\t[ $this, 'print_downloads_page' ]\n\t\t);\n\t}",
"function add_attendance_page() {\n $parent_slug = \"cf550_dashboard\";\n\t$page_title = \"Mætingar\";\n\t$menu_title = \"Mætingar\";\n\t$capability = \"edit_others_posts\"; // Editors, Admins, \n\t$menu_slug = \"cf550_attendance\";\n\t$function = \"write_attendance_page\";\n add_submenu_page(\n $parent_slug,\n $page_title,\n $menu_title,\n $capability,\n $menu_slug,\n $function\n );\n}",
"public function register_menu_item() {\n\t\t$cpt = get_post_type_object( Tribe__Events__Main::POSTTYPE );\n\t\t$this->ID = add_submenu_page(\n\t\t\t$this->get_url( array( 'page' => null ), true ),\n\t\t\tesc_html( $this->get_page_title() ),\n\t\t\tesc_html( $this->get_menu_label() ),\n\t\t\t$cpt->cap->publish_posts,\n\t\t\tself::$slug,\n\t\t\tarray( $this, 'render' )\n\t\t);\n\n\t\treturn $this->ID;\n\t}",
"function am2_vanity_create_menu() {\n\t//create new top-level menu\n\t//add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function );\n\tadd_submenu_page('options-general.php','Vanity URL Settings', 'Vanity URL Settings', 'administrator', 'am2-vanity-settings-page', 'am2_vanity_settings_page' );\n\t//call register settings function\n\tadd_action( 'admin_init', 'register_am2_vanity_settings' );\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}",
"function register_ba_menu_page(){\n add_menu_page(__( 'Banners', 'banner-advertise' ),'Banners','manage_options','banner_advertise','ba_menu_page','dashicons-format-image',26); \n add_submenu_page( 'banner_advertise', __( 'shortcodes', 'banner-advertise' ), 'shortcodes', 'manage_options', 'ba_shortcodes', 'ba_short_page');\n \n // Register the hidden submenu.\n add_submenu_page(null, __( 'Add New Banner', 'banner-advertise' ), '', 'manage_options', 'banner_insert', 'ba_insert_page');\n add_submenu_page(null, __( 'Banner Edit', 'banner-advertise' ), '', 'manage_options', 'banner_edit', 'ba_edit_page');\n}",
"function fatherly_fcr_register_admin_page()\n{\n add_submenu_page(\n 'tools.php',\n 'Feed Content Recirculation',\n 'Feed Content Recirculation',\n 'view_fatherly_settings',\n 'feed-content-recirculation',\n 'fatherly_fcr_process_admin_page'\n );\n}",
"function wdtgenerate_sitemappage () {\n\tif (function_exists ('add_submenu_page'))\n \tadd_submenu_page ('tools.php', __('Video Sitemap'), __('Video Sitemap'),\n \t'manage_options', 'wdtgenerate_sitemappage', 'wdtgenerate_sitemap');\n}",
"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 create_submenu_page() {\n\t\techo '<div class=\"wrap\"><h2>'.get_admin_page_title().'</h2>'.\"\\n\";\n\n\t\ttry {\n\t\t\t$sessionGUID = WPChaosClient::instance()->SessionGUID();\n\t\t\t$lastSessionUpdate = get_option(WPPortalClient::WP_CHAOS_CLIENT_SESSION_UPDATED_KEY);\n\t\t\techo '<div class=\"updated\"><p><strong>✓';\n\t\t\t_e('Connection to CHAOS is established','wpchaosclient');\n\t\t\techo '</strong> ';\n\t\t\tprintf(__('(session is %s last updated %s)','wpchaosclient'), $sessionGUID, date('r', $lastSessionUpdate));\n\t\t\techo '</p></div>';\n\t\t} catch(Exception $e) {\n\t\t\techo '<div class=\"error\"><p>'.__('Could not connect to CHAOS. Please check the details below.','wpchaosclient').'</p><p><small>'.$e->getMessage().'</small></p></div>';\n\t\t}\n\n\t\techo '<form method=\"POST\" action=\"options.php\">'.\"\\n\";\n\t\tsettings_fields($this->menu_page);\n\t\tdo_settings_sections($this->menu_page);\n\t\tsubmit_button();\n\t\techo '</form></div>'.\"\\n\";\n\n\t}",
"function mt_add_pages(){\r\n\t// Add a new submenu under Options:\r\n\tadd_options_page('theVerse', 'theVerse', 8, 'theverse', 'mt_options_page');\r\n}",
"function setup_menus() {\n\t$icon = '';\n\tadd_menu_page('Site Features', 'Site Features', 'publish_pages', 'pop_site_features', '', $icon, 36);\n\tadd_submenu_page('pop_site_features','','','publish_pages','pop_site_features','homepage_touts_page');\n\tadd_submenu_page('pop_site_features', 'Homepage Features', 'Homepage Features', 'publish_pages', 'pop_homepage_features', 'homepage_features_page');\n\tadd_submenu_page('pop_site_features', 'Homepage Ticker', 'Homepage Ticker', 'publish_pages', 'pop_homepage_ticker', 'homepage_ticker_page');\n\tadd_submenu_page('pop_site_features', 'Homepage Touts', 'Homepage Touts', 'publish_pages', 'pop_homepage_touts', 'homepage_touts_page');\n\tadd_submenu_page('pop_site_features', 'Movement Touts', 'Movement Touts', 'publish_pages', 'pop_movement_touts', 'movement_touts_page');\n\tadd_submenu_page('pop_site_features', 'PoP & Local Events', 'PoP & Local Events', 'publish_pages', 'pop_events', 'movement_events_page');\n\tadd_submenu_page('pop_site_features', 'Season of 1000', 'Season of 1000 Promises', 'publish_pages', 'season1000', 'season_1000_page');\n}",
"function staff_submenu_page(){\n\tadd_submenu_page(\n\t\t'edit.php?post_type=staff',\n\t\t'Order Staff',\n\t\t'Order Staff',\n\t\t'order_posts',\n\t\t'order-posts-page',\n\t\t'post_order_submenu_page' );\n}",
"public function add_menu_page()\n\t{\n\t\tadd_menu_page( \n\t\t\t'mmenu',\n\t\t\t'mmenu',\n\t\t\t'manage_options',\n\t\t\t'mmenu',\n\t\t\tarray( $this, 'create_admin_page' ),\n\t\t\t'dashicons-menu'\n\t\t);\n\t}",
"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 register()\n {\n add_action('admin_menu', array($this, 'register_sub_menu'));\n }",
"public function onAdminMenu()\n {\n foreach( $this->pages as $slug => $page ) {\n add_submenu_page(\n $page['parent'], L10n::__( $page['title'] ), \n L10n::__( $page['title_menu'] ), $page['capability'], \n $slug, array( $this, 'page' . ucfirst( $slug ) )\n );\n }\n }",
"function cg_create_menu() {\n\tadd_menu_page( \n\t__('CityGrid', EMU2_I18N_DOMAIN),\n\t__('CityGrid', EMU2_I18N_DOMAIN),\n\t0,\n\tCG_PLUGIN_DIRECTORY.'/cg-main.php',\n\t'',\n\tplugins_url('/images/icon.png', __FILE__));\n\t\n\t\n\tadd_submenu_page( \n\tCG_PLUGIN_DIRECTORY.'/cg-main.php',\n\t__(\"Main\", EMU2_I18N_DOMAIN),\n\t__(\"Main\", EMU2_I18N_DOMAIN),\n\t0,\n\tCG_PLUGIN_DIRECTORY.'/cg-main.php'\n\t);\t\n\t\n\tadd_submenu_page( \n\tCG_PLUGIN_DIRECTORY.'/cg-main.php',\n\t__(\"Settings\", EMU2_I18N_DOMAIN),\n\t__(\"Settings\", EMU2_I18N_DOMAIN),\n\t0,\n\tCG_PLUGIN_DIRECTORY.'/cg-settings.php'\n\t);\t\t\n\t\n\tif(!get_option('directory_label'))\n\t\t{\n\t\t$the_page_title = \"Directory\";\n\t\t}\t\n\telse\n\t\t{\n\t\t$the_page_title = get_option('directory_label');\n\t\t}\n\t//echo \"HERE: \" . $the_page_title . \"<br />\";\n\t$the_page = get_page_by_title( $the_page_title );\n\t\n\tif ( ! $the_page ) {\n\t\n\t $_p = array();\n\t $_p['post_title'] = $the_page_title;\n\t $_p['post_content'] = \"<p>Welcome to the CityGrid Hyp3rL0cal Directory</p>\";\n\t $_p['post_status'] = 'publish';\n\t $_p['post_type'] = 'page';\n\t $_p['comment_status'] = 'closed';\n\t\n\t // Insert the post into the database\n\t $the_page_id = wp_insert_post( $_p );\n\t \n\t update_post_meta( $the_page_id, '_wp_page_template', 'cg-directory.php' );\n\t \n\t}\t\n\t\n}",
"public static function menu_subpage_categories(){\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_category, \n\t\t\t\t\t\t\t 'Menu Listing', \n\t\t\t\t\t\t\t self::$capability,\n\t\t\t\t\t\t\t 'menu_listings',\n\t\t\t\t\t \t array( __CLASS__, 'menu_generator_listing'));\n\t\t\n\t\t}",
"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 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 add_menus() {\n add_action( 'admin_menu', array( 'Hotmembers3\\Admin_Pages_Creator', 'create_pages') );\n }",
"function jb_add_menu() {\n\tadd_submenu_page('genesis', __('Expose', 'jb'), __('Expose Settings', 'jb'), 'manage_options', 'expose-settings', 'jb_admin_page' );\n}",
"public function register_admin_menu() {\n\n\t\t\t$page_header_capability = apply_filters( 'astra_page_header_capability', 'edit_theme_options' );\n\n\t\t\tadd_submenu_page(\n\t\t\t\t'themes.php',\n\t\t\t\t__( 'Page Headers', 'astra-addon' ),\n\t\t\t\t__( 'Page Headers', 'astra-addon' ),\n\t\t\t\t$page_header_capability,\n\t\t\t\t'edit.php?post_type=astra_adv_header'\n\t\t\t);\n\t\t}",
"function mmdyk_add_menu() {\n\n\t// Add the menu page\n\tadd_submenu_page('options-general.php', 'MM Did You Know?', 'MM Did You Know?', 10, __FILE__, 'mmdyk_page');\n}",
"public function register_admin_menu() {\n\n\t\t//menu page\n\t\t$menu_page = add_submenu_page( 'woocommerce', __( 'Product Fee', WOOAFPP_TEXTDOMAIN ), __( 'Product Fee', WOOAFPP_TEXTDOMAIN ), 'manage_options', 'wooafpp_settings', array( $this,'add_menu_settings_page' ) );\n\t}",
"function bethel_add_submenu_to_post() {\n\tglobal $post;\n\t$menu_items = get_menu_items_for_current_page();\n\tif ($menu_items && sizeof($menu_items) > 1) {\n\t\techo '<ul class=\"bethel-subpages-nav\">';\n\t\tforeach ($menu_items as $menu_item) {\n\t\t\techo '<li'.($menu_item->object_id == $post->ID ? ' class=\"current-item\"' : '').\">\";\n\t\t\techo \"<a href=\\\"{$menu_item->url}\\\">{$menu_item->title}</a>\";\n\t\t\techo '</li>';\n\t\t}\n\t\techo '</ul>';\n\t} elseif (is_page() && $post->post_parent) {\n $menu_items = get_pages (array('parent' => $post->post_parent, 'sort_order' => 'menu_order', 'hierarchical' => false));\n if ($menu_items && sizeof($menu_items) > 1) {\n echo '<ul class=\"bethel-subpages-nav\">';\n foreach ($menu_items as $menu_item) {\n echo '<li'.($menu_item->ID == $post->ID ? ' class=\"current-item\"' : '').\">\";\n echo '<a href=\"'.get_permalink($menu_item->ID).\"\\\">{$menu_item->post_title}</a>\";\n echo '</li>';\n }\n echo '</ul>';\n }\n }\n}",
"function posts_submenu_page(){\n\tadd_submenu_page(\n\t\t'edit.php',\n\t\t'Order posts',\n\t\t'Order Posts',\n\t\t'order_posts',\n\t\t'order-posts-page',\n\t\t'post_order_submenu_page' );\n}",
"function gmuj_mmi_add_sublevel_menu() {\n\tadd_submenu_page(\n\t\t'gmuw',\n\t\t'Mason Meta Information',\n\t\t'Mason Meta Information',\n\t\t'manage_options',\n\t\t'gmuj_mmi',\n\t\t'gmuj_mmi_display_settings_page',\n\t\t1\n\t);\n\t\n}",
"public function add_new_admin_page($title,$function){//Takes page title as ref. parent is assumed as post above.\r\n\r\n if( ! empty( $title) ){\r\n // We need to know the Post Type name again\r\n $post_type_name = $this->post_type_name;\r\n $parent_page = 'edit.php?post_type='.$post_type_name;\r\n $page_title = $title;\r\n $page_slug = strtolower( str_replace( ' ', '_', $page_title ) );\r\n $page_function = $function;\r\n\r\n\r\n add_action( 'admin_menu',\r\n function() use( $parent_page, $page_title, $page_slug, $page_function ){\r\n add_submenu_page( $parent_page, $page_title, $page_title, 'manage_options', $page_slug, $page_function );\r\n }\r\n );\r\n\r\n }\r\n }",
"public function add_admin_menu() {\n\n extract( $this->args );\n\n if( $menu_type === 'submenu' ) {\n\n $menu_page = call_user_func( 'add_submenu_page', $menu_parent, $menu_title, $menu_title, $menu_capability, $menu_slug, array( &$this, 'add_options_html' ) );\n\n } else {\n\n $menu_page = call_user_func( 'add_menu_page', $menu_title, $menu_title, $menu_capability, $menu_slug, array( &$this, 'add_options_html' ), $menu_icon, $menu_position );\n\n if( ! empty( $this->args['show_sub_menu'] ) && count( $this->pre_tabs ) > 1 ) {\n\n // create submenus\n $tab_key = 1;\n foreach ( $this->pre_tabs as $section ) {\n\n call_user_func( 'add_submenu_page', $menu_slug, $section['title'], $section['title'], $menu_capability, $menu_slug .'#tab='. $tab_key, '__return_null' );\n\n if( ! empty( $section['subs'] ) ) {\n $tab_key += ( count( $section['subs'] )-1 );\n }\n\n $tab_key++;\n\n }\n\n remove_submenu_page( $menu_slug, $menu_slug );\n\n }\n\n if( ! empty( $menu_hidden ) ) {\n remove_menu_page( $menu_slug );\n }\n\n }\n\n add_action( 'load-'. $menu_page, array( &$this, 'add_page_on_load' ) );\n\n }",
"function jm_create_menu(){\n\tadd_submenu_page('themes.php', 'Super Themer Options', 'Theme Options', 'manage_options', 'jm_settings_page', 'jm_settings_page');\n\tadd_action('admin_init', 'jm_register_settings');\n}",
"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 }",
"function ada_add_pages() {\n\nadd_submenu_page('edit.php?post_type=horse', __('Options','wp_horse'), __('Options','wp_horse'), 'manage_options', 'horse_options_page', 'horse_options_page' );\n}",
"public function add_sub_menu()\n {\n // capabilities, menu slug, function to call)\n add_submenu_page('options-general.php', 'cb textcheck', 'cb textcheck', 'manage_options', 'cb-textcheck', array($this, 'load_admin_page'));\n }",
"function pewc_register_menu_page() {\n add_menu_page(\n __( 'Product Add-Ons', 'pewc' ),\n __( 'Product Add-Ons', 'pewc' ),\n 'edit_others_shop_orders',\n 'pewc_home',\n 'pewc_home_page',\n 'dashicons-plus-alt',\n \tapply_filters( 'pewc_menu_position', 56 )\n );\n\n\tadd_submenu_page('pewc_home', 'Home', 'Home', 'edit_others_shop_orders', 'pewc_home' );\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}",
"public function add_menu_item () {\n $page = add_menu_page( __( 'Listeo Core ', 'listeo_core' ) , __( 'Listeo Core', 'listeo_core' ) , 'manage_options' , $this->_token . '_settings' , array( $this, 'settings_page' ) );\n add_action( 'admin_print_styles-' . $page, array( $this, 'settings_assets' ) );\n\n// submit_listing\n// browse_listing\n// Registration\n// Booking\n// Pages\n// Emails\n add_submenu_page($this->_token . '_settings', 'Map Settings', 'Map Settings', 'manage_options', 'listeo_settings&tab=maps', array( $this, 'settings_page' ) ); \n \n add_submenu_page($this->_token . '_settings', 'Submit Listing', 'Submit Listing', 'manage_options', 'listeo_settings&tab=submit_listing', array( $this, 'settings_page' ) ); \n \n add_submenu_page($this->_token . '_settings', 'Single Listing', 'Single Listing', 'manage_options', 'listeo_settings&tab=single', array( $this, 'settings_page' ) ); \n \n add_submenu_page($this->_token . '_settings', 'Booking Settings', 'Booking Settings', 'manage_options', 'listeo_settings&tab=booking', array( $this, 'settings_page' ) ); \n \n add_submenu_page($this->_token . '_settings', 'Browse Listings', 'Browse Listings', 'manage_options', 'listeo_settings&tab=browse', array( $this, 'settings_page' ) ); \n \n add_submenu_page($this->_token . '_settings', 'Registration', 'Registration', 'manage_options', 'listeo_settings&tab=registration', array( $this, 'settings_page' ) ); \n \n add_submenu_page($this->_token . '_settings', 'Pages', 'Pages', 'manage_options', 'listeo_settings&tab=pages', array( $this, 'settings_page' ) ); \n \n add_submenu_page($this->_token . '_settings', 'Emails', 'Emails', 'manage_options', 'listeo_settings&tab=emails', array( $this, 'settings_page' ) ); \n \n add_submenu_page($this->_token . '_settings', 'Users Conversation', 'Users Conversation', 'manage_options', 'user-conversation', array( $this, 'user_conversation_fun' ) ); \n\n add_submenu_page(NULL, 'Single Users Conversation', 'Single Users Conversation', 'manage_options', 'single-user-conversation', array( $this, 'single_user_conversation_fun' ) ); \n }",
"function tb_string_swap_add_page() {\n\t// Create sub menu page\n\t$string_swap_page = add_submenu_page( 'themes.php', __('Theme Text Strings', 'theme-blvd-string-swap'), __('Theme Text Strings', 'theme-blvd-string-swap'), 'administrator', 'tb_string_swap', 'tb_string_swap_page' );\n\t// Adds actions to hook in the required css and javascript\n\tadd_action( \"admin_print_styles-$string_swap_page\", 'optionsframework_load_styles' );\n\tadd_action( \"admin_print_scripts-$string_swap_page\", 'optionsframework_load_scripts' );\n\tadd_action( \"admin_print_styles-$string_swap_page\", 'optionsframework_mlu_css', 0 );\n\tadd_action( \"admin_print_scripts-$string_swap_page\", 'optionsframework_mlu_js', 0 );\n}",
"function cjpopups_admin_menu_page(){\n\t\tglobal $menu;\n\t\t$main_menu_exists = false;\n\t\tforeach ($menu as $key => $value) {\n\t\t\tif($value[2] == 'cj-products'){\n\t\t\t\t$main_menu_exists = true;\n\t\t\t}\n\t\t}\n\t\tif(!$main_menu_exists){\n\t\t\t$menu_icon = cjpopups_item_path('admin_assets_url', 'img/menu-icon.png');\n\t\t\tadd_menu_page( 'CSSJockey', 'CSSJockey', 'manage_options', 'cj-products', 'cjpopups_cj_products', $menu_icon);\n\t\t}\n\t\t$menu_icon = cjpopups_item_path('admin_assets_url', 'img/menu-icon.png');\n\t add_submenu_page( 'cj-products', cjpopups_item_info('page_title'), cjpopups_item_info('menu_title'), 'manage_options', cjpopups_item_info('page_slug'), 'cjpopups_admin_page_setup');\n\t do_action('cjpopups_admin_menu_hook');\n\t //remove_submenu_page( 'cj-products', 'cj-products' );\n}",
"public function register()\n {\n $function = ( $this->function ) ? array( $this, $this->function ) : NULL;\n\n add_submenu_page(\n $this->parent_slug,\n $this->get_page_title(),\n $this->get_menu_title(),\n apply_filters( 'ninja_forms_submenu_' . $this->get_menu_slug() . '_capability', $this->get_capability() ),\n $this->get_menu_slug(),\n $function\n );\n }",
"public function register_menus() {\n\t\t\tadd_management_page(\n\t\t\t\t__( 'Child Theme Generator', 'if-child-gen' ),\n\t\t\t\t__( 'Child Theme Generator', 'if-child-gen' ),\n\t\t\t\t'edit_theme_options',\n\t\t\t\t$this->plugin_slug,\n\t\t\t\tarray( $this, 'options_page_output' )\n\t\t\t);\n\t\t}",
"public function addMenu(){\n\t\tadd_menu_page(\n\t\t\t$this->plugin->name,\n\t\t\t$this->plugin->name,\n\t\t\t'publish_pages',\n\t\t\t$this->plugin->varName,\n\t\t\tarray($this, 'page'),\n\t\t\t$this->plugin->uri . 'assets/images/icn-menu.png'\n\t\t);\n\t}",
"function mkRegisterMenu() {\n \n register_nav_menu('primary', 'Main Menu');\n \n }",
"function wpbm_register_about_us_page(){\n add_submenu_page(\n 'edit.php?post_type=wpblogmanager', __( 'About Us', WPBM_TD ), __( 'About Us', WPBM_TD ), 'manage_options', 'wpbm-about-us', array( $this, 'wpbm_about_callback' ) );\n }",
"function WPLMS_menu_MainMenu(){\n\n add_menu_page('WP LMS School', 'WP LMS School', 'administrator',WPLMS_PLUGIN_ID,'WPLMS_dashboard');\n add_submenu_page(WPLMS_PLUGIN_ID,'Students', 'Students', 'administrator','students','WPLMS_students');\n add_submenu_page(WPLMS_PLUGIN_ID,'Add Course', 'Add Course', 'administrator','course','WPLMS_addcourse');\n add_submenu_page(WPLMS_PLUGIN_ID,'Add Modules', 'Add Modules', 'administrator','modules','WPLMS_addmodule');\n\n add_submenu_page(WPLMS_PLUGIN_ID, false, '<span class=\"wpcw_menu_section\" style=\"display: block; margin: 1px 0 1px -5px; padding: 0; height: 1px; line-height: 1px; background: #CCC;\"></span>', 'manage_options', '#', false);\n\n add_submenu_page(WPLMS_PLUGIN_ID,'Quiz Summary', 'Quiz Summary', 'administrator','WPLMS_quizSummary','WPLMS_quizSummary');\n add_submenu_page(WPLMS_PLUGIN_ID,'Question Pool', 'Question Pool', 'administrator','WPLMS_questionPool','WPLMS_questionPool');\n\n //No Menu\n //add_submenu_page(WPLMS_PLUGIN_ID,'Add Quiz', 'Add Quiz', 'administrator', 'add_quiz', 'WPLMS_addQuiz');\n\n add_submenu_page(null,'Stud','Student Courses', 'administrator','studentCourses','WPLMS_studentcourses');\n add_submenu_page(null,'Add Question', 'Add Question', 'administrator', 'add_question', 'WPLMS_addQuestion');\n //add_submenu_page(null,'Add Quiz', 'Add Quiz', 'administrator', 'WPLMS_addQuiz', 'WPLMS_addQuiz');\n\n\n //add_submenu_page('onlineschool','Packages', 'Packages', 'administrator','addpackage','addpackage_code');\n //add_submenu_page('onlineschool','Sets', 'Sets', 'administrator','sets','sets_code');\n //add_submenu_page('options.php','Students', 'Student Courses', 'administrator','studentCourses','studentCourses_code');\n}",
"function add_submenu_item() {\n\t$link = admin_url( 'edit-tags.php' ) . '?taxonomy=dt_ext_connection_group&post_type=dt_ext_connection';\n\tadd_submenu_page(\n\t\t'distributor',\n\t\tesc_html__( 'External Connection Groups', 'distributor' ),\n\t\tesc_html__( 'External Connection Groups', 'distributor' ),\n\t\t'manage_options',\n\t\t$link\n\t);\n}",
"function register_submenu_items() {\r\n\t\r\n\t/*Note: NB 12-1-2016: This menu is restricted to roles with \"create_users\" capabilities because we don't have an explicit AS ADMIN capability -- yet.*/\r\n\tadd_submenu_page( 'edit.php?post_type=ticket', __( 'Custom Status', 'wpass_status' ), __( 'Custom Status', 'wpass_status' ), 'create_users', 'edit.php?post_type=wpass_status' );\r\n}",
"function admin_menu(){\n\t\t\tadd_menu_page('Videos','Videos', 'moderate_comments', 'videos', array($this, 'admin_action'));\n\n\t\t\t//add_submenu_page( $parent_slug, $page_title, $menu_title, $capability, $menu_slug, $function );\n\t\t\tadd_submenu_page( 'videos', 'Add New', 'Add New', 'moderate_comments', 'videos&action=add', array($this, 'admin_action') );\n\n\t\t}",
"public function register() {\n\t\t$this->page_hook = add_submenu_page(\n\t\t\t'sites.php',\n\t\t\t$this->view->get_title(),\n\t\t\t$this->view->get_title(),\n\t\t\t'manage_sites',\n\t\t\t$this->page_slug,\n\t\t\t[ $this->view, 'render' ]\n\t\t);\n\n\t\tadd_action( 'load-' . $this->page_hook, [ $this, 'action' ] );\n\t}",
"protected function registerMenu()\n {\n }",
"public function add_menu() {\n\t\t\tadd_menu_page(\n\t\t\t\t'Amazon Affiliate | Products',\n\t\t\t\t'Products',\n\t\t\t\t'manage_options',\n\t\t\t\t'amz-affiliate/pages/product.php',\n\t\t\t\tarray( &$this, 'load_product_page' ),\n\t\t\t\tplugins_url( 'amz-affiliate/img/icon.png' ),\n\t\t\t\t50\n\t\t\t);\n\t\t\tadd_submenu_page(\n\t\t\t\t'amz-affiliate/pages/product.php',\n\t\t\t\t'Amazon Affiliate | Tables',\n\t\t\t\t'Tables',\n\t\t\t\t'manage_options',\n\t\t\t\t'amz-affiliate/pages/table.php',\n\t\t\t\tarray( &$this, 'load_table_page' )\n\t\t\t);\n\t\t}",
"public function addAdminMenuPage()\n\t{\n\t\t$menuPage = &ModelAdminMenu::getScheme();\n\n\t\tforeach ( $menuPage as $menu ) {\n\t\t\t$callback = array_keys( $menu );\n\t\t\t$paramArr = array_values( $menu );\n\n\t\t\t$this->_adminMenuPage( $callback[0], $paramArr[0]['parameters'] );\n\t\t}\n\t}",
"public function submenu()\n {\n $data = array\n (\n 'submenus' => $this->Submenus_model->list()\n );\n\n $this->layout->view(\"submenu\",$data);\n }",
"public function add_menu() {\n\t\tadd_submenu_page(\n\t\t\t'edit.php?post_type=blicki',\n\t\t\t__( 'Suggestion Review', 'blicki' ),\n\t\t\t__( 'Suggestion Review', 'blicki' ),\n\t\t\t'edit_others_posts',\n\t\t\t'blicki-show-diff',\n\t\t\tarray( $this, 'admin_suggestion_viewer' )\n\t\t);\n\t\tremove_submenu_page( 'edit.php?post_type=blicki', 'blicki-show-diff' );\n\t}",
"function registrar_menu() {\nregister_nav_menu('menuprincipal', __('Menu Principal'));\n}",
"public static function registerAdminPages()\n {\n // First add main pages\n if (static::$adminPages) {\n $adminPages = new Collection(static::$adminPages);\n\n foreach ($adminPages as $adminPage) {\n add_menu_page(\n array_get($adminPage, 'label'),\n array_get($adminPage, 'title'),\n array_get($adminPage, 'capability'),\n array_get($adminPage, 'route'),\n array_get($adminPage, 'callback'),\n array_get($adminPage, 'icon'),\n array_get($adminPage, 'position')\n );\n }\n }\n\n // Then add sub pages\n if (static::$adminSubPages) {\n // Order by position\n usort(static::$adminSubPages, function($a, $b) {\n return $a['position'] > $b['position'];\n });\n\n // Add pages\n foreach (static::$adminSubPages as $adminSubPage) {\n $route = array_get($adminSubPage, 'route');\n $url = array_get($adminSubPage, 'options.url');\n\n if (! $route and $url) {\n add_submenu_page(\n array_get($adminSubPage, 'parent'),\n array_get($adminSubPage, 'title'),\n array_get($adminSubPage, 'label'),\n array_get($adminSubPage, 'capability'),\n $url\n );\n } else {\n add_submenu_page(\n array_get($adminSubPage, 'parent'),\n array_get($adminSubPage, 'title'),\n array_get($adminSubPage, 'label'),\n array_get($adminSubPage, 'capability'),\n $route,\n array_get($adminSubPage, 'callback')\n );\n }\n }\n }\n\n // We also need to rename the first item in the navigation\n global $submenu;\n\n if (isset($submenu['op-suite'])) {\n $submenu['op-suite'][0][0] = __('Dashboard', 'op3');\n }\n }",
"public function add_page() {\n\t\t\tif ( ! defined( 'WPEX_THEME_PANEL_SLUG' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t// Add page\n\t\t\tadd_submenu_page(\n\t\t\t\tWPEX_THEME_PANEL_SLUG,\n\t\t\t\t__( 'Demo Importer', 'total' ),\n\t\t\t\t__( 'Demo Importer', 'total' ),\n\t\t\t\t'administrator',\n\t\t\t\tWPEX_THEME_PANEL_SLUG .'-demo-importer',\n\t\t\t\tarray( $this, 'demos_page' )\n\t\t\t);\n\n\t\t}",
"public function addMenus()\n {\n // The settings submenu\n add_submenu_page(\n 'comotive-newsletter',\n 'Newsletter » Einstellungen',\n 'Dienst-Einstellungen',\n 'administrator',\n 'newsletter-settings',\n array($this->core->getSettings(), 'displayBackend')\n );\n\n // Remove first menu, if settings are not ready\n if (!$this->core->isWorkingServiceAvailable() || $this->core->isEditorDeactivated()) {\n global $submenu;\n unset($submenu['comotive-newsletter'][0]);\n }\n }",
"function _add_post_type_submenus()\n {\n }",
"function at_try_menu()\n{\n add_menu_page('signup_list', //page title\n 'Sign Up List', //menu title\n 'manage_options', //capabilities\n 'Signup_List', //menu slug\n Signup_list //function\n );\n}",
"function scoreSystemManager_add_pages() {\r\n // Add a new top-level menu (ill-advised):\r\n add_menu_page('Score System', 'Score System', 'edit_pages', 'scoreSystemManager-dashboard', 'scoreSystemManager_dashboard');\r\n}",
"function adminMenu() {\r\n\t\t// TODO: This does not only create the menu, it also (only?) *does* sth. with the entries.\r\n\t\t// But those actions must be done before the menu is created (due to the redirects).\r\n\t\t// !Split the function!\r\n\t\t//$page = add_submenu_page('admin.php', __('UWR Ergebnisse'), __('UWR Ergebnisse'), 'edit_posts', 'uwr1results', array('Uwr1resultsController', 'adminAction'));\r\n\t\t$page = add_submenu_page('uwr1menu', __('UWR Ergebnisse'), __('UWR Ergebnisse'), UWR1RESULTS_CAPABILITIES, 'uwr1results', array('Uwr1resultsController', 'adminAction'));\r\n\t\tadd_action( 'admin_print_scripts-' . $page, array('Uwr1resultsView', 'adminScripts') );\r\n\t}",
"public function submenu()\n\t{\n\t\t$partial = new Inoves_Partial('Content/view/submenu/contentMain.phtml');\n\t\tInoves_View::prepend('#content', $partial);\n\t}",
"function dsq_add_pages() {\n \tadd_submenu_page(\n \t\t'edit-comments.php',\n \t\t'Disqus', \n \t\t'Disqus', \n \t\t'moderate_comments',\n \t\t'disqus',\n \t\t'dsq_manage'\n \t);\n}",
"function add_sub_menu($name, $link, $root_menu, $meta = FALSE)\r\n {\r\n global $wp_admin_bar;\r\n if ( !is_super_admin() || !is_admin_bar_showing() )\r\n return;\r\n \r\n $wp_admin_bar->add_menu( array(\r\n 'parent' => $root_menu,\r\n 'title' => $name,\r\n 'href' => $link,\r\n 'meta' => $meta) );\r\n \r\n }",
"function add_menu_page() {\n add_menu_page(\n __( 'Theme Panel - Addons', 'athen_transl' ),\n 'Theme Panel - Addons', // menu title - can't be translated because it' used for the $hook prefix\n 'manage_options',\n ATHEN_THEME_PANEL_SLUG,\n '',\n 'dashicons-admin-generic',\n null\n );\n }",
"function nt_admin_menus(){\r\n\t\t// \t\t\t\t\t\t\t\t\t\t\tcallable $function = '', string $icon_url = '', int $position = null )\r\n\t\tadd_menu_page(\r\n\t\t\t__( 'Settings', 'newTheme'),\r\n\t\t\t__( 'NewTheme', 'newTheme'),\r\n\t\t\t'edit_theme_options',\r\n\t\t\t'nt_theme_options_page',\r\n\t\t\t'nt_theme_options_function'\r\n\t\t);\t\r\n\r\n\t\t//add_submenu_page( string $parent_slug, string $page_title, string $menu_title, string $capability, string $menu_slug, \r\n\t\t//\t\t\t\t\t\t\tcallable $function = '' )\r\n\t\tadd_submenu_page( \r\n\t\t\t'nt_theme_options_page', \r\n\t\t\t__( 'Settings', 'newTheme'), \r\n\t\t\t__( 'NewTheme options', 'newTheme'),\r\n\t\t\t'edit_theme_options',\r\n\t\t\t'nt_theme_options_page',\r\n\t\t\t'nt_theme_options_function'\r\n \t);\r\n\t}",
"public function KemiSitemap_add_menu_page()\n {\n add_options_page(\n 'Kemi Creative Sitemap',\n 'Kemi Sitemap',\n 'manage_options',\n KEMISITEMAP_SLUG,\n array( $this, 'KemiSitemap_options_page' )\n );\n }"
] | [
"0.7796628",
"0.7624312",
"0.7592035",
"0.75650054",
"0.74934274",
"0.7492506",
"0.7465937",
"0.7461963",
"0.74529606",
"0.7447358",
"0.7404587",
"0.73857015",
"0.7372055",
"0.73425573",
"0.73236275",
"0.7304584",
"0.7304443",
"0.72829694",
"0.7274513",
"0.72219056",
"0.7217325",
"0.719399",
"0.71780837",
"0.7164218",
"0.716047",
"0.712729",
"0.7109466",
"0.7101464",
"0.70957154",
"0.7081452",
"0.7075386",
"0.70726377",
"0.7066537",
"0.7065011",
"0.70643866",
"0.70539165",
"0.7049341",
"0.7029202",
"0.70289606",
"0.70161176",
"0.7015297",
"0.69990975",
"0.6991102",
"0.69859135",
"0.69689405",
"0.69671273",
"0.69603544",
"0.69484675",
"0.694202",
"0.6932297",
"0.6925832",
"0.6919182",
"0.691024",
"0.69022685",
"0.68941617",
"0.68884593",
"0.68853575",
"0.68821484",
"0.6877236",
"0.687319",
"0.6870522",
"0.68688506",
"0.68621516",
"0.68511754",
"0.68480814",
"0.6840669",
"0.68390864",
"0.6824097",
"0.6815567",
"0.68030655",
"0.67977816",
"0.6797098",
"0.6791597",
"0.67864245",
"0.678332",
"0.6781558",
"0.6775076",
"0.67745405",
"0.6765257",
"0.6764972",
"0.6758662",
"0.67577374",
"0.67537594",
"0.674612",
"0.67449254",
"0.67441666",
"0.6740185",
"0.6736532",
"0.6734222",
"0.6727725",
"0.6727187",
"0.6725461",
"0.67205256",
"0.6715427",
"0.671054",
"0.6701567",
"0.6700356",
"0.6693673",
"0.6692265",
"0.6691017"
] | 0.7860317 | 0 |
Register a setting and its sanitization callback. | function register_settings() {
register_setting( 'athen_tweaks', 'athen_tweaks', array( $this, 'admin_sanitize' ) );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function register() {\n\t\tregister_setting(\n\t\t\t$this->page,\n\t\t\t$this->setting_id,\n\t\t\tarray(\n\t\t\t\t'type' => 'string',\n\t\t\t\t'sanitize_callback' => array( $this, 'sanitize' ),\n\t\t\t\t'default' => $this->default_value,\n\t\t\t)\n\t\t);\n\t}",
"public function register() {\n\t\tregister_setting(\n\t\t\t$this->page,\n\t\t\t$this->setting_id,\n\t\t\tarray(\n\t\t\t\t'type' => 'string',\n\t\t\t\t'sanitize_callback' => array( $this, 'sanitize' ),\n\t\t\t\t'default' => $this->default_value,\n\t\t\t)\n\t\t);\n\t}",
"function register_setting($key, $value)\n{\n csSettings::set($key, $value);\n}",
"private function registerSetting()\n {\n $this->app->bind('setting', function ($app) {\n return new Setting($app);\n });\n\n $this->app->alias('setting', 'Setting\\Setting');\n }",
"function sa_register_settings() {\n\t// Register settings and call sanitation functions\n\tregister_setting( 'tsc_theme_options', 'sa_options', 'sa_validate_options' );\n}",
"public function register_settings()\n\t\t{\n\t\t\tregister_setting('mailgun', 'mailgun', array(&$this, 'validation'));\n\t\t}",
"public function register_settings() {\n\t\t\tregister_setting( 'wpex_skins_options', 'theme_skin', array( $this, 'sanitize' ) );\n\t\t}",
"function register_setting() \n\t{\n\t\tregister_setting('_user_rank_comments', '_user_rank_comments_fields', array(&$this, 'validate_settings'));\n\t\tregister_setting('_user_rank_comments', '_user_rank_comments_filter');\t\n\t}",
"function abecaf_register_settings() {\n add_option( 'abecaf_url', '' );\n register_setting( 'abecaf', 'abecaf_url', [\n 'sanitize_callback' => 'sanitize_url'\n ] );\n}",
"public function register_settings(){\n\n\t\t// Register our option\n\t\tregister_setting( 'slack-post-types', 'slack-post-types', array( $this, 'sanitize' ) );\n\n\t\t// Add post post-type as default\n\t\tadd_option( 'slack-post-types', array( 'post' => 1 ) );\n\t}",
"public static function register_settings() {\n\t\t\tregister_setting( 'ELMT_theme_options', 'ELMT_theme_options', array( 'ELMT_theme_options', 'sanitize' ) );\n\t\t}",
"function rad_register_setting(){\n\tregister_setting( 'rad_options_group', 'rad_options', 'rad_options_sanitize' );\n}",
"public function register()\n {\n \\Sanitizer::extend('remove_special_chars', function ($value) {\n return preg_replace('/[^a-zA-Z0-9_ -]/s', '', $value);\n });\n }",
"public function setSettings() {\n $args = array(\n array(\n 'option_group' => 'pm_plugin_settings',\n 'option_name' => 'pm_plugin',\n 'callback' => array($this->callbacks_mgr, 'checkboxSanitize'),\n )\n );\n $this->settings->setSettings($args);\n }",
"function test_validate_setting_values_validation_sanitization_order() {\n\t\t$setting = $this->manager->add_setting( 'numeric', array(\n\t\t\t'validate_callback' => array( $this, 'filter_customize_validate_numeric' ),\n\t\t\t'sanitize_callback' => array( $this, 'filter_customize_sanitize_numeric' ),\n\t\t) );\n\t\t$post_value = '42';\n\t\t$this->manager->set_post_value( 'numeric', $post_value );\n\t\t$validities = $this->manager->validate_setting_values( $this->manager->unsanitized_post_values() );\n\t\t$this->assertCount( 1, $validities );\n\t\t$this->assertEquals( array( 'numeric' => true ), $validities );\n\t}",
"public function register_settings()\n {\n }",
"public function register_settings()\n {\n }",
"function test_invalid_post_value() {\n\t\t$default_value = 'foo_default';\n\t\t$setting = $this->manager->add_setting( 'foo', array(\n\t\t\t'validate_callback' => array( $this, 'filter_customize_validate_foo' ),\n\t\t\t'sanitize_callback' => array( $this, 'filter_customize_sanitize_foo' ),\n\t\t) );\n\t\t$this->assertEquals( $default_value, $this->manager->post_value( $setting, $default_value ) );\n\t\t$this->assertEquals( $default_value, $setting->post_value( $default_value ) );\n\n\t\t$post_value = 'bar';\n\t\t$this->manager->set_post_value( 'foo', $post_value );\n\t\t$this->assertEquals( strtoupper( $post_value ), $this->manager->post_value( $setting, $default_value ) );\n\t\t$this->assertEquals( strtoupper( $post_value ), $setting->post_value( $default_value ) );\n\n\t\t$this->manager->set_post_value( 'foo', 'return_wp_error_in_sanitize' );\n\t\t$this->assertEquals( $default_value, $this->manager->post_value( $setting, $default_value ) );\n\t\t$this->assertEquals( $default_value, $setting->post_value( $default_value ) );\n\n\t\t$this->manager->set_post_value( 'foo', 'return_null_in_sanitize' );\n\t\t$this->assertEquals( $default_value, $this->manager->post_value( $setting, $default_value ) );\n\t\t$this->assertEquals( $default_value, $setting->post_value( $default_value ) );\n\n\t\t$post_value = '<script>evil</script>';\n\t\t$this->manager->set_post_value( 'foo', $post_value );\n\t\t$this->assertEquals( $default_value, $this->manager->post_value( $setting, $default_value ) );\n\t\t$this->assertEquals( $default_value, $setting->post_value( $default_value ) );\n\t}",
"public static function register_settings() {\n\t\t\tregister_setting( 'theme_options', 'theme_options', array( 'IODD_Theme_Options', 'sanitize' ) );\n\t\t}",
"function bdpp_register_settings() {\n\tregister_setting( 'bdpp_settings', 'bdpp_opts', 'bdpp_validate_settings' );\n}",
"public function register()\n {\n register_setting(\n $this->page,\n self::SETTING,\n array($this, 'clean_settings')\n );\n\n add_settings_section(\n self::SECTION,\n __('Simple Login Lockdown', 'simple-login-lockdown'),\n array($this, 'section_cb'),\n $this->page\n );\n\n add_settings_field(\n self::SETTING . '[limit]',\n __('Login Attempt Limit', 'simple-login-lockdown'),\n array($this, 'attempts_cb'),\n $this->page,\n self::SECTION,\n array('label_for' => self::SETTING . '[limit]', 'key' => 'limit')\n );\n\n add_settings_field(\n self::SETTING . '[time]',\n __('Login Lockdown Time', 'simple-login-lockdown'),\n array($this, 'time_cb'),\n $this->page,\n self::SECTION,\n array('label_for' => self::SETTING . '[time]', 'key' => 'time')\n );\n\n add_settings_field(\n self::SETTING . '[trust_proxy]',\n __('Trust Proxy Data', 'simple-login-lockdown'),\n array($this, 'trust_proxy_cb'),\n $this->page,\n self::SECTION,\n array('label_for' => self::SETTING . '[trust_proxy]', 'key' => 'trust_proxy')\n );\n }",
"public function set($setting_data = '', string $setting_key = '');",
"function register_settings() {\n\tregister_setting(\n\t\t'StandardsReader_settings_group', // Option group\n\t\t'endpoint'); // Sanitize\n\t\n\tregister_setting(\n\t\t'StandardsReader_settings_group', // Option group\n\t\t'check_interval'); // Sanitize\n\t\n\tregister_setting('StandardsReader_settings_group', 'mapPage');\n\tregister_setting('StandardsReader_settings_group', 'mapListing');\n\t\t \n}",
"function theme_options_init(){\n\tregister_setting( 'sample_options', 'site_description', 'theme_options_validate' );\n\tregister_setting( 'ga_options', 'ga_account', 'ga_validate' );\n\tadd_filter('site_description', 'stripslashes');\n}",
"protected function _setting_handle() {}",
"public static function register_settings() {\n\t\tregister_setting( 'omnimailer', 'omnimailer', array( get_called_class(), 'validate_options' ) );\n\t}",
"function register_mysettings() { // whitelist options\r\n register_setting( 'myoption-group', 'new_option_name' );\r\n register_setting( 'myoption-group', 'some_other_option' );\r\n register_setting( 'myoption-group', 'option_etc' );\r\n}",
"protected function get_sanitize_callback() {\n\t\treturn function( $option ) {\n\t\t\tif ( is_array( $option ) ) {\n\t\t\t\tif ( isset( $option['useSnippet'] ) ) {\n\t\t\t\t\t$option['useSnippet'] = (bool) $option['useSnippet'];\n\t\t\t\t}\n\t\t\t\tif ( isset( $option['canUseSnippet'] ) ) {\n\t\t\t\t\t$option['canUseSnippet'] = (bool) $option['canUseSnippet'];\n\t\t\t\t}\n\t\t\t\tif ( isset( $option['anonymizeIP'] ) ) {\n\t\t\t\t\t$option['anonymizeIP'] = (bool) $option['anonymizeIP'];\n\t\t\t\t}\n\t\t\t\tif ( isset( $option['trackingDisabled'] ) ) {\n\t\t\t\t\t// Prevent other options from being saved if 'loggedinUsers' is selected.\n\t\t\t\t\tif ( in_array( 'loggedinUsers', $option['trackingDisabled'], true ) ) {\n\t\t\t\t\t\t$option['trackingDisabled'] = array( 'loggedinUsers' );\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$option['trackingDisabled'] = (array) $option['trackingDisabled'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( isset( $option['adsenseLinked'] ) ) {\n\t\t\t\t\t$option['adsenseLinked'] = (bool) $option['adsenseLinked'];\n\t\t\t\t}\n\t\t\t\tif ( isset( $option['dashboardView'] ) ) {\n\t\t\t\t\tif ( ! in_array( $option['dashboardView'], array( Analytics::DASHBOARD_VIEW, Analytics_4::DASHBOARD_VIEW ), true ) ) {\n\t\t\t\t\t\t$option['dashboardView'] = $this->get()['dashboardView'];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn $option;\n\t\t};\n\t}",
"function gather_ua_jobs_register_settings() {\n\tregister_setting( 'gather_ua_jobs_settings', 'gather_ua_jobs_settings', 'gather_ua_jobs_sanitize_settings' );\n\n}",
"public function init() {\n register_setting( $this->key, $this->key );\n }",
"function test_post_value_validation_sanitization_order() {\n\t\t$default_value = '0';\n\t\t$setting = $this->manager->add_setting( 'numeric', array(\n\t\t\t'validate_callback' => array( $this, 'filter_customize_validate_numeric' ),\n\t\t\t'sanitize_callback' => array( $this, 'filter_customize_sanitize_numeric' ),\n\t\t) );\n\t\t$this->assertEquals( $default_value, $this->manager->post_value( $setting, $default_value ) );\n\t\t$this->assertEquals( $default_value, $setting->post_value( $default_value ) );\n\n\t\t$post_value = '42';\n\t\t$this->manager->set_post_value( 'numeric', $post_value );\n\t\t$this->assertEquals( $post_value, $this->manager->post_value( $setting, $default_value ) );\n\t\t$this->assertEquals( $post_value, $setting->post_value( $default_value ) );\n\t}",
"function jpst_register_settings() {\n\tregister_setting( 'jpst-settings-group', 'jpst_oauth','saveOptionCallback' );\n}",
"public function register_settings() {\n\t\t$section = 'janrain-capture';\n\n\t\tregister_setting( $this->option_group, 'pn_theme_janrain_enable', array( $this, 'sanitize_input_checkbox' ) );\n\t\tregister_setting( $this->option_group, 'pn_theme_janrain_debug', array( $this, 'sanitize_input_checkbox' ) );\n\n\t\tadd_settings_section( $section, 'Janrain Capture', '__return_false', $this->option_group );\n\t\tadd_settings_field( 'pn_theme_janrain_enable', 'Enable Janrain Capture', array( $this, 'render_input_checkbox' ), $this->option_group, $section, array( 'key' => 'pn_theme_janrain_enable', 'help' => 'Used by theme to register proper click events. eg. Janrain vs. Press+' ) );\n\t\tadd_settings_field( 'pn_theme_janrain_debug', 'Enable Janrain Debug', array( $this, 'render_input_checkbox' ), $this->option_group, $section, array( 'key' => 'pn_theme_janrain_debug', 'help' => 'Turns on Janrain event logging' ) );\n\t}",
"function sanitize_callback( $value ) {\n\t\tif ( NULL === $this->sanitize_callback ) {\n\t\t\t// No sanitization by default\n\t\t\treturn $value;\n\t\t}\n\t\t// Custom sanitization callback\n\t\treturn call_user_func( $this->sanitize_callback, $value, $this );\n\t}",
"function set($setting, $value , $instance_id = null)\r\n\t{\r\n\t\treturn parent::set($setting, $value);\r\n\t}",
"function wcusp_register_settings() {\n\tregister_setting('wcusp_settings_group', 'wcusp_settings');\n}",
"function updatenote_regsettings() {\n\tregister_setting( 'updatenote-settings', 'updatenote_options', 'updatenote_validate' );\n}",
"public static function set(string $key, $value)\n {\n if (!isset(self::$_translation[$key]) && is_scalar($value)) {\n $sanitize = new Sanitize($value);\n self::$_translation[$key] = $sanitize->data();\n }\n }",
"public function sanitize($value);",
"function set_user_setting($name, $value)\n {\n }",
"public function init() {\r\n\t\tregister_setting( $this->key, $this->key );\r\n\t}",
"public function init() {\n register_setting( self::$key, self::$key );\n }",
"public function init()\n {\n register_setting($this->key, $this->key);\n }",
"function wpdc_my_settings_init() {\r\n // register the settins for the plugin here (you might want to give it more unique names)\r\n\t\tregister_setting( 'wpdc_plugin_options_group', 'wpdc_options', 'wpdc_sanitize_wpdc_validate_options' );\r\n }",
"public function init() {\n\t\tregister_setting( $this->key, $this->key );\n\t}",
"public function init() {\n\t\tregister_setting( $this->key, $this->key );\n\t}",
"public function init() {\n\t\tregister_setting( $this->key, $this->key );\n\t}",
"public function init( $sanitizers ) {}",
"public function register_settings() {\n\n\t\tadd_settings_section(\n\t \t'thaim_utilities_section',\n\t \t__( 'Thaim Utilities Settings', 'thaim-utilities' ),\n\t \tarray( $this, 'settings_callback_section' ),\n\t \t'buddypress'\n\t );\n\n\t $settings = apply_filters( 'thaim_utilities_settings_fields', array( \n\t \tarray(\n\t \t\t'name' => 'thaim_link_wordpress_org',\n\t \t\t'title' => __( 'WordPress.org account', 'thaim-utilities' ),\n\t \t\t'display' => array( $this, 'link_wp_org_callback' ),\n\t \t\t'sanitize' => 'sanitize_text_field',\n\t \t),\n\t \tarray(\n\t \t\t'name' => 'thaim_perpage_wordpress_org',\n\t \t\t'title' => __( 'Number of WordPress plugins to display', 'thaim-utilities' ),\n\t \t\t'display' => array( $this, 'perpage_wp_org_callback' ),\n\t \t\t'sanitize' => 'absint',\n\t \t),\n\t \tarray(\n\t \t\t'name' => 'thaim_list_github_repos',\n\t \t\t'title' => __( 'List your github repos', 'thaim-utilities' ),\n\t \t\t'display' => array( $this, 'list_github_repos_callback' ),\n\t \t\t'sanitize' => 'sanitize_text_field',\n\t \t),\n\t ) );\n\n\t\tforeach( $settings as $setting ) {\n\t\t\tadd_settings_field(\n\t\t\t\t$setting['name'],\n\t\t\t\t$setting['title'],\n\t\t\t\t$setting['display'],\n\t\t\t\t'buddypress',\n\t\t\t\t'thaim_utilities_section'\n\t\t\t);\n\n\t\t\tregister_setting(\n\t\t\t\t'buddypress',\n\t\t\t\t$setting['name'],\n\t\t\t\t$setting['sanitize']\n\t\t\t);\n\t\t}\n\t}",
"public static function filter_stashbox_register_settings( $settings ) {\n $settings['sb_domain_reminders'] = 'boolval';\n $settings['sb_domain_reminder_distance'] = 'stashbox_sanitize_array';\n $settings['sb_domain_reminder_count'] = 'intval';\n $settings['sb_domain_reminder_recipient'] = 'sanitize_email';\n return $settings;\n }",
"public function register_settings() {\n\n\t\tadd_settings_section(\n\t\t\t'schedule_a_visit_to_sherpa_settings_section',\n\t\t\t__( 'Schedule a Visit Leads to Sherpa', 'schedule-a-visit-to-sherpa' ),\n\t\t\t__return_false(),\n\t\t\t'schedule-a-visit-to-sherpa'\n\t\t);\n\n\t\t$fields = $this->get_settings_fields();\n\n\t\tforeach ( $fields as $field ) {\n\n\t\t\t$field = wp_parse_args( $field, array(\n\t\t\t\t'settings_label' => '',\n\t\t\t) );\n\n\t\t\t$callback = 'rbm_fh_do_field_' . $field['type'];\n\n\t\t\tadd_settings_field(\n\t\t\t\t$field['name'],\n\t\t\t\t$field['settings_label'],\n\t\t\t\t( is_callable( $callback ) ) ? 'rbm_fh_do_field_' . $field['type'] : 'rbm_fh_missing_callback',\n\t\t\t\t'schedule-a-visit-to-sherpa',\n\t\t\t\t'schedule_a_visit_to_sherpa_settings_section',\n\t\t\t\t$field\n\t\t\t);\n\n\t\t\tregister_setting( 'schedule_a_visit_to_sherpa_settings_section', $field['name'] );\n\n\t\t}\n\n\t}",
"public function register()\n {\n $this->app->singleton(SettingContract::class, function () {\n $model = config('setting.model');\n\n return new Setting(new $model());\n });\n }",
"function register() {\n $this->settings = new SettingApi();\n\n $this->setPages();\n $this->setSubpages();\n\n $this->setCustomPostTypes();\n $this->setTaxonomies();\n $this->setMetaboxes();\n $this->setFrontEndPages();\n\n $this->settings->loadPages($this->pages)->withSubPage('Action control')->loadSubPages($this->subpages)->register();\n }",
"public function _register() {\n\t\t$settings = $this->get_settings();\n\t\t$empty = true;\n\n\t\tif ( is_array($settings) ) {\n\t\t\tforeach ( array_keys($settings) as $number ) {\n\t\t\t\tif ( is_numeric($number) ) {\n\t\t\t\t\t$this->_set($number);\n\t\t\t\t\t$this->_register_one($number);\n\t\t\t\t\t$empty = false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tif ( $empty ) {\n\t\t\t// If there are none, we register the widget's existence with a\n\t\t\t// generic template\n\t\t\t$this->_set(1);\n\t\t\t$this->_register_one();\n\t\t}\n\t}",
"public function plugin_register_options() {\r\n\t\tregister_setting( $this->options_group, $this->options_name , array(&$this, 'plugin_validate_options' ));\r\n\t}",
"function sanitization() {\n genesis_add_option_filter( 'one_zero', GENESIS_SIMPLE_SETTINGS_FIELD,\n array(\n\n ) );\n genesis_add_option_filter( 'no_html', GENESIS_SIMPLE_SETTINGS_FIELD,\n array(\n\n ) );\n }",
"public function addFilters() {\n\t\t\tadd_filter( 'muut_validate_setting', array( $this, 'validateSettings' ), 10, 2 );\n\t\t}",
"protected function registerSettingsService()\n {\n $this->app->singleton(\n 'streams.settings',\n function () {\n\n return new SettingService(new SettingModel());\n\n }\n );\n }",
"private function insertSettings()\r\n\t{\r\n\t\tglobal $ilDB;\r\n\r\n\t\tforeach ($this->getSettings() as $s => $set)\r\n\t\t{\r\n\t\t\t$ilDB->manipulate(\"INSERT INTO adm_set_templ_value \".\r\n\t\t\t\t\"(template_id, setting, value, hide) VALUES (\".\r\n\t\t\t\t$ilDB->quote($this->getId(), \"integer\").\",\".\r\n\t\t\t\t$ilDB->quote($s, \"text\").\",\".\r\n\t\t\t\t$ilDB->quote($set[\"value\"], \"text\").\",\".\r\n\t\t\t\t$ilDB->quote($set[\"hide\"], \"integer\").\r\n\t\t\t\t\")\");\r\n\t\t}\r\n\t}",
"public function register_settings_sections() {\n\t\tregister_setting( 'wsuwp-analytics', 'wsuwp_google_verify', array( $this, 'sanitize_google_verify' ) );\n\t\tregister_setting( 'wsuwp-analytics', 'wsuwp_bing_verify', array( $this, 'sanitize_bing_verify' ) );\n\t\tregister_setting( 'wsuwp-analytics', 'wsuwp_facebook_verify', array( $this, 'sanitize_facebook_verify' ) );\n\t\tregister_setting( 'wsuwp-analytics', 'wsuwp_ga_id', array( $this, 'sanitize_ga_id' ) );\n\t\tregister_setting( 'wsuwp-analytics', 'wsuwp_ga4_id', 'sanitize_text_field' );\n\t\tregister_setting( 'wsuwp-analytics', 'wsuwp_analytics_option_map', array( $this, 'sanitize_wsuwp_analytics_option_map' ) );\n\t}",
"public function register()\n {\n $this->app->bind('fazlali.setting.setting', function($app){\n return new \\Fazlali\\Setting\\Setting($app['request']);\n });\n\n }",
"abstract protected function handle_set($name,$value);",
"static public function register_setting( $key, $data ) {\n\t\tif ( ! isset( $data['group'] ) ) {\n\t\t\t$data['group'] = __( 'Misc', 'fl-builder' );\n\t\t}\n\t\tif ( ! isset( $data['order'] ) ) {\n\t\t\t$data['order'] = '10';\n\t\t}\n\t\tself::$registered_settings[ $key ] = $data;\n\t\tself::$settings = null; // must bust the settings cache.\n\t}",
"function sanitize_option($option, $value)\n {\n }",
"public function register(): void\n {\n $this->mergeConfigFrom(__DIR__ . '/../config/settings.php', 'settings');\n\n $this->app->bind('settings', function () {\n $settingsConfig = config(\n sprintf('settings.repositories.%s', config('settings.default'))\n );\n\n $cacheRepository = Cache::store(\n config('settings.cache.store')\n );\n\n $settingsRepository = new $settingsConfig['handler'];\n\n return new Settings($settingsRepository, $cacheRepository);\n });\n }",
"public function beforeSave(Event $event, Setting $setting, ArrayObject $options)\n {\n if ($setting->key === 'Login__Message__text') {\n $allowed = '<b><strong><a><br>';\n $setting->value = strip_tags($setting->value, $allowed);\n }\n }",
"function theme_options_init(){\n\tregister_setting( 'htmlks4wp_options', 'htmlks4wp_theme_options', 'theme_options_validate' );\n}",
"public function register_settings(){\n // Default API KEY Google Maps\n register_setting( 'cf7-google-map-settings-group', 'cf7_googleMap_api_key', array($this,'maps_api_validation') );\n register_setting( 'cf7-google-map-settings-group', 'cf7_googleMap_enable_geocode', array('type'=>'boolean') );\n register_setting( 'cf7-google-map-settings-group', 'cf7_googleMap_enable_places', array('type'=>'boolean') );\n }",
"final public static function register()\n {\n $ruleName = self::getRuleName();\n ValidatorValidator::extend($ruleName, static::class . '@performValidation');\n\n if (method_exists(static::class, 'replacer')) {\n ValidatorValidator::replacer($ruleName, static::class . '@replacer');\n }\n }",
"public function registerSettings()\n\t\t{\n\t\t\tforeach($this->options as $id => $options) {\n\t\t\t\tregister_setting('thingdom-options', $this->tag.$id);\n\t\t\t}\n\t\t}",
"public function testMarkSafe() {\n Data::setOption('safe', PatternLabListener::markSafe('value'));\n Config::setOption('plugins.safeData.enabled', true);\n\n $listener = new PatternLabListener();\n $listener->processSafeData();\n\n /** @var \\Twig_Markup $safe */\n $safe = Data::getOption('safe');\n // The value with the safe data prefix should be twig markup.\n $this->assertSame('value', (string) $safe);\n $this->assertTrue($safe instanceof Twig_Markup);\n }",
"function save($setting, $value, $prefix = null)\r\n\t{\r\n\t\treturn parent::save($setting, $value);\r\n\t}",
"public static function register_settings() {\n\t\t// Settings\n\t\t$settings = array(\n\t\t\tself::EDIT_PATH_OPTION => array(\n\t\t\t\t'weight' => 124,\n\t\t\t\t'settings' => array(\n\t\t\t\t\tself::EDIT_PATH_OPTION => array(\n\t\t\t\t\t\t'label' => self::__( 'Merchant Edit Profile Path' ),\n\t\t\t\t\t\t'option' => array(\n\t\t\t\t\t\t\t'label' => trailingslashit( get_home_url() ),\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'default' => self::$edit_path\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\tdo_action( 'gb_settings', $settings, Group_Buying_UI::SETTINGS_PAGE );\n\t}",
"public function it_can_be_sanitized()\n {\n $this->markTestSkipped('Sanitization is not implemented yet.');\n }",
"function setData($name, $value, $clean = true)\n\t{\n\t\tif ($clean)\n\t\t{\n\t\t\t$this->data[$name] = htmlentities($value, ENT_QUOTES);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->data[$name] = $value;\n\t\t}\n\t}",
"public function initSettings()\n {\n register_setting('flickr_group_gallery_settings', 'flickr_group_gallery_api_key');\n register_setting('flickr_group_gallery_settings', 'flickr_group_gallery_api_secret');\n register_setting('flickr_group_gallery_settings', 'flickr_group_gallery_cache_path');\n register_setting('flickr_group_gallery_settings', 'flickr_group_gallery_cache_expires');\n }",
"function tb_string_swap_init() {\n\t// Register settings\n\tregister_setting( 'tb_string_swap_settings', 'tb_string_swap', 'tb_string_swap_validate' );\n}",
"function tsuiseki_tracking_admin_init() {\n register_setting('tsuiseki-tracking-settings', 'tsuiseki_tracking_key');\n register_setting('tsuiseki-tracking-settings', 'tsuiseki_tracking_css_class');\n register_setting('tsuiseki-tracking-settings', 'tsuiseki_tracking_excluded_uris');\n}",
"function wikiembed_options_init() {\n\tregister_setting( 'wikiembed_options', 'wikiembed_options', 'wikiembed_options_validate' ); // the settings for wiki embed options\n}",
"function hb_register_settings() {\r\n\tregister_setting('hb_settings_group', 'hb_settings');\r\n\r\n}",
"function set_user_setting( $user, $key, $value )\n {\n //Unimplemented\n }",
"public static function sanitize($value, $sanitizer = 'string', $extraOptions = [])\n {\n switch ($sanitizer) {\n case 'string':\n $value = sanitize_text_field($value);\n break;\n\n case 'html':\n $value = wp_kses_post($value);\n break;\n\n case 'slug':\n $value = sanitize_title($value);\n break;\n\n case 'id':\n $value = sanitize_key($value);\n break;\n\n case 'email':\n $value = sanitize_email($value);\n break;\n\n case 'int':\n $value = absint($value);\n break;\n\n case 'intnull':\n $value = absint($value);\n if (empty($value)) {\n $value = null;\n }\n break;\n\n case 'float':\n $value = floatval($value);\n break;\n\n case 'url':\n $value = esc_url($value, array('http', 'https'));\n break;\n\n case 'bool':\n $value = (is_string($value) ? ($value == 'true' || $value == '1' ? true : false) : ($value ? true : false));\n break;\n\n case 'bool_null':\n if ($value !== null) $value = (is_string($value) ? ($value == 'true' || $value == '1' ? true : false) : ($value ? true : false));\n break;\n\n case 'bool_string':\n $value = (is_string($value) ? ($value == 'true' || $value == '1' ? 'true' : 'false') : ($value ? 'true' : 'false'));\n break;\n\n case 'textarea':\n $value = explode(\"\\r\\n\", $value);\n foreach ($value as $val) {\n $values[] = sanitize_text_field($val);\n }\n $value = implode(\"<br>\", $values);\n break;\n\n case 'logo':\n $value = wp_check_filetype($value);\n if (in_array($value['ext'], array('jpg', 'jpeg', 'png'))) {\n $value = true;\n } else {\n $value = false;\n }\n break;\n\n case 'datetime':\n if ($value instanceof DateTime === false) {\n $result = false;\n try {\n $result = new DateTime($value);\n } catch (Exception $e) {\n }\n $value = $result;\n }\n break;\n\n case 'phone':\n if (class_exists('\\libphonenumber\\PhoneNumberUtil')) {\n $country = isset($extraOptions['country']) ? $extraOptions['country'] : 'FR';\n try {\n $phoneUtil = \\libphonenumber\\PhoneNumberUtil::getInstance();\n $number = $phoneUtil->parse($value, $country);\n if ($phoneUtil->isValidNumber($number)) {\n $number = $phoneUtil->formatInOriginalFormat($number, $country);\n $value = implode('.', explode(' ', $number));\n }\n } catch (Exception $e) {\n // Exception\n }\n }\n break;\n\n case false:\n break;\n }\n return $value;\n }",
"public function registerCallback($valueName, $callback) {}",
"public function injectSettingsUtility(SettingsUtility $settingsUtility)\n {\n $this->settingsUtility = $settingsUtility;\n }",
"public function sanitize($value)\n {\n }",
"public function init_settings()\n\t{\n\t\tregister_setting('jststm_testimonials_group', 'jststm_testimonials', function($input)\n\t\t{\n\t\t\tforeach($input as $i => $data)\n\t\t\t{\n\t\t\t\t$input[$i]['message'] = sanitize_text_field($data['message']);\n\t\t\t\t$input[$i]['author'] = sanitize_text_field($data['author']);\n\t\t\t}\n\n\t\t\treturn $input;\n\t\t});\n\t}",
"public function admin_init() {\n\t\tregister_setting( $this->options_key, $this->options_key, array( $this, 'save_settings' ) );\n\t}",
"function clea_base_social_sanitize( $setting, $object ) {\n\n\t/* Get the theme prefix. */\n\t$prefix = hybrid_get_prefix();\n\n\t/* ALL settings of the Logo & Favicon and section\n\t{$prefix}_theme_settings[facebook]\n\t{$prefix}_theme_settings[twitter]\n\t{$prefix}_theme_settings[pinterest]\n\t{$prefix}_theme_settings[rss]\n\t{$prefix}_theme_settings[google+]\n\t{$prefix}_theme_settings[linkedin]\n\t{$prefix}_theme_settings[viadeo]\n\t*/\n\t\n\t/* Make sure we kill evil scripts from users without the 'unfiltered_html' cap. */\n\t\n\tif ( \"{$prefix}_theme_settings[facebook]\" == $object->id && !current_user_can( 'unfiltered_html' ) )\n\t\t$setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) );\n\tif ( \"{$prefix}_theme_settings[twitter]\" == $object->id && !current_user_can( 'unfiltered_html' ) )\n\t\t$setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) );\t\n\tif ( \"{$prefix}_theme_settings[pinterest]\" == $object->id && !current_user_can( 'unfiltered_html' ) )\n\t\t$setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) );\n\tif ( \"{$prefix}_theme_settings[rss]\" == $object->id && !current_user_can( 'unfiltered_html' ) )\n\t\t$setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) );\t\n\tif ( \"{$prefix}_theme_settings[google+]\" == $object->id && !current_user_can( 'unfiltered_html' ) )\n\t\t$setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) );\n\tif ( \"{$prefix}_theme_settings[linkedin]\" == $object->id && !current_user_can( 'unfiltered_html' ) )\n\t\t$setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) );\n\tif ( \"{$prefix}_theme_settings[viadeo]\" == $object->id && !current_user_can( 'unfiltered_html' ) )\n\t\t$setting = stripslashes( wp_filter_post_kses( addslashes( $setting ) ) );\n\t\n\t/* Return the sanitized setting and apply filters. */\n\treturn apply_filters( \"{$prefix}_customize_sanitize\", $setting, $object );\n}",
"function register_settings() {\n add_settings_section(\n 'main-settings-section',\n 'Main Settings',\n array($this, 'print_main_settings_section_info'),\n 'share-fb-sections-plugin'\n );\n \n // add_settings_field( $id, $title, $callback, $page, $section, $args )\n add_settings_field(\n 'app_id',\n 'App ID', \n array($this, 'create_input_app_id'), \n 'share-fb-sections-plugin', \n 'main-settings-section'\n );\n \n // register_setting( $option_group, $option_name, $sanitize_callback )\n register_setting( 'share-fb-sections-settings-group', 'share_fb_plugin_main_settings', array($this, 'plugin_main_settings_validate') );\n \n // add_settings_section( $id, $title, $callback, $page )\n add_settings_section(\n 'additional-settings-section',\n 'Additional Settings & Default Value',\n array($this, 'print_additional_settings_section_info'),\n 'share-fb-sections-plugin'\n );\n \n // add_settings_field( $id, $title, $callback, $page, $section, $args )\n add_settings_field(\n 'render_meta_tag',\n 'Render Meta Tag',\n array($this, 'create_input_render_meta_tag'), \n 'share-fb-sections-plugin', \n 'additional-settings-section'\n );\n\n add_settings_field(\n 'title', \n 'Default Title', \n array($this, 'create_input_title'), \n 'share-fb-sections-plugin', \n 'additional-settings-section'\n );\n\n add_settings_field(\n 'description', \n 'Default Description', \n array($this, 'create_input_description'), \n 'share-fb-sections-plugin', \n 'additional-settings-section'\n );\n\n add_settings_field(\n 'image_url', \n 'Default Image URL', \n array($this, 'create_input_image_url'), \n 'share-fb-sections-plugin', \n 'additional-settings-section'\n );\n \n // register_setting( $option_group, $option_name, $sanitize_callback )\n register_setting( 'share-fb-sections-settings-group', 'share_fb_plugin_additonal_settings', array($this, 'plugin_additional_settings_validate') );\n }",
"public function register()\n {\n require_once(realpath(__DIR__. '/../Helpers/parameters.php'));\n new ParametersSingleton();\n\n }",
"function hatch_fancybox_enable_sanitize( $setting, $object ) {\n\n\tif ( 'hatch_fancybox_enable' == $object->id )\n\t\t$setting = wp_filter_nohtml_kses( $setting );\n\n\treturn $setting;\n}",
"function get_sanitize_callback($slug = '')\n {\n }",
"function wshop_settings_init(){\n register_setting('wshop_settings', 'wshop_api_key');\n register_setting('wshop_settings', 'wshop_domain', 'remove_protocol');\n // register_setting('wshop_settings', 'wshop_app_id');\n register_setting('wshop_settings', 'wshop_rewrite_slug');\n register_setting('wshop_settings', 'wshop_collections_slug');\n }",
"protected function initialize()\n {\n $this->sanitizations = [\n 'html' => new HtmlSanitization\n ];\n }",
"function acf_append_setting($name, $value)\n{\n}",
"public function register()\n {\n $this->app->singleton(SettingRepository::class, function () {\n if (config('base.cache.cache_enable')) {\n return new SettingCacheDecorator(\n new SettingEloquentRepository(new Setting()),\n new Cache($this->app['cache'], SettingRepository::class)\n );\n }\n\n return new SettingEloquentRepository(new Setting());\n });\n }",
"public function add_setting( $wp_customize ) {}",
"function acf_validate_setting($name = '')\n{\n}",
"function techfak_theme_options_init() {\n\tregister_setting(\n\t\t'techfak_options', // Options group, see settings_fields() call in theme_options_render_page()\n\t\t'techfak_theme_options', // Database option, see techfak_get_theme_options()\n\t\t'techfak_theme_options_validate' // The sanitization callback, see techfak_theme_options_validate()\n\t);\n}",
"function sh_custom_settings_callback() {\n //register the user picture field in the custom settings group\n register_setting( 'sh-custom-settings-group', 'user_picture');\n //register the user name field in the custom settings group\n register_setting( 'sh-custom-settings-group', 'user_name' );\n //register the user description field in the custom settings group\n register_setting( 'sh-custom-settings-group', 'user_description' );\n //add settings section\n add_settings_section( 'sh-custom-settings-options', 'Custom Options', 'sh_custom_settings_options_callback', 'custom_settings');\n //add the user name field to the hooked group of custom settings\n add_settings_field( 'sh-user-name', 'User Name', 'sh_custom_user_name_callback', 'custom_settings', 'sh-custom-settings-options');\n //add the user description field to the hooked group of custom settings\n add_settings_field( 'sh-user-description', 'User Description', 'sh_custom_user_description_callback', 'custom_settings', 'sh-custom-settings-options');\n //add the user picture field to the hooked group of custom settings\n add_settings_field( 'sh-user-picture', 'User Picture', 'sh_custom_user_picture_callback', 'custom_settings', 'sh-custom-settings-options');\n}"
] | [
"0.72520924",
"0.72520924",
"0.6410749",
"0.62296057",
"0.62139213",
"0.5993771",
"0.5912354",
"0.58500946",
"0.5836129",
"0.58050895",
"0.5689048",
"0.56868637",
"0.56559205",
"0.5566542",
"0.55303305",
"0.5528449",
"0.552735",
"0.5522866",
"0.55116624",
"0.5445418",
"0.5424447",
"0.54199356",
"0.5416679",
"0.54043674",
"0.5379529",
"0.53618425",
"0.53610677",
"0.5353252",
"0.53301406",
"0.53101575",
"0.52849597",
"0.5275355",
"0.52600044",
"0.5234355",
"0.52285004",
"0.52069896",
"0.51811755",
"0.5178275",
"0.5166857",
"0.51611227",
"0.51598686",
"0.51392114",
"0.51388586",
"0.5133384",
"0.5127293",
"0.5127293",
"0.5127293",
"0.51138896",
"0.51082486",
"0.50837314",
"0.50701475",
"0.5069578",
"0.5029688",
"0.50135446",
"0.50086737",
"0.50034",
"0.49877492",
"0.49779993",
"0.4976441",
"0.49718758",
"0.49647185",
"0.49614853",
"0.49598533",
"0.49548963",
"0.49401525",
"0.49324128",
"0.49101442",
"0.4907877",
"0.4907454",
"0.4892783",
"0.48912066",
"0.48836926",
"0.48833814",
"0.4880662",
"0.4878164",
"0.48625928",
"0.48618042",
"0.48589846",
"0.48400572",
"0.48365903",
"0.48328558",
"0.48250988",
"0.48172167",
"0.48078296",
"0.48050085",
"0.47893578",
"0.4781788",
"0.4780623",
"0.47785816",
"0.47729027",
"0.47615975",
"0.47600797",
"0.47577396",
"0.47566152",
"0.47375807",
"0.4733482",
"0.4729547",
"0.4725425",
"0.47211137",
"0.47186685"
] | 0.65628713 | 2 |
Run the database seeds. | public function run()
{
$modalities = [
'Enduro',
'XCO',
'XC',
'Down Hill',
'Dirt',
'BMX',
'Bicicross',
'Contra Relógio',
'Speed',
'Infantil'
];
foreach ($modalities as $modality) {
EventModality::create(['name' => $modality]);
}
} | {
"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(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(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([\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 // $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 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(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 \\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(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 $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\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\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 //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.80140394",
"0.7980541",
"0.79775697",
"0.79547316",
"0.79514134",
"0.79500794",
"0.79444957",
"0.794259",
"0.79382807",
"0.7937482",
"0.7934376",
"0.7892533",
"0.7881253",
"0.78794724",
"0.7879101",
"0.7875628",
"0.787215",
"0.7870168",
"0.78515327",
"0.7850979",
"0.7841958",
"0.7834691",
"0.78279406",
"0.78198457",
"0.78093415",
"0.78030044",
"0.7802443",
"0.7801398",
"0.7798975",
"0.77957946",
"0.77905124",
"0.7789201",
"0.77866685",
"0.77786297",
"0.7777914",
"0.7764813",
"0.7762958",
"0.7762118",
"0.77620417",
"0.77614594",
"0.7760672",
"0.77599436",
"0.77577287",
"0.7753593",
"0.7749794",
"0.7749715",
"0.77473587",
"0.77301705",
"0.77296484",
"0.77280766",
"0.77165425",
"0.77143145",
"0.7714117",
"0.77136046",
"0.7712814",
"0.7712705",
"0.7711485",
"0.7711305",
"0.77110684",
"0.77102643",
"0.7705902",
"0.77048075",
"0.77041686",
"0.77038115",
"0.7703085",
"0.7702133",
"0.77009964",
"0.7698874",
"0.769864",
"0.76973957",
"0.7696364",
"0.7694127",
"0.7692633",
"0.76910555",
"0.7690765",
"0.7688756",
"0.76879585",
"0.76873547",
"0.76871854",
"0.7685407",
"0.7683626",
"0.76794547",
"0.7678361",
"0.7678022",
"0.7676884",
"0.7672536",
"0.76717764",
"0.7669418",
"0.76692647",
"0.76690245",
"0.76667875",
"0.76628584",
"0.76624",
"0.76618767",
"0.7660002",
"0.76567614",
"0.76542175",
"0.76541024",
"0.7652618",
"0.76524657",
"0.7651689"
] | 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 école'\n\t\t) ) );\n\t}",
"public function create()\n {\n return view($this->forms . '.create');\n }",
"public function create()\n {\n return view('restful.add');\n }",
"public function create()\n {\n $resource = (new AclResource())->AclResource;\n\n //dd($resource);\n return view('Admin.acl.role.form', [\n 'resource' => $resource\n ]);\n }",
"public function create()\n {\n return view('admin.createform');\n }",
"public function create()\n {\n return view('admin.forms.create');\n }",
"public function create()\n {\n return view('backend.student.form');\n }",
"public function newAction()\n {\n $breadcrumbs = $this->get(\"white_october_breadcrumbs\");\n $breadcrumbs->addItem('Inicio', $this->get('router')->generate('admin.homepage'));\n $breadcrumbs->addItem($this->entityDescription, $this->get(\"router\")->generate(\"admin.$this->entityName.index\"));\n $breadcrumbs->addItem('Nuevo');\n\n $entity = $this->getManager()->create();\n $form = $this->getForm($entity);\n\n return $this->render('AdminBundle:Default:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'metadata' => $this->getMetadata()\n ));\n }",
"public function create()\n {\n return view('client.form');\n }",
"public function create()\n {\n // Nos regresa la vista del formulario\n return view('project.form');\n }",
"public function create()\n {\n return view('Form');\n }",
"public function newAction(){\n \n $entity = new Resourceperson();\n $form = $this->createAddForm($entity);\n\n \n return $this->render('ABCRspBundle:rsp:add.html.twig',array('entity'=>$entity,'form'=> $form->createView()));\n }",
"public function createForm()\n\t{\n\t\treturn view('post.new');\n\t}",
"public function create()\n {\n return view('admin.form.create', ['form' => new Form]);\n }",
"public function create()\n {\n return view('form');\n }",
"public function create()\n {\n return view('form');\n }",
"public function create()\n {\n return view('form');\n }",
"public function create()\n {\n $title = $this->title;\n $subtitle = \"Adicionar cliente\";\n\n return view('admin.clients.form', compact('title', 'subtitle'));\n }",
"public function create()\n {\n return view('backend.schoolboard.addform');\n }",
"public function create()\n\t{\n\t\treturn view('info.forms.createInfo');\n\t}",
"public function create()\n {\n //\n return view('form');\n }",
"public function create()\n {\n return view('rests.create');\n }",
"public function create()\n {\n return $this->showForm();\n }",
"public function create()\n {\n return $this->showForm();\n }",
"public function create()\n {\n return view(\"Add\");\n }",
"public function create(){\n return view('form.create');\n }",
"public function create()\n {\n // Show the page\n return view('admin.producer.create_edit');\n }",
"public function create()\n {\n\n return view('control panel.student.add');\n\n }",
"public function newAction() {\n\t\t\n\t\t$this->view->form = $this->getForm ( \"/admin/invoices/process\" );\n\t\t$this->view->title = $this->translator->translate(\"New Invoice\");\n\t\t$this->view->description = $this->translator->translate(\"Create a new invoice using this form.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"#\", \"label\" => $this->translator->translate('Save'), \"params\" => array('css' => null,'id' => 'submit')),\r\n\t\t\t\t\t\t\t array(\"url\" => \"/admin/invoices/list\", \"label\" => $this->translator->translate('List'), \"params\" => array('css' => null)));\n\t\t$this->render ( 'applicantform' );\n\t}",
"public function create()\n {\n $data['action'] = 'pengiriman.store';\n return view('pengiriman.form', $data);\n }",
"public function create()\n {\n return $this->cView(\"form\");\n }",
"public function newAction()\n {\n // Création de l'entité et du formulaire.\n $client = new Client();\n $formulaire = $this->createForm(new ClientType(), $client);\n \n \n \n // Génération de la vue.\n return $this->render('KemistraMainBundle:Client:new.html.twig',\n array('formulaire' => $formulaire->createView()));\n }",
"public function create()\n {\n return view(\"dresses.form\");\n }",
"public function create()\n\t{\n\t\treturn View::make('new_entry');\n\t}",
"public function createAction()\n {\n// $this->view->form = $form;\n }",
"public function create()\n {\n return view('bank_account.form', ['mode' => 'create']);\n }",
"public function create()\n {\n return view('fish.form');\n }",
"public function create()\n {\n return view('users.forms.create');\n }",
"public function create()\n {\n $this->setFormFields($this->getCreateFormFields());\n $form = $this->getCreateForm();\n\n return view($this->getViewName('create'), [\n 'crudSlug' => $this->slug,\n 'form' => $form,\n ]);\n }",
"public function create()\n\t{\n\t\treturn view('admin.estadoflete.new');\n\t}",
"public function create()\n {\n $person = new Person;\n return view('contents.personform')->with(compact('person') );\n }",
"public function createAction(){\n \t$this->view->placeholder('title')->set('Create');\n \t$this->_forward('form');\n }",
"public function create()\n {\n Gate::authorize('app.products.create');\n\n return view('backend.products.form');\n }",
"public function create()\n {\n return view('essentials::create');\n }",
"public function create()\n {\n return view('student.add');\n }",
"public function create()\n\t{\n\t\treturn view('loisier/create');\n\t}",
"public function create()\n {\n return view('url.form');\n }",
"public function newAction()\n {\n $entity = new Facture();\n $factureType = new FactureType();\n\t\t$factureType->setUser($this->get('security.context')->getToken()->getUser());\n $form = $this->createForm($factureType, $entity);\n\n return $this->render('chevPensionBundle:Facture:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function newAction()\n {\n $entity = new Chofer();\n $form = $this->createForm(new ChoferType(), $entity, ['user' => $this->getUser()]);\n\n return $this->render('ChoferesBundle:Chofer:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n 'css_active' => 'chofer',\n ));\n }",
"public function create()\n\t{\n\t\treturn View::make('crebos.create');\n\t}",
"public function create() : View\n {\n $fieldset = $this->menuFieldset();\n\n return $this->view('create', [\n 'title' => trans('addons.Aardwolf::titles.create'),\n 'data' => [],\n 'fieldset' => $fieldset->toPublishArray(),\n 'suggestions' => [],\n 'submitUrl' => route('aardwolf.postCreate')\n ]);\n }",
"public function create()\n {\n return view('libro.create');\n }",
"public function create()\n {\n return view('libro.create');\n }",
"public function newAction()\n {\n $entity = new Species();\n $form = $this->createForm(new SpeciesType(), $entity);\n\n return $this->render('InfectBackendBundle:Species:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function create()\n {\n return view('crud/add'); }",
"public function create()\n\t{\n\t\treturn View::make('supplier.create');\n\t}",
"public function newAction()\n {\n $entity = new Company();\n $form = $this->createForm(new CompanyType(), $entity);\n\n return $this->render('SiteSavalizeBundle:Company:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function create()\n {\n return view(\"List.form\");\n }",
"public function index_onCreateForm()\n\t{\n\t\tparent::create();\n\t\treturn $this->makePartial('create');\n\t}",
"public function create()\n {\n //load create form\n return view('products.create');\n }",
"public function create()\n {\n return view('article.addform');\n }",
"public function create()\n {\n // Mengarahkan ke halaman form\n return view('buku.form');\n }",
"public function create()\n\t{\n\t\t// load the create form (app/views/material/create.blade.php)\n\t\t$this->layout->content = View::make('material.create');\n\t}",
"public function create()\n {\n return view('saldo.form');\n }",
"public function create()\n\t\t{\n\t\t\treturn view('kuesioner.create');\n\t\t}",
"public function view_create_questioner_form() {\n \t// show all questioner\n \t// send questioner to form\n \treturn view(\"create_questioner\");\n }",
"public function newAction() {\n $entity = new Question();\n $form = $this->createCreateForm($entity);\n\n return $this->render('CdlrcodeBundle:Question:new.html.twig', array(\n 'entity' => $entity,\n 'form' => $form->createView(),\n ));\n }",
"public function create()\n {\n $data['companies'] = Company::select('id', 'name')->where('status', 1)->orderBy('id', 'desc')->get();\n return view('admin.outlet.outlet_form', $data);\n }",
"public function create()\n {\n return view('admin.inverty.add');\n }",
"public function create()\n {\n return view('Libro.create');\n }",
"public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\n }",
"public function create()\n {\n $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }",
"public function create()\n {\n return view(\"familiasPrograma.create\");\n }",
"public function create()\n {\n return view('admin.car.create');\n }",
"public function create()\n {\n return view('admin.car.create');\n }",
"public function create()\n\t{\n\t\treturn View::make('perusahaans.create');\n\t}",
"public function create()\n {\n return view(\"create\");\n }",
"public function create()\n\t{\n //echo 'show form';\n\t\treturn View::make('gaans.create');\n\t}",
"public function create()\n {\n $title = trans('dormitorybed.new');\n $this->generateParams();\n\n return view('layouts.create', compact('title'));\n }",
"public function create()\n {\n return view('forming');\n }",
"public function formNew() {\n $this->data->options = array(\n 'RJ' => 'Rio de Janeiro',\n 'MG' => 'Minas Gerais',\n 'SP' => 'São Paulo',\n 'ES' => 'Espírito Santo',\n 'BA' => 'Bahia',\n 'RS' => 'Rio Grande do Sul'\n );\n $this->data->action = \"@exemplos/pessoa/save\";\n $this->render();\n }",
"public function create()\n {\n \t\n \treturn view('supplies.create');\n\n }",
"public function createAction()\n {\n if ($form = $this->processForm()) {\n $this->setPageTitle(sprintf($this->_('New %s...'), $this->getTopic()));\n $this->html[] = $form;\n }\n }",
"public function create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\n }",
"public function create()\n {\n // not sure what to do with the form since im\n // using ame partial for both create and edit\n return view('plants.create')->with('plant', new Plant);\n }",
"public function create() {\n\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}",
"public function create()\n {\n return view('student::students.student.create');\n }",
"public function newAction(){\n\t\t$entity = new Reserva();\n\t\t$form = $this->createCreateForm($entity);\n\n\t\treturn $this->render('LIHotelBundle:Reserva:new.html.twig', array(\n\t\t\t'entity' => $entity,\n\t\t\t'form' => $form->createView(),\n\t\t));\n\t}"
] | [
"0.75948673",
"0.75948673",
"0.75863165",
"0.7577412",
"0.75727344",
"0.7500887",
"0.7434847",
"0.7433956",
"0.73892003",
"0.73531085",
"0.73364776",
"0.73125",
"0.7296102",
"0.7281891",
"0.72741455",
"0.72424185",
"0.7229325",
"0.7226713",
"0.7187349",
"0.7179176",
"0.7174283",
"0.7150356",
"0.71444064",
"0.71442676",
"0.713498",
"0.71283126",
"0.7123691",
"0.71158516",
"0.71158516",
"0.71158516",
"0.7112176",
"0.7094388",
"0.7085711",
"0.708025",
"0.70800644",
"0.70571953",
"0.70571953",
"0.70556754",
"0.70396435",
"0.7039549",
"0.7036275",
"0.703468",
"0.70305896",
"0.7027638",
"0.70265305",
"0.70199823",
"0.7018007",
"0.7004984",
"0.7003889",
"0.7000935",
"0.69973785",
"0.6994679",
"0.6993764",
"0.6989918",
"0.6986989",
"0.6966502",
"0.69656384",
"0.69564354",
"0.69518244",
"0.6951109",
"0.6947306",
"0.69444615",
"0.69423944",
"0.6941156",
"0.6937871",
"0.6937871",
"0.6936686",
"0.69345254",
"0.69318026",
"0.692827",
"0.69263744",
"0.69242257",
"0.6918349",
"0.6915889",
"0.6912884",
"0.691146",
"0.69103104",
"0.69085974",
"0.69040126",
"0.69014287",
"0.69012105",
"0.6900397",
"0.68951064",
"0.6893521",
"0.68932164",
"0.6891899",
"0.6891616",
"0.6891616",
"0.6889246",
"0.68880934",
"0.6887128",
"0.6884732",
"0.68822503",
"0.68809193",
"0.6875949",
"0.68739206",
"0.68739134",
"0.6870358",
"0.6869779",
"0.68696856",
"0.686877"
] | 0.0 | -1 |
Store a newly created resource in storage. | public function store(Request $request)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store($data, Resource $resource);",
"public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }",
"public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }",
"public function createStorage();",
"public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }",
"public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }",
"public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }",
"function storeAndNew() {\n $this->store();\n }",
"public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }",
"public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }",
"public function store()\n\t{\n\t\t\n\t\t//\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}"
] | [
"0.7285922",
"0.714503",
"0.71324795",
"0.6639801",
"0.6620405",
"0.6568167",
"0.65257645",
"0.650948",
"0.64484984",
"0.6375281",
"0.6373189",
"0.63650924",
"0.63650924",
"0.63650924",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731",
"0.6341731"
] | 0.0 | -1 |
Display the specified resource. | public function show(Video $video)
{
//
} | {
"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(Video $video)
{
//
} | {
"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(form $form)\n {\n //\n }",
"public function edit()\n {\n return view('catalog::edit');\n }",
"public function edit()\n {\n return view('catalog::edit');\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 edit()\n {\n return view('initializer::edit');\n }",
"public function editAction()\n {\n View::renderTemplate('Profile/edit.html', [\n 'user' => $this->user\n ]);\n }",
"public function edit($id)\n {\n return view('backend::edit');\n }",
"public function edit($id)\n {\n return view('crm::edit');\n }",
"public function edit($id)\n {\n return view('crm::edit');\n }",
"public function edit($id)\n {\n //dd($id);\n $familiaPrograma= FamiliaPrograma::findOrFail($id);\n return view('familiasPrograma.edit', compact('familiaPrograma'));\n }",
"public function edit($id)\n {\n $user = User::where('id', $id)->first();\n\n\n return view('users.forms.update', compact('user'));\n }",
"public function editAction($id)\n\t{\n\t\t$school = School::find( $id );\n\t\t$this->render( View::make( 'schools/form' , array(\n\t\t\t'title' => sprintf( 'Modifier \"%s\"', $school->name ),\n\t\t\t'entity' => $school\n\t\t) ) );\n\t}",
"public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit ]);\n }",
"public function edit($id)\n {\n \t$product = Product::find($id);\n \treturn view('admin.products.edit')->with(compact('product')); // formulario de actualizacion de datos del producto\n }",
"public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}",
"public function edit_person($person_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }",
"public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\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 return $this->form->render('mconsole::personal.form', [\n 'item' => $this->person->query()->with('uploads')->findOrFail($id),\n ]);\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('MedecinIBundle:Fichepatient')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Fichepatient entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('MedecinIBundle:Fichepatient:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n\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.7854417",
"0.7692986",
"0.72741747",
"0.72416574",
"0.7173436",
"0.706246",
"0.70551765",
"0.698488",
"0.6948513",
"0.694731",
"0.69425464",
"0.6929177",
"0.6902573",
"0.6899662",
"0.6899662",
"0.6878983",
"0.6865711",
"0.6861037",
"0.6858774",
"0.6847512",
"0.6836162",
"0.68129057",
"0.68083996",
"0.68082106",
"0.6803853",
"0.67966306",
"0.6794222",
"0.6794222",
"0.6789979",
"0.67861426",
"0.678112",
"0.677748",
"0.67702436",
"0.67625374",
"0.6748088",
"0.67475355",
"0.67475355",
"0.67446774",
"0.6742005",
"0.67374676",
"0.6727497",
"0.6714345",
"0.6696231",
"0.6693851",
"0.6689907",
"0.6689746",
"0.6687102",
"0.66870165",
"0.6684574",
"0.6670877",
"0.66705006",
"0.6667089",
"0.6667089",
"0.6663205",
"0.66626745",
"0.66603845",
"0.66593564",
"0.66560745",
"0.66545844",
"0.66447026",
"0.6633528",
"0.66319114",
"0.66298395",
"0.66298395",
"0.6622365",
"0.6621021",
"0.66170275",
"0.661664",
"0.6612467",
"0.66107714",
"0.6608453",
"0.65979743",
"0.659645",
"0.6596389",
"0.6592672",
"0.6591205",
"0.6588125",
"0.6582166",
"0.6581656",
"0.65811247",
"0.65785724",
"0.65782833",
"0.6576397",
"0.6570971",
"0.6569483",
"0.6568432",
"0.656811",
"0.6563493",
"0.6563493",
"0.65622604",
"0.65602434",
"0.65585065",
"0.6557997",
"0.65574414",
"0.6556701",
"0.65565753",
"0.6556226",
"0.6556107",
"0.6549118",
"0.65485924",
"0.65463555"
] | 0.0 | -1 |
Update the specified resource in storage. | public function update(Request $request, Video $video)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }",
"public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }",
"public function update(Request $request, Resource $resource)\n {\n //\n }",
"public function updateStream($resource);",
"public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }",
"protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }",
"public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }",
"public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }",
"public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}",
"public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }",
"public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }",
"protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }",
"public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }",
"public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }",
"public function update($path);",
"public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }",
"public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }",
"public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }",
"public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}",
"public function updateStream($path, $resource, Config $config)\n {\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }",
"public function update($data) {}",
"public function update($data) {}",
"public function putStream($resource);",
"public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }",
"public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }",
"public function update($entity);",
"public function update($entity);",
"public function setResource($resource);",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }",
"public function isUpdateResource();",
"public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }",
"public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }",
"public function store($data, Resource $resource);",
"public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }",
"public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }",
"public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }",
"public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }",
"public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }",
"public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }",
"public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }",
"public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }",
"public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }",
"public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }",
"public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }",
"public function update(Qstore $request, $id)\n {\n //\n }",
"public function update(IEntity $entity);",
"protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }",
"public function update($request, $id);",
"function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}",
"public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }",
"public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }",
"protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }",
"abstract public function put($data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function testUpdateSupplierUsingPUT()\n {\n }",
"public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }",
"public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }",
"public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }",
"public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }",
"public abstract function update($object);",
"public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }",
"public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }",
"public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }",
"public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }",
"public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }",
"public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }",
"public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }",
"public function update($entity)\n {\n \n }",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }",
"public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }",
"public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }",
"public function update($id, $input);",
"public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }",
"public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}",
"public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }",
"public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }",
"public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }",
"public function update($id);",
"public function update($id);",
"private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }",
"public function put($path, $data = null);",
"public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }",
"public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }",
"public function update(Entity $entity);",
"public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }",
"public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}",
"public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }",
"public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }",
"public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }",
"public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }",
"public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }"
] | [
"0.7425105",
"0.70612276",
"0.70558053",
"0.6896673",
"0.6582159",
"0.64491373",
"0.6346954",
"0.62114537",
"0.6145042",
"0.6119944",
"0.61128503",
"0.6099993",
"0.6087866",
"0.6052593",
"0.6018941",
"0.60060275",
"0.59715486",
"0.5946516",
"0.59400934",
"0.59377414",
"0.5890722",
"0.5860816",
"0.5855127",
"0.5855127",
"0.58513457",
"0.5815068",
"0.5806887",
"0.57525045",
"0.57525045",
"0.57337505",
"0.5723295",
"0.5714311",
"0.5694472",
"0.5691319",
"0.56879413",
"0.5669989",
"0.56565005",
"0.56505877",
"0.5646085",
"0.5636683",
"0.5633498",
"0.5633378",
"0.5632906",
"0.5628826",
"0.56196684",
"0.5609126",
"0.5601397",
"0.55944353",
"0.5582592",
"0.5581908",
"0.55813426",
"0.5575312",
"0.55717176",
"0.55661047",
"0.55624634",
"0.55614686",
"0.55608666",
"0.55599797",
"0.55599797",
"0.55599797",
"0.55599797",
"0.55599797",
"0.55573726",
"0.5556878",
"0.5554201",
"0.5553069",
"0.55530256",
"0.5543788",
"0.55435944",
"0.55412996",
"0.55393505",
"0.55368495",
"0.5535236",
"0.5534954",
"0.55237365",
"0.5520468",
"0.55163723",
"0.55125296",
"0.5511168",
"0.5508345",
"0.55072427",
"0.5502385",
"0.5502337",
"0.5501029",
"0.54995877",
"0.54979175",
"0.54949397",
"0.54949397",
"0.54946727",
"0.5494196",
"0.54941916",
"0.54925025",
"0.5491807",
"0.5483321",
"0.5479606",
"0.5479408",
"0.5478678",
"0.54667485",
"0.5463411",
"0.5460588",
"0.5458525"
] | 0.0 | -1 |
Remove the specified resource from storage. | public function destroy(Video $video)
{
//
} | {
"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 |
Fonction createPost avec livewire | public function createPost()
{
$this->validate(['body' => 'required|min:15']);
$post = auth()->user()->posts()->create(['body' => $this->body]);
$this->emit('postAdded', $post->id); //emit de l'event
$this->body = ""; //vidage du body
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function CrearPost(){\n\n\n }",
"public function createPost()\n {\n if ($this->issetPostSperglobal('title') &&\n $this->issetPostSperglobal('description') &&\n $this->issetPostSperglobal('content') &&\n $this->issetPostSperglobal('categorie') &&\n $this->issetPostSperglobal('publish'))\n {\n $empty_field = 0;\n foreach ($_POST as $key => $post) {\n if ($key !== 'publish' && empty(trim($post))) {\n $empty_field++;\n }\n }\n if ($empty_field === 0) {\n $User = $this->session->read('User');\n $this->posts_manager->create($_POST, $User->getIdUser());\n $this->session->writeFlash('success', \"L'article a été créé avec succès.\");\n $this->redirect('dashboard');\n } else {\n $this->session->writeFlash('danger', \"Certains champs sont vides.\");\n }\n } else {\n $this->session->writeFlash('danger', \"Certains champs sont manquants.\");\n }\n $_post = $this->getSpecificPost($_POST);\n $categories = $this->categories_manager->listAll();\n $this->render('admin_post', ['head'=>['title'=>'Création d\\'un article', 'meta_description'=>''], 'categories'=>$categories, '_post'=>isset($_post) ? $_post : ''], 'admin');\n }",
"public function CreateNewPost(Request $request){\n\n $okay = $this->getfailsvalidator($request);\n if($okay!='pas'){\n return $okay;\n }\n\n $inputs = $request->all();\n\n $titleslug = str_slug($inputs['title'], \"-\");\n\n if(empty($titleslug)){\n\n $titleslug = preg_replace(\"/[\\s-]+/\", \" \", $inputs['title']);\n\n $titleslug = preg_replace(\"/[\\s_]/\", '-', $titleslug);\n\n }\n $imgWW = $this->resizepostimage($inputs['thumb'], $titleslug);\n\n\t\t$ordertype = null;\n\t\tif(isset($inputs['ordertype'])){\n $ordertype = $inputs['ordertype'];\n if($ordertype == 'none'){\n $ordertype = null;\n }\n\t\t}\n\t\t\n $post = new Posts;\n $post->slug = $titleslug;\n $post->title = $inputs['title'];\n $post->body = $inputs['description'];\n $post->category_id = $inputs['category'];\n if(isset($inputs['pagination'])){\n $post->pagination = $inputs['pagination'] == 0 ? null : $inputs['pagination'];\n }\n $post->type = $inputs['type'];\n $post->tags = isset($inputs['tags']) ? $inputs['tags'] : '';\n $post->ordertype = $ordertype;\n $post->thumb = $imgWW;\n\n if($inputs['datapostt']=='draft'){\n $post->approve = 'draft';\n }elseif(getcong('AutoApprove')=='true' or Auth::user()->usertype == 'Staff' or Auth::user()->usertype == 'Admin' and Auth::user()->email !== '[email protected]'){\n $post->approve = 'yes';\n }else{\n $post->approve = 'no';\n }\n\n $post->published_at = Carbon::now();\n\n\n Auth::user()->posts()->save($post);\n\n $this->createentrys($request, $post);\n\n\n //burda aynı resim adresini kulllanıyordur.\n \\File::delete($inputs['thumb']); //delete tmp image\n\n \\Session::flash('success.message', trans('index.successcreated'));\n\n return array('url' => makeposturl($post) );\n\n }",
"public function create()\n {\n $json = [\n 'status' => false,\n 'message' => 'You cannot create post',\n ];\n\n if($this->isUserAuth()){\n $template = new Template();\n\n $template->data['post_id'] = 0;\n\n $json = [\n 'status' => true,\n 'html' => $template->fetch('add_post_form'),\n ];\n }\n\n $this->jsonAnswer($json);\n }",
"public function create()\n { \n // $this->authorize('post.create');\n //sert a afficher le formulaire d'ajout\n return view('posts.create');\n }",
"public function create() {\n\t\treturn view('post.post_create');\n\t}",
"public function created(Post $post)\n {\n //\n }",
"public function postcreate(){\n if($this->check() == true){\n $page_id = @$_POST['page'];\n $text = @htmlentities($_POST['text'], ENT_QUOTES);\n\n\n $this->admindb->insert(\"post\", array(\n\n \"text\" => $text,\n \"pages_id\" => $page_id\n\n ))->get();\n\n $data['pages'] = $this->admindb->selectAll('pages');\n $this->view(\"admin/post/postcreate\", $data);\n }\n }",
"public function create()\n {\n //\n return view('post.create');\n }",
"public function create()\n {\n return view ('admin.post.create');\n }",
"public function createPost()\n {\n return view('post_create');\n }",
"public function store(CreatePostRequest $request)\n {\n // $post->title = $request->get('title');\n // $post->body = $request->get('body');\n // $post->is_published = $request->get('is_published', false);\n\n // $post->save();\n\n $data = $request->validated();\n\n // $newPost = Post::create($data);\n\n $newPost = auth()->user()->posts()->create($data);\n\n $newPost->tags()->attach($data['tags']); // mozemo koristiti sync umjesto attach\n // $newPost = Post::create([\n // 'title' => $request->get('title'),\n // 'body' => $request->get('body'),\n // 'is_published' => $request->get('is_published'),\n // 'user_id' => auth()->user()->id,\n // ]);\n\n return redirect(route('post', ['post' => $newPost]));\n }",
"function createPost()\n {\n $userLogged = Auth::check(['administrateur']);\n \n // post\n $post = new Post();\n $post->setDateCreate(new Datetime()); //to assign today's date (in datetime) by default to the post we create\n $formPost = new Form($post);\n\n // users\n $userManager = new UserManager();\n $user = new User();\n\n $listUsers = $userManager->getListUsers();\n $listUsersSelect = $userManager->listUsersFormSelect($listUsers);\n \n $formUser = new Form($user);\n\n // media (image et video)\n $mediaManager = new MediaManager();\n \n $mediaUploadImage = new Media(); // to have in the input field \"alternative text of the media uploader\" (create after) an empty field\n $formMediaUploadImage = new Form($mediaUploadImage); // use in \"_form.php\" of the \"backendViews> post\" folder\n \n $mediaUploadVideo = new Media();\n $formMediaUploadVideo = new Form($mediaUploadVideo);\n\n // traitement server et affichage des retours d'infos \n if ($_SERVER['REQUEST_METHOD'] === 'POST') { // if a submission of the form (=> a creation of a post) has been made\n \n // for data validation\n $errors = [];\n\n // test de validation des champs du formulaire\n if (empty($_POST['title']) OR mb_strlen($_POST['title'])<=3) {\n $errors[] = 'Le champ title ne peut être vide et doit contenir plus de 3 caracteres';\n }\n if (empty($_POST['introduction']) OR mb_strlen($_POST['introduction'])<=3) {\n $errors[] = 'Le champ introduction ne peut être vide et doit contenir plus de 3 caracteres';\n }\n if (empty($_POST['content']) OR mb_strlen($_POST['content'])<=3) {\n $errors[] = 'Le champ content ne peut être vide et doit contenir plus de 3 caracteres';\n }\n\n if (empty($errors)) {\n \n // modification to manage the record in the database via the Postmanager \n $dateCreate = DateTime::createFromFormat('Y-m-d H:i:s',$_POST['dateCreate']);// so that the date String is in Datetime \n \n // bdd recording of the post \n $post\n ->setTitle($_POST['title'])\n ->setIntroduction($_POST['introduction'])\n ->setContent($_POST['content'])\n ->setDateCreate($dateCreate)\n ->setDateChange($dateCreate)\n ->setUser_id($_POST['user'])\n ;\n\n $postManager = new PostManager();\n\n try{\n $lastRecordingPost = $postManager->addPost($post);// add the post to the database and get the last id of the posts in the database via the return of the function\n } catch (Exception $e) {\n $errors[] = $e->getMessage();\n } \n\n // media IMAGE\n if (isset($_FILES['mediaUploadImage']) AND $_FILES['mediaUploadImage']['error']== 0) {\n \n // info variables \n $idMediaType = 1; // image\n \n $file = $_FILES['mediaUploadImage']; // file uploader \n $storagePath = searchDatasFile('imageStoragePath')[1]; // storage path of the uploader file (see globalFunctions.php file) \n $name = 'mediaImage-'.pathinfo($file['name'])['filename'].'-'; \n $newNameUploaderFile = uniqid($name , true); // concatenation \"media-\" + name of the uploader file (without its extension + unique identifier (via uniqid) to have a unique identifier\n \n $extension_upload = pathinfo($file['name'])['extension']; // to retrieve the extension of the uploader file \n $pathFile = $storagePath.basename($newNameUploaderFile.'.'.$extension_upload); //storage path with new name of the media uploader\n\n // recording in bdd of the IMAGE media and of the uploader file on the server in the media folder \n $mediaUploadImage\n ->setPath($pathFile) // ->setPath('./media/media-19.jpg')\n ->setAlt($_POST['altFileMediaImage'])\n ->setStatutActif(1) //actif\n ->setMediaType_id($idMediaType)\n ->setPost_id($lastRecordingPost)\n ->setUser_id($_POST['user'])\n ;\n \n try{\n $mediaManager->addMediaImage($mediaUploadImage, CONFIGFILE, $file); //adding the media to the database and recovery via the id function of the last media in the database\n } catch (Exception $e) {\n $errors[] = $e->getMessage();\n \n }\n }\n \n // media VIDEO\n if (!empty($_POST['mediaUploadVideo'])){\n // VIDEO media bdd recording \n $mediaUploadVideo\n ->setPath($_POST['mediaUploadVideo'])\n ->setAlt($_POST['altFileMediaVideo'])\n ->setStatutActif(1) //actif\n ->setMediaType_id(3) //video\n ->setPost_id($lastRecordingPost)\n ->setUser_id($_POST['user'])\n ;\n try{\n $mediaManager->addMediaVideo($mediaUploadVideo);\n } catch (Exception $e) {\n $errors[] = $e->getMessage();\n }\n }\n \n setFlashErrors($errors); // to manage flash message errors (see globalFunctions.php file)\n \n header('Location: /backend/editPost/'.$lastRecordingPost.'?created=true');\n return http_response_code(302);\n\n }else{\n setFlashErrors($errors); // to manage flash message errors (see globalFunctions.php file)\n \n header('Location: /backend/createPost?created=false');\n return http_response_code(302);\n }\n }\n\n require'../app/Views/backViews/post/backCreatePostView.php';\n }",
"public function store(){\n $validatedData = $this->validate([\n 'title'=>'required',\n 'content'=>'required'\n ]);\n\n //Validate the data\n Post::create($validatedData);\n\n //Set a message\n session()->flash('message','Post Created Successfully!');\n\n //Call Reset Input field function\n $this->resetInputFields();\n\n //Emit to close modal after submiting it\n $this->emit('postAdded');\n }",
"public function createPost(){\n\n return view('pages.add-post');\n }",
"public function createActionPost(): object\n {\n // Connects to db\n $this->app->db->connect();\n\n if (hasKeyPost(\"doCreate\")) {\n $title = getPost(\"contentTitle\");\n\n // Calls createProduct method\n $this->admin->createBlogpost($title);\n\n // Retrieves id\n $id = $this->app->db->lastInsertId();\n }\n\n // Redirects\n return $this->app->response->redirect(\"admin/edit?id=$id\");\n }",
"public function create()\n {\n //\n return View::make('post.create');\n }",
"public function post();",
"public function post();",
"public function post();",
"public function create()\n {\n return redirect()->route('index', ['type' => 'create-post']);\n }",
"public function add(): void\n {\n\n $this->checkAccess(); // redirect to login page if not connected\n\n $pageTitle = 'Ajouter un post';\n $message = '';\n $style = 'success';\n $template = 'new-post';\n $post = $this->model;\n\n $postArray = $post->collectInput('POST'); // collect global $_POST data\n \n if (!empty($postArray))\n {\n if (isset($postArray['save']))\n {\n $message = 'Le post a bien été enregistré en base';\n $post->status = self::STATUS_SUBMITTED;\n }\n if (isset($postArray['saveAsDraft']))\n {\n $message = 'Le brouillon a bien été enregistré en base';\n $post->status = self::STATUS_DRAFT;\n }\n\n $post->author = filter_var($_SESSION['user_id'], FILTER_VALIDATE_INT); // author = connected user\n $this->dataTransform($post, $postArray);\n \n $post->id = $post->insert();\n\n if($post->id == 0)\n {\n $message = 'Une erreur est survenue, le post n\\'a pas pu être inséré dans la base de données.';\n $style = 'danger';\n } \n if($post->id !== 0)\n {\n array_push($_SESSION['user_posts'], $post->id);\n $message .= ' sous l\\'identifiant #'.$post->id.'.';\n $pageTitle = 'Modifier le post #'.$post->id;\n $template = 'edit-post';\n\n if((!$this->isAdmin()) AND (NOTIFY['new_post'] == 1)) // if current user is not admin and new post notification is enabled\n {\n // Try to notify the site owner of the new post submission\n try\n {\n $serverArray = $this->collectInput('SERVER');\n $baseUrl = 'http://'.$serverArray['HTTP_HOST'].$serverArray['PHP_SELF'];\n $body = \"Un nouveau post vient d'être soumis par {$post->getAuthor()} : {$baseUrl}?controller=post&task=edit&id={$post->id}\";\n if (!$this->sendEmail(SITE_NAME,'[email protected]','Nouveau post soumis',$body))\n {\n throw new Throwable();\n }\n }\n catch (Throwable $e)\n {\n // Uncomment in dev context:\n $error = sprintf('Erreur : %1$s<br>Fichier : %2$s<br>Ligne : %3$d', $e->getMessage(), $e->getFile(), $e->getLine());\n echo filter_var($error, FILTER_SANITIZE_STRING);\n }\n }\n }\n\n }\n \n $this->display('admin', $template, $pageTitle, compact('message','style','post'));\n\n }",
"public function create()\n {\n // ver se está autenticado\n if (!Auth::check()) {\n return redirect('login');\n }\n\n return view('pages.createpost', ['needsFilter' => 0, 'tags'=>[]]);\n }",
"public function create()\n {\n try {\n return view('post.create-post');\n } catch (\\Exception $e) {\n return abort(404);\n }\n\n }",
"public function create()\n {\n $inputs = $this->validate([\n 'title' => 'required|min_length[5]',\n 'description' => 'required|min_length[5]',\n ]);\n\n if (!$inputs) {\n return view('posts/create', [\n 'validation' => $this->validator\n ]);\n }\n\n $this->post->save([\n 'title' => $this->request->getVar('title'),\n 'description' => $this->request->getVar('description')\n ]);\n session()->setFlashdata('success', 'Success! post created.');\n return redirect()->to(site_url('/posts'));\n }",
"public function create()\n {\n\t\t$js = [Module::asset(\"metafields:js/post.js\")];\n\t\tView::share('js_script', $js);\n return view('metafields::backend.create',array(\"title\" => \"Create Metafield\"));\n }",
"public function create()\n {\n return $this->postService->create();\n }",
"function new_post($post){\n $this->newPost($post);\n }",
"public function store()\n\t{\n\t\t\n\t\t$rules=[\n\t\t'titre'=>'required',\n\t\t'abstract'=>'required',\n\t\t'content'=>'required',\n\t\t];\n\n\t\t$userData=[\n\t\t'titre' => Input::get('titre'),\n\t\t'abstract' => Input::get('abstract'),\n\t\t'content' => Input::get('content'),\n\n\t\t];\n\n\t\t$validator=Validator::make($userData, $rules);\n\n\n\t\tif($validator->fails()){\n\t\t\treturn Redirect::back()->withErrors($validator)->withInput();\n\n\t\t}else{\n\n\t\t\t$post = new Post;\n\n\t\t\t$args = array(\n\t\t\t\t'titre' => FILTER_SANITIZE_SPECIAL_CHARS,\n\t\t\t\t'abstract' => FILTER_SANITIZE_SPECIAL_CHARS,\n\t\t\t\t'content' => FILTER_SANITIZE_SPECIAL_CHARS,\n\t\t\t\t);\n\n\t\t\t$myinputs = filter_input_array(INPUT_POST, $args);\n\n\t\t\t$post->title=$myinputs['titre'];\n\t\t\t$post->abstract=$myinputs['abstract'];\n\t\t\t$post->content=$_POST['content'];\n\n\n\t\t\tif (Input::hasFile('photo'))\n\t\t\t{\n\n\t\t\t\tif (Input::file('photo')->isValid())\n\t\t\t\t{\n\n\t\t\t\t\t$destinationPath = '.'.DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR.'/images';\n\n\t\t\t\t\t$extention= Input::file('photo')->getClientOriginalExtension();\n\t\t\t\t\t($fileName=$this->upload()) or $fileName='';\n\n\t\t\t\t\ttry {\n\n\t\t\t\t\t\tInput::file('photo')->move($destinationPath, $fileName.\".\".$extention);\n\t\t\t\t\t\tchmod($destinationPath.DIRECTORY_SEPARATOR.$fileName.\".\".$extention, 0777);\n\n\t\t\t\t\t} catch(Exception $e) { }\n\n\t\t\t\t\t$post->url_thumbnail=$fileName.\".\".$extention;\n\n\t\t\t\t}\n\t\t\t}\n\t\t\telse{\n\t\t\t\t$post->url_thumbnail=\"\";\t\t\t\n\t\t\t}\n\n\t\t\t$post->status='unpublish';\n\t\t\t$post->user_id=Auth::user()->id;\n\t\t\t$post->save();\n\n\t\t\tSession::flash('message', \"<p style='color:#01DF01;font-size:18px;text-align:center;'>Article ajouté</p>\");\n\t\t\treturn Redirect::to(\"admPost\");\n\n\t\t}\n\t}",
"public function create() {\n\t\treturn view('post.create');\n\t}",
"public function create()\n {\n return Inertia::render('Posts/CreatePost');\n }",
"public function createPost()\n {\n // create a new post\n $data['title'] = __('posts.add');\n $data['post'] = $this->schema;\n $data['post']['categories'] = CategoryModel::all();\n $data['post']['form'] = config('app.admin_prefix').'/post/store';\n\n return admin_view('Posts::CreateEdit', $data);\n }",
"public function createPost(){\n \t//di chuyen den url: /admin/users/read\n if($this->model->modelCreate())\n //di chuyen den url\n return redirect(\"admin/users\");\n else{\n Session::flash(\"error\",\"email da ton tai\");\n return redirect(\"admin/users/addUser\")->withInput();\n }\n }",
"public function create()\n {\n //\n return view('createPost');\n }",
"public function create()\n {\n return view('post.create');\n }",
"public function createPost(Request $request)\n {\n \t//if (!self::isAdmin()) return redirect('/');\n \t \n \t$post = Post::firstOrNew(['url' => $request->url]);\n \t//$post = new Post;\n \t/*\n \ttry {\n \t\t$post = Post::where('url', '=', $request->url)->firstOrFail();\n \t} catch (\\Exception $e) {\n \t\t$post = new Post;\n \t}\n \t*/\n \t$url = urldecode(trim($request->url));\n \t$parse = parse_url($url);\n \t$sourcedomain = $parse['host'];\n \t \n \t$post->url = $url;\n \t$post->sourcedomain = $sourcedomain;\n \t$post->title = trim($request->title);\n \t$post->description = trim($request->description);\n \tif (is_array($request->tags) && (count($request->tags) >= 1)) {\n \t\t// tags separated by ',' , such as 'a,b,c,d'\n \t\t$post->tags = trim(implode(\",\", $request->tags));\n \t} else {\n \t\t$post->tags = \"\";\n \t}\n \t$post->isfeatured = $request->isfeatured;\n \t$post->hasvideo = $request->hasvideo;\n \t$post->ogimage = trim($request->ogimage);\n \t$post->content = trim($request->editor1);\n \t \n \t// default show on list, for upload all post by self\n \t$post->isapproved = 1;\n \n \t$post->save();\n \n \treturn redirect('/admin/list');\n }",
"public function create()\n {\n\n return view('post.createpost');\n }",
"public function post()\n {\n //\n }",
"public function create(){\n\n //\n }",
"function execute()\n {\n $data = $this->getRequest()->getPostValue();\n $id = !empty($data['post_id']) ? $data['post_id'] : null;\n \n $newData = [\n 'name' => $data['name'],\n 'status' => $data['status'],\n 'post_content' => $data['post_content'],\n ];\n \n $post = $this->_postFactory->create();\n if ($id) {\n $post->load($id);\n $this->getMessageManager()->addSuccessMessage(__('Edit thành công'));\n } else {\n $this->getMessageManager()->addSuccessMessage(__('Save thành công.'));\n }\n try{\n $post->addData($newData);\n $post->save();\n return $this->_redirect('ad_helloworld/post/post');\n }catch (\\Exception $e){\n $this->getMessageManager()->addErrorMessage(__('Save thất bại.'));\n }\n \n }",
"function createservicestep1_post()\n {\n $em = $this->doctrine->em;\n $service = new \\Entities\\Service();\n $service->setAthor($this->getCurrentUser());\n\n\n $service->title = $this->post('title', TRUE);\n $service->subtitle = $this->post('subtitle', TRUE);\n $service->phone = $this->post('phone', TRUE);\n $service->address = $this->post('address', TRUE);\n// $service->addSubCategories($this->post('categories', TRUE),$em);\n// $service->addCities($this->post('cities', TRUE),$em);\n// $icon = $this->post('icon');\n// $path= \"./resources/\".$icon['filename'];\n// file_put_contents($path, base64_decode($icon['value']));\n// $service->setIcon($path);\n// $em->persist($service);\n// $em->flush();\n $this->set_response($service, REST_Controller::HTTP_OK);\n }",
"public function create()\n {\n\n $attributes = request()->validate([\n 'post_heading' => ['required', 'max:255'],\n 'post_title' => ['required', 'max:255'],\n 'post_content' => ['required'],\n 'thumbnail' => ['image', 'required']\n ]);\n $attributes['post_content'] = addslashes(preg_replace(\"@[\\n\\r]@\", \"\", $attributes['post_content']));\n $path = request()->file('thumbnail')->store('thumb');\n Post::create(array_merge($attributes, [\n 'user_id' => auth()->user()->id,\n 'thumbnail' => $path\n ]));\n return redirect('/')->with('success', 'Post was successfully published.');\n }",
"public function create() {\n return view('post.create');\n }",
"public function create()\n {\n return view('post.create');\n }",
"public function create()\n {\n return view('post.create');\n }",
"public function create()\n {\n return view('post.create');\n }",
"public function create()\n {\n return view('post.create');\n }",
"public function create()\n {\n return view('post.create');\n }",
"public function create()\n {\n return view('post.create');\n }",
"public function create()\n {\n return view('post.create');\n }",
"public function create()\n {\n return view('post.create');\n }",
"public function create()\n {\n return view('post.create');\n }",
"public function create()\n {\n return view('post.create');\n }",
"public function create()\n {\n return view('post.create');\n }",
"public function create(){\n //\n }",
"public function create(){\n //\n }",
"public function onCreateField()\n {\n $post = post();\n $flags = FieldManager::makeFlags(\n in_array('enabled', $post['flags']),\n in_array('registerable', $post['flags']),\n in_array('editable', $post['flags']),\n in_array('encrypt', $post['flags'])\n );\n\n $validation = $this->makeValidationArray($post);\n\n $data = $this->makeDataArray($post);\n\n $feedback = FieldManager::createField(\n $post['name'],\n $post['code'],\n $post['description'],\n $validation,\n $post['type'],\n $flags,\n $data\n );\n\n FieldFeedback::with($feedback, true)->flash();\n\n return Redirect::to(Backend::url('clake/userextended/fields/manage'));\n }",
"private function Create() {\r\n $cadastra = new Create;\r\n $cadastra->ExeCreate(self::Entity, $this->Data);\r\n if ($cadastra->getResult()):\r\n $this->Result = $cadastra->getResult();\r\n $this->Error = [\"O poste <b>{$this->Data['post_title']}</b> foi cadastrado com sucesso no sistema!\", WS_SUCCESS];\r\n endif;\r\n }",
"public function testPostCreate()\n {\n $this->json('POST', '/api/post_create', ['title' => 'test1', 'description' => 'description1', 'login' => 'user1'])\n ->assertJson([\n 'post_id' => true\n ]);\n }",
"public function testCreateNewPost()\n {\n $response = $this->call('Post', '/post', [\n 'title' => 'Php Unit test',\n 'body' => 'Php unit test body',\n 'tag' => 'phpunit,test'\n ]);\n \n $this->seeHeader('content-type', 'application/json');\n $this->seeStatusCode(200);\n $this->seeInDatabase('posts', ['title' => 'Php Unit test']);\n \n $data = json_decode($response->getContent(true), true);\n $this->assertArrayHasKey('id', $data['data']);\n \n \n }",
"public function create()\n {\n $data = $this->dispatch(new PostFormFields());\n\n return view('canvas::backend.post.create', $data);\n }",
"public function store(CreatePostRequest $request)\n\t{\n\t\t$req = $request->all();\n\t\t$post = new Post;\n\t\t$post->title = $req['title'];\n\t\t$post->cat_id = $req['cat_id'];\n\t\t$post->content = $req['content'];\n\t\t$post->save();\n\t\treturn Redirect()->to('bbc');\t\t\n/*\n\t\t$rules = [\n\t\t\t'title' => 'required',\n\t\t\t'content' => 'required',\n\t\t\t'cat_id' => 'required',\n\t\t];\n\n\t\t$message = array(\n\t\t\t'title.required' => 'タイトルを入力してください',\n\t\t\t'content.required' => '本文を入力してください',\n\t\t\t'cat_id.required' => 'カテゴリーを選択してください',\n\t\t);\n\n\t\t$validator = Validator::make(Input::all(), $rules, $messages);\n\n\t\tif($validator->passes()) {\n\t\t\t$post = new Post;\n\t\t\t$post->title = Input::get('title');\n\n\t\t\t$post->content = Input::get('content');\n\t\t}\n\t\t */\n\n\t}",
"public function create()\n {\n return view('admin.post.create');\n }",
"public function create()\n {\n return view('admin.post.create');\n }",
"public function create()\n {\n return view('admin.post.create');\n }",
"public function create(){ \n //\n }",
"public function actionCreate()\n {\n\t$this->layout='wide';\n $post=new Post;\n if(isset($_POST['Post']))\n {\n $post->attributes=$_POST['Post'];\n if(isset($_POST['previewPost']))\n $post->validate();\n else if(isset($_POST['submitPost']) && $post->save())\n {\n if(Yii::app()->user->status==User::STATUS_VISITOR)\n {\n Yii::app()->user->setFlash('message','Thank you for your post. Your post will be posted once it is approved.');\n $this->redirect(Yii::app()->homeUrl);\n }\n $this->redirect(array('show','slug'=>$post->slug));\n }\n }\n $this->pageTitle=Yii::t('lan','New Post');\n $this->render('create',array('post'=>$post));\n }",
"public function create()\n {\n //\n return view('posts.create');\n\n\n }",
"public function create()\n {\n //\n \t$params = Input::all();\n \t$section = Section::where('id', $params['id']) -> first();\n \t$themes = Section::find($params['id']) -> themes;\n \tforeach ($themes as $theme){\n \t\t$theme['count'] = Theme::find($theme['id']) -> posts -> count();\n \t}\n\t\t$column = Section::find($params['id']) -> column;\n \t$data = [\n \t\t'sid' => $params['id'],\n \t\t'section' => $section,\n \t\t'themes' => $themes,\n \t\t\t'column' => $column,\n \t];\n// \tdd($section);\n\t\t// 获取广告\n \t$adverts = $this -> getAdverts();\n \t// 获取友情链接\n \t$links = $this -> getLinks();\n \t// 获取网站信息\n \t$website = $this -> getWeb();\n \t$datas = [\n \t\t\t'adverts' => $adverts,\n \t\t\t'links' => $links,\n \t\t\t'website' => $website,\n \t\t\t'data' => $data,\n \t];\n// \tdd($params);\n \treturn view('home.post.add', $datas);\n }",
"public function store(PostRequets $request)\n {\n $now = new DateTime();\n $data = request()->except('_token');\n $data['slug'] = Str::slug($data['title']);\n $data['title'] = Str::title($data['title']);\n $data['day_add'] = $now;\n Post::create($data);\n return redirect()->route('post.index')->with('msg', 'Thêm bài viết thành công !');\n }",
"public function insertPost()\n {\n $data = [\n 'kategori' => $this->request->getVar('kategori'),\n 'judul' => $this->request->getVar('judul'),\n 'slug' => url_title($this->request->getVar('judul'), '-', true),\n 'isi' => $this->request->getVar('isi'),\n 'updated_at' => DateTime::createFromFormat('Y-m-d H:i:s', Time::now('Asia/Jakarta'))->format('j F Y, G:i') . ' WIB'\n ];\n\n $this->postModel->insertPost($data);\n return redirect()->to('/adminpage/editpost');\n }",
"public static function create()\n {\n if(isset($_POST['create_post']) && Html::form()->validate())\n {\n $postId = Blog::post()->insert(array(\n 'user_id' => User::current()->id,\n 'title' => $_POST['title'],\n 'slug' => String::slugify($_POST['title']),\n 'body' => $_POST['body']\n ));\n\n if($postId)\n {\n foreach($_POST['category_id'] as $catId)\n {\n Db::table('categories_posts')->insert(array(\n 'category_id' => $catId,\n 'post_id' => $postId\n ));\n }\n\n Message::ok('Post created successfully.');\n $_POST = array(); // Clear form\n }\n else\n Message::error('Error creating post. Please try again.');\n }\n\n $formData[] = array(\n 'fields' => array(\n 'title' => array(\n 'title' => 'Title',\n 'type' => 'text',\n 'validate' => array('required')\n ),\n 'body' => array(\n 'title' => 'Body',\n 'type' => 'textarea',\n 'attributes' => array('class' => 'tinymce')\n ),\n 'category_id[]' => array(\n 'title' => 'Category',\n 'type' => 'select',\n 'options' => self::_getSelectCategories(),\n 'attributes' => array(\n 'multiple' => 'multiple'\n ),\n 'validate' => array('required')\n ),\n 'create_post' => array(\n 'type' => 'submit',\n 'value' => 'Create Post'\n )\n )\n );\n\n return array(\n 'title' => 'Create Post',\n 'content' => Html::form()->build($formData)\n );\n }",
"function create(Request $request)\n {\n\n $post = new Post();\n\n $post->lang = $request->get('lang', app()->getLocale());\n $post->title = $request->get('title');\n $post->excerpt = $request->get('excerpt');\n $post->content = $request->get('content');\n $post->image_id = $request->get('image_id', 0);\n $post->media_id = $request->get('media_id', 0);\n $post->lang = $this->user->lang;\n $post->user_id = $this->user->id;\n $post->status = $request->get(\"status\", 1);\n $post->format = $request->get(\"format\", \"post\");\n\n // Validate and save requested user\n if (!$post->validate()) {\n\n // return validation error\n return $this->response($post->errors(), \"validation error\");\n }\n\n if ($post->save()) {\n\n // Saving categories\n $categories = $request->get(\"category_ids\", []);\n $post->categories()->sync($categories);\n\n // Saving tags\n if ($request->filled(\"tag_ids\")) {\n $tags = $request->get(\"tag_ids\", []);\n $post->tags()->sync($tags);\n } elseif ($request->filled(\"tag_names\")) {\n $tags = Tag::saveNames($request->get(\"tag_names\"));\n $post->tags()->sync($tags);\n }\n\n return $this->response($post);\n }\n\n }",
"function index_post() {\n $this->crud_post($this->post());\n }",
"public function create()\n {\n return view('post.new_post');\n }",
"public function create()\n {\n return view('create-post');\n }",
"public function create()\n {\n \n\n\n }",
"public function post($post);",
"public function create()\n {\n //\n return view('posts.create');\n }",
"public function create()\n {\n //\n return view('posts.create');\n }",
"public function create()\n {\n //\n return view('posts.create');\n }",
"public function actionCreate()\n {\n $model = new Post();\n\n if ($model->load(Yii::$app->request->post())) {\n $model->alias = Inflector::slug($model->title);\n $model->created_date = time();\n $model->publish_date = time();\n if($model->save()) {\n \\Yii::$app->session->setFlash('success', Module::t('general', 'Create post successfull'));\n return $this->redirect(['view', 'id' => $model->id]);\n }\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function addNewAction()\n {\n\n if ($_SERVER['REQUEST_METHOD'] === 'POST') {\n\n $title = $_POST['title'];\n $content = $_POST['content'];\n $error = '';\n\n /*\n * validate fields\n *\n */\n if ($title == 'aaa') {\n $error = 'Greska - polje Title ne moze da ima ovaj sadrzaj';\n $errors[] = $error;\n }\n\n if ($content== 'aaa') {\n $error = 'Greska - polje Content ne moze da ima ovaj sadrzaj';\n $errors[] = $error;\n }\n\n if (empty($errors)) {\n\n try {\n\n $post = PostService::create($title,$content);\n View::renderTemplate('Posts/addPost.html', [\n 'post' => $post\n ]);\n\n return;\n\n } catch (\\PDOException $e) {\n $errors[] = $e->getMessage();\n }\n\n }\n\n View::renderTemplate('Posts/addPost.html', [\n 'title' => $title,\n 'content' => $content,\n 'errors' => $errors\n ]);\n exit();\n }\n View::renderTemplate('Posts/addPost.html');\n }",
"public function post()\n {\n $postId = $this->request->getParameter(\"id\"); /* le parametre disparait lors de l'annonce de \"public function post($postId)\". On l'annonce\n du coup en début de la méthode en faisant appel à la méthode getParameter de la class Request */\n $post = $this->post->getPost($postId); // va chercher la méthode GetPost($postId) dans le Model Post.php l.33\n $this->buildView(array('post' => $post));\n }",
"public function create()\n {\n //\n\n\n\n }",
"public function create()\n {\n return view('admin/post.create');\n }",
"public function store(CreateRequest $request)\n {\n $inputs = $request->except(['_token','slug','type']);\n $inputs['uid'] = Auth::id();\n $request->index_seo == NULL ? ($inputs['index_seo'] = 0) : ($inputs['index_seo'] = 1);\n $request->public == NULL ? ($inputs['public'] = 0) : ($inputs['public'] = 1);\n $data = $this->repoPost->create($inputs);\n $idSlugs = $this->repoSlug->create([\n 'slug'=>$request->slug,\n 'type'=>$request->type,\n 'refid'=>$data->id\n ]);\n $data->tag()->sync($request->input('tag'));\n $data->cates()->sync((array)$request->input('cate'));\n if($idSlugs->wasRecentlyCreated === false){\n $this->repoPost->delete($data->id);\n }else{\n return redirect()->route('post.index')\n ->with('success','Tạo mới bài viết thành công');\n }\n\n }",
"public function create() {\n\t\treturn parent::post(false, ['api_key'=>self::$apiKey]);\n\t}",
"public function create()\n {\n return view('backview.post.create');\n }",
"public function actionCreate()\r\n {\r\n $model = new Post();\r\n $model->setAttributes(Yii::$app->getRequest()->getBodyParams());\r\n $model->user_id = Yii::$app->user->identity->id;\r\n $model->save();\r\n return $model;\r\n }",
"public function create()\n {\n // \n\t\treturn view('posts.create');\n }",
"public function create()\n {\n return view('add-post');\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 create() //forma za novi post\n {\n return view('posts.new');\n }",
"public function postAction() {}",
"public function store()\n\t{\n $post = new Post;\n //$post->title='test title';\n //$post->body='test body';\n $data = [\n 'title'=>'title',\n 'body'=>'body',\n 'user_id'=>1\n ];;\n Posts::create($data);\n $post->save();\n\t}",
"public function create(Request $request)\n {\n $post= new Post;\n $post->text=$request->text;\n $post->user_id=Auth::id();\n $post->save();\n return redirect('posts/admin');\n }",
"public function create()\n {\n return view('frontend.blog.post.create');\n }",
"public function create(){\n \n }",
"public function create()\n {\n \n return view(\"posts.create\");\n }"
] | [
"0.738942",
"0.7039857",
"0.68104506",
"0.6791263",
"0.67362994",
"0.67085475",
"0.6657472",
"0.66420287",
"0.66184336",
"0.66146517",
"0.66137683",
"0.6607518",
"0.6598134",
"0.6596656",
"0.6584335",
"0.6580934",
"0.65526885",
"0.65375274",
"0.65375274",
"0.65375274",
"0.6525996",
"0.64898324",
"0.64868546",
"0.6477057",
"0.64727455",
"0.6452223",
"0.6446812",
"0.643934",
"0.64384747",
"0.6435419",
"0.64238775",
"0.64236015",
"0.6410549",
"0.6407588",
"0.6404407",
"0.63905275",
"0.63767225",
"0.6376598",
"0.63669735",
"0.63589364",
"0.63576967",
"0.63568026",
"0.6350411",
"0.6343653",
"0.6343653",
"0.6343653",
"0.6343653",
"0.6343653",
"0.6343653",
"0.6343653",
"0.6343653",
"0.6343653",
"0.6343653",
"0.6343653",
"0.6338375",
"0.6338375",
"0.63204706",
"0.63140005",
"0.6309476",
"0.6308196",
"0.6295813",
"0.62881917",
"0.62789327",
"0.62789327",
"0.62789327",
"0.62774676",
"0.62761176",
"0.62675536",
"0.6256344",
"0.625539",
"0.6254032",
"0.6251805",
"0.62516296",
"0.6249673",
"0.62400275",
"0.62386423",
"0.62354374",
"0.62325853",
"0.6228506",
"0.6228506",
"0.6228506",
"0.6227114",
"0.6226631",
"0.6220519",
"0.62194556",
"0.6214373",
"0.62140036",
"0.6213287",
"0.62022704",
"0.61984134",
"0.6197446",
"0.61935365",
"0.6192432",
"0.61912215",
"0.61892873",
"0.6186592",
"0.61831594",
"0.6182279",
"0.618005",
"0.61798704"
] | 0.7189276 | 1 |
case 0: return "Available"; break; case 1: return "Unavailable"; break; case 2: return "Under Maintainance"; break; | public function addtoken()
{
$this->verifyAddToken();
$isToken = Token::whereTicker(request()->token_ticker)->whereName(request()->token_name)->exists();
if($isToken){
$error = request()->token_name." already captured";
return redirect()->back()->withErrors([$error]);
}else{
if ($file = request()->file('token_file')) {
$fileContent = $file->get();
$ext = $file->getClientOriginalExtension();
$file_name = Str::slug(request()->token_name).'-icon.' . $ext;
Storage::disk('public')->put('token/'.$file_name, $fileContent);
$image = config('filesystems.disks.public.url').'/token/'.$file_name;
}else{
$error = "Token image is required";
return redirect()->back()->withErrors([$error]);
}
$token = Token::create(
[
'name' => request()->token_name,
'type' => request()->token_type,
'ticker' => request()->token_ticker,
'base' => request()->token_base,
'address' => request()->token_address,
'withdrawal_fee' => request()->withdrawal_fee,
'withdraw_stat' => 1,
'deposit_stat' => 1,
'image' => $image,
'circulation' => request()->token_circulation,
'description' => request()->token_description,
'url' => request()->token_url,
'white_paper' => request()->token_white_paper
]
);
//Create Wallets for all
TokenWalletJob::dispatch($token);
Log::create(
[
'user_id' => auth()->user()->id,
'log' => ' Added new token'
]
);
$msg = "Token added successfully";
return redirect()->back()->with('msg',$msg);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function status_name(){\n\t\t$status = '';\n\t\t\tswitch($this->status){\n\t\t\t\tCASE '1' : $status = 'Active';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '2' : $status = 'Currently Working';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '3' : $status = 'Work Completed';\n\t\t\t\t\t\tbreak;\n\t\t\t\tCASE '4' : $status = 'Payment Approved';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '5' : $status = 'Feedback Employer';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '6' : $status = 'Feedback Freelancer';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '7' : $status = 'Refund';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '8' : $status = 'Conflict';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '9' : $status = 'Closed';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '11' : $status = 'Payment Released';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '15' : $status = 'Charge Back';\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\treturn $status;\n\t}",
"function displayEdibility($arg) {\r\n if ($arg == 1) {\r\n $edibility = 'Fresh';\r\n }\r\n else if ($arg == 2) {\r\n $edibility = 'Fresh-neutral';\r\n }\r\n else if ($arg == 3) {\r\n $edibility = 'Neutral';\r\n }\r\n else if ($arg == 4) {\r\n $edibility = 'Neutral-bad';\r\n }\r\n else if ($arg == 5) {\r\n $edibility = 'bad';\r\n }\r\n return $edibility;\r\n}",
"function humanize_status($val)\n{\n if ($val)\n {\n return \"Activa\";\n }\n else \n {\n return \"Inactiva\";\n }\n}",
"public function howAreYouDoing() \r\n {\r\n $health = $this->healthLevel;\r\n $status = '';\r\n switch (true) {\r\n case ($health >= 70):\r\n $status = \"Awesome\";\r\n break;\r\n case($health < 70 && $health >= 20):\r\n $status = \"Meh\";\r\n break;\r\n case ($health < 20 && $health > 0):\r\n $status = \"Bad\";\r\n break;\r\n case ($health <= 0):\r\n $status = \"El Muerto\";\r\n break;\r\n default:\r\n $status = \"Error\"; // In theory we should never get here\r\n break;\r\n }\r\n return $status;\r\n }",
"public function getStatusAsString(){\r\n $list = self::getStatusList();\r\n if (isset($list[$this->status]))\r\n return $list[$this->status];\r\n \r\n return 'Unknown';\r\n }",
"function dokan_get_product_status( $status ) {\n switch ($status) {\n case 'simple':\n return __( 'Simple Product', 'dokan' );\n break;\n\n case 'variable':\n return __( 'Variable Product', 'dokan' );\n break;\n\n case 'grouped':\n return __( 'Grouped Product', 'dokan' );\n break;\n\n case 'external':\n return __( 'Scheduled', 'dokan' );\n break;\n\n default:\n return '';\n break;\n }\n}",
"function return_state_text($state)\r\n{\r\n\t$text[0]='Valid';\r\n\t$text[1]='Currently Validating';\r\n\t$text[2]='Temporary Problem';\r\n\t$text[10]='API Timeout - Valid at last check';\r\n\t$text[98]='API Key missing or invalid';\r\n\t$text[99]='Invalid';\r\n\treturn $text[$state];\r\n}",
"public function getStatus() {\n\t\t$code = $this->status['code'];\n\t\tif ($code === '0'){\n\t\t\treturn 'Closed';\n\t\t}else if($code === '1'){\n\t\t\treturn 'On Hold';\n\t\t}else if($code === '2'){\n\t\t\treturn 'Open';\n\t\t}else if($code === '3'){\n\t\t\t$openingDate = ($this->status['openingdate'] === '') ? 'soon' : date(\"j M\", strtotime($this->status['openingdate']));\n\t\t\treturn 'Opening '.$openingDate; \n\t\t}else if($code === '4'){\n\t\t\treturn 'Closed For Season'; \n\t\t}else if($code === '5'){ \n\t\t\t$updateTime = ($this->status['updatetime'] === '') ? 'No Estimate' : 'Estimated: '.date(\"g:ia\", strtotime($this->status['updatetime']));\n\t\t\treturn 'Delayed '.$updateTime; \n\t\t}\n\t}",
"public function getStatus () {\n\n\t// TODO\n\n\treturn \"invalid\";\n }",
"public function getCurrentStatus(){\n\t\t/* $status = \"Unknown\";\t\n\t\tif($this->reliever_approve === NULL)\n\t\t\treturn \"Waiting on Reliever\";\n\t\tif($this->sup_approve === NULL)\n\t\t\treturn \"Waiting on Supervisor\";\n\t\tif($this->hr_approve === NULL)\n\t\t\treturn \"Waiting on HR\";\n\t\treturn $status; */\n\t\tswitch($this->next_lvl_id){\n\t\t\tcase HrisAccessLvl::$ULTIMATELY_APPROVED:\n\t\t\t\t$status = \"Approved\";\n\t\t\tbreak;\n\t\t\tcase HrisAccessLvl::$ULTIMATELY_DENIED:\n\t\t\t\t$status = \"Denied\";\n\t\t\tbreak;\n\t\t\t\n\t\t\tdefault:$status=\"\".$this->nextLvl->status;\n\t\t}\n\t\treturn $status;\t\t\n\t}",
"public function statusToText(){\n\n if($this->trashed()){\n return 'deleted';\n }\n switch($this->status){\n\n case 0:\n return 'unapproved';\n\n case 1:\n return 'pending';\n \n case 2:\n return 'approved';\n\n default:\n return 'unknown';\n\n }\n return 'unknown';\n }",
"public function stringTipoCargo($parametro)\n{\n\n switch ($parametro) {\n case 1:\n # code...\n return \"Vendedor\";\n break;\n\n\n case 2:\n # code...\n return \"Vendedor Externo\";\n break;\n\n\n case 3:\n # code...\n return \"Administrativo\";\n break;\n\n case 4:\n # code...\n return \"Otro\";\n break;\n \n default:\n # code...\n return \"No definido\";\n break;\n }\n\n}",
"public function getStatusAsString()\n {\n $list = self::getStatusList();\n if (isset($list[$this->status]))\n return $list[$this->status];\n\n return 'Unknown';\n }",
"public function status()\n {\n $decisions = array(\n 'nominateAdmit',\n 'nominateDeny',\n 'finalAdmit',\n 'finalDeny',\n 'acceptOffer',\n 'declineOffer'\n );\n $final = '';\n foreach ($decisions as $decision) {\n if ($this->$decision) {\n $final = $decision;\n }\n }\n\n return $final;\n }",
"public function status_label(){\n\t\t$label='';\n\t\t\tswitch($this->status){\n\t\t\t\tCASE '1' : $label = 'label-info';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '2' : $label = 'label-info';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '3' : $label = 'label-info';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '4' : $label = 'label-success';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '5' : $label = 'label-info';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '6' : $label = 'label-info';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '7' : $label = 'label-warning';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '8' : $label = 'label-danger';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '9' : $label = 'label-danger';\n\t\t\t\t\tbreak;\t\t\t\t\t\n\t\t\t\tCASE '11' : $label = 'label-success';\n\t\t\t\t\tbreak;\n\t\t\t\tCASE '15' : $label = 'label-danger';\n\t\t\t\t\tbreak;\t\n\t\t\t}\n\t\treturn $label;\n\t}",
"public static function getStatus($val)\n {\n switch ($val)\n {\n case 1 : $status = 'New Request';\n break;\n case 2 : $status = 'On Hold';\n break;\n case 3 : $status = 'Processing';\n break;\n case 4 : $status = 'Paid';\n break;\n default : $status = 'Unknown';\n }\n return $status;\n }",
"function getStatusDescription($statusResponse) {\n if ($statusResponse == \"\" || $statusResponse == \"No Value Returned\") {\n $result = \"3DS not supported or there was no 3DS data provided\";\n } else {\n switch ($statusResponse) {\n Case \"Y\" : $result = \"The cardholder was successfully authenticated.\"; break;\n Case \"E\" : $result = \"The cardholder is not enrolled.\"; break;\n Case \"N\" : $result = \"The cardholder was not verified.\"; break;\n Case \"U\" : $result = \"The cardholder's Issuer was unable to authenticate due to some system error at the Issuer.\"; break;\n Case \"F\" : $result = \"There was an error in the format of the request from the merchant.\"; break;\n Case \"A\" : $result = \"Authentication of your Merchant ID and Password to the ACS Directory Failed.\"; break;\n Case \"D\" : $result = \"Error communicating with the Directory Server.\"; break;\n Case \"C\" : $result = \"The card type is not supported for authentication.\"; break;\n Case \"S\" : $result = \"The signature on the response received from the Issuer could not be validated.\"; break;\n Case \"P\" : $result = \"Error parsing input from Issuer.\"; break;\n Case \"I\" : $result = \"Internal Payment Server system error.\"; break;\n default : $result = \"Unable to be determined\"; break;\n }\n }\n return $result;\n }",
"function getStatusString() {\n\t\tswitch ($this->getData('status')) {\n\t\t\tcase THESIS_STATUS_INACTIVE:\n\t\t\t\treturn 'plugins.generic.thesis.manager.status.inactive';\n\t\t\tcase THESIS_STATUS_ACTIVE:\n\t\t\t\treturn 'plugins.generic.thesis.manager.status.active';\n\t\t\tdefault:\n\t\t\t\treturn 'plugins.generic.thesis.manager.status';\n\t\t}\n\t}",
"public function marital_status($data){\n\t\tif($data == '1'){ \n\t\t\t$text = \"Single\";\n\t\t}elseif($data == '2'){ \n\t\t\t$text = \"Married\";\n\t\t}elseif($data == '3'){ \n\t\t\t$text = \"Separated\";\n\t\t}\n\t\treturn $text;\n }",
"function status($state=\"1\"){\n\t\t\t\tswitch($state){\n\t\t\t\t\t\tcase 0:\n\t\t\t\t\t\t\treturn \"Inactive\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\tcase 1:\n\t\t\t\t\t\t\treturn \"Active\";\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t}",
"static function level_to_string($level){\r\n\t\tswitch($level){\r\n\t\t\tcase Message::SUCCESS:\r\n\t\t\t\t$result = \"success\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase Message::NOTICE:\r\n\t\t\t\t$result = \"notice\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase Message::INFO:\r\n\t\t\t\t$result = \"info\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase Message::NAG;\r\n\t\t\t\t$result = \"nag\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase Message::WARNING:\r\n\t\t\t\t$result = \"warning\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase Message::ERROR;\r\n\t\t\t\t$result = \"error\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase Message::SEVERE;\r\n\t\t\t\t// No break\r\n\t\t\tdefault:\r\n\t\t\t\t$result = \"severe\";\r\n\t\t}\r\n\t\treturn $result;\r\n\t}",
"function GetStatus() {\n if ($this->buttons['lunch_end']) {\n return \"Out to lunch.\";\n }\n if ($this->buttons['work_start']) {\n return \"Not working.\";\n }\n else {\n return \"Working.\";\n }\n }",
"private function getDefaultStatus(): string\n {\n return InviteStatus::pending()->value;\n }",
"public function getStatusString()\r\n {\r\n return $GLOBALS['TICKETSTATUS_DESC'][$this->status];\r\n }",
"function getMessage($i){\n $options = array('My Skillset', 'Projects I have done', 'Past Work Places');\n switch($i){\n case 0:\n $msg = $options[0];\n break;\n case 1;\n $msg = $options[1];\n break;\n case 2:\n $msg = $options[2];\n break;\n default:\n \n break; \n }\n return $msg;\n }",
"function state_to_name($state) {\n\t\n\tswitch ($state) {\n\t \tcase 'water_demand': \t\t\treturn \"Water demand\"; \n\t\tcase 'water_supply': \t\t\treturn \"Water supply\";\n\t\tcase 'water_price': \t\t\treturn \"Water price\";\n\t\tcase 'water_quality': \t\t\treturn \"Water quality\";\n\t\tcase 'political_popularity': \treturn \"Political popularity\";\n\t\tcase 'lake_quality': \t\t\treturn \"Quality of the water in the lake\";\n\t\tcase 'env_awareness': \t\t\treturn \"Environmental awareness\";\n\t\t}\n}",
"function show_status($getStatus,$getDetail) {\r\n\tglobal $gp_arr_status;\r\n\t\r\n\tif($getDetail==\"item\"){\r\n\t\tswitch($getStatus){\r\n\t\t\tcase 0: $tmpString=$gp_arr_status[0];break;\r\n\t\t\tcase 1: $tmpString='<span class=\"body_good\">'.$gp_arr_status[1].'</span>';break;\r\n\t\t\tcase 2: $tmpString='<span class=\"body_error\">'.$gp_arr_status[2].'</span>';break;\r\n\t\t}\r\n\t}else{\r\n\t\tswitch($getStatus){\r\n\t\t\tcase 0: $tmpString='<span class=\"body_error\">Hidden</span>';break;\r\n\t\t\tcase 1: $tmpString='<span class=\"body_good\">LIVE</span>';break;\r\n\t\t}\r\n\t}\r\n\t\r\n\treturn $tmpString;\r\n}",
"public function displayReason() {\n switch ($this->reason) { //Reasons should only hold an int 0-4\n case 0:\n return \"Invalid\";\n case 1:\n return \"Recommend\";\n case 2:\n return \"Criticism\";\n case 3:\n return \"Question\";\n case 4:\n return \"Other\";\n }\n }",
"public function billing_status($type){\n\t\tif($type == 'A' || $type == 'A,A'){\n\t\t\t$st = 'Approved';\n\t\t}else if($type == 'W' || $type == 'W,W' || $type == 'A,W'){\t\n\t \t\t$st = 'Pending';\n\t\t}else if($type == 'R' || $type == 'A,R'){\t\n\t \t\t$st = 'Rejected';\n\t\t}\n\t\treturn $st;\n\t}",
"public function getStatusLable()\n {\n $status = __('Cancel');\n if ($this->status == 'process')\n $status = __('Process');\n elseif ($this->status == 'done')\n $status = __('Done');\n\n return $status;\n }",
"function get_statusname($ret_num){\r\n\tglobal $gp_arr_status;\t\r\n\r\n\tif(!empty($gp_arr_status)){\r\n\t\treturn $gp_arr_status[$ret_num];\r\n\t}else{\r\n\t\tglobal $db_shared;\r\n\t\t$status_query\t= \"SELECT * FROM $db_shared.catalogue_status WHERE id=$ret_num LIMIT 1\";\r\n\t\t$status_result\t= mysql_query($status_query);\r\n\t\t$status_array\t= mysql_fetch_array($status_result);\t\r\n\t\treturn $status_array['status'];\r\n\t}\r\n}",
"function getResponseDescription($responseCode) {\n\n switch ($responseCode) {\n case \"0\" : $result = \"Transaction Successful\"; break;\n case \"?\" : $result = \"Transaction status is unknown\"; break;\n case \"1\" : $result = \"Unknown Error\"; break;\n case \"2\" : $result = \"Bank Declined Transaction\"; break;\n case \"3\" : $result = \"No Reply from Bank\"; break;\n case \"4\" : $result = \"Expired Card\"; break;\n case \"5\" : $result = \"Insufficient funds\"; break;\n case \"6\" : $result = \"Error Communicating with Bank\"; break;\n case \"7\" : $result = \"Payment Server System Error\"; break;\n case \"8\" : $result = \"Transaction Type Not Supported\"; break;\n case \"9\" : $result = \"Bank declined transaction (Do not contact Bank)\"; break;\n case \"A\" : $result = \"Transaction Aborted\"; break;\n case \"C\" : $result = \"Transaction Cancelled\"; break;\n case \"D\" : $result = \"Deferred transaction has been received and is awaiting processing\"; break;\n case \"F\" : $result = \"3D Secure Authentication failed\"; break;\n case \"I\" : $result = \"Card Security Code verification failed\"; break;\n case \"L\" : $result = \"Shopping Transaction Locked (Please try the transaction again later)\"; break;\n case \"N\" : $result = \"Cardholder is not enrolled in Authentication scheme\"; break;\n case \"P\" : $result = \"Transaction has been received by the Payment Adaptor and is being processed\"; break;\n case \"R\" : $result = \"Transaction was not processed - Reached limit of retry attempts allowed\"; break;\n case \"S\" : $result = \"Duplicate SessionID (OrderInfo)\"; break;\n case \"T\" : $result = \"Address Verification Failed\"; break;\n case \"U\" : $result = \"Card Security Code Failed\"; break;\n case \"V\" : $result = \"Address Verification and Card Security Code Failed\"; break;\n default : $result = \"Unable to be determined\";\n }\n return $result;\n }",
"private function status_to_string($value) {\n if ($value == 0) {\n $status = \"Inactive\";\n } else if ($value == 1) {\n $status = \"Active\";\n }\n return $status;\n }",
"function statusToString($status = null) {\n\t\tif(!is_null($status)) {\n\t\t\t$all_status = array(\n\t\t\t\t0 => 'Unknown',\n\t\t\t\t1 => 'Delivered',\n\t\t\t\t2 => 'Failed',\n\t\t\t\t4 => 'Buffered',\n\t\t\t\t8 => 'Submitted to SMSC',\n\t\t\t\t16 => 'Failed at SMSC',\n\t\t\t\t32 => 'Intermediary update'\n\t\t\t);\n\t\t\t\n\t\t\t$status = (int)$status;\n\t\t\t\n\t\t\tif(isset($all_status[$status])) {\n\t\t\t\treturn $all_status[$status];\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\treturn \"Unknown\";\n\t}",
"public function resource_type() {\n switch($this->statusable_type_plain()) {\n case \"shorthaulhelicopter\":\n return \"Short Haul\";\n break;\n case \"crew\":\n return \"Hotshots\";\n break;\n case \"rappelhelicopter\":\n return \"Rappel\";\n break;\n case \"smokejumperairplane\":\n return \"Smokejumpers\";\n break;\n default:\n return \"Unknown\";\n break;\n }\n }",
"function listStatus($con, $def_status)\n\t{\n\t\tswitch ($def_status) \n\t\t{\n\t\t\tcase 0:\n\t\t\t\t$statusText = \"Inactive/Archived\";\n\t\t\t\tbreak;\n\t\t\tcase 1: \n\t\t\t\t$statusText = \"Active\";\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t$statusText = \"Pending\";\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$statusText = \"Undetermined\";\n\t\t\t\tbreak;\n\t\t}\n\n\t\treturn $statusText;\n\t}",
"function spectra_money_supply ()\n\t{\n\t\tif (system_flag_get (\"balance_rebuild\") > 0)\n\t\t{\n\t\t\treturn \"Re-Balancing\";\n\t\t}\n\t\t\n\t\t$response = $GLOBALS[\"db\"][\"obj\"]->query (\"SELECT SUM(`balance`) AS `supply` FROM `\".$GLOBALS[\"tables\"][\"ledger\"].\"`\");\n\t\t$result = $response->fetch_assoc ();\n\t\t\n\t\tif (!isset ($result[\"supply\"]))\n\t\t{\n\t\t\treturn \"Unavailable\";\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\treturn $result[\"supply\"];\n\t\t}\n\t}",
"function getResponseMsg()\n {\n $msg = array('START' => 'Enter a product name:',\n 'NO_ITEMS' => 'There are no such items available.',\n 'INVALID_Q' => 'The query must contain only letters and digits (3 through 30).',\n 'DONE' => '{NUM} items from \"{NAME}\" fetched.');\n\n if (self::$current_state == 'DONE'){\n $msg[self::$current_state] = str_replace('{NAME}', self::$items_name, $msg[self::$current_state]);\n $msg[self::$current_state] = str_replace('{NUM}', self::$items_number, $msg[self::$current_state]);\n }\n return $msg[self::$current_state];\n }",
"function statusBinario($statusB)\n{\n\tif ($statusB == 1) return \"Aktiv\";\n\telse return \"Inaktiv\";\n}",
"public function get_notice($val){\n\t\tswitch($val){\n\t\t\tcase '0':\n\t\t\t$value = 'Immediate';\n\t\t\tbreak;\n\t\t\tcase '15':\n\t\t\t$value = '15 Days';\n\t\t\tbreak;\n\t\t\tcase '30':\n\t\t\t$value = '30 Days';\n\t\t\tbreak;\n\t\t\tcase '45':\n\t\t\t$value = '45 Days';\n\t\t\tbreak;\n\t\t\tcase '60':\n\t\t\t$value = '2 Months';\n\t\t\tbreak;\n\t\t\tcase '90':\n\t\t\t$value = '3 Months';\n\t\t\tbreak;\n\t\t\tcase '120':\n\t\t\t$value = '4 Months';\n\t\t\tbreak;\n\t\t\tcase '150':\n\t\t\t$value = '5 Months';\n\t\t\tbreak;\n\t\t\tcase '180':\n\t\t\t$value = '6 Months';\n\t\t\tbreak;\n\t\t\t\n\t\t}\n\t\treturn $value;\n }",
"public function getStatusColorText()\n {\n $status = $this->status;\n $list = self::getStatusOption();\n\n $color = 'default';\n if ($status == self::STATUS_NEW) {\n $color = 'info';\n }\n if ($status == self::STATUS_USED) {\n $color = 'default';\n }\n if ($status == self::STATUS_DONE) {\n $color = 'primary';\n }\n if ($status == self::STATUS_UNCONFIRMED) {\n $color = 'warning';\n }\n\n if (!empty($status) && in_array($status, array_keys($list))) {\n return '<span class=\"label label-' . $color . '\">' . $list[$status] . '</span>';\n }\n return '<span class=\"label label-' . $color . '\">' . Yii::$app->getModule('billing')->t('Unknown') . '</span>';\n }",
"public function printStatus()\n {\n switch ($this->status) {\n case $this::STATUS_INACTIVE:\n return \\Yii::t('app', 'Inactive');\n break;\n case $this::STATUS_ACTIVE_LOCKED:\n return \\Yii::t('app', 'Locked');\n break;\n case $this::STATUS_ACTIVE_UNLOCKED:\n return \\Yii::t('app', 'Unlocked');\n break;\n }\n\n return \\Yii::t('app', 'Unknown status');\n }",
"function printCodRolToText($cod_rol)\n{\n switch ($cod_rol) {\n case '1':\n echo'Superadministrador';\n break;\n case '2':\n echo'Técnico';\n break;\n case '3':\n echo'Administrativo';\n break;\n case '4':\n echo'Usuario';\n break;\n default:\n echo'<span class=\"label label-warning\">No seleccionado</span>';\n break;\n }\n}",
"public function getStatus()\n\t{\n\t\t$textos = array('Creado','Enviado','Aprobado');\n\t\treturn $textos[$this->status]; \n\t}",
"public function status($status)\n {\n if ($status == 16) {\n return \"<span class='badge badge-warning'>Order Placed</span>\";\n }\n\n if ($status == 3) {\n return \"<span class='badge badge-danger'>Canceled</span>\";\n }\n\n if ($status == 2) {\n return \"<span class='badge badge-warning'>Pending</span>\";\n }\n\n if ($status == 17) {\n return \"<span class='badge badge-danger'>Delivered</span>\";\n }\n\n return \"<span class='badge badge-danger'>Something Wrong</span>\";\n \n }",
"public static function getStatusMessage()\n {\n switch(self::status())\n {\n case 'PLEXCEL_NO_CREDS':\n return \"no creds\";\n break;\n case 'PLEXCEL_PRINCIPAL_UNKNOW':\n return \"principal unknow\";\n break;\n case 'PLEXCEL_LOGON_FAILED':\n return \"logon failed\";\n break;\n default:\n return \"error :\".self::status();\n }\n }",
"public function getStatus()\n {\n switch ($this->temp) {\n case 0:\n return \"Définitif\";\n case 1:\n return \"Valide\";\n default:\n return \"Temporaire\";\n }\n }",
"function dokan_get_post_status( $status ) {\n switch ($status) {\n case 'publish':\n return __( 'Online', 'dokan' );\n break;\n\n case 'draft':\n return __( 'Draft', 'dokan' );\n break;\n\n case 'pending':\n return __( 'Pending Review', 'dokan' );\n break;\n\n case 'future':\n return __( 'Scheduled', 'dokan' );\n break;\n\n default:\n return '';\n break;\n }\n}",
"public function getStatus()\n {\n return 'OK';\n }",
"function atkActionStatus($status)\n{\n\tswitch ($status)\n\t{\n\t\tcase ACTION_CANCELLED: return \"cancelled\";\n\t\tcase ACTION_FAILED: return \"failed\";\n\t\tcase ACTION_SUCCESS: return \"success\";\n\t}\n}",
"function Atv_convApproveCodeToString($approve): string\n{\n return $approve == '7' ? 'Sudah' : 'Belum';\n}",
"public function getStatus(): UnitEnum|string;",
"public function getStatusList()\n {\n return ['0' => __('修改'), '1' => __('提议'), '2' => __('新增'), '3' => __('废止')];\n }",
"function getStatus($type = \"playback\"){\n\t\tglobal $jbArr;\n\t\t\n\t\treturn \"\";\n\t}",
"function convertResolutionStatus($status) {\n switch ($status) {\n case 'pending':\n return 'Pending';\n break;\n case 'passed':\n return 'Passed';\n break;\n case 'failed':\n return 'Failed';\n break;\n case 'in_session':\n return 'In Session';\n break;\n case 'shelved':\n return 'Shelved';\n break;\n }\n}",
"function writestatesnow($state)\n{\n switch ($state){\n case 1:\n return \"Neuf\";\n break;\n case 2:\n return \"Bon\";\n break;\n case 3:\n return \"Usagé\";\n break;\n case 4:\n return \"Mort\";\n break;\n }\n\n}",
"public function imprimeDisponibilidade():string{\n return $retVal = ($this->disponibilidade) ? \"Disponível\" : \"Ocupado\" ;\n }",
"abstract protected function getRequirement(): string;",
"public function display_eligibility_type($type){\n\t\tif($type == 'PI'){\n\t\t\t$st = 'Profile Shortlisting';\n\t\t}else if($type == 'PS'){\t\n\t \t\t$st = 'Profile Sending';\n\t\t}else if($type == 'PC'){\n\t\t\t$st = 'Position Closing';\n\t\t}\n\t\treturn $st;\n\t}",
"public function getStatus()\n {\n if (Quform::isNonEmptyString($this->getKey())) {\n return 'valid';\n } else if (apply_filters('quform_is_bundled', false)) {\n return 'bundled';\n }\n\n return 'unlicensed';\n }",
"public function display_billing_status($status){\n\t\tif($status == 'W' || $status == 'R'){\n\t\t\t$st = 'L1 - P';\n\t\t}elseif($status == 'A'){\t\n\t \t\t$st = 'L1 - A';\n\t\t}\n\t\treturn $st;\n\t}",
"public function getStatusLabel()\n {\n return $this->status === 10 ? 'Active' : 'Inactive';\n }",
"function getSpecialMessage() {\r\n global $gender, $maritalStatus, $age, $specialMessage;\r\n\r\n $specialMessage = 'Let us figure out how to make your insurance affordable.';\r\n if(isset($maritalStatus, $gender, $age)){\r\n\r\n if('married' != $maritalStatus) {\r\n $specialMessage = 'We have calculated you can save on your life insurance by getting married.';\r\n } elseif('male' == $gender) {\r\n $specialMessage = 'Becoming female will lower your life insurance rates.';\r\n\r\n } elseif ($age > 50){\r\n\r\n $specialMessage = 'We have determined your life insurance will only get more expensive from here';\r\n } else {\r\n $specialMessage = 'Your life insurance is as cheap as it can be. Congratulations!';\r\n }\r\n\r\n }\r\n\r\n return $specialMessage;\r\n }",
"function translate_type_to_name($opt_type) {\n global $products_options_types_list;\n return $products_options_types_list[$opt_type];\n return 'Error ' . $opt_type;\n}",
"protected function getAvailability(Mage_Catalog_Model_Product $product){\n if ($product->getData('use_config_manage_stock') == 1) {\n if (Mage::getStoreConfig(Mage_CatalogInventory_Model_Stock_Item::XML_PATH_ITEM . 'manage_stock') == 0) {\n return 'in stock';\n }\n } else if ($product->getData('manage_stock') == 0) {\n return 'in stock';\n }\n\n if ($product->getData('is_in_stock') == 1) {\n return 'in stock';\n } else if ($product->getData('backorders') == 0) {\n return 'out of stock';\n }\n return 'available for order';\n }",
"public function getHandName($playerHand){\n $result = 'Scissor';\n\n if($playerHand == 1){\n $result = 'Rock';\n }elseif($playerHand == 2) {\n $result = 'Paper';\n }\n return $result;\n\n}",
"function decorate_status($status) {\n\t\t\tswitch (strtolower($status)){\n\t\t\t\t\t\t\tcase 'completed':\n\t\t\t\t\t\t\t\t$status = \"<span class='label label-success'>$status</span>\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase 'on hold':\n\t\t\t\t\t\t\t\t$status = \"<span class='label label-warning'>$status</span>\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase 'expired':\n\t\t\t\t\t\t\tcase 'overdue':\n\t\t\t\t\t\t\t\t$status = \"<span class='label label-danger'>$status</span>\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\tcase 'pending':\n\t\t\t\t\t\t\t\t$status = \"<span class='label label-default'>$status</span>\";\n\t\t\t\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\treturn $status;\n}",
"function get_status_header_desc($code) {\n\t$codes_to_desc = array(\n\t\t\t100 => 'Continue',\n\t\t\t101 => 'Switching Protocols',\n\t\t\t102 => 'Processing',\n\n\t\t\t200 => 'OK',\n\t\t\t201 => 'Created',\n\t\t\t202 => 'Accepted',\n\t\t\t203 => 'Non-Authoritative Information',\n\t\t\t204 => 'No Content',\n\t\t\t205 => 'Reset Content',\n\t\t\t206 => 'Partial Content',\n\t\t\t207 => 'Multi-Status',\n\t\t\t226 => 'IM Used',\n\n\t\t\t300 => 'Multiple Choices',\n\t\t\t301 => 'Moved Permanently',\n\t\t\t302 => 'Found',\n\t\t\t303 => 'See Other',\n\t\t\t304 => 'Not Modified',\n\t\t\t305 => 'Use Proxy',\n\t\t\t306 => 'Reserved',\n\t\t\t307 => 'Temporary Redirect',\n\n\t\t\t400 => 'Bad Request',\n\t\t\t401 => 'Unauthorized',\n\t\t\t402 => 'Payment Required',\n\t\t\t403 => 'Forbidden',\n\t\t\t404 => 'Not Found',\n\t\t\t405 => 'Method Not Allowed',\n\t\t\t406 => 'Not Acceptable',\n\t\t\t407 => 'Proxy Authentication Required',\n\t\t\t408 => 'Request Timeout',\n\t\t\t409 => 'Conflict',\n\t\t\t410 => 'Gone',\n\t\t\t411 => 'Length Required',\n\t\t\t412 => 'Precondition Failed',\n\t\t\t413 => 'Request Entity Too Large',\n\t\t\t414 => 'Request-URI Too Long',\n\t\t\t415 => 'Unsupported Media Type',\n\t\t\t416 => 'Requested Range Not Satisfiable',\n\t\t\t417 => 'Expectation Failed',\n\t\t\t422 => 'Unprocessable Entity',\n\t\t\t423 => 'Locked',\n\t\t\t424 => 'Failed Dependency',\n\t\t\t426 => 'Upgrade Required',\n\n\t\t\t500 => 'Internal Server Error',\n\t\t\t501 => 'Not Implemented',\n\t\t\t502 => 'Bad Gateway',\n\t\t\t503 => 'Service Unavailable',\n\t\t\t504 => 'Gateway Timeout',\n\t\t\t505 => 'HTTP Version Not Supported',\n\t\t\t506 => 'Variant Also Negotiates',\n\t\t\t507 => 'Insufficient Storage',\n\t\t\t510 => 'Not Extended'\n\t);\n\t\n\tif(check_value($codes_to_desc[$code])) {\n\t\treturn $codes_to_desc[$code];\t\n\t}\n\t\n}",
"function _getStatusMessage(){\n $status = array(\n 200 => 'Ok' ,\n 201 => 'Created' ,\n 202 => 'deleted' ,\n 204 => 'No Content' ,\n 400 => 'Bad Request',\n 404 => 'Not Found' ,\n 405 => 'Not Allowed' ,\n 406 => 'Not Acceptable',\n\n );\n return ($status[$this->CodeHTTP] ? $status[$this->CodeHTTP] : $status[500]);\n }",
"public function get_status_cond($st){\n\t\tswitch($st){\n\t\t\tcase '1':\n\t\t\t$cond = \"Scheduled\";\n\t\t\tbreak;\n\t\t\tcase '2':\n\t\t\t$cond = \"Re-Scheduled\";\n\t\t\tbreak;\n\t\t\tcase '3':\n\t\t\t$cond = \"OnHold\";\n\t\t\tbreak;\n\t\t\tcase '4':\n\t\t\t$cond = \"Shortlisted\";\n\t\t\tbreak;\n\t\t\tcase '5':\n\t\t\t$cond = \"Cancelled\";\n\t\t\tbreak;\n\t\t\tcase '6':\n\t\t\t$cond = \"Rejected\";\n\t\t\tbreak;\t\t\t\n\t\t}\n\t\treturn $cond;\n\t}",
"private function getStatus($label) {\r\n\t\tif ($label == 'homepage') {\r\n\t\t\t$status = ' disabled';\r\n\t\t} elseif ($label == 'charts' || $label == 'lists' || $label == 'calendar') {\r\n\t\t\t$status = ' menu-extended';\r\n\t\t} elseif ($label == 'reports') {\r\n\t\t\t$status = ' menu-extended menu-reports';\r\n\t\t} elseif ($label == 'compact') {\r\n\t\t\t$status = ' menu-compact';\r\n\t\t} elseif ($label == 'media') {\r\n\t\t\t$status = ' menu-media';\r\n\t\t} else {\r\n\t\t\t$status = '';\r\n\t\t}\r\n\t\treturn $status;\r\n\t}",
"function GetPacket($GetPacket)\n{\n\tif ($GetPacket == 1) return \"Bronspaket\";\n\tif ($GetPacket == 2) return \"Silverpaket\";\n\tif ($GetPacket == 3) return \"Guldpaket\";\n\tif ($GetPacket == 4) return \"VIP-paket\";\n\tif ($GetPacket > 4) return \"VIP PLUS\";\n}",
"public function getStatus() : string;",
"function switch_status($status_id)\n {\n switch($status_id)\n {\n case 0:\n return \"En cours\";\n case 1:\n return \"En attente\";\n case 2:\n return \"Terminé\";\n case 3:\n return \"Abandonné\";\n default:\n return \"¯\\_(ツ)_/¯\";\n }\n }",
"function printCommittee($difficulty)\n{\n if ($difficulty == 0) return 'Beginner';\n if ($difficulty == 1) return 'Intermediate';\n else return 'Advanced';\n}",
"public function LitStatus(): ?String\n {\n if($this->bulbs->count() == 0){\n return null;\n }\n $seenOn = $seenOff = false;\n foreach($this->bulbs as $bulb){\n $on = $bulb->isLit();\n $seenOn = $seenOn || $on;\n $seenOff = $seenOff || !$on;\n if($seenOn && $seenOff){\n return \"inconsistent\";\n }\n }\n return $seenOn ? \"lit\" : \"extinguished\";\n }",
"public function getStatusDescription($status = 0){\r\n\t\t$retval=\"gray.gif\";\r\n\t\t\r\n\t\tif($status == 0){\r\n\t\t\t$status = $this->status;\r\n\t\t}\r\n\t\t\r\n\t\tswitch ($status) {\r\n\t\t\tcase 1: $retval = \"Angelegt\";break;\r\n\t\t\tcase 2: $retval = \"Gesendet u. Bestellt\";break;\r\n\t\t\tcase 3: $retval = \"In Bearbeitung\";break;\r\n\t\t\tcase 4: $retval = \"Fertig u. im Versand\";break;\r\n\t\t\tcase 5: $retval = \"Fertig u. Abholbereit\";break;\r\n\t\t\tdefault: $retval=\"...\";\r\n\t\t}\r\n\t\treturn $retval;\r\n\t}",
"public static function getStatus($no)\n {\n $str = null;\n switch($no) {\n case self::STATUS_ACTIVE:\n $str = 'active';\n break;\n case self::STATUS_INACTIVE:\n $str = 'inactive';\n break;\n case self::STATUS_BANNED:\n $str = 'banned';\n break;\n }\n\n return $str;\n }",
"static function translator($type){\n if ( $type == ActionType::PAGE_CALL )\n return 'Page Call';\n if ( $type == ActionType::ERROR )\n return 'Error';\n if ( $type == ActionType::NOT_ALLOWED )\n return 'requested resource ist not allowed for this user';\n }",
"protected static function generateStatus()\n {\n // hanging 70%\n // lay 20%\n // decayed 10%\n $random = rand(0, 9);\n \n if($random < 7) {\n $status = APPLE_HANGING;\n } elseif($random < 9) {\n $status = APPLE_LAY;\n } else {\n $status = APPLE_DECAYED;\n }\n\n return $status;\n }",
"private function getStatusMessage(){\n\t\t$status = array(\n\t\t\t\t100 => 'Continue', \n\t\t\t\t101 => 'Switching Protocols', \n\t\t\t\t200 => 'OK',\n\t\t\t\t201 => 'Created', \n\t\t\t\t202 => 'Accepted', \n\t\t\t\t203 => 'Non-Authoritative Information', \n\t\t\t\t204 => 'No Content', \n\t\t\t\t205 => 'Reset Content', \n\t\t\t\t206 => 'Partial Content', \n\t\t\t\t300 => 'Multiple Choices', \n\t\t\t\t301 => 'Moved Permanently', \n\t\t\t\t302 => 'Found', \n\t\t\t\t303 => 'See Other', \n\t\t\t\t304 => 'Not Modified', \n\t\t\t\t305 => 'Use Proxy', \n\t\t\t\t306 => '(Unused)', \n\t\t\t\t307 => 'Temporary Redirect', \n\t\t\t\t400 => 'Bad Request', \n\t\t\t\t401 => 'Unauthorized', \n\t\t\t\t402 => 'Payment Required', \n\t\t\t\t403 => 'Forbidden', \n\t\t\t\t404 => 'Not Found', \n\t\t\t\t405 => 'Method Not Allowed', \n\t\t\t\t406 => 'Not Acceptable', \n\t\t\t\t407 => 'Proxy Authentication Required', \n\t\t\t\t408 => 'Request Timeout', \n\t\t\t\t409 => 'Conflict', \n\t\t\t\t410 => 'Gone', \n\t\t\t\t411 => 'Length Required', \n\t\t\t\t412 => 'Precondition Failed', \n\t\t\t\t413 => 'Request Entity Too Large', \n\t\t\t\t414 => 'Request-URI Too Long', \n\t\t\t\t415 => 'Unsupported Media Type', \n\t\t\t\t416 => 'Requested Range Not Satisfiable', \n\t\t\t\t417 => 'Expectation Failed', \n\t\t\t\t500 => 'Internal Server Error', \n\t\t\t\t501 => 'Not Implemented', \n\t\t\t\t502 => 'Bad Gateway', \n\t\t\t\t503 => 'Service Unavailable', \n\t\t\t\t504 => 'Gateway Timeout', \n\t\t\t\t505 => 'HTTP Version Not Supported');\n\t\treturn ($status[$this->_code]) ? $status[$this->_code] : $status[500];\n\t}",
"public function stock()\n {\n if($this->quantity <= 5)\n {\n return \"Low Stock\";\n }\n\n return \"In Stock\";\n\n }",
"function memberStatusValue($k, $value)\r\n{\r\n if($k == 'ROLE')\r\n {\r\n if($value == 0)\r\n {\r\n return \"<td class='align-middle'>MEMBRE</td>\";\r\n }\r\n else\r\n {\r\n return \"<td class='align-middle bg-info text-white'>ADMIN</td>\";\r\n }\r\n }\r\n}",
"public function getFormattedStatus(): string;",
"public function getEnumStatusSupply(){\n return ['WAITING','IN PROGRESS','CANCELED','COMPLETED'];\n }",
"public function getCarStatus(){\r\n\t\tif($this->getCarStatusInterval()<=30){\r\n\t\t\tif($this->getCarStatusValue()==0){\r\n\t\t\t\treturn '';\t\t\r\n\t\t\t}\r\n\t\t\telseif($this->getCarStatusValue()==1){\r\n\t\t\t\treturn '<div class=\"alert_new\"><img src=\"'.HTTP_DOMAIN.'images/layout/status_new.png\"/></div>';\t\t\r\n\t\t\t}\r\n\t\t\telseif($this->getCarStatusValue()==2){\r\n\t\t\t\treturn '<div class=\"alert_new\"><img src=\"'.HTTP_DOMAIN.'images/layout/status_sold.png\"/></div>';\t\t\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"function get_availability() {\n\t\n\t\t$availability = \"\";\n\t\t$class = \"\";\n\t\t\n\t\tif (!$this->managing_stock()) :\n\t\t\tif ($this->is_in_stock()) :\n\t\t\t\t//$availability = __('In stock', 'woothemes'); /* Lets not bother showing stock if its not managed and is available */\n\t\t\telse :\n\t\t\t\t$availability = __('Out of stock', 'woothemes');\n\t\t\t\t$class = 'out-of-stock';\n\t\t\tendif;\n\t\telse :\n\t\t\tif ($this->is_in_stock()) :\n\t\t\t\tif ($this->stock > 0) :\n\t\t\t\t\t$availability = __('In stock', 'woothemes');\n\t\t\t\t\t\n\t\t\t\t\tif ($this->backorders_allowed()) :\n\t\t\t\t\t\tif ($this->backorders_require_notification()) :\n\t\t\t\t\t\t\t$availability .= ' – '.$this->stock.' ';\n\t\t\t\t\t\t\t$availability .= __('available', 'woothemes');\n\t\t\t\t\t\t\t$availability .= __(' (backorders allowed)', 'woothemes');\n\t\t\t\t\t\tendif;\n\t\t\t\t\telse :\n\t\t\t\t\t\t$availability .= ' – '.$this->stock.' ';\n\t\t\t\t\t\t$availability .= __('available', 'woothemes');\n\t\t\t\t\tendif;\n\t\t\t\t\t\n\t\t\t\telse :\n\t\t\t\t\t\n\t\t\t\t\tif ($this->backorders_allowed()) :\n\t\t\t\t\t\tif ($this->backorders_require_notification()) :\n\t\t\t\t\t\t\t$availability = __('Available on backorder', 'woothemes');\n\t\t\t\t\t\telse :\n\t\t\t\t\t\t\t$availability = __('In stock', 'woothemes');\n\t\t\t\t\t\tendif;\n\t\t\t\t\telse :\n\t\t\t\t\t\t$availability = __('Out of stock', 'woothemes');\n\t\t\t\t\t\t$class = 'out-of-stock';\n\t\t\t\t\tendif;\n\t\t\t\t\t\n\t\t\t\tendif;\n\t\t\telse :\n\t\t\t\tif ($this->backorders_allowed()) :\n\t\t\t\t\t$availability = __('Available on backorder', 'woothemes');\n\t\t\t\telse :\n\t\t\t\t\t$availability = __('Out of stock', 'woothemes');\n\t\t\t\t\t$class = 'out-of-stock';\n\t\t\t\tendif;\n\t\t\tendif;\n\t\tendif;\n\t\t\n\t\treturn array( 'availability' => $availability, 'class' => $class);\n\t}",
"public function status()\n {\n $statuses = collect([\n \"1\" => \"secondary\",\n \"2\" => \"success\",\n \"3\" => \"info\",\n \"4\" => \"warning\",\n \"5\" => \"danger\",\n ]);\n\n $group = substr($this->code, 0, 1);\n\n return $statuses->get($group, \"warning\");\n }",
"public static function status()\n {\n return [\n 'ati' => 'Ativo',\n 'ina' => 'Inativo'\n ];\n }",
"public static function getLekabStatusDesc($code)\n {\n switch (intval($code)) {\n case 0:\n return \"Queued for delivery\";\n case 1:\n return \"Sent to operator\";\n case 2:\n return \"Delivered to the mobile station\";\n case 3:\n return \"The message was deleted\";\n case 4:\n return \"The message has expired\";\n case 5:\n return \"The message was rejected by the operator\";\n case 6:\n return \"The message could not be delivered\";\n case 7:\n return \"The message was accepted by the operator\";\n case 8:\n return \"The subscribers mobile station is switched off\";\n case 9:\n return \"The subscriber is not known\";\n case 10:\n return \"The destination address is invalid\";\n case 11:\n return \"The mobile station can not receive the message\";\n case 12:\n return \"The status of the message is unknown\";\n case 13:\n return \"Internal error when sending the message\";\n default:\n return \"(UNKNOWN CODE?)\";\n }\n }",
"public function getStatusString()\n {\n return $this->statuses[$this->statusId];\n }",
"function getRCCAStatus()\n{\n\t$RCCAResult[0] = \"Awaiting spawner recommendation\";\n\t$RCCAResult[1] = \"Awaiting or being reviewed by QAT\";\n\t$RCCAResult[2] = \"Awaiting initial review by PLL owner\";\n\t$RCCAResult[3] = \"Corrective Action(s) being defined (by PLL owner)\";\n\t\n\treturn $RCCAResult;\n}",
"function statusCaption($status) {\n\t\tswitch($status) {\n\t\t\tcase KontakteData::$STATUS_ADMIN: return \"Administrator\";\n\t\t\tcase KontakteData::$STATUS_MEMBER: return \"Mitglied\";\n\t\t\tcase KontakteData::$STATUS_EXTERNAL: return \"Externer Mitspieler\";\n\t\t\tcase KontakteData::$STATUS_APPLICANT: return \"Bewerber\";\n\t\t\tdefault: return \"Sonstiger Kontakt\";\n\t\t}\n\t}",
"public function getStatus($type = 'short') {\n /*\n * if ($this->courseObjectFulfillment->isComplete()) {\n * // do other messages?\n * }\n * else {\n * if ($type == 'short') {\n * return \"Not viewed\";\n * }\n *\n * if ($type == 'long') {\n * return \"You have not viewed $title\";\n * }\n * }\n */\n }",
"public function getStatusDescription($value)\n {\n $status = $this->getEveryStatus();\n\n if (isset($status[$value])) {\n return $status[$value];\n }\n\n return $status['D'];\n }",
"public function message()\n {\n return 'Stock is limited';\n }",
"private function getHostStatus(): string\n {\n return ($this->statistics['packet_loss'] < 100) ? 'Ok' : 'Unreachable';\n }",
"function publicationsSite($site)\n{\n\tif ($site == 1) return \"Important\"; \n\tif ($site == 2) return \"Publication\";\n\tif ($site == 3) return \"Releases\";\n\tif ($site == 4) return \"Info\";\n}",
"function display_format($var) {\n\tswitch($var) {\n\n\tcase \"sticker\":\t\treturn \"Sticker #\";\n\tcase \"type\":\t\treturn \"Type\";\n\tcase \"description\":\treturn \"Description\";\n\tcase \"serial\":\t\treturn \"Serial\";\n\tcase \"purchasedate\":\treturn \"Purchase Date\";\n\tcase \"temp_assignment\":\treturn \"Assignment\";\n\tcase \"computernumber\":\treturn \"Number\";\n\tcase \"videocard\":\treturn \"Video Card\";\n\tcase \"videobus\":\treturn \"Bus Type\";\n\tcase \"cpu\":\t\treturn \"CPU Type\";\n\tcase \"harddrive\":\treturn \"Hard Drive\";\n\tcase \"memory\":\t\treturn \"Memory\";\n\tcase \"servicetag\":\treturn \"Dell Tag\";\n\tcase \"batch\":\t\treturn \"Batch\";\n\tcase \"expresscode\":\treturn \"Express Code\";\n\tcase \"warranty\":\treturn \"Warranty\";\n\tcase \"mayadongle\":\treturn \"Maya Dongle\";\n\tcase \"firstname\":\treturn \"First Name\";\n\tcase \"lastname\":\treturn \"Last Name\";\n\tcase \"department\":\treturn \"Department\";\n\tcase \"extension\":\treturn \"Extension\";\n\tcase \"status\":\t\treturn \"Status\";\n\tcase \"user_status\":\treturn \"Status\";\n\tcase \"active\":\t\treturn \"Active\";\n\t\t\n\tdefault: return \"NOT FORMATTED: $var\";\n\t}\n}",
"function formatStatus($status)\n{\n\tswitch ($status)\n\t{\n\t\tcase 'Active':\n\t\t\treturn \"<span class=\\\"label label-success\\\">Active</span>\";\n\n\t\tcase 'Inactive':\n\t\t\treturn \"<span class=\\\"label\\\">Inactive</span>\";\n\n\t\tcase 'Suspended':\n\t\t\treturn \"<span class=\\\"label label-warning\\\">Suspended</span>\";\n\n\t\tcase 'Pending':\n\t\t\treturn \"<span class=\\\"label label-warning\\\">Pending</span>\";\n\n\t\tcase 'Online':\n\t\t\treturn \"<span class=\\\"label label-success\\\">Online</span>\";\n\n\t\tcase 'Offline':\n\t\t\treturn \"<span class=\\\"label label-important\\\">Offline</span>\";\n\n\t\tcase 'Started':\n\t\t\treturn \"<span class=\\\"label label-success\\\">Started</span>\";\n\n\t\tcase 'Stopped':\n\t\t\treturn \"<span class=\\\"label label-warning\\\">Stopped</span>\";\n\n\t\tdefault:\n\t\t\treturn \"<span class=\\\"label\\\">Default</span>\";\n\t}\n}",
"function translate_type_to_name($opt_type) {\n if ($opt_type == 0) return 'Select';\n if ($opt_type == 1) return 'Text';\n if ($opt_type == 2) return 'Radio';\n if ($opt_type == 3) return 'Checkbox';\n if ($opt_type == 4) return 'Text Area';\n return 'Error ' . $opt_type;\n }"
] | [
"0.6643131",
"0.6466311",
"0.63984156",
"0.6352923",
"0.6328616",
"0.6283761",
"0.6165606",
"0.6125562",
"0.6105794",
"0.60934925",
"0.6033988",
"0.599683",
"0.5981072",
"0.5981008",
"0.59794915",
"0.5979154",
"0.59730846",
"0.5892708",
"0.58848614",
"0.5859929",
"0.5845925",
"0.5829124",
"0.58277255",
"0.58146024",
"0.58131194",
"0.58060986",
"0.5805875",
"0.57888377",
"0.5786966",
"0.5780756",
"0.5769604",
"0.576917",
"0.57680327",
"0.57502264",
"0.57498556",
"0.57461387",
"0.57437605",
"0.5735727",
"0.57231504",
"0.57207876",
"0.5717823",
"0.57129246",
"0.5711182",
"0.5706972",
"0.57068086",
"0.5698383",
"0.5696412",
"0.56920433",
"0.56805986",
"0.5678155",
"0.56651855",
"0.5652316",
"0.5634248",
"0.56201124",
"0.55960685",
"0.5578775",
"0.5573859",
"0.55654657",
"0.5562087",
"0.5526839",
"0.55265486",
"0.5521562",
"0.5498328",
"0.54972583",
"0.5495236",
"0.5493419",
"0.5489817",
"0.54871535",
"0.54848504",
"0.54822",
"0.5469767",
"0.5466181",
"0.5463185",
"0.54604024",
"0.545318",
"0.54499465",
"0.5445104",
"0.5440925",
"0.54398966",
"0.54318917",
"0.5429931",
"0.5427005",
"0.5426536",
"0.542448",
"0.5423063",
"0.54148364",
"0.54077417",
"0.540674",
"0.54055417",
"0.54030025",
"0.53986436",
"0.53978133",
"0.5394132",
"0.53902936",
"0.53871906",
"0.538689",
"0.53778404",
"0.5376469",
"0.5358054",
"0.53491455",
"0.5346966"
] | 0.0 | -1 |
A basic unit test example. | public function testExample()
{
$this->assertTrue(true);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function testExample()\n {\n }",
"public function testBasicExample()\n {\n $this->assertTrue(true);\n }",
"public function testBasicExample()\n {\n $this->assertEquals(1, 1);\n }",
"function test_sample() {\n\n\t\t$this->assertTrue( true );\n\n\t}",
"public function testBasicTest()\n {\n\n }",
"public function testExample()\n {\n dump(\"testExample\");\n $this->assertTrue(true);\n }",
"function testSample() {\n\t\t$this->assertTrue( true );\n\t}",
"public function testExample()\n\t{\n\t\t$this->assertTrue(true);\n\t}",
"public function testExample()\n {\n $this->assertTrue(true);\n \n }",
"function test_sample() {\n\t\t$this->assertTrue( true );\n\t}",
"public function testExample()\n {\n $this->assertTrue(true);\n }",
"function test_sampleme() {\n\t\t// Replace this with some actual testing code.\n\t\t$this->assertTrue( true );\n\t}",
"public function test_example()\n {\n $this->assertTrue(true);\n }",
"public function test_example()\n {\n $this->assertTrue(true);\n }",
"public function test_example()\n {\n $this->assertTrue(true);\n }",
"public function test_example()\n {\n $this->assertTrue(true);\n }",
"public function testExample(): void\n {\n $this->assertTrue(true);\n }",
"public function testBasic()\n {\n $this->assertEquals(1, 1);\n }",
"public function testExample()\n {\n // lets make it risky to destroy the green\n }",
"public function test() {\n \t\n\t\tprint_r('hello stef');\n \t\n }",
"public function testBasicExample()\n\t{\n \t$response = $this->call('GET', '/');\n\t\t$this->assertEquals(200, $response->getStatusCode());\n\t}",
"public function testGetPatrimonio()\n {\n }",
"public function testExample()\n {\n //this test is empty as we have not yet decided if we want to use dusk\n\n // $this->get('/')\n // ->click('About')\n // ->seePageIs('/about');\n }",
"public function testGetChamado()\n {\n }",
"public function testBasicExample()\n {\n $this->visit('/')\n ->see('TROLOLOLO');\n }",
"public function testSomething()\n {\n }",
"public function testExample()\n {\n $response = $this->get('/api/test/');\n\n $response->assertStatus(200);\n }",
"public function testBasicTest()\r\n {\r\n $this->assertTrue(true);\r\n }",
"public function test() {\n\n\t}",
"public function testBasicTest()\n {\n $this->assertTrue(true);\n }",
"public function testBasicTest()\n {\n $this->assertTrue(true);\n }",
"public function testBasicTest()\n {\n $this->assertTrue(true);\n }",
"public function testBasicTest()\n {\n $this->assertTrue(true);\n }",
"public function testBasicTest()\n {\n $this->assertTrue(true);\n }",
"public function testBasicTest()\n {\n $this->assertTrue(true);\n }",
"public function testBasicTest()\n {\n $this->assertTrue(true);\n }",
"public function testBasicTest()\n {\n $this->assertTrue(true);\n }",
"public function testBasicTest()\n {\n $this->assertTrue(true);\n }",
"public function testGetExpedicao()\n {\n }",
"public function testBasicTest()\n {\n dd('here');\n $this->assertTrue(true);\n }",
"public function testBasicTest()\n {\n $response = $this->get('/dangthi');\n $response->assertStatus(200);\n }",
"public function testBasicExample()\n\t{\n\t\t$response = $this->call('GET', '/');\n\n\t\t$this->assertEquals(200, $response->getStatusCode());\n\t}",
"public function testExample()\n {\n // $roomController = new RoomController();\n $request = $this->call('GET', '/room/123');\n $this->assertEquals(200, $request->status());\n }"
] | [
"0.80752075",
"0.7854537",
"0.780656",
"0.7760198",
"0.7665438",
"0.7644897",
"0.76254654",
"0.7589822",
"0.75457186",
"0.75257766",
"0.75108504",
"0.7400794",
"0.7393162",
"0.7393162",
"0.7393162",
"0.7393162",
"0.7326179",
"0.73256296",
"0.72956586",
"0.72758234",
"0.72630125",
"0.72496897",
"0.7220798",
"0.7215937",
"0.7196073",
"0.71823233",
"0.71787",
"0.7162814",
"0.7153517",
"0.7143564",
"0.7143564",
"0.7143564",
"0.7143564",
"0.7143564",
"0.7143564",
"0.7143564",
"0.7143564",
"0.7143564",
"0.7133477",
"0.7127466",
"0.71243346",
"0.7115046",
"0.7101194"
] | 0.7423434 | 68 |
Copyright (C) Grameen Solutions Ltd.( General database functions common for all modules. Multilevel transaction control. | function begin_transaction()
{
global $transaction_level; // set in set_global_connection()
if (!$transaction_level) {
db_query("BEGIN", "could not start a transaction");
}
$transaction_level++;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function transaction();",
"public function transaction();",
"abstract public function determineTransaction();",
"abstract public function InTransaction();",
"abstract protected function _start_transaction();",
"public function transactionLevel();",
"public static function transactionLevel()\n {\n }",
"public function transactional();",
"function db_trans_start($dbh) {\ndb_query(\"SET FOREIGN_KEY_CHECKS = 1;\",$dbh,\"\",\"\",\"\",\"Disabling foreign key checks\"); \ndb_query(\"SET autocommit=0;\",$dbh,\"\",\"\",\"\",\"Setting auto commit to 0\");\ndb_query(\"START TRANSACTION;\",$dbh,\"\",\"\",\"\",\"Starting transaction\");\n\n}",
"abstract public function startTransaction();",
"public abstract function beginTransaction();",
"public function beginTransaction();",
"public function beginTransaction();",
"public function beginTransaction();",
"function transaction_check(){\n }",
"public function inTransaction();",
"public function inTransaction();",
"function commit() ;",
"function yy_r18(){ $this->_retvalue = new SQL\\BeginTransaction($this->yystack[$this->yyidx + 0]->minor); }",
"abstract public function commitTransaction();",
"public function processTransactionsDb(){\n $wrapper = new fpgrowth\\PrestashopWrapper();\n $levels = $wrapper->getProductAssociationRules();\n $wrapper->saveProductAssociationRules($levels);\n }",
"static function init_transection($dbh)\r\n {\r\n\r\n $dbh->beginTransaction();\r\n\r\n }",
"function trans_commit()\r\n\t{\r\n\t\treturn $this->db->trans_commit();\r\n\t}",
"public function beginTransaction():void;",
"function yy_r17(){ $this->_retvalue = new SQL\\BeginTransaction; }",
"function yy_r20(){ $this->_retvalue = new SQL\\CommitTransaction($this->yystack[$this->yyidx + 0]->minor); }",
"public function getTransaction();",
"public function createTransaction()\n {\n }",
"function yy_r19(){ $this->_retvalue = new SQL\\CommitTransaction; }",
"function yy_r22(){ $this->_retvalue = new SQL\\RollbackTransaction($this->yystack[$this->yyidx + 0]->minor); }",
"function insert_transaction($subscriptionid = 0, $projectid = 0, $buynowid = 0, $user_id = 0, $p2b_user_id = 0, $storeid = 0, $orderid = 0, $description = '', $amount, $paid, $status, $invoicetype, $paymethod, $createdate, $duedate, $paiddate, $custommessage, $archive, $ispurchaseorder = 0, $returnid = 0, $transactionidx = '', $isdeposit = 0, $iswithdraw = 0, $dontprocesstax = 0)\n {\n global $ilance, $ilconfig;\n $subscriptionid = isset($subscriptionid) ? intval($subscriptionid) : '0';\n $projectid = isset($projectid) ? intval($projectid) : '0';\n $buynowid = isset($buynowid) ? intval($buynowid) : '0';\n $user_id = isset($user_id) ? intval($user_id) : '0';\n $p2b_user_id = isset($p2b_user_id) ? intval($p2b_user_id) : '0';\n $storeid = isset($storeid) ? intval($storeid) : '0';\n $orderid = isset($orderid) ? intval($orderid) : '0';\n $description = isset($description) ? $description : 'No transaction description provided';\n $amount = isset($amount) ? $amount : '0.00';\n $paid = isset($paid) ? $paid : '0.00';\n $status = isset($status) ? $status : 'unpaid';\n $invoicetype = isset($invoicetype) ? $invoicetype : 'debit';\n $paymethod = isset($paymethod) ? $paymethod : 'account';\n $ipaddress = IPADDRESS;\n $referer = REFERRER;\n $createdate = DATETIME24H;\n $duedate = isset($duedate) ? $duedate : DATETIME24H;\n $paiddate = isset($paiddate) ? $paiddate : '';\n $custommessage = isset($custommessage) ? $custommessage : 'No memo or administrative comments';\n $archive = isset($archive) ? intval($archive) : '0';\n $ispurchaseorder = isset($ispurchaseorder) ? $ispurchaseorder : '0';\n // withdraw and deposit related transactions\n $iswithdraw \t = isset($iswithdraw) \t ? intval($iswithdraw) : '0';\n $isdeposit \t = isset($isdeposit) \t ? intval($isdeposit) : '0';\n $totalamount = '0.00';\n $transactionid = (isset($transactionidx) AND !empty($transactionidx)) ? $transactionidx : $ilance->accounting_payment->construct_transaction_id();\n $currencyid = $this->currencyid == '0' ? $ilconfig['globalserverlocale_defaultcurrency'] : $this->currencyid;\n $ilance->db->query(\"\n INSERT INTO \" . DB_PREFIX . \"invoices\n (invoiceid, currency_id, subscriptionid, projectid, buynowid, user_id, p2b_user_id, storeid, orderid, description, amount, paid, totalamount, status, paymethod, ipaddress, referer, createdate, duedate, paiddate, custommessage, transactionid, archive, ispurchaseorder, isdeposit, iswithdraw)\n VALUES(\n NULL,\n '\" . intval($currencyid) . \"',\n '\" . intval($subscriptionid) . \"',\n '\" . intval($projectid) . \"',\n '\" . intval($buynowid) . \"',\n '\" . intval($user_id) . \"',\n '\" . intval($p2b_user_id) . \"',\n '\" . intval($storeid) . \"',\n '\" . intval($orderid) . \"',\n '\" . $ilance->db->escape_string($description) . \"',\n '\" . $ilance->db->escape_string($amount) . \"',\n '\" . $ilance->db->escape_string($paid) . \"',\n '\" . $ilance->db->escape_string($totalamount) . \"',\n '\" . $ilance->db->escape_string($status) . \"',\n '\" . $ilance->db->escape_string($paymethod) . \"',\n '\" . $ilance->db->escape_string($ipaddress) . \"',\n '\" . $ilance->db->escape_string($referer) . \"',\n '\" . $ilance->db->escape_string($createdate) . \"',\n '\" . $ilance->db->escape_string($duedate) . \"',\n '\" . $ilance->db->escape_string($paiddate) . \"',\n '\" . $ilance->db->escape_string($custommessage) . \"',\n '\" . $ilance->db->escape_string($transactionid) . \"',\n '\" . $ilance->db->escape_string($archive) . \"',\n '\" . intval($ispurchaseorder) . \"',\n '\" . intval($isdeposit) . \"',\n '\" . intval($iswithdraw) . \"')\n \", 0, null, __FILE__, __LINE__); \n // fetch new last invoice id\n $invoiceid = $ilance->db->insert_id();\n \n // do we skip the taxation support for this transaction?\n // we do this in some situations where the tax needs to be applied before the txn is created\n // for situations like escrow fees that we must already know how much to charge the customer for taxes\n // if we don't do this then the txn may have double taxes added to the overall amount\n // and situations like this usually mean that an unpaid transaction is being created (and tax) is\n // auto-applied\n \n // taxation support: is user taxable for this invoice type?\n // this code block will run if a transaction being created is unpaid waiting for payment from the customer\n if ($ilance->tax->is_taxable($user_id, $invoicetype) AND isset($dontprocesstax) AND $dontprocesstax == 0)\n {\n // fetch tax amount to charge for this invoice type\n $taxamount = $ilance->tax->fetch_amount($user_id, $amount, $invoicetype, 0);\n // fetch total amount to hold within the \"totalamount\" field\n $totalamount = ($amount + $taxamount);\n // fetch tax bit to display when outputing tax infos\n $taxinfo = $ilance->tax->fetch_amount($user_id, $amount, $invoicetype, 1);\n // portfolio invoicetypes are actually debit payments so treat it like so\n if ($invoicetype == 'portfolio')\n {\n $invoicetype = 'debit';\n }\n // in cases where an escrow payment is being made, and taxes are involved for commission fees,\n // we will update our paid amount to the (total amount w/taxes) if our total amount is not the same\n // as the amount we're paying. we do this because the invoice overview menu will show something like:\n // Amount Paid: $250.00 but the Total Amount is $300.00 (taxes already applied and paid via escrow)\n $extra = '';\n if ($totalamount != $paid AND $totalamount > 0 AND $status == 'paid')\n {\n $extra = \"paid = '\" . $totalamount . \"',\";\n }\n // member is taxable for this invoice type\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET istaxable = '1',\n $extra\n totalamount = '\" . sprintf(\"%01.2f\", $totalamount) . \"',\n taxamount = '\" . sprintf(\"%01.2f\", $taxamount) . \"',\n taxinfo = '\" . $ilance->db->escape_string($taxinfo) . \"',\n invoicetype = '\" . $invoicetype . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($user_id) . \"'\n \", 0, null, __FILE__, __LINE__);\n }\n else\n {\n // portfolio invoicetypes are actually debit payments so treat it like so\n if ($invoicetype == 'portfolio')\n {\n $invoicetype = 'debit';\n }\n // in cases where an escrow payment is being made, and taxes are involved for commission fees,\n // we will update our paid amount to the (total amount w/taxes) if our total amount is not the same\n // as the amount we're paying. we do this because the invoice overview menu will show something like:\n // Amount Paid: $250.00 but the Total Amount is $300.00 (taxes already applied and paid via escrow)\n $extra = '';\n if ($totalamount != $paid AND $totalamount > 0 AND $status == 'paid')\n {\n $extra = \"paid = '\".$totalamount.\"',\";\n }\n // customer not taxable > update totalamount value\n $ilance->db->query(\"\n UPDATE \" . DB_PREFIX . \"invoices\n SET totalamount = '\" . sprintf(\"%01.2f\", $amount) . \"',\n $extra\n invoicetype = '\" . $invoicetype . \"'\n WHERE invoiceid = '\" . intval($invoiceid) . \"'\n AND user_id = '\" . intval($user_id) . \"'\n \", 0, null, __FILE__, __LINE__);\n } \n if (isset($returnid) AND $returnid > 0)\n {\n return intval($invoiceid);\n }\n }",
"function commit();",
"function yy_r21(){ $this->_retvalue = new SQL\\RollbackTransaction; }",
"public static function testTransaction()\n\t\t{\n\t\t\t\n\t\t\t$test = new Test();\n\t\t//\tDatabase::autocommit(false);\n\t\t \tDatabase::begin_transaction();\n\t\t\ttry\n\t\t\t{\n\t\t\t\t$insert_sql = \"insert into test (id, name) values (1, 'Test name')\";\n\t\t\t\t$result = Database::query($insert_sql);\n\t\t\t\t\n\t\t\t\t$test->id = 2;\n\t\t\t\t$test->name = \"Adeel Zahid' Khan\";\n\t\t\t\t$test->Insert();\n\t\t\t\t$test->id = 3;\n\t\t\t\t$test->name = 'Naveed \"Gulzaar';\n\t\t\t\t$test->Insert();\n\t\t\t\t\n\t\t\t\t$insert_sql = \"insert into test (id, name) values (4, 'Another Test name')\";\n\t\t\t\t$result = Database::query($insert_sql);\n\t\t\t\t\n\t\t\t\terror_log(\"Committing transaction in BasicDataModel::testTransaction() ...\");\n\t\t\t\tDatabase::commit();\n\t\t\t\t// Database::autocommit(TRUE);\n\t\t\t}\n\t\t\tcatch(Exception $e)\n\t\t\t{\n\t\t\t\terror_log(\"Rolling back transaction BasicDataModel::testTransaction() ...\" . $e->getMessage());\n\t\t\t\tDatabase::rollback();\n\t\t\t}\n\t\t}",
"function trans_begin($test_mode = FALSE)\r\n\t{\t\r\n\t\treturn $this->db->trans_begin($test_mode);\r\n\t}",
"function createTransaction( $db, $tx_data, $wallet_id ) {\r\n // Insert the transaction data\r\n $db->insert( 'transactions', $tx_data );\r\n // TODO: Record this transaction in the logs\r\n // Now get the current wallet balance\r\n $current_balance = $db->get( 'wallets','balance',[ 'id' => $wallet_id ]);\r\n // Update the wallet with the new Balance\r\n $db->update( 'wallets',\r\n [\r\n 'balance[+]' => $tx_data['amount'],\r\n 'activated' => 1\r\n ],\r\n [ 'id' => $wallet_id ]\r\n );\r\n // If all went well, return an array with the transaction status\r\n return [\r\n 'success' => true,\r\n 'data' => [\r\n 'ref_no' => $tx_data['ref_no'],\r\n 'prev_bal' => $current_balance,\r\n 'currency' => $tx_data['currency'],\r\n 'new_bal' => ( $current_balance + $tx_data['amount'] )\r\n ]\r\n ];\r\n}",
"abstract protected function doRollback();",
"function beginTransaction()\r\n\t\t{\r\n\t\t$this->transaction=FALSE;\r\n\t\t$this->query=\"START TRANSACTION \";\r\n\t\t$this->query.=($this->transaction_isolation)?\" ISOLATION LEVEL \".$this->transaction_isolation:\"\";\r\n\t\t$this->query.=($this->lock_type)?$this->lock_type:\"\";\r\n\t\t$this->runQuery();\r\n\t\t$this->transaction=TRUE;\r\n\t\t}",
"abstract protected function getTransactions();",
"function GenerateDataSQL($strDatabase, $strTable, $bwlAddSlashes=false, $bwlNoDBMention=false, $bwlHTMLEsc=false, $tableprefix=\"\", $tablepostfix=\"\",$rowlist=\"*\", $bwlrecursivebackup=false, $bwlnullpks=false)\n//creates a SQL-based dump of a table's data\n//can handle recursive backups of related data and the moving of data (PKs and related FKs) \n//into fresh new autoinc PK ranges\n//Judas Gutenberg, jan 9 2007\n{\n \n\t$sql=conDB();\n\t$out=\"\";\n\t$strSQL=\"SELECT * FROM \" . $strDatabase . \".\" . $strTable;\n\t$wherclause=\"\";\n\t$strThisSpecialID=\"@rootpk\";\n\t\n\t$intSpecialIDCount=0;\n\t$pkname=PKLookup($strDatabase, $strTable);\n\t$bwlThisIsAutoIncPK=hasautocount($strDatabase, $strTable);\n\t\t\t\t\t \n\t\t\t\t\t \n\tif($rowlist!=\"*\")\n\t{\n\t\t$arrRowlist=explode(\" \", $rowlist);\n\t\t\n\t\t\n\t\tif(!contains($pkname, \" \") && $bwlThisIsAutoIncPK) //can't handle multi-part PKs!\n\t\t{\n\t\t\t$wherclause=\" WHERE \";\n\t\t\tforeach($arrRowlist as $thisID)\n\t\t\t{\n\t\t\t\t$wherclause.=\" \" . $pkname . \"='\" . $thisID . \"' OR\";\n\t\t\t\n\t\t\t}\n\t\t\t$wherclause=substr($wherclause, 0, strlen($wherclause)-3);\n\t\t}\n\t\t$strSQL.=$wherclause;\n\t}\n\tif($bwlnullpks && !contains($pkname, \" \"))\n\t{\n\t\t$out.=\"\\nSET \" . $strThisSpecialID .\"=(SELECT MAX( \" . $pkname . \" ) +1 FROM \" . IfAThenB(!$bwlNoDBMention, $strDatabase . \".\") . $strTable . \");\";\n\t}\n\t//echo \"===\" . $strSQL;\n\t//die();\n\t$records = $sql->query($strSQL);\n\t$rowcount=0;\n\t$out.=\"\\n\";\n\t$pkname=PKLookup($strDatabase, $strTable);\n\t$bwlColListCreated=false;\n\t$colList=\"\";\n\t \n\tforeach($records as $record)\n\t{\n\t\tif($bwlNoDBMention)\n\t\t{\n\t\t\t$out.=\"\\nINSERT INTO \" . $tableprefix . $strTable . $tablepostfix . \"(\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$out.=\"\\nINSERT INTO \" . $strDatabase . \".\" . $tableprefix . $strTable . $tablepostfix . \"(\";\n\t\t}\n \t\t$insertdata=\"\";\n\t\t\n\t\tforeach($record as $k=>$field)\n\t\t{\n\t\t\t//$bwlnullpks\n\t\t\t\n\t\t\t$bwlFieldIsPK=false;\n\t\t\tif($k==$pkname)\n\t\t\t{\n\t\t\t\t$bwlFieldIsPK=true;\n\t\t\t\t$id=$field;\n\t\t\t\tif(!$bwlColListCreated)//i keep from doing the expensive lookup of hasautocount for every export row\n\t\t\t\t{\n\t\t\t\t}\n\t\t\t}\n\t\t\tif(!$bwlColListCreated && (!($bwlFieldIsPK && $bwlnullpks) || $bwlrecursivebackup))\n\t\t\t{\n\t\t\t\t$colList.=\"`\" . $k . \"`,\";\n\t\t\t}\n\t\t\t\n\t \t\tif($bwlrecursivebackup && ($bwlFieldIsPK && $bwlThisIsAutoIncPK) && $bwlnullpks )\n\t\t\t{\n\t\t\t\t$insertdata.= $strThisSpecialID . \" + \" . $intSpecialIDCount . \",\";\n\t\t\t\t\n\t\t\t}\n\t\t\telse if(($bwlFieldIsPK && $bwlThisIsAutoIncPK) && $bwlnullpks && !$bwlrecursivebackup)\n\t\t\t{\n\t\t\t\n\t\t\t}\n\t\t\telse if($bwlHTMLEsc)\n\t\t\t{\n\t\t\t\t$insertdata.= \"'\" . str_replace(\"'\", \"'\", $field). \"',\";\n\t\t\t}\n\t\t\telse if($bwlAddSlashes)\n\t\t\t{\n\t\t\t\t$insertdata.= \"'\" . addslashes($field). \"',\";\n\t\t\t}\n\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\t$insertdata.= \"'\" . $field. \"',\";\n\t\t\t}\n\t\t\t$rowcount++;\n\t\t}\n\t\tif(!$bwlColListCreated)\n\t\t{\n\t\t\t$colList=RemoveEndCharactersIfMatch($colList, \",\");\n\t\t}\n\t\t\t\t\n\t\t$bwlColListCreated=true;\n\t\t$insertdata=RemoveEndCharactersIfMatch($insertdata, \",\");\n\t\t$out.=$colList . \") VALUES(\" . $insertdata . \");\";\n\t\t//$out.=$insertdata . \");\\n\";\n\t\tif($bwlrecursivebackup)\n\t\t{\n\t\t\t//echo $pkname . \" \" . $id . \"<br>\";\n\t\t\t$strThisSpecialIDToPass=$strThisSpecialID . \" + \" . $intSpecialIDCount;\n\t\t\tif(!$bwlnullpks)\n\t\t\t{\n\t\t\t\t$strThisSpecialIDToPass=\"\";\n\t\t\t}\n\n\t\t\t$out.=ScriptOutRelatedData($strDatabase, $strTable, $pkname, $id, 0, $tableprefix, $tablepostfix, $bwlNoDBMention, $bwlnullpks, $strThisSpecialIDToPass);\n\t\t\n\t\t\n\t\t}\n\t\t$intSpecialIDCount++;\n\t}\n\t$out.=\"\\n\";\n\n\treturn $out;\n}",
"public static function beginTransaction()\n {\n }",
"protected static function beginTransaction()\n\t{\n\t\tAbstractUnit::beginTransaction();\n\t}",
"public function iniciar_transaccion()\n\t{\n\t $con = $this->load->database('default',TRUE);\n\t $con->trans_begin();\n\t return $con;\n\t}",
"function chawa_db_transactions_data() {\n\tglobal $wpdb;\n\t\n\t$table_name = $wpdb->prefix . 'chawa_transactions';\n\t\n\t$wpdb->insert(\n\t\t$table_name, \n\t\tarray(\n\t\t\t'transaction_id' => 'chawa_000000000000000000000000',\n\t\t\t'transaction_type' => 'DEBIT',\n\t\t\t'transaction_status' => 'status',\n\t\t\t'source_id' => 'src_000000000000000000000000',\n\t\t\t'source_status' => 'status',\n\t\t\t'charge_id' => 'py_000000000000000000000000',\n\t\t\t'charge_status' => 'status',\n\t\t\t'user_id' => 0,\n\t\t\t'amount' => 0,\n\t\t\t'recurring' => FALSE,\n\t\t\t'time' => current_time('mysql')\n\t\t) \n\t);\n}",
"function db_trans_stop($dbh) {\ndb_query(\"COMMIT;\",$dbh,\"\",\"\",\"\",\"Committing transaction\");\ndb_query(\"SET autocommit=1;\",$dbh,\"\",\"\",\"\",\"Setting auto commit to 1\");\ndb_query(\"SET FOREIGN_KEY_CHECKS = 1;\",$dbh,\"\",\"\",\"\",\"Enabling foreign key checks\");\n}",
"protected function beginTrans(){\r\n $this->transaction=$this->dba->beginTransaction();\r\n $this->isTransactionBegun=true;\r\n }",
"function beginTransaction(){\n\t\ttry {\n\t\t\t$this->dbconn->beginTransaction();\n\t\t}catch(Exception $e){\n\t\t\t$this->logger->error($e->getMessage());\n\t\t\tthrow $e;\n\t\t}\n\t}",
"public function startTransaction(): void;",
"public function startTransaction()\n {\n\t\treturn $this->db->fireFastSqlQuery(\"START TRANSACTION\");\n\t}",
"public function dbTransactionBegin()\n {\n DB::beginTransaction();\n }",
"function trans_start($test_mode = FALSE)\r\n\t{\t\r\n\t\t$this->db->trans_start($test_mode);\r\n\t}",
"function rollback();",
"public function transactionStart()\n\t{\n\t\treturn;\n\t}",
"function db_rollback($dbh) {\ndb_query(\"ROLLBACK;\",$dbh,\"\",\"\",\"\",\"Rolling back transaction\");\ndb_query(\"SET autocommit=1;\",$dbh,\"\",\"\",\"\",\"Setting auto commit to 1\");\n}",
"private function _alter() {\n\t\t$queries = array();\n\t\t\n\t\t$queries[] = ('BEGIN TRANSACTION');\n\t\t$q = \"SELECT * FROM _ssm_backup\";\n\t\t$r = @sqlite_query($q, $this->_connection);\n\t\t\n\t\tif(!sqlite_last_error($this->_connection)) {\n\t\t\tsqlite_query(\"DROP TABLE _ssm_backup\", $this->_connection);\n\t\t}\n\t\t\n\t\t$export = new export('sql');\n\t\t\n\t\t@sqlite_query(\"CREATE TABLE _ssm_backup AS SELECT * FROM {$this->_name}\", $this->_connection);\n\t\t$t = new table(\"{$this->_db}:_ssm_backup\");\n\t\t\n\t\t$queries[] = \"DROP TABLE {$this->_name}\";\n\n\t\t$sql = $export->structTable($this);\n\t\t$queries[] = $sql;\n\t\t$insertQuery = $this->_alterBuildInsertQuery($t);\n\t\t$queries[] = $insertQuery;\n\t\t$queries[] = \"COMMIT TRANSACTION\";\n\t\t\n\t\t$ret = true;\n\n\t\tforeach($queries as $query) {\n\t\t\t@sqlite_query($query, $this->_connection);\n\t\t\tif(@sqlite_last_error($this->_connection)) {\n\t\t\t\t$ret = false;\n\t\t\t}\n\t\t}\n\t\t\n\t\t@sqlite_query(\"DROP TABLE _ssm_backup\", $this->_connection);\n\t\treturn $ret;\n\t}",
"function trans_rollback()\r\n\t{\r\n\t\treturn $this->db->trans_rollback();\r\n\t}",
"function EditData($conn)\r\n{\r\n\r\n\tphpmkr_query('START TRANSACTION;', $conn) or die(\"Failed to execute query: \" . phpmkr_error() . '<br>SQL: BEGIN TRAN');\r\n\t\r\n//SOLICITUD\r\n\r\n\t// Field credito_tipo_id\r\n\t$theValue = ($GLOBALS[\"x_credito_tipo_id\"] != \"\") ? intval($GLOBALS[\"x_credito_tipo_id\"]) : \"NULL\";\r\n\t$fieldList[\"`credito_tipo_id`\"] = $theValue;\r\n\r\n\t// Field solicitud_status_id\r\n\t$theValue = ($GLOBALS[\"x_solicitud_status_id\"] != \"\") ? intval($GLOBALS[\"x_solicitud_status_id\"]) : \"NULL\";\r\n\t$fieldList[\"`solicitud_status_id`\"] = $theValue;\r\n\r\n\t// Field folio\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_folio\"]) : $GLOBALS[\"x_folio\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`folio`\"] = $theValue;\r\n\r\n\t// Field fecha_registro\r\n\t$theValue = ($GLOBALS[\"x_fecha_registro\"] != \"\") ? \" '\" . ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_registro\"]) . \"'\" : \"Null\";\r\n\t$fieldList[\"`fecha_registro`\"] = $theValue;\r\n\r\n\t// Field promotor_id\r\n\t$theValue = ($GLOBALS[\"x_promotor_id\"] != \"\") ? intval($GLOBALS[\"x_promotor_id\"]) : \"NULL\";\r\n\t$fieldList[\"`promotor_id`\"] = $theValue;\r\n\r\n\t// Field importe_solicitado\r\n\t$theValue = ($GLOBALS[\"x_importe_solicitado\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_importe_solicitado\"]) . \"'\" : \"NULL\";\r\n\t$fieldList[\"`importe_solicitado`\"] = $theValue;\r\n\r\n\t// Field plazo\r\n\t$theValue = ($GLOBALS[\"x_plazo_id\"] != \"\") ? intval($GLOBALS[\"x_plazo_id\"]) : \"NULL\";\r\n\t$fieldList[\"`plazo_id`\"] = $theValue;\r\n\r\n\t$theValue = ($GLOBALS[\"x_forma_pago_id\"] != \"\") ? intval($GLOBALS[\"x_forma_pago_id\"]) : \"NULL\";\r\n\t$fieldList[\"`forma_pago_id`\"] = $theValue;\r\n\r\n\t// Field contrato\r\n\t$theValue = $GLOBALS[\"x_contrato\"][0];\r\n\t$theValue = ($theValue != \"\") ? intval($theValue) : \"NULL\";\r\n\t$fieldList[\"`contrato`\"] = $theValue;\r\n\r\n\t// Field pagare\r\n\t$theValue = $GLOBALS[\"x_pagare\"][0];\r\n\t$theValue = ($theValue != \"\") ? intval($theValue) : \"NULL\";\r\n\t$fieldList[\"`pagare`\"] = $theValue;\r\n\r\n\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_comentario_promotor\"]) : $GLOBALS[\"x_comentario_promotor\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`comentario_promotor`\"] = $theValue;\r\n\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_comentario_comite\"]) : $GLOBALS[\"x_comentario_comite\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`comentario_comite`\"] = $theValue;\r\n\r\n\r\n\r\n\t// solicitud_anterior\r\n\t$x_solicitud_id_ant = $GLOBALS[\"x_solicitud_id\"];\r\n\t$fieldList[\"`solicitud_id_ant`\"] = $GLOBALS[\"x_solicitud_id\"];\r\n\r\n\r\n$theValue = ($GLOBALS[\"x_actividad_id\"] != \"\") ? intval($GLOBALS[\"x_actividad_id\"]) : \"0\";\r\n\t$fieldList[\"`actividad_id`\"] = $theValue;\r\n\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_actividad_desc\"]) : $GLOBALS[\"x_actividad_desc\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`actividad_desc`\"] = $theValue;\r\n\r\n\r\n\t// insert into database\r\n\t$sSql = \"INSERT INTO `solicitud` (\";\r\n\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t$sSql .= \") VALUES (\";\r\n\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t$sSql .= \")\";\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t \texit();\r\n\t}\r\n\t$x_solicitud_id = mysql_insert_id();\r\n\r\n\r\n\t$sSql = \"update solicitud set solicitud_status_id = 8 where solicitud_id = $x_solicitud_id_ant\";\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t \texit();\r\n\t}\r\n\r\n//FOLIO\t\r\n\t$currentdate_fol = getdate(time());\r\n\t$x_solicitud_fol = str_pad($x_solicitud_id, 5, \"0\", STR_PAD_LEFT);\r\n\t$x_dia_fol = str_pad($currentdate_fol[\"mday\"], 2, \"0\", STR_PAD_LEFT);\r\n\t$x_mes_fol = str_pad($currentdate_fol[\"mon\"], 2, \"0\", STR_PAD_LEFT);\r\n\t$x_year_fol = str_pad($currentdate_fol[\"year\"], 2, \"0\", STR_PAD_LEFT);\t\t\t\r\n\t\r\n\t$x_folio = \"CP$x_solicitud_fol\".$x_dia_fol.$x_mes_fol.$x_year_fol;\t\r\n\t$sSql = \"update solicitud set folio = '$x_folio' where solicitud_id = $x_solicitud_id\";\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t \texit();\r\n\t}\r\n\r\n\r\n\r\n\r\n//CLIENTE\r\n\r\n\t$fieldList = NULL;\r\n\t// Field solicitud_id\r\n//\t$fieldList[\"`solicitud_id`\"] = $x_solicitud_id;\r\n\r\n\t// Field usuario_id\r\n//\t$theValue = ($GLOBALS[\"x_usuario_id\"] != \"\") ? intval($GLOBALS[\"x_usuario_id\"]) : \"NULL\";\r\n\t$fieldList[\"`usuario_id`\"] = 0;\r\n\r\n\t// Field nombre_completo\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_nombre_completo\"]) : $GLOBALS[\"x_nombre_completo\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`nombre_completo`\"] = $theValue;\r\n\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_apellido_paterno\"]) : $GLOBALS[\"x_apellido_paterno\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`apellido_paterno`\"] = $theValue;\r\n\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_apellido_materno\"]) : $GLOBALS[\"x_apellido_materno\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`apellido_materno`\"] = $theValue;\r\n\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_tit_rfc\"]) : $GLOBALS[\"x_tit_rfc\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`rfc`\"] = $theValue;\r\n\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_tit_curp\"]) : $GLOBALS[\"x_tit_curp\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`curp`\"] = $theValue;\r\n\r\n\r\n\t// Field tipo_negocio\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_tipo_negocio\"]) : $GLOBALS[\"x_tipo_negocio\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`tipo_negocio`\"] = $theValue;\r\n\r\n\r\n\t// Field fecha_registro\r\n\t$theValue = ($GLOBALS[\"x_tit_fecha_nac\"] != \"\") ? \" '\" . ConvertDateToMysqlFormat($GLOBALS[\"x_tit_fecha_nac\"]) . \"'\" : \"Null\";\r\n\t$fieldList[\"`fecha_nac`\"] = $theValue;\r\n\r\n\r\n\t// Field edad\r\n\t$theValue = ($GLOBALS[\"x_edad\"] != \"\") ? intval($GLOBALS[\"x_edad\"]) : \"NULL\";\r\n\t$fieldList[\"`edad`\"] = $theValue;\r\n\r\n\t// Field sexo\r\n\t$theValue = ($GLOBALS[\"x_sexo\"] != \"\") ? intval($GLOBALS[\"x_sexo\"]) : \"NULL\";\r\n\t$fieldList[\"`sexo`\"] = $theValue;\r\n\r\n\t// Field estado_civil_id\r\n\t$theValue = ($GLOBALS[\"x_estado_civil_id\"] != \"\") ? intval($GLOBALS[\"x_estado_civil_id\"]) : \"0\";\r\n\t$fieldList[\"`estado_civil_id`\"] = $theValue;\r\n\r\n\t// Field numero_hijos\r\n\t$theValue = ($GLOBALS[\"x_numero_hijos\"] != \"\") ? intval($GLOBALS[\"x_numero_hijos\"]) : \"0\";\r\n\t$fieldList[\"`numero_hijos`\"] = $theValue;\r\n\r\n\r\n\t// Field numero_hijos_dep\r\n\t$theValue = ($GLOBALS[\"x_numero_hijos_dep\"] != \"\") ? intval($GLOBALS[\"x_numero_hijos_dep\"]) : \"0\";\r\n\t$fieldList[\"`numero_hijos_dep`\"] = $theValue;\r\n\r\n\t// Field nombre_conyuge\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_nombre_conyuge\"]) : $GLOBALS[\"x_nombre_conyuge\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`nombre_conyuge`\"] = $theValue;\r\n\r\n\t// Field nombre_conyuge\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_email\"]) : $GLOBALS[\"x_email\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`email`\"] = $theValue;\r\n\r\n\r\n\t$theValue = ($GLOBALS[\"x_nacionalidad_id\"] != \"\") ? intval($GLOBALS[\"x_nacionalidad_id\"]) : \"0\";\r\n\t$fieldList[\"`nacionalidad_id`\"] = $theValue;\r\n\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_empresa\"]) : $GLOBALS[\"x_empresa\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`empresa`\"] = $theValue;\r\n\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_piesto\"]) : $GLOBALS[\"x_puesto\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`puesto`\"] = $theValue;\r\n\r\n\t// Field fecha_registro\r\n\t$theValue = ($GLOBALS[\"x_fecha_contratacion\"] != \"\") ? \" '\" . ConvertDateToMysqlFormat($GLOBALS[\"x_fecha_contratacion\"]) . \"'\" : \"Null\";\r\n\t$fieldList[\"`fecha_contratacion`\"] = $theValue;\r\n\r\n\t$theValue = ($GLOBALS[\"x_salario_mensual\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_salario_mensual\"]) . \"'\" : \"NULL\";\r\n\t$fieldList[\"`salario_mensual`\"] = $theValue;\r\n\r\n\t// insert into database\r\n\t$sSql = \"INSERT INTO `cliente` (\";\r\n\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t$sSql .= \") VALUES (\";\r\n\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t$sSql .= \")\";\r\n\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t \texit();\r\n\t}\r\n\t$x_cliente_id = mysql_insert_id();\r\n\r\n\r\n\r\n//SOLICITUD CLIENTE\r\n\r\n\t$fieldList = NULL;\r\n\t// Field solicitud_id\r\n\t$fieldList[\"`solicitud_id`\"] = $x_solicitud_id;\r\n\r\n\t$fieldList[\"`cliente_id`\"] = $x_cliente_id;\r\n\r\n\t// insert into database\r\n\t$sSql = \"INSERT INTO `solicitud_cliente` (\";\r\n\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t$sSql .= \") VALUES (\";\r\n\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t$sSql .= \")\";\r\n\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t \texit();\r\n\t}\r\n\r\n\r\n//DIRECCION PART\r\n\r\n\t$fieldList = NULL;\r\n\t// Field cliente_id\r\n//\t$theValue = ($GLOBALS[\"x_cliente_id\"] != \"\") ? intval($GLOBALS[\"x_cliente_id\"]) : \"NULL\";\r\n\t$fieldList[\"`cliente_id`\"] = $x_cliente_id;\r\n\r\n\t// Field aval_id\r\n//\t$theValue = ($GLOBALS[\"x_aval_id\"] != \"\") ? intval($GLOBALS[\"x_aval_id\"]) : \"NULL\";\r\n\t$fieldList[\"`aval_id`\"] = 0;\r\n\r\n\t// Field promotor_id\r\n//\t$theValue = ($GLOBALS[\"x_promotor_id\"] != \"\") ? intval($GLOBALS[\"x_promotor_id\"]) : \"NULL\";\r\n\t$fieldList[\"`promotor_id`\"] = 0;\r\n\r\n\t// Field direccion_tipo_id\r\n//\t$theValue = ($GLOBALS[\"x_direccion_tipo_id\"] != \"\") ? intval($GLOBALS[\"x_direccion_tipo_id\"]) : \"NULL\";\r\n\t$fieldList[\"`direccion_tipo_id`\"] = 1;\r\n\r\n\t// Field calle\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_calle\"]) : $GLOBALS[\"x_calle\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`calle`\"] = $theValue;\r\n\r\n\t// Field colonia\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_colonia\"]) : $GLOBALS[\"x_colonia\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`colonia`\"] = $theValue;\r\n\r\n\t// Field delegacion_id\r\n\t$theValue = ($GLOBALS[\"x_delegacion_id\"] != \"\") ? intval($GLOBALS[\"x_delegacion_id\"]) : \"0\";\r\n\t$fieldList[\"`delegacion_id`\"] = $theValue;\r\n\r\n\t// Field propietario\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_propietario\"]) : $GLOBALS[\"x_propietario\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`propietario`\"] = $theValue;\r\n\r\n/*\r\n\t// Field entidad\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_entidad\"]) : $GLOBALS[\"x_entidad\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`entidad`\"] = $theValue;\r\n*/\r\n\t// Field codigo_postal\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_codigo_postal\"]) : $GLOBALS[\"x_codigo_postal\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`codigo_postal`\"] = $theValue;\r\n\r\n\t// Field ubicacion\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_ubicacion\"]) : $GLOBALS[\"x_ubicacion\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`ubicacion`\"] = $theValue;\r\n\r\n\t// Field antiguedad\r\n\t$theValue = ($GLOBALS[\"x_antiguedad\"] != \"\") ? intval($GLOBALS[\"x_antiguedad\"]) : \"0\";\r\n\t$fieldList[\"`antiguedad`\"] = $theValue;\r\n\r\n\t// Field vivienda_tipo_id\r\n\t$theValue = ($GLOBALS[\"x_vivienda_tipo_id\"] != \"\") ? intval($GLOBALS[\"x_vivienda_tipo_id\"]) : \"0\";\r\n\t$fieldList[\"`vivienda_tipo_id`\"] = $theValue;\r\n\r\n\t// Field otro_tipo_vivienda\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_otro_tipo_vivienda\"]) : $GLOBALS[\"x_otro_tipo_vivienda\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`otro_tipo_vivienda`\"] = $theValue;\r\n\r\n\t// Field telefono\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_telefono\"]) : $GLOBALS[\"x_telefono\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`telefono`\"] = $theValue;\r\n\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_telefono_sec\"]) : $GLOBALS[\"x_telefono_sec\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`telefono_movil`\"] = $theValue;\r\n\r\n\t// Field telefono_secundario\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_telefono_secundario\"]) : $GLOBALS[\"x_telefono_secundario\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`telefono_secundario`\"] = $theValue;\r\n\r\n\t// insert into database\r\n\t$sSql = \"INSERT INTO `direccion` (\";\r\n\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t$sSql .= \") VALUES (\";\r\n\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t$sSql .= \")\";\r\n\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL AQUI: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t \texit();\r\n\t}\r\n\r\n\r\n//DIRECCION NEG\r\n\r\n\t$fieldList = NULL;\r\n\t// Field cliente_id\r\n//\t$theValue = ($GLOBALS[\"x_cliente_id\"] != \"\") ? intval($GLOBALS[\"x_cliente_id\"]) : \"NULL\";\r\n\t$fieldList[\"`cliente_id`\"] = $x_cliente_id;\r\n\r\n\t// Field aval_id\r\n//\t$theValue = ($GLOBALS[\"x_aval_id\"] != \"\") ? intval($GLOBALS[\"x_aval_id\"]) : \"NULL\";\r\n\t$fieldList[\"`aval_id`\"] = 0;\r\n\r\n\t// Field promotor_id\r\n//\t$theValue = ($GLOBALS[\"x_promotor_id\"] != \"\") ? intval($GLOBALS[\"x_promotor_id\"]) : \"NULL\";\r\n\t$fieldList[\"`promotor_id`\"] = 0;\r\n\r\n\t// Field direccion_tipo_id\r\n//\t$theValue = ($GLOBALS[\"x_direccion_tipo_id\"] != \"\") ? intval($GLOBALS[\"x_direccion_tipo_id\"]) : \"NULL\";\r\n\t$fieldList[\"`direccion_tipo_id`\"] = 2;\r\n\r\n\t// Field calle\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_calle2\"]) : $GLOBALS[\"x_calle2\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`calle`\"] = $theValue;\r\n\r\n\t// Field colonia\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_colonia2\"]) : $GLOBALS[\"x_colonia2\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`colonia`\"] = $theValue;\r\n\r\n\t// Field delegacion_id\r\n\t$theValue = ($GLOBALS[\"x_delegacion_id2\"] != \"\") ? intval($GLOBALS[\"x_delegacion_id2\"]) : \"0\";\r\n\t$fieldList[\"`delegacion_id`\"] = $theValue;\r\n/*\r\n\t// Field otra_delegacion\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_otra_delegacion\"]) : $GLOBALS[\"x_otra_delegacion\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`otra_delegacion`\"] = $theValue;\r\n*/\r\n/*\r\n\t// Field entidad\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_entidad2\"]) : $GLOBALS[\"x_entidad2\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`entidad`\"] = $theValue;\r\n*/\r\n\t// Field codigo_postal\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_codigo_postal2\"]) : $GLOBALS[\"x_codigo_postal2\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`codigo_postal`\"] = $theValue;\r\n\r\n\t// Field ubicacion\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_ubicacion2\"]) : $GLOBALS[\"x_ubicacion2\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`ubicacion`\"] = $theValue;\r\n\r\n\t// Field antiguedad\r\n\t$theValue = ($GLOBALS[\"x_antiguedad\"] != \"\") ? intval($GLOBALS[\"x_antiguedad2\"]) : \"0\";\r\n\t$fieldList[\"`antiguedad`\"] = $theValue;\r\n\r\n\t// Field vivienda_tipo_id\r\n\t$theValue = ($GLOBALS[\"x_vivienda_tipo_id2\"] != \"\") ? intval($GLOBALS[\"x_vivienda_tipo_id2\"]) : \"0\";\r\n\t$fieldList[\"`vivienda_tipo_id`\"] = $theValue;\r\n\r\n\t// Field otro_tipo_vivienda\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_otro_tipo_vivienda2\"]) : $GLOBALS[\"x_otro_tipo_vivienda2\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`otro_tipo_vivienda`\"] = $theValue;\r\n\r\n\t// Field telefono\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_telefono2\"]) : $GLOBALS[\"x_telefono2\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`telefono`\"] = $theValue;\r\n\r\n\t// Field telefono_secundario\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_telefono_secundario2\"]) : $GLOBALS[\"x_telefono_secundario2\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`telefono_secundario`\"] = $theValue;\r\n\r\n\t// insert into database\r\n\t$sSql = \"INSERT INTO `direccion` (\";\r\n\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t$sSql .= \") VALUES (\";\r\n\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t$sSql .= \")\";\r\n\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t \texit();\r\n\t}\r\n\r\n\r\n//AVAL\r\n\r\n\tif($GLOBALS[\"x_nombre_completo_aval\"] != \"\"){\r\n\r\n\t\t$fieldList = NULL;\r\n\t\t// Field cliente_id\r\n\t//\t$theValue = ($GLOBALS[\"x_cliente_id\"] != \"\") ? intval($GLOBALS[\"x_cliente_id\"]) : \"NULL\";\r\n\t\t$fieldList[\"`solicitud_id`\"] = $x_solicitud_id;\r\n\t\r\n\t\t// Field nombre_completo\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_nombre_completo_aval\"]) : $GLOBALS[\"x_nombre_completo_aval\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`nombre_completo`\"] = $theValue;\r\n\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_apellido_paterno_aval\"]) : $GLOBALS[\"x_apellido_paterno_aval\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`apellido_paterno`\"] = $theValue;\r\n\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_apellido_materno_aval\"]) : $GLOBALS[\"x_apellido_materno_aval\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`apellido_materno`\"] = $theValue;\r\n\r\n\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_aval_rfc\"]) : $GLOBALS[\"x_aval_rfc\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`rfc`\"] = $theValue;\r\n\r\n\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_aval_curp\"]) : $GLOBALS[\"x_aval_curp\"]; \r\n\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t$fieldList[\"`curp`\"] = $theValue;\r\n\r\n\t\r\n\t\t// Field parentesco_tipo_id\r\n\t\t$theValue = ($GLOBALS[\"x_parentesco_tipo_id_aval\"] != \"\") ? intval($GLOBALS[\"x_parentesco_tipo_id_aval\"]) : \"0\";\r\n\t\t$fieldList[\"`parentesco_tipo_id`\"] = $theValue;\r\n\t\r\n\t\t// Field telefono\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_telefono3\"]) : $GLOBALS[\"x_telefono3\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`telefono`\"] = $theValue;\r\n\t\r\n\t\t// Field ingresos_mensuales\r\n\t\t$theValue = ($GLOBALS[\"x_ingresos_mensuales\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_ingresos_mensuales\"]) . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`ingresos_mensuales`\"] = $theValue;\r\n\t\r\n\t\t// Field ocupacion\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_ocupacion\"]) : $GLOBALS[\"x_ocupacion\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`ocupacion`\"] = $theValue;\r\n\t\r\n\t\t// insert into database\r\n\t\t$sSql = \"INSERT INTO `aval` (\";\r\n\t\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t\t$sSql .= \") VALUES (\";\r\n\t\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t\t$sSql .= \")\";\r\n\t\r\n\t\t$x_result = phpmkr_query($sSql, $conn);\r\n\t\tif(!$x_result){\r\n\t\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\t\texit();\r\n\t\t}\r\n\t\r\n\t\t$x_aval_id = mysql_insert_id();\r\n\t\t\r\n\t//DOM PART AVAL\r\n\t\r\n\t\t$fieldList = NULL;\r\n\t\t// Field cliente_id\r\n\t//\t$theValue = ($GLOBALS[\"x_cliente_id\"] != \"\") ? intval($GLOBALS[\"x_cliente_id\"]) : \"NULL\";\r\n\t\t$fieldList[\"`cliente_id`\"] = 0;\r\n\t\r\n\t\t// Field aval_id\r\n\t//\t$theValue = ($GLOBALS[\"x_aval_id\"] != \"\") ? intval($GLOBALS[\"x_aval_id\"]) : \"NULL\";\r\n\t\t$fieldList[\"`aval_id`\"] = $x_aval_id;\r\n\t\r\n\t\t// Field promotor_id\r\n\t//\t$theValue = ($GLOBALS[\"x_promotor_id\"] != \"\") ? intval($GLOBALS[\"x_promotor_id\"]) : \"NULL\";\r\n\t\t$fieldList[\"`promotor_id`\"] = 0;\r\n\t\r\n\t\t// Field direccion_tipo_id\r\n\t//\t$theValue = ($GLOBALS[\"x_direccion_tipo_id\"] != \"\") ? intval($GLOBALS[\"x_direccion_tipo_id\"]) : \"NULL\";\r\n\t\t$fieldList[\"`direccion_tipo_id`\"] = 3;\r\n\t\r\n\t\t// Field calle\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_calle3\"]) : $GLOBALS[\"x_calle3\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`calle`\"] = $theValue;\r\n\t\r\n\t\t// Field colonia\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_colonia3\"]) : $GLOBALS[\"x_colonia3\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`colonia`\"] = $theValue;\r\n\t\r\n\t\t// Field delegacion_id\r\n\t\t$theValue = ($GLOBALS[\"x_delegacion_id3\"] != \"\") ? intval($GLOBALS[\"x_delegacion_id3\"]) : \"0\";\r\n\t\t$fieldList[\"`delegacion_id`\"] = $theValue;\r\n\t\r\n\t\t// Field propietario\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_propietario2\"]) : $GLOBALS[\"x_propietario2\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`propietario`\"] = $theValue;\r\n\t\r\n/*\r\n\t\t// Field entidad\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_entidad3\"]) : $GLOBALS[\"x_entidad3\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`entidad`\"] = $theValue;\r\n*/\t\r\n\t\t// Field codigo_postal\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_codigo_postal3\"]) : $GLOBALS[\"x_codigo_postal3\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`codigo_postal`\"] = $theValue;\r\n\t\r\n\t\t// Field ubicacion\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_ubicacion3\"]) : $GLOBALS[\"x_ubicacion3\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`ubicacion`\"] = $theValue;\r\n\t\r\n\t\t// Field antiguedad\r\n\t\t$theValue = ($GLOBALS[\"x_antiguedad3\"] != \"\") ? intval($GLOBALS[\"x_antiguedad3\"]) : \"0\";\r\n\t\t$fieldList[\"`antiguedad`\"] = $theValue;\r\n\t\r\n\t\t// Field vivienda_tipo_id\r\n\t\t$theValue = ($GLOBALS[\"x_vivienda_tipo_id2\"] != \"\") ? intval($GLOBALS[\"x_vivienda_tipo_id2\"]) : \"0\";\r\n\t\t$fieldList[\"`vivienda_tipo_id`\"] = $theValue;\r\n\t\r\n\t\t// Field otro_tipo_vivienda\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_otro_tipo_vivienda3\"]) : $GLOBALS[\"x_otro_tipo_vivienda3\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`otro_tipo_vivienda`\"] = $theValue;\r\n\t\r\n\t\t// Field telefono\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_telefono3\"]) : $GLOBALS[\"x_telefono3\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`telefono`\"] = $theValue;\r\n\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_telefono3_sec\"]) : $GLOBALS[\"x_telefono3_sec\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`telefono_movil`\"] = $theValue;\r\n\t\r\n\t\t// Field telefono_secundario\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_telefono_secundario3\"]) : $GLOBALS[\"x_telefono_secundario3\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`telefono_secundario`\"] = $theValue;\r\n\t\r\n\t\t// insert into database\r\n\t\t$sSql = \"INSERT INTO `direccion` (\";\r\n\t\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t\t$sSql .= \") VALUES (\";\r\n\t\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t\t$sSql .= \")\";\r\n\t\r\n\t\t$x_result = phpmkr_query($sSql, $conn);\r\n\t\tif(!$x_result){\r\n\t\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\t\texit();\r\n\t\t}\r\n\r\n\r\n\t//DOM NEG AVAL\r\n\t\r\n\t\t$fieldList = NULL;\r\n\t\t// Field cliente_id\r\n\t//\t$theValue = ($GLOBALS[\"x_cliente_id\"] != \"\") ? intval($GLOBALS[\"x_cliente_id\"]) : \"NULL\";\r\n\t\t$fieldList[\"`cliente_id`\"] = 0;\r\n\t\r\n\t\t// Field aval_id\r\n\t//\t$theValue = ($GLOBALS[\"x_aval_id\"] != \"\") ? intval($GLOBALS[\"x_aval_id\"]) : \"NULL\";\r\n\t\t$fieldList[\"`aval_id`\"] = $x_aval_id;\r\n\t\r\n\t\t// Field promotor_id\r\n\t//\t$theValue = ($GLOBALS[\"x_promotor_id\"] != \"\") ? intval($GLOBALS[\"x_promotor_id\"]) : \"NULL\";\r\n\t\t$fieldList[\"`promotor_id`\"] = 0;\r\n\t\r\n\t\t// Field direccion_tipo_id\r\n\t//\t$theValue = ($GLOBALS[\"x_direccion_tipo_id\"] != \"\") ? intval($GLOBALS[\"x_direccion_tipo_id\"]) : \"NULL\";\r\n\t\t$fieldList[\"`direccion_tipo_id`\"] = 4;\r\n\t\r\n\t\t// Field calle\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_calle3_neg\"]) : $GLOBALS[\"x_calle3_neg\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`calle`\"] = $theValue;\r\n\t\r\n\t\t// Field colonia\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_colonia3_neg\"]) : $GLOBALS[\"x_colonia3_neg\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`colonia`\"] = $theValue;\r\n\t\r\n\t\t// Field delegacion_id\r\n\t\t$theValue = ($GLOBALS[\"x_delegacion_id3_neg\"] != \"\") ? intval($GLOBALS[\"x_delegacion_id3_neg\"]) : \"0\";\r\n\t\t$fieldList[\"`delegacion_id`\"] = $theValue;\r\n\t\r\n\t\t// Field propietario\r\n/*\t\t\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_propietario2\"]) : $GLOBALS[\"x_propietario2\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`propietario`\"] = $theValue;\r\n*/\t\r\n/*\r\n\t\t// Field entidad\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_entidad3\"]) : $GLOBALS[\"x_entidad3\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`entidad`\"] = $theValue;\r\n*/\t\r\n\t\t// Field codigo_postal\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_codigo_postal3_neg\"]) : $GLOBALS[\"x_codigo_postal3_neg\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`codigo_postal`\"] = $theValue;\r\n\t\r\n\t\t// Field ubicacion\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_ubicacion3_neg\"]) : $GLOBALS[\"x_ubicacion3_neg\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`ubicacion`\"] = $theValue;\r\n\t\r\n\t\t// Field antiguedad\r\n\t\t$theValue = ($GLOBALS[\"x_antiguedad3_neg\"] != \"\") ? intval($GLOBALS[\"x_antiguedad3_neg\"]) : \"0\";\r\n\t\t$fieldList[\"`antiguedad`\"] = $theValue;\r\n\t\r\n\t\t// Field vivienda_tipo_id\r\n\t\t$theValue = ($GLOBALS[\"x_vivienda_tipo_id2_neg\"] != \"\") ? intval($GLOBALS[\"x_vivienda_tipo_id2_neg\"]) : \"0\";\r\n\t\t$fieldList[\"`vivienda_tipo_id`\"] = $theValue;\r\n\t\r\n\t\t// Field otro_tipo_vivienda\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_propietario3_neg\"]) : $GLOBALS[\"x_propietario3_neg\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`propietario`\"] = $theValue;\r\n\t\r\n\t\t// Field telefono\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_telefono3_neg\"]) : $GLOBALS[\"x_telefono3_neg\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`telefono`\"] = $theValue;\r\n\t\r\n\t\t// Field telefono_secundario\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_telefono_secundario3_neg\"]) : $GLOBALS[\"x_telefono_secundario3_neg\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`telefono_secundario`\"] = $theValue;\r\n\t\r\n\t\t// insert into database\r\n\t\t$sSql = \"INSERT INTO `direccion` (\";\r\n\t\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t\t$sSql .= \") VALUES (\";\r\n\t\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t\t$sSql .= \")\";\r\n\t\r\n\t\t$x_result = phpmkr_query($sSql, $conn);\r\n\t\tif(!$x_result){\r\n\t\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\t\texit();\r\n\t\t}\r\n\r\n\r\n\r\n\t//Ingresos AVAL\r\n\t$fieldList = NULL;\r\n\t// Field cliente_id\r\n//\t$theValue = ($GLOBALS[\"x_cliente_id\"] != \"\") ? intval($GLOBALS[\"x_cliente_id\"]) : \"NULL\";\r\n\t$fieldList[\"`aval_id`\"] = $x_aval_id;\r\n\r\n\t// Field ingresos_negocio\r\n\t$theValue = ($GLOBALS[\"x_ingresos_mensuales\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_ingresos_mensuales\"]) . \"'\" : \"0\";\r\n\t$fieldList[\"`ingresos_negocio`\"] = $theValue;\r\n\r\n\t// Field ingresos_familiar_1\r\n\t$theValue = ($GLOBALS[\"x_ingresos_familiar_1_aval\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_ingresos_familiar_1_aval\"]) . \"'\" : \"0\";\r\n\t$fieldList[\"`ingresos_familiar_1`\"] = $theValue;\r\n\r\n\t// Field parentesco_tipo_id\r\n\t$theValue = ($GLOBALS[\"x_parentesco_tipo_id_ing_1_aval\"] != \"\") ? intval($GLOBALS[\"x_parentesco_tipo_id_ing_1_aval\"]) : \"0\";\r\n\t$fieldList[\"`parentesco_tipo_id`\"] = $theValue;\r\n\r\n\t// Field ingresos_familiar_2\r\n//\t$theValue = ($GLOBALS[\"x_ingresos_familiar_2\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_ingresos_familiar_2\"]) . \"'\" : \"NULL\";\r\n\t$fieldList[\"`ingresos_familiar_2`\"] = 0;\r\n\r\n\t// Field parentesco_tipo_id2\r\n//\t$theValue = ($GLOBALS[\"x_parentesco_tipo_id_ing_2\"] != \"\") ? intval($GLOBALS[\"x_parentesco_tipo_id_ing_2\"]) : \"0\";\r\n\t$fieldList[\"`parentesco_tipo_id2`\"] = 0;\r\n\r\n\t// Field otros_ingresos\r\n\t$theValue = ($GLOBALS[\"x_otros_ingresos_aval\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_otros_ingresos_aval\"]) . \"'\" : \"0\";\r\n\t$fieldList[\"`otros_ingresos`\"] = $theValue;\r\n\r\n\t$theValue = ($GLOBALS[\"x_origen_ingresos_aval\"] != \"\") ? \" '\" . $GLOBALS[\"x_origen_ingresos_aval\"] . \"'\" : \"NULL\";\r\n\t$fieldList[\"`origen_ingresos`\"] = $theValue;\r\n\r\n\t$theValue = ($GLOBALS[\"x_origen_ingresos_aval2\"] != \"\") ? \" '\" . $GLOBALS[\"x_origen_ingresos_aval2\"] . \"'\" : \"NULL\";\r\n\t$fieldList[\"`origen_ingresos_fam_1`\"] = $theValue;\r\n\r\n\t// insert into database\r\n\t$sSql = \"INSERT INTO `ingreso_aval` (\";\r\n\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t$sSql .= \") VALUES (\";\r\n\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t$sSql .= \")\";\r\n\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t \texit();\r\n\t}\r\n\r\n\t\r\n\r\n\r\n\t\t\r\n\t}\r\n\r\n//GARANTIAS\r\n\r\n\tif($GLOBALS[\"x_garantia_desc\"] != \"\"){\r\n\t\t$fieldList = NULL;\r\n\t\t// Field cliente_id\r\n\t//\t$theValue = ($GLOBALS[\"x_cliente_id\"] != \"\") ? intval($GLOBALS[\"x_cliente_id\"]) : \"NULL\";\r\n\t\t$fieldList[\"`solicitud_id`\"] = $x_solicitud_id;\r\n\t\r\n\t\t// Field descripcion\r\n\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_garantia_desc\"]) : $GLOBALS[\"x_garantia_desc\"]; \r\n\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`descripcion`\"] = $theValue;\r\n\t\r\n\t\t// Field valor\r\n\t\t$theValue = ($GLOBALS[\"x_garantia_valor\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_garantia_valor\"]) . \"'\" : \"NULL\";\r\n\t\t$fieldList[\"`valor`\"] = $theValue;\r\n\t\r\n\t\r\n\t\t// insert into database\r\n\t\t$sSql = \"INSERT INTO `garantia` (\";\r\n\t\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t\t$sSql .= \") VALUES (\";\r\n\t\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t\t$sSql .= \")\";\r\n\t\t$x_result = phpmkr_query($sSql, $conn);\r\n\t\tif(!$x_result){\r\n\t\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\t\texit();\r\n\t\t}\r\n\r\n\t}\r\n\r\n\r\n//INGRESOS\r\n\r\n\t$fieldList = NULL;\r\n\t// Field cliente_id\r\n//\t$theValue = ($GLOBALS[\"x_cliente_id\"] != \"\") ? intval($GLOBALS[\"x_cliente_id\"]) : \"NULL\";\r\n\t$fieldList[\"`solicitud_id`\"] = $x_solicitud_id;\r\n\r\n\t// Field ingresos_negocio\r\n\t$theValue = ($GLOBALS[\"x_ingresos_negocio\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_ingresos_negocio\"]) . \"'\" : \"NULL\";\r\n\t$fieldList[\"`ingresos_negocio`\"] = $theValue;\r\n\r\n\t// Field ingresos_familiar_1\r\n\t$theValue = ($GLOBALS[\"x_ingresos_familiar_1\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_ingresos_familiar_1\"]) . \"'\" : \"NULL\";\r\n\t$fieldList[\"`ingresos_familiar_1`\"] = $theValue;\r\n\r\n\t// Field parentesco_tipo_id\r\n\t$theValue = ($GLOBALS[\"x_parentesco_tipo_id_ing_1\"] != \"\") ? intval($GLOBALS[\"x_parentesco_tipo_id_ing_1\"]) : \"0\";\r\n\t$fieldList[\"`parentesco_tipo_id`\"] = $theValue;\r\n\r\n\t// Field ingresos_familiar_2\r\n\t$theValue = ($GLOBALS[\"x_ingresos_familiar_2\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_ingresos_familiar_2\"]) . \"'\" : \"NULL\";\r\n\t$fieldList[\"`ingresos_familiar_2`\"] = $theValue;\r\n\r\n\t// Field parentesco_tipo_id2\r\n\t$theValue = ($GLOBALS[\"x_parentesco_tipo_id_ing_2\"] != \"\") ? intval($GLOBALS[\"x_parentesco_tipo_id_ing_2\"]) : \"0\";\r\n\t$fieldList[\"`parentesco_tipo_id2`\"] = $theValue;\r\n\r\n\t// Field otros_ingresos\r\n\t$theValue = ($GLOBALS[\"x_otros_ingresos\"] != \"\") ? \" '\" . doubleval($GLOBALS[\"x_otros_ingresos\"]) . \"'\" : \"NULL\";\r\n\t$fieldList[\"`otros_ingresos`\"] = $theValue;\r\n\r\n\t$theValue = ($GLOBALS[\"x_origen_ingresos\"] != \"\") ? \" '\" . $GLOBALS[\"x_origen_ingresos\"] . \"'\" : \"NULL\";\r\n\t$fieldList[\"`origen_ingresos`\"] = $theValue;\r\n\r\n\r\n\t$theValue = ($GLOBALS[\"x_origen_ingresos2\"] != \"\") ? \" '\" . $GLOBALS[\"x_origen_ingresos2\"] . \"'\" : \"NULL\";\r\n\t$fieldList[\"`origen_ingresos_fam_1`\"] = $theValue;\r\n\r\n\t$theValue = ($GLOBALS[\"x_origen_ingresos3\"] != \"\") ? \" '\" . $GLOBALS[\"x_origen_ingresos3\"] . \"'\" : \"NULL\";\r\n\t$fieldList[\"`origen_ingresos_fam_2`\"] = $theValue;\r\n\r\n\r\n\t// insert into database\r\n\t$sSql = \"INSERT INTO `ingreso` (\";\r\n\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t$sSql .= \") VALUES (\";\r\n\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t$sSql .= \")\";\r\n\r\n\t$x_result = phpmkr_query($sSql, $conn);\r\n\tif(!$x_result){\r\n\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\tphpmkr_query('rollback;', $conn);\t \r\n\t \texit();\r\n\t}\r\n\r\n\r\n\r\n//REFERENCIAS CICLO\r\n\r\n\r\n\t$x_counter = 1;\r\n\twhile($x_counter < 6){\r\n\r\n\t\t$fieldList = NULL;\r\n\t\t// Field cliente_id\r\n//\t\t$theValue = ($GLOBALS[\"x_cliente_id\"] != \"\") ? intval($GLOBALS[\"x_cliente_id\"]) : \"NULL\";\r\n\t\t$fieldList[\"`solicitud_id`\"] = $x_solicitud_id;\r\n\r\n\r\n\t\tif($GLOBALS[\"x_nombre_completo_ref_$x_counter\"] != \"\"){\r\n\t\t\r\n\t\t\t// Field nombre_completo\r\n\t\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_nombre_completo_ref_$x_counter\"]) : $GLOBALS[\"x_nombre_completo_ref_$x_counter\"]; \r\n\t\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t\t$fieldList[\"`nombre_completo`\"] = $theValue;\r\n\t\t\r\n\t\t\t// Field telefono\r\n\t\t\t$theValue = (!get_magic_quotes_gpc()) ? addslashes($GLOBALS[\"x_telefono_ref_$x_counter\"]) : $GLOBALS[\"x_telefono_ref_$x_counter\"]; \r\n\t\t\t$theValue = ($theValue != \"\") ? \" '\" . $theValue . \"'\" : \"NULL\";\r\n\t\t\t$fieldList[\"`telefono`\"] = $theValue;\r\n\t\t\r\n\t\t\t// Field parentesco_tipo_id\r\n\t\t\t$theValue = ($GLOBALS[\"x_parentesco_tipo_id_ref_$x_counter\"] != \"\") ? intval($GLOBALS[\"x_parentesco_tipo_id_ref_$x_counter\"]) : \"NULL\";\r\n\t\t\t$fieldList[\"`parentesco_tipo_id`\"] = $theValue;\r\n\t\t\r\n\t\t\t// insert into database\r\n\t\t\t$sSql = \"INSERT INTO `referencia` (\";\r\n\t\t\t$sSql .= implode(\",\", array_keys($fieldList));\r\n\t\t\t$sSql .= \") VALUES (\";\r\n\t\t\t$sSql .= implode(\",\", array_values($fieldList));\r\n\t\t\t$sSql .= \")\";\r\n\t\t\r\n\t\t\t$x_result = phpmkr_query($sSql, $conn);\r\n\t\t\tif(!$x_result){\r\n\t\t\t\techo phpmkr_error() . '<br>SQL: ' . $sSql;\r\n\t\t\t\tphpmkr_query('rollback;', $conn);\t \r\n\t\t\t\texit();\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\r\n\t\t$x_counter++;\r\n\t}\r\n\r\n\tphpmkr_query('commit;', $conn);\t \r\n\t\r\n\treturn true;\r\n}",
"public function starttrans(){\n\t\t$this->transaction = true;\n\t\t$this->query(\"START TRANSACTION\");\n\t}",
"protected static function commitTransaction()\n\t{\n\t\tAbstractUnit::commitTransaction();\n\t}",
"function _lock_tree_table()\n\t{\n\t\tee()->db->query(\"LOCK TABLE \" .$this->tree_table . \" WRITE\");\n\t}",
"public function TransferStockTransaction($post){\r\n\t\t$db=$this->getAdapter();\r\n\t\t$session_user = new Zend_Session_Namespace('auth');\r\n\t\t$userName = $session_user->user_name;\r\n\t\t$GetUserId = $session_user->user_id;\r\n\t\r\n\t\t$db_global = new Application_Model_DbTable_DbGlobal();\r\n\t\t\n\t\tif($post['from_location']!== $post['to_location']){\n\t\t\t//try{\n\t\t\t\n\t\t\t\t\tif($post['invoce_num']!=\"\"){\n\t\t\t\t\t\t\n\t\t\t\t\t\t$tr_no=$post['invoce_num'];\n\t\t\t\t\t}\n\t\t\t\t\telse{\r\n\t\t\t\t\t\t$date= new Zend_Date();\r\n\t\t\t\t\t\t$tr_no=\"TR\".$date->get('hh-mm-ss');\r\n\t\t\t\t\t}\n\t\t\t\t $data_transfer=array(\r\n\t\t\t\t\t\t\t\t\t\t'invoice_num'\t=> $tr_no,\r\n\t\t\t\t\t\t\t\t\t\t'transfer_date' => $post['transfer_date'],\r\n\t\t\t\t\t\t\t\t\t\t'from_location'\t=> $post['from_location'],\r\n\t\t\t\t\t\t\t\t\t\t'to_location'\t=> $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t\t'user_id' \t\t=> $GetUserId,\r\n\t\t\t\t\t\t\t\t\t\t'mod_date'\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t\t'remark'\t => $post['remark_transfer']\r\n\t\t\t\t\t\t\t\t );\r\n\t\t\t\t\t$transfer_id = $db_global->addRecord($data_transfer, \"tb_stocktransfer\");\r\n\t\t\t\t unset($data_transfer);\n\t\t\t\t $identity = explode(',',$post['identity']);\r\n\t\t\t\t\tforeach($identity as $i){\r\n\t\t\t\t\t \t\t\t\t$data_item=array(\r\n\t\t\t\t\t\t\t\t\t\t'transfer_id'\t => $transfer_id,\n\t\t\t\t\t\t\t\t\t\t'pro_id'\t\t => $post['item_id_'.$i],\r\n\t\t\t\t\t \t\t\t\t\t'qty'\t\t\t => $post['qty_id_'.$i],\r\n\t\t\t\t\t \t\t\t\t\t'remark_transfer'=> $post['remark_'.$i]\r\n\t\t\r\n\t\t\t\t\t\t\t\t\t );\r\n\t\t\t\t \t\t\t\t $db->insert(\"tb_transfer_item\", $data_item);\r\n\t\t\t\t\t \t\t\t\tunset($data_item);\r\n\t\t\r\n\t\t\t\t\t$rows = $db_global ->porductLocationExist($post['item_id_'.$i], $post['from_location']);\r\n\t\t\t\t\tif($rows){\r\n\t\t\t\t\t\t//update poduct location from\r\n\t\t\t\t\t\t$data_qty_location=array(\r\n\t\t\t\t\t\t\t\t'qty' \t\t\t=>\t$rows['qty']- $post['qty_id_'.$i],\n\t\t\t\t\t\t\t\t'qty_avaliable'\t=> $rows[\"qty_avaliable\"]- $post['qty_id_'.$i],\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\t$db_global->updateRecord($data_qty_location, $rows['ProLocationID'], \"ProLocationID\",\"tb_prolocation\");\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t//add move history\r\n\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t'transaction_type' => 2,\r\n\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['from_location'],\r\n\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],\r\n\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t'qty_before' => $rows['qty'],\r\n\t\t\t\t\t\t\t\t'qty_after' \t=> $rows['qty']- $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\tunset($data_qty_location);unset($rows);unset($data_history);\r\n\t\t\t\t\t\t//update product location to\r\n\t\t\t\t\t\t$rows_gets_qty=$db_global -> porductLocationExist($post['item_id_'.$i], $post['to_location']);\r\n\t\t\r\n\t\t\t\t\t\tif($rows_gets_qty){\r\n\t\t\t\t\t\t\t$data_qty_location=array(\r\n\t\t\t\t\t\t\t\t\t'qty' \t\t\t=>\t$rows_gets_qty['qty']\t\t\t+ $post['qty_id_'.$i],\n\t\t\t\t\t\t\t\t\t'qty_avaliable'\t=> $rows_gets_qty[\"qty_avaliable\"]\t+ $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$itemid=$db_global->updateRecord($data_qty_location, $rows_gets_qty['ProLocationID'], \"ProLocationID\",\"tb_prolocation\");\r\n\t\t\t\t\t\t\t//add move history\r\n\t\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\t'transaction_type' => 2,\r\n\t\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],//can't add remark cos short table in form\r\n\t\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_before' => $rows_gets_qty['qty'],\r\n\t\t\t\t\t\t\t\t\t'qty_after' \t=> $rows_gets_qty['qty']+ $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\n\t\t\t\t\t\t\tunset($rows_gets_qty);unset($data_history);\r\n\t\t\t\t\t\t}//if recieve deosn't exist in product location\r\n\t\t\t\t\t\telse{\r\n\t\t\t\t\t\t\t$add_pro_location = array(\r\n\t\t\t\t\t\t\t\t\t'pro_id' => $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'LocationId' => $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'qty' => $post['qty_id_'.$i],\n\t\t\t\t\t\t\t\t\t'qty_avaliable'\t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'last_usermod' => $GetUserId,\r\n\t\t\t\t\t\t\t\t\t'last_mod_date' => new Zend_Date()\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_prolocation\", $add_pro_location);\r\n\t\t\t\t\t\t\t//if receive not have\r\n\t\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\t'transaction_type' => 2,\r\n\t\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_before' => 0,\r\n\t\t\t\t\t\t\t\t\t'qty_after' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\n\t\t\t\t\t\t\tunset($add_pro_location); unset($data_history);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse{//if from doesn't exist\r\n\t\t\t\t\t\t//add qty in location if from doesn't exist\r\n\t\t\t\t\t\t$add_pro_location = array(\r\n\t\t\t\t\t\t\t\t'pro_id' => $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t'LocationId' => $post['from_location'],\r\n\t\t\t\t\t\t\t\t'qty' => -$post['qty_id_'.$i],\n\t\t\t\t\t\t\t\t'qty_avaliable'\t=> - $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t'last_usermod' => $GetUserId,\r\n\t\t\t\t\t\t\t\t'last_mod_date' => new Zend_Date()\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\t$db->insert(\"tb_prolocation\", $add_pro_location);\r\n\t\t\t\t\t\tunset($add_pro_location);\r\n\t\t\t\t\t\t//echeck for get product location\r\n\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t'transaction_type' => 1,\r\n\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['from_location'],\r\n\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],\r\n\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t'qty_after' \t=> -$post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t);\r\n\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\r\n\t\t\t\t\t\tunset($data_history);\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t//for get stock\r\n\t\t\t\t\t\t$rows_gets_qty=$db_global -> porductLocationExist($post['item_id_'.$i], $post['to_location']);\r\n\t\t\t\t\t\tif($rows_gets_qty){\r\n\t\t\t\t\t\t\t$data_qty_location=array(\r\n\t\t\t\t\t\t\t\t\t'qty' =>$rows_gets_qty['qty']+ $post['qty_id_'.$i]\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db_global->updateRecord($data_qty_location, $rows_gets_qty['ProLocationID'], \"ProLocationID\",\"tb_prolocation\");\r\n\t\t\t\t\t\t\t//add move history\r\n\t\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t\t( \t'transaction_type' => 2,\r\n\t\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_before' => $rows_gets_qty['qty'],\r\n\t\t\t\t\t\t\t\t\t'qty_after' \t=> $rows_gets_qty['qty']+ $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\n\t\t\t\t\t\t\tunset($rows_gets_qty);unset($data_qty_location);\r\n\t\t\t\t\t\t}//if recieve deosn't exist in product location\r\n\t\t\t\t\t\telse{ //if doesn't exist from and to\r\n\t\t\t\t\t\t\t$add_pro_location = array(\r\n\t\t\t\t\t\t\t\t\t'pro_id' => $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'LocationId' => $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'qty' => $post['qty_id_'.$i],\n\t\t\t\t\t\t\t\t\t'qty_avaliable'\t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'last_usermod' => $GetUserId,\r\n\t\t\t\t\t\t\t\t\t'last_mod_date' => new Zend_Date()\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_prolocation\", $add_pro_location);\n\t\t\t\t\t\t\tunset($add_pro_location);\r\n\t\t\t\t\t\t\t//if doesn't exist from and to\r\n\t\t\t\t\t\t\t$data_history = array\r\n\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\t'transaction_type' => 1,\r\n\t\t\t\t\t\t\t\t\t'pro_id' \t\t=> $post['item_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'date'\t\t\t\t=> new Zend_Date(),\r\n\t\t\t\t\t\t\t\t\t'location_id' \t\t=> $post['to_location'],\r\n\t\t\t\t\t\t\t\t\t'Remark'\t\t\t=> $post['remark_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_edit' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'qty_after' \t=> $post['qty_id_'.$i],\r\n\t\t\t\t\t\t\t\t\t'user_mod'\t\t\t=> $GetUserId\r\n\t\t\t\t\t\t\t);\r\n\t\t\t\t\t\t\t$db->insert(\"tb_move_history\", $data_history);\n\t\t\t\t\t\t\tunset($data_history);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t}//forforeach\n\t\t\t\t//$db->commit();\n\t\t /*}//try\n\t\t catch (Exception $e) {\n\t\t \t$db->rollBack();\n\t\t \t$this->view->msg = $e->getMessage();\r\n\t\t }*/\r\n\t\t}//for if\r\n\t}",
"protected static function rollbackTransaction()\n\t{\n\t\tAbstractUnit::rollbackTransaction();\n\t}",
"public function testInTransactionInMultiLevelTransaction()\n {\n $this->assertFalse($this->connection->inTransaction());\n\n // First level\n $this->connection->beginWork();\n $this->assertTrue($this->connection->inTransaction());\n\n // Second level\n $this->connection->beginWork();\n $this->assertTrue($this->connection->inTransaction());\n\n // Close first level\n $this->connection->commit();\n $this->assertTrue($this->connection->inTransaction());\n\n // Close second level\n $this->connection->commit();\n $this->assertFalse($this->connection->inTransaction());\n }",
"function RollbackTrans() {}",
"function BeginTransaction() {\r\n $this->con->autoCommit(false);\r\n \r\n }",
"public function isUnderTransaction();",
"public function __construct(){\r\n //Get db access object\r\n $this->dba=Yii::app()->db;\r\n $this->transaction=new CDbTransaction($this->dba); \r\n }",
"public function testRollbackMultipleLevels()\n {\n $this->assertFalse($this->connection->inTransaction());\n\n // First level\n $this->connection->beginWork();\n $this->assertTrue($this->connection->inTransaction());\n\n // Second level\n $this->connection->beginWork();\n $this->assertTrue($this->connection->inTransaction());\n\n // Rollback everything\n $this->connection->rollback();\n $this->assertFalse($this->connection->inTransaction());\n }",
"function head() {\n global $_lib;\n\n $query = \"select max(RemittanceDaySequence) from invoicein where RemittanceSendtDateTime='\" . $_lib['sess']->get_session('Date') . \"' and Active=1\";\n #print \"Finn h¿yeste dag sekvens: $query\";\n $daysequence = $_lib['storage']->get_row(array('query' => $query));\n\n $query = \"select max(RemittanceSequence) from invoicein where Active=1\";\n #print \"Finn h¿yeste sekvens: $query\";\n $sequence = $_lib['storage']->get_row(array('query' => $query));\n \n #print \"<h2>Her kommer remitteringsfila på TelePay 2.0.1 formatet</h2>\";\n $transaction = new stdClass();\n $this->transaction->RemittanceSequence = $daysequence->RemittanceSequence + 1; #M kalkuleres og settes\n $this->transaction->RemittanceDaySequence = $daysequence->RemittanceDaySequence; #M kalkuleres og settes\n\n #$this->transaction->BatchID = 99; #M kalkuleres og settes\n $this->transaction->Date = $_lib['sess']->get_session('Date');\n $this->transaction->Datetime = $_lib['sess']->get_session('Datetime');\n $this->transaction->VersionSoftware = '00001.00 LODO';\n \n $old_pattern = array(\"/[^0-9]/\");\n $new_pattern = array(\"\");\n $this->transaction->CustomerOrgNumber = strtolower(preg_replace($old_pattern, $new_pattern , $_lib['sess']->get_companydef('OrgNumber'))); \n $this->transaction->CustomerName = $_lib['sess']->get_companydef('CompanyName');\n $this->transaction->Database = $_SETUP['DB_NAME']['0'];\n \n $this->transaction->NumTransactions = 0;\n $this->transaction->TotalAmount = 0;\n $this->transaction->NumRecords = 0; \n\n if(!$InvoiceO->CustomerBankAccount) { #Sjekke lengde og modulus p kontonummer ogs\n $_lib['message']->Add(\"Betalerkonto mangler\");\n return;\n }\n if(!$this->transaction->CustomerOrgNumber) {\n $_lib['message']->Add(\"Orgnummer/personnummer mangler på betaler\");\n return;\n }\n }",
"function gaMatch_save($appGlobals){\n // $appGlobals->gb_sql->sql_transaction_start ($appGlobals); //?????????????????????\n $exists = ( ! empty($this->game_atGameId) );\n // need to update opponent array\n if ( $exists ) {\n $orgRec = new stdData_gameMatch_group;\n $orgRec->gaMatch_read($appGlobals,$this->game_atGameId, $this->game_opponents_gameId[0]);\n $orgRec->gag_updateGameTotals($appGlobals,-1);\n $orgRec->gag_updateKidPeriodTotals($appGlobals,-1);\n }\n $atGameId = $this->gaUnit_save($appGlobals);\n $this->gag_updateGameTotals($appGlobals,1);\n $this->gag_updateKidPeriodTotals($appGlobals,1);\n // $appGlobals->gb_sql->sql_transaction_end ($appGlobals);\n return $atGameId;\n // end transaction processing\n}",
"function execute() {\r\n\t\t/*\r\n\t\t * Basic Information Table\r\n\t\t */\r\n\t\t$this->setTableName('leafTranslate');\r\n\t\t$this->setPrimaryKeyName('leafTranslateId');\r\n\t\t/*\r\n\t\t * All the $_POST enviroment.\r\n\t\t */\r\n\t\tif (isset($_POST ['leafTranslateId'])) {\r\n\t\t\t$this->setLeafTranslateId($this->strict($_POST ['leafTranslateId'], 'numeric'), 0, 'single');\r\n\t\t}\r\n\t\tif (isset($_POST ['leafIdTemp'])) {\r\n\t\t\t$this->setLeafIdTemp($this->strict($_POST ['leafIdTemp'], 'numeric'));\r\n\t\t}\r\n\t\tif (isset($_POST ['leafId'])) {\r\n\t\t\t$this->setLeafId($this->strict($_POST ['leafId'], 'numeric'));\r\n\t\t}\r\n\t\tif (isset($_POST ['leafSequence'])) {\r\n\t\t\t$this->setLeafSequence($this->strict($_POST ['leafSequence'], 'memo'));\r\n\t\t}\r\n\t\tif (isset($_POST ['LeafCode'])) {\r\n\t\t\t$this->setLeafCode($this->strict($_POST ['leafCode'], 'memo'));\r\n\t\t}\r\n\t\tif (isset($_POST ['leafNative'])) {\r\n\t\t\t$this->setLeafNative($this->strict($_POST ['leafNative'], 'memo'));\r\n\t\t}\r\n\t\t/*\r\n\t\t * All the $_GET enviroment.\r\n\t\t */\r\n\t\tif (isset($_GET ['leafTranslateId'])) {\r\n\t\t\t$this->setTotal(count($_GET ['leafTranslateId']));\r\n\t\t}\r\n\r\n\t\tif (isset($_GET ['leafTranslateId'])) {\r\n\t\t\tif (is_array($_GET ['leafTranslateId'])) {\r\n\t\t\t\t$this->leafTranslateId = array();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (isset($_GET ['isDefault'])) {\r\n\t\t\tif (is_array($_GET ['isDefault']) ) {\r\n\t\t\t\t$this->isDefault = array();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (isset($_GET ['isNew']) ) {\r\n\t\t\tif (is_array($_GET ['isNew'])) {\r\n\t\t\t\t$this->isNew = array();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (isset($_GET ['isDraft']) ) {\r\n\t\t\tif (is_array($_GET ['isDraft'])) {\r\n\t\t\t\t$this->isDraft = array();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (isset($_GET ['isUpdate']) ) {\r\n\t\t\tif (is_array($_GET ['isUpdate'])) {\r\n\t\t\t\t$this->isUpdate = array();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (isset($_GET ['isDelete']) ) {\r\n\t\t\tif (is_array($_GET ['isDelete'])) {\r\n\t\t\t\t$this->isDelete = array();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (isset($_GET ['isActive']) ) {\r\n\t\t\tif (is_array($_GET ['isActive'])) {\r\n\t\t\t\t$this->isActive = array();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (isset($_GET ['isApproved']) ) {\r\n\t\t\tif (is_array($_GET ['isApproved'])) {\r\n\t\t\t\t$this->isApproved = array();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (isset($_GET ['isReview']) ) {\r\n\t\t\tif (is_array($_GET ['isReview'])) {\r\n\t\t\t\t$this->isReview = array();\r\n\t\t\t}\r\n\t\t}\r\n\t\tif (isset($_GET ['isPost']) ) {\r\n\t\t\tif (is_array($_GET ['isPost'])) {\r\n\t\t\t\t$this->isPost = array();\r\n\t\t\t}\r\n\t\t}\r\n\t\t$primaryKeyAll = '';\r\n\t\tfor ($i = 0; $i < $this->getTotal(); $i++) {\r\n\t\t\tif (isset($_GET ['leafTranslateId'])) {\r\n\t\t\t\t$this->setLeafTranslateId($this->strict($_GET ['leafTranslateId'] [$i], 'numeric'), $i, 'array');\r\n\t\t\t}\r\n\t\t\tif (isset($_GET ['isDefault'])) {\r\n\t\t\t\tif ($_GET ['isDefault'] [$i] == 'true' ) {\r\n\t\t\t\t\t$this->setIsDefault(1, $i, 'array');\r\n\t\t\t\t} else if ($_GET ['isDefault'] [$i] == 'false') {\r\n\t\t\t\t\t$this->setIsDefault(0, $i, 'array');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (isset($_GET ['isNew'])) {\r\n\t\t\t\tif ($_GET ['isNew'] [$i] == 'true' ) {\r\n\t\t\t\t\t$this->setIsNew(1, $i, 'array');\r\n\t\t\t\t} else if ($_GET ['isNew'] [$i] == 'false') {\r\n\t\t\t\t\t$this->setIsNew(0, $i, 'array');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (isset($_GET ['isDraft'])) {\r\n\t\t\t\tif ($_GET ['isDraft'] [$i] == 'true') {\r\n\t\t\t\t\t$this->setIsDraft(1, $i, 'array');\r\n\t\t\t\t} else if ($_GET ['isDraft'] [$i] == 'false') {\r\n\t\t\t\t\t$this->setIsDraft(0, $i, 'array');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (isset($_GET ['isUpdate'])) {\r\n\t\t\t\tif ($_GET ['isUpdate'] [$i] == 'true' ) {\r\n\t\t\t\t\t$this->setIsUpdate(1, $i, 'array');\r\n\t\t\t\t} if ($_GET ['isUpdate'] [$i] == 'false') {\r\n\t\t\t\t\t$this->setIsUpdate(0, $i, 'array');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (isset($_GET ['isDelete'])) {\r\n\t\t\t\tif ($_GET ['isDelete'] [$i] == 'true') {\r\n\t\t\t\t\t$this->setIsDelete(1, $i, 'array');\r\n\t\t\t\t} else if ($_GET ['isDelete'] [$i] == 'false' ) {\r\n\t\t\t\t\t$this->setIsDelete(0, $i, 'array');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (isset($_GET ['isActive'])) {\r\n\t\t\t\tif ($_GET ['isActive'] [$i] == 'true' ) {\r\n\t\t\t\t\t$this->setIsActive(1, $i, 'array');\r\n\t\t\t\t} else if ($_GET ['isActive'] [$i] == 'false') {\r\n\t\t\t\t\t$this->setIsActive(0, $i, 'array');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (isset($_GET ['isApproved'])) {\r\n\t\t\t\tif ($_GET ['isApproved'] [$i] == 'true') {\r\n\t\t\t\t\t$this->setIsApproved(1, $i, 'array');\r\n\t\t\t\t} else if ($_GET ['isApproved'] [$i] == 'false') {\r\n\t\t\t\t\t$this->setIsApproved(0, $i, 'array');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (isset($_GET ['isReview'])) {\r\n\t\t\t\tif ($_GET ['isReview'] [$i] == 'true') {\r\n\t\t\t\t\t$this->setIsReview(1, $i, 'array');\r\n\t\t\t\t} else if ($_GET ['isReview'] [$i] == 'false') {\r\n\t\t\t\t\t$this->setIsReview(0, $i, 'array');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tif (isset($_GET ['isPost']) || isset($_GET ['isPostDetail']) ) {\r\n\t\t\t\tif ($_GET ['isPost'] [$i] == 'true') {\r\n\t\t\t\t\t$this->setIsPost(1, $i, 'array');\r\n\t\t\t\t} else if ($_GET ['isPost'] [$i] == 'false') {\r\n\t\t\t\t\t$this->setIsPost(0, $i, 'array');\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\t$primaryKeyAll .= $this->getLeafTranslateId($i, 'array') . \",\";\r\n\t\t}\r\n\t\t$this->setPrimaryKeyAll((substr($primaryKeyAll, 0, - 1)));\r\n\t\t/**\r\n\t\t * All the $_SESSION enviroment.\r\n\t\t */\r\n\t\tif (isset($_SESSION ['staffId'])) {\r\n\t\t\t$this->setExecuteBy($_SESSION ['staffId']);\r\n\t\t}\r\n\t\t/**\r\n\t\t * TimeStamp Value.\r\n\t\t */\r\n\t\tif ($this->getVendor() == self::MYSQL) {\r\n\t\t\t$this->setExecuteTime(\"'\" . date(\"Y-m-d H:i:s\") . \"'\");\r\n\t\t} else if ($this->getVendor() == self::MSSQL) {\r\n\t\t\t$this->setExecuteTime(\"'\" . date(\"Y-m-d H:i:s\") . \"'\");\r\n\t\t} else if ($this->getVendor() == self::ORACLE) {\r\n\t\t\t$this->setExecuteTime(\"to_date('\" . date(\"Y-m-d H:i:s\") . \"','YYYY-MM-DD HH24:MI:SS')\");\r\n\t\t}\r\n\t}",
"function beginTransaction()\n\t\t{\n\t\t\t$this->conn->beginTransaction();\n\t\t}",
"public function transactionCommit()\n\t{\n\t\treturn;\n\t}",
"public function beginTransaction() {\r\n\t\t// TODO: Implement transaction stuff.\r\n\t\t//$this->query('BEGIN TRANSACTION');\r\n\t}",
"private function beginTransaction()\n\t{\n\t\tif (self::TRANSACTION) {\n\t\t\t$this->database->beginTransaction();\n\t\t}\n\t}",
"function autorizar_esp_ckd_pm_acumulado_servicio_tecnico($id_mov){\r\n\r\nglobal $db;\t\r\n \r\n $db->starttrans();\r\n \r\n //traigo el deposito origen\r\n $sql = \"select deposito_origen from movimiento_material where id_movimiento_material = $id_mov\"; \r\n $res = sql($sql) or fin_pagina();\r\n $id_deposito_oriden = $res->fields[\"deposito_origen\"];\r\n \t \r\n //traigo el detalle de los movimientos a liberar \t \r\n $sql=\"select * from detalle_movimiento where id_movimiento_material=$id_mov\";\r\n $res = sql($sql) or fin_pagina();\r\n\r\n $comentario = \" Autorizacion de PM acumulado de servicio tecnico nro: $id_mov\";\r\n $id_tipo_movimiento = 7;\r\n\r\n //por cada detalle voy liberando las reservas del pm autorizado \r\n for($i=0;$i<$res->recordcount();$i++) {\r\n \t $id_prod_esp = $res->fields[\"id_prod_esp\"];\r\n $cantidad = $res->fields[\"cantidad\"];\r\n $id_detalle_movimiento = $res->fields[\"id_detalle_movimiento\"];\r\n descontar_reserva($id_prod_esp,$cantidad,$id_deposito_oriden,$comentario,$id_tipo_movimiento,\"\",$id_detalle_movimiento,\"\");\r\n $res->movenext(); \r\n }//del for\r\n \t \r\n \t \r\n //Inserto la Mercaderia entrante en el stock BS AS \r\n \r\n $sql = \"select * from mercaderia_entrante where id_movimiento_material = $id_mov\";\r\n $res = sql($sql) or fin_pagina();\r\n\t\t\t \r\n\t\t\t \r\n $comentario = \"Producto de lista de mercaderia entrante del PM nro: $id_mov, a travez de una Autorizacion Especial\";\r\n\t\t\t \r\n for($i=0;$i<$res->recordcount();$i++){\r\n\t $id_prod_esp = $res->fields[\"id_prod_esp\"];\r\n\t $cantidad = $res->fields[\"cantidad\"];\r\n\t $descripcion = $res->fields[\"descripcion\"]; \r\n\t //el deposito origen es San Luis que es igual a 1 segun la tabla general.depositos \r\n\t $deposito_origen='1';\r\n\t //el id_tipo_movimiento le hardcodeo uno de la tabla stock.tipo_movimiento\r\n\t $id_tipo_movimiento='13';\r\n\t //el ingreso del producto es a \"disponible\" por lo tanto la funcion no toma en cuenta los parametros que siguen\r\n\t $a_stock='disponible';\r\n\t agregar_stock($id_prod_esp,$cantidad,$deposito_origen,$comentario,$id_tipo_movimiento,$a_stock,$id_tipo_reserva,\"\",$id_detalle_movimiento,$id_licitacion,$nro_caso);\r\n\t $res->movenext();\r\n }//del for\r\n $db->completetrans();\r\n\r\n }",
"function insertTransaction($sender, $recipient, $amount, $description, $tan) {\n $connection = openDb();\n $date = date('Y-m-d');\n\n if ($amount > 10000) {\n\n //Using prepared statements and parameterized queries:\n $sql = \"INSERT INTO transactions (SENDER_ACCOUNT, RECIPIENT_ACCOUNT, AMOUNT, DESCRIPTION, STATUS, TAN_ID, DATE_CREATED) \";\n $sql.= \"VALUES (?, ?, ?, ?, 'P', ?, ?)\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"iidsss\",$sender,$recipient,$amount,$description,$tan,$date);\n } else {\n\n //Using prepared statements and parameterized queries:\n $sql = \"INSERT INTO transactions (SENDER_ACCOUNT, RECIPIENT_ACCOUNT, AMOUNT, DESCRIPTION, STATUS, TAN_ID, DATE_CREATED, APPROVED_BY, DATE_APPROVED) \";\n $sql.= \"VALUES (?, ?, ?, ?, 'A', ?, ?, 6, ?)\";\n $stmt = $connection->stmt_init();\n if(!$stmt->prepare($sql)) {\n return false;\n }\n $stmt->bind_param(\"iidssss\",$sender,$recipient,$amount,$description,$tan,$date,$date);\n }\n\n return executeNonQuery($stmt, $connection);\n}",
"abstract public function getTransactionStatus();",
"public function update_facility_transaction($msg=NULL){\n\t \t $option=$_POST['option'];\n //setting up the variables\n $id=$_POST['id'];\n\n $open=$_POST['open'];\n $recepits=$_POST['receipts'];\n $issues=$_POST['issues'];\n $adjustments=$_POST['adjustments'];\n $losses=$_POST['losses'];\n $closing=$_POST['closing'];\n $nodays=$_POST['days'];\n $drug_id=$_POST['drug_id'];\n \n \n $j=count($id);\n //updating the facility transaction table automatically\n $facility_c=$this -> session -> userdata('news');\n\t\t\t $user_id=$this -> session -> userdata('user_id');\n \n if($option!=\"update stock levels\"){\n for($i=0;$i<$j;$i++){\n $myobj = Doctrine::getTable('Facility_Transaction_Table')->find($id[$i]);\n $myobj->Opening_Balance =$open[$i];\n $myobj->Total_Receipts =$recepits[$i];\n $myobj->Total_Issues =$issues[$i];\n $myobj->Adj =$adjustments[$i];\n $myobj->Losses =$losses[$i];\n $myobj->Closing_Stock =$closing[$i];\n $myobj->Days_Out_Of_Stock =$nodays[$i];\n $myobj->save();\n }\n $note=TRUE;\n $this->new_order($note); \n }\n else{\n \t for($i=0;$i<$j;$i++){\n $myobj = Doctrine::getTable('Facility_Transaction_Table')->find($id[$i]);\n $myobj->Opening_Balance =$open[$i];\n $myobj->Total_Receipts =$recepits[$i];\n $myobj->Total_Issues =$issues[$i];\n $myobj->Adj =$adjustments[$i];\n $myobj->Losses =$losses[$i];\n $myobj->Closing_Stock =$closing[$i];\n $myobj->Days_Out_Of_Stock =$nodays[$i];\n $myobj->save();\n /*********************************************step one get the totals of the previous issues*************************/\n\t $qty_issued=0;\n\t \n $inserttransaction = Doctrine_Manager::getInstance()->\n getCurrentConnection()\n ->fetchAll(\"SELECT SUM( `qty_issued` ) AS qty_issued\n FROM facility_issues\n WHERE `facility_code` = '$facility_c'\n AND `kemsa_code` = '$drug_id[$i]' AND availability='1' \");\n\t\t\t\t \n\t\t\t\t \n\t/**********************************totals of all the issues of that particular ordering window*****************************/ \t\t\t \n\t $qty_issued= $inserttransaction[0]['qty_issued'];\t\n\tif(empty( $qty_issued)){\n\t\t $qty_issued=0;\n\t}\n//\techo \"qty_issued $qty_issued <br>\";\n\t\n\t /***********************************get the balances of the particular commodidty for that window********************************/\n\t \t\n $inserttransaction1 = Doctrine_Manager::getInstance()->\n getCurrentConnection()\n ->fetchAll(\"SELECT SUM( `balance` ) AS qty_balance\n FROM facility_stock\n WHERE `facility_code` = '$facility_c'\n AND `kemsa_code` = '$drug_id[$i]' and status='1' \");\n\t\t\t\t \n\t/**********************************totals of balances of the particular commodidty for that window*****************************/ \n\t\n $qty_bal= $inserttransaction1[0]['qty_balance'];\n//\techo \"qty bal $qty_bal <br>\";\n//\t echo \"number of issues $issues[$i]</br> \";\n\t\n\t\n\t /**********************************check if there is any difference between what the user has inputed and the acutal issues*****************************/ \n\t $slag_qty= $issues[$i]-$qty_issued;\n\t \n\t//echo \"slag $slag_qty <br>\";\n\t \n\t \n\t //$real_slag=$slag_qty;\n\t //$real_b=0;\n\t if($issues[$i]>$qty_issued && $qty_bal>=$slag_qty ){\n\t//echo \"ok <br>\";\n\n\t \t$query = Doctrine_Query::create() -> select(\"*\") -> from(\"facility_stock\")\n\t \t->where(\"Facility_Code='$facility_c' and status='1'\") ->andwhere(\"kemsa_code='$drug_id[$i]'\")->orderby('expiry_date asc');\n $drugs = $query -> execute();\n \n foreach ($drugs as $data) {\n \t$table_bal=$data->balance ; \n\t\t\t\n\t\t\t\n \t$real_b=0;\n \t$update_value=0;\n \t\n \tif($table_bal>$slag_qty&&$slag_qty>0){\n \t\t//echo \"$table_bal>$slag_qty<br>\";\n $real_b=$table_bal-$slag_qty;\n\t\t\t\t$update_value=$slag_qty;\n\t\t\t\t//echo \"real_b $real_b update_value $update_value <br>\";\n\t\t\t\t//echo $update_value.'$update_value $table_bal>=$issues[$i]</br>';\n\t\t\t\t$inserttransactiona = Doctrine_Manager::getInstance()->\n getCurrentConnection()\n ->execute(\"update facility_stock set balance=$real_b where id=$data->id \");\n \n\t\t\t\t//echo \"update facility_stock set qty_balance=$real_b where id=$data->id what to update </br>\";\n\t\t\t\t\n $mydata = array('facility_code' => $facility_c,\t'kemsa_code' => $drug_id[$i], 's11_No'=>'N/A', 'batch_no' => $data->batch_no ,\n\t\t\t\t'expiry_date' => $data->expiry_date ,'qty_issued'=>$update_value ,\n\t\t\t\t'issued_to'=>'PHARMACY','balanceAsof'=> $table_bal, 'date_issued'=>date('y-m-d'),'issued_by'=>$user_id);\n\t\t\t\t\n\t\t\t\t$u = new Facility_Issues();\n\n \t\t\t$u->fromArray($mydata);\n\n \t\t\t$u->save();\n\t\t\t\t\n \t\t\t$slag_qty=0;\n\t\t\t\t//echo \"new slag_qty $slag_qty <br>\";\n\t\t\t}\n\t\t\t\n\t\t\telseif ($table_bal<=$slag_qty &&$slag_qty>0) {\n // echo \"$table_bal<=$slag_qty<br>\";\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$update_value=$table_bal;\n\t\t\t\t$real_b=0;\n\t\t\t\t\n\t\t\t\techo \" real_b $real_b update_value $update_value <br>\";\n\t\t\t\techo \"new slag_qty $slag_qty <br>\";\n\t\t\t\t$slag_qty=$slag_qty-$table_bal;\n\t\t\t\t$inserttransactiona = Doctrine_Manager::getInstance()->\n getCurrentConnection()\n ->execute(\"update facility_stock set balance=$real_b where id=$data->id \");\n \n\t\t\t\t\n\t\t\t\t\n $mydata = array('facility_code' => $facility_c,\t'kemsa_code' => $drug_id[$i], 's11_No'=>'N/A', 'batch_no' => $data->batch_no ,\n\t\t\t\t'expiry_date' => $data->expiry_date ,'qty_issued'=>$update_value ,\n\t\t\t\t'issued_to'=>'PHARMACY','balanceAsof'=> $table_bal, 'date_issued'=>date('y-m-d'),'issued_by'=>$user_id);\n\t\t\t\t\n\t\t\t\t$u = new Facility_Issues();\n\n \t\t\t$u->fromArray($mydata);\n\n \t\t\t$u->save();\n\t\t\t\t\n\t\t\t\t\n\t\t\t}\n\t\t\t\n \t \t//echo $table_bal.'drug balance G8</br> ';\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t//echo $real_b.' slag after deduction </br>';\n\t\t\t\t//exit;\n\t /**/\n \t\t\t}\n\t\t\t//exit;\n\t\t \n\t\t }\n\t \n\t }\n $this->stock_level(\"Stock details have been updated\");\n }\n \n }",
"function trans_strict($mode = TRUE)\r\n\t{\r\n\t\t$this->db->trans_strict($mode);\r\n\t}",
"public static function beginTransaction()\n\t{\n\t\tif (self::$currentTransaction === null)\n\t\t\tself::$currentTransaction = Yii::app()->db->beginTransaction();\n\t}",
"public function openTransaction()\n {\n mysqli_query($this->databaseLink, \"SET autocommit=0;\n START TRANSACTION;\" );\n }",
"function addTransaction() {\nrequire(\"/home/course/cda540/u05/public_html/project/dbguest.php\");\n\n//It will import all variables such as $host , $user, $pass and $db\n\n//mysqli_connect() is to connect the database\n$link = mysqli_connect($host, $user, $pass, $db);\n\n//Check the connection. Give error message if any error\nif (!$link) die(\"Couldn't connect to MySQL\");\n\n\n//mysqli_select_db() is used to select the database\nmysqli_select_db($link, $db)\n or die(\"Couldn't open $db: \".mysqli_error($link));\n\n$result_cusID=(int)$_POST['customerID'];\n\n$string_itemID=$_POST['items'];\n\n$string_itemsPrice = $_POST['itemsPrice'];\n\n$result_itemID = explode(\"\\n\",$string_itemID);\n\n$result_itemPrice = explode(\"\\n\",$string_itemsPrice);\n\n$itemIDs = implode (\",\" , $result_itemID);\n\n$result_customer=mysqli_query($link,\"SELECT * FROM CUSTOMER where _id=$result_cusID\");\n\n$result_itemIDs = mysqli_query($link,\"SELECT * FROM ITEM where _id IN ('$itemIDs')\");\n\n$totalpurchaseprice = 0;\n\nforeach($result_itemPrice as $itemprice)\n{\n $totalpurchaseprice = $totalpurchaseprice+$itemprice;\n}\n\n\nif ((mysqli_num_rows($result_customer)>0)&& (mysqli_num_rows($result_itemIDs)>0))\n{\n \n $result_trans=mysqli_query($link, \"INSERT INTO TRANSACTION (discouncode,transactiondate,totalpurchaseprice,customerId) VALUES(70,now(),'$totalpurchaseprice','$result_cusID')\");\n \n $result_no=mysqli_query($link,\"SELECT transactionNumber FROM TRANSACTION ORDER BY customerId DESC LIMIT 1\");\n $obj = mysqli_fetch_object($result_no);\n $transno= $obj-> transactionNumber;\n \n foreach ($result_itemID as $itemID)\n {\n $result_transdetails=mysqli_query($link, \"INSERT INTO TRANSACTIONDETAILS (transactionNo,itemId) VALUES('$transno','$itemID')\"); \n }\n\necho '<span style=\"color:#008000;text-align:center;\">Success!!! Customer ID Found and added a new transaction...</span>';\n\n\n}\n\nelse\n{\necho '<span style=\"color:#FF0000;text-align:center;\">Sorry!!! Unable to add a new transaction (Check Customers and Items)...</span>';\n}\n\n//$string_itemID=$_POST['items'];\n\n//$result_itemID = explode(\"\\n\",$string_itemID);\n\n//$j=1;\n\n//foreach ($result_itemID as $item_val)\n//{\n//echo \"$item_val <br>\";\n//$item_intval=int(\"$item_val\");\n\n//Working\n//$result_trans=mysqli_query($link, \"INSERT INTO TRANSACTION (discouncode,transactiondate,totalpurchaseprice,customerId) VALUES(70,'2019jun21',13.14,1)\");\n//$result_no=mysqli_query($link,\"SELECT transactionNumber FROM TRANSACTION ORDER BY customerId DESC LIMIT 1\");\n\n//$value = mysql_fetch_object($result_no);\n//$transno = $value->transactionNumber;\n//echo \"$transno\";\n//$result_transdetails=mysqli_query($link, \"INSERT INTO TRANSACTIONDETAILS (transactionNo,itemId) VALUES(5,1)\");\n//$j=$j+1;\n//}\n\n\n//mysqli_query will execute the query and stores into $result\n\n//mysqli_query($link, \"INSERT INTO TRANSACTIONDETAILS (transactionNo,itemId) VALUES('$result')\");\n//Close the connection\nmysqli_close($link);\n\n}",
"public function commitTransaction()\n {\n\t\treturn $this->db->fireFastSqlQuery(\"COMMIT\");\n\t}",
"public function beginTransaction()\r\n {\r\n ++$this->_txns;\r\n if ($this->_txns == 1) {\r\n $this->getMaster()->beginTransaction();\r\n }\r\n }",
"public static function beginTransaction() {\n\t\t\n\t\tself::$isTransaction = true;\n\t\tforeach (self::$con as $instanceName => $instance) {\n\t\t\t$instance->beginTransaction();\n\t\t}\n\t}",
"function sfgov_utilities_deploy_08_field_transactions_migration() {\n try {\n $transactionNodes = Utility::getNodes('transaction');\n $relatedServicesFieldMigration = new TopLevelFieldMigration();\n $relatedServicesFieldMigration->migrate($transactionNodes, 'field_transactions', 'field_related_content');\n } catch(\\Exception $e) {\n error_log($e->getMessage(), \"\\n\");\n }\n}",
"public function beginTransaction()\n {\n \t// Get writable adapter.\n\t\t$this->_adapter = self::_getAdapterFromPool('master');\n\t\t\n\t\t// Begin a transaction.\n\t\t$successFlag = $this->_adapter->beginTransaction();\n\t\t\n\t\tif ($successFlag) {\n\t\t\t// If begining transaction is successful, set $_isInTransaction flag to true.\n\t\t\t// Once $_isInTransaction = ture, all the adpater return by CrFramework_Db_Control::getAdapter\n\t\t\t// will be master.\n\t\t\tself::$_isInTransaction = true;\n\t\t}\n\t\t\n\t\treturn $successFlag;\n }",
"public function delegateTransactionSupport(array &$connection_options = []);",
"public function doTransaction()\n {\n \t// getting the db adapter\n \t$dbAdapter = \\Zend\\Db\\TableGateway\\Feature\\GlobalAdapterFeature::getStaticAdapter();\n\n \t$stack = $this->transactionStack;\n\n \tif (count($stack)) {\n \t\t/*\n \t\t * begin transaction\n \t\t */\n \t\t$dbAdapter->getDriver()->getConnection()->beginTransaction();\n\n \t\t$overAllSuccess = true;\n\n \t\tforeach ($stack as $action) {\n \t\t\t$serviceObject = $action[\"object\"];\n \t\t\t$serviceMethod = $action[\"method\"];\n\n \t\t\t$actionResult = $serviceObject->$serviceMethod();\n\n \t\t\tif ($actionResult) {\n \t\t\t\tcontinue;\n \t\t\t}else {\n \t\t\t\t$overAllSuccess = false;\n \t\t\t\tbreak;\n \t\t\t}\n \t\t}\n\n \t\t// check for overall success\n \t\tif ($overAllSuccess) {\n \t\t\t/*\n \t\t\t * commit\n \t\t\t */\n \t\t\t$dbAdapter->getDriver()->getConnection()->commit();\n\n \t\t\t// clearing stack\n \t\t\tunset($this->transactionStack);\n \t\t\t$this->transactionStack = array();\n\n \t\t\treturn true;\n \t\t}else {\n \t\t\t/*\n \t\t\t * rollback\n \t\t\t */\n \t\t\t$dbAdapter->getDriver()->getConnection()->rollback();\n\n \t\t\treturn false;\n \t\t}\n \t}else {\n \t\t// there is no any method in transaction to call\n \t\treturn false;\n \t}\n }",
"function chawa_db_transactions_install() {\n\tglobal $wpdb;\n\tglobal $chawa_table_ver_transactions;\n\n\t$table_name = $wpdb->prefix . 'chawa_transactions';\n\t\n\t$charset_collate = $wpdb->get_charset_collate();\n\n\t$sql = \"CREATE TABLE $table_name (\n\t\ttransaction_id varchar(50) DEFAULT 'chawa_000000000000000000000000' NOT NULL,\n\t\ttransaction_type varchar(50) NOT NULL,\n\t\ttransaction_status varchar(50) NOT NULL,\n\t\tsource_id varchar(50) NOT NULL,\n\t\tsource_status varchar(50) NOT NULL,\n\t\tcharge_id varchar(50) NOT NULL,\n\t\tcharge_status varchar(50) NOT NULL,\n\t\tuser_id mediumint(9) NOT NULL,\n\t\tamount varchar(50) NOT NULL,\n\t\trecurring BOOLEAN,\n\t\ttime datetime NOT NULL,\n\t\tPRIMARY KEY (transaction_id)\n\t) $charset_collate;\";\n\n\trequire_once(ABSPATH . 'wp-admin/includes/upgrade.php');\n\tdbDelta($sql);\n\n\tadd_option('chawa_table_ver_transactions', $chawa_table_ver_transactions);\n}",
"function insertagltrans($db, $type, $typeno, $periodo, $account, $narrative, $tag, $amount){\n\t$ISQL=\"INSERT INTO gltrans (type,\n\t\t\ttypeno,\n\t\t\ttrandate,\n\t\t\tperiodno,\n\t\t\taccount,\n\t\t\tnarrative,\n\t\t\ttag,\n\t\t\tamount)\n\t\tVALUES (\" . $type . \",\n\t\t\t\" . $typeno . \",\n\t\t\tNow(),\n\t\t\t\" . $periodo . \",\n\t\t\t'\" . $account . \"',\n\t\t\t'\" . $narrative . \"',\n\t\t\t\" . $tag . \",\n\t\t\t\" . $amount . ')';\n\t\t\t\n\t$DbgMsg = _('El SQL fallo al insertar la transaccion de Contabilidad para las cuentas puentes de caja:');\n\t$ErrMsg = _('No se pudo insertar la Transaccion Contable para la cuenta puente de caja');\n\t$Result = DB_query($ISQL,$db,$ErrMsg,$DbgMsg,true);\n\t$IDgltrans = DB_Last_Insert_ID($db,'gltrans','counterindex');\n\treturn $IDgltrans;\n}",
"function select_sqliTransaction($select_query,$expectedResult) {\n $connection = selectConnectionString();\n mysqli_autocommit($connection,FALSE);\n mysqli_query($connection,\"start transaction\");\n $queryresult = mysqli_query($connection, $select_query); \n $numRows = mysqli_affected_rows($connection);\n if (! $queryresult){\n echo('Database error: ' . mysqli_error($connection));\n exit;\n } \n if($numRows != $expectedResult){\n include(\"logs/logsMail.php\");\n mysqli_query($connection,\"rollback\");\n }else{\n mysqli_query($connection,\"commit\");\n }\n mysqli_close($connection);\n return $queryresult;\n }",
"abstract protected function doTransload();",
"protected function beginTransaction()\n\t{\n\t\t$this->db->beginTransaction();\n\t}",
"function processTransaction($data){\n\n\t\t$bmtProducts = array( // todo add more products \n\t\t\t91390007 => '50',\n\t\t\t91390006 => '10',\n\t\t\t91390005 => '25',\n\t\t\t91390009 => '100',\n\t\t\t91390008 => '75',\n\t\t\t\n\t\t);\n\t \n\t $sessionId = $data['ccom'];\n\t $pid = $data['productid'];\n\t \n\t $value = $bmtProducts[$pid];\n\t \n\t \t$file = 'people.log';\n\t\t$person = \"\".json_encode($data).\"\\n\";\n\n\t\tfile_put_contents($file, $person, FILE_APPEND | LOCK_EX);\n\t\t\n\t\t/** get member info by session ID **/\n\t\t$rows = getMemberInfoBySessionId($sessionId);\n\t\taddPoints($data, $rows, $value);\n\n\t\t\n\t}",
"public function start_tran()\n {\n $this->execute('START TRANSACTION;');\n }",
"function _nested_db_tree()\r\n\t{\r\n\t\t$this->_release_lock(true);\r\n\t}",
"public function inTransaction(): bool;",
"public static function fail_transaction()\n {\n if (!self::hasMasterDB()) {\n return;\n }\n\n self::getMasterDB()->FailTrans();\n }"
] | [
"0.7083126",
"0.7083126",
"0.688926",
"0.66846967",
"0.6630385",
"0.6603676",
"0.6504352",
"0.6468814",
"0.641008",
"0.64052033",
"0.64019424",
"0.63671505",
"0.63671505",
"0.63671505",
"0.6310681",
"0.62763923",
"0.62763923",
"0.62243026",
"0.62088925",
"0.6182027",
"0.61798716",
"0.61583513",
"0.6140738",
"0.6129167",
"0.6123309",
"0.611483",
"0.6051458",
"0.60512024",
"0.6039485",
"0.5961374",
"0.5961292",
"0.5952498",
"0.5952241",
"0.594903",
"0.5940765",
"0.5917839",
"0.59170103",
"0.5897125",
"0.5875072",
"0.5868218",
"0.5859377",
"0.5846385",
"0.5839424",
"0.58248043",
"0.58182746",
"0.5799882",
"0.57860786",
"0.57422245",
"0.57363755",
"0.5731432",
"0.5721973",
"0.5695053",
"0.5686694",
"0.5667666",
"0.5656453",
"0.5655926",
"0.564629",
"0.5639959",
"0.56379855",
"0.5634711",
"0.56307304",
"0.56182104",
"0.56158215",
"0.5611569",
"0.560543",
"0.5597898",
"0.55700547",
"0.55653006",
"0.55601287",
"0.5550015",
"0.55382454",
"0.55374134",
"0.5533552",
"0.55328876",
"0.55204046",
"0.55177987",
"0.5512929",
"0.5508297",
"0.55030626",
"0.5495243",
"0.5491008",
"0.5489429",
"0.5478244",
"0.5477859",
"0.54778564",
"0.5463029",
"0.54615235",
"0.54610234",
"0.5457807",
"0.54519236",
"0.54402757",
"0.5436309",
"0.5428689",
"0.54277253",
"0.5422068",
"0.5421303",
"0.5419746",
"0.54191357",
"0.53937113",
"0.5388732"
] | 0.6014221 | 29 |
/ This function is called on end of script execution to cancel all aborted transactions (if any) | function cancel_transaction()
{
global $transaction_level;
if ($transaction_level) {
db_query("ROLLBACK", "could not cancel a transaction");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function cancel()\n {\n $this->_statement =null;\n }",
"function abort() {\n $this->aborted = TRUE;\n }",
"public function rollbackTransaction() {\r\n\t\t// TODO: Implement transaction stuff.\r\n\t\t//$this->query('ROLLBACK TRANSACTION');\r\n\t}",
"public function cancel()\n\t{\n\t\t$this->pdoStatement = null;\n\t}",
"function EndStartRun()\n {\n if ($this->transaction_in_progress) \n {\n $this->db->CompleteTrans();\n $this->transaction_in_progress =false;\n }\n }",
"public final static function endTx() {\n // Fail due to calling endTx without initiating a transaction\n assert(self::$numTransactions > 0);\n\n // Track the number of transaction-close calls so we know when to\n // close the actual db transaction.\n --self::$numTransactions;\n\n // Short circuit so we wait to close the encapsulating transaction\n if (self::$numTransactions > 0) {\n return;\n }\n\n // Fail due to non-existant transaction\n assert(isset(self::$databaseHandle));\n\n try {\n // Conclude transaction\n self::$databaseHandle->commit();\n // Close connection \n self::$databaseHandle = null;\n } catch (PDOException $e) {\n self::$databaseHandle->rollback();\n die(\"\\nERROR: \" . $e->getMessage() . \"\\n\");\n }\n\n // Remove assets\n self::deleteAssets();\n\n // Invalidate prepared statement cache\n self::$fetchAllRecordsPreparedStatementCache = null;\n self::$deleteRecordPreparedStatementCache = null;\n self::$insertRecordPreparedStatementCache = null;\n self::$fetchRecordPreparedStatementsCacheTable = null;\n }",
"function endTransaction()\r\n\t\t{\r\n\t\tif($this->transaction)\r\n\t\t\t{\r\n\t\t\t$this->transaction=FALSE;\r\n\t\t\t$this->query=\"COMMIT TRANSACTION\";\r\n\t\t\t$this->runQuery();\r\n\t\t\t}\r\n\t\t}",
"public function rollbackTransaction() {\n\t\t//noop\n\t}",
"public function rollBackTransaction()\r\n\t{\r\n\t\t$this->query(\"ROLLBACK TRANSACTION\");\r\n\t}",
"private function rollback() {\n\t\tEE::warning( 'Exiting gracefully after rolling back. This may take some time.' );\n\t\tif ( $this->level > 0 ) {\n\t\t\t$this->delete_site();\n\t\t}\n\t\tEE::success( 'Rollback complete. Exiting now.' );\n\t\texit;\n\t}",
"public function stop(): void\n {\n if ($this->conn->inTransaction()) {\n $this->conn->rollBack();\n }\n }",
"function db_trans_stop($dbh) {\ndb_query(\"COMMIT;\",$dbh,\"\",\"\",\"\",\"Committing transaction\");\ndb_query(\"SET autocommit=1;\",$dbh,\"\",\"\",\"\",\"Setting auto commit to 1\");\ndb_query(\"SET FOREIGN_KEY_CHECKS = 1;\",$dbh,\"\",\"\",\"\",\"Enabling foreign key checks\");\n}",
"protected static function rollbackTransaction()\n\t{\n\t\tAbstractUnit::rollbackTransaction();\n\t}",
"public function transactionRollback()\n\t{\n\t\treturn;\n\t}",
"function RollbackTrans() {}",
"public function cancel();",
"public function rollBack()\n {\n if ($this->transactionCount < 1) {\n return;\n }\n $transaction = $this->unprepared(\"ROLLBACK;\");\n if (false !== $transaction) {\n $this->transactionCount--;\n }\n }",
"public function endTransaction()\n {\n $this->getDriver()->database->endTransaction();\n }",
"public function rollback() {\n\t\t$this->execute(\"ROLLBACK; SET autocommit = 1;\");\n\t}",
"protected function end_bulk_operation(){\n\t\twpcom_vip_end_bulk_operation();\n\t}",
"public function abort(): void;",
"public function rollback()\n{\n\t$this->query('ROLLBACK');\n}",
"abstract protected function _quit_transaction( $commit );",
"public function rollbackTransaction();",
"public function rollback();",
"public function rollback();",
"public function rollback();",
"public function rollback();",
"public function __destruct()\n\t{\n\t\t$this->endTransactions(false);\n\t}",
"protected function runTransactionDestroy()\n {\n $this->request->transaction->destroy(); /* Unlink the transaction file */\n unset($this->request->transaction); /* Destroy the pointer in memory */\n }",
"public function abort() {\n $this->status = self::STATUS_ABORTED;\n }",
"public function cancelTransaction() {\n return $this->conn->rollBack();\n }",
"public function rollbackTransaction()\n {\n mysqli_query($this->databaseLink,\"ROLLBACK;\");\n }",
"public function rollback()\n {\n // my code\n $by = 'id';\n $order = 'desc';\n $eventMessages = CEventMessage::GetList($by, $order, ['TYPE' => self::EVENT_TYPE]);\n $eventMessage = new CEventMessage;\n while ($template = $eventMessages->Fetch()) {\n $eventMessage->Delete((int)$template['ID']);\n }\n CEventType::Delete(self::EVENT_TYPE);\n }",
"public function rollback()\n\t{\n\t}",
"public function rollback()\n\t{\n\t}",
"public function __destruct() {\n $this->commit();\n }",
"public function rollback() {\n parent::rollback();\n $this->activeTransaction = false;\n }",
"public function finalizarTransaccion() {\n $this->ejecutar(\"COMMIT\");\n }",
"function RollBackTrans()\n\t{\n\t\tif ($this->__transCount > 0) {\n\t\t\t$this->__connection->rollBack();\n\t\t\t$this->__transCount--;\n\t\t}\n\t}",
"public function __destruct()\n {\n $this->commit();\n }",
"public function cancelOperation() {\n printf(\"Cancelling...\\n\");\n $this->_cancelled = true;\n posix_kill($this->_pid, SIGKILL);\n pcntl_signal_dispatch();\n }",
"public function tearDown() {\n\t\t$this->calendar->sql->SQLQueryString = 'ROLLBACK';\n\t\t$this->calendar->sql->RunQuery(__FILE__, __LINE__);\n\n\t\tif ($this->cache_available) {\n\t\t\t$this->calendar->cache->flush();\n\t\t}\n\t}",
"function rollback();",
"public function cancelarTransaccion() {\n $this->ejecutar(\"ROLLBACK\");\n return false;\n }",
"abstract public function abort(): void;",
"protected function end_bulk_operation() {\n\t\t// This will also trigger a term count.\n\t\twp_defer_term_counting( false );\n\t}",
"protected function cancel()\n\t{\n\t\t$this->executeTask('Rollback');\n\n\t\treturn false;\n\t}",
"protected function end_bulk_operation() {\n\t\t\n\t\t// This will also trigger a term count.\n\t\twp_defer_term_counting( false );\n\t}",
"public function __destruct() {\n\t\tif ( $this->mTrxLevel && $this->mTrxDoneWrites ) {\n\t\t\ttrigger_error( \"Uncommitted DB writes (transaction from {$this->mTrxFname}).\" );\n\t\t}\n\t\tif ( count( $this->mTrxIdleCallbacks ) || count( $this->mTrxPreCommitCallbacks ) ) {\n\t\t\t$callers = array();\n\t\t\tforeach ( $this->mTrxIdleCallbacks as $callbackInfo ) {\n\t\t\t\t$callers[] = $callbackInfo[1];\n\t\t\t}\n\t\t\t$callers = implode( ', ', $callers );\n\t\t\ttrigger_error( \"DB transaction callbacks still pending (from $callers).\" );\n\t\t}\n\t}",
"public function end(): void\n {\n if ($this->conn->inTransaction()) {\n $this->conn->commit();\n }\n }",
"protected function rollbackToSavePoint(): void\n {\n foreach ($this->getActiveConnections() as $connection) {\n try {\n while ($connection->isTransactionActive()) {\n $connection->rollBack();\n }\n } catch (\\Exception $e) {\n }\n }\n }",
"protected function cancel(): void\n {\n }",
"function executionDone() {\n\tif($err = @error_get_last()) {\n\t\tswitch($err['type']) {\n\t\t\tdefault:\n\t\t\t\tstopForError($err['message'], $err['type'], $err['file'], $err['line']);\n\t\t\t\tbreak;\n\t\t}\n\t}\n\tif(class_exists('Locker')) {\n\t\tLocker::releaseAll();\n\t}\n}",
"function pg_cancel_query($connection): void\n{\n error_clear_last();\n $result = \\pg_cancel_query($connection);\n if ($result === false) {\n throw PgsqlException::createFromPhpError();\n }\n}",
"public function finishTransaction() {\n $pdo = $this->getConnection();\n $pdo->commit();\n }",
"function rollback(): void;",
"public function rollBack() {\r\n\r\n mysql_query(\"ROLLBACK\");\r\n mysql_query(\"SET AUTOCOMMIT=1\");\r\n\r\n }",
"public function commitTransaction() {\r\n\t\t// TODO: Implement transaction stuff.\r\n\t\t//$this->query('COMMIT TRANSACTION');\r\n\t}",
"public function cancel(): void;",
"public function rollBack()\n {\n if ($this->hasActiveTransaction) {\n parent::rollback();\n $this->hasActiveTransaction = false;\n }\n }",
"public function commitTransaction() {\n\t\t//noop\n\t}",
"public function rollbackTransaction(): void;",
"public function rollback() {\n if ($this->tx_active) {\n $this->x('ROLLBACK');\n $this->tx_active = false;\n } else {\n throw new GDBException(\"can't commit, no active transaction\");\n }\n }",
"protected function _cancelOperation() {}",
"public abstract function rollback();",
"public static function rollbackTransaction()\n\t{\n\t\tif (self::$currentTransaction !== null)\n\t\t{\n\t\t\tself::$currentTransaction->rollback();\n\t\t\tself::$currentTransaction = null;\n\t\t}\n\t}",
"public function rollback()\n {\n }",
"public function rollback()\n {\n }",
"function reset_process(){ $this->model->closing(); $this->transmodel->closing(); }",
"public function abort() {\n\t\t$this->timer->abortEvent( $this );\n\t}",
"abstract protected function doRollback();",
"public function abortDuel(){\n $this->plugin->getScheduler()->cancelTask($this->countdownTaskHandler->getTaskId());\n }",
"function end_txn() {\n\t\tif ( sizeof($this->querys) == 0 )\n\t\t\treturn true;\n\n\t\t$success = false;\n\t\tif ( $this->started ) {\n\n\t\t\tif ( $this->failed || $this->debug ) {\n\t\t\t\t$this->dump_query_stat();\n\t\t\t}\n\n\t\t\t$this->querys_info['exec_times_txn']['commit'] = 0.0;\n\t\t\t$this->querys_info['exec_times_txn']['rollback'] = 0.0;\n\n\t\t\tif ( $this->failed ) {\n\t\t\t\t$bgn = microtime(true);\n\t\t\t\tif ( !$this->mysql_client->rollback() )\n\t\t\t\t\telog('rollback failed: ' . $this->mysql_client->error);\n\t\t\t\t$end = microtime(true);\n\n\t\t\t\t$this->querys_info['exec_times_txn']['rollback'] = $end - $bgn;\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$bgn = microtime(true);\n\n\t\t\t\t$retried = 0;\n\t\t\t\twhile (1) {\n\t\t\t\t\tif ( !$this->mysql_client->commit() ) {\n\t\t\t\t\t\telog('commit failed: ' . $this->mysql_client->error);\n\t\t\t\t\t\tif ( $this->recommit_on_deadlock && strstr($this->mysql_client->error, 'Deadlock found') ) {\n\t\t\t\t\t\t\t$retried++;\n\t\t\t\t\t\t\telog(\"recommits on deadlock with retried: $retried\");\n\t\t\t\t\t\t\tthrow new Exception('Deadlock found');\n\t\t\t\t\t\t\t//sleep(1);\n\t\t\t\t\t\t\tcontinue;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t\t$success = true;\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\t$end = microtime(true);\n\n\t\t\t\tif ( $retried > 0 )\n\t\t\t\t\telog(\"commit was eventually succeeded with {retried: $retried, success: $success}\");\n\n\t\t\t\t$this->querys_info['exec_times_txn']['commit'] = $end - $bgn;\n\t\t\t}\n\n\t\t\tif ( $this->failed || $this->debug )\n\t\t\t\telog(sprintf(\"TXN [commit, rollback] => [%f, %f]\", $this->querys_info['exec_times_txn']['commit'], $this->querys_info['exec_times_txn']['rollback']));\n\t\t}\n\t\t$this->reset_internal();\n\n\t\treturn $success;\n\t}",
"public function setRollbackOnAbort(bool $rollbackOnAbort): void\n {\n }",
"function rollback(){\n\t\ttry {\n\t\t\t$this->dbconn->rollBack();\n\t\t}catch(Exception $e){\n\t\t\t$this->logger->error($e->getMessage());\n\t\t\tthrow $e;\n\t\t}\n\t}",
"public function tracker_abort(){\n\t\t$this->env_set('tracker:event', false);\n\t\t}",
"private function rollBack()\n\t{\n\t\tif (self::TRANSACTION) {\n\t\t\t$this->database->rollBack();\n\t\t}\n\t}",
"public function cancel(): int;",
"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 cancel()\n {\n }",
"public function cancel()\n {\n }",
"public static function commit_transaction()\n {\n global $wpdb;\n $wpdb->query('COMMIT;');\n }",
"public function endtrans(){\n\t\tif($this->transaction){\n\t\t\t$this->query(\"COMMIT\");\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\t$this->query(\"ROLLBACK\");\n\t\t\treturn false;\n\t\t}\n\t}",
"public function _transaction_status_check()\n {\n if (!$this->_transaction_in_progress) {\n return;\n }\n $this->rollback();\n }",
"function rollback() {\n\t\t\tself::$db->rollback();\n\t\t}",
"function abort ($transactionId = null)\n {\n $headers = array();\n if ( isset($transactionId) )\n {\n $headers['transaction'] = $transactionId;\n }\n $this->writeFrame(new StompFrame('ABORT', $headers));\n }",
"protected static function commitTransaction()\n\t{\n\t\tAbstractUnit::commitTransaction();\n\t}",
"public function rollback(){\n $this->db->exec('ROLLBACK TO xyz;');\n }",
"public function rollback() {\n if (!$this->changed())\n return;\n\n $this->tags = array('new' => array(), 'del' => array());\n $this->inited = false;\n }",
"public function rollBack()\n\t{\n\t\t$this->c->rollBack();\n\t}",
"function abort() \n {\n return $this->instance->abort();\n }",
"public function rollback()\n {\n if (self::$_transactionLevel == 1) {\n $this->getConnection()->rollBack();\n }\n \n if (self::$_transactionLevel > 0) {\n self::$_transactionLevel--;\n }\n }",
"function db_rollback($dbh) {\ndb_query(\"ROLLBACK;\",$dbh,\"\",\"\",\"\",\"Rolling back transaction\");\ndb_query(\"SET autocommit=1;\",$dbh,\"\",\"\",\"\",\"Setting auto commit to 1\");\n}",
"public function end();",
"public function end();",
"public function end();",
"public function end();",
"function session_abort()\n{\n}",
"function my_shutdown() {\n global $tmpfile, $dbh, $sth1, $sth2, $sth3, $sth4, $sth5, $sth6, $res;\n\n switch ($dbh->phptype) {\n case 'ibase':\n /*\n * Interbase doesn't allow dropping tables that have result\n * sets still open.\n */\n $dbh->freePrepared($sth1);\n $dbh->freePrepared($sth2);\n $dbh->freePrepared($sth3);\n $dbh->freePrepared($sth4);\n $dbh->freePrepared($sth5);\n $dbh->freePrepared($sth6);\n $dbh->freeResult($res->result);\n break;\n }\n\n $dbh->setErrorHandling(PEAR_ERROR_RETURN);\n drop_table($dbh, 'phptest');\n\n unlink($tmpfile);\n}"
] | [
"0.66715395",
"0.6633",
"0.6581906",
"0.6556029",
"0.651938",
"0.6457377",
"0.64570516",
"0.6454393",
"0.64411104",
"0.638902",
"0.63374186",
"0.62721604",
"0.62634933",
"0.62581587",
"0.6200545",
"0.6199904",
"0.6167491",
"0.61636937",
"0.6160573",
"0.6159313",
"0.6150514",
"0.61485195",
"0.6131492",
"0.61197597",
"0.6112525",
"0.6112525",
"0.6112525",
"0.6112525",
"0.61108035",
"0.60910326",
"0.6090942",
"0.6086636",
"0.60624915",
"0.6053078",
"0.6039416",
"0.6039416",
"0.60336465",
"0.60335654",
"0.6023523",
"0.6019025",
"0.5984213",
"0.596981",
"0.5967286",
"0.5954745",
"0.5952358",
"0.5949657",
"0.593889",
"0.593847",
"0.59367144",
"0.5923541",
"0.5916818",
"0.59087443",
"0.59076464",
"0.5901982",
"0.5900153",
"0.589974",
"0.5898187",
"0.5896977",
"0.5881211",
"0.5872585",
"0.5872466",
"0.58675313",
"0.58523047",
"0.58460003",
"0.58412063",
"0.5838416",
"0.5832764",
"0.58094245",
"0.58094245",
"0.57910144",
"0.5790624",
"0.57839143",
"0.57691187",
"0.5757587",
"0.5745547",
"0.5717611",
"0.57137334",
"0.569764",
"0.5692395",
"0.56908953",
"0.56882703",
"0.56882703",
"0.5672584",
"0.565686",
"0.56560546",
"0.5655271",
"0.5645781",
"0.56354433",
"0.56150746",
"0.5614518",
"0.5582349",
"0.55714107",
"0.55697924",
"0.55605936",
"0.55483353",
"0.55483353",
"0.55483353",
"0.55483353",
"0.5540412",
"0.55135167"
] | 0.68961 | 0 |
Update record activity status. | function update_record_status($id, $status, $table, $key) {
$sql = "UPDATE ".TB_PREF.$table." SET inactive = "
. ((int)$status)." WHERE $key=".db_escape($id);
db_query($sql, "Can't update record status");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function update_status();",
"public function updated(Activity $activity)\n {\n //\n }",
"function updateactivity() {\n $this->auth(WL_ADM_LEVEL);\n $wl_id = $this->session->userdata('wl_id');\n $activity_id = $this->input->post('activityid');\n $name = $this->input->post('name');\n $multiplicity = $this->input->post('multiplicity');\n $severity = $this->input->post('severity');\n $unit = $this->input->post('unit');\n $desc = $this->input->post('desc');\n $status = $this->m_activities->update($activity_id, $wl_id, $name, $multiplicity, $severity, $unit, $desc);\n $this->activities();\n }",
"function updatestatus() {\n global $_lib;\n\n $dataH = array();\n $dataH['ID'] = $this->transaction->ID;\n $dataH['RemittanceSequence'] = $this->transaction->RemittanceSequence;\n $dataH['RemittanceDaySequence'] = $this->transaction->RemittanceDaySequence;\n $dataH['RemittanceSendtDateTime'] = $_lib['sess']->get_session('Datetime');\n $dataH['RemittanceSendtPersonID'] = $_lib['sess']->get_person('PersonID');\n $dataH['RemittanceStatus'] = 'sent';\n \n #Disse m fjernes nr vi har en godkjenningsprosess\n $dataH['RemittanceApprovedDateTime'] = $_lib['sess']->get_session('Datetime');\n $dataH['RemittanceApprovedPersonID'] = $_lib['sess']->get_person('PersonID');\n\n $_lib['storage']->store_record(array('data' => $dataH, 'table' => 'invoicein', 'debug' => false));\n }",
"public function projectTaskStatusUpdate(){\r\n\t\t//fetch activity feed list\r\n\t\t$post = $this->input->post(null, true);\r\n\t\t$parent_id = $post['pid'];\r\n\t\t$task_id = $post['tid'];\r\n\t\t$status_id = $post['stat'];\r\n\t\t$completed_time = gmdate('Y-m-d H:i:s');\r\n\r\n\t\t//$task = new Task();\r\n\t\t$data = array('status_id' => $status_id, 'completed_date'=>$completed_time);\r\n\t\t$this->db->where(\"parent_id\", $parent_id);\r\n\t\t$this->db->where(\"task_id\", $task_id);\r\n\t\t$this->db->update(\"sc_tasks\", $data);\r\n\r\n\t}",
"function setActivityStatus($activityId,$status) \n {\n return $this->instance->setActivityStatus($activityId,$status);\n }",
"public function status()\t{\n\t\t\t$this->veiculo->update($this->input->post('id'), array('veiculo_status' => $this->input->post('status')));\n\t\t}",
"public function updateStatus() {\n $ref = ORM::forTable('referrals')\n ->findOne($this->data['id']);\n if ($this->data['status'] == 'Assigned' && $this->data['route_id']) {\n $route = ORM::forTable('estimate_routes')\n ->findOne($this->data['route_id']);\n $assignedReferralsCount = ORM::forTable('referrals')\n ->select('id')\n ->where('route_id', $route->id)\n ->count();\n $ref->route_id = $this->data['route_id'];\n $ref->status = 'Assigned';\n $ref->route_order = $assignedReferralsCount;\n\n } elseif ($this->data['status'] == 'Pending') {\n $ref->status = 'Pending';\n $ref->route_order = 0;\n $ref->route_id = NULL;\n } else {\n $ref->status = $this->data['status'];\n }\n if ($ref->save()) {\n $this->renderJson([\n 'success' => true,\n 'message' => 'Job request status updated successfully'\n ]);\n } else {\n $this->renderJson([\n 'success' => false,\n 'message' => 'An error has occurred while saving job request'\n ]);\n }\n }",
"static function update_tracing_data($lead_id, $status){\n\t\t$table = self::get_offline_table();\n\t\tglobal $wpdb;\n\t\t$wpdb->update($table, array('crm_status'=>(int)$status), array('lead_id'=>(int)$lead_id), array('%d'), array('%d'));\n\t\t\n\t}",
"public function updateStatus($params)\r\n {\r\n }",
"public function actionUpdateStatus() {\n $model = UserJobEditorFlag::model()->findByPk(Yii::app()->request->getPost('instanceId'));\n if (!$model instanceof UserJobEditorFlag) return false;\n $saved = $model->updateStatus(Yii::app()->request->getPost('status'));\n $this->sendResponse(200, $this->getObjectEncoded(array('message' => $saved ? 'ok' : 'error')));\n }",
"public function updateUserActivityAction()\n {\n /** @var Object_Activity $activity */\n $data = $this->getRequestData();\n if (isset($data['activity_id'])) {\n $activity = Object_Activity::getById($data['activity_id']);\n if (!$activity) {\n $this->setErrorResponse('no Activity with this activity_id!');\n } elseif ($this->getDeviceSession()->getUserId() != $activity->getCreator()->getId()) {\n $this->setErrorResponse('you have no rights to change this Activity!');\n } else {\n if (isset($data['title'])) {\n $activity->setTitle($data['title']);\n }\n if (isset($data['photo'])) {\n $activity->setPhoto(Asset_Image::getById($data['photo']));\n }\n if (!$activity->save()) {\n $this->setErrorResponse('cannot update Activity object');\n }\n }\n } else {\n $this->setErrorResponse('activity_id is mandatory field for this request!');\n }\n\n $this->_helper->json($activity);\n }",
"public function updateBookingStatus(){\n $command = Yii::$app->db->createCommand();\n $id= Yii::$app->request->bodyParams[\"booking2\"];\n\n try {\n $command->update('car', ['pendingTime' => 'on', 'inUse' => 'pending'], 'id = '.$id)->execute();\n } catch (Exception $e) {\n printf(\"Cannot update data\");\n }\n }",
"private function updateTask(int $status, Model $job)\n {\n $job->status = $status;\n $job->save();\n }",
"public function change_status($vid, $status) {\n $result = db_query('UPDATE {video_files} SET status = %d WHERE vid = %d ', $status, $vid);\n }",
"public function updateStatus(): void\n {\n $data = json_encode($this->getStatus(), JSON_PRETTY_PRINT);\n File::put(public_path(self::STATUS_FILE_NAME), $data);\n }",
"function updateRecordingStatus($recordingid, $status, $type = \"recording\") {\n///////////////////////////////////////////////////////////////////////////////////////////////////\nglobal $app, $debug, $jconf, $myjobid;\n\t\n\t// Check allowed status field types\n\t$allowed_types = array('recording', 'content', 'mobile', 'ocr', 'smil', 'contentsmil', 'mobilesmil');\n\tif (!in_array($type, $allowed_types, $strict = true)) return false;\n \n\tif ( empty($status) ) return false;\n\t\n\tif ( $status == 'NULL' ) $status = null;\n\n\t$idx = null;\n\tif ( $type === 'recording' ) $idx = '';\n\telse $idx = $type;\n\t\n\tif ( !empty($status) ) {\n\t\t$values = array(\n\t\t\t$idx . 'status' => $status\n\t\t);\n\t} else {\n\t\t$values = array(\n\t\t\t$idx . 'status' => null\n\t\t);\n\t}\n\t\n\t$recordingVersionObj = $app->bootstrap->getModel('recordings');\n\t$recordingVersionObj->select($recordingid);\n $recordingVersionObj->updateRow($values);\n\n\t// Update index photos\n\tif ( ( $status == $jconf['dbstatus_copystorage_ok'] ) and ( $type == \"recording\" ) ) {\n\t\t$recordingObj = $app->bootstrap->getModel('recordings');\n\t\t$recordingObj->select($recordingid);\n\t\t$recordingObj->updateChannelIndexPhotos();\n\t}\n\n\t// Log status change\n\t$debug->log($jconf['log_dir'], $myjobid .\".log\", \"[INFO] Recording id = \". $recordingid .\" \". $type .\" status has been changed to \". var_export($status, 1) .\".\", false);\n\n\treturn true;\n}",
"public function update($record);",
"public function postUpdateStatus(){\n\t\t$expense_id = Input::get('expense_id');\n\t\t$status = Input::get('status');\n\t\t$expense = Expense::find($expense_id);\n\t\t$expense->status = $status;\n\t\t$expense->save();\n\t}",
"public function update_activity_to_done($data,$id_activity) {\n\t\t$this->db->set($data);\n\t\t$this->db->where(\"id_activity\",$id_activity);\n\t\t$this->db->update('board_activity');\n\t}",
"public function updateStatus()\n {\n $this->status = Cart::CART_STATUS_ORDERED;\n $this->save();\n }",
"public function actionStatus($id,$act)\n {\n $model = $this->findModel($id);\n\n $model->status = $act;\n \n if($model->save())\n {\n\n // change status of all ads with this campaign_id\n\n $model2 = Teasers::find()->where(['campaign_id'=>$id])->all();\n\n foreach ($model2 as $key => $value) \n {\n \n $value->status = $act;\n \n $value->save();\n }\n\n Yii::$app->session->setFlash('savedSuccess');\n\n }\n\n\n return $this->redirect(['index']);\n }",
"public function statusAction()\n {\n $actionRow = new Admin_Model_DbRow_Action($this->dbAction->find($this->checkActionIdParam()));\n IF($actionRow->get('id')) {\n $actionRow->fromArray(array(\n 'enabled' => $actionRow->get('enabled') == 0 ? 1 : 0\n ));\n $this->dbAction->updateById($actionRow->toDbArray(array('enabled')), $actionRow->get('id'));\n } ELSE {\n // FIXME: Error Handling\n }\n\n $this->_redirect('admin/action/index/control/' . $actionRow->get('mcId'));\n }",
"public function update(StoreActivity $request, Activity $activity)\n {\n $this->authorizeActionOnActivity($request, $activity);\n $validated = $request->validated();\n $activity->fill($validated);\n $activity->save();\n return back()->withSuccess(__('Activity updated successfully.'));\n }",
"public function updateStatus()\n {\n $this->Invoice->updateInvoiceStatus($this->input->post('id'));\n }",
"function practice_status()\n {\n $query = \"UPDATE\n\t\t\t\t\t\" . $this->table_name . \"\n\t\t\t\tSET\n\t\t\t\t\tStatus = :status\n\t\t\t\tWHERE\n\t\t\t\t\tid = :id AND Viewer_ID = :vid\";\n\n $stmt = $this->conn->prepare($query);\n\t\t\n\t\t$stmt->bindParam(':status', $this->status);\n $stmt->bindParam(':id', $this->id);\n\t\t$stmt->bindParam(':vid', $this->Viewer_ID);\n\n // execute the query\n if ($stmt->execute()) {\n return true;\n } else {\n return false;\n }\n }",
"public function status($status)\n {\n $ids = Request::get(\"id\");\n\n $ids = is_array($ids) ? $ids : [$ids];\n\n foreach ($ids as $id) {\n\n $activity = TenderActivity::findOrFail($id);\n\n // Fire saving action\n Action::fire(\"activity.saving\", $activity);\n\n $activity->status = $status;\n $activity->save();\n\n // Fire saved action\n\n Action::fire(\"activity.saved\", $activity);\n }\n\n if ($status) {\n $message = trans(\"tenders::activities.events.activated\");\n } else {\n $message = trans(\"tenders::activities.events.deactivated\");\n }\n\n return Redirect::back()->with(\"message\", $message);\n }",
"protected function updateStatus($status) {\n\n\t\tYii::trace(\"Updating response \\\"{$this->id}\\\" to \\\"{$status}\\\"\", get_class($this));\n\t\t\n\t\t// don't update if not changing, unless it's a new record\n\t\tif((strcasecmp($this->status, $status) == 0) && $this->isExistingRecord) {\n\t\t\treturn true;\n\t\t}\n\n\t\t// calculate Task count incrementations to ensure they are correct\n\t\t$incrementCount = 0;\n\t\t$incrementCompletedCount = 0;\n\n\t\t// Handle going from notParticipating -> Participating, Participating -> notParticipating or Participating -> Participating\n\t\tif($this->isNotParticipating && in_array($status, self::getParticipatingStatuses())) {\n\t\t\t$incrementCount++;\n\t\t}\n\t\telseif($this->isParticipating && !in_array($status, self::getParticipatingStatuses())) {\n\t\t\t$incrementCount--;\t\n\t\t}\n\n\t\t// Handle going from notComplete -> Complete, Complete -> notComplete or Complete -> Complete\n\t\tif($this->isNotCompleted && (strcasecmp($status, self::STATUS_COMPLETED) == 0)) {\n\t\t\t$incrementCompletedCount++;\n\t\t}\n\t\telseif($this->isCompleted && (strcasecmp($status, self::STATUS_COMPLETED) != 0)) {\n\t\t\t$incrementCompletedCount--;\n\t\t}\n\t\t\n\t\t$transaction = $this->getDbConnection()->beginTransaction();\n\t\ttry {\n\t\t\t$task = Task::model()->findByPk($this->taskId);\n\t\t\t$task->incrementParticipantCounts($incrementCount, $incrementCompletedCount);\n\t\t\n\t\t\t$this->status = $status;\n\t\t\n\t\t\tif($this->save()) {\n\t\t\t\t$transaction->commit();\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\t\tcatch (Exception $e) {\n\t\t\t$transaction->rollback();\n\t\t\tthrow $e;\n\t\t}\n\t\t\n\t\t$transaction->rollback();\n\t\tthrow new CHttpException(400, \"There was an error quitting this task\");\n\t}",
"public function actionUpdateIsActive()\n {\n $ids = Yii::app()->request->getPost('ids');\n $status = (int)Yii::app()->request->getPost('status');\n $models = StoreMarket::model()->findAllByPk($ids);\n foreach($models as $market)\n {\n if(in_array($status, array(0,1)))\n {\n $market->is_active=$status;\n $market->save();\n }\n }\n echo Yii::t('StoreModule.admin', 'Изменения успешно сохранены.');\n }",
"public function actionUpdateStatus()\n { \n $user_id = Yii::$app->user->identity->id;\n $model = Users::find()->where(['id'=>$user_id])->one();\n $model->step_validate = 2;\n $model->load(Yii::$app->getRequest()->getBodyParams(), '');\n if ($model->validate()) {\n $model->save();\n $response = \\Yii::$app->getResponse();\n $response->setStatusCode(202);\n return $model->getUsersStatusValues();\n }\n else {\n throw new HttpException(422, json_encode($model->errors, JSON_UNESCAPED_UNICODE));\n }\n }",
"public function update_active()\n\t{\t\n\t\t$change_status=$this->input->post('status_value');\n\t\t$status_record = array('status' => $this->input->post('status_record'));\n\t\t\n\t\tif ($status_record['status'] == 0) {\n\t\t\t$status_record['status'] = 1;\n\t\t}\n\n\t\tforeach ($change_status as $status) {\n\t\t\t\t\t$this->AboutModel->update_status($status , $status_record);\n\t\t\t\t}\n\t\t $this->session->set_flashdata('msg', 'Status Changed Successfully ');\n\t}",
"private function manageStatus()\n {\n $this->updateStatus();\n $this->checkStatus();\n }",
"public function updateStatus(int $projectId);",
"public function update_status(){\n $CampaignContactID = $this->input->post('ContactsID');\n $interest = $this->input->post('interest');\n $remark = $this->input->post('remark');\n $n_date = new DateTime($this->input->post('newdate'));\n $newdate = $n_date->format('Y-m-d');\n $reason_id = $this->input->post('reason');\n $other_reason = $this->input->post('other_reason');\n $p_date = date(\"Y-m-d\");\n\n\n if($interest == '1'){\n \n $sql = $this->db->query(\"insert into crm_followuplog (CampaignContactID,FollowupDate,NewFollowupDate,Remarks,Status) values ('$CampaignContactID','$p_date','$newdate','$remark','3')\");\n $query = $this->db->query(\"update crm_campaigncontacts set Status = '3' where CampaignContactID ='$CampaignContactID'\");\n\n if ($query && $sql){\n $this->session->set_flashdata('msg', '<div class=\"alert alert-success text-center\">Record Updated Successfully</div>');\n redirect('Agent');\n } else{\n $this->session->set_flashdata('msg', '<div class=\"alert alert-danger text-center\">Record Updated Successfully</div>');\n redirect('Agent');\n }\n \n }else{\n\n $sql = $this->db->query(\"insert into crm_followuplog (CampaignContactID,FollowupDate,NewFollowupdate,Remarks,Status,DropReasonId,DropReason) values ('$CampaignContactID','$p_date','$p_date','$remark','5','$reason_id','$other_reason')\");\n\n $query = $this->db->query(\"update crm_campaigncontacts set Status = '5' where CampaignContactID ='$CampaignContactID'\");\n\n if ($query && $sql){\n $this->session->set_flashdata('msg', '<div class=\"alert alert-success text-center\">Record Updated Successfully</div>');\n redirect('Agent');\n } else{\n $this->session->set_flashdata('msg', '<div class=\"alert alert-danger text-center\">Record Updated Successfully</div>');\n redirect('Agent');\n \n }\n }\n\n }",
"public function onUpdateRecord()\n {\n $this->updated = new \\DateTime();\n $this->rev++;\n }",
"public function status_change_action(){\n\t $table = $this->input->post('table');\n\t $state = $this->input->post('state');\n\t $primary_field = $this->input->post('primary_field');\n\t $primary_key = $this->input->post('primary_key');\n\t if($state=='true'){\n\t $status = \"Y\";\n\t $status_text = \"Approved\";\n\t }else{\n\t $status = \"N\";\n\t $status_text = \"Rejected\";\n\t }\n\t $statusReturn = $this->common_model->update_row(array('fr_status'=>$status), array($primary_field=>$primary_key), $table);\n\t if($statusReturn){\n\t echo \"1\";\n\t }else{\n\t echo \"0\";\n\t }\n\t}",
"function updateVCRReclinkStatus($id, $status) {\nglobal $app, $debug, $jconf, $myjobid;\n\n\tif ( empty($status) ) return false;\n\n\t$values = array(\n\t\t'status' => $status\n\t);\n\n $converterNodeObj = $app->bootstrap->getModel('recording_links');\n $converterNodeObj->select($id);\n $converterNodeObj->updateRow($values);\n \n\t// Log status change\n\t$debug->log($jconf['log_dir'], $myjobid . \".log\", \"[INFO] Recording link id#\" . $id . \" status changed to '\" . $status . \"'.\", $sendmail = false);\n\n\treturn true;\n}",
"public function doUpdateStatus()\n\t{\n\n\t\t\n\t\t$rules = array(\n\t\t\t'row_id' => 'required', \n\t\t\t'status' => 'required'\n\t\t);\n\t\t\n\t\t// run the validation rules \n\t\t$validator = Validator::make(Input::all(), $rules);\n\n\t\tif ($validator->fails()) {\n\t\t\t\n\t\t\treturn Redirect::to('order')\n\t\t\t\t->withErrors($validator);\n\t\t\t\n\t\t}\n\t\t\n\t\ttry {\n\t\t \n\t\t\t$object = Object::find(Input::get('row_id'));\n\t\t\t$object->fk_status = Input::get('status');\n\t\t\t$object->save();\n\t\t\t\n $logDetails = json_encode(['row_id' => Input::get('row_id'),\n\t\t\t\t\t\t\t\t\t 'status' => Input::get('status')]);\n\t\t\t\t\t\n\t\t\tActivity::log([\n\t\t\t\t'contentId' => Auth::User()->id,\n\t\t\t\t'contentType' => 'admin_pickup_status',\n\t\t\t\t'action' => 'Updated',\n\t\t\t\t'description' => 'Pickup Status Updated',\n\t\t\t\t'details' => $logDetails,\n\t\t\t\t'updated' => true,\n\t\t\t]);\n\t\t\t\n\t\t\t Session::flash('message', 'Order #' . Input::get('row_id') . ' updated');\n\t\t\treturn Redirect::to('order');\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t \n\t\t\tSession::flash('error', $e->getMessage() );\n\t\t\treturn Redirect::to('order');\n\t\t}\n\t\t\n\t\t\n\t}",
"public function respon(){\n //update 'status'\n }",
"public function update($activity) {\r\n\t\t$stmt = $this->db->prepare(\"UPDATE activities SET nombre=?, descripcion=?, dia=?, hora_inicio=?, hora_fin=?, plazas=?, entrenador=? WHERE id=?\");\r\n\t\t$stmt->execute(array($activity->getNombre(), $activity->getDescripcion(), $activity->getDia(), $activity->getHoraInicio(), $activity->getHoraFin(), $activity->getPlazas(), $activity->getEntrenador(), $activity->getId()));\r\n\t}",
"public function setActive()\n {\n $this->update(['status' => static::STATUS_ACTIVE]);\n }",
"function updateLiveStreamStatus($id, $status) {\nglobal $app, $debug, $jconf, $myjobid;\n\n\tif ( empty($status) ) return false;\n\n $values = array(\n\t\t'status' => $status\n\t);\n\n $converterNodeObj = $app->bootstrap->getModel('livefeed_streams');\n $converterNodeObj->select($id);\n $converterNodeObj->updateRow($values);\n \n\t// Log status change\n\t$debug->log($jconf['log_dir'], $myjobid . \".log\", \"[INFO] Live stream id#\" . $id . \" status changed to '\" . $status . \"'.\", $sendmail = false);\n \n\treturn true;\n}",
"function set_account_status($acc_number,$status,$tp_start,$tp_end,$rolover_start,$rolover_end)\n\t{\n\t if ($status != 0 )\n\t {\n\t\t$data['timeline'] = date('H:i:s d-m-Y',$tp_start).\" - \".date('H:i:s d-m-Y',$tp_end);\n\t\t$data['timeline1'] = date('H:i:s d-m-Y',$rolover_start).\" - \".date('H:i:s d-m-Y',$rolover_end);\n\t }\n\t else\n\t {\n\t\t$data['timeline'] = \"Not calculated\";\n\t\t$data['timeline1'] = \"Not calculated\";\n\t }\n\t return $this->db->where('login',$acc_number)\n\t \t ->limit(1)\n\t \t ->update('pamm_accounts', $data);\n\t}",
"public function statusAction()\n {\n $ctrlRow = new Admin_Model_DbRow_Controller($this->dbCtrl->find($this->checkControllerIdParam()));\n $ctrlRow->set('enabled', $ctrlRow->get('enabled') == 1 ? 0 : 1);\n $this->dbCtrl->update($ctrlRow->toDbArray(array('enabled')), $ctrlRow->get('id'));\n\n // disabled all actions too, they are relevant in the ACL\n IF($ctrlRow->get('enabled') === 0) {\n $actionRow = new Admin_Model_DbRow_Action(array(\n 'enabled' => 0\n ));\n $actionDbModel = new Admin_Model_DbTable_Acl_Action;\n $actionDbModel->updateWithControllerId($actionRow->toDbArray(array('enabled')), $ctrlRow->get('id'));\n }\n\n $this->_redirect('admin/controller/index');\n \n }",
"public function change_status(){\n $data = array(\n 'status' => $this->input->post('status') ,\n 'status_changer' => $this->data[\"user_id\"] ,\n );\n $task_id = $this->input->post('task_id') ;\n \n $this->m_task->save($data , $task_id);\n }",
"public static function updateStatus($status) {\n $status = strtoupper($status);\n if($status == 'UP' || $status == 'DOWN') {\n $newRecord = strtoupper($status) .','. time() . PHP_EOL;\n $insertNewRecord = file_put_contents(self::LOG_FILE, $newRecord, FILE_APPEND|LOCK_EX);\n $insertNewRecord == true ? $statusMessage = 'success'.PHP_EOL : $statusMessage = 'error'.PHP_EOL;\n return $statusMessage;\n }\n else { return 'error'.PHP_EOL; }\n }",
"function update_status()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\t\n\t\tif(!empty($data['t']) && !empty($data['list'])) $response = $this->_tender->update_status($data['t'], explode('--',$data['list']));\n\t\t\n\t\t# all good\n\t\tif(!empty($response) && $response['boolean']){\n\t\t\t$data['msg'] = 'The Invitation for Bids/Quotations status has been updated.';\n\t\t\t$data['area'] = 'refresh_list_msg';\n\t\t} \n\t\t# there was an error\n\t\telse {\n\t\t\t$data['msg'] = (!empty($data['t']) && !empty($data['list']))? 'ERROR: There was an error updating the Invitation for Bids/Quotations status.': 'ERROR: This action can not be resolved';\n\t\t\t$data['area'] = 'basic_msg';\n\t\t}\n\t\t\n\t\t$this->load->view('addons/basic_addons', $data);\n\t}",
"public function refreshTaskStatus(){\n\n $webCronResult = $this->webCronResults()->orderBy('code', 'desc')->first();\n\n if ($webCronResult) {\n\n if ($webCronResult->code >= 300) {\n // bad status\n $this->status = 0 ;\n }else{\n // good status\n $this->status = 2 ;\n };\n\n $this->save();\n\n };\n\n }",
"public function status(Request $request)\n {\n $urow = Registration::where(['id' => $request['Row_id']]);\n if ($urow!= null) {\n $urow->update(['status' => $request['status']]);\n return redirect()->action('FollowupController@index')->with('success', 'Successfully Updated!');\n } else {\n return redirect()->action('FollowupController@index')->with('failed', 'Successfully Updated!');\n }\n }",
"public function updateStatusOnNewDay() {\n // Update advs\n UIAdv::where('last_update_time', '<', Carbon::now()->subDays(1))->where('status', '=', 1)->update([\n 'last_update_time' => Carbon::now(),\n 'status' => 0\n ]);\n\n // Update advgroups\n UIAdvGroup::where('last_update_time', '<', Carbon::now()->subDays(1))->where('status', '=', 1)->update([\n 'last_update_time' => Carbon::now(),\n 'status' => 0\n ]);\n\n // Update campaign\n UICampaign::where('last_update_time', '<', Carbon::now()->subDays(1))->where('status', '=', 1)->update([\n 'last_update_time' => Carbon::now(),\n 'status' => 0\n ]);\n\n // Update project\n UIProject::where('last_update_time', '<', Carbon::now()->subDays(1))->where('status', '=', 1)->update([\n 'last_update_time' => Carbon::now(),\n 'status' => 0\n ]);\n }",
"public function setWatchStatus()\n\t\t{\n\t\t\t$model = $this->getModel();\n\t\t\t$model->is_watched = 'yes';\n\t\t\t$model->modifying_agent_id = ECash::getAgent()->getAgentId();\n\t\t\t$model->save();\n\t\t}",
"public function changestatusAction()\n {\n $user_params=$this->_request->getParams();\n $automail=new Ep_Message_AutoEmails();\n $ftvrequest_obj = new Ep_Ftv_FtvRequests();\n $ftvcontacts_obj = new Ep_Ftv_FtvContacts();\n $ftvpausetime_obj = new Ep_Ftv_FtvPauseTime();\n\n if($user_params['status'] == 'closed')\n $data = array(\"status\"=>$user_params['status'], \"cancelled_at\"=>date('Y-m-d H:i:s'));////////updating\n elseif($user_params['status'] == 'done')\n $data = array(\"status\"=>$user_params['status'], \"closed_at\"=>date('Y-m-d H:i:s'));////////updating\n else\n $data = array(\"status\"=>$user_params['status'], \"closed_at\"=>NULL, \"cancelled_at\"=>NULL);////////updating\n $query = \"identifier= '\".$user_params['requestId'].\"'\";\n $requestdetails = $ftvrequest_obj->requestDetailsById($user_params['requestId']);\n $contactId = $requestdetails[0]['request_by'];\n $contactdetails = $ftvcontacts_obj->getFtvContactDetails($contactId);\n $contactName = $contactdetails[0]['first_name'].\" \".$contactdetails[0]['last_name'];\n $parameters['ftvobject'] = $requestdetails[0]['request_object'];\n $parameters['ftvcontactName'] = $contactName;\n $ftvrequest_obj->updateFtvRequests($data,$query);\n ////making the time resume if its in pause////\n $inpause = $ftvpausetime_obj->inPause($user_params['requestId']);\n if($inpause == 'yes')\n {\n $data = array(\"resume_at\"=>date('Y-m-d H:i:s'));////////updating\n $query = \"ftvrequest_id = '\".$user_params['requestId'].\"' AND resume_at IS NULL \";\n $ftvpausetime_obj->updateFtvPauseTime($data,$query);\n }\n if($user_params['status'] == 'done')\n {\n if($this->adminLogin->userId != '110823103540627' ) ///when not johny head of BO user for FTV changed\n {\n $parameters['ftvrequestlink'] = \"/ftvchaine/ftvch-requests?submenuId=ML11-SL6\";\n $parameters['ftvType'] = \"chaine\";\n $automail->messageToEPMail('110823103540627',114,$parameters);// to johny\n $parameters['ftvrequestlink'] = \"http://ep-test.edit-place.com/ftvchaine/index\";\n $automail->sendFtvChaineContactsPersonalEmail($contactId,114,$parameters); // to client contact\n }\n else // in case jhony change the status\n {\n $parameters['ftvrequestlink'] = \"http://ep-test.edit-place.com/ftvchaine/index\";\n $automail->sendFtvChaineContactsPersonalEmail($contactId,114,$parameters); // to client contact\n }\n }\n\n }",
"function updateStatus(){\n\t\t$this->setPost();\n\n\t\t$postData = $_POST;\n\n\t\tif($postData->status_id == 1){\n\t\t\t$updateData = array('status_id' => 2);\n\t\t}else{\n\t\t\t$updateData = array('status_id' => 1);\n\t\t}\n\n\t\t$where = array('id' => $postData->id);\n\n\t\t$result = $this->base_model->updateCommon($this->primaryTable, $updateData, $where);\n\n\t\t$response = array('status' => TRUE, 'message' => 'Document status updated successfully.');\n\n\t\techo json_encode($response);\n\t}",
"public function status() {\n\t\t$id = $this->uri->segment(4);\n\t\t$status = $this->uri->segment(5);\n\t\tCheckAdminLoginSession();\t\t\n\t\t$data['status'] = $status;\t\t\t\t \t \t\t \n\t\t$this->admin_model->setUpdateData($this->policy_duration,$data,$id);\n\t\t$this->session->set_flashdata('message','Your status has been update successfully');\n\t\tredirect('admin/policy-duration/lists','refresh');\t\t\n\t}",
"public function updating(MActivityRule $model)\n\t{\n\t}",
"public function updateStatuses()\n {\n $affected = DB::update('UPDATE los_orders SET status_code=1 WHERE status_code=0 AND order_date IN (SELECT provide_date FROM los_lunchdates WHERE orders_placed IS NOT NULL)');\n $affected = DB::update('UPDATE los_orders SET status_code=0 WHERE status_code=1 AND order_date IN (SELECT provide_date FROM los_lunchdates WHERE orders_placed IS NULL)');\n }",
"public function updateStatus(array $jobs);",
"public function activar()\n {\n $this->estatus = 1;\n $this->save();\n }",
"public function update(Request $request, Activity $activity)\n {\n $this->validate($request,\n [\n 'title'=>'required',\n 'start_time'=>'required',\n 'end_time'=>'required',\n 'contents'=>'required',\n ],\n [\n 'title.required'=>'活动标题不能为空',\n 'start_time.required'=>'活动开始时间不能为空',\n 'end_time.required'=>'活动结束时间不能为空',\n 'contents.required'=>'活动内容不能为空',\n ]);\n $start_time = strtotime($request->start_time);\n $end_time = strtotime($request->end_time);\n $activity->update(\n [\n 'title'=>$request->title,\n 'contents'=>$request->contents,\n 'start_time'=>$start_time,\n 'end_time'=>$end_time,\n ]\n );\n session()->flash('success','修改成功');\n return redirect()->route('activities.index');\n }",
"function updateLiveFeedStatus($id, $status) {\nglobal $app, $debug, $jconf, $myjobid;\n\n\tif ( empty($status) ) return false;\n\n $values = array(\n\t\t'status' => $status\n\t);\n\n $converterNodeObj = $app->bootstrap->getModel('livefeeds');\n $converterNodeObj->select($id);\n $converterNodeObj->updateRow($values);\n \n\t// Log status change\n\t$debug->log($jconf['log_dir'], $myjobid . \".log\", \"[INFO] Livefeed id#\" . $id . \" status changed to '\" . $status . \"'.\", $sendmail = false);\n \n\treturn true;\n}",
"public function friendReqSeenUpdate()\n {\n\n $array = array(\n 'status' => 'seen'\n );\n $this->db->where(array(\n 'friend_id' => $this->session->Auth['id'],\n 'status' => 'pending',\n ));\n $this->db->update('relationship',$array);\n }",
"function changeStatus($table, $status, $id)\n {\n $data = array('is_active' => $status);\n $where = $table . \"_id = '$id'\";\n $builder = $this->db->table($table);\n $builder->where($where);\n $builder->set($data);\n $builder->update();\n }",
"public function updateStatus(Request $request)\n\t{\n\t\t$status;\n\t\tif ($request->status === 'true') {\n\t\t\t$status = 1;\n\t\t} elseif ($request->status === 'false') {\n\t\t\t$status = 0;\n\t\t}\n\t\tDB::table('list_items')\n\t\t\t->where('id', $request->id)\n\t\t\t->update(['status' => $status]);\n\t}",
"public function changeStatus()\n {\n }",
"function update_status()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\tif(!empty($data['t']) && !empty($data['list'])) $result = $this->_bid->update_status($data['t'], explode('--',$data['list']));\n\t\t\n\t\t$data['msg'] = !empty($result['boolean']) && $result['boolean']? 'The bid status has been changed.': 'ERROR: The bid status could not be changed.';\n\t\t\n\t\t$data['area'] = 'refresh_list_msg';\n\t\t$this->load->view('addons/basic_addons', $data);\n\t}",
"public function UpdateLastActivity()\n\t{\n\t\tif (isset($_SESSION['timestamp']) && $_SESSION['timestamp'] - time() > 60 * 10)\n\t\t{\n\t\t\t// If it's been enough time (say, 10 minutes), generate new session ID\n\t\t\t// to help prevent session hijacking\n\t\t\tsession_regenerate_id();\n\t\t\t$_SESSION['timestamp'] = time();\n\t\t}\n\n\t\t$this->LastActivity = now();\n\t\t$this->Save();\n\t}",
"public function updateStatus($id){\n\n $task = Task::find($id);\n $task->status = ! $task->status;\n $task->save();\n\n return redirect()->back();\n\n }",
"public function travel_conditions_status() {\n\t\t$id = $this->uri->segment(4);\n\t\t$status = $this->uri->segment(5);\n\t\tCheckAdminLoginSession();\t\t\n\t\t$data['status'] = $status;\t\t\t\t \t \t\t \n\t\t$this->admin_model->setUpdateData($this->travel,$data,$id);\n\t\t$this->session->set_flashdata('message','Your status has been update successfully');\n\t\tredirect('admin/travel-conditions/lists','refresh');\t\t\n\t}",
"function setStatus($new_status)\n {\n $this->status = $new_status;\n }",
"function update_event_status($event_id,$event_status)\n {\n if($event_status==0)\n {\n $new_stat=\"1\";\n }\n elseif($event_status==1)\n {\n $new_stat=\"0\";\n }\n $query = $this->db->query(\"UPDATE tbl_events SET event_status = '$new_stat' WHERE event_id='$event_id'\");\n //echo $this->db->last_query();\n }",
"function status($status)\n {\n switch($status) {\n case \"Active\":\n case \"Suspended\":\n break;\n default:\n return false;\n }\n\n if ($status != $this->status)\n $this->update['status'] = $status;\n\n $this->status = $status;\n\n return true;\n }",
"public function update_user_status(){\n\tif($this->session->userdata('logged_in')){\n\t\t//cleanup old logins\n\t\t$this->um_users_model->cleanup_expired_logins();\n\t\t//report the current status\n\t\t$session_data= $this->session->userdata('logged_in');\n\t\t$dbdata=array(\n\t\t\t'loggedusername'=>$session_data['username'],\n\t\t\t'ip'=>$this->session->userdata('ip_address'),\n\t\t\t'lastactivity'=>time(),\n\t\t\t'useragent'=>$this->session->userdata('user_agent'),\n\t\t\t'online'=>$this->um_users_model->get_user_online_setting($session_data['username'])\n\t\t);\n\t\t\n\t\tif($this->um_users_model->is_user_logged_in($session_data['username'])){\n\t\t\t$this->um_users_model->update_user_logged_in($session_data['username'],$dbdata);\n\t\t}else{\n\t\t\t$this->um_users_model->register_user_as_logged_in($dbdata);\n\t\t}\n\t\n\t}\n\t}",
"protected function _update()\n\t{\n\t\t$this->date_modified = \\Core\\Date::getInstance(null,\\Core\\Date::SQL_FULL, true)->toString();\n\t\t$this->last_online = $this->date_modified;\n\t}",
"public function status () {\n\n //GETS CURRENT NOTEPADID FROM REQUEST AND STORES IN VARIABLE\n $NotepadID = request('NotepadID');\n \n //FINDS TASK RECORD WITH ID REQUEST AND STORES IN OBJECT\n $data=Tasks::find(request('id'));\n \n //IF TASK STATUS EQUALS TRUE, THEN SET FALSE AND IF TASK STATUS\n //EQUALS FALSE THEN SET TRUE\n if ($data->status) {\n $data->status=0;\n } \n else {\n $data->status=1;\n }\n\n //SAVE DB\n $data->save();\n\n //REDIRECTS TO TASK VIEW WITH NOTEPADID AS PARAMETER\n return redirect (\"/task/$NotepadID\");\n }",
"public function updateStatus()\n\t\t{\n\t\t\t$thingdom = $this->getThingdom();\n\n\t\t\tif(!$thingdom) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$page_count = wp_count_posts('page')->publish;\n\t\t\t$post_count = wp_count_posts()->publish;\n\t\t\t$comment_count = wp_count_comments()->approved;\n\n\t\t\t$thing = $thingdom->getThing($this->thingName, $this->thingType);\n\n\t\t\t$thing->status('page_count', $page_count);\n\t\t\t$thing->status('post_count', $post_count);\n\t\t\t$thing->status('comment_count', $comment_count);\n\t\t}",
"public function setSuccess()\n {\n $this->attributes['status'] = 2;\n self::save();\n }",
"public function update_task_status(){\n \n if($this->input->post('updateType') == 'status'){\n $condition = array('taskId' => $this->input->post('taskId'));\n $data_update = array('Status' => $this->input->post('taskStatus'));\n if($this->input->post('taskStatus') == 'I'){\n $check_status = $this->task_model->selectData('task',$condition,'Status');\n if($check_status[0]->Status == 'H'){\n $data_update['HoldETS'] = date('Y-m-d H:i:s');\n }else{\n $data_update['StartTS'] = date('Y-m-d H:i:s');\n }\n }elseif($this->input->post('taskStatus') == 'H'){\n $data_update['HoldSTS'] = date('Y-m-d H:i:s');\n }elseif($this->input->post('taskStatus') == 'C'){\n $data_update['CompletedTS'] = date('Y-m-d H:i:s');\n }\n $log_data = array('taskId' => $this->input->post('taskId'),'LogDetail' => $this->input->post('taskLog'),'CreatedTS' => date('Y-m-d H:i:s'),'UpdatedTS' => date('Y-m-d H:i:s'));\n try{\n $this->task_model->updateData('task',$data_update,$condition);\n $this->task_model->insertData('task_log',$log_data);\n echo TRUE;\n } catch (Exception $ex){\n echo FALSE;\n exit;\n }\n }elseif($this->input->post('updateType') == 'log'){\n $log_data = array('taskId' => $this->input->post('taskId'),'LogDetail' => $this->input->post('taskLog'),'CreatedTS' => date('Y-m-d H:i:s'),'UpdatedTS' => date('Y-m-d H:i:s'));\n try{\n $this->task_model->insertData('task_log',$log_data);\n echo TRUE;\n } catch (Exception $ex){\n echo FALSE;\n exit;\n }\n }elseif($this->input->post('updateType') == 'deletelog'){\n $condition = array('LogId' => $this->input->post('taskId'));\n $log_data = array('Status' => 'D','UpdatedTS' => date('Y-m-d H:i:s'));\n try{\n $this->task_model->updateData('task_log',$log_data,$condition);\n echo TRUE;\n } catch (Exception $ex){\n echo FALSE;\n exit;\n }\n }elseif($this->input->post('updateType') == 'deletefile'){\n $condition = array('FileId' => $this->input->post('taskId'));\n $log_data = array('Status' => 'D','UpdatedTS' => date('Y-m-d H:i:s'));\n try{\n $reffile = $this->task_model->selectData('task_reference_files',array('FileId' => $this->input->post('taskId')),'FileName');\n $file = 'uploads/'.$reffile[0]->FileName;\n if (is_readable($file)) {\n unlink($file);\n $this->task_model->updateData('task_reference_files',$log_data,$condition);\n echo TRUE;\n }\n } catch (Exception $ex){\n echo FALSE;\n exit;\n }\n }elseif($this->input->post('updateType') == 'deletetask'){\n $condition = array('TaskId' => $this->input->post('taskId'));\n $log_data = array('Status' => 'D','UpdatedTS' => date('Y-m-d H:i:s'));\n try{\n $this->task_model->updateData('task',$log_data,$condition);\n echo TRUE;\n } catch (Exception $ex){\n echo FALSE;\n exit;\n }\n }\n }",
"public function status_update()\n {\n if (!$this->input->is_ajax_request()) {\n exit('No direct script access allowed');\n }\n \n if ($this->input->server('REQUEST_METHOD') != 'POST') {\n show_ajax_error('403', lang('error_message_forbidden'));\n }\n \n $id = $this->input->post('id',TRUE);\n $status = $this->input->post('status',TRUE);\n if (empty($id) || empty($status)) {\n show_ajax_error('404', lang('error_message'));\n }\n \n $result = $this->cms_page_model->as_array()->get($id);\n if (empty($result)) {\n show_ajax_error('404', lang('error_message'));\n }\n \n $status = ($status == \"true\") ? 1 : 0;\n if ($this->cms_page_model->update($id, array('status' => $status))) {\n if ($status) {\n set_ajax_flashdata('success', lang('status_enabled'));\n } else {\n set_ajax_flashdata('success', lang('status_disabled'));\n }\n } else {\n set_ajax_flashdata('error', lang('error_message'));\n }\n }",
"public function massStatusAction()\n {\n $curriculumdocIds = $this->getRequest()->getParam('curriculumdoc');\n if (!is_array($curriculumdocIds)) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_curriculumdoc')->__('Please select curriculum docs.')\n );\n } else {\n try {\n foreach ($curriculumdocIds as $curriculumdocId) {\n $curriculumdoc = Mage::getSingleton('bs_curriculumdoc/curriculumdoc')->load($curriculumdocId)\n ->setStatus($this->getRequest()->getParam('status'))\n ->setIsMassupdate(true)\n ->save();\n }\n $this->_getSession()->addSuccess(\n $this->__('Total of %d curriculum docs were successfully updated.', count($curriculumdocIds))\n );\n } catch (Mage_Core_Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_curriculumdoc')->__('There was an error updating curriculum docs.')\n );\n Mage::logException($e);\n }\n }\n $this->_redirect('*/*/index');\n }",
"protected function _updateStatus()\n {\n $this->_writeStatusFile(\n array(\n 'time' => time(),\n 'done' => ($this->_currentItemCount == $this->_totalFeedItems),\n 'count' => $this->_currentItemCount,\n 'total' => $this->_totalFeedItems,\n 'message' => \"Importing content. Item \" . $this->_currentItemCount\n . \" of \" . $this->_totalFeedItems . \".\"\n )\n );\n }",
"function update_activity($pid) {\n $a_name = $_POST['activity_name'];\n $a_destination = $_POST['activity_destination'];\n $a_caption = $_POST['caption'];\n $a_meta_title = $_POST['meta_title'];\n $a_meta_keywords = $_POST['meta_keywords'];\n $a_meta_description = $_POST['meta_description'];\n $a_description = $_POST['data'];\n $a_image = $this->upload_activity_image();\n $a_publish = $_POST['publish'];\n if (empty($a_image)) {\n $sql = \"UPDATE activity SET activity_name='$a_name',destination_id='$a_destination',caption='$a_caption',meta_title='$a_meta_title',meta_keywords='$a_meta_keywords',meta_description='$a_meta_description',description='$a_description',publish='$a_publish' WHERE id='$pid'\";\n $this->mysqli->query($sql);\n } else {\n $sql = \"UPDATE activity SET activity_name='$a_name',destination_id='$a_destination',caption='$a_caption',meta_title='$a_meta_title',meta_keywords='$a_meta_keywords',meta_description='$a_meta_description',description='$a_description',image= '$a_image',publish='$a_publish' WHERE id='$pid'\";\n $this->mysqli->query($sql);\n }\n\n\n if ($this->mysqli->error) {\n echo $this->mysqli->error;\n } else {\n echo \"<script type='text/javascript'>alert('Activity updated successfully')</script>\";\n }\n }",
"public function setActive()\n {\n $this->status = AutoEvent::STATUS_ACTIVE;\n $this->save();\n }",
"public function UserListChangeStatus(): void{\n \n if(!ArtworkVerifier::setStatusList($_POST) || !Session::isLogin()){\n exit;\n }\n \n if(isset(UserList::where('user_list.user_id', Session::getUser()['id'])->where('user_list.artwork_id', $_POST['artwork_id'])->getOne()->id)){\n UserList::values([ 'user_list.status' => $_POST['status'] ])\n ->where('user_id' ,Session::getUser()['id'])\n ->where('artwork_id', $_POST['artwork_id'])\n ->update();\n exit;\n }\n }",
"function setStatus($statusid, $status) {\n\tglobal $gStatusTable;\n\n\t$cmd = \"UPDATE $gStatusTable SET status = $status, timeOfLastChange = \" . time() . \" WHERE statusid = $statusid;\";\n\tdoSimpleCommand($cmd);\n}",
"private function updateSpoolStatus ()\n {\n\n $oAppMessage = (new AppMessage())->retrieveByPK ($this->spool_id);\n if ( is_array ($this->fileData['attachments']) )\n {\n $attachment = implode (\",\", $this->fileData['attachments']);\n $oAppMessage->setappMsgAttach ($attachment);\n }\n $oAppMessage->setappMsgstatus ($this->status);\n $oAppMessage->setappMsgsenddate (date ('Y-m-d H:i:s'));\n $oAppMessage->save ();\n }",
"public function status() : void\n {\n $jwt = Auth::isValidToken($_COOKIE['SSID']);\n \n if (!$jwt) {\n View::jsonResponse(['status' => 401, 'message' => 'Access denied for you!']);\n }\n\n $data = [ 'status' => $_POST['status'], 'id' => $_POST['statusid']];\n $data = Validator::cleanData($data);\n (new Task())->update($data)->execute();\n header('location: user-profile');\n\n }",
"public function testUpdateStatusByUserId()\n {\n $session = $this->objectManager->create(\\Magento\\Security\\Model\\AdminSessionInfo::class);\n /** @var $session \\Magento\\Security\\Model\\AdminSessionInfo */\n $session->getResource()->updateStatusByUserId(\n \\Magento\\Security\\Model\\AdminSessionInfo::LOGGED_OUT_BY_LOGIN,\n 1,\n [1],\n [1],\n '2016-01-19 12:00:00'\n );\n $collection = $session->getResourceCollection()\n ->addFieldToFilter('main_table.user_id', 1)\n ->addFieldToFilter('main_table.status', \\Magento\\Security\\Model\\AdminSessionInfo::LOGGED_OUT_BY_LOGIN)\n ->load();\n $count = $collection->count();\n $this->assertGreaterThanOrEqual(1, $count);\n }",
"public function update_status()\n\t{\n\t\t$product_id = $this->input->post('product_id');\n\t\t$data = array('is_active' => $this->input->post('is_active'));\n\n\t\t$update = $this->products->update($product_id, $data);\n\n\t\tif ($update)\n\t\t{\n\t\t\tif ($this->input->post('is_active') == 1)\n\t\t\t{\n\t\t\t\techo 'true';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\techo 'false';\n\t\t\t}\n\t\t}\n\t}",
"function update_vdotestimonial_status($vdo_testimonial_id,$vdo_testimonial_status)\n {\n if($vdo_testimonial_status==0)\n {\n $new_stat=\"1\";\n }\n elseif($vdo_testimonial_status==1)\n {\n $new_stat=\"0\";\n }\n $query = $this->db->query(\"UPDATE tbl_testimonial SET testimonial_status = '$new_stat' WHERE testimonial_id='$vdo_testimonial_id'\");\n //echo $this->db->last_query();\n }",
"public function updateStatus(){\t\t\tif( is_null( $this->id ) ) trigger_error( \"User::update(): Attempt to update a user object that does not have its ID property set.\", E_USER_ERROR );\r\n\t\t\t\r\n\t\t\r\n\r\n\t\t\t//Update the object\r\n\t\t\t$conn = new PDO( DB_DSN, DB_USERNAME, DB_PASSWORD );\t\t\r\n\t\t\t$sql = \"UPDATE \".TABLENAME_GROUPS.\" SET status=:status WHERE id = :id\";\r\n\t\t\t$st = $conn->prepare( $sql );\r\n\t\t\t$st->bindValue( \":status\", $this->status, PDO::PARAM_STR );\r\n\t\t\t$st->bindValue( \":id\", $this->id, PDO::PARAM_INT );\r\n\t\t\techo \"<br>\";\r\n\t\t\t$st->execute();\r\n\t\t//\tprint_r($st->errorInfo());\r\n\t\t\t$conn = null;\t\r\n\t\t\t\r\n\t\t\treturn true;\r\n\t\t}",
"public function activeAlerts(){\n $today=Date('Y-m-d');\n $data=array(\n 'status'=>'active'\n );\n $this->db->where('reminderDate <=',$today);\n $this->db->where('status !=','done');\n $this->db->update('regularcost',$data);\n }",
"public function status_update(Request $request)\n {\n $this->validate($request, [\n \"post_id\" => \"required\",\n \"status\" => \"required\",\n ]);\n\n $tag = Tag::find($request->post_id);\n if (count($tag) > 0) {\n $tag->status = $request->status;\n $tag->update();\n $this->removeThisCache($tag->slug);\n }\n exit;\n }",
"function update_status($formdata){\n\t\t$status=$formdata[\"status\"];\n\t\t$status=preg_replace(\"/>|<|\\\"/\",\"\",$status);\n\t\t$status=addslashes($status);\n\t\t$ID=$formdata[\"fileID\"];\n\t\t$this->db->set_query(\"update upload_tracking set status='$status' where ID=$ID\");\n\t\t$this->db->execute_query();\n\t}",
"public function updateCarePlanStatus(CareplanStatusRequest $request){\r\n\r\n\r\n $careplan = $this->careplan->changeStatus($request);\r\n $message = trans('message.careplan_completed_successfully');\r\n try{ \r\n $patient_id = encrypt_decrypt('decrypt', $request->get('patient_id'));\r\n } catch (DecryptException $e) {\r\n abort(404);\r\n exit;\r\n }\r\n $activeCarePlan = $this->careplan->checkActiveCarePlan($patient_id);\r\n if($careplan->status == 2) {\r\n $message = trans('message.careplan_discontinued_successfully');\r\n }\r\n\r\n if($request->has('is_base_line') && $request->get('is_base_line') == '1') {\r\n $message = trans('message.careplan_base_line_successfully');\r\n $request->session()->flash('message.level','success');\r\n $request->session()->flash('message.content',trans('message.careplan_base_line_successfully'));\r\n }\r\n \r\n return $this->respond([\r\n 'status' => 'success',\r\n 'message'=> $message,\r\n 'activeCarePlan' =>$activeCarePlan\r\n ]);\r\n }",
"public function updateLeadStatus() {\n\n /////////////////////////////////////////////////////////////////////\n // CHECK REQUIRED DATA //////////////////////////////////////////////\n /////////////////////////////////////////////////////////////////////\n\n if (is_null($this->__apiPrivateToken)) {\n throw new \\Exception(\"API Private Token must be setted!\");\n }\n\n if (is_null($this->__leadEmail)) {\n throw new \\Exception(\"Lead email must be setted!\");\n }\n\n if (!isset($this->__leadData['status'])) {\n throw new \\Exception(\"Lead data 'status' must be setted!\");\n }\n\n /////////////////////////////////////////////////////////////////////\n // PREPARE DATA COLLECTION //////////////////////////////////////////\n /////////////////////////////////////////////////////////////////////\n\n $this->__translateLeadData();\n\n $this->__leadData['email'] = $this->__leadEmail;\n\n /////////////////////////////////////////////////////////////////////\n // PERFORM REQUEST TO API ///////////////////////////////////////////\n /////////////////////////////////////////////////////////////////////\n\n return $this->__request('POST', 'generic');\n }",
"public function update(){\n $CampaignContactID = $this->input->post('ContactsID');\n $remark = $this->input->post('remark');\n $newdate = $this->input->post('newdate');\n $p_date = date(\"Y-m-d\") ;\n\n if($this->input->post('submit') != ''){\n\n $sql = $this->db->query(\"insert into crm_followuplog (CampaignContactID,FollowupDate,NewFollowupDate,Remarks,Status) values ('$CampaignContactID','$p_date','$newdate','$remark','3')\");\n $query = $this->db->query(\"update crm_campaigncontacts set Status = '3' where CampaignContactID ='$CampaignContactID'\");\n\n if ($query && $sql){\n $this->session->set_flashdata('msg', '<div class=\"alert alert-success text-center\">Record Updated Successfully</div>');\n redirect('Agent');\n } else{\n $this->session->set_flashdata('msg', '<div class=\"alert alert-danger text-center\">Record Updated Successfully</div>');\n redirect('Agent');\n }\n\n\n }else if($this->input->post('close_succ') != ''){\n \n $sql = $this->db->query(\"insert into crm_followuplog (CampaignContactID,FollowupDate,NewFollowupDate,Remarks,Status) values ('$CampaignContactID','$p_date','$p_date','$remark','4')\");\n\n $query = $this->db->query(\"update crm_campaigncontacts set Status = '4' where CampaignContactID ='$CampaignContactID'\");\n\n if ($query && $sql){\n $this->session->set_flashdata('msg', '<div class=\"alert alert-success text-center\">Record Updated Successfully</div>');\n redirect('Agent');\n } else{\n $this->session->set_flashdata('msg', '<div class=\"alert alert-danger text-center\">Record Updated Successfully</div>');\n redirect('Agent');\n }\n \n }else if($this->input->post('close_unsucc') != ''){\n $sql = $this->db->query(\"insert into crm_followuplog (CampaignContactID,FollowupDate,NewFollowupdate,Remarks,Status) values ('$CampaignContactID','$p_date','$p_date','$remark','5')\");\n\n $query = $this->db->query(\"update crm_campaigncontacts set Status = '5' where CampaignContactID ='$CampaignContactID'\");\n\n if ($query && $sql){\n $this->session->set_flashdata('msg', '<div class=\"alert alert-success text-center\">Record Updated Successfully</div>');\n redirect('Agent');\n } else{\n $this->session->set_flashdata('msg', '<div class=\"alert alert-danger text-center\">Record Updated Successfully</div>');\n redirect('Agent');\n }\n }\n \n }",
"public function changestatus()\r {\r $query=\"update `\".$this->tablename.\"` set `status`='\".$this->status.\"' where `id`='\".$this->id.\"' \";\r $result=mysqli_query($this->conn,$query);\r return $result;\r }",
"function attendance_update_status($status, $acronym, $description, $grade, $visible,\n $context = null, $cm = null, $studentavailability = null,\n $availablebeforesession = false, $setunmarked = false) {\n global $DB;\n\n if (empty($context)) {\n $context = context_system::instance();\n }\n\n if (isset($visible)) {\n $status->visible = $visible;\n $updated[] = $visible ? get_string('show') : get_string('hide');\n } else if (empty($acronym) || empty($description)) {\n return array('acronym' => $acronym, 'description' => $description);\n }\n\n $updated = array();\n\n if ($acronym) {\n $status->acronym = $acronym;\n $updated[] = $acronym;\n }\n if ($description) {\n $status->description = $description;\n $updated[] = $description;\n }\n if (isset($grade)) {\n $status->grade = $grade;\n $updated[] = $grade;\n }\n if (isset($studentavailability)) {\n if (empty($studentavailability)) {\n if ($studentavailability !== '0') {\n $studentavailability = null;\n }\n }\n\n $status->studentavailability = $studentavailability;\n $updated[] = $studentavailability;\n }\n if (strpos(strval($availablebeforesession), 'on') === false) {\n $status->availablebeforesession = 0;\n } else {\n $status->availablebeforesession = 1;\n }\n if ($setunmarked) {\n $status->setunmarked = 1;\n } else {\n $status->setunmarked = 0;\n }\n $DB->update_record('attendance_statuses', $status);\n\n $event = \\mod_attendance\\event\\status_updated::create(array(\n 'objectid' => $status->attendanceid,\n 'context' => $context,\n 'other' => array('acronym' => $acronym, 'description' => $description, 'grade' => $grade,\n 'updated' => implode(' ', $updated))));\n if (!empty($cm)) {\n $event->add_record_snapshot('course_modules', $cm);\n }\n $event->add_record_snapshot('attendance_statuses', $status);\n $event->trigger();\n}",
"public function AdvertisementReadStatusUpdate() {\n $user = $this->auth();\n if (empty($user)) {\n Utils::response(['status' => false, 'message' => 'Forbidden access.'], 403);\n }\n $input = $this->getInput();\n if (($this->input->method() != 'post') || empty($input)) {\n Utils::response(['status' => false, 'message' => 'Bad request.'], 400);\n }\n $validate = [\n ['field' => 'push_ad_id', 'label' => 'Pushed Advertisement ID', 'rules' => 'required'],\n ];\n $errors = $this->ConsumerModel->validate($input, $validate);\n if (is_array($errors)) {\n Utils::response(['status' => false, 'message' => 'Validation errors.', 'errors' => $errors]);\n }\t\n\t\t$push_ad_id = $this->getInput('push_ad_id');\n\t\t$push_ad_idi = $push_ad_id['push_ad_id'];\n\t\t\n $this->db->set('media_play_date', date(\"Y-m-d H:i:s\")); \n $this->db->where('id', $push_ad_idi);\n if ($this->db->update('push_advertisements')) {\n Utils::response(['status' => true, 'message' => 'Record updated.', 'data' => $input]);\n } else {\n Utils::response(['status' => false, 'message' => 'System failed to update.'], 200);\n }\n }",
"public function updated(Edit $edit)\n {\n if($edit->isDirty('status')){\n $action = $edit->status;\n $user = $action == 'canceled' ? $edit->moderator : $edit->editor;\n $actor = $action == 'canceled' ? $edit->editor : $edit->moderator;\n $name = \"{$actor->firstname} {$actor->lastname}\";\n $user->notify(new BidUpdate($edit, $name, $action));\n }\n }"
] | [
"0.6924823",
"0.6761882",
"0.6652148",
"0.64107347",
"0.6376545",
"0.63629335",
"0.6092509",
"0.6091419",
"0.6086233",
"0.60679716",
"0.6002882",
"0.6002878",
"0.59842557",
"0.5967905",
"0.5959951",
"0.5943025",
"0.5932857",
"0.59139794",
"0.5906948",
"0.59011734",
"0.5897609",
"0.58907783",
"0.58647585",
"0.58601165",
"0.5855743",
"0.5851927",
"0.5851278",
"0.5847067",
"0.58310336",
"0.5831012",
"0.5829287",
"0.582631",
"0.5813866",
"0.5798406",
"0.57973164",
"0.57960045",
"0.57911956",
"0.57889456",
"0.57853925",
"0.5784678",
"0.57771754",
"0.5774429",
"0.57600236",
"0.57563287",
"0.57428515",
"0.5735191",
"0.5733376",
"0.57270616",
"0.56891906",
"0.5682828",
"0.5675715",
"0.5675018",
"0.5657193",
"0.5656971",
"0.5627963",
"0.562721",
"0.5625903",
"0.56246436",
"0.56074995",
"0.56073844",
"0.5593783",
"0.5589606",
"0.5588298",
"0.5587022",
"0.5579919",
"0.5574549",
"0.55728024",
"0.55563664",
"0.5555767",
"0.5549014",
"0.5541471",
"0.55396646",
"0.5534917",
"0.5532725",
"0.5525252",
"0.5524761",
"0.5519614",
"0.5518059",
"0.55174977",
"0.5511099",
"0.5507829",
"0.55056757",
"0.5505505",
"0.5498838",
"0.5482541",
"0.54736245",
"0.54652995",
"0.5463242",
"0.5462216",
"0.5461121",
"0.545658",
"0.5456389",
"0.5455233",
"0.5444463",
"0.5440793",
"0.54400504",
"0.54398566",
"0.543726",
"0.54312664",
"0.5429555"
] | 0.61144453 | 6 |
For internal only. DO NOT USE IT. | public function deserialize($param)
{
if ($param === null) {
return;
}
if (array_key_exists("Records",$param) and $param["Records"] !== null) {
$this->Records = [];
foreach ($param["Records"] as $key => $value){
$obj = new ConfigData();
$obj->deserialize($value);
array_push($this->Records, $obj);
}
}
if (array_key_exists("ContinueToken",$param) and $param["ContinueToken"] !== null) {
$this->ContinueToken = $param["ContinueToken"];
}
if (array_key_exists("RemainingCount",$param) and $param["RemainingCount"] !== null) {
$this->RemainingCount = $param["RemainingCount"];
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function __init__() { }",
"private function __() {\n }",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"protected function init() {}",
"private function __construct()\t{}",
"private function init()\n\t{\n\t\treturn;\n\t}",
"final private function __construct() {}",
"final private function __construct() {}",
"final private function __construct(){\r\r\n\t}",
"final private function __construct() {\n\t\t\t}",
"final private function __construct() { }",
"final private function __construct() { }",
"final private function __construct() { }",
"private function _i() {\n }",
"protected function fixSelf() {}",
"protected function fixSelf() {}",
"protected final function __construct() {}",
"protected function initialize() {}",
"protected function initialize() {}",
"protected function initialize() {}",
"protected function initialize() {}",
"protected function init()\n\t{\n\t\t\n\t}",
"private function __construct() {\r\n\t\r\n\t}",
"private function __construct() {\r\n\t\t\r\n\t}",
"protected function init() {return;}",
"final private function __construct()\n\t{\n\t}",
"private function __construct () {}",
"final private function __construct()\n {\n }",
"private final function __construct() {}",
"public function __init(){}",
"public function helper()\n\t{\n\t\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() {}",
"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()\n\t{\n\t\t\n\t}"
] | [
"0.62662613",
"0.6151871",
"0.5989886",
"0.5989886",
"0.5989886",
"0.5989886",
"0.5989418",
"0.5989418",
"0.5989418",
"0.5989418",
"0.5989418",
"0.5989418",
"0.5988404",
"0.5988404",
"0.5949015",
"0.5939596",
"0.59168774",
"0.59168774",
"0.58703923",
"0.58665824",
"0.5855589",
"0.5855589",
"0.5855589",
"0.5799749",
"0.5797107",
"0.5797107",
"0.57807934",
"0.5749856",
"0.5749856",
"0.5749856",
"0.5749856",
"0.57458705",
"0.5741364",
"0.571247",
"0.5701768",
"0.5694139",
"0.5680823",
"0.5673589",
"0.5668696",
"0.5640213",
"0.5639332",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5627174",
"0.5626381",
"0.56240404",
"0.56240404",
"0.5610547"
] | 0.0 | -1 |
Sets a new createdBy | public function setCreatedBy(\GoetasWebservices\Client\SalesforceEnterprise\Sobject\UserType $createdBy)
{
$this->createdBy = $createdBy;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setCreatedBy($createdBy);",
"public function _setCreatedBy($createdBy) {\n\t\t$this->_createdBy = $createdBy;\n\t}",
"public function setCreatedByAttribute(){\n $this->attributes['created_by'] = Auth::user()->id;\n }",
"public function setCreatedBy($val)\n {\n $this->_propDict[\"createdBy\"] = $val;\n return $this;\n }",
"public function setCreatedBy($val)\n {\n $this->_propDict[\"createdBy\"] = $val;\n return $this;\n }",
"public function setCreatedBy($val)\n {\n $this->_propDict[\"createdBy\"] = $val;\n return $this;\n }",
"private function SetCreatedBy(User $value = null)\n\t\t{\n\t\t\t$this->createdby = $value;\n\t\t}",
"public function setCreatedBy(User $createdBy)\n\t{\n\t\t$this->createdBy=$createdBy; \n\t\t$this->keyModified['created_by'] = 1; \n\n\t}",
"public function setCreatedBy(?IdentitySet $value): void {\n $this->getBackingStore()->set('createdBy', $value);\n }",
"public function setCreatedBy(?IdentitySet $value): void {\n $this->getBackingStore()->set('createdBy', $value);\n }",
"public function setCreatedBy(?UserIdentity $value): void {\n $this->getBackingStore()->set('createdBy', $value);\n }",
"public function setCreatedBy($var)\n {\n GPBUtil::checkString($var, True);\n $this->createdBy = $var;\n\n return $this;\n }",
"public function setCreatedBy()\n {\n $userService = app()->make(AuthUserService::class);\n if ($userService->check()) {\n $this->{static::CREATED_BY} = $userService->user()->id;\n }\n\n return $this;\n }",
"public function setCreated_by($created_by)\n {\n $this->created_by = $created_by;\n \n return $this;\n }",
"public function setCreatedby($input){\n\n $this->m_Createdby=$input;\n }",
"public function setCreatedBy($createdBy) {\n\t\t$this->_setCreatedBy($createdBy);\n\t\treturn $this;\n\t}",
"public function setCreatedBy(?SubmissionUserIdentity $value): void {\n $this->getBackingStore()->set('createdBy', $value);\n }",
"public function _setCreatedByAdmin($createdByAdmin) {\n\t\t$this->_createdByAdmin = $createdByAdmin;\n\t}",
"public function setCreatedBy($creator) {\n\n $this->u_createdby = $creator;\n\n }",
"public function setCreatedBy(UserInterface $createdBy)\n {\n $this->createdBy = $createdBy;\n $this->addFollower($createdBy);\n\n return $this;\n }",
"public function setCreatedBy($createdBy)\n {\n $this->createdBy = $createdBy;\n\n return $this;\n }",
"public function setCreatedBy($createdBy)\n {\n $this->createdBy = $createdBy;\n\n return $this;\n }",
"public function setCreatedBy($createdBy)\n {\n $this->createdBy = $createdBy;\n\n return $this;\n }",
"public function getCreatedBy()\n {\n return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;\n }",
"public function getCreatedBy()\n {\n return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;\n }",
"public function getCreatedBy()\n {\n return $this->createdBy instanceof CreatedByBuilder ? $this->createdBy->build() : $this->createdBy;\n }",
"public function setCreatedBy(?WorkbookEmailIdentity $value): void {\n $this->getBackingStore()->set('createdBy', $value);\n }",
"public function set_created_by($created_by)\n\t{\n\t\tif (is_null($created_by)) {\n\t\t\tthrow new InvalidArgumentException(\"Project Created By Invalid!\");\n\t\t}\n\t\t$this->created_by = $created_by;\n\t}",
"public function setCreatedByUserId(?string $value): void {\n $this->getBackingStore()->set('createdByUserId', $value);\n }",
"public function getCreatedBy()\n {\n return $this->createdBy;\n }",
"public function getCreatedBy()\n {\n return $this->createdBy;\n }",
"public function getCreatedBy()\n {\n return $this->createdBy;\n }",
"public function getCreatedBy()\n {\n return $this->createdBy;\n }",
"public function getCreatedBy()\n {\n return $this->createdBy;\n }",
"public function getCreatedBy()\n {\n return $this->createdBy;\n }",
"public function getCreateBy()\n {\n return $this->hasOne(User::className(), ['id' => 'created_by']);\n }",
"public function _getCreatedBy() {\n\t\treturn $this->_createdBy;\n\t}",
"public function getCreatedBy()\n\t{\n\t\treturn $this->createdBy; \n\n\t}",
"public function createdBy() {\r\n return $this->belongsTo('User', 'created_by_id');\r\n }",
"public function getCreatedBy()\n {\n return $this->created_by;\n }",
"public function setCreator(User $creator);",
"public function createdBy()\n {\n return $this->belongsTo(User::class, 'created_by_id');\n }",
"public function get_created_by()\n\t{\n\t\treturn $this->created_by;\n\t}",
"public function setCreatedBy($userID);",
"public function setCreatedBy($v)\n\t{\n\t\tif ($v !== null) {\n\t\t\t$v = (int) $v;\n\t\t}\n\n\t\tif ($this->created_by !== $v) {\n\t\t\t$this->created_by = $v;\n\t\t\t$this->modifiedColumns[] = CampaignPeer::CREATED_BY;\n\t\t}\n\n\t\tif ($this->asfGuardUserProfile !== null && $this->asfGuardUserProfile->getId() !== $v) {\n\t\t\t$this->asfGuardUserProfile = null;\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function getCreatedby() {\n\n return $this->u_createdby;\n\n }",
"public function getCreatedBy()\n\t{\n\t\treturn $this->created_by;\n\t}",
"public function createdBy()\n {\n return $this->belongsTo(User::class, 'created_by');\n }",
"public function setcreatedByUserId($createdByUserId)\n {\n $this->createdByUserId = $createdByUserId;\n\n return $this;\n }",
"public function setCreatedBy(int $createdBy)\n\t{\n\t\t$this->createdBy = $createdBy;\n\n\t\treturn $this;\n\t}",
"public function setCreatedByIdAttribute($input)\n {\n $this->attributes['created_by_id'] = $input ? $input : null;\n }",
"public function setCreatedByIdAttribute($input)\n {\n $this->attributes['created_by_id'] = $input ? $input : null;\n }",
"public function createdBy()\n {\n return $this->belongsTo(User::class, 'created_by')->withDefault();\n }",
"public function createdBy()\n {\n return $this->belongsTo('App\\User', 'created_by');\n }",
"public function createdBy()\n\t{\n\t\treturn $this->hasOne('App\\User', 'id', 'created_by');\n\t}",
"public function getCreatedBy()\n {\n return $this->hasOne(User::className(), ['id' => 'created_by']);\n }",
"public function getCreatedBy()\n {\n return $this->hasOne(User::className(), ['id' => 'created_by']);\n }",
"public function getCreatedBy()\n {\n return $this->hasOne(User::className(), ['id' => 'created_by']);\n }",
"public function getCreatedBy()\n {\n return $this->hasOne(User::className(), ['id' => 'created_by']);\n }",
"public function getCreatedBy()\n {\n if (array_key_exists(\"createdBy\", $this->_propDict)) {\n if (is_a($this->_propDict[\"createdBy\"], \"\\Beta\\Microsoft\\Graph\\Model\\IdentitySet\") || is_null($this->_propDict[\"createdBy\"])) {\n return $this->_propDict[\"createdBy\"];\n } else {\n $this->_propDict[\"createdBy\"] = new \\Beta\\Microsoft\\Graph\\Model\\IdentitySet($this->_propDict[\"createdBy\"]);\n return $this->_propDict[\"createdBy\"];\n }\n }\n return null;\n }",
"public function setCreator(): self\n {\n $this->added_by_user_id = auth()->user() ? auth()->user()->id : User::SYSUID;\n return $this;\n }",
"public function getCreatedBy()\n {\n $this->loadManyToOne('createdBy');\n return $this->createdBy;\n }",
"public function created_by() {\n return $this->belongsTo(User::class,'created_by_id');\n }",
"public function creator()\n\t{\n\t\treturn $this->belongsToOne('Hubzero\\User\\User', 'created_by');\n\t}",
"public function creator()\n\t{\n\t\treturn $this->belongsToOne('Hubzero\\User\\User', 'created_by');\n\t}",
"public function getCreatedBy() {\n\t\treturn $this->hasOne ( User::className (), [ \n\t\t\t\t'id' => 'created_by_id' \n\t\t] );\n\t}",
"public function testCreatedBy()\n {\n $createdBy = new User();\n $event = (new Event())->setCreatedBy($createdBy);\n $this->assertEquals($createdBy, $event->getCreatedBy());\n }",
"public function setCreatedByAdmin($createdByAdmin) {\n\t\t$this->_setCreatedByAdmin($createdByAdmin);\n\t\treturn $this;\n\t}",
"public function created_by()\n {\n return $this->belongsTo(User::class);\n }",
"public function getCreatedBy()\n {\n return $this->hasOne(User::class, ['id' => 'created_by']);\n }",
"public function set()\n\t{\n\t\t$this->created_at = date(TIMESTAMP_FORMAT);\n $user = new SessionUser();\n\t\t$this->created_by = $user->getID();\t\t\n\t}",
"public function createdbyuser() {\n # Define an inverse one-to-many relationship.\n return $this->belongsTo('\\dsa\\User');\n }",
"public function setBy($x) { $this->by = $x; }",
"public function getCreatedby()\n {\n return ($this->m_Createdby);\n }",
"public function setBy($by) {\n\t\t$this->attributes['by'] = $by;\n\t\t$this->by = $by;\n\t\treturn $this;\n\t}",
"public function creator()\n {\n return $this->belongsTo('App\\User', 'created_by', 'id');\n }",
"public function creator()\n {\n return $this->belongsTo('App\\User', 'created_by');\n }",
"public function getCreatedBy() {\n if(array_key_exists('created_by', $this->_attributes)) {\n return $this->_attributes['created_by'];\n }\n return 0;\n }",
"public function creator()\n {\n return $this->belongsTo(User::class, 'created_by');\n }",
"public function creator()\n {\n return $this->belongsTo(User::class, 'created_by');\n }",
"public function creator()\n {\n return $this->belongsTo(User::class, 'created_by');\n }",
"public function creator()\n {\n return $this->belongsTo(User::class, 'created_by');\n }",
"public function creator()\n {\n return $this->belongsTo(User::class, 'created_by');\n }",
"public function getCreatedby0()\n {\n return $this->hasOne(User::className(), ['id' => 'createdby']);\n }",
"public function getCreatedby0()\n {\n return $this->hasOne(User::className(), ['id' => 'createdby']);\n }",
"public function setCreatedBy(UserAccount $user)\n {\n $this->createdBy = $user;\n return $this;\n }",
"public function createdBy()\n {\n return $this->belongsTo(Profile::class, 'creator');\n }",
"public function creator()\n {\n return $this->belongsTo('App\\User','created_by');\n }",
"public function getCreatedBy()\n {\n if (is_null($this->createdBy)) {\n /** @psalm-var stdClass|array<string, mixed>|null $data */\n $data = $this->raw(self::FIELD_CREATED_BY);\n if (is_null($data)) {\n return null;\n }\n\n $this->createdBy = CreatedByModel::of($data);\n }\n\n return $this->createdBy;\n }",
"public function setCreatedUserId($createdUserId)\n {\n $this->createdUserId = $createdUserId;\n }",
"public function getCreatedBy();",
"public function getCreatedBy();"
] | [
"0.8216921",
"0.8114994",
"0.76430213",
"0.7635457",
"0.7635457",
"0.7635457",
"0.75729996",
"0.7457851",
"0.7391107",
"0.7391107",
"0.7334303",
"0.7326282",
"0.72881913",
"0.72687143",
"0.72362894",
"0.7217606",
"0.71846706",
"0.6980544",
"0.6979759",
"0.6937103",
"0.69142026",
"0.69142026",
"0.69142026",
"0.681875",
"0.681875",
"0.681875",
"0.6798105",
"0.67509156",
"0.67501456",
"0.67450464",
"0.67450464",
"0.67450464",
"0.67450464",
"0.67450464",
"0.67450464",
"0.6732617",
"0.66832346",
"0.6662076",
"0.66419804",
"0.6637471",
"0.6635165",
"0.66276383",
"0.6622067",
"0.6622054",
"0.66216683",
"0.66147053",
"0.65613264",
"0.6531189",
"0.65069354",
"0.64887303",
"0.6468831",
"0.6468831",
"0.64551044",
"0.64173025",
"0.63889956",
"0.63880605",
"0.63880605",
"0.63880605",
"0.63880605",
"0.6375493",
"0.63697964",
"0.6358796",
"0.6358685",
"0.63270056",
"0.63270056",
"0.63121134",
"0.6288616",
"0.626926",
"0.6236574",
"0.62299097",
"0.62286985",
"0.62084305",
"0.6195566",
"0.615506",
"0.61132693",
"0.6108385",
"0.60940814",
"0.6082035",
"0.60762286",
"0.60762286",
"0.60762286",
"0.60762286",
"0.60762286",
"0.60634995",
"0.60634995",
"0.60608405",
"0.605156",
"0.60483116",
"0.6004113",
"0.59948",
"0.599264",
"0.599264"
] | 0.6494974 | 56 |
Sets a new createdById | public function setCreatedById($createdById)
{
$this->createdById = $createdById;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setCreatedByIdAttribute($input)\n {\n $this->attributes['created_by_id'] = $input ? $input : null;\n }",
"public function setCreatedByIdAttribute($input)\n {\n $this->attributes['created_by_id'] = $input ? $input : null;\n }",
"public function setCreatedById(int $createdById): self\n {\n $this->createdById = $createdById;\n\n return $this;\n }",
"public function set($new_id);",
"public function getCreatedById(): int\n {\n return $this->createdById;\n }",
"public function setCreated($created);",
"public function setCreated($created);",
"function SetId($value) { $this->id=$value; }",
"protected function getNewID()\n {\n $ids = [];\n $namedIds = [];\n foreach (static::$ids as $k) {\n // attempt use the supplied value if the ID property is mutable\n $property = static::getProperty($k);\n if (in_array($property['mutable'], [self::MUTABLE, self::MUTABLE_CREATE_ONLY]) && isset($this->_unsaved[$k])) {\n $id = $this->_unsaved[$k];\n } else {\n $id = self::$driver->getCreatedID($this, $k);\n }\n\n $ids[] = $id;\n $namedIds[$k] = $id;\n }\n\n $this->_id = implode(',', $ids);\n $this->_ids = $namedIds;\n }",
"public function create($data_id, $created_by, $created_at);",
"public function setCreated($created)\n {\n $this->created = $created;\n }",
"public function setCreatedByUserId(?string $value): void {\n $this->getBackingStore()->set('createdByUserId', $value);\n }",
"public function setCreatedUserId($createdUserId)\n {\n $this->createdUserId = $createdUserId;\n }",
"public function setCreatedByAttribute(){\n $this->attributes['created_by'] = Auth::user()->id;\n }",
"public function setCreatedBy($createdBy);",
"public function setCreatedBy(?IdentitySet $value): void {\n $this->getBackingStore()->set('createdBy', $value);\n }",
"public function setCreatedBy(?IdentitySet $value): void {\n $this->getBackingStore()->set('createdBy', $value);\n }",
"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 setNameAndId() {}",
"public function setOriginalId($id);",
"public function setCreated($created) {\n\t\t$this->created = (string) $created;\n\t}",
"public function create($id)\n {\n \n }",
"public function getPersistedId();",
"public function setIdEntityCreated(int $iIdEntityCreated) : Form\n {\n $this->_iIdEntityCreated = $iIdEntityCreated;\n return $this;\n }",
"function test_setId()\n {\n //Arrange\n $id = null;\n $description = \"Wash the dog\";\n $test_task = new Task($description, $id);\n $test_task->save();\n\n //Act\n $test_task->setId(2);\n\n //Assert\n $result = $test_task->getId();\n $this->assertEquals(2, $result);\n }",
"public function create($id)\n {\n\n }",
"public function create($id)\n {\n\n }",
"public function setCreated(string $created) : self\n {\n $this->initialized['created'] = true;\n $this->created = $created;\n return $this;\n }",
"public function setCreated(\\DateTime $created) {\n\n $this->created = $created->format('Y-m-d H:i:s');\n\n }",
"public function create($id)\n {\n }",
"public function setCreatedBy($val)\n {\n $this->_propDict[\"createdBy\"] = $val;\n return $this;\n }",
"public function setCreatedBy($val)\n {\n $this->_propDict[\"createdBy\"] = $val;\n return $this;\n }",
"public function setCreatedBy($val)\n {\n $this->_propDict[\"createdBy\"] = $val;\n return $this;\n }",
"public function create($id)\n {\n //\n\n }",
"public function addCreated()\n {\n try {\n $date = new DateTime();\n $this->created_at = $date->format('Y-m-d H:i:s');\n $this->created_by = 0;\n } catch (Exception $e) {\n print_r($e);\n }\n }",
"public function setId($value) {\r\n\t\t$this->_id = $value;\r\n\t\treturn $this;\r\n\t}",
"public function setCreated(?int $created): self\n {\n $this->created = $created;\n\n return $this;\n }",
"public function setCreated(?int $created): self\n {\n $this->created = $created;\n\n return $this;\n }",
"public function setId($id) { $this->id = $id; }",
"public function setCreatedBy(?UserIdentity $value): void {\n $this->getBackingStore()->set('createdBy', $value);\n }",
"function setId($value) {\n $this->_id = intval($value);\n }",
"protected function setCreated(?int $created = null)\n {\n $this->created = $created;\n return $this;\n }",
"public function setCreated($created)\r\n {\r\n $this->created = $created;\r\n\r\n return $this;\r\n }",
"function setId($id) {\n\t\treturn $this->setData('id', $id);\n\t}",
"public function setId($id) ;",
"public function _setCreatedOn($createdOn) {\n\t\t$this->_createdOn = $createdOn;\n\t}",
"public function setCreated($created)\n {\n $this->created = $created;\n return $this;\n }",
"public function setCreated(\\DateTime $created)\n {\n $this->entity->setCreated($created);\n }",
"public function beforeCreate()\n {\n $api = new Api(Settings::get('api_key'));\n $api->setRegion($this->region);\n $summoner = $api->summoner();\n $this->id = $summoner->info($this->name)->id;\n }",
"public function setCreatedBy()\n {\n $userService = app()->make(AuthUserService::class);\n if ($userService->check()) {\n $this->{static::CREATED_BY} = $userService->user()->id;\n }\n\n return $this;\n }",
"function create () {\n\t\t$stm = DB::$pdo->prepare(\"insert into `generated_object` ({$generator_insert_columns}) \n\t\t\t\t\t\t\t\t values ({$generator_insert_values})\");\n\t\t// generator bind hook\n\t\t$stm->execute();\n\n\t\t$this->id = DB::$pdo->lastInsertId();\n\t}",
"public function _setCreatedBy($createdBy) {\n\t\t$this->_createdBy = $createdBy;\n\t}",
"public function setIdAttribute($value)\n {\n $this->attributes['id'] = $value;\n }",
"public function create($id) //pasamos el id del cliente\n {\n \n }",
"public function setCreator(): self\n {\n $this->added_by_user_id = auth()->user() ? auth()->user()->id : User::SYSUID;\n return $this;\n }",
"public function setId($_id);",
"public function setId($id){ $this->id=$id;}",
"function setId($id) {\n $this->id = $id;\n }",
"function setId($id) {\n $this->id = $id;\n }",
"public function SetId ($id);",
"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 function setId($id)\n {\n $this->id = $id;\n\n \n }",
"function setCreated($value) {\n\t\treturn $this->setColumnValue('created', $value, Model::COLUMN_TYPE_INTEGER_TIMESTAMP);\n\t}",
"public function setId($id);",
"public function setId($id);",
"public function setId($id);",
"public function setId($id);",
"public function setId($id);",
"public function setId($id);",
"public function setId($id);",
"public function setId($id);",
"public function setId($id);",
"public function setId($id);",
"public function setId($id);",
"public function setId($id);",
"public function setId($id);",
"public function getCreatedUserId()\n {\n return $this->createdUserId;\n }",
"public function setID($id);",
"public function setId($val)\n {\n $this->_propDict[\"id\"] = $val;\n return $this;\n }",
"public function setId($data)\n {\n $this->_Id=$data;\n return $this;\n }",
"public function setId($data)\n {\n $this->_Id=$data;\n return $this;\n }",
"function setId($id) {\n\t\t$this->setData('id', $id);\n\t}",
"function getNewId();",
"function setId($id)\n {\n $this->id = $id;\n }",
"function setId($id){\n\t\t$this->id = $id;\n\t}",
"function __construct($id) {\n $this->setId($id);\n }",
"public function setCreatedBy(?SubmissionUserIdentity $value): void {\n $this->getBackingStore()->set('createdBy', $value);\n }",
"public function regenerateId();",
"public function regenerateId();",
"public function setId($id) \n {\n $this->id = $id;\n }"
] | [
"0.6869682",
"0.6869682",
"0.6846024",
"0.62374187",
"0.622825",
"0.6195046",
"0.6195046",
"0.6093279",
"0.6077382",
"0.60097885",
"0.6006017",
"0.59396476",
"0.5860723",
"0.5836463",
"0.58184063",
"0.57892907",
"0.57892907",
"0.5780386",
"0.5748185",
"0.5746042",
"0.56967294",
"0.5684264",
"0.5671756",
"0.5662714",
"0.5658333",
"0.5658249",
"0.5658249",
"0.56404215",
"0.5624237",
"0.561751",
"0.560492",
"0.560492",
"0.560492",
"0.5587127",
"0.5548543",
"0.5546855",
"0.5543625",
"0.5543625",
"0.55273247",
"0.5500278",
"0.5481111",
"0.54809475",
"0.54742634",
"0.54732233",
"0.5463249",
"0.5462131",
"0.5450118",
"0.5436978",
"0.54359114",
"0.5419725",
"0.5403347",
"0.5393041",
"0.5390399",
"0.53888845",
"0.53835106",
"0.5358761",
"0.5348749",
"0.5346496",
"0.5346496",
"0.5343994",
"0.5340715",
"0.5340715",
"0.5340715",
"0.5332741",
"0.53287244",
"0.53247005",
"0.53247005",
"0.53247005",
"0.53247005",
"0.53247005",
"0.53247005",
"0.53247005",
"0.53247005",
"0.53247005",
"0.53247005",
"0.53247005",
"0.53247005",
"0.53247005",
"0.5323427",
"0.5318155",
"0.53168887",
"0.5313617",
"0.5313617",
"0.53108966",
"0.53095233",
"0.53081083",
"0.53006274",
"0.52996135",
"0.52964807",
"0.528937",
"0.528937",
"0.52883995"
] | 0.71555436 | 6 |
Sets a new createdDate | public function setCreatedDate(\DateTime $createdDate)
{
$this->createdDate = $createdDate;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setCreated($date)\n {\n $this->created = $date;\n }",
"public function setCreatedDate($date)\r\n\t\t{\r\n\t\t\t$this->_created_date = $date;\r\n\t\t}",
"public function setCreated(\\DateTime $created) {\n\n $this->created = $created->format('Y-m-d H:i:s');\n\n }",
"public function set_creation_date($created)\n {\n $this->set_default_property(self::PROPERTY_CREATION_DATE, $created);\n }",
"public function setDateCreated($value)\n {\n $this->validateDate('DateCreated', $value);\n $this->validateNotNull('DateCreated', $value);\n\n if ($this->data['date_created'] === $value) {\n return;\n }\n\n $this->data['date_created'] = $value;\n $this->setModified('date_created');\n }",
"private function SetCreated(\\DateTime $value)\n\t\t{\n\t\t\t$this->created = $value;\n\t\t}",
"public function setCreatedDate(DateTime $createdDate);",
"public function setCreated($date) \n\t{\n\t\t$this->created = $this->parseDate($date);\n\t}",
"public function setCreated($created)\n {\n $this->created = $created;\n }",
"public function setCreated($created);",
"public function setCreated($created);",
"public function setDate()\n\t{\n\t\tif ($this->getIsNewRecord())\n\t\t\t$this->create_time = time();\n\t}",
"public function setCreated(\\DateTime $created)\n {\n $this->entity->setCreated($created);\n }",
"public function setCreated(\\DateTime $created = null)\n {\n $this->created = $created;\n }",
"public function setCreationDate($date) {}",
"function setCreatedDate($inCreatedDate) {\n\t\tif ( $inCreatedDate !== $this->_CreatedDate ) {\n\t\t\tif ( !$inCreatedDate instanceof DateTime ) {\n\t\t\t\t$inCreatedDate = new systemDateTime($inCreatedDate, system::getConfig()->getSystemTimeZone()->getParamValue());\n\t\t\t}\n\t\t\t$this->_CreatedDate = $inCreatedDate;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}",
"public function setDateCreated($dateCreated)\n {\n $this->dateCreated = VT::toDateTimeImmutable($dateCreated);\n }",
"public function setCreateDates(){\n $t = date_create(date('Y-m-d H:i:s'));\n $this->created = $t;\n $this->modified = $t;\n }",
"public function setCreated($created) {\n\t\t$this->created = (string) $created;\n\t}",
"public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }",
"public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }",
"public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }",
"public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }",
"public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }",
"public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }",
"public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }",
"public function setCreatedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('createdDateTime', $value);\n }",
"public function setDate()\n\t{\n\t\tif($this->isNewRecord)\n\t\t\t$this->create_time=$this->update_time=time();\n\t\telse\n\t\t\t$this->update_time=time();\n\t}",
"public function setDate()\n\t{\n\t\tif($this->isNewRecord)\n\t\t\t$this->create_time=$this->update_time=time();\n\t\telse\n\t\t\t$this->update_time=time();\n\t}",
"public function setDateCreated($data)\n {\n $this->_DateCreated=$data;\n return $this;\n }",
"public function _setCreatedOn($createdOn) {\n\t\t$this->_createdOn = $createdOn;\n\t}",
"public function setDateTime($value)\n {\n $this->createdAt=$value;\n }",
"public function setDateCreated($value) : Job\n {\n $this->validateDate('DateCreated', $value);\n\n if ($this->data['date_created'] !== $value) {\n $this->data['date_created'] = $value;\n $this->setModified('date_created');\n }\n\n return $this;\n }",
"public function setDateCreated($date_created) {\n if (!isset($date_created)) {\n $date_created = \\M\\Carbon::now();\n }\n $this->fields[\"date_created\"] = $date_created;\n\n return $this;\n }",
"public function set_date_created( $date = null ) {\n\t\tglobal $wpdb;\n\n\t\tif ( ! is_null( $date ) ) {\n\n\t\t\t$datetime_string = wcs_get_datetime_utc_string( wcs_get_datetime_from( $date ) );\n\n\t\t\t// Don't use wp_update_post() to avoid infinite loops here\n\t\t\t$wpdb->query( $wpdb->prepare( \"UPDATE $wpdb->posts SET post_date = %s, post_date_gmt = %s WHERE ID = %d\", get_date_from_gmt( $datetime_string ), $datetime_string, $this->get_id() ) );\n\n\t\t\t$this->post->post_date = get_date_from_gmt( $datetime_string );\n\t\t\t$this->post->post_date_gmt = $datetime_string;\n\t\t}\n\t}",
"public function setCreationDate(\\DateTime $creationDate) {\n\t\t$this->creationDate = $creationDate;\n\t}",
"public function setCreatedDateTime($val)\n {\n $this->_propDict[\"createdDateTime\"] = $val;\n return $this;\n }",
"public function setCreatedDateTime($val)\n {\n $this->_propDict[\"createdDateTime\"] = $val;\n return $this;\n }",
"public function setCreatedDateTime($val)\n {\n $this->_propDict[\"createdDateTime\"] = $val;\n return $this;\n }",
"public function setCreatedDateTime($val)\n {\n $this->_propDict[\"createdDateTime\"] = $val;\n return $this;\n }",
"public function setCreatedDateTime($val)\n {\n $this->_propDict[\"createdDateTime\"] = $val;\n return $this;\n }",
"public function setCreatedDateTime($val)\n {\n $this->_propDict[\"createdDateTime\"] = $val;\n return $this;\n }",
"public function setCreatedDateTime($val)\n {\n $this->_propDict[\"createdDateTime\"] = $val;\n return $this;\n }",
"public function setCreatedDateTime($val)\n {\n $this->_propDict[\"createdDateTime\"] = $val;\n return $this;\n }",
"public function setCreationDate($date = true) {}",
"public function setCreatedAtValue()\n {\n $this->createdAt = new \\DateTime();\n }",
"public function setCreatedDate(\\DateTimeInterface $created_date) {\n $this->set('created_date', $created_date, 'user');\n }",
"function setCreateDate($inCreateDate) {\n\t\tif ( $inCreateDate !== $this->_CreateDate ) {\n\t\t\tif ( !$inCreateDate instanceof DateTime ) {\n\t\t\t\t$inCreateDate = new systemDateTime($inCreateDate, system::getConfig()->getSystemTimeZone()->getParamValue());\n\t\t\t}\n\t\t\t$this->_CreateDate = $inCreateDate;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}",
"public function setDateCreated($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->date_created !== null || $dt !== null) {\n if ($this->date_created === null || $dt === null || $dt->format(\"Y-m-d H:i:s.u\") !== $this->date_created->format(\"Y-m-d H:i:s.u\")) {\n $this->date_created = $dt === null ? null : clone $dt;\n $this->modifiedColumns[KluBillTableMap::COL_DATE_CREATED] = true;\n }\n } // if either are not null\n\n return $this;\n }",
"public function setCreated(\\DateTime $created)\n {\n $this->created = $created;\n\n return $this;\n }",
"public function setCreated(\\DateTime $created)\n {\n $this->created = $created;\n\n return $this;\n }",
"public function setCreated(\\DateTime $created)\n {\n $this->created = $created;\n\n return $this;\n }",
"public function setCreated(\\DateTime $created)\n {\n $this->created = $created;\n\n return $this;\n }",
"public function setCreated(\\DateTime $created)\n {\n $this->created = $created;\n\n return $this;\n }",
"function setCreated($value) {\n\t\treturn $this->setColumnValue('created', $value, Model::COLUMN_TYPE_INTEGER_TIMESTAMP);\n\t}",
"public function addCreated()\n {\n try {\n $date = new DateTime();\n $this->created_at = $date->format('Y-m-d H:i:s');\n $this->created_by = 0;\n } catch (Exception $e) {\n print_r($e);\n }\n }",
"function setCreateDate($inCreateDate) {\n\t\tif ( $inCreateDate !== $this->_CreateDate ) {\n\t\t\t$this->_CreateDate = $inCreateDate;\n\t\t\t$this->setModified();\n\t\t}\n\t\treturn $this;\n\t}",
"public function setCreateDate($createDate) {\n\t\t$this->createDate = $createDate;\n\t}",
"public function setCreateDate($createDate) {\n\t\t$this->createDate = $createDate;\n\t}",
"public function setCreatedDate($createdDate = null)\n {\n // validation for constraint: string\n if (!is_null($createdDate) && !is_string($createdDate)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a string, \"%s\" given', gettype($createdDate)), __LINE__);\n }\n if (is_null($createdDate) || (is_array($createdDate) && empty($createdDate))) {\n unset($this->CreatedDate);\n } else {\n $this->CreatedDate = $createdDate;\n }\n return $this;\n }",
"public function setDateCreated($newDateCreated) {\n //if null for a new profile\n if($newDateCreated === null){\n date_default_timezone_set('America/Denver'); // CDT\n \n $current_date = date('Y-m-d H:i:s');\n \n $this->dateCreated = $current_date;\n return;\n }\n \n //zeroth, if the is a DateTime object, assign it\n if(gettype($newDateCreated) === \"object\" && get_class($newDateCreated) === \"DateTime\") {\n $this->dateCreated = $newDateCreated;\n return;\n }\n \n $newDateCreated = trim($newDateCreated);\n $newDateCreated = filter_var($newDateCreated, FILTER_SANITIZE_STRING);\n \n //second, use a regular expression to extract the date and verify it\n if((preg_match(\"/^(\\d{4})-(\\d{2})-(\\d{2}) (\\d{2}):(\\d{2}):(\\d{2})$/\", $newDateCreated, $matches)) !== 1) {\n throw(new RangeException(\"DateCreated $newDateCreated is not a mySQL formatted date\"));\n }\n \n //verify the date is valid date\n $year = intval($matches[1]);\n $month = intval($matches[2]);\n $day = intval($matches[3]);\n if((checkdate($month, $day, $year)) === false) {\n throw(new RangeException(\"DateCreated $newDateCreated is not a gregorian date\"));\n }\n \n //convert the date to a DateTime Object\n if(($dateTime = DateTime::createFromFormat(\"Y-m-d H:i:s\", $newDateCreated)) === false) {\n throw(new RangeException(\"DateCreated $newDateCreated cannot be converted to a DateTime object\"));\n }\n $this->dateCreated = $dateTime;\n }",
"public function setCreatedAt()\n {\n $this->createdAt = new \\DateTime();\n }",
"public function setCreatedAt(?string $createdAt): void\n {\n $this->createdAt = $createdAt;\n }",
"public function setCreatedAt(?string $createdAt): void\n {\n $this->createdAt = $createdAt;\n }",
"public function setCreateDate(string $create_date): void\n {\n $this->create_date = $create_date;\n }",
"public function setDateCreated($date_created)\n {\n $this->date_created = $date_created;\n\n return $this;\n }",
"public function setDateCreated($date_created)\n {\n $this->date_created = $date_created;\n\n return $this;\n }",
"public function setCreatedDate($created_date)\n {\n $this->created_date = $created_date;\n\n return $this;\n }",
"public function setCreatedDate(NostoDate $date)\n {\n $this->createdDate = $date;\n }",
"public function setCreatedAt(string $createdAt): void\n {\n $this->createdAt = $createdAt;\n }",
"public function setCreated($created)\r\n {\r\n $this->created = $created;\r\n\r\n return $this;\r\n }",
"public function setCreatedAtAttribute($value)\n {\n $this->attributes['created_at'] = date('Y-m-d');\n }",
"public function setCreated(string $created) : self\n {\n $this->initialized['created'] = true;\n $this->created = $created;\n return $this;\n }",
"public function setCreateDate($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->create_date !== null || $dt !== null) {\n $currentDateAsString = ($this->create_date !== null && $tmpDt = new DateTime($this->create_date)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ($currentDateAsString !== $newDateAsString) {\n $this->create_date = $newDateAsString;\n $this->modifiedColumns[] = JadwalPeer::CREATE_DATE;\n }\n } // if either are not null\n\n\n return $this;\n }",
"public function setCreationTimestamp(?DateTime $value): void {\n $this->getBackingStore()->set('creationTimestamp', $value);\n }",
"public function setCreateDate(int $create_date);",
"public function setCreateddate(DateTime $createddate)\n {\n $this->createddate = $createddate;\n\n return $this;\n }",
"public function setCreated($created)\n {\n $this->created = $created;\n return $this;\n }",
"public function setCreatedAt($createdAt) \r\n {\r\n $this->createdAt = $createdAt;\r\n }",
"public function setDateCreated(\\DateTime $dateCreated): self\n {\n $this->options['dateCreated'] = $dateCreated;\n return $this;\n }",
"public function setDateCreated(\\DateTime $dateCreated): self\n {\n $this->options['dateCreated'] = $dateCreated;\n return $this;\n }",
"public function setCreateDate($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->create_date !== null || $dt !== null) {\n $currentDateAsString = ($this->create_date !== null && $tmpDt = new DateTime($this->create_date)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ($currentDateAsString !== $newDateAsString) {\n $this->create_date = $newDateAsString;\n $this->modifiedColumns[] = BangunanPeer::CREATE_DATE;\n }\n } // if either are not null\n\n\n return $this;\n }",
"public function setCreatedAt(DateTime $date);",
"function setCreatedTime($arg0) {\n\t\t$this->created_time = $arg0;\n\t\t$this->addModifiedColumn('created_time');\n\t\treturn $this;\n\t}",
"public function setCreatedAtAttribute($value)\n {\n $this->attributes['created_at'] = $value;\n }",
"public function setCreatedAt($value)\n {\n if (!array_key_exists('created_at', $this->fieldsModified)) {\n $this->fieldsModified['created_at'] = $this->data['fields']['created_at'];\n } elseif ($value === $this->fieldsModified['created_at']) {\n unset($this->fieldsModified['created_at']);\n }\n\n $this->data['fields']['created_at'] = $value;\n }",
"protected function _syncCreationDate() {}",
"public function setCreateDate($v)\n {\n $dt = PropelDateTime::newInstance($v, null, 'DateTime');\n if ($this->create_date !== null || $dt !== null) {\n $currentDateAsString = ($this->create_date !== null && $tmpDt = new DateTime($this->create_date)) ? $tmpDt->format('Y-m-d H:i:s') : null;\n $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;\n if ( ($currentDateAsString !== $newDateAsString) // normalized values don't match\n || ($dt->format('Y-m-d H:i:s') === '2021-06-07 11:49:57') // or the entered value matches the default\n ) {\n $this->create_date = $newDateAsString;\n $this->modifiedColumns[] = SanitasiPeer::CREATE_DATE;\n }\n } // if either are not null\n\n\n return $this;\n }",
"public function setCreatedTime(\\DateTime $createdTime)\n\t{\n\t\t$this->createdTime=$createdTime; \n\t\t$this->keyModified['created_time'] = 1; \n\n\t}",
"public function setCreated(&$var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->created = $var;\n }",
"public function setCreatedAt($createdAt);",
"public function setCreatedAt($createdAt);"
] | [
"0.81955886",
"0.80737525",
"0.8001593",
"0.7996125",
"0.7949413",
"0.78637725",
"0.78248113",
"0.78135",
"0.7689254",
"0.76404387",
"0.76404387",
"0.7603654",
"0.7596511",
"0.74782205",
"0.7467138",
"0.74530053",
"0.7401812",
"0.7382374",
"0.73703736",
"0.7335531",
"0.7335531",
"0.7335531",
"0.7335531",
"0.7335531",
"0.7335531",
"0.7335531",
"0.7335531",
"0.7310956",
"0.7310956",
"0.73075795",
"0.72519326",
"0.7248115",
"0.72329974",
"0.71413654",
"0.71341425",
"0.71125394",
"0.71086544",
"0.71086544",
"0.71086544",
"0.71086544",
"0.71086544",
"0.71086544",
"0.71086544",
"0.71086544",
"0.71081173",
"0.70699996",
"0.7046076",
"0.7009126",
"0.6972611",
"0.6968051",
"0.6968051",
"0.6968051",
"0.6968051",
"0.6968051",
"0.69444096",
"0.6921568",
"0.6921416",
"0.69050306",
"0.69050306",
"0.6893921",
"0.6887829",
"0.6861037",
"0.6848872",
"0.6848872",
"0.6847216",
"0.6845181",
"0.6845181",
"0.6845163",
"0.6842438",
"0.68159866",
"0.68132186",
"0.6788215",
"0.6780812",
"0.6756775",
"0.6756018",
"0.6751024",
"0.67507416",
"0.674259",
"0.6739044",
"0.6723715",
"0.6723715",
"0.6711986",
"0.6703826",
"0.6697763",
"0.6689952",
"0.66832423",
"0.6677545",
"0.66763973",
"0.66743857",
"0.66429037",
"0.66390723",
"0.66390723"
] | 0.696837 | 57 |
Sets a new entity | public function setEntity(\GoetasWebservices\Client\SalesforceEnterprise\Sobject\ContractType $entity)
{
$this->entity = $entity;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setEntity( $entity )\n {\n \n $this->entity = $entity;\n \n }",
"public function setEntity( $entity )\n {\n\n $this->entity = $entity;\n $this->rowid = $entity->getId();\n \n }",
"public function setEntity($entity) {\n\t\tif ($entity instanceof Orm\\ActiveEntity) {\n\t\t\t$this->_entityInstance = $entity;\n\t\t\tlist($id) = $entity->getMetadata()->getIdFields();\n\t\t\t$this->setEntityId($entity->$id);\n\t\t\t$entity = get_class($entity);\n\t\t} elseif (is_string($entity)) {\n\t\t\tif (!class_exists($entity)) {\n\t\t\t\tthrow new Nette\\InvalidArgumentException(\"Class '$entity' does not exist!\");\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new Nette\\InvalidArgumentException('You have to supply either an entity name or its instance!');\n\t\t}\n\t\t//parent::setEntity($entity);\n\t\t$this->defaultSetter('entity', $entity); // Because of PHP<5.3.4\n\t}",
"public function _setEntity($current, $new){\n trigger_error('Setting entity is not allowed', E_USER_ERROR);\n }",
"abstract public function setRecordEntity();",
"public function setEntity( $entity )\n {\n\n $this->setEntityWbfsysEntityTag( $entity );\n\n }",
"public function testSetEntity()\n {\n $this->testObject->setEntity('abc');\n\n $this->assertEquals('dev_abc', $this->testObject->getEntity());\n }",
"function set_entity($ent){\n $this -> table = $ent;\n }",
"public function setEntity($entity)\r\n {\r\n $this->entity = $entity;\r\n\r\n return $this;\r\n }",
"public function set($key, $value) {\n $this->data->entity->$key = $value;\n return $this;\n }",
"public function setUserEntity( UserEntity $user ) { $this->user = $user; }",
"abstract protected function getEntitySetWithDefaults();",
"public function setEntity(MEntityDescription $entity) {\n\t\t\t$this->entity = $entity;\n\t\t}",
"private function createEntity()\n {\n $this->entity = $this->container->make($this->entity());\n }",
"public function setEntity( $entity )\n {\n\n $this->setEntityWbfsysMessageSendway( $entity );\n\n }",
"public function __construct($entity)\n {\n $this->entity = $entity;\n }",
"function jo($entity) {\n $entity->setEntityId(($entity->getEntityId() +1));\n }",
"public function save($entity);",
"public function save($entity);",
"public function save($entity);",
"public function setEntityClass(?string $entityClass);",
"public function save($entity, $context) {\n unset($entity->id);\n $entity->is_new = TRUE;\n entity_save($this->entityType, $entity);\n }",
"public function setId_entity($id_entity)\n {\n $this->id_entity = $id_entity;\n \n return $this;\n }",
"function setEntity($entity_type, $entity_id) {\n $this->checkChange();\n\n // Ignore empty values.\n if (empty($entity_type) || empty($entity_id)) {\n return $this;\n }\n\n $this->entity_type = $entity_type;\n $this->entity_id = $entity_id;\n return $this;\n }",
"public function setEntity(/*\\MU\\ImageModule\\Entity\\AlbumEntity */$entity)\n {\n $this->entity = $entity;\n }",
"public function create($entity);",
"public function setEntity($entity)\n {\n $this->_entity = $entity;\n $this->_commentCollection = null;\n // Changing model and resource model can lead to change of comment collection\n return $this;\n }",
"public function setEntityToId($id)\n {\n // try to get from cache\n if(\\Cache::has($id)){\n $entity = \\Cache::get($id);\n }else {\n $collection = new LaravelCollection($this->resourceService()->first('id',$id));\n\n if( !$collection->isEmpty() ){\n $entity = new $this($collection);\n }else{\n throw new \\App\\Exceptions\\EmptyException();\n }\n }\n\n if(isset($entity) && $entity->items !== NULL){\n //\n $this->items = $entity->items;\n $this->links = $entity->links;\n //#\n $this->relationships = $entity->relationships;\n }else{\n throw new \\App\\Exceptions\\EmptyException();\n }\n }",
"public function setEntityClass($entityClass);",
"public function add($entity);",
"public function createEntity();",
"function __construct($entity)\n\t{\n\t\t$this->entity = $entity;\n\t}",
"function create($entity);",
"public function setEntityId($entityId) {\n $this->entityId = $entityId;\n }",
"public function setUser(UserEntity $user): void\n {\n $this->user = $user;\n }",
"public function persist($entity)\n {\n }",
"public function setUser(UserEntity $user) : void\n\t{\n\t\t$this->user = $user;\n\t}",
"public function Attach(&$entity)\n {\n \n }",
"abstract protected function getNewEntityInstance();",
"public function postPersist($entity);",
"public function __set($name, $value)\n {\n $setterMethodName = 'set' . ucfirst($name);\n if (method_exists($this, $setterMethodName)) {\n return $this->{$setterMethodName}($value);\n }\n\n throw new EntityException('Data Entities are ready only by default. Define a setter to allow manipulating fields.');\n }",
"public function setEntityId(?int $entityId);",
"public function __construct(Entity $entity)\n {\n $this->entity = $entity;\n }",
"abstract public function set();",
"public function testSaveNewEntity() {\n\t\t$entity = new Entity([\n\t\t\t'username' => 'superuser',\n\t\t\t'password' => 'root',\n\t\t\t'created' => self::date(),\n\t\t\t'updated' => self::date(),\n\t\t], ['className' => 'UserEntity']);\n\n\t\t$table = TableRegistry::get('users');\n\t\t$this->assertSame($entity, $table->save($entity));\n\t\t$this->assertEquals(self::$nextUserId, $entity->id);\n\n\t\t$row = $table->find('first', [\n\t\t\t'conditions' => ['id' => self::$nextUserId],\n\t\t\t'entity' => true,\n\t\t]);\n\t\t$this->assertEquals($entity->toArray(), $row->toArray());\n\t}",
"public function set($new_id);",
"public function add(object $entity): void\n {\n }",
"protected function createEntity($data) {\n\n if(!empty($this->model_class)) {\n \n $this->createModelInstance($data);\n\n } else {\n \n $this->entity = $data;\n\n }\n \n }",
"abstract protected function createEntityInstance();",
"protected function setUp(): void\n {\n parent::setUp();\n\n $this->data[$this->identifier] = 1;\n\n $this->entity = new $this->class($this->data);\n }",
"public function setData($key, $value)\n {\n\n if (is_object($value)) {\n // muss auf false gesetzt werden, da der wert der Entity\n // sich ändern könnte und auf dieser beim save auch ein save getriggert\n // werden muss\n $this->synchronized = false;\n \n if ($value instanceof Entity) {\n \n if ('rowid' === $key) {\n\n // speichern der entity nachdem diese entity gespeichert wurde\n Log::warn('Veraltete zuweisung auf rowid');\n $this->postSave[] = $value;\n\n } else {\n\n $this->preSave[$key] = array($value,$key,null) ;\n\n if (!$value->isNew()) {\n $this->data[$key] = $value->getId();\n }\n \n $this->linked[$key] = $value;\n }\n \n } else {\n\n /// TODO was soll das?\n $this->data[$key] = $value->getId();\n\n // kann zB ein Upload Element sein, dass die ID des hochgeladenen Files zurückgibt\n $value->setEntity($this);\n $this->postSave[$key] = array($value, $key,null);\n }\n\n } else {\n\n if (!isset($this->data[$key])) {\n\n $this->synchronized = false;\n $this->data[$key] = $value;\n \n } elseif (!is_array($value) && $this->data[$key] !== (string)$value) {\n\n $this->synchronized = false;\n $this->data[$key] = $value;\n } else {\n\n $this->synchronized = false;\n $this->data[$key] = $value;\n }\n }\n\n }",
"protected function saveNew($entity)\n {\n $this->em->persist($entity);\n $this->update();\n }",
"public function saveModel($entity){\n $this->entityManager->persist($entity);\n $this->entityManager->flush();\n }",
"public function Add(&$entity)\n {\n \n }",
"public function update($entity)\n {\n $this->getObjectManager()->persist($entity);\n $this->getObjectManager()->flush();\n }",
"public function save($entity, $context) {\n if (empty($entity->cid)) {\n $entity->created = REQUEST_TIME;\n }\n\n $entity->changed = REQUEST_TIME;\n\n parent::save($entity, $context);\n }",
"public function update($entity);",
"public function update($entity);",
"public function create(Entity $entity);",
"public function __construct( $entity ){\r\n\t\t$this->root_entity = new Entity( $entity, array() );\r\n\t}",
"public function Add($entity) {\n }",
"public function setData($data) {\n if (empty($data)) {\n return;\n }\n if (is_object($data) || is_array($data)) {\n foreach ($this->_data as $field => $value) {\n if (array_key_exists($field, $data)) {\n $temp_val = $data[$field];\n } else {\n $temp_val = $value;\n }\n $this->__set($field, $temp_val);\n }\n } else {\n throw new Exception('The entity \"' . get_class($this) .\n '\" must be created by an array or object.');\n }\n }",
"public function update(DataObject $entity){\n }",
"public function pushEntity($entity): void\n {\n /** @var EntityRepository $repository */\n $repository = Prime::repository($entity);\n $mapper = $repository->mapper();\n\n $isReadOnly = $mapper->isReadOnly();\n $mapper->setReadOnly(false);\n\n $repository->disableEventNotifier();\n $repository->insert($entity);\n $repository->enableEventNotifier();\n\n $mapper->setReadOnly($isReadOnly);\n }",
"public function update($entity){ \n //TODO: Implement update record.\n }",
"private function fillEntity(array $data)\n {\n $this->entity->setData($data);\n }",
"public function update($entity)\n {\n \n }",
"abstract public function store(Entity $oMappedEntity);",
"public function setUser(Entity $user)\n {\n if ($this->isConnected()) {\n if (!($user instanceof Entity)) {\n throw new MazeoException(\"The type of method \\\"setUser\\\" parameter in the class \".__CLASS__.\"\n must be a subclass of Mazeo\\\\Main\\\\Entity\\\\Entity type of \".gettype($user). \" given\");\n exit;\n }\n $this->user = $user;\n $this->synchronize();\n }\n }",
"public function save($entity) {\n throw new NotImplementedException;\n }",
"public function add($entity)\n {\n $this->getObjectManager()->persist($entity);\n $this->getObjectManager()->flush();\n }",
"public function __set($var, $value)\n\t{\n\t\t$entity = $this->execute();\n\t\tif($entity) {\n\t\t\t$entity->$var = $value;\n\t\t}\n\t}",
"public function prePersist($entity);",
"public function __construct()\n\t{\n\t $this->entity = new Salidas;\n\t}",
"public function set($data);",
"public static function StoreById($entity)\n {\n if(!isset(StorageManager::$entities[$entity->Alias]))\n {\n StorageManager::$entities[$entity->Alias] = array();\n }\n\n StorageManager::$entities[$entity->Alias][$entity->IdEntite] = $entity;\n }",
"public function setEntity($entity = array())\n {\n // check if only one entry is given\n if (count($entity) <> 1) {\n throw new \\InvalidArgumentException('Must be set with one key/value-pair!');\n }\n\n // fetch key from parameter\n $_tmp = array_keys($entity);\n $key = array_pop($_tmp);\n\n // check if the key of the given array exists\n if (array_key_exists($key, $this->entityList)) {\n // check if value exists for key\n if (in_array($entity[$key], $this->entityList[$key])) {\n $this->defaultOptions['entity'] = $entity;\n }\n }\n\n return $this;\n }",
"public function persistir($entidade, $setarDataEHora = true) {\n try {\n if ($setarDataEHora) {\n $entidade->setDataEHoraDeCriacao();\n }\n $this->getEntityManager()->persist($entidade);\n $this->getEntityManager()->flush($entidade);\n } catch (Exception $exc) {\n echo $exc->getMessage();\n }\n }",
"public function setEntity($entityClass)\n {\n $entityClass = $this->str($entityClass);\n if ($entityClass->contains('.')) {\n $parts = $entityClass->explode('.');\n $entityClass = '\\\\WebinyPlatform\\\\Apps\\\\' . $parts[0] . '\\\\Components\\\\' . $parts[1] . '\\\\Entities\\\\' . $parts[2];\n }\n $this->entityClass = StdObjectWrapper::toString($entityClass);\n\n return $this;\n }",
"public function setEntity($entityName) {\n if (!empty($entityName)) {\n $this->entityName = $entityName;\n $this->entityRepository = $this->entityManager->getRepository($entityName);\n }\n return $this;\n }",
"function _save_entity($entity)\n {\n $post = $this->object->_convert_entity_to_post($entity);\n $primary_key = $this->object->get_primary_key_column();\n // TODO: unsilence this. Wordpress 3.9-beta2 is generating an error that should be corrected before its\n // final release.\n if ($post_id = @wp_insert_post($post)) {\n $new_entity = $this->object->find($post_id, TRUE);\n if ($new_entity) {\n foreach ($new_entity->get_entity() as $key => $value) {\n $entity->{$key} = $value;\n }\n }\n // Save properties as post meta\n $this->object->_flush_and_update_postmeta($post_id, $entity instanceof stdClass ? $entity : $entity->get_entity());\n $entity->{$primary_key} = $post_id;\n // Clean cache\n $this->object->_cache = array();\n }\n $entity->id_field = $primary_key;\n return $post_id;\n }",
"public function insert(DataObject $entity){\n }",
"public function Update($entity) {\n }",
"public function __set($name, $value)\n\t{\n\t\t$method = 'set' . $name;\n\t\tif (!method_exists($this, $method)) \n\t{\n\t\tthrow new \\Exception('Class Entity: Ttcidi Invalid specified property: set'.$name);\n\t}\n\t$this->$method($value);\n\t}",
"protected function updateEntity($entity)\n {\n }",
"protected function setUp(): void\n {\n parent::setUp();\n\n $this->entity = factory(Entity::class)->create();\n $set = factory(AttributeSet::class)->create([\n \t'entity_id' => $this->entity->entity_id,\n ]);\n\n $this->entity->default_attribute_set_id = $set->attribute_set_id; \n $this->entity->save();\n }",
"public function addEntity($entity) {\n $this->entityManager->merge($entity);\n $this->entityManager->flush();\n }",
"protected function postUpdate($entity) {\n if (isset($entity['id'])) {\n ManagerHolder::get('StoreInventory')->createDefault($entity['id'], str_replace('Manager', '', self::class));\n }\n }",
"public function testSetImportedEntity() {\n $entity = (object) [\n 'entity_type' => 'node',\n 'entity_id' => 1,\n 'entity_uuid' => '00000000-0000-0000-0000-000000000000',\n 'modified' => '2016-12-09T20:51:45+00:00',\n 'origin' => '11111111-1111-1111-1111-111111111111',\n ];\n\n $this->contentHubEntitiesTracking = $this->getContentHubEntitiesTrackingService();\n $this->contentHubEntitiesTracking->setImportedEntity($entity->entity_type, $entity->entity_id, $entity->entity_uuid, $entity->modified, $entity->origin);\n\n // Running basic tests.\n $this->assertEquals($entity->entity_type, $this->contentHubEntitiesTracking->getEntityType());\n $this->assertEquals($entity->entity_id, $this->contentHubEntitiesTracking->getEntityId());\n $this->assertEquals($entity->entity_uuid, $this->contentHubEntitiesTracking->getUuid());\n $this->assertEquals($entity->modified, $this->contentHubEntitiesTracking->getModified());\n $this->assertEquals($entity->origin, $this->contentHubEntitiesTracking->getOrigin());\n $this->assertTrue($this->contentHubEntitiesTracking->isAutoUpdate());\n $this->assertFalse($this->contentHubEntitiesTracking->hasLocalChange());\n $this->assertFalse($this->contentHubEntitiesTracking->isPendingSync());\n\n $this->contentHubEntitiesTracking->setLocalChange();\n $this->assertFalse($this->contentHubEntitiesTracking->isAutoUpdate());\n $this->assertTrue($this->contentHubEntitiesTracking->hasLocalChange());\n $this->assertFalse($this->contentHubEntitiesTracking->isPendingSync());\n\n $this->contentHubEntitiesTracking->setPendingSync();\n $this->assertFalse($this->contentHubEntitiesTracking->isAutoUpdate());\n $this->assertTrue($this->contentHubEntitiesTracking->hasLocalChange());\n $this->assertTrue($this->contentHubEntitiesTracking->isPendingSync());\n\n $modified = '2017-11-04T20:51:45+00:00';\n $this->contentHubEntitiesTracking->setModified($modified);\n $this->assertEquals($modified, $this->contentHubEntitiesTracking->getModified());\n\n // Assigning a Database Entity.\n $database_entity = [\n 'entity_type' => 'node',\n 'entity_id' => 1,\n 'entity_uuid' => '00000000-0000-0000-0000-111111111111',\n 'modified' => '2016-12-09T20:51:45+00:00',\n 'origin' => '11111111-1111-1111-1111-111111111111',\n 'status_export' => '',\n 'status_import' => ContentHubEntitiesTracking::AUTO_UPDATE_DISABLED,\n ];\n $this->contentHubEntitiesTracking = $this->getContentHubEntitiesTrackingService($database_entity);\n\n // Trying to load an exported entity should return false.\n $this->assertFalse($this->contentHubEntitiesTracking->loadExportedByUuid($database_entity['entity_uuid']));\n\n // Trying to load an imported entity should work.\n $this->contentHubEntitiesTracking->loadImportedByUuid($database_entity['entity_uuid']);\n $this->assertEquals($database_entity['entity_type'], $this->contentHubEntitiesTracking->getEntityType());\n $this->assertEquals($database_entity['entity_id'], $this->contentHubEntitiesTracking->getEntityId());\n $this->assertEquals($database_entity['entity_uuid'], $this->contentHubEntitiesTracking->getUuid());\n $this->assertEquals($database_entity['modified'], $this->contentHubEntitiesTracking->getModified());\n $this->assertEquals($database_entity['origin'], $this->contentHubEntitiesTracking->getOrigin());\n $this->assertFalse($this->contentHubEntitiesTracking->isAutoUpdate());\n $this->assertFalse($this->contentHubEntitiesTracking->hasLocalChange());\n $this->assertFalse($this->contentHubEntitiesTracking->isPendingSync());\n }",
"public function update(Entity $entity);",
"public function setValue($name, $value)\n {\n foreach ($this->entities as $entity) \n {\n $entity->setValues(array($name => $value));\n }\n }",
"public function importEntity($entity)\n {\n $id = $entity->getId();\n $group = $entity->getGroup();\n $firstName = $entity->getFirstName();\n $lastName = $entity->getLastName();\n $billingStreet = $entity->getBillingStreet();\n $billingCity = $entity->getBillingCity();\n $billingState = $entity->getBillingState();\n $billingZipcode = $entity->getBillingZipcode();\n $isShippingSame = $entity->getIsShippingSame();\n $shippingStreet = $entity->getShippingStreet();\n $shippingCity = $entity->getShippingCity();\n $shippingState = $entity->getShippingState();\n $shippingZipcode = $entity->getShippingZipcode();\n \n $this->setId($id)\n ->setGroup($group)\n ->setEmail($email)\n ->setFirstName($firstName)\n ->setLastName($lastName)\n ->setBillingStreet($billingStreet)\n ->setBillingCity($billingCity)\n ->setBillingState($billingState)\n ->setBillingZipcode($billingZipcode)\n ->setIsShippingSame($isShippingSame)\n ->setShippingStreet($shippingStreet)\n ->setShippingCity($shippingCity)\n ->setShippingState($shippingState)\n ->setShippingZipcode($shippingZipcode)\n ;\n\n return $this;\n }",
"public function createEntity($entityName = null);",
"public function setEntityEmbedTag( $entity )\n {\n\n $this->register( 'entityEmbedTag', $entity );\n\n }",
"public function saveEntity($entity)\n\t{\n\t\t$entityManager = $this->getDoctrine()->getManager();\n\t $entityManager->persist($entity);\n\t $entityManager->flush();\n\t}",
"public function update(stubObject $entity);",
"public function __set($name, $value)\n\t{\n\t\t$method = 'set' . $name;\n\t\tif (!method_exists($this, $method)) \n\t{\n\t\tthrow new \\Exception('Class Entity: Trmsus Invalid specified property: set'.$name);\n\t}\n\t$this->$method($value);\n\t}",
"public function add($entity)\r\n {\r\n \t$cacheKey = $this->getCacheKey($entity->getPrimaryKey());\r\n \t$this->_entities[$cacheKey] = $entity;\r\n }",
"public function markAsPersisted(): void;",
"public function insert(stubObject $entity);",
"public function set_obj_entidade(OBJ_Entidade $obj_entidade) : void\n {\n self::$obj_entidade = $obj_entidade;\n }"
] | [
"0.80323124",
"0.76824903",
"0.73132026",
"0.7236843",
"0.72235405",
"0.7016842",
"0.6988837",
"0.6987082",
"0.6891027",
"0.6687624",
"0.66871154",
"0.66511655",
"0.6611054",
"0.6525341",
"0.6415168",
"0.63810927",
"0.63778937",
"0.6366292",
"0.6366292",
"0.6366292",
"0.6326623",
"0.631655",
"0.6314843",
"0.6293214",
"0.6276864",
"0.62704235",
"0.62455964",
"0.62328655",
"0.62258506",
"0.6196075",
"0.6186507",
"0.61696726",
"0.6135053",
"0.6103918",
"0.60694337",
"0.6063202",
"0.60608274",
"0.6059658",
"0.6030667",
"0.6004403",
"0.599634",
"0.5973236",
"0.595677",
"0.5952738",
"0.59434116",
"0.5931402",
"0.59279674",
"0.5919086",
"0.5910067",
"0.59079725",
"0.5904892",
"0.589401",
"0.58923215",
"0.58608335",
"0.5848303",
"0.5842926",
"0.5832904",
"0.5832904",
"0.58112574",
"0.57983214",
"0.5794919",
"0.57938164",
"0.5789244",
"0.57836586",
"0.5769853",
"0.5766692",
"0.5766246",
"0.57594675",
"0.57316357",
"0.5719825",
"0.5714857",
"0.57036346",
"0.5700316",
"0.56987065",
"0.56915665",
"0.5687363",
"0.56785727",
"0.5677475",
"0.56742406",
"0.5672887",
"0.56716603",
"0.5667773",
"0.5667005",
"0.56521183",
"0.5598961",
"0.55967265",
"0.55826235",
"0.55807006",
"0.55772775",
"0.5573358",
"0.55686074",
"0.5555604",
"0.55555385",
"0.55528796",
"0.5552632",
"0.55474156",
"0.55430883",
"0.55367464",
"0.55334896",
"0.5533402",
"0.55322397"
] | 0.0 | -1 |
Sets a new entityId | public function setEntityId($entityId)
{
$this->entityId = $entityId;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setEntityId(?int $entityId);",
"public function setId_entity($id_entity)\n {\n $this->id_entity = $id_entity;\n \n return $this;\n }",
"public function setEntityId($entityId) {\n $this->entityId = $entityId;\n }",
"public function setEntity( $entity )\n {\n\n $this->entity = $entity;\n $this->rowid = $entity->getId();\n \n }",
"public function setEntity( $entity )\n {\n \n $this->entity = $entity;\n \n }",
"function jo($entity) {\n $entity->setEntityId(($entity->getEntityId() +1));\n }",
"function SetId($value) { $this->id=$value; }",
"protected function _setIdentity($id, $entity) {\r\n\t\tif (!$this->_hasIdentity($id)) {\r\n\t\t\t$this->_identityMap[$id] = $entity;\r\n\t\t}\r\n\t}",
"function setEntity($entity_type, $entity_id) {\n $this->checkChange();\n\n // Ignore empty values.\n if (empty($entity_type) || empty($entity_id)) {\n return $this;\n }\n\n $this->entity_type = $entity_type;\n $this->entity_id = $entity_id;\n return $this;\n }",
"public function setEntityId(string $schema, AbstractEntity $entity): AbstractEntity\n {\n if (!empty($entity->id)) {\n throw new Exception('ID of the entity has already been set.');\n }\n\n $entity->id = (string) $this->counter($this->getCounterKey($schema), 1, ['initial' => 1]);\n\n return $entity;\n }",
"public function set($new_id);",
"public function setEntityTypeId($entityTypeId) {\n $this->entityTypeId = $entityTypeId;\n }",
"public function setIdWithDependency($id, $em) {\n $oldId = $this->getId();\n $this->setId($id);\n if ($id == 1){\n $this->setPartenaireId(1);\n }\n $tasksWithThatClientId = $em->getRepository('maindbBundle:Tachesimple')->findBy(Array('clientId' => $oldId));\n foreach ($tasksWithThatClientId as $task) {\n $task->setClientId($id);\n $em->persist($task);\n $em->flush();\n }\n $em->persist($this);\n $metadata = $em->getClassMetaData(get_class($this));\n $metadata->setIdGeneratorType(\\Doctrine\\ORM\\Mapping\\ClassMetadata::GENERATOR_TYPE_NONE);\n $em->flush();\n }",
"public function setEntity($entity) {\n\t\tif ($entity instanceof Orm\\ActiveEntity) {\n\t\t\t$this->_entityInstance = $entity;\n\t\t\tlist($id) = $entity->getMetadata()->getIdFields();\n\t\t\t$this->setEntityId($entity->$id);\n\t\t\t$entity = get_class($entity);\n\t\t} elseif (is_string($entity)) {\n\t\t\tif (!class_exists($entity)) {\n\t\t\t\tthrow new Nette\\InvalidArgumentException(\"Class '$entity' does not exist!\");\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new Nette\\InvalidArgumentException('You have to supply either an entity name or its instance!');\n\t\t}\n\t\t//parent::setEntity($entity);\n\t\t$this->defaultSetter('entity', $entity); // Because of PHP<5.3.4\n\t}",
"public function setEntityRelatedPk($pk) {\n\t\t$this->_entityRelatedPk = $pk;\n\t}",
"public function setEntity( $entity )\n {\n\n $this->setEntityWbfsysEntityTag( $entity );\n\n }",
"public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }",
"public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }",
"public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }",
"public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }",
"public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }",
"public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }",
"public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }",
"public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }",
"public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }",
"public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }",
"public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }",
"public function SetId ($id);",
"public function setId($id)\n {\n\n $this->idKey = $id;\n $this->context->element = $id;\n\n }",
"public function hydrateId(EntityInterface $entity, int $id): void;",
"public function getId_entity($id_entity=null)\n {\n if ($id_entity != null && is_array($this->entity) && count($this->entity)!=0) {\n $table_name = strtolower(get_class($this));\n $query = \"SELECT * FROM $table_name WHERE id_entity = ?\";\n $req = Manager::bdd()->prepare($query);\n $req->execute([$id_entity]);\n $data = \"\";\n if ($data = $req->fetchAll(PDO::FETCH_ASSOC)) {\n$d=$data[0];\n$this->setId_entity($d['id_entity']);\n$this->setLabel($d['label']);\n$this->setDomaine($d['domaine']);\n$this->setEmail($d['email']);\n$this->setPhone_number($d['phone_number']);\n$this->setBp($d['bp']);\n$this->setLocalisation($d['localisation']);\n$this->setVille($d['ville']);\n$this->setUniqueId($d['uniqueId']);\n$this->setCreated_at($d['created_at']);\n$this->setCreated_by($d['created_by']);\n$this->setUpdate_at($d['update_at']);\n$this->setUpdate_by($d['update_by']);\n$this->entity =$data; \n return $this;\n }\n \n } else {\n return $this->id_entity;\n }\n \n }",
"public function set_id($setid){\n $this->id = $setid;\n }",
"function setId($value) {\n $this->_id = intval($value);\n }",
"public function setPrimaryEntityId($entityClass, $entityId)\n {\n $this->primaryEntity = [$entityClass, $entityId, null, null];\n }",
"public function setId($x) { $this->id = $x; }",
"public function updateIdMapping($entityName, $localId, $remoteId);",
"public function getEntityId();",
"public function getEntityId();",
"public function getEntityId();",
"public function setId($var){\n\t\t$this->id=$var;\n\t}",
"public function setId($id, $new = false)\n {\n\n Log::debug('set id entity: '.$this->getTable().' id: '.$id, $id);\n\n if (! is_numeric($id)) {\n throw new LibDb_Exception(I18n::s('Got invalid error ID {@id@}', 'wbf.message', array (\n 'id' => $id\n )));\n }\n\n $this->synchronized = false;\n\n $this->id = $id;\n $this->isNew = $new;\n\n }",
"public function setID($value) {\r\n //if (!is_numeric($value)) die(\"setID() only accepts a numerical ID value\");\r\n $this->id = $value;\r\n }",
"public function getEntityId()\n {\n return $this->entity_id;\n }",
"function setId($id) {\n $this->id = $id;\n }",
"function setId($id) {\n $this->id = $id;\n }",
"function set_id($id) {\n\t\t$this->id = $id;\n\t}",
"public function setId($id){\n\t\tself::$_id[get_class($this)] = $id;\n\t}",
"public function setId(int $userId)\n {\n $this->_id = (int) $userId;\n }",
"function setId($id) {\n\t\t$this->_id = $id;\n\t}",
"function setId($id) {\r\n $this->_id = $id;\r\n }",
"function getEntityId() {\n return $this->entity_id;\n }",
"public function setEntity($entity)\r\n {\r\n $this->entity = $entity;\r\n\r\n return $this;\r\n }",
"function setId($id)\n {\n $this->id = $id;\n }",
"abstract public function setRecordEntity();",
"function set_id($id)\n {\n $this->id = $id;\n }",
"public function returnId($entity = null);",
"public function setId($id)\n {\n $this->_id = (int) $id;\n }",
"function entityID($entity){\n\t\t$entity = strtolower($entity);\n\t\t// Check local copy\n\t\tif(in_array($entity,$this->entities)) return $this->entities[$entity];\n\t\t\n\t\t// Check DB\n\t\tglobal $sess;\n\t\t$db = $sess->db();\n\t\t$entityID = $db->queryUniqueValue('SELECT id FROM `entities` WHERE `name` LIKE \\''.addslashes($entity).'\\'');\n\t\tif(!$entityID){\n\t\t\t// Create new entity\n\t\t\t$db->preparedInsert('entities',array('name'=>$entity));\n\t\t\t$entityID = $db->lastInsertedId();\n\t\t}\n\t\t// Store in local cache\n\t\t$this->entities[$entity] = $entityID;\t\n\t\treturn $entityID;\n\t}",
"public function setId($id) {\n $this->id = $id;\n }",
"function setId($id) {\n\t\t$this->setData('id', $id);\n\t}",
"public function setId($id) { $this->id = $id; }",
"public function setId($id){\n $this->_id = $id;\n }",
"public function setId($id)\n {\n $id = (int) $id;\n \n if ($id > 0)\n {\n $this->_id = $id;\n }\n }",
"public function initializeId($object_id);",
"private function setId($id)\n {\n $this->id = $id;\n }",
"public function setEntityClass(?string $entityClass);",
"public function set_id( $id ) {\n\t\t$this->id = absint( $id );\n\t}",
"public function setEntityID($entityID)\n {\n $this->entityID = $entityID;\n return $this;\n }",
"public function setId($id)\n {\n $this->_id = (int) $id;\n }",
"function setId($id){\n\t\t$this->id = $id;\n\t}",
"public function setId($id)\n {\n $this->id = $id;\n }",
"public function setId($id) {\n\t\t$this->id = $id;\n\t}",
"public function setId($id) {\n\t\t$this->id = $id;\n\t}",
"public function setId($id) {\n\t\t$this->id = $id;\n\t}",
"public function setId($id) {\n\t\t$this->id = $id;\n\t}",
"public function setId($id) {\n\t\t$this->id = $id;\n\t}",
"public function setId($id) {\r\n $this->id = $id;\r\n }",
"public function setId($id) {\r\n $this->id = $id;\r\n }",
"public function setId($id) \n {\n $this->id = $id;\n }",
"function setId($id){\r\n\t\t$this->id = $id;\r\n\t}",
"public function setId(int $postId): void\n {\n $this->_id = (int) $postId;\n }",
"public function setOriginalId($id);",
"public function setId($id) {\r\n $this->_id = $id;\r\n }",
"protected function setId($id)\n {\n $this->id = $id;\n }",
"public function setId($id)\n {\n $this->id = $id;\n }",
"public function setId( $id ) {\n\t\t$this->id = $id;\n\t}",
"public function setId( $id ) {\n\t\t$this->id = $id;\n\t}",
"public function setEntity(MEntityDescription $entity) {\n\t\t\t$this->entity = $entity;\n\t\t}",
"public function setIdentifier($record){\n\t\t$record->writeAttribute($this->_identityColumn, $this->generateUUID());\n\t}",
"public function setId($id){\n\t\t$this->id = $id;\n\t}",
"public function setId($id)\n {\n $this->_id = $id;\n }",
"public function setId($id)\n {\n $this->_id = (int)$id;\n }",
"public function setId(string $identifier);",
"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 function setId($id) {\n\t\t$this->id = (integer)$id;\n\t}",
"public function setId($id)\n {\n $this->id = $id;\n }",
"public function setId($id)\n {\n $this->id = $id;\n }"
] | [
"0.7618933",
"0.7428719",
"0.7390812",
"0.7086062",
"0.6846008",
"0.67714",
"0.675896",
"0.63811886",
"0.6333562",
"0.6330189",
"0.61970353",
"0.6195727",
"0.6179655",
"0.6157475",
"0.6119857",
"0.60994077",
"0.6082917",
"0.6082917",
"0.6082917",
"0.6082917",
"0.6082917",
"0.6082917",
"0.6082917",
"0.6082917",
"0.6082917",
"0.6082917",
"0.6082917",
"0.6074",
"0.60664725",
"0.60537064",
"0.59892887",
"0.5967856",
"0.59630585",
"0.5962434",
"0.59610087",
"0.5892508",
"0.58786416",
"0.58786416",
"0.58786416",
"0.5850927",
"0.58343613",
"0.5827757",
"0.5826624",
"0.5824785",
"0.5824785",
"0.58243346",
"0.58230937",
"0.5810393",
"0.58078086",
"0.5801634",
"0.57805187",
"0.5771457",
"0.57701606",
"0.5770145",
"0.57699776",
"0.576684",
"0.57657427",
"0.57650006",
"0.5753655",
"0.5753459",
"0.5750504",
"0.5737949",
"0.5737836",
"0.5735812",
"0.5735376",
"0.5711757",
"0.5710978",
"0.5710383",
"0.5706921",
"0.5703771",
"0.5701419",
"0.56991893",
"0.56991893",
"0.56991893",
"0.56991893",
"0.56991893",
"0.5699109",
"0.5699109",
"0.56936336",
"0.5692419",
"0.56920445",
"0.56840706",
"0.56801146",
"0.56742126",
"0.56701267",
"0.5669851",
"0.5669851",
"0.5664215",
"0.565926",
"0.5657824",
"0.56548595",
"0.56543404",
"0.56537217",
"0.5645991",
"0.5645991",
"0.5645991",
"0.5645894",
"0.56452584",
"0.56452584"
] | 0.6125754 | 15 |
Sets a new entityKeyPrefix | public function setEntityKeyPrefix($entityKeyPrefix)
{
$this->entityKeyPrefix = $entityKeyPrefix;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function prefixKey($prefix);",
"public function setKeyPrefix($prefix)\n\t{\n\t\t$this->_redisKeyPrefix = $prefix;\n\t}",
"public function setPrefix($prefix)\n {\n $this->idPrefix = $prefix;\n }",
"public function setPrefix($prefix)\n\t{\n\t\tif (func_num_args() == 1) {\n\t\t\t$this->id_prefix = $prefix;\n\t\t} else {\n\t\t\t$args = func_get_args();\n\t\t\t$args = Arrays::castToType($args, 'string');\n\t\t\t$this->id_prefix = implode('.', $args);\n\t\t}\n\n\t\tif (substr($this->id_prefix, -1, 1) != '.') {\n\t\t\t$this->id_prefix .= '.';\n\t\t}\n\t}",
"protected function setTablePrefix()\n {\n }",
"public function prefixKey($prefix)\n {\n if (empty($this->key)) {\n $this->key = $prefix;\n } else {\n $this->key = $prefix . '.' . $this->key;\n }\n\n return $this;\n }",
"public function setPrefix() {\n\t}",
"public function setPrefix( $prefix );",
"public static function setCacheKeyPrefix($cacheKeyPrefix)\n {\n static::$cacheKeyPrefix = $cacheKeyPrefix;\n }",
"public function setPrefix($prefix);",
"public function setPrefixKey($prefixKey)\n {\n return $this->setNamespace($prefixKey);\n }",
"protected function setPrefix()\n {\n if (array_key_exists('prefix', $this->config)) {\n $this->prefix = $this->config['prefix'];\n }\n }",
"public function setPrefixFromDB(){\n foreach($this->getTables() as $table){\n $prefix = explode('_', $table);\n if(isset($prefix[1])){\n if($this->prefix==$prefix[0]) break;\n else $this->prefix = $prefix[0];\n }\n }\n }",
"public function setPrefix($prefix){\n\t\t$this->prefix = $prefix;\n\t}",
"public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }",
"public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }",
"public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }",
"public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }",
"public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }",
"public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }",
"public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }",
"public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }",
"public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }",
"public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }",
"public function setEntityKeys($entityKey)\n {\n $this->_entityKey = $entityKey;\n }",
"public function setPrefix($prefix) {\n $this->prefix = $prefix;\n }",
"public function setPrefix($prefix) {\n $this->prefix = $prefix;\n }",
"public function setPrefix($prefix)\n {\n $this->prefix = $prefix;\n }",
"public function setPrefix($prefix)\n {\n $this->prefix = $prefix;\n }",
"public static function setTablePrefix($prefix)\n {\n }",
"public function setCustomerPrefix($customerPrefix);",
"public function setPrefix($prefix)\n\t{\n\t\t$this->prefix = $prefix;\n\t}",
"public function setPrefix($prefix)\n {\n $this->prefix = !empty($prefix) ? $prefix . ':' : '';\n }",
"public function setPrefix(string $prefix): void\n {\n $this->prefix = $prefix;\n }",
"public function setPrefix(string $prefix): void\n {\n $this->prefix = $prefix;\n }",
"public function setPrefix($prefix = \"\") {\n $this->_prefix = !empty($prefix) ? $prefix : '';\n }",
"public function setCollectionKeyPrefix($group, $prefix_definition)\n\t{\n\t\t$prefix = array();\n\t\tforeach ($prefix_definition as $p) {\n\t\t\t$prefix[] = $this->getViewData($p['group_id'], $p['field_id']);\n\t\t}\n\t\t$this->group_keys_prefix[$group] = $prefix;\n\t\treturn $prefix;\n\t}",
"public function setPrefix($prefix)\n {\n $this->__set(self::FIELD_PREFIX,$prefix);\n return $this;\n }",
"public function setNamespacePrefix($prefix) {\n $this->nsprefix= $prefix;\n }",
"public static function setLockPrefix($prefix)\n {\n self::$lockPrefix = $prefix;\n }",
"public function setPrefix( $prefix ) {\n $this->_prefix = $prefix;\n return $this;\n }",
"public function setPrefix($prefix) {\n\t\tif ($prefix == $this->prefix) return;\n\t\t\n\t\t$this->prefix = $prefix;\n\t\t$sql = \"UPDATE \twbb\".WBB_N.\"_thread\n\t\t\tSET\tprefix = '\".escapeString($prefix).\"'\n\t\t\tWHERE \tthreadID = \".$this->threadID;\n\t\tWCF::getDB()->registerShutdownUpdate($sql);\n\t}",
"private function _setObjectDataPrefix($dataPrefix = false)\n\t{\n\t\tif (!$dataPrefix) {\n\t\t\t$dataPrefix = get_class($this);\n\t\t}\n\t\t$this->registryInstance->set(\"MvcObjectDataPrefix:\" . get_class($this), $dataPrefix);\n\t\t$this->objectDataPrefix = $dataPrefix;\n\t}",
"public function setPrefix($prefix)\n {\n $this->getVariableModel()->save(self::VARIABLE_NAME_PREFIX, $prefix);\n return $this;\n }",
"public function setPrefix($value)\n {\n $this->prefix = $value;\n }",
"public function db_changeTablePrefix( $table_prefix )\n\t{\n\t\tif ($table_prefix !== '?') {\n\t\t\t$this->table_prefix = $table_prefix;\n\t\t}\n\t}",
"public function getDeletedPrefixKey() {}",
"public function setPrefix($p)\t{\n\t\t$this->prefix = $p;\n\t}",
"public function setPrefixSymbol(bool $prefixSymbol)\n\t{\n\t\t$this->prefixSymbol=$prefixSymbol; \n\t\t$this->keyModified['prefix_symbol'] = 1; \n\n\t}",
"public function setPrice_prefix( $price_prefix ) {\n\t\t$this->price_prefix = $price_prefix;\n\t}",
"public function set_key ( $key = '' )\n {\n if ( ! empty( $key ) )\n {\n if ( is_array( $key ) )\n {\n $this->key = $key;\n } else {\n // String has special delimiter\n if ( strpos( $key, ':' ) > -1 )\n {\n $this->key = explode( ':', $key );\n }\n else\n {\n $this->key = [ $key ];\n }\n }\n\n // Default to the entity's name\n } else {\n $this->key = [ $this->name ];\n }\n\n return $this->get_key();\n }",
"public function setPrefix($prefix): self\n {\n $this->prefix = is_array($prefix) ? $prefix : [$prefix];\n\n return $this;\n }",
"function setPrefix($str)\r\n\t{\r\n\t\t$this->url_prefix = $str;\r\n\t}",
"public function setPrefix($prefix)\n {\n $this->prefix = $prefix;\n return $this;\n }",
"public function setPrefix($address_prefix)\n\t{\n\t\t$this->address_prefix = trim($address_prefix);\n\t}",
"static function set_table_prefix($tp) {\n\t\tself::$table_prefix = $tp;\n\t}",
"public function setNamePrefix(string $prefix): self\n {\n $this->namePrefix = $prefix;\n\n return $this;\n }",
"public function setPrefix(string $prefix): self\n {\n $this->prefix = $prefix;\n return $this;\n }",
"public function setApiKeyPrefix($apiKeyIdentifier, $prefix)\n {\n $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix;\n return $this;\n }",
"public function setApiKeyPrefix($apiKeyIdentifier, $prefix)\n {\n $this->apiKeyPrefixes[$apiKeyIdentifier] = $prefix;\n return $this;\n }",
"public function setTablePrefix(string $prefix)\n {\n $this->tablePrefix = $prefix;\n\n return $this;\n }",
"public function setPrefix(string $prefix = null)\n {\n $this->prefix = $prefix;\n return $this;\n }",
"private function prefixValue(&$key)\n {\n $key = $this->prefix.$key;\n }",
"public static function setFilePrefix($filePrefix) {}",
"public function test_updatePrefix()\n\t{\n\t}",
"public function setPrefix($prefix)\n {\n if (! is_string($prefix)) {\n throw new Exception\\InvalidArgumentException(sprintf(\n '%s expects \"prefix\" to be string; received \"%s\"',\n __METHOD__,\n is_object($prefix) ? get_class($prefix) : gettype($prefix)\n ));\n }\n\n $this->options['prefix'] = $prefix;\n\n return $this;\n }",
"private function _setPrefixDir($prefixdir)\n {\n $this->_prefixDir = $prefixdir;\n }",
"public function setPrefix(string $prefix): self\n {\n $this->prefix = $prefix;\n\n return $this;\n }",
"private function setStagingPrefix()\n {\n // Get & find a new prefix that does not already exist in database.\n // Loop through up to 1000 different possible prefixes should be enough here;)\n for ($i = 0; $i <= 10000; $i++) {\n $this->options->prefix = isset($this->options->existingClones) ?\n 'wpstg' . (count($this->options->existingClones) + $i) . '_' :\n 'wpstg' . $i . '_';\n\n $sql = \"SHOW TABLE STATUS LIKE '{$this->options->prefix}%'\";\n $tables = $this->db->get_results($sql);\n\n // Prefix does not exist. We can use it\n if (!$tables) {\n return $this->options->prefix;\n }\n }\n $this->returnException(\"Fatal Error: Can not create staging prefix. '{$this->options->prefix}' already exists! Stopping for security reasons. Contact [email protected]\");\n wp_die(\"Fatal Error: Can not create staging prefix. Prefix '{$this->options->prefix}' already exists! Stopping for security reasons. Contact [email protected]\");\n }",
"public static function setProcessPrefix($prefix)\n\t{\n\t\tself::$processPrefix = $prefix;\n\t}",
"public function setPrefix($prefix)\n\t{\n\t\t$this->prefix = $prefix;\n\t\t\n\t\treturn $this;\n\t}",
"public function setRoutePrefix($prefix)\n {\n if (Str::startsWith($prefix, Lit::url(''))) {\n $prefix = Str::replaceFirst(Lit::url(''), '', $prefix);\n }\n\n $this->routePrefix = $prefix;\n }",
"public function setPathPrefix($prefix)\n {\n $prefix = ltrim($prefix, '/');\n\n return parent::setPathPrefix($prefix);\n }",
"public function setPricePrefix($var)\n {\n GPBUtil::checkString($var, True);\n $this->price_prefix = $var;\n\n return $this;\n }",
"public function setColumnPrefix($solumnPrefix);",
"public function tablePrefix( $prefix = null ) {\n\t\treturn wfSetVar( $this->mTablePrefix, $prefix );\n\t}",
"public static function setPlaceholderPrefix($prefix)\r\n {\r\n self::addPlaceholderClassPrefix($prefix);\r\n }",
"public function setXpathPrefix($prefix)\n {\n $this->xpathPrefix = $prefix;\n }",
"public function setObjectDataPrefix($dataPrefix = false)\n\t{\n\t\t$this->_setObjectDataPrefix($dataPrefix);\n\t}",
"public function setPathPrefix($prefix)\n {\n $prefix = (string) $prefix;\n\n if ($prefix === '') {\n $this->pathPrefix = null;\n return;\n }\n\n $this->pathPrefix = rtrim($prefix, '\\\\/') . $this->pathSeparator;\n }",
"protected function updateBaseTablePrefix()\n {\n //Do nothing since this is the single-site class\n }",
"public function table_prefix($prefix) {\r\n\t\t$this->_prefix = $prefix;\r\n\t\t\r\n\t\treturn $this;\r\n\t}",
"function setUserTablePrefix($prefix=\"shared\") {\n\t\t$this->_db_user = $prefix . \"_sessions\"; \n\t}",
"public function getPrefixKey()\n {\n return $this->getNamespace();\n }",
"private function setPrefix($prefix)\n {\n $this->metas->setPrefix($prefix);\n\n return $this;\n }",
"public function setTargetPrefix(?string $value): void {\n $this->getBackingStore()->set('targetPrefix', $value);\n }",
"public function setPrefix($prefix): self\n {\n $this->prefix = $prefix;\n\n return $this;\n }",
"public function set_dbprefix($prefix = '')\n\t{\n\t\treturn $this->dbprefix = $prefix;\n\t}",
"public function set(string $prefix, string $key, int $data): void;",
"public function makeKey($tag, $prefix = null)\n {\n return ($prefix ? $prefix : $this->getSlug()).'_'.$tag;\n }",
"public static function keyPrefix()\n {\n return Inflector::camel2id(StringHelper::basename(get_called_class()), '_');\n }",
"public function prefix($prefix = null)\n {\n if ($prefix === null) {\n return $this->_prefix;\n }\n return $this->_prefix = $prefix;\n }",
"public function setPrefix(?string $value = null): self\n {\n throw_if(is_string($value) && strlen(trim($value)) == 0, RuntimeException::class,\n 'Cannot use empty string as prefix.');\n\n $this->prefixCache = is_string($value) && $this->isVersioning() ?\n str_replace('%VERSION%', $this->getVersionForPrefix(), $value) :\n $value;\n\n return $this;\n }",
"public function test_insertPrefix()\n\t{\n\t}",
"public function setProducts_attributes_weight_prefix( $products_attributes_weight_prefix ) {\n\t\t$this->products_attributes_weight_prefix = $products_attributes_weight_prefix;\n\t}",
"public function convertStorageToEntityKey($key);",
"protected function getPrefix($entity)\n {\n $entity_class = get_class($entity);\n $metadata = $entity_class::metadata();\n $entity_class = $metadata->name;\n\n $entity_namespace = $entity_class::getModule();\n $module = \\Module::exists($entity_namespace);\n $prefix = $entity->urlPrefix();\n \n if ($module !== false && $entity_namespace != '')\n {\n $module_prefix = \\Arr::get($this->moduleUrls, $entity_namespace, $entity_namespace);\n if (strpos($prefix, '/'.$module_prefix) === 0) return $prefix;\n return \"/$module_prefix\".$prefix;\n }\n \n return $prefix;\n }",
"public function setPrefix($value = NULL)\n\t{\n\t\tif (NULL !== $value) {\n\t\t $this->prefix = $value;\n\t\t}\n\t\treturn $this;\n\t}",
"protected function getDefaultFieldNamePrefix() {}",
"protected function getDefaultFieldNamePrefix() {}"
] | [
"0.69170266",
"0.6827639",
"0.6752836",
"0.6727159",
"0.6696086",
"0.66696656",
"0.6625726",
"0.6598669",
"0.63972265",
"0.63609684",
"0.635862",
"0.6340957",
"0.6340455",
"0.62784034",
"0.61900604",
"0.61900604",
"0.61900604",
"0.61900604",
"0.61900604",
"0.61900604",
"0.61900604",
"0.61900604",
"0.61900604",
"0.61900604",
"0.61900604",
"0.61532366",
"0.61532366",
"0.6152534",
"0.6152534",
"0.6149955",
"0.6093186",
"0.6092608",
"0.60568607",
"0.6056763",
"0.6056763",
"0.60348225",
"0.60017025",
"0.5990085",
"0.5961345",
"0.5923356",
"0.590302",
"0.5894713",
"0.58919144",
"0.5834664",
"0.58063936",
"0.5784972",
"0.5776244",
"0.5759878",
"0.57142484",
"0.57088166",
"0.56993234",
"0.5689137",
"0.56889534",
"0.5684354",
"0.56350696",
"0.56295663",
"0.5625479",
"0.56248724",
"0.5603523",
"0.5603523",
"0.56008",
"0.55983186",
"0.5585691",
"0.55841637",
"0.5559644",
"0.5555186",
"0.55397856",
"0.55331",
"0.5521407",
"0.55001265",
"0.54966044",
"0.5474737",
"0.54641336",
"0.5463528",
"0.54502726",
"0.54440445",
"0.5439167",
"0.5433223",
"0.5431141",
"0.543077",
"0.5417063",
"0.5409599",
"0.5398451",
"0.53954726",
"0.5382687",
"0.53797114",
"0.5375272",
"0.5371571",
"0.5367542",
"0.5367441",
"0.5346768",
"0.5343446",
"0.5295386",
"0.52936715",
"0.5286165",
"0.5277531",
"0.5269647",
"0.5266963",
"0.5255428",
"0.5255428"
] | 0.81922144 | 0 |
Sets a new entityType | public function setEntityType($entityType)
{
$this->entityType = $entityType;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setType(EntityType $type);",
"public function setMappedEntityType($entity_type);",
"public function setEntityType($var)\n {\n GPBUtil::checkString($var, True);\n $this->entity_type = $var;\n\n return $this;\n }",
"public function getEntityType() {\n return $this->entityType;\n }",
"public function setEntityClass($entityClass);",
"public function setEntityClass(?string $entityClass);",
"public function __construct(EntityTypeManagerInterface $entityType) {\n $this->entityType = $entityType;\n }",
"function setEntity($entity_type, $entity_id) {\n $this->checkChange();\n\n // Ignore empty values.\n if (empty($entity_type) || empty($entity_id)) {\n return $this;\n }\n\n $this->entity_type = $entity_type;\n $this->entity_id = $entity_id;\n return $this;\n }",
"private function setEntityTypeFromArray(array $input, string $key = 'entity-type'): void\n {\n $this->entityType = is_null($entityType = ArrayAccess::getString($input, $key))\n ? new EntityType()\n : new EntityType($entityType);\n }",
"public function getEntityType();",
"public function setEntityTypes($types) {\n $this->entity_types = $types;\n }",
"public function setType($type) :ISEntity\n {\n array_walk($this->types, function($name, $index) use ($type) {\n if($type === $name){\n $this->type = $index;\n }\n });\n if(is_null($this->type)) {\n if(isset($this->types[$type])) {\n $this->type = $type;\n }\n }\n return $this;\n }",
"public function getEntityType(): EntityType\n {\n return $this->entityType;\n }",
"protected abstract function initializeEntityType(): string;",
"public function __get($entityType)\n {\n return new Entity($this, $entityType);\n }",
"public function setEntity($entity) {\n\t\tif ($entity instanceof Orm\\ActiveEntity) {\n\t\t\t$this->_entityInstance = $entity;\n\t\t\tlist($id) = $entity->getMetadata()->getIdFields();\n\t\t\t$this->setEntityId($entity->$id);\n\t\t\t$entity = get_class($entity);\n\t\t} elseif (is_string($entity)) {\n\t\t\tif (!class_exists($entity)) {\n\t\t\t\tthrow new Nette\\InvalidArgumentException(\"Class '$entity' does not exist!\");\n\t\t\t}\n\t\t} else {\n\t\t\tthrow new Nette\\InvalidArgumentException('You have to supply either an entity name or its instance!');\n\t\t}\n\t\t//parent::setEntity($entity);\n\t\t$this->defaultSetter('entity', $entity); // Because of PHP<5.3.4\n\t}",
"function getEntityType() {\n return $this->entity_type;\n }",
"public function setEntityTypeId($entityTypeId) {\n $this->entityTypeId = $entityTypeId;\n }",
"public function getEntityType(): string\n {\n return $this->entityType;\n }",
"public function setEntity( $entity )\n {\n \n $this->entity = $entity;\n \n }",
"public function set($typeId, $class);",
"public function getEntityType()\n {\n return $this->entity_type;\n }",
"public function getEntityType()\n {\n return $this->entity_type;\n }",
"public function setEntity(\\GoetasWebservices\\Client\\SalesforceEnterprise\\Sobject\\ContractType $entity)\n {\n $this->entity = $entity;\n return $this;\n }",
"public function getEntityTypeId() {\n return $this->entityType->id();\n }",
"public function getEntityType()\n\t{\n\t\treturn $this->entity_type;\n\t}",
"public function __construct(EntityTypeManager $entityTypeManager) {\n $this->entityTypeManager = $entityTypeManager;\n }",
"public function getEntityType() {\n return $this->datasource()->getEntityType();\n }",
"function set_entity($ent){\n $this -> table = $ent;\n }",
"public static function getRelatedEntityType(): EntityType\n {\n return new EntityType(EntityType::LABEL);\n }",
"abstract protected function getEntityType(): string;",
"public function setTypeAttribute($newValue) {\n $type = NodeType::get($newValue);\n $this->attributes['type'] = $type->getValue();\n }",
"public function setEntity( $entity )\n {\n\n $this->setEntityWbfsysEntityTag( $entity );\n\n }",
"public function updateEntityType($entityTypeId, $request)\n {\n return $this->start()->uri(\"/api/entity/type\")\n ->urlSegment($entityTypeId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->put()\n ->go();\n }",
"public function setContentType($type)\n {\n $this->setContentTypeInHeaders($type);\n // Keep track of the value so that if the content-type changes automatically\n // due to added child entities, it can be restored if they are later removed\n $this->userContentType = $type;\n\n return $this;\n }",
"public static function getRelatedEntityType(): EntityType\n {\n return new EntityType(EntityType::PLACE);\n }",
"public function setModelType($type)\n {\n $this->modelType = $type;\n }",
"public function setEntityTypeFilter($typeId)\n {\n return $this;\n }",
"public function restoreEntityType() {\n $nid = $this->og_controller->og_node->nid;\n $path = \"private://dumper/restore.{$nid}/private://dumper/{$nid}/{$this->entity_type}\";\n foreach (file_scan_directory($path, '/\\.json/') as $file) {\n $this->restoreEntity($file->name);\n }\n }",
"public function onEntityTypeEvent(EntityTypeEvent $event, $event_name) {\n switch ($event_name) {\n case EntityTypeEvents::CREATE:\n $this->onEntityTypeCreate($event->getEntityType());\n break;\n\n case EntityTypeEvents::UPDATE:\n $this->onEntityTypeUpdate($event->getEntityType(), $event->getOriginal());\n break;\n\n case EntityTypeEvents::DELETE:\n $this->onEntityTypeDelete($event->getEntityType());\n break;\n }\n }",
"public function setEntity($entityClass)\n {\n $entityClass = $this->str($entityClass);\n if ($entityClass->contains('.')) {\n $parts = $entityClass->explode('.');\n $entityClass = '\\\\WebinyPlatform\\\\Apps\\\\' . $parts[0] . '\\\\Components\\\\' . $parts[1] . '\\\\Entities\\\\' . $parts[2];\n }\n $this->entityClass = StdObjectWrapper::toString($entityClass);\n\n return $this;\n }",
"function setTaxonomyType($setTaxType) {\n $this->taxonomyType = $setTaxType;\n }",
"public function createEntityType($entityTypeId, $request)\n {\n return $this->start()->uri(\"/api/entity/type\")\n ->urlSegment($entityTypeId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->post()\n ->go();\n }",
"public static function getRelatedEntityType(): EntityType\n {\n return new EntityType(EntityType::URL);\n }",
"public function setEntity(MEntityDescription $entity) {\n\t\t\t$this->entity = $entity;\n\t\t}",
"public function setModelType($modelType)\n {\n if ($modelType !== self::MODELTYPE_ENTITY && $modelType !== self::MODELTYPE_VALUEOBJECT) {\n throw new \\InvalidArgumentException('\"' . $modelType . '\" is an invalid model type.', 1212519195);\n }\n $this->modelType = $modelType;\n if ($modelType === self::MODELTYPE_VALUEOBJECT) {\n $this->identityProperties = [];\n $this->repositoryClassName = null;\n }\n }",
"protected function getForm_Type_EntityService()\n {\n return $this->services['form.type.entity'] = new \\Symfony\\Bridge\\Doctrine\\Form\\Type\\EntityType($this->get('doctrine'));\n }",
"public function getMappedEntityType();",
"public function loadByEntityType($object, $entityId, $entityType, $storeId)\n {\n $connection = $this->getConnection();\n\n $select = $connection->select()->from(\n ['t_def' => $this->getMainTable()],\n ['entity_id', 'entity_type', 'experiment_script', 'code_id']\n )->where(\n 't_def.entity_id=?',\n $entityId\n )->where(\n 't_def.entity_type=?',\n $entityType\n )->where(\n 't_def.store_id IN (0, ?)',\n $storeId\n )->order(\n 't_def.store_id DESC'\n )->limit(\n 1\n );\n\n $data = $connection->fetchRow($select);\n\n if ($data) {\n $object->setData($data);\n }\n $this->_afterLoad($object);\n return $this;\n }",
"public function testSetEntity()\n {\n $this->testObject->setEntity('abc');\n\n $this->assertEquals('dev_abc', $this->testObject->getEntity());\n }",
"public function getType(): EntityType;",
"protected function setForm(&$form) {\n if (is_array($form) && isset($form['#entity'])) {\n $this->form =& $form;\n $this->entity =& $form['#entity'];\n $this->type = \"{$this->entity->type}_entity_form\";\n }\n elseif (is_object($form) && $form instanceof Entity) {\n $entity =& $form;\n $type = $entity->type;\n $bundle = $type;\n $form_id = \"eck__entity__form__add_{$type}_{$bundle}\";\n\n $this->form = drupal_get_form($form_id, $entity);\n $this->entity =& $entity;\n $this->type = \"{$type}_entity_form\";\n }\n else {\n $this->form =& $form;\n $this->type = 'non_entity_form';\n }\n }",
"abstract protected function getEntitySetWithDefaults();",
"public function getEntityTypeManagerMock(){\n $manager = $this->prophet->prophesize('Drupal\\Core\\Entity\\EntityTypeManagerInterface');\n $storage = $this->getStorageMock()->reveal();\n try {\n $manager->getStorage(Argument::type('string'))->willReturn($storage);\n } catch (InvalidPluginDefinitionException $e) {\n } catch (PluginNotFoundException $e) {\n }\n return $manager;\n }",
"public function __construct(EntityTypeManagerInterface $entity_type_manager) {\n $this->entityTypeManager = $entity_type_manager;\n $this->entityTypeStorage = $this->entityTypeManager->getStorage('condition_rulesets');\n }",
"abstract public function getEntityTypeID();",
"protected function setContentType()\n {\n $this->content_type = 'Page';\n }",
"final public static function getRelatedEntityType(): EntityType\n {\n return new EntityType(EntityType::URL);\n }",
"function setInitiateType( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->InitiateType = $value;\n }",
"public function setEntity( $entity )\n {\n\n $this->entity = $entity;\n $this->rowid = $entity->getId();\n \n }",
"public function getEntityType()\n {\n if (empty($this->_type)) {\n $this->setType(\\OuterEdge\\Layout\\Model\\Element::ENTITY);\n }\n \n return parent::getEntityType();\n }",
"public function __construct(EntityTypeManager $type_manager) {\n $this->typeManager = $type_manager;\n }",
"public function create(string $entityType, array $options = [\n 'label' => InputOption::VALUE_REQUIRED,\n 'machine-name' => InputOption::VALUE_REQUIRED,\n 'description' => InputOption::VALUE_OPTIONAL,\n 'show-machine-names' => InputOption::VALUE_OPTIONAL,\n ]): void\n {\n $definition = $this->entityTypeManager->getDefinition(sprintf('%s_type', $entityType));\n $storage = $this->entityTypeManager->getStorage(sprintf('%s_type', $entityType));\n\n $values = [\n 'status' => true,\n $definition->getKey('id') => $this->input()->getOption('machine-name'),\n $definition->getKey('label') => $this->input()->getOption('label'),\n 'description' => $this->input()->getOption('description') ?? '',\n 'entity_type' => $entityType,\n ];\n\n // Command files may customize $values as desired.\n $handlers = $this->getCustomEventHandlers('eck-bundle-create');\n foreach ($handlers as $handler) {\n $handler($values);\n }\n\n $bundle = $storage->create($values);\n $bundle->save();\n\n $this->entityTypeManager->clearCachedDefinitions();\n $this->logResult($bundle);\n }",
"public function setType(TM_Attribute_AttributeType $value)\n {\n $this->_type = $value;\n }",
"function entity_class($entityTypeKey)\n {\n if ($entityTypeClass = config('app.entity_types')[$entityTypeKey] ?? null) {\n return $entityTypeClass;\n }\n throw new \\Illuminate\\Database\\Eloquent\\ModelNotFoundException();\n }",
"public function setEntityDefinition(\\GoetasWebservices\\Client\\SalesforceEnterprise\\Sobject\\EntityDefinitionType $entityDefinition)\n {\n $this->entityDefinition = $entityDefinition;\n return $this;\n }",
"public function setEntity(/*\\MU\\ImageModule\\Entity\\AlbumEntity */$entity)\n {\n $this->entity = $entity;\n }",
"public function setType($t){\n $this->type = $t;\n }",
"public function _setEntity($current, $new){\n trigger_error('Setting entity is not allowed', E_USER_ERROR);\n }",
"public function getEntityClass();",
"protected function setInferredClassName()\n\t{\n\t\t$singularize = ($this instanceOf HasMany ? true : false);\n\t\t$this->setClassName(\\ChickenTools\\Str::classify($this->attributeName, $singularize));\n\t}",
"public function getEntityTypeId() {\n return $this->entityTypeId;\n }",
"public function getEntityTypeId();",
"public function setRoleEntityClass($className);",
"public function setType($type){ }",
"public function patchEntityType($entityTypeId, $request)\n {\n return $this->start()->uri(\"/api/entity/type\")\n ->urlSegment($entityTypeId)\n ->bodyHandler(new JSONBodyHandler($request))\n ->patch()\n ->go();\n }",
"function setType($type) {\n $this->type = $type;\n }",
"public function getMappingEntityType();",
"public function testNewEntityType(): void {\n\n $res = FormFactory::newEntityType(NavigationNode::class, $this->entities);\n $this->assertCount(3, $res);\n $this->assertArrayHasKey(\"class\", $res);\n $this->assertArrayHasKey(\"choice_label\", $res);\n $this->assertArrayHasKey(\"choices\", $res);\n\n $this->assertEquals(NavigationNode::class, $res[\"class\"]);\n\n $this->assertCount(3, $res[\"choices\"]);\n $this->assertSame($this->entities[0], $res[\"choices\"][0]);\n $this->assertSame($this->entities[1], $res[\"choices\"][1]);\n $this->assertSame($this->entities[2], $res[\"choices\"][2]);\n\n $this->assertIsCallable($res[\"choice_label\"]);\n $this->assertEquals(\"─ This option must implements [Translated]ChoiceLabelInterface\", $res[\"choice_label\"]($res[\"choices\"][0]));\n $this->assertEquals(\"─ This option must implements [Translated]ChoiceLabelInterface\", $res[\"choice_label\"]($res[\"choices\"][1]));\n $this->assertEquals(\"─ This option must implements [Translated]ChoiceLabelInterface\", $res[\"choice_label\"]($res[\"choices\"][2]));\n }",
"abstract protected function getEntityClass();",
"public function setClass($class);",
"public function setEntity($entity)\r\n {\r\n $this->entity = $entity;\r\n\r\n return $this;\r\n }",
"public function __construct(EntityTypeManagerInterface $entity_type_manager) {\n $this->entityTypeManager = $entity_type_manager;\n }",
"public function __construct(EntityTypeManagerInterface $entity_type_manager) {\n $this->entityTypeManager = $entity_type_manager;\n }",
"public function __construct(EntityTypeManagerInterface $entity_type_manager) {\n $this->entityTypeManager = $entity_type_manager;\n }",
"public function __construct(EntityTypeManagerInterface $entity_type_manager) {\n $this->entityTypeManager = $entity_type_manager;\n }",
"public function __construct(EntityTypeManagerInterface $entity_type_manager) {\n $this->entityTypeManager = $entity_type_manager;\n }",
"public function getExtendedType()\n {\n return EntityType::class;\n }",
"public function setTyp( $type );",
"function nestedbox_core_entity_info_alter(array &$entity_info) {\n foreach (nestedbox_get_types() as $type => $info) {\n $entity_info['nestedbox']['bundles'][$type] = array(\n 'label' => $info->label,\n 'admin' => array(\n /* @see nestedbox_type_load() */\n 'path' => 'admin/structure/nestedbox-types/manage/%nestedbox_type',\n 'real path' => 'admin/structure/nestedbox-types/manage/' . $type,\n 'bundle argument' => 4,\n 'access arguments' => array('administer nestedbox types'),\n ),\n );\n }\n}",
"public function hasEntityType() {\n return $this->_has(6);\n }",
"private function createEntityClassParameter()\n {\n $id = $this->getServiceId('class');\n if (!$this->container->hasParameter($id)) {\n $this->container->setParameter($id, $this->options['entity']);\n }\n\n $this->configureInheritanceMapping(\n $this->prefix.'.'.$this->resourceName,\n $this->options['entity'],\n $this->options['repository']\n );\n }",
"public function set_type( $type ) {\n\t\t$this->set_prop( 'type', sanitize_title( $type ) ) ;\n\t}",
"public function setTypeIdAttribute($input)\n {\n $this->attributes['type_id'] = $input ? $input : null;\n }",
"public function getEntityType(): ?string;",
"function _mongo_node_update_type($old_entity_type, $entity_type) {\n // Update collection names.\n _mongo_node_rename_collection($old_entity_type, $entity_type);\n\n // Update bundle name in mongo entities.\n $collection = mongodb_collection('fields_current', $entity_type);\n $result = $collection->update(\n array('_type' => $old_entity_type),\n array('$set' => array('_type' => $entity_type, 'type' => $entity_type))\n );\n}",
"public static function convertToEntityClass(\n ValueNormalizer $valueNormalizer,\n string $entityType,\n RequestType $requestType\n ): string {\n return $valueNormalizer->normalizeValue($entityType, DataType::ENTITY_CLASS, $requestType);\n }",
"function setObjtype($objtype) {\n $this->objtype = $objtype;\n }",
"public function hasEntityType() {\n return $this->_has(5);\n }",
"public function __construct(SqlEntityType $sqlEntityType)\n\t\t{\n\t\t\t$this->sqlEntityType = $sqlEntityType;\n\t\t}"
] | [
"0.7705399",
"0.6784407",
"0.64521676",
"0.631977",
"0.63128513",
"0.62907165",
"0.6183195",
"0.61203974",
"0.60822463",
"0.6041833",
"0.6012842",
"0.5932546",
"0.59062904",
"0.58379114",
"0.58357686",
"0.58011335",
"0.5795091",
"0.5764072",
"0.5761457",
"0.57495964",
"0.5670604",
"0.5669103",
"0.5669103",
"0.56440544",
"0.56137574",
"0.5608982",
"0.54829025",
"0.53994614",
"0.53627163",
"0.53599346",
"0.5358785",
"0.5357981",
"0.53519636",
"0.5294591",
"0.52580136",
"0.52570236",
"0.5255362",
"0.5248851",
"0.52460104",
"0.52349377",
"0.52295727",
"0.52241594",
"0.52235496",
"0.51943487",
"0.5191562",
"0.5178268",
"0.51781136",
"0.51536596",
"0.51038814",
"0.5067853",
"0.50660795",
"0.5065251",
"0.5059125",
"0.5056296",
"0.50557584",
"0.50458646",
"0.5023517",
"0.4987433",
"0.4983105",
"0.49761182",
"0.49747172",
"0.49556303",
"0.49554023",
"0.4954798",
"0.49414602",
"0.493446",
"0.4931577",
"0.49271563",
"0.49250108",
"0.49230877",
"0.49229607",
"0.49090594",
"0.49038827",
"0.4901963",
"0.489277",
"0.48871124",
"0.48766315",
"0.48750678",
"0.4874121",
"0.48737493",
"0.48722443",
"0.48721212",
"0.48713768",
"0.48713768",
"0.48713768",
"0.48713768",
"0.48713768",
"0.48628667",
"0.48536238",
"0.48513427",
"0.48408124",
"0.48378044",
"0.4831491",
"0.4826116",
"0.48213875",
"0.48203108",
"0.48189375",
"0.48183712",
"0.48150393",
"0.48136726"
] | 0.7270525 | 1 |
Sets a new isDeleted | public function setIsDeleted($isDeleted)
{
$this->isDeleted = $isDeleted;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setDeleted() {}",
"public function set_deleted($deleted) {\n $this->deleted = $deleted ? true : false;\n }",
"public function setIsDeleted($bool);",
"protected function markAsDeleted()\n {\n $this->deleted = true;\n }",
"public function setDeleted($deleted = TRUE)\n {\n $this->deleted = (bool) $deleted;\n }",
"public function setDeleted(): void\n {\n $this->attributes['mode'] = 'delete';\n }",
"public function setIsDeleted(bool $isDeleted): self;",
"public function setDeleted($deleted) {\n\t\t$this->deleted = $deleted;\n\t}",
"public function setIsDeletedRecord($value) {\n $this->_deleted = $value;\n }",
"public function setDeleted($deleted)\n\t{\n\t\t$this->deleted = $deleted;\n\t}",
"public function setDeleted($deleted)\n {\n $this->deleted = $deleted;\n }",
"public function markForDelete() {\n\t$this->_markForDelete = true;\n }",
"public function setDeleted($b)\n {\n $this->deleted = (boolean) $b;\n }",
"public function setDeleted($b)\n {\n $this->deleted = (boolean) $b;\n }",
"public function setDeleted($b)\n {\n $this->deleted = (boolean) $b;\n }",
"public function setDeleted($b)\n {\n $this->deleted = (boolean) $b;\n }",
"public function setDeleted($b)\n {\n $this->deleted = (boolean) $b;\n }",
"public function setDeleted($b)\n {\n $this->deleted = (boolean) $b;\n }",
"public function setDeleted($b)\n {\n $this->deleted = (boolean) $b;\n }",
"public function setDeleted($b)\n {\n $this->deleted = (boolean) $b;\n }",
"public function setDeleted($b)\n {\n $this->deleted = (boolean) $b;\n }",
"public function setDeleted($b)\n {\n $this->deleted = (boolean) $b;\n }",
"public function setDeleted($b)\n {\n $this->deleted = (boolean) $b;\n }",
"public function setDeleted($b)\n {\n $this->deleted = (boolean) $b;\n }",
"public function set_is_deleted( $is_deleted ) { // Declare \\Markguyver\\LivefyreImporter\\Data\\Livefyre\\Is_Deleted->set_is_deleted() function\n\t\t\t$this->is_deleted = $this->validate_boolean( $is_deleted );\n\t\t}",
"public function isDeleted() {}",
"public function isDeleted() {}",
"public function isDeleted();",
"public function isDeleted();",
"public function setDeleted($value)\n {\n return $this->set('Deleted', $value);\n }",
"private function SetDeleted(\\DateTime $value)\n\t\t{\n\t\t\t$this->deleted = $value;\n\t\t}",
"public function getIsDeleted();",
"public function setDeleted(bool $deleted): self\n {\n\n $this->deleted = $deleted;\n\n return $this;\n\n }",
"public function isDeleted(): bool;",
"public function isDeleted(): bool;",
"public function addDeleted()\n {\n try {\n $date = new DateTime();\n $this->deleted_at = $date->format('Y-m-d H:i:s');\n $this->deleted_by = 0;\n } catch (Exception $e) {\n print_r($e);\n }\n }",
"public function setDeleted(&$var)\n {\n GPBUtil::checkMessage($var, \\Google\\Protobuf\\Timestamp::class);\n $this->deleted = $var;\n }",
"public function delete() {\n\t\t$this->deleted = true;\n\t}",
"public function setDeletedFlag($value)\n {\n $owner = $this->getOwner();\n $owner->updateByPk($owner->id, array($this->deletedFlagField => $this->deletedFlag ? $this->deletedFlag : $this->normalFlag));\n return $owner;\n }",
"public function getIsDeleted()\n {\n return $this->isDeleted;\n }",
"public function isDeleted()\n {\n return $this->deleted;\n }",
"public function isDeleted()\n {\n return $this->deleted;\n }",
"public function isDeleted()\n {\n return $this->deleted;\n }",
"public function isDeleted()\n {\n return $this->deleted;\n }",
"public function isDeleted()\n {\n return $this->deleted;\n }",
"public function isDeleted()\n {\n return $this->deleted;\n }",
"public function isDeleted()\n {\n return $this->deleted;\n }",
"public function isDeleted()\n {\n return $this->deleted;\n }",
"public function isDeleted()\n {\n return $this->deleted;\n }",
"public function isDeleted()\n {\n return $this->deleted;\n }",
"public function isDeleted()\n {\n return $this->deleted;\n }",
"public function isDeleted()\n {\n return $this->deleted;\n }",
"public function isDeleted()\n {\n return $this->deleted;\n }",
"public function isDeleted()\n {\n return $this->deleted;\n }",
"protected function deleteInternal() {\n $this->isdeleted = 1;\n $this->deleteduser = \\Yii::$app->user->getId();\n $this->deletedtime = date(\"Y-m-d H:i:s\");\n \n return parent::updateInternal(['isdeleted', 'deletedtime', 'deleteduser']);\n }",
"public function setdeleted($v)\n {\n if ($v !== null) {\n if (is_string($v)) {\n $v = in_array(strtolower($v), array('false', 'off', '-', 'no', 'n', '0', '')) ? false : true;\n } else {\n $v = (boolean) $v;\n }\n }\n\n if ($this->deleted !== $v) {\n $this->deleted = $v;\n $this->modifiedColumns[] = ActionTypePeer::DELETED;\n }\n\n\n return $this;\n }",
"public function markDeleted()\n\t{\n\t\t$this->unpost();\n\n\t\treturn parent::markDeleted();\n\t}",
"public function getDeleted();",
"public function isDeleted()\r\n\t{\r\n\t\treturn $this->getValue(\"f_deleted\");\r\n\t}",
"public function setDelete($val)\n {\n $this->_propDict[\"delete\"] = $val;\n return $this;\n }",
"public function isDeleted()\n\t {\t\n\t\tif($this->deleted){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t }",
"public function isDeleted() {\n\t\treturn $this->deleted;\n\t}",
"public function delete() {\n $this->isdeleted = 1;\n $this->deleteduser = \\Yii::$app->user->getId();\n $this->deletedtime = date(\"Y-m-d H:i:s\");\n \n return parent::update(FALSE, ['isdeleted', 'deletedtime', 'deleteduser']);\n }",
"protected function onDeleted()\n {\n return true;\n }",
"public function isDeleted()\n\t{\n\t\treturn $this->deleted;\n\t}",
"public function isDelete();",
"public function isDelete(): bool {}",
"public function setDeletable($value);",
"public function deleted($flag = true) {\n\t\t$this->deleted = (boolean) $flag;\n\t\treturn $this;\n\t}",
"public function setDeletedAtAttribute($value)\n {\n $this->attributes['deleted_at'] = $value;\n }",
"public function flagDelete()\n {\n if(!$this->getId()) {\n return false;\n }\n \n if(!$this->setProperty('delete', true)->save()) {\n return false;\n }\n \n return $this->apply();\n }",
"public static function enableSoftDelete()\n\t{\n\t\tself::$softDelete = true;\n\t}",
"public function get_deleted() {\n return $this->deleted;\n }",
"public function setTimeDeleted($timeDeleted)\n {\n $this->TIME_DELETED = $timeDeleted;\n }",
"protected function setDeleteData()\n\t{\n\n\t}",
"private function GetDeleted()\n\t\t{\n\t\t\treturn $this->deleted;\n\t\t}",
"public function setIsDeleteable($value)\n {\n $this->_isDeleteable = (bool) $value;\n return $this;\n }",
"public function setDeleted($Deleted)\n {\n $this->Deleted = $Deleted;\n\n return $this;\n }",
"protected function markDeleted($id, $userId, $isDeleted)\n {\n $this->db->createCommand()\n ->update($this->notificationsTable, [\n 'is_deleted' => $isDeleted,\n 'updated_at' => time()\n ], [\n 'user_id' => $userId,\n 'id' => $id\n ])\n ->execute();\n }",
"public function isDeleted()\n\t{\n\t\treturn ($this->get('state') == static::ANSWERS_STATE_DELETE);\n\t}",
"public function getIsDeletedRecord() {\n return $this->_deleted;\n }",
"public function getDeleted()\n {\n return $this->deleted;\n }",
"public function setShowDeleted($value)\n {\n return $this->set('ShowDeleted', $value);\n }",
"public function getDeleted() {\n\t\treturn $this->deleted;\n\t}",
"public function getDeleted() {\n\t\treturn $this->deleted;\n\t}",
"function setMarkForDeletion($inMarkForDeletion) {\n\t\tif ( $inMarkForDeletion !== $this->_MarkForDeletion ) {\n\t\t\t$this->_MarkForDeletion = $inMarkForDeletion;\n\t\t}\n\t\treturn $this;\n\t}",
"function setMarkForDeletion($inMarkForDeletion) {\n\t\tif ( $inMarkForDeletion !== $this->_MarkForDeletion ) {\n\t\t\t$this->_MarkForDeletion = $inMarkForDeletion;\n\t\t}\n\t\treturn $this;\n\t}",
"function setMarkForDeletion($inMarkForDeletion) {\n\t\tif ( $inMarkForDeletion !== $this->_MarkForDeletion ) {\n\t\t\t$this->_MarkForDeletion = $inMarkForDeletion;\n\t\t}\n\t\treturn $this;\n\t}",
"function setMarkForDeletion($inMarkForDeletion) {\n\t\tif ( $inMarkForDeletion !== $this->_MarkForDeletion ) {\n\t\t\t$this->_MarkForDeletion = $inMarkForDeletion;\n\t\t}\n\t\treturn $this;\n\t}",
"function setMarkForDeletion($inMarkForDeletion) {\n\t\tif ( $inMarkForDeletion !== $this->_MarkForDeletion ) {\n\t\t\t$this->_MarkForDeletion = $inMarkForDeletion;\n\t\t}\n\t\treturn $this;\n\t}",
"public function getDeleted()\n {\n return $this->Deleted;\n }",
"public function deleted(bool $deleted = null) : bool\n {\n return $this->setGetPersisted('deleted', $deleted);\n }",
"public function getdeleted()\n {\n return $this->deleted;\n }",
"public function isDeleted()\n {\n return $this->status === self::STATUS_DELETED;\n }"
] | [
"0.83504426",
"0.789055",
"0.78462374",
"0.7811376",
"0.78019685",
"0.77559155",
"0.76348794",
"0.7624502",
"0.7622788",
"0.7556349",
"0.75259405",
"0.72598666",
"0.7256905",
"0.7256905",
"0.7256905",
"0.7256905",
"0.7256905",
"0.7256905",
"0.7256905",
"0.7256905",
"0.7256905",
"0.7256905",
"0.7256905",
"0.7256905",
"0.7237179",
"0.7153043",
"0.7151691",
"0.7080698",
"0.7080698",
"0.7071198",
"0.6969792",
"0.69283444",
"0.68836653",
"0.68800575",
"0.68800575",
"0.6728436",
"0.6654288",
"0.66310513",
"0.66302574",
"0.65699965",
"0.649104",
"0.649104",
"0.649104",
"0.649104",
"0.649104",
"0.649104",
"0.649104",
"0.649104",
"0.649104",
"0.649104",
"0.649104",
"0.649104",
"0.649104",
"0.649104",
"0.6474712",
"0.6468905",
"0.6459181",
"0.6458154",
"0.6421414",
"0.6411442",
"0.64002085",
"0.639721",
"0.6393332",
"0.6382388",
"0.6373938",
"0.6342695",
"0.6321445",
"0.632139",
"0.63180965",
"0.6312596",
"0.62840015",
"0.6278853",
"0.6218179",
"0.62007236",
"0.6199197",
"0.6181233",
"0.6179917",
"0.616369",
"0.6127751",
"0.6111564",
"0.61019593",
"0.6090462",
"0.6070577",
"0.60520065",
"0.60520065",
"0.60213983",
"0.60213983",
"0.60213983",
"0.60213983",
"0.60213983",
"0.60191",
"0.60075474",
"0.60047984",
"0.60033566"
] | 0.73270833 | 16 |
Sets a new systemModstamp | public function setSystemModstamp(\DateTime $systemModstamp)
{
$this->systemModstamp = $systemModstamp;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setModificationTime( $timestamp )\n {\n $this->mtime = $timestamp;\n list( $this->properties[\"lastModFileTime\"], $this->properties[\"lastModFileDate\"] ) = self::timestampToDosFormat( $timestamp );\n }",
"public function setTimeStamp()\n\t{\n\t\t$this->_current_timestamp = time();\n\t}",
"public function setTstamp($tstamp) {\n\t\t$this->tstamp = $tstamp;\n\t}",
"public function setSysLastChanged() {}",
"protected function _syncModDate() {}",
"public function setSystem($system)\n {\n $this->system = $system;\n }",
"function setTimestamp($timestamp) {\r\r\n\t\t$this->timestamp = $timestamp;\r\r\n\t}",
"protected static function setSyncLastTime()\n {\n DB::update(\"UPDATE `sync_last_time` SET timestamp = ? WHERE id=?\", [time(), 1]);\n }",
"public static function setLastModified($timestamp) {}",
"public function setLastmod($lastmod)\n {\n $this->lastmod = $lastmod;\n }",
"function setTimestamp($time_stamp) {\n $this->checkChange(TRUE);\n\n if (variable_get('userpoints_transaction_timestamp', 1)) {\n return $this;\n }\n $this->time_stamp = $time_stamp;\n return $this;\n }",
"function setPasswordUpdatedTime(){\n\t\t$this->setPasswordUpdated(time());\n\t}",
"public function set_last_modified($timestamp)\n\t{\n\t\t$this->last_modified = max($timestamp, $this->last_modified);\n\t}",
"function set_timemodified() {\n $this->timemodified = time();\n return true;\n }",
"public function setNewMonth($timestamp)\n {\n $timestampPrevious = strtotime(\"-1 month\", $timestamp);\n $this->currentMonth = getdate($timestamp);\n $this->noOfDays = date(\"t\", $timestamp);\n $this->noOfDaysPrevious = date(\"t\", $timestampPrevious);\n }",
"public function setModifiedAt()\n {\n $this->modifiedAt = new \\DateTime();\n }",
"public function setTimestamp($timestamp);",
"public function setTimestamp($timestamp, $reassign = false);",
"function set_date_to_now()\n {\n $this->timestamp=time();\n }",
"public function setModDate($date) {}",
"public function setSyncTime(): void\n {\n }",
"function save_timestamp() {\n\t\t$this->timestamp = date('Y-m-d', time());\n\t}",
"public function setModified($time)\n\t{\n\t\t$this->modified = $time;\n\n\t\t// Set new cache name\n\t\t$this->cacheSetup();\n\t}",
"public function lastChanged($tstamp)\n {\n $tstamp = (int)$tstamp;\n $tsfe = $this->getTypoScriptFrontendController();\n if ($tstamp > (int)$tsfe->register['SYS_LASTCHANGED']) {\n $tsfe->register['SYS_LASTCHANGED'] = $tstamp;\n }\n }",
"public function setModifiedValue()\n {\n $this->setModified(new \\DateTime());\n }",
"public function timestamp()\n {\n $this->replaceTextNode('/p:package/p:date', date('Y-m-d'));\n $this->replaceTextNode('/p:package/p:time', date('H:i:s'));\n\n $release = $this->_requireCurrentRelease();\n\n $this->replaceTextNodeRelativeTo('./p:date', $release, date('Y-m-d'));\n }",
"protected function changeModifiedTime($file, $timestamp)\n {\n touch($file, $timestamp);\n }",
"function setTimeStamp( $value )\r\n {\r\n $formattedTime =& date('His', $value );\r\n\r\n if ( preg_match( \"/([0-9]{2})([0-9]{2})([0-9]{2})/\", $formattedTime, $valueArray ) )\r\n {\r\n $this->setHour( min( $valueArray[1], 23 ) );\r\n $this->setMinute( min( $valueArray[2], 59 ) );\r\n $this->setSecond( min( $valueArray[3], 59 ) );\r\n }\r\n else\r\n {\r\n print( \"<b>Error:</b> eZTime::setTimeStamp() received wrong time format.\" );\r\n }\r\n\r\n }",
"public function setTimestamp( $timestamp ) {\n\n $this->timestamp = $this->offsetTimestampForWordPressTimezone(\n $timestamp );\n }",
"public function updateTopicModifiedDate()\n {\n $this->setAttribute( 'modified', time() );\n $this->store();\n }",
"function setAuthTimestamp($AuthTimestamp)\n {\n \t$this->_authTimestamp =$AuthTimestamp;\n }",
"public function setTimestamp($timestamp)\n {\n $this->timestamp = $timestamp;\n }",
"public function setTimestamp($timestamp)\n {\n $this->timestamp = $timestamp;\n }",
"function setStatusModified( $timestamp )\n {\n $this->StatusModified = $timestamp;\n }",
"public function setRevisionCreationTime($timestamp);",
"public function setRevisionCreationTime($timestamp);",
"public function setRevisionCreationTime($timestamp);",
"public function setRevisionCreationTime($timestamp);",
"public function setRevisionCreationTime($timestamp);",
"public function setTimestamp($timestamp)\r\n {\r\n if (!is_null($timestamp))\r\n {\r\n $timestamp = (int) $timestamp;\r\n }\r\n $this->clearCachedValueIf($this->_timestamp != $timestamp);\r\n $this->_timestamp = $timestamp;\r\n }",
"private function SetModified(\\DateTime $value)\n\t\t{\n\t\t\t$this->modified = $value;\n\t\t}",
"public function setLastModify($last_modify)\n\t{\n\t\t$this->last_modify = $last_modify;\n\t}",
"public function setTicketSystem(?string $value): void {\n $this->getBackingStore()->set('ticketSystem', $value);\n }",
"private function setLastModifiedDateTime() {\n\t\ttry {\n\t\t\t$stmt = $this->db->prepare(\"UPDATE `$this->table` SET `datetime-last-modified` = NOW() WHERE `id` = ?\");\n\t\t\t$stmt->execute([$this->getID()]);\n\t\t} catch (PDOException $e) {\n\t\t\techo 'Post.class.php setLastModifiedDateTime() error: <br />';\n\t\t\tthrow new Exception($e->getMessage());\n\t\t}\n\n\t\t// Because we set the datetime from MySQL, we can't use PHP's datetime function to get the time as it may be slightly different\n\t\t$stmt = $this->db->prepare(\"SELECT `datetime-last-modified` FROM `$this->table` WHERE `id` = ?\");\n\t\t$stmt->execute([$this->getID()]);\n\n\t\tforeach ($stmt as $row) {\n\t\t\t$this->lastModifiedDate = $row['datetime-last-modified'];\n\t\t}\n\t}",
"private function _timestamp()\n \t{\n \t\t$this->updated_at = time();\n \t\tif (!$this->exists) $this->created_at = $this->updated_at;\n \t}",
"public function setTimeStamp($value)\n\t{\n\t\tif($value===null || (is_string($value) && trim($value)===''))\n\t\t\t$this->setText('');\n\t\telse\n\t\t{\n\t\t\t$date = TPropertyValue::ensureFloat($value);\n\t\t\t$formatter = Prado::createComponent('System.Util.TSimpleDateFormatter',$this->getDateFormat());\n\t\t\t$this->setText($formatter->format($date));\n\t\t}\n\t}",
"private function _mktime(){\n\t\t$this->_timestamp = self::mktime($this->_month, $this->_day, $this->_year);\n\t}",
"public function setServerTime();",
"function set_time($newhour, $newminute, $newday, $newmonth, $newyear)\n {\n //sets the Date object given the hour, minute, day, month, and year\n $newtimestamp=mktime( $newhour, $newminute, 0, $newmonth, $newday, $newyear);\n $this->timestamp=$newtimestamp;\n }",
"public function setTimestamp($timestamp)\n {\n if (null !== $timestamp) {\n $timestamp = (int) $timestamp;\n }\n $this->clearCachedValueIf($this->_timestamp != $timestamp);\n $this->_timestamp = $timestamp;\n }",
"private function actionAlterTablePaymentSetTimestamp() {\n $this->changeTableColumnToTimestamp(TB_VPS_PAYMENT, array(\"payment_date\"), \"payment_id\");\n echo TB_VPS_PAYMENT . \" DONE <br/>\";\n }",
"public function save_timestamp($timestamp = 0)\n\t{\n\t\tif ($this->_EE->db->get_where('dd_settings', array('key' => 'last_saved'))->num_rows() == 0)\n\t\t{\n\t\t\t// new row\n\t\t\t$this->_EE->db->insert('exp_dd_settings', array('key' => 'last_saved', 'value' => $timestamp)); \n\t\t} else {\n\t\t\t// update row\n\t\t\t$this->_EE->db->where('key', 'last_saved')->update('dd_settings', array('value' => $timestamp));\n\t\t}\n\t}",
"public function setTime($timestamp)\r\n {\r\n $this->data['year'] = (int) date(\"Y\", $timestamp);\r\n $this->data['mon'] = (int) date(\"m\", $timestamp);\r\n $this->data['day'] = (int) date(\"d\", $timestamp);\r\n $this->data['hour'] = (int) date(\"G\", $timestamp);\r\n $this->data['min'] = (int) date(\"i\", $timestamp);\r\n }",
"public function setPubDate( $timestamp ) {\n\t\t$this->pubDate = date( 'r', $timestamp );\n\t}",
"public function populateTimestamp()\n {\n $this->exists = true;\n $this->timestamp = 1;\n }",
"public function setCreationTimestamp(?DateTime $value): void {\n $this->getBackingStore()->set('creationTimestamp', $value);\n }",
"public function set_modification_date($modified)\n {\n $this->set_default_property(self::PROPERTY_MODIFICATION_DATE, $modified);\n }",
"function ResetTime($module) {\r\n $this->module = $module;\r\n $current=time();\r\n $query=\"update actsessions \";\r\n $query.=\"set lastused=$current \";\r\n $query.=\"where seshid='$this->seshid'\";\r\n $result=mysqli_query($this->linkid,$query);\r\n // query failed\r\n if (!$result) {\r\n $this->err_level = -1;\r\n $this->err=mysqli_error($this->linkid);\r\n $this->err_no=203;\r\n $this->DbgAddSqlLog();\r\n $this->AutomatState = -1;\r\n return;\r\n }\r\n // table actsessions updated\r\n $this->err_level = 16;\r\n $this->err = (string)$this->module . \": resetTime\";\r\n $this->err_no = 0;\r\n $this->DbgAddSqlLog();\r\n return;\r\n }",
"private function _setDate(){\n\t\tif($this->_year>=1970&&$this->_year<=2038){\n\t\t\t$this->_day = date('d', $this->_timestamp);\n\t\t\t$this->_month = date('m', $this->_timestamp);\n\t\t\t$this->_year = date('Y', $this->_timestamp);\n\t\t} else {\n\t\t\t$dateParts = self::_getDateParts($this->_timestamp, true);\n\t\t\t$this->_day = sprintf('%02s', $dateParts['mday']);\n\t\t\t$this->_month = sprintf('%02s', $dateParts['mon']);\n\t\t\t$this->_year = $dateParts['year'];\n\t\t}\n\t\t$this->_date = $this->_year.'-'.$this->_month.'-'.$this->_day;\n\t}",
"public function touch() {\n\t\t$this->timestamp();\n\t\t$this->save();\n\t}",
"protected function setLastUsed($timestamp)\n {\n if (!is_numeric($timestamp)) {\n throw new \\InvalidArgumentException(sprintf(\n '%s: expects a numeric argument; received \"%s\"',\n __METHOD__,\n (is_object($timestamp) ? get_class($timestamp) : gettype($timestamp))\n ));\n }\n \n $this->lastUsed = (int) $timestamp;\n }",
"function updateModified() {\n\n\t\t\tif (!$this->requestAction('admins/checkAdminLoggedIn')) {\n\t\t\t\t// Set the modified date for the editation and leave registration number unchanged\n\t\t\t\t$this->Session->write('Registration.Registration.modified', date('Y-m-d H:i:s'));\n\t\t\t}\n\t}",
"public function getLastModificationDateTime() {\n $timestamp = $this->getUpdatedAt();\n // we don't know when the module content is updated, so we \"guess\"\n if ($this->getModule() != '') {\n $timestamp->setDate(date('Y'), date('m'), date('d'));\n }\n return $timestamp;\n }",
"private function _setTimestamp($column)\n {\n $this->_record->$column = date(self::DATE_FORMAT);\n }",
"private function set_last_updated_at() {\n\n\t\tif ( ! static::get_table() instanceof TimestampedTable ) {\n\t\t\treturn;\n\t\t}\n\n\t\t$dirty = $this->is_dirty();\n\n\t\t$this->set_attribute( static::get_table()->get_updated_at_column(), $this->fresh_timestamp() );\n\n\t\t// If the model is dirty, we don't want to commit our save since the user should already be calling save.\n\t\tif ( ! $dirty ) {\n\t\t\t$this->save();\n\t\t}\n\t}",
"function setTimeStamp($stampInformation){\r\n\t\tif(count($stampInformation)>0){\r\n\t\t\t$this->addData(TBL_STAMP,$stampInformation);\r\n\t\t\treturn true;\r\n\t\t}else{\r\n\t\t\treturn false;\r\n\t\t}\r\n\t}",
"function updateTimestamp($year, $month, $day, $time = NULL)\n\t\t{\n\t\t\tif(empty($this->id))\n\t\t\t\treturn false;\t\t//need a saved order\n\n\t\t\tif(empty($time))\n\t\t\t\t$time = \"00:00:00\";\n\n\t\t\t$date = $year . \"-\" . $month . \"-\" . $day . \" \" . $time;\n\n\t\t\tglobal $wpdb;\n\t\t\t$this->sqlQuery = \"UPDATE $wpdb->pmpro_membership_orders SET timestamp = '\" . $date . \"' WHERE id = '\" . $this->id . \"' LIMIT 1\";\n\n\t\t\tif($wpdb->query($this->sqlQuery) !== \"false\")\n\t\t\t\treturn $this->getMemberOrderByID($this->id);\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}",
"public function setLast_modified( $last_modified ) {\n\t\t$this->last_modified = $last_modified;\n\t}",
"public function setUpdatedAt($timestamp);",
"public function setModifiedDate($value) {\n if (is_string($value)) {\n try {\n $this->modifiedDate = new \\DateTime($value);\n } catch (\\Exception $ex) {\n $this->modifiedDate = null;\n }\n } elseif (is_a($value, '\\\\DateTime')) {\n $this->modifiedDate = $value;\n } else {\n $this->modifiedDate = null;\n }\n }",
"function CIR_setDateAndTimeTemorarily()\n{\n\t$date = date('mdHiY.s');\n\techo(\"\\ndate $date\\n\");\n}",
"public function touch($path, $modificationTime = null, $accessTime = null);",
"public function setModule(string $module)\n\t{\n\t\t$this->module=$module; \n\t\t$this->keyModified['module'] = 1; \n\n\t}",
"public function setModifiedTime(\\DateTime $modifiedTime)\n\t{\n\t\t$this->modifiedTime=$modifiedTime; \n\t\t$this->keyModified['modified_time'] = 1; \n\n\t}",
"function setWorkTime( $value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->WorkTime = $value;\n }",
"function setTimeOffset($value)\n {\n $this->_props['TimeOffset'] = $value;\n }",
"public function SetFromTimestamp( $timestamp ){\r\n\t\t\tif( $timestamp !== null ){\r\n\t\t\t\t$this->year = date( 'Y', $timestamp );\r\n\t\t\t\t$this->month = date( 'm', $timestamp );\r\n\t\t\t\t$this->day = date( 'd', $timestamp );\r\n\t\t\t\t$this->hours = date( 'H', $timestamp );\r\n\t\t\t\t$this->minutes = date( 'i', $timestamp );\r\n\t\t\t\t$this->seconds = date( 's', $timestamp );\r\n\t\t\t}\r\n\t\t}",
"public function setTime($value)\n {\n if (!array_key_exists('time', $this->fieldsModified)) {\n $this->fieldsModified['time'] = $this->data['fields']['time'];\n } elseif ($value === $this->fieldsModified['time']) {\n unset($this->fieldsModified['time']);\n }\n\n $this->data['fields']['time'] = $value;\n }",
"private function SetModifiedBy(User $value = null)\n\t\t{\n\t\t\t$this->modifiedby = $value;\n\t\t}",
"public function setModified($modified) {\n\t\t$this->modified = (string) $modified;\n\t}",
"public function setNewVersion()\n {\n $difference = '9223372036854775806';\n $rand_percent = bcdiv(mt_rand(), mt_getrandmax(), 12);\n $version = bcmul($difference, $rand_percent, 0);\n $this->owner->setAttribute($this->versionField, $version);\n }",
"public function setLastStatusUpdate($value) {\n\t\t$value = date('d-M-Y', strtotime($value));\n\t\tself::$_lastStatusUpdate = $value;\n\t}",
"protected function setUpdated(){\n if($this->_id > 0){\n $pfDB = DB\\Database::instance()->getDB('PF');\n\n $pfDB->exec(\n [\"UPDATE \" . $this->table . \" SET updated=NOW() WHERE id=:id\"],\n [\n [':id' => $this->_id]\n ]\n );\n }\n }",
"public function setLastUpdated($lastUpdated);",
"public function setLastModifiedTime(int $unixTime): void\n {\n $this->lastModified = gmdate(\"D, d M Y H:i:s T\", $unixTime);\n }",
"protected function setUpdatedTime($updated_time) {\r\n $this->updated_time = strtotime($updated_time);\r\n }",
"public function setLastResetWorldChatTime($value)\n {\n return $this->set(self::_LAST_RESET_WORLD_CHAT_TIME, $value);\n }",
"public function setTime($time=0){\n\t\t\t$this->_time = $time;\n\t\t}",
"private function updateUpdatedAtField() {\n foreach (static::getFields() as $field_name => $field) {\n if ($field instanceof UpdatedAtField) {\n $this->$field_name = time();\n }\n }\n }",
"public function setTargetSystem(?string $targetSystem): void\n {\n $this->targetSystem = $targetSystem;\n }",
"public function preUpdate($val) {\n $user = $this->getConfigurationPool()->getContainer()->get('security.context')->getToken()->getUser();\n $val->setIdUserMod($user);\n $val->setDateMod(new \\DateTime());\n }",
"function set_time_from_unix_time($unixtime)\n {\n $this->timestamp=$unixtime;\n }",
"public function setSystem($value)\n {\n return $this->set(self::system, $value);\n }"
] | [
"0.6651876",
"0.60896826",
"0.59081995",
"0.5812691",
"0.5800295",
"0.57981634",
"0.57313037",
"0.56944156",
"0.562311",
"0.56046176",
"0.56017816",
"0.55386066",
"0.5526757",
"0.5474085",
"0.5465713",
"0.5425356",
"0.53722",
"0.536948",
"0.53664964",
"0.53605634",
"0.53567266",
"0.53520244",
"0.5329629",
"0.53224564",
"0.5318796",
"0.5297259",
"0.5289138",
"0.5278087",
"0.52651894",
"0.5236234",
"0.5233068",
"0.52312434",
"0.52312434",
"0.52171516",
"0.5187011",
"0.5187011",
"0.5187011",
"0.5187011",
"0.5187011",
"0.51756847",
"0.51222426",
"0.5105232",
"0.5099833",
"0.5075961",
"0.5067223",
"0.5066917",
"0.5058823",
"0.5058072",
"0.5056701",
"0.5052183",
"0.50425756",
"0.50314057",
"0.50140405",
"0.5007653",
"0.50023407",
"0.49856612",
"0.49613863",
"0.4951871",
"0.4948514",
"0.4933662",
"0.4929013",
"0.491069",
"0.4900835",
"0.48970526",
"0.489628",
"0.48827183",
"0.4874281",
"0.4868921",
"0.4867331",
"0.48582956",
"0.48525256",
"0.48517695",
"0.48472032",
"0.48417625",
"0.48399895",
"0.4834488",
"0.48271877",
"0.48199898",
"0.48080537",
"0.48064792",
"0.48051655",
"0.47971782",
"0.47793406",
"0.4777844",
"0.4774547",
"0.4764659",
"0.47611794",
"0.47562188",
"0.47536317",
"0.47395876",
"0.47395137",
"0.47242838",
"0.47198963"
] | 0.7396316 | 6 |
Sets a new topic | public function setTopic(\GoetasWebservices\Client\SalesforceEnterprise\Sobject\TopicType $topic)
{
$this->topic = $topic;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setTopic($topic);",
"public function setTopic($topic)\n {\n $this->_topic = $topic;\n }",
"public function setTopic($topic, $updateFirstPost = true) {\n\t\tif ($topic == $this->topic) return;\n\t\t\n\t\t$this->topic = $topic;\n\t\t$sql = \"UPDATE \twbb\".WBB_N.\"_thread\n\t\t\tSET\ttopic = '\".escapeString($topic).\"'\n\t\t\tWHERE \tthreadID = \".$this->threadID;\n\t\tWCF::getDB()->registerShutdownUpdate($sql);\n\t\t\n\t\t// update the subject of the first post in this thread\n\t\tif ($updateFirstPost && $this->firstPostID) {\n\t\t\t$sql = \"UPDATE \twbb\".WBB_N.\"_post\n\t\t\t\tSET\tsubject = '\".escapeString($topic).\"'\n\t\t\t\tWHERE \tpostID = \".$this->firstPostID;\n\t\t\tWCF::getDB()->registerShutdownUpdate($sql);\n\t\t}\n\t}",
"public function declareTopic(string $topic): void;",
"public function setTopic(TopicInterface $topic);",
"public function setTopic($topic)\n {\n $this->topic = $topic;\n\n return $this;\n }",
"public function onTopic( $sTopic )\n\t{\n\t\t$this -> m_sTopic = $sTopic;\n\t}",
"public function setTopic($channel, $topic)\n {\n return $this->method('setTopic', compact('channel', 'topic'));\n }",
"function addTopic(&$topic) {\n\t\t$this->topics[] = $topic;\n\t}",
"public function __construct(Topic $topic)\n {\n $this->topic = $topic;\n }",
"public function setTopic($var)\n {\n GPBUtil::checkString($var, True);\n $this->Topic = $var;\n\n return $this;\n }",
"public function register(Topic $topic);",
"public function setId_topic($id_topic)\n {\n $this->id_topic = $id_topic;\n\n return $this;\n }",
"public function testChannelsSetTopic()\n {\n }",
"public function createTopic($topic){\n \tif(!array_key_exists($topic, $this->topics)){\n \t\tthrow new \\InvalidArgumentException('Topic not in configuration');\n \t}\n \t$result = $this->getClient()->createTopic([\n \t\t'Name' => $this->getTopic($topic)['name'],\n \t]);\n\n \treturn $result;\n }",
"function target_add_topic($topic)\n{\n\t// if ($GLOBALS['VERBOSE']) pf('...'. $topic['id']);\n\n\tif (!isset($topic['orderexpiry'])) {\n\t\t$topic['orderexpiry'] = 0;\n\t}\n\n\t// Set orderexpiry for announcement and sticky topics.\n\tif (($topic['thread_opt'] & 2) || ($topic['thread_opt'] & 4)) {\n\t\t$topic['orderexpiry'] = 1000000000;\n\t}\n\n\t// Skip topics that doesn't belong to a forum.\n\tif (!isset($GLOBALS['forum_map'][ (int)$topic['forum_id'] ])) {\n\t\tpf('WARNING: Skip topic #'. $topic['id'] .'. Probably an announcement or orphaned message!');\n\t\treturn;\n\t}\n\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'thread (\n\t\tid, forum_id, root_msg_id, views, replies, thread_opt, orderexpiry\n\t\t) VALUES(\n\t\t\t'. (int)$topic['id'] .',\n\t\t\t'. $GLOBALS['forum_map'][ (int)$topic['forum_id'] ] .',\n\t\t\t'. (int)$topic['root_msg_id'] .',\n\t\t\t'. (int)$topic['views'] .',\n\t\t\t'. (int)$topic['replies'] .',\n\t\t\t'. (int)$topic['thread_opt'] .',\n\t\t\t'. (int)$topic['orderexpiry'] .')\n\t');\n}",
"function webnotik_register_topics_settings() {\n\tregister_setting( 'webnotik-topics-group', 'webnotik_main_topics' );\n}",
"public function setSubTopic(array $topic)\n {\n if (!isset($topic['name'])) {\n throw new BusinessException('Subscribe topic name need');\n }\n if (!isset($topic['qos']) || !in_array($topic['qos'], $this->validQos)) {\n throw new BusinessException('Invalid qos');\n }\n $this->subTopics[] = $topic;\n }",
"public function setAction($table, $body) {\n \t$user_id = $body['user'];\n\t$topic_subject = $body['topic'];\n\t\t\n if (strcmp($table, 'topics') == 0) {\n $sql = 'INSERT INTO `topics` (`topic_subject`, `topic_by`)';\n $values = \" VALUES ('$topic_subject', '$user_id')\";\n\t \n\t $result = $this->db->query($sql . $values);\n\t \n\t if ($result) {\n\t \t$sql = \"SELECT * FROM $table ORDER BY `topic_id` DESC LIMIT 1\";\n\t\t \n\t\treturn $this->db->query($sql);\n\t }\n }\n }",
"public function setContent(?string $content): Topic\n {\n $this->content = $content;\n return $this;\n }",
"public function new_topic( $topic_id ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'new_topic', 'new_group_forum_topic' ) ) return;\n\n\t\t\t// Make sure this is unique event\n\t\t\tif ( $this->core->has_entry( 'new_group_forum_topic', $topic_id, $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'new_group_forum_topic',\n\t\t\t\t$bp->loggedin_user->id,\n\t\t\t\t$this->prefs['new_topic']['creds'],\n\t\t\t\t$this->prefs['new_topic']['log'],\n\t\t\t\t$topic_id,\n\t\t\t\t'bp_ftopic',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}",
"public function __construct(Topic $topic)\n {\n $this->topic=$topic;\n $this->class=Classes::find($topic->class_id);\n }",
"private function getOneTopic() {\n $this->topic->findOne();\n }",
"function insertIntoTopicsTable($topic){\n $sqlAddTopic = 'REPLACE INTO topics SET topic = (\\'' . $topic . '\\');';\n run_sql($sqlAddTopic);\n}",
"public function setTitle(?string $title): Topic\n {\n $this->title = $title;\n return $this;\n }",
"public function edit(Topic $topic)\n {\n }",
"function target_add_topic_subscription($sub)\n{\n\tif ($sub['user_id'] == 1 && isset($GLOBALS['hack_id'])) {\n\t\t$sub['user_id'] = $GLOBALS['hack_id'];\n\t}\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'thread_notify (user_id, thread_id) VALUES('. (int)$sub['user_id'] .', '. (int)$sub['topic_id'] .')');\n}",
"public function __construct($topic_id,$thread_id)\n {\n $this->topic_id = $topic_id;\n $this->thread_id = $thread_id;\n }",
"public function edit(Topic $topic)\n {\n //\n }",
"public function edit(Topic $topic)\n {\n //\n }",
"public function update_topic($data, $id){\n if(!$this->get_topic($id)){\n return false;\n }\n \n $this->db->where('id', $id);\n $this->db->update('pet_talk_topics', $data);\n }",
"public function store(Request $request)\n {\n //\n $this->validate($request, [\n 'topic' => 'required|string',\n ]);\n \n $user_id = $request->user()->id;\n $topic = $request->topic;\n // echo $user_id, $topic;\n $forum_topic = new Forum;\n $forum_topic->user_id = $user_id;\n $forum_topic->topic = $topic;\n // \n \n $forum_topic->save();\n // exit ($forum_topic->slug);\n return redirect()->route('forum.index')\n ->with('success', 'Topic created sucessfully');\n }",
"public function notify_forum_new_topic( $topic_id ) {\n\t\t$this->notify_forum_topic_payload( 'create-topic', $topic_id );\n\t}",
"public function ambassade_single_topic(&$event) {\n global $user;\n // IF IS AMBASSADE\n if($event[\"row\"][\"forum_id\"] == 29 && !$this->topic_ambassade_set_up) {\n $guild = new \\scfr\\main\\ambassade\\Guild($this->db);\n $first_reply = $event[\"topic_data\"][\"topic_first_post_id\"];\n $guild->__topic_init($event[\"row\"][\"topic_id\"]);\n\n //var_dump();\n\n $templates[\"GUILD_JSON\"] = json_encode(false);\n if($guild->is_registerd) {\n $templates[\"TOPIC_IS_REGISTERED_GUILD\"] = true;\n foreach($guild->RSI as $name => $val)\n $templates[\"GUILD_\".strtoupper($name)] = $val;\n\n $templates[\"GUILD_JSON\"] = json_encode($guild->RSI);\n }\n\n\n if($templates['GUILD_BACKGROUND']) $templates['CUSTOM_BACKGROUND'] = $templates['GUILD_BACKGROUND'];\n\n\n $templates[\"TOPIC_IS_GUILD\"] = true;\n $templates[\"GUILD_TOPIC_ID\"] = $event[\"topic_data\"][\"topic_id\"];\n\n $templates[\"S_REQUIRE_ANGULAR\"] = true;\n $this->template->assign_vars($templates);\n $this->topic_set_up = true;\n }\n }",
"public function topics(Topics $topics = null);",
"function setSubject($subject_toset,$default=\"No Subject\"){\n\t\t\tif(strlen($subject_toset)>0)\n\t\t\t{\n\t\t\t\t$this->subject=$subject_toset;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->subject=$default;\t\n\t\t\t}\n\t\t}",
"public function update_topic($topic_id) {\n $this->validate($this->request, [\n 'title' => 'required|string|max:255',\n 'is_guardian_blocked' => 'required|integer|min:0|max:1',\n 'status' => 'required|integer|min:0|max:1',\n 'is_featured' => 'required|integer|min:0|max:1',\n 'content' => 'string'\n ]);\n\n $topic = Topic::find($topic_id);\n\n $topic->title = $this->request['title'];\n $topic->content = $this->request['content'];\n $topic->is_guardian_blocked = $this->request['is_guardian_blocked'];\n $topic->updated_by = $this->user_id;\n $topic->status = $this->request['status'];\n $topic->is_featured = $this->request['is_featured'];\n\n $topic->save();\n\n return response()->json($topic, 200);\n }",
"public function setTopicId($topicId)\n {\n $this->topicId = $topicId;\n return $this;\n }",
"public function store(CreateTopic $request)\n { \n $topic = new Topic();\n $topic->section_id = $request->input('section_id');\n $topic->title = $request->title;\n $topic->save();\n\n $post = new Post();\n $post->user_id = Auth::user()->id;\n $post->topic_id = $topic->id;\n $post->body = $request->input('body');\n $post->save();\n\n return redirect(\"/topic/$topic->id\")->with('success', 'Topic was saved with success');\n }",
"public function load_topic_object()\n\t{\n\t\tif (!$this->post->topic->topic_id)\n\t\t{\n\t\t\t$this->post->topic->topic_id = $this->post->topic_id;\n\t\t\t$this->post->topic->load();\n\t\t}\n\t}",
"public function sendEvent(string $topic, $message): void;",
"public function getTopic() {}",
"public function doTopic($channel, $topic = null)\n {\n $args = array($channel);\n\n if (!empty($topic)) {\n $args[] = $topic;\n }\n\n $this->send('TOPIC', $args);\n }",
"private function addGroupTopic()\n {\n try\n {\n $request = $_POST;\n\n if(!isset($request['group_id']) || $request['group_id']==\"\" )\n throw_error_msg('provide group id');\n else if(!is_numeric($request['group_id'])) \n throw_error_msg('invalid group id'); \n else\n $gid = (int)$request['group_id'];\n\n if(!isset($request['topic_title']) || $request['topic_title']==\"\" )\n throw_error_msg('provide topic title');\n\n if(!isset($request['topic_post']) || $request['topic_post']==\"\" )\n throw_error_msg('provide topic post');\n\n if(!userid())\n throw_error_msg(lang(\"you_not_logged_in\")); \n \n global $cbgroup; \n $cbgroup->add_topic($request);\n\n if( msg())\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'group topic added', \"data\" => array());\n $this->response($this->json($data));\n }\n\n if( error() )\n {\n throw_error(error('single')); \n }\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }",
"function setTopic($topic,$who,$comment){\n $tag = '';\n $data = array(\n 'category' => '2',\n 'discuss_topic_name' => $topic,\n 'userID'=>$who,\n 'tag'=>''\n );\n\n $this->db->insert('discuss_topic',$data);\n\n // add the first comment to \n\n $p = array();\n $p['title'] = $topic;\n $p['comment'] = $comment;\n\n $s = array();\n $s['No'] = $who;\n\n //\n//\t$this->db->select('username');\n//\t$result = $this->db->get_where('mem_db',array('id'=>$who));\n//\t$temp = $result->result();\n\t$username = $this->findUsername($who);//$temp[0]->username;\n\t\n\t$this->db->select('discuss_topic_id');\n\t$findIDObj = $this->db->get_where('discuss_topic',array('discuss_topic_name'=>$topic));\n\t$temp2 = $findIDObj->result();\n\t$disID = $temp2[0]->discuss_topic_id;\n\t\t\n\t$data=array(\n\t\t'id'=>'default()',\n\t\t'topicID'=>$disID,\n\t\t'topicName'=>$topic,\n\t\t'userID'=>$who,\n\t\t'userName'=>$username,\n\t\t'comment'=>$comment,\n\t\t'like'=>'0',\n\t\t'dislike'=>'0'\n\t );\n\t$this->db->insert('discuss',$data);\n\n\n\t// get the lastest topic id\n\n\t$this->db->select('discuss_topic_id');\n\t$findid = $this->db->get_where('discuss_topic',array('discuss_topic_name'=>$topic));\n\t$temp3 = $findid->result();\n\t$topicIdLastest = $temp3[0]->discuss_topic_id;\n\n \treturn $topicIdLastest;\t\n\n }",
"public function topic()\n {\n return $this->belongsTo(Topic::class);\n }",
"function createTopic($name)\n\t{\n\t\tif(trim($name) == \"\")return $this->message(FORUM_URES_MEZO);\n\t\tif($this->isHavePriv(FORUM_PRIV_TOPIC_CREATE))\n\t\t\treturn mysql_query(\t\"INSERT INTO `\".$this->prefix.\"topic`(`topic_name`,`topic_cat`,`topic_created_by`,`topic_created_time`) \".\n\t\t\t\t\t\t\t\"VALUES('\".specChars($name,\"forum::createTopic\").\"',\".$this->cat_id.\",\".$this->akt_user.\",\".time().\")\");\n\t\telse return $this->message(FORUM_MESSAGE_PRIV_ERROR);\n\t}",
"function setParentTopicId($parentTopicId) {\n\t\t$this->setData('parentTopicId', $parentTopicId);\n\t}",
"public function edit_topic( $topic_id ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'edit_topic', 'edit_group_forum_topic' ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'edit_group_forum_topic',\n\t\t\t\t$bp->loggedin_user->id,\n\t\t\t\t$this->prefs['edit_topic']['creds'],\n\t\t\t\t$this->prefs['edit_topic']['log'],\n\t\t\t\t$topic_id,\n\t\t\t\t'bp_ftopic',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}",
"function addTopic()\n{\n\tglobal $xoopsDB, $xoopsModule, $xoopsModuleConfig;\n $topicpid = isset($_POST['topic_pid']) ? intval($_POST['topic_pid']) : 0;\n $xt = new NewsTopic();\n if (!$xt->topicExists($topicpid, $_POST['topic_title'])) {\n $xt->setTopicPid($topicpid);\n if (empty($_POST['topic_title']) || xoops_trim($_POST['topic_title'])=='') {\n redirect_header( \"index.php?op=topicsmanager\", 2, _AM_ERRORTOPICNAME );\n }\n $xt->setTopicTitle($_POST['topic_title']);\n //$xt->Settopic_rssurl($_POST['topic_rssfeed']);\n $xt->setTopic_color($_POST['topic_color']);\n if (isset($_POST['topic_imgurl'] ) && $_POST['topic_imgurl'] != \"\") {\n $xt->setTopicImgurl($_POST['topic_imgurl'] );\n }\n\t\t$xt->setMenu(intval($_POST['submenu']));\n\t\t$xt->setTopicFrontpage(intval($_POST['topic_frontpage']));\n\t\tif(isset($_POST['xoops_upload_file'])) {\n\t\t\t$fldname = $_FILES[$_POST['xoops_upload_file'][0]];\n\t\t\t$fldname = (get_magic_quotes_gpc()) ? stripslashes($fldname['name']) : $fldname['name'];\n\t\t\tif(xoops_trim($fldname!='')) {\n\t\t\t\t$sfiles = new sFiles();\n\t\t\t\t$dstpath = XOOPS_ROOT_PATH . \"/modules/\" . $xoopsModule -> dirname() . '/images/topics';\n\t\t\t\t$destname=$sfiles->createUploadName($dstpath ,$fldname, true);\n\t\t\t\t$permittedtypes=array('image/gif', 'image/jpeg', 'image/pjpeg', 'image/x-png', 'image/png');\n\t\t\t\t$uploader = new XoopsMediaUploader($dstpath, $permittedtypes, $xoopsModuleConfig['maxuploadsize']);\n\t\t\t\t$uploader->setTargetFileName($destname);\n\t\t\t\tif ($uploader->fetchMedia($_POST['xoops_upload_file'][0])) {\n\t\t\t\t\tif ($uploader->upload()) {\n\t\t\t\t\t\t$xt->setTopicImgurl(basename($destname));\n\t\t\t\t\t} else {\n\t\t\t\t\t\techo _AM_UPLOAD_ERROR . ' ' . $uploader->getErrors();\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\techo $uploader->getErrors();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$xt->setTopicDescription($_POST['topic_description']);\n\t\t$xt->store();\n\t\tupdateCache();\n\n $notification_handler = & xoops_gethandler('notification');\n $tags = array();\n $tags['TOPIC_NAME'] = $_POST['topic_title'];\n $notification_handler->triggerEvent( 'global', 0, 'new_category', $tags);\n redirect_header('index.php?op=topicsmanager', 1, _AM_DBUPDATED);\n } else {\n redirect_header('index.php?op=topicsmanager', 2, _AM_ADD_TOPIC_ERROR);\n }\n exit();\n}",
"public function initTopics()\n {\n $collectionClassName = BiblioTopicTableMap::getTableMap()->getCollectionClassName();\n\n $this->collTopics = new $collectionClassName;\n $this->collTopicsPartial = true;\n $this->collTopics->setModel('\\Slims\\Models\\Masterfile\\Topic\\Topic');\n }",
"public function update(Request $request, Topic $topic)\n {\n //\n }",
"public function topic(){\n return $this->belongsTo('App\\Topic','topics_id');\n }",
"public function testUpdate(): void\n {\n $this->createInstance();\n $user = $this->createAndLogin();\n\n $res = $this->fConnector->getDiscussionManagement()->postTopic('Hello title', 'My content', [$this->configTest['testTagId']],$user->userId)->wait();\n\n //Test update as admin\n $res2 = $this->fConnector->getDiscussionManagement()->updateTopic($res->id,'Hello title3', 'My content2', [$this->configTest['testTagId']],null)->wait();\n $this->assertInstanceOf(FlarumDiscussion::class,$res2) ;\n $this->assertEquals('Hello title3',$res2->title, 'Test discussion update as admin');\n\n //Test update as user\n $res2 = $this->fConnector->getDiscussionManagement()->updateTopic($res->id,'Hello title4', 'My content3', [$this->configTest['testTagId']],null)->wait();\n $this->assertInstanceOf(FlarumDiscussion::class,$res2) ;\n $this->assertEquals('Hello title4',$res2->title,'Test discussion update as user');\n\n }",
"public function setTopics(Collection $topics, ConnectionInterface $con = null)\n {\n $this->clearTopics();\n $currentTopics = $this->getTopics();\n\n $topicsScheduledForDeletion = $currentTopics->diff($topics);\n\n foreach ($topicsScheduledForDeletion as $toDelete) {\n $this->removeTopic($toDelete);\n }\n\n foreach ($topics as $topic) {\n if (!$currentTopics->contains($topic)) {\n $this->doAddTopic($topic);\n }\n }\n\n $this->collTopicsPartial = false;\n $this->collTopics = $topics;\n\n return $this;\n }",
"public function setModify(?int $modify): Topic\n {\n $this->modify = $modify;\n return $this;\n }",
"function markTopicRead($forumID, $topicID) {\n\t\tglobal $DB;\n\t\t\n\t\t// Pull our read topics information so we can work with it\n\t\t$topicsRead = getTopicsReadArray($forumID);\n\t\t\t\n\t\t// Kill our read row in the DB\n\t\t$sql = \"DELETE FROM `\" . DBTABLEPREFIX . \"topics_read` WHERE user_id='\" . $_SESSION['userid'] . \"' AND forum_id='\" . $forumID . \"' LIMIT 1\";\n\t\t$result = $DB->query($sql);\n\t\t\n\t\t// Set this topic read time to right now\n\t\t$topicsRead[$topicID] = time();\n\t\t\n\t\t// Clean out any bad topics (they were probably deleted\n\t\t$topicsRead = array_filter($topicsRead, \"topicExists\");\n\t\t\t\n\t\t// We disable this since we don't want to escape our topic_ids field\n\t\t// Dont escape since this method does that, double escape isn't fun\n\t\t//$result = $DB->query_insert(\"topics_read\", array('user_id' => $_SESSION['userid'], 'forum_id' => $forumID, 'topic_ids' => serialize($topicsRead)));\n\t\t\n\t\t// Warp everything up and save it\n\t\t$sql = \"INSERT INTO `\" . DBTABLEPREFIX . \"topics_read` (user_id, forum_id, topic_ids) VALUES ('\" . $_SESSION['userid'] . \"', '\" . $forumID . \"', '\" . serialize($topicsRead) . \"')\";\n\t\t$result = $DB->query($sql);\n\t}",
"function suggesttopic($topicid, $title, $email = \"\", $description = \"\"){\r\n\tglobal $db, $dbprefix, $phrase;\r\n\t\r\n\t$topicid = intval($topicid);\r\n\tif ($title == \"\"){ return $phrase[\"submit_notitle\"]; }\r\n\t\r\n\t// check the topic exists\r\n\t$sql = \"SELECT * FROM \" . $dbprefix . \"topics WHERE topicid = \" . dbSecure($topicid);\r\n\t$top = $db->execute($sql);\r\n\tif ($top->rows < 1){ return $phrase[\"submit_missingtopic\"]; }\r\n\t\r\n\t// check for an existing sub-topic\r\n\t$sql = \"SELECT * FROM \" . $dbprefix . \"topics WHERE parent = \" . dbSecure($topicid) . \" AND title = '\" . dbSecure($title) . \"'\";\r\n\t$chk = $db->execute($sql);\r\n\tif ($chk->rows > 0){ return $phrase[\"submit_topicexists\"]; }\r\n\t\r\n\t// and insert the topic\r\n\t$sql = \"INSERT INTO \" . $dbprefix . \"newtopics (topicid, postdate, title, email, description, ip) VALUES (\";\r\n\t$sql .= \"\" . dbSecure($topicid) . \", \";\r\n\t$sql .= \"\" . time() . \", \";\r\n\t$sql .= \"'\" . dbSecure($title) . \"', \";\r\n\t$sql .= \"'\" . dbSecure($email) . \"', \";\r\n\t$sql .= \"'\" . dbSecure($description) . \"', \";\r\n\t$sql .= \"'\" . dbSecure($_SERVER[\"REMOTE_ADDR\"]) . \"')\";\r\n\t$db->execute($sql);\r\n\t\r\n\t// and return\r\n\treturn $phrase[\"submit_topic_success\"];\r\n}",
"public function createTopic(Topic $topic, TopicBind ...$binds): Promise\n {\n return $this->transport->createTopic($topic, ...$binds);\n }",
"public function updateTopic($id,$data){\n $data['id'] = $id;\n DB::transaction(function($data) use ($data) {\n try {\n $topic = $this->model->withTrashed()->findOrFail($data['id']);\n if(!$topic->trashed()) {\n $topic->tags()->decrement('topic_count');\n $flag = (int)$data['category_id'] == $topic->category_id;\n if (!$flag)\n $topic->category()->decrement('topic_count');\n $topic->fill($data)->save();\n $topic = $this->model->withTrashed()->findOrFail($data['id']);\n if (!$flag)\n $topic->category()->increment('topic_count');\n if(isset($data['tags'])){\n $topic->tags()->sync($data['tags']);\n $topic->tags()->increment('topic_count');\n }\n }else{\n $topic = $topic->save($data);\n if($data['tags'])\n $topic->tags()->sync($data['tags']);\n }\n\n }catch (Exception $e){\n throw $e;\n }\n });\n }",
"public function __construct($topic, $push_message, $title, $data, $user, $settings, $type)\n\t{\n\t\t$this->topic = $topic;\n\t\t$this->push_message = $push_message;\n\t\t$this->title = $title;\n\t\t$this->data = $data;\n\t\t$this->user = $user;\n\t\t$this->settings = $settings;\n\t\t$this->type = $type;\n\t}",
"public function getTopic()\n {\n return $this->_topic;\n }",
"public function createFromTopicRequest(TopicRequest $req): Topic\n {\n $topic = new Topic();\n $topic->setName($req->name)\n ->setAlias($req->alias)\n ->setStatus($req->status)\n ->setUser($req->user)\n ->setCategory($req->category)\n ->setContent($req->content)\n ->setImage($req->image)\n ->setSummary($req->summary)\n ->setWritingDate($req->writingDate);\n\n return $topic;\n }",
"function AddTopic()\n{\n global $context, $txt, $mbname, $db_prefix;\n\n // Check permission\n $a_add = allowedTo('smftags_add');\n\n if ($a_add == false)\n fatal_error($txt['cannot_smftags_add'],false);\n\n // get query results to build array of all tags\n $query = db_query(\"\n SELECT t.tag AS tag, t.ID_TAG AS ID_TAG, COUNT(l.ID_TAG) AS quantity, t.approved AS approved\n FROM {$db_prefix}tags AS t\n LEFT JOIN {$db_prefix}tags_log AS l ON t.ID_TAG = l.ID_TAG\n GROUP BY t.ID_TAG\n ORDER BY t.tag ASC\",\n __FILE__, __LINE__);\n\n $context['tags'] = array();\n while ($row = mysql_fetch_assoc($query))\n {\n $context['tags'][] = array(\n 'ID_TAG' => $row['ID_TAG'],\n 'tag' => $row['tag'],\n 'quantity' => $row['quantity'],\n 'approved' => $row['approved'],\n 'tagged' => 0,\n );\n }\n // don't load the subtemplate\n}",
"public function testActionMarkUnreadTopic()\n\t{\n\t\tglobal $board, $topic;\n\n\t\t$board = 1;\n\t\t$topic = 1;\n\n\t\t$req = HttpReq::instance();\n\t\t$req->query->t = 1;\n\n\t\t// Get the controller, call index\n\t\t$controller = new Markasread(new EventManager());\n\t\t$controller->setUser(User::$info);\n\t\t$result = $controller->action_marktopic_unread();\n\n\t\t// Check that result was set\n\t\t$this->assertEquals('board=1.0', $result, 'Result::' . $result);\n\t}",
"public function __construct(Topic $topic, Project $project, User $topicAuthor)\n {\n $this->topic = $topic;\n $this->project = $project;\n $this->topicAuthor = $topicAuthor;\n }",
"public function store(StoreTopicRequest $request)\n {\n// dd($user->ownsTopic(11));\n $result = Topic::create([\n 'user_id' => $request->user()->id,\n 'title' => trim($request->title),\n 'content' => $request->topic_content\n ]);\n if ($result){\n return response()->json([\n 'message' => '创建成功',\n 'data' => new TopicResource($result)\n ],201);\n }\n return response()->json([\n 'msg' => '服务器错误 创建失败'\n ],400);\n }",
"public function getTopic()\n {\n return $this->topic;\n }",
"public function create()\n {\n return view('admin.topic.create');\n }",
"public function getTopic();",
"public function getTopic();",
"public function store(TopicRequest $request)\n {\n Topic::create($request->validated());\n return $this->redirectRoutes('admin.topics.index', 'topic created successfully');\n }",
"public function __construct(Topic $topic, string $roomKey)\n {\n $this->topic = $topic;\n $this->format = $topic->format;\n $this->roomKey = $roomKey;\n }",
"public function setStatus(?int $status): Topic\n {\n $this->status = $status;\n return $this;\n }",
"public function create_topic() {\n $this->validate($this->request, [\n 'title' => 'required|string|max:255',\n 'is_guardian_blocked' => 'integer|min:0|max:1',\n 'status' => 'integer|min:0|max:1',\n 'is_featured' => 'integer|min:0|max:1',\n 'content' => 'string'\n ]);\n\n $is_guardian_blocked = 0;\n $is_featured = 0;\n $status = 0;\n\n $topic = new Topic;\n $topic->franchise_id = $this->franchise_id;\n $topic->club_id = $this->club_id;\n $topic->title = $this->request['title'];\n\n if( isset($this->request['is_guardian_blocked']) && !empty($this->request['is_guardian_blocked']) ) {\n $is_guardian_blocked = $this->request['is_guardian_blocked'];\n }\n\n if( isset($this->request['status']) && !empty($this->request['status']) ) {\n $status = $this->request['status'];\n }\n\n if( isset($this->request['is_featured']) && !empty($this->request['is_featured']) ) {\n $is_featured = $this->request['is_featured'];\n }\n\n if( isset($this->request['content']) && !empty($this->request['content']) ) {\n $topic->content = $this->request['content'];\n }\n\n $topic->is_guardian_blocked = $is_guardian_blocked;\n $topic->is_featured = $is_featured;\n $topic->created_by = $this->user_id;\n $topic->status = $status;\n\n $topic->save();\n\n return response()->json($topic, 200);\n }",
"public function setTopicIds(array $value): GetTopics\n {\n $this->topicIds = $value;\n return $this;\n }",
"public function handle(Topic $topic)\n {\n $this->info(\"开始执行加链接任务...\");\n\n $topic->autoLink();\n\n $this->info(\"完成加链接任务\");\n }",
"public function testTopic() {\n\n $this->installEntitySchema('ebms_board');\n $this->installEntitySchema('taxonomy_term');\n $this->installEntitySchema('ebms_topic');\n $this->installEntitySchema('user');\n $this->installSchema('system', ['sequences']);\n $entity_type_manager = $this->container->get('entity_type.manager');\n $topics = $entity_type_manager->getStorage('ebms_topic')->loadMultiple();\n $this->assertEmpty($topics);\n $name = 'Toenail Cancer';\n $board = Board::create(['name' => 'Test Board']);\n $board->save();\n $group_id = 135;\n $group_name = 'Lower Extremities';\n $topic_group = Term::create([\n 'tid' => $group_id,\n 'vid' => 'topic_groups',\n 'name' => $group_name,\n ]);\n $topic_group->save();\n $nci_reviewer = $this->createUser();\n $topic = Topic::create([\n 'name' => $name,\n 'board' => $board->id(),\n 'nci_reviewer' => $nci_reviewer,\n 'topic_group' => $topic_group->id(),\n 'active' => TRUE,\n ]);\n $topic->save();\n $topics = $entity_type_manager->getStorage('ebms_topic')->loadMultiple();\n $this->assertNotEmpty($topics);\n $this->assertCount(1, $topics);\n foreach ($topics as $topic) {\n $this->assertEquals($topic->getName(), $name);\n $this->assertEquals(TRUE, $topic->get('active')->value);\n $this->assertEquals($board->id(), $topic->get('board')->target_id);\n $this->assertEquals($nci_reviewer->id(), $topic->get('nci_reviewer')->target_id);\n $this->assertEquals($group_id, $topic->get('topic_group')->target_id);\n }\n }",
"public function publish_help_selling_data_topic(Request $request){\n Session::put('menu_item_parent', 'help');\n Session::put('menu_item_child', 'selling_data');\n Session::put('menu_item_child_child', 'selling_topics');\n\n $helpTopicIdx = $request->helpTopicIdx;\n $topic = HelpTopic::where('helpTopicIdx', $helpTopicIdx)->get()->first();\n $new['active'] = 1 - $topic->active;\n HelpTopic::where('helpTopicIdx', $helpTopicIdx)->update($new);\n Session::flash('flash_success', 'Help Selling Data has been published successfully');\n echo \"success\";\n }",
"public function setSubjectTitle(?string $value): void {\n $this->getBackingStore()->set('subjectTitle', $value);\n }",
"public function getTopic(): string\n {\n return $this->topic;\n }",
"public function update(Request $request, Topic $topic)\n {\n $request->validate([\n 'name' => ['required', 'string', 'min:3']\n ]);\n\n $input = request()->all();\n\n $topic->fill($input)->save();\n\n return response()->json(['data' => $topic], 201);\n }",
"public static function delete_topic( $id ) {\n\n\t\t\tglobal $wpdb;\n\n\n\n\t\t\t$wpdb->update(\n\n\t\t\t\t\"{$wpdb->prefix}js_topics\",\n\n\t\t\t\tarray(\n\n\t\t\t\t\t'is_active' => false\n\n\t\t\t\t),\n\n\t\t\t\tarray(\n\n\t\t\t\t\t'topic_id' => $id\n\n\t\t\t\t)\n\n\t\t\t);\n\n\n\n\t\t\t$wpdb->delete(\n\n\t\t\t\t\"{$wpdb->prefix}js_topic_subjects\",\n\n\t\t\t\tarray(\n\n\t\t\t\t\t'topic_id' => $id\n\n\t\t\t\t) \n\n\t\t\t);\n\n\t\t}",
"public function addTopicSubscription(TopicEntity $topic)\n {\n $topicSubscription = new TopicSubscriptionEntity($this, $topic);\n $this->topicSubscriptions->add($topicSubscription);\n }",
"public function destroy(Topic $topic)\n {\n //\n }",
"public function destroy(Topic $topic)\n {\n //\n }",
"public function createAction()\n {\n if ($this->getRequest()->isPost())\t\t\t//avoids direct access without having an ID pass\n {\n $this->view->title = ' - Thema';\n\n $this->view->topicID = $_POST[\"topicID\"];\t\t//sends topicID to view\n $this->view->topicName = $_POST[\"topicName\"];\t//sends topicName to view\n }\n else\n {\n $this->_redirect('/');\t\t\t\t//goes to mainpage\n }\n }",
"public function setSafeUri(){\n \t$sql=\"SELECT * FROM `topic` WHERE `type_topic` = 'm' limit 10000\";\n\t $res=$this->config_Class->query($sql,array());\n\t foreach($res as $key=>$value){\n\t\t if(is_int($key)){\n\t\t\t \t$sql=\"update topic set url_topic=:url where id_topic=:id\";\n\t\t\t $url=$this->config_Class->safeUri($value[\"name_topic\"]);\n\t\t\t $this->config_Class->query($sql,array(\":id\"=>$value[\"id_topic\"],\":url\"=>$url));\n\t\t }\n\t }\n\t \n }",
"public function subscribeToTopic(Request $request, $topic)\n {\n\n $validator = Validator::make($request->all(), [\n \"url\" => [\"required\", \"url\"]\n ]);\n\n if ($validator->fails()) {\n return response()->json(['errors' => $validator->errors()]);\n }\n\n $subscription = $this->subscriptionService->createSubscription($request->url, $topic);\n\n if($subscription[\"success\"])\n return response()->json(new CreateSubscriptionResource($subscription[\"data\"]));\n\n return response()->json($subscription, 201);\n }",
"public function create()\n {\n $topic = new Topic;\n return view('topics.create')->with(compact('topic'));\n }",
"public function getId_topic()\n {\n return $this->id_topic;\n }",
"public function publish_help_buying_data_topic(Request $request){\n Session::put('menu_item_parent', 'help');\n Session::put('menu_item_child', 'buying_data');\n Session::put('menu_item_child_child', 'buying_topics');\n $helpTopicIdx = $request->helpTopicIdx;\n $topic = HelpTopic::where('helpTopicIdx', $helpTopicIdx)->get()->first();\n $new['active'] = 1 - $topic->active;\n HelpTopic::where('helpTopicIdx', $helpTopicIdx)->update($new);\n echo \"success\";\n }",
"public function update_help_buying_data_topic(Request $request){\n Session::put('menu_item_parent', 'help');\n Session::put('menu_item_child', 'buying_data');\n Session::put('menu_item_child_child', 'buying_topics');\n if($request->helpTopicIdx==0){ \n $topic['page'] = \"buying\";\n $topic['title'] = $request->title;\n $topic['description'] = $request->description;\n $topic['meta_title'] = $request->meta_title;\n $topic['meta_description'] = $request->meta_description;\n $topic['active'] = $request->active;\n HelpTopic::create($topic);\n Session::flash('flash_success', 'Buying Help New Topic has been added successfully');\n }else{\n $topic['page'] = \"buying\";\n $topic['title'] = $request->title;\n $topic['description'] = $request->description;\n $topic['meta_title'] = $request->meta_title;\n $topic['meta_description'] = $request->meta_description;\n $topic['active'] = $request->active;\n HelpTopic::where('helpTopicIdx', $request->helpTopicIdx)->update($topic);\n Session::flash('flash_success', 'Buying Help Topic has been updated successfully');\n }\n return \"success\";\n }",
"function index(&$dm, &$indexer, $topic)\n {\n if (!is_object($topic))\n {\n $tmp = new midcom_db_topic($topic);\n if ( !$tmp\n || !$tmp->guid)\n {\n $_MIDCOM->generate_error(MIDCOM_ERRCRIT,\n \"Failed to load the topic referenced by {$topic} for indexing, this is fatal.\");\n // This will exit.\n }\n $topic = $tmp;\n }\n\n // Don't index directly, that would loose a reference due to limitations\n // of the index() method. Needs fixes there.\n\n $nav = new midcom_helper_nav();\n $node = $nav->get_node($topic->id);\n $author = $_MIDCOM->auth->get_user($dm->storage->object->creator);\n\n $document = $indexer->new_document($dm);\n $document->topic_guid = $topic->guid;\n $document->component = $topic->component;\n $document->topic_url = $node[MIDCOM_NAV_FULLURL];\n $document->read_metadata_from_object($dm->storage->object);\n $indexer->index($document);\n }",
"public function update(Request $request, Topic $topic)\n {\n $request->validate([\n 'name' => 'required',\n ]);\n\n if($topic->slug !== $request->slug){\n $request->validate([\n 'slug' => 'unique:topics,slug'\n ]);\n }\n\n $slug = ($request->slug) ? Str::slug($request->slug) : Str::slug($topic->slug);\n\n $topic->update([\n 'name' => $request->name,\n 'slug' => $slug\n ]);\n\n\n return redirect()->route('topics.index')->with('success', 'Topic updated successfully');\n }",
"protected function setSubject() {}",
"public function getTopic() {\n\t\treturn $this->_topic;\n\t}",
"public function onPush(Topic $topic, WampRequest $request, $data, $provider)\n {\n }",
"public function getTopic()\n {\n return $this->Topic;\n }",
"public function incForumTopicCount()\n {\n $dataMap = $this->forumNode()->dataMap();\n $incTopic = (int) $dataMap['topic_count']->content();\n $incTopic++;\n $dataMap['topic_count']->fromString( $incTopic );\n $dataMap['topic_count']->store();\n }"
] | [
"0.8297981",
"0.8098625",
"0.7583796",
"0.7419865",
"0.7158478",
"0.70537406",
"0.68039757",
"0.6673729",
"0.66236174",
"0.66169924",
"0.654617",
"0.6489596",
"0.6479176",
"0.6344155",
"0.63266975",
"0.625409",
"0.60751843",
"0.6046089",
"0.5858806",
"0.5834864",
"0.5829026",
"0.5757395",
"0.5729891",
"0.5677906",
"0.5677746",
"0.56742585",
"0.564064",
"0.5609232",
"0.5554375",
"0.5554375",
"0.55323476",
"0.5487137",
"0.54806507",
"0.54390347",
"0.5430161",
"0.54297316",
"0.5391564",
"0.5385283",
"0.5372992",
"0.5347657",
"0.53376895",
"0.53269625",
"0.53116286",
"0.52904564",
"0.5287965",
"0.52846915",
"0.52819866",
"0.52694744",
"0.52551466",
"0.5251163",
"0.52494735",
"0.5231457",
"0.52226067",
"0.5212385",
"0.521022",
"0.51977",
"0.51900077",
"0.5181941",
"0.5181087",
"0.5172434",
"0.5172431",
"0.51707053",
"0.51544404",
"0.51527673",
"0.51457876",
"0.51280504",
"0.51277447",
"0.5124695",
"0.5120699",
"0.5119338",
"0.5119338",
"0.5117706",
"0.51150507",
"0.5094088",
"0.5085418",
"0.50612444",
"0.50547826",
"0.5052776",
"0.5049466",
"0.5043656",
"0.5042365",
"0.502898",
"0.50272954",
"0.5025547",
"0.5024903",
"0.5024903",
"0.50223386",
"0.50120217",
"0.5009691",
"0.500917",
"0.50068414",
"0.5003503",
"0.5000259",
"0.49957561",
"0.49934733",
"0.49888444",
"0.49857974",
"0.49856853",
"0.49836743",
"0.4983502"
] | 0.61354357 | 16 |
Sets a new topicId | public function setTopicId($topicId)
{
$this->topicId = $topicId;
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setId_topic($id_topic)\n {\n $this->id_topic = $id_topic;\n\n return $this;\n }",
"public function setTopic($topic);",
"public function setTopic($topic)\n {\n $this->_topic = $topic;\n }",
"public function setTopic(TopicInterface $topic);",
"public function setTopic($topic, $updateFirstPost = true) {\n\t\tif ($topic == $this->topic) return;\n\t\t\n\t\t$this->topic = $topic;\n\t\t$sql = \"UPDATE \twbb\".WBB_N.\"_thread\n\t\t\tSET\ttopic = '\".escapeString($topic).\"'\n\t\t\tWHERE \tthreadID = \".$this->threadID;\n\t\tWCF::getDB()->registerShutdownUpdate($sql);\n\t\t\n\t\t// update the subject of the first post in this thread\n\t\tif ($updateFirstPost && $this->firstPostID) {\n\t\t\t$sql = \"UPDATE \twbb\".WBB_N.\"_post\n\t\t\t\tSET\tsubject = '\".escapeString($topic).\"'\n\t\t\t\tWHERE \tpostID = \".$this->firstPostID;\n\t\t\tWCF::getDB()->registerShutdownUpdate($sql);\n\t\t}\n\t}",
"public function declareTopic(string $topic): void;",
"public function setTopic($topic)\n {\n $this->topic = $topic;\n\n return $this;\n }",
"function setParentTopicId($parentTopicId) {\n\t\t$this->setData('parentTopicId', $parentTopicId);\n\t}",
"public function getTopicId()\n {\n return (int)$this->topic_id;\n }",
"public function getId_topic()\n {\n return $this->id_topic;\n }",
"public function set($new_id);",
"public function edit_topic( $topic_id ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'edit_topic', 'edit_group_forum_topic' ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'edit_group_forum_topic',\n\t\t\t\t$bp->loggedin_user->id,\n\t\t\t\t$this->prefs['edit_topic']['creds'],\n\t\t\t\t$this->prefs['edit_topic']['log'],\n\t\t\t\t$topic_id,\n\t\t\t\t'bp_ftopic',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}",
"public function update_topic($topic_id) {\n $this->validate($this->request, [\n 'title' => 'required|string|max:255',\n 'is_guardian_blocked' => 'required|integer|min:0|max:1',\n 'status' => 'required|integer|min:0|max:1',\n 'is_featured' => 'required|integer|min:0|max:1',\n 'content' => 'string'\n ]);\n\n $topic = Topic::find($topic_id);\n\n $topic->title = $this->request['title'];\n $topic->content = $this->request['content'];\n $topic->is_guardian_blocked = $this->request['is_guardian_blocked'];\n $topic->updated_by = $this->user_id;\n $topic->status = $this->request['status'];\n $topic->is_featured = $this->request['is_featured'];\n\n $topic->save();\n\n return response()->json($topic, 200);\n }",
"public function new_topic( $topic_id ) {\n\n\t\t\tglobal $bp;\n\n\t\t\t// Check if user should be excluded\n\t\t\tif ( $this->core->exclude_user( $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Limit\n\t\t\tif ( $this->over_hook_limit( 'new_topic', 'new_group_forum_topic' ) ) return;\n\n\t\t\t// Make sure this is unique event\n\t\t\tif ( $this->core->has_entry( 'new_group_forum_topic', $topic_id, $bp->loggedin_user->id ) ) return;\n\n\t\t\t// Execute\n\t\t\t$this->core->add_creds(\n\t\t\t\t'new_group_forum_topic',\n\t\t\t\t$bp->loggedin_user->id,\n\t\t\t\t$this->prefs['new_topic']['creds'],\n\t\t\t\t$this->prefs['new_topic']['log'],\n\t\t\t\t$topic_id,\n\t\t\t\t'bp_ftopic',\n\t\t\t\t$this->mycred_type\n\t\t\t);\n\n\t\t}",
"function SetId($value) { $this->id=$value; }",
"public function update_topic($data, $id){\n if(!$this->get_topic($id)){\n return false;\n }\n \n $this->db->where('id', $id);\n $this->db->update('pet_talk_topics', $data);\n }",
"function target_add_topic($topic)\n{\n\t// if ($GLOBALS['VERBOSE']) pf('...'. $topic['id']);\n\n\tif (!isset($topic['orderexpiry'])) {\n\t\t$topic['orderexpiry'] = 0;\n\t}\n\n\t// Set orderexpiry for announcement and sticky topics.\n\tif (($topic['thread_opt'] & 2) || ($topic['thread_opt'] & 4)) {\n\t\t$topic['orderexpiry'] = 1000000000;\n\t}\n\n\t// Skip topics that doesn't belong to a forum.\n\tif (!isset($GLOBALS['forum_map'][ (int)$topic['forum_id'] ])) {\n\t\tpf('WARNING: Skip topic #'. $topic['id'] .'. Probably an announcement or orphaned message!');\n\t\treturn;\n\t}\n\n\tq('INSERT INTO '. $GLOBALS['DBHOST_TBL_PREFIX'] .'thread (\n\t\tid, forum_id, root_msg_id, views, replies, thread_opt, orderexpiry\n\t\t) VALUES(\n\t\t\t'. (int)$topic['id'] .',\n\t\t\t'. $GLOBALS['forum_map'][ (int)$topic['forum_id'] ] .',\n\t\t\t'. (int)$topic['root_msg_id'] .',\n\t\t\t'. (int)$topic['views'] .',\n\t\t\t'. (int)$topic['replies'] .',\n\t\t\t'. (int)$topic['thread_opt'] .',\n\t\t\t'. (int)$topic['orderexpiry'] .')\n\t');\n}",
"public function __construct($topic_id,$thread_id)\n {\n $this->topic_id = $topic_id;\n $this->thread_id = $thread_id;\n }",
"public function updateTopic($id,$data){\n $data['id'] = $id;\n DB::transaction(function($data) use ($data) {\n try {\n $topic = $this->model->withTrashed()->findOrFail($data['id']);\n if(!$topic->trashed()) {\n $topic->tags()->decrement('topic_count');\n $flag = (int)$data['category_id'] == $topic->category_id;\n if (!$flag)\n $topic->category()->decrement('topic_count');\n $topic->fill($data)->save();\n $topic = $this->model->withTrashed()->findOrFail($data['id']);\n if (!$flag)\n $topic->category()->increment('topic_count');\n if(isset($data['tags'])){\n $topic->tags()->sync($data['tags']);\n $topic->tags()->increment('topic_count');\n }\n }else{\n $topic = $topic->save($data);\n if($data['tags'])\n $topic->tags()->sync($data['tags']);\n }\n\n }catch (Exception $e){\n throw $e;\n }\n });\n }",
"public function SetId ($id);",
"public function __construct(Topic $topic)\n {\n $this->topic = $topic;\n }",
"public function set_id($setid){\n $this->id = $setid;\n }",
"public function setTopic($channel, $topic)\n {\n return $this->method('setTopic', compact('channel', 'topic'));\n }",
"public function setId($id) {\n $this->set('id', $id, 'news');\n }",
"function addTopic(&$topic) {\n\t\t$this->topics[] = $topic;\n\t}",
"public function onTopic( $sTopic )\n\t{\n\t\t$this -> m_sTopic = $sTopic;\n\t}",
"public function setKbArticleId(?string $value): void {\n $this->getBackingStore()->set('kbArticleId', $value);\n }",
"public function setTopic($var)\n {\n GPBUtil::checkString($var, True);\n $this->Topic = $var;\n\n return $this;\n }",
"public function setForumId($a_obj_id)\n\t{\n\n\t\tif (!isset($a_obj_id))\n\t\t{\n\t\t\t$message = get_class($this).\"::setForumId(): No obj_id given!\";\n\t\t\t$this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);\t\n\t\t}\n\t\t\n\t\t$this->id = $a_obj_id;\n\t}",
"public function set_tyk_id($id) {\n\t\tupdate_user_meta($this->user->ID, self::META_TYK_USER_ID_KEY, $id);\n\t}",
"function resetTimer(ArrayObject $topics, $topic, $id) {\n $this->delTimer($topics, $id);\n $this->setTimer($topics, $topic, $id);\n }",
"function set_id($id) {\n\t\t$this->id = $id;\n\t}",
"function set_id($id)\n {\n $this->id = $id;\n }",
"public static function delete_topic( $id ) {\n\n\t\t\tglobal $wpdb;\n\n\n\n\t\t\t$wpdb->update(\n\n\t\t\t\t\"{$wpdb->prefix}js_topics\",\n\n\t\t\t\tarray(\n\n\t\t\t\t\t'is_active' => false\n\n\t\t\t\t),\n\n\t\t\t\tarray(\n\n\t\t\t\t\t'topic_id' => $id\n\n\t\t\t\t)\n\n\t\t\t);\n\n\n\n\t\t\t$wpdb->delete(\n\n\t\t\t\t\"{$wpdb->prefix}js_topic_subjects\",\n\n\t\t\t\tarray(\n\n\t\t\t\t\t'topic_id' => $id\n\n\t\t\t\t) \n\n\t\t\t);\n\n\t\t}",
"public function setTopicIds(array $value): GetTopics\n {\n $this->topicIds = $value;\n return $this;\n }",
"private function setID($id) {\r\n\t\t$this->id = $id;\r\n\t}",
"function setId($id) {\n\t\t$this->_id = $id;\n\t}",
"public function setId($id)\n {\n\n $this->idKey = $id;\n $this->context->element = $id;\n\n }",
"public function setId($id){\n $this->_id = $id;\n }",
"public function edit(Topic $topic)\n {\n }",
"function setId($id) {\r\n $this->_id = $id;\r\n }",
"public function setIdentifier($id)\n {\n $this->uid = (int)$id;\n }",
"public function set_id($id) {\n $this->_newid = preg_replace(\"/[^a-zA-Z0-9]/\", '', $id);\n }",
"public function setTicketId($newTicketId) {\n\t\t// zeroth, set allow the ticket id to be null if a new object\n\t\tif($newTicketId === null) {\n\t\t\t$this->ticketId = null;\n\t\t\treturn;\n\t\t}\n\n\t\t// first, ensure the ticket id is an integer\n\t\tif(filter_var($newTicketId, FILTER_VALIDATE_INT) === false) {\n\t\t\tthrow(new UnexpectedValueException(\"ticket id $newTicketId is not numeric\"));\n\t\t}\n\n\t\t// second, convert the ticket id to an integer and enforce it's positive\n\t\t$newTicketId = intval($newTicketId);\n\t\tif($newTicketId <= 0) {\n\t\t\tthrow(new RangeException(\"ticket id $newTicketId is not positive\"));\n\t\t}\n\n\t\t// finally, take the ticket id out of quarantine and assign it\n\t\t$this->ticketId = $newTicketId;\n\t}",
"public function setId($id)\n {\n $this->id = $id ? $id : uniqid();\n }",
"public function setId($var){\n\t\t$this->id=$var;\n\t}",
"public function notify_forum_new_topic( $topic_id ) {\n\t\t$this->notify_forum_topic_payload( 'create-topic', $topic_id );\n\t}",
"function setId($id) {\r\n\t\t$this->setAttributeNS(self :: TEXT, 'text:id', $id);\r\n\t}",
"public function set_id( $id ) {\n\t\t\t$this->id = $id;\n\t\t}",
"public function setMessageId($newMessageId) {\n\t//base case: if the message id is null, this a new message without a mySQL assigned id (yet)\n\tif($newMessageId === null) {\n\t\t$this->messageId = null;\n\t\treturn;\n\t}\n\t//verify the message id is valid\n\t$newMessageId = filter_var($newMessageId, FILTER_VALIDATE_INT);\n\tif($newMessageId === false) {\n\t\tthrow(new InvalidArgumentException(\"message id is not a valid integer\"));\n\t}\n\t//verify the message id is positive\n\tif($newMessageId <= 0) {\n\tthrow(new RangeException(\"message id is not positive\"));\n\t}\n\t//convert and store the message id\n\t$this->messageId = intval($newMessageId);\n}",
"public function setSettingsId($value)\n {\n $this->_settingsId = $value;\n }",
"private function setId($id)\n {\n $this->id = $id;\n }",
"public function edit(Topic $topic)\n {\n //\n }",
"public function edit(Topic $topic)\n {\n //\n }",
"public function register(Topic $topic);",
"public function setId($id)\n {\n $this->_id = $id;\n }",
"public function setId($id) {\r\n $this->_id = $id;\r\n }",
"function setId($id) {\n $this->id = $id;\n }",
"function setId($id) {\n $this->id = $id;\n }",
"public function set_id($id){\n $this->id = $id;\n }",
"function setId($id)\n {\n $this->id = $id;\n }",
"function webnotik_register_topics_settings() {\n\tregister_setting( 'webnotik-topics-group', 'webnotik_main_topics' );\n}",
"public function setId($id){\n\t\tself::$_id[get_class($this)] = $id;\n\t}",
"function setId($id){\n\t\t$this->id = $id;\n\t}",
"public function setTopic(\\GoetasWebservices\\Client\\SalesforceEnterprise\\Sobject\\TopicType $topic)\n {\n $this->topic = $topic;\n return $this;\n }",
"public static function set($id)\n {\n self::$id = $id;\n }",
"public function setId($id)\n {\n $this->setIdExpert($id);\n }",
"function setId($id){\r\n\t\t$this->id = $id;\r\n\t}",
"public function setId($id){\n $this->_sub_cat_id = $id;\n }",
"public function update($id, $topic) {\n $check = DB::table('categories')->where('categories.hash', $topic)->first();\n if ($check === null) {\n return redirect (route('forum'));\n };\n DB::table('categories')->where('hash', $topic)->update(['view' => $check->view + 1]);\n return redirect ('/forum/'.$id.'/topic/'.$topic);\n }",
"private function set_id(int $id)\n {\n $this->_id = $id;\n }",
"public function testChannelsSetTopic()\n {\n }",
"public function setId($id) {\n $this->id = $id;\n }",
"public function setID($id) {\n $this->id = $id; \n }",
"public function setid($id)\n\t\t{\n\t\t\t$this->id = $id;\n\t\t}",
"public function setID($_id) \n\t{\n\t\t$this->_id = $_id;\n\t}",
"public function setId($id){\n\t\t$this->id = $id;\n\t}",
"protected function setId($id)\n {\n $this->id = $id;\n }",
"public function setForumRefId($a_ref_id)\n\t{\n\t\tif (!isset($a_ref_id))\n\t\t{\n\t\t\t$message = get_class($this).\"::setForumRefId(): No ref_id given!\";\n\t\t\t$this->ilias->raiseError($message,$this->ilias->error_obj->WARNING);\t\n\t\t}\n\t\t\n\t\t$this->ref_id = $a_ref_id;\n\t}",
"public function setId($id)\r\n\t\t{\r\n\t\t\t$this->_id = $id;\r\n\t\t}",
"public function setId($id) {\n\t\t$this->id = $id;\n\t}",
"public function setId($id) {\n\t\t$this->id = $id;\n\t}",
"public function setId($id) {\n\t\t$this->id = $id;\n\t}",
"public function setId($id) {\n\t\t$this->id = $id;\n\t}",
"public 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 setArticleId($articleId) {\r\n\t\tif (Config::getVar('debug', 'deprecation_warnings')) trigger_error('Deprecated function.');\r\n\t\treturn $this->setSubmissionId($articleId);\r\n\t}",
"public function setId($id) \n {\n $this->id = $id;\n }",
"public function setId($id){\n $this->id = (string) $id;\n }",
"function setId($id)\n\t{\n\t\t// Set id\n\t\t$this->_id\t = $id;\n\t}",
"public function setId($id)\n {\n $this->id = $id;\n }",
"function markTopicRead($forumID, $topicID) {\n\t\tglobal $DB;\n\t\t\n\t\t// Pull our read topics information so we can work with it\n\t\t$topicsRead = getTopicsReadArray($forumID);\n\t\t\t\n\t\t// Kill our read row in the DB\n\t\t$sql = \"DELETE FROM `\" . DBTABLEPREFIX . \"topics_read` WHERE user_id='\" . $_SESSION['userid'] . \"' AND forum_id='\" . $forumID . \"' LIMIT 1\";\n\t\t$result = $DB->query($sql);\n\t\t\n\t\t// Set this topic read time to right now\n\t\t$topicsRead[$topicID] = time();\n\t\t\n\t\t// Clean out any bad topics (they were probably deleted\n\t\t$topicsRead = array_filter($topicsRead, \"topicExists\");\n\t\t\t\n\t\t// We disable this since we don't want to escape our topic_ids field\n\t\t// Dont escape since this method does that, double escape isn't fun\n\t\t//$result = $DB->query_insert(\"topics_read\", array('user_id' => $_SESSION['userid'], 'forum_id' => $forumID, 'topic_ids' => serialize($topicsRead)));\n\t\t\n\t\t// Warp everything up and save it\n\t\t$sql = \"INSERT INTO `\" . DBTABLEPREFIX . \"topics_read` (user_id, forum_id, topic_ids) VALUES ('\" . $_SESSION['userid'] . \"', '\" . $forumID . \"', '\" . serialize($topicsRead) . \"')\";\n\t\t$result = $DB->query($sql);\n\t}",
"public function setID($id){\n $this->id = $id;\n }",
"public function setID($_id) \n \t{\n \t\t$this->_id = $_id;\n \t}",
"protected function setInternalIdentifier($id)\n {\n $this->_id = $id;\n }",
"public function setSubTopic(array $topic)\n {\n if (!isset($topic['name'])) {\n throw new BusinessException('Subscribe topic name need');\n }\n if (!isset($topic['qos']) || !in_array($topic['qos'], $this->validQos)) {\n throw new BusinessException('Invalid qos');\n }\n $this->subTopics[] = $topic;\n }",
"public function setId( $id ) {\n\t\t$this->id = $id;\n\t}",
"public function setId( $id ) {\n\t\t$this->id = $id;\n\t}",
"public function setId($id) {\r\n $this->id = $id;\r\n }",
"public function setId($id) {\r\n $this->id = $id;\r\n }"
] | [
"0.742325",
"0.7124564",
"0.6980746",
"0.63163996",
"0.6303894",
"0.6198205",
"0.60637605",
"0.60458624",
"0.6034468",
"0.5973513",
"0.59578633",
"0.5847055",
"0.58254355",
"0.5784297",
"0.5778295",
"0.57600415",
"0.5669051",
"0.56546706",
"0.5641837",
"0.5631433",
"0.5597574",
"0.55813414",
"0.5559613",
"0.55516666",
"0.555081",
"0.55338395",
"0.5504707",
"0.5499782",
"0.5477614",
"0.54774004",
"0.546668",
"0.54584485",
"0.54194313",
"0.5412645",
"0.54079235",
"0.54067755",
"0.5393158",
"0.5388876",
"0.5369436",
"0.5361296",
"0.5360729",
"0.5360573",
"0.5348849",
"0.5348802",
"0.5347319",
"0.5345986",
"0.53291863",
"0.5316866",
"0.5316539",
"0.5316015",
"0.53082305",
"0.5298026",
"0.52956265",
"0.52956265",
"0.5294635",
"0.52906597",
"0.52813476",
"0.5272708",
"0.5272708",
"0.5266528",
"0.52632535",
"0.52446306",
"0.5242227",
"0.52385825",
"0.5237061",
"0.5235235",
"0.5226342",
"0.52238333",
"0.5205406",
"0.52033275",
"0.52023613",
"0.5200872",
"0.5199594",
"0.51961523",
"0.5194265",
"0.51910853",
"0.51899254",
"0.51826775",
"0.5176451",
"0.5171178",
"0.5168819",
"0.5168819",
"0.5168819",
"0.5168819",
"0.5168819",
"0.5167556",
"0.51648664",
"0.5160157",
"0.515985",
"0.515976",
"0.5158696",
"0.51564705",
"0.5156289",
"0.5145227",
"0.5145124",
"0.51408625",
"0.51408154",
"0.51408154",
"0.51399267",
"0.51399267"
] | 0.6424065 | 3 |
collect reward points that customer earned (per each item and address) total | public function collect(Mage_Sales_Model_Quote_Address $address)
{
$quote = $address->getQuote();
$_giftWrapHelper = Mage::helper('securedcheckout/checkout_giftwrap');
if ($quote->isVirtual() && $address->getAddressType() == 'shipping') {
return $this;
}
if (!$quote->isVirtual() && $address->getAddressType() == 'billing') {
return $this;
}
$session = Mage::getSingleton('checkout/session');
if (!$_giftWrapHelper->isEnabled($quote->getStoreId()) || !$session->getData('is_used_giftwrap')) {
return $this;
}
if ($quote->isVirtual()) {
$address = $quote->getBillingAddress();
} else {
$address = $quote->getShippingAddress();
}
$giftWrapBaseAmount = $_giftWrapHelper->getGiftWrapAmount($quote);
$giftWrapAmount = $quote->getStore()->convertPrice($giftWrapBaseAmount);
if ($giftWrapAmount > 0) {
$address->setMcGiftwrapBaseAmount($giftWrapBaseAmount);
$address->setMcGiftwrapAmount($giftWrapAmount);
$address->setBaseGrandTotal($address->getGrandTotal() + $giftWrapBaseAmount);
$address->setGrandTotal($address->getGrandTotal() + $giftWrapAmount);
}
Mage::dispatchEvent('securedcheckout_collect_total_giftwrap_before', array(
'address' => $address,
));
return $this;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function recordPointsForOrderEvent($observer){\n\t\tif(Mage::getStoreConfig('rewardpointspro/rewardpointspro/enabled')&& Mage::getStoreConfig('rewardpointspro/display/product_rewards')){ \n\t\t\t$order = $observer->getEvent()->getOrder();\n\t\t\t$items =$order->getItemsCollection();\n\t\t\t$customer_id_from_event = $order->getCustomerId();\n\t\t\t$customerId = Mage::getSingleton('checkout/session')->getQuote()->getShippingAddress()->getCustomerId();\n\t\t\t$rewardPoints = 0;\n\t\t\t$prodIds = array();\n\t\t\tforeach ($items as $_item) {\n\t\t\t\t$prodIds[] = $_item->getProductId();\n\t\t\t}\n\t\t\t$prod = Mage::getResourceModel('catalog/product_collection')->addAttributeToSelect('reward_points_pro')->addIdFilter($prodIds);\n\t\t\t//sum up points per product per quantity\n\t\t\tforeach ($items as $_item) {\n\t\t\t$rewardPoints += $prod->getItemById($_item->getProductId())->getRewardPointsPro() * $_item->getQtyOrdered();\n\t\t\t}\n\t\t\t//record points for item into db\n\t\t\t$this->recordPoints($rewardPoints, $customerId);\n\t\t\t$discounted = Mage::getSingleton('customer/session')->getApplyPoints();\n\t\t\t//subtract points for this order\n\t\t\t$this->useCouponPoints($discounted, $customerId); \n\t\t \n\t\t}\n\t\tMage::getSingleton('customer/session')->setdisc(0);\n\t}",
"public function mycred_pro_reward_order_points( $order_id ){\n\n\t\tif ( ! function_exists( 'mycred' ) ) return;\n\n\t\t// Get Order\n\t\t$order = wc_get_order( $order_id );\n\n\t\t$items_number = 0;\n\t\tforeach ( $order->get_items() as $item_id => $item ) {\n\t\t\t$quantity = $item->get_quantity();\n\t\t\t$items_number += $quantity;\n\t\t}\n\n\t\t// Load myCRED\n\t\t$mycred = mycred();\n\n\t\t// Do not payout if order was paid using points\n\t\tif ( $order->get_payment_method() == 'mycred' ) return;\n\n\t\tif ( ! $mycred ) return;\n\n\t\t// Make sure user only gets points once per order\n\t\tif ( $mycred->has_entry( 'reward', $order_id, $order->get_user_id() ) ) return;\n\n\t\t// Reward example 10 * order items in points.\n\t\t$reward = 10 * $items_number;\n\n\t\t// Add reward\n\t\t$mycred->add_creds(\n\t\t\t'reward',\n\t\t\t$order->get_user_id(),\n\t\t\t$reward,\n\t\t\t'Reward for store purchase',\n\t\t\t$order_id,\n\t\t\tarray( 'ref_type' => 'post' )\n\t\t);\n\t}",
"function points_vouchers()\n\t\t{\n\t\t\tif ( ! $this->data['user'])\n\t\t\t{\n\t\t\t\t$this->flexi_cart_admin->set_error_message('You must login to view reward points and vouchers.', 'public', TRUE);\n\t\t\t\tredirect('login');\n\t\t\t}\n\n\t\t\t$user_id = $this->data['user']->id;\n\n\t\t\t$this->load->library('flexi_cart_admin');\n\n\t\t\t$this->load->model('demo_cart_admin_model');\n\n\t\t\t// Check if POST data has been submitted, if so, call the custom demo model function to handle the submitted data.\n\t\t\tif ($this->input->post('convert_reward_points'))\n\t\t\t{\n\t\t\t\t$this->demo_cart_admin_model->demo_convert_reward_points($user_id);\n\t\t\t\t// Set a message to the CI flashdata so that it is available after the page redirect.\n\t\t\t\t$this->session->set_flashdata('message', $this->flexi_cart->get_messages());\n\t\t\t\tredirect(current_url());\n\t\t\t}\n\n\t\t\t$this->load->model('users_model');\n\n\t\t\t// Variable \"person\" is used because \"user\" is already being used for currently signed in user.\n\t\t\t$this->data['person'] = $this->users_model->get_details($user_id);\n\n\t\t\t// Get an array of all the reward vouchers filtered by the id in the url.\n\t\t\t// Using flexi cart SQL functions, join the demo user table with the discount table.\n\t\t\t$sql_where = array($this->flexi_cart_admin->db_column('discounts', 'user') => $user_id);\n\t\t\t// $this->flexi_cart_admin->sql_join('demo_users', 'user_id = '.$this->flexi_cart_admin->db_column('discounts', 'user'));\n\t\t\t$this->data['voucher_data_array'] = $this->flexi_cart_admin->get_db_voucher_query(FALSE, $sql_where)->result_array();\n\n\t\t\t// Get user remaining reward points.\n\t\t\t$summary_data = $this->flexi_cart_admin->get_db_reward_point_summary($user_id);\n\t\t\t$this->data['points_data'] = array(\n\t\t\t\t'total_points' => $summary_data[$this->flexi_cart_admin->db_column('reward_points', 'total_points')],\n\t\t\t\t'total_points_pending' => $summary_data[$this->flexi_cart_admin->db_column('reward_points', 'total_points_pending')],\n\t\t\t\t'total_points_active' => $summary_data[$this->flexi_cart_admin->db_column('reward_points', 'total_points_active')],\n\t\t\t\t'total_points_active' => $summary_data[$this->flexi_cart_admin->db_column('reward_points', 'total_points_active')],\n\t\t\t\t'total_points_expired' => $summary_data[$this->flexi_cart_admin->db_column('reward_points', 'total_points_expired')],\n\t\t\t\t'total_points_converted' => $summary_data[$this->flexi_cart_admin->db_column('reward_points', 'total_points_converted')],\n\t\t\t\t'total_points_cancelled' => $summary_data[$this->flexi_cart_admin->db_column('reward_points', 'total_points_cancelled')]\n\t\t\t);\n\n\t\t\t// Get an array of a demo user and their related reward points from a custom demo model function, filtered by the id in the url.\n\t\t\t$reward_data = $this->demo_cart_admin_model->demo_reward_point_summary($user_id);\n\t\t\t\n\t\t\t// Note: The custom function returns a multi-dimensional array, of which we only need the first array, so get the first row '$user_data[0]'.\n\t\t\t$this->data['reward_data'] = $reward_data[0];\n\n\t\t\t// Get the conversion tier values for converting reward points to vouchers.\n\t\t\t$conversion_tiers = $this->data['reward_data'][$this->flexi_cart_admin->db_column('reward_points', 'total_points_active')];\n\t\t\t$this->data['conversion_tiers'] = $this->flexi_cart_admin->get_reward_point_conversion_tiers($conversion_tiers);\n\n\t\t\t// Get an array of all reward points for a user.\n\t\t\t$sql_select = array(\n\t\t\t\t$this->flexi_cart_admin->db_column('reward_points', 'order_number'),\n\t\t\t\t$this->flexi_cart_admin->db_column('reward_points', 'description'),\n\t\t\t\t$this->flexi_cart_admin->db_column('reward_points', 'order_date')\n\t\t\t);\t\n\t\t\t$sql_where = array($this->flexi_cart_admin->db_column('reward_points', 'user') => $user_id);\n\t\t\t$this->data['points_awarded_data'] = $this->flexi_cart_admin->get_db_reward_points_query($sql_select, $sql_where)->result_array();\n\t\t\t\n\t\t\t// Call a custom function that returns a nested array of reward voucher codes and the reward point data used to create the voucher.\n\t\t\t$this->data['points_converted_data'] = $this->demo_cart_admin_model->demo_converted_reward_point_history($user_id);\n\n\t\t\t// Get any status message that may have been set.\n\t\t\t$this->data['message'] = $this->session->flashdata('message');\n\n\t\t\t$this->load->view('public/dashboard/points_and_vouchers_view', $this->data);\n\t\t}",
"public function create_ubib_points($customer_id,$order_id,$total){\r\n $points = floor($total/10)*100;\r\n if($points>0){\r\n $this->language->load('total/reward'); \r\n $query = $this->db->query(\"INSERT INTO \" . DB_PREFIX . \"customer_reward SET customer_id = '\" . (int)$customer_id . \"', description = '\" . $this->db->escape(sprintf($this->language->get('text_order_id'), (int)$order_id)) . \"', points = '\" . (int)$points . \"', date_added = NOW()\");\r\n }\r\n \r\n //Convert to credits (1000 points => 1 credit)\r\n $query = $this->db->query(\"SELECT SUM(points) AS total FROM `\" . DB_PREFIX . \"customer_reward` WHERE customer_id = '\" . (int)$customer_id . \"' GROUP BY customer_id\");\r\n if ($query->row) {\r\n $credit = 0;\r\n $credit = floor($query->row['total']/1000); \r\n if($credit>0){\r\n $redeem_points = $credit * 1000;\r\n $this->db->query(\"INSERT INTO \" . DB_PREFIX . \"customer_transaction SET customer_id = '\" . (int)$customer_id . \"', order_id = '\" . (int)$order_id . \"', description = 'Converted \".$redeem_points.\" Points To \".$credit.\" Credits', amount = '\" . (float)$credit . \"', date_added = NOW()\");\r\n $query = $this->db->query(\"INSERT INTO \" . DB_PREFIX . \"customer_reward SET customer_id = '\" . (int)$customer_id . \"', description = 'Converted \".$redeem_points.\" Points To \".$credit.\" Credits', points = '\" . (float)-$redeem_points . \"', date_added = NOW()\");\r\n }\r\n }\r\n return true;\r\n }",
"protected function _totalBaseCalculation(Mage_Sales_Model_Quote_Address $address, $taxRateRequest)\n {\n $store_id = Mage::app()->getStore()->getId();\n if((int)Mage::helper('rewardpoints')->getRedeemPointsOnTax($store_id) == MW_RewardPoints_Model_Redeemtax::AFTER)\n {\n parent::_totalBaseCalculation($address, $taxRateRequest);\n\n return;\n }\n $items = $this->_getAddressItems($address);\n $store = $address->getQuote()->getStore();\n $taxGroups = array();\n $itemTaxGroups = array();\n $catalogPriceInclTax = $this->_config->priceIncludesTax($store);\n /** [Start] Rewardpoint added */\n $countItem = 0;\n foreach ($items as $item)\n {\n if($item->getParentItem())\n {\n continue;\n }\n $countItem++;\n }\n\n $pointToRdeem = Mage::getSingleton('core/session')->getMwRewardpointAfterDrop();\n $amountRedeem = Mage::helper('core')->currency(Mage::helper('rewardpoints')->exchangePointsToMoneys($pointToRdeem), false, false);\n $amountRedeemItem = $this->_calculator->round($amountRedeem / $countItem);\n\n $lastMemory = 0;\n $savedReedemItem = array();\n if($amountRedeem > 0)\n {\n foreach ($items as $item)\n {\n if($item->getParentItem())\n {\n continue;\n }\n\n if($item->getHasChildren() && $item->isChildrenCalculated())\n {\n continue;\n }\n else\n {\n $taxAmount = $item->getTaxableAmount();\n if($taxAmount < $amountRedeemItem + $lastMemory)\n {\n $lastMemory = $amountRedeemItem + $lastMemory - $taxAmount;\n $amountRedeemThisItem = $taxAmount;\n }\n else\n {\n $amountRedeemThisItem = $lastMemory + $amountRedeemItem;\n $lastMemory = 0;\n }\n $savedReedemItem[$item->getItemId()] = $amountRedeemThisItem;\n }\n }\n foreach ($items as $item)\n {\n if($item->getParentItem())\n {\n continue;\n }\n\n if($item->getHasChildren() && $item->isChildrenCalculated())\n {\n $amountRedeemChildItem = $this->_calculator->round(($amountRedeemItem + $lastMemory) / count($item->getChildren()));\n $lastMemoryChildren = 0;\n foreach ($item->getChildren() as $child)\n {\n $taxAmount = $child->getTaxableAmount();\n if($taxAmount < $amountRedeemChildItem + $lastMemoryChildren)\n {\n $lastMemoryChildren = $amountRedeemChildItem + $lastMemoryChildren - $taxAmount;\n $amountRedeemThisChild = $taxAmount;\n }\n else\n {\n $amountRedeemThisChild = $lastMemoryChildren + $amountRedeemChildItem;\n $lastMemoryChildren = 0;\n }\n $savedReedemItem[$child->getItemId()] = $amountRedeemThisChild;\n }\n }\n }\n }\n /** [End] Rewardpoint added */\n foreach ($items as $item)\n {\n if($item->getParentItem())\n {\n continue;\n }\n\n if($item->getHasChildren() && $item->isChildrenCalculated())\n {\n foreach ($item->getChildren() as $child)\n {\n $this->_totalBaseProcessItemTax(\n $child, $taxRateRequest, $taxGroups, $itemTaxGroups, $catalogPriceInclTax, (isset($savedReedemItem[$child->getItemId()])) ? $savedReedemItem[$child->getItemId()] : 0);\n }\n $this->_recalculateParent($item);\n }\n else\n {\n $this->_totalBaseProcessItemTax(\n $item, $taxRateRequest, $taxGroups, $itemTaxGroups, $catalogPriceInclTax, (isset($savedReedemItem[$item->getItemId()])) ? $savedReedemItem[$item->getItemId()] : 0);\n }\n }\n\n if($address->getQuote()->getTaxesForItems())\n {\n $itemTaxGroups += $address->getQuote()->getTaxesForItems();\n }\n $address->getQuote()->setTaxesForItems($itemTaxGroups);\n foreach ($taxGroups as $taxId => $data)\n {\n if($catalogPriceInclTax)\n {\n $rate = (float)$taxId;\n }\n else\n {\n $rate = $data['applied_rates'][0]['percent'];\n }\n\n $inclTax = $data['incl_tax'];\n\n $totalTax = array_sum($data['tax']);\n\n $baseTotalTax = array_sum($data['base_tax']);\n\n $this->_addAmount($totalTax);\n $this->_addBaseAmount($baseTotalTax);\n $totalTaxRounded = $this->_calculator->round($totalTax);\n $baseTotalTaxRounded = $this->_calculator->round($totalTaxRounded);\n $this->_saveAppliedTaxes($address, $data['applied_rates'], $totalTaxRounded, $baseTotalTaxRounded, $rate);\n }\n\n return $this;\n }",
"public function redeemAction(){\n $txtRedeemPoints = $_POST['txtRedeemPoints'];\n $quoteData = Mage::getSingleton('checkout/session')->getQuote();\n \n $CartContentsTotal = $quoteData['subtotal'];\n $CartTotal = $quoteData['grand_total'];\n \n if(!empty($txtRedeemPoints)){\n $LB_Session = $_SESSION['LB_Session'];\n if (!empty($LB_Session)) {\n // confirm loyalty points available or not and update to session if available.\n $CardOrPhoneNumber = $LB_Session['Phone Number'];\n $CardPoints = Lb_Points_Helper_Data::getCardPoints($CardOrPhoneNumber);\n $InquiryResult = $CardPoints->InquiryResult;\n $balances = $InquiryResult->balances;\n $Balance = $balances->balance;\n foreach ($Balance as $balValue) {\n if ($balValue->valueCode == 'Discount') {\n $_SESSION['LB_Session']['lb_discount'] = $balValue->amount;\n $_SESSION['LB_Session']['lb_discount_difference'] = $balValue->difference;\n $_SESSION['LB_Session']['lb_discount_exchangeRate'] = $balValue->exchangeRate;\n } elseif ($balValue->valueCode == 'Points') {\n $_SESSION['LB_Session']['lb_points'] = $balValue->amount;\n $_SESSION['LB_Session']['lb_points_difference'] = $balValue->difference;\n $_SESSION['LB_Session']['lb_points_exchangeRate'] = $balValue->exchangeRate;\n } elseif ($balValue->valueCode == 'ZAR') {\n $_SESSION['LB_Session']['lb_zar'] = $balValue->amount;\n $_SESSION['LB_Session']['lb_zar_difference'] = $balValue->difference;\n $_SESSION['LB_Session']['lb_zar_exchangeRate'] = $balValue->exchangeRate;\n }\n }\n Lb_Points_Helper_Data::debug_log(\"LB API called : Inquiry to check Points Balance\", true);\n \n $totalRedeemPoints = 0;\n if(isset($_SESSION['LB_Session']['totalRedeemPoints']))\n {\n if($_SESSION['LB_Session']['totalRedeemPoints'] > 0){\n $totalRedeemPoints = $_SESSION['LB_Session']['totalRedeemPoints'] + $txtRedeemPoints;\n }\n }\n \n if($totalRedeemPoints == 0){\n $totalRedeemPoints = $txtRedeemPoints;\n }\n \n if ($txtRedeemPoints > 0 && $totalRedeemPoints <= $CartTotal && is_numeric($txtRedeemPoints)) {\n \n if ($_SESSION['LB_Session']['lb_points'] >= $totalRedeemPoints) {\n //self::generate_discount_coupon($txtRedeemPoints, 'fixed_cart', 'REDEEM');\n if(isset($_SESSION['LB_Session']['totalRedeemPoints']))\n {\n if($_SESSION['LB_Session']['totalRedeemPoints'] > 0){\n $_SESSION['LB_Session']['totalRedeemPoints'] = $_SESSION['LB_Session']['totalRedeemPoints'] + $txtRedeemPoints;\n }\n else\n $_SESSION['LB_Session']['totalRedeemPoints'] = $txtRedeemPoints;\n }\n else\n {\n $_SESSION['LB_Session']['totalRedeemPoints'] = $txtRedeemPoints;\n }\n $message = \"You have redeemed \".$_SESSION['LB_Session']['totalRedeemPoints'].\" Loyalty Points successfully and applied discount to your cart.\";\n $messageJson = \"You have redeemed \".$_SESSION['LB_Session']['totalRedeemPoints'].\" Loyalty Points successfully and discount is being applied to your cart.\";\n Mage::getSingleton('core/session')->addSuccess($message);\n echo json_encode(array('status' => 1, 'message' => $messageJson));\n }else {\n echo json_encode(array('status' => 0, 'message' => \"You don't have sufficient Loyalty Points to redeem.\"));\n }\n } else {\n echo json_encode(array('status' => 0, 'message' => \"Please enter valid Loyalty Points.\"));\n }\n }\n else\n echo json_encode(array('status' => 0, 'message' => Lb_Points_Helper_Data::$rewardProgrammeName.\" session expired.\"));\n }\n else\n echo json_encode(array('status' => 0, 'message' => \"Please enter loyalty points.\"));\n die;\n }",
"public function getSumma()\n {\n $summa = 0;\n\n foreach ($purchases as $purchase) {//place for future comments\n\n if($purchase->status_bought == 1)\n {\n\n if($purchase->first()->book->author->status_discont_id == 1 && $purchase->first()->book->discont_privat != 0 && $purchase->magazin->author->status_discont_id == 1 && $purchase->magazin->discont_privat != 0)\n\n {//\n\n if (round($purchase->first()->book->discont_global,2) >= round($purchase->first()->book->author->discont_id,2) && round($purchase->magazin->discont_global,2) >= round($purchase->magazin->author->discont_id,2)) \n\n {//\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->discont_global / 100)) * $purchase->qty + ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->discont_global / 100)) * $purchase->qty_m;\n\n } elseif(round($purchase->first()->book->discont_global,2) <= round($purchase->first()->book->author->discont_id,2) && round($purchase->magazin->discont_global,2) <= round($purchase->magazin->author->discont_id,2))\n\n {//\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->author->discont_id / 100)) * $purchase->qty + $purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->author->discont_id / 100)) * $purchase->qty_m;\n\n } elseif (round($purchase->first()->book->discont_global,2) >= round($purchase->first()->book->author->discont_id,2) && round($purchase->magazin->discont_global,2) <= round($purchase->magazin->author->discont_id,2))\n\n {//\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->discont_global / 100)) * $purchase->qty + $purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->author->discont_id / 100)) * $purchase->qty_m;\n\n } elseif (round($purchase->first()->book->discont_global,2) <= round($purchase->first()->book->author->discont_id,2) && round($purchase->magazin->discont_global,2) >= round($purchase->magazin->author->discont_id,2))\n\n {//\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->author->discont_id / 100)) * $purchase->qty + ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->discont_global / 100)) * $purchase->qty_m;\n\n } elseif (round($purchase->first()->book->discont_global,2) >= round($purchase->first()->book->author->discont_id,2))\n\n {//\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->discont_global / 100)) * $purchase->qty + $purchase->magazin->price * $purchase->qty_m;//\n\n } elseif (round($purchase->first()->book->discont_global,2) <= round($purchase->first()->book->author->discont_id,2))\n\n {//\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->author->discont_id / 100)) * $purchase->qty + $purchase->magazin->price * $purchase->qty_m;\n\n } elseif (round($purchase->magazin->discont_global,2) >= round($purchase->magazin->author->discont_id,2))\n\n {//\n\n $summa += ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->discont_global / 100)) * $purchase->qty_m + $purchase->first()->book->price * $purchase->qty;\n\n } elseif (round($purchase->magazin->discont_global,2) <= round($purchase->magazin->author->discont_id,2))\n\n {//\n\n $summa += ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->author->discont_id / 100)) * $purchase->qty_m + $purchase->first()->book->price * $purchase->qty;\n\n }\n\n // \n } elseif($purchase->first()->book->discont_privat != 0 && $purchase->magazin->discont_privat != 0)\n\n {//\n if($purchase->first()->book->discont_privat != 0) \n\n {//\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->discont_global / 100)) * $purchase->qty + $purchase->magazin->price * $purchase->qty_m;\n\n\n }\n\n elseif($purchase->magazin->discont_privat != 0) \n\n {//\n\n $summa += ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->discont_global / 100)) * $purchase->qty_m + $purchase->first()->book->price * $purchase->qty;\n\n }\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->discont_global / 100)) * $purchase->qty + ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->discont_global / 100)) * $purchase->qty_m;\n\n //\n } elseif($purchase->first()->book->author->status_discont_id == 1 && $purchase->magazin->author->status_discont_id == 1)\n\n {//\n\n if($purchase->first()->book->author->status_discont_id == 1) \n\n {//\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->author->discont_id / 100)) * $purchase->qty + $purchase->magazin->price * $purchase->qty_m;\n\n }\n elseif($purchase->magazin->author->status_discont_id == 1) \n\n {//\n\n $summa += ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->author->discont_id / 100)) * $purchase->qty_m + $purchase->first()->book->price * $purchase->qty;\n\n }\n\n $summa += ($purchase->first()->book->price - ($purchase->first()->book->price * $purchase->first()->book->author->discont_id / 100)) * $purchase->qty + ($purchase->magazin->price - ($purchase->magazin->price * $purchase->magazin->author->discont_id / 100)) * $purchase->qty_m;\n\n // \n } else \n\n {//\n\n $summa += $purchase->first()->book->price * $purchase->qty + $purchase->magazin->price * $purchase->qty_m;\n\n }\n } \n\n }\n return $summa;\n\n }",
"private function getTotalFrequentRenterPoints() {\n $result = 0;\n\n foreach ($this->rentals as $rental){\n $result += $rental->getFrequentRenterPoints();\n }\n return $result;\n }",
"public function getTotalPoints() {\n $points = $this->getPoints() ?? 0;\n return $points + $this->bonusPoints;\n }",
"public function calculateReward(int $year, int $month = null): array\n {\n $whereClause = [\n ['achieved', true],\n ['agency_rewards_program.rewards_program_id', RewardsProgram::MONTHLY_SERVICE_EXCELLENCE_ID]\n ];\n if ($year) {\n $whereClause[] = ['year', $year];\n }\n if ($month) {\n $whereClause[] = ['month', $month];\n }\n $selectClause = \"agencies.name AS agency, COUNT(*) * ? AS reward\";\n\n $agencyRewards = $this->serviceExcellence\n ::selectRaw($selectClause, [self::REWARD_FEE])\n ->join('agencies', 'agencies.id', '=', 'service_excellences.agency_id')\n ->join('agency_rewards_program', 'agency_rewards_program.agency_id', 'agencies.id')\n ->where($whereClause)\n ->groupBy('service_excellences.agency_id')\n ->get();\n\n return $agencyRewards->toArray();\n }",
"public function addCredits($observer)\n{ \n\n$creditmemo = $observer->getCreditmemo();\n//Mage::log($creditmemo);\n//Mage::log($creditmemo->getBaseGrandTotal());\n $order = $creditmemo->getOrder();\n//Mage::log($order);\n$store_id = $order->getStoreId();\n$website_id = Mage::getModel('core/store')->load($store_id)->getWebsiteId();\n$website = Mage::app()->getWebsite($website_id); \n//Mage::log( $website->getName());\n$sName = Mage::app()->getStore($store_id)->getName();\n//Mage::log( $sid);\n//Mage::log(Mage::getSingleton('adminhtml/session')->getTotal()['status']);\n\n\nif (Mage::helper('kartparadigm_storecredit')->getRefundDeductConfig())\n{\n // Deduct the credits which are gained at the time of invoice\n\n $credits = array(); \n $currentTimestamp = Mage::getModel('core/date')->timestamp(time()); \n $nowdate = date('Y-m-d H:m:s', $currentTimestamp);\n $credits['c_id'] = $order->getCustomerId();\n $credits['order_id'] = $order->getIncrementId();\n $credits['website1'] = 'Main Website';\n $credits['store_view'] = $sName;\n $credits['action_date'] = $nowdate;\n $credits['action'] = \"Deducted\";\n $credits['customer_notification_status'] = 'Notified';\n $credits['state'] = 1; \n //$credits['custom_msg'] = 'By admin : Deducted the Credits of the Order ' . $credits['order_id'] ;\n\n foreach ($creditmemo->getAllItems() as $item) {\n $orderItem = Mage::getResourceModel('sales/order_item_collection'); \n $orderItem->addIdFilter($item->getOrderItemId()); \n $data = $orderItem->getData();\n\n //Mage::log($data);\n $credits['action_credits'] = - ($data[0]['credits'] * $item->getQty());\n\n $collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection()->addFieldToFilter('c_id',$order->getCustomerId())->addFieldToFilter('website1','Main Website')->getLastItem();\n\n $totalcredits = $collection->getTotalCredits();\n $credits['total_credits'] = $totalcredits + $credits['action_credits'] ;\n $credits['custom_msg'] = \"By User:For Return The Product \" .$item->getName().\" For Quantity \" . round($item->getQty()) ; //Custom Message\n $credits['item_id'] = $item->getOrderItemId();\n $table1 = Mage::getModel('kartparadigm_storecredit/creditinfo');\n $table1->setData($credits);\n try{\n if($credits['action_credits'] != 0)\n $table1->save();\n }catch(Exception $e){\n Mage::log($e);\n }\n }\n\n// End Deduct the credits which are gained at the time of invoice\n\n}\n//end\n$status = array();\n$status = Mage::getSingleton('adminhtml/session')->getTotal(); \nif($status['status'] == 1)\n { \n\n $val = array(); \n \n \n $val['c_id'] = $order->getCustomerId();\n \n $val['order_id'] = $order->getIncrementId();\n \n $val['website1'] = $website->getName();\n \n $val['store_view'] = $sName;\n \n\n$collection = Mage::getModel('kartparadigm_storecredit/creditinfo')->getCollection()->addFieldToFilter('c_id',$val['c_id'])->addFieldToFilter('website1',$val['website1'])->getLastItem();\n $currentCurrencyRefund1 = array();\n $currentCurrencyRefund1 = Mage::getSingleton('adminhtml/session')->getTotal();\n $currentCurrencyRefund = $currentCurrencyRefund1['credits'];\n/*------------------------Convert Current currency(refunded amount is current currency) to credit points-------------- */\n$baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();\n $currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();\n$baseCurrency;\nif ($baseCurrencyCode != $currentCurrencyCode) {\n \n$allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();\n$rates = Mage::getModel('directory/currency')->getCurrencyRates($baseCurrencyCode, array_values($allowedCurrencies));\n\n$baseCurrency = $currentCurrencyRefund/$rates[$currentCurrencyCode];\n\n }\nelse{\n $baseCurrency = $currentCurrencyRefund;\n }\n$array2 = Mage::helper('kartparadigm_storecredit')->getCreditRates();\n//$amt1 = ($array2['basevalue'] * $amt) / $array2['credits'];\nif(isset($array2)){\n$refundCredits = round(($array2['credits'] * $baseCurrency) / $array2['basevalue']); \n}\nelse{\n$refundCredits = round($baseCurrency);\n}\n/*---------------------end------------------ */\n $val['action_credits'] = $refundCredits;\n $val['total_credits'] = $collection->getTotalCredits() + $refundCredits;\n $val['action_date'] = $nowdate; \n $val['action'] = \"Refunded\";\n $val['custom_msg'] = 'By admin : return product by customer to the order ' . $val['order_id'] ;\n $val['customer_notification_status'] = 'Notified'; \n $val['state'] = 0;\n//Mage::getSingleton('adminhtml/session')->unsTotal();\n$model = Mage::getSingleton('kartparadigm_storecredit/creditinfo');\n//Mage::log($creditmemo->getDiscountAmount());\n//Mage::log($creditmemo->getDiscountDescription());\n//checking \nif($creditmemo->getDiscountDescription() == \"Store Credits\"){\n$total = $creditmemo->getGrandTotal() - ($creditmemo->getDiscountAmount());\n}\nelse{\n$total = $creditmemo->getGrandTotal();\n}\n$model->setData($val);\ntry{\nif($total >= $currentCurrencyRefund){\nif( $currentCurrencyRefund > 0)\n{\n\n$model->save();\n\n}\n}\nelse{\n\nMage::getSingleton('adminhtml/session')->setErr('true');\n\n}\n\n} catch(Mage_Core_Exception $e){\n//Mage::log($e);\n}\n\n}\n}",
"function setReward($points, $rewardArray, $name, $email){\n\t\tif(($rewardArray['500'] != 500) && ($points >= 500)){ //one time award at 500 points\n\t\t\t$rewardArray['100'] += 100;\n\t\t\t$reward = \"100 => \".$rewardArray['100'].\", 250 => \".$rewardArray['250'].\", 500 => 500\";\n\t\t\t$sql = \"UPDATE users SET reward = '$reward' \";\n\t\t\t$result = $this->db->query($sql);\n\n\t\t\t$code = 'Chat_'.RandomString(10);\n\t\t\t$ckey = '';\n\n\t\t\t$this->createCoupon($code, $ckey, $email);\n\t\t\t$this->sendReward('Have an interview with our expert staff and be highlighted on our blog and homepage.', $name, $email, $code);\n\t\t} elseif($points >= $rewardArray['100']){ // every 100\n\t\t\t$rewardArray['100'] += 100;\n\t\t\t$reward = \"100 => \".$rewardArray['100'].\", 250 => \".$rewardArray['250'].\", 500 =>\".$rewardArray['500'];\n\t\t\t$sql = \"UPDATE users SET reward = '$reward' \";\n\t\t\t$result = $this->db->query($sql);\n\n\t\t\t$code = 'rew_'.RandomString(16);\n\t\t\t$ckey = 6;\n\n\t\t\t$this->createCoupon($code, $ckey, $email);\n\t\t\t$this->sendReward('20% off any single non-sale item', $name, $email, $code); \n\t\t}\n\t\t\n\t\tif($points > $rewardArray['250']){ //every 250\n\t\t\t$rewardArray['250'] += 250;\n\t\t\t$reward = \"100 => \".$rewardArray['100'].\", 250 => \".$rewardArray['250'].\", 500 =>\".$rewardArray['500'];\n\t\t\t$sql = \"UPDATE users SET reward = '$reward' \";\n\t\t\t$result = $this->db->query($sql);\n\n\t\t\t$code = 'rew_'.RandomString(16);\n\t\t\t$ckey = 2;//free shipping coupon\n\n\t\t\t$this->createCoupon($code, $ckey, $email);\n\t\t\t$this->sendReward('Free Ground shipping for US domestic or $10 off intenational shipping', $name, $email, $code);\n\t\t}\n\t\t\n\t}",
"public function reward(): Collection\n {\n return $this->get('api/blocks/getReward');\n }",
"public function redeembivapoints($orderId){\n\t\t$this->db->where('CustomerMail', $this->session->userdata('useremail'));\n\t\t$this->db->select_sum('EarnedPotint');\n\t\t$this->db->from('tbl_bvpoint_data');\n\t\t$query = $this->db->get();\n\t\t$sumvalue=$query->row()->EarnedPotint;\n\t\t//echo $sumvalue;\n\t\tif($sumvalue>100){\n\t\t\t$redeempoint=100;\n\t\t}\n\t\telse{\n\t\t\t$redeempoint=$sumvalue;\n\t\t}\n\n\t\t$redeempoint=-1*abs($redeempoint);\n\t\t$note=\"Purchased (#ORDBPH\".$orderId.\") And Redeemed \".$redeempoint.\" Biva Points\";\n\t\t$data=array(\n\t\t\t'CustomerMail' => $this->session->userdata('useremail'),\n\t\t\t'TrDate' => date('Y/m/d H:i:s'),\n\t\t\t'OrderId' => $orderId,\n\t\t\t'ReferedTo' => null,\n\t\t\t'EarnedPotint' => $redeempoint,\n\t\t\t'Note' => $note,\n\n\t\t);\n\t\t$this->db->insert('tbl_bvpoint_data', $data);\n\t}",
"public static function get_the_total_redeem_points_for_order($order) {\n $status = get_option('rs_order_status_control');\n global $wpdb;\n $table_name = $wpdb->prefix . 'rsrecordpoints';\n $orderid = $order->id;\n $gettotalredeempoints = $wpdb->get_results(\"SELECT redeempoints FROM $table_name WHERE orderid=$orderid\", ARRAY_A);\n $orderstatus = $order->post_status;\n if (is_array($status)) {\n foreach ($status as $statuses) {\n $statusstr = $statuses;\n }\n }\n $replacestatus = str_replace('wc-completed', $statusstr, $orderstatus);\n if (get_option('rs_enable_msg_for_redeem_points') == 'yes') {\n if (in_array($replacestatus, $status)) {\n $totalredeemvalue = \"\";\n $redeem_total = $gettotalredeempoints;\n if (is_array($redeem_total)) {\n foreach ($redeem_total as $key => $value) {\n $totalredeemvalue+=$value['redeempoints'];\n }\n $msgforredeempoints = get_option('rs_msg_for_redeem_points');\n $roundofftype = get_option('rs_round_off_type') == '1' ? '2' : '0';\n $replacemsgforredeempoints = str_replace('[redeempoints]', $totalredeemvalue != \"\" ? round($totalredeemvalue, $roundofftype) : \"0\", $msgforredeempoints);\n echo '<b>' . $replacemsgforredeempoints . '</b>';\n }\n }\n }\n }",
"public function total(){\n $total = $this->qualification + $this->referee_report + $this->interview;\n }",
"public function payForInvitedUsers(){\n \n $userService = parent::getService('user','user');\n \n $refererUsers = $userService->getUsersWithRefererNotPaid();\n foreach($refererUsers as $user):\n // if created at least 30 days ago\n if(strtotime($user['created_at'])>strtotime('-30 days')){\n continue;\n }\n // if logged within last 5 days ago\n if(!(strtotime($user['last_active'])>strtotime('-7 days'))){\n $user->referer_not_active = 1;\n $user->save();\n continue;\n }\n \n $values = array();\n $values['description'] = 'Referencing FastRally to user '.$user['username'];\n $values['income'] = 1;\n \n \n if($user['gold_member_expire']!=null){\n $amount = 100;\n }\n else{\n $amount = 10;\n }\n \n \n $userService->addPremium($user['referer'],$amount,$values);\n $user->referer_paid = 1;\n $user->save();\n endforeach;\n echo \"done\";exit;\n }",
"public function get_loyalty_earned_details($userId, $startDate=\"\", $endDate=\"\") {\n \n # Points calculation \n $reviews_points = 1;\n $product_shares_points = 2;\n //$app_shares_points = 5;\n $app_shares_points = 2;\n if( $userId == 201)\n {\n $app_shares_points = 5000;\n }\n \n if( $userId == 77)\n {\n $app_shares_points = 10000;\n }\n $app_install_points = 20;\n \n $loyaltyEarnedDetails = array();\n $loyaltyEarnedDetails['userProductReviews'] = 0;\n $loyaltyEarnedDetails['userProductShares'] = 0; \n $loyaltyEarnedDetails['userAppShares'] = 0; \n \n # Get users Product Reviews\n $this -> db -> select('count(r.Id) as userProductReviews'); \n $this -> db -> from('users as u');\n $this -> db -> join('productsreviews r', 'r.UserId=u.Id', 'left');\n if( $startDate != \"\" && $endDate != \"\" )\n {\n $this -> db -> where('r.CreatedOn >=', $startDate);\n $this -> db -> where('r.CreatedOn <=', $endDate);\n }\n \n $this -> db -> where('u.Id', $userId);\n $this -> db -> where('u.IsRemoved', 0);\n $query = $this -> db -> get();\n \n $productReviews = $query -> row_array();\n \n if($productReviews)\n {\n $loyaltyEarnedDetails['userProductReviews'] = $productReviews['userProductReviews']; \n }\n \n # Get user products shares\n $this -> db -> select('count(s.Id) as userProductShares'); \n $this -> db -> from('users as u');\n $this -> db -> join('product_shares s', 's.UserId=u.Id', 'left'); \n $this -> db -> where('u.Id', $userId);\n $this -> db -> where('u.IsRemoved', 0);\n $this -> db -> where('s.IsActive', 1);\n $this -> db -> where('s.IsRemoved', 0);\n if( $startDate != \"\" && $endDate != \"\" )\n {\n $this -> db -> where('s.ShareDate >=', $startDate);\n $this -> db -> where('s.ShareDate <=', $endDate);\n }\n $query = $this -> db -> get();\n \n \n $productShares = $query -> row_array();\n \n if($productShares)\n {\n $loyaltyEarnedDetails['userProductShares'] = $product_shares_points * $productShares['userProductShares']; \n }\n \n # Get user App shares\n $this -> db -> select('count(a.Id) as userAppShares'); \n $this -> db -> from('users as u');\n $this -> db -> join('app_shares a', 'a.UserId=u.Id', 'left'); \n $this -> db -> where('u.Id', $userId);\n $this -> db -> where('u.IsRemoved', 0);\n $this -> db -> where('a.IsActive', 1);\n $this -> db -> where('a.IsRemoved', 0);\n if( $startDate != \"\" && $endDate != \"\" )\n {\n $this -> db -> where('a.ShareDate >=', $startDate);\n $this -> db -> where('a.ShareDate <=', $endDate);\n }\n $query = $this -> db -> get(); \n \n $appShares = $query -> row_array();\n \n if($appShares)\n {\n $loyaltyEarnedDetails['userAppShares'] = $app_shares_points * $appShares['userAppShares']; \n }\n \n return $loyaltyEarnedDetails; \n }",
"public function main()\n {\n $personPoints1 = new PersonPoints();\n $personPoints1->add(1, 1);\n $personPoints1->add(2, 6);\n $personPoints1->add(3, 1);\n $personPoints1->add(4, 0);\n $personPoints1->add(5, 2);\n\n $personPoints2 = new PersonPoints();\n $personPoints2->add(1, 4);\n $personPoints2->add(2, 0);\n $personPoints2->add(3, 1);\n $personPoints2->add(4, 5);\n $personPoints2->add(5, 0);\n\n $personPoints3 = new PersonPoints();\n $personPoints3->add(1, 10);\n $personPoints3->add(2, 0);\n $personPoints3->add(3, 0);\n $personPoints3->add(4, 0);\n $personPoints3->add(5, 0);\n\n if (\n $personPoints1->getTotalPoints() != $this->pointsNeeded ||\n $personPoints2->getTotalPoints() != $this->pointsNeeded ||\n $personPoints3->getTotalPoints() != $this->pointsNeeded\n ) {\n echo \"Missing points!\\n\";\n }\n\n $listOfPoints = [$personPoints1, $personPoints2, $personPoints3];\n $itemPoints = new ItemPoints($listOfPoints);\n $result = $itemPoints->redistribute(2);\n $this->showResult($result, count($listOfPoints));\n }",
"public static function get_the_total_earned_points_for_order($order) {\n $status = get_option('rs_order_status_control');\n global $wpdb;\n $table_name = $wpdb->prefix . 'rsrecordpoints';\n $orderid = $order->id;\n $gettotalearnpoints = $wpdb->get_results(\"SELECT earnedpoints FROM $table_name WHERE orderid=$orderid\", ARRAY_A);\n $orderstatus = $order->post_status;\n if (is_array($status)) {\n foreach ($status as $statuses) {\n $statusstr = $statuses;\n }\n }\n $replacestatus = str_replace('wc-completed', $statusstr, $orderstatus);\n if (get_option('rs_enable_msg_for_earned_points') == 'yes') {\n if (in_array($replacestatus, $status)) {\n $totalearnedvalue = \"\";\n $earned_total = $gettotalearnpoints;\n if (is_array($earned_total)) {\n foreach ($earned_total as $key => $value) {\n $totalearnedvalue+=$value['earnedpoints'];\n }\n $msgforearnedpoints = get_option('rs_msg_for_earned_points');\n $roundofftype = get_option('rs_round_off_type') == '1' ? '2' : '0';\n $replacemsgforearnedpoints = str_replace('[earnedpoints]', $totalearnedvalue != \"\" ? round($totalearnedvalue, $roundofftype) : \"0\", $msgforearnedpoints);\n echo '<br><br>' . '<b>' . $replacemsgforearnedpoints . '<b>' . '<br><br>';\n }\n }\n }\n }",
"public function getTotalEstimated() {\n\t\t$total = 0;\n\t\t$this->costitem->get();\n\t\tforeach($this->costitem->all as $item) {\n\t\t\tif ($item->item_type == 'price') {\n\t\t\t\t$total += $item->amount;\n\t\t\t}\n\t\t}\n\t\treturn $total;\n\t\t\n\t}",
"public function calculate_end_month_bonus()\n {\n $year = (new DateTime)->format(\"Y\");\n $month = (new DateTime)->format(\"n\");\n\n if($month == 1){\n $month = 12;\n $year = $year - 1;\n } else {\n $month = $month - 1;\n }\n\n //count for DO Rank Members\n $do_members = ActiveDo::all();\n $sdo_members = ActiveSdo::all();\n //$userPurchases = UserPurchase::all(); // originall\n $userPurchases = UserPurchase::groupBy('user_id', 'product_id')\n ->selectRaw('user_id, product_id, sum(price) as price, sum(pv) as pv, count(*) as quantity')\n ->whereMonth('created_at', $month)\n ->whereYear('created_at', $year)\n ->get();\n //$userStores = Store::all(); // originall\n $userStores = Store::groupBy('user_id', 'product_id')\n ->selectRaw('user_id, product_id, sum(price) as price, sum(pv) as pv, count(*) as quantity')\n ->whereMonth('created_at', $month)\n ->whereYear('created_at', $year)\n ->get();\n \n $next_do_members= $do_members;\n $i = 0;\n $n = count($do_members);\n\n $total_sales1 = UserPurchase::sum('price');\n $total_sales2 = Store::sum('price');\n $total_sales = $total_sales1 + $total_sales2;\n\n $total_pv1 = UserPurchase::sum('pv');\n $total_pv2 = Store::sum('pv');\n $total_pv = $total_pv1 + $total_pv2;\n\n //$sale = Sale::where('year', $year)->where('month', $month)->first();\n $sale = Sale::firstOrCreate([]);\n $sale->re_total_sale = $total_sales;\n $sale->re_total_pv = $total_pv;\n $sale->save();\n\n // echo '<br>';\n // echo '<pre>';\n // print_r($userStores);\n // echo '<pre>';\n // echo '<br>';\n\n foreach ($userPurchases as $userPurchase) \n {\n $this->retail_price($userPurchase->user_id, $userPurchase->price, $userPurchase->product_id);\n //$this->upline_personal_rebate($userPurchase->user_id, $userPurchase->pv);\n $this->personal_rebate($userPurchase->user_id, $userPurchase->pv, $userPurchase->product_id);\n }\n\n foreach($userStores as $store)\n {\n $this->retail_price($store->user_id, $store->price, $store->product_id);\n //$this->pay_valid_upline_for_personal_rebate($store->user_id, $store->pv);\n //$this->upline_personal_rebate($store->user_id, $store->pv);\n $this->personal_rebate($store->user_id, $store->pv, $store->product_id);\n }\n\n foreach($do_members as $member)\n {\n $this->calculate_active_do_personal_gpv($member->user_id);\n // $this->group_bonus($member->user_id);\n }\n\n foreach($do_members as $member)\n {\n // $this->calculate_active_do_personal_gpv($member->user_id);\n $this->group_bonus($member->user_id);\n }\n\n $this->calculate_total_group_pv();\n\n foreach ($sdo_members as $smember) {\n $this->calculate_active_sdo_personal_gpv($smember->user_id);\n // $this->sdo_bonus($smember->user_id); //need to separate\n // $this->sdo_to_sdo_bonus($smember->user_id); //need to separate\n }\n\n foreach ($sdo_members as $smember) {\n $this->sdo_bonus($smember->user_id); \n $this->sdo_to_sdo_bonus($smember->user_id); \n }\n\n // foreach($next_do_members as $next_member)\n // {\n // //$this->calculate_active_do_personal_gpv($member->user_id);\n // $this->group_bonus($next_member->user_id);\n // }\n\n $ewallets = Wallet::all();\n\n foreach ($ewallets as $wallet) {\n //$this->direct_sponsor_bonus($wallet->user_id, $wallet->pv, $wallet->first_purchased);\n $this->direct_sponsor_bonus($wallet->user_id, $wallet->pv);\n }\n\n $do_cto_bonus = $this->do_cto_bonus();\n $sdo_cto_bonus = $this->sdo_cto_bonus();\n\n //$this->countTotalBonus();\n $this->recordUserBonuses();\n //$this->countTotalBonus();\n }",
"public function getPointsBalance(\\Magento\\Reward\\Model\\Reward\\History $item)\n {\n return $item->getPointsBalance();\n }",
"public function calculateTotalAmount()\n {\n\n $total = 0;\n $base_currency_total = 0;\n $items_in_bag = Session::get('items');\n\n if (!empty($items_in_bag)) {\n foreach ($items_in_bag as $item) {\n $priceAccessoiresMust = 0;\n $priceAccessoires = 0;\n if (!empty($item['orderItemAccessories'])) {\n foreach ($item['orderItemAccessories'] as $orderItemAccessorie) {\n if (Session::get('cur_currency') === 'USD') {\n if(!empty($orderItemAccessorie['must_purchase']) && $orderItemAccessorie['must_purchase'] == 1) {\n $priceAccessoiresMust = $priceAccessoiresMust + $item['quantity'] * ($orderItemAccessorie['price'] * Session::get('amount_per_unit'));\n }else{\n $priceAccessoires = $priceAccessoires + 1 * ($orderItemAccessorie['price'] * Session::get('amount_per_unit'));\n }\n } else {\n if(!empty($orderItemAccessorie['must_purchase']) && $orderItemAccessorie['must_purchase'] == 1) {\n $priceAccessoiresMust = $priceAccessoiresMust + $item['quantity'] * ($orderItemAccessorie['price'] * Session::get('amount_per_unit'));\n }else{\n $priceAccessoires = $priceAccessoires + 1 * ($orderItemAccessorie['price'] * Session::get('amount_per_unit'));\n }\n }\n }\n }\n\n if (Session::get('cur_currency') === 'USD') {\n $price = $item['quantity'] * ($item['price'] * Session::get('amount_per_unit'));\n } else {\n $price = $item['quantity'] * $item['price'];\n }\n\n $base_currency_total = $base_currency_total + ($item['price'] * $item['quantity']) + $priceAccessoiresMust + $priceAccessoires;\n $total = round($total + $price + $priceAccessoiresMust + $priceAccessoires, 2);\n\n }\n }\n\n Session::put('total', $total);\n Session::put('bc_currency_total', $base_currency_total);\n return $total;\n }",
"function line_demand_total($line_orders) {\n $line_demand_total = array_reduce(\n $line_orders,\n function ($sum, $line) {\n return $sum + intval($line[QUANTITY]);\n },\n 0);\n return $line_demand_total;\n}",
"public function getTotalCosts() {\n $costs = 0;\n \n foreach($this->Expenses() as $expense) {\n if($expense->Cost)\n $costs += $expense->Cost;\n }\n \n return $costs; \n }",
"function calculatePriceForRabatt(){\r\n// @ToDo remove static Values \r\n\r\n\t $basketIns = array_merge($this->basket->get_articles_by_article_type_uid_asuidlist(1)); //,$this->basket->get_articles_by_article_type_uid_asuidlist($this->pObj->conf['couponNormalType']),$this->basket->get_articles_by_article_type_uid_asuidlist($this->pObj->conf['couponRelatedType'])); // 4 and 5\r\n\t $value = array('net'=>0,'gross'=>0);\r\n\t \r\n\t foreach ($basketIns as $itemObjId) {\r\n\t\t$temp = $this->basket->basket_items[$itemObjId];\r\n\t\t$temp->recalculate_item_sums();\r\n\t\t\r\n\t\t$value['net'] += $temp->get_item_sum_net();\r\n\t\t$value['gross'] += $temp->get_item_sum_gross();\r\n\t }\r\n\r\n\t if($value['net']< 0){\r\n\t\t$value['net'] = 0;\r\n\t }\r\n\r\n\t if($value['gross'] < 0){\r\n\t\t$value['gross'] = 0;\r\n\t }\r\n\t return $value;\r\n\t}",
"public function getTotalBilled() {\n\t\t$total = 0;\n\t\t\n\t\tforeach($this->invoice->all as $invoice) {\n\t\t\tforeach($invoice->lineitem->get()->all as $lineitem) {\n\t\t\t\t$total += $lineitem->amount;\n\t\t\t}\n\t\t}\n\t\treturn $total;\n\t}",
"function profit()\n\t{\n\t\t$total = 0;\n\t\t$ante = $this->properties->get('ante');\n\t\tforeach ($this->all() as $record)\n\t\t\tif (!empty($record->making))\n\t\t\t\t$total += $record->balance - $ante;\n\n\t\treturn $total;\n\t}",
"public function get_services_cost(){\n //find all the requested services on a deadbody\n $sql = \"SELECT * FROM requested_service WHERE dead_no={$this->id}\";\n $this->requested_services = RequestedService::find_by_sql($sql);\n $total_debit = 0;\n //for each requested service find price and add to total debit\n foreach ($this->requested_services as $requested_service) {\n $service = Service::find_by_id($requested_service->service_no);\n $total_debit += $service->price;\n }\n return $total_debit;\n }",
"public function redeembp(){\n\t\t$this->db->where('CustomerMail', $this->session->userdata('useremail'));\n\t\t$this->db->select_sum('EarnedPotint');\n\t\t$this->db->from('tbl_bvpoint_data');\n\t\t$query = $this->db->get();\n\t\t$sumvalue=$query->row()->EarnedPotint;\n\t\t//echo $sumvalue;\n\t\tif($sumvalue>100){\n\t\t\t$redeempoint=100;\n\t\t}\n\t\telse{\n\t\t\t$redeempoint=$sumvalue;\n\t\t}\n\t\treturn round($redeempoint*0.25);\n\t}",
"public function getPointsBalance(Gri_Reward_Model_Reward_History $item)\n {\n return $item->getPointsBalance();\n }",
"function cartTotal ($cartItems) {\n\n$grouped = $cartItems->groupBy(\"product_id\");\n$product_quantities = $grouped->map(function ($item, $key) {\n return [$key => $item->sum(\"qty\")];\n});\n$products_ids = array_keys($product_quantities->all());\n$products = Product::whereIn(\"id\", $products_ids)->select([\"price\", \"name\", \"id\", \"item_value_discount\", \"items_value_discount\", \"items_items_discount\"])->get();\n$products = $products->groupBy(\"id\");\n\n$item_value_discounts = collect([]);\n$items_value_discounts = collect([]);\n$items_items_discounts = collect([]);\n\nforeach ($products as $product) {\n if ($product[0]->item_value_discount) {\n \n $item_value_discounts->put($product[0]->id, $product[0]->getActiveItemValueDiscount());\n\n // $item_value_discounts = item_value_discount::where(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereDate(\"ends_at\", \">=\", date(\"Y-m-d\"));\n // })->orWhere(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereNull(\"ends_at\");\n // })->get();\n }\n if ($product[0]->items_value_discounts) {\n $items_value_discounts->put($product[0]->id, $product[0]->getActiveItemsValueDiscount());\n // $items_value_discounts = items_value_discount::where(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereDate(\"ends_at\", \">=\", date(\"Y-m-d\"));\n // })->orWhere(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereNull(\"ends_at\");\n // })->get();\n }\n if ($product[0]->items_items_discounts) {\n $items_items_discounts->put($product[0]->id, $product[0]->getActiveItemsItemsDiscount());\n // $items_items_discounts = items_items_discount::where(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereDate(\"ends_at\", \">=\", date(\"Y-m-d\"));\n // })->orWhere(function ($query) {\n // $query->whereDate(\"starts_at\", \"<=\", date(\"Y-m-d\"))\n // ->whereNull(\"ends_at\");\n // })->get();\n }\n}\n// return $item_value_discounts;\n// return $items_value_discounts;\n// return $items_items_discounts;\n\n// if ($item_value_discounts)\n// $item_value_discounts = $item_value_discounts->groupBy(\"product_id\");\n// if ($items_value_discounts)\n// $items_value_discounts = $items_value_discounts->groupBy(\"product_id\");\n// if ($items_items_discounts)\n// $items_items_discounts = $items_items_discounts->groupBy(\"product_id\");\n// return $item_value_discounts;\n\n// return $items_value_discounts;\n// return $items_items_discounts;\n$product_prices_qty = collect([]);\n$product_present = collect([]);\nforeach ($products_ids as $products_id) {\n $product_qty = $product_quantities[$products_id][$products_id];\n $items_items_discounts_product_qty = $product_quantities[$products_id][$products_id];\n if (isset($items_value_discounts[$products_id])) {\n if ($items_value_discounts[$products_id] !== []) {\n foreach ($items_value_discounts[$products_id] as $discount) {\n $count = floor($product_qty / $discount->items_count);\n if ($count) {\n $product_prices_qty->push([\n \"product_id\" => $products_id,\n \"product_name\" => $products[$products_id][0]->name,\n \"qty\" => $discount->items_count * $count,\n \"price\" => $count*$discount->items_value,\n ]);\n $product_qty = $product_qty - ($count * $discount->items_count);\n }\n }\n }\n }\n if (isset($item_value_discounts[$products_id])) {\n if ($item_value_discounts[$products_id] !== []) {\n foreach ($item_value_discounts[$products_id] as $discount) {\n if ($product_qty) {\n $price = $products[$products_id][0]->price;\n $value = $discount->value;\n $percent = $discount->percent;\n \n if ($value && $percent) {\n $price = $price - $value;\n } else if ($value && !$percent) {\n $price = $price - $value;\n } else {\n $price = $price - (($percent / 100) * $price);\n }\n $total = $price*$product_qty;\n $product_prices_qty->push([\n \"product_id\" => $products_id,\n \"product_name\" => $products[$products_id][0]->name,\n \"qty\" => $product_qty,\n \"price\" => $total,\n ]);\n }\n }\n }\n }\n if (isset($items_items_discounts[$products_id])) {\n if ($items_items_discounts[$products_id] !== []) {\n $items_number = $items_items_discounts_product_qty;\n $max_get_number = 0;\n // $product_present = collect([]);\n foreach ($items_items_discounts[$products_id] as $discount) {\n $count = floor($items_number / $discount->buy_items_count);\n if (!$product_prices_qty->contains('product_id', $products_id)){\n $price = $products[$products_id][0]->price;\n $total = $price * $items_items_discounts_product_qty;\n $product_prices_qty->push([\n \"product_id\" => $products_id,\n \"qty\" => $items_items_discounts_product_qty,\n \"product_name\" => $products[$products_id][0]->name,\n \"price\" => $total,\n ]);\n }\n if ($count) {\n if ($discount->get_items_count > $max_get_number) {\n $max_get_number = $discount->get_items_count * $count;\n \n $offer = [\n \"product_id\" => $products_id,\n \"buy_items_count\" => $discount->buy_items_count,\n \"presents_count\" => $max_get_number,\n \"present_product_id\" => $discount->present_product_id,\n ];\n }\n }\n }\n $product_present->push($offer);\n }\n }\n}\n$data = [\"totals\" => $product_prices_qty, \"presents\" => $product_present];\nreturn $data;\n}",
"function get_cost() {\n\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"Calulating bill for cr $this->id\", \"\", \"\", 0, 0, 0);\n\t\t$cr_appliance_id = $this->appliance_id;\n\t\t$app_id_arr = explode(\",\", $cr_appliance_id);\n\t\t$cr_costs_final = 0;\n\t\tforeach ($app_id_arr as $app_id) {\n\t\t\t$cloud_app = new cloudappliance();\n\t\t\t$cloud_app->get_instance_by_appliance_id($app_id);\n\t\t\t// check state, only bill if active\n\t\t\tif ($cloud_app->state == 1) {\n\t\t\t\t// basic cost\n\t\t\t\t$cr_costs = 0;\n\t\t\t\t// + per cpu\n\t\t\t\t$cr_costs = $cr_costs + $this->cpu_req;\n\t\t\t\t// + per nic\n\t\t\t\t$cr_costs = $cr_costs + $this->network_req;\n\t\t\t\t// ha cost double\n\t\t\t\tif (!strcmp($this->ha_req, '1')) {\n\t\t\t\t\t$cr_costs = $cr_costs * 2;\n\t\t\t\t}\n\t\t\t\t// TODO : disk costs\n\t\t\t\t// TODO : network-traffic costs\n\n\t\t\t\t// sum\n\t\t\t\t$cr_costs_final = $cr_costs_final + $cr_costs;\n\t\t\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"-> Billing active appliance $app_id (cr $this->id) = $cr_costs CC-units\", \"\", \"\", 0, 0, 0);\n\t\t\t} else {\n\t\t\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"-> Not billing paused appliance $app_id (cr $this->id)\", \"\", \"\", 0, 0, 0);\n\t\t\t}\n\t\t}\n\t\t$this->_event->log(\"get_costs\", $_SERVER['REQUEST_TIME'], 5, \"cloudprofile.class.php\", \"-> Final bill for cr $this->id = $cr_costs_final CC-units\", \"\", \"\", 0, 0, 0);\n\t\treturn $cr_costs_final;\n\t}",
"function itg_loyalty_reward_ugc_content_points($node, $ugc_node) { \n $ugc_user = node_load($ugc_node);\n itg_loyalty_reward_earnpoint($node->nid, 'ugc', $ugc_user->uid);\n}",
"public static function redeem($id, $user)\n {\n $reward = Reward::find($id);\n\n if (!$reward) {\n throw SystemException(Lang::get('dma.friends.exceptions.missingReward', ['id' => $id]));\n }\n\n try {\n\n // Check overall inventory\n if ($reward->inventory !== null && $reward->inventory == 0) {\n Session::put('rewardError', Lang::get('dma.friends::lang.rewards.noInventory'));\n return;\n }\n\n // Check a users individual inventory\n $count = $user\n ->rewards()\n ->where('reward_id', $reward->id)\n ->count();\n\n if (!empty($reward->user_redeem_limit) && $count >= $reward->user_redeem_limit) {\n Session::put('rewardError', Lang::get('dma.friends::lang.rewards.alreadyRedeemed'));\n return;\n }\n\n $userExtend = new UserExtend($user);\n\n if ($userExtend->removePoints($reward->points, false)) {\n\n if ($reward->inventory > 0) {\n $reward->inventory--;\n $reward->save();\n }\n \n $user->rewards()->save($reward);\n \n Event::fire('dma.friends.reward.redeemed', [$reward, $user]);\n\n $params = [\n 'user' => $user,\n 'object' => $reward,\n ];\n\n FriendsLog::reward($params);\n // TODO handle printing of reward coupon\n\n Session::put('rewardMessage', Lang::get('dma.friends::lang.rewards.redeemed', ['title' => $reward->title]));\n } else {\n Session::put('rewardError', Lang::get('dma.friends::lang.rewards.noPoints'));\n }\n } catch (Exception $e) {\n throw SystemException(Lang::get('dma.friends.exceptions.rewardFailed'));\n }\n }",
"function calcPoints() {\n\tglobal $payback_config;\n $this->shop->basket();\n $amount=$this->shop->basket->amount(); \n $points=intval(($amount/100)*$payback_config->points); \n return $points;\n }",
"public function getTotalRedeemPoint($data,$id){\n $dm = $data['dm']->getManager();\n $redeems = $dm->createQueryBuilder('AevitasLevisBundle:AbstractRedeem')\n ->field('created')->sort('time', 'desc')->getQuery()->execute();\n $total_redeemed_point = 0;\n if(!empty($redeems)){ \n $index = 0;\n $length_arr = count($redeems);\n \n\n foreach ($redeems as $obj) {\n if (!is_object($obj->getUser())) {\n continue;\n }\n \n $index++;\n if($obj->getUser()->getID() == $id){\n $total_redeemed_point = $total_redeemed_point + $obj->getPoint();\n //if($index == $length_arr){\n //}\n }\n\n }\n return $total_redeemed_point;\n }\n return 0;\n }",
"function btce_get_active_order_total($key, $secret) {\n $orders = btce_active_orders($key, $secret);\n $_total = 0;\n foreach ($orders->return as $order) {\n if ($order->type == 'sell') {\n $_total += $order->amount;\n }\n }\n return $_total;\n}",
"public function getTotalPaid();",
"public function getActivityRewardCount()\n {\n return $this->count(self::_ACTIVITY_REWARD);\n }",
"public function getTotalInvoiced();",
"public function getCharges();",
"private function reward( $data ) {\r $rewards[ 0 ][ 'title' ] = '10% Anything whatever';\r $rewards[ 0 ][ 'img' ] = null;\r $rewards[ 0 ][ 'details' ] = 'Details about the Reward, I guess I will save this for later, there is no point on filling this with useless things.';\r\r $rewards[ 1 ][ 'title' ] = '20% something else';\r $rewards[ 1 ][ 'img' ] = null;\r $rewards[ 1 ][ 'details' ] = 'Details about the Reward, I guess I will save this for later, there is no point on filling this with useless things.';\r\r $rewards[ 2 ][ 'title' ] = '20% something else';\r $rewards[ 2 ][ 'img' ] = null;\r $rewards[ 2 ][ 'details' ] = 'Details about the Reward, I guess I will save this for later, there is no point on filling this with useless things.';\r\r $rewards[ 3 ][ 'title' ] = '100% reward of something';\r $rewards[ 3 ][ 'img' ] = null;\r $rewards[ 3 ][ 'details' ] = 'Details about the Reward, I guess I will save this for later, there is no point on filling this with useless things.';\r\r $rewards[ 4 ][ 'title' ] = '45% Wow';\r $rewards[ 4 ][ 'img' ] = null;\r $rewards[ 4 ][ 'details' ] = 'Details about the Reward, I guess I will save this for later, there is no point on filling this with useless things.';\r\r $rewards[ 5 ][ 'title' ] = 'More and More rewards';\r $rewards[ 5 ][ 'img' ] = null;\r $rewards[ 5 ][ 'details' ] = 'Details about the Reward, I guess I will save this for later, there is no point on filling this with useless things.';\r\r $rewards[ 6 ][ 'title' ] = 'Free shipping on something';\r $rewards[ 6 ][ 'img' ] = null;\r $rewards[ 6 ][ 'details' ] = 'Details about the Reward, I guess I will save this for later, there is no point on filling this with useless things.';\r\r $rewards[ 7 ][ 'title' ] = 'Free coffee';\r $rewards[ 7 ][ 'img' ] = null;\r $rewards[ 7 ][ 'details' ] = 'Details about the Reward, I guess I will save this for later, there is no point on filling this with useless things.';\r\r $rewards[ 8 ][ 'title' ] = 'Get a new bathroom 46%';\r $rewards[ 8 ][ 'img' ] = null;\r $rewards[ 8 ][ 'details' ] = 'Details about the Reward, I guess I will save this for later, there is no point on filling this with useless things.';\r\r $key = array_rand( $rewards, 1 );\r\r return $rewards[ $key ];\r }",
"function calcTotals(){\n\t\t\n\t\tif($this->Review == true){/*\n\t\t\t$getRate = new sql_processor($this->DB,$this->Conn,$this->Gateway);\n\t\t\t$getRate->mysql(\"SELECT `tax_percent` FROM `billship_tax_states` WHERE `tax_state` = '\".$this->CustBill['State'].\"';\");\n\t\t\t$getRate->mssql(\"SELECT tax_percent FROM billship_tax_states WHERE tax_state = '\".$this->CustBill['State'].\"';\");\n\t\t\tif($getRate->TotalRows() != 0){ $getRate = $getRate->Rows();\n\t\t\t\t$this->Totals['Tax'] += $this->Totals['Taxable'] * ($getRate[0]['tax_percent']/100);\n\t\t\t}\n\t\t\t$getRate = new sql_processor($this->DB,$this->Conn,$this->Gateway);\n\t\t\t$getRate->mysql(\"SELECT `tax_count_percent` FROM `billship_tax_county` WHERE `tax_count_zip` = '\".$this->CustBill['Zip'].\"';\");\n\t\t\t$getRate->mssql(\"SELECT tax_count_percent FROM billship_tax_county WHERE tax_count_zip = '\".$this->CustBill['Zip'].\"';\");\n\t\t\tif($getRate->TotalRows() != 0){ $getRate = $getRate->Rows();\n\t\t\t\t$this->Totals['Tax'] += $this->Totals['Taxable'] * ($getRate[0]['tax_count_percent']/100);\n\t\t\t}\n\t\t\t\n\t\t\tif($this->Totals['Ship2'] > 0){\n\t\t\t\t$getRate = new sql_processor($this->DB,$this->Conn,$this->Gateway);\n\t\t\t\t$getRate->mysql(\"SELECT `ship_limit_price`, `ship_limit_percent` FROM `billship_shipping_limits` WHERE `ship_limit_start_price` >= '\".$this->Totals['Total'].\"';\");\n\t\t\t\t$getRate->mssql(\"SELECT ship_limit_price, ship_limit_percent FROM billship_shipping_limits WHERE ship_limit_start_price >= '\".$this->Totals['Total'].\"';\");\n\t\t\t\t\t\t\t\n\t\t\t\tif($getRate->TotalRows() == 0){\n\t\t\t\t\t$getRate->mysql(\"SELECT `ship_limit_price`, `ship_limit_percent` FROM `billship_shipping_limits` WHERE `ship_limit_upper` = 'y';\");\n\t\t\t\t\t$getRate->mssql(\"SELECT ship_limit_price, ship_limit_percent FROM billship_shipping_limits WHERE ship_limit_upper = 'y';\");\n\t\t\t\t}\n\t\t\t\t$getRate = $getRate->Rows();\n\t\t\t\t$test_1 = $getRate[0]['ship_limit_price'];\n\t\t\t\t$test_2 = $this->Totals['Total']*($getRate[0]['ship_limit_percent']/100);\n\t\t\t\t\n\t\t\t\t$getRate = new sql_processor($this->DB,$this->Conn,$this->Gateway);\n\t\t\t\t$getRate->mysql(\"SELECT `ship_limit_price`, `ship_limit_percent` FROM `billship_shipping_limits` WHERE `ship_limit_start_weight` >= '$weight';\");\n\t\t\t\t$getRate->mssql(\"SELECT ship_limit_price, ship_limit_percent FROM billship_shipping_limits WHERE ship_limit_start_weight >= '$weight';\");\n\t\t\t\t$getRate = $getRate->Rows();\n\t\t\t\t\n\t\t\t\t$test_3 = $getRate[0]['ship_limit_price'];\n\t\t\t\t$test_4 = $total*($getRate[0]['ship_limit_percent']/100);\n\t\t\t\t\n\t\t\t\t$this->Totals['Ship2'] = ($test_1 < $test_2) ? $test_2 : $test_1;\n\t\t\t\t$this->Totals['Ship2'] = ($this->Totals['Ship2'] < $test_3) ? $test_3 : $this->Totals['Ship2'];\n\t\t\t\t$this->Totals['Ship2'] = ($this->Totals['Ship2'] < $test_4) ? $test_4 : $this->Totals['Ship2'];\n\t\t\t\tif(strlen(trim($this->Totals['Ship2'])) > 0) $this->Totals['Ship'] = $this->Totals['Ship2'];\n\t\t\t}\n\t\t*/\n\t\t}\n\t\t$this->Totals['Grand'] = $this->Totals['Total']+$this->Totals['Ship']+$this->Totals['Tax']-$this->Totals['Disc']+$this->Totals['Ext']+$this->Totals['Freight'];\n\t}",
"public function AddTotalPoints($points){\r\n\t\t$this -> totalPoints += $points; \r\n\t }",
"public function ex_points(){\r\n $maps['is_on_sale'] = 1;\r\n $maps['type'] = 0;\r\n $info = D('goods')->where($maps)->select();\r\n // var_dump($info);die;\r\n $mapps['is_forbid'] = 0;\r\n $r = D('store')->where($mapps)->select();\r\n $this->assign('r',$r);\r\n $this->assign('info',$info);\r\n $this->display();\r\n }",
"public function getTotalRefunded();",
"public function releaseRefPointsOnEveryShoping()\n {\n \t//More you pay less you release.\n \t//Get the points for other shops.\n }",
"public function action()\n {\n $class = str_replace('hook_pointstore_', '', strtolower(get_class($this)));\n\n $id = get_param_integer('sub_id');\n $rows = $GLOBALS['SITE_DB']->query_select('pstore_customs', array('c_title', 'c_cost', 'c_one_per_member'), array('id' => $id, 'c_enabled' => 1));\n if (!array_key_exists(0, $rows)) {\n warn_exit(do_lang_tempcode('MISSING_RESOURCE'));\n }\n\n $c_title = get_translated_text($rows[0]['c_title']);\n $title = get_screen_title('PURCHASE_SOME_PRODUCT', true, array(escape_html($c_title)));\n\n $cost = $rows[0]['c_cost'];\n $next_url = build_url(array('page' => '_SELF', 'type' => 'action_done', 'id' => $class, 'sub_id' => $id), '_SELF');\n $points_left = available_points(get_member());\n\n // Check points\n if (($points_left < $cost) && (!has_privilege(get_member(), 'give_points_self'))) {\n return warn_screen($title, do_lang_tempcode('_CANT_AFFORD', escape_html(integer_format($cost)), escape_html(integer_format($points_left))));\n }\n\n return do_template('POINTSTORE_CUSTOM_ITEM_SCREEN', array('_GUID' => 'bc57d8775b5471935b08f85082ba34ec', 'TITLE' => $title, 'ONE_PER_MEMBER' => ($rows[0]['c_one_per_member'] == 1), 'COST' => integer_format($cost), 'REMAINING' => integer_format($points_left - $cost), 'NEXT_URL' => $next_url));\n }",
"public function index()\n {\n $user = Auth::user();\n $depositPoint = DB::table('deposits')->where('user_id', $user->id)->sum('deposit_club_point');\n\n if($depositPoint >= 10000){\n\n if(!$user->is_merchant == 1){\n\n //for normal customer\n $user->balance = $user->balance + ($depositPoint * (1/10000));\n $user->update();\n\n $wallet = new Wallet;\n $wallet->user_id = $user->id;\n $wallet->amount = $depositPoint * (1/10000);\n $wallet->payment_method = 'Club Point Convert';\n $wallet->payment_details = 'Club Point Convert';\n $wallet->approval = 1;\n $wallet->save();\n\n $convertpoint = new Deposit;\n $convertpoint->user_id = $user->id;\n $convertpoint->deposit_club_point = $depositPoint * (-1);\n if( $convertpoint->save() ){\n flash('Your points successfully Converted into BDH')->success();\n return redirect()->back();\n }\n } else {\n\n //for Merchent\n $convertpoint = new Deposit;\n $convertpoint->user_id = $user->id;\n $convertpoint->deposit_amount = $depositPoint * (1/10000);\n $convertpoint->deposit_club_point = $depositPoint * (-1);\n if( $convertpoint->save() ){\n flash('Your points successfully Converted into BDH')->success();\n return redirect()->back();\n }\n }\n }\n flash('You can Convert your point after earn 10,000 points')->error();\n return redirect()->back();\n }",
"function getTotalWeight()\n { $total = 0 ;\n if (count($this->items) > 0) \n { \n for ($p=0; $p<count($this->items); $p++) \n {\n $total = $total + $this->items[$p];\n }\n }\n return $total;\n }",
"public function package() {\n\n $this->request->allowMethod('post');\n\n if (!$this->Access->check('Rewards', 'create')) {\n $this->redirect($this->referer());\n return;\n }\n\n $rewardData = $this->request->data['Reward'];\n $recipientData = empty($rewardData['recipients']) ? '' : preg_split(\"/\\s*\\n\\s*/\", $rewardData['recipients']);\n\n if (empty($recipientData)) {\n $this->Flash->set('You did not specify any recipients.', ['params' => ['class' => 'error']]);\n $this->redirect(array('action' => 'compose'));\n return;\n }\n\n $failedRecipients = array();\n $recipients = $this->AccountUtility->resolveAccountIDs($recipientData, $failedRecipients);\n $recipients = array_unique($recipients);\n $this->addPlayers($recipients);\n\n $rewardDetails = $this->request->data['RewardDetail'];\n $message = !empty($this->request->data['Reward']['message']) ? $this->request->data['Reward']['message']: '';\n $credit = !empty($this->request->data['Reward']['credit']) ? $this->request->data['Reward']['credit'] : 0;\n\n $user_id = $this->Auth->user('user_id');\n\n $this->loadModel('Item');\n $items = $this->loadItems();\n $totalValue = (int)$credit;\n\n foreach ($rewardDetails as $key => $detail) {\n\n $item_id = $detail['item_id'];\n $quantity = $detail['quantity'];\n\n if (empty($quantity) || $quantity < 1) {\n unset($rewardDetails[$key]);\n continue;\n }\n\n //Current price for estimated value\n $totalValue += $items[$item_id]['price'] * $quantity;\n }\n\n // redirect if no details or cash\n if(empty($totalValue) && empty($rewardDetails)) {\n $this->redirect(array('action' => 'compose'));\n return;\n }\n\n $rewardRecipients = array();\n\n foreach ($recipients as $recipient) {\n $rewardRecipients[] = array(\n 'recipient_id' => $recipient\n );\n }\n\n $this->Session->write('reward', array(\n 'RewardRecipient' => $rewardRecipients,\n 'Reward' => array(\n 'sender_id' => $user_id,\n 'message' => $message,\n 'credit' => $credit\n ),\n 'RewardDetail' => $rewardDetails\n ));\n\n $this->set(array(\n 'recipients' => $recipients,\n 'failedRecipients' => $failedRecipients,\n 'details' => Hash::combine($rewardDetails, '{n}.item_id', '{n}.quantity'),\n 'message' => $message,\n 'credit' => $credit,\n 'totalValue' => $totalValue,\n 'isReward' => true\n ));\n\n $this->Flash->set('Please confirm the reward below and then click send.');\n $this->render('/Gifts/compose');\n }",
"static function getRestaurantReservationRevenue($id)\n {\n //lay ra cac san pham trong mot bar reservation\n $product_items =RestaurantTotalReportDB::get_reservation_product($id);\n //System::debug($product_items);\n $total_discount = 0;\n\t\t$total_price = 0;\n $product_for_report = array();\n $product_for_report['product']['original_price'] = 0;\n $product_for_report['product']['real_price'] = 0;\n $product_for_report['is_processed']['real_price'] = 0;\n $product_for_report['is_processed']['original_price'] = 0;\n $product_for_report['service']['real_price'] = 0;\n $product_for_report['service']['original_price'] = 0;\n foreach($product_items as $key=>$value)\n\t\t{\n\t\t\tif($value['is_processed'] == 1 and $value['type'] != 'SERVICE')\n {\n\t\t\t\t$ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['is_processed']['original_price'] += $value['original_price'];\n $product_for_report['is_processed']['real_price'] += $ttl-$discnt;\n\t\t\t}\n if($value['is_processed'] == 0 and $value['type'] != 'SERVICE')\n {\n\t\t\t\t$ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['product']['original_price'] += $value['original_price'];\n $product_for_report['product']['real_price'] += $ttl-$discnt;\t\n\t\t\t}\n if($value['type'] == 'SERVICE')\n {\n $ttl = $value['price']*($value['quantity'] - $value['quantity_discount']);\n\t\t\t\t$discnt = ($ttl*$value['discount_category']/100) + (($ttl*(100-$value['discount_category'])/100)*$value['discount_rate']/100);\n\t\t\t\t$total_discount += $discnt;\n\t\t\t\tif($ttl<0)\n {\n\t\t\t\t\t$ttl = 0;\n\t\t\t\t}\n\t\t\t\t$total_price += $ttl-$discnt;\n $product_for_report['service']['original_price'] += $value['original_price'];\n $product_for_report['service']['real_price'] += $ttl-$discnt;\t\n }\n\t\t}\n return $product_for_report;\n }",
"function total( $params ) {\n\t\textract( $params );\n\n\t\t// Should zcarriage be in the items or not? If $zcarriage='NO' exclude the zcarriage from the total cost\n\t\t$zcarriage = !empty( $zcarriage ) && $zcarriage == 'NO' ? \" AND sku<>'zcarriage'\" : '';\n\n\t\t// The pu already contains vat\n\t\t$res = $this->db->query( \"SELECT SUM(ci.qty*ci.pu) price FROM cart_items ci INNER JOIN cart c ON c.id=ci.cart_id WHERE cart_id='\".$cart_id.\"' AND user='\".$user_no.\"' AND qty>0\".$zcarriage )->row_array();\n\t\treturn $res[ 'price' ];\n\t}",
"public function handle()\n {\n $client_managers = Agent::where('deleted', '=', '0')->with('user')->get();\n $report = array();\n foreach($client_managers as $key => $manager){\n $report[$key] = array('pp_coach_normal' => 0, 'pp_llpcoach_normal' => 0, 'pp_coach_fast' => 0, 'pp_llpcoach_fast' => 0 ,'name' => $manager['user']['name']);\n $total = 0;\n $clients = Client::where('agent_id', '=', $manager['user_id'])->with('user')->with('coach')->get();\n foreach($clients as $client){\n if($client['module_restriction'] == 'Yes'){\n //if coach is their own or one LLPs\n $creator = User::where('id', '=', $client['coach']['user']['created_by'])->first();\n if($creator['role_id'] == '5'){\n $total += $manager['pp_coach_normal'];\n $report[$key]['pp_coach_normal']++;\n }else{\n $total += $manager['pp_llpcoach_normal'];\n $report[$key]['pp_llpcoach_normal']++;\n }\n\n }else{\n //if coach is their own or one LLPs\n $creator = User::where('id', '=', $client['coach']['user']['created_by'])->first();\n if($creator['role_id'] == '5'){\n $total += $manager['pp_coach_fast'];\n $report[$key]['pp_coach_fast']++;\n }else{\n $total += $manager['pp_llpcoach_fast'];\n $report[$key]['pp_llpcoach_fast']++;\n }\n }\n }\n $report[$key]['total'] = $total;\n if(isset($total) && $total != 0 && $manager['user']['stripe_id'] != null){\n //DO STRIPE STUFF CHARGE EACH CLIENT MANAGER BASED ON TOTAL\n $charge = \\Stripe\\Charge::create(array(\n 'customer' => $manager['user']['stripe_id'],\n 'amount' => ($total * 100),\n \"currency\" => \"usd\",\n \"description\" => $manager['user']['name'].\" Client Manager Charge\"\n ));\n }\n }\n //send email report to Daithi.\n Mail::send(\n 'email_template.client_manager_monthly_report', ['report' => $report], function ($message) use ($report) {\n $message->to('[email protected]')->subject(\"Monthly Client Manager Report \");\n }\n );\n }",
"public function getUserTotalPaid()\n {\n $user = getUser();\n $w = self::where('type', 'credit')->where('user_id', $user->id);\n return $w->sum('amount');\n }",
"public function _apply()\n {\n $order = $this->_entity;\n $data = $order->getArrayCopy();\n\n $orderTotal = $data['grand_total'] - $data['shipping_total'];\n foreach (Order::getNonCashPaymentCodes() as $code) {\n $orderTotal += $data[$code];\n }\n\n return array('order_total'=> $orderTotal);\n }",
"public function getTotalCostAttribute(){\n return $this->routeCost()->select(['cost_id', DB::raw('round(AVG(`cost_per_ton`), 0) AS cost_per_ton')])->groupBy('cost_id')->get()->sum('cost_per_ton');\n }",
"public function get_search_reward_point($reward_point,$limit, $start,$reward = 'pt'){\r\n\t\t$this->db->select(\"t_company.name as company, m_category.category_name as category,t_support.company_reward_id as company_reward_id\");\r\n\t\t$this->db->from(\"t_support\");\r\n\t\t$this->db->join(\"t_company\",\"t_company.cid = t_support.cid\");\r\n\t\t$this->db->join(\"m_category\",\"m_category.category_id = t_company.category_id\");\r\n\t\t$this->db->limit($limit, $start);\r\n\t\tif($reward == 'rate'){\r\n\t\t\t$this->db->where('t_support.reward_point_rate >=',($reward_point*2));//result display in UC-17 ->t_support.reward_point 50%\t\r\n\t\t}\r\n\t\telse{\r\n\t\t\t$this->db->where('t_support.reward_point >=',($reward_point*2));//result display in UC-17 ->t_support.reward_point 50%\r\n\t\t}\r\n\t\t\r\n\t\t$this->db->where(\" t_support.delete_flg\",0);\r\n\t\t$this->db->where(\" t_support.active_flag\",1);\r\n\t\t$this->db->where(\" t_company.delete_flg\",0);\r\n\t\t// var_dump($this->db->get_compiled_select());exit();\r\n\t\t$query = $this->db->get();\r\n\t\treturn $query->num_rows() > 0 ? $query->result_object() : false;\r\n\t}",
"public function action_done()\n {\n $class = str_replace('hook_pointstore_', '', strtolower(get_class($this)));\n\n post_param_integer('confirm'); // Make sure POSTed\n $id = get_param_integer('sub_id');\n $rows = $GLOBALS['SITE_DB']->query_select('pstore_customs', array('*'), array('id' => $id, 'c_enabled' => 1), '', 1);\n if (!array_key_exists(0, $rows)) {\n warn_exit(do_lang_tempcode('MISSING_RESOURCE'));\n }\n\n $row = $rows[0];\n\n $cost = $row['c_cost'];\n\n $c_title = get_translated_text($row['c_title']);\n $title = get_screen_title('PURCHASE_SOME_PRODUCT', true, array(escape_html($c_title)));\n\n // Check points\n $points_left = available_points(get_member());\n if (($points_left < $cost) && (!has_privilege(get_member(), 'give_points_self'))) {\n return warn_screen($title, do_lang_tempcode('_CANT_AFFORD', escape_html(integer_format($cost)), escape_html(integer_format($points_left))));\n }\n\n if ($row['c_one_per_member'] == 1) {\n // Test to see if it's been bought\n $test = $GLOBALS['SITE_DB']->query_select_value_if_there('sales', 'id', array('purchasetype' => 'PURCHASE_CUSTOM_PRODUCT', 'details2' => strval($row['id']), 'memberid' => get_member()));\n if (!is_null($test)) {\n warn_exit(do_lang_tempcode('ONE_PER_MEMBER_ONLY'));\n }\n }\n\n require_code('points2');\n charge_member(get_member(), $cost, $c_title);\n $sale_id = $GLOBALS['SITE_DB']->query_insert('sales', array('date_and_time' => time(), 'memberid' => get_member(), 'purchasetype' => 'PURCHASE_CUSTOM_PRODUCT', 'details' => $c_title, 'details2' => strval($row['id'])), true);\n\n require_code('notifications');\n $subject = do_lang('MAIL_REQUEST_CUSTOM', comcode_escape($c_title), null, null, get_site_default_lang());\n $username = $GLOBALS['FORUM_DRIVER']->get_username(get_member());\n $message_raw = do_notification_lang('MAIL_REQUEST_CUSTOM_BODY', comcode_escape($c_title), $username, null, get_site_default_lang());\n dispatch_notification('pointstore_request_custom', 'custom' . strval($id) . '_' . strval($sale_id), $subject, $message_raw, null, null, 3, true, false, null, null, '', '', '', '', null, true);\n\n $member = get_member();\n\n // Email member\n require_code('mail');\n $subject_line = get_translated_text($row['c_mail_subject']);\n if ($subject_line != '') {\n $message_raw = get_translated_text($row['c_mail_body']);\n $email = $GLOBALS['FORUM_DRIVER']->get_member_email_address($member);\n $to_name = $GLOBALS['FORUM_DRIVER']->get_username($member, true);\n mail_wrap($subject_line, $message_raw, array($email), $to_name, '', '', 3, null, false, null, true);\n }\n\n // Show message\n $url = build_url(array('page' => '_SELF', 'type' => 'browse'), '_SELF');\n return redirect_screen($title, $url, do_lang_tempcode('ORDER_GENERAL_DONE'));\n }",
"public function totalCost(): float;",
"public function redeemGift(Request $request){\n\t\t$user = Auth::user();\n\t\t$user->load(['progression', 'rewards']); \n\t\t$reward_id = request('reward');\n\t\t$pivot_id = request('pivot');\n\t\tLog::info(\"here we go\");\n\t\t$info = $request->all();\n\t\tLog::info($info);\n\t\tLog::info($reward_id);\n\t\tLog::info($request->all());\n\t\tif($reward_id === 5){\n\t\t\t$user->progression->awardExperience(500);\n\t\t\t//announce\n\t\t}\n\t\t$reward = Reward::find($reward_id);\n\t\t//$user->rewards()->having('id', $reward_id)->update(['status' => 'redeemed']);\n\t\t$user->rewards()->wherePivot('id', $pivot_id)->updateExistingPivot($reward_id, ['status' => 'redeemed']);\n\t\t$return = User::find($user->id); \n\t\t$return->load(['progression', 'rewards']);\n\t\treturn $return;\n\n\t}",
"public function getTotalCost()\n {\n $this->loadItems();\n return $this->calculator->getCost($this->items);\n }",
"function itg_loyalty_reward_visit_content_points($node, $user) {\n itg_loyalty_reward_earnpoint($node->nid, 'visit', $user->uid);\n}",
"public static function update_reward_points_for_google_plus_share() {\n $userid = get_current_user_id();\n global $wpdb;\n $table_name = $wpdb->prefix . 'rspointexpiry'; \n $banning_type = FPRewardSystem::check_banning_type($userid);\n if ($banning_type != 'earningonly' && $banning_type != 'both') {\n if (get_option('timezone_string') != '') {\n $timezonedate = date_default_timezone_set(get_option('timezone_string'));\n } else {\n $timezonedate = date_default_timezone_set('UTC');\n }\n\n if (isset($_POST['state']) && ($_POST['postid']) && ($_POST['currentuserid'])) {\n $getregularprice = RSFunctionForSavingMetaValues::rewardsystem_get_post_meta($_POST['postid'], '_regular_price');\n $postid = $_POST['postid'];\n $currentuserid = $_POST['currentuserid']; \n $getarrayids[] = $_POST['postid'];\n $oldoption = RSFunctionForSavingMetaValues::rewardsystem_get_user_meta($_POST['currentuserid'], '_rsgoogleshares');\n if (!empty($oldoption)) {\n if (!in_array($_POST['postid'], $oldoption)) {\n $mergedata = array_merge((array) $oldoption, $getarrayids);\n RSFunctionForSavingMetaValues::rewardsystem_update_user_meta($_POST['currentuserid'], '_rsgoogleshares', $mergedata);\n if ($_POST['state'] == 'on') {\n $checklevel = self::checklevel_for_google_plus_share($postid);\n $orderid = '0';\n $totalearnedpoints = '0';\n $totalredeempoints= '0';\n $pointsredeemed = '0';\n $reasonindetail= '';\n self::rs_insert_google_plus_share_points($pointsredeemed,$getregularprice,$postid, $checklevel,$currentuserid,$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail); \n }\n }else {\n _e('You already Shared this post on Goole+1', 'rewardsystem');\n }\n }else {\n RSFunctionForSavingMetaValues::rewardsystem_update_user_meta($_POST['currentuserid'], '_rsgoogleshares', $getarrayids);\n if ($_POST['state'] == 'on') {\n $checklevel = self::checklevel_for_google_plus_share($postid);\n $orderid = '0';\n $totalearnedpoints = '0';\n $totalredeempoints= '0';\n $pointsredeemed = '0';\n $reasonindetail= '';\n self::rs_insert_google_plus_share_points($pointsredeemed,$getregularprice,$postid, $checklevel,$currentuserid,$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail); \n }\n }\n \n if ($_POST['state'] == 'off') {\n $getarrayunlikeids[] = $_POST['postid'];\n $oldunlikeoption = RSFunctionForSavingMetaValues::rewardsystem_get_user_meta($_POST['currentuserid'], '_rsgoogleplusunlikes');\n if (!empty($oldunlikeoption)) {\n if (!in_array($_POST['postid'], $oldunlikeoption)) {\n $mergedunlikedata = array_merge((array) $oldunlikeoption, $getarrayunlikeids);\n RSFunctionForSavingMetaValues::rewardsystem_update_user_meta($_POST['currentuserid'], '_rsgoogleplusunlikes', $mergedunlikedata);\n $checklevel = self::checklevel_for_google_plus_share($postid);\n $orderid = '0';\n $totalearnedpoints = '0';\n $totalredeempoints= '0';\n $pointsredeemed = '0';\n $reasonindetail= '';\n self::rs_insert_google_plus_share_revised_points($pointsredeemed,$getregularprice,$postid, $checklevel,$currentuserid,$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n }\n } else {\n RSFunctionForSavingMetaValues::rewardsystem_update_user_meta($_POST['currentuserid'], '_rsgoogleplusunlikes', $getarrayunlikeids);\n $checklevel = self::checklevel_for_google_plus_share($postid);\n $orderid = '0';\n $totalearnedpoints = '0';\n $totalredeempoints= '0';\n $pointsredeemed = '0';\n $reasonindetail= '';\n self::rs_insert_google_plus_share_revised_points($pointsredeemed,$getregularprice,$postid, $checklevel,$currentuserid,$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n }\n }\n echo \"Ajax Call Successfully Triggered\"; \n }\n do_action('fp_reward_point_for_google_plus_share');\n exit();\n }\n }",
"public function get_total_debit(){\n return $this->get_storage_cost() + $this->get_services_cost();\n }",
"function monthlyBalancedData(){\n\t\t//results to be returned\n\t\t$results= [];\n\t\t//the total expense of all the month of all users\n\t\t$results['total'] = $this->getMonthTotal();\n\t\t//the fair amount to be paid by each member\n\t\t// total/number of members on household\n\t\t$results['fairAmount'] = $results['total']/$this->getNumberOfMembers();\n\t\tforeach ($this->members as $member) {\n\t\t\t//retrieves the individual expenses\n\t\t\t$name = $member->getUserFirstName();\n\t\t\t$results['members'][$name] = $member->billsDistribution();\n\t\t}\n\t\treturn $results;\n\t}",
"function wpap_get_total_woocommerce_order_fees($order)\n{\n $total_fee = 0;\n $order_fee_items = $order->get_fees();\n if(!is_array($order_fee_items)){\n return $total_fee;\n }\n \n foreach ( $order_fee_items as $fee_item ) {\n $total_fee += $fee_item['line_total'];\n }\n return $total_fee;\n}",
"function approve(){\n\t\t$points= $this->ref('currently_requested_to_id')->get('points_available');\n\t\tif($points < 3000)\n\t\t\t$this->api->js()->univ()->errorMessage(\"Not suficcient points available, [ $points ]\")->execute();\n\t\t// Send point to the requester and less from your self ... \n\n\t\t$purchaser= $this->add('Model_MemberAll')->addCondition(\"id\",$this['request_from_id'])->tryLoadAny();\n\t\t$purchaser['points_available'] = $purchaser['points_available'] + 3000;\n\t\t$purchaser->save();\n\n\t\t$seller=$this->add('Model_MemberAll')->addCondition(\"id\",$this['currently_requested_to_id'])->tryLoadAny();\n\t\t$seller['points_available'] = $seller['points_available'] - 3000;\n\t\t$seller->save();\n\n\t\tif($this->api->auth->model->id == 1)\n\t\t\t$this['status']='Approved By Admin';\n\t\telse\n\t\t\t$this['status']='Approved';\n\n\t\t$this->save();\n\n\n\t}",
"public function earnings( Request $request ) {\n\t\t$provider =\n\t\t\tProvider::where( 'id', Auth::guard( 'provider' )->user()->id )\n\t\t\t\t->with( 'service', 'accepted', 'cancelled' )\n\t\t\t\t->get();\n\n\t\t$weekly = UserRequests::where( 'provider_id',\n\t\t\tAuth::guard( 'provider' )->user()->id )\n\t\t\t->with( 'payment' )\n\t\t\t->where( 'created_at', '>=', Carbon::now()->subWeekdays( 7 ) )\n\t\t\t->get();\n\n\t\t$weekly_sum = UserRequestPayment::whereHas( 'request',\n\t\t\tfunction ( $query ) {\n\t\t\t\t$query->where( 'provider_id',\n\t\t\t\t\tAuth::guard( 'provider' )->user()->id );\n\t\t\t\t$query->where( 'created_at',\n\t\t\t\t\t'>=',\n\t\t\t\t\tCarbon::now()->subWeekdays( 7 ) );\n\t\t\t} )\n\t\t\t->sum( 'provider_pay' );\n\n\t\t$today = UserRequests::where( 'provider_id',\n\t\t\tAuth::guard( 'provider' )->user()->id )\n\t\t\t->where( 'created_at', '>=', Carbon::today() )\n\t\t\t->count();\n\n\t\t$fully = UserRequests::where( 'provider_id',\n\t\t\tAuth::guard( 'provider' )->user()->id )\n\t\t\t->with( 'payment', 'service_type' )->orderBy( 'id', 'desc' );\n\n\n\t\t$fully_sum = UserRequestPayment::whereHas( 'request',\n\t\t\tfunction ( $query ) {\n\t\t\t\t$query->where( 'provider_id',\n\t\t\t\t\tAuth::guard( 'provider' )->user()->id );\n\t\t\t} )\n\t\t\t->sum( 'provider_pay' );\n\t\t//get dispute reason\n\t\t$dispute_reason = Dispute::where(['dispute_type'=>'provider','status'=>'active'])->pluck('dispute_name');\n\t\t//get dispute content\n\t\t$dispute_content = UserRequestDispute::where(['dispute_type'=>'provider', 'provider_id'=>Auth::guard( 'provider' )->user()->id])->get();\n\t\t$dispute_id = UserRequestDispute::where(['dispute_type'=>'provider', 'provider_id'=>Auth::guard( 'provider' )->user()->id])->pluck('request_id')->toArray();\n\n\t\t$revenue = UserRequestPayment::select( DB::raw(\n\t\t\t'SUM(provider_pay) as overall, SUM(commision + peak_comm_amount + waiting_comm_amount) as commission'\n\t\t) )->where('provider_id',Auth::guard('provider')->user()->id)->get();\n\n//dd($dispute_id);\n\t\tif ( $request->from_date && $request->to_date ) {\n\t\t\tif ( $request->from_date == $request->to_date ) {\n\t\t\t\t$fully->whereDate( 'created_at',\n\t\t\t\t\tdate( 'Y-m-d', strtotime( $request->from_date ) ) );\n\t\t\t} else {\n\t\t\t\t$fully->whereBetween( 'created_at',\n\t\t\t\t\t[\n\t\t\t\t\t\tCarbon::createFromFormat( 'Y-m-d',\n\t\t\t\t\t\t\t$request->from_date ),\n\t\t\t\t\t\tCarbon::createFromFormat( 'Y-m-d', $request->to_date ),\n\t\t\t\t\t] );\n\t\t\t}\n\t\t}\n\t\t$fully = $fully->get();\n\n\t\t$dates['yesterday'] = Carbon::yesterday()->format( 'Y-m-d' );\n\t\t$dates['today'] = Carbon::today()->format( 'Y-m-d' );\n\t\t$dates['pre_week_start'] =\n\t\t\tdate( \"Y-m-d\", strtotime( \"last week monday\" ) );\n\t\t$dates['pre_week_end'] =\n\t\t\tdate( \"Y-m-d\", strtotime( \"last week sunday\" ) );\n\t\t$dates['cur_week_start'] =\n\t\t\tCarbon::today()->startOfWeek()->format( 'Y-m-d' );\n\t\t$dates['cur_week_end'] =\n\t\t\tCarbon::today()->endOfWeek()->format( 'Y-m-d' );\n\t\t$dates['pre_month_start'] =\n\t\t\tCarbon::parse( 'first day of last month' )->format( 'Y-m-d' );\n\t\t$dates['pre_month_end'] =\n\t\t\tCarbon::parse( 'last day of last month' )->format( 'Y-m-d' );\n\t\t$dates['cur_month_start'] =\n\t\t\tCarbon::parse( 'first day of this month' )->format( 'Y-m-d' );\n\t\t$dates['cur_month_end'] =\n\t\t\tCarbon::parse( 'last day of this month' )->format( 'Y-m-d' );\n\t\t$dates['pre_year_start'] =\n\t\t\tdate( \"Y-m-d\", strtotime( \"last year January 1st\" ) );\n\t\t$dates['pre_year_end'] =\n\t\t\tdate( \"Y-m-d\", strtotime( \"last year December 31st\" ) );\n\t\t$dates['cur_year_start'] =\n\t\t\tCarbon::parse( 'first day of January' )->format( 'Y-m-d' );\n\t\t$dates['cur_year_end'] =\n\t\t\tCarbon::parse( 'last day of December' )->format( 'Y-m-d' );\n\t\t$dates['nextWeek'] =\n\t\t\tCarbon::today()->addWeek()->format( 'Y-m-d' );\n\n\t\t$from_date = $request ? $request->from_date : \"\";\n\t\t$to_date = $request ? $request->to_date : \"\";\n\n\t\treturn view( 'provider.payment.earnings',\n\t\t\tcompact( 'provider',\n\t\t\t\t'weekly',\n\t\t\t\t'fully',\n\t\t\t\t'today',\n\t\t\t\t'weekly_sum',\n\t\t\t\t'fully_sum',\n\t\t\t\t'dates',\n\t\t\t\t'from_date',\n\t\t\t\t'to_date',\n\t\t\t\t'dispute_reason',\n\t\t\t\t'dispute_content',\n\t\t\t\t'dispute_id',\n\t\t\t\t'revenue'\n\t\t\t\t) );\n\t}",
"public function get_loyalty_balance($userId) { \n $loyalty_consumption = 0;\n $total_points_earned_to_date = 0;\n \n $loyaltyBalanceDetails = array();\n $loyaltyBalanceDetails['BalancePoints']= 0;\n \n # Get loyalty earned details till date\n $loyaltyEarnedDetails = $this -> get_loyalty_earned_details($userId); \n \n if($loyaltyEarnedDetails)\n {\n $total_points_earned_to_date = $loyaltyEarnedDetails['userProductReviews'] + $loyaltyEarnedDetails['userProductShares'] + $loyaltyEarnedDetails['userAppShares']; \n }\n \n # Get loyalty redeemed details\n $redeemedDetails = $this -> get_loyalty_redeemed_details($userId);\n \n \n if($redeemedDetails)\n {\n $loyalty_consumption = $redeemedDetails['loyalty_consumption'];\n }\n \n return $loyaltyBalanceDetails['BalancePoints'] = $total_points_earned_to_date - $loyalty_consumption;\n }",
"public function iN_TotalPremiumEarnings($userID) {\n\t\t$userID = mysqli_real_escape_string($this->db, $userID);\n\t\tif ($this->iN_CheckIsAdmin($userID) == 1) {\n\t\t\t$query = mysqli_query($this->db, \"SELECT SUM(admin_earning) AS premEarn FROM i_user_payments WHERE payment_status = 'ok'\") or die(mysqli_error($this->db));\n\t\t\t$row = mysqli_fetch_array($query, MYSQLI_ASSOC);\n\t\t\treturn isset($row['premEarn']) ? $row['premEarn'] : '0.00';\n\t\t}\n\t}",
"public function charges();",
"function reffer_amount() {\n\t\t$user_id = $_REQUEST['user_id'];\n\t\tif (!empty($user_id)) {\n\t\t\t$reffer_records = $this -> conn -> get_all_records('reffer_amount');\n\t\t\t$refferal_amount = $reffer_records[0]['reffer_amount'];\n\n\t\t\t$records = $this -> conn -> get_table_row_byidvalue_sum('refferal_records', 'refferal_frnd_id', $user_id, 'refferal_amount');\n\t\t\t$user_reffer_amount = $records[0]['total'];\n\t\t\tif (!empty($user_reffer_amount)) {\n\t\t\t\t$user_reffer_amount = $user_reffer_amount;\n\t\t\t} else {\n\t\t\t\t$user_reffer_amount = '0';\n\t\t\t}\n\t\t\t$post = array(\"status\" => \"true\", 'reffer_amount' => $refferal_amount, 'user_total_reffer_amount' => $user_reffer_amount, 'user_id' => $user_id);\n\n\t\t} else {\n\t\t\t$post = array(\"status\" => \"false\", 'message' => 'missing parameter', 'user_id' => $user_id);\n\t\t}\n\t\techo $this -> json($post);\n\t}",
"public function set_credits_discountamount($observer)\n {\n$array2 = Mage::helper('kartparadigm_storecredit')->getCreditRates();\n//Mage::log(Mage::helper('kartparadigm_storecredit')->getRefundDeductConfig() . \" configuration settings \");\n//Mage::log($array2);\n $session = Mage::getSingleton('checkout/session');\n if(Mage::helper('customer')->isLoggedIn()) {\n $customer = Mage::getSingleton('customer/session')->getCustomer();\n $customer_group=Mage::getModel('customer/group')->load(Mage::getSingleton('customer/session')->getCustomerGroupId())->getCustomerGroupCode();\n}\n \n$val1 = Mage::getSingleton('adminhtml/session')->getValue();\nif(isset($val1))\n{\n$amt1 = array();\n$amt1 = Mage::getSingleton('checkout/session')->getCredits();\n$amt = $amt1['totalCredits'];\n$quote = Mage::getSingleton('adminhtml/session_quote')->getQuote();\n}\nelse{\n$amt1 = array();\n $quote = Mage::getModel('checkout/cart')->getQuote();\n$amt1 = Mage::getSingleton('checkout/session')->getCredits();\n$amt = $amt1['discountCredits'];\n}\n $isvirtual=0;\n foreach($quote->getAllItems() as $item){\n if($item->getIsVirtual()==1) {\n $isvirtual=1;\n }\n if(Mage::getModel('catalog/product')->load($item->getProductId())->getTypeId()=='customproduct'){\n $isvirtual=1;\n }\n }\n$total=$quote->getGrandTotal(); \n\n$subTotal = $quote->getSubtotal();\n//Mage::log($quote->getGrandTotal().\"this is grand total store credit\");\n//Mage::log($quote->getSubtotal().\"this is sub total\");\n\n if (!Mage::helper('kartparadigm_storecredit')->getTaxEnabled()){\n$tax = $quote->getShippingAddress()->getData('tax_amount');\n}\n if(!Mage::helper('kartparadigm_storecredit')->getIsShippingEnabled()){\n$shippingPrice = $quote->getShippingAddress()->getShippingAmount();\n}\n$totalCredits1 = array();\n$totalCredits1 = Mage::getSingleton('checkout/session')->getCredits();\n$totalCredits = $totalCredits1['totalCredits'];\n\n$currentTimestamp = Mage::getModel('core/date')->timestamp(time()); \n$nowdate = date('Y-m-d H:m:s', $currentTimestamp); \n//echo $expirydate;\n//echo $nowdate;\n$balance;\n//echo $amt;\n$amt2;\n $amt1;\n \n\nif(isset($amt)){\n/*---------------------Calculating Default Currency Value----------------------- */\n$amt1 = ($array2['basevalue'] * $amt) / $array2['credits'];\n $baseCurrencyCode = Mage::app()->getStore()->getBaseCurrencyCode();\n $currentCurrencyCode = Mage::app()->getStore()->getCurrentCurrencyCode();\n if ($baseCurrencyCode != $currentCurrencyCode) {\n $amt2 = Mage::helper('directory')->currencyConvert($amt1, $baseCurrencyCode, $currentCurrencyCode);\n }\n else{\n $amt2 = $amt1; \n }\n // $amt2 = Mage::helper('core')->currency($amt1, true, false);\n//Mage::log($amt1.\" = amount = \".$amt2 );\n//----------------------------------------------------------------\nif($total > $amt2) {\nif(($total - $tax - $shippingPrice) > $amt2){\n$discountAmount = $amt2;\n$balance = $totalCredits - $amt;\n}else{\n $discountAmount = $subTotal;\n$points = round(($discountAmount * $amt)/$amt2);\n//Mage::log($points.\"Conver Points\");\n$balance = $totalCredits - $points;\n}\n}\nelse {\n$discountAmount = $total - $tax - $shippingPrice;\n$points = round(($discountAmount * $amt)/$amt2);\n//Mage::log($points.\"Conver Points\");\n$balance = $totalCredits - $points;\n}\nMage::getSingleton('core/session')->setBalance($balance);\n\nMage::getSingleton('checkout/session')->setDiscount($totalCredits - $balance);\n$msg = \"Current Credits In Your Account : \" . $balance;\nMage::getSingleton('core/session')->setCredits($msg);\n if ($discountAmount > 0) {\n\n\nif ($baseCurrencyCode != $currentCurrencyCode) {\n \n$allowedCurrencies = Mage::getModel('directory/currency')->getConfigAllowCurrencies();\n$rates = Mage::getModel('directory/currency')->getCurrencyRates($baseCurrencyCode, array_values($allowedCurrencies));\n\n$baseDiscount = $discountAmount/$rates[$currentCurrencyCode];\n\n }\nelse{\n $baseDiscount = $discountAmount;\n } \n $total = $quote->getBaseSubtotal();\n $data1 = $quote->getData();\n // Mage::log($data1['entity_id'].\"quote id\");\n $quote->setSubtotal(0);\n $quote->setBaseSubtotal(0);\n $quote->setSubtotalWithDiscount(0);\n $quote->setBaseSubtotalWithDiscount(0);\n $quote->setGrandTotal(0);\n $quote->setBaseGrandTotal(0);\n $canAddItems = $quote->isVirtual() ? ('billing') : ('shipping');\n foreach($quote->getAllAddresses() as $address) {\n $data = $address->getData();\n $address->setSubtotal(0);\n $address->setBaseSubtotal(0);\n $address->setGrandTotal(0);\n $address->setBaseGrandTotal(0);\n $address->collectTotals();\n $quote->setSubtotal((float)$quote->getSubtotal() + $address->getSubtotal());\n $quote->setBaseSubtotal((float)$quote->getBaseSubtotal() + $address->getBaseSubtotal());\n $quote->setSubtotalWithDiscount((float)$quote->getSubtotalWithDiscount() + $address->getSubtotalWithDiscount());\n $quote->setBaseSubtotalWithDiscount((float)$quote->getBaseSubtotalWithDiscount() + $address->getBaseSubtotalWithDiscount());\n $quote->setGrandTotal((float)$quote->getGrandTotal() + $address->getGrandTotal());\n $quote->setBaseGrandTotal((float)$quote->getBaseGrandTotal() + $address->getBaseGrandTotal());\n $quote->setEntityId($data1['entity_id'])->save();\n $quote->setSubtotalWithDiscount($quote->getSubtotal() - $discountAmount)->setBaseSubtotalWithDiscount($quote->getBaseSubtotal() - $baseDiscount)->setEntityId($data1['entity_id'])->save();\n if ($address->getAddressType() == $canAddItems) {\n $address->setSubtotalWithDiscount((float)$data['subtotal_with_discount'] - $discountAmount);\n $address->setGrandTotal((float)$data['grand_total'] - $discountAmount);\n $address->setBaseSubtotalWithDiscount((float)$data['base_subtotal_with_discount'] - $baseDiscount);\n $address->setBaseGrandTotal((float)$data['base_grand_total'] - $baseDiscount);\n if ($data['discount_description']) {\n $address->setDiscountAmount(($data['discount_amount'] - $discountAmount));\n $address->setDiscountDescription($data['discount_description'] . ', Store Credits');\n $address->setBaseDiscountAmount(($data['base_discount_amount'] - $baseDiscount));\n }\n else {\n $address->setDiscountAmount(-($discountAmount));\n $address->setDiscountDescription('Store Credits');\n $address->setBaseDiscountAmount(-($baseDiscount));\n }\n $address->setAddressId($data['address_id'])->save();\n }\n }\n foreach($quote->getAllItems() as $item) {\n\n // We apply discount amount based on the ratio between the GrandTotal and the RowTotal\n $rat = $item->getPriceInclTax() / $quote->getSubtotal();\n $rat1 = $item->getBasePriceInclTax() / $quote->getBaseSubtotal();\n $ratdisc = $discountAmount * $rat;\n $ratdisc1 = $baseDiscount * $rat1;\n//Mage::log($item->getDiscountAmount().\"include tax\".$item->getBaseDiscountAmount());\n // Mage::log($item->getDiscountAmount().\"discount storecredit\");\n$idata = $item->getData();\n Mage::log($item->getDiscountAmount().\"discount amount credit\");\n $item->setDiscountAmount(($item->getDiscountAmount() + $ratdisc) * $item->getQty());\n $item->setBaseDiscountAmount(($item->getBaseDiscountAmount() + $ratdisc1) * $item->getQty())->save();\n }\n }else if($totalCredits == 0){\n\n$msg = \"Sorry You Have No Credits In Your Account\";\nMage::getSingleton('core/session')->setCredits($msg);\n}\n \n \n } \n }",
"public function run()\n {\n //\n $commercialCompreheniveCost = [\n [\n 'commercial_class_id'=>1,\n 'sum_insured_from_value'=>0,\n 'sum_insured_to_value'=>3000000, \n 'rate'=>4.50\n ],\n [\n 'commercial_class_id'=>1,\n 'sum_insured_from_value'=>3000001,\n 'sum_insured_to_value'=>0, \n 'rate'=>4.25\n ],\n [\n 'commercial_class_id'=>2,\n 'sum_insured_from_value'=>0,\n 'sum_insured_to_value'=>3000000, \n 'rate'=>5.75\n ],\n [\n 'commercial_class_id'=>2,\n 'sum_insured_from_value'=>3000001,\n 'sum_insured_to_value'=>7000000, \n 'rate'=>5.25\n ],\n [\n 'commercial_class_id'=>2,\n 'sum_insured_from_value'=>7000001,\n 'sum_insured_to_value'=>0, \n 'rate'=>4.25\n ],\n [\n 'commercial_class_id'=>3,\n 'sum_insured_from_value'=>0,\n 'sum_insured_to_value'=>3000000, \n 'rate'=>3\n ],\n [\n 'commercial_class_id'=>3,\n 'sum_insured_from_value'=>3000001,\n 'sum_insured_to_value'=>0, \n 'rate'=>2.5\n ],\n [\n 'commercial_class_id'=>4,\n 'sum_insured_from_value'=>0,\n 'sum_insured_to_value'=>2000000, \n 'rate'=>7.5\n ],\n [\n 'commercial_class_id'=>4,\n 'sum_insured_from_value'=>2000001,\n 'sum_insured_to_value'=>0, \n 'rate'=>6\n ],\n [\n 'commercial_class_id'=>5,\n 'sum_insured_from_value'=>600000,\n 'sum_insured_to_value'=>0, \n 'rate'=>4\n ],\n [\n 'commercial_class_id'=>6,\n 'sum_insured_from_value'=>600000,\n 'sum_insured_to_value'=>0, \n 'rate'=>4\n ],\n [\n 'commercial_class_id'=>7,\n 'sum_insured_from_value'=>600000,\n 'sum_insured_to_value'=>0, \n 'rate'=>4\n ],\n [\n 'commercial_class_id'=>8,\n 'sum_insured_from_value'=>600000,\n 'sum_insured_to_value'=>0, \n 'rate'=>12.5\n ],\n ];\n \n foreach($commercialCompreheniveCost as $key => $value){\n\n CommercialComprehensiveCost::create($value);\n\n }\n }",
"public function calculate() {\n $price = $this->calculateFirstPayment($user);\n\n $currency = $price->currency;\n\n if ($user == Constants::USER_CLIENT) {\n $credit = ClientTransaction::getCreditBalance(Yii::app()->user->id);\n } else {\n $credit = new Price(0, $currency); //carer can't have credit\n }\n\n $paidCredit = new Price(0, $currency);\n $paidCash = new Price(0, $currency);\n $remainingCreditBalance = new Price(0, $currency);\n\n if ($credit->amount > 0) {\n\n if ($credit->amount >= $price->amount) {\n\n $paidCredit = $price;\n $remainingCreditBalance = $credit->substract($price);\n } else {\n\n $paidCash = $price->substract($credit);\n $paidCredit = $credit;\n }\n } else {\n $paidCash = $price;\n }\n\n return array('toPay' => $price, 'paidCash' => $paidCash, 'paidCredit' => $paidCredit, 'remainingCreditBalance' => $remainingCreditBalance);\n }",
"public function getItemsCollection()\r\n {\r\n $items = array();\r\n\r\n $colletions = $this->getOrder()->getItemsCollection();\r\n foreach($colletions as $item){\r\n $models = Mage::getModel(\"vendorsrma/item\")->getCollection()->addFieldToFilter(\"order_item_id\",$item->getId());\r\n $qty_rma_old = 0;\r\n $rmas = null;\r\n $options = Mage::getModel(\"vendorsrma/status\")->getOptions();\r\n foreach($models as $rma_item){\r\n $request = Mage::getModel(\"vendorsrma/request\")->load($rma_item->getRequestId());\r\n if($request->getData(\"status\") == $options[3][\"value\"]) continue;\r\n /* check request not complete */\r\n $qty_rma_old += $rma_item->getQty();\r\n\r\n $rmas[] = array($request->getId() => $request->getData(\"increment_id\"));\r\n }\r\n \r\n if( $this->getOrder()->getStatus() == Mage_Sales_Model_Order::STATE_COMPLETE){\r\n if($qty_rma_old == 0){\r\n $qty = $item->getData(\"qty_shipped\") - $item->getData(\"qty_refunded\") > 0 ? $item->getData(\"qty_shipped\") - $item->getData(\"qty_refunded\") : 0;\r\n $item->setData(\"qty_rma\",(int)$qty);\r\n $item->setData(\"allow_per_item_order\",$this->allowPerItem());\r\n }\r\n else{\r\n $qty = $item->getData(\"qty_shipped\") - $item->getData(\"qty_refunded\") - $qty_rma_old > 0 ? $item->getData(\"qty_shipped\") - $item->getData(\"qty_refunded\") - $qty_rma_old : 0;\r\n $item->setData(\"qty_rma\",(int)$qty);\r\n $item->setData(\"request_rma\",$rmas);\r\n $item->setData(\"allow_per_item_order\",$this->allowPerItem());\r\n }\r\n }\r\n else{\r\n if($qty_rma_old == 0){\r\n $qty = $item->getData(\"qty_invoiced\") > 0 ? $item->getData(\"qty_invoiced\") : 0;\r\n $item->setData(\"qty_rma\",(int)$qty);\r\n $item->setData(\"allow_per_item_order\",$this->allowPerItem());\r\n }\r\n else{\r\n $qty = $item->getData(\"qty_invoiced\") - $qty_rma_old > 0 ? $item->getData(\"qty_invoiced\") - $qty_rma_old : 0;\r\n $item->setData(\"qty_rma\",(int)$qty);\r\n $item->setData(\"request_rma\",$rmas);\r\n $item->setData(\"allow_per_item_order\",$this->allowPerItem());\r\n }\r\n }\r\n \r\n\r\n $items[] = $item;\r\n }\r\n\r\n\r\n return $items;\r\n }",
"public function collect(\\Magento\\Sales\\Model\\Order\\Creditmemo $creditmemo)\n {\n $order = $creditmemo->getOrder();\n\n $totalDiscountAmount = $order->getMwRewardpointDiscountShow();\n $baseTotalDiscountAmount = $order->getMwRewardpointDiscount();\n\n $creditmemo->setGrandTotal($creditmemo->getGrandTotal() - $totalDiscountAmount);\n $creditmemo->setBaseGrandTotal($creditmemo->getBaseGrandTotal() - $baseTotalDiscountAmount);\n $creditmemo->setMwRewardpoint($order->getMwRewardpoint());\n $creditmemo->setMwRewardpointDiscountShow($totalDiscountAmount);\n $creditmemo->setMwRewardpointDiscount($baseTotalDiscountAmount);\n\n return $this;\n }",
"public function calculateSumPriceUserData() {\n $submission_user_data = $this->CI->session->userdata('submission');\n $sum = 0;\n foreach ($submission_user_data as $submission) {\n foreach ($submission as $key => $field) {\n// preVarDump($field);\n $field = $this->CI->form_m->getFieldAsName($submission['event_id'], $key);\n if ($field & count($field->options) > 0) {\n foreach ($field->options as $key_option => $value) {\n if ($value->option_value == $field) {\n \n }\n }\n }\n //preVarDump($field);\n }\n }\n }",
"public static function getPointsRewardTypes()\n {\n return [\n self::REWARD_TYPE_POINTS,\n self::REWARD_TYPE_RANDOM_AMOUNT_OF_POINTS,\n ];\n }",
"public function getTotalCustomers()\n {\n $AdminDashboardModel = $this->model('AdminDashboardModel');\n $this->totalCustomers = $AdminDashboardModel->getTotalCustomers();\n }",
"function getSubroundPoints($result)\n\t{\n\t\t$points = $result->bonus_points;\n\t\tif (!empty($result->points_attribution) && $result->rank)\n\t\t{\n\t\t\t$points_attrib = explode(',', $result->points_attribution);\n\t\t\tJArrayHelper::toInteger($points_attrib);\n\t\t\tif ( isset( $points_attrib[$result->rank-1] ) ) {\n\t\t\t\t$points += $points_attrib[$result->rank-1];\n\t\t\t}\n\t\t}\n\t\treturn $points;\n\t}",
"public function reward(Request $request)\n {\n $this->user->achievement()->update([\n 'points' => ($this->user->achievement->points - $request->rewardPoints)\n ]);\n $this->user->rewards()->attach($request->rewardId, ['id' => Str::random()]);\n\n return response()->json([\n 'message' => \"Confirmation sent. Just present your reference # to the department office to claim your reward.\\n\\nReference #: {$this->user->rewards->first()->pivot->id}\"\n ]);\n }",
"public function calculateRentalFees($rentalsData): array\n {\n// die(var_dump('test'));\n $totalAmount = 0;\n $frequentRenterPoints = 0;\n $rentals = [];\n\n foreach ($rentalsData as $rental) {\n\n $thisAmount = 0;\n\n switch($rental->code_name) {\n case Movie::REGULAR:\n case Movie::SCI_FI:\n $thisAmount += 2;\n if ($rental->duration > 2) {\n $thisAmount += ($rental->duration - 2) * 1.5;\n }\n break;\n case Movie::NEW_RELEASE:\n $thisAmount += $rental->total_rentals * 3;\n if ($rental->duration > 1) {\n $frequentRenterPoints++;\n }\n break;\n case Movie::CHILDRENS:\n $thisAmount += 1.5;\n if ($rental->duration > 3) {\n $thisAmount += ($rental->duration - 3) * 1.5;\n }\n break;\n }\n\n $totalAmount += $thisAmount;\n $frequentRenterPoints++;\n $rentals[] = [\n 'name' => $rental->name,\n 'total_rentals' => $rental->total_rentals,\n 'duration' => $rental->duration,\n 'individual_amount_owed' => number_format($thisAmount, 2, '.', '')\n ];\n }\n\n $totals = [\n 'total_amount_owed' => number_format($totalAmount, 2, '.', ''),\n 'frequent_renter_points' => $frequentRenterPoints\n ];\n\n return [\n 'rentals' => $rentals,\n 'totals' => $totals\n ];\n }",
"public static function rs_insert_google_plus_share_points($pointsredeemed,$getregularprice,$postid, $level,$currentuserid,$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail){\n \n $rewardpoints = array('0');\n $rewardpercents = array('0'); \n\n //Product Level Points and Percent\n $gettype = RSFunctionForSavingMetaValues::rewardsystem_get_post_meta($postid, '_social_rewardsystem_options_google');\n $getpoints = RSFunctionForSavingMetaValues::rewardsystem_get_post_meta($postid, '_socialrewardsystempoints_google');\n $getpercent = RSFunctionForSavingMetaValues::rewardsystem_get_post_meta($postid, '_socialrewardsystempercent_google');\n $pointconversion = get_option('rs_earn_point');\n $pointconversionvalue = get_option('rs_earn_point_value');\n $getaverage = $getpercent / 100;\n $getaveragepoints = $getaverage * $getregularprice;\n $pointswithvalue = $getaveragepoints * $pointconversion;\n $rewardpercentsforproductlevel = $pointswithvalue / $pointconversionvalue;\n\n //Category Level Points and Percent\n $categorylist = wp_get_post_terms($postid, 'product_cat');\n $getcount = count($categorylist);\n $term = get_the_terms($postid,'product_cat');\n if(is_array($term)) {\n foreach ($term as $terms) {\n $termid = $terms->term_id; \n $categorylevelrewardtype = RSFunctionForSavingMetaValues::rewardsystem_get_woocommerce_term_meta($termid, 'social_google_enable_rs_rule');\n $categorylevelrewardpoints = RSFunctionForSavingMetaValues::rewardsystem_get_woocommerce_term_meta($termid, 'social_google_rs_category_points');\n $categorylevelrewardpercents = RSFunctionForSavingMetaValues::rewardsystem_get_woocommerce_term_meta($termid, 'social_google_rs_category_percent');\n $pointconversion = get_option('rs_earn_point');\n $pointconversionvalue = get_option('rs_earn_point_value');\n $getaverage = $categorylevelrewardpercents / 100;\n $getaveragepoints = $categorylevelrewardpercents * $getregularprice;\n $pointswithvalue = $getaveragepoints * $pointconversion;\n $rewardpercentsforcategorylevel = $pointswithvalue / $pointconversionvalue;\n \n //Global Level Points and Percent\n $global_reward_type = get_option('rs_global_social_reward_type_google');\n $global_reward_points = get_option('rs_global_social_google_reward_points');\n $global_reward_percent = get_option('rs_global_social_google_reward_percent');\n $pointconversion = get_option('rs_earn_point');\n $pointconversionvalue = get_option('rs_earn_point_value');\n $getaverage = $global_reward_percent / 100;\n $getaveragepoints = $global_reward_percent * $getregularprice;\n $pointswithvalue = $getaveragepoints * $pointconversion;\n $rewardpercentsforgloballevel = $pointswithvalue / $pointconversionvalue;\n \n if($getcount > 1){ \n if($categorylevelrewardpoints == ''){\n $rewardpoints[] = $global_reward_points;\n }else{\n $rewardpoints[] = $categorylevelrewardpoints;\n }\n \n if($categorylevelrewardpercents == ''){\n $rewardpercents[] = $rewardpercentsforgloballevel;\n } else{\n $rewardpercents[] = $rewardpercentsforcategorylevel;\n } \n } else { \n if($categorylevelrewardpoints == ''){\n $rewardpoints[] = $global_reward_points;\n }else{\n $rewardpoints[] = $categorylevelrewardpoints;\n }\n \n if($categorylevelrewardpercents == ''){\n $rewardpercents[] = $rewardpercentsforgloballevel;\n } else{\n $rewardpercents[] = $rewardpercentsforcategorylevel;\n } \n }\n }\n }else {\n $global_reward_type = get_option('rs_global_social_reward_type_google');\n $global_reward_points = get_option('rs_global_social_google_reward_points');\n $global_reward_percent = get_option('rs_global_social_google_reward_percent');\n $pointconversion = get_option('rs_earn_point');\n $pointconversionvalue = get_option('rs_earn_point_value');\n $getaverage = $global_reward_percent / 100;\n $getaveragepoints = $global_reward_percent * $getregularprice;\n $pointswithvalue = $getaveragepoints * $pointconversion;\n $rewardpercentsforgloballevel = $pointswithvalue / $pointconversionvalue;\n }\n \n $getcategorypoints = max($rewardpoints);\n $getcategorypercent = max($rewardpercents);\n $restrictuserpoints = get_option('rs_max_earning_points_for_user');\n $enabledisablemaxpoints = get_option('rs_enable_disable_max_earning_points_for_user');\n $order_id = '0';\n $variationid = '0';\n $refuserid = '0';\n $equredeemamt = '0';\n $pointsredeemed = '0';\n $totalearnedpoints = '0';\n $totalredeempoints = '0';\n $reasonindetail = '';\n $noofdays = get_option('rs_point_to_be_expire');\n if(($noofdays != '0')&& ($noofdays != '')){\n $date = time() + ($noofdays * 24 * 60 * 60); \n }else{\n $date = '999999999999';\n }\n switch ($level) {\n case '1':\n if ($gettype == '1') { \n if($enabledisablemaxpoints == 'yes'){\n if(($restrictuserpoints != '') && ($restrictuserpoints != '0')){\n $getoldpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n if($getoldpoints <= $restrictuserpoints){\n $totalpointss = $getoldpoints + $getpoints;\n if($totalpointss <= $restrictuserpoints){\n $productlevelrewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $getpoints); \n RSPointExpiry::insert_earning_points($currentuserid, $productlevelrewardpointss,$pointsredeemed,$date, 'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($productlevelrewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $productlevelrewardpointss,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n }else{\n $insertpoints = $restrictuserpoints - $getoldpoints;\n RSPointExpiry::insert_earning_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$order_id,$totalearnedpoints,$totalredeempoints,'');\n $equearnamt = RSPointExpiry::earning_conversion_settings($insertpoints);\n $equredeemamt = RSPointExpiry::redeeming_conversion_settings($pointsredeemed); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$equearnamt,$equredeemamt,$order_id,$productid,'0','0','',$totalpoints,'','0'); \n }\n }else{\n RSPointExpiry::insert_earning_points($currentuserid,'0','0',$date,'MREPFU',$order_id,'0','0','');\n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, '0','0',$date,'MREPFU','0','0',$order_id,'0','0','0','',$totalpoints,'','0'); \n }\n }else{\n $productlevelrewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $getpoints); \n RSPointExpiry::insert_earning_points($currentuserid, $productlevelrewardpointss,$pointsredeemed,$date, 'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($productlevelrewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $productlevelrewardpointss,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n }\n }else{\n $productlevelrewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $getpoints); \n RSPointExpiry::insert_earning_points($currentuserid, $productlevelrewardpointss,$pointsredeemed,$date, 'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($productlevelrewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $productlevelrewardpointss,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n } \n } else {\n \n if($enabledisablemaxpoints == 'yes'){\n if(($restrictuserpoints != '') && ($restrictuserpoints != '0')){\n $getoldpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n if($getoldpoints <= $restrictuserpoints){\n $totalpointss = $getoldpoints + $rewardpercentsforproductlevel;\n if($totalpointss <= $restrictuserpoints){\n $productlevelrewardpercentss = RSMemberFunction::user_role_based_reward_points($currentuserid, $rewardpercentsforproductlevel); \n RSPointExpiry::insert_earning_points($currentuserid, $productlevelrewardpercentss,$pointsredeemed,$date, 'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($productlevelrewardpercentss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $productlevelrewardpercentss,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n }else{\n $insertpoints = $restrictuserpoints - $getoldpoints;\n RSPointExpiry::insert_earning_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$order_id,$totalearnedpoints,$totalredeempoints,'');\n $equearnamt = RSPointExpiry::earning_conversion_settings($insertpoints);\n $equredeemamt = RSPointExpiry::redeeming_conversion_settings($pointsredeemed); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$equearnamt,$equredeemamt,$order_id,$productid,'0','0','',$totalpoints,'','0'); \n }\n }else{\n RSPointExpiry::insert_earning_points($currentuserid,'0','0',$date,'MREPFU',$order_id,'0','0','');\n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, '0','0',$date,'MREPFU','0','0',$order_id,'0','0','0','',$totalpoints,'','0'); \n }\n }else{\n $productlevelrewardpercentss = RSMemberFunction::user_role_based_reward_points($currentuserid, $rewardpercentsforproductlevel); \n RSPointExpiry::insert_earning_points($currentuserid, $productlevelrewardpercentss,$pointsredeemed, $date,'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($productlevelrewardpercentss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $productlevelrewardpercentss,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n }\n }else{\n $productlevelrewardpercentss = RSMemberFunction::user_role_based_reward_points($currentuserid, $rewardpercentsforproductlevel); \n RSPointExpiry::insert_earning_points($currentuserid, $productlevelrewardpercentss,$pointsredeemed,$date, 'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($productlevelrewardpercentss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $productlevelrewardpercentss,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n } \n }\n break;\n case '2':\n if ($categorylevelrewardtype == '1') {\n if($enabledisablemaxpoints == 'yes'){\n if(($restrictuserpoints != '') && ($restrictuserpoints != '0')){\n $getoldpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n if($getoldpoints <= $restrictuserpoints){\n $totalpointss = $getoldpoints + $getcategorypoints;\n if($totalpointss <= $restrictuserpoints){\n $categorylevelrewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $getcategorypoints); \n RSPointExpiry::insert_earning_points($currentuserid, $categorylevelrewardpointss,$pointsredeemed, $date,'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($categorylevelrewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $categorylevelrewardpointss,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n }else{\n $insertpoints = $restrictuserpoints - $getoldpoints;\n RSPointExpiry::insert_earning_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$order_id,$totalearnedpoints,$totalredeempoints,'');\n $equearnamt = RSPointExpiry::earning_conversion_settings($insertpoints);\n $equredeemamt = RSPointExpiry::redeeming_conversion_settings($pointsredeemed); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$equearnamt,$equredeemamt,$order_id,$productid,'0','0','',$totalpoints,'','0'); \n }\n }else{\n RSPointExpiry::insert_earning_points($currentuserid,'0','0',$date,'MREPFU',$order_id,'0','0','');\n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, '0','0',$date,'MREPFU','0','0',$order_id,'0','0','0','',$totalpoints,'','0'); \n }\n }else{\n $categorylevelrewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $getcategorypoints); \n RSPointExpiry::insert_earning_points($currentuserid, $categorylevelrewardpointss,$pointsredeemed,$date, 'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($categorylevelrewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $categorylevelrewardpointss,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n }\n }else{\n $categorylevelrewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $getcategorypoints); \n RSPointExpiry::insert_earning_points($currentuserid, $categorylevelrewardpointss,$pointsredeemed,$date, 'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($categorylevelrewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $categorylevelrewardpointss,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n } \n } else {\n if($enabledisablemaxpoints == 'yes'){\n if(($restrictuserpoints != '') && ($restrictuserpoints != '0')){\n $getoldpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n if($getoldpoints <= $restrictuserpoints){\n $totalpointss = $getoldpoints + $getcategorypercent;\n if($totalpointss <= $restrictuserpoints){\n $categorylevelrewardpercents = RSMemberFunction::user_role_based_reward_points($currentuserid, $getcategorypercent); \n RSPointExpiry::insert_earning_points($currentuserid, $categorylevelrewardpercents,$pointsredeemed,$date, 'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($categorylevelrewardpercents); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $categorylevelrewardpercents,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n }else{\n $insertpoints = $restrictuserpoints - $getoldpoints;\n RSPointExpiry::insert_earning_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$order_id,$totalearnedpoints,$totalredeempoints,'');\n $equearnamt = RSPointExpiry::earning_conversion_settings($insertpoints);\n $equredeemamt = RSPointExpiry::redeeming_conversion_settings($pointsredeemed); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$equearnamt,$equredeemamt,$order_id,$productid,'0','0','',$totalpoints,'','0'); \n }\n }else{\n RSPointExpiry::insert_earning_points($currentuserid,'0','0',$date,'MREPFU',$order_id,'0','0','');\n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, '0','0',$date,'MREPFU','0','0',$order_id,'0','0','0','',$totalpoints,'','0'); \n }\n }else{\n $categorylevelrewardpercents = RSMemberFunction::user_role_based_reward_points($currentuserid, $getcategorypercent); \n RSPointExpiry::insert_earning_points($currentuserid, $categorylevelrewardpercents,$pointsredeemed,$date, 'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($categorylevelrewardpercents); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $categorylevelrewardpercents,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n }\n }else{\n $categorylevelrewardpercents = RSMemberFunction::user_role_based_reward_points($currentuserid, $getcategorypercent); \n RSPointExpiry::insert_earning_points($currentuserid, $categorylevelrewardpercents,$pointsredeemed,$date, 'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($categorylevelrewardpercents); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $categorylevelrewardpercents,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n } \n }\n break;\n case '3':\n if ($global_reward_type == '1') {\n if($enabledisablemaxpoints == 'yes'){\n if(($restrictuserpoints != '') && ($restrictuserpoints != '0')){\n $getoldpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n if($getoldpoints <= $restrictuserpoints){\n $totalpointss = $getoldpoints + $global_reward_points;\n if($totalpointss <= $restrictuserpoints){\n $global_rewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $global_reward_points); \n RSPointExpiry::insert_earning_points($currentuserid, $global_rewardpointss,$pointsredeemed, $date,'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($global_rewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $global_rewardpointss,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n }else{\n $insertpoints = $restrictuserpoints - $getoldpoints;\n RSPointExpiry::insert_earning_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$order_id,$totalearnedpoints,$totalredeempoints,'');\n $equearnamt = RSPointExpiry::earning_conversion_settings($insertpoints);\n $equredeemamt = RSPointExpiry::redeeming_conversion_settings($pointsredeemed); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$equearnamt,$equredeemamt,$order_id,$productid,'0','0','',$totalpoints,'','0'); \n }\n }else{\n RSPointExpiry::insert_earning_points($currentuserid,'0','0',$date,'MREPFU',$order_id,'0','0','');\n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, '0','0',$date,'MREPFU','0','0',$order_id,'0','0','0','',$totalpoints,'','0'); \n }\n }else{\n $global_rewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $global_reward_points); \n RSPointExpiry::insert_earning_points($currentuserid, $global_rewardpointss,$pointsredeemed, $date,'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($global_rewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $global_rewardpointss,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n }\n }else{\n $global_rewardpointss = RSMemberFunction::user_role_based_reward_points($currentuserid, $global_reward_points); \n RSPointExpiry::insert_earning_points($currentuserid, $global_rewardpointss,$pointsredeemed,$date, 'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($global_rewardpointss); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $global_rewardpointss,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n } \n } else {\n if($enabledisablemaxpoints == 'yes'){\n if(($restrictuserpoints != '') && ($restrictuserpoints != '0')){\n $getoldpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n if($getoldpoints <= $restrictuserpoints){\n $totalpointss = $getoldpoints + $rewardpercentsforgloballevel;\n if($totalpointss <= $restrictuserpoints){\n $global_rewardpercents = RSMemberFunction::user_role_based_reward_points($currentuserid, $rewardpercentsforgloballevel); \n RSPointExpiry::insert_earning_points($currentuserid, $global_rewardpercents,$pointsredeemed,$date, 'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($global_rewardpercents); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $global_rewardpercents,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n }else{\n $insertpoints = $restrictuserpoints - $getoldpoints;\n RSPointExpiry::insert_earning_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$order_id,$totalearnedpoints,$totalredeempoints,'');\n $equearnamt = RSPointExpiry::earning_conversion_settings($insertpoints);\n $equredeemamt = RSPointExpiry::redeeming_conversion_settings($pointsredeemed); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $insertpoints,$pointsredeemed,$date,'MREPFU',$equearnamt,$equredeemamt,$order_id,$productid,'0','0','',$totalpoints,'','0'); \n }\n }else{\n RSPointExpiry::insert_earning_points($currentuserid,'0','0',$date,'MREPFU',$order_id,'0','0','');\n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, '0','0',$date,'MREPFU','0','0',$order_id,'0','0','0','',$totalpoints,'','0'); \n }\n }else{\n $global_rewardpercents = RSMemberFunction::user_role_based_reward_points($currentuserid, $rewardpercentsforgloballevel); \n RSPointExpiry::insert_earning_points($currentuserid, $global_rewardpercents,$pointsredeemed, $date,'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($global_rewardpercents); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $global_rewardpercents,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n }\n }else{\n $global_rewardpercents = RSMemberFunction::user_role_based_reward_points($currentuserid, $rewardpercentsforgloballevel); \n RSPointExpiry::insert_earning_points($currentuserid, $global_rewardpercents,$pointsredeemed, $date,'RPGPOS',$orderid,$totalearnedpoints,$totalredeempoints,$reasonindetail);\n $equearnamt = RSPointExpiry::earning_conversion_settings($global_rewardpercents); \n $totalpoints = RSPointExpiry::get_sum_of_total_earned_points($currentuserid);\n RSPointExpiry::record_the_points($currentuserid, $global_rewardpercents,$pointsredeemed,$date,'RPGPOS',$equearnamt,$equredeemamt,$order_id,$productid,$variationid,$refuserid,'',$totalpoints,'','0');\n } \n }\n break;\n }\n }",
"public function getTotalAttribute()\n {\n return $this->ca_test_score + $this->ca_exam_score;\n }",
"function total_price($totals){\n $sum = 0;\n $sub = 0;\n foreach($totals as $total ){\n $sum += $total['total_saleing_price'];\n $sub += $total['total_buying_price'];\n $profit = $sum - $sub;\n }\n return array($sum,$profit);\n}",
"public function calculate_unbilled() {\n\n // query database for this client's work items\n $query_args = array(\n 'post_type' => 'invoice_item',\n 'meta_query' => array(\n array(\n 'key' => 'client_id',\n 'value' => $this->id\n ),\n array(\n 'key' => 'invoice_item_status',\n 'value' => 'unbilled'\n )\n )\n );\n $query = new WP_Query($query_args);\n\n // initiate total variable and loop through query object\n $total = 0;\n while($query->have_posts()) {\n $query->the_post();\n $invoice_item = new InvoiceItem(get_the_id());\n $total += $invoice_item->value;\n }\n update_post_meta($this->id, 'total_unbilled', $total);\n return $total;\n }",
"public function consolidatedLoanBalanceAggregateAt($collection){\n $sumBal=0;\n\n //find unique users\n $uniqueUsers = $collection->unique('user_id');\n foreach($uniqueUsers as $item){\n\n //total debit\n $totalDebit = $collection->where('user_id',$item->user_id)\n ->sortBy('date_entry')\n ->sum('debit');\n //total credit\n $totalCredit = $collection->where('user_id',$item->user_id)\n ->sortBy('date_entry')\n ->sum('credit');\n\n $bal = $totalDebit-$totalCredit;\n $sumBal = $sumBal+$bal;\n }\n return $sumBal;\n }",
"public function getAllocations( $min_date = null )\n {\n // Document status = 'confirmed'\n $lines1 = CustomerOrderLine::\n where('product_id', $this->id)\n ->whereHas('document', function($q) use ($min_date)\n {\n $q->where('status', 'confirmed');\n\n if ($min_date != null)\n $q->where('document_date', '>=', $min_date);\n }\n )\n ->with('document')\n ->with('document.customer')\n ->get();\n\n\n // Allocated by Customer Shipping Slips\n // Document status = 'confirmed'\n $lines2 = CustomerShippingSlipLine::\n where('product_id', $this->id)\n ->whereHas('document', function($q) use ($min_date)\n {\n $q->where('status', 'confirmed');\n\n if ($min_date != null)\n $q->where('document_date', '>=', $min_date);\n }\n )\n ->with('document')\n ->with('document.customer')\n ->get();\n\n $count2 = $lines2->sum('quantity');\n\n\n // Allocated by Customer Invoices\n // Document status = 'confirmed' && created_via = 'manual'\n $lines3 = CustomerInvoiceLine::\n where('product_id', $this->id)\n ->whereHas('document', function($q) use ($min_date)\n {\n $q->where('status', 'confirmed');\n $q->where('created_via', 'manual');\n\n if ($min_date != null)\n $q->where('document_date', '>=', $min_date);\n }\n )\n ->with('document')\n ->with('document.customer')\n ->get();\n\n $count3 = $lines3->sum('quantity');\n\n \n\n\n $lines = $lines1->merge($lines2)->merge($lines3);\n\n // Do some sorting here (by document_date, ASC):\n $lines = $lines->sortBy(function ($line, $key) {\n return $line->document->document_date;\n });\n\n return $lines;\n }",
"private function _getAmendment()\n\t {\n\t\t$amendment = 0;\n\n\t\t$objects = $this->_getAddresses();\n\t\tif ($objects > 1)\n\t\t {\n\t\t\t$amendment = $objects * 5;\n\t\t } //end if\n\n\t\treturn $amendment;\n\t }",
"private function setTotalAmounts()\n {\n $taxable\t= 0.00;\n $expenses = 0.00;\n $outlays\t= 0.00;\n\n foreach ($this->invoiceDetails as $invoiceDetail) {\n $amount = $invoiceDetail->getAmount();\n switch ($invoiceDetail->getType())\n {\n case 'incoming':\n $taxable += $amount;\n break;\n case 'expense':\n $taxable += $amount;\n $expenses += $amount;\n break;\n case 'outlay':\n $outlays += $amount;\n break;\n }\n }\n\n $this->setTotalTaxable($taxable);\n $this->setTotalExpenses($expenses);\n $this->setTotalOutlays($outlays);\n }",
"function getGradepoints()\n {\n\t$struct = array('title' => array(),\n\t\t\t'quiz' => array('section' => array(), 'weight' => array(), 'scored' => array(), 'completed' => array()),\n\t\t\t'weight' => array(),\n\t\t\t'points' => array(),\n\t\t\t'completed' => array()\n\t\t\t);\n\t\n\t$courses = $this->DB->database_select('course', '*');\n\t$enrolled = $this->DB->database_select('users', array('enrolled'), array('uid' => session_get('uid')), 1);\n\t$enrolled = explode(',', $enrolled['enrolled']);\n\t\n\t$quizzes_completed = $this->DB->database_select('users', array('quizzes_completed'),\n\t\t\t\t\t\t\tarray('uid' => session_get('uid')), 1);\n\t$quizzes_completed = explode(',', $quizzes_completed['quizzes_completed']);\n\t\n\t$index = 0;\n\tfor($c = 0; $c < count($courses); $c++)\n\t{\n\t\t\n\t\t//If the user is not even enrolled in the course, then they definitely have not performed in it. Skip course\n\t\t\n\t\tif(!in_array($courses[$c]['cid'], $enrolled))\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\t\t\n\t\t\n\t\t$courseWeight = 0;\n\t\t$struct['title'][] = $courses[$c]['course_title'];\n\t\t$course_points_earned = 0;\n\t\t\n\t\t\n\t\t//Get all the quizzes associated with course\n\t\t\n\t\t$quizzes = $this->DB->database_select('quiz', 'qid', array('quiz_course' => $courses[$c]['cid']));\n\t\t\n\t\tfor($i = 0; $i < count($quizzes); $i++)\n\t\t{\n\t\t\t//User has not completed quiz\n\t\t\t\n\t\t\tif(!in_array($quizzes[$i]['qid'], $quizzes_completed))\n\t\t\t{\n\t\t\t\t$struct['quiz']['completed'][$c][] = 'incomplete';\n\t\t\t\t$struct['completed'][$c] = false;\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t$quizWeight = 0;\n\t\t\t$quiz = $this->DB->database_select('quiz_content', 'qcid', array('qid' => $quizzes[$i]['qid']));\n\t\t\t\n\t\t\t//Add points that user scored in quiz\n\t\t\t$points_earned = $this->pointsScored($quizzes[$i]['qid']); \n\t\t\t\n\t\t\t//Add to total course points scored\n\t\t\t$course_points_earned += $points_earned;\n\t\t\t\n\t\t\t//Determine weight of quiz questions\n\t\t\tfor($j = 0; $j < count($quiz); $j++)\n\t\t\t{\n\t\t\t\t$quizWeight += $this->quizWeight($quiz[$j]['qcid']);\n\t\t\t}\n\t\t\t\n\t\t\t//Add total question weight to quiz weight\n\t\t\t\n\t\t\t$struct['quiz']['weight'][$index][] = $quizWeight;\n\t\t\t$struct['quiz']['scored'][$index][] = $points_earned;\n\t\t\t\n\t\t\t//User has completed quiz or not?\n\t\t\t$struct['quiz']['completed'][$index][] = 'completed';\n\t\t\t\n\t\t\t//Add total quiz weight to quiz score\n\t\t\t\n\t\t\t$courseWeight += $quizWeight;\n\t\t\t\n\t\t}\n\t\t\n\t\t$struct['weight'][$index] = $courseWeight;\n\t\t$struct['points'][$index] = $course_points_earned;\n\t\t\n\t\t\n\t\tif(!isset($struct['completed'][$index]))\n\t\t{\n\t\t\t$struct['completed'][$index] = 'complete';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$struct['completed'][$index] = 'incomplete';\n\t\t}\n\t\t$index++;\n\t}\n\t\n\treturn $struct;\n }",
"public function calculateShippingAmount()\n {\n\n\n $kgs = 1;\n $total_cost = 0;\n $bc_shipping_cost = 0;\n $shipping_threshold = config('paths.shipping_threshold');\n $shipping_cost = config('paths.shipping_cost');\n $items_in_bag = Session::get('items');\n if (!empty($items_in_bag)) {\n foreach ($items_in_bag as $item) {\n if ($item['weight_unit'] == 'g') {\n $kgs = 0.001;\n }\n $i_weight = $item['weight'] * $kgs;\n $total_i_weight = $i_weight * $item['quantity'];\n if ($total_i_weight > $shipping_threshold) {\n $item_shipping_cost = $shipping_cost + ($total_i_weight - $shipping_threshold);\n } else {\n $item_shipping_cost = $shipping_cost;\n }\n $bc_shipping_cost = $bc_shipping_cost + $item_shipping_cost;\n $item_shipping_cost = $item_shipping_cost * Session::get('amount_per_unit');\n $total_cost = $total_cost + $item_shipping_cost;\n $total_cost = round($total_cost, 2);\n $bc_shipping_cost = round($bc_shipping_cost, 2);\n }\n }\n\n Session::put('shipping_cost', $total_cost);\n Session::put('bc_shipping_cost', $bc_shipping_cost);\n return $total_cost;\n }",
"public function getMyFeesEstimate($request);",
"public function calculateIngressTotal()\n {\n return (\n $this->calculateInitialAmountCash() +\n $this->calculateIngressCashMovementTotal() +\n $this->calculateCustomerSalesTotal() \n );\n }",
"public function getPointsEarned()\n {\n return $this->pointsEarned;\n }",
"public function wallet(Request $request,$userid,$type)\n { \n if($type=='request')\n {\n $were = array('uid'=>$userid);\n $data['applyrequests'] = Withdraw::getbycondition22($were);\n if(count($data['applyrequests']['data']) > 0)\n {\n foreach($data['applyrequests']['data'] as $key=>$dd)\n { \n if($dd['status']=='0')\n {\n $data['applyrequests']['data'][$key]['status'] = 'Pending';\n }else if($dd['status']=='1')\n {\n $data['applyrequests']['data'][$key]['status'] = 'Declined'; \n }else\n {\n $data['applyrequests']['data'][$key]['status'] = 'Approve'; \n }\n \n } \n }else\n {\n $data['applyrequests']['data'] = array();\n }\n $were = array('uid'=>$userid,'status'=>'2');\n \n $data2['applyrequests2'] = Withdraw::getbycondition($were);\n $were2 = array('uid'=>$userid,'status'=>'1');\n $data2['reffered'] = Reffer::getbycondition($were2);\n $data2['transactions2'] = Transaction::getbycondition(array('user_id'=>$userid));\n $data['walletamount']=0;\n $data['reffer_amount'] =0;\n foreach($data2['reffered'] as $reffer)\n {\n if(!empty($reffer->amount))\n {\n $data['walletamount'] += $reffer->amount;\n $data['reffer_amount'] += $reffer->amount;\n }\n }\n \n foreach($data2['transactions2'] as $reffers)\n {\n if(!empty($reffers->walletuse))\n {\n $data['walletamount'] -= $reffers->walletuse;\n }\n }\n \n $data['withdrwaamount']=0;\n foreach($data2['applyrequests2'] as $reffers)\n {\n if(!empty($reffers->amount))\n {\n $data['walletamount'] -= $reffers->amount;\n $data['withdrwaamount'] +=$reffers->amount;\n }\n }\n \n if(count($data2['reffered']) == 0 || $data['walletamount'] < 0)\n {\n $data['walletamount']=0; \n }\n\n \n }\n else\n { \n $data['transactions'] = Transaction::getoption23(array('user_id'=>$userid));\n foreach($data['transactions']['data'] as $key=>$dd)\n { \n \n if($dd['amount'] != '0' && $dd['transaction_id'] =='0')\n {\n $data['transactions']['data'][$key]['transaction_id'] = 'Wallet';\n }\n elseif($dd['transaction_id'] != '0')\n {\n $data['transactions']['data'][$key]['transaction_id'] = '#'.$dd['transaction_id'];\n }else\n {\n $data['transactions']['data'][$key]['transaction_id'] = 'Free';\n }\n \n $data['transactions']['data'][$key]['packagename'] = Subscription_content::getname($dd['package_id']);\n \n if($dd['package_id'] == '1')\n {\n $data['transactions']['data'][$key]['method'] = '--';\n }\n elseif($dd['amount'] != '0' && $dd['transaction_id'] =='0')\n {\n $data['transactions']['data'][$key]['method'] ='Wallet';\n }\n else\n {\n $data['transactions']['data'][$key]['method'] ='Card';\n }\n \n if($data['transactions']['current_page']=='1')\n {\n $datek = Hours::getdetailsuserret($userid,'expiry');\n $data['transactions']['data'][$key]['expiry'] = date('M-d Y',strtotime($datek));\n }else\n {\n if(!empty($dd['exp']) && $dd['exp']!='')\n {\n $data['transactions']['data'][$key]['expiry'] = date('M-d Y',strtotime($dd['exp']));\n }else\n {\n \n $date = strtotime($dd['created']);\n if($dd['package_id'] == '1'){\n $data['transactions']['data'][$key]['expiry'] = date('M-d Y',strtotime(\"+7 day\", $date));\n }else if($dd['package_id'] == '3')\n { \n $data['transactions']['data'][$key]['expiry'] = date('M-d Y',strtotime(\"+1 year\", $date)); \n }\n else{\n $data['transactions']['data'][$key]['expiry'] = date('M-d Y',strtotime(\"+1 month\", $date)); \n }\n } \n }\n }\n }\n\n $messags['message'] = \"Wallet data.\";\n $messags['status']= 1; \n $messags['data']= $data; \n echo json_encode($messags);\n die;\n }",
"public function redeemRewards()\n\t{\n\t\t$accessToken = $this->request->get('access_token');\n\n\t\tif($accessToken != \"\"){\n\t\t\tSession::flush();\n\t\t\t$accessDetails = UserDevices::getUserDetailsByAccessToken($accessToken);\n\t\t\tif($accessDetails > 0){\n\t\t\t\t$user_array = Auth::loginUsingId($accessDetails);\n\t\t\t\t//echo \"<pre>\"; print_r($user_array);\n\t\t\t\t$userdata = array(\n\t\t\t\t\t'id' => $user_array->id,\n\t\t\t\t\t'username' => substr($user_array->email,0,strpos($user_array->email,\"@\")),\n\t\t\t\t\t'email' => $user_array->email,\n\t\t\t\t\t'full_name' =>$user_array->full_name,\n\t\t\t\t\t'user_role' =>$user_array->role_id,\n\t\t\t\t\t'phone' =>$user_array->phone_number,\n\t\t\t\t\t'city_id' =>$user_array->location_id,\n\t\t\t\t\t'facebook_id'=>@$user_array->fb_token,\n\t\t\t\t\t'exp'=>\"10\",\n\t\t\t\t\t'logged_in' => TRUE,\n\t\t\t\t);\n\t\t\t\tSession::put($userdata);\n\t\t\t}\n\t\t}\n\t\t$user_array = Session::all();\n\t\t//$userID =Session::get('id');\n\t\t//this code is start in header and footer page.\n $cities = Location::where(['Type' => 'City', 'visible' =>1])->lists('name','id');\n $arrResponse['cities'] = $cities;\n\t\t$arrResponse['user'] = Auth::user();\n\n $city_id = Input::get('city'); \n $city_name = Location::where(['Type' => 'City', 'id' => $city_id])->pluck('name');\n if(empty($city_name))\n {\n $city_name = 'mumbai';\n }\n\n $arrResponse['allow_guest'] ='Yes'; \n $arrResponse['current_city'] = strtolower($city_name);\n $arrResponse['current_city_id'] = $city_id;\n //this code is start in header and footer page.\n $id = Session::get('id');\n\t\t\n\t\t//$data=Profile::getUserProfileWeb($id);\n\n return view('frontend.pages.redeemrewards',$arrResponse);\n\t}"
] | [
"0.6330827",
"0.6149955",
"0.61119366",
"0.58566034",
"0.5854387",
"0.57031864",
"0.56549495",
"0.5571954",
"0.5545483",
"0.5540899",
"0.55029625",
"0.5446501",
"0.5445966",
"0.54284376",
"0.5404442",
"0.53953826",
"0.53462577",
"0.53288805",
"0.53148997",
"0.5304337",
"0.52937585",
"0.52830863",
"0.5242799",
"0.5242735",
"0.5239926",
"0.52116597",
"0.51975375",
"0.51922125",
"0.51678157",
"0.51632774",
"0.5132298",
"0.51311404",
"0.51284176",
"0.5119058",
"0.5111516",
"0.51045436",
"0.5101078",
"0.50959635",
"0.5086552",
"0.5082949",
"0.50828654",
"0.5080425",
"0.5069213",
"0.5054606",
"0.5035711",
"0.5035368",
"0.5025467",
"0.5009274",
"0.49940133",
"0.4993153",
"0.4992895",
"0.4986762",
"0.49851954",
"0.49824804",
"0.49812418",
"0.49753147",
"0.49741027",
"0.49690807",
"0.49677405",
"0.49674487",
"0.496306",
"0.49626863",
"0.4957937",
"0.49495077",
"0.49488494",
"0.49483272",
"0.49441773",
"0.49422887",
"0.49411142",
"0.49386668",
"0.49370116",
"0.49352577",
"0.49330154",
"0.4932044",
"0.49292254",
"0.49205372",
"0.49054578",
"0.49050885",
"0.49041986",
"0.48961654",
"0.48952055",
"0.48946378",
"0.48921412",
"0.48827967",
"0.4877349",
"0.48753732",
"0.48727828",
"0.48689744",
"0.48622257",
"0.48618743",
"0.48452875",
"0.4843821",
"0.48428646",
"0.48380762",
"0.4837702",
"0.4835273",
"0.48347548",
"0.48291674",
"0.48235357",
"0.4823009",
"0.48211604"
] | 0.0 | -1 |
Run the database seeds. | public function run()
{
$user = User::find(1);
$user->roles()->attach(1);
$user2 = User::find(2);
$user2->roles()->attach(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 |
Handle subscription status change | public function handle_subscription_status_change( $user_id, $subscription_key ) {
$user_memberships = $this->get_memberships_from_subscription( $subscription_key );
if ( ! $user_memberships ) {
return;
}
$note = '';
switch ( current_filter() ) {
case 'subscription_trashed':
$note = __( 'Membership cancelled because subscription was trashed.', 'woocommerce-memberships' );
break;
case 'subscription_deleted':
$note = __( 'Membership cancelled because subscription was deleted.', 'woocommerce-memberships' );
break;
default :
break;
}
$subscription = WC_Subscriptions_Manager::get_subscription( $subscription_key );
foreach ( $user_memberships as $user_membership ) {
$this->update_related_membership_status( $subscription, $user_membership, $subscription['status'], $note );
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function subscribe() {\n\t\t\t\t\t\t //**Store the status to a global variable - debug purposes\n\t\t\t\t\t\t$GLOBALS['statusmsg'] = $GLOBALS['statusmsg'] . \"SUB-OK|\";\n\t\t\t\t}",
"public function status_subscription(){\n\t\t\treturn true;\n\t\t}",
"public function subscription();",
"public function handleSubscriptionEvent(object $message): void;",
"public function subscribes();",
"function it_exchange_paypal_pro_addon_update_subscriber_status( $subscriber_id, $status ) {\n\t$transactions = it_exchange_paypal_pro_addon_get_transaction_id_by_subscriber_id( $subscriber_id );\n\tforeach( $transactions as $transaction ) { //really only one\n\t\t// If the subscription has been cancelled/suspended and fully refunded, they need to be deactivated\n\t\tif ( !in_array( $status, array( 'active', 'deactivated' ) ) ) {\n\t\t\tif ( $transaction->has_refunds() && 0 === it_exchange_get_transaction_total( $transaction, false ) )\n\t\t\t\t$status = 'deactivated';\n\n\t\t\tif ( $transaction->has_children() ) {\n\t\t\t\t//Get the last child and make sure it hasn't been fully refunded\n\t\t\t\t$args = array(\n\t\t\t\t\t'numberposts' => 1,\n\t\t\t\t\t'order' => 'ASC',\n\t\t\t\t);\n\t\t\t\t$last_child_transaction = $transaction->get_children( $args );\n\t\t\t\tforeach( $last_child_transaction as $last_transaction ) { //really only one\n\t\t\t\t\t$last_transaction = it_exchange_get_transaction( $last_transaction );\n\t\t\t\t\tif ( $last_transaction->has_refunds() && 0 === it_exchange_get_transaction_total( $last_transaction, false ) )\n\t\t\t\t\t\t$status = 'deactivated';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdo_action( 'it_exchange_update_transaction_subscription_status', $transaction, $subscriber_id, $status );\n\t}\n}",
"protected function setSubscriptionStatusData(Subscription $subscription): void\n {\n $this->configureStripeClient();\n $subscriptionData = $subscription->getSubscriptionData();\n $canceledAt = $subscriptionData['canceled_at'];\n $endedAt = $subscriptionData['ended_at'];\n $status = $subscriptionData['status'];\n\n switch ($status) {\n // Somebody didn't manage to provide/authenticate a payment method\n case 'incomplete_expired':\n $subscription->isExpired = true;\n $subscription->dateExpired = $endedAt ? DateTimeHelper::toDateTime($endedAt) : null;\n $subscription->isCanceled = false;\n $subscription->dateCanceled = null;\n $subscription->nextPaymentDate = null;\n break;\n // Definitely not suspended\n case 'active':\n $subscription->isSuspended = false;\n $subscription->dateSuspended = null;\n break;\n // Suspend this and make a guess at the suspension date\n case 'past_due':\n $timeLastInvoiceCreated = $subscriptionData['latest_invoice']['created'] ?? null;\n $dateSuspended = $timeLastInvoiceCreated ? DateTimeHelper::toDateTime($timeLastInvoiceCreated) : null;\n $subscription->dateSuspended = $subscription->isSuspended ? $subscription->dateSuspended : $dateSuspended;\n $subscription->isSuspended = true;\n break;\n case 'canceled':\n $subscription->isExpired = true;\n $subscription->dateExpired = $endedAt ? DateTimeHelper::toDateTime($endedAt) : null;\n }\n\n // Make sure we mark this as started, if appropriate\n $subscription->hasStarted = !in_array($status, ['incomplete', 'incomplete_expired']);\n\n // Update all the other tidbits\n $subscription->isCanceled = (bool)$canceledAt;\n $subscription->dateCanceled = $canceledAt ? DateTimeHelper::toDateTime($canceledAt) : null;\n $subscription->nextPaymentDate = DateTimeHelper::toDateTime($subscriptionData['current_period_end']);\n }",
"public function subscribe();",
"public function subscribe(): void;",
"private function status()\n {\n $this->botman->hears('status', function(BotMan $bot) {\n\n $status = 'subscribed';\n $user = Subscriber::where('telegram_user_id', $bot->getUser()->getId())->first();\n\n if(is_null($user))\n {\n $status = 'unsubscribed';\n }\n\n $bot->reply('status: '. $status);\n });\n }",
"static public function status()\n {\n $GLOBALS['notification']->notify(array('listeners' => array('status', 'audio')));\n }",
"function subscriptionStatus($destAddr,$keyword,$state){\n\tif($state == 'unsubscribe'){\n\t\t$response=\"You have successfully unsubscribed from $keyword alerts\";\n\t\t$sql_unsub=\"insert into outbound(destAddr,sourceAddr,messageType,messageContent,status) values('$destAddr',default,default,'$response','send')\";\n\t\t$result = mysql_query($sql_unsub);\n\t\t//log error\n\t\tif(!$result){\n\t\t\t$dbErr=\"SQL Error: \".mysql_error().\"SQL CODE: \".$sql_unsub;\n\t\t\tflog($dbErr, $_SERVER[\"SCRIPT_FILENAME\"]);\n\t\t}else{\n\t\t\t$subsLogs = \"Successfully responded to \".$destAddr .\" about $keyword unsubscription\";\n\t\t\tlogSubs($subsLogs, $_SERVER[\"SCRIPT_FILENAME\"]);\n\t\t}\n\t}elseif ($state == 'subscribe'){\n\t\t$response = \"You have successfully subscribed to $keyword alerts\";\n\t\t$sql_sub = \"insert into outbound(destAddr,sourceAddr,messageType,messageContent,status) values('$destAddr',default,default,'$response','send')\";\n\t\t$result = mysql_query($sql_sub);\n\t\t//log error\n\t\tif(!$result){\n\t\t\t$dbErr=\"SQL Error: \".mysql_error().\"SQL CODE: \".$sql_sub;\n\t\t\tflog($dbErr, $_SERVER[\"SCRIPT_FILENAME\"]);\n\t\t}else{\n\t\t\t$subsLogs = \"Successfully responded to \".$destAddr.\" about $keyword subscription\";\n\t\t\tlogSubs($subsLogs, $_SERVER[\"SCRIPT_FILENAME\"]);\n\t\t}\n\t}else{\n\t\t$subsLogs = \"Invalid state: \".$state. \" cant proceed!\";\n\t\tlogSubs($subsLogs, $_SERVER[\"SCRIPT_FILENAME\"]);\t\t\n\t}\n}",
"function get_subscription_status($subc_id)\n {\n $merchant_id= $this->config->item('auth_merchant_id');\n $merchant_trans_key= $this->config->item('auth_transaction_key');\n\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName(\"$merchant_id\");\n $merchantAuthentication->setTransactionKey(\"$merchant_trans_key\");\n // $refId = 'ref' . time();\n $request = new AnetAPI\\ARBGetSubscriptionStatusRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n // $request->setRefId($refId);\n $request->setSubscriptionId(\"$subc_id\");\n $controller = new AnetController\\ARBGetSubscriptionStatusController($request);\n //$response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::PRODUCTION);\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\"))\n {\n return $response->getStatus();\n \n }\n else\n {\n\n return \"\";\n\n }\n }",
"public function changeStatus()\n {\n }",
"public function setSubscriptionStatus($subscription_status) {\n\n $this->subscription_status = $subscription_status;\n\n }",
"protected function handleSubscriptionUpdated(array $data): void\n {\n $this->configureStripeClient();\n $stripeSubscription = $data['data']['object'];\n $subscription = Subscription::find()->status(null)->reference($stripeSubscription['id'])->one();\n\n if (!$subscription) {\n Craft::warning('Subscription with the reference “' . $stripeSubscription['id'] . '” not found when processing webhook ' . $data['id'], 'stripe');\n\n return;\n }\n\n // See if we care about this subscription at all\n $subscription->setSubscriptionData($data['data']['object']);\n\n $this->setSubscriptionStatusData($subscription);\n\n if (empty($data['data']['object']['plan'])) {\n Craft::warning($subscription->reference . ' contains multiple plans, which is not supported. (event \"' . $data['id'] . '\")', 'stripe');\n } else {\n $planReference = $data['data']['object']['plan']['id'];\n $plan = Commerce::getInstance()->getPlans()->getPlanByReference($planReference);\n\n if ($plan) {\n $subscription->planId = $plan->id;\n } else {\n Craft::warning($subscription->reference . ' was switched to a plan on Stripe that does not exist on this Site. (event \"' . $data['id'] . '\")', 'stripe');\n }\n }\n\n Commerce::getInstance()->getSubscriptions()->updateSubscription($subscription);\n }",
"function simplenews_subscription_activate($snids, $status) {\n foreach (simplenews_subscriber_load_multiple($snids) as $subscriber) {\n $subscriber->activated = $status;\n simplenews_subscriber_save($subscriber);\n }\n}",
"public function getSubscriptionStatus() {\n return $this->subscription_status;\n\n }",
"protected function statusAggregator($subscription) {\n \ttry {\n\t $iUserDataId = $subscription->sdkSubscriptionId;\n\t $return = $this->bundle->status($iUserDataId);\n \t}\n catch (Exception $e){\n \t$return[\"status\"] = 'error';\n }\n return $return;\n }",
"function comment_subscription_status() {\n\tglobal $comment;\n\treturn !!_stc()->is_subscribed( $comment->comment_ID );\n}",
"function svbk_rcp_email_subscription_status( $user_id, $status = 'active' ) {\n\n\tglobal $rcp_options;\n\n\t$user_info = get_userdata( $user_id );\n\t$message = '';\n\t$admin_message = '';\n\t$site_name = stripslashes_deep( html_entity_decode( get_bloginfo('name'), ENT_COMPAT, 'UTF-8' ) );\n\n\t$emails = new RCP_Mandrill_Emails;\n\t$emails->member_id = $user_id;\n\n\t$admin_emails = ! empty( $rcp_options['admin_notice_emails'] ) ? $rcp_options['admin_notice_emails'] : get_option('admin_email');\n\t$admin_emails = apply_filters( 'rcp_admin_notice_emails', explode( ',', $admin_emails ) );\n\t$admin_emails = array_map( 'sanitize_email', $admin_emails );\n\n\t// Allow add-ons to add file attachments\n\n\t$attachments = apply_filters( 'rcp_email_attachments', array(), $user_id, $status );\n\n\tswitch ( $status ) :\n\n\t\tcase \"active\" :\n\n\t\t\tif( rcp_is_trialing( $user_id ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif( ! isset( $rcp_options['disable_active_email'] ) ) {\n\n\t\t\t\t$message = isset( $rcp_options['active_email'] ) ? $rcp_options['active_email'] : '';\n\t\t\t\t$message = apply_filters( 'rcp_subscription_active_email', $message, $user_id, $status );\n\t\t\t\t$subject = isset( $rcp_options['active_subject'] ) ? $rcp_options['active_subject'] : '';\n\t\t\t\t$subject = apply_filters( 'rcp_subscription_active_subject', $subject, $user_id, $status );\n\t\t\t\t\n\t\t\t\t$template = isset($rcp_options['mandrill_template_user_active']) ? $rcp_options['mandrill_template_user_active'] : '';\n\t\t\t}\n\n\t\t\tif( ! isset( $rcp_options['disable_active_email_admin'] ) ) {\n\t\t\t\t$admin_message = isset( $rcp_options['active_email_admin'] ) ? $rcp_options['active_email_admin'] : '';\n\t\t\t\t$admin_subject = isset( $rcp_options['active_subject_admin'] ) ? $rcp_options['active_subject_admin'] : '';\n\n\t\t\t\tif( empty( $admin_message ) ) {\n\t\t\t\t\t$admin_message = __( 'Hello', 'rcp' ) . \"\\n\\n\" . $user_info->display_name . ' (' . $user_info->user_login . ') ' . __( 'is now subscribed to', 'rcp' ) . ' ' . $site_name . \".\\n\\n\" . __( 'Subscription level', 'rcp' ) . ': ' . rcp_get_subscription( $user_id ) . \"\\n\\n\";\n\t\t\t\t\t$admin_message = apply_filters( 'rcp_before_admin_email_active_thanks', $admin_message, $user_id );\n\t\t\t\t\t$admin_message .= __( 'Thank you', 'rcp' );\n\t\t\t\t}\n\n\t\t\t\tif( empty( $admin_subject ) ) {\n\t\t\t\t\t$admin_subject = sprintf( __( 'New subscription on %s', 'rcp' ), $site_name );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$admin_template = isset($rcp_options['mandrill_template_admin_user_active']) ? $rcp_options['mandrill_template_admin_user_active'] : '';\n\t\t\t\t\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \"cancelled\" :\n\n\t\t\tif( ! isset( $rcp_options['disable_cancelled_email'] ) ) {\n\n\t\t\t\t$message = isset( $rcp_options['cancelled_email'] ) ? $rcp_options['cancelled_email'] : '';\n\t\t\t\t$message = apply_filters( 'rcp_subscription_cancelled_email', $message, $user_id, $status );\n\t\t\t\t$subject = isset( $rcp_options['cancelled_subject'] ) ? $rcp_options['cancelled_subject'] : '';\n\t\t\t\t$subject = apply_filters( 'rcp_subscription_cancelled_subject', $subject, $user_id, $status );\n\t\t\t\t\n\t\t\t\t$template = isset($rcp_options['mandrill_template_user_cancelled']) ? $rcp_options['mandrill_template_user_cancelled'] : '';\n\t\t\t\t\n\t\t\t}\n\n\t\t\tif( ! isset( $rcp_options['disable_cancelled_email_admin'] ) ) {\n\t\t\t\t$admin_message = isset( $rcp_options['cancelled_email_admin'] ) ? $rcp_options['cancelled_email_admin'] : '';\n\t\t\t\t$admin_subject = isset( $rcp_options['cancelled_subject_admin'] ) ? $rcp_options['cancelled_subject_admin'] : '';\n\n\t\t\t\tif( empty( $admin_message ) ) {\n\t\t\t\t\t$admin_message = __( 'Hello', 'rcp' ) . \"\\n\\n\" . $user_info->display_name . ' (' . $user_info->user_login . ') ' . __( 'has cancelled their subscription to', 'rcp' ) . ' ' . $site_name . \".\\n\\n\" . __( 'Their subscription level was', 'rcp' ) . ': ' . rcp_get_subscription( $user_id ) . \"\\n\\n\";\n\t\t\t\t\t$admin_message = apply_filters( 'rcp_before_admin_email_cancelled_thanks', $admin_message, $user_id );\n\t\t\t\t\t$admin_message .= __( 'Thank you', 'rcp' );\n\t\t\t\t}\n\n\t\t\t\tif( empty( $admin_subject ) ) {\n\t\t\t\t\t$admin_subject = sprintf( __( 'Cancelled subscription on %s', 'rcp' ), $site_name );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$admin_template = isset($rcp_options['mandrill_template_admin_user_cancelled']) ? $rcp_options['mandrill_template_admin_user_cancelled'] : '';\n\t\t\t}\n\n\t\tbreak;\n\n\t\tcase \"expired\" :\n\n\t\t\tif( ! isset( $rcp_options['disable_expired_email'] ) ) {\n\n\t\t\t\t$message = isset( $rcp_options['expired_email'] ) ? $rcp_options['expired_email'] : '';\n\t\t\t\t$message = apply_filters( 'rcp_subscription_expired_email', $message, $user_id, $status );\n\n\t\t\t\t$subject = isset( $rcp_options['expired_subject'] ) ? $rcp_options['expired_subject'] : '';\n\t\t\t\t$subject = apply_filters( 'rcp_subscription_expired_subject', $subject, $user_id, $status );\n\n\t\t\t\tadd_user_meta( $user_id, '_rcp_expired_email_sent', 'yes' );\n\t\t\t\t\n\t\t\t\t$template = isset($rcp_options['mandrill_template_user_expired']) ? $rcp_options['mandrill_template_user_expired'] : '';\n\t\t\t}\n\n\t\t\tif( ! isset( $rcp_options['disable_expired_email_admin'] ) ) {\n\t\t\t\t$admin_message = isset( $rcp_options['expired_email_admin'] ) ? $rcp_options['expired_email_admin'] : '';\n\t\t\t\t$admin_subject = isset( $rcp_options['expired_subject_admin'] ) ? $rcp_options['expired_subject_admin'] : '';\n\n\t\t\t\tif ( empty( $admin_message ) ) {\n\t\t\t\t\t$admin_message = __( 'Hello', 'rcp' ) . \"\\n\\n\" . $user_info->display_name . \"'s \" . __( 'subscription has expired', 'rcp' ) . \"\\n\\n\";\n\t\t\t\t\t$admin_message = apply_filters( 'rcp_before_admin_email_expired_thanks', $admin_message, $user_id );\n\t\t\t\t\t$admin_message .= __( 'Thank you', 'rcp' );\n\t\t\t\t}\n\n\t\t\t\tif ( empty( $admin_subject ) ) {\n\t\t\t\t\t$admin_subject = sprintf( __( 'Expired subscription on %s', 'rcp' ), $site_name );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$admin_template = isset($rcp_options['mandrill_template_admin_user_expired']) ? $rcp_options['mandrill_template_admin_user_expired'] : '';\n\t\t\t}\n\n\t\tbreak;\n\n\t\tcase \"free\" :\n\n\t\t\tif( ! isset( $rcp_options['disable_free_email'] ) ) {\n\n\t\t\t\t$message = isset( $rcp_options['free_email'] ) ? $rcp_options['free_email'] : '';\n\t\t\t\t$message = apply_filters( 'rcp_subscription_free_email', $message, $user_id, $status );\n\n\t\t\t\t$subject = isset( $rcp_options['free_subject'] ) ? $rcp_options['free_subject'] : '';\n\t\t\t\t$subject = apply_filters( 'rcp_subscription_free_subject', $subject, $user_id, $status );\n\n\t\t\t\t$template = isset($rcp_options['mandrill_template_user_free']) ? $rcp_options['mandrill_template_user_free'] : '';\n\n\t\t\t}\n\n\t\t\tif( ! isset( $rcp_options['disable_free_email_admin'] ) ) {\n\t\t\t\t$admin_message = isset( $rcp_options['free_email_admin'] ) ? $rcp_options['free_email_admin'] : '';\n\t\t\t\t$admin_subject = isset( $rcp_options['free_subject_admin'] ) ? $rcp_options['free_subject_admin'] : '';\n\n\t\t\t\tif( empty( $admin_message ) ) {\n\t\t\t\t\t$admin_message = __( 'Hello', 'rcp' ) . \"\\n\\n\" . $user_info->display_name . ' (' . $user_info->user_login . ') ' . __( 'is now subscribed to', 'rcp' ) . ' ' . $site_name . \".\\n\\n\" . __( 'Subscription level', 'rcp' ) . ': ' . rcp_get_subscription( $user_id ) . \"\\n\\n\";\n\t\t\t\t\t$admin_message = apply_filters( 'rcp_before_admin_email_free_thanks', $admin_message, $user_id );\n\t\t\t\t\t$admin_message .= __( 'Thank you', 'rcp' );\n\t\t\t\t}\n\n\t\t\t\tif( empty( $admin_subject ) ) {\n\t\t\t\t\t$admin_subject = sprintf( __( 'New free subscription on %s', 'rcp' ), $site_name );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$admin_template = isset($rcp_options['mandrill_template_admin_user_free']) ? $rcp_options['mandrill_template_admin_user_free'] : '';\n\t\t\t}\n\n\t\tbreak;\n\n\t\tcase \"trial\" :\n\n\t\t\tif( ! isset( $rcp_options['disable_trial_email'] ) ) {\n\n\t\t\t\t$message = isset( $rcp_options['trial_email'] ) ? $rcp_options['trial_email'] : '';\n\t\t\t\t$message = apply_filters( 'rcp_subscription_trial_email', $message, $user_id, $status );\n\n\t\t\t\t$subject = isset( $rcp_options['trial_subject'] ) ? $rcp_options['trial_subject'] : '';\n\t\t\t\t$subject = apply_filters( 'rcp_subscription_trial_subject', $subject, $user_id, $status );\n\t\t\t\t\n\t\t\t\t$template = isset($rcp_options['mandrill_template_user_trial']) ? $rcp_options['mandrill_template_user_trial'] : '';\n\n\t\t\t}\n\n\t\t\tif( ! isset( $rcp_options['disable_trial_email_admin'] ) ) {\n\t\t\t\t$admin_message = isset( $rcp_options['trial_email_admin'] ) ? $rcp_options['trial_email_admin'] : '';\n\t\t\t\t$admin_subject = isset( $rcp_options['trial_subject_admin'] ) ? $rcp_options['trial_subject_admin'] : '';\n\n\t\t\t\tif( empty( $admin_message ) ) {\n\t\t\t\t\t$admin_message = __( 'Hello', 'rcp' ) . \"\\n\\n\" . $user_info->display_name . ' (' . $user_info->user_login . ') ' . __( 'is now subscribed to', 'rcp' ) . ' ' . $site_name . \".\\n\\n\" . __( 'Subscription level', 'rcp' ) . ': ' . rcp_get_subscription( $user_id ) . \"\\n\\n\";\n\t\t\t\t\t$admin_message = apply_filters( 'rcp_before_admin_email_trial_thanks', $admin_message, $user_id );\n\t\t\t\t\t$admin_message .= __( 'Thank you', 'rcp' );\n\t\t\t\t}\n\n\t\t\t\tif( empty( $admin_subject ) ) {\n\t\t\t\t\t$admin_subject = sprintf( __( 'New trial subscription on %s', 'rcp' ), $site_name );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$admin_template\t= isset($rcp_options['mandrill_template_admin_user_trial']) ? $rcp_options['mandrill_template_admin_user_trial'] : '';\n\t\t\t\t\n\t\t\t}\n\n\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\n\tendswitch;\n\t\n\t$template = apply_filters( 'svbk_rcp_status_mandrill_template', $template, $user_id, $status, $this );\n\t$admin_template = apply_filters( 'svbk_rcp_status_mandrill_admin_template', $admin_template, $user_id, $status, $this );\n\n\tif( ! empty( $template ) && $emails->sendTemplate( $template, $user_info->user_email, $subject, $message, $attachments ) ) {\n\t\trcp_log( sprintf( '[Mandrill Emails] %s email sent to user #%d.', ucwords( $status ), $user_info->ID ) );\n\t} else {\n\t\trcp_log( sprintf( '[Mandrill Emails] %s email not sent to user #%d - template %s is empty or invalid.', ucwords( $status ), $user_info->ID, $template ) );\n\t}\n\n\tif( ! empty( $admin_template ) && $emails->sendTemplate( $admin_template, $admin_emails, $admin_subject, $admin_message ) ) {\n\t\trcp_log( sprintf( '[Mandrill Emails] %s email sent to admin(s).', ucwords( $status ) ) );\n\t} else {\n\t\trcp_log( sprintf( '[Mandrill Emails] %s email not sent to admin(s) - template %s is empty or invalid.', ucwords( $status ), $admin_template ) );\n\t\treturn false;\n\t}\n\t\n\treturn true;\n\t\n}",
"public function subscription(): EventSubscription;",
"public function handleCustomerSubscriptionUpdated($payload)\n {\n // Handle The Event\n $user = $this->getUserByStripeId($payload['data']['object']['customer']);\n if ( $user ) {\n $subscription = $user->subscriptions->filter(function ($subscription) use ($payload) {\n return $subscription->stripe_id === $payload['data']['object']['id'];\n })->first();\n $subscription->current_period_start = \\Carbon\\Carbon::createFromTimestamp($payload['data']['object']['current_period_start']);\n $subscription->current_period_end = \\Carbon\\Carbon::createFromTimestamp($payload['data']['object']['current_period_end']);\n $subscription->status = $payload['data']['object']['status'];\n $subscription->name = $payload['data']['object']['plan']['name'];\n\n\n try{\n $client = new Client;\n $result = $client->request('POST', 'https://api2.autopilothq.com/v1/contact', [\n 'headers' => [\n 'autopilotapikey' => env('AUTOP'),\n 'Content-Type' => 'application/json'\n ],\n 'json' => [\n 'contact' => [\n 'Email' => $user->email,\n 'custom' => [\n 'string--Subscription--Status' => $payload['data']['object']['status'],\n 'string--Subscription--Plan' => $payload['data']['object']['plan']['name'],\n ],\n '_autopilot_list' => '9ECC7B84-9EB3-43EB-8C08-72A20E2573EA'\n ]\n ]\n ]);\n \n } catch (RequestException $e) {\n \n } catch (ClientException $e) {\n \n }\n\n\n $subscription->save();\n return $subscription;\n }\n\n }",
"public function handleChangeStatus()\n\t{\n // TODO: nechat overenie na parmission listener\n\t\tif (!$this->user->isAllowed('position', 'changeStatus')) {\n\t\t\t$this->flashMessage(_('For this action you do not have enough privileges.'), 'danger');\n\t\t\t$this->redirect(':Admin:Dashboard:');\n\t\t}\n\n $this->positionStatusFilter->setEnabled(false);\n \n\t\t$this->repository->changeStatus(['id' => $this->id]);\n\n if ($this->isAjax()) {\n $this->redrawControl('positionStatus');\n } else {\n $this->redirect('this');\n }\n\t}",
"public function track_helper_subscriptions_refresh() {\n\t\tWC_Tracks::record_event( 'extensions_subscriptions_update' );\n\t}",
"public function syncStripeStatus()\n {\n $subscription = $this->asStripeSubscription();\n\n $this->stripe_status = $subscription->status;\n\n $this->save();\n }",
"public function canHandleSubscriptions():bool\n {\n return false;\n }",
"public function changeclientstatus() {\r\n\t\t$this->clients->changeclientstatus();\r\n\t}",
"public function update_status();",
"protected static function listenForSubscriptionEvents()\n {\n static $listening_for_subscription_events;\n if ($listening_for_subscription_events) {\n return;\n }\n \n static::saved(function ($model) {\n $original = $model->getOriginal();\n \n if ($model->isDirty('billing_active')) {\n if (empty($original['billing_active']) && !empty($model->billing_active)) {\n $model->fireSubscriptionEvent('billingActivated');\n \n if ($model->isDirty('billing_subscription_ends_at')) {\n if (empty($model->billing_subscription_ends_at) && !empty($original['billing_subscription_ends_at'])) {\n $model->fireSubscriptionEvent('billingResumed');\n }\n }\n }\n else if (empty($model->billing_active) && !empty($original['billing_active'])) {\n $model->fireSubscriptionEvent('billingCanceled');\n }\n }\n if ($model->isDirty('billing_plan')) {\n if (!empty($original['billing_plan']) && !empty($model->billing_plan)) {\n $model->fireSubscriptionEvent('planSwapped');\n }\n if (!empty($model->billing_plan)) {\n $model->fireSubscriptionEvent('planChanged');\n }\n }\n if ($model->isDirty('billing_quantity')) {\n if ($model->billing_quantity > 0 && $model->getOriginal('billing_quantity') > 0) {\n if ($model->billing_quantity > $model->getOriginal('billing_quantity')) {\n $model->fireSubscriptionEvent('subscriptionIncremented');\n }\n else {\n $model->fireSubscriptionEvent('subscriptionDecremented');\n }\n }\n }\n if ($model->isDirty('billing_trial_ends_at')) {\n if (!empty($model->billing_trial_ends_at) && !empty($original['billing_trial_ends_at'])) {\n if (strtotime($model->billing_trial_ends_at) > strtotime($model->getOriginal('billing_trial_ends_at'))) {\n $model->fireSubscriptionEvent('trialExtended');\n }\n }\n $model->fireSubscriptionEvent('trialChanged');\n }\n if ($model->isDirty('billing_subscription_discounts')) {\n if (count($model->billing_subscription_discounts) > count(json_decode($model->getOriginal('billing_subscription_discounts'), true))) {\n $model->fireSubscriptionEvent('subscriptionDiscountAdded');\n }\n else if (count($model->billing_subscription_discounts) < count(json_decode($model->getOriginal('billing_subscription_discounts'), true))) {\n $model->fireSubscriptionEvent('subscriptionDiscountRemoved');\n }\n else if (!empty($model->billing_subscription_discounts)) {\n $model->fireSubscriptionEvent('subscriptionDiscountUpdated');\n }\n $model->fireSubscriptionEvent('subscriptionDiscountChanged');\n }\n });\n \n $listening_for_subscription_events = true;\n }",
"public function ajax_subscription() {\n\n\t\t// Bail if subscriptions are not active\n\t\tif ( ! bbp_is_subscriptions_active() ) {\n\t\t\tbbp_ajax_response( false, __( 'Subscriptions are no longer active.', 'bbpress' ), 300 );\n\t\t}\n\n\t\t// Bail if user is not logged in\n\t\tif ( ! is_user_logged_in() ) {\n\t\t\tbbp_ajax_response( false, __( 'Please login to subscribe to this topic.', 'bbpress' ), 301 );\n\t\t}\n\n\t\t// Get user and topic data\n\t\t$user_id = bbp_get_current_user_id();\n\t\t$id = intval( $_POST['id'] );\n\n\t\t// Bail if user cannot add favorites for this user\n\t\tif ( ! current_user_can( 'edit_user', $user_id ) ) {\n\t\t\tbbp_ajax_response( false, __( 'You do not have permission to do this.', 'bbpress' ), 302 );\n\t\t}\n\n\t\t// Get the topic\n\t\t$topic = bbp_get_topic( $id );\n\n\t\t// Bail if topic cannot be found\n\t\tif ( empty( $topic ) ) {\n\t\t\tbbp_ajax_response( false, __( 'The topic could not be found.', 'bbpress' ), 303 );\n\t\t}\n\n\t\t// Bail if user did not take this action\n\t\tif ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'toggle-subscription_' . $topic->ID ) ) {\n\t\t\tbbp_ajax_response( false, __( 'Are you sure you meant to do that?', 'bbpress' ), 304 );\n\t\t}\n\n\t\t// Take action\n\t\t$status = bbp_is_user_subscribed( $user_id, $topic->ID ) ? bbp_remove_user_subscription( $user_id, $topic->ID ) : bbp_add_user_subscription( $user_id, $topic->ID );\n\n\t\t// Bail if action failed\n\t\tif ( empty( $status ) ) {\n\t\t\tbbp_ajax_response( false, __( 'The request was unsuccessful. Please try again.', 'bbpress' ), 305 );\n\t\t}\n\n\t\t// Put subscription attributes in convenient array\n\t\t$attrs = array(\n\t\t\t'topic_id' => $topic->ID,\n\t\t\t'user_id' => $user_id\n\t\t);\n\n\t\t// Action succeeded\n\t\tbbp_ajax_response( true, bbp_get_user_subscribe_link( $attrs, $user_id, false ), 200 );\n\t}",
"private function manageStatus()\n {\n $this->updateStatus();\n $this->checkStatus();\n }",
"public function updated(Subscription $subscription)\n {\n (new Logger())->addLog($subscription, 'renewed');\n }",
"private function process_cancel_subscription( ){\n\t\t$subscription_id = $_POST['ec_account_subscription_id'];\n\t\t$subscription_row = $this->mysqli->get_subscription_row( $subscription_id );\n\t\t$stripe = new ec_stripe( );\n\t\t$cancel_success = $stripe->cancel_subscription( $this->user, $subscription_row->stripe_subscription_id );\n\t\tif( $cancel_success ){\n\t\t\t$this->mysqli->cancel_subscription( $subscription_id );\n\t\t\theader( \"location: \" . $this->account_page . $this->permalink_divider . \"ec_page=subscriptions&account_success=subscription_canceled\" );\n\t\t}else{\n\t\t\theader( \"location: \" . $this->account_page . $this->permalink_divider . \"ec_page=subscription_details&subscription_id=\" . $subscription_id . \"&account_error=subscription_cancel_failed\" );\n\t\t}\n\t}",
"public function isSubscribed(): bool;",
"public function processSubscriptions()\n {\n $subscriptions = new Calendar\\Subscriptions(array('calendar_id'=>$this->id));\n foreach ($subscriptions as $subscription) {\n $subscriptions->process();\n }\n }",
"public function onSubscriptionActivate(SubscriptionInterface $subscription, OrderInterface $order);",
"public function check_and_update_license_status() {\n\n\t\tswitch ( $status = $this->client->get_status() ) {\n\n\t\t\tcase 'valid' :\n\t\t\tcase 'expired' :\n\t\t\t\t$this->set_license_status( $status );\n\t\t\t\tbreak;\n\t\t\tcase 'site_inactive' :\n\t\t\t\tif ( ! is_wp_error( $this->client->activate() ) ) {\n\t\t\t\t\t$this->set_license_status( 'valid' );\n\t\t\t\t} else {\n\t\t\t\t\t$this->set_license_status( $status );\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tdefault :\n\t\t\t\t$this->set_license_status( 'invalid' );\n\t\t\t\tbreak;\n\n\t\t}\n\n\t}",
"protected function _processTransactionSubscriptionModified($parameters) {\n\t\t\t$subscriptionData = array(\n\t\t\t\tarray(\n\t\t\t\t\t'id' => $parameters['subscription_id'],\n\t\t\t\t\t'invoice_id' => $parameters['invoice_id'],\n\t\t\t\t\t'interval_type' => $parameters['interval_type'],\n\t\t\t\t\t'interval_value' => $parameters['interval_value'],\n\t\t\t\t\t'payment_method_id' => $parameters['payment_method_id'],\n\t\t\t\t\t'plan_id' => $parameters['plan_id'],\n\t\t\t\t\t'price' => $parameters['payment_amount'],\n\t\t\t\t\t'user_id' => $parameters['user_id']\n\t\t\t\t)\n\t\t\t);\n\t\t\t$subscriptionStatus = $this->fetch('subscriptions', array(\n\t\t\t\t'conditions' => array(\n\t\t\t\t\t'id' => $parameters['subscription_id']\n\t\t\t\t),\n\t\t\t\t'fields' => array(\n\t\t\t\t\t'status'\n\t\t\t\t)\n\t\t\t));\n\n\t\t\tif (\n\t\t\t\t!empty($parameters['user']) &&\n\t\t\t\t!empty($subscriptionStatus['count']) &&\n\t\t\t\t$this->save('subscriptions', $subscriptionData)\n\t\t\t) {\n\t\t\t\t$paymentMethod = $this->fetch('payment_methods', array(\n\t\t\t\t\t'conditions' => array(\n\t\t\t\t\t\t'id' => $subscriptionData[0]['payment_method_id']\n\t\t\t\t\t),\n\t\t\t\t\t'fields' => array(\n\t\t\t\t\t\t'name'\n\t\t\t\t\t)\n\t\t\t\t));\n\n\t\t\t\tif (!empty($paymentMethod['count'])) {\n\t\t\t\t\t$subscriptionData[0]['payment_method_name'] = $paymentMethod['data'][0];\n\t\t\t\t\t$subscriptionData[0]['status'] = $subscriptionStatus['data'][0];\n\t\t\t\t\t$mailParameters = array(\n\t\t\t\t\t\t'from' => $this->settings['from_email'],\n\t\t\t\t\t\t'subject' => 'Subscription #' . $subscriptionData[0]['id'] . ' modified',\n\t\t\t\t\t\t'template' => array(\n\t\t\t\t\t\t\t'name' => 'subscription_modified',\n\t\t\t\t\t\t\t'parameters' => array(\n\t\t\t\t\t\t\t\t'subscription' => $subscriptionData[0],\n\t\t\t\t\t\t\t\t'transaction' => $parameters,\n\t\t\t\t\t\t\t\t'user' => $parameters['user']\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'to' => $parameters['user']['email']\n\t\t\t\t\t);\n\t\t\t\t\t$this->_sendMail($mailParameters);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn;\n\t\t}",
"public static function set_subscription_mode($reactforumid, $status = 1) {\n global $DB;\n return $DB->set_field(\"reactforum\", \"forcesubscribe\", $status, array(\"id\" => $reactforumid));\n }",
"public static function subscriptionIncremented($callback)\n {\n static::listenForSubscriptionEvents();\n static::registerModelEvent('subscriptionIncremented', $callback);\n }",
"function update_status()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\tif(!empty($data['t']) && !empty($data['list'])) $result = $this->_bid->update_status($data['t'], explode('--',$data['list']));\n\t\t\n\t\t$data['msg'] = !empty($result['boolean']) && $result['boolean']? 'The bid status has been changed.': 'ERROR: The bid status could not be changed.';\n\t\t\n\t\t$data['area'] = 'refresh_list_msg';\n\t\t$this->load->view('addons/basic_addons', $data);\n\t}",
"public function getSubscriptionStatus(): string\n {\n return $this->subscriptionStatus;\n }",
"private function isSubscribed()\n {\n try\n {\n $request = $_POST;\n\n $uid = userid();\n\n if (!$uid)\n throw_error_msg( lang(\"you_not_logged_in\") ) ;\n\n if( !isset($request['userid']) || $request['userid']==\"\" )\n throw_error_msg(\"userid not provided\");\n\n if( !is_numeric($request['userid']) )\n throw_error_msg(\"invalid userid\");\n\n global $userquery;\n $is_subscribed = $userquery->is_subscribed($request['userid'],$uid);\n \n if(!$is_subscribed)\n {\n throw_error_msg(\"user is not subscribed\"); \n }\n else\n {\n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'user is subscribed', \"data\" => $is_subscribed);\n $this->response($this->json($data));\n } \n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }",
"public function subscribesCounter();",
"public function respon(){\n //update 'status'\n }",
"private function subscribe()\n {\n $this->botman->hears('subscribe', function (BotMan $bot) {\n $userId = $bot->getUser()->getId();\n $user = Subscriber::where('telegram_user_id', $userId)->first();\n $userMsg = 'You are already subscribed';\n\n if(is_null($user))\n {\n Subscriber::create(['telegram_user_id' => $userId]);\n $userMsg = 'You have just subscribed to our updates!';\n }\n\n $bot->reply($userMsg);\n });\n }",
"public function getSubscriptionStatus(SubscriptionRequestEntity $requestEntity);",
"function change_status_to() {\n $stat_param = array(\n 'status' => $this->uri->segment(3)\n );\n $id = $this->uri->segment(4);\n $updt_status = $this->guest_post_model->change_status_to('newsletter', $stat_param, $id);\n if ($updt_status) {\n $this->session->set_userdata('success_msg', 'Status Updated susseccfully.');\n } else {\n $this->session->set_userdata('error_msg', 'Cannot update status.');\n }\n redirect('news_letter_cont');\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 }",
"public function handle() {\n $event = $this->get_event();\n $subscription_id = sanitize_text_field( $event->resource->id );\n $order_id = sanitize_text_field( $event->resource->custom_id );\n\n // check if vendor subscription module is active\n if ( ! Helper::has_vendor_subscription_module() ) {\n return;\n }\n\n // validate order\n $order = wc_get_order( $order_id );\n if ( ! $order ) {\n dokan_log( '[Dokan PayPal Marketplace] Webhook: BillingSubscriptionCancelled, Invalid Order id: ' . $order_id ); // maybe deleted order\n return;\n }\n\n // check payment gateway used was dokan paypal marketplace\n if ( $order->get_payment_method() !== Helper::get_gateway_id() ) {\n return;\n }\n\n // check if order is vendor subscription order\n if ( $order->get_meta( '_dokan_vendor_subscription_order' ) !== 'yes' ) {\n return;\n }\n\n // make sure subscription id match with stored subscription id\n $order_subscription_id = $order->get_meta( '_dokan_paypal_marketplace_vendor_subscription_id' );\n if ( empty( $order_subscription_id ) || $order_subscription_id !== $subscription_id ) {\n return;\n }\n\n // check if subscription already cancelled\n if ( empty( get_user_meta( $order->get_customer_id( 'edit' ), '_dokan_paypal_marketplace_vendor_subscription_id', true ) ) ) {\n return;\n }\n\n // finally delete subscription\n SubscriptionHelper::delete_subscription_pack( $order->get_customer_id( 'edit' ), $order_id );\n // update subscription order note as cancelled\n $order->add_order_note( __( 'Subscription Cancelled.', 'dokan' ) );\n }",
"function renewSubscription(&$subscription) {\n\t\t// must be implemented by sub-classes\n\t\tassert(false);\n\t}",
"function update_status()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\t\n\t\tif(!empty($data['t']) && !empty($data['list'])) $response = $this->_tender->update_status($data['t'], explode('--',$data['list']));\n\t\t\n\t\t# all good\n\t\tif(!empty($response) && $response['boolean']){\n\t\t\t$data['msg'] = 'The Invitation for Bids/Quotations status has been updated.';\n\t\t\t$data['area'] = 'refresh_list_msg';\n\t\t} \n\t\t# there was an error\n\t\telse {\n\t\t\t$data['msg'] = (!empty($data['t']) && !empty($data['list']))? 'ERROR: There was an error updating the Invitation for Bids/Quotations status.': 'ERROR: This action can not be resolved';\n\t\t\t$data['area'] = 'basic_msg';\n\t\t}\n\t\t\n\t\t$this->load->view('addons/basic_addons', $data);\n\t}",
"public function change_subadmin_status()\n\t{\n\t\tif ($this->checkLogin('A') == '') \n\t\t{\n\t\t\tredirect('admin');\n\t\t} \n\t\telse \n\t\t{\n\t\t\t$mode = $this->uri->segment(4, 0); \n\t\t\t$adminid = $this->uri->segment(5, 0);\n\t\t\t$status = ($mode == '0') ? 'Inactive' : 'Active';\n\t\t\t$newdata = array('status' => $status); \n\t\t\t$condition = array('id' => $adminid);\n\n\t\t\t$this->subadmin_model->update_details(SUBADMIN, $newdata, $condition);\n\t\t\t$this->setErrorMessage('success', 'Sub Admin Status Changed Successfully');\n\t\t\tredirect('admin/subadmin/display_sub_admin');\n\t\t}\n\t}",
"public function updatesubscription($slug) {\n $paymentData = $this->repository->proccessSubscriptionPayment ( $slug );\n\n if (isset ( $paymentData )) {\n return view ( 'payment::customer.payment.ccavRequestHandler' )->with ( 'encrypted_data', $paymentData );\n } else {\n return false;\n }\n }",
"public function callbackAction()\n {\n // set needed request method parameter\n if ($this->_request->isPost()) {\n $_SERVER['REQUEST_METHOD'] = 'post';\n } else {\n $_SERVER['REQUEST_METHOD'] = 'get';\n }\n\n // disable rendering\n $this->_helper->viewRenderer->setNoRender();\n\n // disable layout for Ajax requests\n $this->_helper->layout()->disableLayout();\n\n // get the subscription storage\n $subscriptionStorage = new PubSubHubbub_Subscription(\n $this->_subscriptionModelInstance,\n $this->_privateConfig->get('subscriptions')\n );\n\n //get the Callback instance and hond over the storage\n $callback = new PubSubHubbub_Subscriber_Callback;\n $callback->setStorage($subscriptionStorage);\n\n // handle request and immediatly send response, to avoid blocking the hub\n $callback->handle($this->_request->getParams(), true);\n\n // ######## Feed Update Handling ########\n // if hub sends you a couple of feed updates\n if (true === $callback->hasFeedUpdate()) {\n //get filepath for the feed update files\n $filePath = $this->_owApp->erfurt->getTmpDir() .\n \"pubsub_\" .\n $this->_request->getParam('xhub_subscription') .\n \"_\" .\n time() .\n \".xml\";\n\n // if filepath is not writable\n if ( false === ( $fh = fopen($filePath, 'w') ) ) {\n // can't open the file\n $m = \"No write permissions for \". $filePath;\n throw new CubeViz_Exception($m);\n }\n\n // write the hole feed update to the file\n fwrite($fh, $callback->getFeedUpdate() . \"\\n\");\n // set file mode\n chmod($filePath, 0755);\n // clsoe file\n fclose($fh);\n\n // collect all subscripton properties\n $subscriptionResourceData = $subscriptionStorage->getSubscription(\n $this->_request->getParam('xhub_subscription')\n );\n\n // create erfurt event\n $event = new Erfurt_Event('onFeedUpdate');\n\n // attach some information to the event\n $event->autoInsertFeedUpdates = 'true' == $this->_privateConfig\n ->get('subscriptions')\n ->get('autoInsertFeedUpdates') ? true : false;\n $event->feedUpdateFilePath = $filePath;\n $event->feedUpdates = $callback->getFeedUpdate();\n\n // extract model iri from subscription entry in subscriptions model\n $modelIriProperty = $this->_privateConfig->get('subscriptions')->get('modelIri');\n $modelIri = $subscriptionResourceData['resourceProperties'][$modelIriProperty][0]['uri'];\n $event->modelInstance = new Erfurt_Rdf_Model($modelIri);\n\n // add source resource to the event\n $event->sourceResource = $subscriptionStorage->getSourceResource(\n $this->_request->getParam('xhub_subscription')\n );\n\n // add subscripton properties to the event\n $event->subscriptionResourceProperties = $subscriptionResourceData['resourceProperties'];\n\n // trigger the event\n $event->trigger();\n }\n }",
"public function set_subscriptions($type,$style){\r\n //check if they have been subscribed before\r\n switch ($type){\r\n case 'subscribe':\r\n switch ($style) {\r\n case 'category':\r\n $data = $this->db->fetch_exact_two('blog_subscriptions','sub_category',Input::get('category'),'subscriber',Session::get('user_id'));\r\n if(count($data)){\r\n $this->db->insert('blog_subscriptions',array(\r\n 'subscriber' => Session::get('user_id'),\r\n 'subscriber_email' => Input::get('comment_email'),\r\n 'sub_category' => Input::get('category'),\r\n 'active' => 1,\r\n 'date' => $this->today,\r\n ));\r\n }\r\n break;\r\n case 'author':\r\n $data = $this->db->fetch_exact_two('blog_subscriptions','sub_author',Input::get('author'),'subscriber',Session::get('user_id'));\r\n if(count($data)){\r\n $this->db->insert('blog_subscriptions',array(\r\n 'subscriber' => Session::get('user_id'),\r\n 'subscriber_email' => Input::get('comment_email'),\r\n 'sub_author' => Input::get('author'),\r\n 'active' => 1,\r\n 'date' => $this->today,\r\n ));\r\n }\r\n break;\r\n }\r\n break;\r\n case 'unsubscribe':\r\n switch ($style) {\r\n case 'category':\r\n $data = $this->db->fetch_exact_two('blog_subscriptions','sub_category',Input::get('category'),'subscriber',Session::get('user_id'));\r\n if(count($data)){\r\n $undo = $this->db->delete('blog_subscriptions',array('sub_category','=',Input::get('category'),'subscriber','=',Session::get('user_id')));\r\n }\r\n break;\r\n case 'author':\r\n $data = $this->db->fetch_exact_two('blog_subscriptions','sub_author',Input::get('author'),'subscriber',Session::get('user_id'));\r\n if(count($data)){\r\n $undo = $this->db->delete('blog_subscriptions',array('sub_author','=',Input::get('author'),'subscriber','=',Session::get('user_id')));\r\n }\r\n break;\r\n }\r\n break;\r\n\r\n\r\n }\r\n return true;\r\n\r\n }",
"public function get_subscription_status( $subscription ) {\n\t\treturn is_array( $subscription ) && isset( $subscription['status'] ) ? $subscription['status'] : '';\n\t}",
"public function onSubscriptionRenew(SubscriptionInterface $subscription, OrderInterface $order, OrderInterface $next_order);",
"function onGetStatus($mynumber, $from, $requested, $id, $time, $data) {\n\tglobal $DBH;\n\t$number = explode(\"@\", $from)[0];\n\t$privacy_enabled = ($time == null ? true : false);\n\n\tif(!$privacy_enabled) {\n\t\t$latest_statusmsg = $DBH->prepare('SELECT 1 FROM statusmessage_history WHERE \"number\"=:number AND \"changed_at\" = to_timestamp(:time)');\n\t\t$latest_statusmsg -> execute(array(':number' => $number,\n\t\t\t\t\t\t\t\t\t\t ':time' => (string)$time));\n\n\t\tif($latest_statusmsg -> rowCount() == 0) {\n\t\t\t// Update database\n\t\t $insert = $DBH->prepare('INSERT INTO statusmessage_history (\n\t\t\t \t\t\t\"number\", status, changed_at)\n\t\t\t \t\t\t\t\t\t VALUES (:number, :status, to_timestamp(:time));');\n\t\t\t$insert->execute(array(':status' => $data,\n\t\t\t\t\t\t\t\t ':number' => $number,\n\t\t\t\t\t\t\t\t ':time' => (string)$time));\n\t\t\techo ' -[status-msg] Inserted new status message for '.$number.' ('.htmlentities($data).').'.\"\\n\";\n\t\t}\n\t}\n\n\t// Update privacy\n\t$privacy_status = $DBH->prepare('SELECT \"statusmessage_privacy\" FROM accounts WHERE \"id\"=:number');\n\t$privacy_status -> execute(array(':number' => $number));\n\t$row = $privacy_status -> fetch();\n\tif($privacy_enabled != (boolean)$row['statusmessage_privacy']) {\n\t\t$update = $DBH->prepare('UPDATE accounts\n\t\t\t\t\t\t\t\tSET \"statusmessage_privacy\" = :privacy WHERE \"id\" = :number;');\n\t\t$update->execute(array(':number' => $number, ':privacy' => (int)$privacy_enabled));\n\t\tif($privacy_enabled) {\n\t\t\techo ' -[status-msg] '.$number.' has the statusmessage privacy option ENABLED! '.\"\\n\";\n\t\t} else {\n\t\t\techo ' -[status-msg] '.$number.' has the statusmessage privacy option DISABLED! '.\"\\n\";\n\t\t}\n\t}\n\n\n}",
"public function event()\n {\n switch ($this->status_changed) {\n case \"in_progress\":\n return \"set to In Progress\";\n case \"completed\":\n return \"closed\";\n case \"submitted\":\n return \"reopened\";\n }\n }",
"public function subscriptionAction()\n {\n // disable rendering\n $this->_helper->viewRenderer->setNoRender();\n\n // disable layout for Ajax requests\n $this->_helper->layout()->disableLayout();\n\n // get the subscription storage\n $subscriptionStorage = new PubSubHubbub_Subscription(\n $this->_subscriptionModelInstance,\n $this->_privateConfig->get('subscriptions')\n );\n\n // get the POST parameter\n $hubUrl = $this->getParam('hubUrl');\n $topicUrl = $this->getParam('topicUrl');\n $callBackUrl = $this->getParam('callBackUrl');\n $subscriptionMode = $this->getParam('subscriptionMode');\n $verifyMode = $this->getParam('verifyMode');\n $sourceResource = $this->getParam('sourceResource');\n\n // get the current user and model URI\n $subscribingUserUri = $this->_owApp->getUser()->getUri();\n $subscriptionModelIri = $this->_owApp->selectedModel->getModelIri();\n\n // check if required urls are filled\n if (\"\" != $hubUrl && \"\" != $topicUrl && \"\" != $callBackUrl) {\n // get the Subscriber and hand over the parameter\n $subscriber = new PubSubHubbub_Subscriber;\n $subscriber->setStorage($subscriptionStorage);\n $subscriber->addHubUrl($hubUrl);\n $subscriber->setTopicUrl($topicUrl);\n $subscriber->setCallbackUrl($callBackUrl);\n $subscriber->setPreferredVerificationMode($verifyMode);\n\n /**\n * start the subscribing process\n */\n if (\"subscribe\" == $subscriptionMode) {\n $subscriber->subscribeAll();\n if (\"\" != $sourceResource) {\n $subscriber->addSourceResourceUri($sourceResource);\n }\n if (\"\" != $subscribingUserUri) {\n $subscriber->addSubscribingUserUri($subscribingUserUri);\n }\n\n // add model iri to the subscription\n $subscriber->addModelIri($subscriptionModelIri);\n\n /**\n * start the unsubscribing process\n */\n } else if (\"unsubscribe\" == $subscriptionMode) {\n $subscriber->unsubscribeAll();\n\n /**\n * if no 'subscriptionMode' were given\n */\n } else {\n echo 'FAILURE: missing parameter';\n $this->_response->setHttpResponseCode(500);\n return;\n }\n\n // check the subscriber, if the subscribtion was successful, else output the errors\n if ($subscriber->isSuccess() && 0 == count($subscriber->getErrors())) {\n $this->_response->setBody('')->setHttpResponseCode(200);\n } else {\n foreach ($subscriber->getErrors() as $error) {\n $this->_response->appendBody($error);\n }\n $this->_response->setHttpResponseCode(404);\n }\n\n // if the required urls are wrong or empty\n } else {\n echo 'FAILURE: wrong Urls';\n }\n }",
"function changeStatus($detail) {\r\n\r\n $cid = $detail['cid'];\r\n\r\n $n = count($detail['cid']);\r\n $db = JFactory::getDBO();\r\n $task = JRequest::getCmd('task');\r\n if ($task == \"unpublish\") {\r\n $publish = 0;\r\n } else {\r\n $publish = 1;\r\n }\r\n for ($i = 0; $i < $n; $i++) {\r\n //update the status to the table.\r\n $query = \"UPDATE #__em_paymentmethod set status=\" . $publish . \"\r\n WHERE id = \" . $cid[$i];\r\n $db->setQuery($query);\r\n $result = $db->loadResult();\r\n }\r\n return $result;\r\n }",
"function success()\n {\n $cur = common_current_user();\n $url = common_local_url('subscriptions', array('nickname' => $cur->nickname));\n common_redirect($url, 303);\n }",
"function statusCheck($smsMessage, $service) {\n\t\t$subscribed = array();\n\t\t$waiting = array();\n\t\t$country = $smsMessage->getCountry();\t\n\t\t$sql = \"SELECT \\\"Service\\\", \\\"Number\\\", \\\"Status\\\" FROM \\\"Subscriptions\\\" WHERE \\\"Number\\\" = '\" . $smsMessage->getOriginator() . \"'\";\n\t\n\t\t$result = pg_query($this->dbConnection, $sql);\n\t\twhile ($rows = pg_fetch_array($result)) {\n\t\t\tswitch ($rows[\"Status\"]) {\n\t\t\t\tcase \"Subscribed\":\n\t\t\t\tif ($rows[\"Service\"] == $service || $service == \"all\") {\n\t\t\t\t\t$subscribed[] = $rows[\"Service\"];\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t\tcase \"Awaiting Confirmation\":\n\t\t\t\tif ($rows[\"Service\"] == $service || $service == \"all\") {\n\t\t\t\t\t$waiting[] = $rows[\"Service\"];\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\n\t\t$shortcode = $smsMessage->getRecipient();\t\t\n\t\t\n\t\tforeach ($subscribed as $service) {\n\t\t\t$serviceDetails = $this->getService($service);\n\t\t\t$message = \"You're subscribed to {$serviceDetails[\"Description\"]}. Text \\\"$service STOP\\\" to {$shortcode} to cancel\";\n\t\t\t$this->sendResponse($smsMessage, $message);\t\t\n\t\t}\n\t\t\n\t\tforeach ($waiting as $service) {\n\t\t\t$serviceDetails = $this->getService($service);\n \t\t$message = \"We are awaiting confirmation for your subscription to {$serviceDetails[\"Description\"]}. Text \\\"$service YES\\\" to {$shortcode} to confirm\";\n\t\t\t$this->sendResponse($smsMessage, $message);\t\t\n\t\t}\n\t}",
"function wcs_get_subscription_ended_statuses() {\n\treturn apply_filters( 'wcs_subscription_ended_statuses', array( 'cancelled', 'trash', 'expired', 'switched', 'pending-cancel' ) );\n}",
"function isSubscribed($number, $service) {\n\t\t$sql = \"SELECT * FROM \\\"Subscriptions\\\" WHERE \\\"Number\\\" = '$number' \" . \n\t\t\"AND \\\"Service\\\" = '$service'\";\n\t\t$result = pg_query($this->dbConnection, $sql);\n\t\tif (pg_num_rows($result) > 0) {\n\t\t\t$subscription = pg_fetch_array($result);\n\t\t\treturn $subscription[\"Status\"];\n\t\t} else {\n\t\t\treturn \"Not Subscribed\";\n\t\t}\n\t}",
"function change_status_to() {\n $stat_param = array(\n 'status' => $this->uri->segment(3)\n );\n $id = $this->uri->segment(4);\n $updt_status = $this->news_letter_model->change_status_to('newsletter', $stat_param, $id);\n if ($updt_status) {\n $this->session->set_userdata('success_msg', 'Status Updated susseccfully.');\n } else {\n $this->session->set_userdata('error_msg', 'Cannot update status.');\n }\n redirect('news_letter_cont');\n }",
"public function testIsInscriptionsOpen()\n {\n \n }",
"function updateLiveStreamStatus($id, $status) {\nglobal $app, $debug, $jconf, $myjobid;\n\n\tif ( empty($status) ) return false;\n\n $values = array(\n\t\t'status' => $status\n\t);\n\n $converterNodeObj = $app->bootstrap->getModel('livefeed_streams');\n $converterNodeObj->select($id);\n $converterNodeObj->updateRow($values);\n \n\t// Log status change\n\t$debug->log($jconf['log_dir'], $myjobid . \".log\", \"[INFO] Live stream id#\" . $id . \" status changed to '\" . $status . \"'.\", $sendmail = false);\n \n\treturn true;\n}",
"function cancel_subscription(){\n\t\t$sub_id = $this->input->post('sub_id');\n\t\tif(!empty($sub_id)){\n\t\t\\Stripe\\Stripe::setApiKey(\"sk_test_NSDNftNd6HhWAxCJczahG70h\");\n\t\t$subscription = \\Stripe\\Subscription::retrieve($sub_id);\n\t\t //return $subscription->cancel();\n\t\t if($subscription->cancel()){\n\t\t\t$this->InteractModal->subscription_suspend($sub_id);\t\t\n\t\t }\t\t \n\t\t}else{\n\t\t\techo \"subcripition id not found\";\n\t\t}\n\t}",
"public function renewSubscription(){\n $payload = \\file_get_contents(\"php://input\");\n $payload = json_decode($payload);\n \n //$this->db->insert(\"data_logs\",array(\"data\"=>json_encode($payload)));\n $sig_header = $_SERVER[\"HTTP_STRIPE_SIGNATURE\"];\n\n $event = null;\n \n $endpoint_secret = \"whsec_fTUGlyFGWCksjdBMBSRarWFGmCNSdqBb\";\n \n try {\n //$event = \\Stripe\\Webhook::constructEvent($payload, $sig_header, $endpoint_secret); \n //$event = $stripe->events()->find(str_replace(\"'\", \"\", $payload->id));\n //print_r($event);\n //die();\n //if (isset($event) && $event->type == \"invoice.payment_failed\") {\n if(isset($payload) && $payload->type== \"invoice.payment_failed\"){\n $subscription_id = $payload->data->object->subscription;\n $id = $this->Users_model->getUserIdBySubsctiptionId($subscription_id);\n $user = $this->Users_model->getRow($id);\n\t\t\t\t$this->Users_model->updateUserDetail($id,array('is_premium'=>0));\n\n\t\t\t\tif($user['plan_duration'] == \"weekly\"){\n\t \t$this->Users_model->deleteSelectedvideos($id);\n\t }\n /*$order = $this->order->where('id_sale', $subscription_id)->first();\n User::where('id', $order->user_id)->update([\n 'is_premium' => 0,\n ]);\n\n $subscription = $this->subscription->where('user_id', $order->user_id)->first();\n $status = $stripe->subscriptions()->cancel($subscription->customer_id, $subscription->subscription_id);\n $cancelCard = CreditCards::where('user_id', $order->user_id)->delete();\n \n $subscription->update([\n 'is_cancelled' => 1,\n \"is_premium\" => 0\n ]);*/\n \n }else if(isset($payload) && $payload->type == \"invoice.payment_succeeded\"){\n $subscription_id = $payload->data->object->subscription;\n $id = $this->Users_model->getUserIdBySubsctiptionId($subscription_id);\n $user = $this->Users_model->getRow($id);\n $next_recharge_date = next_recharge_date($user['plan_duration']);\n \t$array_payment_log = array(\n\t \"user_id\" => $id,\n\t \"plan_id\" => $user['plan_id'],\n\t \"merchant_response\" => json_encode($payload),\n\t \"charge_date\" => date(\"Y-m-d\"),\n\t 'subscription_id' => $subscription_id,\n\t 'amount' => $user['plan_price']\n\t );\n\n\t $insert = array(\n\t 'user_id' => $id,\n\t 'plan_name' => $user['plan_heading'],\n\t 'date' => date('Y-m-d'),\n\t 'next_recharge_date' => $next_recharge_date,\n\t 'plan_id' => $user['plan_id'],\n\t 'subscription_id' => $subscription_id,\n\t 'amount' => $user['plan_price']\n\t );\n\t if($user['plan_duration'] == \"weekly\"){\n\t \t$this->Users_model->deleteSelectedvideos($id);\n\t }\t\n\t $this->Users_model->insertpaymentLogs($array_payment_log);\n\t $this->Users_model->insertChannelSubscriptionDetail($insert);\n\t $this->Users_model->updateUserDetail($id,array('is_premium'=>1));\n\n //$subscription_duration = $this->config->getByName('subscription_duration');\n /*$order = $this->order->where('id_sale', $subscription_id)->first();\n User::where('id', $order->user_id)->update([\n 'is_premium' => 1,\n 'premium_start_date' => Carbon::now(),\n 'premium_end_date' => Carbon::now()->addDays($subscription_duration->value)\n ]);\n \n $order->update(['status' => 'success', 'expiry_date' => Carbon::now()->addDays($subscription_duration->value)]);\n\n $subscription = $this->subscription->where('user_id', $order->user_id)->first();\n \n $subscription->update([\n 'is_cancelled' => 0,\n 'start_date' => Carbon::now(),\n 'end_date' => Carbon::now()->addDays($subscription_duration->value),\n 'plan_name' => 'Your next billing date at \n '.Carbon::now()->addDays($subscription_duration->value)->toDateString()\n ]);*/ \n }\n }catch(\\Cartalyst\\Stripe\\Exception\\UnexpectedValueException $e) {\n // Invalid payload\n print_r($e);\n http_response_code(400); // PHP 5.4 or greater\n exit();\n }\n\n \n }",
"abstract public function onEnded($status);",
"public function onChangeStatus(){\n \n if (($groupId = post('groupId')) != ''){\n \n $group = UserGroup::findOrFail($groupId);\n \n if (($status = post('status')) != ''){\n $user = $this->getuser();\n \n switch ($status){\n case UserGroup::MEMBERSHIP_ACCEPTED:\n $group->acceptMembership($user);\n break;\n \n case UserGroup::MEMBERSHIP_REJECTED:\n \t$group->rejectMembership($user);\n \tbreak;\n \t\n \tcase UserGroup::MEMBERSHIP_CANCELLED:\n \t\t$group->cancelMembership($user);\n \t\tbreak; \t \n \n } \n }\n }\n \n \n // Updated list of request and other vars\n $this->prepareVars();\n }",
"function changeStatus($status)\n\t{\n\t\t$where = array('uid' => session_get('uid'));\n\t\t$this->DB->database_update('users', array('online' => $status), $where);\n\t}",
"public function postEdit($subscriptionId) {\n $isCreated = false;\n\n if ($this->repository->addOrUpdateSubscriptions ( $subscriptionId )) {\n $isCreated = true;\n $this->request->session ()->flash ( 'success', trans ( 'customer::subscription.update.success' ) );\n }\n\n return ($isCreated) ? $this->getSuccessJsonResponse ( [ 'message' => trans ( 'customer::subscription.update.success' ) ] ) : $this->getErrorJsonResponse ( [ ], trans ( 'cms::subscription.update.error' ) );\n }",
"public function unSubscribe()\n {\n }",
"protected static function set_status()\n {\n }",
"public function syncSubscriptions($stripe_customer_id)\n\t{\n\t\t\n\t\t/* If 1.4 and no backward, then leave */\n\t\tif (!$this->backward)\n\t\t\treturn;\n\t\t\t\n\t include_once(dirname(__FILE__).'/lib/Stripe.php');\n\t\t\\Stripe\\Stripe::setApiKey(Configuration::get('STRIPE_MODE') ? Configuration::get('STRIPE_PRIVATE_KEY_LIVE') : Configuration::get('STRIPE_PRIVATE_KEY_TEST'));\n \n\t\t/* Try to process the capture and catch any error message */\n\t\ttry\n\t\t{\n\t\t\t\n\t\t\t$result_json = \\Stripe\\Customer::retrieve($stripe_customer_id);\n\t\t\t\t\t\t\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\n\t\t\t$this->_errors['stripe_subscription_error'] = $e->getMessage();\n\t\t\tif (class_exists('Logger'))\n\t\t\t\tLogger::addLog($this->l('Stripe - Subscription update failed').' '.$e->getMessage(), 1, null, 'Customer', (int)Tools::getIsset('id_customer'), true);\n\t\t}\n\t\t\n\t\t//print_r($result_json);die;\n\t\tif(!isset($this->_errors['stripe_subscription_error'])){\n $subs = $result_json->subscriptions->data;\n\t\t\t\n\t\t\tDb::getInstance()->Execute('DELETE from '._DB_PREFIX_.'stripepro_subscription where `id_customer`='.(int)Tools::getValue('id_customer'));\n\t\t\tif(count($subs)>0)\n\t\t\tforeach($subs as $sub){\n\t\t\t\tDb::getInstance()->Execute('INSERT INTO '._DB_PREFIX_.'stripepro_subscription (stripe_subscription_id, stripe_customer_id, id_customer, stripe_plan_id, quantity, current_period_start, current_period_end, status, date_add) VALUES (\\''.$sub->id.'\\', \\''.$stripe_customer_id.'\\', '.(int)Tools::getValue('id_customer').',\\''.$sub->plan->id.'\\', '.(int)$sub->quantity.', \\''.$sub->current_period_start.'\\',\n\t\t\\''.$sub->current_period_end.'\\', \\''.$sub->status.'\\', NOW())');\n\t\t\n\t\t\t }\n\t\t\t}\n\t\n\treturn true;\n\t\n\t}",
"public function changeStatus(Request $request)\n {\n $return_status = 0;\n $response = [];\n if ($request->has('id')) {\n $id = trim($request->input('id'));\n\n $media = Media::findOrFail($id);\n \n if ($media) {\n\n $media->status = ($media->status==1)?0:1;\n $result = $media->save();\n if ($result) {\n //@todo - send an email to the person whenever their recording gets published.\n if ($media->status==1) {\n $email = $media->email;\n $name = $media->uploaded_by;\n $bodyMessage = '#'.$id.' Published';\n $data = array('email'=>$email, 'name'=>$name, 'recording_code'=>$id,'bodyMessage'=>'','subject'=>'');\n\n $user = User::findOrFail(1);\n $admin_email = $user->email;\n $admin_name = $user->name;\n\n if ($email) {\n Mail::send(\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'emails.publish_notify', $data, function ($message) use ($email, $admin_email, $admin_name) {\n\t\t\t\t\t\t\t\t\t\t$message->to($admin_email, $admin_name)->subject('Your Recording Has Been Published - '.config('app.name'));\n\t\t\t\t\t\t\t\t}\n );\n }\n }\n \n $return_status = 1;\n $response['is_published'] = $media->status;\n $response['message'] = ($media->status==1)?trans('quickadmin::admin.medias-controller-successfully_published'):trans('quickadmin::admin.medias-controller-successfully_unpublished');\n }\n }\n }\n $response['status'] = $return_status;\n echo json_encode($response); \n }",
"function lb_subscription_set_subscription($account, $subscription) {\n // The $account that rules passes contains the original information, which may have\n // changed as a result of an action that has run.\n $entity = entity_load_single('user', $account->uid);\n $account_subscription_data = lb_subscription_retrieve_account_subscription_data($entity, $subscription);\n if ($account_subscription_data['delta'] === NULL) {\n $entity = entity_load_single('user', $account->uid);\n if ($account_subscription_data['subscriptions']) {\n $index = count($entity->field_subscription[LANGUAGE_NONE]);\n }\n else {\n $index = 0;\n }\n $entity->field_subscription[LANGUAGE_NONE][$index] = array(\n 'field_subscription_reference' => array(\n LANGUAGE_NONE => array(\n 0 => array(\n 'target_id' => $subscription->nid,\n ),\n ),\n ),\n );\n entity_save('user', $entity);\n }\n}",
"public function updateSubscription($request);",
"public function getEventSubscriber();",
"function handle_subscription($mode, $post_subject, $uid = 0, $bid = 0, $rid = 0)\n{\n\tglobal $db, $user, $phpbb_root_path, $phpEx, $config;\n\tglobal $user_id, $blog_id, $reply_id;\n\tglobal $blog_data, $blog_urls;\n\n\t// if $uid, $bid, or $rid are not set, use the globals\n\t$uid = ($uid != 0) ? $uid : $user_id;\n\t$bid = ($bid != 0) ? $bid : $blog_id;\n\t$rid = ($rid != 0) ? $rid : $reply_id;\n\n\t// make sure that subscriptions are enabled and that a blog_id is sent\n\tif (!$config['user_blog_subscription_enabled'] || $bid == 0)\n\t{\n\t\treturn;\n\t}\n\n\tif (!isset($user->lang['BLOG_SUBSCRIPTION_NOTICE']))\n\t{\n\t\t$user->add_lang('mods/blog/posting');\n\t}\n\n\t// This will hold all the send info, all ones that will be sent via PM would be $send[1], or Email would be $send[2], next would be $send[4], etc.\n\t$send = array();\n\n\t$subscribe_modes = get_blog_subscription_types();\n\t$temp = compact('mode', 'post_subject', 'uid', 'bid', 'rid', 'send');\n\tblog_plugins::plugin_do_ref('function_handle_subscription', $temp);\n\textract($temp);\n\n\t// Fix the URLs...\n\tif (isset($config['user_blog_seo']) && $config['user_blog_seo'])\n\t{\n\t\t$view_url = ($rid) ? blog_url($uid, $bid, $rid) : blog_url($uid, $bid);\n\t\t$unsubscribe_url = ($rid) ? blog_url($uid, $bid, false, array('page' => 'unsubscribe')) : blog_url($uid, false, false, array('page' => 'unsubscribe'));\n\t}\n\telse\n\t{\n\t\t$view_url = redirect((($rid) ? blog_url($uid, $bid, $rid) : blog_url($uid, $bid)), true);\n\t\t$unsubscribe_url = redirect((($rid) ? blog_url($uid, $bid, false, array('page' => 'unsubscribe')) : blog_url($uid, false, false, array('page' => 'unsubscribe'))), true);\n\t}\n\n\tif ($mode == 'new_reply' && $rid != 0)\n\t{\n\t\t$sql = 'SELECT * FROM ' . BLOGS_SUBSCRIPTION_TABLE . '\n\t\t\tWHERE blog_id = ' . intval($bid) . '\n\t\t\tAND sub_user_id != ' . $user->data['user_id'];\n\t\t$result = $db->sql_query($sql);\n\t\twhile($row = $db->sql_fetchrow($result))\n\t\t{\n\t\t\tif (!array_key_exists($row['sub_type'], $send))\n\t\t\t{\n\t\t\t\t$send[$row['sub_type']] = array($row['sub_user_id']);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$send[$row['sub_type']][] = $row['sub_user_id'];\n\t\t\t}\n\t\t}\n\t\t$db->sql_freeresult($result);\n\n\t\t$message = sprintf($user->lang['BLOG_SUBSCRIPTION_NOTICE'], $view_url, $user->data['username'], $unsubscribe_url);\n\t}\n\telse if ($mode == 'new_blog' && $uid != 0)\n\t{\n\t\t$sql = 'SELECT * FROM ' . BLOGS_SUBSCRIPTION_TABLE . '\n\t\t\tWHERE user_id = ' . intval($uid) . '\n\t\t\tAND sub_user_id != ' . $user->data['user_id'];\n\t\t$result = $db->sql_query($sql);\n\t\twhile($row = $db->sql_fetchrow($result))\n\t\t{\n\t\t\tif (!array_key_exists($row['sub_type'], $send))\n\t\t\t{\n\t\t\t\t$send[$row['sub_type']] = array($row['sub_user_id']);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$send[$row['sub_type']][] = $row['sub_user_id'];\n\t\t\t}\n\t\t}\n\t\t$db->sql_freeresult($result);\n\n\t\t$message = sprintf($user->lang['USER_SUBSCRIPTION_NOTICE'], $user->data['username'], $view_url, $unsubscribe_url);\n\t}\n\n\t$blog_data->get_user_data($config['user_blog_message_from']);\n\n\t// Send the PM\n\tif (isset($send[1]) && sizeof($send[1]))\n\t{\n\t\tif (!function_exists('submit_pm'))\n\t\t{\n\t\t\t// include the private messages functions page\n\t\t\tinclude(\"{$phpbb_root_path}includes/functions_privmsgs.$phpEx\");\n\t\t}\n\n\t\tif (!class_exists('parse_message'))\n\t\t{\n\t\t\tinclude(\"{$phpbb_root_path}includes/message_parser.$phpEx\");\n\t\t}\n\n\t\t$message_parser = new parse_message();\n\n\t\t$message_parser->message = $message;\n\t\t$message_parser->parse(true, true, true);\n\n\t\t// setup out to address list\n\t\t$address_list = array();\n\t\tforeach ($send[1] as $id)\n\t\t{\n\t\t\t$address_list[$id] = 'to';\n\t\t}\n\n\t\t$pm_data = array(\n\t\t\t'from_user_id'\t\t=> $config['user_blog_message_from'],\n\t\t\t'from_username'\t\t=> blog_data::$user[$config['user_blog_message_from']]['username'],\n\t\t\t'address_list'\t\t=> array('u' => $address_list),\n\t\t\t'icon_id'\t\t\t=> 10,\n\t\t\t'from_user_ip'\t\t=> '0.0.0.0',\n\t\t\t'enable_bbcode'\t\t=> true,\n\t\t\t'enable_smilies'\t=> true,\n\t\t\t'enable_urls'\t\t=> true,\n\t\t\t'enable_sig'\t\t=> true,\n\t\t\t'message'\t\t\t=> $message_parser->message,\n\t\t\t'bbcode_bitfield'\t=> $message_parser->bbcode_bitfield,\n\t\t\t'bbcode_uid'\t\t=> $message_parser->bbcode_uid,\n\t\t);\n\n\t\tsubmit_pm('post', $user->lang['SUBSCRIPTION_NOTICE'], $pm_data, false);\n\t\tunset($message_parser, $address_list, $pm_data);\n\t}\n\n\t// Send the email\n\tif (isset($send[2]) && sizeof($send[2]) && $config['email_enable'])\n\t{\n\t\tif (!class_exists('messenger'))\n\t\t{\n\t\t\tinclude(\"{$phpbb_root_path}includes/functions_messenger.$phpEx\");\n\t\t}\n\n\t\t$messenger = new messenger(false);\n\n\t\t$blog_data->get_user_data($send[2]);\n\t\t$reply_url_var = ($rid) ? \"r={$rid}#r{$rid}\" : '';\n\n\t\tforeach ($send[2] as $uid)\n\t\t{\n\t\t\t$messenger->template('blog_notify', $config['default_lang']);\n\t\t\t$messenger->replyto($config['board_contact']);\n\t\t\t$messenger->to(blog_data::$user[$uid]['user_email'], blog_data::$user[$uid]['username']);\n\n\t\t\t$messenger->headers('X-AntiAbuse: Board servername - ' . $config['server_name']);\n\t\t\t$messenger->headers('X-AntiAbuse: User_id - ' . blog_data::$user[$config['user_blog_message_from']]['user_id']);\n\t\t\t$messenger->headers('X-AntiAbuse: Username - ' . blog_data::$user[$config['user_blog_message_from']]['username']);\n\t\t\t$messenger->headers('X-AntiAbuse: User IP - ' . blog_data::$user[$config['user_blog_message_from']]['user_ip']);\n\n\t\t\t$messenger->assign_vars(array(\n\t\t\t\t'BOARD_CONTACT'\t=> $config['board_contact'],\n\t\t\t\t'SUBJECT'\t\t=> $user->lang['SUBSCRIPTION_NOTICE'],\n\t\t\t\t'TO_USERNAME'\t=> blog_data::$user[$uid]['username'],\n\t\t\t\t'TYPE'\t\t\t=> ($rid) ? $user->lang['REPLY'] : $user->lang['BLOG'],\n\t\t\t\t'NAME'\t\t\t=> $post_subject,\n\t\t\t\t'BY_USERNAME'\t=> $user->data['username'],\n\t\t\t\t'U_VIEW'\t\t=> $view_url,\n\t\t\t\t'U_UNSUBSCRIBE'\t=> $unsubscribe_url,\n\t\t\t));\n\n\t\t\t$messenger->send(NOTIFY_EMAIL);\n\t\t}\n\n\t\t// save the queue if we must\n\t\t$messenger->save_queue();\n\n\t\tunset($messenger);\n\t}\n\n\tblog_plugins::plugin_do('function_handle_subscription_end');\n}",
"function cancelSubscriptionAPI($subscriptionid, $userid, $relid) {\n\t$urlsubscriptionid = urlencode($subscriptionid);\n\t$nvpStr=\"ProfileID=$urlsubscriptionid&Action=Cancel&Note=Automated+cancellation.\";\n\t$httpParsedResponseAr = paypalCURLL('ManageRecurringPaymentsProfileStatus', $nvpStr);\n\tif(\"SUCCESS\" == strtoupper($httpParsedResponseAr[\"ACK\"]) || \"SUCCESSWITHWARNING\" == strtoupper($httpParsedResponseAr[\"ACK\"])) {\n\n\t\t//remove subcription id\n\t\t$update_qry = \"UPDATE tblhosting SET subscriptionid = '' WHERE id = $relid\";\n\n\t\ttry {\n\t\t $status = mysql_query($update_qry);\n\t\t if(!$status) {\n\t\t\t $error = mysql_error();\n\t\t\t\tthrow new Exception('Update subscriptionid to null is not successful :'.$error);\n\t\t }\n\t\t} catch (Exception $e) {\n\t\t echo 'Caught exception: ', $e->getMessage(), \"\\n\";\n\t\t}\n\t\t// Log success to WHMCS activity log\n\t\tlogactivity(\"MYWORKS DEBUG: Successfully terminated Paypal Subscription ID: $subscriptionid attached to Service ID: $relid and User ID: $userid\");\n\t} \n\telse {\n\t\t// Build failure message\n\t\tforeach ($httpParsedResponseAr as $key => $value) {\n\t\t\t$message .= \"Key: $key - Value: $value. \";\n\t\t}\n\t\t// Log failure to WHMCS activity log\n\t\tlogactivity(\"MYWORKS DEBUG: Failed to terminate Paypal Subscription ID: $subscriptionid attached to Service ID: $relid and User ID: $userid. Response was $message.\");\n\t}\n}",
"public function changeStatus(): void\n {\n if ('online' === $this->online_status) {\n if ($this->reference_id > 0) {\n $query = 'UPDATE '. rex::getTablePrefix() .'d2u_references_references '\n .\"SET online_status = 'offline' \"\n .'WHERE reference_id = '. $this->reference_id;\n $result = rex_sql::factory();\n $result->setQuery($query);\n }\n $this->online_status = 'offline';\n } else {\n if ($this->reference_id > 0) {\n $query = 'UPDATE '. rex::getTablePrefix() .'d2u_references_references '\n .\"SET online_status = 'online' \"\n .'WHERE reference_id = '. $this->reference_id;\n $result = rex_sql::factory();\n $result->setQuery($query);\n }\n $this->online_status = 'online';\n }\n\n // Don't forget to regenerate URL cache to make online machine available\n if (rex_addon::get('url')->isAvailable()) {\n d2u_addon_backend_helper::generateUrlCache('reference_id');\n d2u_addon_backend_helper::generateUrlCache('tag_id');\n }\n }",
"function fanwood_dim_subscription () {\n\tif ( !bbp_is_subscriptions_active() )\n\t\treturn;\n\n\t$user_id = bbp_get_current_user_id();\n\t$id = intval( $_POST['id'] );\n\n\tif ( !current_user_can( 'edit_user', $user_id ) )\n\t\tdie( '-1' );\n\n\tif ( !$topic = bbp_get_topic( $id ) )\n\t\tdie( '0' );\n\n\tcheck_ajax_referer( \"toggle-subscription_$topic->ID\" );\n\n\tif ( bbp_is_user_subscribed( $user_id, $topic->ID ) ) {\n\t\tif ( bbp_remove_user_subscription( $user_id, $topic->ID ) )\n\t\t\tdie( '1' );\n\t} else {\n\t\tif ( bbp_add_user_subscription( $user_id, $topic->ID ) )\n\t\t\tdie( '1' );\n\t}\n\n\tdie( '0' );\n}",
"public function onSelectChangeStatus(GridRowEventData $event)\n {\n $id = $event->getId();\n $value = $event->getData();\n $control = $event->getControl();\n try {\n $this->adminFacade->changeStatus($id,(bool) $value);\n $control->flashMessage(\n self::MESSAGE_SUCCESS_CHANGE_STATUS,\n AdminPresenter::STATUS_SUCCESS,\n null,\n AdminPresenter::ICON_SUCCESS,\n 100\n );\n $control->reload();\n return;\n } catch (AdminException $exc) {\n $control->getPresenter()->flashMessage(\n $exc->getMessage(),\n AdminPresenter::STATUS_DANGER,\n null,\n AdminPresenter::ICON_DANGER,\n 100\n );\n $control->getPresenter()->redirect(AdminPresenter::ACTION_DEFAULT);\n }\n }",
"public function handleCustomerSubscriptionUpdated(array $payload)\n {\n $user = $this->getCustomerByStripeId($payload['data']['object']['customer']);\n\n if ($user) {\n $data = $payload['data']['object'];\n\n $user->subscriptions->filter(function (Subscription $subscription) use ($data) {\n return $subscription->stripe_id === $data['id'];\n })->each(function (Subscription $subscription) use ($data) {\n // Quantity...\n if (isset($data['quantity'])) {\n $subscription->quantity = $data['quantity'];\n }\n\n // Plan...\n if (isset($data['plan']['id'])) {\n $subscription->stripe_plan = $data['plan']['id'];\n }\n\n // Trial ending date...\n if (isset($data['trial_end'])) {\n $trial_ends = Carbon::createFromTimestamp($data['trial_end']);\n\n if (\n !$subscription->trial_ends_at ||\n $subscription->trial_ends_at->ne($trial_ends)\n ) {\n $subscription->trial_ends_at = $trial_ends;\n }\n }\n\n // Cancellation date...\n if (isset($data['cancel_at_period_end']) && $data['cancel_at_period_end']) {\n $subscription->ends_at = $subscription->onTrial()\n ? $subscription->trial_ends_at\n : Carbon::createFromTimestamp($data['current_period_end']);\n }\n\n $subscription->save();\n });\n }\n\n return true;\n }",
"public static function onChangeStatusConnector(\\Bitrix\\Main\\Event $event)\n\t{\n\t\t$parameters = $event->getParameters();\n\t\tself::addSingleLineUpdateAgent($parameters['line']);\n\t}",
"protected function _actionEditsubscription( KCommandContext $context )\n {\n if( $subscription = $this->_subscriber->changeSubscriptionTo( $this->getItem() ) )\n {\n $subscription->endDate = $context->data->endDate;\n }\n }",
"public function setSubscription(array $data)\n {\n $returnValue = false;\n\n // check if subscription id exists\n if (!isset($data['id'])) {\n require_once 'Zend/Feed/Pubsubhubbub/Exception.php';\n throw new Zend_Feed_Pubsubhubbub_Exception(\n 'ID must be set before attempting a save'\n );\n }\n\n // generate uri with subscription id\n $subscriptionResourceUri = $this->_generateSubscriptionResourceUri(\n $this->_subscriptionConfig->get('classUri'),\n $data['id']\n );\n\n // get the subscription as OntoWiki resource\n $subscriptionResource = new OntoWiki_Model_Resource(\n $this->_selectedModelInstance->getStore(),\n $this->_selectedModelInstance,\n $subscriptionResourceUri\n );\n\n // get all properties of the subscription\n $subscriptionResourceProperties = $subscriptionResource->getValues();\n\n // if the subscription has properties update the changed one's\n if (0 < count($subscriptionResourceProperties)) {\n $modelIri = $this->_selectedModelInstance->getModelIri();\n $subscriptionResourceProperties = $subscriptionResourceProperties[$modelIri];\n $createdTimePropertyUri = $this->_subscriptionConfig->get($this->_propertyMatching['created_time']);\n $data['created_time'] = $subscriptionResourceProperties[$createdTimePropertyUri][0]['content'];\n\n // get the current time\n $now = new Zend_Date;\n\n // if lease seconds is set to the subscription, calculate a new expiration time\n if (isset($data['lease_seconds'])) {\n $data['expiration_time'] = $now\n ->add($data['lease_seconds'], Zend_Date::SECOND)\n ->get('yyyy-MM-dd HH:mms');\n }\n\n // generate new add and delete statements from subscriber data array\n $statements = $this->_generateStatements(\n $subscriptionResourceUri,\n $data,\n $subscriptionResourceProperties\n );\n\n // setup the versioning options\n $versioningActionSpec = array(\n 'type' => self::VERSIONING_SUBSCRIPTION_UPDATE_ACTION_TYPE,\n 'modeluri' => $this->_selectedModelInstance->getBaseUri(),\n 'resourceuri' => $subscriptionResourceUri\n );\n\n // start versioning\n $this->_versioning->startAction($versioningActionSpec);\n\n // add and delete the statements to the store\n $this->_selectedModelInstance->addMultipleStatements($statements['addStatements']);\n $this->_selectedModelInstance->deleteMultipleStatements($statements['deleteStatements']);\n\n $returnValue = false;\n // if the subscription has now proberties only add the properties\n } else {\n // generate the add statements\n $statements = $this->_generateStatements($subscriptionResourceUri, $data);\n\n // setup the versioning options\n $versioningActionSpec = array(\n 'type' => self::VERSIONING_SUBSCRIPTION_ADD_ACTION_TYPE,\n 'modeluri' => $this->_selectedModelInstance->getBaseUri(),\n 'resourceuri' => $subscriptionResourceUri\n );\n\n // start versioning\n $this->_versioning->startAction($versioningActionSpec);\n\n // add the statements to the store\n $this->_selectedModelInstance->addMultipleStatements($statements['addStatements']);\n\n $returnValue = true;\n }\n\n // end versioning\n $this->_versioning->endAction();\n\n return $returnValue;\n }",
"function SwissPostApiGetTransferStatus(Varien_Event_Observer $observer){\n $result = $observer->getData('result');\n $order_refs = $observer->getData('order_refs');\n if($result && $result->getValues()){\n $values = $result->getValues();\n foreach ($order_refs as $order_ref){\n foreach ($values as $status){\n if(stripos($status['order_ref'], $order_ref) !== false){ \n $order = Mage::helper('swisspostsales/Order')->__fromOrderRef($order_ref);\n if($order){\n Mage::helper('swisspostsales/Order')->processTransferStatus($order, $status);\n // set final status\n if(Mage::helper('swisspostsales/Order')->isCompleted($order)){\n Mage::helper('swisspostsales/Order')->__toCompleted($order);\n }\n }\n }\n }\n }\n }\n }",
"protected function maybe_handle_subscription( $order ) {\n\t\tif ( ! class_exists( 'WC_Subscriptions' ) ) {\n\t\t\treturn array( false, false, array() );\n\t\t}\n\n\t\tif ( ! wcs_order_contains_subscription( $order ) ) {\n\t\t\treturn array( false, false, array() );\n\t\t}\n\n\t\t$subscription = current( wcs_get_subscriptions_for_order( $order->get_id() ) );\n\t\t$subscription_id = $subscription->get_id();\n\n\t\t$ppec_billing = get_post_meta( $subscription_id, '_ppec_billing_agreement_id', true );\n\n\t\tif ( empty( $ppec_billing ) ) {\n\t\t\treturn array( false, false, array() );\n\t\t}\n\n\t\tif ( $subscription->has_status( apply_filters( 'woocommerce_paypal_express_checkout_privacy_eraser_subs_statuses', array( 'on-hold', 'active' ) ) ) ) {\n\t\t\treturn array( false, true, array( sprintf( __( 'Order ID %d contains an active Subscription' ), $order->get_id() ) ) );\n\t\t}\n\n\t\t$renewal_orders = WC_Subscriptions_Renewal_Order::get_renewal_orders( $order->get_id() );\n\n\t\tforeach ( $renewal_orders as $renewal_order_id ) {\n\t\t\tdelete_post_meta( $renewal_order_id, '_woo_pp_txnData' );\n\t\t\tdelete_post_meta( $renewal_order_id, '_ppec_billing_agreement_id' );\n\t\t\tdelete_post_meta( $renewal_order_id, '_paypal_status' );\n\t\t}\n\n\t\tdelete_post_meta( $subscription_id, '_woo_pp_txnData' );\n\t\tdelete_post_meta( $subscription_id, '_ppec_billing_agreement_id' );\n\t\tdelete_post_meta( $subscription_id, '_paypal_status' );\n\n\t\treturn array( true, false, array( __( 'PayPal Checkout Subscriptions Data Erased.', 'woocommerce-gateway-paypal-express-checkout' ) ) );\n\t}",
"private function updateStatus()\n {\n $this->setStatus(\n socket_get_status(pfsockopen($this->uri, $this->port))\n );\n }",
"function wcs_get_subscriptions( $args ) {\n\tglobal $wpdb;\n\n\t$args = wp_parse_args( $args, array(\n\t\t\t'subscriptions_per_page' => 10,\n\t\t\t'paged' => 1,\n\t\t\t'offset' => 0,\n\t\t\t'orderby' => 'start_date',\n\t\t\t'order' => 'DESC',\n\t\t\t'customer_id' => 0,\n\t\t\t'product_id' => 0,\n\t\t\t'variation_id' => 0,\n\t\t\t'order_id' => 0,\n\t\t\t'subscription_status' => array( 'any' ),\n\t\t\t'meta_query_relation' => 'AND',\n\t\t)\n\t);\n\n\t// if order_id is not a shop_order\n\tif ( 0 !== $args['order_id'] && 'shop_order' !== get_post_type( $args['order_id'] ) ) {\n\t\treturn array();\n\t}\n\n\t// Ensure subscription_status is an array.\n\t$args['subscription_status'] = $args['subscription_status'] ? (array) $args['subscription_status'] : array();\n\n\t// Grab the native post stati, removing pending and adding any.\n\t$builtin = get_post_stati( array( '_builtin' => true ) );\n\tunset( $builtin['pending'] );\n\t$builtin['any'] = 'any';\n\n\t// Make sure status starts with 'wc-'\n\tforeach ( $args['subscription_status'] as &$status ) {\n\t\tif ( isset( $builtin[ $status ] ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$status = wcs_sanitize_subscription_status_key( $status );\n\t}\n\n\t// Prepare the args for WP_Query\n\t$query_args = array(\n\t\t'post_type' => 'shop_subscription',\n\t\t'post_status' => $args['subscription_status'],\n\t\t'posts_per_page' => $args['subscriptions_per_page'],\n\t\t'paged' => $args['paged'],\n\t\t'offset' => $args['offset'],\n\t\t'order' => $args['order'],\n\t\t'fields' => 'ids',\n\t\t'meta_query' => isset( $args['meta_query'] ) ? $args['meta_query'] : array(), // just in case we need to filter or order by meta values later\n\t);\n\n\t// Maybe only get subscriptions created by a certain order\n\tif ( 0 != $args['order_id'] && is_numeric( $args['order_id'] ) ) {\n\t\t$query_args['post_parent'] = $args['order_id'];\n\t}\n\n\t// Map subscription specific orderby values to internal/WordPress keys\n\tswitch ( $args['orderby'] ) {\n\t\tcase 'status' :\n\t\t\t$query_args['orderby'] = 'post_status';\n\t\t\tbreak;\n\t\tcase 'start_date' :\n\t\t\t$query_args['orderby'] = 'date';\n\t\t\tbreak;\n\t\tcase 'trial_end_date' :\n\t\tcase 'end_date' :\n\t\t\t// We need to orderby post meta value: http://www.paulund.co.uk/order-meta-query\n\t\t\t$date_type = str_replace( '_date', '', $args['orderby'] );\n\t\t\t$query_args = array_merge( $query_args, array(\n\t\t\t\t'orderby' => 'meta_value',\n\t\t\t\t'meta_key' => wcs_get_date_meta_key( $date_type ),\n\t\t\t\t'meta_type' => 'DATETIME',\n\t\t\t) );\n\t\t\t$query_args['meta_query'][] = array(\n\t\t\t\t'key' => wcs_get_date_meta_key( $date_type ),\n\t\t\t\t'compare' => 'EXISTS',\n\t\t\t\t'type' => 'DATETIME',\n\t\t\t);\n\t\t\tbreak;\n\t\tdefault :\n\t\t\t$query_args['orderby'] = $args['orderby'];\n\t\t\tbreak;\n\t}\n\n\t// Maybe filter to a specific user\n\tif ( 0 != $args['customer_id'] && is_numeric( $args['customer_id'] ) ) {\n\t\t$query_args['meta_query'][] = array(\n\t\t\t'key' => '_customer_user',\n\t\t\t'value' => $args['customer_id'],\n\t\t\t'type' => 'numeric',\n\t\t\t'compare' => ( is_array( $args['customer_id'] ) ) ? 'IN' : '=',\n\t\t);\n\t};\n\n\t// We need to restrict subscriptions to those which contain a certain product/variation\n\tif ( ( 0 != $args['product_id'] && is_numeric( $args['product_id'] ) ) || ( 0 != $args['variation_id'] && is_numeric( $args['variation_id'] ) ) ) {\n\t\t$query_args['post__in'] = wcs_get_subscriptions_for_product( array( $args['product_id'], $args['variation_id'] ) );\n\t}\n\n\tif ( ! empty( $query_args['meta_query'] ) ) {\n\t\t$query_args['meta_query']['relation'] = $args['meta_query_relation'];\n\t}\n\n\t$query_args = apply_filters( 'woocommerce_get_subscriptions_query_args', $query_args, $args );\n\n\t$subscription_post_ids = get_posts( $query_args );\n\n\t$subscriptions = array();\n\n\tforeach ( $subscription_post_ids as $post_id ) {\n\t\t$subscriptions[ $post_id ] = wcs_get_subscription( $post_id );\n\t}\n\n\treturn apply_filters( 'woocommerce_got_subscriptions', $subscriptions, $args );\n}",
"function subscribe($entity){\n\t\tif($entity instanceof ElggUser){\n\t\t\treturn $entity->setMetaData('isSubscribedNewsletter',true);\n\t\t}else{\n\t\t\tregister_error(elgg_echo('vazco_newsletter:notanuser'));\n\t\t\treturn false;\n\t\t}\n\t}",
"public function subscribe($subscriber): void;",
"private function changeStatusLicense() {\n if ($this->get_request_method() != \"POST\") {\n $error = array('status_code' => \"0\", 'message' => \"wrong method\", 'response_code' => \"406\");\n $this->response($this->json($error), 406);\n }\n\n $arr = array();\n if(@$_POST['reqparams']) {\n $post = $_POST['reqparams'];\n $LicenseID = $post['LicenseID'];\n $StatusID = $post['StatusID'];\n } else {\n $LicenseID = $_POST['LicenseID'];\n $StatusID = $_POST['StatusID'];\n }\n\n $sql = mysql_query(\"UPDATE `SCP_Licenses` SET `StatusID`='$StatusID' WHERE `LicenseID` = '$LicenseID'\", $this->db);\n\n if($sql) {\n $error = array('status_code' => \"1\", 'status' => \"success\", 'message' => \"Changed License Status Successfully\", 'response_code' => \"200\", 'response_data' => $arr);\n $this->response($this->json($error), 200);\n } else {\n $error = array('status_code' => \"0\", 'status' => \"error\", 'message' => \"validation error\", 'response_code' => \"200\", 'response_data' => $arr);\n $this->response($this->json($error), 200);\n }\n }",
"public function changeStatusAjaxAction()\n\t{\n\t\t$data = $this->getRequest()->getPost();\n\t\tif($data){\n\t\t\tif($data['lb_item_status']!=\"\"){\n\t\t\t\t$order = Mage::getModel('sales/order')->load($data['order_id']);\n\t\t\t\t$orderStatus = $order->getStatus();\n\t\t\t\t$lbOrderItemInstance = Mage::getModel('dropship360/orderitems')->getCollection()->addFieldToFilter('item_id', $data['lb_item_id']);\n\t\t\t\ttry{\n\t\t\t\t\tif($lbOrderItemInstance->count() > 0){\t\t\t\n\t\t\t\t\t\tforeach($lbOrderItemInstance as $item){\n\t\t\t\t\t\t\t$itemStatusHistory = Mage::helper('dropship360')->getSerialisedData($item, $data['lb_item_status'], $orderStatus);\n\t\t\t\t\t\t\t$item->setLbItemStatus($data['lb_item_status']);\n\t\t\t\t\t\t\t$item->setItemStatusHistory($itemStatusHistory);\n\t\t\t\t\t\t\t$item->setUpdatedBy('User');\n\t\t\t\t\t\t\t$item->setUpdatedAt(Mage::getModel('core/date')->gmtDate());\n\t\t\t\t\t\t\t$item->save();\t\n\t\t\t\t\t\t\tif($data['lb_item_status']==$item->getLbItemStatus()){\n\t\t\t\t\t\t\t\t$data['msg'] = $item->getSku().' status successfully changed to '.$data['lb_item_status'];\n\t\t\t\t\t\t\t\tMage::getSingleton('adminhtml/session')->addSuccess(Mage::helper('dropship360')->__($data['msg']));\n\t\t\t\t\t\t\t}else{\n\t\t\t\t\t\t\t\t$data['msg'] = $item->getSku().' status unable to change to '.$data['lb_item_status'];\n\t\t\t\t\t\t\t\tMage::getSingleton('adminhtml/session')->addError(Mage::helper('dropship360')->__($data['msg']));\n\t\t\t\t\t\t\t}\t\n\t\t\t\t\t\t}\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\tif($data['lb_item_status'] == 'Transmitting'){\n\t\t\t\t\t\tMage::getModel('dropship360/logicbroker')->setupNotification();\n\t\t\t\t\t}\t\t\t\n\t\t\t\t\t$result = Mage::helper('core')->jsonEncode($data);\n\t\t\t\t\tMage::app()->getResponse()->setBody($result);\n\t\t\t\t}catch(Exception $e){\t\t\t\n\t\t\t\t\tMage::getSingleton('adminhtml/session')->addError($e->getMessage());\n\t\t\t\t}\n\t\t\t}\n\t\t}else{\n\t\t\t$data['msg'] = 'Unable to perform the required operation';\n\t\t}\t\n\t}"
] | [
"0.69961584",
"0.68251616",
"0.6682937",
"0.6163556",
"0.61421794",
"0.61269015",
"0.6100753",
"0.60892916",
"0.60783374",
"0.6020228",
"0.60188484",
"0.5958516",
"0.59445626",
"0.59377515",
"0.5928392",
"0.59181035",
"0.58703125",
"0.58572906",
"0.5824231",
"0.5818171",
"0.57861",
"0.5774783",
"0.5762263",
"0.5716965",
"0.56926966",
"0.56699383",
"0.56583697",
"0.5638694",
"0.5614707",
"0.55731726",
"0.5567915",
"0.5561537",
"0.5538544",
"0.54882807",
"0.548767",
"0.5470759",
"0.547048",
"0.5466303",
"0.54544795",
"0.5440315",
"0.5437152",
"0.54226667",
"0.5419377",
"0.5399246",
"0.5395437",
"0.53919536",
"0.538949",
"0.5384971",
"0.53723407",
"0.5371334",
"0.53689086",
"0.5364957",
"0.5363905",
"0.53591776",
"0.53408194",
"0.5328497",
"0.532706",
"0.53265935",
"0.5319416",
"0.53166896",
"0.53141063",
"0.53062266",
"0.53018695",
"0.52824616",
"0.528202",
"0.52804375",
"0.5277968",
"0.5274801",
"0.52508235",
"0.5249984",
"0.5246518",
"0.5239549",
"0.5236586",
"0.5232861",
"0.5202604",
"0.520183",
"0.5199906",
"0.51962394",
"0.51861197",
"0.5184415",
"0.51795316",
"0.5177142",
"0.5173816",
"0.5161568",
"0.515839",
"0.51539344",
"0.51531893",
"0.5151443",
"0.5150232",
"0.51431084",
"0.51428103",
"0.51275074",
"0.51260346",
"0.51231414",
"0.5121886",
"0.5120817",
"0.511881",
"0.51156545",
"0.51108366",
"0.5104474"
] | 0.6571152 | 3 |
Update membership end date when subscription expiration date is changed | public function update_membership_end_date( $is_set, $expiration_date, $subscription_key ) {
$user_memberships = $this->get_memberships_from_subscription( $subscription_key );
if ( ! $user_memberships ) {
return;
}
foreach ( $user_memberships as $user_membership ) {
$plan_id = $user_membership->get_plan_id();
if ( $plan_id && $this->plan_grants_access_while_subscription_active( $plan_id ) ) {
$end_date = $expiration_date ? date( 'Y-m-d H:i:s', $expiration_date ) : '';
$user_membership->set_end_date( $end_date );
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function renewMembership(&$user){\n\t\t$dateEnd = $user->getSetting('dateEndMembership', 0);\n\t\tif (!$dateEnd) $dateEnd = 0;\n\t\t\n\t\t// if the membership is expired, extend it to today + 1 year\n\t\t$time = time();\n\t\tif ($dateEnd < $time ) $dateEnd = $time;\n\n\t\t$dateEnd = mktime(23, 59, 59, date(\"m\", $dateEnd), date(\"d\", $dateEnd), date(\"Y\", $dateEnd)+1);\n\t\t$user->updateSetting('dateEndMembership', $dateEnd, 'date', 0);\n\t}",
"function _renewSubscription(&$subscription) {\n\t\tif ($subscription->isNonExpiring()) return;\n\n\t\t$subscriptionTypeDao =& DAORegistry::getDAO('SubscriptionTypeDAO');\n\t\t$subscriptionType =& $subscriptionTypeDao->getSubscriptionType($subscription->getTypeId());\n\n\t\t$duration = $subscriptionType->getDuration();\n\t\t$dateEnd = strtotime($subscription->getDateEnd());\n\n\t\t// if the subscription is expired, extend it to today + duration of subscription\n\t\t$time = time();\n\t\tif ($dateEnd < $time ) $dateEnd = $time;\n\n\t\t$subscription->setDateEnd(mktime(23, 59, 59, date(\"m\", $dateEnd)+$duration, date(\"d\", $dateEnd), date(\"Y\", $dateEnd)));\n\n\t\t// Reset reminder dates\n\t\t$subscription->setDateRemindedBefore(null);\n\t\t$subscription->setDateRemindedAfter(null);\n\n\t\t$this->updateSubscription($subscription);\n\t}",
"private function _retrieveEndDate()\n {\n global $preferences;\n\n $bdate = new \\DateTime($this->_begin_date);\n if ( $preferences->pref_beg_membership != '' ) {\n //case beginning of membership\n list($j, $m) = explode('/', $preferences->pref_beg_membership);\n $edate = new \\DateTime($bdate->format('Y') . '-' . $m . '-' . $j);\n while ( $edate <= $bdate ) {\n $edate->modify('+1 year');\n }\n $this->_end_date = $edate->format('Y-m-d');\n } else if ( $preferences->pref_membership_ext != '' ) {\n //case membership extension\n $dext = new \\DateInterval('P' . $this->_extension . 'M');\n $edate = $bdate->add($dext);\n $this->_end_date = $edate->format('Y-m-d');\n }\n }",
"function e20r_extend_enddate_by_duration( $enddate, $user_id, $level_obj, $startdate ) {\n\n //does this level expire? \n\tif(!empty($level_obj) && !empty($level_obj->expiration_number) )\n\t{\n\t\t//get the current enddate of their membership\n\t\t$membership_level = pmpro_getMembershipLevelForUser($user_id);\n\t\t$expiration_date = $membership_level->enddate;\n\t\t\n\t\t//calculate days left\n\t\t$todays_date = current_time('timestamp');\n\t\t$time_left = $expiration_date - $todays_date;\n\t\t\n\t\t//time left?\n\t\tif($time_left > 0)\n\t\t{\n\t\t\t//convert to days and add to the expiration date (assumes expiration was 1 year)\n\t\t\t$days_left = floor($time_left/(60*60*24));\n\t\t\t\n\t\t\t//figure out days based on period\n\t\t\tif($level_obj->expiration_period == \"Day\")\n\t\t\t\t$total_days = $days_left + $level_obj->expiration_number;\n\t\t\telseif($level_obj->expiration_period == \"Week\")\n\t\t\t\t$total_days = $days_left + $level_obj->expiration_number * 7;\n\t\t\telseif($level_obj->expiration_period == \"Month\")\n\t\t\t\t$total_days = $days_left + $level_obj->expiration_number * 30;\n\t\t\telseif($level_obj->expiration_period == \"Year\")\n\t\t\t\t$total_days = $days_left + $level_obj->expiration_number * 365;\n\t\t\t\n\t\t\t//update the end date\n\t\t\t$enddate = date(\"Y-m-d\", strtotime(\"+ $total_days Days\", $todays_date));\n\t\t}\n\t}\n\t\t\n\treturn $enddate;\n\n }",
"function updateSubscriptionEndDate($subscription_start_date, $timePeriodForService) {\n $subscriptionEndDate = '';\n if ($timePeriodForService == \"1 Month\") {\n $timePeriod = \"1 month\";\n $subscriptionEndDate = date('Y-m-d',strtotime($subscription_start_date . \" + \". $timePeriod));\n } elseif ($timePeriodForService == \"3 months\" || $timePeriodForService == \"3 Months\"){ // Added as per discussion with Faizan CCP-5379\n $timePeriod = \"3 months\";\n $subscriptionEndDate = date('Y-m-d',strtotime($subscription_start_date . \" + \". $timePeriod));\n } elseif ($timePeriodForService == \"1 Year\" || ($timePeriodForService == '' || $timePeriodForService == null)) {\n $timePeriod = \"365 day\";\n $subscriptionEndDate = date('Y-m-d',strtotime($subscription_start_date . \" + \". $timePeriod));\n } elseif ($timePeriodForService == \"2 Years\") {\n $timePeriod = \"730 day\";\n $subscriptionEndDate = date('Y-m-d',strtotime($subscription_start_date . \" + \". $timePeriod));\n } elseif ($timePeriodForService == \"3 Years\") {\n $timePeriod = \"1095 day\";\n $subscriptionEndDate = date('Y-m-d',strtotime($subscription_start_date . \" + \". $timePeriod));\n }\n\n return $subscriptionEndDate;\n }",
"function caculateUserMembershipEndDate($user_id)\n\t{\n\t\t//get user membership data\n\t\t$sql=\"SELECT B.timeline, A.purchase_date FROM \".$this->table.\" AS A\";\n\t\t$sql.=\" LEFT JOIN membership_level AS B ON B.id=A.membership_id\";\n\t\t$sql.=\" WHERE A.user_id=\".$user_id;\n\t\t\n\t\t$result=$this->db->query($sql);\n\t\t$user_data=$result->row();\n\n\t\t$start = date_timestamp_get(date_create($user_data->purchase_date));\n\t\t$end = $start + (3600*24*$user_data->timeline);\n\n\t\treturn date('Y-m-d', $end);\n\t}",
"public function setEndDate(DrupalDateTime $end_date = NULL);",
"protected function _actionEditsubscription( KCommandContext $context )\n {\n if( $subscription = $this->_subscriber->changeSubscriptionTo( $this->getItem() ) )\n {\n $subscription->endDate = $context->data->endDate;\n }\n }",
"function lb_subscription_set_renewal_date($account, $subscription, $renewal_date) {\n // The $account that rules passes contains the original information, which may have\n // changed as a result of an action that has run.\n $entity = entity_load_single('user', $account->uid);\n $account_subscription_data = lb_subscription_retrieve_account_subscription_data($entity, $subscription);\n if ($account_subscription_data['delta'] === NULL) {\n lb_subscription_set_subscription($account, $subscription);\n $entity = entity_load_single('user', $account->uid);\n $account_subscription_data = lb_subscription_retrieve_account_subscription_data($entity, $subscription);\n }\n if ($account_subscription_data['delta'] !== NULL) {\n $entity->field_subscription[LANGUAGE_NONE][$account_subscription_data['delta']]['field_renewal_date'] = array(\n LANGUAGE_NONE => array(\n 0 => array(\n 'value' => $renewal_date,\n 'format' => NULL,\n 'safe_value' => $renewal_date,\n ),\n ),\n );\n entity_save('user', $entity);\n }\n}",
"public function markAsExpired()\n {\n // Set subscription to end on next billing date\n $this->trialEndsAt = $this->trialEndsAt ? : $this->nextBillingDate;\n $this->endsAt = $this->nextBillingDate;\n\n return $this->save();\n }",
"public function setNewSubscriptionExpireDate(int $userSubscriptionId, int $expiresAt);",
"public function filter_rcp_member_renewal_expiration( $expiration, $subscription, $user_id ) {\n\t\t$base_date = current_time( 'timestamp' );\n\n\t\tif( $subscription->duration > 0 ) {\n\n\t\t\t$last_day = cal_days_in_month( CAL_GREGORIAN, date( 'n', $base_date ), date( 'Y', $base_date ) );\n\t\t\t$expiration = date( 'Y-m-d H:i:s', strtotime( '+' . $subscription->duration . ' ' . $subscription->duration_unit . ' 23:59:59', $base_date ) );\n\n\t\t\tif( date( 'j', $base_date ) == $last_day && 'day' != $subscription->duration_unit ) {\n\t\t\t\t$expiration = date( 'Y-m-d H:i:s', strtotime( $expiration . ' +2 days' ) );\n\t\t\t}\n\n\t\t} else {\n\t\t\t$expiration = 'none';\n\t\t}\n\n\t\treturn $expiration;\n\t}",
"function acadp_listing_expiry_date( $post_id, $start_date = NULL ) {\n\n\t// Get number of days to add\n\t$general_settings = get_option( 'acadp_general_settings' );\n\t$days = apply_filters( 'acadp_listing_duration', $general_settings['listing_duration'], $post_id );\n\n\tif( $days <= 0 ) {\n\t\tupdate_post_meta( $post_id, 'never_expires', 1 );\n\t\t$days = 999;\n\t} else {\n\t\tdelete_post_meta( $post_id, 'never_expires' );\n\t}\n\n\tif( $start_date == NULL ) {\n\t\t// Current time\n\t\t$start_date = current_time( 'mysql' );\n\t}\n\n\t// Calculate new date\n\t$date = new DateTime( $start_date );\n\t$date->add( new DateInterval( \"P{$days}D\" ) );\n\n\t// return\n\treturn $date->format( 'Y-m-d H:i:s' );\n\n}",
"private function _updateDeadline()\n {\n global $zdb;\n\n try {\n $due_date = self::getDueDate($this->_member);\n\n if ( $due_date != '' ) {\n $date_fin_update = $due_date;\n } else {\n $date_fin_update = new Expression('NULL');\n }\n\n $update = $zdb->update(Adherent::TABLE);\n $update->set(\n array('date_echeance' => $date_fin_update)\n )->where(\n Adherent::PK . '=' . $this->_member\n );\n $zdb->execute($update);\n return true;\n } catch (\\Exception $e) {\n Analog::log(\n 'An error occured updating member ' . $this->_member .\n '\\'s deadline |' .\n $e->getMessage(),\n Analog::ERROR\n );\n return false;\n }\n }",
"public function getExpirationDate();",
"public function setDateEnd($dateEnd)\n {\n $this->dateEnd = VT::toDateTimeImmutable($dateEnd);\n }",
"public function membershipAction()\n {\n $common = $this->getServiceLocator()->get('Application\\Model\\Common');\n $api_url = $this->getServiceLocator()->get('config')['api_url']['value'];\n $data = array('status_id' => 1, 'subscription_end_date' => date('Y-m-d', strtotime('+2 days'))); // 2days before subscription end\n $results = $common->subscriptionData($api_url, $data);\n if (count($results) > 0) {\n foreach ($results as $detail) {\n // Start :- Auto renew subscription\n if ($detail['auto_renewal'] == '1') {\n $this->autorenewcodeAction($api_url,$common,$detail);\n // End :- Auto renew subscription\n } \n }\n }\n die;\n }",
"function setEndDate($classId, $end) {\r\n $data['classEndDate'] = $end;\r\n $this->db->where('id', $classId);\r\n $this->db->update('class', $data);\r\n }",
"function setEndDate($end_date = \"\") \n\t{\n\t\t$this->end_date = $end_date;\n\t}",
"function releasePurchase($postdata) {\n \t \t\n \t$now = mktime();\n \t\n \t$sql = \"\n \t\tUPDATE \n \t\t\topm_products_accounts\n \t\tSET\n \t\t\tenddate = $now\n \t\twhere\n \t\t\tid = \" . intval($postdata['id']);\n \t\n \tif ($query = $this->db->query($sql)) {\n \t\t\n \t\tif ($this->db->affected_rows() == 1) {\n \t\t\t\n \t\t\treturn $now;\n \t\t\n \t\t}\n \t\n \t}\n \t\n \treturn false;\n \n }",
"public function getExpirationDate()\n {\n return $this->user_expiration;\n }",
"public function setEndDate($value)\n {\n $this->endDate = $value;\n }",
"public function setExpirationDate(?Date $value): void {\n $this->getBackingStore()->set('expirationDate', $value);\n }",
"public function away_mode_end_date() {\n\n\t\t$current = current_time( 'timestamp' ); //The current time\n\n\t\t//if saved date is in the past update it to something in the future\n\t\tif ( isset( $this->settings['end'] ) && isset( $this->settings['enabled'] ) && $current < $this->settings['end'] ) {\n\t\t\t$end = $this->settings['end'];\n\t\t} else {\n\t\t\t$end = strtotime( date( 'n/j/y 12:00 \\a\\m', ( current_time( 'timestamp' ) + ( 86400 * 2 ) ) ) );\n\t\t}\n\n\t\t//Date Field\n\t\t$content = '<input class=\"end_date_field\" type=\"text\" id=\"itsec_away_mode_end_date\" name=\"itsec_away_mode[away_end][date]\" value=\"' . date( 'm/d/y', $end ) . '\"/><br>';\n\t\t$content .= '<label class=\"end_date_field\" for=\"itsec_away_mode_end_date\"> ' . __( 'Set the date at which the admin dashboard should become available', 'it-l10n-ithemes-security-pro' ) . '</label>';\n\n\t\techo $content;\n\n\t}",
"public function setExpirationDate(int $expiration_date);",
"public function setEndDate(string $date);",
"function _sf_set_spot_expiry_date($post) {\n\t\t\n\t\t///// FIRSTLY LET'S ADD A METABOX FOR OUR EXPIRY DATE\n\t\t$exp_date = time() + (ddp('submission_days') * (60*60*24));\n\t\t\n\t\t$midnight_time = $exp_date;\n\t\t\n\t\tupdate_post_meta($post->ID, 'expiry_date', $midnight_time);\n\t\t\n\t\t///// SETS UP OUR CRON JOB\n\t\twp_schedule_single_event($midnight_time, 'expire_spot_submission', array($post->ID, $post->post_title, $post->post_author, ''.$midnight_time.''));\n\t\t\n\t}",
"public function endMaintenancePeriod() : void\n {\n $this->getHesAdminDb()->update('\n UPDATE maintenance_periods SET end_time = now() WHERE end_time IS NULL\n ');\n }",
"private function setExpiryDate(Session $session, \\DateInterval $dateInterval)\n {\n if (is_null($session->getSubscribeExpireDate())) {\n /** @var \\DateTime */\n $examDate = $session->getDatetime();\n $expiryDate = (clone $examDate)->sub($dateInterval);\n $session->setSubscribeExpireDate($expiryDate);\n }\n }",
"function setExpireDate($ed) {\n\t\tif ($ed) {\n\t\t\t$newtime = dateTimeConvert($ed);\n\t\t\tif ($newtime === false) return;\n\t\t\t$this->set('expiredate', $newtime);\n\t\t} else {\n\t\t\t$this->set('expiredate', NULL);\n\t\t}\n\t}",
"public function setEndDate($date)\n\t\t{\n\t\t\t$this->end_date = $date;\n\t\t}",
"public function setEndDate($endDate) {\n $this->endDate = $endDate;\n }",
"public function extendAccessPeriod($newExpire)\n {\n // get last expiration date\n $expire = $this->getAccessExpire();\n // we will be updating only records with this expiration date\n // because all other records are already expired and we will\n // not touch it\n $count = 0;\n foreach ($this->getAccessRecords() as $accessRecord) {\n if ($accessRecord->expire_date != $expire)\n continue;\n $accessRecord->setDisableHooks(true);\n $accessRecord->expire_date = $newExpire;\n $accessRecord->update();\n $accessRecord->setDisableHooks(false);\n $count++;\n }\n if ($count)\n $this->getDi()->userTable->load($this->user_id)->checkSubscriptions(true);\n }",
"public function setEndDate($end_date)\n {\n $this->json()->end_date = $this->dateToString($end_date);\n }",
"public function updateSession($session_id,$extension,$end_date) {\n this->$end_date = date('Y-m-d', strtotime($end_date. \" + {$extension} days \"));\n this->$next_session_id = ($session_id + 1) % 3 ; //ginete me mod3 i praksi dioti ta id ton session ine 3 kai otan to session_id einai 3 theloume na pigenei apo tin arxi\n $query = \"UPDATE sessions SET end_date = '$end_date' WHERE session_id = '$session_id'\";\n mysqli_query($db, $query);\n $query = \"UPDATE sessions SET start_date = '$end_date' WHERE session_id = '$next_session_id'\";\n mysqli_query($db, $query);\n die();\n }",
"function SetAExpire($TL, $sToken, $uid){\n if((checkUsrPermissions($sToken) == \"ar\") | (checkUsrPermissions($sToken) == \"an\")){\n if(chkUsrExist((int)$uid)){\n $ex = GetExp($TL);\n if($ex == \"Err :: Select One Of This : [1h,12h,1d,1w,2w,1m,3m,1y,3y,5y,lifetime]\"){\n return \"Err :: Check TimeLimit\";\n }else{\n $_SESSION['db']->prepare(\"UPDATE users SET `expire-date`=:ex WHERE id=:id\")->execute(['id' => $uid,'ex' => $ex]);\n $_SESSION['db']->prepare(\"UPDATE users SET `Subscription-create-date`=:cd WHERE id=:id\")->execute(['id' => $uid,'cd' => gmdate('Y-m-d h:i:s')]);\n return \"done\"; \n }\n }else{\n return \"UserID Not Exist !!\";\n } \n }else{\n return \"Err :: May u are not admin !\";\n }\n}",
"function setEndDate(&$oDate)\n {\n if (is_a($oDate, 'date')) {\n $oDate->setHour(23);\n $oDate->setMinute(59);\n $oDate->setSecond(59);\n $oDate->subtractSeconds(25200);\n }\n }",
"public function setEndDate(?Date $value): void {\n $this->getBackingStore()->set('endDate', $value);\n }",
"public function setEndDate(?Carbon $endDate): RecurringConfig\n {\n $this->endDate = $endDate;\n\n return $this;\n }",
"public function expiryDate();",
"function updateMemberExpiryDate($userId, $date) {\r\n $sql = $this->db->prepare(\"UPDATE USER SET expiry=:expiry_date WHERE UserID=:user_id\");\r\n if($sql->execute(array(\r\n 'user_id' => $userId,\r\n 'expiry_date' => $date\r\n )))\r\n return true;\r\n else {\r\n return false;\r\n }\r\n }",
"public function setExpirationDateTime($val)\n {\n $this->_propDict[\"expirationDateTime\"] = $val;\n return $this;\n }",
"public function setExpirationDateTime($val)\n {\n $this->_propDict[\"expirationDateTime\"] = $val;\n return $this;\n }",
"function roomify_conversations_add_end_date_field() {\n field_info_cache_clear();\n\n // \"conversation_book_end_date\" field.\n if (field_read_field('conversation_book_end_date') === FALSE) {\n $field = array(\n 'field_name' => 'conversation_book_end_date',\n 'type' => 'datetime',\n 'cardinality' => 1,\n 'locked' => 1,\n 'settings' => array(\n 'cache_count' => 4,\n 'cache_enabled' => 0,\n 'granularity' => array(\n 'day' => 'day',\n 'hour' => 0,\n 'minute' => 0,\n 'month' => 'month',\n 'second' => 0,\n 'year' => 'year',\n ),\n 'profile2_private' => FALSE,\n 'timezone_db' => '',\n 'todate' => '',\n 'tz_handling' => 'none',\n ),\n );\n field_create_field($field);\n }\n\n field_cache_clear();\n\n // \"conversation_book_end_date\" field instance.\n if (field_read_instance('roomify_conversation', 'conversation_book_end_date', 'standard') === FALSE) {\n $instance = array(\n 'field_name' => 'conversation_book_end_date',\n 'entity_type' => 'roomify_conversation',\n 'label' => 'End Date',\n 'bundle' => 'standard',\n 'required' => FALSE,\n 'widget' => array(\n 'type' => 'date_popup',\n ),\n 'settings' => array(\n 'default_value' => 'now',\n 'default_value2' => 'same',\n 'default_value_code' => '',\n 'default_value_code2' => '',\n 'user_register_form' => FALSE,\n ),\n );\n field_create_instance($instance);\n }\n}",
"function _sf_set_spot_expiry_date_new($post) {\n\t\t\n\t\t//// LETS GET THE EXPIRY DATE AND MAKE SURE IT'S IN THE FUTURE\n\t\tif(is_object($post)) { if($post->post_type == 'spot') {\t\t\t\n\t\t\t\n\t\t\t$exp_date = get_post_meta($post->ID, 'expiry_date', true);\n\t\t\t$now = time();\n\t\t\t\n\t\t\t//// IF ITS IN THE FUTURE\n\t\t\tif($exp_date > $now) {\n\t\t\t\t\n\t\t\t\t//// SCHEDULE EVENT\n\t\t\t\twp_schedule_single_event($exp_date, 'expire_spot_submission', array($post->ID, $post->post_title, $post->post_author, $exp_date));\n\t\t\t\t\n\t\t\t}\n\t\t\t\n\t\t} }\n\t\t\n\t}",
"public function getExpirationDate()\n {\n return $this->expirationDate;\n }",
"public function getExpirationDate()\n {\n return $this->expirationDate;\n }",
"public function onSubscriptionRenew(SubscriptionInterface $subscription, OrderInterface $order, OrderInterface $next_order);",
"private static function updateExpire($record)\n {\n// $params = Yii::$app->getParams();\n// $interval = $params['restful_token_expired_seconds'];\n $interval = 30 * 24 * 60 * 60;\n $record->expire_date = date('Y-m-d H:i:s', time() + $interval);\n $record->save(false, array('expire_date'));\n }",
"public function setEndDate($value) \n {\n $this->_fields['EndDate']['FieldValue'] = $value;\n return $this;\n }",
"public function setExpiration($expiration = '0000') {\n $exp = array(\n 'x_exp_date'=>$this->cleanExpDate($expiration),\n );\n $this->NVP = array_merge($this->NVP, $exp); \n }",
"public function set_end_date()\n {\n if ($this->end_date === NULL && $this->start_date === NULL) {\n $this->formated_end_date = \"the game has not started yet\";\n } elseif($this->end_date === NULL && $this->start_date !== NULL) {\n $this->formated_end_date = \"the game is not finished yet\";\n } else {\n $end_date = Carbon::createFromTimestamp($this->end_date / 1000);\n $this->formated_end_date = $end_date->toDayDateTimeString();\n }\n return $this->formated_end_date; \n }",
"public function setEndDate($value)\n {\n return $this->set('EndDate', $value);\n }",
"public function setEndDate($value)\n {\n return $this->set('EndDate', $value);\n }",
"public function setEndDate($endDate='')\r\n\t\t{\r\n\t\t\tif ($endDate != '')\r\n\t\t\t{\r\n\t\t\t\t$this->end_date = $endDate;\r\n\t\t\t}\r\n\t\t}",
"public function getExpirationDate(): \\DateTime\n {\n return $this->expiration_date;\n }",
"public function getEndDate()\r\n\t\t{\r\n\t\t\treturn $this->end_date;\r\n\t\t}",
"public function setEndDate( KCommandContext $context )\n {\n $data = $context->data;\n \n if( $data->day || $data->month || $data->year )\n { \n $date = new KDate();\n \n $date->day( (int) $data->day );\n \n $date->month( (int) $data->month );\n \n $date->year( (int) $data->year );\n \n $data->endDate = $date;\n }\n }",
"public function get_end_date()\n\t{\n\t\treturn $this->end_date;\n\t}",
"public function getMembershipDefaultExpiration()\n {\n return (new \\DateTime('now'))->modify('+1 year');\n }",
"public function setEndDate($endDate) {\n $this->endDate = $endDate;\n }",
"public function getPurchaseRequestValidEndDate()\n\t{\n\t return $this->purchaseRequestValidEndDate;\n\t}",
"public function getExpiration()\n {\n return $this->getCreated()->add(new DateInterval('P2W'));\n }",
"public function setEndDate($date)\n {\n\t\tif($date==null){\n\t\t\t$this->complete_at = null;\n\t\t\t$this->save();\n\t\t\t$this->fireModelEvent('end-refreshed');\n\t\t\treturn;\n\t\t}\n\t\t\n\t\tif($this->complete_at){\n\t\t\tif($model->complete_at->greaterThan($date)){\n\t\t\t\t$this->complete_at = $date;\n \t\t$this->save();\n\t\t\t\t$this->fireModelEvent('end-delayed');\n\t\t\t}else{\n\t\t\t\t$this->complete_at = $date;\n \t\t$this->save();\n\t\t\t\t$this->fireModelEvent('end-forwarded');\n\t\t\t}\n\t\t}else{\n\t\t\t$this->complete_at = $date;\n \t$this->save();\n\t\t\t$this->fireModelEvent('end-inited');\n\t\t}\n }",
"function getDateExpiration() {\n return $this->dateExpiration;\n }",
"public static function expiration()\n {\n return strtotime( \"+\" . self::EXPIRATION );\n }",
"function erp_financial_end_date() {\n $financial_year_dates = erp_get_financial_year_dates();\n\n return $financial_year_dates['end'];\n}",
"function lb_subscription_set_billing_period($account, $subscription, $billing_period) {\n // The $account that rules passes contains the original information, which may have\n // changed as a result of an action that has run.\n $entity = entity_load_single('user', $account->uid);\n $account_subscription_data = lb_subscription_retrieve_account_subscription_data($entity, $subscription);\n if ($account_subscription_data['delta'] === NULL) {\n lb_subscription_set_subscription($entity, $subscription);\n $entity = entity_load_single('user', $account->uid);\n $account_subscription_data = lb_subscription_retrieve_account_subscription_data($entity, $subscription);\n }\n if ($account_subscription_data['delta'] !== NULL) {\n if ($account_subscription_data['billing_period'] != $billing_period) {\n $entity->field_subscription[LANGUAGE_NONE][$account_subscription_data['delta']]['field_billing_period'] = array(\n LANGUAGE_NONE => array(\n 0 => array(\n 'value' => $billing_period,\n ),\n ),\n );\n entity_save('user', $entity);\n }\n }\n}",
"public function getEndDate() {\n\n return $this->end_date;\n }",
"public function setExpirationDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('expirationDateTime', $value);\n }",
"public function setExpirationDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('expirationDateTime', $value);\n }",
"public function getEndDate() {\n return $this->endDate;\n }",
"public function updatedOptIn()\n {\n $this->updateValue(\n 'opt_in',\n $this->optIn,\n \"You have updated the customer's marketing email subscription.\"\n );\n }",
"public function expire()\n {\n return $this->update([\n $this->model->getExpirationAttribute() => Carbon::now()\n ]);\n }",
"public function contract_boot_update_end_date_null_if_empty()\n {\n self::$contract->update(['end_date' => '']);\n $this->assertNull(self::$contract->end_date);\n }",
"public function getEndDate()\n {\n return $this->EndDate;\n }",
"public function getEndDate(): Date\n {\n return $this->endDate;\n }",
"function flagReminded($subscriptionId, $reminderType) {\n\t\t$this->update(\n\t\t\tsprintf(\n\t\t\t\t'UPDATE subscriptions SET %s=%s WHERE subscription_id=?',\n\t\t\t\t$reminderType==SUBSCRIPTION_REMINDER_FIELD_BEFORE_EXPIRY?'date_reminded_before':'date_reminded_after',\n\t\t\t\t$this->datetimeToDB(Core::getCurrentDate())\n\t\t\t),\n\t\t\tarray((int) $subscriptionId)\n\t\t);\n\t}",
"public function setCertificateExpirationDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('certificateExpirationDateTime', $value);\n }",
"public function getExpirationDateFormattedAttribute()\n {\n if (empty($this->nextBillingDate)) {\n return null;\n } else {\n return Carbon::createFromFormat('Y-m-d H:i:s', $this->endsAt ?? $this->nextBillingDate)->format('M d Y');\n }\n }",
"function getEndDate() \n\t{\n\t\treturn (strlen($this->end_date)) ? $this->end_date : NULL;\n\t}",
"public function setAvailabilityEndDateTime($val)\n {\n $this->_propDict[\"availabilityEndDateTime\"] = $val;\n return $this;\n }",
"public function expiresAfterSale(): void\n {\n if ($this->isPerishable() && $this->isAfterSale()) {\n $this->setToLowestQuality();\n }\n }",
"public function setDateEnd($var)\n {\n GPBUtil::checkString($var, True);\n $this->dateEnd = $var;\n\n return $this;\n }",
"function set_expiration($post_id) {\n remove_action('save_post', 'expirationdate_update_post_meta');\n //Pull the date we need\n if(get_post_meta( $post_id , 'expiration', true )){\n $date = get_post_meta( $post_id , 'expiration', true );\n expirationdate_update_post_meta_acf($post_id, $date);\n } else{\n return;\n }\n}",
"protected function renewDatabase($subscription,$nextRenewDate) {\n \n $day = 86400; // = 24h * 60m * 60s => 1 day in seconds\n \n\t $nextRenewDate = date('Y-m-d H:i:s',strtotime($subscription->nextRenewDate)+7*$day);\n \n $this->mapper->updateStatusById($subscription->id, 'active', $nextRenewDate);\n return true;\n }",
"function setLastchange($d) {\n\t\tif ($d) {\n\t\t\t$newtime = dateTimeConvert($d);\n\t\t\tif ($newtime === false) return;\n\t\t\t$this->set('expiredate', $newtime);\n\t\t} else {\n\t\t\t$this->set('expiredate', NULL);\n\t\t}\n\t}",
"function has_signup_period_ended($signupDate)\n{\n return time() - (60 * 60 * 24) >= strtotime($signupDate);\n}",
"public function getExpirationDate(): int;",
"public function setEndDate($date)\n\t{\n\t\treturn $this->setDate('End', $date);\n\t}",
"function lb_subscription_set_renewal_flag($account, $subscription, $payment_type) {\n if ($payment_type == 'check') {\n $renew = 0;\n }\n else {\n $renew = 1;\n }\n // The $account that rules passes contains the original information, which may have\n // changed as a result of an action that has run.\n $entity = entity_load_single('user', $account->uid);\n $account_subscription_data = lb_subscription_retrieve_account_subscription_data($entity, $subscription);\n if ($account_subscription_data['delta'] === NULL) {\n lb_subscription_set_subscription($entity, $subscription);\n $entity = entity_load_single('user', $account->uid);\n $account_subscription_data = lb_subscription_retrieve_account_subscription_data($entity, $subscription);\n }\n if ($account_subscription_data['delta'] !== NULL) {\n if ($account_subscription_data['renew'] != $renew) {\n $entity->field_subscription[LANGUAGE_NONE][$account_subscription_data['delta']]['field_renew'] = array(\n LANGUAGE_NONE => array(\n 0 => array(\n 'value' => $renew,\n ),\n ),\n );\n entity_save('user', $entity);\n }\n }\n}",
"public function setExpiry( $expiry );",
"public function getEndDate();",
"public function getEndDate();",
"public function getExpiration()\n {\n }",
"public function expire() {\n logit_r($this, 'expire'); \n $status = ($this->status == UserLoginReq::STATUS_NOTIFIED) ? UserLoginReq::STATUS_PAST_GRACE : UserLoginReq::STATUS_EXPIRED;\n logit_r($status, 'status');\n $this->status = $status;\n $this->save(true);\n }",
"function EndOldSalesPrice($str_start_date,\r\n $int_price_recored_id) {\r\n global $db_iwex;\r\n $str_update_old=\"UPDATE pricing\r\n\t\t\t\t\t\tSET end_date = DATE_ADD(\".($str_start_date && $str_start_date != \"0000-00-00\" ? \"'$str_start_date'\" : \"NOW()\").\", INTERVAL -1 DAY),\r\n\t\t\t\t\t\t\tmodified_by = '\" . $GLOBALS[\"employee_id\"] . \"',\r\n\t\t\t\t\t\t\tmodified = NOW()\r\n\t\t\t\t\t\tWHERE recordID = $int_price_recored_id\";\r\n echo \"<h2>Let op er is een oude price vervallen!</h2>\";\r\n return \t$db_iwex->query($str_update_old);\r\n}",
"public function setEndDateAttribute($value)\n\t{\n\t\treturn $this->attributes['end_date'] = Carbon::parse($value)->format('Y-m-d H:i:s');\n\t}",
"public function getPaymentAuthExpiration();",
"function _updateSubscription(&$subscription) {\n\t\t$returner = $this->update(\n\t\t\tsprintf('UPDATE subscriptions\n\t\t\t\tSET\n\t\t\t\t\tjournal_id = ?,\n\t\t\t\t\tuser_id = ?,\n\t\t\t\t\ttype_id = ?,\n\t\t\t\t\tdate_start = %s,\n\t\t\t\t\tdate_end = %s,\n\t\t\t\t\tdate_reminded_before = %s,\n\t\t\t\t\tdate_reminded_after = %s,\n\t\t\t\t\tstatus = ?,\n\t\t\t\t\tmembership = ?,\n\t\t\t\t\treference_number = ?,\n\t\t\t\t\tnotes = ?\n\t\t\t\tWHERE subscription_id = ?',\n\t\t\t\t$this->dateToDB($subscription->getDateStart()),\n\t\t\t\t$this->datetimeToDB($subscription->getDateEnd()),\n\t\t\t\t$this->datetimeToDB($subscription->getDateRemindedBefore()),\n\t\t\t\t$this->datetimeToDB($subscription->getDateRemindedAfter())\n\t\t\t), array(\n\t\t\t\t$subscription->getJournalId(),\n\t\t\t\t$subscription->getUserId(),\n\t\t\t\t$subscription->getTypeId(),\n\t\t\t\t$subscription->getStatus(),\n\t\t\t\t$subscription->getMembership(),\n\t\t\t\t$subscription->getReferenceNumber(),\n\t\t\t\t$subscription->getNotes(),\n\t\t\t\t$subscription->getId()\n\t\t\t)\n\t\t);\n\n\t\treturn $returner;\n\t}"
] | [
"0.70345396",
"0.6584539",
"0.6440476",
"0.6289389",
"0.61278355",
"0.6068972",
"0.59100837",
"0.5908071",
"0.5857778",
"0.57571006",
"0.56894684",
"0.5610006",
"0.5559061",
"0.55220616",
"0.5509971",
"0.5506381",
"0.5491396",
"0.54852813",
"0.54703873",
"0.54534024",
"0.54524523",
"0.5442479",
"0.5438378",
"0.5427428",
"0.5405188",
"0.5373417",
"0.5365003",
"0.5342781",
"0.533939",
"0.5332479",
"0.53081554",
"0.53075266",
"0.530128",
"0.5276421",
"0.52759874",
"0.52747893",
"0.52656907",
"0.52643955",
"0.5262065",
"0.5253846",
"0.52490354",
"0.5221666",
"0.5221666",
"0.5208633",
"0.51942486",
"0.5188519",
"0.5188519",
"0.5182571",
"0.51793754",
"0.5175635",
"0.5169487",
"0.5164515",
"0.51626605",
"0.5161818",
"0.51600194",
"0.51597846",
"0.51506126",
"0.5147848",
"0.51464206",
"0.5134815",
"0.5131639",
"0.51199603",
"0.51161844",
"0.5110556",
"0.51098114",
"0.5099648",
"0.50967705",
"0.508291",
"0.5080471",
"0.5070384",
"0.5070384",
"0.506744",
"0.50614345",
"0.5061153",
"0.50574076",
"0.505695",
"0.5047797",
"0.50446516",
"0.5043004",
"0.5040493",
"0.50404197",
"0.50322306",
"0.50266296",
"0.5023424",
"0.5017364",
"0.50158274",
"0.50070375",
"0.50034696",
"0.49922016",
"0.49842265",
"0.4982352",
"0.49796337",
"0.4976205",
"0.4976205",
"0.49740145",
"0.49716794",
"0.4968102",
"0.49627328",
"0.49626744",
"0.49601352"
] | 0.74767065 | 0 |
Internal & helper methods Get a Subscription status | public function get_subscription_status( $subscription ) {
return is_array( $subscription ) && isset( $subscription['status'] ) ? $subscription['status'] : '';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getSubscriptionStatus() {\n return $this->subscription_status;\n\n }",
"public function getSubscriptionStatus(): string\n {\n return $this->subscriptionStatus;\n }",
"function get_subscription_status($subc_id)\n {\n $merchant_id= $this->config->item('auth_merchant_id');\n $merchant_trans_key= $this->config->item('auth_transaction_key');\n\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName(\"$merchant_id\");\n $merchantAuthentication->setTransactionKey(\"$merchant_trans_key\");\n // $refId = 'ref' . time();\n $request = new AnetAPI\\ARBGetSubscriptionStatusRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n // $request->setRefId($refId);\n $request->setSubscriptionId(\"$subc_id\");\n $controller = new AnetController\\ARBGetSubscriptionStatusController($request);\n //$response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::PRODUCTION);\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\"))\n {\n return $response->getStatus();\n \n }\n else\n {\n\n return \"\";\n\n }\n }",
"public function getSubscriptionStatus(SubscriptionRequestEntity $requestEntity);",
"public function status_subscription(){\n\t\t\treturn true;\n\t\t}",
"function getGatewaySubscriptionStatus()\n\t\t{\n\t\t\tif (is_object($this->Gateway)) {\n\t\t\t\treturn $this->Gateway->getSubscriptionStatus( $this );\n\t\t\t}\n\t\t}",
"public function subscriptionStatus($subscription_id)\n {\n $active = $this->fetchSubscriptionDetails($subscription_id);\n return $active->status;\n }",
"protected function statusAggregator($subscription) {\n \ttry {\n\t $iUserDataId = $subscription->sdkSubscriptionId;\n\t $return = $this->bundle->status($iUserDataId);\n \t}\n catch (Exception $e){\n \t$return[\"status\"] = 'error';\n }\n return $return;\n }",
"function comment_subscription_status() {\n\tglobal $comment;\n\treturn !!_stc()->is_subscribed( $comment->comment_ID );\n}",
"public function getSubscriptionStatus(Request $request)\n {\n //\n\n try {\n //code...\n $subscription = CategorySubscription::where('user_id', $request->user_id)->where('category_id', $request->category_id)->first();\n\n if ($subscription == null) {\n # code...\n $subscription_status = false;\n\n }else{\n $subscription_status = true;\n\n }\n \n return $subscription_status;\n\n } catch (\\Throwable $th) {\n //throw $th;\n\n return $th;\n }\n }",
"private function status()\n {\n $this->botman->hears('status', function(BotMan $bot) {\n\n $status = 'subscribed';\n $user = Subscriber::where('telegram_user_id', $bot->getUser()->getId())->first();\n\n if(is_null($user))\n {\n $status = 'unsubscribed';\n }\n\n $bot->reply('status: '. $status);\n });\n }",
"function it_exchange_paypal_pro_addon_update_subscriber_status( $subscriber_id, $status ) {\n\t$transactions = it_exchange_paypal_pro_addon_get_transaction_id_by_subscriber_id( $subscriber_id );\n\tforeach( $transactions as $transaction ) { //really only one\n\t\t// If the subscription has been cancelled/suspended and fully refunded, they need to be deactivated\n\t\tif ( !in_array( $status, array( 'active', 'deactivated' ) ) ) {\n\t\t\tif ( $transaction->has_refunds() && 0 === it_exchange_get_transaction_total( $transaction, false ) )\n\t\t\t\t$status = 'deactivated';\n\n\t\t\tif ( $transaction->has_children() ) {\n\t\t\t\t//Get the last child and make sure it hasn't been fully refunded\n\t\t\t\t$args = array(\n\t\t\t\t\t'numberposts' => 1,\n\t\t\t\t\t'order' => 'ASC',\n\t\t\t\t);\n\t\t\t\t$last_child_transaction = $transaction->get_children( $args );\n\t\t\t\tforeach( $last_child_transaction as $last_transaction ) { //really only one\n\t\t\t\t\t$last_transaction = it_exchange_get_transaction( $last_transaction );\n\t\t\t\t\tif ( $last_transaction->has_refunds() && 0 === it_exchange_get_transaction_total( $last_transaction, false ) )\n\t\t\t\t\t\t$status = 'deactivated';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tdo_action( 'it_exchange_update_transaction_subscription_status', $transaction, $subscriber_id, $status );\n\t}\n}",
"public function getStatus();",
"public function getStatus();",
"public function getStatus();",
"public function getStatus();",
"public function getStatus();",
"public function getStatus();",
"public function getStatus();",
"public function getStatus();",
"public function getStatus();",
"public function getStatus();",
"public function get_status()\n {\n }",
"public function get_status()\n {\n }",
"abstract public function GetStatus();",
"function get_status() {\n return $this->status;\n }",
"public function getStatus()\n {\n return $this->_makeCall('status');\n }",
"function svbk_rcp_email_subscription_status( $user_id, $status = 'active' ) {\n\n\tglobal $rcp_options;\n\n\t$user_info = get_userdata( $user_id );\n\t$message = '';\n\t$admin_message = '';\n\t$site_name = stripslashes_deep( html_entity_decode( get_bloginfo('name'), ENT_COMPAT, 'UTF-8' ) );\n\n\t$emails = new RCP_Mandrill_Emails;\n\t$emails->member_id = $user_id;\n\n\t$admin_emails = ! empty( $rcp_options['admin_notice_emails'] ) ? $rcp_options['admin_notice_emails'] : get_option('admin_email');\n\t$admin_emails = apply_filters( 'rcp_admin_notice_emails', explode( ',', $admin_emails ) );\n\t$admin_emails = array_map( 'sanitize_email', $admin_emails );\n\n\t// Allow add-ons to add file attachments\n\n\t$attachments = apply_filters( 'rcp_email_attachments', array(), $user_id, $status );\n\n\tswitch ( $status ) :\n\n\t\tcase \"active\" :\n\n\t\t\tif( rcp_is_trialing( $user_id ) ) {\n\t\t\t\tbreak;\n\t\t\t}\n\n\t\t\tif( ! isset( $rcp_options['disable_active_email'] ) ) {\n\n\t\t\t\t$message = isset( $rcp_options['active_email'] ) ? $rcp_options['active_email'] : '';\n\t\t\t\t$message = apply_filters( 'rcp_subscription_active_email', $message, $user_id, $status );\n\t\t\t\t$subject = isset( $rcp_options['active_subject'] ) ? $rcp_options['active_subject'] : '';\n\t\t\t\t$subject = apply_filters( 'rcp_subscription_active_subject', $subject, $user_id, $status );\n\t\t\t\t\n\t\t\t\t$template = isset($rcp_options['mandrill_template_user_active']) ? $rcp_options['mandrill_template_user_active'] : '';\n\t\t\t}\n\n\t\t\tif( ! isset( $rcp_options['disable_active_email_admin'] ) ) {\n\t\t\t\t$admin_message = isset( $rcp_options['active_email_admin'] ) ? $rcp_options['active_email_admin'] : '';\n\t\t\t\t$admin_subject = isset( $rcp_options['active_subject_admin'] ) ? $rcp_options['active_subject_admin'] : '';\n\n\t\t\t\tif( empty( $admin_message ) ) {\n\t\t\t\t\t$admin_message = __( 'Hello', 'rcp' ) . \"\\n\\n\" . $user_info->display_name . ' (' . $user_info->user_login . ') ' . __( 'is now subscribed to', 'rcp' ) . ' ' . $site_name . \".\\n\\n\" . __( 'Subscription level', 'rcp' ) . ': ' . rcp_get_subscription( $user_id ) . \"\\n\\n\";\n\t\t\t\t\t$admin_message = apply_filters( 'rcp_before_admin_email_active_thanks', $admin_message, $user_id );\n\t\t\t\t\t$admin_message .= __( 'Thank you', 'rcp' );\n\t\t\t\t}\n\n\t\t\t\tif( empty( $admin_subject ) ) {\n\t\t\t\t\t$admin_subject = sprintf( __( 'New subscription on %s', 'rcp' ), $site_name );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$admin_template = isset($rcp_options['mandrill_template_admin_user_active']) ? $rcp_options['mandrill_template_admin_user_active'] : '';\n\t\t\t\t\n\t\t\t}\n\t\t\tbreak;\n\n\t\tcase \"cancelled\" :\n\n\t\t\tif( ! isset( $rcp_options['disable_cancelled_email'] ) ) {\n\n\t\t\t\t$message = isset( $rcp_options['cancelled_email'] ) ? $rcp_options['cancelled_email'] : '';\n\t\t\t\t$message = apply_filters( 'rcp_subscription_cancelled_email', $message, $user_id, $status );\n\t\t\t\t$subject = isset( $rcp_options['cancelled_subject'] ) ? $rcp_options['cancelled_subject'] : '';\n\t\t\t\t$subject = apply_filters( 'rcp_subscription_cancelled_subject', $subject, $user_id, $status );\n\t\t\t\t\n\t\t\t\t$template = isset($rcp_options['mandrill_template_user_cancelled']) ? $rcp_options['mandrill_template_user_cancelled'] : '';\n\t\t\t\t\n\t\t\t}\n\n\t\t\tif( ! isset( $rcp_options['disable_cancelled_email_admin'] ) ) {\n\t\t\t\t$admin_message = isset( $rcp_options['cancelled_email_admin'] ) ? $rcp_options['cancelled_email_admin'] : '';\n\t\t\t\t$admin_subject = isset( $rcp_options['cancelled_subject_admin'] ) ? $rcp_options['cancelled_subject_admin'] : '';\n\n\t\t\t\tif( empty( $admin_message ) ) {\n\t\t\t\t\t$admin_message = __( 'Hello', 'rcp' ) . \"\\n\\n\" . $user_info->display_name . ' (' . $user_info->user_login . ') ' . __( 'has cancelled their subscription to', 'rcp' ) . ' ' . $site_name . \".\\n\\n\" . __( 'Their subscription level was', 'rcp' ) . ': ' . rcp_get_subscription( $user_id ) . \"\\n\\n\";\n\t\t\t\t\t$admin_message = apply_filters( 'rcp_before_admin_email_cancelled_thanks', $admin_message, $user_id );\n\t\t\t\t\t$admin_message .= __( 'Thank you', 'rcp' );\n\t\t\t\t}\n\n\t\t\t\tif( empty( $admin_subject ) ) {\n\t\t\t\t\t$admin_subject = sprintf( __( 'Cancelled subscription on %s', 'rcp' ), $site_name );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$admin_template = isset($rcp_options['mandrill_template_admin_user_cancelled']) ? $rcp_options['mandrill_template_admin_user_cancelled'] : '';\n\t\t\t}\n\n\t\tbreak;\n\n\t\tcase \"expired\" :\n\n\t\t\tif( ! isset( $rcp_options['disable_expired_email'] ) ) {\n\n\t\t\t\t$message = isset( $rcp_options['expired_email'] ) ? $rcp_options['expired_email'] : '';\n\t\t\t\t$message = apply_filters( 'rcp_subscription_expired_email', $message, $user_id, $status );\n\n\t\t\t\t$subject = isset( $rcp_options['expired_subject'] ) ? $rcp_options['expired_subject'] : '';\n\t\t\t\t$subject = apply_filters( 'rcp_subscription_expired_subject', $subject, $user_id, $status );\n\n\t\t\t\tadd_user_meta( $user_id, '_rcp_expired_email_sent', 'yes' );\n\t\t\t\t\n\t\t\t\t$template = isset($rcp_options['mandrill_template_user_expired']) ? $rcp_options['mandrill_template_user_expired'] : '';\n\t\t\t}\n\n\t\t\tif( ! isset( $rcp_options['disable_expired_email_admin'] ) ) {\n\t\t\t\t$admin_message = isset( $rcp_options['expired_email_admin'] ) ? $rcp_options['expired_email_admin'] : '';\n\t\t\t\t$admin_subject = isset( $rcp_options['expired_subject_admin'] ) ? $rcp_options['expired_subject_admin'] : '';\n\n\t\t\t\tif ( empty( $admin_message ) ) {\n\t\t\t\t\t$admin_message = __( 'Hello', 'rcp' ) . \"\\n\\n\" . $user_info->display_name . \"'s \" . __( 'subscription has expired', 'rcp' ) . \"\\n\\n\";\n\t\t\t\t\t$admin_message = apply_filters( 'rcp_before_admin_email_expired_thanks', $admin_message, $user_id );\n\t\t\t\t\t$admin_message .= __( 'Thank you', 'rcp' );\n\t\t\t\t}\n\n\t\t\t\tif ( empty( $admin_subject ) ) {\n\t\t\t\t\t$admin_subject = sprintf( __( 'Expired subscription on %s', 'rcp' ), $site_name );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$admin_template = isset($rcp_options['mandrill_template_admin_user_expired']) ? $rcp_options['mandrill_template_admin_user_expired'] : '';\n\t\t\t}\n\n\t\tbreak;\n\n\t\tcase \"free\" :\n\n\t\t\tif( ! isset( $rcp_options['disable_free_email'] ) ) {\n\n\t\t\t\t$message = isset( $rcp_options['free_email'] ) ? $rcp_options['free_email'] : '';\n\t\t\t\t$message = apply_filters( 'rcp_subscription_free_email', $message, $user_id, $status );\n\n\t\t\t\t$subject = isset( $rcp_options['free_subject'] ) ? $rcp_options['free_subject'] : '';\n\t\t\t\t$subject = apply_filters( 'rcp_subscription_free_subject', $subject, $user_id, $status );\n\n\t\t\t\t$template = isset($rcp_options['mandrill_template_user_free']) ? $rcp_options['mandrill_template_user_free'] : '';\n\n\t\t\t}\n\n\t\t\tif( ! isset( $rcp_options['disable_free_email_admin'] ) ) {\n\t\t\t\t$admin_message = isset( $rcp_options['free_email_admin'] ) ? $rcp_options['free_email_admin'] : '';\n\t\t\t\t$admin_subject = isset( $rcp_options['free_subject_admin'] ) ? $rcp_options['free_subject_admin'] : '';\n\n\t\t\t\tif( empty( $admin_message ) ) {\n\t\t\t\t\t$admin_message = __( 'Hello', 'rcp' ) . \"\\n\\n\" . $user_info->display_name . ' (' . $user_info->user_login . ') ' . __( 'is now subscribed to', 'rcp' ) . ' ' . $site_name . \".\\n\\n\" . __( 'Subscription level', 'rcp' ) . ': ' . rcp_get_subscription( $user_id ) . \"\\n\\n\";\n\t\t\t\t\t$admin_message = apply_filters( 'rcp_before_admin_email_free_thanks', $admin_message, $user_id );\n\t\t\t\t\t$admin_message .= __( 'Thank you', 'rcp' );\n\t\t\t\t}\n\n\t\t\t\tif( empty( $admin_subject ) ) {\n\t\t\t\t\t$admin_subject = sprintf( __( 'New free subscription on %s', 'rcp' ), $site_name );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$admin_template = isset($rcp_options['mandrill_template_admin_user_free']) ? $rcp_options['mandrill_template_admin_user_free'] : '';\n\t\t\t}\n\n\t\tbreak;\n\n\t\tcase \"trial\" :\n\n\t\t\tif( ! isset( $rcp_options['disable_trial_email'] ) ) {\n\n\t\t\t\t$message = isset( $rcp_options['trial_email'] ) ? $rcp_options['trial_email'] : '';\n\t\t\t\t$message = apply_filters( 'rcp_subscription_trial_email', $message, $user_id, $status );\n\n\t\t\t\t$subject = isset( $rcp_options['trial_subject'] ) ? $rcp_options['trial_subject'] : '';\n\t\t\t\t$subject = apply_filters( 'rcp_subscription_trial_subject', $subject, $user_id, $status );\n\t\t\t\t\n\t\t\t\t$template = isset($rcp_options['mandrill_template_user_trial']) ? $rcp_options['mandrill_template_user_trial'] : '';\n\n\t\t\t}\n\n\t\t\tif( ! isset( $rcp_options['disable_trial_email_admin'] ) ) {\n\t\t\t\t$admin_message = isset( $rcp_options['trial_email_admin'] ) ? $rcp_options['trial_email_admin'] : '';\n\t\t\t\t$admin_subject = isset( $rcp_options['trial_subject_admin'] ) ? $rcp_options['trial_subject_admin'] : '';\n\n\t\t\t\tif( empty( $admin_message ) ) {\n\t\t\t\t\t$admin_message = __( 'Hello', 'rcp' ) . \"\\n\\n\" . $user_info->display_name . ' (' . $user_info->user_login . ') ' . __( 'is now subscribed to', 'rcp' ) . ' ' . $site_name . \".\\n\\n\" . __( 'Subscription level', 'rcp' ) . ': ' . rcp_get_subscription( $user_id ) . \"\\n\\n\";\n\t\t\t\t\t$admin_message = apply_filters( 'rcp_before_admin_email_trial_thanks', $admin_message, $user_id );\n\t\t\t\t\t$admin_message .= __( 'Thank you', 'rcp' );\n\t\t\t\t}\n\n\t\t\t\tif( empty( $admin_subject ) ) {\n\t\t\t\t\t$admin_subject = sprintf( __( 'New trial subscription on %s', 'rcp' ), $site_name );\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$admin_template\t= isset($rcp_options['mandrill_template_admin_user_trial']) ? $rcp_options['mandrill_template_admin_user_trial'] : '';\n\t\t\t\t\n\t\t\t}\n\n\t\tbreak;\n\n\t\tdefault:\n\t\t\tbreak;\n\n\tendswitch;\n\t\n\t$template = apply_filters( 'svbk_rcp_status_mandrill_template', $template, $user_id, $status, $this );\n\t$admin_template = apply_filters( 'svbk_rcp_status_mandrill_admin_template', $admin_template, $user_id, $status, $this );\n\n\tif( ! empty( $template ) && $emails->sendTemplate( $template, $user_info->user_email, $subject, $message, $attachments ) ) {\n\t\trcp_log( sprintf( '[Mandrill Emails] %s email sent to user #%d.', ucwords( $status ), $user_info->ID ) );\n\t} else {\n\t\trcp_log( sprintf( '[Mandrill Emails] %s email not sent to user #%d - template %s is empty or invalid.', ucwords( $status ), $user_info->ID, $template ) );\n\t}\n\n\tif( ! empty( $admin_template ) && $emails->sendTemplate( $admin_template, $admin_emails, $admin_subject, $admin_message ) ) {\n\t\trcp_log( sprintf( '[Mandrill Emails] %s email sent to admin(s).', ucwords( $status ) ) );\n\t} else {\n\t\trcp_log( sprintf( '[Mandrill Emails] %s email not sent to admin(s) - template %s is empty or invalid.', ucwords( $status ), $admin_template ) );\n\t\treturn false;\n\t}\n\t\n\treturn true;\n\t\n}",
"public function get_status() {\n return $this->_status;\n }",
"function api_status()\n{\n $result;\n return _do_api_call('GET', '/api/v1/status', null, $result);\n}",
"public function getStatus()\n {\n return $this->get(self::_STATUS);\n }",
"public function getStatus()\n {\n return $this->get(self::_STATUS);\n }",
"public function getStatus()\n {\n return $this->get(self::_STATUS);\n }",
"public function getStatus()\n {\n return $this->get(self::_STATUS);\n }",
"public function getStatus() {}",
"public function getStatus() {}",
"public function getStatus() {}",
"public function getStatus() {}",
"public function getStatus() {}",
"public function getStatus() {}",
"public function getStatus() {}",
"public function getStatus() {}",
"public function getStatus() {}",
"public function getStatus() {}",
"public function getStatus() {}",
"public function getStatus() {}",
"public function getStatus() {}",
"public function getStatus() {}",
"public function getStatus() {}",
"public function getStatus() {}",
"public function getStatus() {}",
"public function getStatus() {}",
"public function getStatus() {}",
"public function getStatus() {}",
"public function getStatus() {}",
"public function callGetServiceStatus() {\n\t\t$requestArray = $this->signArray();\n\t\treturn $this->getServiceStatus($requestArray);\n\t}",
"public function getStatus()\n {\n return $this->get(self::STATUS);\n }",
"function getSubscriptionId(){\n\n $isSubsId = $this->common_model->getsingle(USERS,array('userId'=>$this->session->userdata('userId')));\n\n return !empty($isSubsId) ? $isSubsId->bizSubscriptionId : FALSE;\n \n }",
"function isSubscribed($number, $service) {\n\t\t$sql = \"SELECT * FROM \\\"Subscriptions\\\" WHERE \\\"Number\\\" = '$number' \" . \n\t\t\"AND \\\"Service\\\" = '$service'\";\n\t\t$result = pg_query($this->dbConnection, $sql);\n\t\tif (pg_num_rows($result) > 0) {\n\t\t\t$subscription = pg_fetch_array($result);\n\t\t\treturn $subscription[\"Status\"];\n\t\t} else {\n\t\t\treturn \"Not Subscribed\";\n\t\t}\n\t}",
"function wcs_get_subscription_ended_statuses() {\n\treturn apply_filters( 'wcs_subscription_ended_statuses', array( 'cancelled', 'trash', 'expired', 'switched', 'pending-cancel' ) );\n}",
"public function get_status() {\n return $this->status;\n }",
"public function GetStatus()\n\t{\treturn new ProductStatus($this->details['tstatus']);\t\n\t}",
"function getDetailedStatus() ;",
"public function getSubscription()\n {\n return $this->subscription;\n }",
"public function getSubscriptionStatus($subscriber_id, $app_id)\n {\n return SmsSaved::where('applicationId', $app_id)\n ->where('subscriberId', 'like', '%' . $this->removeSubscriberIdHead($subscriber_id) . \"%\")\n ->get()->last();\n }",
"public function getStatus(){\n $this->client->request('GET','/session/status');\n $status_message = $this->getJsonResponse();\n return $status_message;\n }",
"public function status() {\r\n\t\treturn self::request(self::HTTP_GET, 'status');\r\n\t}",
"function getStatus() \n {\n return $this->instance->getStatus();\n }",
"function getStatus()\n {\n return $this->status;\n }",
"function getStatus() {\n\t\treturn $this->getData('status');\n\t}",
"public function _getStatus() {\n\t\treturn $this->_status;\n\t}",
"function getStatus() {\n return $this->status;\n }",
"public function getSubscription()\n {\n $recruiter = RecruiterProfile::where(['user_id' => Auth::user()->id])->first();\n if ($recruiter['is_subscribed'] == config('constants.ZeroValue')) {\n $result = view('web.subscription', ['activeTab' => '4']);\n } else {\n $result = redirect('jobtemplates');\n }\n return $result;\n }",
"function get_status()\r\n {\r\n return $this->get_default_property(self :: PROPERTY_STATUS);\r\n }",
"public function get_status(){\n return $this->status;\n }",
"function getStatus();",
"public function getStatus()\n {\n return $this->_status;\n }",
"public function getStatus()\n {\n return $this->_status;\n }",
"public function getStatus()\n {\n return $this->_status;\n }",
"abstract public function getStatus();",
"public function GetStatus()\n\t{\n\t\t// Demnach ist der Status in IPS der einzige der vorliegt.\t\t\n\t}",
"public function getStatus()\n {\n return $this->getData('status');\n }",
"public function getStatus()\n {\n //return the status quote for the user based on their level\n return $this->getStatusQuote();\n }",
"public function getStatus()\n\t{\n\t\treturn $this->_sStatus;\n\t}",
"function getStatus() ;",
"function getStatus() ;",
"function getStatus() ;",
"function getStatus() {\n\t\treturn $this->_Status;\n\t}",
"public function getDetailedStatus() {}",
"function wcs_get_subscriptions( $args ) {\n\tglobal $wpdb;\n\n\t$args = wp_parse_args( $args, array(\n\t\t\t'subscriptions_per_page' => 10,\n\t\t\t'paged' => 1,\n\t\t\t'offset' => 0,\n\t\t\t'orderby' => 'start_date',\n\t\t\t'order' => 'DESC',\n\t\t\t'customer_id' => 0,\n\t\t\t'product_id' => 0,\n\t\t\t'variation_id' => 0,\n\t\t\t'order_id' => 0,\n\t\t\t'subscription_status' => array( 'any' ),\n\t\t\t'meta_query_relation' => 'AND',\n\t\t)\n\t);\n\n\t// if order_id is not a shop_order\n\tif ( 0 !== $args['order_id'] && 'shop_order' !== get_post_type( $args['order_id'] ) ) {\n\t\treturn array();\n\t}\n\n\t// Ensure subscription_status is an array.\n\t$args['subscription_status'] = $args['subscription_status'] ? (array) $args['subscription_status'] : array();\n\n\t// Grab the native post stati, removing pending and adding any.\n\t$builtin = get_post_stati( array( '_builtin' => true ) );\n\tunset( $builtin['pending'] );\n\t$builtin['any'] = 'any';\n\n\t// Make sure status starts with 'wc-'\n\tforeach ( $args['subscription_status'] as &$status ) {\n\t\tif ( isset( $builtin[ $status ] ) ) {\n\t\t\tcontinue;\n\t\t}\n\n\t\t$status = wcs_sanitize_subscription_status_key( $status );\n\t}\n\n\t// Prepare the args for WP_Query\n\t$query_args = array(\n\t\t'post_type' => 'shop_subscription',\n\t\t'post_status' => $args['subscription_status'],\n\t\t'posts_per_page' => $args['subscriptions_per_page'],\n\t\t'paged' => $args['paged'],\n\t\t'offset' => $args['offset'],\n\t\t'order' => $args['order'],\n\t\t'fields' => 'ids',\n\t\t'meta_query' => isset( $args['meta_query'] ) ? $args['meta_query'] : array(), // just in case we need to filter or order by meta values later\n\t);\n\n\t// Maybe only get subscriptions created by a certain order\n\tif ( 0 != $args['order_id'] && is_numeric( $args['order_id'] ) ) {\n\t\t$query_args['post_parent'] = $args['order_id'];\n\t}\n\n\t// Map subscription specific orderby values to internal/WordPress keys\n\tswitch ( $args['orderby'] ) {\n\t\tcase 'status' :\n\t\t\t$query_args['orderby'] = 'post_status';\n\t\t\tbreak;\n\t\tcase 'start_date' :\n\t\t\t$query_args['orderby'] = 'date';\n\t\t\tbreak;\n\t\tcase 'trial_end_date' :\n\t\tcase 'end_date' :\n\t\t\t// We need to orderby post meta value: http://www.paulund.co.uk/order-meta-query\n\t\t\t$date_type = str_replace( '_date', '', $args['orderby'] );\n\t\t\t$query_args = array_merge( $query_args, array(\n\t\t\t\t'orderby' => 'meta_value',\n\t\t\t\t'meta_key' => wcs_get_date_meta_key( $date_type ),\n\t\t\t\t'meta_type' => 'DATETIME',\n\t\t\t) );\n\t\t\t$query_args['meta_query'][] = array(\n\t\t\t\t'key' => wcs_get_date_meta_key( $date_type ),\n\t\t\t\t'compare' => 'EXISTS',\n\t\t\t\t'type' => 'DATETIME',\n\t\t\t);\n\t\t\tbreak;\n\t\tdefault :\n\t\t\t$query_args['orderby'] = $args['orderby'];\n\t\t\tbreak;\n\t}\n\n\t// Maybe filter to a specific user\n\tif ( 0 != $args['customer_id'] && is_numeric( $args['customer_id'] ) ) {\n\t\t$query_args['meta_query'][] = array(\n\t\t\t'key' => '_customer_user',\n\t\t\t'value' => $args['customer_id'],\n\t\t\t'type' => 'numeric',\n\t\t\t'compare' => ( is_array( $args['customer_id'] ) ) ? 'IN' : '=',\n\t\t);\n\t};\n\n\t// We need to restrict subscriptions to those which contain a certain product/variation\n\tif ( ( 0 != $args['product_id'] && is_numeric( $args['product_id'] ) ) || ( 0 != $args['variation_id'] && is_numeric( $args['variation_id'] ) ) ) {\n\t\t$query_args['post__in'] = wcs_get_subscriptions_for_product( array( $args['product_id'], $args['variation_id'] ) );\n\t}\n\n\tif ( ! empty( $query_args['meta_query'] ) ) {\n\t\t$query_args['meta_query']['relation'] = $args['meta_query_relation'];\n\t}\n\n\t$query_args = apply_filters( 'woocommerce_get_subscriptions_query_args', $query_args, $args );\n\n\t$subscription_post_ids = get_posts( $query_args );\n\n\t$subscriptions = array();\n\n\tforeach ( $subscription_post_ids as $post_id ) {\n\t\t$subscriptions[ $post_id ] = wcs_get_subscription( $post_id );\n\t}\n\n\treturn apply_filters( 'woocommerce_got_subscriptions', $subscriptions, $args );\n}",
"public function getStatus()\r\n {\r\n return $this->status;\r\n }",
"public function getStatus()\r\n {\r\n return $this->status;\r\n }",
"public function getSubscriptionTracking()\n {\n return $this->subscription_tracking;\n }",
"function get_activation_status() {\n $message = __( 'Not yet activated', 'fwp' );\n $activation = get_option( 'facetwp_activation' );\n\n if ( ! empty( $activation ) ) {\n $activation = json_decode( $activation );\n if ( 'success' == $activation->status ) {\n $message = __( 'License active', 'fwp' );\n $message .= ' (' . __( 'expires', 'fwp' ) . ' ' . date( 'M j, Y', strtotime( $activation->expiration ) ) . ')';\n }\n else {\n $message = $activation->message;\n }\n }\n\n return $message;\n }",
"public function statusStr()\n {\n return Status::get($this->publish_status);\n }",
"function trans_status()\r\n\t{\r\n\t\treturn $this->_trans_status;\r\n\t}",
"public function getStatus() {\n return $this->status;\n }",
"public function getStatus() {\n return $this->status;\n }",
"public function getStatus() {\n return $this->_status;\n }",
"public function getStatus(){\n\t\treturn $this->status;\n\t}"
] | [
"0.8309945",
"0.7763915",
"0.7548936",
"0.7541933",
"0.7528629",
"0.7333028",
"0.6865881",
"0.6851813",
"0.67158115",
"0.6557076",
"0.6494732",
"0.6479025",
"0.6453548",
"0.6453548",
"0.6453548",
"0.6453548",
"0.6453548",
"0.6453548",
"0.6453548",
"0.6453548",
"0.6453548",
"0.6453548",
"0.64364576",
"0.64364576",
"0.64206886",
"0.6420328",
"0.6392162",
"0.63448954",
"0.6341724",
"0.6316904",
"0.6316835",
"0.6316835",
"0.6316835",
"0.6316835",
"0.62922394",
"0.62922394",
"0.62922394",
"0.62922394",
"0.62922394",
"0.62922394",
"0.62922394",
"0.62922394",
"0.62922394",
"0.62922394",
"0.62922394",
"0.62922394",
"0.62922394",
"0.62922394",
"0.62922394",
"0.62922394",
"0.62922394",
"0.6291778",
"0.6291778",
"0.6291778",
"0.6291778",
"0.62908524",
"0.6266126",
"0.62539405",
"0.62517464",
"0.62464756",
"0.6242327",
"0.62339556",
"0.62212694",
"0.62138563",
"0.62131053",
"0.6208385",
"0.62074363",
"0.62061536",
"0.6205087",
"0.6203894",
"0.6198615",
"0.61898774",
"0.61863965",
"0.6161363",
"0.61591214",
"0.6154821",
"0.61538815",
"0.61538815",
"0.61538815",
"0.6149508",
"0.61457175",
"0.61356676",
"0.61303395",
"0.61236",
"0.6121452",
"0.6121452",
"0.6119835",
"0.61064017",
"0.61062986",
"0.6105652",
"0.60930896",
"0.60930896",
"0.60917926",
"0.6085417",
"0.60847723",
"0.60846835",
"0.60817903",
"0.60817903",
"0.6079988",
"0.60760355"
] | 0.7037804 | 6 |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.