query
stringlengths 7
5.25k
| document
stringlengths 15
1.06M
| metadata
dict | negatives
listlengths 3
101
| negative_scores
listlengths 3
101
| document_score
stringlengths 3
10
| document_rank
stringclasses 102
values |
---|---|---|---|---|---|---|
Remove the specified resource from storage. | public function destroy($id)
{
$success = Vehicle::find($id)->delete();
if ($success) {
return redirect('/vehicles');
}
else {
return redirect('/vehicles', 422);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }",
"public function destroy(Resource $resource)\n {\n //\n }",
"public function removeResource($resourceID)\n\t\t{\n\t\t}",
"public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }",
"public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }",
"public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }",
"public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }",
"protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }",
"public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }",
"public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }",
"public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }",
"public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}",
"public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}",
"public function delete(): void\n {\n unlink($this->getPath());\n }",
"public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }",
"public function remove($path);",
"function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}",
"public function delete(): void\n {\n unlink($this->path);\n }",
"private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }",
"public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }",
"public function remove() {}",
"public function remove() {}",
"public function remove();",
"public function remove();",
"public function remove();",
"public function remove();",
"function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}",
"public function deleteImage(){\n\n\n Storage::delete($this->image);\n }",
"public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }",
"public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}",
"public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }",
"public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }",
"public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}",
"public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }",
"public function deleteImage(){\n \tStorage::delete($this->image);\n }",
"public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }",
"public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }",
"public function destroy($id)\n {\n Myfile::find($id)->delete();\n }",
"public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }",
"public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }",
"public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }",
"public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }",
"public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }",
"public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }",
"public function delete($path);",
"public function delete($path);",
"public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }",
"public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }",
"public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }",
"public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }",
"public function delete($path, $data = null);",
"public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }",
"public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }",
"public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }",
"public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }",
"public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }",
"public function del($path){\n\t\treturn $this->remove($path);\n\t}",
"public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }",
"public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}",
"public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }",
"public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }",
"public function revoke($resource, $permission = null);",
"public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }",
"function delete($path);",
"public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}",
"public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }",
"public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }",
"public function remove($filePath){\n return Storage::delete($filePath);\n }",
"public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }",
"public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }",
"public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }",
"public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }",
"function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }",
"public function remove($id);",
"public function remove($id);",
"public function deleted(Storage $storage)\n {\n //\n }",
"public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }",
"public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }",
"public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }",
"public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }",
"function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}",
"public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }",
"public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}",
"public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }",
"public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }"
]
| [
"0.6672584",
"0.6659381",
"0.6635911",
"0.6632799",
"0.6626075",
"0.65424126",
"0.65416265",
"0.64648265",
"0.62882507",
"0.6175931",
"0.6129922",
"0.60893893",
"0.6054415",
"0.60428125",
"0.60064924",
"0.59337646",
"0.5930772",
"0.59199584",
"0.5919811",
"0.5904504",
"0.5897263",
"0.58962846",
"0.58951396",
"0.58951396",
"0.58951396",
"0.58951396",
"0.5880124",
"0.58690923",
"0.5863659",
"0.5809161",
"0.57735413",
"0.5760811",
"0.5753559",
"0.57492644",
"0.5741712",
"0.57334286",
"0.5726379",
"0.57144034",
"0.57096",
"0.5707689",
"0.5705895",
"0.5705634",
"0.5703902",
"0.5696585",
"0.5684331",
"0.5684331",
"0.56780374",
"0.5677111",
"0.5657287",
"0.5648262",
"0.5648085",
"0.5648012",
"0.5640759",
"0.5637738",
"0.5629985",
"0.5619264",
"0.56167465",
"0.5606877",
"0.56021434",
"0.5601949",
"0.55992156",
"0.5598557",
"0.55897516",
"0.5581397",
"0.5566926",
"0.5566796",
"0.55642897",
"0.55641",
"0.5556583",
"0.5556536",
"0.5550097",
"0.5543172",
"0.55422723",
"0.5540013",
"0.5540013",
"0.55371785",
"0.55365825",
"0.55300397",
"0.552969",
"0.55275744",
"0.55272335",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.5525997",
"0.5525624",
"0.5523911",
"0.5521122",
"0.5517412"
]
| 0.0 | -1 |
Display a listing of the resource. | public function index(Request $request)
{
if(!$request->ajax()) return redirect('/');
$search = $request->search;
$criteria = $request->criteria;
$period = $request->period;
$query = User::join('students', 'users.id', '=', 'students.id_user')
->join('roles', 'users.id_role', '=', 'roles.id')
->join('q8_groups', 'students.id_q8', '=', 'q8_groups.id')
->leftjoin('groups', 'groups.id', '=', 'students.id_group')
->select('students.id', 'students.name', 'students.paternal_surname as lastName1', 'students.maternal_surname as lastName2', 'students.period',
'students.id_group', 'students.condition as students_condition', 'q8_groups.id as id_q8', 'q8_groups.nameq8 as q8Name', 'users.condition', 'users.password',
'users.email', 'users.id_role', 'students.id_user', 'groups.id as group_id', 'groups.name as group_name', 'students.grade', 'students.career');
if ($search=='') {
$students = $query
->where('students.condition', '!=', '0', 'AND', 'students.period', '==', $period)
->where('students.period', '=', $period)
->orderBy('students.name', 'asc')->paginate(8);
} else if($criteria == 'email'){
$students = $query
->where('users.'.$criteria, 'like', '%'. $search . '%', 'AND', 'students.condition', '!=', '0', 'AND', 'users.condition', '!=', '0')
->where('students.period', '=', $period)
->orderBy('students.name', 'asc')->paginate(8);
} else if($criteria == 'name'){
$students = $query
->where('students.'.$criteria, 'like', '%'. $search . '%', 'AND', 'students.condition', '!=', '0', 'AND', 'users.condition', '!=', '0')
->orWhere('students.paternal_surname', 'like', '%'. $search . '%', 'AND', 'students.condition', '!=', '0', 'AND', 'users.condition', '!=', '0')
->orWhere('students.maternal_surname', 'like', '%'. $search . '%', 'AND', 'students.condition', '!=', '0', 'AND', 'users.condition', '!=', '0')
->where('students.period', '=', $period)
->orderBy('students.name', 'asc')->paginate(8);
}else if ($criteria == 'nameQ8'){
$students = $query
->where('q8_groups.'.$criteria, 'like', '%'. $search . '%', 'AND', 'students.condition', '!=', '0', 'AND', 'users.condition', '!=', '0')
->where('students.period', '=', $period)
->orderBy('students.name', 'asc')->paginate(8);
} else {
$students = $query
->where('students.'.$criteria, 'like', '%'. $search . '%', 'AND', 'students.condition', '!=', '0', 'AND', 'users.condition', '!=', '0')
->where('students.period', '=', $period)
->orderBy('students.name', 'asc')->paginate(8);
}
$periods = DB::table('students')->select('period')->distinct()->orderBy('period','desc')->get();
return [
'pagination' => [
'total' => $students->total(),
'current_page' => $students->currentPage(),
'per_page' => $students->perPage(),
'last_page' => $students->lastPage(),
'from' => $students->firstItem(),
'to' => $students->lastItem(),
],
'students' => $students,
'periods' => $periods
];
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }",
"public function listing();",
"function index() {\n\t\t$this->show_list();\n\t}",
"public function actionList() {\n $this->_getList();\n }",
"public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }",
"public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }",
"public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }",
"function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}",
"public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }",
"public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }",
"public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}",
"function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}",
"public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }",
"public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}",
"public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}",
"public function actionRestList() {\n\t $this->doRestList();\n\t}",
"public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }",
"public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }",
"public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}",
"public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}",
"public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }",
"public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }",
"public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }",
"public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }",
"public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}",
"public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }",
"public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}",
"public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }",
"public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}",
"public function index()\n {\n $this->list_view();\n }",
"public function index()\n {\n $this->list_view();\n }",
"public function index()\n {\n $this->list_view();\n }",
"public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }",
"public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }",
"public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}",
"public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }",
"public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }",
"public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }",
"public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }",
"public function index()\n {\n return Resources::collection(Checking::paginate());\n }",
"public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }",
"public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }",
"public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }",
"public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }",
"public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }",
"public function view(){\n\t\t$this->buildListing();\n\t}",
"public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }",
"public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }",
"public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }",
"public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }",
"public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }",
"public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }",
"public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }",
"public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }",
"public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}",
"public function listAction() {}",
"public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }",
"public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }",
"public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }",
"public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }",
"public function executeList()\n {\n $this->setTemplate('list');\n }",
"public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }",
"function listing() {\r\n\r\n }",
"public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }",
"public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }",
"public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }",
"public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}",
"public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }",
"public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}",
"public function _index(){\n\t $this->_list();\n\t}",
"public function index()\n {\n $this->booklist();\n }",
"function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}",
"public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }",
"public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }",
"public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }",
"public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }",
"public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }",
"public function indexAction() {\n $this->_forward('list');\n }",
"public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }",
"public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }",
"public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}",
"public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }",
"public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }",
"public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }",
"public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }",
"public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }",
"public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }",
"public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }",
"public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}",
"public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }",
"public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }",
"public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }",
"public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}",
"public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }",
"public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }",
"public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }",
"public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }",
"public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }",
"public function index()\n {\n return view('admin.resources.index');\n }",
"public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}"
]
| [
"0.7447426",
"0.73628515",
"0.73007894",
"0.7249563",
"0.7164474",
"0.7148467",
"0.71320325",
"0.7104678",
"0.7103152",
"0.7100512",
"0.7048493",
"0.6994995",
"0.69899315",
"0.6935843",
"0.6899995",
"0.68999326",
"0.6892163",
"0.6887924",
"0.6867505",
"0.6851258",
"0.6831236",
"0.68033123",
"0.6797587",
"0.6795274",
"0.67868614",
"0.67610204",
"0.67426085",
"0.67303514",
"0.6727031",
"0.67257243",
"0.67257243",
"0.67257243",
"0.67195046",
"0.67067856",
"0.67063624",
"0.67045796",
"0.66655326",
"0.666383",
"0.66611767",
"0.66604036",
"0.66582054",
"0.6654805",
"0.6649084",
"0.6620993",
"0.66197145",
"0.6616024",
"0.66077465",
"0.6602853",
"0.6601494",
"0.6593894",
"0.65878326",
"0.6586189",
"0.6584675",
"0.65813804",
"0.65766823",
"0.65754175",
"0.657203",
"0.657202",
"0.65713936",
"0.65642136",
"0.6563951",
"0.6553249",
"0.6552584",
"0.6546312",
"0.6536654",
"0.6534106",
"0.6532539",
"0.6527516",
"0.6526785",
"0.6526042",
"0.65191233",
"0.6518727",
"0.6517732",
"0.6517689",
"0.65155584",
"0.6507816",
"0.65048593",
"0.6503226",
"0.6495243",
"0.6492096",
"0.6486592",
"0.64862204",
"0.6485348",
"0.6483991",
"0.64789015",
"0.6478804",
"0.64708763",
"0.6470304",
"0.64699143",
"0.6467142",
"0.646402",
"0.6463102",
"0.6460929",
"0.6458856",
"0.6454334",
"0.6453653",
"0.645357",
"0.6450551",
"0.64498454",
"0.64480853",
"0.64453584"
]
| 0.0 | -1 |
Update the specified resource in storage. | public function update(Request $request)
{
if(!$request->ajax()) return redirect('/');
try {
DB::beginTransaction();
//Search the user who's about to get modified
$student = Student::findOrFail($request->id);
$user = User::findOrFail($student->id_user);
if ($student->id_q8 != $request->id_q8) {
$group1 = Q8::findOrFail($student->id_q8);
$group2 = Q8::findOrFail($request->id_q8);
$group1->num_students--;
$group2->num_students++;
$group1->save();
$group2->save();
}
$student->name = strtoupper($request->name);
$student->paternal_surname = strtoupper($request->paternal_surname);
$student->maternal_surname = strtoupper($request->maternal_surname);
$student->period = strtoupper($request->period);
$student->id_q8 = $request->id_q8;
$student->id_group = $request->id_group;
$student->grade = $request->grade;
$student->save();
$user->email = $request->username;
//$user->password = bycrypt($request->password);
$user->condition = '1';
$user->save();
DB::commit();
} catch (Exception $e) {
DB::rollBack();
}
} | {
"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 updateStream($path, $resource, Config $config)\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 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 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 putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }",
"public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }",
"public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }",
"public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }",
"public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }",
"public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }",
"public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }",
"public function update(Qstore $request, $id)\n {\n //\n }",
"public function update($request, $id);",
"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 }",
"function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}",
"public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }",
"protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }",
"public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"abstract public function put($data);",
"public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }",
"public function testUpdateSupplierUsingPUT()\n {\n }",
"public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }",
"public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }",
"public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }",
"public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }",
"public abstract function update($object);",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }",
"public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }",
"public function update(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(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }",
"public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }",
"public function update()\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($id, $input);",
"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(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 {/* 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 $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 {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }",
"public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }",
"public function update($id);",
"public function update($id);",
"public function 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 }",
"private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }",
"public function update(Entity $entity);",
"public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }",
"public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }",
"public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}",
"public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }",
"public 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.74238616",
"0.7062842",
"0.7057816",
"0.6897868",
"0.65820867",
"0.64505464",
"0.6347915",
"0.62114644",
"0.6145006",
"0.61231726",
"0.6115922",
"0.6100021",
"0.6089019",
"0.60542375",
"0.60187906",
"0.6008231",
"0.5974106",
"0.5944986",
"0.59397626",
"0.59393746",
"0.58937186",
"0.58607864",
"0.5853811",
"0.5853811",
"0.58521867",
"0.5815276",
"0.58061725",
"0.57518756",
"0.57518756",
"0.5736318",
"0.57246256",
"0.5715636",
"0.5696208",
"0.5691033",
"0.5687788",
"0.56692934",
"0.56556624",
"0.5652178",
"0.56494987",
"0.5636202",
"0.56355816",
"0.5632871",
"0.563206",
"0.56291884",
"0.5621382",
"0.56087434",
"0.5602465",
"0.55928403",
"0.55825645",
"0.55821884",
"0.5581833",
"0.5576869",
"0.55712104",
"0.5568173",
"0.55648434",
"0.5562885",
"0.5560537",
"0.5560537",
"0.5560537",
"0.5560537",
"0.5560537",
"0.55592597",
"0.5556131",
"0.5555849",
"0.5555397",
"0.5553912",
"0.55530137",
"0.5543831",
"0.55430055",
"0.5540152",
"0.5539437",
"0.55359006",
"0.5535772",
"0.5534487",
"0.552458",
"0.5518245",
"0.5515452",
"0.55145514",
"0.5509227",
"0.55079365",
"0.55065364",
"0.55039924",
"0.5501616",
"0.5500345",
"0.5499738",
"0.54980725",
"0.5496017",
"0.5496017",
"0.5494488",
"0.5494334",
"0.54936594",
"0.54934716",
"0.5491019",
"0.54835314",
"0.54795796",
"0.5479442",
"0.5478275",
"0.54646415",
"0.54637444",
"0.5461914",
"0.54562414"
]
| 0.0 | -1 |
Logic recovery of a User. | public function toggle(Request $request)
{
if(!$request->ajax()) return redirect('/');
$student = Student::findOrFail($request->id);
$student->condition = !$student->condition;
$student->save();
$user = User::findOrFail($student->id_user);
$user->condition = !$user->condition;
$user->save();
if ($student->condition) {
if ($student->id_group != null)
{
$group = Group::findOrFail($student->id_group);
$group->num_students++;
$group->save();
}
if ($student->id_q8 != null)
{
DB::table('q8_groups')
->where('q8_groups.id', '=', $student->id_q8)
->increment('num_students', 1);
}
} else {
if ($student->id_group != null)
{
$group = Group::findOrFail($student->id_group);
$group->num_students--;
$group->save();
}
if ($student->id_q8 != null)
{
DB::table('q8_groups')
->where('q8_groups.id', '=', $student->id_q8)
->decrement('num_students', 1);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function restored(User $user)\n {\n //\n }",
"public function restored(User $user)\n {\n //\n }",
"public function restored(User $user)\n {\n //\n }",
"public function restored(User $user)\n {\n //\n }",
"public function restored(User $user)\n {\n //\n }",
"public function restored(User $user)\n {\n //\n }",
"public function restored(User $user)\n {\n //\n }",
"public function restored(User $user)\n {\n //\n }",
"public function restored(User $user)\n {\n //\n }",
"public function restored(User $user)\n {\n //\n }",
"public function restored(User $user)\n {\n //\n }",
"public function restored(User $user)\n {\n //\n }",
"public function restored(User $user)\n {\n //\n }",
"public function restored(User $user)\n {\n //\n }",
"public function restored(User $user)\n {\n //\n }",
"public function restored(User $user)\n {\n //\n }",
"public function restoring(User $user)\n {\n //\n }",
"public function restore(User $user, User $user1)\n {\n //\n }",
"public function restore(User $user, Payer $payer)\n {\n //\n }",
"public function restore(User $user, EduDocument $eduDocument)\n {\n //\n }",
"public function restore(User $user, Flashcard $flashcard)\n {\n //\n }",
"public function recover_user($id)\n\t{\n\t\t$dbres = $this->db->query(\"update user SET delete_status='0' where id = $id \");\n\t\tredirect(site_url() . 'sys/get_employees?msg_rec=success');\n\t}",
"public function restore()\n {\n\n $user = User::model()->findByAttributes(array('email' => $this->email));\n if ( null == $user ) {\n $this->addError('email', 'User with this email is not registered');\n return false;\n }\n\n $user->password = substr(md5(time().uniqid()), 0, 12 );\n\n $mailResult = Email::sendMail(\n $user->email,\n 'Password recovery on ' . Yii::app()->getRequest()->getHostInfo(),\n 'Dear user! Your password has been changed to ' . $user->password\n );\n\n if ( !$mailResult ) {\n Yii::app()->user->setFlash('failMessage','Send E-mail with a new password failed');\n return false;\n };\n\n $user->save();\n Yii::app()->user->setFlash('successMessage','A new password sent to you at your address e-mail.');\n\n return true;\n\n }",
"public function recovery($mode=null)\n\t{\n\t\t$model=$this->UserByMode;\n\t\tif ($mode) $model->setScenario($mode);\n\t\tif(!count($model)) {\n\t\t\t$this->errorCode=self::ERROR_USERNAME_INVALID;\n\t\t} else if((int)$model->status === PersonUser::BANNED) {\n\t\t\t$this->errorCode=self::ERROR_USER_BANNED;\n\t\t } else if((int)$model->status === PersonUser::ACTIVE) {\n\t\t\t$this->errorCode=self::ERROR_USER_ACTIVE;\n\t\t} else if($mode!='activate' && (int)$model->status === PersonUser::WAITING_APPROVAL) {\n\t\t\t$this->errorCode=self::ERROR_USER_APPROVAL;\n\t\t} else if($mode!='activate' && $model->activation_code !== $this->password) {\n\t\t\t$this->errorCode=self::ERROR_ACTIVATION_CODE;\n\t\t\t$this->id = $model->id;\n\t\t} else {\n\t\t\t$this->errorCode=self::ERROR_NONE;\n\t\t\t$this->id = $model->id;\n\t\t\t$this->name = Yii::t('PersonModule.general','Recovery Mode');\n\t\t\tif ($mode!='activate') {\n\t\t\t\t$this->recovery = true;\n\t\t\t}\telse {\n\t\t\t\t$model->status=PersonUser::ACTIVE;\n\t\t\t}\n\t\t\t$model->last_login = date('Y-m-d H:i:s');\n\t\t\t$model->save();\n\t\t}\n\t\treturn !$this->errorCode;\n\t}",
"function passwordRecovery()\n\t{\n\t\t$args = new safe_args();\n\t\t$args->set('email', NOTSET, 'any');\n\t\t$args->set('mode', 'RECOVERY', 'any');\t\t\n\t\t$args = $args->get(func_get_args());\n\n\t\tif ( is_email($args['email']) )\n\t\t\t$sql = 'SELECT user_id FROM users WHERE email = \"'.$args['email'].'\" limit 1';\n\t\telse\n\t\t\t$sql = 'SELECT user_id FROM users WHERE user_name = \"'.$args['email'].'\" limit 1';\n\n\t\t$user = getOneAssocArray($sql);\n\t\t\n\t\tif ( $user['user_id'] )\n\t\t\treturn $this->sendNewPassword( array( 'user_id' => $user['user_id'], 'mode' => $args['mode']));\n\t\telse\n\t\t\treturn NULL;\n\t}",
"public function restore(User $user, Attendance $attendance)\n {\n //\n }",
"public function restore(User $user, InterventionRequest $interventionRequest)\n {\n //\n }",
"public function restore(User $user, Jadwal $jadwal)\n {\n //\n }",
"public function restore(User $user, User $target)\n {\n //\n }",
"public function restore(User $user, Paciente $paciente)\n {\n //\n }",
"public function restore(User $user, Negocio $negocio)\n {\n //\n }",
"Public Function RestoreUser($ID)\n\t{\n\t\t$Data = array('deleted'=>0);\n\t\t$this->_db->update('bevomedia_user', $Data, 'id = ' . $ID);\n\t\t$this->_db->update('bevomedia_user_info', $Data, 'id = ' . $ID);\n\t}",
"public function setRecovery(User &$user)\n\t{\n\t\t$user->setRecovery(Random::generate(32), 'now + ' . $this->settings->expiration->recovery);\n\t\treturn $this;\n\t}",
"public function restored(User $user)\n {\n $this->clearCache($this->key);\n }",
"public function restore(User $user, AkunBank $akunBank)\n {\n //\n }",
"public function restore(User $user, Carrito $carrito)\n {\n //\n }",
"public function restore(User $user, Quack $quack)\n {\n //\n }",
"public function restore(User $user, Evento $evento)\n {\n //\n }",
"public function restore(User $user, Information $information)\n {\n //\n }",
"public function restore(User $user, Profil $profil)\n {\n //\n }",
"public function restore(User $user, Event $event)\n {\n //\n }",
"public function restore(User $user, Event $event)\n {\n //\n }",
"public function restore(User $user, MuzaiEducation $muzaiEducation)\n {\n //\n }",
"public function restore(User $user, ExamRoom $examRoom)\n {\n //\n }",
"public function restore(User $user, Fila $fila)\n {\n //\n }",
"public function restore(User $user, Match $match)\n {\n //\n }",
"public function restore(User $user, Pensamiento $pensamiento)\n {\n //\n }",
"public function restore(User $user, Dictation $dictation)\n {\n //\n }",
"function RecoveryInactiveUser(&$UserProfile,&$nUser) {\n\t\t$SQLStrQuery=\"SELECT * FROM Password AS PASS JOIN Usuario AS U ON PASS.UID=U.UID WHERE (PASS.REGISTRADO='0')\";\n\t\tSQLQuery($ResponsePointer,$nUser,$SQLStrQuery,true); // Realiza la consulta en la base de datos globales\n\t\tConvertPointerToArray($ResponsePointer,$UserProfile,$nUser,20); // Convertir la consulta en un arreglo de datos\n\t}",
"public function restore(User $user, Goods $goods)\n {\n //\n }",
"public function actionRecovery ()\n {\n\t\t$model = new User('recovery');\n\t\tif (Yii::app()->user->id)\n {\n if(!Y::app()->request->isAjaxRequest)\n $this->redirect('/');\n else echo 'You are logged';\n }\n\n $email = ((isset($_GET['email']))?$_GET['email']:'');\n $activkey = ((isset($_GET['activkey']))?$_GET['activkey']:'');\n\n if( $email && $activkey )\n {\n $model = new User('changePassword');\n $find=User::model()->findByAttributes(array('email'=>$email));\n if(!isset($find))\n $find=User::model()->findByAttributes(array('username'=>$email));\n\n if(isset($find)&&$find->activkey==$activkey)\n {\n if(isset($_POST['User']))\n {\n $model->attributes=$_POST['User'];\n if($model->validate())\n {\n $find->password = UserModule::encrypting($model->password);\n $find->activkey = UserModule::encrypting(microtime().$model->password);\n if ($find->status==0) $find->status = 1;\n $find->save();\n Yii::app()->user->setFlash('recoveryMessage',Y::t(\"Новый пароль сохранен.\"));\n $this->redirect(array(\"/user/recovery\"));\n }\n }\n $this->render('changepassword',array('model'=>$model));\n }\n else\n {\n Yii::app()->user->setFlash('recoveryMessage',Y::t(\"Неверная ссылка для востановления.\"));\n $this->redirect(array(\"/user/recovery\"));\n }\n }\n else\n {\n if(isset($_POST['User']))\n {\n $model->attributes=$_POST['User'];\n if($model->validate()) {\n $user = User::model()->findbyPk($model->checkexists_id);\n $activation_url = 'http://' . $_SERVER['HTTP_HOST'].\n $this->createUrl('/user/recovery/recovery',array(\"activkey\" => $user->activkey, \"email\" => $user->getEmail()));\n\n $subject = str_replace( '{site_name}', Y::t('Имя сайта',0),\n Y::t('Восстановление пароля на сайте \"{site_name}\"',0) );\n $message = str_replace( '{activation_url}', $activation_url,\n Y::t('Для восстановления пароля перейдите по следующей ссылке: {activation_url}',0) );\n\n $this->sendMail($user->getEmail(),array('subject'=>$subject,'body'=>$message));\n Yii::app()->user->setFlash('recoveryMessage',Y::t(\"На Ваш адрес электронной почты было отправлено письмо с инструкциями.\"));\n\n }\n }\n\n if(Y::app()->request->isAjaxRequest)\n $this->renderPartial('application.modules.user.components.views._recoverPassForm',array('model'=>$model));\n else $this->render('recovery',array('model'=>$model));\n }\n\t}",
"public function restore(User $user, Rapper $rapper)\n {\n //\n }",
"public function restore($id){\n\t\tif(Auth::check()){\n\t\t\t$logged_user=Auth::user();\n\t\t\tif($logged_user->isSiteAdmin()){\n\t\t\t\t$user=User::onlyTrashed()->find($id);\n\t\t\t\tif($user!=null){\n\t\t\t\t\t$user->restore();\n\t\t\t\t\ttry{\n\t\t\t\t\t\tMail::send('mails.notification_restore',[], function ($message) {\n\t\t\t\t\t\t\t$message->from('[email protected]','LAN Creator')\n\t\t\t\t\t\t\t->to($user->email)\n\t\t\t\t\t\t\t->subject('Your LanCreator account has been restored');\n\t\t\t\t\t\t});\n\t\t\t\t\t}catch(\\Exception $e){\n\n\t\t\t\t\t}\n\t\t\t\t\treturn response()->json(['success'=>'This user\\'s account has been successfully restored.','html'=>view('user.show_delete',compact('user'))->render() ]);\n\t\t\t\t}else{\n\t\t\t\t\treturn response()->json(['error'=>'This user hasn\\'t been deleted.']);\n\t\t\t\t}\n\t\t\t}else{\n\t\t\t\treturn response()->json(['error'=>'You don\\'t have enough rights to perform this action.']);\n\t\t\t}\n\t\t}else{\n\t\t\treturn response()->json(['error'=>'Please log in to perform this action.']);\n\t\t}\n\t}",
"public function postRecover()\n\t{\n\t\t$inputs = Input::get('recover');\n\n\t\t$expires = Config::get('auth.reminder.expire');\n\t\t$reminder = Models\\PasswordReminder::whereToken($inputs['token'])->where(\"created_at\", \">\", DB::raw(\"NOW() - INTERVAL $expires MINUTE\"))->first();\n\t\tif (!$reminder) {\n\t\t\t$this->setFormErrors(\"recover.password\", \"Sorry, invalid or expired token\");\n\t\t}\n\n\t\tif (empty($this->formErrors)) {\n\t\t\t$user = Models\\User::whereEmail($reminder->email)->first();\n\t\t\tif (!$user) {\n\t\t\t\t$this->setFormErrors(\"recover.password\", \"Can't seem to find your email in the system\");\n\t\t\t}\n\t\t}\n\n\t\tif (empty($this->formErrors)) {\n\t\t\t$user->password = $inputs['password'];\n\t\t\tif ($user->isInvalid()) {\n\t\t\t\t$this->setFormErrors('recover', $user->getErrors());\n\t\t\t} else {\n\t\t\t\t$user->save();\n\t\t\t}\n\t\t}\n\n\t\tif (empty($this->formErrors)) {\n\n\t\t\tModels\\PasswordReminder::whereEmail($user->email)->delete();\n\n\t\t\tFlash::success('Your password has been successfully updated!');\n\n\t\t\treturn [\n\t\t\t\t'success' => true,\n\t\t\t];\n\t\t} else {\n\t\t\tthrow new ValidationException(['errors' => $this->formErrors]);\n\t\t}\n\n\t}",
"public function restore(User $user, CourseClass $courseClass)\n {\n //\n }",
"public function passRecovery($email=''){\n \n $ret = '';//var para retorno\n \n if($email!=''){//se email informado\n \n $sql = new Sql();\n //consulta email informado na tabela de usuários\n $res = $sql->select('SELECT * FROM usuarios WHERE email_usuario = :email_usuario',array(':email_usuario'=>$email)); \n \n //caso nada encontrado retorna ZERO\n if(is_array($res) && count($res)==0){\n \n $ret = 0;//email nao encontrado\n \n }\n elseif(count($res)==1)//caso encontrado então gera o link para recuperacao com base no ID e EMAIL do usuario\n {\n $_userData = array();\n $dataUser = $res[0];\n $_linkTtime = date('Y-m-d H:i:s');\n $_userData['userdata'] = $dataUser;\n $_userData['hash'] = md5( base64_encode($dataUser['id_usuario']) );\n $_userData['hrlimit'] = date(\"d/m/Y H:i:s\", strtotime(\"+1 hours\"));\n \n \n $paramsRecovery = array(\n ':id_usuario'=>$res[0]['id_usuario'],\n ':hash_recovery'=>md5( base64_encode($dataUser['id_usuario']) ),\n ':dt_register'=>$_linkTtime\n );\n \n \n //gera cadastro na tabela de recuperacao de senha\n $res = $sql->query('INSERT INTO pwd_recovery (\n id_usuario,\n hash_recovery,\n dt_register\n ) VALUES ( \n :id_usuario, \n :hash_recovery, \n :dt_register )',$paramsRecovery);\n \n \n if($res>1){//se hash anotado corretamente retorna a url para redirect\n \n $user_key = md5(base64_encode($dataUser['id_usuario']));\n $user_uid = $dataUser['id_usuario'];\n $_url = \"$user_key\";//hash (IDusuario)/(HASH)\n $ret = $_url;\n \n \n $_userData['userdata'] = $_userData;\n $_userData['urlHash'] = $ret;\n //$hashRecovery = $ret;\n \n //retorna a URL com o hash para o reset da senha do usuário\n return $_userData;\n \n }else{//caso contrario retorna falso\n \n \n $ret = false;\n return $ret;\n }\n }\n \n }else{\n $ret = 0;//email nao informado retorna 0\n return $ret;\n }\n \n }",
"public function restore(User $user, Load $load)\n {\n //\n }",
"public function restore(User $user, Storage $storage)\n {\n //\n }",
"function RecoveryToReactivateUser(&$UserProfile,&$nUser) {\n\t\t$SQLStrQuery=\"SELECT * FROM Password AS PASS JOIN Usuario AS U ON PASS.UID=U.UID WHERE (PASS.ACTIVO='0' AND PASS.REGISTRADO='1')\";\n\t\tSQLQuery($ResponsePointer,$nUser,$SQLStrQuery,true); // Realiza la consulta en la base de datos globales\n\t\tConvertPointerToArray($ResponsePointer,$UserProfile,$nUser,20); // Convertir la consulta en un arreglo de datos\n\t}",
"public function saveUser() {\n\n try {\n\n $this->save();\n\n }catch (Exception $e) {\n\n throw new Exception($e->getMessage());\n\n }\n }",
"public function restore(User $user, EvaluationSubject $evaluationSubject)\n {\n //\n }",
"public static function refreshUser() {\n\t\t$user = self::getUser();\n\t\t\n\t\t$refreshedUser = db_UserManager::getInstance()->find($user['id']);\n\t\t\n\t\tself::setUser($refreshedUser);\n\t}",
"public function restore(User $user, Language $language)\n {\n //\n }",
"public function restore(User $user, Screening $screening)\n {\n //\n }",
"public function recoverUsername() {\n\t\tif(!check($this->_email)) throw new Exception(lang('error_4',true));\n\t\t\n\t\t$accountData = $this->getAccountData();\n\t\tif(!is_array($accountData)) throw new Exception(lang('error_12',true));\n\t\t$this->setUsername($accountData[_CLMN_USERNM_]);\n\t\t\n\t\tif(!$this->_sendUsernameRecoveryEmail()) throw new Exception(lang('error_25',true));\n\t}",
"public function restore(User $user, Grupo $grupo)\n {\n //\n }",
"public function restore(User $user, Sector $sector)\n {\n //\n }",
"public function restore(User $user, StaffMember $staffMember)\n {\n //\n }",
"public function restore(User $user, ContractCost $contractCost)\n {\n //\n }",
"public function restored(User $user)\n {\n $user->restoreUserRelationships();\n }",
"public function processUser(){\n \n $this->setCurrentUser();\n $this->setUsersAttributes();\n }",
"protected function switchUserBack() {\n if ($this->isUserSwitched) {\n $this->accountSwitcher->switchBack();\n $this->isUserSwitched = FALSE;\n }\n }",
"public function restore(User $user, Inventario $inventario)\n {\n //\n }",
"public function restore(User $user, Memo $memo)\n {\n //\n }",
"function RecoveryUserProfileByID(&$UserProfile,&$nUser,$iUID) {\n\t\t$SQLStrQuery=\"SELECT * FROM Usuario WHERE (UID='\".$iUID.\"')\";\n\t\tSQLQuery($ResponsePointer,$nUser,$SQLStrQuery,true); // Realiza la consulta en la base de datos globales\n\t\tConvertPointerToArray($ResponsePointer,$UserProfile,$nUser,17); // Convertir la consulta en un arreglo de datos\n\t}",
"public function restore(User $user, Hour $hour)\n {\n // Handled by admin middleware\n }",
"public function restore(User $user, Group $group)\n {\n //\n }",
"public function rollback(){\n return $this->forge->table('users')->ifExists()->drop();\n }",
"public function restore(User $user, SportManager $sportManager) {\n\t\t//\n\t}",
"public function restore(User $user, SystemUnit $systemUnit)\n {\n //\n }",
"public function restore(User $user, Habitacion $habitacion)\n {\n //\n }",
"public function restore(User $user, Stagaire $stagaire)\n {\n //\n }",
"public function admin_account_Recover($id){\n\t\t\t\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', 'Your Company Account Recover Successfully .');\n\t\t\t\treturn Redirect::to('admin/users/del/'.$role_id);\n\t\t\t}\n\t\t\t\n\t\t}",
"public function restore(User $user, User $model)\n {\n //\n }",
"public function restore(User $user, Attraction $attraction)\n {\n //\n }",
"public function restore(User $user, UserGroup $userGroup)\n {\n //\n }",
"public function restore(User $user, Materiaimpartida $materiaimpartida)\n {\n //\n }",
"public function restore(User $user, Exercise $exercise)\n {\n //\n }",
"function recoverPassword(){\n\t\tglobal $recoverPasswordInputs, $pdo;\n\t\ttry{\n\t\t\t$recoverPassword = $pdo->prepare('SELECT hash FROM USER WHERE email = :email AND firstName = :firstName AND lastName = :lastName');\n\t\t\t$recoverPassword->bindValue(':email', $recoverPasswordInputs['email']);\n\t\t\t$recoverPassword->bindValue(':firstName', $recoverPasswordInputs['fname']);\n\t\t\t$recoverPassword->bindValue(':lastName', $recoverPasswordInputs['lname']);\n\t\t\t$recoverPassword->execute();\n\t\t\t$result = $recoverPassword -> fetch();\n\n\t\t\tif ($result != null) {\n\t\t\t\tsendEmail(updatePassword());\n\t\t \theader('Location: ../signin.php#recoverPassword=success');\n\t\t\t exit();\n\t\t\t}else {\n\t\t\t header('Location: ../recoverPassword.php#recoverPassword=warning');\n\t\t\t exit();\n\t\t\t}\n\t\t}\n\t\tcatch (PDOException $e)\n\t\t\t{echo $e->getMessage();}\n\t}",
"public function restore(User $user, Dependence $dependence)\n {\n //\n }",
"public function restore(User $user, Company $company)\n {\n //\n }",
"public function restore(User $user, Image $image)\n {\n //\n }",
"public function restore(User $user, Image $image)\n {\n //\n }",
"public function restore(User $user, NovaSentMail $mail)\n {\n return false;\n }",
"public function restore(User $user, World $world)\n {\n //\n }",
"public function restore(User $user, User $model)\n {\n }",
"public static function userCreateFailed(){\n self::$IntelligenceService->addToIntelligenceStack(self::USER_INTELLIGENCE_CREATE_KEY, self::USER_INTELLIGENCE_FAILED);\n }",
"protected function finish()\n {\n if (LilyModule::instance()->enableLogging)\n LilyModule::instance()->user->inited = true;\n LilyModule::instance()->user->save();\n if (is_string($this->finishRedirectUrl))\n $redirectUrl = Yii::app()->createUrl($this->finishRedirectUrl);\n else\n $redirectUrl = Yii::app()->createUrl($this->finishRedirectUrl[0], array_slice($this->finishRedirectUrl, 1));\n Yii::log(\"userIniter finished\", CLogger::LEVEL_INFO, 'lily');\n Yii::app()->request->redirect($redirectUrl);\n }",
"public function suspend_user(User $user){\n //If the user is active suspend them if not reinstate them\n if ($user->active == 1) {\n $user->active = 0;\n $user->save();\n session()->flash('status', $user->username . ' was successfully suspended');\n return redirect()->back();\n }\n $user->active = 1;\n $user->save();\n session()->flash('status', $user->username . ' was successfully reinstated');\n return redirect()->back();\n }",
"function recoverpassword() {\r\n $this->form_validation->set_rules('user_email', 'Email', 'required|valid_email|xss_clean|callback_useremail_check');\r\n\r\n if ($this->form_validation->run() == FALSE) {\r\n $this->forgotpass();\r\n } else {\r\n $user_email = $this->input->post('user_email');\r\n $val = $this->auth_model->set_recovery_key($user_email);\r\n $this->_send_recovery_email($val);\r\n $this->session->set_flashdata('msg', '<div class=\"alert alert-success\">' . lang_key('email_sent_inbox') . '</div>');\r\n redirect(site_url('admin/auth/forgotpass'));\r\n }\r\n }",
"public function restore(User $user, Especie $especie)\n {\n //\n }"
]
| [
"0.7112842",
"0.7112842",
"0.7112842",
"0.7112842",
"0.7112842",
"0.7112842",
"0.7112842",
"0.7112842",
"0.7112842",
"0.7112842",
"0.7112842",
"0.7112842",
"0.7112842",
"0.7112842",
"0.7112842",
"0.7112842",
"0.70393777",
"0.6716518",
"0.658486",
"0.6575866",
"0.65623623",
"0.65249133",
"0.6476609",
"0.6464798",
"0.64362675",
"0.6397614",
"0.6328214",
"0.63206947",
"0.63186026",
"0.6303175",
"0.6273584",
"0.62237614",
"0.61956686",
"0.61911273",
"0.61733985",
"0.6164952",
"0.6161702",
"0.6146449",
"0.61454844",
"0.61420244",
"0.6138065",
"0.6138065",
"0.61334443",
"0.6122304",
"0.6110976",
"0.61032856",
"0.6100861",
"0.609955",
"0.6081543",
"0.60800105",
"0.6078252",
"0.6071877",
"0.60717046",
"0.60484666",
"0.60483456",
"0.60376555",
"0.60256827",
"0.6018971",
"0.60185677",
"0.6005866",
"0.60007066",
"0.5996651",
"0.59961134",
"0.59951776",
"0.59917533",
"0.5986585",
"0.5963298",
"0.5941976",
"0.59321254",
"0.5931967",
"0.5925383",
"0.58883923",
"0.58858025",
"0.58827984",
"0.5869999",
"0.5867356",
"0.5858794",
"0.58567655",
"0.5850997",
"0.584806",
"0.58405954",
"0.583452",
"0.58298874",
"0.58287287",
"0.5827423",
"0.58191764",
"0.58142",
"0.581119",
"0.58085644",
"0.5804868",
"0.5797866",
"0.57791793",
"0.57791793",
"0.5773439",
"0.5771109",
"0.5767539",
"0.575835",
"0.5750151",
"0.572586",
"0.5724257",
"0.5717025"
]
| 0.0 | -1 |
Remove the specified resource from storage. | public function destroy($id)
{
//
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function delete($resource){\n return $this->fetch($resource, self::DELETE);\n }",
"public function destroy(Resource $resource)\n {\n //\n }",
"public function removeResource($resourceID)\n\t\t{\n\t\t}",
"public function unpublishResource(PersistentResource $resource)\n {\n $client = $this->getClient($this->name, $this->options);\n try {\n $client->delete(Path::fromString($this->getRelativePublicationPathAndFilename($resource)));\n } catch (FileDoesNotExistsException $exception) {\n }\n }",
"public function deleteResource(&$resource) {\n\n if ($this->connector != null) {\n $this->logger->addDebug(\"Deleting Resource Node from Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}}) detach delete a;\",\n [\n 'id' => $resource->getID()\n ]\n );\n $this->logger->addDebug(\"Updated neo4j to remove resource\");\n }\n\n }",
"public function deleteShopifyResource() {\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'DELETE',\n ]);\n }",
"public function deleteResource()\n {\n $database = new Database();\n $id = $this->_params['id'];\n $database->deleteResource($id);\n $this->_f3->reroute('/Admin');\n }",
"protected function deleteResource($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }",
"public function delete()\n {\n persistableCollection::getInstance($this->resourceName)->deleteObject($this);\n }",
"public function remove()\n {\n $this->_getBackend()->remove($this->_id);\n }",
"public function remove()\n {\n if (! ftruncate($this->fileHandle, 0)) {\n throw new StorageException(\"Could not truncate $this->path\");\n }\n if (! unlink($this->path)) {\n throw new StorageException(\"Could not delete $this->path\");\n }\n }",
"public function delete()\n\t{\n\t\t$s3 = AWS::createClient('s3');\n $s3->deleteObject(\n array(\n 'Bucket' => $this->bucket,\n 'Key' => $this->location\n )\n );\n\t\tif($this->local_file && file_exists($this->local_file)) {\n\t\t\tunlink($this->local_file);\n\t\t}\n $this->local_file = null;\n\t}",
"public function delete()\n\t{\n\t\tsfCore::db->query(\"DELETE FROM `swoosh_file_storage` WHERE `id`='%i';\", $this->id);\n\t\t$this->fFile->delete();\n\t}",
"public function delete(): void\n {\n unlink($this->getPath());\n }",
"public function delete()\n {\n if($this->exists())\n unlink($this->getPath());\n }",
"public function remove($path);",
"function deleteFileFromStorage($path)\n{\n unlink(public_path($path));\n}",
"public function delete(): void\n {\n unlink($this->path);\n }",
"private function destroyResource(DrydockResource $resource) {\n $blueprint = $resource->getBlueprint();\n $blueprint->destroyResource($resource);\n\n $resource\n ->setStatus(DrydockResourceStatus::STATUS_DESTROYED)\n ->save();\n }",
"public static function delete($fileName, $storage)\n {\n if (Storage::disk($storage)->exists($fileName)) \n {\n return Storage::disk($storage)->delete($fileName);\n }\n }",
"public function remove() {}",
"public function remove() {}",
"public function remove();",
"public function remove();",
"public function remove();",
"public function remove();",
"function delete_resource($resource_id, $page)\n\t{\n\t\t//get resource data\n\t\t$table = \"resource\";\n\t\t$where = \"resource_id = \".$resource_id;\n\t\t\n\t\t$this->db->where($where);\n\t\t$resource_query = $this->db->get($table);\n\t\t$resource_row = $resource_query->row();\n\t\t$resource_path = $this->resource_path;\n\t\t\n\t\t$image_name = $resource_row->resource_image_name;\n\t\t\n\t\t//delete any other uploaded image\n\t\t$this->file_model->delete_file($resource_path.\"\\\\\".$image_name, $this->resource_path);\n\t\t\n\t\t//delete any other uploaded thumbnail\n\t\t$this->file_model->delete_file($resource_path.\"\\\\thumbnail_\".$image_name, $this->resource_path);\n\t\t\n\t\tif($this->resource_model->delete_resource($resource_id))\n\t\t{\n\t\t\t$this->session->set_userdata('success_message', 'resource has been deleted');\n\t\t}\n\t\t\n\t\telse\n\t\t{\n\t\t\t$this->session->set_userdata('error_message', 'resource could not be deleted');\n\t\t}\n\t\tredirect('resource/'.$page);\n\t}",
"public function deleteImage(){\n\n\n Storage::delete($this->image);\n }",
"public function del(string $resource): bool|string\n {\n $json = false;\n $fs = unserialize($_SESSION['rfe'][$this->getRoot()], ['allowed_classes' => false]);\n if (array_key_exists($resource, $fs)) {\n // if $item has children, delete all children too\n if (array_key_exists('dir', $fs[$resource])) {\n foreach ($fs as $key => $file) {\n if (isset($file['parId']) && $file['parId'] == $resource) {\n unset($fs[$key]);\n }\n }\n }\n unset($fs[$resource]);\n $_SESSION['rfe'][$this->getRoot()] = serialize($fs);\n $json = '[{\"msg\": \"item deleted\"}]';\n }\n return $json;\n }",
"public function destroy()\n\t{\n\t\treturn unlink(self::filepath($this->name));\n\t}",
"public function destroy($id) {\n $book = Book::find($id);\n // return unlink(storage_path(\"public/featured_images/\".$book->featured_image));\n Storage::delete(\"public/featured_images/\" . $book->featured_image);\n if ($book->delete()) {\n return $book;\n }\n\n }",
"public function destroy($id)\n {\n Storageplace::findOrFail($id)->delete();\n }",
"public function destroyResourceImage(): void\n\t{\n\t\tif (isset($this->image)) {\n\t\t\t@imagedestroy($this->image->getImageResource());\n\t\t}\n\t}",
"public function deleteResource(PersistentResource $resource)\n {\n $pathAndFilename = $this->getStoragePathAndFilenameByHash($resource->getSha1());\n if (!file_exists($pathAndFilename)) {\n return true;\n }\n if (unlink($pathAndFilename) === false) {\n return false;\n }\n Files::removeEmptyDirectoriesOnPath(dirname($pathAndFilename));\n return true;\n }",
"public function deleteImage(){\n \tStorage::delete($this->image);\n }",
"public function destroy()\n {\n $file=public_path(config('larapages.media.folder')).Input::all()['folder'].'/'.Input::all()['file'];\n if (!file_exists($file)) die('File not found '.$file);\n unlink($file);\n }",
"public function delete() \r\n {\r\n if($this->exists())\r\n {\r\n unlink($this->fullName());\r\n }\r\n }",
"public function destroy($id)\n {\n Myfile::find($id)->delete();\n }",
"public function destroy($delete = false)\n {\n if (null !== $this->resource) {\n $this->resource->clear();\n $this->resource->destroy();\n }\n\n $this->resource = null;\n clearstatcache();\n\n // If the $delete flag is passed, delete the image file.\n if (($delete) && file_exists($this->name)) {\n unlink($this->name);\n }\n }",
"public static function delete($path){\r\n $currentDir = getcwd();\r\n $storageSubPath = \"/../../\".STORAGE_PATH;\r\n $file = $currentDir . $storageSubPath . '/' . $path;\r\n\r\n unlink($file);\r\n }",
"public function destroy(Storage $storage)\n {\n return redirect()->route('storages.index');\n }",
"public function remove() {\n //Check if there are thumbs and delete files and db\n foreach ($this->thumbs()->get() as $thumb) {\n $thumb->remove();\n } \n //Delete the attachable itself only if is not default\n if (strpos($this->url, '/defaults/') === false) {\n Storage::disk('public')->delete($this->getPath());\n }\n parent::delete(); //Remove db record\n }",
"public function removeFile($uri){\n return Storage::disk('public')->delete($uri);\n }",
"public function destroy(Resource $resource)\n {\n if( $resource->delete() ){\n return Response(['status'=>'success','message'=>'Resource deleted']); \n } else {\n return Response(['status'=>'error', 'message'=>'Something went wrong']);\n }\n }",
"public function delete($path);",
"public function delete($path);",
"public function destroy($id)\n { \n File::find($id)->remove();\n \n return redirect()->route('files.index');\n }",
"public function destroy($id)\n {\n $supplier = Supplier::find($id);\n $photo = $supplier->photo;\n if ($photo) {\n unlink($photo);\n }\n $supplier->delete();\n }",
"public function destroy($id)\n {\n $student = Student::where('id', $id)->first();\n // $path = $student->image;\n unlink($student->image);\n Student::findOrFail($id)->delete();\n return response('Deleted!');\n }",
"public function destroy($id)\n {\n $icon = SliderIcon::find($id);\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $icon->delete();\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества удалёны');\n }",
"public function delete($path, $data = null);",
"public function destroy($id)\n {\n $items=Items::find($id);\n // delete old file\n if ($items->photo) {\n $str=$items->photo;\n $pos = strpos($str,'/',1);\n $str = substr($str, $pos);\n $oldFile = storage_path('app\\public').$str;\n File::Delete($oldFile); \n }\n $items->delete();\n return redirect()->route('items.index');\n }",
"public function destroy($id)\n {\n $carousel = Carousel::find($id);\n $image = $carousel->image;\n\n $basename ='img/carousel/' . basename($image);\n //Delete the file from disk\n if(file_exists($basename)){\n unlink($basename);\n }\n //With softDeletes, this is the way to permanently delete a record\n $carousel->delete();\n Session::flash('success','Product deleted permanently');\n return redirect()->back();\n }",
"public function remove()\n {\n $fs = new Filesystem();\n $fs->remove($this->dir());\n }",
"public static function destroy(int $resource_id)\n {\n try {\n $image_data = ListingImage::where('id', $resource_id)->first();\n self::delete_image($image_data->name);\n $delete = ListingImage::where('id', $resource_id)->delete();\n\n // activity()\n // ->causedBy(Auth::user()->id)\n // ->performedOn($delete)\n // ->withProperties(['id' => $delete->id])\n // ->log('listing image deleted');\n return response()->json(['status'=> 'ok', 'msg'=> 'Data deleted successfully']);\n } catch (Exception $e) {\n $e->getMessage();\n }\n }",
"public function destroy(Storage $storage)\n {\n $this->storage->destroy($storage);\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource deleted', ['name' => trans('product::storages.title.storages')]));\n }",
"public function del($path){\n\t\treturn $this->remove($path);\n\t}",
"public function destroy($id)\n {\n //\n $product = Product::findOrFail($id);\n $product->delete();\n if($product->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$product->img);\n // return 'deleted';\n }\n return redirect()->route('product.index'); \n }",
"public function removeUpload()\n{\n if ($file = $this->getAbsolutePath()) {\n unlink($file); \n }\n}",
"public function destroy($id)\n {\n $image = Images::withTrashed()->find($id);\n\n Storage::disk('uploads')->delete(\"social-media/$image->filename\");\n\n $image->tags()->detach();\n $image->detachMedia(config('constants.media_tags'));\n $image->forceDelete();\n\n return redirect()->back()->with('success', 'The image was successfully deleted');\n }",
"public function destroyByResourceId($resource_id)\n {\n// $online_party = $this->onlinetrack->where('resource_id', $resource_id)->get()->first();\n// $online_party->status = \"offline\";\n// $online_party->save();\n// return $online_party;\n return $this->onlinetrack->where('resource_id', $resource_id)->delete();\n }",
"public function revoke($resource, $permission = null);",
"public function destroy($id)\n {\n $data=Image::find($id);\n $image = $data->img;\n\n\n $filepath= public_path('images/');\n $imagepath = $filepath.$image;\n\n //dd($old_image);\n if (file_exists($imagepath)) {\n @unlink($imagepath);\n }\n\n\n $data->delete();\n\n return redirect()->route('image.index');\n }",
"function delete($path);",
"public function removeItem(int $id)\n\t{\n\t\t$this->storage->remove($id);\n\t}",
"public function destroy(File $file)\n {\n //\n $v = Storage::delete($file->path);\n \n }",
"public function destroyResource($resource)\n {\n if (!is_object($resource)) {\n return false;\n }\n\n $resource_type = get_class($resource);\n $resource_id = $resource->getKey();\n\n return Role::where('resource_type', $resource_type)\n ->where('resource_id', $resource_id)\n ->delete();\n }",
"public function remove($filePath){\n return Storage::delete($filePath);\n }",
"public function remove(): void\n {\n $file = $this->getAbsolutePath();\n if (!is_file($file) || !file_exists($file)) {\n return;\n }\n\n unlink($file);\n }",
"public function destroy(Request $request, Storage $storage)\n {\n $storage->delete();\n $request->session()->flash('alert-success', 'Запись успешно удалена!');\n return redirect()->route('storage.index');\n }",
"public function remove(Storable $entity): Storable\n {\n $this->getRepository(get_class($entity))->remove($entity);\n $this->detach($entity);\n\n return $entity;\n }",
"public function processDeletedResource(EntityResource $resource)\n {\n /** @var AuthorizationRepository $repository */\n $repository = $this->entityManager->getRepository('Edweld\\AclBundle\\Entity\\Authorization');\n\n $repository->removeAuthorizationsForResource($resource);\n }",
"function _unlink($resource, $exp_time = null)\n {\n if(file_exists($resource)) {\n return parent::_unlink($resource, $exp_time);\n }\n\n // file wasn't found, so it must be gone.\n return true;\n }",
"public function remove($id);",
"public function remove($id);",
"public function deleted(Storage $storage)\n {\n //\n }",
"public function destroy($id)\n {\n $data = Product::findOrFail($id);\n\n if(file_exists('uploads/product/'.$data->image1)){\n unlink('uploads/product/'.$data->image1);\n }\n\n if(file_exists('uploads/product/'.$data->image2)){\n unlink('uploads/product/'.$data->image2);\n }\n\n if(file_exists('uploads/product/'.$data->image3)){\n unlink('uploads/product/'.$data->image3);\n }\n $data->delete();\n }",
"public function removeUpload()\n {\n $file = $this->getAbsolutePath();\n if ($file) {\n unlink($file);\n }\n }",
"public function resources_delete($resource_id, Request $request) {\n if ($resource_id) {\n $resp = Resources::where('id', '=', $resource_id)->delete();\n if($resp){\n $msg = 'Resource has been deleted successfully.';\n $request->session()->flash('message', $msg);\n }\n }\n //return redirect()->route('admin-factor-list');\n return redirect()->to($_SERVER['HTTP_REFERER']);\n }",
"public function delete()\n {\n try\n {\n $thumbnail = $this->getThumbnail();\n if($thumbnail)\n {\n $thumbnail->delete();\n }\n }\n catch(sfException $e){}\n \n // delete current file\n parent::delete();\n }",
"function deleteResource($uuid){\n $data = callAPI(\"DELETE\",\"/urest/v1/resource/\".$uuid);\n return $data;\n}",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function delete();",
"public function remove_resource($idproject){\n\t\t\n\t\t// Load model and try to get project data\n\t\t$this->load->model('Projects_model', 'projects');\n\t\t\n\t\t// Update\n\t\t$this->projects->save_project(array(\"ext\" => \"\", \"vzaar_idvideo\" => \"0\", \"vzaar_processed\" => \"0\"), $idproject);\n\t}",
"public function destroy($id){\n $file_data = Slider::findOrFail($id);\n File::delete(public_path('../storage/app/public/sliders/'.$file_data->path));\n $slider = Slider::destroy($id);\n return response()->json(null, 204);\n }",
"public function delete()\n\t{\n\t\t@unlink($this->get_filepath());\n\t\t@unlink($this->get_filepath(true));\n\t\tparent::delete();\n\t}",
"public function delete($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'DELETE');\n }",
"public function destroy($id)\n {\n //Find Slider With Id\n $slider = Slider::findOrFail($id);\n // Check If The Image Exist\n if(file_exists('uploads/slider/'.$slider->image)){\n\n unlink( 'uploads/slider/'.$slider->image);\n }\n $slider->delete();\n return redirect()->back()->with('success','Slider Successfully Deleted');\n }"
]
| [
"0.6672584",
"0.6659381",
"0.6635911",
"0.6632799",
"0.6626075",
"0.65424126",
"0.65416265",
"0.64648265",
"0.62882507",
"0.6175931",
"0.6129922",
"0.60893893",
"0.6054415",
"0.60428125",
"0.60064924",
"0.59337646",
"0.5930772",
"0.59199584",
"0.5919811",
"0.5904504",
"0.5897263",
"0.58962846",
"0.58951396",
"0.58951396",
"0.58951396",
"0.58951396",
"0.5880124",
"0.58690923",
"0.5863659",
"0.5809161",
"0.57735413",
"0.5760811",
"0.5753559",
"0.57492644",
"0.5741712",
"0.57334286",
"0.5726379",
"0.57144034",
"0.57096",
"0.5707689",
"0.5705895",
"0.5705634",
"0.5703902",
"0.5696585",
"0.5684331",
"0.5684331",
"0.56780374",
"0.5677111",
"0.5657287",
"0.5648262",
"0.5648085",
"0.5648012",
"0.5640759",
"0.5637738",
"0.5629985",
"0.5619264",
"0.56167465",
"0.5606877",
"0.56021434",
"0.5601949",
"0.55992156",
"0.5598557",
"0.55897516",
"0.5581397",
"0.5566926",
"0.5566796",
"0.55642897",
"0.55641",
"0.5556583",
"0.5556536",
"0.5550097",
"0.5543172",
"0.55422723",
"0.5540013",
"0.5540013",
"0.55371785",
"0.55365825",
"0.55300397",
"0.552969",
"0.55275744",
"0.55272335",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.55271083",
"0.5525997",
"0.5525624",
"0.5523911",
"0.5521122",
"0.5517412"
]
| 0.0 | -1 |
Store a newly created resource in storage. | public function inscribirAlumno(Request $request)
{
// if(!$request->ajax()) return redirect('/');
try {
DB::beginTransaction();
//Search the user who's about to get modified
$student = Student::where('id_user', '=', $request->id_user)->firstOrFail();
$student->id_group = $request->id_group;
$student->save();
$group = Group::findOrFail($request->id_group);
$group->num_students++;
$group->save();
DB::commit();
} catch (Exception $e) {
DB::rollBack();
}
} | {
"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 a listing of the resource. | public function index()
{
return view('backend.articlecategorys.index');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }",
"public function listing();",
"function index() {\n\t\t$this->show_list();\n\t}",
"public function actionList() {\n $this->_getList();\n }",
"public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }",
"public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }",
"public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }",
"function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}",
"public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }",
"public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }",
"public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}",
"function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}",
"public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }",
"public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}",
"public function actionRestList() {\n\t $this->doRestList();\n\t}",
"public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}",
"public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }",
"public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }",
"public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}",
"public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}",
"public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }",
"public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }",
"public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }",
"public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }",
"public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}",
"public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }",
"public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}",
"public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }",
"public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}",
"public function index()\n {\n $this->list_view();\n }",
"public function index()\n {\n $this->list_view();\n }",
"public function index()\n {\n $this->list_view();\n }",
"public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }",
"public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }",
"public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}",
"public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }",
"public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }",
"public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }",
"public function index()\n {\n return Resources::collection(Checking::paginate());\n }",
"public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }",
"public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }",
"public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }",
"public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }",
"public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }",
"public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }",
"public function view(){\n\t\t$this->buildListing();\n\t}",
"public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }",
"public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }",
"public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }",
"public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }",
"public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }",
"public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }",
"public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }",
"public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }",
"public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}",
"public function listAction() {}",
"public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }",
"public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }",
"public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }",
"public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }",
"public function executeList()\n {\n $this->setTemplate('list');\n }",
"public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }",
"function listing() {\r\n\r\n }",
"public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }",
"public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }",
"public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}",
"public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }",
"public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }",
"public function _index(){\n\t $this->_list();\n\t}",
"public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}",
"function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}",
"public function index()\n {\n $this->booklist();\n }",
"public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }",
"public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }",
"public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }",
"public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }",
"public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }",
"public function indexAction() {\n $this->_forward('list');\n }",
"public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }",
"public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }",
"public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}",
"public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }",
"public function 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 view('admin.resources.index');\n }",
"public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\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.7446737",
"0.73625076",
"0.7300871",
"0.72476006",
"0.7163127",
"0.7149414",
"0.7131995",
"0.7105663",
"0.7102927",
"0.7101388",
"0.704981",
"0.69946545",
"0.69897777",
"0.6935023",
"0.690029",
"0.68989694",
"0.68925905",
"0.68878543",
"0.6866467",
"0.6849924",
"0.6829784",
"0.68033314",
"0.67971504",
"0.6796001",
"0.6786942",
"0.6760321",
"0.6743112",
"0.6730776",
"0.67266184",
"0.67259544",
"0.67259544",
"0.67259544",
"0.671818",
"0.670783",
"0.670644",
"0.6704464",
"0.6665842",
"0.6663898",
"0.6660563",
"0.6660198",
"0.6657512",
"0.6654405",
"0.6648237",
"0.6620824",
"0.6619237",
"0.6618058",
"0.66072917",
"0.660077",
"0.6600677",
"0.6594786",
"0.6587929",
"0.65850085",
"0.65824693",
"0.6581521",
"0.6577045",
"0.6574634",
"0.65729445",
"0.65715027",
"0.6570646",
"0.6565125",
"0.6563328",
"0.6553843",
"0.6553201",
"0.6545921",
"0.6537198",
"0.6534121",
"0.6533748",
"0.65272135",
"0.6526431",
"0.6525868",
"0.6519198",
"0.65185314",
"0.6517867",
"0.65170157",
"0.651509",
"0.65070677",
"0.6505637",
"0.65033627",
"0.6494597",
"0.6492147",
"0.64880013",
"0.64871716",
"0.6485315",
"0.6485215",
"0.64790684",
"0.64767736",
"0.64725083",
"0.64709103",
"0.64702755",
"0.6466392",
"0.64618254",
"0.646148",
"0.64601135",
"0.6458744",
"0.64543813",
"0.64537513",
"0.64530194",
"0.6450726",
"0.64492655",
"0.6449169",
"0.64466155"
]
| 0.0 | -1 |
Show the form for creating a new resource. | public function create()
{
return view('backend.articlecategorys.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(ArticleCategorysFormRequest $request)
{
$articleCategory = ArticleCategory::create($request->all());
return redirect()->route('articlecategorys.index')->with('message','Success..! Bạn đã thêm mới thành công..!');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store($data, Resource $resource);",
"public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }",
"public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }",
"public function createStorage();",
"public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }",
"public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }",
"public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }",
"function storeAndNew() {\n $this->store();\n }",
"public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }",
"public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }",
"public function store()\n\t{\n\t\t\n\t\t//\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}"
]
| [
"0.72865677",
"0.7145327",
"0.71325725",
"0.6640912",
"0.66209733",
"0.65685713",
"0.652643",
"0.65095705",
"0.64490104",
"0.637569",
"0.63736665",
"0.63657933",
"0.63657933",
"0.63657933",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437"
]
| 0.0 | -1 |
Display the specified resource. | public function show($id)
{
$articleCategory = ArticleCategory::findOrFail($id);
$optionActive = Config::where('group','active')->lists('title','value');
return view('backend.articlecategorys.show',compact('articleCategory','optionActive'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(Resource $resource)\n {\n // not available for now\n }",
"public function show(Resource $resource)\n {\n //\n }",
"function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }",
"private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }",
"function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}",
"public function show(ResourceSubject $resourceSubject)\n {\n //\n }",
"public function show(ResourceManagement $resourcesManagement)\n {\n //\n }",
"public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function retrieve(Resource $resource);",
"public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }",
"public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function show(Dispenser $dispenser)\n {\n //\n }",
"public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }",
"public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}",
"public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }",
"public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }",
"public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }",
"function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}",
"public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }",
"public function get(Resource $resource);",
"public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }",
"public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }",
"function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}",
"public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }",
"public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }",
"function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}",
"public function edit(Resource $resource)\n {\n //\n }",
"public function show(rc $rc)\n {\n //\n }",
"public function show(Resolucion $resolucion)\n {\n //\n }",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show()\n\t{\n\t\t//\n\t}",
"public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }",
"public function show(Resena $resena)\n {\n }",
"public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}",
"public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }",
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }",
"public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }",
"public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }",
"public function display()\n\t{\n\t\tparent::display();\n\t}",
"public function show()\n\t{\n\t\t\n\t}",
"public function get_resource();",
"function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}",
"public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }",
"public function display($title = null)\n {\n echo $this->fetch($title);\n }",
"public function display(){}",
"public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}",
"public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}",
"public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }",
"public function display() {\n echo $this->render();\n }",
"#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}",
"public function show($id)\n\t{\n\t//\n\t}",
"public function show($id)\n\t{\n\t//\n\t}",
"public function show($id)\n {\n //\n $this->_show($id);\n }",
"function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }",
"public function show()\n\t{\n\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {}",
"static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}",
"public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}",
"public abstract function display();",
"public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }",
"public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}",
"public function show( $id ) {\n\t\t//\n\t}",
"public function show( $id ) {\n\t\t//\n\t}",
"abstract public function resource($resource);",
"public function show(Response $response)\n {\n //\n }",
"public function show()\n {\n return auth()->user()->getResource();\n }",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}"
]
| [
"0.8232636",
"0.81890994",
"0.68296117",
"0.64987075",
"0.649589",
"0.64692974",
"0.64633286",
"0.63640857",
"0.6307513",
"0.6281809",
"0.621944",
"0.61926234",
"0.61803305",
"0.6173143",
"0.61398774",
"0.6119022",
"0.61085826",
"0.6106046",
"0.60947937",
"0.6078597",
"0.6047151",
"0.60409963",
"0.6021287",
"0.5989136",
"0.5964405",
"0.5962407",
"0.59518087",
"0.59309924",
"0.5921466",
"0.5908002",
"0.5908002",
"0.5908002",
"0.59051657",
"0.5894554",
"0.5871459",
"0.5870088",
"0.586883",
"0.5851384",
"0.58168566",
"0.58166975",
"0.5815869",
"0.58056176",
"0.5799148",
"0.5795126",
"0.5791158",
"0.57857597",
"0.5783371",
"0.5761351",
"0.57592535",
"0.57587147",
"0.5746491",
"0.57460666",
"0.574066",
"0.5739448",
"0.5739448",
"0.57295275",
"0.57293373",
"0.5729069",
"0.57253987",
"0.57253987",
"0.57253987",
"0.57253987",
"0.57253987",
"0.57253987",
"0.57253987",
"0.57253987",
"0.57253987",
"0.57253987",
"0.57214445",
"0.57149816",
"0.5712036",
"0.5710076",
"0.57073003",
"0.5707059",
"0.5705454",
"0.5705454",
"0.5700382",
"0.56997055",
"0.5693362",
"0.5687868",
"0.5687868",
"0.5687868",
"0.5687868",
"0.5687868",
"0.5687868",
"0.5687868",
"0.5687868",
"0.5687868",
"0.5687868",
"0.5687868",
"0.5687868",
"0.5687868",
"0.5687868",
"0.5687868",
"0.5687868",
"0.5687868",
"0.5687868",
"0.5687868",
"0.5687868",
"0.5687868",
"0.5687868"
]
| 0.0 | -1 |
Show the form for editing the specified resource. | public function edit($id)
{
$articleCategory = ArticleCategory::findOrFail($id);
return view('backend.articlecategorys.edit',compact('articleCategory'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function edit($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.edit\")) {\n $view = \"admin.{$this->name}.edit\";\n } else {\n $view = 'admin.includes.actions.edit';\n }\n\n /* Displays the edit resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }",
"public function edit(NebulaResource $resource, $item): View\n {\n $this->authorize('update', $item);\n\n return view('nebula::resources.edit', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }",
"public function edit() {\r\n $id = $this->api->getParam('id');\r\n\r\n if ($id) {\r\n $this->model->id = $id;\r\n $this->checkOwner();\r\n }\r\n $object = $this->model->find_by_id($id);\r\n\r\n $this->api->loadView('contact-form', array('row' => $object));\r\n }",
"public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function edit()\n {\n return view('hirmvc::edit');\n }",
"public function editformAction(){\n\t\t$this->loadLayout();\n $this->renderLayout();\n\t}",
"public function edit() {\n $id = $this->parent->urlPathParts[2];\n // pass name and id to view\n $data = $this->parent->getModel(\"fruits\")->select(\"select * from fruit_table where id = :id\", array(\":id\"=>$id));\n $this->getView(\"header\", array(\"pagename\"=>\"about\"));\n $this->getView(\"editForm\", $data);\n $this->getView(\"footer\");\n }",
"public function edit($id)\n\t{\n\t\treturn $this->showForm('update', $id);\n\t}",
"public function edit($id)\n {\n $model = $this->modelObj;\n $formObj = $model::findOrFail($id);\n $data['formObj'] = $formObj;\n return view($this->veiw_base . '.edit', $data);\n }",
"public function createEditForm(Resourceperson $entity){\n \n $form = $this->createForm(new ResourcepersonType(), $entity, array(\n 'action' => $this->generateUrl('rsp_update', array('id' => $entity->getRpId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => 'Update','attr'=> array(\n 'class'=>'btn btn primary'\n )));\n\n return $form;\n }",
"private function createEditForm(Resource $entity)\n {\n $form = $this->createForm(new ResourceType(), $entity, array(\n 'action' => $this->generateUrl('social_admin_resource_update', array('id' => $entity->getId())),\n 'method' => 'PUT',\n ));\n\n $form->add('submit', 'submit', array('label' => '保存','attr'=>[\n 'class'=>'btn btn-primary'\n ]));\n\n return $form;\n }",
"public function edit($id)\n {\n return $this->showForm('update', $id);\n }",
"public function edit($id)\n {\n return $this->showForm('update', $id);\n }",
"public function editAction()\n {\n if ($form = $this->processForm()) {\n if ($this->useTabbedForms && method_exists($this, 'getSubject')) {\n $data = $this->getModel()->loadFirst();\n $subject = $this->getSubject($data);\n $this->setPageTitle(sprintf($this->_('Edit %s %s'), $this->getTopic(1), $subject));\n } else {\n $this->setPageTitle(sprintf($this->_('Edit %s'), $this->getTopic(1)));\n }\n $this->html[] = $form;\n }\n }",
"public function edit($id)\n {\n $this->data['entity'] = GS_Form::where('id', $id)->firstOrFail();\n return view('admin.pages.forms.edit', $this->data);\n }",
"public function edit($id)\n\t{\n\t\t// get the fbf_presenca\n\t\t$fbf_presenca = FbfPresenca::find($id);\n\n\t\t\n\t\t// show the edit form and pass the fbf_presenca\n\t\t$this->layout->content = View::make('fbf_presenca.edit')\n->with('fbf_presenca', $fbf_presenca);\n\t}",
"public function edit($id)\n {\n $data = $this->model->find($id);\n\n return view('admin.backends.employee.form.edit',compact('data'));\n }",
"public function edit($model, $form);",
"function edit() {\n\t\tglobal $tpl;\n\n\t\t$form = $this->initForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}",
"public function edit($id)\n\t{\n\t\t$faith = Faith::find($id);\n \n return view('faith.form')->with('faith', $faith);\n\n\t}",
"public function edit()\n { \n return view('admin.control.edit');\n }",
"public function edit(Form $form)\n {\n //\n }",
"public function edit()\n {\n return view('common::edit');\n }",
"public function edit($id)\n {\n $resource = (new AclResource())->AclResource;\n $roleResource = AclRole::where('role', $id)->get(['resource'])->toArray();\n $roleResource = Arr::pluck($roleResource, 'resource');\n return view('Admin.acl.role.form', [\n 'role' => $id,\n 'resource' => $resource,\n 'roleResource' => $roleResource,\n ]);\n }",
"public function edit()\n {\n return view('admin::edit');\n }",
"public function edit()\n {\n return view('admin::edit');\n }",
"public function edit()\r\n {\r\n return view('petro::edit');\r\n }",
"public function edit($id)\n {\n // show form edit user info\n }",
"public function edit()\n {\n return view('escrow::edit');\n }",
"public function edit($id)\n {\n $resource = ResourceManagement::find($id);\n\n $users = User::get();\n // Redirect to user list if updating user wasn't existed\n if ($resource == null || $resource->count() == 0) {\n return redirect()->intended('/resource-management');\n }\n\n return view('resources-mgmt/edit', ['resource' => $resource, 'users' => $users]);\n }",
"public function edit()\n {\n return view('commonmodule::edit');\n }",
"public function editAction()\n\t{\n\t\t$params = $this->data->getParams();\n\t\t$params = $this->valid->clearDataArr($params);\n\t\tif (isset($params['id']))\n\t\t{\n\t\t\t$this->employee->setFlag(true);\n\t\t}\n\t\tif (isset($_POST['submit']))\n\t\t{\n\t\t\t$action = $this->valid->clearDataArr($_POST);\n\t\t\t$this->employee->setDataArray($action);\n\t\t\theader('Location: ' . PATH . 'Employee/index/', true, 303);\n\t\t}\n\t\t$employee = $this->employee->setAction('edit');\n\t\t$this->view->addToReplace($employee);\n\t\t$this->listEmployee();\n\t\t$this->arrayToPrint();\n\t}",
"public function edit()\n {\n return view('catalog::edit');\n }",
"public function edit()\n {\n return view('catalog::edit');\n }",
"public function edit(form $form)\n {\n //\n }",
"public function actionEdit($id) { }",
"public function edit()\n {\n return view('admincp::edit');\n }",
"public function edit()\n {\n return view('scaffold::edit');\n }",
"public function edit($id)\n {\n $header = \"Edit\";\n\t\t$data = Penerbit::findOrFail($id);\n\t\treturn view('admin.penerbit.form', compact('data','header'));\n }",
"public function edit()\n {\n return view('Person.edit');\n }",
"public function edit($id)\n {\n $data = Form::find($id);\n return view('form.edit', compact('data'));\n }",
"public function edit($id)\n\t{\n\t\t$career = $this->careers->findById($id);\n\t\treturn View::make('careers._form', array('career' => $career, 'exists' => true));\n\t}",
"public function edit($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 editAction()\n {\n $form = MediaForm::create($this->get('form.context'), 'media');\n $media = $this->get('media_manager.manager')->findOneById($this->get('request')->get('media_id'));\n \n $form->bind($this->get('request'), $media);\n \n return $this->render('MediaManagerBundle:Admin:form.html.twig', array('form' => $form, 'media' => $media));\n }",
"public function edit(Form $form)\n {\n return view('admin.forms.edit', compact('form'));\n }",
"public function editAction($id) {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('CdlrcodeBundle:Question')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Question entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('CdlrcodeBundle:Question:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n {\n return view('consultas::edit');\n }",
"public function edit(DirectorFormBuilder $form, $id)\n {\n return $form->render($id);\n }",
"public function edit()\n {\n return view('dashboard::edit');\n }",
"public function edit($id){\n $rfid = Rfid::find($id);\n\n //load form view\n return view('rfids.edit', ['rfid' => $rfid]);\n }",
"public function edit($id)\n {\n\n // retrieve provider\n $provider = Provider::findOrFail($id);\n\n // return form with provider\n return view('backend.providers.form')->with('provider', $provider);\n }",
"public function edit() {\n return view('routes::edit');\n }",
"public function edit(Question $question)\n {\n $this->employeePermission('application' , 'edit');\n $question->chooses;\n $action = 'edit';\n return view('admin.setting.question_form', compact('action' , 'question'));\n }",
"public function edit($id)\n {\n $this->data['product'] = Product::find($id);\n $this->data['category'] = Category::arrForSelect();\n $this->data['title'] = \" Update Prouct Details\";\n $this->data['mode'] = \"edit\";\n\n return view('product.form', $this->data);\n }",
"public function edit(ClueEnFormBuilder $form, $id): Response\n {\n return $form->render($id);\n }",
"public function editAction($id)\n {\n $em = $this->getDoctrine()->getManager();\n\n $entity = $em->getRepository('BaseBundle:Feriado')->find($id);\n\n if (!$entity) {\n throw $this->createNotFoundException('Unable to find Feriado entity.');\n }\n\n $editForm = $this->createEditForm($entity);\n $deleteForm = $this->createDeleteForm($id);\n\n return $this->render('BaseBundle:Feriado:edit.html.twig', array(\n 'entity' => $entity,\n 'edit_form' => $editForm->createView(),\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function edit($id)\n {\n $resources = User::find(session('usuario_id'))->resources;\n $languages = Language::pluck('name', 'id');\n $types = Type::pluck('name', 'id');\n $method = 'PATCH';\n\n $recurso = Resource::find($id);\n $url = \"/resource/$recurso->id\";\n\n return view('resources.resources', compact('resources', 'languages', 'types', 'method', 'url', 'recurso'));\n }",
"public function edit($articulo_id)\n {\n $titulo = \"Editar\";\n return View(\"articulos.formulario\",compact('titulo','articulo_id'));\n }",
"public function edit($id)\n {\n return view('cataloguemodule::edit');\n }",
"public function displayEditForm(Employee $employee){\n return view('employee.displayEditForm',['employee'=>$employee]);\n }",
"public function edit(Question $question)\n {\n $edit = TRUE;\n return view('questionForm', ['question' => $question, 'edit' => $edit]);\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_id){\n \t$person = Person::find($person_id);\n \treturn view('resource_detail._basic_info.edit',compact('person'));\n }",
"public function edit(Person $person) {\n\t\t$viewModel = new PersonFormViewModel();\n\t\treturn view('person.form', $viewModel);\n\t}",
"public function edit($id)\n {\n $professor = $this->repository->find($id);\n return view('admin.professores.edit',compact('professor'));\n }",
"public function edit($id)\n {\n $data = Restful::find($id);\n return view('restful.edit', compact('data'));\n }",
"public function 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.78548634",
"0.7693446",
"0.72737956",
"0.72415876",
"0.71732706",
"0.7064379",
"0.70547634",
"0.6985193",
"0.6948865",
"0.6946892",
"0.69416964",
"0.6929201",
"0.69028485",
"0.6899143",
"0.6899143",
"0.68794435",
"0.6864862",
"0.6860578",
"0.68581015",
"0.6845792",
"0.6836835",
"0.681191",
"0.6808133",
"0.6806856",
"0.68035305",
"0.6796193",
"0.67936623",
"0.67936623",
"0.67895305",
"0.6785768",
"0.678106",
"0.67773324",
"0.67697626",
"0.6762823",
"0.6747543",
"0.6747543",
"0.67463523",
"0.67444044",
"0.6741766",
"0.6737379",
"0.6726827",
"0.6714104",
"0.66950524",
"0.66935307",
"0.6689272",
"0.6689106",
"0.66872644",
"0.6686648",
"0.6684393",
"0.6670288",
"0.6669616",
"0.66668564",
"0.66668564",
"0.666409",
"0.6662514",
"0.66599286",
"0.66590035",
"0.6655965",
"0.6653906",
"0.6644097",
"0.66327673",
"0.66314846",
"0.6629497",
"0.6629497",
"0.6620671",
"0.66204685",
"0.66168797",
"0.66163945",
"0.66112244",
"0.6610172",
"0.66072273",
"0.65975267",
"0.6596347",
"0.6595878",
"0.65914613",
"0.65904135",
"0.65880567",
"0.658147",
"0.6581434",
"0.6581035",
"0.65780395",
"0.65776944",
"0.6576013",
"0.6570687",
"0.6569499",
"0.6568776",
"0.6567722",
"0.6562973",
"0.6562973",
"0.6561691",
"0.655929",
"0.6557889",
"0.65571314",
"0.65565974",
"0.65564924",
"0.65558827",
"0.65556073",
"0.6555524",
"0.6549151",
"0.6548339",
"0.65460944"
]
| 0.0 | -1 |
Update the specified resource in storage. | public function update($id, ArticleCategorysFormRequest $request)
{
$articleCategory = ArticleCategory::findOrFail($id);
$articleCategory->update($request->all());
return redirect()->route('articlecategorys.index')->with('message','Success..! Bạn đã cập nhật thành công..!');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function updateShopifyResource() {\n $this->saving();\n $this->getShopifyApi()->call([\n 'URL' => API::PREFIX . $this->getApiPathSingleResource(),\n 'METHOD' => 'PUT',\n 'DATA' => [\n static::getResourceSingularName() => $this->shopifyData\n ]\n ]);\n }",
"public function update(Request $request, Resource $resource)\n {\n $request->validate([\n 'name' => 'required',\n 'description' => 'required|string',\n 'file' => 'required|mimes:jpg,jpeg,png,doc,docx,pdf,ppt,txt',\n ]);\n\n $resource->update($request->all());\n\n if ( $request->hasFile('file') ) {\n $resource = 'resource-'.time().'.'.$request->file('file')->extension();\n $request->file->storeAs('resources', $resource,'public');\n $resource->file = $resource;\n }\n\n if ( $resource->save() ) {\n return redirect()->route('admin.resources.index')->with('success', 'Resource updated');\n } else {\n return redirect()->route('admin.resources.index')->with('error', 'Something went wrong');\n }\n }",
"public function update(Request $request, Resource $resource)\n {\n //\n }",
"public function updateStream($resource);",
"public function update(Request $request, Storage $storage)\n {\n $storage->product_id = $request->product_id;\n $storage->amount = $request->amount;\n\n $storage->save();\n\n return redirect()->route('storages.index');\n }",
"protected function updateImageResource($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n $this->deleteResource($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }",
"public function update(Storage $storage, UpdateStorageRequest $request)\n {\n $this->storage->update($storage, $request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource updated', ['name' => trans('product::storages.title.storages')]));\n }",
"public function update(StoreStorage $request, Storage $storage)\n {\n $storage->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('storage.index');\n }",
"public function update_asset($id, Request $request){\n \t\tif(!Auth::user()){\n\t\t\treturn redirect('/');\n\t\t}\n \t\t$asset = Storage::find($id);\n \t\t$asset->name = $request->name;\n \t\t$asset->quantity = $request->quantity;\n \t\t$asset->category_id = $request->category;\n \t\tif($request->file('image') != null){\n\t\t\t$image = $request->file('image');\n\t\t\t$image_name = time(). \".\" . $image->getClientOriginalExtension();\n\t\t\t$destination = \"images/\";\n\t\t\t$image->move($destination, $image_name);\n\t\t\t$asset->image_url = $destination.$image_name;\n\t\t} \n\t\t$asset->save();\n\t\tsession()->flash('success_message', 'Item Updated successfully');\n\t\treturn redirect(\"/storage\");\n \t}",
"public function update(Request $request, Flight $exercise, FlightResource $resource)\n {\n $request->validate([\n 'display_name' => 'required|string|max:100',\n 'file' => 'nullable|file|max:10240|mimes:pdf',\n 'uri' => 'nullable|url|max:255',\n ]);\n\n if ($resource->type === 'file' && $request->file('file')) {\n Storage::drive('public')->delete($resource->resource);\n $resource->resource = $request->file('file')->store('smartcars/exercises/resources', ['disk' => 'public']);\n } elseif ($resource->type === 'uri' && $request->input('uri')) {\n $resource->resource = $request->input('uri');\n }\n\n $resource->save();\n\n return redirect()->route('adm.smartcars.exercises.resources.index', $exercise)\n ->with('success', 'Resource edited successfully.');\n }",
"public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n 'title' => 'required|string',\n 'content' => 'required|string',\n 'mentoring_area_id' => 'required|integer',\n 'featured_image_uri' => 'string',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n \n $resource = Resource::find($id);\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->featured_image_uri = $request->get('featured_image_uri');\n $resource->updated_at = \\Carbon\\Carbon::now();\n $resource->mentoring_area_id = $request->get('mentoring_area_id');\n $resource->save();\n $data['resource'] = $resource;\n return APIHandler::response(1, \"Resource has been updated\");\n }",
"protected function updateVideoResource($fileName, $videoId, $storage, $premium=1)\n {\n //Get video name and storage location for video\n $video = Video::where('id', '=', $videoId)->first();\n\n //Check the storage medium\n if($storage == 'vimeo' || $storage == 'youtube')\n {\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n else\n {\n if($video['storage'] == 'local' || $video['storage'] == 's3')\n {\n //Delete old video\n $this->deleteResource($video->name, $video->storage);\n }\n \n //Store the new video\n $video->name = $fileName;\n $video->storage = $storage;\n $video->premium = $premium;\n $video->save();\n }\n }",
"public function put($resource, $with=[]){\n return $this->fetch($resource, self::PUT, $with);\n }",
"public function update($id, $resource) {\n SCA::$logger->log(\"update resource\");\n return $this->orders_service->update($id, $resource);\n }",
"public function update($path);",
"public function update($id, $resource)\n {\n SCA::$logger->log(\"Entering update()\");\n //check whether it is an sdo or an xml string.\n if ($resource instanceof SDO_DataObjectImpl) {\n //if the thing received is an sdo convert it to xml\n if ($this->xml_das !== null) {\n $xml = SCA_Helper::sdoToXml($this->xml_das, $resource);\n } else {\n throw new SCA_RuntimeException(\n 'Trying to update a resource with SDO but ' .\n 'no types specified for reference'\n );\n }\n } else {\n $xml = $resource;\n }\n\n $slash_if_needed = ('/' === $this->target_url[strlen($this->target_url)-1])?'':'/';\n\n $handle = curl_init($this->target_url.$slash_if_needed.\"$id\");\n curl_setopt($handle, CURLOPT_HEADER, false);\n curl_setopt($handle, CURLOPT_RETURNTRANSFER, true);\n curl_setopt($handle, CURLOPT_CUSTOMREQUEST, \"PUT\");\n curl_setopt($handle, CURLOPT_POSTFIELDS, $xml);\n\n //replace with Content-Type: atom whatever\n $headers = array(\"User-Agent: SCA\",\n \"Content-Type: text/xml;\",\n \"Accept: text/plain\");\n curl_setopt($handle, CURLOPT_HTTPHEADER, $headers);\n\n $result = curl_exec($handle);\n\n $response_http_code = curl_getinfo($handle, CURLINFO_HTTP_CODE);\n\n curl_close($handle);\n\n $response_exception = $this->buildResponseException($response_http_code, '200');\n\n if ($response_exception != null) {\n throw $response_exception;\n } else {\n //update does not return anything in the body\n return true;\n }\n }",
"public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'name' => 'required',\n 'link' => 'required',\n 'description' => 'required'\n ]);\n\n $resource = Resource::find($id);\n $resource->name = $request->name;\n $resource->type_id = $request->type_id;\n $resource->has_cost = ($request->has('has_cost')) ? 1 : 0;\n $resource->language_id = $request->language_id;\n $resource->link = $request->link;\n $resource->description = $request->description;\n $resource->tags = '';\n\n $resource->save();\n //return back()->with('success', 'Recurso actualizado satisfactoriamente');\n return redirect('/resource')->with('success', 'Recurso actualizado satisfactoriamente');\n }",
"public function update(Request $request, $id)\n {\n $oldProduct = Product::findOrFail($id);\n $data = $request->all();\n if(isset($data['img'])){\n // $file = $request->file('photo');\n // return $file;\n $imgName = time().'.'.$request->img->extension();\n $data['img'] = $imgName;\n // Storage::putFile('spares', $file);\n $path = $request->img->storeAs('public/uploads', $imgName); //in Storage\n\n //delete old file\n if($oldProduct->img != 'product-default.png'){\n Storage::delete(\"public/uploads/\".$oldProduct->img);\n // return 'deleted';\n }\n \n }else{\n $data['img'] = $oldProduct->img;\n }\n $oldProduct->update($data);\n return redirect()->route('product.index'); \n\n }",
"public function update($request, $id) {\n\t\t\t$image = $request['photo'];\n\t\t\tif($image !== null) {\n\t\t\t\t$name = time().'.' . explode('/', explode(':', substr($image, 0, strpos($image, ';')))[1])[1];\n\t\t\t\t\\Image::make($request['photo'])->save(public_path('storage/products/').$name);\n\t\t\t\t$request['photo'] = $name;\n\t\t\t} else {\n\t\t\t\t$currenPhoto = Product::all()->where('id', $id)->first();\n\t\t\t\t$request['photo'] = $currenPhoto->photo;\n\t\t\t}\n return $this->product->update($id, $request);\n\t}",
"public function updateStream($path, $resource, Config $config)\n {\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function updateResourceIndex(&$resource) {\n if ($this->connector != null) {\n\n // STEP 1: Update or insert this resource as a node:\n $this->logger->addDebug(\"Updating/Inserting Node into Neo4J database\");\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} }) SET a.title = {title}, a.version = {version}, a.href = {href}\n return a;\",\n [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n );\n\n // Check to see if anything was added\n $records = $result->getRecords();\n if (empty($records)) {\n // Must create this record instead\n $result = $this->connector->run(\"CREATE (n:Resource) SET n += {infos};\",\n [\n \"infos\" => [\n 'id' => $resource->getID(),\n 'version' => $resource->getVersion(),\n 'title' => $resource->getTitle(),\n 'href' => $resource->getLink()\n ]\n ]\n );\n }\n\n // STEP 2: Update or insert the resource's link to holding repository\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id} })-[r:HIRELATION]->()\n return r;\",\n [\n 'id' => $resource->getID(),\n ]\n );\n $records = $result->getRecords();\n if (!empty($records)) {\n // delete the one there so that we can add the correct one (just in case)\n $result = $this->connector->run(\"MATCH (a:Resource {id: {id}})-[r:HIRELATION]->() delete r;\",\n [\n 'id' => $resource->getID()\n ]\n );\n\n }\n\n // If resource has a repository, then add a link\n if ($resource->getRepository() != null && $resource->getRepository()->getID() != null) {\n $this->connector->run(\"MATCH (a:Identity {id: {id1} }) MATCH (b:Resource {id: {id2} }) CREATE (b)-[r:HIRELATION]->(a);\",\n [\n 'id1' => (string) $resource->getRepository()->getID(),\n 'id2' => $resource->getID()\n ]);\n }\n }\n }",
"public function update($data) {}",
"public function update($data) {}",
"public function putStream($resource);",
"public function update(Request $request, NebulaResource $resource, $item): RedirectResponse\n {\n $this->authorize('update', $item);\n\n $validated = $request->validate($resource->rules(\n $resource->editFields()\n ));\n\n $resource->updateQuery($item, $validated);\n\n $this->toast(__(':Resource updated', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }",
"public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }",
"public function update($entity);",
"public function update($entity);",
"public function setResource($resource);",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->upload($path, $resource, $config);\n }",
"public function isUpdateResource();",
"public function update(Request $request, $id)\n {\n $device = Device::findOrFail($id);\n $device->fill($request->all());\n if ($request->hasFile('icon')) {\n if ($device->hasMedia('icon')) {\n $device->deleteMedia($device->getFirstMedia('icon'));\n }\n $device->addMediaFromRequest('icon')->toMediaCollection('icon');\n }\n $device->save();\n return new DeviceResource($device);\n }",
"public function update(Request $request, $id)\n {\n //\n $product = Product::findOrFail($id);\n \n $product->update($request->all());\n \n $file = $request->file('url_image')->move('upload', $request->file('url_image')->getClientOriginalName());\n\n Product::where('id',$id)->update(['url_image'=>$file]);\n \n \\Session::flash('flash_message', 'Edit product successfully.'); \n \n //cũ : return redirect('articles');\n return redirect()->route('products.index');\n }",
"public function store($data, Resource $resource);",
"public function update(Request $request, $id)\n {\n \n $product = Product::find($id);\n\n\n $product->fill($request->all())->save();\n\n //Verificamos que tenemos una imagen\n if($request->file('photo_1')){\n\n\n //En caso de tenerla la guardamos en la clase Storage en la carpeta public en la carpeta image.\n $path = Storage::disk('public')->put('photo_1',$request->file('photo_1'));\n\n //Actualizamos el Post que acabamos de crear\n $product->fill(['photo_1' => asset($path)])->save();\n\n }\n\n\n return redirect()->route('products.index')->with('info', 'Producto actualizado exitosamente!');\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n if (\\Input::hasFile('image')) {\n $this->imgsave($request, $product);\n }\n\n\n if (!empty($request->input('tags'))) {\n $product->tags()->sync($request->input('tags'));\n } else {\n $product->tags()->detach();\n }\n\n $product->update($request->all());\n\n return redirect()->to('dashboard/product')->with('message', 'update success');\n }",
"public function put($resource_path, array $variables = array()) {\n return $this->call($resource_path, $variables, 'PUT');\n }",
"public function update($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'updateValidations')) {\n $this->request->validate($this->updateValidations());\n }\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Update the specified resource */\n $resource->update(Input::all());\n\n /* Redirect back */\n return redirect()->back()\n ->with(\n 'info',\n Lang::has($this->name . '.resource-updated') ?\n $this->name . '.resource-updated' :\n 'messages.alert.resource-updated'\n );\n }",
"public function putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }",
"public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }",
"public function update(Request $request, $id)\n\n {\n ResourceManagement::findOrFail($id);\n $constraints = [\n 'title' => 'required|max:100',\n 'url'=> 'required|max:191',\n 'content' => 'required'\n ];\n\n $input = [\n 'title' => $request['title'],\n 'url' => $request['url'],\n 'content' => $request['content'],\n 'type' => $request['type'],\n 'level' => $request['level'],\n 'user_id' => $request['user']\n ];\n// $this->validate($input, $constraints);\n ResourceManagement::where('id', $id)\n ->update($input);\n\n return redirect()->intended('/resource-management');\n }",
"public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }",
"public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }",
"public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }",
"public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }",
"public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }",
"public function update(Qstore $request, $id)\n {\n //\n }",
"public function update(IEntity $entity);",
"protected function performUpdate(): bool\n {\n // Abort if resource does not support update operations\n if (!$this->isUpdatable()) {\n throw new UnsupportedOperation(sprintf('API does not support update operation for %s resources', $this->resourceNameSingular()));\n }\n\n $id = $this->id();\n $prepared = $this->prepareBeforeUpdate($this->toArray());\n\n $payload = [\n $this->resourceNameSingular() => $prepared\n ];\n\n $response = $this\n ->request()\n ->put($this->endpoint($id), $payload);\n\n // Extract and (re)populate resource (if possible)\n // Note: Unlike the \"create\" method, Redmine does NOT\n // appear to send back a full resource when it has been\n // successfully updated.\n $this->fill(\n $this->decodeSingle($response)\n );\n\n return true;\n }",
"public function update($request, $id);",
"function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}",
"public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }",
"public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }",
"protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }",
"abstract public function put($data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function testUpdateSupplierUsingPUT()\n {\n }",
"public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }",
"public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }",
"public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }",
"public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }",
"public abstract function update($object);",
"public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }",
"public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }",
"public function update(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }",
"public function update(Request $request, $id)\n {\n $volume = $this->findVolume($id);\n\n if(count($volume) > 0) {\n $volume->str_volume_name = $request->str_volume_name;\n\n $volume->save();\n }\n\n return response()\n ->json(\n array(\n 'message' => 'Volume is successfully updated.',\n 'volume' => $volume\n ),\n 201\n );\n }",
"public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }",
"public function update()\n {\n $accessory = Accessories::find(request('id'));\n\n if ($accessory == null) {\n return response()->json([\"error\" => \"aksesuaras nerastas\"], 404);\n }\n\n $this->validateData();\n $path = $accessory->src;\n\n if (request()->hasFile('src')) {\n\n if (Storage::disk('public')->exists($accessory->src)) {\n Storage::disk('public')->delete($accessory->src);\n }\n $path = request()->file('src')->store('accessoriesImages', 'public');\n }\n\n $accessory->update(array_merge($this->validateData(), ['src' => $path]));\n\n return response()->json([\"data\" => $accessory], 200);\n }",
"public function update(ProductStoreRequest $request,$id)\n {\n $data = $request->validated();\n $product = Product::where('id',$id);\n $product->update($data);\n return response(\"Producto actualizado con éxito\",200);\n }",
"public function update($entity)\n {\n \n }",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->write($path,stream_get_contents($resource),$config);\n }",
"public function update($id, Request $request)\n {\n date_default_timezone_set('Asia/Taipei');\n $data = $request->all();\n $dbData = Product::find($id);\n $myfile = Storage::disk('local');\n if ($request->hasFile('img')) {\n $file = $request->file('img');\n $path = $myfile->putFile('public', $file);\n $data['img'] = $myfile->url($path);\n File::delete(public_path($dbData->img));\n }\n $dbData->update($data);\n\n if ($request->hasFile('imgs')) {\n // $this->fetchDestroyByProdId($id);\n $localS = Storage::disk('local');\n\n $fileS = $request->file('imgs');\n $imgs = [];\n foreach ($fileS as $i) {\n $pathS = $localS->putFile('public', $i);\n $imgs[] = $localS->url($pathS);\n }\n foreach ($imgs as $img) {\n ProductImg::create([\n 'product_id' => $id,\n 'img' => $img\n ]);\n }\n }\n\n return redirect()->route('admin');\n }",
"public function update(Request $request, Product $product)\n { $remfile= $product->image;\n if($request->filep){\n $product->image=$request->filep;\n File::delete(storage_path('app/public/products/'.$remfile));\n }else{\n $product->image=$remfile;\n }\n //rmdir(storage_path('app/public/products/'.$remfile));\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->save();\n sleep(3);\n toast('Details updated successfully','info');\n return redirect('/products');\n }",
"public function update($id, $input);",
"public function update(ProductRequest $request,int $id): ProductResource\n {\n $attributes = $request->only('supplier_id', 'name', 'warehouses');\n\n return new ProductResource($this->productRepository->update($id, $attributes)); }",
"public function update(Request $request, $id)\n {\n $slider=new Slider;\n $slider=$slider::find($id);\n \n \n if($file =$request->file('slider')){\n if(Storage::delete('public/slider/'.$slider->slider)){\n\n //Get file original name//\n \n$original_name=$file->getClientOriginalName();\n\n //Get just the file name\n$filename=pathinfo($original_name,PATHINFO_FILENAME);\n\n//Create new file name\n$name=$filename.'_'.time().'.'.$file->getClientOriginalExtension();\n\n $destination='public/slider';\n $path=$request->slider->storeAs($destination,$name);\n $slider->slider=$name;\n $slider->save();\n return redirect('Admin/slider');\n\n }\n }\n}",
"public function update(Request $request, $id)\n {/* dd($request->all()); */\n $acheivePic = $this->acheiveRepo->find($id);\n $acheive = $request->except('_method', '_token', 'photo', 'ar', 'en');\n $acheiveTrans = $request->only('ar', 'en');\n\n if ($request->hasFile('icon')) {\n // Delete old image first.\n $oldPic = public_path() . '/images/acheives/' . $acheivePic->icon;\n File::delete($oldPic);\n\n // Save the new one.\n $image = $request->file('icon');\n $imageName = $this->upload($image, 'acheives');\n $acheive['icon'] = $imageName;\n }\n\n $this->acheiveRepo->update($id, $acheive, $acheiveTrans);\n\n return redirect('admin-panel/widgets/acheive')->with('updated', 'updated');\n }",
"public function update(Request $request, $id)\n {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }",
"public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }",
"public function update($id);",
"public function update($id);",
"private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }",
"public function put($path, $data = null);",
"public function update(Request $request, $id)\n {\n $request->validate([\n 'path_image'=>'image',\n 'status'=>'required|in:0,1'\n ]);\n $slider=Slider::whereId($id)->first();\n if (is_null($slider)){\n return redirect()->route('sliders.index')->with('error','Slider does not exist');\n }\n try {\n if ($request->hasFile('path_image')){\n $file = $request->file('path_image');\n\n $image_path= $file->store('/sliders',[\n 'disk'=>'uploads'\n ]);\n Storage::disk('uploads')->delete($slider->image);\n\n $request->merge([\n 'image'=>$image_path,\n ]);\n }\n\n $slider->update( $request->only(['status','image']));\n return redirect()->route('sliders.index')->with('success','Updated successful');\n }catch (\\Exception $exception){\n return redirect()->route('sliders.index')->with(['error'=>'Something error try again']);\n\n }\n }",
"public function update() {\n $this->accessory->update($this->accessory_params());\n\n if ($this->accessory->is_valid()) {\n $this->update_accessory_image($this->accessory);\n redirect('/backend/accessories', ['notice' => 'Successfully updated.']);\n } else {\n redirect(\n '/backend/accessories/edit',\n ['error' => $this->accessory->errors_as_string()],\n ['id' => $this->accessory->id]\n );\n }\n }",
"public function update(Entity $entity);",
"public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }",
"public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}",
"public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }",
"public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n\n $product->name = $request->input('name');\n $product->description = $request->input('description');\n $product->lastPrice = $product->price !== $request->input('price') ? $product->price : NULL;\n $product->price = $request->input('price');\n\n if ($request->hasFile('image')) { \n $currentImg = $product->image;\n if ($currentImg) {\n Storage::delete('/public/' . $currentImg);\n }\n $image = $request->file('image'); \n $path = $image->store('images','public');\n $product->image = $path;\n };\n\n $product->save(); \n\n $product_promotions = $request->input('promotion');\n\n $product->promotions()->sync($product_promotions);\n\n return redirect()->route('admin.modify');\n }",
"public static function updateImage($fileName, $imageId, $storage)\n {\n //Get image name and storage location for image\n $image = Image::where('id', '=', $imageId)->first();\n\n //Delete old image\n ResourceHandler::delete($image->name, $image->storage);\n\n //Store the new image\n $image->name = $fileName;\n $image->storage = $storage;\n\n $image->save();\n }",
"public function update($request, $id)\n {\n $this->checkExits($id);\n $data = $request->except(['_method','_token','photo']);\n\n if($request->photo)\n {\n try {\n $this->UploadFile($request);\n } catch (\\Exception $e) {\n //if has exception , don't has action\n }\n if ($this->img !== '') {\n $data['img'] = $this->img;\n }\n }\n\n $this->object->update($data);\n\n }",
"public function updateProduct($request, $product)\n {\n $product->update($request->except(['_token', '_method', 'image']));\n if ($request->hasFile('image')) {\n $image = $request->file('image');\n $imageName = time() . '.' . $request->file('image')->extension();\n // $img = Image::make('public/foo.jpg');\n\n $image_resize = Image::make($image->getRealPath());\n $image_resize->resize(500, 500);\n $image_resize->save(public_path('images/') . $imageName, 100);\n $product->gallery = $imageName;\n $product->save();\n }\n $product->getTags()->sync($request->input('tags'));\n }"
]
| [
"0.7425105",
"0.70612276",
"0.70558053",
"0.6896673",
"0.6582159",
"0.64491373",
"0.6346954",
"0.62114537",
"0.6145042",
"0.6119944",
"0.61128503",
"0.6099993",
"0.6087866",
"0.6052593",
"0.6018941",
"0.60060275",
"0.59715486",
"0.5946516",
"0.59400934",
"0.59377414",
"0.5890722",
"0.5860816",
"0.5855127",
"0.5855127",
"0.58513457",
"0.5815068",
"0.5806887",
"0.57525045",
"0.57525045",
"0.57337505",
"0.5723295",
"0.5714311",
"0.5694472",
"0.5691319",
"0.56879413",
"0.5669989",
"0.56565005",
"0.56505877",
"0.5646085",
"0.5636683",
"0.5633498",
"0.5633378",
"0.5632906",
"0.5628826",
"0.56196684",
"0.5609126",
"0.5601397",
"0.55944353",
"0.5582592",
"0.5581908",
"0.55813426",
"0.5575312",
"0.55717176",
"0.55661047",
"0.55624634",
"0.55614686",
"0.55608666",
"0.55599797",
"0.55599797",
"0.55599797",
"0.55599797",
"0.55599797",
"0.55573726",
"0.5556878",
"0.5554201",
"0.5553069",
"0.55530256",
"0.5543788",
"0.55435944",
"0.55412996",
"0.55393505",
"0.55368495",
"0.5535236",
"0.5534954",
"0.55237365",
"0.5520468",
"0.55163723",
"0.55125296",
"0.5511168",
"0.5508345",
"0.55072427",
"0.5502385",
"0.5502337",
"0.5501029",
"0.54995877",
"0.54979175",
"0.54949397",
"0.54949397",
"0.54946727",
"0.5494196",
"0.54941916",
"0.54925025",
"0.5491807",
"0.5483321",
"0.5479606",
"0.5479408",
"0.5478678",
"0.54667485",
"0.5463411",
"0.5460588",
"0.5458525"
]
| 0.0 | -1 |
Remove the specified resource from storage. | public function destroy($id)
{
$articleCategory = ArticleCategory::findOrFail($id);
$articleCategory->delete();
return redirect()->route('articlecategorys.index')->with('message','Success..! Bạn đã xóa thành công..!');
} | {
"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 |
Run the database seeds. | public function run()
{
$faker = Faker\Factory::create('pt_BR');
DB::table('drivers')->insert([
'user_id' => 1,
'username' => 'driver1',
'password' => bcrypt('123abc'),
'name' => 'Reginaldo',
'lastname' => 'Garutti',
'rg' => $faker->rg,
'created_at' => Carbon::now()->format('Y-m-d H:i:s'),
'updated_at' => Carbon::now()->format('Y-m-d H:i:s')
]);
DB::table('drivers')->insert([
'user_id' => 1,
'username' => 'driver2',
'name' => 'James',
'lastname' => 'Cotil 2005',
'rg' => $faker->rg,
'password' => bcrypt('123abc'),
'created_at' => Carbon::now()->format('Y-m-d H:i:s'),
'updated_at' => Carbon::now()->format('Y-m-d H:i:s')
]);
} | {
"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 |
Functions to handle numerios SQLrequests. Adds or updates a term. | function gwAddTerm($arPre, $id_dict, $arStop, $in_term, $is_specialchars, $is_overwrite, $intLine = 0, $isDelete = 0)
{
global $oDom, $oFunc, $oDb, $oSqlQ, $oCase, $oL, $oHtml, $oSess;
global $arFields, $arDictParam, $arTermParam, $cnt, $tid, $sys;
global $gw_this, $qT;
# @header("content-type: text/html; charset=utf-8");
$id_w = $oDb->MaxId($arDictParam['tablename']);
$isQ = 1;
$isCleanMap = 0;
$id_old = isset($tid) ? $tid : 0;
$queryA = $qT = array();
$isTermExist = 0;
/* Used for keywords */
$str_term_filtered = $oDom->get_content($arPre['term']);
/* remove {TEMPLATES}, {%TEMPLATES%} */
$str_term_filtered = preg_replace("/{(%)?([A-Za-z0-9:\-_]+)(%)?}/", '', $str_term_filtered);
$str_term_filtered = trim($str_term_filtered);
/* Used in database */
$str_term_src = gw_fix_input_to_db($str_term_filtered);
$str_term_filtered = gw_unhtmlspecialamp($str_term_filtered);
/* 22 jul 2003: Custom Term ID */
$qT['id'] = $oDom->get_attribute('id', 'term', $arPre['term'] );
$qT['id'] = preg_replace("/[^0-9]/", '', trim($qT['id']));
/* */
if (!$isDelete)
{
/* -- Check for an existed term -- */
/* prepare keywords for a term */
if ($is_specialchars)
{
/* Keep specials */
$str_term_filtered = $oCase->nc($str_term_filtered);
$str_term_filtered = gw_text_wildcars($str_term_filtered);
$arKeywordsT = text2keywords($oCase->rm_($str_term_filtered), 1);
}
else
{
/* Remove specials */
$str_term_filtered = text_normalize($str_term_filtered);
$arKeywordsT = text2keywords($str_term_filtered, $arDictParam['min_srch_length']);
}
/* Are there any keywords? */
$isTermEmpty = (empty($arKeywordsT) && (strlen(trim( $str_term_filtered )) == 0)) ? 1 : 0;
if (!$isTermEmpty)
{
/* no empty keywords for a term */
/* SQL-query */
/* Get existent keywords, standard mode */
$word_srch_sql = ($qT['id'] != '') ? 't.id = "' . $qT['id'] . '"' : '';
if ($word_srch_sql == '')
{
$word_srch_sql = "k.word_text IN ('" . implode("', '", $arKeywordsT) . "')";
}
$sql = $oSqlQ->getQ('get-term-exists', TBL_WORDLIST, $arDictParam['tablename'], $id_dict,
$in_term, $word_srch_sql
);
/* Get existent keywords, keep specialchars mode */
if (($is_specialchars) || empty($arKeywordsT))
{
$ar_chars_sql = array('\\' => '\\\\', '\\%' => '\\\\\\\%', '\\_' => '\\\\\\\_', '\\"' => '\\\\\\\"', "\\'" => "\\\\\\\'");
$sql = $oSqlQ->getQ('get-term-exists-spec', $arDictParam['tablename'],
str_replace(array_keys($ar_chars_sql), array_values($ar_chars_sql), gw_addslashes( $str_term_src ))
);
}
$arSql = $oDb->sqlExec($sql);
# prn_r($arSql, __LINE__ . '<br />' . $sql);
$isTermNotMatched = 1; // `No term found' by default
for (; list($arK, $arV) = each($arSql);) // compare founded values (Q) with imported (T)
{
$id_old = $arV['id']; // get ID for existent keywords.
if ($id_old == $qT['id'])
{
$isTermNotMatched = 0;
break;
}
if ($is_specialchars)
{
/* 1 - is the minimum length */
$arKeywordsQ = text2keywords( text_normalize($arV['term']), 1);
}
else
{
/* $arDictParam['min_srch_length'] - is the minimum length */
$arKeywordsQ = text2keywords( text_normalize($arV['term']), $arDictParam['min_srch_length']);
}
# prn_r($arKeywordsQ);
$div1 = sizeof(gw_array_exclude($arKeywordsT, $arKeywordsQ));
$div2 = sizeof(gw_array_exclude($arKeywordsQ, $arKeywordsT));
$isTermNotMatched = ($div1 + $div2);
// if the sum of excluded arrays is 0, this term already exists
if (!$isTermNotMatched) // in english, double negative means positive... yeah
{
break;
}
} // end of for each founded terms
if ($isTermNotMatched > 0)
{
$isQ = 1;
$isTermExist = 0;
}
else
{
$isTermExist = 1;
}
} // !$isTermEmpty
}
/* */
if (!isset($str_term_filtered))
{
$str_term_filtered = gw_text_wildcars($str_term_filtered);
$str_term_filtered = text_normalize($str_term_filtered);
}
/* 21 jan 2006: new `date_created' for new terms */
/* 23 apr 2008: subtract 61 second */
$qT['date_created'] = isset($arPre['date_created']) ? $arPre['date_created'] : $sys['time_now_gmt_unix'];
$qT['date_modified'] = $sys['time_now_gmt_unix'] - 61;
$qT['date_created'] -= 61;
/* 21 jul 2003: Better protection by adding random Next ID number */
$arTermParam['tid'] = $qT['id'] = ($qT['id'] == '') ? mt_rand($id_w, ($sys['leech_factor'] * 2) + $id_w) : $qT['id'];
$qT['term'] = $str_term_src;
/* 15 sep 2007: Term URI */
/* 08 apr 2008: Make link to added term */
/* 11 apr 2008: Better URI */
/* 23 apr 2008: Even better URI. Added transliteration. */
$qT['term_uri'] = $oDom->get_attribute('uri', 'term', $arPre['term'] );
$qT['term_uri'] = ($qT['term_uri'] == '') ? $qT['id'].'-'.$oCase->translit( $oCase->lc($str_term_filtered)) : $qT['term_uri'];
$qT['term_uri'] = $oCase->rm_entity($qT['term_uri']);
$qT['term_uri'] = preg_replace('/[^0-9A-Za-z_-]/', '-', $qT['term_uri']);
$qT['term_uri'] = preg_replace('/-{2,}/', '-', $qT['term_uri']);
if ($qT['term_uri'] == '-')
{
$qT['term_uri'] = $qT['id'].'-';
}
$arTermParam['term_uri'] = $qT['term_uri'];
$qT['defn'] =& $arPre['parameters']['xml'];
/* Alphabetic orders 1,2,3 */
$qT['term_1'] = $oDom->get_attribute('t1', 'term', $arPre['term'] );
$qT['term_2'] = $oDom->get_attribute('t2', 'term', $arPre['term'] );
$qT['term_3'] = $oDom->get_attribute('t3', 'term', $arPre['term'] );
/* -- Custom Alphabetic Toolbar -- */
/* Select custom rules for uppercasing */
$sql = 'SELECT az_value, az_value_lc FROM `'.$sys['tbl_prefix'].'custom_az` WHERE `id_profile` = "'.$arDictParam['id_custom_az'].'"';
$arSqlAz = $oDb->sqlRun($sql, 'st');
for (; list($arK, $arV) = each($arSqlAz);)
{
$str_term_src = str_replace($arV['az_value_lc'], $arV['az_value'], $str_term_src);
}
/* Unicode uppercase */
$str_term_src_uc = $oCase->uc( $str_term_src );
/* 1.8.7: Custom sorting order */
$qT['term_order'] = $oDom->get_attribute('term_order', 'term', $arPre['term'] );
$qT['term_order'] = ($qT['term_order'] == '') ? $str_term_src_uc : $qT['term_order'];
$qT['term_a'] = $qT['term_b'] = $qT['term_c'] = $qT['term_d'] = $qT['term_e'] = $qT['term_f'] = 0;
/* Prepare A, AAZZ, AAAZZZ */
$qT['term_3'] = ($qT['term_3'] == '') ? $oFunc->mb_substr($str_term_filtered, 2, 1, $sys['internal_encoding']) : $qT['term_3'];
$qT['term_2'] = ($qT['term_2'] == '') ? $oFunc->mb_substr($str_term_filtered, 1, 1, $sys['internal_encoding']) : $qT['term_2'];
$qT['term_1'] = ($qT['term_1'] == '') ? $oFunc->mb_substr($str_term_filtered, 0, 1, $sys['internal_encoding']) : $qT['term_1'];
/* */
$ar_field_names = array('a','b','c','d','e','f');
preg_match_all("/./u", $qT['term_order'], $ar_letters);
for (; list($cnt_letter, $letter) = each($ar_letters[0]);)
{
if (isset($ar_field_names[$cnt_letter]))
{
$qT['term_'.$ar_field_names[$cnt_letter]] = text_str2ord($letter);
}
}
/* Fix htmlspecial characters */
$qT['term_3'] = gw_htmlspecialamp(gw_unhtmlspecialamp($qT['term_3']));
$qT['term_2'] = gw_htmlspecialamp(gw_unhtmlspecialamp($qT['term_2']));
$qT['term_1'] = gw_htmlspecialamp(gw_unhtmlspecialamp($qT['term_1']));
/* */
$qT['is_active'] = $oDom->get_attribute('is_active', 'term', $arPre['term']);
$qT['is_complete'] = $oDom->get_attribute('is_complete', 'term', $arPre['term']);
#prn_r($qT, __LINE__.__FILE__);
#exit;
if ($isDelete || $isTermExist)
{
/* Assign Term ID from previously added term */
$arTermParam['tid'] = $id_old;
if ($is_overwrite)
{
$qT['id'] = $id_old;
$isCleanMap = 1;
$isTermExist = 0;
# $queryA[] = $oSqlQ->getQ('del-term_id', $arDictParam['tablename'], $id_old, $id_dict);
}
}
if (!$isDelete && $isTermExist)
{
/* Term already exists */
$ar_matched_terms = array();
for (reset($arSql); list($arK, $arV) = each($arSql);)
{
$ar_matched_terms[] = $oHtml->a($sys['page_admin'].'?'.GW_ACTION.'='.GW_A_EDIT.'&'.GW_TARGET.'='.GW_T_TERMS.'&id='.$id_dict.'&tid=' . $arV['id'],
$arV['term'], '', '', $oL->m('3_edit'));
}
$str_line = implode(' | ', $ar_matched_terms);
$queryA = '<dl style="margin:0">';
$queryA .= '<dt class="xu red">'.$oL->m('reason_25').' - <strong>'. $str_term_src . '</strong></dt>';
$queryA .= '<dd class="termpreview">' .$str_line. '</dd>';
$queryA .= '</dl>';
$isQ = 0;
}
/* Allow query */
if ($isQ)
{
/* Prepare keywords per field */
# $ot = new gw_timer('addterm');
for (reset($arFields); list($fK, $fV) = each($arFields);)
{
// Init
$arKeywords[$fK] = array();
//
# $int_min_length = (isset($fV[2]) && ($fV[2] != 'auto') && ($fV[2] != '')) ? $fV[2] : $arDictParam['min_srch_length'];
# $int_min_length = (!isset($fV[2]) || ($fV[2] == 'auto') ) ? $int_min_length : $fV[2];
//
// Make keywords from array
// space is required, otherwise `...word</defn><defn>word...' will become `wordword'
$tmpStr = '';
if (isset($arPre[$fV[0]]))
{
$tmpStr = $oDom->get_content( $arPre[$fV[0]] );
}
if ($tmpStr != '') // do not parse empty strings
{
// Get maximum search length per field
$int_min_length = $fV[2];
if ( is_string($int_min_length) )
{
$int_min_length = $arDictParam['min_srch_length'];
}
# $isStrip = ($srchLength == 1) ? 0 : 1;
# prn_r( text_normalize( $tmpStr ) . ' ' . $fV[0] . '; len=' . $int_min_length);
/* Fix wildcars, 1.6.1 */
$tmpStr = str_replace('<![CDATA[', '', $tmpStr);
$tmpStr = str_replace(']]>', '', $tmpStr);
$tmpStr = gw_text_wildcars($tmpStr);
/* */
# prn_r( $fV );
$arKeywords[$fK] = text2keywords( gw_text_sql(text_normalize($tmpStr)), $int_min_length, 25, $sys['internal_encoding'] );
/* Remove stopwords from parsed strings only (others are empty) */
$arKeywords[$fK] = gw_array_exclude( $arKeywords[$fK], $arStop);
}
}
/* keywords convertion time */
# prn_r( $arKeywords );
# print $ot->endp(__LINE__, __FILE__);
# exit;
/* Remove double keywords from definition */
for (reset($arFields); list($fK, $fV) = each($arFields);)
{
if ($fK != 0)
{
$arKeywords[0] = gw_array_exclude( $arKeywords[0], $arKeywords[$fK]);
}
}
/** Keywords were prepared */
/** Add keywords to database! */
# prn_r($arStop);
# prn_r($arKeywords);
# prn_r($arPre);
gwAddNewKeywords($id_dict, $qT['id'], $arKeywords, $id_old, $isCleanMap, $qT['date_created']);
$qT['int_bytes'] = strlen($qT['defn']);
/* Checksum */
$qT['crc32u'] = crc32($str_term_src_uc);
/* Add User ID to term */
if ($gw_this['vars'][GW_ACTION] == GW_A_ADD)
{
$qT['id_user'] = $oSess->id_user;
}
/* Add relation `user to term' */
$q2['user_id'] = $oSess->id_user;
$q2['term_id'] = $qT['id'];
$q2['dict_id'] = $id_dict;
// -------------------------------------------------
// Turn on text parsers
// -------------------------------------------------
// Process automatic functions
for (; list($k, $v) = each($gw_this['vars']['funcnames'][GW_A_UPDATE . GW_T_TERM]);)
{
if (function_exists($v))
{
$v();
}
}
/* REPLACE or UPDATE */
if ($isDelete || $isTermExist)
{
if ($is_overwrite)
{
unset($qT['id']);
$queryA[] = gw_sql_update($qT, $arDictParam['tablename'], 'id = "'.$id_old.'"');
}
}
else
{
$id_old = $qT['id'];
$queryA[] = gw_sql_insert($qT, $arDictParam['tablename'], 1);
}
/* 23 Nov 2007: history of changes */
$qT['id_term'] = $id_old;
$qT['id_dict'] = $arDictParam['id'];
$qT['id_user'] = $oSess->id_user;
$qT['keywords'] = serialize($arKeywords);
unset($qT['id']);
$queryA[] = gw_sql_insert($qT, $sys['tbl_prefix'].'history_terms', 1);
/* Assign edited term to user */
$queryA[] = gw_sql_replace($q2, TBL_MAP_USER_TERM, 1);
/* Check table to keep indexes */
$arQuery[] = 'CHECK TABLE `'.$arDictParam['tablename'].'`';
} /* is_query allowed */
return $queryA;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function addNewSYTerm()\n\t{\n require 'b_ConnectionString.php';\n\n\t\t$capturedSchoolYearData = $_POST['sendSchoolYearData'];\n\t\tfor ($counter = 1 ; $counter <= 4 ; $counter++)\n\t\t{\n\t\t\t$query = \n\t\t\t\t\"INSERT INTO syterms (schoolYear, termNumber, isActive) \n\t\t\t\tVALUES ('$capturedSchoolYearData', '\" . $counter . \"', '0');\";\n\n\t\t\tmysqli_query($mySQL_ConStr, $query);\n\t\t}\n\n\t\tautoSetActiveSYTerm();\n\t}",
"public function update(Request $request, Term $term)\n {\n //\n }",
"public function update(Request $request, Term $term)\n {\n //\n }",
"public function store(TermRequest $request)\n {\n $data = Term::create($request->only('no_of_months','is_daily'));\n return response()->json(['message'=>'Saved','data'=>$data],200);\n }",
"function parseterm($term){\n\t$insertstring = \"INSERT INTO AcademicQuarters (AcademicQuarterID, Name, Year) VALUES('\".$term.\"'\";\n\tif (substr($term, 2 , 1)==1){\n\t\t$temp = (int)substr($term,0 ,2)-1;\n\t\tif ($temp < 10)\n\t\t\t$temp = '0'.(string)$temp;\n\t\telse\n\t\t\t$temp = (string)$temp;\n\t\t$insertstring = $insertstring.\",'Fall','20\".$temp.\"');\";\n\t}\n\tif (substr($term, 2 , 1)==2)\n\t\t$insertstring = $insertstring.\",'Winter','20\". (int)substr($term,0 ,2).\"');\";\n\tif (substr($term, 2 , 1)==3)\n\t\t$insertstring = $insertstring.\",'Spring','20\". (int)substr($term,0 ,2).\"');\";\n\tif (substr($term, 2 , 1)==4)\n\t\t$insertstring = $insertstring.\",'Winter','20\". (int)substr($term,0 ,2).\"');\";\n\n\treturn $insertstring;\n}",
"function updateSYTerm()\n\t{\n\n require 'b_ConnectionString.php';\n\n\t\t$capturedIsActiveData = $_POST['sendIsActiveData'];\n\t\t$capturedSYTermIDData = $_POST['sendSYTermIDData'];\n\n\t\t$query = \"UPDATE syterms \n\t\t\tSET isActive = '$capturedIsActiveData'\n\t\t\tWHERE syTermID = '$capturedSYTermIDData'\";\n\n\t\tmysqli_query($mySQL_ConStr, $query);\n\t\t\n\t\tif ($capturedIsActiveData == '1')\n\t\t{\n\t\t\t$query = \"UPDATE syterms \n\t\t\t\tSET isActive = '0'\n\t\t\t\tWHERE\n\t\t\t\tsyTermID != '$capturedSYTermIDData'\";\n\n\n\t\t\tmysqli_query($mySQL_ConStr, $query);\n\t\t}\n\n //autoSetActiveSYTerm();\n\t}",
"public function update(TermRequest $request, $id)\n {\n Term::where('id',$id)->update($request->only('no_of_months'));\n return response()->json(['message'=>'Saved'],200);\n }",
"private function initSearchTerm() {\n\t\t$q = 'SELECT count(*) FROM twitterSearch WHERE searchTerm = \"' .$this->_searchString .'\"';\n\t\tif ($this->_testMode) {print \"(init) created a row, q = \" .$q .\"<br> \";}\n\t\t$r = mysql_query($q, CONN) or die('could not select the number of rows for the search term in initting');\n\t\t$arr = mysql_fetch_array($r);\n\t\t$numRows = $arr['count(*)'];\n\t\t\n\t\tif ($numRows == 0) {\n\t\t\t$q = 'INSERT INTO twitterSearch (searchTerm) VALUES (\"' .$this->_searchString .'\")';\n\t\t\t$r = mysql_query($q, CONN) or die('could not create the new row for the search term in init()');\n\t\t\tif ($this->_testMode) {print \"(init) created a row, q = \" .$q .\"<br> \";}\n\t\t}\n\t\telse {\n\t\t\tif ($this->_testMode) {print \"(init) no need to create a row<br>\";}\n\t\t}\n\t}",
"function term_handler( $term_id, $tt_id=null ) {\n\t\t$this->add_ping( 'db', array( 'term' => $term_id ) );\n\t\tif ( $tt_id )\n\t\t\t$this->term_taxonomy_handler( $tt_id );\n\t}",
"function autoSetActiveSYTerm()\n\t{\n require 'b_ConnectionString.php';\n\n\t\t$activeTermArray = array();\n $query = \"SELECT * from syterms WHERE isActive = 1;\";\n $tableQuery = mysqli_query($mySQL_ConStr, $query); \n\n $activeTermArray = mysqli_fetch_assoc($tableQuery);\n\n\n\t\tif (sizeof($activeTermArray) != 1)\n\t\t{\n\t\t\t$query = \n\t\t\t\t\"SELECT * FROM syterms \n \t\tORDER BY schoolYear ASC , termNumber ASC LIMIT 0, 1;\";\n\t\t\t$tableQuery = mysqli_query($mySQL_ConStr, $query); \n\n\t\t\twhile($getRow = mysqli_fetch_assoc($tableQuery))\n\t\t\t{\n\t\t\t\t$selectedSYTerm = $getRow['syTermID'];\n\t\t\t}\n\n\t\t $query = \n\t\t \"UPDATE syterms SET isActive = '1' \n\t WHERE syTermID = $selectedSYTerm;\";\n\t \tmysqli_query($mySQL_ConStr, $query);\n\t\t \n\t \t$query = \n\t \t\"UPDATE syterms SET isActive = '0' \n\t WHERE syTermID != $selectedSYTerm;\";\n\t\t mysqli_query($mySQL_ConStr, $query);\n\t }\n \t\n\t}",
"public function update(UpdateTerm $request, Term $term)\n {\n $this->authorize('update', $term);\n foreach ($term->fillable as $key => $value) {\n if($request->has($value)){\n $term->$value = $request->input($value);\n }\n if($request->hasFile($value)){\n $file = $request->file($value);\n $file_name = time().'.'.$file->extension();\n $file->move(public_path('upload'),$file_name);\n $term->$value = $file_name;\n }\n }\n //json orther\n $input = $request->except(array_merge(['_token','_method'],$term->fillable));\n $orther = [];\n foreach ($input as $key => $value) {\n if($request->has($key)){\n $orther[$key] = $request->input($key);\n }\n if($request->hasFile($key)){\n $file = $request->file($key);\n $file_name = time().'.'.$file->extension();\n $file->move(public_path('upload'),$file_name);\n $orther[$key] = $file_name;\n }\n }\n $term->orther = json_encode($orther);\n // alias\n $term->alias = str_slug($term->name,'-');\n // save\n $term->save();\n // notifi\n Session::flash('success','Sửa thành công :v');\n return redirect('terms/'.$term->id.'/edit');\n }",
"function _update_generic_term_count($terms, $taxonomy)\n {\n }",
"function coursesStop($stop, $termStoped)\n{\n\tglobal $con;\n\t\t$updateSQL = sprintf(\"UPDATE courses SET status=%s WHERE status=1 AND term<%s\",\n\t\t\t$stop,\n\t\t\t$termStoped);\n \n $Result1 = mysqli_query($con, $updateSQL) or die(mysqli_error($con));\n}",
"function bindTerm($STATEMENT_ID,$termWeWant,$fieldWeAreChanging){\n return oci_bind_by_name($STATEMENT_ID,$termWeWant,$fieldWeAreChanging);\n }",
"function setTermStatus($term){\n $termClass = new DatabaseTable('terms');\n $termNew = [\n 'tid'=>$term['tid'],\n 'tmid'=>$term['tmid'],\n 'tname'=>$term['tname'],\n 'tsdate'=>$term['tsdate'],\n 'tedate'=>$term['tedate'],\n 'tstatus'=>checkDateStatus($term['tsdate'], $term['tedate'])\n ];\n $termClass->update($termNew, 'tid');\n $term = $termClass->find('tid', $term['tid']);\n $term = $term->fetch();\n return $term;\n }",
"public function updateSearchTerms($input)\n\t{\n\t\t$twitter_search = Setting::where('key', 'twitter_search')->firstOrFail();\n\t\t$twitter_search->value = $input['twitter_search'];\n\t\t$twitter_search->save();\n\n\t\t$instagram_search = Setting::where('key', 'instagram_search')->firstOrFail();\n\t\t$instagram_search->value = $input['instagram_search'];\n\t\t$instagram_search->save();\t\t\n\t}",
"function action_rest_insert_quotes( $post, $request, $true ) {\n $params = $request->get_json_params();\n if(array_key_exists(\"terms\", $params)) {\n foreach($params[\"terms\"] as $taxonomy => $terms) {\n wp_set_post_terms($post->ID, $terms, $taxonomy);\n }\n }\n}",
"public function edit(Term $term)\n {\n //\n }",
"public function edit(Term $term)\n {\n //\n }",
"public function addTerm( $terms, $args = array() )\n\t{\n\t\t$terms = (array) $terms;\n\n\t\tforeach ($terms as $name => $alias) {\n\n\t\t\tif (is_numeric( $name )) {\n\t\t\t\t$this->table[] = new DQueryClauseTableSimple( $alias, null, $args );\n\t\t\t} else {\n\t\t\t\t$this->table[] = new DQueryClauseTableSimple( $name, $alias, $args );\n\t\t\t}\n\n\t\t}\n\n\t\treturn $this;\n\t}",
"function addSemanticFieldToWord($wordID, $semanticFieldID){\r\nif(numQueryResults(\"SELECT * FROM word_semanticfield WHERE wordID = \". $wordID . \" AND semanticFieldID = \" . $semanticFieldID) > 0){\r\n\t//our work is done here; don't perform the rest of the function\r\n\treturn;\r\n}\r\n//Assign a semantic field to apply to a particular word, given their IDs\r\n$wordSemanticFieldInsertionQuery = \"INSERT INTO word_semanticfield(wordID, semanticFieldID) VALUES(\" . \r\n\tmysql_real_escape_string($wordID) . \", \" . \r\n\tmysql_real_escape_string($semanticFieldID) . \")\";\r\n\tif(!$wordSemanticFieldInsertionResult = mysql_query($wordSemanticFieldInsertionQuery)){echo ('Query failed: ' . mysql_error()) . \"QUERY TEXT: \" . $wordSemanticFieldInsertionQuery; mysql_query(\"ROLLBACK\"); die();}\r\n}",
"public function store(Request $request)\n {\n $this->validateTerm($request);\n $data = $request->all();\n DB::beginTransaction();\n try{\n $term = Term::create([\n 'term_title' => $data['term_title'],\n 'term_slug' => isset($data['term_slug']) ? $data['term_slug'] : null,\n ]);\n TermTaxonomy::create([\n 'term_id' => $term->id,\n 'term_taxonomy' => isset($data['term_taxonomy']) ? $data['term_taxonomy'] : 'category',\n 'term_taxonomy_parent' => $data['term_taxonomy_parent'],\n ]);\n DB::commit();\n }catch (\\Exception $e) {\n DB::rollBack();\n }\n return redirect()->route('admin.term.index');\n }",
"public function editTerm($term_name, $term_id){\n\t\t\t$query = $this->connection()->prepare(\"UPDATE termz SET name='$term_name' WHERE id='$term_id'\");\n\t\t $query->execute();\n\t\t return true;\n\t\t}",
"public function store(StoreTerm $request)\n {\n $term = new Term;\n $term->user_id = Auth::id();\n foreach ($term->fillable as $key => $value) {\n if($request->has($value)){\n $term->$value = $request->input($value);\n }\n if($request->hasFile($value)){\n $file = $request->file($value);\n $file_name = time().'.'.$file->extension();\n $file->move(public_path('upload'),$file_name);\n $term->$value = $file_name;\n }\n }\n //json orther\n $input = $request->except(array_merge(['_token','_method'],$term->fillable));\n $orther = [];\n foreach ($input as $key => $value) {\n if($request->has($key)){\n $orther[$key] = $request->input($key);\n }\n if($request->hasFile($key)){\n $file = $request->file($key);\n $file_name = time().'.'.$file->extension();\n $file->move(public_path('upload'),$file_name);\n $orther[$key] = $file_name;\n }\n }\n $term->orther = json_encode($orther);\n // alias\n $term->alias = str_slug($term->name,'-');\n // save\n $term->save();\n // notifi\n Session::flash('success','Lưu thành công :v');\n return redirect('terms/'.$term->id.'/edit');\n }",
"function TerminStop($stop, $datenow)\n{\n\tglobal $con;\n\t\t$updateSQL = sprintf(\"UPDATE term SET status=%s WHERE status=1 AND term_stop<%s\",\n\t\t\t$stop,\n\t\t\t$datenow);\n \n $Result1 = mysqli_query($con, $updateSQL) or die(mysqli_error($con));\n}",
"function _update_post_term_count($terms, $taxonomy)\n {\n }",
"public function set_query($term = '') {\n if (!empty($term)) {\n $this->term = $term;\n }\n\n if (empty($this->term)) {\n $this->validquery = false;\n } else {\n $this->validquery = true;\n }\n\n if ($this->validquery and $this->validindex) {\n $this->results = $this->get_results();\n } else {\n $this->results = array();\n }\n }",
"function urlFun($conn, $sale_id, $quantity, $isbn) {\n\t\t\t\t\t\t\t\t$quantity_query = \"UPDATE SALE\n\t\t\t\t\t\t\t\t\t\tSET quantity='$quantity'\n\t\t\t\t\t\t\t\t\t\tWHERE sale_id='$sale_id' AND ISBN='$isbn';\";\n\t\t\t\t\t\t\t\tmysqli_query($conn, $quantity_query);\n\t\t\t\t\t\t\t}",
"function term_get($term_key)\n{\n $query = \"SELECT * FROM term WHERE term_key={$term_key}\";\n $result = mysql_query($query);\n while (@$row = mysql_fetch_array($result, MYSQL_ASSOC))\n {\n $results[] = $row;\n }\n return $results;\n}",
"public function modifyQuery($query, SearchTerm $search);",
"public function editDefinition()\r\n{\r\n $query_string = \"UPDATE glossary \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"word = :word, \";\r\n $query_string .= \"worddefinition = :worddefinition \";\r\n $query_string .= \"WHERE wordid = :wordid\";\r\n\r\n return $query_string;\r\n}",
"function add_number_to_formula($number){\n global $conn;\n //GET calculator from the id where the id is the same as the users id\n $query = \"UPDATE `calculators` SET `string`= `string` * 10 + \".$number.\" WHERE id = \".$_SESSION['id'].\";\";\n //prep&execute\n //prep\n $statement = $conn->prepare($query);\n $statement->execute();\n}",
"function addQuery() {}",
"private function Sql($term) {\r\n $query = trim($term);\r\n $query = trim(preg_replace(\"/(\\\\s+)+/\", \" \", $query));\r\n $keywords = array_unique(explode(' ', $query));\r\n\r\n // Array containing a list of all field names\r\n $all = array();\r\n // Get a full list of field names\r\n foreach($this->config as $item) {\r\n $all = array_merge($all, array_keys($item['select']));\r\n }\r\n $all = array_unique($all);\r\n // Generate the SQL\r\n $unions = array();\r\n $params = array();\r\n foreach($this->config as $table => $item) {\r\n $selects = array('? AS `__table`');\r\n $params[] = $table;\r\n $ifs = array();\r\n // Select clause\r\n foreach($all as $fieldName) {\r\n if (!array_key_exists($fieldName, $item['select'])) {\r\n $selects[] = sprintf('NULL AS `%s`', $fieldName);\r\n continue;\r\n } elseif (empty($item['select'][$fieldName]['subquery'])) {\r\n $selects[] = sprintf('`%s`', $fieldName);\r\n } else {\r\n $selects[] = sprintf('(%s) AS `%s`', $item['select'][$fieldName]['subquery'], $fieldName);\r\n $params = array_merge($params, $item['select'][$fieldName]['params']);\r\n }\r\n }\r\n foreach($all as $fieldName) {\r\n // Search score\r\n if (!array_key_exists($fieldName, $item['index'])) continue;\r\n if (empty($item['select'][$fieldName]['subquery'])) {\r\n // Exact match\r\n $ifs[] = \"IF(LOWER(`{$fieldName}`) = LOWER(?), ?, 0)\";\r\n $params[] = $query;\r\n $params[] = $item['index'][$fieldName]['exactWeight'];\r\n // Matching full occurrences\r\n if (count($keywords) > 1) {\r\n $ifs[] = \"IF(LOWER(`{$fieldName}`) LIKE LOWER(?), ROUND((LENGTH(`{$fieldName}`) - LENGTH(REPLACE(LOWER(`{$fieldName}`), LOWER(?), ''))) / LENGTH(?)) * ?, 0)\";\r\n $params[] = '%' . $query . '%';\r\n $params[] = $query;\r\n $params[] = $query;\r\n $params[] = $item['index'][$fieldName]['fullWeight'];\r\n }\r\n // Matching keywords\r\n foreach($keywords as $kw) {\r\n if (strlen($kw) < $this->minWordLength) continue;\r\n $ifs[] = \"IF(LOWER(`{$fieldName}`) LIKE LOWER(?), ROUND((LENGTH(`{$fieldName}`) - LENGTH(REPLACE(LOWER(`{$fieldName}`), LOWER(?), ''))) / LENGTH(?)) * ?, 0)\";\r\n $params[] = '%' . $kw . '%';\r\n $params[] = $kw;\r\n $params[] = $kw;\r\n $params[] = $item['index'][$fieldName]['wordWeight'];\r\n }\r\n } else {\r\n // Exact match\r\n $subquery = sprintf('(%s)', $item['select'][$fieldName]['subquery']);\r\n $subparams = $item['select'][$fieldName]['params'];\r\n $ifs[] = \"IF(LOWER({$subquery}) = LOWER(?), ?, 0)\";\r\n $params = array_merge($params, $subparams);\r\n $params[] = $query;\r\n $params[] = $item['index'][$fieldName]['exactWeight'];\r\n // Matching full occurrences\r\n if (count($keywords) > 1) {\r\n $ifs[] = \"IF(LOWER({$subquery}) LIKE LOWER(?), ROUND((LENGTH({$subquery}) - LENGTH(REPLACE(LOWER({$subquery}), LOWER(?), ''))) / LENGTH(?)) * ?, 0)\";\r\n $params = array_merge($params, $subparams);\r\n $params[] = '%' . $query . '%';\r\n $params = array_merge($params, $subparams);\r\n $params = array_merge($params, $subparams);\r\n $params[] = $query;\r\n $params[] = $query;\r\n $params[] = $item['index'][$fieldName]['fullWeight'];\r\n }\r\n // Matching keywords\r\n foreach($keywords as $kw) {\r\n if (strlen($kw) < $this->minWordLength) continue;\r\n $ifs[] = \"IF(LOWER({$subquery}) LIKE LOWER(?), ROUND((LENGTH({$subquery}) - LENGTH(REPLACE(LOWER({$subquery}), LOWER(?), ''))) / LENGTH(?)) * ?, 0)\";\r\n $params = array_merge($params, $subparams);\r\n $params[] = '%' . $kw . '%';\r\n $params = array_merge($params, $subparams);\r\n $params = array_merge($params, $subparams);\r\n $params[] = $kw;\r\n $params[] = $kw;\r\n $params[] = $item['index'][$fieldName]['wordWeight'];\r\n }\r\n }\r\n }\r\n $unions[] = sprintf('SELECT %s, %s AS `__score` FROM `%s`', implode(', ', $selects), (empty($ifs) ? '0' : implode(' + ', $ifs)), $table);\r\n }\r\n $this->sql[$term] = implode(' UNION ', $unions);\r\n $this->params = $params;\r\n }",
"function gwAddNewKeywords($id_dict, $id_term, $arKeywords, $termIdOld, $isClean, $date_created)\r\n{\r\n\tglobal $arFields, $intFields, $arStop, $sys;\r\n\tglobal $oDb, $oSqlQ;\r\n#\t@header(\"content-type: text/html; charset=utf-8\");\r\n\r\n\t// Adding search keywords\r\n\t$arKeywordsJoin = array();\r\n\tfor (reset($arKeywords); list($k, $v) = each($arKeywords);)\r\n\t{\r\n\t\t$arKeywordsJoin = array_merge($arKeywordsJoin, $v); // common array with all keywords\r\n\t}\r\n\t// unique keywords only, have to run second time\r\n\t$arKeywordsJoin = array_flip($arKeywordsJoin);\r\n\r\n\t$arQuery = array();\r\n\t$arSql = array();\r\n\tif (!empty($arKeywordsJoin))\r\n\t{\r\n\t\t$word_text_sql = \"'\" . implode(\"', '\", array_keys($arKeywordsJoin)) . \"'\";\r\n\t\t/* Get the list of already known keywords and their IDs */\r\n\t\t$arSql = $oDb->sqlExec($oSqlQ->getQ('get-word', TBL_WORDLIST, $word_text_sql));\r\n\t}\r\n# prn_r($arSql);\r\n\t$q2 = $q1 = array();\r\n\tif (!empty($arSql)) // some keywords are exist already\r\n\t{\r\n\t\t$cnt = 0;\r\n\t\t// for each founded keyword\r\n\t\tfor (; list($arK, $arV) = each($arSql);)\r\n\t\t{\r\n\t\t\tif ($isClean) // overwrite mode\r\n\t\t\t{\r\n\t\t\t\t$arQuery[0] = $oSqlQ->getQ('del-wordmap-by-term-dict', $termIdOld, $id_dict);\r\n\t\t\t}\r\n\t\t\t$q2['word_id'] = $arV['word_id'];\r\n\t\t\t$q2['term_id'] = $id_term;\r\n\t\t\t$q2['dict_id'] = $id_dict;\r\n\t\t\t$q2['date_created'] = $date_created;\r\n\t\t\t// Set Field ID\r\n\t\t\tfor (reset($arFields); list($id_field, $fV) = each($arFields);)\r\n\t\t\t{\r\n\t\t\t\tif (isset($arKeywords[$id_field]) && in_array($arV['word_text'], $arKeywords[$id_field]))\r\n\t\t\t\t{\r\n\t\t\t\t\t$q2['term_match'] = $id_field;\r\n\t\t\t\t\t$arQueryMapExist[] = gw_sql_insert($q2, TBL_WORDMAP, 1, $cnt);\r\n\t\t\t\t\tunset($arKeywordsJoin[$arV['word_text']]); // remove existent keyword\r\n\t\t\t\t\t$cnt++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n\t//\r\n\t// Add new kewords\r\n# prn_r($arKeywordsJoin);\r\n# prn_r($arKeywords);\r\n\t//\r\n\t$q2 = $q1 = array();\r\n\t$q1['word_id'] = $q2['word_id'] = ($oDb->MaxId(TBL_WORDLIST, 'word_id') - 1);\r\n\t$cnt = $cntMap = 0;\r\n\t// for each new keyword\r\n\tfor (reset($arKeywordsJoin); list($newkeyword, $v2) = each($arKeywordsJoin);)\r\n\t{\r\n\t\t$q2['word_id']++;\r\n\t\t$q2['dict_id'] = $id_dict;\r\n\t\t$q2['term_id'] = $id_term;\r\n\t\t$q2['date_created'] = $date_created;\r\n\t\t$q1['word_id']++;\r\n\t\t$q1['word_text'] = '';\r\n\t\t//\r\n\t\t// Set index ID per field\r\n\t\tfor (reset($arFields); list($id_field, $fV) = each($arFields);)\r\n\t\t{\r\n\t\t\tif (isset($arKeywords[$id_field]) && in_array($newkeyword, $arKeywords[$id_field]))\r\n\t\t\t{\r\n\t\t\t\t$q2['term_match'] = $id_field;\r\n\t\t\t\t$q1['word_text'] = $newkeyword;\r\n\t\t\t\t// add keyword into map\r\n\t\t\t\t$arQueryMap[] = gw_sql_insert($q2, TBL_WORDMAP, 1, $cntMap);\r\n\t\t\t\tunset($arKeywordsJoin[$newkeyword]); // remove new keyword\r\n\t\t\t\t$cntMap++;\r\n\t\t\t}\r\n\t\t}\r\n\t\t// add new word into wordlist\r\n\t\tif ($q1['word_text'] != '')\r\n\t\t{\r\n\t\t\t$arQueryWord[] = gw_sql_insert($q1, TBL_WORDLIST, 1, $cnt);\r\n\t\t\t$cnt++;\r\n\t\t}\r\n\t}\r\n\t/* Queries for existent keywords */\r\n\tif (isset($arQueryMapExist)) { $arQuery[] = implode('', $arQueryMapExist); }\r\n\t/* Queries for new keywords */\r\n\tif (isset($arQueryWord)) { $arQuery[] = implode('', $arQueryWord); }\r\n\t/* Queries for new keywords map */\r\n\tif (isset($arQueryMap)) { $arQuery[] = implode('', $arQueryMap); }\r\n\t/* Displays queries */\r\n\tif ($sys['isDebugQ'])\r\n\t{\r\n\t\t$arQuery = gw_highlight_sql($arQuery);\r\n\t\tprint '<ul class=\"gwsql\"><li>'.implode(';</li><li>', $arQuery).';</li></ul>';\r\n\t}\r\n\telse\r\n\t{\r\n\t\tfor (; list($kq, $vq) = each($arQuery);)\r\n\t\t{\r\n\t\t\tif (!$oDb->sqlExec($vq))\r\n\t\t\t{\r\n\t\t\t\tprint '<li class=\"xt\">Error: cannot exec query: '.$arQuery[$i].';</li>';\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}",
"function terminCaducado($statusTerm)\n{\n\tglobal $con;\n\t\n\t$query_ConsultaFuncion = sprintf(\"SELECT * FROM term WHERE status = %s ORDER BY id_term ASC \",\n\t\t GetSQLValueString($statusTerm, \"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\tif ($totalRows_ConsultaFuncion!=0) \n\t\treturn false;\n\telse return true;\t\n\t\n\tmysqli_free_result($ConsultaFuncion);\n}",
"public function actionManageCurrentTerm()\n {\n $message = null;\n if (isset($_POST['term'])) {\n Yii::app()->session['current_term'] = $_POST['term'];\n // echo ' Yii app session:' . Yii::app()->session['current_term'];\n $current_term = Yii::app()->session['current_term'];\n $message = \"$current_term has been selected\";\n }\n\n $term = Term::model()->getLatest();\n // echo ' Yii app session:' . Yii::app()->session['current_term'];\n // echo ' latest term id:' . $term->id;\n $this->render('manageCurrentTerm', array('term' => $term->id, 'message' => $message));\n }",
"protected function _AddQueryTerm ( QueryTerm $query_term )\r\n\t{\r\n\t\t$this->_qts[$query_term->ToHash ()] = $query_term;\r\n\t}",
"function retrieveSYTerm()\n\t{\n require 'b_ConnectionString.php';\n\n\t\t$capturedSYTermID = $_POST['sendSYTermID'];\n\n\t\t$query = \n\t\t\"SELECT * FROM syterms \n \tWHERE syTermID = '$capturedSYTermID'\";\n\n\t\t$result = mysqli_query($mySQL_ConStr, $query);\n\t\t$returnValue = mysqli_fetch_array($result);\n\n\t\techo json_encode($returnValue);\n\t}",
"function termsOfUse($args = array(), &$request) {\n $journal =& $request->getJournal();\n $dataversePlugin =& PluginRegistry::getPlugin('generic', DATAVERSE_PLUGIN_NAME);\n $templateMgr =& TemplateManager::getManager();\n \n if ($dataversePlugin->getSetting($journal->getId(), 'fetchTermsOfUse')) {\n // Try fetching terms of use from DV. If not available, use DV terms cached on last fetch\n $termsOfUse = $dataversePlugin->getTermsOfUse();\n $templateMgr->assign('termsOfUse', $termsOfUse ? $termsOfUse : $this->getSetting($journal->getId(), 'dvTermsOfUse'));\n }\n else {\n // Get terms of use configured by JM\n $templateMgr->assign('termsOfUse', $dataversePlugin->getSetting($journal->getId(), 'termsOfUse'));\n }\n\t\t$templateMgr->display($dataversePlugin->getTemplatePath() .'/termsOfUse.tpl');\n }",
"public function addTerm($name, $admin_id){\n\t\t\t$sql = \"INSERT INTO termz (id, name, admin_id, created_at) VALUES (NULL, '$name', '$admin_id', NULL)\";\n\t\t\t$this->connection()->exec($sql);\n\t\t\treturn true;\n\t\t}",
"function wp_update_term_count($terms, $taxonomy, $do_deferred = \\false)\n {\n }",
"public function addDefinition()\r\n{\r\n $query_string = \"INSERT INTO glossary \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"word = :word, \";\r\n $query_string .= \"worddefinition = :worddefinition\";\r\n\r\n return $query_string;\r\n}",
"function ras_submit_db () {\n\n\t\textract(doSlash(psa(array('poll_id', 'name', 'prompt', 'n0', 'n1', 'n2', 'n3', 'n4', 'n5', 'n6', 'n7', 'n8', 'n9' ,'step', 'event', 'selection'))));\n\t\t$where = \"id='\".$poll_id.\"'\";\n\t\t\n\t\tif($step == 'poll_response') {\n\t\t\t$stat = 'r'.substr($selection, -1);\n\t\t\t\t$current = safe_field( $stat ,'txp_poll' , $where);\n\t\t\t\t\t$newstat = $current + 1;\n\t\t\t\t\t$what = $stat.'='.$newstat;\n\t\t\t\tsafe_update('txp_poll', $what ,$where);\n\t\t}\n}",
"function wp_update_term_count_now($terms, $taxonomy)\n {\n }",
"function queryword()\n\t{\n\t\t$sql=\"select id_word, frequency, word from $this->lang_frequency where word >= '$this->word' LIMIT 1\";\n\t\t$fs = mysql_query($sql,$this->db);\n\t\t$rs=mysql_fetch_row($fs);\n\t\t//dumpa ($rs);\n\t\t$err=mysql_error($this->db);\n\t\tif ($err)\n\t\t{\n\t\t\techo \"<br>$sql <br> $err<hr>\";\n\t\t}\n\n\t\t$id=$rs[0];\n\t\t$feq=$rs[1];\n\t\t//echo \"<span>$word con id = $id e freq di $feq<br>$sql<br></span>\";\n\t\tif ($id<=25)\n\t\t{\n\t\t $idn=0;\n\t\t $pos=$id-1;\n\t\t}\n\t\telse\n\t\t{\n\t\t $idn=$id-26;\n\t\t $pos=25;\n\t\t}\n\t\t$this->wordfreq=$feq;\n\t\t$this->id=$id;\n\t\t$this->idn=$idn;\n\t\t$this->pos=$pos;\n\t\t$this->wordfound=$rs[2];\n\t}",
"public function store(TermRequest $request)\n {\n $term = new Term($request->only('name', 'slug', 'taxonomy'));\n $term->save();\n\n return $this->created($term);\n }",
"function db_increase_name_num($name, $sex, $db)\n{ \n //echo \"Inside db_increase_name_num. \";\n if($sex == \"M\") //Updates the num of a name from the database's boy site's table if a name M was passed.\n {\n $updateNum = 'UPDATE `SITE_BABYNAMES_BOY`' . PHP_EOL \n . ' SET num=`num`+1 '. PHP_EOL \n . ' WHERE name=\\''.$name.'\\';'; \n $db->query($updateNum); \n }\n else //Updates the num of a name from the database's girl site's table if a name F was passed.\n {\n $updateNum = 'UPDATE `SITE_BABYNAMES_GIRL`' . PHP_EOL \n . ' SET num=`num`+1 '. PHP_EOL \n . ' WHERE name=\\''.$name.'\\';'; \n $db->query($updateNum); \n } \n}",
"public function SQO_Title_CatNums(fcSQL_Terms $qTerms=NULL) {\n\t$sroTitle = $this->SQO_Source('t');\n\t$sroDept = new fcSQL_TableSource($this->DepartmentTable()->TableName(),'d');\n\t$sroSupp = new fcSQL_TableSource($this->SupplierTable()->TableName(),'s');\n\t$arJT = array(\n\t new fcSQL_JoinElement($sroTitle),\n\t new fcSQL_JoinElement($sroDept,'t.ID_Dept=d.ID'),\n\t new fcSQL_JoinElement($sroSupp,'t.ID_Supp=s.ID')\n\t );\n \t$qJoin = new fcSQL_JoinSource($arJT);\n\t$qjSel = new fcSQL_Select($qJoin);\n\t$qf = $qjSel->Fields();\n\t$qf->SetFields($this->Fields_all_forCompile_array());\n\t$oq = new fcSQL_Query($qjSel,$qTerms);\n\treturn $oq;\n }",
"function removeSYTerm()\n\t{\n \trequire 'b_ConnectionString.php';\n\n\t\t$captured_SchoolYear = $_POST['sendSchoolYear'];\n\n\t\t$query = \n\t\t\"DELETE from syterms \n \tWHERE schoolYear = $captured_SchoolYear\";\n\t\tmysqli_query($mySQL_ConStr, $query);\n\n\n\t $query = \n\t \t\"SELECT 1 AS 'exists' FROM syterms \n\t \tWHERE isActive = 1 LIMIT 1\";\n\t $result = mysqli_query($mySQL_ConStr, $query);\n\t $returnValue = mysqli_fetch_array($result);\n\n\t autoSetActiveSYTerm();\n\n\t echo json_encode($returnValue);\n\t}",
"function add_student_availability($term, $day, $hour, $type) {\n //this assumes that the primary key is being insterted automatically using a counter\n $query = 'INSERT into student_avail(term_id, weekday, hour, type) VALUES($1,$2,$3,$4)';\n\n return pg_query_params($CONNECTION, $query, array($term, $day, $hour, $type));\n }",
"function statusInsc($statusInsc, $termSt)\n{\n\tglobal $con;\n\t\n\t$query_ConsultaFuncion = sprintf(\"SELECT * FROM inscriptions WHERE id_student = %s AND term = %s\",\n\t\t\t\t\t\t\t\t\t\tGetSQLValueString($statusInsc, \"int\"),\n\t\t\t\t\t\t\t\t\t\tGetSQLValueString($termSt, \"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[\"status\"];\t\n\t\n\tmysqli_free_result($ConsultaFuncion);\n}",
"function ObtenerNombreTermin($nombreTermin)\n{\n\tglobal $con;\n\t\n\t$query_ConsultaFuncion = sprintf(\"SELECT term_name FROM term WHERE id_term = %s \",\n\t\t \t\t\t\t\t\t\t\tGetSQLValueString($nombreTermin, \"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[\"term_name\"];\t\n\t\n\tmysqli_free_result($ConsultaFuncion);\n}",
"public function saveTermAndConditions(Request $request)\n {\n $data = [\n \"tags\" => implode(\", \", array_column(request()->tags, 'text')),\n \"type\" => self::TERMS_AND_CONDITIONS,\n self::TITLE => \"Terms and condtions\",\n self::DESCRIPTION => $request->description,\n ];\n Page::updateOrCreate(['id' => request()->editId], $data);\n return [self::STATUS => true, self::MESSAGE => 'Term and condition is added successfully'];\n }",
"protected function _prepare_term($term)\n {\n }",
"function process_terms() {\n\t\t$this->terms = apply_filters( 'wp_import_terms', $this->terms );\n\n\t\tif ( empty( $this->terms ) )\n\t\t\treturn;\n\n\t\tforeach ( $this->terms as $term ) {\n\t\t\t// if the term already exists in the correct taxonomy leave it alone\n\t\t\t$term_id = term_exists( $term['slug'], $term['term_taxonomy'] );\n\t\t\tif ( $term_id ) {\n\t\t\t\tif ( is_array($term_id) ) $term_id = $term_id['term_id'];\n\t\t\t\tif ( isset($term['term_id']) )\n\t\t\t\t\t$this->processed_terms[intval($term['term_id'])] = (int) $term_id;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tif ( empty( $term['term_parent'] ) ) {\n\t\t\t\t$parent = 0;\n\t\t\t} else {\n\t\t\t\t$parent = term_exists( $term['term_parent'], $term['term_taxonomy'] );\n\t\t\t\tif ( is_array( $parent ) ) $parent = $parent['term_id'];\n\t\t\t}\n\t\t\t$description = isset( $term['term_description'] ) ? $term['term_description'] : '';\n\t\t\t$termarr = array( 'slug' => $term['slug'], 'description' => $description, 'parent' => intval($parent) );\n\n\t\t\t$id = wp_insert_term( $term['term_name'], $term['term_taxonomy'], $termarr );\n\t\t\tif ( ! is_wp_error( $id ) ) {\n\t\t\t\tif ( isset($term['term_id']) )\n\t\t\t\t\t$this->processed_terms[intval($term['term_id'])] = $id['term_id'];\n\t\t\t} else {\n\t\t\t\tprintf( 'Failed to import %s %s', esc_html($term['term_taxonomy']), esc_html($term['term_name']) );\n\t\t\t\tif ( defined('IMPORT_DEBUG') && IMPORT_DEBUG )\n\t\t\t\t\techo ': ' . $id->get_error_message();\n\t\t\t\techo '<br />';\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t}\n\n\t\tunset( $this->terms );\n\t}",
"function addValues($setVal,$tableName,$idColumn,$colValToInc){\n \n if(isset($_GET[$setVal])){\n $setVal = filterStr($_GET[$setVal]);\n $page = filterStr($_GET['yaw']);\n $directPage = $page.\".php\";\n $result = query(\"update {$tableName} set $colValToInc = $colValToInc+1 where {$idColumn} = {$setVal}\");\n show_error($result);\n header(\"Location: ../$directPage\"); \n }\n \n}",
"public function prepare_item_for_response($term, $request)\n {\n }",
"function hello_yoda_insert(){\n\tglobal $wpdb;\n\n\tif ('POST' === $_SERVER['REQUEST_METHOD']){\n\t\tglobal $wpdb;\n\t\t\n\t\t$quote = filter_var($_POST['quote'], FILTER_SANITIZE_STRING);\n\t\t$quotee = filter_var($_POST['quotee'], FILTER_SANITIZE_STRING);\n\n\t\tif ($quote != '' && ($quotee == 'Vader' || $quotee == 'Yoda')){\n\t\t\t$stmt = $wpdb->prepare(\"INSERT INTO {$wpdb->prefix}quotes (quote,quotee) VALUES (%s, %s)\", $quote, $quotee);\n\t\t\t$wpdb->query($stmt);\n\t\t}\n\t\n\t}\n}",
"protected function populate_terms($terms)\n {\n }",
"public function Q($query)\n {\n //connectionecting to database\n require './koneksi.php';\n // kembali jika query kososng\n if (!$query) {\n return;\n }\n mysqli_query($connection, \"TRUNCATE TABLE tbq\");\n // ekstraksi keyword\n $keywordsArray = $this->tokenize($query);\n $tbtoken = $this->ambilToken();\n foreach ($tbtoken as $token) {\n //menyamakan isi dari token dengan query\n mysqli_query($connection, \"INSERT into tbq (idtoken,count) values($token[id],0)\") or die(mysqli_error($connection));\n foreach ($keywordsArray as $word) {\n //jika ada yang sama lagi, akan count akan bertambah\n if ($token['term'] == $word) {\n mysqli_query($connection, \"UPDATE tbq set count = count + 1 where idtoken = $token[id]\") or die(mysqli_error($connection));\n }\n }\n }\n //closing connectionection\n $connection->close();\n }",
"public function testUpdateFinancialStatementUsingPut()\n {\n }",
"function btrClient_addterm_form_submit($form, &$form_state) {\n //dpm($form_state['values']); //debug\n $string = check_plain(trim($form_state['values']['newterm']));\n\n $sguid = btr_add_term($string);\n if (empty($sguid)) {\n drupal_set_message(t('This term already exists.'));\n return;\n }\n\n // notify translators about the new term\n btrClient_new_term_notification($string, $sguid);\n\n // redirect to translating the term\n $lng = variable_get('btrClient_translation_lng', 'fr');\n drupal_goto(\"translations/$lng/$sguid\");\n}",
"private function internal_query($start, $limit, $year) {\n global $DB, $CFG;\n $from = '';\n $fromarray = array();\n $where = '';\n $wherearray = array();\n $total = '';\n\n $occurstable = year_tables::get_occurs_table($year);\n $docstable = year_tables::get_docs_table($year);\n\n $join = 0;\n foreach ($this->terms as $term) {\n foreach ($term->ids as $id) {\n $alias = \"o$join\";\n if ($join == 0) {\n $from .= \"{\" . $occurstable . \"} $alias \";\n $where .= \"$alias.wordid = ?\";\n $wherearray[] = $id;\n $total .= \"$alias.score\";\n } else {\n // Note: This line uses the id directly rather than as a ?\n // parameter, because.\n $from .= \"JOIN {\" . $occurstable . \"} $alias\n ON $alias.documentid = o0.documentid AND $alias.wordid = ? \";\n $fromarray[] = $id;\n $total .= \"+$alias.score\";\n }\n $join++;\n }\n }\n // Because it kills the server to search for a large number of terms\n // when the database is full, we need to limit it.\n $maxterms = $CFG->local_ousearch_maxterms;\n if ($join > $maxterms) {\n $referer = $_SERVER['HTTP_REFERER'];\n if (!$referer) {\n $referer = ''; // Use default.\n }\n throw new moodle_exception('toomanyterms', 'local_ousearch', $referer, $maxterms);\n }\n foreach ($this->negativeterms as $term) {\n if (count($term->ids) == 1) {\n $alias = \"o$join\";\n $from .= \"LEFT JOIN {\" . $occurstable . \"} $alias\n ON $alias.documentid = o0.documentid AND $alias.wordid = ?\";\n $fromarray[] = $term->ids[0];\n $total .= \"-(CASE WHEN $alias.score IS NULL THEN 0 ELSE 999999 END)\";\n $join++;\n }\n }\n\n list ($restrict, $restrictarray) = $this->internal_get_restrictions();\n $query = \"\n SELECT o0.documentid, $total AS totalscore, d.*,\n c.shortname AS courseshortname, c.fullname AS coursefullname,\n g.name AS groupname\n FROM $from\n JOIN {\" . $docstable . \"} d ON d.id = o0.documentid\n LEFT JOIN {course} c ON d.courseid = c.id\n LEFT JOIN {groups} g ON d.groupid = g.id\n WHERE $where\n $restrict\n AND $total > 0\n ORDER BY totalscore DESC, o0.documentid\";\n $queryarray = array_merge($fromarray, $wherearray, $restrictarray);\n $result = $DB->get_records_sql($query, $queryarray, $start, $limit);\n if (!$result) {\n $result = array();\n }\n return $result;\n }",
"function load_lang($term) {\n global $dbf;\n global $lang;\n \n $sql = \"SELECT text,term FROM base_language_text WHERE term='\".$term.\"' AND language_code='\".$lang.\"'\";\n $dbf->query($sql);\n $dbf->next_record();\n \n $rows = $dbf->rowdata();\n if($term != $rows['term']) {\n exit(\"the language term not match in a database!\"); \n } else { \n $text = $rows['text'];\n return $text;\n }\n}",
"function editTerms($data) {\n\t\t\t$conn = $this->connect();\n\t\t\t$allowed_pepole = $this->modify(mysqli_real_escape_string($conn, $data['allowed_people']));\n\t\t\t$religion = $this->modify(mysqli_real_escape_string($conn, $data['religion']));\n\t\t\t$uid = $_SESSION['userid'];\n\t\t\t$pid = $_SESSION['pid'];\n\t\t\t$colName = \"post_allowed_people = '\".$allowed_pepole.\"', post_religion\";\n\t\t\tif($allowed_pepole == \"\" || $religion == \"\") {\n\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Empty\");\n\t\t\t} else {\n\t\t\t\tif(preg_match(\"/^[a-z ]+$/i\", $allowed_pepole) || preg_match(\"/^[a-z ]+$/i\", $religion)) {\n\t\t\t\t\tif($this->length($allowed_pepole, 25, 3) || $this->length($religion, 10, 3)) {\n\t\t\t\t\t\t$result = $this->changepost('newpost', $colName, $religion, $uid , $pid);\n\t\t\t\t\t\tif($result == true) {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Successfully_Changed\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Failed!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&length=tooBigOrSmall\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&invalid=type\");\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"function updateTicket() {\n if (isset($_POST)) {\n\t$type[0] = $_POST['typeC'];\n $type[1] = $_POST['typeA'];\n $type[2] = $_POST['typeF'];\n $num[0] = intval($_POST['TicketNumC']);\n $num[1] = intval($_POST['TicketNumA']);\n $num[2] = intval($_POST['TicketNumF']);\n //$num = $_POST['TicketNum'];\n }\n \n // start connect db\n $conn = dbConnect(); \n if ($conn) {\n\n//Part one select data from tickettype\n for($i = 0 ; $i <=2 ; $i++){\n if($num[$i] == 0){\n continue;\n }\n$sql = \"SELECT * FROM EMM_ZOO.TICKETGATE_TYPE WHERE TICKETGATE_TYPE = '$type[$i]';\";\n\n \n$stmt = db2_prepare($conn, $sql);\n$result = db2_execute($stmt);\nwhile ($row = db2_fetch_assoc($stmt)) {\n $ticket_price = $row['TICKETGATETYPE_PRICE'];\n $ticket_type = $row['TICKETGATE_TYPE'];\n $ticket_id = intval($row['TICKETGATETYPE_ID']);\n //printf (\"%-5d %-16s %-32d\\n\", \n // $ticket_price, $ticket_type, $ticket_id);\n}\n$insert = \"INSERT INTO EMM_ZOO.TICKETGATE_TRANSACTION (TICKETGATE_ID, TICKETGATETYPE_ID, TICKETGATE_DATE, TICKETGATE_NUM, TICKETGATE_PRICE) VALUES (DEFAULT, $ticket_id, CURRENT DATE, $num[$i]\".\",\". $ticket_price*$num[$i] .\");\";\n //echo $insert; \n$rc = db2_exec($conn, $insert); // ตรงนี้ error ยังไม่เสร็จ\n \n \nif ($rc) {\n // echo \"Insert successfully!!\";\necho \"<script>alert('$num[$i] $type[$i] ticket has sole in price \".($ticket_price*$num[$i]).\"');window.location='GateTricket.php';</script>\";\n}\n\nelse { // If statement is error why see the code\n\t die('Critical error:' . db2_stmt_error($stmt));\n}\n\n// finish all query statement \ndb2_free_stmt($stmt);\n}\ndb2_close($conn);\n}\nelse {\n echo db2_conn_errormsg($conn);\n} \n}",
"public function store(Request $request)\n {\n $request->validate([\n 'mini_glossaries_id' => 'required',\n 'value' => 'required|max:191'\n ]);\n\n $term = new Term([\n 'mini_glossary_id'=>$request->get('mini_glossaries_id'),\n 'value'=>$request->get('value')\n ]);\n\n $term->save();\n \n return redirect()->route('translator', ['mini_glossaries_id' => $request->get('mini_glossaries_id')])->with('ok_message', 'New Term \"' . $term->value . '\" was added to this Mini-glossay');\n }",
"public function set_query($query) {\n $this->querytext = $query;\n\n // Clear the existing arrays.\n $this->terms = array();\n $this->negativeterms = array();\n\n // Refill those arrays from the query text.\n $words = local_ousearch_document::split_words($query, true);\n $currentquote = array();\n $sign = false;\n $inquote = false;\n foreach ($words as $word) {\n // Clean word to get rid of +, \", and - except if it's in the middle.\n $cleaned = preg_replace('/(^-)|(-$)/', '',\n preg_replace('/[+\"]/', '', $word));\n\n // Shorten word if necessary to db length.\n $cleaned = core_text::substr($cleaned, 0,\n local_ousearch_document::MAX_WORD_LENGTH);\n\n if ($inquote) {\n // Handle hyphenated words.\n if (strpos($cleaned, '-') !== false) {\n foreach (explode('-', $cleaned) as $subword) {\n $currentquote[] = $subword;\n }\n } else {\n $currentquote[] = $cleaned;\n }\n self::internal_end_quote($currentquote, $word, $sign, $inquote);\n } else {\n // The below are all single-byte characters so we don't need to\n // use textlib here.\n $firstchar = substr($word, 0, 1);\n $secondchar = strlen($word) > 1 ? substr($word, 1, 1) : false;\n\n if ($firstchar == '\"') {\n // E.g. \"a phrase\".\n $currentquote = self::internal_hyphenated_array($cleaned);\n $inquote = true;\n $sign = '';\n self::internal_end_quote($currentquote, $word, $sign, $inquote);\n } else if ($firstchar == '+' && $secondchar == '\"') {\n // E.g. +\"a phrase\".\n $currentquote = self::internal_hyphenated_array($cleaned);\n $inquote = true;\n $sign = '+';\n self::internal_end_quote($currentquote, $word, $sign, $inquote);\n } else if ($firstchar == '-' && $secondchar == '\"') {\n // E.g. -\"a phrase\".\n $currentquote = self::internal_hyphenated_array($cleaned);\n $inquote = true;\n $sign = '-';\n self::internal_end_quote($currentquote, $word, $sign, $inquote);\n } else if ($firstchar == '+' && $cleaned !== '') {\n // E.g. +cat.\n $term = new StdClass;\n $term->words = self::internal_hyphenated_array($cleaned);\n $term->required = true;\n $this->terms[] = $term;\n } else if ($firstchar == '-' && $cleaned !== '') {\n // E.g. -cat.\n $term = new StdClass;\n $term->words = self::internal_hyphenated_array($cleaned);\n $this->negativeterms[] = $term;\n } else if ($cleaned !== '') {\n $term = new StdClass;\n $term->words = self::internal_hyphenated_array($cleaned);\n $term->required = false;\n $this->terms[] = $term;\n }\n }\n }\n }",
"private function getCumulativeCountsByTerm($term)\n {\n // So, build a list of extra application terms we should use.\n $extraTerms = array();\n if (Term::getTermSem($term) == TERM_FALL) {\n // Compute the Summer 2 term\n $t = Term::getPrevTerm($term);\n $extraTerms[] = $t;\n \n // Computer the SUmmer 1 term\n $t = Term::getPrevTerm($t);\n $extraTerms[] = $t;\n }\n \n // Create the where clause, start by adding the requested term\n $termClause = \"application_term = {$term}\";\n \n // Add any extra terms, if any.\n if (count($extraTerms) > 0) {\n foreach ($extraTerms as $t) {\n $termClause .= \" OR application_term = $t\";\n }\n }\n \n // Build the query\n /* Query with human readable dates\n $query = \"select\n to_char(date_trunc('day',timestamp 'epoch' + created_on * interval '1 second'), 'Mon DD, YYYY') as date,\n count(created_on) as daily_count, sum(count(created_on)) OVER (ORDER BY to_char(date_trunc('day',timestamp 'epoch' + created_on * interval '1 second'), 'Mon DD, YYYY')) as running_total\n FROM hms_new_application\n WHERE term = 201340\n AND ($termClause)\n AND student_type = 'F'\n AND application_type = 'fall'\n GROUP BY date\n ORDER BY date\";\n */\n \n PHPWS_Core::initModClass('hms', 'PdoFactory.php');\n $db = PdoFactory::getInstance()->getPdo();\n \n $query =\"SELECT\n date_part('epoch', date_trunc('day',timestamp 'epoch' + created_on * interval '1 second')) as date,\n SUM(COUNT(created_on)) OVER (ORDER BY date_part('epoch', date_trunc('day',timestamp 'epoch' + created_on * interval '1 second'))) as running_total\n FROM hms_new_application\n WHERE term = :term\n AND ($termClause)\n AND student_type = 'F'\n AND cancelled = 0\n GROUP BY date\n ORDER BY date\";\n \n $stmt = $db->prepare($query);\n $stmt->bindParam(':term', $term);\n $stmt->execute();\n $result = $stmt->fetchAll(PDO::FETCH_ASSOC);\n \n return $result;\n }",
"function update_term_cache($terms, $taxonomy = '')\n {\n }",
"function checkTermGenePrediction($term,$table_name,$orgv_id,$field_name,$pred_id){\n $query=\"select * from $table_name \";\n $query.=\"where $field_name='$term' and organism_version_id =$orgv_id \";\n $query.=\" and gene_prediction_id in($pred_id)\";\n global $con;if(!$con)$con=getConnection();\n $result = mysql_query($query,$con);$gene_prediction=0;\n if($result){\n $numRows =mysql_numrows($result);\n if($numRows>0)$gene_prediction=1;\n }\n return $gene_prediction;\n}",
"function phpTrafficA_addSEngine($table, $connection, $engine, $keywords, $date, $pageid) {\n$sql3 = \"UPDATE `$table` SET count=count+1,last='$date' WHERE STRCMP(engine,'$engine')=0 AND STRCMP(keyword,'$keywords')=0 AND page=$pageid\";\n$res3 = mysql_query($sql3);\nif (mysql_affected_rows() < 1) {\n\t$req4 =\"INSERT INTO `$table` SET engine='$engine', keyword='$keywords', page='$pageid', first='$date', last='$date', count='1'\";\n\t$res4 = mysql_query($req4);\n}\nreturn 1;\n}",
"public function xhrTerm(){\n $date = $_POST['date'];\n\n $freeTerms = $this->_term->freeTerms($date);\n echo json_encode($freeTerms);\n }",
"function submitIngr() {\r\n\t$conn = mysql_connect(\"localhost\", \"earthcr1_DYLMG\", \"Plastichorse22@\");\r\n\tmysql_select_db(\"earthcr1_DYLMG\");\r\n\t$sql = \"INSERT INTO Ingredients (IngredientName, IngredientLOI, IngredientTE)\\n\"\r\n\t\t. \"VALUES ('$_POST[ingrName]', $_POST[LOI], $_POST[thermalExp]) \";\r\n\tmysql_query($sql,$conn);\r\n\t\r\n\t/////////////////////////// Query to retrieve $IngrID_new /////////////////////////////\r\n\t\r\n\t// Gets ID for new ingredient submission as $IngrID_new\t\t(to be used in M2M table)\r\n\t$sql = \t\"SELECT IngredientID \\n\"\r\n\t\t\t. \"FROM Ingredients \\n\"\r\n\t\t\t. \"ORDER BY IngredientID DESC LIMIT 1\";\t\t// Selects the last IngredientID\r\n\t$rs = mysql_query($sql, $conn);\r\n\tif (!$rs) {\r\n\t\tdie('Query error: ' . mysql_error());\r\n\t}\r\n\twhile ($row = mysql_fetch_array($rs)) { $IngrID_new = $row['IngredientID']; }\r\n\tmysql_free_result($rs);\r\n\t///////////////////////////////////////////////////////////////////////////////////////\r\n\t\r\n\t\r\n\t// Loops through oxide inputs\r\n\t// Creates INSERT VALUES.... string\r\n\t$oxideList = createOxideArray();\t\t\t\t\t\t\t\t\t\t\t\t\t// Creates array of $oxideList['Formula'] => [oxideID]\r\n\t$sqlInsertValues = \"\";\r\n\tforeach ($_POST as $formula => $oxideAmt) {\r\n\t\tif(!empty($oxideAmt) && array_key_exists($formula,$oxideList)) {\t\t\t\t// Verifies as oxide input, and not empty id\r\n\t\t\t$sqlInsertValues .= \"($IngrID_new, $oxideList[$formula], $oxideAmt),\"; \r\n\t\t}\r\n\t}\r\n\t$sqlInsertValues = substr($sqlInsertValues,0,-1);\t\t\t\t\t\t\t\t\t// Removes the last \",\" from the string.\r\n\t\r\n\t/////////////////////////// Query to Insert IngredientOxides (M2M) //////////////////////////\r\n\t$conn = mysql_connect(\"localhost\", \"earthcr1_DYLMG\", \"Plastichorse22@\");\r\n\tmysql_select_db(\"earthcr1_DYLMG\");\r\n\r\n\t$sql = \"INSERT INTO IngredientOxides (IngredientID, OxideID, OxideAmt)\\n\"\r\n\t\t\t. \"VALUES $sqlInsertValues\";\r\n\tif (!mysql_query($sql, $conn)) {\r\n\t\tdie('Could not execute query:' . mysql_error());\r\n\t}\r\n\t/////////////////////////////////////////////////////////////////////////////////////////////\r\n}",
"public function Count($term) {\r\n if (!array_key_exists($term, $this->sql)) $this->Sql($term);\r\n $db = NetDesign::GetInstance()->MySQL();\r\n return (int)$db->query(sprintf('SELECT COUNT(*) FROM (%s) AS `query` WHERE `__score` > 0', $this->sql[$term]), $this->params)->fetchColumn();\r\n }",
"public function getTerm()\n\t{\n\t $year_id = $this->getYear();\n\t\t$sqlTerm = \"SELECT * FROM edu_terms WHERE NOW() >= from_date AND NOW() <= to_date AND year_id = '$year_id' AND status = 'Active'\";\n\t\t$term_result = $this->db->query($sqlTerm);\n\t\t$ress_term = $term_result->result();\n\n\t\tif($term_result->num_rows()==1)\n\t\t{\n\t\t\tforeach ($term_result->result() as $rows)\n\t\t\t{\n\t\t\t $term_id = $rows->term_id;\n\t\t\t}\n\t\t\treturn $term_id;\n\t\t}\n\t}",
"public function addReply()\r\n{\r\n $query_string = \"INSERT INTO replies \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"replycontent = :replycontent, \";\r\n $query_string .= \"replytopic = :replytopic, \";\r\n $query_string .= \"replyauthor = :replyauthor\";\r\n\r\n return $query_string;\r\n}",
"function bdpp_edit_taxonomy_field($term){\n\t\tinclude_once( BDPP_DIR . '/includes/admin/taxonomy/edit-form.php' );\n\t}",
"public static function UpdateTerm($mCurrentTermName, $Id)\n {\n $sql = 'CALL school_update_term_name(:term, :id)';\n //Build the parameter array\n $params = array(\n ':term' => $mCurrentTermName,\n ':id' => $Id\n );\n //Execute the query \n self::UpdateTermInActiveClass($mCurrentTermName);\n DatabaseHandler::Execute($sql, $params);\n\n }",
"function term_relationship_handler( $object_id, $term_id ) {\n\t\t$this->add_ping( 'db', array( 'term_relationship' => array( 'object_id' => $object_id, 'term_taxonomy_id' => $term_id ) ) );\n\t}",
"function update_post($table, $post_id, $column, $input) {\n\n $conn = new my_mysql();\n $query = \"UPDATE $table SET $column='$input' WHERE id=$post_id;\";\n $conn->transactionQuery($query);\n echo $input;\n}",
"public function setActiveTerm($term)\n {\n if (strlen($term)) {\n $this->putSession('term', $term);\n }\n else {\n $this->resetSession();\n }\n\n $this->activeTerm = $term;\n }",
"public function setTerms(){\n\t\t$this->terms = new stdClass();\n\t\tforeach (get_taxonomies() as $taxonomy ) {\n\t\t\t$this->terms->$taxonomy = $this->getTerms( $taxonomy);\n\t\t\t//$this->{'terms_'.$taxonomy} = $this->terms[$taxonomy];\n\t\t}\n\t}",
"public static function AddUniCountOfWords() {\r\n $conn = ModMetocHelper::coToDa();\r\n $cont = ModMetocHelper::conTab();\r\n\r\n $sql = \"ALTER TABLE $cont ADD uni_count_of_words INT(10)\";\r\n $result = $conn->query($sql);\r\n }",
"function resourceHandler($key, $value, $mysqli, $missionID) {\n //code to be executed;\n if ($value > 0){\n $key = str_replace('\\'', '', $key);\n $key = str_replace('_', ' ', $key);\n //echo $key;\n //echo \"<--- key\";\n $query = \"UPDATE resource SET quantity = quantity - $value WHERE resourceName = '$key';\";\n $result = $mysqli->query($query);\n if (!$result) {\n die('Invalid query to modify resource in oc_create_mission_submit.php: ' . mysqli_error($mysqli));\n }\n \n //get resourceID\n $query = \"SELECT resourceID FROM resource WHERE resourceName = '$key';\";\n $result = $mysqli->query($query);\n if (!$result) {\n die('Invalid query to resourceID in oc_create_mission_submit.php: ' . mysqli_error($mysqli));\n }\n \n $resourceID = $result->fetch_assoc()[\"resourceID\"];\n \n $query = \"insert into resourceMission(missionID, resourceID, \" .\n \"quantity) values (\" . $missionID . \", \" . $resourceID . \", \" .\n $value . \")\";\n \n $result = $mysqli->query($query);\n if (!$result) {\n die('Invalid query to add resources in oc_create_mission_submit.php: ' . mysqli_error($mysqli));\n }\n }\n}",
"public function setActiveTerm($term)\n {\n if (strlen($term)) {\n $this->putSession('term', $term);\n } else {\n $this->resetSession();\n }\n\n $this->activeTerm = $term;\n }",
"public function updatenationalities ($id , $description \n ){\n $sqlQuery = \" UPDATE nationalities SET id = $id , description =\n$description \";\n $sqlQuery .= \" WHERE id= $id\";\n $result = $this -> getDbManager () -> executeQuery ( $sqlQuery );\n return $result ;\n }",
"function updateDoctor($nr, $vardas, $pavarde){\n// sprintf - % vietoj kiekvieno %s isves kintamuosius is eiles\n// %s -s - string, f- (float) skaicius su kableliu;\n $manoSQL = sprintf(\"UPDATE doctors SET\n name='%s',\n lname='%s'\n WHERE id=%s\n LIMIT 1;\",\n htmlspecialchars($vardas, ENT_QUOTES, UTF-8),// uzkoduoja html kabutes, $pavarde, $nr);\n htmlspecialchars($pavarde, ENT_QUOTES, UTF-8),// uzkoduoja html kabutes\n $nr);\n\n $x = mysqli_query(getPrisijungimas(), $manoSQL);\n\n if ($x) {\n echo \"Gydytojas nr $nr updeitintas!<br>\";\n }\n}",
"function Specialities_Update(){\n\t\t\n\t\t//when click on button\n\t\tif(isset($_POST['updatesp'])){\n\t\t\t\n\t\t\t\t// get id move to variable\n\t\t\t$get_id = $_GET['Edit'];\n\t\t\t\n\t\t\t//values for Specialities table\n\t\t\t$values = \"specialitie_name='\".$_POST['sp'].\"'\";\n\t\t\t\n\t\t // update Specialities from table\n\t\t $this->Update('specialities',$values,\"where id='$get_id'\",'Specialities?m');\n\t\t} // ifisset close\n\t}",
"function handlePOSTRequest() {\n if (connectToDB()) {\n if (array_key_exists('resetTablesRequest', $_POST)) {\n handleResetRequest();\n } else if (array_key_exists('updateQueryRequest', $_POST)) {\n handleUpdateRequest();\n } else if (array_key_exists('insertQueryRequest', $_POST)) {\n handleInsertRequest();\n } \n else if (array_key_exists('avgAgeQueryRequest', $_POST)) {\n //console_log(\"hello\");\n handleAvgAgeRequest();\n //echo \"Average age is 0\";\n } \n\n disconnectFromDB();\n }\n }",
"function addIngredientToRecipe($recipe, $ingredient, $qty, $units){\n\t $recipeid = $this->getRecipeID($recipe);\n\t if(($recipeid != NULL) && ($ingredient != NULL) && ($qty != NULL)&& ($units != NULL))\n\t\t{ \n\t\t if($qty <= 0)\n\t\t return;\n\t\t $count = @mysql_query(\"SELECT COUNT(*) as count FROM Ingredients WHERE (Recipe = '$recipeid' AND IngredientName = '$ingredient' AND Units ='$units')\");\n\t\t $countdata = mysql_fetch_assoc($count);\n\t\t if($countdata['count'] >= 1)\n\t\t @mysql_query(\"UPDATE Ingredients SET Quantity = Quantity + '$qty' WHERE (Recipe = '$recipeid' AND IngredientName = '$ingredient' AND Units ='$units')\");\n\t\t else\n\t\t @mysql_query(\"INSERT INTO Ingredients VALUES ('$recipeid','$ingredient','$qty','$units')\");\n\t }\n\t}",
"function obtenerTerminActivo($terminActiv, $termStatus)\n{\n\tglobal $con;\n\t\n\t$query_ConsultaFuncion = sprintf(\"SELECT * FROM term WHERE term_stop = %s AND status = %s ORDER BY id_term DESC \",\n\t\t GetSQLValueString($terminActiv, \"text\"),\n\t\t GetSQLValueString($termStatus, \"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\tif ($totalRows_ConsultaFuncion!=0) \n\t\treturn true;\n\telse return false;\t\n\t\n\tmysqli_free_result($ConsultaFuncion);\n}",
"public function run()\n {\n TermsOfDelivery::truncate();\n\n $input = [\n [\n 'term_of_delivery' => '1 week'\n ],\n [\n 'term_of_delivery' => '2 weeks'\n ],\n [\n 'term_of_delivery' => '3 weeks'\n ],\n [\n 'term_of_delivery' => '4 weeks'\n ],\n [\n 'term_of_delivery' => '2 months'\n ],\n [\n 'term_of_delivery' => '3 months'\n ],\n [\n 'term_of_delivery' => '4 months'\n ],\n ];\n\n $inserted_input = TermsOfDelivery::insert($input);\n }",
"public function MyUpdate() {\n //var_dump($rs);\n\n DB::beginTransaction();\n\n\n /*\n DB::transaction(function() {\n $article = Articles::create(array(\n ''\n ));\n });\n */\n }",
"function dbModifyTwitt($db, $id, $login, $text)\r\n {\r\n try\r\n {\r\n $request = 'update twitts set text=:text where id=:id and login=:login ';\r\n $statement = $db->prepare($request);\r\n $statement->bindParam(':id', $id, PDO::PARAM_INT);\r\n $statement->bindParam(':login', $login, PDO::PARAM_STR, 20);\r\n $statement->bindParam(':text', $text, PDO::PARAM_STR, 80);\r\n $statement->execute();\r\n }\r\n catch (PDOException $exception)\r\n {\r\n error_log('Request error: '.$exception->getMessage());\r\n return false;\r\n }\r\n return true;\r\n }",
"function getTerm($num){\r\n $data = new \\Cars\\Data\\Common($this->app);\r\n return $data->getTerm($num);\r\n }",
"public function update(Request $request, $id)\n {\n $terms = Terms::find($id);\n $terms->description = $request->description;\n $terms->save();\n return redirect()->route('terms.index')->with('success','Terms update successfully');\n }",
"public function updateQ(){\n\t\t$action = $this->input->post('q');\n\t\t$where \t= array(\n\t\t\t'id'\t\t => $this->input->post('idQ'),\n\t\t\t// 'survey' => $this->input->post('id'),\n\t\t\t// 'page'\t => $this->input->post('idPage')\n\t\t);\n\t\t\n\t\tif ($action == \"create\") {\n\t\t\t$data = array(\n\t\t\t\t'survey' => $this->input->post('id'),\n\t\t\t\t'page'\t => $this->input->post('idPage'),\n\t\t\t\t'title'\t\t\t=> $this->input->post('titleQ'),\n\t\t\t\t'desc'\t\t\t=> $this->input->post('textQ'),\n\t\t\t\t'type'\t\t\t=> $this->input->post('typeAns'),\n\t\t\t\t'req'\t\t\t => $this->input->post('reqQ'),\n\t\t\t\t'cat_risk'\t\t\t => $this->input->post('cat_risk'),\n\t\t\t);\n\t\t\tif ($this->MstSurveyModel->insert($this->tables[2], $data)) {\n\t\t\t\t$response = \"success\";\n\t\t\t}else $response = \"failed\";\n\t\t}else{\n\t\t\t$data = array(\n\t\t\t\t'title'\t\t\t=> $this->input->post('titleQ'),\n\t\t\t\t'desc'\t\t\t=> $this->input->post('textQ'),\n\t\t\t\t'type'\t\t\t=> $this->input->post('typeAns'),\n\t\t\t\t'req'\t\t\t\t=> $this->input->post('reqQ'),\n\t\t\t\t'cat_risk'\t\t\t => $this->input->post('cat_risk'),\n\t\t\t);\n\t\t\t// print_r($data);exit();\n\t\t\tif ($this->MstSurveyModel->update($this->tables[2], $data, $where)) {\n\t\t\t\t$response = \"success\";\n\t\t\t}else $response = \"failed\";\n\t\t}\n\n\t\techo json_encode($response);\n\t}",
"public function update(Request $request, $id)\n {\n if (TermsConditions::where('id', $id)->exists()) {\n $term = TermsConditions::findOrFail($id);\n $term->update($request->all());\n\n return response()->json([\n \"message\" => \"Terms and Conditions updated successfully\",\n ], 200);\n } else {\n return response()->json([\n \"message\" => \"Record not found\",\n ], 404);\n\n }\n }"
]
| [
"0.61919594",
"0.61895263",
"0.61895263",
"0.5669199",
"0.5575875",
"0.551291",
"0.5438189",
"0.53062063",
"0.5246073",
"0.5219104",
"0.52182436",
"0.52019674",
"0.51884556",
"0.5170921",
"0.5169508",
"0.51436543",
"0.51353747",
"0.50966406",
"0.50966406",
"0.5088554",
"0.5077133",
"0.5013188",
"0.50120884",
"0.49862593",
"0.49635476",
"0.4961082",
"0.4957192",
"0.49548405",
"0.49445164",
"0.49378955",
"0.4936522",
"0.49305266",
"0.49188283",
"0.48987603",
"0.4893925",
"0.4885769",
"0.48789787",
"0.4874712",
"0.48469096",
"0.48342463",
"0.48251417",
"0.48178422",
"0.48167667",
"0.48140943",
"0.48110992",
"0.48073307",
"0.47990614",
"0.4786353",
"0.47767127",
"0.47632027",
"0.47549275",
"0.47486964",
"0.47288948",
"0.47228304",
"0.47196874",
"0.47052965",
"0.46819308",
"0.4680285",
"0.46718156",
"0.46597588",
"0.4646288",
"0.46343347",
"0.46203586",
"0.46101096",
"0.46054778",
"0.45943436",
"0.4574092",
"0.45702747",
"0.45673895",
"0.45486307",
"0.4533641",
"0.4526146",
"0.452042",
"0.45111066",
"0.4510115",
"0.4497569",
"0.4496123",
"0.44885248",
"0.44768116",
"0.44748965",
"0.44717667",
"0.44708037",
"0.447067",
"0.44700935",
"0.44677612",
"0.446636",
"0.4459441",
"0.44561738",
"0.4456161",
"0.44500852",
"0.44417763",
"0.4441384",
"0.44383934",
"0.44342276",
"0.44307488",
"0.4429733",
"0.4428808",
"0.44282642",
"0.44278842",
"0.44269064"
]
| 0.575202 | 3 |
Adds new keywords into tables TBL_WORDLIST and TBL_WORDMAP | function gwAddNewKeywords($id_dict, $id_term, $arKeywords, $termIdOld, $isClean, $date_created)
{
global $arFields, $intFields, $arStop, $sys;
global $oDb, $oSqlQ;
# @header("content-type: text/html; charset=utf-8");
// Adding search keywords
$arKeywordsJoin = array();
for (reset($arKeywords); list($k, $v) = each($arKeywords);)
{
$arKeywordsJoin = array_merge($arKeywordsJoin, $v); // common array with all keywords
}
// unique keywords only, have to run second time
$arKeywordsJoin = array_flip($arKeywordsJoin);
$arQuery = array();
$arSql = array();
if (!empty($arKeywordsJoin))
{
$word_text_sql = "'" . implode("', '", array_keys($arKeywordsJoin)) . "'";
/* Get the list of already known keywords and their IDs */
$arSql = $oDb->sqlExec($oSqlQ->getQ('get-word', TBL_WORDLIST, $word_text_sql));
}
# prn_r($arSql);
$q2 = $q1 = array();
if (!empty($arSql)) // some keywords are exist already
{
$cnt = 0;
// for each founded keyword
for (; list($arK, $arV) = each($arSql);)
{
if ($isClean) // overwrite mode
{
$arQuery[0] = $oSqlQ->getQ('del-wordmap-by-term-dict', $termIdOld, $id_dict);
}
$q2['word_id'] = $arV['word_id'];
$q2['term_id'] = $id_term;
$q2['dict_id'] = $id_dict;
$q2['date_created'] = $date_created;
// Set Field ID
for (reset($arFields); list($id_field, $fV) = each($arFields);)
{
if (isset($arKeywords[$id_field]) && in_array($arV['word_text'], $arKeywords[$id_field]))
{
$q2['term_match'] = $id_field;
$arQueryMapExist[] = gw_sql_insert($q2, TBL_WORDMAP, 1, $cnt);
unset($arKeywordsJoin[$arV['word_text']]); // remove existent keyword
$cnt++;
}
}
}
}
//
// Add new kewords
# prn_r($arKeywordsJoin);
# prn_r($arKeywords);
//
$q2 = $q1 = array();
$q1['word_id'] = $q2['word_id'] = ($oDb->MaxId(TBL_WORDLIST, 'word_id') - 1);
$cnt = $cntMap = 0;
// for each new keyword
for (reset($arKeywordsJoin); list($newkeyword, $v2) = each($arKeywordsJoin);)
{
$q2['word_id']++;
$q2['dict_id'] = $id_dict;
$q2['term_id'] = $id_term;
$q2['date_created'] = $date_created;
$q1['word_id']++;
$q1['word_text'] = '';
//
// Set index ID per field
for (reset($arFields); list($id_field, $fV) = each($arFields);)
{
if (isset($arKeywords[$id_field]) && in_array($newkeyword, $arKeywords[$id_field]))
{
$q2['term_match'] = $id_field;
$q1['word_text'] = $newkeyword;
// add keyword into map
$arQueryMap[] = gw_sql_insert($q2, TBL_WORDMAP, 1, $cntMap);
unset($arKeywordsJoin[$newkeyword]); // remove new keyword
$cntMap++;
}
}
// add new word into wordlist
if ($q1['word_text'] != '')
{
$arQueryWord[] = gw_sql_insert($q1, TBL_WORDLIST, 1, $cnt);
$cnt++;
}
}
/* Queries for existent keywords */
if (isset($arQueryMapExist)) { $arQuery[] = implode('', $arQueryMapExist); }
/* Queries for new keywords */
if (isset($arQueryWord)) { $arQuery[] = implode('', $arQueryWord); }
/* Queries for new keywords map */
if (isset($arQueryMap)) { $arQuery[] = implode('', $arQueryMap); }
/* Displays queries */
if ($sys['isDebugQ'])
{
$arQuery = gw_highlight_sql($arQuery);
print '<ul class="gwsql"><li>'.implode(';</li><li>', $arQuery).';</li></ul>';
}
else
{
for (; list($kq, $vq) = each($arQuery);)
{
if (!$oDb->sqlExec($vq))
{
print '<li class="xt">Error: cannot exec query: '.$arQuery[$i].';</li>';
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function add_keywords ( $new_keywords )\r\n\t\t{\r\n\t\t\r\n\t\t\t$this->errno = DB_OK;\r\n\r\n\t\t\tif ( $this->cat_id == -1 )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tSuch category hasn't been created\r\n\t\t\t{\r\n\t\t\t\t$this->errno = WRONG_ID;\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( ! ( $result = $this->con->query( \"SELECT cat_keywords FROM category WHERE cat_id=$this->cat_id\" ) ) )\r\n\t\t\t{\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tFailed to connect\t\r\n\t\t\t\treturn ;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tif ( $result->num_rows == 1 )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tas the id is unique one row should have been returned\r\n\t\t\t{\r\n\t\t\t\t$row = $result->fetch_row();\r\n\t\t\t\t$kw = $row[0];\r\n\t\t\t}\t\t\t\t\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\r\n\t\t\t\treturn ;\r\n\t\t\t}\t\t\t\r\n\t\t\t\r\n\t\t\t/* gathering all keywords into one variable with # as delimiter to insert it to the database */\r\n\t\t\t$kw_length = 0; \t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tinitialize with 0 in case the keywords array hasn't been set\r\n\t\r\n\t\t\tif ( isset ( $new_keywords ) )\r\n\t\t\t\t$kw_length = count( $new_keywords );\r\n\r\n\t\t\tif ( $kw_length == 0 )\r\n\t\t\t{\r\n\t\t\t\t$this->errno = WRONG_INPUT;\r\n\t\t\t\treturn ;\t\t\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\tfor ( $i = 0; $i < $kw_length; $i++ )\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tgenerating the keyword string which will enter to the database\r\n\t\t\t\t$kw = $kw.\"#\".$new_keywords[$i];\t\t\t\r\n\t\t\t\r\n\t\t\tif( !$this->con->query( \"UPDATE category SET cat_keywords=\\\"$kw\\\" WHERE cat_id=$this->cat_id;\" ) )\t\t\t\r\n\t\t\t{\r\n\t\t\t\t$this->errno = MYSQL_ERROR;\t\t\t\t\t\r\n\t\t\t\treturn ;\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tFailed to query\t\t\t\t\r\n\t\t\t}\r\n\r\n\t\t\t$this->cat_keywords = NULL;\r\n\t\t\t\r\n\t\t\t$tok = strtok( $kw, \"#\" );\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t//\tturning the keywords string into an array\r\n\t\t\t\r\n\t\t\twhile ( $tok !== false ) \r\n\t\t\t{\r\n\t\t\t\t$this->cat_keywords [] = $tok;\r\n\t\t\t\t$tok = strtok( \"#\" );\r\n\t\t\t}\t\t\t\r\n\t\r\n\t\t}",
"protected function _syncKeywords() {}",
"private function installWords()\n {\n $data = file(__DIR__ . '/../bad_words_pl.txt');\n\n $bom = pack('H*', 'EFBBBF');\n\n $rows = [];\n foreach ($data as $row) {\n $rows[] = [trim(preg_replace(\"/^$bom/\", '', $row))];\n }\n\n Yii::$app\n ->db\n ->createCommand()\n ->batchInsert($this->table, ['word'], $rows)\n ->execute();\n }",
"public static function addKeywords($params)\n {\n $data = new ExcludedKeyword();\n $data->keyword = BackEnd_Helper_viewHelper::stripSlashesFromString( $params['keyword']);\n $data->action = BackEnd_Helper_viewHelper::stripSlashesFromString($params['actionType']);\n $data->url = BackEnd_Helper_viewHelper::stripSlashesFromString($params['redirectTo']);\n $data->save();\n\n if($params['actionType'] == 1){\n\n //split value by comman (,)\n $splitedVal = explode(',',$params['selectedShopForSearchbar']) ;\n //get hidden value from posted form\n\n foreach ($splitedVal as $sp) {\n //find shop by name from shop table\n $relKeyWords = new RefExcludedkeywordShop();\n //add value in array by index\n $relKeyWords->keywordid = $data->id;//get last inserted keyword id\n $relKeyWords->shopid = $sp;\n $relKeyWords->keywordname = BackEnd_Helper_viewHelper::stripSlashesFromString($params['keyword']);\n $relKeyWords->save();\n\n }\n }\n //call cache function\n FrontEnd_Helper_viewHelper::clearCacheByKeyOrAll('all_excludedkeyword_list');\n //die('out');\n\n }",
"private function addKeyword()\n {\n // get demanded link data\n $this->model->action('link','addKeyword', \n array('id_key' => (int)$_REQUEST['id_key'],\n 'id_link' => (int)$_REQUEST['id_link']));\n }",
"function mx_add_search_words($mode, $post_id, $post_text, $post_title = '', $mx_mode = 'mx')\n\t{\n\t\tglobal $db, $config, $lang;\n\n\t\t// $search_match_table = SEARCH_MATCH_TABLE;\n\t\t// $search_word_table = SEARCH_WORD_TABLE;\n\n\t\tswitch ($mx_mode)\n\t\t{\n\t\t\tcase 'mx':\n\t\t\t\t$search_match_table = MX_MATCH_TABLE;\n\t\t\t\t$search_word_table = MX_WORD_TABLE;\n\t\t\t\t$db_key = 'block_id';\n\t\t\tbreak;\n\t\t\tcase 'kb':\n\t\t\t\t$search_match_table = KB_MATCH_TABLE;\n\t\t\t\t$search_word_table = KB_WORD_TABLE;\n\t\t\t\t$db_key = 'article_id';\n\t\t\tbreak;\n\t\t}\n\n\t\tstopwords_synonyms_init();\n\n\t\t$search_raw_words = array();\n\t\t$search_raw_words['text'] = split_words(clean_words('post', $post_text, $stopwords_array, $synonyms_array));\n\t\t$search_raw_words['title'] = split_words(clean_words('post', $post_title, $stopwords_array, $synonyms_array));\n\n\t\t@set_time_limit(0);\n\n\t\t$word = array();\n\t\t$word_insert_sql = array();\n\t\twhile (list($word_in, $search_matches) = @each($search_raw_words))\n\t\t{\n\t\t\t$word_insert_sql[$word_in] = '';\n\t\t\tif (!empty($search_matches))\n\t\t\t{\n\t\t\t\tfor ($i = 0; $i < sizeof($search_matches); $i++)\n\t\t\t\t{\n\t\t\t\t\t$search_matches[$i] = trim($search_matches[$i]);\n\n\t\t\t\t\tif($search_matches[$i] != '')\n\t\t\t\t\t{\n\t\t\t\t\t\t$word[] = $search_matches[$i];\n\t\t\t\t\t\tif (!strstr($word_insert_sql[$word_in], \"'\" . $search_matches[$i] . \"'\"))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$word_insert_sql[$word_in] .= ($word_insert_sql[$word_in] != \"\") ? \", '\" . $search_matches[$i] . \"'\" : \"'\" . $search_matches[$i] . \"'\";\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\tif (sizeof($word))\n\t\t{\n\t\t\tsort($word);\n\n\t\t\t$prev_word = '';\n\t\t\t$word_text_sql = '';\n\t\t\t$temp_word = array();\n\t\t\tfor($i = 0; $i < sizeof($word); $i++)\n\t\t\t{\n\t\t\t\tif ($word[$i] != $prev_word)\n\t\t\t\t{\n\t\t\t\t\t$temp_word[] = $word[$i];\n\t\t\t\t\t$word_text_sql .= (($word_text_sql != '') ? ', ' : '') . \"'\" . $word[$i] . \"'\";\n\t\t\t\t}\n\t\t\t\t$prev_word = $word[$i];\n\t\t\t}\n\t\t\t$word = $temp_word;\n\n\t\t\t$check_words = array();\n\n\t\t\t$value_sql = '';\n\t\t\t$match_word = array();\n\t\t\tfor ($i = 0; $i < sizeof($word); $i++)\n\t\t\t{\n\t\t\t\t$new_match = true;\n\t\t\t\tif (isset($check_words[$word[$i]]))\n\t\t\t\t{\n\t\t\t\t\t$new_match = false;\n\t\t\t\t}\n\n\t\t\t\tif ($new_match)\n\t\t\t\t{\n\t\t\t\t\t$value_sql .= (($value_sql != '') ? ', ' : '') . '(\\'' . $word[$i] . '\\', 0)';\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif ($value_sql != '')\n\t\t\t{\n\t\t\t\t$sql = \"INSERT IGNORE INTO \" . $search_word_table . \" (word_text, word_common) VALUES $value_sql\";\n\t\t\t\t$db->sql_query($sql);\n\t\t\t}\n\t\t}\n\n\t\twhile(list($word_in, $match_sql) = @each($word_insert_sql))\n\t\t{\n\t\t\t$title_match = ($word_in == 'title') ? 1 : 0;\n\n\t\t\tif ($match_sql != '')\n\t\t\t{\n\t\t\t\t$sql = \"INSERT INTO \" . $search_match_table . \" ($db_key, word_id, title_match)\n\t\t\t\t\tSELECT $post_id, word_id, $title_match\n\t\t\t\t\t\tFROM \" . $search_word_table . \"\n\t\t\t\t\t\tWHERE word_text IN ($match_sql)\";\n\t\t\t\t$db->sql_query($sql);\n\t\t\t}\n\t\t}\n\n\t\tif ($mode == 'single')\n\t\t{\n\t\t\t// remove_common('single', 4/10, $word);\n\t\t}\n\n\t\treturn;\n\t}",
"public function setKeyWords()\n {\n if (empty($this->sqlKeywords)) {\n $this->sqlKeywords = [\"abort\",\"absolute\",\"access\",\"action\",\"add\",\"admin\",\"after\",\"aggregate\",\"all\",\"also\",\"alter\",\"always\",\"analyse\",\"analyze\",\"and\",\"any\",\"array\",\"as\",\"asc\",\"assertion\",\"assignment\",\"asymmetric\",\"at\",\"attribute\",\"authorization\",\"backward\",\"before\",\"begin\",\"between\",\"bigint\",\"binary\",\"bit\",\"boolean\",\"both\",\"by\",\"cache\",\"called\",\"cascade\",\"cascaded\",\"case\",\"cast\",\"catalog\",\"chain\",\"char\",\"character\",\"characteristics\",\"check\",\"checkpoint\",\"class\",\"close\",\"cluster\",\"coalesce\",\"collate\",\"collation\",\"column\",\"comment\",\"comments\",\"commit\",\"committed\",\"concurrently\",\"configuration\",\"conflict\",\"connection\",\"constraint\",\"constraints\",\"content\",\"continue\",\"conversion\",\"copy\",\"cost\",\"create\",\"cross\",\"csv\",\"cube\",\"current\",\"current_catalog\",\"current_date\",\"current_role\",\"current_schema\",\"current_time\",\"current_timestamp\",\"current_user\",\"cursor\",\"cycle\",\"data\",\"database\",\"day\",\"deallocate\",\"dec\",\"decimal\",\"declare\",\"default\",\"defaults\",\"deferrable\",\"deferred\",\"definer\",\"delete\",\"delimiter\",\"delimiters\",\"depends\",\"desc\",\"dictionary\",\"disable\",\"discard\",\"distinct\",\"do\",\"document\",\"domain\",\"double\",\"drop\",\"each\",\"else\",\"enable\",\"encoding\",\"encrypted\",\"end\",\"enum\",\"escape\",\"event\",\"except\",\"exclude\",\"excluding\",\"exclusive\",\"execute\",\"exists\",\"explain\",\"extension\",\"external\",\"extract\",\"false\",\"family\",\"fetch\",\"filter\",\"first\",\"float\",\"following\",\"for\",\"force\",\"foreign\",\"forward\",\"freeze\",\"from\",\"full\",\"function\",\"functions\",\"global\",\"grant\",\"granted\",\"greatest\",\"group\",\"grouping\",\"handler\",\"having\",\"header\",\"hold\",\"hour\",\"identity\",\"if\",\"ilike\",\"immediate\",\"immutable\",\"implicit\",\"import\",\"in\",\"including\",\"increment\",\"index\",\"indexes\",\"inherit\",\"inherits\",\"initially\",\"inline\",\"inner\",\"inout\",\"input\",\"insensitive\",\"insert\",\"instead\",\"int\",\"integer\",\"intersect\",\"interval\",\"into\",\"invoker\",\"is\",\"isnull\",\"isolation\",\"join\",\"key\",\"label\",\"language\",\"large\",\"last\",\"lateral\",\"leading\",\"leakproof\",\"least\",\"left\",\"level\",\"like\",\"limit\",\"listen\",\"load\",\"local\",\"localtime\",\"localtimestamp\",\"location\",\"lock\",\"locked\",\"logged\",\"mapping\",\"match\",\"materialized\",\"maxvalue\",\"method\",\"minute\",\"minvalue\",\"mode\",\"month\",\"move\",\"name\",\"names\",\"national\",\"natural\",\"nchar\",\"next\",\"no\",\"none\",\"not\",\"nothing\",\"notify\",\"notnull\",\"nowait\",\"null\",\"nullif\",\"nulls\",\"numeric\",\"object\",\"of\",\"off\",\"offset\",\"oids\",\"on\",\"only\",\"operator\",\"option\",\"options\",\"or\",\"order\",\"ordinality\",\"out\",\"outer\",\"over\",\"overlaps\",\"overlay\",\"owned\",\"owner\",\"parallel\",\"parser\",\"partial\",\"partition\",\"passing\",\"password\",\"placing\",\"plans\",\"policy\",\"position\",\"preceding\",\"precision\",\"prepare\",\"prepared\",\"preserve\",\"primary\",\"prior\",\"privileges\",\"procedural\",\"procedure\",\"program\",\"quote\",\"range\",\"read\",\"real\",\"reassign\",\"recheck\",\"recursive\",\"ref\",\"references\",\"refresh\",\"reindex\",\"relative\",\"release\",\"rename\",\"repeatable\",\"replace\",\"replica\",\"reset\",\"restart\",\"restrict\",\"returning\",\"returns\",\"revoke\",\"right\",\"role\",\"rollback\",\"rollup\",\"row\",\"rows\",\"rule\",\"savepoint\",\"schema\",\"scroll\",\"search\",\"second\",\"security\",\"select\",\"sequence\",\"sequences\",\"serializable\",\"server\",\"session\",\"session_user\",\"set\",\"setof\",\"sets\",\"share\",\"show\",\"similar\",\"simple\",\"skip\",\"smallint\",\"snapshot\",\"some\",\"sql\",\"stable\",\"standalone\",\"start\",\"statement\",\"statistics\",\"stdin\",\"stdout\",\"storage\",\"strict\",\"strip\",\"substring\",\"symmetric\",\"sysid\",\"system\",\"table\",\"tables\",\"tablesample\",\"tablespace\",\"temp\",\"template\",\"temporary\",\"text\",\"then\",\"time\",\"timestamp\",\"to\",\"trailing\",\"transaction\",\"transform\",\"treat\",\"trigger\",\"trim\",\"true\",\"truncate\",\"trusted\",\"type\",\"types\",\"unbounded\",\"uncommitted\",\"unencrypted\",\"union\",\"unique\",\"unknown\",\"unlisten\",\"unlogged\",\"until\",\"update\",\"user\",\"using\",\"vacuum\",\"valid\",\"validate\",\"validator\",\"value\",\"values\",\"varchar\",\"variadic\",\"varying\",\"verbose\",\"version\",\"view\",\"views\",\"volatile\",\"when\",\"where\",\"whitespace\",\"window\",\"with\",\"within\",\"without\",\"work\",\"wrapper\",\"write\",\"xml\",\"xmlattributes\",\"xmlconcat\",\"xmlelement\",\"xmlexists\",\"xmlforest\",\"xmlparse\",\"xmlpi\",\"xmlroot\",\"xmlserialize\",\"year\",\"yes\",\"zone\"];\n }\n }",
"protected function setKeywords() {\r\n\t\t$keywords = $this->newsItem->getKeywords();\r\n\t\t$keywordsAction = $this->settings['news']['semantic']['general']['keywords']['action'];\r\n\t\t$pageKeywords = $GLOBALS['TSFE']->page['keywords'];\r\n\t\tif (!empty($keywordsAction) && !empty($pageKeywords)) {\r\n\t\t\tswitch ($keywordsAction) {\r\n\t\t\t\tcase 'prepend':\r\n\t\t\t\t\t$keywords = (empty($keywords)) ? $pageKeywords : $keywords . ', ' . $pageKeywords;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tcase 'append':\r\n\t\t\t\t\t$keywords = (empty($keywords)) ? $pageKeywords : $pageKeywords . ',' . $keywords;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\tdefault:\r\n\t\t\t}\r\n\t\t}\r\n\t\t$keywordsArray = t3lib_div::trimExplode(',', $keywords);\r\n\t\t$keywordsLimit = intval($this->settings['news']['semantic']['general']['keywords']['limit']);\r\n\t\t$this->keywords = (empty($keywordsLimit)) ? array_unique($keywordsArray) : $this->keywords = array_slice(array_unique($keywordsArray), 0, $keywordsLimit);\r\n\t}",
"function add_keywords($keywords) {\n\n $operations = array();\n\n for ($i = 0; $i < count($keywords); $i++) {\n\n $k = $keywords[$i];\n\n if (!isset($k['match_type']))\n $k['match_type'] = AW_MATCH_TYPE_BROAD;\n\n $keyword = '<criterion xsi:type=\"Keyword\">\n <text>'.$this->__xml($k['text']).'</text>\n <matchType>'.\n $this->__xml($k['match_type'])\n .'</matchType>\n </criterion>';\n\n $operations[] =\n $this->__make_criterion_operation('ADD',\n $k['ad_group_id'],\n $keyword,\n $k['user_status'],\n $k['destination_url']);\n\n }\n\n return $this->__do_mutate('AdGroupCriterionService', $operations);\n\n}",
"public function AddHeadKeywords($keywords){\r\n\t\t$this->head->AddKeywords($keywords);\r\n\t}",
"public function insertKeyword($page_id, $word) {\n $page_id = $this->connection->escape_string($page_id);\n $word = $this->connection->escape_string($word);\n \n $this->query(\"INSERT INTO Keywords (page_id, word)\"\n . \" VALUES ('$page_id', '$word')\");\n }",
"public function testAssignKeywords()\n {\n $this->markTestIncomplete(\n 'This test has not been implemented yet.'\n );\n }",
"private function create_frequency_table($words)\n {\n foreach($words as $key => $word) \n {\n $this->insert_word($word);\n }\n }",
"public function setKeywords($keywords, $encoding = 'UTF-8') {}",
"static public function addKeyword($new_keyword) {\n\t\tself::$page_keywords[] = (string)trim($new_keyword);\n\t}",
"public function setKeywords($keywords)\n {\n $this->keywords = (array)$keywords;\n }",
"public static function AddCountOfWords() {\r\n $conn = ModMetocHelper::coToDa();\r\n $cont = ModMetocHelper::conTab();\r\n\r\n $sql = \"ALTER TABLE $cont ADD count_of_words INT(10)\";\r\n $result = $conn->query($sql);\r\n }",
"function gwAddTerm($arPre, $id_dict, $arStop, $in_term, $is_specialchars, $is_overwrite, $intLine = 0, $isDelete = 0)\r\n{\r\n\tglobal $oDom, $oFunc, $oDb, $oSqlQ, $oCase, $oL, $oHtml, $oSess;\r\n\tglobal $arFields, $arDictParam, $arTermParam, $cnt, $tid, $sys;\r\n\tglobal $gw_this, $qT;\r\n\r\n#\t@header(\"content-type: text/html; charset=utf-8\");\r\n\r\n\t$id_w = $oDb->MaxId($arDictParam['tablename']);\r\n\t$isQ = 1;\r\n\t$isCleanMap = 0;\r\n\t$id_old = isset($tid) ? $tid : 0;\r\n\t$queryA = $qT = array();\r\n\t$isTermExist = 0;\r\n\t/* Used for keywords */\r\n\t$str_term_filtered = $oDom->get_content($arPre['term']);\r\n\t/* remove {TEMPLATES}, {%TEMPLATES%} */\r\n\t$str_term_filtered = preg_replace(\"/{(%)?([A-Za-z0-9:\\-_]+)(%)?}/\", '', $str_term_filtered);\r\n\t$str_term_filtered = trim($str_term_filtered);\r\n\t/* Used in database */\r\n\t$str_term_src = gw_fix_input_to_db($str_term_filtered);\r\n\t\r\n\t$str_term_filtered = gw_unhtmlspecialamp($str_term_filtered);\r\n\t/* 22 jul 2003: Custom Term ID */\r\n\t$qT['id'] = $oDom->get_attribute('id', 'term', $arPre['term'] );\r\n\t$qT['id'] = preg_replace(\"/[^0-9]/\", '', trim($qT['id']));\r\n\t/* */\r\n\tif (!$isDelete)\r\n\t{\r\n\t\t/* -- Check for an existed term -- */\r\n\t\t/* prepare keywords for a term */\r\n\t\tif ($is_specialchars)\r\n\t\t{\r\n\t\t\t/* Keep specials */\r\n\t\t\t$str_term_filtered = $oCase->nc($str_term_filtered);\r\n\t\t\t$str_term_filtered = gw_text_wildcars($str_term_filtered);\r\n\t\t\t$arKeywordsT = text2keywords($oCase->rm_($str_term_filtered), 1);\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t/* Remove specials */\r\n\t\t\t$str_term_filtered = text_normalize($str_term_filtered);\r\n\t\t\t$arKeywordsT = text2keywords($str_term_filtered, $arDictParam['min_srch_length']);\r\n\t\t}\r\n\t\t/* Are there any keywords? */\r\n\t\t$isTermEmpty = (empty($arKeywordsT) && (strlen(trim( $str_term_filtered )) == 0)) ? 1 : 0;\r\n\t\tif (!$isTermEmpty)\r\n\t\t{\r\n\t\t\t/* no empty keywords for a term */\r\n\t\t\t/* SQL-query */\r\n\t\t\t/* Get existent keywords, standard mode */\r\n\t\t\t$word_srch_sql = ($qT['id'] != '') ? 't.id = \"' . $qT['id'] . '\"' : '';\r\n\t\t\tif ($word_srch_sql == '')\r\n\t\t\t{\r\n\t\t\t\t$word_srch_sql = \"k.word_text IN ('\" . implode(\"', '\", $arKeywordsT) . \"')\";\r\n\t\t\t}\r\n\t\t\t$sql = $oSqlQ->getQ('get-term-exists', TBL_WORDLIST, $arDictParam['tablename'], $id_dict,\r\n\t\t\t\t\t\t$in_term, $word_srch_sql\r\n\t\t\t\t\t);\r\n\t\t\t/* Get existent keywords, keep specialchars mode */\r\n\t\t\tif (($is_specialchars) || empty($arKeywordsT))\r\n\t\t\t{\r\n\t\t\t\t$ar_chars_sql = array('\\\\' => '\\\\\\\\', '\\\\%' => '\\\\\\\\\\\\\\%', '\\\\_' => '\\\\\\\\\\\\\\_', '\\\\\"' => '\\\\\\\\\\\\\\\"', \"\\\\'\" => \"\\\\\\\\\\\\\\'\");\r\n\t\t\t\t$sql = $oSqlQ->getQ('get-term-exists-spec', $arDictParam['tablename'],\r\n\t\t\t\t\t\tstr_replace(array_keys($ar_chars_sql), array_values($ar_chars_sql), gw_addslashes( $str_term_src ))\r\n\t\t\t\t\t);\r\n\t\t\t}\r\n\t\t\t$arSql = $oDb->sqlExec($sql);\r\n#\t\t\tprn_r($arSql, __LINE__ . '<br />' . $sql);\r\n\t\t\t$isTermNotMatched = 1; // `No term found' by default\r\n\r\n\t\t\tfor (; list($arK, $arV) = each($arSql);) // compare founded values (Q) with imported (T)\r\n\t\t\t{\r\n\t\t\t\t$id_old = $arV['id']; // get ID for existent keywords.\r\n\t\t\t\tif ($id_old == $qT['id'])\r\n\t\t\t\t{\r\n\t\t\t\t\t$isTermNotMatched = 0;\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t\tif ($is_specialchars)\r\n\t\t\t\t{\r\n\t\t\t\t\t/* 1 - is the minimum length */\r\n\t\t\t\t\t$arKeywordsQ = text2keywords( text_normalize($arV['term']), 1);\r\n\t\t\t\t}\r\n\t\t\t\telse\r\n\t\t\t\t{\r\n\t\t\t\t\t/* $arDictParam['min_srch_length'] - is the minimum length */\r\n\t\t\t\t\t$arKeywordsQ = text2keywords( text_normalize($arV['term']), $arDictParam['min_srch_length']);\r\n\t\t\t\t}\r\n#\t\t\t\tprn_r($arKeywordsQ);\r\n\t\t\t\t$div1 = sizeof(gw_array_exclude($arKeywordsT, $arKeywordsQ));\r\n\t\t\t\t$div2 = sizeof(gw_array_exclude($arKeywordsQ, $arKeywordsT));\r\n\t\t\t\t$isTermNotMatched = ($div1 + $div2);\r\n\t\t\t\t// if the sum of excluded arrays is 0, this term already exists\r\n\t\t\t\tif (!$isTermNotMatched) // in english, double negative means positive... yeah\r\n\t\t\t\t{\r\n\t\t\t\t\tbreak;\r\n\t\t\t\t}\r\n\t\t\t} // end of for each founded terms\r\n\t\t\tif ($isTermNotMatched > 0)\r\n\t\t\t{\r\n\t\t\t\t$isQ = 1;\r\n\t\t\t\t$isTermExist = 0;\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$isTermExist = 1;\r\n\t\t\t}\r\n\t\t} // !$isTermEmpty\r\n\t}\r\n\t/* */\r\n\tif (!isset($str_term_filtered))\r\n\t{\r\n\t\t$str_term_filtered = gw_text_wildcars($str_term_filtered);\r\n\t\t$str_term_filtered = text_normalize($str_term_filtered);\r\n\t}\r\n\t/* 21 jan 2006: new `date_created' for new terms */\r\n\t/* 23 apr 2008: subtract 61 second */\r\n\t$qT['date_created'] = isset($arPre['date_created']) ? $arPre['date_created'] : $sys['time_now_gmt_unix'];\r\n\t$qT['date_modified'] = $sys['time_now_gmt_unix'] - 61;\r\n\t$qT['date_created'] -= 61;\r\n\t/* 21 jul 2003: Better protection by adding random Next ID number */\r\n\t$arTermParam['tid'] = $qT['id'] = ($qT['id'] == '') ? mt_rand($id_w, ($sys['leech_factor'] * 2) + $id_w) : $qT['id'];\r\n\t$qT['term'] = $str_term_src;\r\n\t/* 15 sep 2007: Term URI */\r\n\t/* 08 apr 2008: Make link to added term */\r\n\t/* 11 apr 2008: Better URI */\r\n\t/* 23 apr 2008: Even better URI. Added transliteration. */\r\n\t$qT['term_uri'] = $oDom->get_attribute('uri', 'term', $arPre['term'] );\r\n\t$qT['term_uri'] = ($qT['term_uri'] == '') ? $qT['id'].'-'.$oCase->translit( $oCase->lc($str_term_filtered)) : $qT['term_uri'];\r\n\t$qT['term_uri'] = $oCase->rm_entity($qT['term_uri']);\r\n\t$qT['term_uri'] = preg_replace('/[^0-9A-Za-z_-]/', '-', $qT['term_uri']);\r\n\t$qT['term_uri'] = preg_replace('/-{2,}/', '-', $qT['term_uri']);\r\n\tif ($qT['term_uri'] == '-')\r\n\t{\r\n\t\t$qT['term_uri'] = $qT['id'].'-';\r\n\t}\r\n\t$arTermParam['term_uri'] = $qT['term_uri'];\r\n\r\n\t$qT['defn'] =& $arPre['parameters']['xml'];\r\n\t/* Alphabetic orders 1,2,3 */\r\n\t$qT['term_1'] = $oDom->get_attribute('t1', 'term', $arPre['term'] );\r\n\t$qT['term_2'] = $oDom->get_attribute('t2', 'term', $arPre['term'] );\r\n\t$qT['term_3'] = $oDom->get_attribute('t3', 'term', $arPre['term'] );\r\n\t/* -- Custom Alphabetic Toolbar -- */\r\n\t/* Select custom rules for uppercasing */\r\n\t$sql = 'SELECT az_value, az_value_lc FROM `'.$sys['tbl_prefix'].'custom_az` WHERE `id_profile` = \"'.$arDictParam['id_custom_az'].'\"';\r\n\t$arSqlAz = $oDb->sqlRun($sql, 'st');\r\n\tfor (; list($arK, $arV) = each($arSqlAz);)\r\n\t{\r\n\t\t$str_term_src = str_replace($arV['az_value_lc'], $arV['az_value'], $str_term_src);\r\n\t}\r\n\t/* Unicode uppercase */\r\n\t$str_term_src_uc = $oCase->uc( $str_term_src );\r\n\t/* 1.8.7: Custom sorting order */\r\n\t$qT['term_order'] = $oDom->get_attribute('term_order', 'term', $arPre['term'] );\r\n\t$qT['term_order'] = ($qT['term_order'] == '') ? $str_term_src_uc : $qT['term_order'];\r\n\t$qT['term_a'] = $qT['term_b'] = $qT['term_c'] = $qT['term_d'] = $qT['term_e'] = $qT['term_f'] = 0;\r\n\t/* Prepare A, AAZZ, AAAZZZ */\r\n\t$qT['term_3'] = ($qT['term_3'] == '') ? $oFunc->mb_substr($str_term_filtered, 2, 1, $sys['internal_encoding']) : $qT['term_3'];\r\n\t$qT['term_2'] = ($qT['term_2'] == '') ? $oFunc->mb_substr($str_term_filtered, 1, 1, $sys['internal_encoding']) : $qT['term_2'];\r\n\t$qT['term_1'] = ($qT['term_1'] == '') ? $oFunc->mb_substr($str_term_filtered, 0, 1, $sys['internal_encoding']) : $qT['term_1'];\r\n\t/* */\r\n\t$ar_field_names = array('a','b','c','d','e','f');\r\n\tpreg_match_all(\"/./u\", $qT['term_order'], $ar_letters);\r\n\tfor (; list($cnt_letter, $letter) = each($ar_letters[0]);)\r\n\t{\r\n\t\tif (isset($ar_field_names[$cnt_letter]))\r\n\t\t{\r\n\t\t\t$qT['term_'.$ar_field_names[$cnt_letter]] = text_str2ord($letter);\r\n\t\t}\r\n\t}\r\n\t/* Fix htmlspecial characters */\r\n\t$qT['term_3'] = gw_htmlspecialamp(gw_unhtmlspecialamp($qT['term_3']));\r\n\t$qT['term_2'] = gw_htmlspecialamp(gw_unhtmlspecialamp($qT['term_2']));\r\n\t$qT['term_1'] = gw_htmlspecialamp(gw_unhtmlspecialamp($qT['term_1']));\r\n\t/* */\r\n\t$qT['is_active'] = $oDom->get_attribute('is_active', 'term', $arPre['term']);\r\n\t$qT['is_complete'] = $oDom->get_attribute('is_complete', 'term', $arPre['term']);\r\n#prn_r($qT, __LINE__.__FILE__);\r\n#exit;\r\n\tif ($isDelete || $isTermExist)\r\n\t{\r\n\t\t/* Assign Term ID from previously added term */\r\n\t\t$arTermParam['tid'] = $id_old;\r\n\t\tif ($is_overwrite)\r\n\t\t{\r\n\t\t\t$qT['id'] = $id_old;\r\n\t\t\t$isCleanMap = 1;\r\n\t\t\t$isTermExist = 0;\r\n#\t\t\t$queryA[] = $oSqlQ->getQ('del-term_id', $arDictParam['tablename'], $id_old, $id_dict);\r\n\t\t}\r\n\t}\r\n\tif (!$isDelete && $isTermExist)\r\n\t{\r\n\t\t/* Term already exists */\r\n\t\t$ar_matched_terms = array();\r\n\t\tfor (reset($arSql); list($arK, $arV) = each($arSql);)\r\n\t\t{\r\n\t\t\t$ar_matched_terms[] = $oHtml->a($sys['page_admin'].'?'.GW_ACTION.'='.GW_A_EDIT.'&'.GW_TARGET.'='.GW_T_TERMS.'&id='.$id_dict.'&tid=' . $arV['id'],\r\n\t\t\t\t\t\t $arV['term'], '', '', $oL->m('3_edit'));\r\n\t\t}\r\n\t\t$str_line = implode(' | ', $ar_matched_terms);\r\n\t\t$queryA = '<dl style=\"margin:0\">';\r\n\t\t$queryA .= '<dt class=\"xu red\">'.$oL->m('reason_25').' - <strong>'. $str_term_src . '</strong></dt>';\r\n\t\t$queryA .= '<dd class=\"termpreview\">' .$str_line. '</dd>';\r\n\t\t$queryA .= '</dl>';\r\n\t\t$isQ = 0;\r\n\t}\r\n\t/* Allow query */\r\n\tif ($isQ)\r\n\t{\r\n\t\t/* Prepare keywords per field */\r\n#\t\t$ot = new gw_timer('addterm');\r\n\t\tfor (reset($arFields); list($fK, $fV) = each($arFields);)\r\n\t\t{\r\n\t\t\t// Init\r\n\t\t\t$arKeywords[$fK] = array();\r\n\t\t\t//\r\n#\t\t\t$int_min_length = (isset($fV[2]) && ($fV[2] != 'auto') && ($fV[2] != '')) ? $fV[2] : $arDictParam['min_srch_length'];\r\n#\t\t\t$int_min_length = (!isset($fV[2]) || ($fV[2] == 'auto') ) ? $int_min_length : $fV[2];\r\n\t\t\t//\r\n\t\t\t// Make keywords from array\r\n\t\t\t// space is required, otherwise `...word</defn><defn>word...' will become `wordword'\r\n\t\t\t$tmpStr = '';\r\n\t\t\tif (isset($arPre[$fV[0]]))\r\n\t\t\t{\r\n\t\t\t\t$tmpStr = $oDom->get_content( $arPre[$fV[0]] );\r\n\t\t\t}\r\n\t\t\tif ($tmpStr != '') // do not parse empty strings\r\n\t\t\t{\r\n\t\t\t\t// Get maximum search length per field\r\n\t\t\t\t$int_min_length = $fV[2];\r\n\t\t\t\tif ( is_string($int_min_length) )\r\n\t\t\t\t{\r\n\t\t\t\t\t$int_min_length = $arDictParam['min_srch_length'];\r\n\t\t\t\t}\r\n#\t\t\t\t$isStrip = ($srchLength == 1) ? 0 : 1;\r\n# prn_r( text_normalize( $tmpStr ) . ' ' . $fV[0] . '; len=' . $int_min_length);\r\n\t\t\t\t/* Fix wildcars, 1.6.1 */\r\n\t\t\t\t$tmpStr = str_replace('<![CDATA[', '', $tmpStr);\r\n\t\t\t\t$tmpStr = str_replace(']]>', '', $tmpStr);\r\n\t\t\t\t$tmpStr = gw_text_wildcars($tmpStr);\r\n\t\t\t\t/* */\r\n#\t\t\t\tprn_r( $fV );\r\n\t\t\t\t$arKeywords[$fK] = text2keywords( gw_text_sql(text_normalize($tmpStr)), $int_min_length, 25, $sys['internal_encoding'] );\r\n\t\t\t\t/* Remove stopwords from parsed strings only (others are empty) */\r\n\t\t\t\t$arKeywords[$fK] = gw_array_exclude( $arKeywords[$fK], $arStop);\r\n\t\t\t}\r\n\t\t}\r\n\t\t/* keywords convertion time */\r\n#\t\tprn_r( $arKeywords );\r\n#\t\tprint $ot->endp(__LINE__, __FILE__);\r\n#\t\texit;\r\n\t\t/* Remove double keywords from definition */\r\n\t\tfor (reset($arFields); list($fK, $fV) = each($arFields);)\r\n\t\t{\r\n\t\t\tif ($fK != 0)\r\n\t\t\t{\r\n\t\t\t\t$arKeywords[0] = gw_array_exclude( $arKeywords[0], $arKeywords[$fK]);\r\n\t\t\t}\r\n\t\t}\r\n\t\t/** Keywords were prepared */\r\n\t\t/** Add keywords to database! */\r\n# prn_r($arStop);\r\n# prn_r($arKeywords);\r\n# prn_r($arPre);\r\n\t\tgwAddNewKeywords($id_dict, $qT['id'], $arKeywords, $id_old, $isCleanMap, $qT['date_created']);\r\n\t\t$qT['int_bytes'] = strlen($qT['defn']);\r\n\t\t/* Checksum */\r\n\t\t$qT['crc32u'] = crc32($str_term_src_uc);\r\n\t\t/* Add User ID to term */\r\n\t\tif ($gw_this['vars'][GW_ACTION] == GW_A_ADD)\r\n\t\t{\r\n\t\t\t$qT['id_user'] = $oSess->id_user;\r\n\t\t}\r\n\t\t/* Add relation `user to term' */\r\n\t\t$q2['user_id'] = $oSess->id_user;\r\n\t\t$q2['term_id'] = $qT['id'];\r\n\t\t$q2['dict_id'] = $id_dict;\r\n\t\t// -------------------------------------------------\r\n\t\t// Turn on text parsers\r\n\t\t// -------------------------------------------------\r\n\t\t// Process automatic functions\r\n\t\tfor (; list($k, $v) = each($gw_this['vars']['funcnames'][GW_A_UPDATE . GW_T_TERM]);)\r\n\t\t{\r\n\t\t\tif (function_exists($v))\r\n\t\t\t{\r\n\t\t\t\t$v();\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t/* REPLACE or UPDATE */\r\n\t\tif ($isDelete || $isTermExist)\r\n\t\t{\r\n\t\t\tif ($is_overwrite)\r\n\t\t\t{\r\n\t\t\t\tunset($qT['id']);\r\n\t\t\t\t$queryA[] = gw_sql_update($qT, $arDictParam['tablename'], 'id = \"'.$id_old.'\"');\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$id_old = $qT['id'];\r\n\t\t\t$queryA[] = gw_sql_insert($qT, $arDictParam['tablename'], 1);\r\n\t\t}\r\n\r\n\t\t/* 23 Nov 2007: history of changes */\r\n\t\t$qT['id_term'] = $id_old;\r\n\t\t$qT['id_dict'] = $arDictParam['id'];\r\n\t\t$qT['id_user'] = $oSess->id_user;\r\n\t\t$qT['keywords'] = serialize($arKeywords);\r\n\t\tunset($qT['id']);\r\n\t\t\r\n\t\t$queryA[] = gw_sql_insert($qT, $sys['tbl_prefix'].'history_terms', 1);\r\n\t\t/* Assign edited term to user */\r\n\t\t$queryA[] = gw_sql_replace($q2, TBL_MAP_USER_TERM, 1);\r\n\t\t/* Check table to keep indexes */\r\n\t\t$arQuery[] = 'CHECK TABLE `'.$arDictParam['tablename'].'`';\r\n\t} /* is_query allowed */\r\n\treturn $queryA;\r\n}",
"static public function setTopicKeywords($keywords, $topicid, $userid, $glue=null) {\n\t\tif (!isset(self::$_topics [$topicid][$userid])) {\n\t\t\tself::loadTopics(array($topicid), $userid);\n\t\t}\n\t\t$oldkeywords = isset(self::$_topics [$topicid][$userid]) ? self::$_topics [$topicid][$userid] : array();\n\n\t\t// Load new keywords missing from the topic\n\t\t$keywords = self::cleanKeywords($keywords, $glue);\n\t\tself::loadKeywords($keywords);\n\n\t\t$keywords = array_flip($keywords);\n\t\t$dellist = array_diff_key ( $oldkeywords, $keywords );\n\t\t$addlist = array_diff_key ( $keywords, $oldkeywords );\n\t\tforeach ($dellist as $keyword=>$i) {\n\t\t\t$instance = self::$_instances [$keyword];\n\t\t\t$instance->delTopic($topicid, $userid);\n\t\t}\n\t\tforeach ($addlist as $keyword=>$i) {\n\t\t\t$instance = self::$_instances [$keyword];\n\t\t\t$instance->addTopic($topicid, $userid);\n\t\t}\n\t\treturn $keywords;\n\t}",
"public function registerKeywords(array $keywords) {\r\n\t\tforeach ($keywords as $nextKeyword) {\r\n\t\t\t$this->registerKeyword($nextKeyword);\r\n\t\t}\r\n\t}",
"public function keywords()\r\n {\r\n }",
"function bl_InsertWords($page_id,$words)\n {\n\n \tforeach ($words as $word => $infos) \n \t{\n\t\t\t// On test si l'URL existe deja\n\t\t\t$worditem = db_getWordByWord($word);\n\t\t\tif (!$worditem) {\n\t\t\t\t$id = db_addWord($word);\n\t\t\t} else {\n\t\t\t\t// l'URL existe deja\n\t\t\t\t$id = $worditem['word_id'];\n\t\t\t}\n\n\n \t\t//if (!db_isWordedExist($page_id,$id)) {\n \t\t\t//db_createFastWorded($page_id,$id,$infos['total']['avg_weight'],$infos['total']['avg_density']);\n \t\t//}\n \t\t//db_insertWordedData($page_id,$id,$tag,$infos['freq'],$infos['density'],$infos['weight']);\n \t}\n \tdb_createFastWorded($page_id,$words);\n }",
"public function run()\n {\n $keywords = ['new', 'internal', 'expensive', 'second hand', 'antique', 'electronic', 'furniture'];\n\n foreach ($keywords as $keywordName) {\n $keyword = new Keyword();\n $keyword->name = $keywordName;\n $keyword->save();\n }\n }",
"public function setKeywords($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->keywords = $arr;\n\n return $this;\n }",
"static public function setKeywords($new_keywords) {\n\t\tif (is_string($new_keywords)) {\n\t\t\t$new_keywords = explode(',', $new_keywords);\n\t\t\tforeach($new_keywords as &$keyword) {\n\t\t\t\t$keyword = trim($keyword);\n\t\t\t}\n\t\t}\n\t\tself::$page_keywords = (array)$new_keywords;\n\t}",
"public function setKeywords(string $keywords)\n {\n $this->keywords = $keywords;\n }",
"public function setKeyWord($key){\n $this->keyword = $key;\n }",
"static function save_keywords($post_id, $keywords){\n\t\t\tupdate_post_meta($post_id, 'affiliate_keywords', $keywords);\n\t\t}",
"function setKeyWords( &$value )\n {\n if ( $this->State_ == \"Dirty\" )\n $this->get( $this->ID );\n\n $this->KeyWords = ( $value );\n }",
"public function CargarKeywords()\n\t{\n\t\t$data_table = $this->data_source->ejecutarConsulta(\"SELECT * FROM keywords\");\n\t\treturn $data_table;\n\t}",
"public function setKeywords($keywords, int $maxLength = null);",
"abstract function getKeywords();",
"public function setKeywords(?AnswerKeyword $value): void {\n $this->getBackingStore()->set('keywords', $value);\n }",
"public function addKeyword($keyword)\n {\n $this->keywords[$keyword] = $keyword;\n }",
"public function run()\n\t{\n\t\t\\DB::table('keywords')->truncate();\n \n\t\t\\DB::table('keywords')->insert(array (\n\t\t\t0 => \n\t\t\tarray (\n\t\t\t\t'id' => 1,\n\t\t\t\t'pin_id' => 1,\n 'occurrences' => 2,\n\t\t\t\t'keywords' => 'Let\\'s go crazy',\n\t\t\t),\n\t\t\t1 => \n\t\t\tarray (\n\t\t\t\t'id' => 2,\n\t\t\t\t'pin_id' => 3,\n 'occurrences' => 2,\n 'keywords' => 'Testing keywords',\n\t\t\t),\n\t\t));\n\t}",
"private function internal_add_words($title, $content) {\n global $DB;\n\n // Build up set of words with counts.\n $wordset = array();\n self::internal_add_to_wordset($wordset, $title, true);\n self::internal_add_to_wordset($wordset, self::strip_xhtml($content));\n if (count($wordset) == 0) {\n return true;\n }\n\n // Cut down all words to max db length.\n foreach ($wordset as $word => $count) {\n // Check byte length just to save time.\n if (strlen($word) > self::MAX_WORD_LENGTH) {\n // Cut length of word.\n $short = core_text::substr($word, 0, self::MAX_WORD_LENGTH);\n\n // Combine with existing word if there are two with same prefix.\n if (array_key_exists($short, $wordset)) {\n $count += $wordset[$short];\n }\n\n // Save as short word and remove long one.\n $wordset[$short] = $count;\n unset($wordset[$word]);\n }\n }\n\n // Get word IDs from database.\n $list = '';\n $listarray = array();\n foreach ($wordset as $word => $count) {\n $list .= \",?\";\n $listarray[] = $word;\n }\n $list = substr($list, 1); // Get rid of first comma.\n $dbwords = $DB->get_records_select('local_ousearch_words',\n 'word IN (' . $list . ')', $listarray, '', 'word,id');\n\n // Add any missing words to database. This is a performance-critical\n // operation, so we provide an efficient way to do it coded specifically\n // for Postgres. Unfortunately this cannot be done with standard Moodle\n // Postgres driver because it does not expose the Postgres connection\n // ID, so you can only use this if you use an OU overridden version of\n // the Postgres driver. (This override is very simple. It is available\n // in OU public repository in lib/dml folder.)\n if ($fastpg = is_a($DB, 'ou_pgsql_native_moodle_database')) {\n // Do this in 512-word blocks (there is a limit at 1664).\n $sequences = array();\n $pos = 0;\n $missingwords = array();\n foreach ($wordset as $word => $count) {\n if (!isset($dbwords[$word])) {\n $missingwords[$pos] = $word;\n $sequenceindex = (int)($pos / 512);\n if (!array_key_exists($sequenceindex, $sequences)) {\n $sequences[$sequenceindex] = '';\n }\n // Note: Cannot use {} syntax here because the sequence name\n // is inside a string so I don't think Moodle will replace\n // it.\n $sequences[$sequenceindex] .= ',nextval(\\'' .\n $DB->get_prefix() .\n 'local_ousearch_words_id_seq\\') AS s' . $pos;\n $pos++;\n }\n }\n if (count($missingwords) > 0) {\n foreach ($sequences as $sequenceindex => $sequenceselect) {\n $rs = $DB->get_recordset_sql($sql = 'SELECT ' .\n substr($sequences[$sequenceindex], 1), array());\n $fields = (array)$rs->current();\n $rs->close();\n $data = array();\n for ($i = $sequenceindex * 512;\n $i < $pos && $i < ($sequenceindex + 1) * 512;\n $i++) {\n $id = $fields['s' . $i];\n $data[] = $id . \"\\t\" . $missingwords[$i];\n $dbwords[$missingwords[$i]] = new stdClass;\n $dbwords[$missingwords[$i]]->id = $id;\n }\n if (!pg_copy_from($DB->get_pgsql_connection_id(),\n $DB->get_prefix() . 'local_ousearch_words',\n $data)) {\n throw new dml_exception(\n 'fastinserterror', 'local_ousearch');\n }\n }\n }\n } else {\n // This is the slow Moodle-standard way to insert words, for all\n // other database drivers.\n foreach ($wordset as $word => $count) {\n if (!isset($dbwords[$word])) {\n $newword = (object)array('word' => $word);\n $newword->id = $DB->insert_record(\n 'local_ousearch_words', $newword);\n $dbwords[$word] = $newword;\n }\n }\n }\n\n // Now add the records attaching the words, with scoring, to this document.\n if ($fastpg && count($wordset) > 0) {\n // Fast insert data.\n $data = array();\n foreach ($wordset as $word => $count) {\n $titlecount = empty($count[true]) ? 0 : $count[true];\n $bodycount = empty($count[false]) ? 0 : $count[false];\n $score = ($bodycount < 15 ? $bodycount : 15) +\n ($titlecount < 15 ? $titlecount * 16 : 15 * 16);\n\n $data[] = $dbwords[$word]->id . \"\\t\" . $this->id . \"\\t\" .\n $score;\n }\n if (!pg_copy_from($DB->get_pgsql_connection_id(),\n $DB->get_prefix() . $this->get_occurrences_table(), $data)) {\n throw new dml_exception(\n 'fastinserterror', 'local_ousearch');\n }\n } else {\n // Slow insert data for all databases.\n foreach ($wordset as $word => $count) {\n $titlecount = empty($count[true]) ? 0 : $count[true];\n $bodycount = empty($count[false]) ? 0 : $count[false];\n $score = ($bodycount < 15 ? $bodycount : 15) +\n ($titlecount < 15 ? $titlecount * 16 : 15 * 16);\n $DB->execute('INSERT INTO {' . $this->get_occurrences_table() . '}' .\n '(wordid, documentid, score) VALUES(?,?,?)',\n array($dbwords[$word]->id, $this->id, $score));\n }\n }\n }",
"public function setKeywords($val)\n {\n $this->_propDict[\"keywords\"] = $val;\n return $this;\n }",
"public function keywords(): morphMany\n {\n return $this->morphMany(ItemKeyword::class, 'keywordable');\n }",
"function tck_insert_link($args) {\n global $ydb;\n $keyword = $args[1];\n $table = YOURLS_DB_TABLE_URL;\n \n // Next we update the keyword based on the prefix.\n $prefix = substr($keyword, 0, 1);\n $fkeyword = substr($keyword, 1, strlen($keyword) - 1);\n\n $custom = 0;\n if ( $prefix == tck_get_prefix(0) ) $custom = 0;\n if ( $prefix == tck_get_prefix(1) ) $custom = 1;\n \n $sql = 'Update ' . $table . ' Set `keyword` = \\'' . $fkeyword . '\\', ';\n $sql .= '`' . TCK_COLUMN . '` = ' . $custom . ' Where `keyword` = \\'' . $keyword . '\\';';\n\n $ydb->query($sql);\n }",
"function add(Local_Domain_Models_Keyword $Keyword)\n {\n $this->doAdd($Keyword);\n }",
"public function multiInsert($words, $id_order)\n {\n foreach ($words as $word) {\n $this->db->insert(\"{$this->table}_search\", [\n 'word' => $word,\n 'id_order' => $id_order\n ]);\n }\n }",
"function get_keywords(){\n global $oDB;\n\t$query2 = \"SELECT words\n \tFROM collection_words\n WHERE words <> '' AND is_active = 1\";\n\n\t$result = $oDB->select($query2);\n\t\n\tif (mysqli_num_rows($result)==0) {\n // Exit if no collection words found\t\n print \"ERROR: No keywords found in collection_words table\";\n exit;\n } \n\telse if (mysqli_num_rows($result)>400) {\n // Exit if keyword count exceeds API limit of 400\n print \"ERROR: More than 400 keywords in collection_words table\";\n exit;\n }\n\n // Create a keyword list\n $keyword_array = array();\n\n while ($row=mysqli_fetch_assoc($result)) {\n array_push($keyword_array, $row['words']);\n }\t\t\n return $keyword_array;\n }",
"function set_keywords_from_search_query()\n\t{\n\t\t$santizied_search_query = $this->get_sanitized_search_query($this->search_query);\n\t\n\t\t$keywords_to_search_for = explode(' ',$santizied_search_query);\n\t\t$unique_keywords = array_unique($keywords_to_search_for);\n\t\t\n\t\t$this->keywords_to_search_for = $this->remove_ignored_keywords_from_array($unique_keywords);\n\t}",
"function setKeywords($keywords) {\n $this->fields['keywords'] = $keywords;\n return $this;\n }",
"private function generateKeywordsFromText($text){\n $stopWords = array('i','a','about','an','and','are','as','at','be','by','com','de','en','for','from','how','in','is','it','la','of','on','or','that','the','this','to','was','what','when','where','who','will','with','und','the','www', \"such\", \"have\", \"then\");\n\n\n //Let us do some basic clean up! on the text before getting to real keyword generation work\n\n $text = preg_replace('/\\s\\s+/i', '', $text); // replace multiple spaces etc. in the text\n $text = trim($text); // trim any extra spaces at start or end of the text\n $text = preg_replace('/[^a-zA-Z0-9 -]/', '', $text); // only take alphanumerical characters, but keep the spaces and dashes too…\n $text = strtolower($text); // Make the text lowercase so that output is in lowercase and whole operation is case in sensitive.\n\n // Find all words\n preg_match_all('/\\b.*?\\b/i', $text, $allTheWords);\n $allTheWords = $allTheWords[0];\n\n //Now loop through the whole list and remove smaller or empty words\n foreach ( $allTheWords as $key=>$item ) {\n if ( $item == '' || in_array(strtolower($item), $stopWords) || strlen($item) <= 3 ) {\n unset($allTheWords[$key]);\n }\n }\n\n // Create array that will later have its index as keyword and value as keyword count.\n $wordCountArr = array();\n\n // Now populate this array with keywrds and the occurance count\n if ( is_array($allTheWords) ) {\n foreach ( $allTheWords as $key => $val ) {\n $val = strtolower($val);\n if ( isset($wordCountArr[$val]) ) {\n $wordCountArr[$val]++;\n } else {\n $wordCountArr[$val] = 1;\n }\n }\n }\n\n // Sort array by the number of repetitions\n arsort($wordCountArr);\n\n //Keep first 10 keywords, throw other keywords\n $wordCountArr = array_slice($wordCountArr, 0, 10);\n\n // Now generate comma separated list from the array\n $words=\"\";\n foreach ($wordCountArr as $key=>$value)\n $words .= \", \" . $key ;\n\n // Trim list of comma separated keyword list and return the list\n return trim($words,\",\");\n }",
"function addProductKeywordRelation($idProduct, $idKeyword) {\r\n $table = \"products_has_keywords\";\r\n\r\n $dbc = connection();\r\n $dbc->quote($table);\r\n $req = \"INSERT INTO $table (id_products, id_keywords) VALUES (:idProduct, :idKeyword)\";\r\n\r\n $requPrep = $dbc->prepare($req); // on prépare notre requête\r\n $requPrep->bindParam(':idProduct', $idProduct, PDO::PARAM_STR);\r\n $requPrep->bindParam(':idKeyword', $idKeyword, PDO::PARAM_BOOL);\r\n $requPrep->execute();\r\n $requPrep->closeCursor();\r\n return $dbc->lastInsertId();\r\n}",
"public function getKeywords();",
"private function default_keywords() {\n\t\t// Default keywords.\n\t\techo WPSEO_News_Wrappers::textinput( 'default_keywords', __( 'Default Keywords', 'wordpress-seo-news' ) );\n\t\techo '<p class=\"desc label\">' . sprintf(\n\t\t\t/* translators: %1$s opening tag of the link to the Google suggested keywords page, %2$s closing tag for the link. */\n\t\t\t__( 'It might be wise to add some of the %1$sGoogle\\'s suggested keywords%2$s to all of your posts. Add them as a comma separated list.', 'wordpress-seo-news' ),\n\t\t\t'<a target=\"_blank\" href=\"http://www.google.com/support/news_pub/bin/answer.py?answer=116037\">',\n\t\t\t'</a>'\n\t\t) . '</p>';\n\n\t\techo WPSEO_News_Wrappers::checkbox( 'restrict_sitemap_featured_img', __( 'Only use the featured image for your News Sitemap, ignore images in post.', 'wordpress-seo-news' ), false );\n\t\techo '<br>';\n\t}",
"function get_keywords()\n{\n global $KEYWORDS_TABLE;\n $q = \"select keyword, description from `$KEYWORDS_TABLE` order by keyword;\";\n $rows = dbSelect($q, 'get_keywords()');\n $keywords = array();\n foreach ($rows as $row) {\n $keywords[] = $row[0];\n }\n return $keywords;\n}",
"public function add_keyword(){\n $this->autoRender = false;\n if( $this->request->is('post')){\n if( !empty( $this->request->data ) ){\n\n //pr( $this->request->data ); die;\n //$this->loadModel('ProductKeyword');\n if( $this->ProductKeyword->save($this->request->data)){\n $this->Session->setFlash('Keyword has been successfully saved!', 'default', array('class' => 'alert alert-success'));\n }\n }else{\n $this->Session->setFlash('Please enter valid information!', 'default', array('class' => 'alert alert-danger'));\n }\n $this->redirect( array('controller' =>'productranks', 'action' => 'ranking_tracker') );\n\n }\n\n }",
"public function setKeywords($keywords)\n\t{\n\t\t$this->keywords = $keywords;\n\n\t\tif($this->pageInitialized)\n\t\t\t$this->setMetaTag('keywords', $this->keywords);\n\t}",
"private function upgrade_0_1_to_0_2()\n {\n $sql = \"UPDATE {$this->config->dbTablePrefix}common_module\n SET\n `type`=2,\n `alias`='Keywords'\n WHERE\n `name`='keyword'\";\n\n $this->model->dba->query($sql);\n }",
"public function addDefinition()\r\n{\r\n $query_string = \"INSERT INTO glossary \";\r\n $query_string .= \"SET \";\r\n $query_string .= \"word = :word, \";\r\n $query_string .= \"worddefinition = :worddefinition\";\r\n\r\n return $query_string;\r\n}",
"public function setKeywords($keywords)\n\t{\n\t\tif( ! is_array($keywords))\n\t\t{\n\t\t\t$keywords = explode(',', $keywords);\n\t\t}\n\n\t\t// Flatten the array into single column\n\t\t$keywords = array_flatten($keywords);\n\t\t// Trim & lowercase the array\n\t\t$keywords = array_map('trim', $keywords);\n\t\t$keywords = array_map('strtolower', $keywords);\n\n\t\t$this->keywords = $keywords;\n\n\t\treturn $keywords;\n\t}",
"public function keyword($keywords) {\n\t\tforeach ((array) $keywords as $val) {\n\t\t\t$this->keywords[] = $val;\n\t\t}\n\n\t\treturn $this;\n\t}",
"public function keywordsProvider()\n {\n return [[[]]];\n }",
"function addStopWordsToArray($dbconnection) {\n\t//add stop words from the Stop Words table to the stopWords array - remove apostrophe from stop words\n\t$stopWords = array();\n\t$sql=\"select stopWord from stopWords\" ;\n\t$result=$dbconnection->query($sql) ;\n\n\tif($result) {\n\t\twhile ($row = $result->fetch_assoc()) {\n\t\t\t$stopWords[] = str_replace(\"'\",\"\",$row['stopWord']) ;\n\t\t}\n\t//Also add the AT_USER used in the replacement above and URL to stop words and RT for retweet\n\t$stopWords[]='atuser' ;\n\t$stopWords[]='url' ;\n\t$stopWords[]='rt' ;\n\t$result->close();\n\treturn $stopWords ;\n }\n}",
"public static function AddUniCountOfWords() {\r\n $conn = ModMetocHelper::coToDa();\r\n $cont = ModMetocHelper::conTab();\r\n\r\n $sql = \"ALTER TABLE $cont ADD uni_count_of_words INT(10)\";\r\n $result = $conn->query($sql);\r\n }",
"public function get_keywords() {\n\t\treturn [ 'Feature image', 'photo', 'visual' ];\n\t}",
"private function getLinkKeywords()\n {\n $this->tplVar['keys'] = array();\n \n $keywords = array();\n \n // get demanded link data\n $this->model->action('link','getKeywordIds', \n array('result' => & $keywords,\n 'id_link' => (int)$_REQUEST['id_link']));\n\n foreach($keywords as $key)\n {\n $tmp = array();\n $tmp['id_key'] = $key; \n \n $keyword = array();\n $this->model->action('keyword','getKeyword', \n array('result' => & $keyword,\n 'id_key' => (int)$key,\n 'fields' => array('title','id_key'))); \n $branch = array();\n // get navigation node branch of the current node\n $this->model->action('keyword','getBranch', \n array('result' => & $branch,\n 'id_key' => (int)$key,\n 'fields' => array('title','id_key'))); \n\n $tmp['branch'] = '';\n \n foreach($branch as $bkey)\n {\n $tmp['branch'] .= '/'.$bkey['title'];\n }\n \n $tmp['branch'] .= '/<strong>'.$keyword['title'].'</strong>';\n \n $this->tplVar['keys'][] = $tmp;\n }\n sort($this->tplVar['keys']); \n }",
"public function index() {\n\n $keywords = User_search_keyword::inst()->get_user_keywords($this->c_user->id, $this->profile->id);\n\n $new_keywords = array();\n $errors = array();\n $saved_ids = array(0); // '0' to prevent datamapper error caused by empty array\n $delete = true;\n\n if ($post = $this->input->post()) {\n\n unset($post['submit']);\n //d($post);\n $grouped = Arr::collect($post);\n //ddd($grouped);\n foreach ($grouped as $id => $data) {\n if (strpos($id, 'new_') === 0) {\n $keyword = User_search_keyword::inst()->fill_from_array($data, $this->c_user->id, $this->profile->id);\n $new_keywords[$id] = $keyword;\n } else {\n $keyword = User_search_keyword::inst()->fill_from_array($data, $this->c_user->id, $this->profile->id, $id);\n if ($keyword->id !== $id) {\n $new_keywords[$id] = $keyword;\n }\n }\n if ($keyword->save()) {\n $saved_ids[] = $keyword->id;\n } else {\n $errors[$id] = $keyword->error->string;\n }\n }\n\n if (empty($errors)) {\n if ($delete) {\n User_search_keyword::inst()->set_deleted($this->c_user->id, $this->profile->id, $saved_ids);\n }\n $this->addFlash(lang('keywords_saved_success'), 'success');\n redirect('connect/user_search_keywords');\n } else {\n $this->addFlash(implode('<br>', Arr::map('strip_tags', $errors)));\n }\n }\n\n CssJs::getInst()\n ->c_js('settings/user_search_keywords', 'index');\n\n $configs = Available_config::getByKeysAsArray(array(\n 'auto_follow_users_by_search',\n 'max_daily_auto_follow_users_by_search'\n ), $this->c_user, $this->profile->id);\n\n //ddd($configs);\n\n $outp_keywords = array();\n foreach ($keywords as $keyword) {\n $outp_keywords[$keyword->id] = $keyword;\n }\n $outp_keywords = array_merge($outp_keywords, $new_keywords);\n\n $this->template->set('keywords', $outp_keywords);\n $this->template->set('errors', $errors);\n $this->template->set('configs', $configs);\n $this->template->render();\n }",
"public function filterByKeywords($keywords = null, $comparison = null)\n {\n if (null === $comparison) {\n if (is_array($keywords)) {\n $comparison = Criteria::IN;\n } elseif (preg_match('/[\\%\\*]/', $keywords)) {\n $keywords = str_replace('*', '%', $keywords);\n $comparison = Criteria::LIKE;\n }\n }\n\n return $this->addUsingAlias(ArticleTableMap::COL_KEYWORDS, $keywords, $comparison);\n }",
"public function run()\n {\n $keywords = ['JavaScript', 'CSS', 'HTML', 'C++', 'Web Design'];\n\n foreach ($keywords as $keyword) {\n Keyword::create(['term' => $keyword]);\n }\n }",
"private function listKeywords($idSetter)\n\t{\n\t\t$sql = <<<END_SQL\nSELECT theWord\nFROM keyword\nWHERE idSetter=:idSetter\nORDER BY theWord;\nEND_SQL;\n\t\t$stmt = $this->dbx->prepare($sql);\n\t\t$stmt->execute(array(\n\t\t\t\":idSetter\" => $idSetter,\n\t\t));\n\t\t$words = $stmt->fetchAll(PDO::FETCH_ASSOC) ?: array();\n\n\t\t// We now need to rearrange the keywords as an associative array ...\n\t\t$records = array();\n\t\t$count = count($words);\n\t\tfor ($i = 0; $i < $count; ++$i)\n\t\t{\n\t\t\t$key = $words[$i][\"theWord\"];\n\t\t\t$records[strtolower($key)] = $key;\n\t\t}\n\n\t\treturn array\n\t\t(\n\t\t\t\"action\" => \"list\",\n\t\t\t\"table\" => \"keyword\",\n\t\t\t\"idSetter\" => $idSetter,\n\t\t\t\"records\" => $records,\n\t\t);\n\t}",
"function associateWordWithWord($wordID, $seeAlsoID, $message=\"\"){\r\n\tinsertIntoTable(\"seealso\", array(\"wordID\" => $wordID, \"seeAlsoID\" => $seeAlsoID));\r\n\tprint $message;\r\n}",
"private function _addTags()\n {\n $metadata = $this->getRecordMetadata();\n $this->_record->addTags($metadata[self::TAGS]);\n }",
"function listAll(){\n return(($this->_db)->query(\"SELECT * FROM keywords\")->fetchAll(PDO::FETCH_ASSOC));\n }",
"public function setContextualKeywords($var)\n {\n $arr = GPBUtil::checkRepeatedField($var, \\Google\\Protobuf\\Internal\\GPBType::STRING);\n $this->contextual_keywords = $arr;\n\n return $this;\n }",
"public function getSeoKeywords();",
"function _index_keyword($keyword, $product_id, $frequency)\n\t{\n\t\t$model_keyword \t\t=& model::create('keyword');\n\t\t$product_keyword \t=& model::create('product_keyword');\n\t\t\n\t\t//Insert unique keyword\n\t\tif(!$model_keyword->find_by_field('keyword',$keyword))\n\t\t{\n\t\t\t$model_keyword->keyword = $keyword;\n\t\t\t$model_keyword->save();\n\t\t}\n\t\t\n\t\t//Add keyword into product frequency table\n\t\tif($product_keyword->find_by_field_array(array('keyword_id' => $model_keyword->id,'product_id' => $product_id)))\n\t\t\t$product_keyword->frequency += $frequency;\t//If keyword was found in say title and description\t\t\n\t\telse\n\t\t{\n\t\t\t$product_keyword->keyword_id \t= $model_keyword->id;\n\t\t\t$product_keyword->product_id \t= $product_id;\n\t\t\t$product_keyword->frequency \t= $frequency;\t\t\t\n\t\t}\n\t\t\n\t\treturn $product_keyword->save();\t\t\n\t}",
"public function registerKeyword(/*string*/ $keyword);",
"public function AddHeadKeyword($keyword){\r\n\t\t$this->head->AddKeyword($keyword);\r\n\t}",
"function AddKeywordToIdea($ideaid, $keyword)\n\t\t{\n\t\t\t$success = False;\n\t\n\t\t\ttry\n\t\t\t{\n\t\t\t\t// create an instance of our DB tool, and connect to the database\n\t\t\t\t$db = new DatabaseTool();\n\t\t\t\t$db->Connect();\n\t\t\t\t\n\t\t\t\t// add the keyword to the list of chops the idea needs\n\t\t\t\t$query = 'INSERT INTO ideakeywords(keyword, ideaid) VALUES(' . $keyword . ', ' . $ideaid . ')';\n\t\t\t\t$db->query($query);\n\t\t\t\t\n\t\t\t\t// success!\n\t\t\t\t$success = True;\n\t\t\t\t\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\t$success = False;\n\t\t\t}\n\t\t\t\n\t\t\t// return our success\n\t\t\treturn $success;\n\t\t}",
"public static function at()\n\t{\n\t\t\n\t\t$alter_info = array(\n\t\t\t// deleted columns, simple 1d array\n\t\t\t//'drop' => array('ii'),\n\t\t\t\n\t\t\t// old name => new name and definition\n\t\t\t//'change' => array(\n\t\t\t//\t'thing' => 'trong INT( 11 ) NOT NULL'\n\t\t\t//),\n\t\t\t\n\t\t\t// new column definitions\n\t\t\t'add' => array(\n\t\t\t\t'mpc_convs smallint unsigned not null default 0',\n\t\t\t\t'vt_convs smallint unsigned not null default 0'\n\t\t\t)\n\t\t);\n\t\t$ta = new table_alterer('g_data', 'keywords_11', $alter_info);\n\t\t$ta->go();\n\t}",
"public function setKeywords($value)\n {\n return $this->set('Keywords', $value);\n }",
"static function add_word($user_id, $word_list_id, $lang1, $lang2, $comment) {\n global $con;\n // TODO check owner\n $sql = \"INSERT INTO `word` (`list`, `language1`, `language2`, `comment`, `time`, `user`)\n\t\tVALUES (\".$word_list_id.\", '\".$lang1.\"', '\".$lang2.\"', '\".$comment.\"', \".time().\", \".$user_id.\");\";\n $query = mysqli_query($con, $sql);\n return mysqli_insert_id($con);\n }",
"private function makeRankedKeywordList() {\n\t\t$this->html = preg_replace('/\\s+/', ' ', $this->html);\n\t\t$this->html = trim($this->html);\n\t\t$keywords = explode(' ', $this->html);\n\t\tforeach ($keywords as $k) {\n\t\t\tif ( !isset($this->ranked_keywords[$k]) ) { $this->ranked_keywords[$k] = 1; }\n\t\t\t$this->ranked_keywords[$k] += 1;\n\t\t}\n\t}",
"public function train($sentence)\n {\n\n //connectionecting to database\n require 'koneksi.php';\n\n // ekstraksi keyword\n mysqli_query($connection, \"TRUNCATE tbtoken\");\n $keywordsArray = $this->tokenize($sentence);\n // update tabel frekuensi kata\n foreach ($keywordsArray as $word) {\n\n // if this word is already present with given category then update count else insert\n $sql = mysqli_query($connection, \"SELECT count(*) as total FROM tbtoken WHERE term = '$word' \");\n $count = mysqli_fetch_assoc($sql);\n\n //rumus bobot\n\n if ($count['total'] == 0) {\n $sql = mysqli_query($connection, \"INSERT into tbtoken (term,count) values('$word',1)\");\n } else {\n $sql = mysqli_query($connection, \"UPDATE tbtoken set count = count + 1 where term = '$word'\");\n }\n }\n\n //closing connectionection\n $connection->close();\n }",
"public function get_keywords() {\n return [ 'autostop', 'cta', 'video', 'player', 'embed' ];\n }",
"public function setKeywords($keywords) {\n $this->properties['keywords'] = $keywords;\n\n return $this;\n }",
"function we_tag_keywords(array $attribs, $content){\n\t$htmlspecialchars = weTag_getAttribute('htmlspecialchars', $attribs, false, we_base_request::BOOL);\n\t$attribs = removeAttribs($attribs, array(\n\t\t'htmlspecialchars'\n\t));\n\n\t$keys = !empty($GLOBALS['KEYWORDS']) ? $GLOBALS['KEYWORDS'] : '';\n\tif(!$keys && $content){\n\t\tob_start();\n\t\t//FIXME:eval\n\t\teval('?>' . $content);\n\t\t$keys = ob_get_clean();\n\t}\n\tif(!empty($GLOBALS['we_editmode'])){\n\t\t//set meta data & exit\n\t\t$GLOBALS['meta']['Keywords']['default'] = $keys;\n\t\treturn;\n\t}\n\t$attribs['name'] = 'keywords';\n\t$attribs['content'] = str_replace('\"', '\\'', ($htmlspecialchars ? oldHtmlspecialchars(strip_tags($keys)) : strip_tags($keys)));\n\treturn getHtmlTag(\"meta\", $attribs) . \"\\n\";\n}",
"function h_keywords($cat_id){\r\n\t\r\n\t\tconnect(); \r\n\t\t\t$cp_id = clean_input($cat_id);\r\n\t\t\t\r\n\t\t\r\n\t\t\t//\r\n\t\t\tif(!empty($_GET['cat_id'])){ \r\n\t\t\t\t$xyquery = \"SELECT cat_desc_long FROM categories WHERE cat_id = '$cp_id'\";\r\n\t\t\t\t$xyresult = mysql_query($xyquery) or die(mysql_error());\r\n\t\t\t\tlist($cat_desc_long)= mysql_fetch_row($xyresult);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t$heading = $cat_desc_long;\r\n\t\t\t$heading2 = explode('<h2>',$heading);\r\n\t\t\t$heading2 = explode('</h2>', $heading2[1]);\r\n\t\t\t\r\n\t\t\t\tif(!empty($heading2[0])) echo \",\".$heading2[0];\r\n\t\t\t$heading = $cat_desc_long;\r\n\t\t\t$heading3 = explode('<h1>',$heading);\r\n\t\t\t$heading3 = explode('</h1>', $heading3[1]);\r\n\t\t\t\r\n\t\t\t\tif(!empty($heading3[0])) echo \",\".$heading3[0];\r\n\t\t\t$heading = $cat_desc_long;\r\n\t\t\t$heading4 = explode('<h3>',$heading);\r\n\t\t\t$heading4 = explode('</h3>', $heading4[1]);\r\n\t\t\t\r\n\t\t\t\tif(!empty($heading4[0])) echo \",\".$heading4[0];\t\r\n\t\t\t\t\r\n\t\t}",
"public function add_keyword(){\n\n\t\t\t$this->load->library('form_validation');\n\t\t\t\n\t\t\t$this->form_validation->set_error_delimiters('<div class=\"alert alert-danger text-danger text-center\"><i class=\"fa fa-exclamation-triangle\" aria-hidden=\"true\"></i> ', '</div>');\n\t\t\t\t\n\t\t\t$this->form_validation->set_rules('keyword','Keyword','required|trim|xss_clean|is_unique[keywords.keyword]');\n\t\t\t$this->form_validation->set_rules('icon','Icon','required|trim|xss_clean');\n\t\t\t\t\t\t\n\t\t\t$this->form_validation->set_message('required', '%s cannot be blank!');\n\t\t\t$this->form_validation->set_message('is_unique', 'This keyword already exists!');\n\t\t\t\n\t\t\tif($this->form_validation->run()){\n\t\t\t\t\t\t\t\n\t\t\t\t$add = array(\n\t\t\t\t\t'keyword' => ucwords($this->input->post('keyword')),\n\t\t\t\t\t'icon' => $this->input->post('icon'),\n\t\t\t\t);\n\t\t\n\t\t\t\tif($this->Keywords->add_keyword($add)){\n\t\t\t\t\t\n\t\t\t\t\t$username = $this->session->userdata('admin_username');\n\t\t\t\t\t$user_array = $this->Admin->get_user($username);\n\t\t\t\t\t\n\t\t\t\t\t$fullname = '';\n\t\t\t\t\tif($user_array){\n\t\t\t\t\t\tforeach($user_array as $user){\n\t\t\t\t\t\t\t$fullname = $user->admin_name;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t//update activities table\n\t\t\t\t\t$description = 'added a new keyword (<i>'.$this->input->post('keyword').'</i>) and icon';\n\t\t\t\t\n\t\t\t\t\t$activity = array(\t\t\t\n\t\t\t\t\t\t'name' => $fullname,\n\t\t\t\t\t\t'username' => $username,\n\t\t\t\t\t\t'description' => $description,\n\t\t\t\t\t\t'keyword' => 'Icon',\n\t\t\t\t\t\t'activity_time' => date('Y-m-d H:i:s'),\n\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\t$this->Site_activities->insert_activity($activity);\n\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$data['success'] = true;\n\t\t\t\t\t\t\t\n\t\t\t\t\t$data['notif'] = '<div class=\"alert alert-success text-center\" role=\"alert\"> <i class=\"fa fa-check-circle\"></i><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">×</button> New keyword (<i>'.$this->input->post('keyword').'</i>) and icon added!</div>';\n\t\t\t\t\t\t\t\n\t\t\t\t}else{\n\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t$data['success'] = false;\n\t\t\t\t\t\t\t\n\t\t\t\t\t$data['notif'] = '<div class=\"alert alert-danger text-center\" role=\"alert\"><i class=\"fa fa-ban\"></i><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">×</button> New keyword (<i>'.$this->input->post('keyword').'</i>) and icon not added!</div>';\n\t\t\t\t\t\t\t\n\t\t\t\t}\t\t\t\t\n\t\t\t}\n\t\t\telse {\n\t\t\t\t\t\t\n\t\t\t\t$data['success'] = false;\n\t\t\t\t$data['notif'] = '<div class=\"alert alert-danger text-center\" role=\"alert\"><i class=\"fa fa-ban\"></i><button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">×</button>'.validation_errors().'</div>';\n\t\t\t\t//$data['errors'] = $this->form_validation->error_array();\n\t\t\t\t//$this->addhand();\t\n\t\t\t}\n\n\t\t\t// Encode the data into JSON\n\t\t\t$this->output->set_content_type('application/json');\n\t\t\t$data = json_encode($data);\n\n\t\t\t// Send the data back to the client\n\t\t\t$this->output->set_output($data);\n\t\t\t//echo json_encode($data);\t\t\t\n\t\t}",
"function Save_FileKeywords($FileID,$Array){\n\t\t$Keyword=ArrayToString($Array);\n\t\t$Keyword=strtolower($Keyword);\n\t\t$database=DatabaseName();\n\t\t\n\t\t$query = \"INSERT INTO `$database`.`keywords` VALUES (\n\t\t\t\t\t'\".mysql_real_escape_string($FileID).\"',\n\t\t\t\t\t'\".mysql_real_escape_string($Keyword).\"',\n\t\t\t\t\t'','')\";\n\t\tmysql_query($query);\n\t}",
"protected function setUp()\n {\n $this->keywords = new Keywords;\n }",
"public function set_keywords($keywords)\n\t{\n\t\tif (is_null($keywords)) {\n\t\t\tthrow new InvalidArgumentException(\"Project Keywords Invalid!\");\n\t\t}\n\t\t$this->keywords = $keywords;\n\t}",
"private function upgrade_0_2_to_0_3()\n {\n $sql = \"ALTER TABLE {$this->config->dbTablePrefix}keyword\n ADD `lang` char(2) NOT NULL default 'en' AFTER `status`,\n ADD `lang_dir` char(3) NOT NULL default 'ltr' AFTER `modifydate`,\n ADD `format` varchar(20) NOT NULL default 'html' AFTER `description`,\n ADD KEY `lang` (`lang`)\";\n\n $this->model->dba->query($sql);\n\n $this->model->action('common','setConfigVar',\n array('data' => array('use_format' => 0,\n 'use_lang' => 0,\n 'default_format' => 'html',\n 'default_lang' => 'en'),\n 'module' => 'keyword') );\n }",
"public function getMetaKeywords();",
"public function get_keywords()\n\t{\n\t\treturn ['algolia', 'search', 'algolia'];\n\t}",
"protected function setKeyword($value)\n\t{\n\t\t$this->keyword = $value;\n\t}",
"public function setProdKeywords($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->prod_keywords !== $v) {\n $this->prod_keywords = $v;\n $this->modifiedColumns[TblProdInfoTableMap::COL_PROD_KEYWORDS] = true;\n }\n\n return $this;\n }",
"static public function keywords($data) {\n// $query_replace = array('', '', '', '', '', '|', '|', '|', '|');\n//\n// $query_data = explode('|', str_replace($query_search, $query_replace, $data));\n//\n// $keywords = array();\n// foreach ($query_data as $query_data_value) {\n// $keyword = trim($query_data_value);\n//\n// if(!in_array($keyword, $keywords)) {\n// $keywords[] = $keyword;\n// }\n// }\n// \n// return $keywords;\n }",
"public function updateTables()\n {\n $prefix = $this->getPrefix();\n $charset = $this->wpdb->get_charset_collate();\n\n foreach ($this->config['tables'] as $table => $createStatement) {\n $sql = str_replace(\n ['{prefix}', '{charset}'],\n [$prefix, $charset],\n $createStatement\n );\n dbDelta($sql);\n }\n }",
"public static function UpdateCountOfWords() {\r\n $conn = ModMetocHelper::coToDa();\r\n $cont = ModMetocHelper::conTab();\r\n\r\n $sql = \"UPDATE $cont SET $cont.count_of_words=(LENGTH($cont.introtext) - LENGTH(REPLACE($cont.introtext, ' ', ''))+1 + LENGTH($cont.fulltext) - LENGTH(REPLACE($cont.fulltext, ' ', ''))) WHERE $cont.count_of_words IS NULL\";\r\n $result = $conn->query($sql);\r\n }",
"function updateSelectBoxes(){\r\n\t\t$wordString = trim(preg_replace('#[\\.,\\?/!]#u', '', $_POST['sentenceAnalyzedForm']));\r\n\t\tif(strlen($wordString) > 0){\r\n\t\t\t$wordString = trim($wordString, \" \");\r\n\t\t\t$wordDescs = explode(\" \", $wordString);\r\n\t\t\t$_POST['keyWords'] = $wordDescs;\r\n\t\t}\r\n\t\tforeach($wordDescs as $key => $desc){\r\n\t\t\t$wordExistsResult = mysql_query(\"SELECT wordID, wordWrittenForm, wordDescription FROM word WHERE wordWrittenForm LIKE '\" . $desc .\"'\");\r\n\t\t\t\twhile($wordRow = mysql_fetch_array($wordExistsResult)){\r\n\t\t\t\t\t$relatedWords[$wordRow[0]] = $wordRow[1] . \" - \" . $wordRow[2];\r\n\t\t\t\t}\r\n\t\t}\r\n\t\t$_POST['possibleMatches'] = $relatedWords;\r\n}",
"function GetKeyWords() {\n\t\t$lTitle = str_replace(\",\", \" \", str_replace(\", \", \" \", $this->m_pubdata['storytitle']));\n\t\t$lSubTitle = str_replace(\",\", \" \", str_replace(\", \", \" \", $this->m_pubdata['storysubtitle']));\n\t\t$lSupTitle = str_replace(\",\", \" \", str_replace(\", \", \" \", $this->m_pubdata['storysuptitle']));\n\t\t//~ $lDesc = str_replace(\",\", \" \", str_replace(\", \", \" \", $this->m_pubdata['description']));\n\t\t$lTmpSTr = ($lTitle ? \", \" . $lTitle : \"\") . ($lSubTitle ? \", \" . $lSubTitle : \"\") . ($lSupTitle ? \", \" . $lSupTitle : \"\") . ($lDesc ? \", \" . $lDesc : \"\") . ($this->m_pubdata['keywordsnaked'] ? \", \" . $this->m_pubdata['keywordsnaked'] : \"\");\n\t\t$lArr = split(' ', $lTmpSTr);\n\t\tforeach($lArr as $k) {\n\t\t\t$k = trim($k);\n\t\t\t$lRetStr .= $k . ' ';\n\t\t}\n\t\treturn $lRetStr;\n\t}",
"public function registerDb() {\n global $wpdb;\n\n $charset_collate = $wpdb->get_charset_collate();\n $table_name = $wpdb->prefix . \"items_bookmark\";\n \n $createTable = \"CREATE TABLE IF NOT EXISTS $table_name (\n user_id INTEGER NOT NULL,\n response_id int,\n utterance_id int,\n PRIMARY KEY (user_id)\n ) $charset_collate;\";\n\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\n dbDelta($createTable);\n }",
"public function insertKeywordsNoticia($keyword)\n\t{\n\t\t$sql = \"INSERT INTO keywords (keyword) VALUES ( :keyword)\";\n\t\t$resultado = $this->data_source->ejecutarActualizacion(\n\t\t\t$sql,\n\t\t\tarray(\n\t\t\t\t':keyword' => $keyword\n\t\t\t)\n\t\t);\n\t\treturn $resultado;\n\t}",
"function keywords_and_description($submit_keywords, $keywords, $seo_desc){\n\t\tif( isset($_POST[$submit_keywords]) ){\n\t\t\t$key_words = $_POST[$keywords];\n\t\t\t$short_desc = $_POST[$seo_desc]; \n\t\t\tuser::update_key_words($key_words, $short_desc);\n\n\t\t\t\theader(\"location: ../../basic_info.php\");\n\t\t}\n\t}",
"public function getTwords() {\n $this->tlist = getTranslatables($this->langtag);\n }"
]
| [
"0.6899649",
"0.6315743",
"0.6269624",
"0.62153697",
"0.6179198",
"0.61315554",
"0.60629374",
"0.60450596",
"0.60157603",
"0.60083413",
"0.59692585",
"0.5944565",
"0.58526736",
"0.58253616",
"0.58253443",
"0.581905",
"0.5809284",
"0.5784633",
"0.57677084",
"0.57584035",
"0.5731846",
"0.57291585",
"0.57113206",
"0.5700475",
"0.56436455",
"0.56241786",
"0.5606095",
"0.5598879",
"0.5584361",
"0.555455",
"0.5552141",
"0.55503285",
"0.5549009",
"0.55146396",
"0.5468759",
"0.54633886",
"0.5457519",
"0.54491395",
"0.5365966",
"0.533451",
"0.5334358",
"0.53338414",
"0.53180575",
"0.53124344",
"0.5310832",
"0.5308711",
"0.5287861",
"0.5283208",
"0.52506554",
"0.52344406",
"0.52259976",
"0.5225877",
"0.5224952",
"0.52074826",
"0.51991713",
"0.51988834",
"0.5189921",
"0.51827663",
"0.5171809",
"0.51710695",
"0.51660174",
"0.51587975",
"0.5156608",
"0.5147238",
"0.51426005",
"0.5135728",
"0.5135088",
"0.512071",
"0.51162076",
"0.5114934",
"0.511452",
"0.5103253",
"0.5098365",
"0.50920975",
"0.5091222",
"0.50801516",
"0.5067262",
"0.50671524",
"0.5047302",
"0.5039476",
"0.5037733",
"0.50325817",
"0.502444",
"0.4990403",
"0.4979565",
"0.4974055",
"0.49727786",
"0.49717844",
"0.49630406",
"0.49613124",
"0.49551624",
"0.49487036",
"0.49439898",
"0.49278829",
"0.49189836",
"0.4918692",
"0.4918226",
"0.49115223",
"0.4908433",
"0.49024376"
]
| 0.6956576 | 0 |
end of prepareSQLdum mySQL 1, Oct 2002 8 Feb 2005 hexadecimal | function gw_sql_replace($arData, $tbl_name, $isFields = 1)
{
$arFields = $arValues = array();
$strFields = '';
if (is_array($arData))
{
for (reset($arData); list($k, $v) = each($arData);)
{
$v = gw_text_sql($v);
if ($v == ''){ $vF = "''"; }
elseif ( preg_match("/^0x[0-9a-f]/", $v)) { $vF = $v; }
else { $vF = "'" . $v . "'"; }
$arFields[] = $k;
$arValues[] = $vF;
}
if ($isFields) { $strFields = ' (`' . implode('`, `', $arFields) . '`)'; }
$sql = CRLF . 'REPLACE INTO `' . $tbl_name .'`'. $strFields . ' VALUES ('.implode(',', $arValues).')';
return $sql;
}
return false;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function startsql()\r\n{\r\n require \".inc/config.php\"; // import configuration\r\n $db = new PDO(\"$db_type:host=$db_host;dbname=$db_name\",$db_user,$db_pass); // initialize DB connection\r\n $db->query(\"SET NAMES 'utf8' COLLATE 'utf8_general_ci'\"); // set UTF8 as character set\r\n $db->query('SET CHARACTER SET utf8');\r\n return $db; // function returns the PDO class\r\n}",
"public function prepare(/*# string */ $sql)/*# : bool */;",
"public function prepareQuery($sql){\n \t//parse out the tokens\n \t$tokens = preg_split('/((?<!\\\\\\)[&?!])/', $sql, -1, PREG_SPLIT_DELIM_CAPTURE);\n\t\t\n \t//maintain a count of the actual tokens for quick reference in execute\n \t$count = 0;\n \t\n \t$sqlStr = '';\n\t foreach ($tokens as $key => $val) {\n\t switch ($val) {\n\t case '?' :\n\t case '!' :\n\t case '&' :\t\n\t \t$count++;\n\t \t$sqlStr .= '?';\n\t \tbreak;\n\t \t\n\t default :\n\t \t//escape any special characters\n\t $tokens[$key] = preg_replace('/\\\\\\([&?!])/', \"\\\\1\", $val);\n\t $sqlStr .= $tokens[$key];\n\t break;\n\t } // switch\n\t } // foreach\n\n\t $this->preparedTokens[] = array('tokens' => $tokens, 'tokenCount' => $count, 'sqlString' => $sqlStr);\n\t end($this->preparedTokens);\n\t return key($this->preparedTokens);\t\n }",
"function PreprocessSql($sql);",
"function db_query_parsed($sql, $ignore_errors = 0, $attach_mysql = \"\") {\n global $CONF;\n\n if ($CONF['database_type'] == 'mysql' || $CONF['database_type'] == 'mysqli' ) {\n\n $replace = array(\n '{AUTOINCREMENT}' => 'int(11) not null auto_increment', \n '{PRIMARY}' => 'primary key',\n '{UNSIGNED}' => 'unsigned' , \n '{FULLTEXT}' => 'FULLTEXT', \n '{BOOLEAN}' => \"tinyint(1) NOT NULL DEFAULT '\" . db_get_boolean(False) . \"'\",\n '{UTF-8}' => '/*!40100 CHARACTER SET utf8 */',\n '{LATIN1}' => '/*!40100 CHARACTER SET latin1 */',\n '{IF_NOT_EXISTS}' => 'IF NOT EXISTS',\n '{RENAME_COLUMN}' => 'CHANGE COLUMN',\n '{MYISAM}' => 'ENGINE=MyISAM',\n '{INNODB}' => 'ENGINE=InnoDB',\n '{INT}' => 'integer NOT NULL DEFAULT 0',\n '{BIGINT}' => 'bigint NOT NULL DEFAULT 0',\n '{DATE}' => \"timestamp NOT NULL default '2000-01-01'\", # MySQL needs a sane default (no default is interpreted as CURRENT_TIMESTAMP, which is ...\n '{DATECURRENT}' => 'timestamp NOT NULL default CURRENT_TIMESTAMP', # only allowed once per table in MySQL\n );\n $sql = \"$sql $attach_mysql\";\n\n } elseif($CONF['database_type'] == 'pgsql') {\n $replace = array(\n '{AUTOINCREMENT}' => 'SERIAL', \n '{PRIMARY}' => 'primary key', \n '{UNSIGNED}' => '', \n '{FULLTEXT}' => '', \n '{BOOLEAN}' => \"BOOLEAN NOT NULL DEFAULT '\" . db_get_boolean(False) . \"'\",\n '{UTF-8}' => '', # UTF-8 is simply ignored.\n '{LATIN1}' => '', # same for latin1\n '{IF_NOT_EXISTS}' => '', # does not work with PgSQL\n '{RENAME_COLUMN}' => 'ALTER COLUMN', # PgSQL : ALTER TABLE x RENAME x TO y\n '{MYISAM}' => '',\n '{INNODB}' => '',\n '{INT}' => 'integer NOT NULL DEFAULT 0',\n '{BIGINT}' => 'bigint NOT NULL DEFAULT 0',\n 'int(1)' => 'int',\n 'int(10)' => 'int', \n 'int(11)' => 'int', \n 'int(4)' => 'int', \n '{DATE}' => \"timestamp with time zone default '2000-01-01'\", # stay in sync with MySQL\n '{DATECURRENT}' => 'timestamp with time zone default now()',\n );\n\n } else {\n echo \"Sorry, unsupported database type \" . $conf['database_type'];\n exit;\n }\n\n $replace['{BOOL_TRUE}'] = db_get_boolean(True);\n $replace['{BOOL_FALSE}'] = db_get_boolean(False);\n\n $query = trim(str_replace(array_keys($replace), $replace, $sql));\n\n if (safeget('debug') != \"\") {\n printdebug ($query);\n }\n $result = db_query($query, $ignore_errors);\n if (safeget('debug') != \"\") {\n print \"<div style='color:#f00'>\" . $result['error'] . \"</div>\";\n }\n return $result;\n}",
"function prepareForDb() {\n $this->description = sql_escape($this->description);\n $this->postsHeader = sql_escape($this->postsHeader);\n $this->postBody = sql_escape($this->postBody);\n $this->postsFooter = sql_escape($this->postsFooter);\n $this->formLogged = sql_escape($this->formLogged);\n $this->form = sql_escape($this->form);\n $this->navigation = sql_escape($this->navigation);\n $this->name = sql_escape($this->name);\n $this->nameLin = sql_escape($this->nameLin);\n $this->memberName = sql_escape($this->memberName);\n $this->date = sql_escape($this->date);\n $this->time = sql_escape($this->time); \n $this->nextPage = sql_escape($this->nextPage);\n $this->previousPage =sql_escape($this->previousPage);\n $this->firstPage = sql_escape($this->firstPage);\n $this->lastPage = sql_escape($this->lastPage);\n\t$this->gravDefault = sql_escape($this->gravDefault);\n }",
"private function prepareStatement()\n {\n $columns = '';\n $fields = '';\n foreach ($this->fields as $key => $f) {\n if ($key == 0) {\n $columns .= \"$f\";\n $fields .= \":$f\";\n continue;\n }\n\n $columns .= \", $f\";\n $fields .= \", :$f\";\n }\n\n $this->statement = $this->pdo->prepare(\n 'INSERT INTO `' . $this->table . '` (' . $columns . ') VALUES (' . $fields . ')'\n );\n }",
"public function prepare($sql);",
"function prepareQuery() {\n\t\t$q = \"SET \n\t\t\t\t\t`template` = '{$this->newIdt}',\n\t\t\t\t\t`description` = '{$this->description}',\n\t\t\t\t\t`PostsHeader` = '{$this->postsHeader}',\n\t\t\t\t\t`PostBody` = '{$this->postBody}',\n\t\t\t\t\t`PostsFooter` = '{$this->postsFooter}',\n\t\t\t\t\t`FormLogged` = '{$this->formLogged}',\n\t\t\t\t\t`Form` = '{$this->form}',\n\t\t\t\t\t`Navigation` = '{$this->navigation}',\n\t\t\t\t\t`Name` = '{$this->name}',\n\t\t\t\t\t`NameLin` = '{$this->nameLin}',\n\t\t\t\t\t`MemberName` = '{$this->memberName}',\n\t\t\t\t\t`Date` = '{$this->date}',\n\t\t\t\t\t`Time` = '{$this->time}',\n\t\t\t\t\t`NextPage` = '{$this->nextPage}',\n\t\t\t\t\t`PreviousPage` = '{$this->previousPage}',\n\t\t\t\t\t`FirstPage` = '{$this->firstPage}',\n\t\t\t\t\t`LastPage` = '{$this->lastPage}',\n\t\t\t\t\t`UrlsToLinks`\t=\t'\".($this->urlToLink ? 'yes' : 'no').\"',\n\t\t\t\t\t`EmoToImg` \t\t=\t'\".($this->emoToImg ? 'yes' : 'no').\"',\n\t\t\t\t\t`GravDefault`\t=\t'{$this->gravDefault}',\n\t\t\t\t\t`GravSize`\t\t=\t{$this->gravSize}\";\n\t\treturn $q;\n\n\t}",
"public function prepareStatement($rawSql);",
"private function prepare ($sql) {\n $this->query = $this->connection->prepare($sql);\n }",
"protected function prepareSelectStatement() {}",
"abstract protected function _prepare();",
"public function prepare() {\n\t\tif ($this->_statement == null) \n\t\t{\n\t\t\ttry {\n\t\t\t\t$this->_statement = $this->_connection->getPdoInstance()->prepare($this->getText());\n\t\t\t\t$this->_paramLog = array();\n\t\t\t} catch (\\Exception $e) {\n\t\t\t\t$errorInfo = $e instanceof PDOException ? $e->errorInfo : null;\n\t\t\t\tthrow new \\GO\\Base\\Exception\\Database('DbCommand failed to prepare the SQL statement: '. $e->getMessage(), $e->getCode(), $errorInfo);\n\t\t\t}\n\t\t}\n\t}",
"public function prepare_query()\n {\n }",
"function _prepare() {}",
"abstract protected function parseSql();",
"function mkSQL() {\n $n = func_num_args();\n if ($n < 1) {\n Fatal::internalError('Not enough arguments given to mkSQL().');\n }\n $i = 1;\n $SQL = \"\";\n $fmt = func_get_arg(0);\n while (strlen($fmt)) {\n $p = strpos($fmt, \"%\");\n if ($p === false) {\n $SQL .= $fmt;\n break;\n }\n $SQL .= substr($fmt, 0, $p);\n if (strlen($fmt) < $p+2) {\n Fatal::internalError('Bad mkSQL() format string.');\n }\n if ($fmt{$p+1} == '%') {\n $SQL .= \"%\";\n } else {\n if ($i >= $n) {\n Fatal::internalError('Not enough arguments given to mkSQL().');\n }\n $arg = func_get_arg($i++);\n switch ($fmt{$p+1}) {\n case '!':\n /* very dangerous, but sometimes very useful -- be careful */\n $SQL .= $arg;\n break;\n case 'B':\n if ($arg) {\n $SQL .= \"'Y'\";\n } else {\n $SQL .= \"'N'\";\n }\n break;\n case 'C':\n $a = array();\n foreach (explode('.', $arg) as $ident) {\n array_push($a, '`'.$this->_ident($ident).'`');\n }\n $SQL .= implode('.', $a);\n break;\n case 'I':\n $SQL .= '`'.$this->_ident($arg).'`';\n break;\n case 'i':\n $SQL .= $this->_ident($arg);\n break;\n case 'N':\n $SQL .= $this->_numstr($arg);\n break;\n case 'Q':\n //$SQL .= \"'\".mysqli_real_escape_string($arg, $this->_link).\"'\";\n $SQL .= \"'\".mysqli_real_escape_string($this->_link, $arg).\"'\";\n break;\n case 'q':\n //$SQL .= \"'\".mysqli_real_escape_string($arg, $this->_link).\"'\";\n $SQL .= \"'\".mysqli_real_escape_string($this->_link, $arg).\"'\";\n break;\n default:\n Fatal::internalError('Bad mkSQL() format string.');\n }\n }\n $fmt = substr($fmt, $p+2);\n }\n if ($i != $n) {\n Fatal::internalError('Too many arguments to mkSQL().');\n }\n return $SQL;\n }",
"function writeDB($dump_file, $aSystem, $aSecurity)\n {\n if (!$link = @mysql_connect($aSystem['db_host'] .':'. $aSystem['db_port'], $aSystem['db_user'], $aSystem['db_pass']))\n return 'e_mysql_connect'; // Error: MySQL connect\n\n if (!mysql_select_db($aSystem['db_name'], $link)) return 'e_mysql_no_db'; // Error: specified DB not exist\n\n if (!$r = @fopen($dump_file, 'r')) return 'e_mysql_file'; // Error: Cannot open file for reading\n\n $sql_query = '';\n $q = 0;\n $aTemp = array();\n\n\n\n$sql_statements = file_get_contents($dump_file);\n$arr_sql = preg_split('/;[\\n|\\n\\r]+/',$sql_statements);\n \n mysql_query(\"SET NAMES 'utf8' COLLATE 'utf8_general_ci'\");\n foreach ($arr_sql as $query)\n {\n $q++;\n $sql_query = str_replace('db_prefix_', $aSystem['db_prefix'], $query);\n\n if ( ! empty($sql_query))\n {\n $sql_rez = mysql_query($sql_query);\n\n if ( ! $sql_rez) return mysql_error() .\"<p>Query #\". $q .\"<hr />\". $sql_query .\"<hr /></p>\";\n }\n\n }\n\n/*\n while(($str = fgets($r, 4096)) !== false)\n {\n \tif (empty($str) || preg_match(\"/^(#|--|COMMIT)/\", $str))\n {\n $sql_query.= $str;\n if (!empty($sql_query))\n {\n $q++;\n $sql_query = str_replace('db_prefix_', $aSystem['db_prefix'], $sql_query);\n $sql_rez = mysql_query($sql_query);\n\n if (!$sql_rez) return mysql_error() .\"<p>Query #\". $q .\"<hr />\". $sql_query .\"<hr /></p>\";\n $aTemp[] = $sql_query;\n $sql_query = '';\n }\n }else{\n $sql_query .= trim($str);\n }\n }\n print_r($aTemp);\n*/\n// Add Super Admin\n $s = $aSecurity;\n $sql_query = sprintf(\"UPDATE %sAdmins SET `login`='%s', `pwd`=md5('%s'), `last_online`=NOW(), `email`='%s' WHERE `id`='1'\",\n $aSystem['db_prefix'], $s['admin_name'], $s['admin_pass'], $s['admin_mail']);\n $sql_rez = mysql_query($sql_query);\n\n if (!$sql_rez) return 'e_mysql_admin_add';\n\n// If no error - return TRUE\n return TRUE;\n fclose($r);\n mysql_close($link);\n }",
"protected function prepare()\n\t{\n\t}",
"function prepareSQLStatement($connection, $query){\n\tif (!($sqlPrep = $connection->prepare($query))) {\n\t\techo \"Prepare of the statement <b> $query </b> failed: (\" . $connection->errno . \") \" . $connection->error;\n\t}\n\telse{\n\t\treturn $sqlPrep;\n\t}\n}",
"function exec($sql);",
"function setParams($sql, $params)\n{\n\t$has_params = false;\n\t\n\t$pat = $this->SQL_PARAM_PATTERN;\n\tif (strpos($sql, '{')) $has_params = true;\n\tif ($this->config['pclib.compatibility']['sql_syntax'] and strpos($sql, '[')) {\n\t\t$has_params = true;\n\t\t$pat = \"/\\[([#\\?\\!]?)([a-z0-9_]+)\\]/i\";\n\t}\n\tif (!$has_params) return $sql;\n\t\n\tpreg_match_all($pat, $sql, $found);\n\tif (!$found[0]) return $sql;\n\t$from = $to = array();\n\t$empty = false;\n\tforeach($found[2] as $i => $key) {\n\t\t$from[] = $found[0][$i];\n\t\tif (strlen(array_get($params, $key)) == 0) {\n\t\t\t$empty = true;\n\t\t\tif ($found[1][$i] == '#') $to[] = '__PCL_EMPTY0__';\n\t\t\telse $to[] = '__PCL_EMPTYS__';\n\t\t}\n\t\telseif ($found[1][$i] == '#')\n\t\t\t$to[] = (int)$params[$key];\n\t\telseif($found[1][$i] == '?')\n\t\t\t$to[] = '';\n\t\telseif($found[1][$i] == '!')\n\t\t\t$to[] = $params[$key];\n\t\telse\n\t\t\t$to[] = $this->escape($params[$key]);\n\t}\n\t\n\t$sql = str_replace($from, $to, $sql);\n\tif (!strpos($sql, \"\\n\") and !$empty) return $sql;\n\t\n\t$from = array(\"/^\\s*~ .+__PCL_EMPTY.__.*$/m\", \"/^\\s*~ /m\", \"/__PCL_EMPTYS__/\", \"/__PCL_EMPTY0__/\");\n\t$to = array('',' ','', '0');\n\treturn preg_replace($from, $to, $sql);\n}",
"function createSql($whereString)\n{\n global $displayBitmap;\n $postCount = count($_POST)-1;\n $selectString = \"SELECT \";\n $fromString = \" FROM movie\";\n $orderByString = \" ORDER BY \";\n\n //check if no display options were checked\n if (!$_POST['dispTitle']\n && !$_POST['dispYear']\n && !$_POST['dispStar']\n && !$_POST['dispCountry']\n && !$_POST['dispDirector']\n && !$_POST['dispActor']\n && !$_POST['dispScreen']\n && !$_POST['dispCine']\n && !$_POST['dispOscar'])\n return NULL;\n\n //set up the SELECT and FROM sql strings\n for (reset($_POST); key($_POST) != \"sort\"; next($_POST))\n {\n switch (current($_POST))\n {\n case \"movie.title\":\n $selectString = $selectString . current($_POST);\n next($_POST);\n if (key($_POST) != \"sort\")\n $selectString = $selectString . \", \";\n prev($_POST);\n $displayBitmap |= TTL_MASK;\n break;\n\n case \"movie.year\":\n $selectString = $selectString . current($_POST);\n next($_POST);\n if (key($_POST) != \"sort\")\n $selectString = $selectString . \", \";\n prev($_POST);\n $displayBitmap |= YER_MASK;\n break;\n\n case \"mystarrating\":\n $selectString = $selectString . current($_POST);\n next($_POST);\n if (key($_POST) != \"sort\")\n $selectString = $selectString . \", \";\n prev($_POST);\n $displayBitmap |= STR_MASK;\n break;\n\n case \"country\":\n $selectString = $selectString . current($_POST);\n next($_POST);\n if (key($_POST) != \"sort\")\n $selectString = $selectString . \", \";\n prev($_POST);\n $displayBitmap |= COU_MASK;\n break;\n\n case \"dirname\":\n $selectString = $selectString . current($_POST);\n next($_POST);\n if (key($_POST) != \"sort\")\n $selectString = $selectString . \", \";\n prev($_POST);\n $fromString = $fromString . \" LEFT JOIN directed USING (title, year)\";\n $displayBitmap |= DIR_MASK;\n break;\n\n case \"actname\":\n $selectString = $selectString . current($_POST);\n next($_POST);\n if (key($_POST) != \"sort\")\n $selectString = $selectString . \", \";\n prev($_POST);\n $fromString = $fromString . \" LEFT JOIN actedin USING (title, year)\";\n $displayBitmap |= ACT_MASK;\n break;\n\n case \"scrname\":\n $selectString = $selectString . current($_POST);\n next($_POST);\n if (key($_POST) != \"sort\")\n $selectString = $selectString . \", \";\n prev($_POST);\n $fromString = $fromString . \" LEFT JOIN wrote USING (title, year)\";\n $displayBitmap |= SCR_MASK;\n break;\n\n case \"cinname\":\n $selectString = $selectString . current($_POST);\n next($_POST);\n if (key($_POST) != \"sort\")\n $selectString = $selectString . \", \";\n prev($_POST);\n $fromString = $fromString . \" LEFT JOIN shot USING (title, year)\";\n $displayBitmap |= CIN_MASK;\n break;\n\n case \"OSCAR\":\n $fromString = $fromString . \" LEFT JOIN oscar USING (title, year)\";\n $selectString = $selectString . \"category, recipientName, status\";\n $displayBitmap |= OSC_MASK;\n continue 2;\n\n default:\n continue 2;\n }\n }\n\n //get the order by attribute\n $orderByString = $orderByString . $_POST['sort'];\n\n return $selectString . $fromString . $whereString . $orderByString;\n}",
"function _parseSQL(){\n\t\tif ( !isset($this->sql_data) ){\n\t\t\timport('SQL/Parser.php');\n\t\t\t$parser =& new SQL_Parser(null,'MySQL');\n\t\t\t$this->sql_data = $parser->parse($this->sql);\n\t\t}\n\t\treturn $this->sql_data;\n\t}",
"function insert_stmt(){\n\t\tglobal $in;\n\t\tif ($this->attributes['BYTB']!='' )$this->fields_value_bytb($this->attributes['BYTB']);\n\t\t\n\t\t\n\t\tif ($this->attributes['TB']!='no'){\n\t\t\t$i=0;\n\t\t\tforeach ($this->values as $key => $val){\t\t\t\t\n\t\t\t\t$this->field_stmt[$i]=\"{$key}\";\n\t\t\t\t$this->value_stmt[$i]=\"{$in[$key]}\";\n\t\t\t\t\n\t\t\t\tif($in[$key]==1){\n\t\t\t\t\t$i++;\n\t\t\t\t\t$this->field_stmt[$i]=\"D_{$key}\";\n\t\t\t\t\t#GC 20/04/2015 gestione popolamento decode\n\t\t\t\t\tif (isset($this->attributes['DECODE'][$key])) $this->value_stmt[$i]=\"{$this->attributes['DECODE'][$key]}\";\n\t\t\t\t\telse $this->value_stmt[$i]=$val;\n\t\t\t\t}\n\t\t\t\t#GC 20/04/2015 gestione sbiancamento decode\n\t\t\t\tif($in[$key]==0){\n\t\t\t\t\t$i++;\n\t\t\t\t\t$this->field_stmt[$i]=\"D_{$key}\";\n\t\t\t\t\t$this->value_stmt[$i]=\"\";\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn;\n\t}",
"function dbprep() {\n global $kProtectFunction, $kFormatOptions, $kDebugQueries;\n\n\t$args = func_get_args();\n\t$format = array_shift($args);\n\n\t// generate final query\n\tif (empty($args)) {\n\t\t$format = str_replace(\"%%\", \"%\", $format);\n\t\t$query = $format;\n } else if (empty($kFormatOptions)) {\n $asargs = array_map($kProtectFunction, $args); // protect arguments\n $query = vsprintf($format, $asargs);\n\t} else {\n $format = str_replace(\"%%\", PERCENT_PLACEHOLDER, $format);\n if ($kDebugQueries) {\n $format = dbtestquery($format, $args);\n }\n\n $specs = preg_match_all(\"/%[${kFormatOptions}]/\", $format, $matches);\n $asargs = array_map($kProtectFunction, $matches[0], $args); // protect arguments\n\t\t$allspecs = array_map('prefixPercent', str_split($kFormatOptions));\n\t\t$format = vsprintf(str_replace($allspecs, \"%s\", $format), $asargs);\n\t\t$query = str_replace(PERCENT_PLACEHOLDER, \"%\", $format);\n }\n \n\treturn $query;\n}",
"public function prepare($sql, $params);",
"function getSql($nomConsulta,$p1=\"<NULL>\", $p2=\"<NULL>\", $p3=\"<NULL>\", $p4=\"<NULL>\", $p5=\"<NULL>\", \n\t\t\t\t\t\t\t $p6=\"<NULL>\", $p7=\"<NULL>\", $p8=\"<NULL>\", $p9=\"<NULL>\", $p10=\"<NULL>\",\n\t\t\t\t\t\t\t $p11=\"<NULL>\", $p12=\"<NULL>\", $p13=\"<NULL>\", $p14=\"<NULL>\", $p15=\"<NULL>\",\n\t\t\t\t\t\t\t $p16=\"<NULL>\", $p17=\"<NULL>\", $p18=\"<NULL>\", $p19=\"<NULL>\", $p20=\"<NULL>\",\n $p21=\"<NULL>\", $p22=\"<NULL>\", $p23=\"<NULL>\", $p24=\"<NULL>\", $p25=\"<NULL>\")\n{\n\tglobal $query;\t\n\t$queryBase = \"\";\n\t$arr = array();\n\t/*$arr[1] = $p1;\t\t$arr[2] = $p2;\n\t$arr[3] = $p3;\t\t$arr[4] = $p4;\n\t$arr[5] = $p5;\t\t$arr[6] = $p6;\n\t$arr[7] = $p7;\t\t$arr[8] = $p8;\n\t$arr[9] = $p9;\t\t$arr[10] = $p10;\n\t$arr[11] = $p11;\t$arr[12] = $p12;\n\t$arr[13] = $p13;\t$arr[14] = $p14;\n\t$arr[15] = $p15;\t$arr[16] = $p16;\n\t$arr[17] = $p17;\t$arr[18] = $p18;\n\t$arr[19] = $p19;\t$arr[20] = $p20;*/\n\t\n\t$arr[1] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p1));\n\t$arr[2] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p2));\n\t$arr[3] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p3));\n\t$arr[4] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p4));\n\t$arr[5] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p5));\n\t$arr[6] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p6));\n\t$arr[7] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p7));\n\t$arr[8] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p8));\n\t$arr[9] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p9));\n\t$arr[10] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p10));\n\t$arr[11] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p11));\n\t$arr[12] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p12));\n\t$arr[13] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p13));\n\t$arr[14] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p14));\n\t$arr[15] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p15));\n\t$arr[16] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p16));\n\t$arr[17] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p17));\n\t$arr[18] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p18));\n\t$arr[19] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p19));\n\t$arr[20] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p20));\n\t$arr[21] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p21));\n\t$arr[22] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p22));\n\t$arr[23] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p23));\n\t$arr[24] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p24));\n\t$arr[25] = str_replace(chr(13), ' ', str_replace(chr(10), ' ',$p25));\n\t\n\t$queryBase = $query[$nomConsulta];\t\n\t\t\n\t$result = replaceParams($queryBase, $arr);\n\treturn $result;\n}",
"function statement_prep($connection, $sql) {\n\t\n\tif($stmt = $connection->prepare($sql)) {\n\t\t\n\t\t/*No Bind params */\n\t\t\n\t\t/*execute statement*/\n\t\t$stmt->execute();\n\t\t\n\t\t/*get result*/\n\t\t$result=$stmt->get_result();\n\t\t\n\t\t$stmt->close();\n\t\t\n\t} else {\n\t\t\t$result=null;\n\t\t\techo 'Prepared statement error: %s\\n'. $connection->error;\n\t}\n\t\n\treturn $result;\n}",
"private function _prepareQuery() \n\t{\n\t\t\t// Establish connection to the database if not already connected\n\t\tif (! $this->_connection || empty($this->_connection)) {\n\t\t\t\n\t\t\t // retrieve the database configuration from the registry\n\t\t\t$config = Registry::getSetting('dbConfig');\n\t\t\t\n\t\t\t$this->_newConnection(\n\t\t\t\t\t$config['host'], \n\t\t\t\t\t$config['database'], \n\t\t\t\t\t$config['user'], \n\t\t\t\t\t$config['password']);\n\t\t}\n\t\t\n\t\tif (! $stmt = $this->_connection->prepare ( $this->_query )) {\n\t\t\ttrigger_error ( 'Problem preparing query', E_USER_ERROR );\n\t\t}\n\t\t$this->_stmt = $stmt;\n\t}",
"abstract protected function _getSQL(): String;",
"private function PrepStatement()\n\t{\n\t\t$this->stmt = $this->prepare($this->query->statement);\n\t\tif($this->query->parameters !==NULL && $this->query->paramtype !==NULL\n\t\t\t&& count($this->query->parameters) == count($this->query->paramtype))\n\t\t{\n\t\t\tforeach ($this->query->parameters as $parameter => $value)\n\t\t\t{\n\t\t\t\t$this->stmt->bindValue($parameter, $value, $this->query->paramtype[$parameter]);\n\t\t\t}\n\t\t}\n\t\telseif ($this->query->parameters!==NULL)\n\t\t{\n\t\t\tforeach ($this->query->parameters as $parameter => $value)\n\t\t\t{\n\t\t\t\t$this->stmt->bindValue($parameter, $value, pdo::PARAM_STR);\n\t\t\t}\n\t\t}\n\t}",
"private function prepareDbStatements() {\n $sql = \"INSERT INTO results_daily (daycode,\n id_host,\n uptime,\n downtime,\n unknowntime,\n generated_ts,\n planned_checks,\n completed_checks,\n day_details,\n log\n )\n VALUES\n (:daycode,\n :id_host,\n :uptime,\n :downtime,\n :unknowntime,\n :generated_ts,\n :planned_checks,\n :completed_checks,\n :day_details,\n :log);\";\n $this->stmt_insert_aggregated_data = $this->dbhandler->prepare($sql);\n //Prepare statement to retrieve results to aggregate...\n $sql = \"SELECT * FROM vw_checks_schedule_with_results\n WHERE id_host = :id_host AND daycode = :daycode\n ORDER BY ts_check;\";\n $this->stmt_retrieve_results = $this->dbhandler->prepare($sql);\n //PREPARE SQL STATEMENT FOR FLAG CHECKS SCHEDULED AS AGGREGATED\n $sql = \"UPDATE host_checks_schedule\n SET aggregated = 1\n WHERE daycode = :daycode\n AND id_host = :id_host;\";\n $this->stmt_set_results_aggregated = $this->dbhandler->prepare($sql);\n }",
"public function db_prep($sql){\n $result = $this->mysqli->prepare($sql);\n return $result;\n }",
"function parsingSql()\r\n\t{\r\n\t\tif ( preg_match(\"/{(.*?)}/\",$this->sql,$match) )\r\n\t\t{\r\n\t\t\t$this->valueToReplace = $match[0]; // {blabla}\r\n\t\t\t$this->fieldToSelect = $match[1]; // nama field yang akan di cek\r\n\t\t}else{\r\n\t\t\tdie(\"SQL query yg anda masukan harus mengandung {}\");\r\n\t\t\treturn ;\r\n\t\t}\r\n\t}",
"public function prepare( $sql ){\n $this->stmt = $this->pdo->prepare( $sql );\n }",
"function sql_query($db_hst, $db_un, $db_pw, $db, $str_SQL = \"\"){//possibly pass db cred data as an array?\n $this->db_hst = $db_hst;\n $this->db_un = $db_un;\n $this->db_pw = $db_pw;\n $this->db = $db;\n \tif($str_SQL <> \"\"){\n \t\t$this->set_sql_string($str_SQL);\n \t\t$this->apply_sql();\n \t}\n \tif($this->bolDebug == 1){echo \"FUNCTION set_sql_string()<br> \\$db_hst=$db_hst, \\$db_un=$db_un, \\$db_pw=$db_pw, \\$db=$db \\$this->str_select_SQL=\" . $this->str_select_SQL . $this->strDebugNewLine;}\n }",
"function prepare($pquery){\n if ( ! $this->initDB() ) return false; \n return $this->dbh->prepare($pquery);\n }",
"public function prepare();",
"public function prepare();",
"function sql_set_charset($charset, $dbh=NULL) {\n global $MYSQL_HANDLER,$SQL_DBH;\n if (strpos($MYSQL_HANDLER[1], 'mysql') === 0) {\n switch(strtolower($charset)){\n case 'utf-8':\n case 'utf8':\n $charset = 'utf8';\n break;\n case 'utf8mb4':\n $charset = 'utf8mb4';\n break;\n case 'euc-jp':\n case 'ujis':\n $charset = 'ujis';\n break;\n case 'gb2312':\n $charset = 'gb2312';\n break;\n /*\n case 'shift_jis':\n case 'sjis':\n $charset = 'sjis';\n break;\n */\n default:\n $charset = 'latin1';\n break;\n }\n\n $db = ($dbh ? $dbh : sql_get_db());\n $mySqlVer = implode('.', array_map('intval', explode('.', sql_get_server_info($db))));\n if (version_compare($mySqlVer, '4.1.0', '>='))\n {\n $res = $db->exec(\"SET CHARACTER SET \" . $charset);\n }\n }\n return $res;\n }",
"function ParseInsertIntoStatement($strSQL)\n//returns an associative array of info\n//return table name keyed to qpre . \"tablename\"\n{\n\t$strSQL=deMultiple($strSQL, \" \");\n\t$arrOut=Array();\n\t$strLen=strlen($strSQL);\n\t$firstparenloc=strpos($strSQL, \"(\");\n\t$secondparenloc=strpos($strSQL, \")\", $firstparenloc);\n\t$thirdparenloc=strpos($strSQL, \"(\", $secondparenloc);\n\t$fourthparenloc=strpos($strSQL, \")\", $thirdparenloc);\n\t$strRawFieldnames=substr($strSQL, $firstparenloc+1, $secondparenloc-$firstparenloc-1);\n\t$strRawFieldvalues=substr($strSQL, $thirdparenloc+1, $fourthparenloc-(1+$thirdparenloc));\n\t$spacebeforefirstparen=strrpos($strSQL, \" \", -($strLen- $firstparenloc));\n\t//echo $firstparenloc . \"=\" . $spacebeforefirstparen . \"=<br>\";\n\tif($spacebeforefirstparen+1==$firstparenloc)\n\t{\n\t\t$spacebeforefirstparen=strrpos($strSQL, \" \", -($strLen- (1+ $firstparenloc)));\n\t\t\n\t}\n\t$tablename=substr($strSQL, $spacebeforefirstparen+1, ($firstparenloc-$spacebeforefirstparen-1));\n\t//echo $tablename . \"*<br>\";\n\t//echo \"*\" . $thirdparenloc . \" \" .$fourthparenloc . \" \" . $strRawFieldvalues. \"*<br>\";\n\t$strRawFieldnames=str_replace(\" \", \"\", $strRawFieldnames);\n\t$arrFieldNames=ParseStringToArraySkippingQuotedRegions($strRawFieldnames, \"'\\\"\", \",\");\n\t$arrValues=ParseStringToArraySkippingQuotedRegions($strRawFieldvalues, \"'\\\"\", \",\");\n\t$i=0;\n\tforeach($arrFieldNames as $thisfieldname)\n\t{\n\t \tif($thisfieldname!=\"\")\n\t\t{\n\t\t\t$arrOut[$thisfieldname]=trim($arrValues[$i]);\n\t\t\t$i++;\n\t\t}\n\t}\n\t$arrOut[qpre . \"table\"]=$tablename;\n\treturn $arrOut;\n}",
"function print_tpch_sql($data, $config, $outfile) {\n\n\t\t$fd = fopen($outfile, \"a\");\n\n\t\tfwrite($fd, \"BEGIN;\\n\");\n\n\t\t$sql = \t'INSERT INTO config(title, cpu_desc, cpu_cores, ram, drive_desc, drive_rpm, kernel_version, pg_version, shared_buffers, ' .\n\t\t\t\t'effective_cache, work_mem, maint_mem, checkp_segments, checkp_target, read_ahead) ' .\n\t\t\t\t\"VALUES ('%s', '%s', %d, %d, '%s', '%s', '%s', '%s', %d, %d, %d, %d, %d, %d, %d);\";\n\n\t\tfwrite($fd, sprintf($sql,\n\t\t\tpg_escape_string($config['title']),\n\t\t\tpg_escape_string($config['cpu_desc']),\n\t\t\t(int)$config['cpu_cores'],\n\t\t\t(int)$config['ram'],\n\t\t\tpg_escape_string($config['drive_desc']),\n\t\t\t(int)$config['drive_rpm'],\n\t\t\tpg_escape_string($config['kernel_version']),\n\t\t\tpg_escape_string($config['pg_version']),\n\t\t\t(int)$config['shared_buffers'],\n\t\t\t(int)$config['effective_cache'],\n\t\t\t(int)$config['work_mem'],\n\t\t\t(int)$config['maint_mem'],\n\t\t\t(int)$config['checkp_segments'],\n\t\t\t(int)$config['checkp_target'],\n\t\t\t(int)$config['read_ahead']\n\t\t) . \"\\n\");\n\n\t\t$sql = 'INSERT INTO results_tpch(config_id, fs, fs_block, db_block, ' .\n\t\t\t\t'tpch_load, tpch_fkeys, tpch_indexes, tpch_analyze, tpch_total, ' .\n\t\t\t\t'query_1, query_2, query_3, query_4, query_5, query_6, query_7, query_8, query_9, query_10, query_11, query_12, query_13, ' .\n\t\t\t\t'query_14, query_15, query_16, query_17, query_18, query_19, query_20, query_21, query_22, '.\n\t\t\t\t'query_1_hash, query_2_hash, query_3_hash, query_4_hash, query_5_hash, query_6_hash, query_7_hash, query_8_hash, query_9_hash, ' .\n\t\t\t\t'query_10_hash, query_11_hash, query_12_hash, query_13_hash, query_14_hash, query_15_hash, query_16_hash, query_17_hash, ' .\n\t\t\t\t'query_18_hash, query_19_hash, query_20_hash, query_21_hash, query_22_hash, db_cache_hit_ratio) ' .\n\t\t\t\t\"VALUES (currval('config_id_seq'), '%s', %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, \" .\n\t\t\t\t\"%s, %s, %s, %s, %s, %s, %s, %s, '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', '%s', \" .\n\t\t\t\t\"'%s', '%s', '%s', '%s', '%s', '%s', '%s', %s)\";\n\n\t\tforeach ($data AS $fs => $a) {\n\t\t\tforeach ($a AS $pgbs => $b) {\n\t\t\t\tforeach ($b AS $fsbs => $c) {\n\n\t\t\t\t\tfwrite($fd, sprintf($sql,\n\t\t\t\t\t\t$fs,\n\t\t\t\t\t\t$fsbs,\n\t\t\t\t\t\t$pgbs,\n\n\t\t\t\t\t\t// tpc-h\n\t\t\t\t\t\t$c['tpch']['load'],\n\t\t\t\t\t\t$c['tpch']['fkeys'],\n\t\t\t\t\t\t$c['tpch']['indexes'],\n\t\t\t\t\t\t$c['tpch']['analyze'],\n\t\t\t\t\t\t$c['tpch']['benchmark'],\n\n\t\t\t\t\t\t($c['tpch']['queries'][1]['duration'] < QUERY_TIMEOUT) ? $c['tpch']['queries'][1]['duration'] : 'NULL',\n\t\t\t\t\t\t($c['tpch']['queries'][2]['duration'] < QUERY_TIMEOUT) ? $c['tpch']['queries'][2]['duration'] : 'NULL',\n\t\t\t\t\t\t($c['tpch']['queries'][3]['duration'] < QUERY_TIMEOUT) ? $c['tpch']['queries'][3]['duration'] : 'NULL',\n\t\t\t\t\t\t($c['tpch']['queries'][4]['duration'] < QUERY_TIMEOUT) ? $c['tpch']['queries'][4]['duration'] : 'NULL',\n\t\t\t\t\t\t($c['tpch']['queries'][5]['duration'] < QUERY_TIMEOUT) ? $c['tpch']['queries'][5]['duration'] : 'NULL',\n\t\t\t\t\t\t($c['tpch']['queries'][6]['duration'] < QUERY_TIMEOUT) ? $c['tpch']['queries'][6]['duration'] : 'NULL',\n\t\t\t\t\t\t($c['tpch']['queries'][7]['duration'] < QUERY_TIMEOUT) ? $c['tpch']['queries'][7]['duration'] : 'NULL',\n\t\t\t\t\t\t($c['tpch']['queries'][8]['duration'] < QUERY_TIMEOUT) ? $c['tpch']['queries'][8]['duration'] : 'NULL',\n\t\t\t\t\t\t($c['tpch']['queries'][9]['duration'] < QUERY_TIMEOUT) ? $c['tpch']['queries'][9]['duration'] : 'NULL',\n\t\t\t\t\t\t($c['tpch']['queries'][10]['duration'] < QUERY_TIMEOUT) ? $c['tpch']['queries'][10]['duration'] : 'NULL',\n\t\t\t\t\t\t($c['tpch']['queries'][11]['duration'] < QUERY_TIMEOUT) ? $c['tpch']['queries'][11]['duration'] : 'NULL',\n\t\t\t\t\t\t($c['tpch']['queries'][12]['duration'] < QUERY_TIMEOUT) ? $c['tpch']['queries'][12]['duration'] : 'NULL',\n\t\t\t\t\t\t($c['tpch']['queries'][13]['duration'] < QUERY_TIMEOUT) ? $c['tpch']['queries'][13]['duration'] : 'NULL',\n\t\t\t\t\t\t($c['tpch']['queries'][14]['duration'] < QUERY_TIMEOUT) ? $c['tpch']['queries'][14]['duration'] : 'NULL',\n\t\t\t\t\t\t($c['tpch']['queries'][15]['duration'] < QUERY_TIMEOUT) ? $c['tpch']['queries'][15]['duration'] : 'NULL',\n\t\t\t\t\t\t($c['tpch']['queries'][16]['duration'] < QUERY_TIMEOUT) ? $c['tpch']['queries'][16]['duration'] : 'NULL',\n\t\t\t\t\t\t($c['tpch']['queries'][17]['duration'] < QUERY_TIMEOUT) ? $c['tpch']['queries'][17]['duration'] : 'NULL',\n\t\t\t\t\t\t($c['tpch']['queries'][18]['duration'] < QUERY_TIMEOUT) ? $c['tpch']['queries'][18]['duration'] : 'NULL',\n\t\t\t\t\t\t($c['tpch']['queries'][19]['duration'] < QUERY_TIMEOUT) ? $c['tpch']['queries'][19]['duration'] : 'NULL',\n\t\t\t\t\t\t($c['tpch']['queries'][20]['duration'] < QUERY_TIMEOUT) ? $c['tpch']['queries'][20]['duration'] : 'NULL',\n\t\t\t\t\t\t($c['tpch']['queries'][21]['duration'] < QUERY_TIMEOUT) ? $c['tpch']['queries'][21]['duration'] : 'NULL',\n\t\t\t\t\t\t($c['tpch']['queries'][22]['duration'] < QUERY_TIMEOUT) ? $c['tpch']['queries'][22]['duration'] : 'NULL',\n\n\t\t\t\t\t\t$c['tpch']['queries'][1]['hash'],\n\t\t\t\t\t\t$c['tpch']['queries'][2]['hash'],\n\t\t\t\t\t\t$c['tpch']['queries'][3]['hash'],\n\t\t\t\t\t\t$c['tpch']['queries'][4]['hash'],\n\t\t\t\t\t\t$c['tpch']['queries'][5]['hash'],\n\t\t\t\t\t\t$c['tpch']['queries'][6]['hash'],\n\t\t\t\t\t\t$c['tpch']['queries'][7]['hash'],\n\t\t\t\t\t\t$c['tpch']['queries'][8]['hash'],\n\t\t\t\t\t\t$c['tpch']['queries'][9]['hash'],\n\t\t\t\t\t\t$c['tpch']['queries'][10]['hash'],\n\t\t\t\t\t\t$c['tpch']['queries'][11]['hash'],\n\t\t\t\t\t\t$c['tpch']['queries'][12]['hash'],\n\t\t\t\t\t\t$c['tpch']['queries'][13]['hash'],\n\t\t\t\t\t\t$c['tpch']['queries'][14]['hash'],\n\t\t\t\t\t\t$c['tpch']['queries'][15]['hash'],\n\t\t\t\t\t\t$c['tpch']['queries'][16]['hash'],\n\t\t\t\t\t\t$c['tpch']['queries'][17]['hash'],\n\t\t\t\t\t\t$c['tpch']['queries'][18]['hash'],\n\t\t\t\t\t\t$c['tpch']['queries'][19]['hash'],\n\t\t\t\t\t\t$c['tpch']['queries'][20]['hash'],\n\t\t\t\t\t\t$c['tpch']['queries'][21]['hash'],\n\t\t\t\t\t\t$c['tpch']['queries'][22]['hash'],\n\t\t\t\t\t\t$c['tpch']['stats']['hit_ratio']\n\n\t\t\t\t\t) . \";\\n\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\tfwrite($fd, \"COMMIT;\\n\");\n\t\tfclose($fd);\n\n\t}",
"function execute_prepared_query($prep_q, $bound_vars, $bound_var_types, $result_expected = false)\n{\n\tglobal $spebs_db;\n\t$pstmt = $spebs_db -> prepare($prep_q);\t\n\tif($spebs_db->errno != 0)\n\t{\n\t\terror_log(\"PREPARE STATEMENT error \".$spebs_db->errno.\": \".$spebs_db->error.\" (Q = \\\"$prep_q\\\")\");\n\t\treturn false;\n\t}\n\t\n\t$bound_varrefs = array();\n\t$bound_varrefs[0] = $bound_var_types;\n\t$i=1;\n\tforeach($bound_vars AS $thisvar)\n\t{\t\n\t\t${\"x$i\"} = $thisvar;\n\t\t$bound_varrefs[$i] = &${\"x$i\"};\n\t\t$i++;\n\t}\n\t$bind_action = call_user_func_array(array($pstmt, 'bind_param'), $bound_varrefs);\n\tif(!$bind_action)\n\t{\t\n\t\terror_log(\"CALL_USER_FUNC_ARRAY error \");\n\t\treturn false;\n\t}\n\tif($pstmt->errno != 0)\n\t{\n\t\terror_log(\"PREPARED QUERY BIND error \".$pstmt->errno.\": \".$pstmt->error);\n\t\treturn false;\n\t}\t\n\tif($pstmt -> execute())\n\t{\n\t\tif(!$result_expected)\n\t\t{\n\t\t\tif(isset($pstmt -> insert_id) && is_int($pstmt -> insert_id) && $pstmt -> insert_id > 0)\n\t\t\t\t$res = $pstmt -> insert_id;\n\t\t\telse\n\t\t\t\t$res = true;\n\t\t\t\t\n\t\t\t$pstmt -> close();\n\t\t\treturn $res;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$results = array();\n\t\t\t$row = array();\n\t\t\t$metadata = $pstmt -> result_metadata();\n\t\t\tforeach($metadata -> fetch_fields() AS $field)\n\t\t\t{\t\n\t\t\t\t$row[$field -> name] = NULL;\n\t\t\t\t$bound_resrefs[] = &$row[$field -> name];\n\t\t\t}\n\t\t\t$bind_action = call_user_func_array(array($pstmt, 'bind_result'), $bound_resrefs);\n\t\t\t$i = 0;\n\t\t\twhile($pstmt -> fetch())\n\t\t\t{\t\n\t\t\t\tforeach($row AS $k => $v)\n\t\t\t\t$results[$i][$k] = $v;\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\t\n\t\t\t$pstmt -> close();\n\t\t\treturn $results;\n\t\t}\n\t\t\n\t}\n\telse\n\t{\n\t\terror_log($pstmt->errno.\": \".$pstmt->error);\n\t\t$pstmt -> close();\t\n\t\treturn false;\n\t}\n}",
"function execute_sql($fileName, $db, $utf8_ok) {\r\n\r\n\t@set_time_limit(120);\r\n\r\n\t// read the data\r\n\t$fd = @fopen ($fileName, 'r');\r\n\tif ($fd === false) {\r\n\t\tshow_error(\"Unable to open SQL file '$fileName'\");\r\n\t}\r\n\t$data = fread($fd, filesize ($fileName));\r\n\tfclose($fd);\r\n\r\n\t// split into separate statements\r\n\t$queries = splitSql($data);\r\n\r\n\t// execute each statement\r\n\tforeach ($queries as $sql) {\r\n\t\t$sql = trim($sql);\r\n\r\n\t\t// skip comments\r\n\t\tif (empty($sql) || $sql[0] == '#' || substr($sql,0,2) == '--') {\r\n\t\t\tcontinue;\r\n\t\t}\r\n\r\n\t\t// set table prefix\r\n\t\t$sql = str_replace('[prefix]', MYSQLPREFIX, $sql);\r\n\r\n\t\t// if database doesn't support utf8, remove the character set declaration\r\n\t\tif (!$utf8_ok) {\r\n\t\t\t$sql = str_replace(' DEFAULT CHARACTER SET utf8', '', $sql);\r\n\t\t}\r\n\r\n\t\t// execute the statement and handle errors\r\n\t\t$result = $db->query($sql);\r\n\t\tif ($db->isError($result)) {\r\n\t\t\tif ($result->code == MDB2_ERROR_ALREADY_EXISTS) {\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\treturn array('info' => $result->userinfo, 'message'=> $result->message, 'code'=> $result->code );\r\n\t\t}\r\n\t}\r\n\treturn false;\r\n}",
"function PMA_splitSqlFile(&$ret, $sql)\n{\n //$sql = trim($sql);\n $sql = rtrim($sql, \"\\n\\r\");\n $sql_len = strlen($sql);\n $char = '';\n $string_start = '';\n $in_string = FALSE;\n $nothing = TRUE;\n $time0 = time();\n\n for ($i = 0; $i < $sql_len; ++$i) {\n $char = $sql[$i];\n\n // We are in a string, check for not escaped end of strings except for\n // backquotes that can't be escaped\n if ($in_string) \n\t\t{\n for (;;) {\n $i = strpos($sql, $string_start, $i);\n // No end of string found -> add the current substring to the\n // returned array\n if (!$i) {\n $ret[] = array('query' => $sql, 'empty' => $nothing);\n return TRUE;\n }\n // Backquotes or no backslashes before quotes: it's indeed the\n // end of the string -> exit the loop\n else if ($string_start == '`' || $sql[$i-1] != '\\\\') {\n $string_start = '';\n $in_string = FALSE;\n break;\n }\n // one or more Backslashes before the presumed end of string...\n else {\n // ... first checks for escaped backslashes\n $j = 2;\n $escaped_backslash = FALSE;\n while ($i-$j > 0 && $sql[$i-$j] == '\\\\') {\n $escaped_backslash = !$escaped_backslash;\n $j++;\n }\n // ... if escaped backslashes: it's really the end of the\n // string -> exit the loop\n if ($escaped_backslash) {\n $string_start = '';\n $in_string = FALSE;\n break;\n }\n // ... else loop\n else {\n $i++;\n }\n } // end if...elseif...else\n } // end for\n } // end if (in string)\n\n // lets skip comments (/*, -- and #)\n else if (($char == '-' && $sql_len > $i + 2 && $sql[$i + 1] == '-' && $sql[$i + 2] <= ' ') || $char == '#' || ($char == '/' && $sql_len > $i + 1 && $sql[$i + 1] == '*')) {\n $i = strpos($sql, $char == '/' ? '*/' : \"\\n\", $i);\n // didn't we hit end of string?\n if ($i === FALSE) {\n break;\n }\n if ($char == '/') $i++;\n }\n\n // We are not in a string, first check for delimiter...\n else if ($char == ';') {\n // if delimiter found, add the parsed part to the returned array\n $ret[] = array('query' => substr($sql, 0, $i), 'empty' => $nothing);\n $nothing = TRUE;\n $sql = ltrim(substr($sql, min($i + 1, $sql_len)));\n $sql_len = strlen($sql);\n if ($sql_len) {\n $i = -1;\n } else {\n // The submited statement(s) end(s) here\n return TRUE;\n }\n } // end else if (is delimiter)\n\n // ... then check for start of a string,...\n else if (($char == '\"') || ($char == '\\'') || ($char == '`')) {\n $in_string = TRUE;\n $nothing = FALSE;\n $string_start = $char;\n } // end else if (is start of string)\n\n elseif ($nothing) {\n $nothing = FALSE;\n }\n\n // loic1: send a fake header each 30 sec. to bypass browser timeout\n $time1 = time();\n if ($time1 >= $time0 + 30) {\n $time0 = $time1;\n header('X-pmaPing: Pong');\n } // end if\n } // end for\n\n // add any rest to the returned array\n if (!empty($sql) && preg_match('@[^[:space:]]+@', $sql)) {\n $ret[] = array('query' => $sql, 'empty' => $nothing);\n }\n\n return TRUE;\n}",
"function esc_sql($data)\n {\n }",
"abstract function getSQL();",
"function pdo_preparedStmt($pdo,$query,$parmList,$parmData){\n$sql = $pdo->prepare($query);\nfor ($i=0; $i < count($parmList); $i++) { \n $sql->bindParam($parmList[$i], $parmData[$i]);\n}\n\nreturn $sql->execute();\n}",
"static function generalizeSQL( $sql ) {\n\t\t# This does the same as the regexp below would do, but in such a way\n\t\t# as to avoid crashing php on some large strings.\n\t\t# $sql = preg_replace( \"/'([^\\\\\\\\']|\\\\\\\\.)*'|\\\"([^\\\\\\\\\\\"]|\\\\\\\\.)*\\\"/\", \"'X'\", $sql );\n\n\t\t$sql = str_replace( \"\\\\\\\\\", '', $sql );\n\t\t$sql = str_replace( \"\\\\'\", '', $sql );\n\t\t$sql = str_replace( \"\\\\\\\"\", '', $sql );\n\t\t$sql = preg_replace( \"/'.*'/s\", \"'X'\", $sql );\n\t\t$sql = preg_replace( '/\".*\"/s', \"'X'\", $sql );\n\n\t\t# All newlines, tabs, etc replaced by single space\n\t\t$sql = preg_replace( '/\\s+/', ' ', $sql );\n\n\t\t# All numbers => N\n\t\t$sql = preg_replace( '/-?\\d+(,-?\\d+)+/s', 'N,...,N', $sql );\n\t\t$sql = preg_replace( '/-?\\d+/s', 'N', $sql );\n\n\t\treturn $sql;\n\t}",
"function yy_r102(){ \n $this->_retvalue = new SQL\\Insert(@$this->yystack[$this->yyidx + -2]->minor);\n $this->_retvalue->into($this->yystack[$this->yyidx + 0]->minor[0])->fields($this->yystack[$this->yyidx + 0]->minor[1]);\n }",
"function &fDefineQry(&$db, $pQry=false){\n global $rsH, $rsG;\n // echo 'original: '.$pQry;\n $db->Execute(\"SET lc_time_names = 'es_EC'\");\n $v=substr ($pQry, 0, 13);\n $f1=substr ($pQry, 23, 8);\n $f2=substr ($pQry, 38, 8);\n list($d,$m,$a)=explode(\"/\",$f1);\n $f1n='20'.$a.\"-\".$m.\"-\".$d;\n list($d,$m,$a)=explode(\"/\",$f2);\n $f2n='20'.$a.\"-\".$m.\"-\".$d;\n \n if($v=='com_FecContab')\n {\n $slCond=$pQry;\n $slCond='com_FecContab BETWEEN \"'.$f1n.'\" AND \"'.$f2n.'\"';\n }\n else\n {\n $slCond=$pQry;\n }\n \n // ECHO 'condicion: '.$slCond; \n \n $slSqlH =\"select\n\t\t com_NumComp as factura, \n\t\t com_codreceptor , \n\t\t com_refoperat as 'semana', \n\t\t cl.aux_nombre AS 'productor', \n\t\t bo.aux_codigo AS 'cod_bod_origen', \n\t\t SUBSTRING(bo.aux_nombre,8) AS 'bodega', \n\t\t cl.aux_codigo AS 'codProductor', \n\t\t act_codauxiliar AS coditem, \n\t\t concat(act_descripcion, ' ', ifnull(act_descripcion1,'')) as 'item', \n\t\t det_ValUnitario as 'valor_unitario' ,\n\t\t det_cantequivale as 'cantidad',\n\t\t \n\t\t CASE WHEN (act_IvaFlag=2) THEN det_ValTotal\n\t\t WHEN (act_IvaFlag=3) THEN (det_ValTotal/(1+(tsd_PorcentajeBI/100)))\n\t\t ELSE det_ValTotal\n\t\t END AS 'BASE_IMPONIBLE',\n\t\t \n\t\t \n\t\t CASE WHEN (act_IvaFlag=0) THEN '0'\n\t\t ELSE tsd_PorcentajeBI\n\t\t END AS 'PORCENTAJE_IVA',\n\t\t CASE WHEN (act_IvaFlag=0) THEN '0'\n\t\t ELSE det_ValTotal*(tsd_PorcentajeBI/100)\n\t\t END AS 'IVA',\n\t\t CASE WHEN (act_IvaFlag=2) THEN (det_ValTotal+(det_ValTotal*(tsd_PorcentajeBI/100)))\n\t\t WHEN (act_IvaFlag=3) THEN det_ValTotal\n\t\t ELSE det_ValTotal\n\t\t END AS 'TOTAL'\n\t from\n\t\t concomprobantes\n\t\t left join invdetalle on det_regnumero = com_regnumero \n\t\t left join v_conauxiliar cl on cl.aux_codigo = com_codreceptor \n\t\t left join v_conauxiliar bo on bo.aux_codigo = com_emisor \n\t\t left join conactivos it on it.act_codauxiliar = det_coditem \n\t\t left join invprecios on pre_lisprecios = 2 and pre_coditem = det_coditem \n\t\t left join invprocesos on pro_codproceso = 5 and cla_TipoTransacc = com_TipoComp,\n\t\t gentasacabecera,\n\t\t gentasadetalle\n\t WHERE \n\t\t com_TipoComp='FA' AND \n\t\t tsc_ID=tsd_ID AND\n\t\t tsd_Rubro=1 AND $slCond\n\t ORDER BY\n\t\t\tbodega,productor\";\n\n $rsG = $db->Execute($slSqlH);\n return $rsG;\t\n}",
"public function make_sql()\n\t{\n\t\ttry{\n\t\t\t$metot = $this->metot;\n\t\t\t$metot = strtolower($metot);\n\t\t\t\n\t\t\tif($metot == \"select\") /* Select için sql oluşturma*/\n\t\t\t{\n\t\t\t\tif ((count($this->tables))== 1)\n\t\t\t\t{\n\t\t\t\t\tfor ($c=1;$c<=(count($this->tables[0])-1);$c++){\n\t\t\t\t\t$col .= $this->tables[0][$c].\", \";\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$col = trim($col);\n\t\t\t\t\t$col = substr(\"$col\", 0, -1);\n\t\t\t\t\t$table = $this->tables[0][0]; \n\t\t\t\t\t/*\n\t\t\t\t\t\tvar_dump($col);\n\t\t\t\t\t\tvar_dump($table);\n\t\t\t\t\t\tstring 'id, adsoyad' (length=12)\n\t\t\t\t\t\tstring 'email' (length=5)\n\t\t\t\t\t*/\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\tforeach ($this->tables AS $row){\n\t\t\t\t\t\t$table = $row[0];\n\t\t\t\t\t\tfor($c=1; $c<=(count($row)-1);$c++){\n\t\t\t\t\t\t\t$var = trim($row[$c]);\n\t\t\t\t\t\t\t$col .= \"{$table}.{$var}, \";\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$col = trim($col);\n\t\t\t\t\t$col = substr($col, 0, -1);\n\t\t\t\t\t$table = $this->tables[0][0]; \n\t\t\t\t\t/*\n\t\t\t\t\t\tvar_dump($col);\n\t\t\t\t\t\tvar_dump($table);\n\t\t\t\t\t\tstring 'email.id, email.adsoyad, blog.id, blog.title' (length=44)\n\t\t\t\t\t\tstring 'email' (length=5)\n\t\t\t\t\t*/\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tif (!is_null($this->join)){\n\t\t\t\t\tforeach($this->join AS $row) {$join .=\" $row \";}\n\t\t\t\t}\n\t\t\t\telse $join = \"\";\n\t\t\t\t\n\t\t\t\tif (!is_null($this->where)) $where = $this->where;\n\t\t\t\telse $where =\"\";\n\t\t\t\t\n\t\t\t\tif (!is_null($this->order)) $order = $this->order;\n\t\t\t\telse $order =\"\";\n\t\t\t\t\n\t\t\t\tif (!is_null($this->group)) $group = $this->group;\n\t\t\t\telse $group =\"\";\n\t\t\t\t\n\t\t\t\tif (!is_null($this->limit)) $limit = $this->limit;\n\t\t\t\telse $limit =\"\";\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->sql = $this->metot.\" \". $col.\" FROM \".$table.\" \".$join.\" \".$where.\" \".$group.\" \".$order.\" \".$limit;\n\t\t\t\t/*var_dump($this->sql); string 'SELECT id, adsoyad FROM email WHERE email.id=35 ' (length=53)*/\n\t\t\t} /*if($metot == \"select\")*/\n\t\t\t\n\t\t\tif($metot == \"insert\") /* Insert için sql oluşturma*/\n\t\t\t{\n\t\t\t\tforeach ($this->tables AS $row)\n\t\t\t\t{\n\t\t\t\t\t$table = $row[0];\n\t\t\t\t\t$col = \"\";\n\t\t\t\t\t$colVal = \"\";\n\t\t\t\t\tfor ($c=1;$c<=(count($row)-1);$c++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$col \t.= strstr($row[$c], \"=\", true).\", \";\n\t\t\t\t\t\t$colVal .= substr((strstr($row[$c], \"=\")), 1).\", \";\n\t\t\t\t\t}\n\t\t\t\t\t$col = trim($col);\n\t\t\t\t\t$col = substr($col, 0, -1);\n\t\t\t\t\t$colVal = trim($colVal);\n\t\t\t\t\t$colVal = substr($colVal, 0, -1);\n\t\t\t\t\t\n\t\t\t\t\t$sql[] = \"INSERT INTO {$table} ($col) VALUES ($colVal) \";\n\t\t\t\t}\n\t\t\t\t$this->sql = $sql;\n\t\t\t} /*if($metot == \"insert\")*/\n\t\t\t\n\t\t\tif ($metot == \"update\") /* Update için sql oluşturma*/\n\t\t\t{\n\t\t\t\tif (!is_null($this->where)) $where = $this->where;\n\t\t\t\telse $where =\"\";\n\t\t\t\t\n\t\t\t\tforeach ($this->tables AS $row)\n\t\t\t\t{\n\t\t\t\t\t$table = $row[0];\n\t\t\t\t\t$col = \"\";\n\t\t\t\t\t$colVal = \"\";\n\t\t\t\t\tfor ($c=1;$c<=(count($row)-1);$c++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$col \t.= $row[$c].\", \";\n\t\t\t\t\t}\n\t\t\t\t\t$col = trim($col);\n\t\t\t\t\t$col = substr($col, 0, -1);\n\t\t\t\t\t$sql[] = \"UPDATE {$table} SET {$col} {$where}\";\n\t\t\t\t}\n\t\t\t\t$this->sql = $sql;\n\t\t\t} /*if ($metot == \"update\")*/\n\t\t\t\n\t\t\tif ($metot == \"delete\") /* Delete için sql oluşturma*/\n\t\t\t{\n\t\t\t\tif (!is_null($this->where)) $where = $this->where;\n\t\t\t\telse $where =\"\";\n\t\t\t\t\n\t\t\t\tforeach ($this->tables AS $row)\n\t\t\t\t{\n\t\t\t\t\t$table = $row[0];\n\t\t\t\t\t$col = \"\";\n\t\t\t\t\t$colVal = \"\";\n\t\t\t\t\tfor ($c=1;$c<=(count($row)-1);$c++)\n\t\t\t\t\t{\n\t\t\t\t\t\t$table = $row[0];\n\t\t\t\t\t\t$col = \"\";\n\t\t\t\t\t\t$colVal = \"\";\n\t\t\t\t\t\tfor ($c=1;$c<=(count($row)-1);$c++)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$col \t.= strstr($row[$c], \"=\", true).\", \";\n\t\t\t\t\t\t\t$colVal .= substr((strstr($row[$c], \"=\")), 1).\", \";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$col = trim($col);\n\t\t\t\t\t\t$col = substr($col, 0, -1);\n\t\t\t\t\t\t$colVal = trim($colVal);\n\t\t\t\t\t\t$colVal = substr($colVal, 0, -1);\n\t\t\t\t\t\t\n\t\t\t\t\t\t$sql[] = \"DELETE FROM {$table} WHERE ($col) = ($colVal) \";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$this->sql = $sql;\n\t\t\t} /*if ($metot == \"delete\")*/\n\t\t\t\n\t\t\t$this->run();\n\t\t}\n\t\tcatch(Exception $e){\n\t\t\techo \"Error : \".$e->getMessage() .\"<br/>\".\"File : \".$e->getFile() . \"<br/>\".\"Line : \".$e->getLine() . \"<br/>\";\n\t\t}\n\t}",
"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}",
"function initsql() {\r\n\tglobal $g_cfg,$msq;\r\n\tif ($msq != NULL) return;\r\n\tif (!($msq = mysqli_connect(\"p:\".$g_cfg[\"sql_serv\"],$g_cfg[\"sql_user\"],\r\n\t\t\t\t\turldecode($g_cfg[\"sql_pwd\"]), $g_cfg[\"sql_db\"] ))) {\r\n\t \tinternal_error(\"cannot connect to mysql.\");\r\n\t}\r\n\tmysqli_set_charset($msq, \"utf8\");\r\n\treturn true;\r\n}",
"private\tfunction\t_prepareFindQuery()\n\t\t{\n\t\t\tself::$_queries[$this->_class]['find']\t=\t'SELECT '.trim(str_replace('<alias>','a0',self::$_queries[$this->_class]['select']), ', ')\n\t\t\t\t\t\t\t\t\t\t\t\t\t.\t\"\\rFROM \".'`'.$this->_table.'` `a0`'.self::$_queries[$this->_class]['from'];\n\t\t\tunset(self::$_queries[$this->_class]['select'], self::$_queries[$this->_class]['from']);\n\t\t\t\n\t\t\treturn\tself::$_queries[$this->_class]['find'];\n\t\t}",
"private function prepareTables() {}",
"function db_raw_exec( $sql )\n{\n return Chev_PDO::instance()->raw_exec( $sql );\n}",
"private function _prepare($sql, $bind)\r\n {\r\n // (?'s) with the given, escaped parameter\r\n // - based on ADOdb emulated prepared statements\r\n\r\n if (is_array($bind))\r\n {\r\n $sqlpieces = explode('?', $sql);\r\n $sql = '';\r\n $i = 0;\r\n\r\n foreach ($bind as $param)\r\n {\r\n $sql .= $sqlpieces[$i];\r\n $sql .= $this->escape($param);\r\n $i += 1;\r\n }\r\n\r\n if (isset($sqlpieces[$i]))\r\n {\r\n $sql .= $sqlpieces[$i];\r\n\r\n if ($i + 1 != sizeof($sqlpieces))\r\n {\r\n throw new Exception(\"could not prepare statment due to parameter mismatch\");\r\n }\r\n }\r\n else if ($i != sizeof($sqlpices))\r\n {\r\n throw new Exception(\"could not prepare statment due to parameter mismatch\");\r\n }\r\n }\r\n\r\n return $sql;\r\n }",
"private function prepare($sql, $params, $type) {\n\t\t$connection = $this->getConnection($type);\n\n\t\t//$sql_monitor = new SQLMonitor($sql);\n\t\t//$sql_monitor->start();\n\n\t\t$sth = $connection->prepare($sql, array(PDO::MYSQL_ATTR_USE_BUFFERED_QUERY => FALSE));\n\t\tforeach ($params AS $key => $value) {\n\t\t\tif (strpos($key, '_') === 0) {\n\t\t\t\t$sth->bindValue(\":{$key}\", $value, PDO::PARAM_INT);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$sth->bindValue(\":{$key}\", $value, PDO::PARAM_STR);\n\t\t\t}\n\t\t}\n\t\t$sth->execute();\n\n\t\t//$sql_monitor->finish($sth);\n\n\t\treturn $sth;\n\t}",
"public function prepareQuery($sql) {\n if (preg_match('/^\\s*DELETE\\s+FROM\\s+(\\S+)\\s*$/i', $sql)) {\n $sql = preg_replace(\"/^\\s*DELETE\\s+FROM\\s+(\\S+)\\s*$/\", \"DELETE FROM \\\\1 WHERE 1=1\", $sql);\n }\n return $sql;\n }",
"protected function printSqlCheck() {}",
"function Compile_SQL($Database_Settings)\n{\n\trequire_once(\"jelly/php/libraries/Mysqldump/Mysqldump.php\");\n\n\t// Create SQL Dump\n\t$Compiled_SQL = new Ifsnop\\Mysqldump\\Mysqldump('mysql:host=' . $Database_Settings['Host_Name'] . ';dbname=' . $Database_Settings['Database_Name'], $Database_Settings['Username'], $Database_Settings['Password']);\n\t\n\t// Write SQL Dump\n\t$Compiled_SQL_Path = 'jelly/xml/' . 'Compiled' . '.' .'sql';\n\t$Compiled_SQL->start($Compiled_SQL_Path);\n}",
"function splitSql($sql)\r\n{\r\n $sql = preg_replace(\"/\\r/s\", \"\\n\", $sql);\r\n $sql = preg_replace(\"/[\\n]{2,}/s\", \"\\n\", $sql);\r\n $lines = explode(\"\\n\", $sql);\r\n $queries = array();\r\n $inQuery = 0;\r\n $i = 0;\r\n\r\n foreach ($lines as $line) {\r\n $line = trim($line);\r\n\r\n if (!$inQuery) {\r\n if (preg_match(\"/^CREATE/i\", $line)) {\r\n $inQuery = 1;\r\n $queries[$i] = $line;\r\n }\r\n elseif (!empty($line) && $line[0] != \"#\") {\r\n $queries[$i] = preg_replace(\"/;$/i\", \"\", $line);\r\n $i++;\r\n }\r\n }\r\n elseif ($inQuery) {\r\n if (preg_match(\"/^[\\)]/\", $line)) {\r\n $inQuery = 0;\r\n $queries[$i] .= preg_replace(\"/;$/i\", \"\", $line);\r\n $i++;\r\n }\r\n elseif (!empty($line) && $line[0] != \"#\") {\r\n $queries[$i] .= $line;\r\n }\r\n }\r\n }\r\n\r\n return $queries;\r\n}",
"function yy_r18(){ $this->_retvalue = new SQL\\BeginTransaction($this->yystack[$this->yyidx + 0]->minor); }",
"abstract protected function buildSQL(): string;",
"function sqlCode($s, $db){\n\t$result = preg_replace(\"/[^a-zA-Z0-9\\-]+/\", \"\", $s);\n\treturn trim($db->real_escape_string($result));\n}",
"function yy_r103(){ \n $this->_retvalue = new SQL\\Insert(@$this->yystack[$this->yyidx + -1]->minor);\n $this->_retvalue->into($this->yystack[$this->yyidx + 0]->minor[0]); \n }",
"static function initMySQL()\n {\n require_once \"system/3d-party/DBSimple/Generic.php\" ;\n self::$sql = DbSimple_Generic::connect('mysql://'.self::$config['db']['user'].':'.self::$config['db']['password'].'@'.self::$config['db']['server'].'/'.self::$config['db']['database']);\n self::$sql->setIdentPrefix(self::$config['db']['table_prefix'].\"_\");\n self::$sql->setErrorHandler(array('Core', 'databaseErrorHandler'));\n\n mysql_set_charset(\"utf8\") or trigger_error(\"An error occurred when specifying the encoding for MySQL\", E_USER_WARNING);\n define('TABLE_PREFIX', self::$config['db']['table_prefix'].\"_\");\n }",
"abstract public function prepareSelect();",
"function exportQuery($db, $sql) {\r\n\tconnect();\r\n\tglobal $l, $errmsg;\r\n\t$sBuffer = \"\";\r\n\t$tableName = \"\";\r\n\t$columnNames = \"\";\r\n\t$columnTypes = \"\";\r\n\t$arrTypes;\r\n\t$sRowBuffer = \"\";\r\n\t$sSQLBuffer = \"\";\r\n\t$fieldValue = \"\";\r\n\t\r\n\t$r = mysql_db_query($db, $sql , $l);\r\n\t$errmsg = mysql_errno().\": \".mysql_error();\r\n\tif (mysql_error() != \"\") {\r\n\t\terrormsg(\"Database Error\", $errmsg);\r\n\t\t$r = 0;\r\n\t\treturn $r;\r\n\t}\r\n\t\r\n\twhile ($obj = mysql_fetch_field($r)) {\r\n\t \tif ($tableName == \"\") $tableName = $obj->table;\r\n\t \tif ($columnNames != \"\") { $columnNames = \"$columnNames,\"; }\r\n\t \tif ($columnTypes != \"\") { $columnTypes = \"$columnTypes,\"; }\r\n\t\t$columnNames = \"$columnNames$obj->name\"; \r\n\t\t$columnTypes .= $obj->type; \r\n\t} \r\n\t\r\n\t$columnTypes = strtoupper($columnTypes);\r\n\t$arrTypes = split(\",\",$columnTypes);\r\n\t// return $columnTypes . \"\\n\\n\" . join($arrTypes,\",\");\r\n\t\r\n\twhile ($row = mysql_fetch_row($r)) {\r\n\t \t$sRowBuffer = \"\";\r\n\t \t$sSQLBuffer = \"\";\r\n\t\tfor ($i=0; $i<mysql_num_fields($r); $i++) {\r\n\t\t\tswitch ($arrTypes[$i]) {\r\n\t\t\t\tcase \"TINYINT\":\r\n\t\t\t\tcase \"SMALLINT\":\r\n\t\t\t\tcase \"MEDIUMINT\":\r\n\t\t\t\tcase \"INT\":\r\n\t\t\t\tcase \"INTEGER\":\r\n\t\t\t\tcase \"BIGINT\":\r\n\t\t\t\tcase \"FLOAT(4)\":\r\n\t\t\t\tcase \"FLOAT(8)\":\r\n\t\t\t\tcase \"FLOAT\":\r\n\t\t\t\tcase \"DOUBLE\":\r\n\t\t\t\tcase \"DOUBLE PRECISION\":\r\n\t\t\t\tcase \"REAL\":\r\n\t\t\t\t\t$fieldValue = AddSlashes($row[$i]);\r\n\t\t\t\t\tbreak;\r\n\r\n\t\t\t\tdefault:\r\n\t\t\t\t\t$fieldValue = \"'\" . AddSlashes($row[$i]) . \"'\";\r\n\t\t\t}\r\n\t\t\tif ($sRowBuffer != \"\") { $sRowBuffer = \"$sRowBuffer,\"; } \r\n\t\t\t$sRowBuffer = \"$sRowBuffer$fieldValue\"; \r\n\t\t}\r\n\t\t$sSQLBuffer = \"REPLACE INTO $tableName ($columnNames) VALUES ($sRowBuffer);\\n\";\r\n\t \t$sBuffer = \"$sBuffer$sSQLBuffer\";\r\n\t} \r\n\tmysql_free_result($r);\r\n\treturn $sBuffer;\r\n}",
"abstract public function installSQL();",
"abstract public function prepare($params=array());",
"private static function prepare($sql)\n {\n return self::$instancia->con->prepare($sql);\n }",
"public function fetchSqlString();",
"public function Prepare($sql)\n {\n $this->init();\n\n $sqlI = \"Prepare: $sql\";\n if (!isset($this->queries[$sqlI])) {\n $this->queries[$sqlI]['count'] = 1;\n } else {\n $this->queries[$sqlI]['count'] ++;\n }\n $start = $this->microtime_float();\n //execute\n $statement = $this->db->Prepare($sql);\n\n $execution_time = ($this->microtime_float() - $start);\n $this->executeTime += $execution_time;\n $this->numExecutes ++;\n $this->queries[$sqlI]['time'][] = $execution_time;\n\n if ($statement === false) {\n trigger_error('ERROR SQL: Error Running db->Prepare(), query: ' . $sql\n . ' Error Message: ' . $this->db->ErrorMsg());\n return false;\n }\n return $statement;\n }",
"function split_sql_file($sql, $delimiter) {\r\n global $option;\r\n // BEGIN Cambio prefisso della tabella!!!!\r\n $sql=str_replace(\"php_stats\",\"$option[prefix]\",$sql);\r\n // END Cambio prefisso della tabella!!!!\r\n $sql=trim($sql);\r\n $char=\"\";\r\n $last_char=\"\";\r\n $ret=array();\r\n $in_string=true;\r\n for($i=0; $i<strlen($sql); ++$i) {\r\n $char=$sql[$i];\r\n\r\n /* if delimiter found, add the parsed part to the returned array */\r\n if($char == $delimiter && !$in_string) {\r\n $ret[]=substr($sql, 0, $i);\r\n $sql=substr($sql, $i + 1);\r\n $i=0;\r\n $last_char=\"\";\r\n }\r\n\r\n if($last_char == $in_string && $char == \")\") $in_string=false;\r\n if($char == $in_string && $last_char != \"\\\\\") $in_string=false;\r\n elseif(!$in_string && ($char == \"\\\"\" || $char == \"'\") && ($last_char != \"\\\\\")) $in_string=$char;\r\n $last_char=$char;\r\n }\r\n\r\n if(!empty($sql)) $ret[]=$sql;\r\n return($ret);\r\n}",
"function set_table_data($table, $fields, $condition = NULL)\n{\n global $connection;\n $results = $connection->query(\"SET NAMES utf8\");\n\n if (!$results) { print (\"error=\".$connection->get_error().\"<br>\"); return false; }\n if (!$condition) $sql = \"UPDATE $table SET $fields\";\n else $sql = \"UPDATE $table SET $fields WHERE $condition\";\n _dbg($sql);\n //$results = $connection->query($sql);\n if (!$results) {\n print (\"error=\".$connection->get_error().\"<br>\");\n return false;\n }\n //_dbg($results);\n return $results;\n}",
"static public function debugPDO($raw_sql, $parameters) {\n\n $keys = array();\n $values = $parameters;\n\n foreach ($parameters as $key => $value) {\n\n // check if named parameters (':param') or anonymous parameters ('?') are used\n if (is_string($key)) {\n $keys[] = '/' . $key . '/';\n } else {\n $keys[] = '/[?]/';\n }\n\n // bring parameter into human-readable format\n if (is_string($value)) {\n $values[$key] = \"'\" . $value . \"'\";\n } elseif (is_array($value)) {\n $values[$key] = implode(',', $value);\n } elseif (is_null($value)) {\n $values[$key] = 'NULL';\n }\n }\n\n /*\n echo \"<br> [DEBUG] Keys:<pre>\";\n print_r($keys);\n \n echo \"\\n[DEBUG] Values: \";\n print_r($values);\n echo \"</pre>\";\n */\n \n $raw_sql = preg_replace($keys, $values, $raw_sql, 1, $count);\n\n return $raw_sql;\n }",
"function prepare_insert($data = []){\n // if there is no data to set, then return an empty string\n if($data == []){\n return '';\n }\n $set_sql = $this->create_set($data);\n // check again to make sure there were proper columns listed in the SET\n if(strlen($set_sql) == 0){\n return '';\n }\n $return_string = \"INSERT INTO {$this->table_name} $set_sql;\";\n return $return_string;\n }",
"public function initDatabaseStructure( );",
"private function getPrepared()\n {\n $array = $this->ToArray();\n unset($array['currentPage']);\n unset($array['pageCount']);\n unset($array['errors']);\n unset($array['insert']);\n unset($array['table']);\n unset($array['Adapter']);\n unset($array['pdoFetch']);\n unset($array['cmsFetchMode']);\n unset($array[$this->primaryName]);\n unset($array['primaryName']);\n $prepared['update'] = '';\n foreach($array as $k=>$v)\n {\n $prepared['values'][':'.$k] = $v;\n $prepared['update'] .= '`'.$k.'`'.\"=\".':'.$k.',';\n }\n if ($prepared['update']{strlen($prepared['update'])-1} == ',')\n {\n $prepared['update'] = substr($prepared['update'],0,-1);\n }\n $prepared['set'] = implode(', ', array_keys($array));\n return $prepared;\n }",
"function eeps_MySQL_connect($host, $user, $pass, $dbname)\n{\n // reportToFile( \"In eeps_MySQL_connect\");\n try {\n $connectionArgument = \"mysql:host=$host;dbname=$dbname;charset=utf8\";\n\n $DBH = new PDO($connectionArgument, $user, $pass); // the database handle\n $DBH->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\n $DBH->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n } catch (PDOException $e) {\n error_log(\"--- eeps MYSQL connection error \" . $e->getMessage());\n print \"Error connecting to the $dbname database!: \" . $e->getMessage() . \"<br/>\";\n die();\n }\n\n return $DBH;\n}",
"function prepare()\n\t{\n\t\treturn null;\n\t}",
"function prepare()\n\t{\n\t\treturn null;\n\t}",
"function sql_select_db($db,&$dbh=NULL)\n {\n global $MYSQL_HOST, $MYSQL_USER, $MYSQL_PASSWORD, $MYSQL_DATABASE, $MYSQL_CONN, $MYSQL_HANDLER, $SQL_DBH;\n global $CONF;\n//echo '<hr />'.print_r($dbh,true).'<hr />';\n//exit;\n if ( !is_null($dbh) )\n {\n if ($dbh->exec(\"USE $db\") !== false)\n return 1;\n return 0;\n }\n\n try\n {\n $SQL_DBH = NULL;\n list($host,$port) = explode(\":\",$MYSQL_HOST);\n if (isset($port)) {\n $portnum = $port;\n $port = ';port='.trim($port);\n }\n else {\n $port = '';\n $portnum = '';\n }\n //$SQL_DBH = new PDO($MYSQL_HANDLER[1].':host='.trim($host).$port.';dbname='.$db, $MYSQL_USER, $MYSQL_PASSWORD);\n //$SQL_DBH = sql_connect();\n switch ($MYSQL_HANDLER[1]) {\n case 'sybase':\n case 'dblib':\n if (is_numeric($portnum)) $port = ':'.intval($portnum);\n else $port = '';\n $SQL_DBH = new PDO($MYSQL_HANDLER[1].':host='.$host.$port.';dbname='.$db, $MYSQL_USER, $MYSQL_PASSWORD);\n break;\n case 'mssql':\n if (is_numeric($portnum)) $port = ','.intval($portnum);\n else $port = '';\n $SQL_DBH = new PDO($MYSQL_HANDLER[1].':host='.$host.$port.';dbname='.$db, $MYSQL_USER, $MYSQL_PASSWORD);\n break;\n case 'oci':\n if (is_numeric($portnum)) $port = ':'.intval($portnum);\n else $port = '';\n $SQL_DBH = new PDO($MYSQL_HANDLER[1].':dbname=//'.$host.$port.'/'.$db, $MYSQL_USER, $MYSQL_PASSWORD);\n break;\n case 'odbc':\n if (is_numeric($portnum)) $port = ';PORT='.intval($portnum);\n else $port = '';\n $SQL_DBH = new PDO($MYSQL_HANDLER[1].':DRIVER={IBM DB2 ODBC DRIVER};HOSTNAME='.$host.$port.';DATABASE='.$db.';PROTOCOL=TCPIP;UID='.$MYSQL_USER.';PWD='.$MYSQL_PASSWORD);\n break;\n case 'pgsql':\n if (is_numeric($portnum)) $port = ';port='.intval($portnum);\n else $port = '';\n $SQL_DBH = new PDO($MYSQL_HANDLER[1].':host='.$host.$port.';dbname='.$db, $MYSQL_USER, $MYSQL_PASSWORD);\n break;\n case 'sqlite':\n if (is_numeric($portnum)) $port = ':'.intval($portnum);\n else $port = '';\n $SQL_DBH = new PDO($MYSQL_HANDLER[1].':'.$db, $MYSQL_USER, $MYSQL_PASSWORD);\n break;\n case 'sqlite2':\n trigger_error(\"Critical Error : sqlite2 driver is not suported. \", E_USER_ERROR);\n break;\n default:\n //mysql\n $SQL_DBH = new PDO($MYSQL_HANDLER[1].':host='.$host.$port.';dbname='.$db, $MYSQL_USER, $MYSQL_PASSWORD);\n break;\n }\n return 1;\n }\n catch (PDOException $e)\n {\n if ($CONF['debug'])\n $msg = '<p>a3 Error!: ' . $e->getMessage() . '</p>';\n else\n {\n $msg = '<p>a3 Error!: ';\n $pattern = '/(Access denied for user|Unknown database)/i';\n if (preg_match($pattern, $e->getMessage(), $m))\n $msg .= $m[1];\n $msg .= '</p>';\n }\n startUpError($msg, 'Connect Error');\n return 0;\n }\n }",
"public function get_sql()\n {\n }",
"function ParseRAWSQL($InpFile //File to parse raw sql data from\n ,$OutFile\n ) //Return string with parsed and readable SQL Source\n {\n $iCnt = 0;\n $iState = -2;\n\n if (!$fpOutHandle = fopen($OutFile, 'w'))\n {\n echo \"::ParseRAWSQL ERROR: Cannot open output file ($OutFile) for writting.\";\n exit -3;\n }\n\n if(file_exists($InpFile) && is_readable($InpFile))\n {\n if(filesize($InpFile) <= 0)\n exit(\"\\n\\nERROR: ASCII INDEX FILE : {$InpFile} CONTAINS NO DATA (Or is none existent).\\n\\n\\n\");\n \n $iState = -1;\n $bNext=0;\n $s=\"\";\n $handle = fopen($InpFile, \"r\");\n while (!feof($handle))\n {\n $RawBuffer = fgets($handle, 4096);\n //Cut off additional line feed at end of line and do an awk like split\n $buffer = substr($RawBuffer, 0, strlen($RawBuffer)-1);\n $chars = preg_split('/ /', $buffer, -1, PREG_SPLIT_NO_EMPTY);\n\n if(trim(end($chars)) == \"__END_OF__LINE__TAG__\")\n {\n if($bNext == 0)\n {\n $_t = substr($buffer,0,strlen($buffer)-22);\n $s = \"{$s}\\n{$_t}\";\n }\n else\n {\n $_t = substr($buffer,0,strlen($buffer)-22);\n $s = \"{$s}{$_t}\";\n }\n $bNext = 1;\n }\n else\n {\n if($bNext == 0)\n $s = \"{$s}\\n{$buffer}\";\n else\n $s = \"{$s}{$buffer}\";\n\n $bNext = 0;\n }\n\n if(strlen($s)>0) $iState = 1;\n\n fprintf($fpOutHandle, \"%s\",$s);\n $s=\"\";\n }\n \n fprintf($fpOutHandle, \"\\n\"); //This just for readability\n fclose($handle);\n fclose($fpOutHandle);\n }\n \n if($iState <= 0) //No result set, not even an empty one, so we exit\n exit(\"\\n\\n::ParseRAWSQL ERROR: No data found in RAW input file: $InpFile State: {$iState}\\n\\n\\n\");\n }",
"function prepareQuery($content) {\n // Ensure case-insensitive string comparisons\n \n $words = pageWords($content);\n // $words = pageWords(sql_escape(preg_replace(\"/[^a-zA-Z0-9s]/\", \"\", $content)));\n $hash = '';\n foreach ($words as $word) {\n // $hash .= ord(substr($word,0,1)) . ord(substr($word,1,1)) . \" \";\n $hash .= $word; // . \" \"; also uncomment substr line below\n }\n // $hash = substr($hash, 0, strlen($hash) - 1); also uncomment . \" \" above\n \n return $hash;\n }",
"public static function read_SqlParams($param);",
"public function toSql() // {{{\n {\n $out = \"\";\n $out .= \"-- This file was autogenerated by a Script With No Name\\n\";\n $out .= \"-- on \".date(\"Y-m-d\").\". It represents a set of BibTeX entries.\\n\\n\";\n $schema = $this->getParameterSet();\n $out .= \"-- Table schema\\n\";\n $out .= \"CREATE TABLE `\".Bibliography::$db_name.\"` (\\n\";\n $out .= \" `identifier` varchar(128) NOT NULL,\\n\";\n foreach ($schema as $p_name)\n {\n $type = Bibliography::guessType($p_name);\n $out .= \" `$p_name` $type DEFAULT NULL,\\n\";\n }\n $out .= \" PRIMARY KEY (`identifier`)\\n\";\n $out .= \") ENGINE=MyISAM DEFAULT CHARSET=utf8;\\n\\n\";\n $out .= \"-- Entry data\\n\";\n foreach ($this->m_entries as $bibtex_name => $bibtex_entry)\n {\n $first = true;\n $out .= \"INSERT INTO `\".Bibliography::$db_name.\"` SET `identifier` = '\".Bibliography::escapeSql($bibtex_name).\"'\";\n foreach ($bibtex_entry as $k => $v)\n {\n $out .= \", `$k` = '\".Bibliography::escapeSql($v).\"'\";\n }\n $out .= \";\\n\";\n }\n return $out;\n }",
"function getMysqlBegin()\n{\n\tmysql_query(\"BEGIN\");\n}",
"function get_sql_encodings()\n{\n global $config;\n unset($config['mysql_possible_character_sets']);\n if (!isset($config['dbconnection'])) {\n MSD_mysql_connect();\n }\n $erg = false;\n $config['mysql_standard_character_set'] = '';\n $config['mysql_possible_character_sets'] = array();\n\n if (!defined('MSD_MYSQL_VERSION')) {\n GetMySQLVersion();\n }\n $v = explode('.', MSD_MYSQL_VERSION);\n $config['mysql_can_change_encoding'] = false;\n if (($v[0] <= 4 && $v[1] < 1) || $v[0] <= 3) {\n // MySQL < 4.1\n $config['mysql_can_change_encoding'] = false;\n $sqlt = 'SHOW VARIABLES LIKE \\'character_set%\\'';\n $res = MSD_query($sqlt) or die(SQLError(\n $sqlt,\n ((is_object($GLOBALS[\"___mysqli_ston\"]))\n ? mysqli_error($GLOBALS[\"___mysqli_ston\"])\n : (($___mysqli_res\n = mysqli_connect_error()) ? $___mysqli_res : false))\n ));\n if ($res) {\n WHILE ($row = mysqli_fetch_row($res)) {\n if ($row[0] == 'character_set') {\n $config['mysql_standard_character_set'] = $row[1];\n if ($v[0] == 3) {\n $config['mysql_possible_character_sets'][0] = $row[1];\n }\n }\n\n if ($row[0] == 'character_sets' && $v[0] > 3) {\n $config['mysql_possible_character_sets'] = explode(' ', $row[1]);\n sort($config['mysql_possible_character_sets']);\n }\n }\n }\n } else {\n // MySQL-Version >= 4.1\n $config['mysql_can_change_encoding'] = true;\n $sqlt = 'SHOW CHARACTER SET';\n $res = MSD_query($sqlt) or die(SQLError(\n $sqlt,\n ((is_object($GLOBALS[\"___mysqli_ston\"]))\n ? mysqli_error($GLOBALS[\"___mysqli_ston\"])\n : (($___mysqli_res\n = mysqli_connect_error()) ? $___mysqli_res : false))\n ));\n\n if ($res) {\n WHILE ($row = mysqli_fetch_row($res)) {\n $config['mysql_possible_character_sets'][] = $row[0] . ' - ' . $row[1];\n }\n sort($config['mysql_possible_character_sets']);\n }\n\n $sqlt = 'SHOW VARIABLES LIKE \\'character_set_connection\\'';\n $res = MSD_query($sqlt) or die(SQLError(\n $sqlt,\n ((is_object($GLOBALS[\"___mysqli_ston\"]))\n ? mysqli_error($GLOBALS[\"___mysqli_ston\"])\n : (($___mysqli_res\n = mysqli_connect_error()) ? $___mysqli_res : false))\n ));\n\n if ($res) {\n WHILE ($row = mysqli_fetch_row($res)) {\n $config['mysql_standard_character_set'] = $row[1];\n }\n }\n }\n}",
"function yy_r17(){ $this->_retvalue = new SQL\\BeginTransaction; }",
"function query_prepared($query, $param=null)\n { \n $stmt = $this->dbh->prepare($query);\n foreach ($param as $index => $val) {\n // indexing start from 1 in Sqlite3 statement\n if (is_array($val)) {\n $ok = $stmt->bindParam($index + 1, $val);\n } else {\n $ok = $stmt->bindValue($index + 1, $val, $this->getArgType($val));\n }\n \n if (!$ok) {\n $type_error = \"Unable to bind param: $val\";\n $this->register_error($type_error);\n $this->show_errors ? trigger_error($type_error,E_USER_WARNING) : null;\n return false;\n }\n }\n \n return $stmt->execute();\n }",
"function db_init(){\n\t\t$SOURCE = $GLOBALS['SOURCE'];\n\t\ttry {\n\t\t\t$pdo = new PDO('mysql:host=' . \n\t\t\t\t$SOURCE['host'] . ';dbname=' .\n\t\t\t\t$SOURCE['dbname'],\n\t\t\t\t$SOURCE['username'] ,\n\t\t\t\t$SOURCE['password']\n\t\t\t\t);\n\n\n\t\t\t$pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t\t$pdo->exec('SET NAMES \"utf8\"');\n\n\t\t\treturn $pdo;\n\n\t\t} catch (PDOException $e){\n\t\t\tlogging($_SERVER['PHP_SELF'] . \", 138\" . \", \" . $e->getMessage() . \", \" . date(\"Y-m-d\") . \" \" . date(\"h:i:sa\"));\n\t\t\treturn;\n\t\t}\n\t}",
"function sql($sql)\n\t{\n\n\t}",
"function FindTables($strSQL, $bwlStripDatabase=true)\n{\n\t$strSQL=$strSQL . \" \";\n\t$strSQL=deMultiple($strSQL, \" \");\n\t$arrOut=Array();\n\tif(contains(strtolower($strSQL), \"insert into\"))\n\t{\n\t\t$strBeingSought=\"insert into\";\n\t\t$strSelectStatementKeywords=\"(\";\n\t\t$strEndKeywords=\"values (\";\n\t}\n\telse if(contains(strtolower($strSQL), \"create table\"))\n\t{\n\t\treturn Array(); //cop out on this case\n\t}\n\telse if(contains(strtolower($strSQL), \"drop table\"))\n\t{\n\t\treturn Array(); //cop out on this case\n\t}\n\telse if(contains(strtolower($strSQL), \"truncate table\"))\n\t{\n\t\treturn Array(); //cop out on this case\n\t}\n\telse\n\t{\n\t\t$strBeingSought=\"from\";\n\t\t$strSelectStatementKeywords=\"join\";\n\t\t$strEndKeywords=\"where group having order limit procedure into for\";\n\t}\n\t\n\t$strSelectStatementNixFollow=\"on\";\n\t$strSelectStatementNixPre=\"on join\";\n\t\n\t$bwlNixfollow=false;\n\t$out= FindSQLClause($strSQL, $strBeingSought, $strEndKeywords);\n\t//echo $strBeingSought . \" \" . $strEndKeywords . \"<br>\";\n\t//echo $out . \"==initialwhere<br>\";\n\t$out=trim($out);\n\t$tablecount=0;\n\t$intFromFromCounter=0; //counts how many terms are between the from statement and the on, join, or where\n\t//echo $out . \"==initialwhere<br>\";\n\t$out=AllWhiteSpaceToSpace($out);\n\t//echo $out . \"==initialwhere<br>\";\n\tif(contains($out, \"(\") && strpos($out, \"(\")>0)//seems to fix not-working for insert sql\n\t{\n\t\t$arrOut[0]=substr( $out, 0, strpos($out, \"(\"));\n\t}\n\telse if(contains($out, \" \"))\n\t{\n\t\t$out=deMultiple($out, \" \");//might want to leave whitespace in quoted areas alone in a future version\n\t\t$arrTable=explode(\" \", $out);\n\t\t\n\t\tforeach($arrTable as $thispart)\n\t\t{\n\t\t\t//echo $thispart . \"==thispart<br>\";\n\t\t\tif(PosInList($strSelectStatementNixPre, $thispart, \" \", true, $quotechar=\"'\")>-1)\n\t\t\t{ \n\t\t\t\t//echo \"prenix<br>\";\n\t\t\t\t//echo $intFromFromCounter . \"==fromfrom<br>\";\n\t\t\t\tif($intFromFromCounter==2) //in other words, if there is, due to the count of terms since the from, clearly a synonymn after the table name\n\t\t\t\t{\n\t\t\t\t\t//these sql terms mean what preceded was not a table\n\t\t\t\t\t//this code once assumed that join-containing sql will always have a synonym for the table after it \n\t\t\t\t\t//but it no longer has this liability\n\t\t\t\t\t$tablecount--;\n\t\t\t\t\tarray_pop($arrOut);\n\t\t\t\t\t//time to process $intFromFromCounter;\n\t\t\t\t}\n\t\t\t\t$intFromFromCounter=0;\n\t\t\t}\n\t\t\tif(PosInList($strSelectStatementKeywords, $thispart, \" \", true, $quotechar=\"'\")>-1)\n\t\t\t{\n\t\t\t\t$bwlNixfollow=false;\n\t\t\t\t//echo \"nixfollowfalse1<br>\";\n\t\t\t}\n\t\t\telse if(PosInList($strSelectStatementNixFollow, $thispart, \" \", true, $quotechar=\"'\")>-1)\n\t\t\t{\n\t\t\t\t//echo \"nixfollowtrue1<br>\";\n\t\t\t\t$bwlNixfollow=true;\n\t\t\t}\n\t\t\telse if(!$bwlNixfollow)\n\t\t\t{\n\t\t\t\t$intFromFromCounter++;\n\t\t\t\t$bwlNixfollow=false;\n\t\t\t\t$arrOut[$tablecount]=StripDBfromTableSpecIfThere($thispart, $bwlStripDatabase);\n\t\t\t\t$tablecount++;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t//echo \"else<br>\";\n\t\t\t}\n\t\t}\n\t}\n\telse\n\t{\n\t\t$arrOut[$tablecount]=StripDBfromTableSpecIfThere($out, $bwlStripDatabase);\n\t}\n\t//echo join(\"<br>\", $arrOut) . \"==tables<p>\";\n\treturn $arrOut;\n}",
"public function prepare() {}",
"public function prepare() {}"
]
| [
"0.6274762",
"0.6239669",
"0.61631525",
"0.6030143",
"0.5825884",
"0.58188796",
"0.5817093",
"0.5815346",
"0.5755648",
"0.5623095",
"0.5598415",
"0.5581232",
"0.55762535",
"0.5537912",
"0.5527029",
"0.55243385",
"0.55145043",
"0.5503253",
"0.5499013",
"0.54893875",
"0.5489143",
"0.54777634",
"0.5476747",
"0.5466527",
"0.54497933",
"0.54177487",
"0.541065",
"0.5405657",
"0.5396367",
"0.5377827",
"0.53772914",
"0.53751093",
"0.5373177",
"0.53717285",
"0.5356347",
"0.5352934",
"0.53470194",
"0.53267086",
"0.5322593",
"0.5320027",
"0.5320027",
"0.5314529",
"0.53038305",
"0.5275433",
"0.5272271",
"0.5267153",
"0.52627236",
"0.5245302",
"0.5232362",
"0.52321607",
"0.5214855",
"0.52075434",
"0.5197534",
"0.51928043",
"0.51910865",
"0.5182905",
"0.5177307",
"0.5169841",
"0.51546454",
"0.51452756",
"0.5145081",
"0.5142419",
"0.51311177",
"0.51278025",
"0.5121906",
"0.5109526",
"0.51089215",
"0.5105935",
"0.5102856",
"0.5101357",
"0.50935394",
"0.50873524",
"0.5084966",
"0.50814056",
"0.507996",
"0.50690764",
"0.5064874",
"0.5055827",
"0.5055779",
"0.50513303",
"0.50448465",
"0.50436676",
"0.50417036",
"0.50397664",
"0.5029961",
"0.5029961",
"0.5025984",
"0.50220865",
"0.5019302",
"0.5019227",
"0.5004709",
"0.5004463",
"0.50005955",
"0.49971965",
"0.49914247",
"0.4987214",
"0.4986888",
"0.4986147",
"0.4984332",
"0.49804005",
"0.49799687"
]
| 0.0 | -1 |
11 aug 2003: do not enclose with quotes all numerals 4 Oct 2002: short INSERT format (intCnt = [ 0, 1, 2 ... ] 24 May 2002: $isFields include field names to query or not 8 Feb 2005: no quotes for hexadecimal values 22 Feb 2005: DELAYED inserts | function gw_sql_insert($SQLnamesA, $table, $isFields = 1, $intCnt = 0, $is_delayed = 0)
{
$query = '';
$SQLfileds = '';
$SQLfiledA = $SQLvalueA = array();
if (is_array($SQLnamesA))
{
for (reset($SQLnamesA); list($k, $v) = each($SQLnamesA);)
{
$v = gw_text_sql($v);
if ($v == '') {
$vF = "''";
}
elseif ( preg_match("/^[0-9]{3,12}$/", $v) && !preg_match("/^[0-1]/", $v)
|| preg_match("/^0x[0-9a-f]/", $v)) {
// enum('0','1', .. ,'9'), timestamp(14), hex
$vF = $v;
}
else {
$vF = "'" . $v . "'";
}
$SQLfiledA[] = $k;
$SQLvalueA[] = $vF;
}
$SQLvalues = implode(',', $SQLvalueA);
if ($isFields) { $SQLfileds = ' (`' . implode('`, `', $SQLfiledA) . '`)'; }
if (!$intCnt)
{
$query = CRLF.'INSERT '.($is_delayed ? 'DELAYED ': '').'INTO `' . $table .'`'. $SQLfileds . ' VALUES ('.$SQLvalues.')';
}
else
{
$query = ', ('.$SQLvalues.')';
}
}
return $query;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function GenerateSqlInsert($data, $fields)\n{\n $loc = \"database.php->GenerateSqlInsert\";\n // First make an array that is an intersection of the two inputs.\n $final = array();\n foreach($fields as $f)\n {\n $fn = $f[0]; // Field name\n $ft = $f[1]; // Field type\n if(!isset($data[$fn])) continue;\n if(is_null($data[$fn])) continue;\n $v = $data[$fn];\n $final[] = array(\"FieldName\"=>$fn, \"FieldType\"=>$ft, \"Value\"=>$v);\n }\n if(count($final) <= 0) return false;\n\n // First, list the columns...\n $sql = ' (';\n $c = 0;\n foreach($final as $f)\n {\n if($c != 0) $sql .= ', ';\n $sql .= $f[\"FieldName\"];\n $c++;\n }\n $sql .= ') VALUES (';\n $c = 0;\n foreach($final as $f)\n {\n if($c != 0) $sql .= ', ';\n if($f[\"FieldType\"] == 'int') $sql .= intval($f[\"Value\"]);\n else if($f[\"FieldType\"] == 'str') $sql .= '\"' . SqlClean($f[\"Value\"]) . '\"';\n else if($f[\"FieldType\"] == 'bool') $sql .= TFstr($f[\"Value\"]);\n else \n {\n DieWithMsg($loc, \"Bad Sql type: \" . $f[\"FieldType\"] . \n \" for field \" . $f[\"FieldName\"] . '.'); \n }\n $c++;\n }\n $sql .= ') ';\n return $sql;\n}",
"function ParseInsertIntoStatement($strSQL)\n//returns an associative array of info\n//return table name keyed to qpre . \"tablename\"\n{\n\t$strSQL=deMultiple($strSQL, \" \");\n\t$arrOut=Array();\n\t$strLen=strlen($strSQL);\n\t$firstparenloc=strpos($strSQL, \"(\");\n\t$secondparenloc=strpos($strSQL, \")\", $firstparenloc);\n\t$thirdparenloc=strpos($strSQL, \"(\", $secondparenloc);\n\t$fourthparenloc=strpos($strSQL, \")\", $thirdparenloc);\n\t$strRawFieldnames=substr($strSQL, $firstparenloc+1, $secondparenloc-$firstparenloc-1);\n\t$strRawFieldvalues=substr($strSQL, $thirdparenloc+1, $fourthparenloc-(1+$thirdparenloc));\n\t$spacebeforefirstparen=strrpos($strSQL, \" \", -($strLen- $firstparenloc));\n\t//echo $firstparenloc . \"=\" . $spacebeforefirstparen . \"=<br>\";\n\tif($spacebeforefirstparen+1==$firstparenloc)\n\t{\n\t\t$spacebeforefirstparen=strrpos($strSQL, \" \", -($strLen- (1+ $firstparenloc)));\n\t\t\n\t}\n\t$tablename=substr($strSQL, $spacebeforefirstparen+1, ($firstparenloc-$spacebeforefirstparen-1));\n\t//echo $tablename . \"*<br>\";\n\t//echo \"*\" . $thirdparenloc . \" \" .$fourthparenloc . \" \" . $strRawFieldvalues. \"*<br>\";\n\t$strRawFieldnames=str_replace(\" \", \"\", $strRawFieldnames);\n\t$arrFieldNames=ParseStringToArraySkippingQuotedRegions($strRawFieldnames, \"'\\\"\", \",\");\n\t$arrValues=ParseStringToArraySkippingQuotedRegions($strRawFieldvalues, \"'\\\"\", \",\");\n\t$i=0;\n\tforeach($arrFieldNames as $thisfieldname)\n\t{\n\t \tif($thisfieldname!=\"\")\n\t\t{\n\t\t\t$arrOut[$thisfieldname]=trim($arrValues[$i]);\n\t\t\t$i++;\n\t\t}\n\t}\n\t$arrOut[qpre . \"table\"]=$tablename;\n\treturn $arrOut;\n}",
"function insert_stmt(){\n\t\tglobal $in;\n\t\tif ($this->attributes['BYTB']!='' )$this->fields_value_bytb($this->attributes['BYTB']);\n\t\t\n\t\t\n\t\tif ($this->attributes['TB']!='no'){\n\t\t\t$i=0;\n\t\t\tforeach ($this->values as $key => $val){\t\t\t\t\n\t\t\t\t$this->field_stmt[$i]=\"{$key}\";\n\t\t\t\t$this->value_stmt[$i]=\"{$in[$key]}\";\n\t\t\t\t\n\t\t\t\tif($in[$key]==1){\n\t\t\t\t\t$i++;\n\t\t\t\t\t$this->field_stmt[$i]=\"D_{$key}\";\n\t\t\t\t\t#GC 20/04/2015 gestione popolamento decode\n\t\t\t\t\tif (isset($this->attributes['DECODE'][$key])) $this->value_stmt[$i]=\"{$this->attributes['DECODE'][$key]}\";\n\t\t\t\t\telse $this->value_stmt[$i]=$val;\n\t\t\t\t}\n\t\t\t\t#GC 20/04/2015 gestione sbiancamento decode\n\t\t\t\tif($in[$key]==0){\n\t\t\t\t\t$i++;\n\t\t\t\t\t$this->field_stmt[$i]=\"D_{$key}\";\n\t\t\t\t\t$this->value_stmt[$i]=\"\";\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn;\n\t}",
"function getInsert($table,$data)\n\t{\n\n\t\t$fields\t\t\t= array();\n\t\t$values\t\t\t= array();\n\n\t\tforeach ($data as $curdata)\n\t\t{\n\n\t\t\t$fields[]\t= $curdata['field'];\n\n\t\t\tswitch (strtolower($curdata['type']))\n\t\t\t{\n\t\t\t\tcase 'i'\t:\n\t\t\t\t\t$values[]\t= (int)$curdata['value'];\n\t\t\t\t\tbreak;\n\t\t\t\tcase 's'\t:\n\t\t\t\t\t$values[]\t= '\\''.addslashes_mssql($curdata['value']).'\\'';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'd'\t:\n\t\t\t\t\t$values[]\t= 'CONVERT(datetime, \\''.date('Y-m-d H:i:s',(int)$curdata['value']).'\\', 120)';\n\t\t\t\t\tbreak;\n\t\t\t}\n\n\t\t}\n\n\t\treturn 'INSERT INTO '.$table.' ('.implode(', ',$fields).') VALUES ('.implode(', ',$values).')';\n\n\t}",
"private function formatInsertCommand( )\n {\n $data_buffer_length = @ count( $this->data_buffer );\n if ( $data_buffer_length == 0 )\n return false;\n\n $sql = 'INSERT INTO ' . $this->table_name . ' ';\n $sql_columns = '(';\n $sql_values = ' VALUE(';\n $this->quote( );\n $i = 0;\n foreach ( $this->data_buffer as $k => $v )\n {\n $sql_columns .= $k;\n $sql_values .= $v;\n if ( ( $i + 1 ) < $data_buffer_length )\n {\n $sql_columns .= ',';\n $sql_values .= ',';\n }\n $i++;\n }\n $sql_columns .= ')';\n $sql_values .= ')';\n $sql .= $sql_columns . $sql_values;\n return $sql;\n }",
"function generate_sql_batch_insert($table, $arr_field, $arr_row, $ignore='')\n {\n $num_field = count($arr_field);\n $num_row = count($arr_row);\n\n $sql = '';\n $sql .= \"INSERT {$ignore} INTO $table (\";\n for ($i=0; $i< $num_field; $i++)\n {\n $sql.= $arr_field[$i];\n if ($i != $num_field - 1)\n {\n $sql .= ', ';\n }\n }\n\n $sql .= ') VALUES ';\n\n for ($i = 0; $i < $num_row; $i ++)\n {\n $sql .= '(';\n for ($j =0; $j< $num_field; $j++)\n {\n // Lay thong tin cu the cua tung ban ghi de noi mang\n $sql .= \"'{$arr_row[$i][$j]}'\";\n if ($j != $num_field -1)\n {\n $sql .= ', ';\n }\n }\n\n $sql .= ')';\n if ($i != $num_row - 1)\n {\n $sql .= ', ';\n }\n }\n\n return $sql;\n }",
"function getInsertQuery($j_obj,$tblName,$ignore){\n $qi = \"INSERT INTO $tblName (\";\n //reset($j_obj);\n try{\n foreach($j_obj as $j_arr_key => $value){\n if(in_array($j_arr_key,explode(\",\",$ignore))){\n continue;\n }\n $qi .= $j_arr_key . \",\";\n }\n $qi = substr_replace($qi,\"\",-1);\n $qi .= \") VALUES (\";\n reset($j_obj);\n foreach($j_obj as $j_arr_key => $value){\n if(in_array($j_arr_key,explode(\",\",$ignore))){\n continue;\n }\n $qi .= \"'\" . $value . \"',\";\n }\n $qi = substr_replace($qi,\"\",-1);\n $qi .= \")\";\n }catch(Exception $e){\n return \"In Exception\";\n }\n return $qi;\n}",
"public function insert_13fields($tablename, $fieldname, $fieldvalue, $fieldname1, $fieldvalue1, $fieldname2, $fieldvalue2, $fieldname3, $fieldvalue3, $fieldname4, $fieldvalue4, $fieldname5, $fieldvalue5, $fieldname6, $fieldvalue6, $fieldname7, $fieldvalue7, $fieldname8, $fieldvalue8, $fieldname9, $fieldvalue9, $fieldname10, $fieldvalue10, $fieldname11, $fieldvalue11, $fieldname12, $fieldvalue12){\n\n $mysqli = $this->connect();\n\n $sql = \"INSERT INTO {$tablename} SET {$fieldname}=:fieldvalue, {$fieldname1}=:fieldvalue1, {$fieldname2}=:fieldvalue2, {$fieldname3}=:fieldvalue3, {$fieldname4}=:fieldvalue4, {$fieldname5}=:fieldvalue5, {$fieldname6}=:fieldvalue6, {$fieldname7}=:fieldvalue7, {$fieldname8}=:fieldvalue8, {$fieldname9}=:fieldvalue9, {$fieldname10}=:fieldvalue10, {$fieldname11}=:fieldvalue11, {$fieldname12}=:fieldvalue12\";\n\n $stmt = $mysqli->prepare($sql);\n\n if($stmt->execute([':fieldvalue'=>$fieldvalue, ':fieldvalue1'=>$fieldvalue1, ':fieldvalue2'=>$fieldvalue2, ':fieldvalue3'=>$fieldvalue3, ':fieldvalue4'=>$fieldvalue4, ':fieldvalue5'=>$fieldvalue5, ':fieldvalue6'=>$fieldvalue6, ':fieldvalue7'=>$fieldvalue7, ':fieldvalue8'=>$fieldvalue8, ':fieldvalue9'=>$fieldvalue9, ':fieldvalue10'=>$fieldvalue10, ':fieldvalue11'=>$fieldvalue11, ':fieldvalue12'=>$fieldvalue12])){\n \n return \"Insertion Made\";\n //array('action'=>'Success', 'counting'=>1);\n } else {\n return $failed=\"failed: \" . $mysqli->error;\n \n //array('action'=>'Success', 'counting'=>0);\n }\n\n}",
"public function IngestFields($fields,$seg_id,$db_handle)\n {\n $i = 0;\n $statement = \"INSERT INTO HL7_Fields_Received(HFR_SRId,HFR_Position,HFR_Value)\n VALUES \";\n \n foreach($fields as $field)\n {\n if($i!=0)\n $statement .= \",\";\n \n $statement .= \"(\".$seg_id.\",\".$i.\",\\\"\".$db_handle->EscapeStrings($field).\"\\\")\";\n $i++;\n }\n \n echo $statement;\n \n if($db_handle->InsertDB($statement) < 1)\n {\n Throw new Exception(\"INSERT ERROR : \".$statement.\" no record inserted\");\n }\n \n }",
"function insert($spec, $fields) {\n\t\t$values = implode(', ', array_fill(0, count($fields), '?'));\n\t\tforeach($fields as &$field) $field = \"{{$field}}\";\n\t\t$fields = implode(', ', $fields);\n\t\t$sql = \"INSERT INTO {$spec['from']} ({$fields}) VALUES ({$values})\";\n\t\treturn $this->quoteIdentifiers($this->aliasFields($sql, false));\n\t}",
"public function compileInsertString( $data )\n {\n \t$field_names\t= \"\";\n\t\t$field_values\t= \"\";\n\n\t\tforeach( $data as $k => $v )\n\t\t{\n\t\t\t$add_slashes = 1;\n\t\t\t\n\t\t\tif ( $this->manual_addslashes )\n\t\t\t{\n\t\t\t\t$add_slashes = 0;\n\t\t\t}\n\t\t\t\n\t\t\tif ( !empty($this->no_escape_fields[ $k ]) )\n\t\t\t{\n\t\t\t\t$add_slashes = 0;\n\t\t\t}\n\t\t\t\n\t\t\tif ( $add_slashes )\n\t\t\t{\n\t\t\t\t$v = $this->addSlashes( $v );\n\t\t\t}\n\t\t\t\n\t\t\t$field_names .= $this->fieldNameEncapsulate . \"$k\" . $this->fieldNameEncapsulate . ',';\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// Forcing data type?\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\tif ( substr( $v, -1 ) == '\\\\' )\n\t\t\t{\n\t\t\t\t$v = preg_replace( '#\\\\\\{1}$#', '\', $v );\n\t\t\t}\n\t\t\t\t\t\n\t\t\tif ( !empty($this->_dataTypes[ $k ]) )\n\t\t\t{\n\t\t\t\tif ( $this->_dataTypes[ $k ] == 'string' )\n\t\t\t\t{\n\t\t\t\t\t$field_values .= $this->fieldEncapsulate . $v . $this->fieldEncapsulate . ',';\n\t\t\t\t}\n\t\t\t\telse if ( $this->_dataTypes[ $k ] == 'int' )\n\t\t\t\t{\n\t\t\t\t\t$field_values .= intval($v).\",\";\n\t\t\t\t}\n\t\t\t\telse if ( $this->_dataTypes[ $k ] == 'float' )\n\t\t\t\t{\n\t\t\t\t\t$field_values .= floatval($v).\",\";\n\t\t\t\t}\n\t\t\t\tif ( $this->_dataTypes[ $k ] == 'null' )\n\t\t\t\t{\n\t\t\t\t\t$field_values .= \"NULL,\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//-----------------------------------------\n\t\t\t// No? best guess it is then..\n\t\t\t//-----------------------------------------\n\t\t\t\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( is_numeric( $v ) and strcmp( intval($v), $v ) === 0 )\n\t\t\t\t{\n\t\t\t\t\t$field_values .= $v.\",\";\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$field_values .= $this->fieldEncapsulate . $v . $this->fieldEncapsulate . ',';\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$field_names = rtrim( $field_names, \",\" );\n\t\t$field_values = rtrim( $field_values, \",\" );\n\t\n\t\treturn array( 'FIELD_NAMES' => $field_names,\n\t\t\t\t\t 'FIELD_VALUES' => $field_values,\n\t\t\t\t\t);\n\t}",
"function buildInsert($params)\n {\n $fieldList = $this->getFieldList($params['table']);\n $fieldInsert = '';\n $valueInsert = '';\n\n reset($fieldList);\n while(current($fieldList))\n {\n if (in_array(current($fieldList), array_keys($params)))\n {\n $fieldInsert .= \"`\" . current($fieldList) . \"`, \";\n $valueInsert .= \"'\" . $params[current($fieldList)] . \"', \";\n }\n else\n {\n $this->setError(\"\", \"buildInsert #001\");\n return false;\n }\n $fieldInfo = next($fieldList);\n }\n\n $fieldInsert = preg_replace(\"/,\\s*$/\", \"\", $fieldInsert);\n $valueInsert = preg_replace(\"/,\\s*$/\", \"\", $valueInsert);\n\n $result = \"INSERT INTO `\"\n . $params[\"table\"]\n . \"` (\" . $fieldInsert . \") VALUES (\" . $valueInsert . \");\";\n return $result;\n }",
"public function insert(...$field_values);",
"function sql_insert($table, $fields) {\n\t$sql = sql_connect();\n\tif( !$sql ){\n\t\treturn false;\n\t}\n\t$prefix = var_get('sql/prefix', '');\n\n\t$query = 'INSERT INTO ' . sql_quote($prefix . $table, true);\n\t$query .= ' (' . implode(',', array_keys($fields)) . ') VALUES (' . implode(',', array_fill(0, sizeof($fields), '?')) . ');';\n\n\tsql_dump($query);\n\n\t//var_dump($query, array_values($fields));\n\t$q = $sql->prepare($query);\n\treturn $q->execute(array_values($fields));\n}",
"function GenerateSqlSet($data, $fields)\n{\n $sql = ' ';\n $c = 0;\n foreach($fields as $f)\n {\n $fn = $f[0]; // Field name\n $ft = $f[1]; // Field type\n if(!isset($data[$fn])) continue;\n if(is_null($data[$fn])) continue;\n $v = $data[$fn];\n if($c != 0) $sql .= ', ';\n $sql .= $fn . '=';\n if($ft == 'int') { $sql .= intval($v); }\n else if($ft == 'str') { $sql .= '\"' . SqlClean($v) . '\"'; }\n else if($ft == 'bool') { $sql .= TFstr($v); }\n else {DieWithMsg(\"databaselib.php->GenerateSQLSet\", \"Bad type: \" . $ft . \" for field \" . $fn . '.'); }\n $c++;\n }\n if($c == 0) return false;\n return $sql;\n}",
"function yy_r102(){ \n $this->_retvalue = new SQL\\Insert(@$this->yystack[$this->yyidx + -2]->minor);\n $this->_retvalue->into($this->yystack[$this->yyidx + 0]->minor[0])->fields($this->yystack[$this->yyidx + 0]->minor[1]);\n }",
"function genericinsert ($table, $data) {\n $names = '';\n $values = '';\n foreach ($data as $key => $value) {\n if (substr($key,0,1) == '@') {\n $names .= substr($key,1).',';\n $values .= $value.',';\n } else {\n $names .= $key.',';\n $values .= '\"'.mysql_real_escape_string($value).'\",';\n }\n }\n // INSERT INTO table (a,b,c) values (1,2,3)\n $query = 'INSERT INTO `'.mysql_real_escape_string($table).'` '.\n '('.substr($names ,0,strlen($names )-1).') values '.\n '('.substr($values,0,strlen($values)-1).')';\n return $query;\n}",
"function Insert($table, $fields)\n {\n $values = array();\n foreach ($fields as $value)\n {\n if (is_int($value)) $values[]=$value;\n else $values[]=\"'\".$this->EscapeString($value).\"'\";\t\t\n }\n\n $sql = sprintf(\"INSERT INTO %s (%s) VALUES(%s)\",$table, implode(',',array_keys($fields)), implode(',',$values));\n\n if ($this->Query($sql)) return $this->InsertID($table);\n else return false;\n }",
"function _query_insert_parse($query){\n $open_brace_first = strpos($query,\"(\",0)+1;\n $close_brace_first = strpos($query,\")\",0);\n $open_brace_second = strpos($query,\"(\",$open_brace_first)+1;\n $close_brace_second = strpos($query,\")\",$open_brace_second);\n \n $cols = substr($query,$open_brace_first,$close_brace_first-$open_brace_first);\n $cols_val = substr($query, $open_brace_second,$close_brace_second-$open_brace_second);\n \n $cols_arr = explode(\",\",$cols);\n $cols_val_arr = explode(\",\",$cols_val);\n \n $qmap = array();\n $len = count($cols_arr);\n for($i=0;$i<$len;$i++){\n $key = trim($cols_arr[$i]);\n $val = trim($cols_val_arr[$i],\"'\");\n $qmap[\"$key\"] = $val;\n }\n return $qmap;\n }",
"function my_insert_record( $table_name , $datas ){\r\n \r\n\tglobal $connection;\r\n\r\n\t$build_query = \" INSERT INTO `\".$table_name .\"` SET \" ;\r\n\tforeach( $datas as $field => $value ){\r\n\t\r\n\t\t$build_query .= \"`\".$field .\"` = \". $value . \", \";\r\n\t\r\n\t}\r\n\t\r\n\t$insert_query = rtrim( trim($build_query) , \",\" ); \r\n \r\n\tif( my_query( $insert_query ) ){\r\n\t\treturn $connection->insert_id; \r\n\t}\r\n\treturn false;\r\n\r\n}",
"function insert_stmt_prepare($new_insert=false){\r\n\t\tforeach ( $this->fields as $key => $val ) {\r\n\t\t\tif (isset ( $val ['TYPE'] ) && $val ['TYPE'] != '')\r\n\t\t\t$field_type = \"field_{$val['TYPE']}\";\r\n\t\t\telse\r\n\t\t\t$field_type = \"field\";\r\n\r\n\t\t\tif ($this->config_service['field_lib'] != '' && file_exists ( $this->config_service['field_lib'] . $field_type . \".inc\" )) {\r\n\t\t\t\tinclude_once $this->config_service['field_lib'] . $field_type . \".inc\";\r\n\t\t\t} else\r\n\t\t\tinclude_once \"{$field_type}.inc\";\r\n\t\t\t$field_obj = new $field_type ( $this, $key, $this->conn, $this->tb_vals, $this->session_vars, $this->service, $this->errors );\r\n\r\n\t\t\tif ($field_obj->attributes ['PK'] == 'yes')\r\n\t\t\t$pk [$field_obj->attributes ['VAR']] = $in [$field_obj->attributes ['VAR']];\r\n\t\t\tif ($new_insert) {\r\n\t\t\t\t//non deve capitare\r\n\t\t\t\t$field_obj->insert_stmt ( true );\r\n\t\t\t\tforeach ( $field_obj->value_stmt as $key_f => $val_f ) {\r\n\t\t\t\t\tif ($field_obj->value_stmt [$key_f] == \"next\") {\r\n\t\t\t\t\t\tif ($field_obj->id==$this->config_service['PK_SERVICE'] && $this->config_service['PK_SEQ']!='' && !isset($this->session_vars['ajax_call'])){\r\n\t\t\t\t\t\t\t$sql_query=\"select {$this->config_service['PK_SEQ']}.nextval as PK_ID from dual\";\r\n\t\t\t\t\t\t\t$sql=new query($this->conn);\r\n\t\t\t\t\t\t\t$sql->set_sql($sql_query);\r\n\t\t\t\t\t\t\t$sql->exec();//non richiede binding\r\n\t\t\t\t\t\t\t$sql->get_row();\r\n\t\t\t\t\t\t\t$pk_id=$sql->row['PK_ID'];\r\n\t\t\t\t\t\t\t$this->pk_value = $pk_id;\r\n\t\t\t\t\t\t\t$in [$field_obj->attributes ['VAR']] = $pk_id;\r\n\t\t\t\t\t\t\t$this->session_vars[$field_obj->attributes ['VAR']]=$pk_id;\r\n\t\t\t\t\t\t\t$in_s=$in;\r\n\t\t\t\t\t\t\tglobal $in;\r\n\t\t\t\t\t\t\t$in=$in_s;\r\n\t\t\t\t\t\t\t$field_obj->value_stmt [$key_f] = $in [$field_obj->attributes ['VAR']];\r\n\t\t\t\t\t\t\t$field_obj->value_stmt [$key_f]=$pk_id;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telse {\r\n\t\t\t\t\t\t\tif ($field_obj->attributes ['WHERE'] != '')\r\n\t\t\t\t\t\t\t$where = \"where \" . $field_obj->attributes ['WHERE'];\r\n\t\t\t\t\t\t\t//$where = preg_replace ( \"/\\[(.*?)\\]/e\", \"var_glob('\\\\1')\", $where );\r\n\t\t\t\t\t\t\t$where=preg_replace_callback ( \"/\\[(.*?)\\]/\", function($matches){return var_glob($matches[1]);}, $where );\r\n\t\t\t\t\t\t\t$query = \"select max(\" . $field_obj->attributes ['VAR'] . \") as max from \" . $this->form ['TABLE'] . \" $where\";\r\n\t\t\t\t\t\t\t$sql = new query ( $conn );\r\n\t\t\t\t\t\t\t$sql->set_sql ( $query );\r\n\t\t\t\t\t\t\t$sql->exec ();//complessa da gestire con carlo\r\n\t\t\t\t\t\t\t$sql->get_row ();\r\n\t\t\t\t\t\t\t$in [$field_obj->attributes ['VAR']] = $sql->row ['MAX'] + 1;\r\n\t\t\t\t\t\t\t$this->pk_value = $sql->row ['MAX'] + 1;\r\n\t\t\t\t\t\t\t$field_obj->value_stmt [$key_f] = $in [$field_obj->attributes ['VAR']];\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$values [$field_obj->field_stmt [$key_f]] = $field_obj->value_stmt [$key_f];\r\n\t\t\t\t}\r\n\t\t\t} else {\r\n\t\t\t\t$field_obj->insert_stmt ();\r\n\t\t\t\tforeach ( $field_obj->value_stmt as $key_f => $val_f )\r\n\t\t\t\t$values [$field_obj->field_stmt [$key_f]] = $field_obj->value_stmt [$key_f];\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->insert_stmt=$values;\r\n\t\t$this->insert_stmt_pk=$pk;\r\n\r\n\t}",
"function insert ($conn , $table , $fields , $values) {\n\n\t\t$fields = implode(\",\", $fields) ;\n\t\t$values = implode(\"','\", $values) ;\n\n\t\t// insert querry\n\t\t$sql=\"INSERT INTO $table (id, $fields) VALUES ('', '$values')\" ;\n\t\t$result =mysql_query($sql ,$conn ) ;\n\n\n\t\tif (mysql_affected_rows()>0) {\n\t\t\treturn TRUE ;\n\n\t\t}\n\n\t\telse {\n\t\t\tdie(\"Error : \".mysql_error()) ;\n\t\t}\n\t}",
"public function insertEscaped(...$field_values);",
"function DoInsertRecordSQL($table, &$avalues, &$blobfields, &$pageObject)\n{\n\t//\tmake SQL string\n\t$strSQL = \"insert into \".$pageObject->connection->addTableWrappers($table).\" \";\n\t\n\t$strFields = \"(\";\n\t$strValues = \"(\";\n\t$blobs = PrepareBlobs($avalues, $blobfields, $pageObject);\n\t\n\tforeach($avalues as $akey => $value)\n\t{\n\t\t$strFields.= $pageObject->getTableField($akey).\", \";\n\t\t\n\t\tif( in_array($akey, $blobfields) )\t\t\t\n\t\t\t$strValues.= $value.\", \";\n\t\telse\n\t\t{\n\t\t\tif( is_null($pageObject->cipherer) )\n\t\t\t\t$strValues.= add_db_quotes($akey, $value).\", \";\n\t\t\telse \n\t\t\t\t$strValues.= $pageObject->cipherer->AddDBQuotes($akey, $value).\", \";\n\t\t}\n\t}\n\t\n\tif( substr($strFields, -2) == \", \" )\n\t\t$strFields = substr($strFields, 0, strlen($strFields) - 2);\n\t\n\tif( substr($strValues, -2) == \", \" )\n\t\t$strValues = substr($strValues, 0, strlen($strValues) - 2);\n\t\n\t$strSQL.= $strFields.\") values \".$strValues.\")\";\n\t\n\tif( !ExecuteUpdate($pageObject, $strSQL, $blobs) )\n\t\treturn false;\n\t\t\n\t$pageObject->ProcessFiles();\n\n\treturn true;\n}",
"function insert($table,$data){\n\t\t$j=0;\n\t\t$c=count($data);\n\t\tforeach($data as $key=>$value){\n\t\t\t$j++;\n\t\t\tif($c==$j){\n\t\t\t\t$line_1.='`'.$key.'`';\n\t\t\t\t$line_2.=\"'\".rce_remove_quotes(mysql_real_escape_string($value)).\"'\";\n\t\t\t} else {\n\t\t\t\t$line_1.='`'.$key.'`, ';\n\t\t\t\t$line_2.=\"'\".rce_remove_quotes(mysql_real_escape_string($value)).\"', \";\n\t\t\t}\n\t\t}\n\t\t$r=mysql_query(\"\n\t\t\tINSERT INTO `$table`\n\t\t\t(\".$line_1.\") VALUES\n\t\t\t(\".$line_2.\")\n\t\t\");\n\t\treturn $r;\n\t}",
"function db_array_to_insert_sqladd( $arr ) {\n\t$s = '';\n\tif ( DB_TYPE == 'access' )$arr = toutf( $arr );\n\t$keys = array();\n\t$values = array();\n\tforeach ( $arr as $k => $v ) {\n\t\t$k = ( $k );\n\t\t$v = ( $v );\n\t\t$keys[] = '`' . $k . '`';\n is_array( $v ) || is_object( $v ) and $v=tojson($v);\n\t\t$v = ( is_int( $v ) || is_float( $v ) ) ? $v : \"'$v'\";\n\t\t$values[] = $v;\n\t}\n\t$keystr = implode( ',', $keys );\n\t$valstr = implode( ',', $values );\n\t$sqladd = \"($keystr) VALUES ($valstr)\";\n\treturn $sqladd;\n}",
"function is_complex_qinsert($parse_map,$table){\n $q_map = $parse_map;\n\n $valid_tbls = array();\n $valid_tbls = get_cols_table($table);\n\n foreach ($q_map as $tbl_name => $tbl_val) {\n # code..\n if(!in_array($tbl_name,$valid_tbls))\n {\n $is_complex = 1;\n return $is_complex;\n }\n }\n\n // handle special case\n $is_contain = false;\n $str = _query_insert_valid($query);\n if(stripos($str,\"values\")==TRUE)\n $is_contain = true;\n\n\n $is_complex = 0;\n\n // validating map\n $needles = array(\"values\",\"VALUES\",\"INTO\",\"into\",\"INSERT\",\"insert\",\"select\",\"SELECT\",\"union\",\"IN\",\"(\",\")\",\"OR\",\"<\",\">\");\n foreach ($q_map as $col => $value) { \n foreach($needles as $needle){\n $pattern ='#\\b'.$needle.'\\b#';\n if (preg_match($pattern,$value) || preg_match($pattern, $col)) { \n $is_complex=1; break; \n } \n }\n }\n\n if($is_contain)\n $is_complex = 1;\n \n return $is_complex ;\n }",
"function _build_import_insert($sourceFieldId, $sourceValue) {\n $importFields = array('kov_nr', 'vge_nr', 'pers_nr', 'corr_naam', 'ov_datum', \n 'vge_adres', 'type', 'specificatie', 'prijs', 'notaris', 'tax_waarde', 'taxateur', \n 'tax_datum', 'bouwkundige', 'bouw_datum', 'definitief');\n /*\n * sourceFieldId 0, 1, 2 are integer\n */\n if ($sourceFieldId < 3) {\n if (!empty($sourceValue)) {\n $result = $importFields[$sourceFieldId].' = '.$sourceValue;\n }\n return $result;\n }\n /*\n * sourceFieldId 3, 5, 6, 8, 9, 10, 11, 13 and 15 are simple strings\n */\n $stringIds = array(3, 5, 6, 8, 9, 10, 11, 13, 15);\n if (in_array($sourceFieldId, $stringIds)) {\n $escapedValue = CRM_Core_DAO::escapeString($sourceValue);\n $result = $importFields[$sourceFieldId].\" = '\".$escapedValue.\"'\";\n return $result;\n }\n /*\n * sourceFieldId 4, 12 and 14 are dates\n */\n $dateIds = array(4, 12, 14);\n if (in_array($sourceFieldId, $dateIds)) {\n $dateValue = date('d-m-Y', strtotime(_reformat_date($sourceValue)));\n if (empty($dateValue) || $dateValue == '01-01-1970') {\n $result = '';\n } else {\n $result = $importFields[$sourceFieldId].\" = '\".$dateValue.\"'\";\n }\n return $result;\n }\n}",
"protected function _sql_insert ( /* void */ )\n {\n /*\n Start SQL query.\n */\n $sql = 'INSERT INTO ';\n /*\n In which table ?\n */\n $sql .= $this->aTables[0] . ' ';\n /*\n Use fields names ?\n */\n $sql .= (empty($this->aFields)) ? '' : \"\\n(\" . implode(', ', $this->aFields) . ')';\n /*\n Insert values.\n */\n $sql .= \"\\nVALUES (\" . implode(\", \", $this->aValues) . \")\";\n /*\n Return SQL.\n */\n return $sql;\n }",
"function db_copy_data($conn, $table, $where, $fields=\"ID\", $values=\"0\") {\n\t$sql = \"select * from $table where $where\";\n\t$result = db_exec($conn, $sql);\n\t$n = mysql_num_fields($result);\n\t$except_fields = explode(',', $fields);\n\t$set_values = explode(',', $values);\n\t$c = count($except_fields);\n\tfor ($i=0; $i<$n; $i++) {\n\t\t$f = mysql_field_name($result, $i);\n\t\t$except = false;\n\t\tfor ($j=0; $j<$c; $j++) {\n\t\t\tif ($f==trim($except_fields[$j])) {\n\t\t\t\t$except = true;\n\t\t\t\t$field_array[] = $set_values[$j].\" as `\".$f.\"`\";\n\t\t\t}\n\t\t}\n\t\tif (!$except) $field_array[] = \"`\".$f.\"`\";\n\t}\n\tdb_free($result);\n\t$field_list = implode(\",\", $field_array);\n\t$sql = \"insert into $table select $field_list from $table where $where\";\n\tdb_exec($conn, $sql);\n\treturn mysql_insert_id();\n}",
"function mysqli_insert($table, $inserts, $dbc) {\n // $values = array_walk(array_values($inserts), 'escape');\n // TODO: fix escaping issue\n $values = array_values($inserts);\n $keys = array_keys($inserts);\n $sqlString = 'INSERT INTO `'.$table.'` (`'.implode('`,`', $keys).'`) VALUES (\\''.implode('\\',\\'', $values).'\\');';\n error_log(print_r($sqlString, true));\n return mysqli_query($dbc, $sqlString);\n}",
"function dbinsert($table, $fields, $funcs = null) {\r\n\tglobal $msq;\r\n\tlist($keys, $vals) = db_fields_to_keys_vals($fields, $funcs);\r\n\t$q = \"insert into \".$table.\" (\".implode(\", \",$keys).\") \".\r\n\t\t\t\" values (\".implode(\", \",$vals).\"); \";\r\n\tif (dbcommit($q) === false)\r\n\t\treturn false;\r\n\treturn mysqli_insert_id($msq);\r\n}",
"protected function _insert()\n\t{\n\t\t// INSERT INTO 'table'\n\t\t$this->_query = 'INSERT INTO '.$this->_table.' (';\n\n\t\t// * / row1, row2\n\t\t$first = true;\n\t\t$vals = '';\n\t\tforeach($this->_set as $key => $value) {\n\t\t\t$this->_query .= ($first) ? ('') : (', '); \n\t\t\t$vals .= ($first) ? ('') : (', '); \n\t\t\t$first = false;\n\n\t\t\t$this->_query .= $key;\n\t\t\t$vals .= \"'$value'\";\n\t\t} // foreach\n\n\t\t$this->_query .= \") VALUES ($vals);\";\n\n\t\treturn $this->_query;\n\t}",
"function Insert ($vars, $table, $identifier, $special_case)\r{\r\tif ($GLOBALS['feedback']) echo \"Insert($vars,$table,$identifier)\\n\";\r\r\tif (sizeof ($vars) > 0)\r\t{\r\t\t$fields = '';\r\t\t$values = '';\r\t\t$select = '';\r\t\twhile (list ($key, $value) = each ($vars))\r\t\t{\r\t\t\tswitch ($key)\r\t\t\t{\r\t\t\t\tcase 'button': break;\r\t\t\t\tdefault:\r\t\t\t\t\tif (strlen($value))\r\t\t\t\t\t{\r\t\t\t\t\t\tif ($special_case && isset($special_case[$key]))\r\t\t\t\t\t\t\t$value = $special_case[$key]['function'] ($value);\r\r\t\t\t\t\t\tif (strlen ($fields)) $fields .= ', ';\r\t\t\t\t\t\t$fields .= \"`$key`\";\r\t\t\t\t\t\tif (strlen ($values)) $values .= ', ';\r\t\t\t\t\t\t$values .= \"'$value'\";\r\t\t\t\t\t\tif (strlen ($select)) $select .= ' AND ';\r\t\t\t\t\t\t$select .= \"`$key` = '$value'\";\r\t\t\t\t\t}\r\t\t\t\t\tbreak;\r\t\t\t}\r\t\t}\r\r\t\t// this is lame, but it allows us to select the inserted record with significant confidence (how many duplicates can there be with the same timestamp?)\r\t\t$now = DEPCRECATED_Now();\r\r\t\t$fields .= ', `modified`';\r\t\t$values .= \", '$now'\";\r\t\t$select .= \" AND `modified` = '$now'\";\r\r\t\tmysql_select_db ($GLOBALS['db']['db'], $GLOBALS['db']['link']);\r\t\t$query_insert = \"INSERT INTO `$table` ($fields) VALUES ($values)\";\r\t\tmysql_query ($query_insert, $GLOBALS['db']['link']) or exit (mysql_error());\r\r\t\t$query_select = \"SELECT * FROM `$table` WHERE $select\";\r\t\t$new_record = mysql_query ($query_select, $GLOBALS['db']['link']) or exit (mysql_error());\r\t\t$record = mysql_fetch_assoc ($new_record);\r\t\treturn $record[$identifier];\r\t}\r\telse return NULL;\r}",
"function db_get_insert_statement($mysqli, $keys, $values)\n{\n\t$query = '';\n\n\tforeach ($keys as $key) {\n\t\t$query_keys[] = '`' . $key['name'] . '`';\n\t}\n\t$query .= '(' . implode(',', $query_keys) . ')';\n\n\t$value_array = array();\n\tforeach ($values as $value) {\n\t\t$value_items = array();\n\t\tforeach ($keys as $key) {\n\t\t\tif (array_key_exists($key['name'], $value)) {\n\t\t\t\t$value_items[] = __db_escape_values($mysqli, $key['type'], $value[$key['name']]);\n\t\t\t} else {\n\t\t\t\t$value_items[] = 'DEFAULT';\n\t\t\t}\n\t\t}\n\t\t$value_array[] = '(' . implode(',', $value_items) . ')';\n\t}\n\t$query .= ' VALUES ' . implode(',', $value_array);\n\n\treturn $query;\n}",
"function getInsertSql()\n {\n $str1 = '';\n $str2 = '';\n $n = 0;\n foreach (array_keys(get_class_vars(get_class($this))) as $k) {\n if (!in_array($k, $this->tblIndex) && $k != 'tblName' && $k != 'schema' && $k != 'tblIndex' && $k != 'exists' && isset($this->$k)) {\n if ($n++ > 0) {\n $str1 .= ',';\n $str2 .= ',';\n }\n\n\n $str1 .= $k . \" \";\n $str2 .= $this->prepareForQuery($this->$k) . \" \";\n\n\n }\n }\n $str = 'INSERT INTO ';\n if (isset($this->schema))\n $str = $str . $this->schema . \".\";\n $str = $str . $this->tblName . ' ( ';\n $str .= $str1;\n $str .= ') VALUES (';\n $str .= $str2;\n $str .= ');';\n return $str;\n }",
"private function _multiInsert($sql)\r\n {\r\n $sql = preg_replace('/\\)\\s*,\\s*\\(/i', ' union all select ', $sql);\r\n $sql = preg_replace('/values\\s*\\(/i', ' select ', $sql);\r\n $sql = preg_replace('/\\)\\s*$/i', '', $sql);\r\n\r\n return $sql;\r\n }",
"function generateInsertQuery($tableName,$columns,$values)\n{\n $i = 0;\n $columnString = \"\";\n $valueString = \"\";\n\n for($i = 0; $i < count($columns); $i++)\n {\n\tif($i > 0)\n\t{\n\t $columnString = $columnString . \",\" . $columns[$i];\n\t \n\t $len = strlen($values[$i]);\n\t if( $len <= 1 || $values[$i][0] != \"'\" || $values[$i][$len-1] != \"'\" )\n\t\t$valueString = $valueString . \",'\" . $values[$i] . \"'\";\n\t else\n\t\t$valueString = $valueString . \",\" . $values[$i];\n\t}\n\telse\n\t{\n\t $columnString = $columns[0];\n\n\t $len = strlen($values[0]);\n\t if( $len <= 1 || $values[0][0] != \"'\" || $values[0][$len-1] != \"'\" )\n\t\t$valueString = \"'\" . $values[0] . \"'\";\n\t else\n\t\t$valueString = $values[0];\n\t}\n }\n \n //INSERT INTO table_name (column1, column2, column3,...)\n //VALUES (value1, value2, value3,...) \n return \"INSERT INTO $tableName ($columnString) VALUES ($valueString)\";\n}",
"function allinea_db(){\n\t\tif ($this->attributes['BYTB']!='' ) $this->fields_value_bytb($this->attributes['BYTB']);\n\t\tif ($this->attributes['TB']!='no'){\n\t\t\t$i=0;\n\t\t\tforeach ($this->values as $key => $val){\n\t\t\t\t$ret[$i]=\"{$key} NUMBER\";\n\t\t\t\t$i++;\n\t\t\t\t$ret[$i]=\"D_{$key} VARCHAR2(200 CHAR)\";\n\t\t\t\t$i++;\n\t\t\t}\n\t\t\treturn $ret;\n\t\t}\n\t\telse return ;\n\t}",
"public function insert_record($table, $fields) {\n /* step 2 */\n $sql = \"\";\n $sql .= \"INSERT INTO \".$table;\n /*implod have two parametre glue = \",\" and pieces=array_keys($fields) implode (glue, pieces) */\n $sql .= \" (\".implode(\",\", array_keys($fields)).\") VALUES \";\n $sql .= \"('\".implode(\"','\", array_values($fields)).\"')\";\n //echo $sql;\n /*step 3*/\n $query = mysqli_query($this->con, $sql);\n if($query){\n return true;\n }\n\n }",
"public function insert($conn, $data){\n\t\t$sql_fields=\"\";\n\t\t$sql_vals=\"\";\n\t\t$id_included=false;\n\t\t\n\t\tforeach($data as $field => $val){\n\t\t\tif (!array_key_exists($field, $this->fields)){\n\t\t\t\tthrow new Exception(\"Field \" . $field . \" does not exists\");\n\t\t\t}\n\t\t\t\n\t\t\t$field_info=$this->fields[$field];\n\t\t\tif (!$id_included && $field_info[\"id\"]){\n\t\t\t\t$id_included=true;\n\t\t\t}\n\t\t\t\n\t\t\tif ($sql_fields!=\"\"){\n\t\t\t\t$sql_fields = $sql_fields . \", \";\n\t\t\t}\n\t\t\t$sql_fields = $sql_fields . \"`\" . $field . \"`\";\n\t\t\t\n\t\t\tif ($sql_vals!=\"\"){\n\t\t\t\t$sql_vals = $sql_vals . \", \";\n\t\t\t}\n\t\t\t\n\t\t\t$sql_vals = $sql_vals . $this->quote($conn, $val, $field_info[\"type\"]);\n\t\t}\n\t\t\n\t\t$sql=\"INSERT INTO `\" . $this->table_name . \"` (\" . $sql_fields . \") VALUES (\" . $sql_vals . \")\";\n\t\t\n\t\t$res=$conn->exec($sql);\n\t\tif ($res===FALSE){ \n\t\t\treturn $res;\n\t\t}\n\t\tif (!$id_included && $this->id!=\"\"){\n\t\t\tif ($this->fields[$this->id][\"auto\"]){\n\t\t\t\treturn $conn->lastInsertId();\n\t\t\t}\n\t\t}\n\t\treturn TRUE;\n\t}",
"function insertData($table, $fields)\n {\n $setval = \"\";\n foreach ($fields as $key => $value) {\n $setval .= \"?,\";\n }\n $setval = substr($setval, 0, -1);\n $sql = \"insert into $table (\" . implode(\",\", array_keys($fields)) . \") values ($setval)\";\n $result = $this->conn->prepare($sql);\n $result->execute(array_values($fields));\n if ($result) {\n return true;\n } else {\n return false;\n }\n $this->conn = null;\n }",
"function build_insert($table,$arr) {\n\t$keys = array_keys($arr);\n\tfor($a=0;$a<count($keys);$a++) {\n\t\t$values[] = str_replace(\"'\",\"''\",$arr[$keys[$a]]);\n\t}\n\n\t$str = \"INSERT INTO `\".$table.\"` (`\".implode('`,`',$keys).\"`) VALUES ('\".implode(\"','\",$values).\"')\";\n\n\treturn $str;\n}",
"function serendipity_parse_sql_inserts($filename) {\n $queries = array();\n\n $fp = fopen($filename, 'r', 1);\n if ($fp) {\n while (!@feof($fp)) {\n $line = trim(fgets($fp, 65536));\n if (preg_match('#^insert\\s*into.*;$#i', $line)) {\n array_push($queries, $line);\n }\n }\n }\n fclose($fp);\n\n return $queries;\n}",
"function _insert ($table_name, $data_array) {\n\t\t$statement = 'INSERT INTO ';\n\t\t$statement .= \"`{$table_name}` (\";\n\t\t$sub_stmt_1 = '';\n\t\t$sub_stmt_2 = '';\n\t\t$p_pointer = 0;\n\t\t$p_count = count($data_array);\n\t\t$first_column_name = '';\n\t\tforeach ($data_array as $column_name => $value) {\n\t\t\tif ($p_pointer == 0) {\n\t\t\t\t$first_column_name = $column_name;\n\t\t\t}\n\t\t\tif ($p_pointer == $p_count - 1) {\n\t\t\t\t$sub_stmt_1 .= '`' . $column_name . '`';\n\t\t\t} else {\n\t\t\t\t$sub_stmt_1 .= '`' . $column_name . '`, ';\n\t\t\t}\n\t\t\t$p_pointer ++;\n\t\t}\n\t\t$p_pointer = 0;\n\t\t$statement .= $sub_stmt_1;\n\t\t$statement .= ') VALUES ';\n\t\tif (is_array($data_array[$first_column_name])) {\n\t\t\t$s_count = count($data_array[$first_column_name]);\n\t\t\tfor ($s_pointer = 0; $s_pointer < $s_count; $s_pointer++) {\n\t\t\t\t$sub_stmt_2 .= '(';\n\t\t\t\t$p_pointer = 0;\n\t\t\t\tforeach ($data_array as $column_name => $value) {\n\t\t\t\t\tif ($p_pointer == $p_count - 1) {\n\t\t\t\t\t\t$sub_stmt_2 .= $this->escape($data_array[$column_name][$s_pointer]);\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$sub_stmt_2 .= $this->escape($data_array[$column_name][$s_pointer]) . ', ';\n\t\t\t\t\t}\n\t\t\t\t\t$p_pointer ++;\t\t\t\n\t\t\t\t}\n\t\t\t\t$sub_stmt_2 .= ')';\n\t\t\t\tif ($s_pointer != $s_count - 1) {\n\t\t\t\t\t$sub_stmt_2 .= ', ';\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$sub_stmt_2 .= '(';\n\t\t\tforeach ($data_array as $column_name => $value) {\n\t\t\t\tif ($p_pointer == $p_count - 1) {\n\t\t\t\t\t$sub_stmt_2 .= $this->escape($data_array[$column_name]);\n\t\t\t\t} else {\n\t\t\t\t\t$sub_stmt_2 .= $this->escape($data_array[$column_name]) . ', ';\n\t\t\t\t}\n\t\t\t\t$p_pointer ++;\n\t\t\t}\n\t\t\t$sub_stmt_2 .= ')';\n\t\t}\n\t\t$statement .= $sub_stmt_2;\n\t\treturn $statement;\n\t}",
"public function _parse_fields_create($fields){\n $str='';\n $auto_exists=NULL;//标示自增字段是否已存在\n foreach ($fields as $field){\n if (isset ($field['name']) && is_string($field['name'])){\n $str.=$field['name'];\n if(isset ($field['auto_increment'])){\n if(!$auto_exists){\n $str.=':auto_increment';\n $auto_exists=TRUE;\n }\n }\n $str.=\"\\n\";\n }\n }\n return $str;\n }",
"private static function genInsertRecordQuery($init_params) {\n $fully_qualified_table_name = static::getFullyQualifiedTableName();\n $database_name = \n $query = \"INSERT INTO {$fully_qualified_table_name} (\";\n\t\t$values_string = \") VALUES (\";\n\t\tforeach ($init_params as $name => $value) {\n $query .= $name . \", \";\n\n // Accumulate value specification string with PDO param bindings \n $transformed_key_name = self::transformForPreparedStatement($name);\n $values_string .= \"$transformed_key_name, \"; \n\t\t}\n \n // Trim redundant commas from strings\n\t\t$query = substr($query, 0, strlen($query) - 2);\n\t\t$values_string = substr($values_string, 0, strlen($values_string) - 2);\n \n // Assemble full query\n return $query . $values_string . \")\";\n\t}",
"function company_insert($table, $data) {\n\n global $devel, $tablas, $I;\n\n if (!$data) {\n print_r(get_defined_vars());\n throw new Exception(\"ERROR: No existen parámetros para INSERT en $table\");\n }\n\n $VALUES = values($data);\n $FIELDS = fields($data);\n\n $query = \"INSERT INTO `$table` ($FIELDS) VALUES ($VALUES)\";\n sql($query, $table, 'INSERT');\n $I++;\n}",
"static function sql_to_insert($table, $idname, $data)\n {\n $sql = \"INSERT INTO `$table` \";\n if (is_array($data)){\n $fields = \"`$idname`\";\n $values = \"NULL\";\n foreach ($data as $key=>$value)\n {\n $fields .= \", `\" . $key . \"`\";\n if (is_numeric($value)){\n $values .= \", \" . $value . \"\";\n } elseif (strpos($value, \"'\") !== false){//Tim thay '\n $values .= \", \\\"\" . $value . \"\\\"\";\n } else {\n $values .= \", '\" . $value . \"'\";\n }\n }\n $sql .= \"($fields) VALUES ($values)\";\n } else {\n $sql .= \" SET \" . $data;\n }\n return $sql;\n }",
"function saveRecord($arrFields = array(), $tablename = '', $enablePrepData = false) {\n\t\t\tif(isset($enablePrepData) && $enablePrepData) {\n\t\t\t\t$arrFields = mysqlPrepValues($arrFields);\n\t\t\t}\n\t\t\t\n\t\t\t$total_fields = count($arrFields);\n\t\t\t$count = 0;\n\t\t\t$field_list = \"\"; $field_values = \"\";\n\t\t\tforeach($arrFields as $key => $item) {\n\t\t\t\t$field_list .= '`' . $key . '`';\n\t\t\t\t$field_values .= '\"' . $item . '\"';\n\t\t\t\t$count++;\n\t\t\t\tif ($count != $total_fields) {\n\t\t\t\t\t$field_list .= ', ';\n\t\t\t\t\t$field_values .= ', ';\n\t\t\t\t}\n\t\t\t}\n\t\t\t$sql = 'INSERT INTO ' . $tablename . '(' . $field_list . ') VALUES (' . $field_values . ')';\n\t\t\t//echo $sql;exit;\n\t\t\tif ($this->db->query($sql)) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}",
"public function insertRecord ($sqlString);",
"private function __insert($insert_method, $fields, $intotable, $fromfields = \"*\", $fromtable = '', $where = '', $limit = '') {\n if (!$intotable) {\n return false;\n } else {\n $sql = '';\n if (!is_array($fields))\n $flds = $fields;\n else {\n $keys = array_keys($fields);\n $values = array_values($fields);\n $flds = '('.implode(',', $keys).') '.(!$fromtable ? ($values ? 'VALUES(\\''.implode('\\',\\'', $values).'\\')' : 'VALUES()') : '');\n }\n \n if ($fromtable) {\n if (is_array($fromfields)) $fromfields = implode(',', $fromfields);\n $where = ($where != '') ? \"WHERE $where\" : '';\n $limit = ($limit != '') ? \"LIMIT $limit\" : '';\n $sql = \"SELECT $fromfields FROM $fromtable $where $limit\";\n }\n\n $rt = $this->query(\"$insert_method $intotable $flds $sql\");\n $lid = $this->_getInsertId();\n return $lid ? $lid : $rt;\n }\n }",
"function insert($tbl, $dataArray)\n\t{\n\t\tforeach($dataArray as $k=>$v){\n\t\t\t$keys .= \"$k, \";\n\t\t\t$values .= \"'\".$this->real_escape_string($v).\"', \";\n\t\t}\n\t\t$keys = substr ($keys, 0, strlen($keys) - 2);\n\t\t$values = substr ($values, 0, strlen($values) - 2);\n\t\t$sql = \"INSERT INTO {$tbl}($keys) VALUES({$values})\";\n\t\t$exeq = $this->query($sql);\n\t\treturn $exeq;\n\t}",
"function _insertQuery(&$obj)\r\n {\r\n foreach ($obj->cleanVars as $k => $v) {\r\n ${$k} = $v;\r\n }\r\n\r\n $sql = sprintf(\"INSERT INTO %s (uid, roleid, deptid) VALUES (%u, %u, %u)\",\r\n $this->_db->prefix($this->_dbtable), $uid, $roleid, $deptid);\r\n\r\n return $sql;\r\n\r\n }",
"public function insert() {\r\n\r\n\t\ttry {\r\n\t\t\tglobal $ks_db;\r\n\t\t\tglobal $ks_log;\r\n\r\n\t\t\t$ks_db->beginTransaction ();\r\n\r\n\t\t\t$arrBindings = array ();\r\n\t\t\t$insertCols = '';\r\n\t\t\t$insertVals = '';\r\n\t\t\t\t\r\n\t\t\tif (isset ( $this->title )) {\r\n\t\t\t\t$insertCols .= \"dsh_title, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->title;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->desc )) {\r\n\t\t\t\t$insertCols .= \"dsh_desc, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->desc;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->portlet )) {\r\n\t\t\t\t$insertCols .= \"dsh_portlet, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->portlet;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->hide )) {\r\n\t\t\t\t$insertCols .= \"dsh_hide, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->hide;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->createdBy )) {\r\n\t\t\t\t$insertCols .= \"dsh_created_by, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->createdBy;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->modifiedBy )) {\r\n\t\t\t\t$insertCols .= \"dsh_modified_by, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->modifiedBy;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->createdDate )) {\r\n\t\t\t\t$insertCols .= \"dsh_created_date, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->createdDate;\r\n\t\t\t}\r\n\t\t\tif (isset ( $this->modifiedDate )) {\r\n\t\t\t\t$insertCols .= \"dsh_modified_date, \";\r\n\t\t\t\t$insertVals .= \"?, \";\r\n\t\t\t\t$arrBindings[] = $this->modifiedDate;\r\n\t\t\t}\r\n\r\n\t\t\t//remove trailing commas\r\n\t\t\t$insertCols = preg_replace(\"/, $/\", \"\", $insertCols);\r\n\t\t\t$insertVals = preg_replace(\"/, $/\", \"\", $insertVals);\r\n\r\n\t\t\t$sql = \"INSERT INTO $this->sqlTable ($insertCols)\";\r\n\t\t\t$sql .= \" VALUES ($insertVals)\";\r\n\r\n\t\t\t$ks_db->query ( $sql, $arrBindings );\r\n\r\n\t\t\t//set the auto-increment property, only if the primary column is auto-increment\r\n\t\t\t$this->id = $ks_db->lastInsertId();\r\n\r\n\t\t\t$ks_db->commit ();\r\n\r\n\t\t} catch(Exception $e) {\r\n\t\t\t$ks_db->rollBack ();\r\n\t\t\t$ks_log->info ( 'Fatal Error: ' . __METHOD__ . '. ' . $e->getMessage () );\r\n\t\t\t$ks_log->info ( '<br>SQL Statement: ' . $sql);\r\n\t\t\techo \"Fatal Error: \" . __METHOD__ . '. ' . $e->getMessage ();\r\n\t\t\techo \"SQL Statement: \" . $sql;\r\n\t\t}\r\n\t}",
"function generateInsertSQL(&$Screen, $logTable, $format = 'var')\n {\n //some sanity checking for the format parameter\n switch($format){\n case 'var':\n case 'replace':\n break;\n default:\n die(\"ERROR: Parameter \\$format in function generateInsertSQL expects either 'var' or 'replace'.\\n\");\n }\n\n //array of fields in the SELECT statement (just to be able to use 'implode')\n $InsertFields = array();\n\n if ($logTable){\n $tableName = $this->ModuleID.\"_l\";\n\n $PKFieldName = end($this->PKFields);\n if('var' == $format){\n $InsertFields[$PKFieldName] = \"\\\"'\\\".\\$recordID.\\\"'\\\"\";\n } else {\n $InsertFields[$PKFieldName] = '/**RecordID**/';\n }\n\n } else {\n $tableName = $this->ModuleID;\n //inserts should include the PK field if it's not auto_increment\n foreach($this->PKFields as $PKFieldName){\n if(false === strpos($this->ModuleFields[$PKFieldName]->dbFlags, 'auto_increment')){\n if('var' == $format){\n $InsertFields[$PKFieldName] = \"\\\"'\\\".\\$recordID.\\\"'\\\"\";\n } else {\n $InsertFields[$PKFieldName] = '/**RecordID**/';\n }\n }\n }\n }\n\n \n if (in_array(strtolower(get_class($Screen)), array('editgrid', 'uploadgrid'))){\n //add grid specific fields \n if(!empty($Screen->localKey)){\n $InsertFields[$Screen->localKey] = '/**PR-ID**/';\n }\n \n if($Screen->listExtended){\n $extendingModule = GetModule($Screen->moduleID);\n $InsertFields[$extendingModule->extendsModuleKey] = '/**extendID**/';\n }\n\n if(count($Screen->conditions) > 0){\n $conditions = $Screen->conditions;\n } else {\n $conditions = $this->conditions;\n }\n\n if(count($conditions) > 0){\n foreach($conditions as $condField => $condValue){\n if(!in_array($condField, $InsertFields)){\n $InsertFields[$condField] = \"'{$condValue}'\";\n }\n }\n }\n \n \n //pick the right set of editable fields\n if($Screen->hasGridForm){\n $t_fields = $Screen->FormFields;\n } else {\n $t_fields = $Screen->Fields;\n }\n } else {\n if(is_array($Screen)){\n $t_fields = $Screen;\n } else {\n $t_fields = $Screen->Fields;\n }\n }\n//print_r($t_fields);\n //handle sub-fields - we \"flatten\" the subfield hierarchy\n $saveFields = array();\n foreach($t_fields as $sfName => $sf){\n //print \"screen field name $sfName\\n\";\n $saveFields = array_merge($saveFields, $sf->getRecursiveFields());\n }\n\n foreach($saveFields as $sfName => $sf){\n\n //only insert editable fields (no ViewFields etc)\n if ($sf->isEditable()){\n\n //look up corresponding ModuleField based on screen field name\n $mf = $this->ModuleFields[$sfName];\n\n switch (strtolower(get_class($mf))){\n case 'tablefield':\n $insert = false;\n //exclude any auto_increment field\n if ($logTable){\n if (\"_RecordID\" != $sfName){\n $insert = true;\n }\n } else {\n if (false === strpos($mf->dbFlags, \"auto_increment\")){\n $insert = true;\n }\n }\n if ($insert){\n if('var' == $format){\n $InsertFields[$sfName] = \"dbQuote(\\$data['{$sfName}'], '{$mf->dataType}')\";\n \n } elseif('replace' == $format){\n //using replace-style formatting, the dbQuote,\n //ChkFormat and and DateToISO must be called\n //outside this function.\n $InsertFields[$sfName] = \"'[*$sfName*]'\"; //this is a tag to be replaced before the prepared SQL is executed\n }\n }\n break;\n case 'remotefield';\n //this should save to the remote table - must generate separate SQL statement\n //(ignore RemoteFields here)\n\n break;\n case 'foreignfield':\n case 'codefield':\n case 'dynamicforeignfield':\n case 'calculatedfield':\n //die(\"Cannot use a foreign field in INSERT statement ($sfName)\\n\");\n print \"AA warning: (Screen {$Screen->name}, Field $sfName, Table $tableName)\\n\";\n print \" Non-saving field type used in form - INSERT statement will not save data for this field. \\n\";\n print \" This may be OK if this field is used for combo box filtering only.\\n\";\n break;\n\n default:\n print \"m. field type for INSERT statement: '\".get_class($mf).\"'\\n\";\n die(\"m. Unknown field type in INSERT statement (Screen {$Screen->name}, Field $sfName, Table $tableName)\\n\");\n break;\n }\n }\n }\n\n //add log data:\n if('var' == $format){\n $InsertFields['_ModDate'] = '\"NOW()\"';\n $InsertFields['_ModBy'] = '$User->PersonID';\n } elseif('replace' == $format){\n $InsertFields['_ModDate'] = 'NOW()';\n $InsertFields['_ModBy'] = '[**UserID**]';\n }\n//print \"generateInsertSQL {$this->ModuleID} InsertFields: \\n\";\n//print_r($InsertFields);\n\n if (count($InsertFields) > 0){\n //format SQL Statement\n if('var' == $format){\n $SQL = \"INSERT INTO `$tableName` (\\n \";\n $SQL .= implode(\",\\n \", array_keys($InsertFields));\n $SQL .= \"\\n) VALUES (\\n \\\".\";\n $SQL .= implode(\".\\\",\\n \\\".\", $InsertFields);\n $SQL .= \".\\\")\"; //NO ENDING NEWLINE - that will cause error messages...\n } elseif('replace' == $format){\n $SQL = \"INSERT INTO `$tableName` (\\n \";\n $SQL .= implode(\",\\n \", array_keys($InsertFields));\n $SQL .= \"\\n) VALUES (\\n \";\n $SQL .= implode(\",\\n \", $InsertFields);\n $SQL .= \")\"; //NO ENDING NEWLINE - that will cause error messages...\n }\n } else {\n $SQL = \"\";\n }\n return $SQL;\n }",
"function insertData($array, $table,$db_conn)\n{\n\n try {\n\n $fields = array_keys($array);\n $values = array_values($array);\n $fieldlist = implode(',', $fields);\n $qs = str_repeat(\"?,\", count($fields) - 1);\n $firstfield = true;\n\n $sql = \"INSERT INTO `$table` SET\";\n\n for ($i = 0; $i < count($fields); $i++) {\n if (!$firstfield) {\n $sql .= \", \";\n }\n $sql .= \" \" . $fields[$i] . \"=?\";\n $firstfield = false;\n }\n\n $sth = $db_conn->prepare($sql);\n return $sth->execute($values);\n\n return $sth;\n } catch (PDOException $e) {\n echo $e->getMessage();\n }\n}",
"public function buildInsert()\n {\n $columns = array();\n $values = array();\n\n /* build sql arguments */\n\n if ( $this->driver->placeholder ) {\n foreach( $this->insert as $k => $v ) {\n if ( is_integer($k) )\n $k = $v;\n\n if ( is_array($v) ) {\n // just interpolate the raw value\n $columns[] = $this->driver->getQuoteColumn($k);\n $values[] = $v[0];\n } else {\n $columns[] = $this->driver->getQuoteColumn($k);\n $newK = $this->setPlaceHolderVar( $k , $v );\n $values[] = $this->driver->getPlaceHolder($newK);\n }\n }\n\n } else {\n foreach( $this->insert as $k => $v ) {\n if ( is_integer($k) ) {\n $k = $v;\n }\n $columns[] = $this->driver->getQuoteColumn( $k );\n $values[] = $this->driver->inflate($v);\n }\n }\n\n $sql = 'INSERT INTO ' . $this->getTableSql() \n . ' ( '\n . join(',',$columns) \n . ') VALUES (' \n . join(',', $values ) \n . ')';\n ;\n\n if ( $this->returning && ( 'pgsql' == $this->driver->type ) ) {\n $sql .= ' RETURNING ' . $this->driver->getQuoteColumn($this->returning);\n }\n\n if ( $this->driver->trim ) {\n return trim($sql);\n }\n return $sql;\n }",
"function prepare_insert($data = []){\n // if there is no data to set, then return an empty string\n if($data == []){\n return '';\n }\n $set_sql = $this->create_set($data);\n // check again to make sure there were proper columns listed in the SET\n if(strlen($set_sql) == 0){\n return '';\n }\n $return_string = \"INSERT INTO {$this->table_name} $set_sql;\";\n return $return_string;\n }",
"function InsertDTR($sheetRow)\n{\n global $con;\n $inputs=array();\n $start_column=\"A\";\n for ($i=0; $i <= 7; $i++) {\n if (empty($sheetRow[$start_column])) {\n $inputs[$i]=\"\";\n } else {\n $inputs[$i]=$sheetRow[$start_column];\n }\n $start_column++;\n }\n $if_exists=$con->myQuery(\n \"SELECT COUNT(id) FROM acu_records WHERE ac_no=? AND action_time=? AND state=?\",\n array(\n $sheetRow[\"A\"],\n $sheetRow[\"D\"],\n $sheetRow[\"E\"]\n )\n )->fetchColumn();\n\n if (empty($if_exists)) {\n $con->myQuery(\"INSERT INTO acu_records(ac_no,acu_id,name,action_time,state,new_state,exception,operation) VALUES(?,?,?,?,?,?,?,?)\", $inputs);\n }\n}",
"function insert ()\n\t\t{\n\t\t\t(string) $dbQuery = \"\";\n\t\t\t\n\t\t\t$dbQuery = \"INSERT INTO $this->criterio_table \";\n\t\t \t$dbQuery .= \"(\";\n\t\t \t\n\t\t\t$dbQuery .= $this->nombre_field.\",\";\n\t\t\t$dbQuery .= $this->descripcion_field.\",\";\n\t\t\t$dbQuery .= $this->puntajeMaximo_field.\",\";\n\t\t\t\n\t\t\t$dbQuery = preg_replace('/,$/', ' ', $dbQuery);\n\t\t\t$dbQuery .= \") \";\n\t\t\t$dbQuery .= \" VALUES (\";\n\t\t \t\n\t\t\t$dbQuery .= \" '$this->nombre',\";\n\t\t\t$dbQuery .= \" '$this->descripcion',\";\n\t\t\t$dbQuery .= \" $this->puntajeMaximo ,\";\n\t\t\t\n\t\t \t\n\t\t \t$dbQuery = preg_replace('/,$/', ' ', $dbQuery);\n\t\t \t$dbQuery .= \") \";\n\t\t \n\t\t \t$this->db->query( $dbQuery );\n\t\t\t\n\t\t\t$this->idcriterio = mysql_insert_id();\n\t\t\tif ($this->db->affected_rows() == 0) return false;\n\t\t\treturn true;\n\t\t}",
"function getInsertUpdateDataString($dataArray, $tableName)\r\n\t{\r\n\t\t//INSERT INTO table (primarykeycol,col1,col2) VALUES (1,2,3) ON DUPLICATE KEY UPDATE col1=0, col2=col2+1\r\n\t\t$dataArray = get_object_vars($dataArray);\r\n\t\t$fieldArr = array();\r\n\t\t$dataArr = array();\r\n\t\tforeach($dataArray as $key=>$value)\r\n\t\t{\r\n\t\t\t$fieldArr[] = $key;\r\n\t\t\t$dataArr[] = \"'\".addslashes($value).\"'\";\r\n\t\t}\r\n\t\t$field = implode(\", \",$fieldArr);\r\n\t\t$data = implode(\", \",$dataArr);\r\n\t\t\r\n\t\t$updateDataArr = array();\r\n\t\tforeach($dataArray as $key=>$value)\r\n\t\t{\r\n\t\t\t$updateDataArr[] = $key.\" = '\".addslashes($value).\"'\";\r\n\t\t}\r\n\t\t$updateData = implode(\", \",$updateDataArr);\r\n\t\t\r\n\t\t$query = \"INSERT INTO \".$tableName.\" (\".$field.\") VALUES (\".$data.\") ON DUPLICATE KEY UPDATE \".$updateData.\";\";\r\n\t\treturn $query;\r\n\t}",
"function insert($table_name,$data){\r\n$keys='';\r\n$values='';\r\nforeach($data as $k=>$v){\r\n\t$keys.='`'.$k.'`,';\r\n\t$values.=\"'\".$v.\"',\";\r\n}\r\n$keys=rtrim($keys,',');\r\n$values=rtrim($values,',');\r\n\r\n\t$query= \"INSERT INTO `{$table_name}` ({$keys}) VALUES ({$values})\";\r\n\t//echo $query;\r\n\t$this->query($query);\r\n}",
"public function insert() {\n $query = \"INSERT INTO {$this->Table} SET \";\n if($this->Fields) {\n foreach ($this->Fields as $key => $item) {\n if($item['ignore'] != true && $this->$key != \"\" && $this->$key !== null) {\n if($first === false) $query .= \", \";\n $query .= $key.\" = '\".$this->escape($this->$key).\"'\";\n $first = false;\n }\n }\n }\n $result = $this->query($query);\n $this->clear();\n return $result;\n }",
"function yy_r103(){ \n $this->_retvalue = new SQL\\Insert(@$this->yystack[$this->yyidx + -1]->minor);\n $this->_retvalue->into($this->yystack[$this->yyidx + 0]->minor[0]); \n }",
"function quote_fields(&$rs, $sql_key=array(), $key_value=array()){\r\n $pk_val_new = array();\r\n\r\n $fm_types = array();\r\n for($t=0; $t<count($sql_key); $t++){\r\n $fm_type = $this->field_metatype($rs, $this->field_index($rs, str_replace('`', '', $sql_key[$t])));\r\n $fm_types[] = $fm_type;\r\n }\r\n\r\n for($i =0; $i < count($key_value); $i++){\r\n $pk_val_fields = explode(PK_DELIMITER, $key_value[$i]);\r\n\r\n // ###### DEBUG ONLY ######################\r\n // echo '$key_value[$i]: '. $key_value[$i] .\"\\n\";\r\n // echo 'pk_val_fields: ';\r\n // print_r($pk_val_fields);\r\n // ########################################\r\n\r\n for($j=0; $j < count($sql_key); $j++){\r\n $fm_type = $fm_types[$j];\r\n if($fm_type != 'I' && $fm_type != 'N' && $fm_type != 'R'){\r\n $pk_val_fld = \"'\" . $pk_val_fields[$j] .\"'\";\r\n }else{\r\n $pk_val_fld = $pk_val_fields[$j];\r\n }\r\n $pk_val_fields[$j] = $pk_val_fld;\r\n }\r\n\r\n $pk_val_new[] = '('. implode(',', $pk_val_fields) .')';\r\n }\r\n\r\n return $pk_val_new;\r\n }",
"public static function insertData()\n {\n $db = ezcDbInstance::get();\n $stmt = $db->prepare(\n \"insert into \" . $db->quoteIdentifier( \"PO_database_type_test\" ) . \n \" (\" .\n $db->quoteIdentifier( \"bool\" ) . \", \" .\n $db->quoteIdentifier( \"int\" ) . \", \" .\n $db->quoteIdentifier( \"str\" ) . \", \" .\n $db->quoteIdentifier( \"lob\" ) . \n \" ) VALUES ( :bool, :int, :str, :lob )\"\n );\n\n $stmt->bindValue( ':bool', 1 );\n $stmt->bindValue( ':int', 23 );\n $stmt->bindValue( ':str', 'Non binary string' );\n $stmt->bindValue( ':lob', \"Binary \\x00 string\", PDO::PARAM_LOB );\n\n $stmt->execute();\n\n $stmt->bindValue( ':bool', 0 );\n $stmt->bindValue( ':int', -42 );\n $stmt->bindValue( ':str', \"Binary \\x00 string\", PDO::PARAM_STR );\n $stmt->bindValue( ':lob', \"Binary \\x00 string\", PDO::PARAM_LOB );\n\n $stmt->execute();\n }",
"function insert_table($table,$field,$value,$connection)\n{\n\t$strfield=\"\";\n\t$strvalue=\"\";\n\tfor($i=0; $i<count($field)-1; $i++)\n\t{\n\t\t$strfield.=$field[$i].\", \";\n\t\t$strvalue.=\"'\".$value[$i].\"', \";\n\t\t\n\t}\n\t$strfield.=$field[$i];\n\t\t$strvalue.=\"'\".$value[$i].\"'\";\n\t$sql_add_news=\"INSERT INTO $table(\".$strfield.\") VALUES (\".$strvalue.\")\";\n\t//echo $sql_add_news;\n\tmysqli_query($connection,$sql_add_news) or die(mysqli_error());\n}",
"public function insert_batch($table, $entries, $extra_suffix_sql = \"\") {\r\n\t\tif (sizeof ( $entries ) == 0) {\r\n\t\t\treturn - 1;\r\n\t\t}\r\n\t\t\r\n\t\t$fields = array ();\r\n\t\t$values = array (); // overall values\r\n\t\t\r\n\r\n\t\t/** First build the field names */\r\n\t\t$idx = 0;\r\n\t\tforeach ( $entries [0] as $key => $value ) {\r\n\t\t\t$fields [] = $key;\r\n\t\t}\r\n\t\t\r\n\t\t/** Now loop thru the entries, build the VALUES string. */\r\n\t\tforeach ( $entries as $entry ) {\r\n\t\t\t$entry_values = array ();\r\n\t\t\t$sanity_idx = 0; // for sanity check\r\n\t\t\tforeach ( $entry as $key => $value ) {\r\n\t\t\t\tif ($fields [$sanity_idx ++] != $key) {\r\n\t\t\t\t\tdie ( 'Bad input data in $db->insert_batch.' );\r\n\t\t\t\t}\r\n\t\t\t\t$entry_values [] = $this->get_field_value ( $value );\r\n\t\t\t}\r\n\t\t\t$values [] = '(' . implode ( ',', $entry_values ) . ')';\r\n\t\t}\r\n\t\t\r\n\t\t$fields_str = implode ( \"`,`\", $fields );\r\n\t\t$values_str = implode ( \",\", $values );\r\n\t\t\r\n\t\t$query = \"INSERT INTO `$table` (`$fields_str`) VALUES $values_str $extra_suffix_sql\";\r\n\t\t$this->query ( $query );\r\n\t\t\r\n\t\treturn 1;\r\n\t}",
"function lazyInsert($table, $data){\n \t$sql = 'SHOW COLUMNS FROM '.$table.';';//fetch all columns\n \t$query = mysql_query($sql);\n \t$colstring = '';\n \t$valuestring = '';\n \twhile($column = mysql_fetch_array($query)){\n \t\t//create the field- and value string\n \t\t$colstring .= '`'.$column['Field'].'`,';\n \t\tif(isset($data[$column['Field']])) $valuestring .= '\\''.mysql_real_escape_string($data[$column['Field']]).'\\', ';\n \t\telse $valuestring .= '\\'\\', ';\n \t}\n \t$values = substr($valuestring,0,-2);\n \t$cols = substr($colstring,0,-1);\n \treturn mysql_query('INSERT INTO '.$table.' ('.$cols.') VALUES ('.$values.');');//insert the data\n }",
"public function insert($table, array $fields);",
"function gw_sql_replace($arData, $tbl_name, $isFields = 1)\r\n{\r\n\t$arFields = $arValues = array();\r\n\t$strFields = '';\r\n\tif (is_array($arData))\r\n\t{\r\n\t\tfor (reset($arData); list($k, $v) = each($arData);)\r\n\t\t{\r\n\t\t\t$v = gw_text_sql($v);\r\n\t\t\tif ($v == ''){ $vF = \"''\"; }\r\n\t\t\telseif ( preg_match(\"/^0x[0-9a-f]/\", $v)) { $vF = $v; }\r\n\t\t\telse { $vF = \"'\" . $v . \"'\"; }\r\n\t\t\t$arFields[] = $k;\r\n\t\t\t$arValues[] = $vF;\r\n\t\t}\r\n\t\tif ($isFields) { $strFields = ' (`' . implode('`, `', $arFields) . '`)'; }\r\n\t\t$sql = CRLF . 'REPLACE INTO `' . $tbl_name .'`'. $strFields . ' VALUES ('.implode(',', $arValues).')';\r\n\t\treturn $sql;\r\n\t}\r\n\treturn false;\r\n}",
"public function insertData($table, $fields = [])\n {\n $column = implode(\", \", array_keys($fields));\n\n $valueArrays = [];\n $i = 0;\n foreach ($fields as $values => $value) {\n if (is_int($value)) {\n $valueArrays[$i] = $this->escape($value);\n }else{\n $valueArrays[$i] = \"'\".$this->escape($value).\"'\";\n }\n $i++;\n }\n $value = implode(\", \", $valueArrays);\n\n $query = \"INSERT INTO $table ($column) VALUES ($value)\";\n $result = $this->mysqli->query($query);\n if( $result ){\n return true;\n }else{\n return false;\n }\n }",
"public function get_insert()\n {\n $pairs = !empty($this->multiset) ? $this->multiset: array($this->set);\n\n $vals = array();\n $keys = null;\n foreach ($pairs as $row)\n {\n $keys = array_keys($row);\n $vals[] = join(', ', self::prepare($row));\n }\n $keys = join(', ', $keys);\n $vals = join('), (', $vals);\n $table = self::quote_name($this->table);\n return \"insert into $table ($keys) values ($vals)\";\n }",
"function dbuniqueinsert($table, $fields, $where, $funcs = null) {\r\n\tglobal $msq;\r\n\tlist($keys, $vals) = db_fields_to_keys_vals($fields, $funcs);\r\n\t$whparts = [];\r\n\tforeach ($where as $k => $v)\r\n\t\t$whparts []= $k.' = \"'.mysqli_real_escape_string($msq, $v).'\"';\r\n\r\n\t$q = \"insert into \".$table.\" (\".implode(\", \",$keys).\") \".\r\n\t\t\t\"select * from (select \".implode(\", \",$vals).\") as tmp \".\r\n\t\t\t\"where not exists (\".\r\n\t\t\t\t\" select \".implode(\", \",$keys).\" from \".$table.\" where \".implode(\" and \",$whparts).\r\n\t\t\t\") limit 1\";\r\n\t// echo $q; exit;\r\n\tif (dbcommit($q) === false)\r\n\t\treturn false;\r\n\treturn mysqli_insert_id($msq);\r\n\r\n}",
"public function prepareInsert($tableName, array $fields)\n\t{\n\t\t$columns = array();\n\t\t$values = array();\n\n\t\t$tableFields = $this->connection->getTableFields($tableName);\n\n\t\tforeach($tableFields as $columnName => $tableField)\n\t\t{\n\t\t\tif(isset($fields[$columnName]) || array_key_exists($columnName, $fields))\n\t\t\t{\n\t\t\t\t$columns[] = $this->quote($columnName);\n\t\t\t\t$values[] = $this->convertToDb($fields[$columnName], $tableField);\n\t\t\t}\n\t\t}\n\n\t\t$binds = $this->prepareBinds($tableFields, $fields);\n\n\t\treturn array(\n\t\t\timplode(\", \", $columns),\n\t\t\timplode(\", \", $values),\n\t\t\t$binds\n\t\t);\n\t}",
"static public function writeInsertData( $table, $fields, $data )\n\t{\n\t\n\t}",
"public function insertSql()\n {\n $sql = \"INSERT INTO \" . $this->dbName . '.' . $this->table\n . \" (\" . implode($this->fields, \", \") . \")\n VALUES (:\" . implode($this->fields, \", :\") . \");\";\n\n $this->query = $sql;\n }",
"public function insertRecords($table, $data) \n {\n \t// setup some variables for fields and values\n \t$fields = \"\";\n $values = \"\";\n\t\t\n // sets attributes and values\n foreach ($data as $f => $v) {\t\t\t\n $fields .= \"`$f`,\";\n $values .= ( is_numeric( $v ) && ( intval( $v ) == $v ) ) ? $v.\",\" : \"'$v',\";\t\t\n }\n\t\t\n // remove last ',' \n \t$setfields = substr($fields, 0, -1);\n \t$setvalues = substr($values, 0, -1);\n \t\n $insert = \"INSERT INTO $table ({$setfields}) VALUES({$setvalues})\";\n $this->executeQuery( $insert );\n return true;\n }",
"function insert($table_name,$column_array){\r\n\t\t\r\n\t\t/* column array format is array('column_name'=>'value','column_name'=>'value')*/\r\n\t\t$query = 'INSERT INTO ' . $table_name . ' (';\r\n\r\n\t\t//if we have a multi dimensional array, then we are inserting\r\n\t\t//several values to same table\r\n\t\tif(!empty($column_array[0]) && is_array($column_array[0])){\r\n\t\t\t$last = end(array_keys($column_array[0]));\r\n\t\t\t\r\n\t\t\t//create column name paren\r\n\t\t\tforeach($column_array[0] as $key=>$val){\r\n\t\t\t\t$query .= $key;\r\n\t\t\t\t\r\n\t\t\t\tif($key != $last)\r\n\t\t\t\t\t$query .= ',';\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$query .= ') VALUES ';\r\n\t\t\t\r\n\t\t\t//create values statement\r\n\t\t\tfor($i = 0; $i < count($column_array); $i++){\r\n\t\t\t\t\r\n\t\t\t\t//open current value set\r\n\t\t\t\t$query .= '(';\r\n\t\t\t\tforeach($column_array[$i] as $key=>$val){\r\n\t\t\t\t\t\r\n\t\t\t\t\t//if $val contains CURDATE or NULL no quotes around\r\n\t\t\t\t\tif(strpos($val,'CURDATE') !== false || \r\n\t\t\t\t\t\tstrpos($val,'NULL') !== false ||\r\n\t\t\t\t\t\tstrpos($val, '()') !== false ||\r\n\t\t\t\t\t\tstrpos($val, '@tid') !== false)\r\n\t\t\t\t\t\t$query .= $val;\r\n\t\t\t\t\telse\r\n\t\t\t\t\t\t$query .= \"'\" . $val . \"'\";\r\n\t\t\t\t\t\r\n\t\t\t\t\tif($key != $last)\r\n\t\t\t\t\t\t$query .= ',';\r\n\t\t\t\t}\r\n\t\t\t\t//close current value set and append comma\r\n\t\t\t\t$query .= ')';\r\n\t\t\t\tif($i != (count($column_array)-1))\r\n\t\t\t\t\t$query .= ',';\r\n\t\t\t}\r\n\t\t}\t\t\t\t\r\n\t\telse{\t\t\t\t\t\r\n\t\t\r\n\t\t$val_addition = '';\r\n\t\t$last = end(array_keys($column_array));\r\n\t\t\r\n\t\t//loop through column array and create proper insert\r\n\t\t//statement for single row\r\n\t\tforeach($column_array as $key=>$val){\r\n\t\t\t$query .= $key;\r\n\t\t\t\r\n\t\t\t//if $val contains CURDATE or NULL no quotes around\r\n\t\t\tif(strpos($val,'CURDATE') !== false || \r\n\t\t\t\tstrpos($val,'NULL') !== false ||\r\n\t\t\t\tstrpos($val, '()') !== false ||\r\n\t\t\t\tstrpos($val, '@tid') !== false)\r\n\t\t\t\t$val_addition .= $val;\r\n\t\t\telse\r\n\t\t\t\t$val_addition .= \"'\" . $val . \"'\";\r\n\t\t\t\r\n\t\t\tif($key !== $last){\r\n\t\t\t\t$query .= ',';\r\n\t\t\t\t$val_addition .= ',';\r\n\t\t\t}\r\n\r\n\t\t}\r\n\t\t\r\n\t\t$query .= ') VALUES (' . $val_addition . ')';\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t//prevent duplicate emails\r\n\t\t$query .= ' ON DUPLICATE KEY UPDATE name = \"' . $column_array[\"name\"] . '\", subscribed = \"1\";';\r\n\t\t\r\n\t\t$this->query .= $query;\r\n\r\n\t}",
"function insertIntoTable($tableName, $valuesToInsert){\r\n\t$insertionQuery = \"INSERT INTO \" . \r\n\t\tmysql_real_escape_string($tableName) . \" (\";\r\n\tforeach ($valuesToInsert as $fieldName => $value){\r\n\t\t$insertionQuery .= $fieldName . \", \";\r\n\t}\r\n\t$insertionQuery = rtrim($insertionQuery, \", \");\t//compensate for the loop not knowing when it's almost over\r\n\t$insertionQuery .= \") VALUES(\";\t//End field specification and begin value specification\r\n\t\r\n\tforeach ($valuesToInsert as $fieldName => $value){\r\n\t\t$insertionQuery .= $value . \", \";\r\n\t}\r\n\t$insertionQuery = rtrim($insertionQuery, \", \");\t//compensate for the loop not knowing when it's almost over\r\n\t$insertionQuery .= \")\";\t\r\n\t//Done with query creation. Now, execute.\r\n\tif(!$insertionResult = mysql_query($insertionQuery)){echo ('Query failed: ' . mysql_error() . \"QUERY TEXT: \" . $insertionQuery); mysql_query(\"ROLLBACK\"); die();} \r\n\t$returnRow = mysql_fetch_array(mysql_query(\"SELECT LAST_INSERT_ID()\"));\r\n\treturn $returnRow[0];\r\n}",
"public function insert($table, $vars, $datatypes,$exclude = ''){\n\n\t\t// Catch Exclusions\n\t\tif($exclude == ''){\n\t\t\t$exclude = array();\n\t\t}\n\n\t\tarray_push($exclude, 'MAX_FILE_SIZE'); // Automatically exclude this one\n\n\t\t// Prepare Variables\n\t\t$vars = $this->SecureData($vars, $datatypes);\n\n\t\t$query = \"INSERT INTO `{$table}` SET \";\n\t\tforeach($vars as $key=>$value){\n\t\t\tif(in_array($key, $exclude)){\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$query .= \"`{$key}` = '{$value}', \";\n\t\t}\n\n\t\t$query = trim($query, ', ');\n\n\t\treturn $this->executeSQL($query);\n\t}",
"protected function compileInsert(array &$args = array()) {\n\t\t\n\t\t// query isn't cached, build up the query\n\t\t$queries = array();\n\t\t\n\t\t// with SQLite we will only allow inserting into one table\n\t\t$contexts = $this->query->getContexts();\n\t\tlist($model_alias, $context) = each($contexts);\n\t\t\n\t\t// get the usual stuff\n\t\t$definition = $this->getDefinitionByModelAlias($model_alias);\n\t\t$table_name = $definition->getInternalName();\n\t\t\n\t\t// get the field and values\n\t\t$fields = $this->buildFieldsList($context, $definition, $args);\n\t\t\n\t\t// create the query\n\t\t$sql = \"INSERT INTO {$table_name} \";\n\t\t$sql .= '('. implode(',', array_keys($fields)) .') ';\n\t\t$sql .= 'VALUES ('. implode(',', array_values($fields)) .')';\n\t\t\n\t\treturn $sql;\n\t}",
"public function insert()\n {\n if(empty($this->attributes)){\n return;\n }\n if ($this->isAutoInc) {\n $columlList = \" (\";\n $valuelList = \" (\";\n foreach ($this->attributes as $column => $value) {\n $columlList .= $column . \", \";\n $valuelList .= \":\".$column . \", \";\n }\n $columlList = str_last_replace(\", \", \")\", $columlList);\n $valuelList = str_last_replace(\", \", \")\", $valuelList);\n $sqlQuery = \"INSERT INTO \" . $this->table . $columlList . \" VALUES\" . $valuelList;\n\n Db::instance()->execute($sqlQuery,$this->attributes);\n #println($sqlQuery, \"blue\");\n }\n }",
"public function insert($params){\n\t\t$rdata=0;\n\t\t$data=array();\n\t\t$sql=array();\n\t\tif(!empty($params)){\n\t\t\t$sql=array();\n\t\t\tforeach($params as $tname=>$cvalue){\n\t\t\t\t$data=array();\n\t\t\t\tforeach($cvalue as $field=>$value){\n\t\t\t\t\t$marray=array();\n\t\t\t\t\tif(preg_match('/^#(.*)$/',$field,$marray)){\n\t\t\t\t\t\t$field=$marray[1];\n\t\t\t\t\t\t$data[]=\"`\".trim($field,'`').\"`=\".$value;\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$data[]=\"`\".trim($field,'`').\"`='\".$value.\"'\";\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t$tname=trim($tname,'`');\n\t\t\t\t$this->query(\"INSERT `\".$tname.\"` SET \".implode(',',$data).\" ;\");\n\t\t\t\t$rdata=$this->insert_id;\n\t\t\t}\n\t\t}\n\t\treturn $rdata;\n\t}",
"function inserts()\n\t{\n\t\t$this->ipsclass->input['step']++;\n\t\t$uninstall = ( $this->ipsclass->input['un'] == 1 ) ? \"&un=1\" : \"\";\n\t\t\n\t\t$object = ( $this->tasks['inserts'] == 1 ) ? 'Database Row' : 'Database Rows';\n\t\t$operation = ( $this->ipsclass->input['un'] ) ? 'removed' : 'inserted';\n\t\t\n\t\tforeach ( $this->xml_array['inserts_group']['insert'] as $k => $v )\n\t\t{\n\t\t\tif ( !$this->ipsclass->input['un'] )\n\t\t\t{\n\t\t\t\tunset( $f );\n\t\t\t\t\n\t\t\t\tforeach ( $v['fields'] as $kk => $vv )\n\t\t\t\t{\n\t\t\t\t\tif ( strtolower( $kk ) == 'value' )\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$f[ $kk ] = $vv['VALUE'];\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$this->ipsclass->DB->build_and_exec_query( array( 'select' => '*',\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'from' => $v['table']['VALUE'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'where' => $v['delete_key']['VALUE'],\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t )\t\t);\n\t\t\t\t\n\t\t\t\tif ( !$this->ipsclass->DB->get_num_rows() )\n\t\t\t\t{\n\t\t\t\t\t$this->ipsclass->DB->do_insert( $v['table']['VALUE'], $f );\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\tif ( in_array( SQL_PREFIX.$v['table']['VALUE'], $this->ipsclass->DB->get_table_names() ) )\n\t\t\t\t{\n\t\t\t\t\t$this->ipsclass->DB->do_delete( $v['table']['VALUE'], $v['delete_key']['VALUE'] );\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t\n\t\t$this->ipsclass->admin->redirect( \"{$this->ipsclass->form_code}&code=work&mod={$this->ipsclass->input['mod']}&step={$this->ipsclass->input['step']}{$uninstall}&st={$this->ipsclass->input['st']}\", \"{$this->xml_array['mod_info']['title']['VALUE']}<br />{$this->tasks['inserts']} {$object} {$operation}....\" );\n\t}",
"public function import_insert($arrayrecord, $array_match_file_to_database, $objimport, $maxfields, $importid, $updatekeys)\n\t{\n // phpcs:enable\n\t\tglobal $langs,$conf,$user;\n global $thirdparty_static; \t// Specific to thirdparty import\n\t\tglobal $tablewithentity_cache;\t// Cache to avoid to call desc at each rows on tables\n\n\t\t$error=0;\n\t\t$warning=0;\n\t\t$this->errors=array();\n\t\t$this->warnings=array();\n\n\t\t//dol_syslog(\"import_csv.modules maxfields=\".$maxfields.\" importid=\".$importid);\n\n\t\t//var_dump($array_match_file_to_database);\n\t\t//var_dump($arrayrecord);\n\t\t$array_match_database_to_file=array_flip($array_match_file_to_database);\n\t\t$sort_array_match_file_to_database=$array_match_file_to_database;\n\t\tksort($sort_array_match_file_to_database);\n\n\t\t//var_dump($sort_array_match_file_to_database);\n\n\t\tif (count($arrayrecord) == 0 || (count($arrayrecord) == 1 && empty($arrayrecord[0]['val'])))\n\t\t{\n\t\t\t//print 'W';\n\t\t\t$this->warnings[$warning]['lib']=$langs->trans('EmptyLine');\n\t\t\t$this->warnings[$warning]['type']='EMPTY';\n\t\t\t$warning++;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$last_insert_id_array = array(); // store the last inserted auto_increment id for each table, so that dependent tables can be inserted with the appropriate id (eg: extrafields fk_object will be set with the last inserted object's id)\n\t\t\t$updatedone = false;\n\t\t\t$insertdone = false;\n\t\t\t// For each table to insert, me make a separate insert\n\t\t\tforeach($objimport->array_import_tables[0] as $alias => $tablename)\n\t\t\t{\n\t\t\t\t// Build sql request\n\t\t\t\t$sql='';\n\t\t\t\t$listfields=array();\n\t\t\t\t$listvalues=array();\n\t\t\t\t$i=0;\n\t\t\t\t$errorforthistable=0;\n\n\t\t\t\t// Define $tablewithentity_cache[$tablename] if not already defined\n\t\t\t\tif (! isset($tablewithentity_cache[$tablename]))\t// keep this test with \"isset\"\n\t\t\t\t{\n\t\t\t\t\tdol_syslog(\"Check if table \".$tablename.\" has an entity field\");\n\t\t\t\t\t$resql=$this->db->DDLDescTable($tablename, 'entity');\n\t\t\t\t\tif ($resql)\n\t\t\t\t\t{\n\t\t\t\t\t\t$obj=$this->db->fetch_object($resql);\n\t\t\t\t\t\tif ($obj) $tablewithentity_cache[$tablename]=1;\t\t// table contains entity field\n\t\t\t\t\t\telse $tablewithentity_cache[$tablename]=0;\t\t\t// table does not contains entity field\n\t\t\t\t\t}\n\t\t\t\t\telse dol_print_error($this->db);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t//dol_syslog(\"Table \".$tablename.\" check for entity into cache is \".$tablewithentity_cache[$tablename]);\n\t\t\t\t}\n\n\n\t\t\t\t// Loop on each fields in the match array: $key = 1..n, $val=alias of field (s.nom)\n\t\t\t\tforeach($sort_array_match_file_to_database as $key => $val)\n\t\t\t\t{\n\t\t\t\t $fieldalias=preg_replace('/\\..*$/i', '', $val);\n\t\t\t\t $fieldname=preg_replace('/^.*\\./i', '', $val);\n\n\t\t\t\t if ($alias != $fieldalias) continue; // Not a field of current table\n\n\t\t\t\t\tif ($key <= $maxfields)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Set $newval with value to insert and set $listvalues with sql request part for insert\n\t\t\t\t\t\t$newval='';\n\t\t\t\t\t\tif ($arrayrecord[($key-1)]['type'] > 0) $newval=$arrayrecord[($key-1)]['val']; // If type of field into input file is not empty string (so defined into input file), we get value\n\n\t\t\t\t\t\t// Make some tests on $newval\n\n\t\t\t\t\t\t// Is it a required field ?\n\t\t\t\t\t\tif (preg_match('/\\*/', $objimport->array_import_fields[0][$val]) && ((string) $newval==''))\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$this->errors[$error]['lib']=$langs->trans('ErrorMissingMandatoryValue', $key);\n\t\t\t\t\t\t\t$this->errors[$error]['type']='NOTNULL';\n\t\t\t\t\t\t\t$errorforthistable++;\n\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t}\n\t\t\t\t\t\t// Test format only if field is not a missing mandatory field (field may be a value or empty but not mandatory)\n\t\t\t\t\t\telse\n\t\t\t\t\t\t{\n\t\t\t\t\t\t // We convert field if required\n\t\t\t\t\t\t if (! empty($objimport->array_import_convertvalue[0][$val]))\n\t\t\t\t\t\t {\n //print 'Must convert '.$newval.' with rule '.join(',',$objimport->array_import_convertvalue[0][$val]).'. ';\n if ($objimport->array_import_convertvalue[0][$val]['rule']=='fetchidfromcodeid'\n \t|| $objimport->array_import_convertvalue[0][$val]['rule']=='fetchidfromref'\n \t|| $objimport->array_import_convertvalue[0][$val]['rule']=='fetchidfromcodeorlabel'\n \t)\n {\n // New val can be an id or ref. If it start with id: it is forced to id, if it start with ref: it is forced to ref. It not, we try to guess.\n $isidorref='id';\n if (! is_numeric($newval) && $newval != '' && ! preg_match('/^id:/i', $newval)) $isidorref='ref';\n $newval=preg_replace('/^(id|ref):/i', '', $newval); // Remove id: or ref: that was used to force if field is id or ref\n //print 'Val is now '.$newval.' and is type '.$isidorref.\"<br>\\n\";\n\n if ($isidorref == 'ref') // If value into input import file is a ref, we apply the function defined into descriptor\n {\n $file=(empty($objimport->array_import_convertvalue[0][$val]['classfile'])?$objimport->array_import_convertvalue[0][$val]['file']:$objimport->array_import_convertvalue[0][$val]['classfile']);\n $class=$objimport->array_import_convertvalue[0][$val]['class'];\n $method=$objimport->array_import_convertvalue[0][$val]['method'];\n if ($this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval] != '')\n {\n \t$newval=$this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval];\n }\n else\n\t\t\t\t\t\t\t\t\t\t{\n $resultload = dol_include_once($file);\n if (empty($resultload))\n {\n dol_print_error('', 'Error trying to call file='.$file.', class='.$class.', method='.$method);\n break;\n }\n $classinstance=new $class($this->db);\n // Try the fetch from code or ref\n $param_array = array('', $newval);\n if ($class == 'AccountingAccount')\n {\n //var_dump($arrayrecord[0]['val']);\n /*include_once DOL_DOCUMENT_ROOT.'/accountancy/class/accountancysystem.class.php';\n $tmpchartofaccount = new AccountancySystem($this->db);\n $tmpchartofaccount->fetch($conf->global->CHARTOFACCOUNTS);\n var_dump($tmpchartofaccount->ref.' - '.$arrayrecord[0]['val']);\n if ((! ($conf->global->CHARTOFACCOUNTS > 0)) || $tmpchartofaccount->ref != $arrayrecord[0]['val'])\n {\n $this->errors[$error]['lib']=$langs->trans('ErrorImportOfChartLimitedToCurrentChart', $tmpchartofaccount->ref);\n $this->errors[$error]['type']='RESTRICTONCURRENCTCHART';\n $errorforthistable++;\n $error++;\n }*/\n $param_array = array('', $newval, 0, $arrayrecord[0]['val']); // Param to fetch parent from account, in chart.\n }\n call_user_func_array(array($classinstance, $method), $param_array);\n // If not found, try the fetch from label\n if (! ($classinstance->id != '') && $objimport->array_import_convertvalue[0][$val]['rule']=='fetchidfromcodeorlabel')\n {\n $param_array = array('', '', $newval);\n call_user_func_array(array($classinstance, $method), $param_array);\n }\n $this->cacheconvert[$file.'_'.$class.'_'.$method.'_'][$newval]=$classinstance->id;\n //print 'We have made a '.$class.'->'.$method.' to get id from code '.$newval.'. ';\n if ($classinstance->id != '')\t// id may be 0, it is a found value\n {\n $newval=$classinstance->id;\n }\n else\n {\n if (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) $this->errors[$error]['lib']=$langs->trans('ErrorFieldValueNotIn', $key, $newval, 'code', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict']));\n elseif (!empty($objimport->array_import_convertvalue[0][$val]['element'])) $this->errors[$error]['lib']=$langs->trans('ErrorFieldRefNotIn', $key, $newval, $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['element']));\n else $this->errors[$error]['lib']='ErrorBadDefinitionOfImportProfile';\n $this->errors[$error]['type']='FOREIGNKEY';\n $errorforthistable++;\n $error++;\n }\n }\n }\n }\n elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='zeroifnull')\n {\n if (empty($newval)) $newval='0';\n }\n elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='fetchidfromcodeunits' || $objimport->array_import_convertvalue[0][$val]['rule']=='fetchscalefromcodeunits')\n {\n \t$file=(empty($objimport->array_import_convertvalue[0][$val]['classfile'])?$objimport->array_import_convertvalue[0][$val]['file']:$objimport->array_import_convertvalue[0][$val]['classfile']);\n \t$class=$objimport->array_import_convertvalue[0][$val]['class'];\n \t$method=$objimport->array_import_convertvalue[0][$val]['method'];\n \t$units=$objimport->array_import_convertvalue[0][$val]['units'];\n \tif ($this->cacheconvert[$file.'_'.$class.'_'.$method.'_'.$units][$newval] != '')\n \t{\n \t\t$newval=$this->cacheconvert[$file.'_'.$class.'_'.$method.'_'.$units][$newval];\n \t}\n \telse\n \t{\n \t\t$resultload = dol_include_once($file);\n \t\tif (empty($resultload))\n \t\t{\n \t\t\tdol_print_error('', 'Error trying to call file='.$file.', class='.$class.', method='.$method.', units='.$units);\n \t\t\tbreak;\n \t\t}\n \t\t$classinstance=new $class($this->db);\n \t\t// Try the fetch from code or ref\n \t\tcall_user_func_array(array($classinstance, $method), array('', '', $newval, $units));\n \t\t$scaleorid = (($objimport->array_import_convertvalue[0][$val]['rule']=='fetchidfromcodeunits') ? $classinstance->id : $classinstance->scale);\n \t\t$this->cacheconvert[$file.'_'.$class.'_'.$method.'_'.$units][$newval]=$scaleorid;\n \t\t//print 'We have made a '.$class.'->'.$method.\" to get a value from key '\".$newval.\"' and we got '\".$scaleorid.\"'.\";exit;\n \t\tif ($classinstance->id > 0)\t// we found record\n \t\t{\n \t\t\t$newval = $scaleorid ? $scaleorid : 0;\n \t\t}\n \t\telse\n \t\t{\n \t\t\tif (!empty($objimport->array_import_convertvalue[0][$val]['dict'])) $this->errors[$error]['lib']=$langs->trans('ErrorFieldValueNotIn', $key, $newval, 'scale', $langs->transnoentitiesnoconv($objimport->array_import_convertvalue[0][$val]['dict']));\n \t\t\telse $this->errors[$error]['lib']='ErrorFieldValueNotIn';\n \t\t\t$this->errors[$error]['type']='FOREIGNKEY';\n \t\t\t$errorforthistable++;\n \t\t\t$error++;\n \t\t}\n \t}\n }\n elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='getcustomercodeifauto')\n {\n if (strtolower($newval) == 'auto')\n {\n $this->thirpartyobject->get_codeclient(0, 0);\n $newval=$this->thirpartyobject->code_client;\n //print 'code_client='.$newval;\n }\n if (empty($newval)) $arrayrecord[($key-1)]['type']=-1;\t// If we get empty value, we will use \"null\"\n }\n elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='getsuppliercodeifauto')\n {\n if (strtolower($newval) == 'auto')\n {\n $newval=$this->thirpartyobject->get_codefournisseur(0, 1);\n $newval=$this->thirpartyobject->code_fournisseur;\n //print 'code_fournisseur='.$newval;\n }\n if (empty($newval)) $arrayrecord[($key-1)]['type']=-1;\t// If we get empty value, we will use \"null\"\n }\n elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='getcustomeraccountancycodeifauto')\n {\n if (strtolower($newval) == 'auto')\n {\n $this->thirpartyobject->get_codecompta('customer');\n $newval=$this->thirpartyobject->code_compta;\n //print 'code_compta='.$newval;\n }\n if (empty($newval)) $arrayrecord[($key-1)]['type']=-1;\t// If we get empty value, we will use \"null\"\n }\n elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='getsupplieraccountancycodeifauto')\n {\n if (strtolower($newval) == 'auto')\n {\n $this->thirpartyobject->get_codecompta('supplier');\n $newval=$this->thirpartyobject->code_compta_fournisseur;\n if (empty($newval)) $arrayrecord[($key-1)]['type']=-1;\t// If we get empty value, we will use \"null\"\n //print 'code_compta_fournisseur='.$newval;\n }\n if (empty($newval)) $arrayrecord[($key-1)]['type']=-1;\t// If we get empty value, we will use \"null\"\n }\n elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='getrefifauto')\n {\n $defaultref='';\n // TODO provide the $modTask (module of generation of ref) as parameter of import_insert function\n $obj = empty($conf->global->PROJECT_TASK_ADDON)?'mod_task_simple':$conf->global->PROJECT_TASK_ADDON;\n if (! empty($conf->global->PROJECT_TASK_ADDON) && is_readable(DOL_DOCUMENT_ROOT .\"/core/modules/project/task/\".$conf->global->PROJECT_TASK_ADDON.\".php\"))\n {\n require_once DOL_DOCUMENT_ROOT .\"/core/modules/project/task/\".$conf->global->PROJECT_TASK_ADDON.'.php';\n $modTask = new $obj;\n $defaultref = $modTask->getNextValue(null, null);\n }\n if (is_numeric($defaultref) && $defaultref <= 0) $defaultref='';\n $newval=$defaultref;\n }\n\n\n elseif ($objimport->array_import_convertvalue[0][$val]['rule']=='numeric')\n {\n $newval = price2num($newval);\n }\n\n //print 'Val to use as insert is '.$newval.'<br>';\n\t\t\t\t\t\t }\n\n\t\t\t\t\t\t // Test regexp\n\t\t\t\t\t\t\tif (! empty($objimport->array_import_regex[0][$val]) && ($newval != ''))\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t// If test is \"Must exist in a field@table or field@table:...\"\n\t\t\t\t\t\t\t\tif (preg_match('/^(.+)@([^:]+)(:.+)?$/', $objimport->array_import_regex[0][$val], $reg))\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t$field=$reg[1];\n\t\t\t\t\t\t\t\t\t$table=$reg[2];\n\t\t\t\t\t\t\t\t\t$filter=!empty($reg[3])?substr($reg[3], 1):'';\n\n\t\t\t\t\t\t\t\t\t$cachekey = $field.'@'.$table;\n\t\t\t\t\t\t\t\t\tif(! empty($filter)) $cachekey.= ':'.$filter;\n\n\t\t\t\t\t\t\t\t\t// Load content of field@table into cache array\n\t\t\t\t\t\t\t\t\tif (! is_array($this->cachefieldtable[$cachekey])) // If content of field@table not already loaded into cache\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$sql=\"SELECT \".$field.\" as aliasfield FROM \".$table;\n\t\t\t\t\t\t\t\t\t\tif(! empty($filter))\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$sql.= ' WHERE ' . $filter;\n\t\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t\t$resql=$this->db->query($sql);\n\t\t\t\t\t\t\t\t\t\tif ($resql)\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\t$num=$this->db->num_rows($resql);\n\t\t\t\t\t\t\t\t\t\t\t$i=0;\n\t\t\t\t\t\t\t\t\t\t\twhile ($i < $num)\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$obj=$this->db->fetch_object($resql);\n\t\t\t\t\t\t\t\t\t\t\t\tif ($obj) $this->cachefieldtable[$cachekey][]=$obj->aliasfield;\n\t\t\t\t\t\t\t\t\t\t\t\t$i++;\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\telse\n\t\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t\tdol_print_error($this->db);\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t\t\t// Now we check cache is not empty (should not) and key is into cache\n\t\t\t\t\t\t\t\t\tif (! is_array($this->cachefieldtable[$cachekey]) || ! in_array($newval, $this->cachefieldtable[$cachekey]))\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t$tableforerror = $table;\n\t\t\t\t\t\t\t\t\t\tif(! empty($filter)) $tableforerror.= ':'.$filter;\n\t\t\t\t\t\t\t\t\t\t$this->errors[$error]['lib']=$langs->transnoentitiesnoconv('ErrorFieldValueNotIn', $key, $newval, $field, $tableforerror);\n\t\t\t\t\t\t\t\t\t\t$this->errors[$error]['type']='FOREIGNKEY';\n\t\t\t\t\t\t\t\t\t $errorforthistable++;\n\t\t\t\t\t\t\t\t\t\t$error++;\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// If test is just a static regex\n\t\t\t\t\t\t\t\telseif (! preg_match('/'.$objimport->array_import_regex[0][$val].'/i', $newval)) {\n\t\t\t\t\t\t\t\t //if ($key == 19) print \"xxx\".$newval.\"zzz\".$objimport->array_import_regex[0][$val].\"<br>\";\n\t\t\t\t\t\t\t\t\t$this->errors[$error]['lib']=$langs->transnoentitiesnoconv('ErrorWrongValueForField', $key, $newval, $objimport->array_import_regex[0][$val]);\n\t\t\t\t\t\t\t\t\t$this->errors[$error]['type']='REGEX';\n\t\t\t\t\t\t\t\t\t$errorforthistable++;\n\t\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t// Other tests\n\t\t\t\t\t\t\t// ...\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Define $listfields and $listvalues to build SQL request\n\t\t\t\t\t\t$listfields[] = $fieldname;\n\n\t\t\t\t\t\t// Note: arrayrecord (and 'type') is filled with ->import_read_record called by import.php page before calling import_insert\n\t\t\t\t\t\tif (empty($newval) && $arrayrecord[($key-1)]['type'] < 0) {\n $listvalues[] = ($newval=='0'?$newval:\"null\");\n } elseif (empty($newval) && $arrayrecord[($key-1)]['type'] == 0) {\n $listvalues[] = \"''\";\n } else {\n $listvalues[] = \"'\".$this->db->escape($newval).\"'\";\n }\n\t\t\t\t\t}\n\t\t\t\t\t$i++;\n\t\t\t\t}\n\n\t\t\t\t// We add hidden fields (but only if there is at least one field to add into table)\n\t\t\t\tif (!empty($listfields) && is_array($objimport->array_import_fieldshidden[0]))\n\t\t\t\t{\n \t\t\t\t// Loop on each hidden fields to add them into listfields/listvalues\n\t\t\t\t foreach($objimport->array_import_fieldshidden[0] as $key => $val)\n \t\t\t\t{\n \t\t\t\t\tif (! preg_match('/^'.preg_quote($alias, '/').'\\./', $key)) continue; // Not a field of current table\n \t\t\t\t if ($val == 'user->id')\n \t\t\t\t {\n \t\t\t\t $listfields[] = preg_replace('/^'.preg_quote($alias, '/').'\\./', '', $key);\n \t\t\t\t $listvalues[] = $user->id;\n \t\t\t\t }\n \t\t\t\t elseif (preg_match('/^lastrowid-/', $val))\n \t\t\t\t {\n \t\t\t\t $tmp=explode('-', $val);\n \t\t\t\t $lastinsertid=(isset($last_insert_id_array[$tmp[1]]))?$last_insert_id_array[$tmp[1]]:0;\n\t\t\t\t\t\t\t$keyfield = preg_replace('/^'.preg_quote($alias, '/').'\\./', '', $key);\n \t\t\t\t $listfields[] = $keyfield;\n $listvalues[] = $lastinsertid;\n \t\t\t\t //print $key.\"-\".$val.\"-\".$listfields.\"-\".$listvalues.\"<br>\";exit;\n \t\t\t\t }\n \t\t\t\t elseif (preg_match('/^const-/', $val))\n \t\t\t\t {\n \t\t\t\t \t$tmp=explode('-', $val, 2);\n \t\t\t\t \t$listfields[] = preg_replace('/^'.preg_quote($alias, '/').'\\./', '', $key);\n \t\t\t\t \t$listvalues[] = \"'\".$tmp[1].\"'\";\n \t\t\t\t }\n \t\t\t\t else\n \t\t\t\t {\n \t\t\t\t \t$this->errors[$error]['lib']='Bad value of profile setup '.$val.' for array_import_fieldshidden';\n \t\t\t\t \t$this->errors[$error]['type']='Import profile setup';\n \t\t\t\t \t$error++;\n \t\t\t\t }\n \t\t\t\t}\n\t\t\t\t}\n\t\t\t\t//print 'listfields='.$listfields.'<br>listvalues='.$listvalues.'<br>';\n\n\t\t\t\t// If no error for this $alias/$tablename, we have a complete $listfields and $listvalues that are defined\n\t\t\t\t// so we can try to make the insert or update now.\n\t\t\t\tif (! $errorforthistable)\n\t\t\t\t{\n\t\t\t\t\t//print \"$alias/$tablename/$listfields/$listvalues<br>\";\n\t\t\t\t\tif (!empty($listfields))\n\t\t\t\t\t{\n\t\t\t\t\t\t$updatedone = false;\n\t\t\t\t\t\t$insertdone = false;\n\n\t\t\t\t\t\tif (!empty($updatekeys)) {\n\t\t\t\t\t\t\t// We do SELECT to get the rowid, if we already have the rowid, it's to be used below for related tables (extrafields)\n\n\t\t\t\t\t\t\tif (empty($lastinsertid)) {\t// No insert done yet for a parent table\n\t\t\t\t\t\t\t\t$sqlSelect = 'SELECT rowid FROM '.$tablename;\n\n\t\t\t\t\t\t\t\t$data = array_combine($listfields, $listvalues);\n\t\t\t\t\t\t\t\t$where = array();\n\t\t\t\t\t\t\t\t$filters = array();\n\t\t\t\t\t\t\t\tforeach ($updatekeys as $key) {\n\t\t\t\t\t\t\t\t\t$col = $objimport->array_import_updatekeys[0][$key];\n\t\t\t\t\t\t\t\t\t$key=preg_replace('/^.*\\./i', '', $key);\n\t\t\t\t\t\t\t\t\t$where[] = $key.' = '.$data[$key];\n\t\t\t\t\t\t\t\t\t$filters[] = $col.' = '.$data[$key];\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$sqlSelect.= ' WHERE '.implode(' AND ', $where);\n\n\t\t\t\t\t\t\t\t$resql=$this->db->query($sqlSelect);\n\t\t\t\t\t\t\t\tif($resql) {\n\t\t\t\t\t\t\t\t\t$res = $this->db->fetch_object($resql);\n\t\t\t\t\t\t\t\t\tif($resql->num_rows == 1) {\n\t\t\t\t\t\t\t\t\t\t$lastinsertid = $res->rowid;\n\t\t\t\t\t\t\t\t\t\t$last_insert_id_array[$tablename] = $lastinsertid;\n\t\t\t\t\t\t\t\t\t} elseif($resql->num_rows > 1) {\n\t\t\t\t\t\t\t\t\t\t$this->errors[$error]['lib']=$langs->trans('MultipleRecordFoundWithTheseFilters', implode($filters, ', '));\n\t\t\t\t\t\t\t\t\t\t$this->errors[$error]['type']='SQL';\n\t\t\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t// No record found with filters, insert will be tried below\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//print 'E';\n\t\t\t\t\t\t\t\t\t$this->errors[$error]['lib']=$this->db->lasterror();\n\t\t\t\t\t\t\t\t\t$this->errors[$error]['type']='SQL';\n\t\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t// We have a last INSERT ID (got by previous pass), so we check if we have a row referencing this foreign key.\n\t\t\t\t\t\t\t\t// This is required when updating table with some extrafields. When inserting a record in parent table, we can make\n\t\t\t\t\t\t\t\t// a direct insert into subtable extrafields, but when me wake an update, the insertid is defined and the child record\n\t\t\t\t\t\t\t\t// may already exists. So we rescan the extrafield table to know if record exists or not for the rowid.\n\t\t\t\t\t\t\t\t// Note: For extrafield tablename, we have in importfieldshidden_array an enty 'extra.fk_object'=>'lastrowid-tableparent' so $keyfield is 'fk_object'\n\t\t\t\t\t\t\t\t$sqlSelect = 'SELECT rowid FROM '.$tablename;\n\n\t\t\t\t\t\t\t\tif(empty($keyfield)) $keyfield = 'rowid';\n\t\t\t\t\t\t\t\t$sqlSelect .= ' WHERE '.$keyfield.' = '.$lastinsertid;\n\n\t\t\t\t\t\t\t\t$resql=$this->db->query($sqlSelect);\n\t\t\t\t\t\t\t\tif($resql) {\n\t\t\t\t\t\t\t\t\t$res = $this->db->fetch_object($resql);\n\t\t\t\t\t\t\t\t\tif($resql->num_rows == 1) {\n\t\t\t\t\t\t\t\t\t\t// We have a row referencing this last foreign key, continue with UPDATE.\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t// No record found referencing this last foreign key,\n\t\t\t\t\t\t\t\t\t\t// force $lastinsertid to 0 so we INSERT below.\n\t\t\t\t\t\t\t\t\t\t$lastinsertid = 0;\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//print 'E';\n\t\t\t\t\t\t\t\t\t$this->errors[$error]['lib']=$this->db->lasterror();\n\t\t\t\t\t\t\t\t\t$this->errors[$error]['type']='SQL';\n\t\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tif (!empty($lastinsertid)) {\n\t\t\t\t\t\t\t\t// Build SQL UPDATE request\n\t\t\t\t\t\t\t\t$sqlstart = 'UPDATE '.$tablename;\n\n\t\t\t\t\t\t\t\t$data = array_combine($listfields, $listvalues);\n\t\t\t\t\t\t\t\t$set = array();\n\t\t\t\t\t\t\t\tforeach ($data as $key => $val) {\n\t\t\t\t\t\t\t\t\t$set[] = $key.' = '.$val;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t$sqlstart.= ' SET '.implode(', ', $set);\n\n\t\t\t\t\t\t\t\tif(empty($keyfield)) $keyfield = 'rowid';\n\t\t\t\t\t\t\t\t$sqlend = ' WHERE '.$keyfield.' = '.$lastinsertid;\n\n\t\t\t\t\t\t\t\t$sql = $sqlstart.$sqlend;\n\n\t\t\t\t\t\t\t\t// Run update request\n\t\t\t\t\t\t\t\t$resql=$this->db->query($sql);\n\t\t\t\t\t\t\t\tif($resql) {\n\t\t\t\t\t\t\t\t\t// No error, update has been done. $this->db->db->affected_rows can be 0 if data hasn't changed\n\t\t\t\t\t\t\t\t\t$updatedone = true;\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//print 'E';\n\t\t\t\t\t\t\t\t\t$this->errors[$error]['lib']=$this->db->lasterror();\n\t\t\t\t\t\t\t\t\t$this->errors[$error]['type']='SQL';\n\t\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Update not done, we do insert\n\t\t\t\t\t\tif (!$error && !$updatedone) {\n\t\t\t\t\t\t\t// Build SQL INSERT request\n\t\t\t\t\t\t\t$sqlstart = 'INSERT INTO '.$tablename.'('.implode(', ', $listfields).', import_key';\n\t\t\t\t\t\t\t$sqlend = ') VALUES('.implode(', ', $listvalues).\", '\".$importid.\"'\";\n\t\t\t\t\t\t\tif (! empty($tablewithentity_cache[$tablename])) {\n\t\t\t\t\t\t\t\t$sqlstart.= ', entity';\n\t\t\t\t\t\t\t\t$sqlend.= ', '.$conf->entity;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tif (! empty($objimport->array_import_tables_creator[0][$alias])) {\n\t\t\t\t\t\t\t\t$sqlstart.= ', '.$objimport->array_import_tables_creator[0][$alias];\n\t\t\t\t\t\t\t\t$sqlend.=', '.$user->id;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t$sql = $sqlstart.$sqlend.')';\n\t\t\t\t\t\t\tdol_syslog(\"import_csv.modules\", LOG_DEBUG);\n\n\t\t\t\t\t\t\t// Run insert request\n\t\t\t\t\t\t\tif ($sql)\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t$resql=$this->db->query($sql);\n\t\t\t\t\t\t\t\tif ($resql)\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t $last_insert_id_array[$tablename] = $this->db->last_insert_id($tablename); // store the last inserted auto_increment id for each table, so that child tables can be inserted with the appropriate id. This must be done just after the INSERT request, else we risk losing the id (because another sql query will be issued somewhere in ERP).\n\t\t\t\t\t\t\t\t $insertdone = true;\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//print 'E';\n\t\t\t\t\t\t\t\t\t$this->errors[$error]['lib']=$this->db->lasterror();\n\t\t\t\t\t\t\t\t\t$this->errors[$error]['type']='SQL';\n\t\t\t\t\t\t\t\t\t$error++;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t/*else\n\t\t\t\t\t{\n\t\t\t\t\t\tdol_print_error('','ErrorFieldListEmptyFor '.$alias.\"/\".$tablename);\n\t\t\t\t\t}*/\n\t\t\t\t}\n\n\t\t\t if ($error) break;\n\t\t\t}\n\n\t\t\tif($updatedone) $this->nbupdate++;\n\t\t\tif($insertdone) $this->nbinsert++;\n\t\t}\n\n\t\treturn 1;\n\t}",
"function DoInsertRecordSQLOnAdd( &$pageObject )\n{\n\t$table = $pageObject->pSet->getOriginalTableName();\n\t$avalues = $pageObject->getNewRecordData();\n\t$blobfields = $pageObject->getBlobFields();\n\t\n\t//\tmake SQL string\n\t$strSQL = \"insert into \".$pageObject->connection->addTableWrappers($table).\" \";\n\t\n\t$strFields=\"(\";\n\t$strValues=\"(\";\n\t$blobs = PrepareBlobs( $avalues, $blobfields, $pageObject );\n\t\n\tforeach($avalues as $akey => $value)\n\t{\n\t\t$strFields.= $pageObject->getTableField($akey).\", \";\n\t\t\n\t\tif( in_array($akey, $blobfields) )\t\t\t\n\t\t\t$strValues.= $value.\", \";\n\t\telse\n\t\t{\n\t\t\tif( is_null( $pageObject->cipherer ) )\n\t\t\t\t$strValues.= add_db_quotes($akey, $value).\", \";\n\t\t\telse \n\t\t\t\t$strValues.= $pageObject->cipherer->AddDBQuotes($akey, $value).\", \";\n\t\t}\n\t}\n\t\n\tif( substr($strFields, -2) == \", \")\n\t\t$strFields = substr($strFields, 0, strlen($strFields) - 2);\n\t\t\n\tif( substr($strValues, -2) == \", \")\n\t\t$strValues = substr($strValues, 0, strlen($strValues) - 2);\n\t\n\t$strSQL.= $strFields.\") values \".$strValues.\")\";\n\t\n\tif( !ExecuteUpdate($pageObject, $strSQL, $blobs) )\n\t\treturn false;\n\n\treturn true;\n}",
"public static function insert($table, $data) {\n// $data = add_magic_quotes($data);\n $fields = array_keys($data);\n self::query(\"INSERT INTO \".iPHP_DB_PREFIX_TAG.\"{$table} (`\" . implode('`,`',$fields) . \"`) VALUES ('\".implode(\"','\",$data).\"')\");\n return self::$insert_id;\n }",
"public static function sqlInsert($table_id, $fields, $values) {\n\t\treturn 'INSERT INTO ' . $table_id . '(' . implode(', ', $fields) . ') VALUES (' . implode(', ', array_map(array('Zend_Gdata_Fusion_Utils', 'escape_value'), $values)) . ');';\n\t}",
"function db_insert($table, $data = array()){\n global $conn;\n $field = \"\";\n $value = \"\";\n foreach($data as $key => $var){\n $field .= $key.',';\n $value .= \"'\". mysqli_escape_string($conn, $var).\"'\".\",\";\n }\n $sql = 'INSERT INTO `'.$table.'` ('.trim($field,',').') VALUES('. trim($value, ',').')';\n return mysqli_query($conn, $sql);\n}",
"function array_to_insert_clause($a_vars) {\n\tif (count($a_vars) == 0)\n\t\t\treturn \"\";\n\t$a_keys = array();\n\tforeach($a_vars as $k=>$v)\n\t\t\t$a_keys[] = $k;\n\treturn \"(`\".implode(\"`,`\",$a_keys).\"`) VALUES ('[\".implode(\"]','[\",$a_keys).\"]')\";\n}",
"function generate_insert_query($matches_array) {\n global $person_id;\n $query = \"INSERT INTO `snelkoppeling`.`matches` (`id` ,`A` ,`B` ,`match`) VALUES\";\n\n for($i = 0; $i < count($matches_array); $i++) {\n $query .= \"(NULL, '{$person_id}', '{$matches_array[$i][0]}', '{$matches_array[$i][1]}'),\";\n }\n return mb_substr($query, 0, -1);\n }",
"private function quote( )\n {\n if ( @ count( $this->data_buffer ) == 0 )\n return;\n foreach ( $this->data_buffer as $key => $val )\n {\n if ( in_array( $key, $this->string_fields ))\n $this->data_buffer[$key] = @\"'\".mysql_real_escape_string($val,underQL::$db_handle).\"'\";\n else\n $this->data_buffer[$key] = $val;\n }\n }",
"function insert($rowindex) {\r\n $tf = array();\r\n $tv = array();\r\n #~ $value = '';\r\n $um = NULL;\r\n foreach ($this->properties as $colvar=>$col) {\r\n if ($col->colname == '') continue; # a virtual field, usually used for display purpose\r\n $value = $this->ds->{$colvar}[$rowindex];\r\n if ($col->on_insert_callback != '')\r\n $value = eval($col->on_insert_callback);\r\n if ($col->inputtype == 'file' and $col->datatype == 'int') {\r\n if (!$um) $um = instantiate_module('upload_manager');\r\n $value = $um->put_file($colvar, $rowindex, $this->module);\r\n }\r\n\r\n $tf[] = '`'.$col->colname.'`';\r\n if ($value == 'Now()') {\r\n $tv[] = myaddslashes($value);\r\n }\r\n else {\r\n $tv[] = \"'\".myaddslashes($value).\"'\";\r\n }\r\n }\r\n $sql_fields = join(',',$tf);\r\n $sql_values = join(',',$tv);\r\n $sql = 'insert into `'.$this->db_table.'` ('.$sql_fields.') values ('.$sql_values.')';\r\n #~ echo $sql;exit();\r\n $res = mysql_query($sql) or die('<br>'.$sql.'<br>'.mysql_error()); #do to database\r\n $ret = mysql_insert_id(); # new!\r\n return $ret;\r\n }",
"public abstract function getInsertSQL($into, $data, $values);",
"function insertMultiples ($table, $cols, $arr, $delayed = '') {\r\n /**\r\n * preprocess $arr\r\n */\r\n foreach ($arr as &$item) {\r\n if (is_array($item) === TRUE) { // support array\r\n foreach ($item as &$t) {\r\n if ($t === NULL) { // support NULL value\r\n $t = NULL;\r\n } else {\r\n $t = \"'\" . $t . \"'\";\r\n }\r\n }\r\n unset($t);\r\n $item = implode(',', $item);\r\n }\r\n }\r\n unset($item);\r\n $cols = implode(\", \", $cols);\r\n $values = '(' . implode(\"), (\", $arr) . ')';\r\n $sql = \"insert \" . $delayed . \" into $table($cols) values $values\";\r\n if ($this->isGenerateSql === TRUE) {\r\n echo $sql . '<br/><br/>';\r\n }\r\n if ($this->dbReturnSql === TRUE) {\r\n return $sql;\r\n }\r\n $this->query($sql);\r\n return $this->lastInsertId($table, TRUE);\r\n }",
"private function insertDb($tableName, $tuple, $filter, $isRefTable){\n\n\t\t\tif(!empty($tuple)){\n\n\t\t\t\t$valueString;\n\t\t\t\t$attributeString;\n\n\t\t\t\t$filterCount=count($filter);\n\n\t \t\t//build INSERT and WHERE clause\n\t \t\t// loop through tuple \n\t \t\tforeach($tuple as $attribute=>$data){\n\n\t \t\t\t// reset the flag\n\t \t\t\t$isFilterAttribute = FALSE;\n\n\t \t\t\t//loop tuple element through filters array\n\t \t\t\t// if tuple key a.k.a. attribute is a filter, set the flag.\n\t \t\t\tfor($i=0;$i<$filterCount; $i++){\n\t \t\t\t\tif($filter[$i]==$attribute){\n\t \t\t\t\t\t$isFilterAttribute = TRUE;\n\t \t\t\t\t}\n\t \t\t\t}\n\n\t \t\t\t// if flag is not set, fix-up the element and\n\t \t\t\t// add it to $where string\n\t \t\t\tif($isFilterAttribute!=TRUE){\n\n\t \t\t\t\t$attributeString.= $attribute. ', ';\n\n\t\t\t\t\t\tif($data != NULL ){\n\t\t\t\t $valueString .= '\\''.mb_convert_encoding($data, \"HTML-ENTITIES\", \"UTF-8\"). '\\', ';\n\t\t\t\t }\n\t\t\t\t else if($data == NULL) {\n\t\t\t\t \t$valueString .= 'NULL, ';\n\t\t\t\t }\n\t \t\t\t}\n\t \t\t}\n\n\t \t\t// trim the last ', ' \n \t\t\t$valueString = substr($valueString, 0, -2);\n \t\t\t$attributeString = substr($attributeString, 0, -2);\n\n\n \t\t\tif(!$isRefTable){\n\n\t\t \t\t$query = 'INSERT INTO ' .$tableName. ' ( '.$this->PKattributes[$tableName]. ', ' .$attributeString. ')\n\t\t \t\t\t\t VALUES ( NULL, '.$valueString.' )';\n\t\t \t\t\t\t echo \"not query \" .$query. \"<br><br><br>\";\n\n\t\t\t\t}else {\n\n\t\t\t\t\t$query = 'INSERT INTO ' .$tableName. ' ( ' .$attributeString. ')\n\t\t \t\t\t\t VALUES ( '.$valueString.' )';\n\n\t\t \t\t\t\t echo $query. \"<br><br><br>\";\n\n\t\t\t\t}\n\t\t\t\t// insert() returns the PK of the last inserted object.\n\t\t\t\t$id = insert($query);\n\n\t\t\t\treturn $id;\n\t\t\t} \n\t\t}",
"function insere_db($campos,$valores,$tabela) {\n\t$inicio=\"INSERT INTO $tabela(\";\n\t$meio=\") VALUES (\";\n\t$fim=\")\";\n\t$valor = sizeof($campos);\n\t$strc=\"\";\n\tfor($i=0;$i <= ($valor-1);$i++){\n\t\t$strc.=\"$campos[$i]\";\n\t\tif($i != ($valor-1)){\n\t\t $strc.=\",\";\n\t\t}\n\t }\n\t$strv=\"\";\n\tfor($k=0;$k <= ($valor-1);$k++){\n\t\t$strv.=\"\\\"$valores[$k]\\\"\";\n\t\tif($k != ($valor-1)){\n\t\t $strv.=\",\";\n\t\t}\n\t }\n\t$insere=\"$inicio$strc$meio$strv$fim\";\n\t//echo $insere;\n\t$foi = consulta_db($insere);\n\treturn $foi;\n}",
"public function insertFormat(): string\n {\n throw new \\RuntimeException(__CLASS__ . ' does not support data insert');\n }"
]
| [
"0.67727214",
"0.6455783",
"0.64232427",
"0.62759495",
"0.62687874",
"0.6187857",
"0.6158087",
"0.6123919",
"0.60920525",
"0.6054932",
"0.60216385",
"0.59857553",
"0.5966598",
"0.59391123",
"0.59107584",
"0.59096766",
"0.5884136",
"0.58570486",
"0.5847232",
"0.58350754",
"0.58348775",
"0.5816312",
"0.5805892",
"0.58045393",
"0.58044934",
"0.57978904",
"0.57856476",
"0.57619953",
"0.57595974",
"0.5758846",
"0.5758353",
"0.57582444",
"0.57498854",
"0.5741951",
"0.57391936",
"0.5707082",
"0.5677791",
"0.5672023",
"0.5670108",
"0.56653595",
"0.5652298",
"0.5649472",
"0.5637327",
"0.56324536",
"0.56057525",
"0.55982625",
"0.5596535",
"0.55901754",
"0.5583942",
"0.5574115",
"0.55734664",
"0.5571548",
"0.55651444",
"0.5559436",
"0.5558021",
"0.5549324",
"0.5523085",
"0.55093086",
"0.5509075",
"0.5479607",
"0.5467919",
"0.545638",
"0.54560006",
"0.54554945",
"0.545186",
"0.5442933",
"0.5442273",
"0.54420435",
"0.54359597",
"0.5432348",
"0.54287565",
"0.54243535",
"0.5423181",
"0.5422646",
"0.542142",
"0.54163057",
"0.54130805",
"0.54127204",
"0.5412275",
"0.54074186",
"0.54018104",
"0.5392388",
"0.53913915",
"0.5388641",
"0.538403",
"0.5364256",
"0.5349637",
"0.53491884",
"0.5346412",
"0.5345958",
"0.5345571",
"0.53449535",
"0.5340268",
"0.533949",
"0.53393215",
"0.5338953",
"0.533891",
"0.5338198",
"0.5335497",
"0.5326501"
]
| 0.7179409 | 0 |
Function to construct DELETE statement. | function gw_sql_delete($table, $ar_where)
{
$ar_w = array();
for (reset($ar_where); list($k, $v) = each($ar_where);)
{
if ($k)
{
$ar_w[] = '`'.$k.'` = "'.$v.'"';
}
else
{
$ar_w[] = $v;
}
}
$where = implode(' AND ', $ar_w);
$query = 'DELETE FROM `'.$table.'` WHERE '.$where;
return $query;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract function getDeleteStatement();",
"protected function _sql_delete ( /* void */ )\n {\n /*\n Start SQL query.\n */\n $sql = 'DELETE FROM ';\n /*\n Which table ?\n */\n $sql .= $this->aTables[0];\n /*\n Where ?\n */\n if (!empty($this->aWhere))\n {\n $sql .= \"\\nWHERE \" . implode(\"\\n\", $this->aWhere);\n $sql .= (!empty($this->aLike)) ? implode(\"\\n\", $this->aLike) : '';\n }\n elseif (!empty($this->aLike))\n {\n $sql .= \"\\nWHERE \" . implode(\"\\n\", $this->aLike);\n }\n /*\n Return SQL.\n */\n return $sql;\n }",
"public function sql_for_delete() {\n\t\t// Check if model is writable\n\t\t$this->assertModelIsWritable();\n\n\t\t// Destination model\n\t\t$model = $this->model;\n\n\t\t// Cascade deletion calculation for model $model\n\t\tforeach ($model::metaGetRelationships() as $relationshipName => $relationship) {\n\t\t\t// Nexii tuples and children tuple deletion\n\t\t\tif (\n\t\t\t\t($relationship[\"type\"] == \"OneToMany\" or $relationship[\"type\"] == \"ManyToMany\") and\n\t\t\t\tisset($relationship[\"on_master_deletion\"]) and\n\t\t\t\t$relationship[\"on_master_deletion\"] == \"delete\"\n\t\t\t) {\n\t\t\t\t$this->addRelatedModel($relationshipName);\n\t\t\t}\n\t\t}\n\n\t\t// SQL code generation\n\t\t$sqlT = \\lulo\\twig\\TwigTemplate::factoryHtmlResource(\\lulo\\query\\Query::PATH . \"/delete/query.twig.sql\");\n\t\t$sql = $sqlT->render([\"query\" => $this]);\n\n\t\t// Return DELETE statement SQL code\n\t\treturn $sql;\n\t}",
"public function deleteStatement()\n {\n }",
"private function getSQLForDelete()\n {\n $table = $this->_sqlParts['from']['table'] . ($this->_sqlParts['from']['alias'] ? ' ' . $this->_sqlParts['from']['alias'] : '');\n $query = 'DELETE FROM ' . $table . ($this->_sqlParts['where'] !== null ? ' WHERE ' . ((string) $this->_sqlParts['where']) : '');\n\n $query = ($this->_maxResults === null && $this->_firstResult == null)\n ? $query\n : $this->_connection->getAdapter()->applyLimit($query, $this->_firstResult, $this->_maxResults);\n\n return $query;\n }",
"public function delete($records = '')/*# : DeleteStatementInterface */;",
"public static function buildDeleteStatement($table, $where)\n{\n\t// Form statement\n\t$stmt = 'DELETE FROM ' . $table . self::buildWhereClause($where);\n\n\t// Return statement\n\treturn $stmt;\n}",
"function getDeleteSql()\n {\n $str = \"DELETE FROM \";\n if (isset($this->schema))\n $str = $str . $this->schema . \".\";\n\n $str = $str . $this->tblName . \" WHERE \" . $this->getWhereCondition($this->tblIndex);\n return $str;\n }",
"public function delete()\r\n {\r\n $this->sql = 'DELETE FROM ' . $this->table .' '.$this->alias. ' '. $this->sql;\r\n $query = R::exec($this->sql, $this->params);\r\n $this->sql = null;\r\n $this->params = [];\r\n return $query;\r\n }",
"function delete($table, $clause) {\t\t\r\n\t\treturn $this->query(\"delete from $table where $clause\");\r\n\t}",
"function delete($table, array $conditions);",
"private function formatDeleteCommand( $where = null )\n {\n $sql = 'DELETE FROM ' . $this->table_name;\n\n if ( $where != null )\n $sql .= ' WHERE ' . $where;\n\n return $sql;\n }",
"function delete($spec) {\n\t\tif(isset($spec['join'])){\n\t\t\t$spec['where'] = array(\"{$spec['select'][0]} IN ({$this->select($spec)})\");\n\t\t\t$spec['join'] = null;\n\t\t}\n\t\t$spec['select'] = $spec['order_by'] = $spec['offset'] = null; // irrelevant fields\n\t\treturn $this->quoteIdentifiers($this->aliasFields(\"DELETE \" . $this->compile($spec), false));\n\t}",
"function getDeleteStatement($model,&$args);",
"function generateDeleteSQL(&$Screen, $format = 'var')\n {\n global $SQLBaseModuleID;\n $SQLBaseModuleID = $this->ModuleID;\n \n //some sanity checking for the format parameter\n if ($format != 'var' && $format != 'replace'){\n if (empty($format)) {\n $format = 'var';\n } else {\n die(\"ERROR: Parameter \\$format in function generateDeleteSQL expects either 'var' or 'replace'.\\n\");\n }\n }\n\n //check for one or more PK's\n if (count($this->PKFields) > 1){\n if('var' == $format){\n //note: I'm not sure if this is useful - will\n //probably redo this case\n\n //if more than one PK field, append # to $recordID\n foreach($this->PKFields as $key=>$PKField){\n $Conditions[] = $PKField.\"=\\$recordID$key\";\n }\n } else {\n //note: it is assumed that the first PK field\n //is the same as the parent row ID\n //and the second is the current module rowID\n $Conditions[] = $this->PKFields[0].\"=/**PR-ID**/\";\n $Conditions[] = $this->PKFields[1].\"=/**RecordID**/\";\n }\n } else {\n if('var' == $format){\n $Conditions[] = $this->PKFields[0].\"=\\$recordID\";\n } else {\n $Conditions[] = $this->PKFields[0].\"=/**RecordID**/\";\n }\n }\n\n $tableName = $this->ModuleID;\n\n //format SQL Statement (we use Update because we simply set _Deleted to true)\n $SQL = \"UPDATE `$tableName`\\n SET\\n \";\n $SQL .= \"_Deleted = 1,\\n\";\n if('var' == $format){\n $SQL .= \"_ModBy = \\\".\\$User->PersonID.\\\",\\n\";\n $SQL .= \"_ModDate = NOW()\\n\";\n } else {\n $SQL .= \"_ModBy = [**UserID**],\\n\";\n $SQL .= \"_ModDate = NOW()\\n\";\n }\n\n $SQL .= \"\\nWHERE\\n \";\n\n //add row identifying conditions\n $SQL .= implode(\"\\n AND \", $Conditions);\n\n $SQL .= \"\"; //NO ENDING NEWLINE - that will cause error messages...\n\n return $SQL;\n }",
"function dbDelete($table, $where = null, $insertId = false){\n //$table = DB_PREFIX.'_'.$table; //para pegar o prefixo da tabela caso use\n $where = ($where) ? \" WHERE {$where}\" : null;\n $query = \"DELETE FROM {$table}{$where}\";\n return qExecute($query, $insertId);\n }",
"public function delete() \n {\n $this->_data['query'] = 'DELETE';\n $this->_data['from'] = ' FROM '.$this->_data['from'];\n $this->_data['query'] .= $this->_data['from'];\n if (func_num_args() > 0) {\n $this->where(func_get_args());\n }\n return $this;\n }",
"public function deleteSql(){\n\n $sql = \"DELETE FROM {$this->table} WHERE id = {$this->updateId}\";\n \n return $sql;\n }",
"protected function getDelete()\n {\n $query = 'DELETE FROM ' . $this->getElement('from') . PHP_EOL;\n $query .= $this->getElement('where');\n\n return $query;\n }",
"public function delete(?string $template = null): Query\n {\n if ($this->queryType !== self::DELETE) {\n $this->resetStatement();\n $this->queryType = self::DELETE;\n }\n return $this->template($template ?? 'DELETE FROM {{table}} {{where}}');\n }",
"public function get_delete()\n {\n $del = $this->alias;\n $from = $this->get_from();\n $join = $this->get_join();\n $where = $this->get_where();\n $order = $this->get_order();\n $group = $this->get_group();\n $limit = $this->get_limit();\n return \"delete $del $from $join $where $group $order $limit\";\n }",
"public function deleteQuery(): string\n {\n return 'DELETE FROM products WHERE id = :id';\n }",
"public function deleteQuestion()\r\n {\r\n $query_string = \"DELETE FROM questions \";\r\n $query_string .= \"WHERE questionid= :questionid\";\r\n\r\n return $query_string;\r\n}",
"static public function BuildSQLDelete( $tableName, $whereArray = NULL, $customWhereArray = array() )\r\n\t{\r\n\t\t$sql = \"DELETE FROM `\" . $tableName . \"`\";\r\n\t\tif( !is_null( $whereArray ) || is_array( $customWhereArray ) )\r\n\t\t{\r\n\t\t\tif( is_array( $customWhereArray ) )\r\n\t\t\t{\r\n\t\t\t\t$sql .= self::BuildSQLWhereClause( $whereArray, $customWhereArray );\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$sql .= self::BuildSQLWhereClause( $whereArray );\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn $sql;\r\n\t}",
"protected function platformDeleteStatement($table)\n {\n return 'DELETE FROM ' . $table\n . $this->compileWhereHavingStatement('where')\n . $this->compileLimitStatement();\n }",
"public function buildDeleteQuery($table, $whereKey, $whereValue)\n {\n return 'delete:' . $table . ':' . $whereKey . ':' . $whereValue;\n }",
"function _delete ($table_name) {\n\t\treturn \"DELETE FROM `{$table_name}`\";\n\t}",
"private function constructDeleteQuery($conds = null, $limit = null)\n {\n $conds = isset($conds) ? $conds : $this->conds;\n $limit = isset($limit) ? $limit : $this->limit;\n\n if (empty($conds)) {\n $this->setError(-1, 'constructDeleteQuery() requires conditions');\n return false;\n }\n\n $condString = '';\n $limitString = '';\n $tablesUsed = array();\n if (!empty($conds)) {\n $condString = ' WHERE ' . $this->constructCondStringStatic($tablesUsed, $conds);\n }\n\n // SQL delete only has LIMIT x rather than LIMIT y,x\n if (!empty($limit)) {\n if ($limit['start'] != 0) {\n $this->setError(-1, 'constructDeleteQuery() can only take 0-index limit starts');\n return false;\n }\n $limitString = ' LIMIT ' . $limit['limit'];\n }\n\n return \"DELETE FROM \" . $this->tableName . \"{$condString}{$limitString}\";\n }",
"public function delete($table, array $where);",
"public abstract function getDeleteSQL($from, $joins, $where, $values, $order, $limit);",
"function generateDeleteQuery($tableName,$column,$value)\n{\n $len = strlen($value);\n if( $len <= 1 || $value[0] != \"'\" || $value[$len-1] != \"'\" )\n\treturn \"DELETE FROM $tableName WHERE $column='$value'\";\n else\n\treturn \"DELETE FROM $tableName WHERE $column=$value\";\n}",
"abstract protected function platformDeleteStatement($table);",
"protected function _delete($table)\n\t{\n\t\treturn 'DELETE FROM '.$table.$this->_compile_wh('qb_where')\n\t\t\t.($this->qb_limit ? ' LIMIT '.$this->qb_limit : '');\n\t}",
"public function deleteQuestions()\r\n{\r\n $query_string = \"DELETE FROM questions \";\r\n $query_string .= \"WHERE quizid = :quizid\";\r\n\r\n return $query_string;\r\n}",
"public function DELETEquery($table, $where)\n {\n if (is_string($where)) {\n // Table and fieldnames should be \"SQL-injection-safe\" when supplied to this function\n $query = 'DELETE FROM ' . $table . ((string) $where !== '' ? ' WHERE ' . $where : '');\n if ($this->debugOutput || $this->store_lastBuiltQuery) {\n $this->debug_lastBuiltQuery = $query;\n }\n return $query;\n } else {\n throw new \\InvalidArgumentException('TYPO3 Fatal Error: \"Where\" clause argument for DELETE query was not a string in $this->DELETEquery() !', 1270853881);\n }\n }",
"public function buildDeleteSql() {\r\n $this->sql .= ' FROM ' . $this->sqlStrTables;\r\n $this->setConditions();\r\n $this->setLimit();\r\n }",
"function delete($table, $conditionNames, $conditionValues) {\n /**Kontrola stringu */\n if(!is_string($table)) {\n throw new Exception(\"Tabulka musí být string.\");\n }\n /**Kontorla poli */\n else if(!is_array($conditionNames) || !is_array($conditionValues)) {\n throw new Exception(\"Hodnota musí být pole.\");\n }\n\n /**Pripojeni k databazi */\n $connect = NULL;\n try {\n $connect = require(\"connect.php\");\n }catch(Exception $e) {\n throw $e;\n }\n\n /**Obrana proti sql utokum */\n $conditionNames = implode('=? AND ', $conditionNames);\n $conditionNames .='=?';\n\n /**Formatovnai metody */\n $statement = $connect->prepare('DELETE FROM ' .$table. ' WHERE ' .$conditionNames );\n \n if(!$statement->execute($conditionValues)){\n throw new Exception(\"Chyba při DELETE dotazu\");\n }\n\n}",
"public function deleteRecord ($sqlString);",
"protected function RetDelete() {\n\n if (!isset($this->\n tables[0])) {\n\n throw new \\Exception(\"Error: Table not properly provided in QueryHelper.\");\n }\n\n $return = \"DELETE FROM `{$this->\n tables[0]}`\";\n\n if (count($this->\n where)) {\n\n $return .= $this->\n WhereClause($this->\n where);\n }\n\n return $return . \";\";\n }",
"function dbRowDelete($table_name, $where_clause='')\n{\n // check for optional where clause\n $whereSQL = '';\n if(!empty($where_clause))\n {\n // check to see if the 'where' keyword exists\n if(substr(strtoupper(trim($where_clause)), 0, 5) != 'WHERE')\n {\n // not found, add keyword\n $whereSQL = \" WHERE \".$where_clause;\n } else\n {\n $whereSQL = \" \".trim($where_clause);\n }\n }\n // build the query\n $sql = \"DELETE FROM \".$table_name.$whereSQL;\n\n // run and return the query result resource\n $q = $this->conn->prepare($sql);\n \n return $q->execute() or die(print_r($q->errorInfo()));\n}",
"public function createDeleteMethodDeclaration($arg1) \n\t{\n\t\t$str = \"\";\n\t\t$str .= \"public function delete()\\n{\\r\";\n\t\t$str .= \"\\t\\$where = '';\\n\";\n\t\t$str .= \"\\tif(isset(\\$this->where)) {\\n\";\n\t\t$str .= \"\\t\\t\\$where = ''. \\$this->where.'';\\n\";\n\t\t$str .= \"\\t} else { \\n\";\n\t\t$str .= \"\\t\\t\\$where = '';\\n\";\n\t\t$str .=\"\\t}\\n\";\n\t\t$str .= \"\\t\\$sql= \\\"\".$arg1.\"\\\" .\\$where.\\\"\\\";\\n\";\n\t\t$str .= \"\\t\\$q = \\$this->conn->prepare(\\$sql);\\n\";\n\t\t$str .= \"\\t\\$q->execute();\\n\";\n\t\t$str .= \"\\treturn true;\";\n\t\t$str .= \"\\n}\\n\\n\\r\";\n\t\treturn $str;\n\t}",
"public function deletePost()\r\n{\r\n $query_string = \"DELETE FROM posts \";\r\n $query_string .= \"WHERE postid= :postid\";\r\n\r\n return $query_string;\r\n}",
"public function compileDeleteWithoutJoins(Builder $builder, $table, $where): string\n {\n return \"delete from {$table} {$where}\";\n }",
"public function deleteCategory()\r\n{\r\n $query_string = \"DELETE FROM categories \";\r\n $query_string .= \"WHERE categoryid= :categoryid\";\r\n\r\n return $query_string;\r\n}",
"public function testDeleteStmt()\n {\n $delete = $this->getConnection()\n ->delete()\n ('dummy_posts')\n ('blog_id = :id');\n return $this->assertEquals($delete, \"DELETE FROM dummy_posts WHERE blog_id = :id\");\n }",
"public function queryDelete($table, $where) : int;",
"public function testWriteDeleteQuery()\n\t{\n\t\t$queryWriter = R::getWriter();\n\t\tasrt( ( $queryWriter instanceof SQLiteT ), TRUE );\n\t\tR::nuke();\n\t\t$bean = R::dispense( 'bean' );\n\t\t$bean->name = 'a';\n\t\t$id = R::store( $bean );\n\t\tasrt( R::count( 'bean' ), 1 );\n\t\t$queryWriter->deleteRecord( 'bean', array(), $addSql = ' id = :id ', $bindings = array( ':id' => $id ) );\n\t\tasrt( R::count( 'bean' ), 0 );\n\t}",
"public function deleteDefinition()\r\n{\r\n $query_string = \"DELETE FROM glossary \";\r\n $query_string .= \"WHERE wordid = :wordid \";\r\n\r\n return $query_string;\r\n}",
"function delete_by( $conds = array() )\n\t{\n\t\t// where clause\n\t\t$this->custom_conds( $conds );\n\t\t// delete the record\n\t return $this->db->delete( $this->table_name );\n\t //print_r($this->db->last_query());die;\n\t \n \t}",
"function test_delete($urabe, $body)\n{\n if ($body->driver == \"PG\")\n $table_name = $body->schema . \".\" . $body->table_name;\n else\n $table_name = $body->table_name;\n $column_name = $body->column_name;\n $column_value = $body->column_value;\n return $urabe->delete($table_name, \"$column_name = $column_value\");\n}",
"private function _generateDelete($className) {\n\t\t$className = ucfirst(strtolower($className));\n\t\t$this->_data.=\"\\tpublic static function delete(\\$$this->primary_key) {\\n\";\n\t\t$this->_data.=\"\\t\\t$\".$className.\"Entity = new \".$className.\"Entity();\\n\";\n\t\t$this->_data.=\"\\t\\treturn $\".$className.\"Entity->delete('$this->primary_key = '.\\$$this->primary_key);\\n\";\n\t\t$this->_data.=\"\\t}\\n\";\n\t}",
"public function get_compiled_delete($reset = TRUE)\n {\n $sql = 'DELETE FROM '.$this->table_prefix($this->_table);\n\n if ( ! empty($this->_where))\n {\n // Add deletion conditions\n $sql .= ' WHERE '.$this->_compile_conditions($this->_where);\n }\n\n if ( ! empty($this->_order_by))\n {\n // Add sorting\n $sql .= ' '.$this->_compile_order_by($this->_order_by);\n }\n\n if ($this->_limit !== null)\n {\n // Add limiting\n $sql .= ' LIMIT '.$this->_limit;\n }\n\n return $sql;\n }",
"function sqlDeleteTeacher()\n\t{\n\t\t$sql = \"\n\t\tDELETE FROM tbl_teacher\n\t\tWHERE teacher_id = :teacher_id\n\t\t\";\n\n\t\treturn $sql;\n\t}",
"public function delete($table, array $where = null);",
"function delete($tab, $cond)\n{\n\t$args = (func_num_args() > 2)? array_slice(func_get_args(),2) : null;\n\t$where = $this->getWhereSql($cond, $args);\n\n\t$sql = \"DELETE FROM $tab WHERE $where\";\n\t$res = $this->query($sql);\n\treturn $res;\n}",
"public function delete()\n {\n $class = strtolower(get_called_class());\n $table = self::$_table_name != null ? self::$_table_name : $class . 's';\n\n $pdo = PDOS::getInstance();\n\n $whereClause = '';\n foreach (static::$_primary_keys as $pk)\n $whereClause .= $pk . ' = :' . $pk . ' AND ';\n $whereClause = substr($whereClause, 0, -4);\n $sql = 'DELETE FROM ' . $table . ' WHERE ' . $whereClause;\n $query = $pdo->prepare($sql);\n $attributes = $this->getAttributes(new \\ReflectionClass($this));\n foreach ($attributes as $k => $v)\n {\n if (in_array($k, static::$_primary_keys))\n $query->bindValue(':' . $k, $v);\n }\n $query->execute();\n }",
"function delete($tabla,$campo,$criterio){\n\treturn $GLOBALS['cn']->query('DELETE FROM '.$tabla.' WHERE '.$campo.'=\"'.$criterio.'\"');\n}",
"function delete($tabla,$campo,$criterio){\n\treturn $GLOBALS['cn']->query('DELETE FROM '.$tabla.' WHERE '.$campo.'=\"'.$criterio.'\"');\n}",
"public function deletePosts()\r\n{\r\n $query_string = \"DELETE FROM posts \";\r\n $query_string .= \"WHERE postcategory= :postcategory\";\r\n\r\n return $query_string;\r\n}",
"function delete($table='', ...$wherekeys) { \n if ( empty($table) ) {\n\t\t\t$this->setParamaters();\n return false; \t\t\t\n\t\t} \n\t\t\n $sql=\"DELETE FROM $table\";\n \n $where = $this->where(...$wherekeys);\n if (is_string($where)) { \n $sql .= $where;\t\t\t\t\t\t\n return (($this->getPrepare()) && !empty($this->getParamaters())) ? $this->query($sql, true) : $this->query($sql) ; \n } else {\n\t\t\t$this->setParamaters();\n return false; \t\t\t\n\t\t} \n }",
"public function delete($table, $conditions, $bind = []);",
"public function deleteBySql($table, $sql, $bind = []);",
"public static function delete($options = array()) {\n if (empty($options['table'])) {\n $options['table'] = static::$tableName; \n }\n $sql = new Sql(static::getDb()); \n// $where = array();\n// foreach (static::$properties as $property) { \n// if (isset($options['where'][$property])) { \n// $where[$property] = $options['where'][$property];\n// }\n// }\n $where = $options['where'];\n if (empty($where)) {\n static::errorParamInvalid();\n return false;\n } \n $delete = $sql->delete()\n ->from($options['table']) \n ->where($where);\n $deleteString = $sql->getSqlStringForSqlObject($delete);\n Log::info('Delete SQL', $deleteString);\n if (static::getDb()->query($deleteString, Adapter::QUERY_MODE_EXECUTE)) {\n return true;\n }\n return false;\n }",
"public static function delete($id){\n $conexion = new Conexion();\n $sql = $conexion->prepare('DELETE FROM'. self::TABLA .' WHERE id = :id');\n $sql->bindValue(':id', $id);\n $sql->execute();\n return $sql; \n}",
"public function _delete ($table, $where_params_array = array())\n {\n $query = \"\n DELETE FROM {$table}\n \";\n\n $bind_params_array = array();\n\n // if there are any WHERE parameters then add them to the query and the bind params array\n if ( !empty ($where_params_array) )\n {\n\n $count = 0;\n $query .= \"WHERE\n \";\n foreach ($where_params_array as $key => $value) {\n\n $bind_params_array[$count] = $value;\n\n if ( $count > 0 )\n {\n $query .= \" AND \";\n }\n $query .= \"`{$key}` = ?\n \";\n $count++;\n }\n }\n else\n {\n\n // DELETE all from table has been disabled as a safeguard in case anyone\n // accidentally forgets to pass the second parameter\n //return false;\n }\n\n return $this->queryDatabase ($query, $bind_params_array, false);\n }",
"public function deleteReply()\r\n{\r\n $query_string = \"DELETE FROM replies \";\r\n $query_string .= \"WHERE replyid = :replyid\";\r\n\r\n return $query_string;\r\n}",
"public function del(array $columns, array $clauseProps){\r\n\r\n # wrap the table name with quotes like so: `table`\r\n $table = $this->wrap($this->attribs['table']);\r\n\r\n if(count($columns) == 1 && $columns[0] == '*'){\r\n $_columns = $columns[0];\r\n }else{\r\n $_columns = implode(', ', array_map(array(&$this, 'addTablePrefix'), $columns));\r\n }\r\n\r\n # start building query string -> DELETE\r\n \t $this->queryString .= \"DELETE \" . $columns . \" FROM \" . $table;\r\n\r\n if(count($clauseProps) > 0){\r\n ;\r\n }\r\n\r\n return $this;\r\n }",
"public function compileDelete(Builder $builder): string\n {\n $table = $this->wrapTable($builder->from);\n\n $where = $this->compileWheres($builder);\n\n return trim(\n isset($builder->joins)\n ? $this->compileDeleteWithJoins($builder, $table, $where)\n : $this->compileDeleteWithoutJoins($builder, $table, $where)\n );\n }",
"public function DELETEquery($table, $where) {\n \n $query = parent::DELETEquery($table, $where);\n \n // log query \n $debugQuery = str_replace(chr(9), '', $query); // removes tabs from query for better readability\n trace($debugQuery);\n $this->logQuery($debugQuery); \n \n return $query;\n \n }",
"public function deleteReplies()\r\n{\r\n $query_string = \"DELETE FROM replies \";\r\n $query_string .= \"WHERE replytopic = :replytopic\";\r\n\r\n return $query_string;\r\n}",
"function Delete()\n\t{\n\t\tglobal $dal_info;\n\t\t\n\t\t$deleteFields = \"\";\n\t\t$tableinfo = &$dal_info[ $this->infoKey ];\n\t\t//\tprepare parameters\t\t\n\t\tforeach($tableinfo as $fieldname => $fld)\n\t\t{\n\t\t\tif( isset($this->{$fld['varname']}) )\n\t\t\t{\n\t\t\t\t$this->Param[ $fieldname ] = $this->{$fld['varname']};\n\t\t\t}\n\t\t\t\n\t\t\tforeach($this->Param as $field => $value)\n\t\t\t{\n\t\t\t\tif( strtoupper($field) != strtoupper($fieldname) )\n\t\t\t\t\tcontinue;\n\t\t\t\t\t\n\t\t\t\t$deleteFields.= $this->_connection->addFieldWrappers( $fieldname ).\"=\". $this->PrepareValue($value, $fld[\"type\"]) . \" and \";\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t//\tdo delete\n\t\tif ($deleteFields)\n\t\t{\n\t\t\t$deleteFields = substr($deleteFields, 0, -5);\n\t\t\t$dalSQL = \"delete from \".$this->_connection->addTableWrappers( $this->m_TableName ).\" where \".$deleteFields;\n\t\t\t$this->_connection->exec( $dalSQL );\n\t\t}\n\t\n\t\t//\tcleanup\n\t $this->Reset();\n\t}",
"public function deleteQuiz()\r\n{\r\n $query_string = \"DELETE FROM quizzes \";\r\n $query_string .= \"WHERE quizid = :quizid\";\r\n\r\n return $query_string;\r\n}",
"protected function _delete($table, $where) {\n\t\treturn $this->query('DELETE FROM '.$table.$this->_compile_wh($where));\n\t}",
"public function delete(){\n\t\t$parametro = func_get_args();\t\t\n\t\t$resultado=$this->execSql($this->DELETE,$parametro);\n\t\tif (!$resultado){\n\t\t\t$this->onError(\"COD_DELETE\",$this->DELETE);\n\t\t}\n\t\treturn $resultado;\n\t}",
"protected function getDeleteByIdSQL($table_name) : string\n\t{\n\n\t\treturn \"DELETE FROM {$table_name} WHERE id = :id or parent_id = :id\";\n\n\t}",
"public function delete($arguments = []) {\n $this->dbh->query($this->query_array['delete'], $arguments);\n }",
"public function deleteData($sql, $params=[]){\n $this->create($sql,$params);\n\n }",
"function delete($table, $target);",
"function QueryDelete($table, $where='1') {\r\n $q = 'DELETE FROM `' . $this->pre . $table . '` WHERE ' . $where . ';';\r\n return $this->query($q);\r\n }",
"function sql_delete($table, $options = array()) {\n\t$sql = sql_connect();\n\tif( !$sql ){\n\t\treturn false;\n\t}\n\t$prefix = var_get('sql/prefix', '');\n\n\t$options = array_merge(array(\n\t\t'where' => '',\n\t), $options);\n\n\t$query = 'DELETE FROM ' . sql_quote($prefix . $table, true);\n\t$query .= !$options['where']? '' : ' WHERE ' . sql_logic($options['where']);\n\t\n\tif( isset($options['limit']) ){\n\t\t$query .= ' LIMIT ' . (int)$options['limit'];\n\t}\n\n\tsql_dump($query);\n\n\t$q = $sql->prepare($query . ';');\n\treturn $q->execute();\n}",
"public function delete(array $where);",
"public function delete($table_name, $where = array())\r\n {\r\n }",
"function delete($bd,$where){\nforeach ($where as $key => $value) {\n\t$campo = $key;\n\t$value_campo = $value;\n}\n$sql = \"DELETE FROM \".$bd.\"\nWHERE \".$campo.\" = \".$value_campo.\"\";\n$conexion = new ConexionOther();\n$stmt= $conexion->prepare($sql);\n$dato = $stmt->execute();\n$stmt = null;\nreturn $dato;\n}",
"abstract public function deleteRecord($tableName, $where);",
"public function delete(array $param = array('table'=>'','condition'=>[])) {\n // (REQUIRED) name of table\n $tableName = isset($param['table']) ? $param['table'] : '';\n // (OPTIONAL) multi dimensional array e.g. [['key','operator','value'],['key','operator','value'],...]\n $arrCondition = isset($param['condition']) ? $param['condition'] : [];\n\n if( empty( $tableName ) ) {\n echo \"table name missing\";\n die;\n }\n\n $insert_values = [];\n $strWhere = \"\";\n\n if( count($arrCondition) > 0 ) {\n foreach( $arrCondition as $col ) {\n if( count( $col ) == 2 ) {\n array_push( $insert_values, $col[1] );\n $strWhere .= \"`\" . $col[0] . \"` = ?\";\n } else if( count( $col ) == 3 ) {\n array_push( $insert_values, $col[2] );\n $strWhere .= \"`\" . $col[0] . \"` \" . $col[1] . \" ?\";\n } else {\n // error\n }\n $strWhere .= \" AND \";\n }\n $strWhere = ' WHERE ' . substr($strWhere, 0, -5);\n }\n\n $strQry = \"DELETE FROM `\".$tableName.\"`\" . $strWhere . \";\";\n\n $pdo = $this->getConnection();\n $this->stmt = $pdo->prepare($strQry);\n $executed = $this->stmt->execute($insert_values);\n if( $executed ) {\n $count = $this->stmt->rowCount(); // effected rows if deleted records\n if( $count > 0 ) {\n echo $count . ' record(s) deleted successfully.';\n } else {\n echo 'fails to delete record(s)';\n }\n } else {\n echo 'fails to update record(s)';\n }\n $this->stmt = null;\n }",
"public function delete()\n {\n $this->execute(\n $this->syntax->deleteSyntax(get_object_vars($this))\n );\n }",
"public function delete($table, $condition = '', $params = [])\n {\n $this->db->createCommand()->delete($table, $condition, $params)->execute();\n }",
"function delete($condition = NULL)\n {\n $db_table = $this->model2table();\n $c2 = isset($this->id) ? \" WHERE id=\" . $this->id : \"\";\n $c = isset($condition) ? \"WHERE $condition\" : $c2;\n\n $sql = \"DELETE FROM $db_table $c\";\n\n if (!$this->getDonotLog()) {\n $this->logDeletedData(\"$db_table $c\");\n }\n\n $this->varifysql($sql);\n $stmt = $this->get_conn()\n ->prepare(\"$sql\");\n\n $this->_beforeDelete($this);\n $stmt->execute();\n $this->_afterDelete($this);\n\n return $stmt->rowCount();\n }",
"public function delete() {\n\t\t$dbh = App::getDatabase()->connect();\n\n\t\t$query = \"DELETE FROM \".$this->getTableName();\n\n\t\t$fl = true;\n\t\tforeach($this as $column => $val) {\n\t\t\tif(in_array($column, $this->getPrimaries())) {\n\t\t\t\t$query .= \"\\n\".(($fl) ? \"WHERE\" : \"AND\").\" \".$column.\" = '\".$val.\"'\";\n\t\t\t\t$fl = false;\n\t\t\t}\n\t\t}\n\n\t\t$res = $dbh->exec($query);\n\t\t$dbh = null;\n\t\treturn $res;\n\t}",
"public function delete() :db\n \t{\n \t\t$this->queryType = \"delete\";\n \t\treturn $this;\n \t}",
"public function delete($table, $where, $where_format = \\null)\n {\n }",
"function sqlDeleteGrade()\n\t{\n\t\t$sql = \"\n\t\tDELETE FROM tbl_grade\n\t\tWHERE grade_id = :grade_id\n\t\t\";\n\n\t\treturn $sql;\n\t}",
"function Delete($table_name, $where_clause='')\n{ \n global $mysqli;\n // check for optional where clause\n $whereSQL = '';\n if(!empty($where_clause))\n {\n // check to see if the 'where' keyword exists\n if(substr(strtoupper(trim($where_clause)), 0, 5) != 'WHERE')\n {\n // not found, add keyword\n $whereSQL = \" WHERE \".$where_clause;\n } else\n {\n $whereSQL = \" \".trim($where_clause);\n }\n }\n // build the query\n $sql = \"DELETE FROM \".$table_name.$whereSQL;\n\n // run and return the query result resource\n return mysqli_query($mysqli,$sql);\n}",
"public function delete($deleteParam = NULL){\n $this->debugBacktrace();\n $this->queryType= \"delete\";\n $this->deleteParam = $deleteParam;\n return $this;\n }",
"public function delete($params=''){\n\t\t$this->_connect();\n\t\tif($this->_schema){\n\t\t\t$table = $this->_schema.'.'.$this->_source;\n\t\t} else {\n\t\t\t$table = $this->_source;\n\t\t}\n\t\t$conditions = '';\n\t\tif(is_array($params)){\n\t\t\t$numberArguments = func_num_args();\n\t\t\t$params = Utils::getParams(func_get_args(), $numberArguments);\n\t\t\tif(isset($params['conditions'])){\n\t\t\t\t$conditions = $params['conditions'];\n\t\t\t}\n\t\t} else {\n\t\t\t$primaryKeys = $this->_getPrimaryKeyAttributes();\n\t\t\tif(is_numeric($params)){\n\t\t\t\tif(count($primaryKeys)==1){\n\t\t\t\t\t$conditions = $primaryKeys[0].\" = '\".$params.\"'\";\n\t\t\t\t} else {\n\t\t\t\t\tthrow new ActiveRecordException('Número de parámetros insuficientes para realizar el borrado');\n\t\t\t\t}\n\t\t\t} else{\n\t\t\t\tif($params){\n\t\t\t\t\t$conditions = $params;\n\t\t\t\t} else {\n\t\t\t\t\tif(count($primaryKeys)==1){\n\t\t\t\t\t\t$primaryKeyValue = $this->readAttribute($primaryKeys[0]);\n\t\t\t\t\t\t$conditions = $primaryKeys[0].\" = '\".$primaryKeyValue.\"'\";\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$conditions = array();\n\t\t\t\t\t\tforeach($primaryKeys as $primaryKey){\n\t\t\t\t\t\t\t$primaryKeyValue = $this->readAttribute($primaryKey);\n\t\t\t\t\t\t\t$conditions[] = $primaryKey.\" = '\".$primaryKeyValue.\"'\";\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$conditions = join(' AND ', $conditions);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif($this->_callEvent('beforeDelete')===false){\n\t\t\treturn false;\n\t\t}\n\t\t$success = $this->_db->delete($table, $conditions);\n\t\t$this->_operationMade = self::OP_DELETE;\n\t\tif($success==true){\n\t\t\t$this->_callEvent('afterDelete');\n\t\t}\n\t\treturn $success;\n\t}",
"public function delete($infos)\n {\n $tabela = $infos['table'];\n $whereCriteria = $infos['where'];\n\n\n try {\n $this->sql = \"DELETE FROM $tabela \";\n if (!empty($whereCriteria)) {\n $this->sql .= \" WHERE \" . $whereCriteria . \" \";\n }\n return $this->sql . \";\";\n } catch (PhiberException $e) {\n throw new PhiberException(new Internationalization(\"query_processor_error\"));\n }\n }",
"public function delete($tableName, $where=null, $whereValues=null, $options=array()) {\n\n // these are the values for each ? in our query template\n $templateValues = array();\n\n // build the query\n $sql = 'DELETE FROM ' . $tableName;\n $this->_setWhere($sql, $where, $whereValues);\n $this->_setOptions($sql, $options);\n\n // prepare the statement\n $stmt = $this->pdo->prepare($sql);\n\n // execute\n return $stmt->execute($whereValues);\n\t}",
"protected function deleteThings($thing, $id) {\n\n $conditions = $id;\n $keytext = $this->makeConstraintSQL($conditions);\n $statement = \"delete from $thing where \" . $keytext;\n //print_r($statement);\n try {\n $stmt = $this->conn->prepare($statement);\n $stmt->execute();\n }\n catch (Exception $e) {\n $this->error .= '<pre>ERROR: ' . $statement . ': ' . $e->getMessage() . '</pre>';\n }\n}",
"public function delete($where);",
"public static function getDeleteSQL($id)\n\t{\n\t\t$sql = \"delete from comments\n where id = %d\";\n\t\t$sql = sprintf($sql, $id);\n\n\t\treturn $sql;\n\t}"
]
| [
"0.7828635",
"0.72687906",
"0.719551",
"0.70964336",
"0.7028847",
"0.7012589",
"0.7006755",
"0.69120455",
"0.68848133",
"0.6884034",
"0.6875269",
"0.6865851",
"0.68323565",
"0.6824594",
"0.6793823",
"0.6715068",
"0.6685823",
"0.6681468",
"0.66672254",
"0.66435426",
"0.65993917",
"0.6597425",
"0.65799683",
"0.65608275",
"0.65564126",
"0.65551984",
"0.6532885",
"0.6519332",
"0.6495278",
"0.6494172",
"0.64896065",
"0.64863884",
"0.64759064",
"0.64723605",
"0.64431703",
"0.6420263",
"0.6419944",
"0.64155793",
"0.63931996",
"0.6392542",
"0.6386814",
"0.63761336",
"0.63697547",
"0.63578933",
"0.6355813",
"0.63543165",
"0.63513535",
"0.63456726",
"0.63448596",
"0.63433176",
"0.6338416",
"0.6338164",
"0.6335576",
"0.6333274",
"0.6324887",
"0.63192797",
"0.62922966",
"0.62922966",
"0.6282487",
"0.6274704",
"0.62699693",
"0.6259968",
"0.62531906",
"0.62489355",
"0.62427354",
"0.62309617",
"0.62297344",
"0.6229317",
"0.6203597",
"0.6192422",
"0.61897546",
"0.618937",
"0.6187738",
"0.61778724",
"0.6177183",
"0.61720675",
"0.6160843",
"0.6154166",
"0.61515534",
"0.6148359",
"0.6146982",
"0.6146881",
"0.6131481",
"0.6121677",
"0.6120203",
"0.6118574",
"0.6101235",
"0.60903347",
"0.60878605",
"0.6084038",
"0.6069559",
"0.60683894",
"0.60655284",
"0.6059274",
"0.60437185",
"0.60254645",
"0.6021792",
"0.6021102",
"0.6009624",
"0.59994334"
]
| 0.6591362 | 22 |
Kills the current process and starts a new one | public function reRunSuite(): void
{
$args = $_SERVER['argv'];
$env = $this->executionContext ? $this->executionContext->asEnv() : array();
$env = array_filter(
array_merge($env, $_SERVER),
function($x): bool { return !is_array($x); }
);
pcntl_exec($this->getExecutablePath(), $args, $env);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function kill();",
"public static function killProcesses() {\n foreach(self::$__pIds as $pid => $active) {\n if(self::$__infoKill) {\n echo sprintf(self::$__infoKill, date('r'), $pid) . PHP_EOL;\n }\n exec('kill ' . $pid);\n unset(self::$__pIds[$pid]);\n };\n }",
"public function stop()\n {\n if (OS::isWin()) {\n $cmd = \"taskkill /pid {$this->pid} -t -f\";\n } else {\n $cmd = \"kill -9 {$this->pid}\";\n }\n shell_exec($cmd);\n }",
"protected function killProcess(): void\n {\n if (($pid = $this->getAttribute('pid')) === null) {\n return;\n }\n\n if ($this->systemCommands()->isProcessRunning($pid)) {\n $this->systemCommands()->killProcess($pid);\n }\n }",
"public function stop() {\n try {\n $pid = $this->getPidFile()->read();\n\n Logger::log(\"Killing THIS PID: \" . $pid, \\Zend_Log::WARN);\n posix_kill($pid, SIGTERM);\n } catch (\\Exception $e) {\n echo $e->getMessage();\n }\n $this->_exit();\n }",
"function killProcess($pid)\n{\n $mapper = systemToolkit::getInstance()->getMapper('process', 'process');\n $process = $mapper->searchOneByField('pid', $pid);\n if($process) {\n $mapper->delete($process);\n }\n}",
"function killProcess(string $id) : void\n {\n shell_exec(\"kill $id\");\n }",
"function kill_Process()\n {\n $this->set_kill_Command();\n //Fire Script \n $this->fire_Script();\n $response = array(\"status\"=>$this->status,\n \"script_ouput\"=>$this->script_output,\n \"executation_time\"=>$this->time_interval,\n \"message\"=>$this->message);\n \n echo json_encode($response, JSON_PRETTY_PRINT);\n }",
"public function kill()\n {\n $this->log(\"Killing process {$this->pid}\");\n $command = \"kill {$this->pid}\";\n exec($command, $output);\n\n if ($this->processIsRunning()) {\n $this->log(\"Process {$this->pid} cannot die!\");\n return false;\n }\n\n $this->log(\"Process {$this->pid} is dead.\");\n return true;\n }",
"public function kill(): void;",
"public function killChild()\n\t{\n\t\tif (!$this->child) {\n\t\t\t$this->logger->log(LogLevel::DEBUG, 'No child to kill.');\n\t\t\treturn;\n\t\t}\n\n\t\t$context = array('child' => $this->child);\n\t\t$this->logger->log(LogLevel::INFO, 'Killing child at {child}', $context);\n\t\tif (exec('ps -o pid,s -p ' . $this->child, $output, $returnCode) && $returnCode != 1) {\n\t\t\t$context = array('child' => $this->child);\n\t\t\t$this->logger->log(LogLevel::DEBUG, 'Child {child} found, killing.', $context);\n\t\t\tposix_kill($this->child, SIGKILL);\n\t\t\t$this->child = null;\n\t\t} else {\n\t\t\t$context = array('child' => $this->child);\n\t\t\t$this->logger->log(LogLevel::INFO, 'Child {child} not found, restarting.', $context);\n\t\t\t$this->shutdown();\n\t\t}\n\t}",
"public function killCommand()\n {\n $this->registry->set(Registry::DAEMON_KILL_KEY, time());\n $this->outputLine('Broadcast kill signal');\n }",
"public function restart()\n {\n $this->destroy();\n $this->start();\n }",
"public function kill()\n {\n $this->option('-k');\n return $this;\n }",
"public function terminate(Process $process);",
"public function killProcess($pid)\n {\n return posix_kill($pid, SIGKILL);\n }",
"public function doProcess(){\n $command = 'nohup '.$this->command.' > /dev/null 2>&1 & echo $!';\n exec($command ,$pross);\n $this->pid = (int)$pross[0];\n }",
"private function serveStop()\n {\n foreach ($this->pid as $pid) {\n $command = \"kill -9 {$pid} > /dev/null 2> /dev/null &\";\n @exec($command, $output);\n }\n }",
"private function stop_ATD()\n\t{\n\t\texecuteCommand('killall run-lowmem.sh', '', $result, $return_status);\n\t}",
"public static function restart()\n {\n $pid = file_get_contents(self::$master_pid);\n posix_kill($pid, SIGUSR1);\n\n if (!is_dir(__APP_DIR__.\"/http_process_cache\"))\n mkdir(__APP_DIR__.\"/http_process_cache\");\n\n $file = new File(__APP_DIR__.\"/http_process_cache\");\n $file->set(\"restart_\".$pid,1,6);\n\n return 1;\n }",
"function stdapi_sys_process_kill($req, &$pkt) {\n # that isn't enabled by default, but better to try it and avoid shelling\n # out when unnecessary.\n my_print(\"doing kill\");\n $pid_tlv = packet_get_tlv($req, TLV_TYPE_PID);\n $pid = $pid_tlv['value'];\n if (is_callable('posix_kill')) {\n $ret = posix_kill($pid, 9);\n $ret = $ret ? ERROR_SUCCESS : posix_get_last_error();\n if ($ret != ERROR_SUCCESS) {\n my_print(posix_strerror($ret));\n }\n } else {\n $ret = ERROR_FAILURE;\n if (is_windows()) {\n my_cmd(\"taskkill /f /pid $pid\");\n # Don't know how to check for success yet, so just assume it worked\n $ret = ERROR_SUCCESS;\n } else {\n if (\"foo\" == my_cmd(\"kill -9 $pid && echo foo\")) {\n $ret = ERROR_SUCCESS;\n }\n }\n }\n return $ret;\n}",
"public function stop() {\n\t\tLogger::getRootLogger ()->info ( \"Stopping IPsec\" );\n\t\t$pid = file_exists ( self::PID_PATH ) ? Functions::shellCommand ( \"pgrep -F \" . self::PID_PATH ) : 0;\n\t\tif ($pid > 0) {\n\t\t\tFunctions::shellCommand ( \"/bin/kill {$pid}\" );\n\t\t}\n\t}",
"protected function stop()\n {\n $pidFile = $this->getPidFile();\n\n if(!is_file($pidFile)){\n echo \"PID file not present, so service is not started\\n\";\n exit;\n }\n if(!is_writable($pidFile)){\n echo \"Insufficient permissions. Please execute as service like 'sudo service anyterm start'\";\n exit;\n }\n\n shell_exec('kill `cat /var/run/anyterm.pid`');\n unlink($pidFile);\n }",
"public function noKill()\n {\n $this->option('--nokill');\n return $this;\n }",
"public function kill_process($pid)\n {\n\n if (!is_numeric($pid)) return false;\n $pid = (int)$pid;\n $sql = \"KILL $pid\";\n\n return $this->db->query($sql);\n }",
"public function kill()\n {\n session_regenerate_id();\n $_SESSION[CCID] = array(); // session_unset();\n session_destroy();\n }",
"public function stop() {\n\t\t$this->invoke(\"stop\");\n\t}",
"protected function restart()\n {\n $this->stop();\n $this->start();\n }",
"public function stopProcess() {\n // Do not change the status of an idle migration\n db_update('migrate_status')\n ->fields(array('status' => MigrationBase::STATUS_STOPPING))\n ->condition('machine_name', $this->machineName)\n ->condition('status', MigrationBase::STATUS_IDLE, '<>')\n ->execute();\n }",
"public function kill($force = false){\n\t\tif(!$this->_pid) return (bool) false;\n\n\t\t$command = 'kill ';\n\t\tif($force) $command .= '9 ';\n\t\t$command .= $this->_pid;\n\t\texec($command);\n\n\t\tif(!$this->isAlive()) $this->writeState(self::STATE_CANCELED);\n\n\t\treturn $this->isAlive();\n\t}",
"public function reload()\n {\n if ($this->config['server_type'] == 'process') {\n $pid = $this->getPid('worker');\n } else {\n $pid = $this->getPid('master');\n }\n\n if (empty($pid)) {\n die(\"{$this->config['process_name']} has not process\".PHP_EOL);\n }\n\n exec(\"kill -USR1 \" . implode(' ', $pid), $output, $return);\n\n if ($return === false) {\n die(\"{$this->config['process_name']} reload fail\".PHP_EOL);\n }\n echo \"{$this->config['process_name']} reload success\".PHP_EOL;\n }",
"function createProcess($pname) {\n $pid = pcntl_fork();\n\n if ($pid == -1) {\n errorOnProcessLunch();\n }\n else if ($pid === 0) {\n startChildProcess($pname);\n exit(); // Make sure to exit.\n }\n else {\n startParentProcess($pid);\n }\n\n}",
"private function _demonize()\n {\n umask(self::$umask);\n\n if (pcntl_fork() != 0)\n {\n exit();\n }\n\n posix_setsid();\n\n if (pcntl_fork() != 0)\n {\n exit();\n }\n }",
"public function restart(): void\n {\n $this->stop();\n $this->start();\n }",
"function killbyname($procname) {\n\treturn mwexec(\"/bin/killall \" . escapeshellarg($procname));\n}",
"public function killExpiredProcess($expiredLockValue)\n {\n if ($this->killExpiredProcesses) {\n list(, $pid) = explode(':', $expiredLockValue);\n exec(\"kill $pid\");\n }\n }",
"public function tearDown() {\n if(self::$__infoKill) {\n echo sprintf(self::$__infoKill, date('r'), $this->__pid) . PHP_EOL;\n }\n exec('kill ' . $this->__pid);\n unset(self::$__pIds[$this->__pid]);\n\n parent::tearDown();\n }",
"public function terminate()\n {\n $this->logger->debug(MessageFormatter::receivedTerminateSignal('Supervisor'));\n\n foreach ($this->consumerProcesses as $processGroup) {\n $processGroup->sendStopSignal();\n }\n\n foreach ($this->consumerProcesses as $processGroup) {\n $processGroup->stopCompletely();\n }\n\n die();\n }",
"public function gearmanWorkerStop()\n {\n for($i = 0; $i < $this->_gearmanForkCount; $i++){\n $this->sub_process_keys[] = $i+1;\n }\n foreach ($this->sub_process_keys as $_sub_key) {\n $shell_cmd = \"ps aux | grep \".$this->_workerFileName. \" |\";\n $shell_cmd .= \"grep -v 'grep' | awk '{print $2}' |\";\n $sub_process_name = $this->_workerFileName.\"_\".$_sub_key;\n $pid_file = $this->_lockDir.$this->_workerFileName.\"_\".$_sub_key.\".pid\";\n $pid_cmd = \"cat $pid_file\";\n $pid = exec($pid_cmd);\n $shell_cmd .= \" grep $pid\";\n echo $shell_cmd.\"\\n\";\n //查看进程是不是存在\n $ps_res = exec($shell_cmd);\n if (empty($ps_res)) {\n echo \"process $sub_process_name is not running!\\n\";\n } else {\n $kill_cmd = \"kill $pid\";\n exec($kill_cmd);\n $this->killed_sub_process_keys[] = $_sub_key;\n echo \"process $sub_process_name is stopped\\n\";\n }\n }\n }",
"public function stop() {\n\t\t// Setup\n\t\t$options = array(\n\t\t\t'appName' => 'cakedaemon',\n\t\t\t'logLocation' => TMP . \"logs\" . DS . 'cakedaemon.log'\n\t\t);\n\n\t\tSystem_Daemon::setOptions($options);\n\t\tSystem_Daemon::stopRunning();\n\t}",
"public function stop();",
"public function stop();",
"public function stop();",
"public function stop();",
"public function stop();",
"public function stop();",
"public function stop();",
"public function stop();",
"public function testStopProcess()\n {\n $command = new SchedulerCommands('unittest');\n\n $exec = $this->getFunctionMock('Martin1982\\LiveBroadcastBundle\\Broadcaster\\Linux', 'exec');\n $exec->expects($this->once())->willReturnCallback(\n function ($command) {\n self::assertEquals('kill 1337', $command);\n }\n );\n\n $command->stopProcess(1337);\n }",
"public function cancelOperation() {\n printf(\"Cancelling...\\n\");\n $this->_cancelled = true;\n posix_kill($this->_pid, SIGKILL);\n pcntl_signal_dispatch();\n }",
"public static function detach()\n\t{\n\t\t// Fork and exit in parent process\n\t\tif (self::fork()) {\n\t\t\texit;\n\t\t}\n\n\t\t// Make the current process a session leader\n\t\tself::$isMaster = true;\n\t\tif (posix_setsid() === -1) {\n\t\t\tthrow new AzaException('Could not detach from terminal');\n\t\t}\n\t}",
"public function restart() {\n\t\t$this->invoke(\"restart\");\n\t}",
"public function killWithoutQueue()\n {\n $processList = $this->getProcessList(\"| grep -v 'queue'\");\n $this->killAll($processList);\n }",
"function killbypid($pidfile) {\n\tsigkillbypid($pidfile, \"TERM\");\n\tunlink_if_exists($pidfile);\n}",
"public function stop()\n {\n $className = str_replace(__NAMESPACE__ . '\\\\', '', get_called_class());\n\n if (!$this->started) {\n return;\n }\n\n $this->destroy();\n $this->started = false;\n Log::d($className . ' stopped.');\n }",
"function reload_ttys() {\n\tposix_kill(1, SIGHUP);\n}",
"public static function stopPhantomDriver()\n {\n if (static::$phantomProcess) {\n static::$phantomProcess->stop();\n }\n }",
"public function destroy(Process $process)\n {\n //\n }",
"public function stop(): bool\n {\n return $this->processRunner->stop();\n }",
"public function restartWith(Command $command);",
"public function terminate();",
"public function stop() {}",
"public function handle()\r\n {\r\n try {\r\n $this->call(\"swooliy:stop\");\r\n\r\n sleep(2);\r\n \r\n $this->call(\"swooliy:start\");\r\n } catch (Throwable $e) {\r\n die($e);\r\n }\r\n }",
"protected abstract function killFree();",
"public function shutdownNow()\n\t{\n\t\t$this->shutdown();\n\t\t$this->killChild();\n\t}",
"public function Close($fileId,$procId) {\n\t\tposix_kill($procId,15);\t\t\n\t\tunlink(ProcMonitor::GetFName($fileId));\n\t\tunlink(ProcMonitor::GetBytesFName($fileId));\n\t}",
"public function kill_session()\n {\n $this->plugins->exec_hook('session_destroy');\n\n $this->session->kill();\n $_SESSION = array('language' => $this->user->language, 'temp' => true, 'skin' => $this->config->get('skin'));\n $this->user->reset();\n }",
"abstract public function stop();",
"public function reload()\n {\n if ($this->config['server_type'] == 'process') {\n $pid = $this->getPid('worker');\n } else {\n $pid = $this->getPid('master');\n }\n\n if (empty($pid)) {\n echo \"{$this->config['process_name']} has not process\" . PHP_EOL;\n return false;\n }\n\n exec(\"kill -USR1 \" . implode(' ', $pid), $output, $return);\n\n if ($return === false) {\n echo \"{$this->config['process_name']} reload fail\" . PHP_EOL;\n return false;\n }\n echo \"{$this->config['process_name']} reload success\" . PHP_EOL;\n return true;\n }",
"function deactivate_ipc(){\n\t\t\n\t\t}",
"protected function killProcessById(Server $server, $pid)\n\t{\n\t\tposix_kill($pid, SIGKILL);\n\t\tif ($server->getVerboseExit())\n\t\t{\n\t\t\techo sprintf(\"Terminating server %d\\n\", $pid);\n\t\t}\n\t}",
"public function Terminate ();",
"final public function stillWorking()\n {\n if(!posix_isatty(STDOUT)) {\n posix_kill(posix_getppid(), SIGUSR1);\n }\n }",
"public function stop() {\n $cmd = sprintf(\"./control.sh stop %s -game %s\", $this->sid, $this->gameId);\n ssh($cmd, $this->host);\n DB::get()->query(\"UPDATE `servers` SET `status` = 0 WHERE `serverID` = '\" . $this->serverId . \"'\");\n }",
"function reset_process(){ $this->model->closing(); }",
"function fsl_session_kill($name){\n unset($_SESSION[''.$name.'']);\n unset($_SESSION[''.$name.'_timeout']);\n session_destroy();\n return true;\n}",
"public function start() {\n echo sprintf(\"Cleaning process started.\" . PHP_EOL);\n $this->clean();\n }",
"public function end()\n\t{\n\t\t$this->set_process_state(false);\n\t}",
"protected function restartAgent($data) {\n \n $command = \"\";\n $bp = new utils\\BackgroundProcess($command);\n }",
"function restart()\n {\n $this->destroy();\n if( $this->_state !== 'destroyed' ) {\n // @TODO :: generated error here\n return false;\n }\n\n $this->_state = 'restart';\n\t\t$this->_start();\n\t\t$this->_state\t=\t'active';\n\n\t\t$this->_setCounter();\n\n return true;\n }",
"public function kill(Request $request) {\n $id = $request->id;\n return response()->json(Bugs::kill($id));\n }",
"public function stopProcess($pid, $grace = 5)\n { $log = usingLog()->startAction(\"stop process '{$pid}' on host '{$this->args[0]}'\");\n\n // is the process running at all?\n if (!fromHost($this->args[0])->getPidIsRunning($pid)) {\n $log->endAction(\"process is not running\");\n return;\n }\n\n // yes it is, so stop it\n // send a TERM signal to the screen session\n $log->addStep(\"send SIGTERM to process '{$pid}'\", function() use ($pid) {\n if ($this->getIsLocalhost()) {\n posix_kill($pid, SIGTERM);\n }\n else {\n usingHost($this->args[0])->runCommand(\"kill {$pid}\");\n }\n });\n\n // has this worked?\n $isStopped = $log->addStep(\"wait for process to terminate\", function() use($pid, $grace, $log) {\n for($i = 0; $i < $grace; $i++) {\n if (!fromHost($this->args[0])->getPidIsRunning($pid)) {\n return true;\n }\n\n // process still exists\n sleep(1);\n }\n\n return false;\n });\n\n // did the process stop?\n if ($isStopped) {\n $log->endAction();\n return;\n }\n\n $log->addStep(\"send SIGKILL to process '{$pid}'\", function() use($pid) {\n if ($this->getIsLocalhost()) {\n posix_kill($pid, SIGKILL);\n }\n else {\n usingHost($this->args[0])->runCommand(\"kill -9 {$pid}\");\n }\n sleep(1);\n });\n\n // success?\n if (fromHost($this->args[0])->getProcessIsRunning($pid)) {\n $log->endAction(\"process is still running :(\");\n throw new E5xx_ActionFailed(__METHOD__);\n }\n\n // all done\n $log->endAction(\"process has finished\");\n }",
"public static function checkProcess($pid)\n {\n return \\Swoole\\Process::kill($pid, 0);\n }",
"public function stop(): bool\n {\n $pid = $this->process->getPid();\n\n print \"\\nStopping Process Id: {$pid}\\n\";\n\n if ('\\\\' === \\DIRECTORY_SEPARATOR) {\n \\exec(\\sprintf('taskkill /F /T /PID %d 2>&1', $pid), $output, $exitCode);\n }\n\n $this->process->kill();\n\n if ($this->process->isRunning()) {\n throw new ProcessException(\\sprintf('Error while killing process \"%s\".', $pid));\n }\n\n return true;\n }",
"public static function stop($main_pid_file, $pid_dir)\n\t{\n\t\tglobal $_SGLOBAL;\n\t\tself::$main_process_name = basename($main_pid_file, '.pid');\n\t\tself::$pid_dir = rtrim($pid_dir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;\n\t\t!is_file(self::$pid_dir.self::$summary_pid_filename) && die(\"system is not running\\n\");\n\t\tProcess::kill_by_pidfile($main_pid_file);\n\t\t$logger = Log::get_log_handle(self::$main_process_name);\n\t\t$logger->pid(self::$main_process_name.' stop');\n\t\t$pids = unserialize(file_get_contents(self::$pid_dir.self::$summary_pid_filename));\n\t\tforeach($pids AS $pid => $pid_process_param) {\n\t\t\tProcess::kill_by_pidfile($pid_process_param[1]);\n\t\t}\n\t\tunlink(self::$pid_dir.self::$summary_pid_filename);\n\t}",
"public function restart($id);",
"function becomeDaemon()\n{\n $pid = pcntl_fork();\n if ($pid == -1) {\n exit();\n } elseif ($pid) {\n exit();\n } else {\n posix_setsid();\n chdir('/');\n umask(0);\n\n return posix_getpid();\n }\n}",
"public static function restart(Vm $vm);",
"protected function _forkProcesses( $numProcesses, Context $context ) {\n\n $processLaunched = 0;\n\n while ( $processLaunched < $numProcesses ) {\n\n try {\n $context->pid_list_len = $this->_queueHandler->getRedisClient()->incr( $context->queue_name );\n } catch ( Exception $e ){\n throw new Exception( \"(parent \" . self::$tHandlerPID . \") ERROR: \" . $e->getMessage() . \" ... EXITING.\", static::ERR_NOT_INCREMENT );\n }\n\n $pid = pcntl_fork();\n\n if ( $pid == -1 ) {\n\n throw new Exception( \"(parent \" . self::$tHandlerPID . \") : ERROR OCCURRED : cannot fork. PARENT EXITING !!\", static::ERR_NOT_FORK );\n\n } elseif ( $pid ) {\n\n // parent process continue running\n $processLaunched += 1;\n $this->_runningPids += 1;\n\n } else {\n\n // child process runs from here\n pcntl_exec( \"/usr/bin/php\", array( __DIR__ . DIRECTORY_SEPARATOR . \"Executor.php\" , json_encode( $context ) ) );\n posix_kill( posix_getpid(), SIGINT ); //this line of code will never be executed\n exit;\n\n }\n\n }\n\n //NO Error. Parent returning after $numProcesses process spawned\n return 0;\n\n }",
"public function run(): void\n {\n $command = $this->composeCommand();\n\n $command = is_windows_os()\n ? \"start /B {$command}\"\n : \"({$command}) > /dev/null 2>&1 &\";\n\n exec($command);\n }",
"public function reap()\n {\n // reap task process if zombied\n if (($r = \\pcntl_waitpid($this->pid, $status, WNOHANG)) > 0) {\n $this->exitStatus = \\pcntl_wexitstatus($status);\n $this->setEndTime();\n $this->task->finish($this->exitStatus);\n $this->dispatcher->dispatch(Event::EXIT, new Event($this));\n } else if ($r < 0) {\n throw new \\RuntimeException(\"pcntl_waitpid() returned error value for PID $pid\");\n } else {\n // force kill if this process is over max runtime\n if ($this->maxRuntime && (microtime(true) - $this->startTime) >= $this->maxRuntime) {\n $this->sendSignal(SIGKILL);\n throw new Exceptions\\RuntimeExceeded(\"Process with PID {$this->pid} has exceeded runtime, SIGKILL sent to process.\");\n }\n }\n }",
"protected function _daemonize ()\n {\n $pid = pcntl_fork();\n \n if ($pid === - 1) {\n throw new \\RuntimeException(\"Failed pcntl_fork\");\n }\n if ($pid) {\n $this->_registerSigHandlers();\n \n $this->_logger->info(\"Started background process:\" . $pid);\n exit(1);\n }\n \n posix_setsid();\n }",
"public function JStop() {}",
"protected function _killPids( Context $queueInfo = null, $pid = 0, $num = 0 ) {\n\n self::_TimeStampMsg( \"Request to kill some processes.\" );\n self::_TimeStampMsg( \"Pid List: \" . @var_export( $queueInfo->pid_set_name, true ) );\n self::_TimeStampMsg( \"Pid: \" . @var_export( $pid, true ) );\n self::_TimeStampMsg( \"Num: \" . @var_export( $num, true ) );\n\n $numDeleted = 0;\n\n if ( !empty( $pid ) && !empty( $queueInfo ) ) {\n\n self::_TimeStampMsg( \"Killing pid $pid from \" . $queueInfo->pid_set_name );\n $numDeleted += $this->_queueHandler->getRedisClient()->srem( $queueInfo->pid_set_name, $pid );\n posix_kill( $pid, SIGINT );\n $queueInfo->pid_list_len = $this->_queueHandler->getRedisClient()->decr( $queueInfo->queue_name );\n\n } elseif ( !empty( $pid ) && empty( $queueInfo ) ) {\n\n self::_TimeStampMsg( \"Killing pid $pid from a not defined queue. Seek and destroy.\" );\n /**\n * @var $queue Context\n */\n foreach ( $this->_queueContextList->list as $queue ) {\n\n $deleted = $this->_queueHandler->getRedisClient()->srem( $queue->pid_set_name, $pid );\n if( $deleted ){\n posix_kill( $pid, SIGINT );\n $queue->pid_list_len = $this->_queueHandler->getRedisClient()->decr( $queue->queue_name );\n self::_TimeStampMsg( \"Found. Killed pid $pid from queue $queue->queue_name.\" );\n }\n $numDeleted += $deleted;\n\n }\n\n } elseif ( !empty( $num ) && !empty( $queueInfo ) ) {\n\n self::_TimeStampMsg( \"Killing $num pid from \" . $queueInfo->pid_set_name );\n $queueBefore = $this->_queueHandler->getRedisClient()->scard( $queueInfo->pid_set_name );\n for( $i = 0; $i < $num; $i++ ){\n $pid = $this->_queueHandler->getRedisClient()->spop( $queueInfo->pid_set_name );\n posix_kill( $pid, SIGINT );\n $queueInfo->pid_list_len = $this->_queueHandler->getRedisClient()->decr( $queueInfo->queue_name );\n }\n $queueAfter = $this->_queueHandler->getRedisClient()->scard( $queueInfo->pid_set_name );\n $numDeleted = $queueBefore - $queueAfter;\n\n } elseif ( !empty( $queueInfo ) ) {\n\n self::_TimeStampMsg( \"Killing all processes from \" . $queueInfo->pid_set_name );\n $numDeleted = $this->_queueHandler->getRedisClient()->scard( $queueInfo->pid_set_name );\n $pid_list = $this->_queueHandler->getRedisClient()->smembers( $queueInfo->pid_set_name );\n foreach( $pid_list as $pid ){\n posix_kill( $pid, SIGINT );\n }\n $this->_queueHandler->getRedisClient()->del( $queueInfo->pid_set_name );\n $this->_queueHandler->getRedisClient()->del( $queueInfo->queue_name );\n $queueInfo->pid_list_len = 0;\n\n } elseif ( !empty( $num ) ) {\n\n self::_TimeStampMsg( \"Killing $num processes balancing all queues.\" );\n\n while ( true ) {\n\n // if all queues are empty or they have less elements than requested $num\n //we do not want an infinite loop\n //so, at least one deletion per cycle\n $deleted = false;\n foreach ( $this->_queueContextList->list as $queue ) {\n\n //Exit, we reached the right number, exit the while loop\n if( $numDeleted >= $num ){\n break 2; //exit the while loop\n }\n\n $_deleted = false;\n if( $queue->max_executors < $queue->pid_list_len ){\n //ok, queue can be reduced because it's upper limit exceed the max queue consumers\n $_deleted = $this->_queueHandler->getRedisClient()->spop( $queue->pid_set_name );\n if ( $_deleted ) {\n $queue->pid_list_len = $this->_queueHandler->getRedisClient()->decr( $queue->queue_name );\n posix_kill( $_deleted, SIGINT );\n }\n }\n\n //we do not want an infinite loop\n //so, at least one deletion per cycle\n $deleted = $_deleted || $deleted;\n\n $numDeleted += (int)(bool)$_deleted;\n\n }\n\n //no more processes to kill!! Avoid infinite loop\n if ( !$deleted ) {\n break;\n }\n\n }\n\n } elseif ( empty( $queueInfo ) && empty( $pid ) && empty( $num ) ) {\n\n self::_TimeStampMsg( \"Killing ALL processes.\" );\n foreach ( $this->_queueContextList->list as $queue ) {\n $numDeleted += $this->_queueHandler->getRedisClient()->scard( $queue->pid_set_name );\n $pid_list = $this->_queueHandler->getRedisClient()->smembers( $queue->pid_set_name );\n foreach ( $pid_list as $pid ){\n posix_kill( $pid, SIGINT );\n }\n $this->_queueHandler->getRedisClient()->del( $queue->pid_set_name );\n $this->_queueHandler->getRedisClient()->set( $queue->queue_name, 0 );\n $queue->pid_list_len = 0;\n }\n\n } else {\n self::_TimeStampMsg( \"Parameters not valid. Killing *** NONE ***\" );\n }\n\n $this->_runningPids -= $numDeleted;\n\n self::_TimeStampMsg( \"Deleted $numDeleted processes.\" );\n\n }",
"public function killJob($args){\n \\Queue::killJob($args[0]);\n }",
"public function Kill($Message = Null) {\n \t\tif($Message == Null) {\n \t\t\t$Kill = exit();\n \t\t} elseif(!$Message == Null) {\n \t\t\t$Kill = exit($Message);\n \t\t} else {\n \t\t\t$Kill = exit();\n \t\t}\n \t\treturn $Kill;\n \t}",
"private function restart() {\n session_start();\n session_regenerate_id();\n session_destroy();\n session_commit();\n session_start();\n $this->setUserAgent();\n $this->setRemoteAddress();\n }",
"public function stop(): void;",
"public function stop(): void;",
"public function stop(): void;",
"public function stop(): void;"
]
| [
"0.6766744",
"0.6735434",
"0.6689856",
"0.6537357",
"0.64111274",
"0.63831526",
"0.62708765",
"0.6205274",
"0.61968374",
"0.61171067",
"0.6020844",
"0.60005397",
"0.59878945",
"0.5976326",
"0.59078497",
"0.5858593",
"0.58067787",
"0.57906395",
"0.5789773",
"0.574048",
"0.5718811",
"0.56064236",
"0.55907184",
"0.55699396",
"0.5531751",
"0.55017376",
"0.5499494",
"0.5429763",
"0.54203653",
"0.5399482",
"0.5385861",
"0.5290382",
"0.5289262",
"0.5262713",
"0.5260396",
"0.5250408",
"0.5247744",
"0.5211211",
"0.5204673",
"0.5204575",
"0.51830775",
"0.51830775",
"0.51830775",
"0.51830775",
"0.51830775",
"0.51830775",
"0.51830775",
"0.51830775",
"0.5147817",
"0.5125525",
"0.5122339",
"0.5113178",
"0.5105551",
"0.5068103",
"0.5048617",
"0.50450915",
"0.5043965",
"0.50329995",
"0.50318956",
"0.4995731",
"0.49714378",
"0.49668032",
"0.49599242",
"0.49442765",
"0.49115372",
"0.4909334",
"0.49039602",
"0.48957208",
"0.4895268",
"0.48934585",
"0.48813048",
"0.48719585",
"0.48617396",
"0.48614225",
"0.4856063",
"0.48544857",
"0.48441744",
"0.48435092",
"0.4829486",
"0.4828878",
"0.48151562",
"0.48072448",
"0.47831735",
"0.47714838",
"0.47697124",
"0.47679535",
"0.47675958",
"0.4763522",
"0.47188002",
"0.47174457",
"0.47163686",
"0.47161412",
"0.4705379",
"0.470526",
"0.47001454",
"0.46817937",
"0.46772832",
"0.46645394",
"0.46645394",
"0.46645394",
"0.46645394"
]
| 0.0 | -1 |
/////////////// CONSTRUCTOR // /////////////// Constructor | public function __construct(ContainerInterface $container)
{
// Get the requested storage service
$this->storage = $container->get(
$container->getParameter('tyhand.simple_apikey.storage_service_name')
);
// Check that the storage service uses the required interface
if (!($this->storage instanceof ApiKeyStorageInterface)) {
throw new DoesNotImplementException(
$this->storage,
'TyHand\SimpleApiKeyBundle\Storage\ApiKeyStorageInterface'
);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function __construct()\t{}",
"private function __construct()\r\n\t{\r\n\t\r\n\t}",
"function _construct() {\n \t\n\t\t\n\t}",
"private function __construct() {\r\n\t\r\n\t}",
"private function __construct()\n\t{\n\t\t\n\t}",
"private function __construct( )\n {\n\t}",
"private function __construct() {\r\n\t\t\r\n\t}",
"final private function __construct() {\n\t\t\t}",
"final private function __construct()\n\t{\n\t}",
"private function __construct()\r\n\t{\r\n\t}",
"private function __construct()\n\t{\n\n\t}",
"private function __construct () \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()\r\r\n\t{\r\r\n\t}",
"private function __construct() { \n\t\t\n\n\t}",
"function __construct()\r\n\t\t{\r\n\t\t\t\r\n\t\t}",
"private function __construct() {\n\t\t}",
"public function _construct()\n\t{\n\n\t}",
"private function __construct()\n\t{\n\t}",
"private function __construct()\n\t{\n\t}",
"private function __construct()\n\t{\n\t}",
"private function __construct()\n\t{\n\t}",
"private function __construct()\n\t{\n\t}",
"private function __construct()\n\t{\n\t}",
"private function __construct()\n\t{\n\t}",
"private function __construct()\n\t{\n\t}",
"private function __construct()\n\t{\n\t}",
"final private function __construct(){\r\r\n\t}",
"public function __construct()\n\t\t{\n\t\t\t//\n\t\t}",
"private function __construct () {}",
"public function __construct()\n\t\t{\n\t\t\t\n\t\t}",
"public function __construct( )\r\n\t{\r\n\t\t// TODO Auto-generated constructor\r\n\t}",
"private function __construct()\r\n {}",
"private function __construct() {\r\n\t}",
"private function __construct() {\r\n\t}",
"public function __construct() {\r\n\t\t// TODO Auto-generated constructor\r\n\t}",
"public function __construct() {\r\n\t\t// TODO Auto-generated constructor\r\n\t}",
"public function __construct() {\r\n\t\t// TODO Auto-generated constructor\r\n\t}",
"public function __construct() { \n\t\t\n\n\t\t}",
"function __construct()\n\t{\n\t\t\n\t\t\n\t}",
"public function __construct() {\n\t\t\n\t}",
"public function __construct() {\n\t\t\n\t}",
"public function __construct() {\n\t\t\n\t}",
"public function __construct() {\n\t\t\n\t}",
"public function __construct() {\n\t\t\n\t}",
"function __construct (){\n\t\t}",
"function _construct(){ }",
"function __construct() {\n\t\t\t\n\t\t}",
"public function __construct()\n\t{\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\t\t// TODO Auto-generated constructor\n\t}",
"public function __construct()\r\n\t\t{\r\n\t\t}",
"function __construct() { }",
"function __construct() { }",
"function __construct() { }",
"final private function __construct()\n {\n }",
"public function __construct()\n\t{}",
"public function __construct()\n\t{\n\t\n\t}",
"public function __construct()\n\t{\n\t\n\t}",
"private function __construct(){\n\t\n\t}",
"private function __construct() {\n\t}",
"private function __construct() {\n\t}",
"private function __construct() {\n\t}",
"private function __construct() {\n\t}",
"private function __construct() {\n\t}",
"private function __construct() {\n\t}",
"private function __construct() {\n\t}",
"private function __construct() {\n\t}",
"private function __construct() {\n\t}",
"private function __construct() {\n\t}",
"private function __construct() {\n\t}",
"private function __construct() {\n\t}",
"private function __construct() {\n\t}",
"private function __construct() {\n\t}",
"private function __construct() {\n\t}",
"private function __construct() {\n\t}",
"private function __construct() {\n\t}",
"private function __construct() {\n\t}",
"private function __construct() {\n\t}",
"function __construct()\r\n\t{\r\n\t}"
]
| [
"0.88787705",
"0.87500215",
"0.8740821",
"0.87185466",
"0.86959124",
"0.8650916",
"0.86462885",
"0.86421627",
"0.8637003",
"0.8624724",
"0.86196315",
"0.8618929",
"0.86177737",
"0.86177737",
"0.86177737",
"0.86177737",
"0.86177737",
"0.86177737",
"0.86177737",
"0.86177737",
"0.86177737",
"0.86177737",
"0.86177737",
"0.86177737",
"0.86177737",
"0.86177737",
"0.86177737",
"0.86177737",
"0.86177737",
"0.86116934",
"0.86004686",
"0.85887855",
"0.8583256",
"0.8575353",
"0.854198",
"0.854198",
"0.854198",
"0.854198",
"0.854198",
"0.854198",
"0.854198",
"0.854198",
"0.854198",
"0.8537805",
"0.8521986",
"0.8517526",
"0.85149074",
"0.8514063",
"0.85084134",
"0.8506558",
"0.8506558",
"0.8492508",
"0.8492508",
"0.8492508",
"0.84922665",
"0.8489006",
"0.84882236",
"0.84882236",
"0.84882236",
"0.84882236",
"0.84882236",
"0.84876364",
"0.84865296",
"0.8471171",
"0.84665394",
"0.84659046",
"0.84659046",
"0.84659046",
"0.84659046",
"0.84659046",
"0.84659046",
"0.84659046",
"0.8462726",
"0.8457087",
"0.8457087",
"0.8457087",
"0.8456765",
"0.845305",
"0.8450935",
"0.8450935",
"0.84428203",
"0.8434088",
"0.8434088",
"0.8434088",
"0.8434088",
"0.8434088",
"0.8434088",
"0.8434088",
"0.8434088",
"0.8434088",
"0.8434088",
"0.8434088",
"0.8434088",
"0.8434088",
"0.8434088",
"0.8434088",
"0.8434088",
"0.8434088",
"0.8434088",
"0.8434088",
"0.84324455"
]
| 0.0 | -1 |
/////////// GETTERS // /////////// Gets the storage service | public function getStorage()
{
return $this->storage;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getStorageService();",
"public function getStorage() {}",
"public function getStorage() {}",
"public function getStorage() {}",
"public static function getStorage() {}",
"public function getStorage();",
"public function getStorage();",
"public function getStorage()\n {\n return $this->get(self::_STORAGE);\n }",
"public function getStorage()\r\n {\r\n return $this->storage;\r\n }",
"public function getStorage()\n {\n return $this->_storage;\n }",
"public function getStorage() {\n\t\treturn $this->_storage;\n\t}",
"public function getStorage(): StorageInterface\n {\n return $this->storage;\n }",
"public function getStorage()\n {\n return Controllers\\StorageController::getInstance();\n }",
"public function getStorageService()\n {\n $class = $this->app['config']->get('shoppingcart.storage','session');\n\n switch ($class)\n {\n case 'session':\n return 'session';\n break;\n case 'database':\n return 'database';\n break;\n default:\n return 'session';\n break;\n }\n }",
"function getStorage();",
"public function getStorage(): StorageInterface\n {\n return $this->configuration[ConfigurationInterface::STORAGE];\n }",
"function getStorage() ;",
"public function getStorage()\n {\n if (null === $this->storage) {\n $this->setStorage();\n }\n return $this->storage;\n }",
"function getStorage()\n{\n\tif (!$this->storage) $this->storage = new AuthDbStorage;\n\treturn $this->storage;\t\n}",
"private function getStorage()\n {\n if (empty($this->storage)) {\n $this->storage = $this->wizardStorageFactory->create([\n 'key' => $this->getRequest()->getParam(UrlBuilder::REQUEST_PARAM_CONFIGURE_KEY)\n ]);\n }\n return $this->storage;\n }",
"function getStorageEngine() {\n \treturn $this->storage_engine;\n }",
"abstract protected function getStorage(): StorageInterface;",
"public function getService()\r\n\t{\r\n\t\t$this->_service = $this->getClient()->objectStoreService('cloudFiles', $this->region);\r\n\t\treturn $this->_service;\r\n\t}",
"function get_storage()\n{\n return env('FILESYSTEM_DRIVER');\n}",
"public function getStorageEndpoint()\n\t{\n\t\treturn $this->storageEndpoint;\n\t}",
"public function getCacheStorage(): CacheStorageInterface\n {\n return $this->storage;\n }",
"public function getStoragePath()\n {\n return $this->storagePath;\n }",
"public function getStoragePath()\n {\n return $this->storagePath;\n }",
"public function getStorage()\n {\n if($this->_storageInstance == null)\n {\n $storageClass = $this->_storageClass;\n $this->_storageInstance = new $storageClass($this->_storageConfig);\n $this->_storageInstance->setMapperInstance($this);\n }\n return $this->_storageInstance;\n }",
"public function getInstanceStorage() {\n if (null == $this->instanceStorage) {\n $this->instanceStorage = new InstanceStorage();\n }\n\n return $this->instanceStorage;\n }",
"protected function getStorage()\n{\n\tglobal $pclib;\n\tif (!$this->storage) $this->storage = new TranslatorDbStorage($this);\n\treturn $this->storage;\n}",
"function _getStorage()\n {\n if ($this->_handler instanceof CacheStorage) {\n return $this->_handler;\n }\n\n $this->_handler = CacheStorage::getInstance($this->_options['storage'], $this->_options);\n if ($this->_handler != null) {\n if ($this->_handler->test()) {\n return $this->_handler;\n } else {\n $this->_handler = CacheStorage::getInstance('file', $this->_options);\n return $this->_handler;\n }\n } else {\n return null;\n }\n }",
"public function getStoragePath(): string;",
"protected function getStorageInfo() {\n\t\t$dirInfo = \\OC\\Files\\Filesystem::getFileInfo('/', false);\n\t\treturn \\OC_Helper::getStorageInfo('/', $dirInfo);\n\t}",
"public function storagePath()\n {\n return $this->storagePath ?: $this->basePath . DIRECTORY_SEPARATOR . 'storage';\n }",
"public function storage($storage)\n\t{\n\t\treturn $this->storage->get($storage);\n\t}",
"public function getStorage()\n {\n if (NULL === $this->_storage) {\n $this->setStorage(new Auth\\Storage\\MultipleIdentities());\n }\n \n return $this->_storage;\n }",
"public function getStorage() {\n return $this->sectionStorage;\n }",
"protected function getSecurity_TokenStorageService()\n {\n return $this->services['security.token_storage'] = new \\Symfony\\Component\\Security\\Core\\Authentication\\Token\\Storage\\TokenStorage();\n }",
"protected function getSecurity_TokenStorageService()\n {\n return $this->services['security.token_storage'] = new \\Symfony\\Component\\Security\\Core\\Authentication\\Token\\Storage\\TokenStorage();\n }",
"public function getCurrentStorage() {\n return @$this->attributes['current_storage'];\n }",
"public function getStorageGroup()\n {\n return $this->get('storagegroup');\n }",
"public function getStoragePath(){\n return $this->storageEngine->getStoragePath();\n }",
"public function storagePath()\n {\n return $this->basePath . DIRECTORY_SEPARATOR . 'storage';\n }",
"protected function getStorageFile()\n\t{\n\t\t$this->createDirectory();\n\t\treturn $this->storagePath.$this->storageFileName;\n\t}",
"function storage_path()\n {\n return base_path() . '/storage';\n }",
"public function getStorage():OAuthStorageInterface;",
"public function get_storage_unit()\n {\n return $this->storage_unit;\n }",
"public function client()\n {\n return StorageProviderClientFactory::make($this);\n }",
"protected function getSessionStorage()\n {\n if (! $this->storage) {\n $this->storage = $this->getServiceLocator()\n ->get('cp_user_auth_storage');\n }\n\n return $this->storage;\n }",
"public function storage(): FilesystemAdapter\n {\n return Storage::disk($this->getDiskName());\n }",
"public function getStorageId() {\n return $this->configuration['storage_id'] ?: NULL;\n }",
"public function &_getStorage()\n\t{\n\t\t$hash = md5(serialize($this->_options));\n\n\t\tif (isset(self::$_handler[$hash]))\n\t\t{\n\t\t\treturn self::$_handler[$hash];\n\t\t}\n\n\t\tself::$_handler[$hash] = TCacheStorage::getInstance($this->_options['storage'], $this->_options);\n\n\t\treturn self::$_handler[$hash];\n\t}",
"public function getStorageDir() : string\n {\n return $this->storageDir;\n }",
"protected function getStorage()\n {\n return unserialize(Session::retrieve(__NAMESPACE__));\n }",
"protected function getFilesystemService()\n {\n return $this->services['filesystem'] = new \\phpbb\\filesystem\\filesystem();\n }",
"public function getSessionStorage()\n {\n if (! $this->storage) {\n $this->storage = $this->getServiceLocator()\n ->get('Application\\Event\\MyAuthStorage');\n }\n return $this->storage;\n }",
"public function provides()\r\n {\r\n return ['storage'];\r\n }",
"public function getStorageNode()\n {\n return $this->get('storagenode');\n }",
"function getFilesystemService() {\n\t// $this->app->make('filesystem');\n\t// - or -\n\t// app('filesystem')\n\t// - or -\n\t// App::make('filesystem');\n\t// - or -\n\treturn $this->app['filesystem'];\n}",
"public function getStorageClass()\n {\n return $this->_storageClass;\n }",
"public function getStorage($name)\n {\n return $this\n ->getService('storage')\n ->getDriver($name)\n ;\n }",
"public static function getStorage($mountPoint) {\n\t\tif (!self::$mounts) {\n\t\t\t\\OC_Util::setupFS();\n\t\t}\n\t\t$mount = self::$mounts->find($mountPoint);\n\t\treturn $mount->getStorage();\n\t}",
"public function getStorageClass()\n {\n return $this->storage_class;\n }",
"public function get()\n {\n $file_path = $this->path();\n\n if (Storage::exists($file_path)) {\n\n return Storage::get($file_path);\n\n }\n }",
"function getObjectStore()\n {\n // services. You can also get it from $identity->token().\n $token = $this->identity->authenticateAsUser($this->username, $this->password, null, $this->tenantName);\n Session::put('token', $token);\n\n // Get a listing of all of the services you currently have configured in\n // OpenStack.\n //$catalog = $identity->serviceCatalog();\n //$tenantName = $identity->tenantName();\n\n $storageList = $this->identity->serviceCatalog('object-store');\n $objectStorageUrl = $storageList[0]['endpoints'][0]['publicURL'];\n\n // Create a new ObjectStorage instance:\n $objectStore = new ObjectStorage($token, $objectStorageUrl);\n\n return $objectStore;\n }",
"public function getLibraryStorage() {\n if (null == $this->libraryStorage) {\n $this->libraryStorage = new LibraryStorage();\n }\n\n return $this->libraryStorage;\n }",
"public function storage_path();",
"public function initStorage()\n {\n $dbMasterConfig = C(self::$dbKey);\n $this->storage = $this->getDbInstance($dbMasterConfig);\n $this->setTableName($dbMasterConfig);\n\n return $this->storage;\n }",
"public function createStorage();",
"public static function getStorage($app) {\n\t\treturn \\OC_App::getStorage($app);\n\t}",
"public function getStorage($identifier) {\n\t\t\n\t\t$storage_folder = getStorageFolder($identifier);\n\t\t\n\t\t$storage_folder = str_replace(WWW_ROOT, '', $storage_folder);\n\t\t\n\t\treturn $storage_folder;\n\t\t\n\t}",
"public function getAnalysisStorage(): StorageInterface;",
"public function getStorageType() {\n return $this->configuration['storage_type'] ?: NULL;\n }",
"protected static function getFacadeAccessor()\n {\n return 'magentoStorage';\n }",
"public function getAll()\n {\n return $this->storage;\n }",
"public static function storagePath(){\n return \\Illuminate\\Foundation\\Application::storagePath();\n }",
"public function getFileStorages() {}",
"public function get()\n {\n if (!$this->storage->has(self::STORAGE_KEY)) {\n $this->update();\n }\n return $this->storage->get(self::STORAGE_KEY);\n }",
"protected function getStorageDisk()\n {\n return config('paperclip.storage.disk')\n ?: config('filesystems.default');\n }",
"private function getStore()\n {\n return $this->storeManager->getStore($this->retrieveSharedCatalogStoreId());\n }",
"public function getRootStorage() {\n return @$this->attributes['root_storage'];\n }",
"public static function getDisk()\n {\n return Storage::disk('s3');\n }",
"protected function getStorage(StorageInterface $source) {\n return new GhostStorage($source);\n }",
"public function getAvatarStorage() {\n\t\tif (!$this->storage) {\n\t\t\ttry {\n\t\t\t\t$this->storage = $this->rootFolder->get('avatars')->getStorage();\n\t\t\t} catch (NotFoundException $e) {\n\t\t\t\t$this->storage = $this->rootFolder->newFolder('avatars')->getStorage();\n\t\t\t}\n\t\t}\n\t\treturn $this->storage;\n\t}",
"protected function getFilesystemService()\n {\n return $this->services['filesystem'] = new \\Symfony\\Component\\Filesystem\\Filesystem();\n }",
"public function getStorageClass()\n {\n return $this->data['storage_class'];\n }",
"protected function domainStorage() {\n if (!$this->domainStorage) {\n $this->domainStorage = $this->entityTypeManager->getStorage('domain');\n }\n return $this->domainStorage;\n }",
"public function getStorageRecord() {}",
"public function getStorageV1()\n {\n return Controllers\\StorageV1Controller::getInstance();\n }",
"public function storage()\n {\n return $this->hasOne(StorageCategory::class);\n }",
"protected function getStorage()\n {\n if (! isset($this->storage)) {\n $this->storage = new SplFixedArray($this->getDomList()->length);\n }\n return $this->storage;\n }"
]
| [
"0.9097235",
"0.82832074",
"0.82831776",
"0.8282873",
"0.8271272",
"0.8162355",
"0.8162355",
"0.8156148",
"0.81435025",
"0.8109119",
"0.80426216",
"0.8032769",
"0.79776275",
"0.79638696",
"0.7878813",
"0.7848551",
"0.7838049",
"0.778412",
"0.771128",
"0.7565371",
"0.7510235",
"0.74604",
"0.74278295",
"0.7396139",
"0.7369847",
"0.7364098",
"0.73589605",
"0.73589605",
"0.73296106",
"0.7238587",
"0.7228252",
"0.7207959",
"0.7206325",
"0.7205576",
"0.71743196",
"0.71666217",
"0.7158604",
"0.71524835",
"0.7127449",
"0.7127449",
"0.7050691",
"0.7043047",
"0.7041749",
"0.70224416",
"0.7013117",
"0.70029134",
"0.69394535",
"0.69189894",
"0.6913819",
"0.68880975",
"0.688348",
"0.6882969",
"0.6879485",
"0.68615025",
"0.6857971",
"0.68513143",
"0.6808848",
"0.6802687",
"0.6792719",
"0.67120063",
"0.66937625",
"0.66896516",
"0.66831577",
"0.66796994",
"0.6666886",
"0.6661839",
"0.66504276",
"0.66214687",
"0.6611923",
"0.66095114",
"0.6597593",
"0.6593267",
"0.6588193",
"0.6581436",
"0.6579499",
"0.65772563",
"0.6563547",
"0.6557928",
"0.65484977",
"0.6536702",
"0.6488321",
"0.6483819",
"0.64629793",
"0.6436472",
"0.6433912",
"0.64245194",
"0.64183235",
"0.6401399",
"0.6400561",
"0.6400315",
"0.63856494",
"0.63838965"
]
| 0.8142996 | 15 |
fetching default value for clinic and store it to session. | public function beforeFilter() {
$sessionstaff = $this->Session->read('staff');
//set next free card number for default search
$getfreecard = $this->Api->get_freecardDetails($sessionstaff['clinic_id']);
$this->set('FreeCardDetails', $getfreecard);
$getallnotifications = $this->ClinicNotification->getNotification($sessionstaff['clinic_id']);
$this->Session->write('staff.AllNotifications', $getallnotifications);
$trainingvideo = $this->TrainingVideo->find('all');
//fetch all training video and set it to session to show at top of the page
$this->Session->write('staff.trainingvideo', $trainingvideo);
if (isset($sessionstaff['clinic_id'])) {
$options3['conditions'] = array('Clinic.id' => $sessionstaff['clinic_id']);
$options3['fields'] = array('Clinic.analytic_code', 'Clinic.log_time', 'Clinic.lead_log', 'Clinic.id');
$ClientCredentials = $this->Clinic->find('first', $options3);
if (isset($ClientCredentials)) {
$staffaceess = $this->Api->accessstaff($sessionstaff['clinic_id']);
$this->Session->write('staff.staffaccess', $staffaceess);
//store analytic code to session
$this->Session->write('staff.analytic_code', $ClientCredentials['Clinic']['analytic_code']);
}
}
if (empty($sessionstaff['var']) && $this->params['action'] != 'login') {
return $this->redirect('/staff/login/');
}
$this->layout = $this->layout;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function get_curr_city() {\n if( isset($_GET['curr_city']) ) {\n $currentCity = $_GET['curr_city'];\n } else {\n if( isset($_COOKIE['curr_city']) ) {\n $currentCity = $_COOKIE['curr_city'];\n } else {\n $currentCity = 'nsk';\n }\n }\n return $currentCity;\n}",
"protected function set_default_value(){\n $this->set_view('sarung/admin/index');\n $this->set_min_power( 100 );\n\t\t$this->set_title('Session');\n\t\t$this->set_body_attribute( \" class='admin admin_sarung_body' \" );\n $this->set_table_name('session');\n \n $this->set_perkiraan_santri_name( 'perkiraan_santri' );\n $this->set_session_name ( 'session_name');\n $this->set_awal_name ( 'awal_name');\n $this->set_akhir_name ( 'akhir_name' );\n $this->set_nilai_name ( 'nilai_name') ;\n $this->set_model_name ( 'model_name');\n \n }",
"public function getDefaultValue() {}",
"public function getDefaultValue() {}",
"public function getBusinessPartnerShippingCityDefaultValue() {\n //initialize dummy value.. no content header.pure html\n $sql = null;\n $cityId = null;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n SELECT `cityId`\n FROM `city`\n WHERE `isActive` = 1\n AND `companyId` = '\" . $this->getCompanyId() . \"'\n AND \t `isDefault` =\t 1\n LIMIT 1\";\n } else\n if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n SELECT TOP 1 [cityId],\n FROM [city]\n WHERE [isActive] = 1\n AND [companyId] = '\" . $this->getCompanyId() . \"'\n AND \t [isDefault] = 1\";\n } else\n if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n SELECT CITYID AS \\\"cityId\\\",\n FROM CITY\n WHERE ISACTIVE = 1\n AND COMPANYID = '\" . $this->getCompanyId() . \"'\n AND \t ISDEFAULT\t =\t 1\n AND \t\t ROWNUM\t =\t 1\";\n } else {\n header('Content-Type:application/json; charset=utf-8');\n echo json_encode(array(\"success\" => false, \"message\" => $this->t['databaseNotFoundMessageLabel']));\n exit();\n }\n\n try {\n $result = $this->q->fast($sql);\n } catch (\\Exception $e) {\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n if ($result) {\n $row = $this->q->fetchArray($result);\n $cityId = $row['cityId'];\n }\n return $cityId;\n }",
"function GetSession($parameter_name, $default_value = \"\"){\n\t//\n return isset($_SESSION[$parameter_name]) ? $_SESSION[$parameter_name] : $default_value;\n}",
"public function get_default(){\n\t\treturn $this->default;\n\t}",
"public function getBusinessPartnerShippingCityDefaultValue() {\n //initialize dummy value.. no content header.pure html\n $sql = null;\n $cityId = null;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n SELECT `cityId`\n FROM `city`\n WHERE `isActive` = 1\n AND `companyId` = '\" . $this->getCompanyId() . \"'\n AND \t `isDefault` =\t 1\n LIMIT 1\";\n } else if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n SELECT TOP 1 [cityId],\n FROM [city]\n WHERE [isActive] = 1\n AND [companyId] = '\" . $this->getCompanyId() . \"'\n AND \t [isDefault] = 1\";\n } else if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n SELECT CITYID AS \\\"cityId\\\",\n FROM CITY\n WHERE ISACTIVE = 1\n AND COMPANYID = '\" . $this->getCompanyId() . \"'\n AND \t ISDEFAULT\t =\t 1\n AND \t\t ROWNUM\t =\t 1\";\n } else {\n header('Content-Type:application/json; charset=utf-8');\n echo json_encode(array(\"success\" => false, \"message\" => $this->t['databaseNotFoundMessageLabel']));\n exit();\n }\n try {\n $result = $this->q->fast($sql);\n } catch (\\Exception $e) {\n header('Content-Type:application/json; charset=utf-8');\n $this->q->rollback();\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n if ($result) {\n $row = $this->q->fetchArray($result);\n $cityId = $row['cityId'];\n }\n return $cityId;\n }",
"public function getDefaultValue();",
"public function getDefaultValue();",
"public function get($name, $default=null) {\n $value = Session::get($name);\n if(is_null($value))\n $value = $default;\n\n return $value;\n }",
"public static function get(string $key, $default = NULL) {\n\t\treturn self::$sessionInstance->get ( $key, $default );\n\t}",
"protected function sessionValue($name, $default='')\r\n {\r\n if (isset($_SESSION[$name])) {\r\n return $_SESSION[$name];\r\n } else {\r\n return $default;\r\n }\r\n }",
"public function getBusinessPartnerShippingCountryDefaultValue() {\n //initialize dummy value.. no content header.pure html\n $sql = null;\n $countryId = null;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n SELECT `countryId`\n FROM `country`\n WHERE `isActive` = 1\n AND `companyId` = '\" . $this->getCompanyId() . \"'\n AND \t `isDefault` =\t 1\n LIMIT 1\";\n } else\n if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n SELECT TOP 1 [countryId],\n FROM [country]\n WHERE [isActive] = 1\n AND [companyId] = '\" . $this->getCompanyId() . \"'\n AND \t [isDefault] = 1\";\n } else\n if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n SELECT COUNTRYID AS \\\"countryId\\\",\n FROM COUNTRY\n WHERE ISACTIVE = 1\n AND COMPANYID = '\" . $this->getCompanyId() . \"'\n AND \t ISDEFAULT\t =\t 1\n AND \t\t ROWNUM\t =\t 1\";\n } else {\n header('Content-Type:application/json; charset=utf-8');\n echo json_encode(array(\"success\" => false, \"message\" => $this->t['databaseNotFoundMessageLabel']));\n exit();\n }\n\n try {\n $result = $this->q->fast($sql);\n } catch (\\Exception $e) {\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n if ($result) {\n $row = $this->q->fetchArray($result);\n $countryId = $row['countryId'];\n }\n return $countryId;\n }",
"public function get($default = null);",
"public function getDefaultValue()\n {\n\treturn $this->default;\n }",
"function getDefaultValue() \n {\n return $this->getValueByFieldName( 'statevar_default' );\n }",
"public static function getAttribute($name,$default=null) {\n\t if(!isset($_SESSION)) {\n\t self::start();\n\t }\n\t if(isset($_SESSION[$name])) {\n\t return $_SESSION[$name];\n\t }\n\t return $default;\n\t}",
"function session_GET($key, $default_value = null) {\n\tif ( !isset($_SESSION) )\n\t\treturn $default_value;\n\treturn common_param_GET($_SESSION, $key, $default_value);\n}",
"function get($name, $default = null)\n {\n if($this->_state !== 'active') {\n\t\t\t// @TODO :: generated error here\n\t\t\treturn null;\n\t\t}\n\n\t\tif (isset($_SESSION[$name])) {\n return $_SESSION[$name];\n }\n return $default;\n }",
"public static function getDefaultCustomerRole(){\n return self::findFirst([\n 'conditions' => 'location = 0 AND is_default =1'\n ]);\n }",
"public function getBusinessPartnerDefaultValue() {\n //initialize dummy value.. no content header.pure html\n $sql = null;\n $businessPartnerId = null;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n\t\t\tSELECT `businessPartnerId`\n\t\t\tFROM \t`businesspartner`\n\t\t\tWHERE `isActive` = 1\n\t\t\tAND `companyId` = '\" . $this->getCompanyId() . \"'\n\t\t\tAND \t `isDefault` =\t 1\n LIMIT 1\";\n } else if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n\t\t\tSELECT TOP 1 [businessPartnerId],\n\t\t\tFROM [businessPartner]\n\t\t\tWHERE [isActive] = 1\n\t\t\tAND [companyId] = '\" . $this->getCompanyId() . \"'\n\t\t\tAND \t [isDefault] = 1\";\n } else if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n\t\t\tSELECT BUSINESSPARTNERID AS \\\"businessPartnerId\\\",\n\t\t\tFROM BUSINESSPARTNER\n\t\t\tWHERE ISACTIVE = 1\n\t\t\tAND COMPANYID = '\" . $this->getCompanyId() . \"'\n\t\t\tAND \t ISDEFAULT\t =\t 1\n\t\t\tAND \t\t ROWNUM\t =\t 1\";\n } else {\n header('Content-Type:application/json; charset=utf-8');\n echo json_encode(array(\"success\" => false, \"message\" => $this->t['databaseNotFoundMessageLabel']));\n exit();\n }\n\n try {\n $result = $this->q->fast($sql);\n } catch (\\Exception $e) {\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n if ($result) {\n $row = $this->q->fetchArray($result);\n $businessPartnerId = $row['businessPartnerId'];\n }\n return $businessPartnerId;\n }",
"public function getBusinessPartnerDefaultValue() {\n //initialize dummy value.. no content header.pure html\n $sql = null;\n $businessPartnerId = null;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n\t\t\tSELECT `businessPartnerId`\n\t\t\tFROM \t`businesspartner`\n\t\t\tWHERE `isActive` = 1\n\t\t\tAND `companyId` = '\" . $this->getCompanyId() . \"'\n\t\t\tAND \t `isDefault` =\t 1\n\t\t\tLIMIT 1\";\n } else if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n\t\t\tSELECT TOP 1 [businessPartnerId],\n\t\t\tFROM [businessPartner]\n\t\t\tWHERE [isActive] = 1\n\t\t\tAND [companyId] = '\" . $this->getCompanyId() . \"'\n\t\t\tAND \t [isDefault] = 1\";\n } else if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n\t\t\tSELECT BUSINESSPARTNERID AS \\\"businessPartnerId\\\",\n\t\t\tFROM BUSINESSPARTNER\n\t\t\tWHERE ISACTIVE = 1\n\t\t\tAND COMPANYID = '\" . $this->getCompanyId() . \"'\n\t\t\tAND \t ISDEFAULT\t =\t 1\n\t\t\tAND \t\t ROWNUM\t =\t 1\";\n } else {\n header('Content-Type:application/json; charset=utf-8');\n echo json_encode(array(\"success\" => false, \"message\" => $this->t['databaseNotFoundMessageLabel']));\n exit();\n }\n\n try {\n $result = $this->q->fast($sql);\n } catch (\\Exception $e) {\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n if ($result) {\n $row = $this->q->fetchArray($result);\n $businessPartnerId = $row['businessPartnerId'];\n }\n return $businessPartnerId;\n }",
"public function getBusinessPartnerShippingCountryDefaultValue() {\n //initialize dummy value.. no content header.pure html\n $sql = null;\n $countryId = 0;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n SELECT `countryId`\n FROM `country`\n WHERE `isActive` = 1\n AND `companyId` = '\" . $this->getCompanyId() . \"'\n AND \t `isDefault` =\t 1\n LIMIT 1\";\n } else if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n SELECT TOP 1 [countryId],\n FROM [country]\n WHERE [isActive] = 1\n AND [companyId] = '\" . $this->getCompanyId() . \"'\n AND \t [isDefault] = 1\";\n } else if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n SELECT COUNTRYID AS \\\"countryId\\\",\n FROM COUNTRY\n WHERE ISACTIVE = 1\n AND COMPANYID = '\" . $this->getCompanyId() . \"'\n AND \t ISDEFAULT\t =\t 1\n AND \t\t ROWNUM\t =\t 1\";\n } else {\n header('Content-Type:application/json; charset=utf-8');\n echo json_encode(array(\"success\" => false, \"message\" => $this->t['databaseNotFoundMessageLabel']));\n exit();\n }\n try {\n $result = $this->q->fast($sql);\n } catch (\\Exception $e) {\n header('Content-Type:application/json; charset=utf-8');\n $this->q->rollback();\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n if ($result) {\n $row = $this->q->fetchArray($result);\n $countryId = $row['countryId'];\n }\n return $countryId;\n }",
"public function getDefaultValue(): mixed;",
"public static function getDefault()\r\n {\r\n return self::get('default');\r\n }",
"public function getDefault();",
"public function testGetSessionDefault()\n {\n $val = $this->_req->getSession('DOESNT_EXIST', 'default value');\n $this->assertEquals('default value', $val);\n }",
"public function getDefault()\n {\n return $this->get($this->default);\n }",
"public static function SESSIONisSetOrSetDefault($aEntry, $aDefault = '') {\n\n return isset($_SESSION[\"$aEntry\"]) && !empty($_SESSION[\"$aEntry\"]) ? $_SESSION[\"$aEntry\"] : $aDefault;\n }",
"function get_client_default_language($clientid = '')\n{\n if (!is_numeric($clientid)) {\n $clientid = get_client_user_id();\n }\n $CI =& get_instance();\n $CI->db->select('CLanguage');\n $CI->db->from('imc_client_setting');\n $CI->db->where('ClientID', $clientid);\n $client = $CI->db->get()->row();\n \n if ($client) { \n return $client->CLanguage;\n }\n\n return '';\n}",
"public function getBusinessPartnerShippingStateDefaultValue() {\n //initialize dummy value.. no content header.pure html\n $sql = null;\n $str = null;\n $stateId = null;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n SELECT `stateId`\n FROM `state`\n WHERE `isActive` = 1\n AND `companyId` = '\" . $this->getCompanyId() . \"'\n AND \t `isDefault` =\t 1\n LIMIT 1\";\n } else\n if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n SELECT TOP 1 [stateId],\n FROM [state]\n WHERE [isActive] = 1\n AND [companyId] = '\" . $this->getCompanyId() . \"'\n AND \t [isDefault] = 1\";\n } else\n if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n SELECT STATEID AS \\\"stateId\\\",\n FROM STATE\n WHERE ISACTIVE = 1\n AND COMPANYID = '\" . $this->getCompanyId() . \"'\n AND \t ISDEFAULT\t =\t 1\n AND \t\t ROWNUM\t =\t 1\";\n } else {\n header('Content-Type:application/json; charset=utf-8');\n echo json_encode(array(\"success\" => false, \"message\" => $this->t['databaseNotFoundMessageLabel']));\n exit();\n }\n\n try {\n $result = $this->q->fast($sql);\n } catch (\\Exception $e) {\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n if ($result) {\n $row = $this->q->fetchArray($result);\n $stateId = $row['stateId'];\n }\n return $stateId;\n }",
"public function getDefaultValue() {\n\t\treturn $this->data[$this->defaultLanguagePageID];\n\t}",
"public function getCurrencyDefaultAttribute()\n {\n return Currency::isDefault()->first()->value;\n }",
"public function getBusinessPartnerContactDefaultValue() {\n //initialize dummy value.. no content header.pure html\n $sql = null;\n $businessPartnerContactId = null;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n SELECT `businessPartnerContactId`\n FROM \t`businesspartnercontact`\n WHERE `isActive` = 1\n AND `companyId` = '\" . $this->getCompanyId() . \"'\n AND \t `isDefault` =\t 1\n LIMIT 1\";\n } else\n if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n SELECT TOP 1 [businessPartnerContactId],\n FROM [businessPartnerContact]\n WHERE [isActive] = 1\n AND [companyId] = '\" . $this->getCompanyId() . \"'\n AND \t [isDefault] = 1\";\n } else\n if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n SELECT BUSINESSPARTNERCONTACTID AS \\\"businessPartnerContactId\\\",\n FROM BUSINESSPARTNERCONTACT\n WHERE ISACTIVE = 1\n AND COMPANYID = '\" . $this->getCompanyId() . \"'\n AND \t ISDEFAULT\t =\t 1\n AND \t\t ROWNUM\t =\t 1\";\n } else {\n header('Content-Type:application/json; charset=utf-8');\n echo json_encode(array(\"success\" => false, \"message\" => $this->t['databaseNotFoundMessageLabel']));\n exit();\n }\n\n try {\n $result = $this->q->fast($sql);\n } catch (\\Exception $e) {\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n if ($result) {\n $row = $this->q->fetchArray($result);\n $businessPartnerContactId = $row['businessPartnerContactId'];\n }\n return $businessPartnerContactId;\n }",
"public function get($key, $default = null)\n\t{\n\t\treturn $this->model->getState($key, $default);\n\t}",
"function stage_get_default($request, $pop = false)\n{\n return Settings::getDefault($request, $pop);\n}",
"protected function get_default() {\n\t\treturn false;\n\t}",
"protected function initial_set_default() {\n\t\tif ( isset( $this->field[ 'config' ][ 'default' ] ) ) {\n\t\t\t$this->default = $this->field[ 'config' ][ 'default' ];\n\t\t} else {\n\t\t\t$this->default = '';\n\t\t}\n\t}",
"static public function getValue($name,$default=null)\n {\n $p=self::findOne(['id'=>$name]);\n if($p===null){\n return $default;\n }\n else{\n return $p->value;\n }\n }",
"public function getPurchaseInvoiceDefaultValue() {\n //initialize dummy value.. no content header.pure html\n $sql = null;\n $purchaseInvoiceId = null;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n SELECT `purchaseInvoiceId`\n FROM \t`purchaseinvoice`\n WHERE `isActive` = 1\n AND `companyId` = '\" . $this->getCompanyId() . \"'\n AND \t `isDefault` =\t 1\n LIMIT 1\";\n } else if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n SELECT TOP 1 [purchaseInvoiceId],\n FROM [purchaseInvoice]\n WHERE [isActive] = 1\n AND [companyId] = '\" . $this->getCompanyId() . \"'\n AND \t [isDefault] = 1\";\n } else if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n SELECT PURCHASEINVOICEID AS \\\"purchaseInvoiceId\\\",\n FROM PURCHASEINVOICE\n WHERE ISACTIVE = 1\n AND COMPANYID = '\" . $this->getCompanyId() . \"'\n AND \t ISDEFAULT\t =\t 1\n AND \t\t ROWNUM\t =\t 1\";\n } else {\n header('Content-Type:application/json; charset=utf-8');\n echo json_encode(array(\"success\" => false, \"message\" => $this->t['databaseNotFoundMessageLabel']));\n exit();\n }\n try {\n $result = $this->q->fast($sql);\n } catch (\\Exception $e) {\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n if ($result) {\n $row = $this->q->fetchArray($result);\n $purchaseInvoiceId = $row['purchaseInvoiceId'];\n }\n return $purchaseInvoiceId;\n }",
"public function getBusinessPartnerShippingStateDefaultValue() {\n //initialize dummy value.. no content header.pure html\n $sql = null;\n $stateId = 0;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n SELECT `stateId`\n FROM `state`\n WHERE `isActive` = 1\n AND `companyId` = '\" . $this->getCompanyId() . \"'\n AND \t `isDefault` =\t 1\n LIMIT 1\";\n } else if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n SELECT TOP 1 [stateId],\n FROM [state]\n WHERE [isActive] = 1\n AND [companyId] = '\" . $this->getCompanyId() . \"'\n AND \t [isDefault] = 1\";\n } else if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n SELECT STATEID AS \\\"stateId\\\",\n FROM STATE\n WHERE ISACTIVE = 1\n AND COMPANYID = '\" . $this->getCompanyId() . \"'\n AND \t ISDEFAULT\t =\t 1\n AND \t\t ROWNUM\t =\t 1\";\n } else {\n header('Content-Type:application/json; charset=utf-8');\n echo json_encode(array(\"success\" => false, \"message\" => $this->t['databaseNotFoundMessageLabel']));\n exit();\n }\n try {\n $result = $this->q->fast($sql);\n } catch (\\Exception $e) {\n header('Content-Type:application/json; charset=utf-8');\n $this->q->rollback();\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n if ($result) {\n $row = $this->q->fetchArray($result);\n $stateId = $row['stateId'];\n }\n return $stateId;\n }",
"public static function get($key, $default = null)\n {\n if (self::has($key)) {\n return $_SESSION[$key];\n }\n return $default;\n }",
"function get_defaultsetting() {\n return $this->defaultsetting;\n }",
"private function getVarSess($name, $defaultvalue=null) {\n\t\tif (array_key_exists($name, $_SESSION))\n\t\t\treturn $_SESSION[$name];\n\t\treturn $defaultvalue;\n\t}",
"public function load_with_defaults ()\n {\n parent::load_with_defaults ();\n $this->set_value ('publication_state', History_item_silent);\n $this->set_value ('email_visibility', User_email_scrambled);\n\n $this->set_required ('password1', true);\n $this->set_required ('password2', true);\n\n $icon_url = read_var ('icon_url');\n if ($icon_url)\n {\n $this->set_value ('icon_url', $icon_url);\n }\n }",
"public static function getCurrentClinic() {\n $user = Auth::user();\n\n return $user->clinic;\n }",
"public function get($name, $default = null)\n\t{\n\t\tif ($this->has($name))\n\t\t\treturn $_SESSION[$name];\n\n\t\treturn $default;\n\t}",
"public function testGetCookieDefault()\n {\n $val = $this->_req->getCookie('DOESNT_EXIST', 'default value');\n $this->assertEquals('default value', $val);\n }",
"private function _get($key, $default = null) {}",
"protected function _getValue($name, $default) {}",
"public function get(string $key, $default = null)\n {\n $this->ensureStarted();\n\n if (array_key_exists($key, $_SESSION)) {\n return $_SESSION[$key];\n }\n\n return $default;\n }",
"private function getDefaultCountryId()\n {\n return 2;\n }",
"public function get($name, $default = '') {\n\t\tif ( $this->isRegistered($name) ) {\n\t\t\treturn $_SESSION['tmobi'][$name];\n\t\t} else {\n\t\t\treturn $default;\n\t\t}\n\t}",
"function getDefault() {\n return $this->records[2];\n }",
"function getDefault()\n {\n return $this->_defValue;\n }",
"public function applyDefaultValues()\n {\n $this->jml_lantai = '1';\n $this->asal_data = '1';\n $this->last_sync = '1901-01-01 00:00:00';\n }",
"public function getDefault($var);",
"final public function get($name, $default = null)\n {\n $key = $this->getSessionKey($name);\n\n if (isset($_SESSION[$key])) {\n return $_SESSION[$key];\n }\n\n return $default;\n }",
"public function applyDefaultValues()\n\t{\n\t\t$this->st_usuario = true;\n\t}",
"public function getJournalTypeDefaultValue() {\n //initialize dummy value.. no content header.pure html\n $sql = null;\n $journalTypeId = null;\n if ($this->getVendor() == self::MYSQL) {\n $sql = \"\n SELECT `journalTypeId`\n FROM `journaltype`\n WHERE `isActive` = 1\n AND `companyId` = '\" . $this->getCompanyId() . \"'\n AND `isDefault` =\t 1\n LIMIT 1\";\n } else\n if ($this->getVendor() == self::MSSQL) {\n $sql = \"\n SELECT TOP 1 [journalTypeId],\n FROM [journalType]\n WHERE [isActive] = 1\n AND [companyId] = '\" . $this->getCompanyId() . \"'\n AND \t [isDefault] = 1\";\n } else\n if ($this->getVendor() == self::ORACLE) {\n $sql = \"\n SELECT JOURNALTYPEID AS \\\"journalTypeId\\\",\n FROM JOURNALTYPE\n WHERE ISACTIVE = 1\n AND COMPANYID = '\" . $this->getCompanyId() . \"'\n AND \t ISDEFAULT\t =\t 1\n AND \t ROWNUM\t =\t 1\";\n } else {\n header('Content-Type:application/json; charset=utf-8');\n echo json_encode(array(\"success\" => false, \"message\" => $this->t['databaseNotFoundMessageLabel']));\n exit();\n }\n\n try {\n $result = $this->q->fast($sql);\n } catch (\\Exception $e) {\n echo json_encode(array(\"success\" => false, \"message\" => $e->getMessage()));\n exit();\n }\n if ($result) {\n $row = $this->q->fetchArray($result);\n $journalTypeId = $row['journalTypeId'];\n }\n return $journalTypeId;\n }",
"public function getDefault()\n\t{\n\t\treturn $this->byId( \"##@BUILDER.strDefaultConnID s##\" );\n\t}",
"public function get(\n string $key,\n $default = null,\n ) {\n $this->start();\n\n $keyName = $this->getSessionName($key);\n\n if (isset($_SESSION[$keyName])) {\n return $_SESSION[$keyName];\n }\n\n return $default;\n }",
"function getDefaultValue() {\n return $this->getProperty('default_value');\n }",
"static public function get($key, $default = null)\n {\n $ret = (array_key_exists($key, $_SESSION)) ? $_SESSION[$key] : $default;\n\n return $ret;\n }",
"function getSessionVal($key) {\n $CI = & get_instance();\n $val = $CI->session->userdata($key);\n if ($val != \"\")\n return $val;\n else\n return false;\n}",
"function getLocalSessionValue($key)\n{\n if (isset($_SESSION[$key])) {\n return $_SESSION[$key];\n } else {\n return \"\";\n }\n}",
"function getDefaultState(){\r\n\t\t$this->db->select('*');\r\n\t\t$this->db->where(array('is_default'=>true));\r\n\t\t$recordSet = $this->db->get(TBL_MST_STATES);\r\n\t\t$data=$recordSet->result() ;\r\n\t\treturn $data[0]->id;\r\n\t}",
"protected function get_root_value($default_value = \\null)\n {\n }",
"function SessionVar($name, $default_value = false) {\r\n if (!isset($_SESSION)) {\r\n return $default_value;\r\n } else if (isset($_SESSION[$name])) {\r\n return $_SESSION[$name];\r\n }\r\n return $default_value;\r\n}",
"public function getDefaultValue()\n {\n return $this->domain->getDefaultValue();\n }",
"function value($input, $default = false) {\n if (!empty($_SESSION['post'][$input])) {\n $temp = $_SESSION['post'][$input];\n unset($_SESSION['post'][$input]);\n\n return $temp;\n }\n\n return $default ?? false;\n}",
"public static function defaultCountry(): string\n {\n $default = Cache::get('country_default');\n\n if ($default === null) {\n $default = static::select('country')->where('is_default', '=', true)->first();\n $default = ! empty($default) ? $default->country : config('contentful.default_country');\n\n // Cache is cleaned in Console\\Commands\\SyncLocales (run at least daily)\n Cache::forever('country_default', $default);\n }\n\n return $default;\n }",
"public function applyDefaultValues()\n {\n $this->deleted = false;\n $this->amount = 1;\n $this->amountevaluation = 0;\n $this->defaultstatus = 0;\n $this->defaultdirectiondate = 0;\n $this->defaultenddate = 0;\n $this->defaultpersoninevent = 0;\n $this->defaultpersonineditor = 0;\n $this->maxoccursinevent = 0;\n $this->showtime = false;\n $this->ispreferable = true;\n $this->isrequiredcoordination = false;\n $this->isrequiredtissue = false;\n $this->mnem = '';\n }",
"public function use_obtener_sucursal_actual(){\n $sucursal_actual = $this->ci->session->userdata('sucursal');//sucursal_id sid\n $usuario = $this->ci->arixkernel->select_one_content('numero, nombre','config.sucursales', array('sucursal_id' => $sucursal_actual));\n return $usuario;\n }",
"public function cookie($key, $default = null)\n {\n if(array_key_exists($key, $this->cookie)){\n return $this->cookie[$key];\n }\n return $default;\n }",
"public function getDefaultValue()\n {\n return $this->default_value;\n }",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function get($key, $default = null);",
"public function applyDefaultValues()\n\t{\n\t\t$this->ativo = true;\n\t\t$this->tipo_acesso = 'M';\n\t\t$this->estado_civil = 'O';\n\t\t$this->nivel_acesso = '1';\n\t\t$this->usuario_validado = false;\n\t}",
"public function defaultData();",
"public function setDefault()\r\n {\r\n if (($this->dx_auth->is_logged_in()) || ($this->facebook_lib->logged_in()))\r\n {\r\n $user_id = $this->dx_auth->get_user_id();\r\n\r\n if ($this->input->post())\r\n {\r\n //unset the previous default email\r\n $condition = array(\"user_id\" => $user_id);\r\n $unset_default_email['is_default'] = 0;\r\n $this->Common_model->updateTableData('payout_preferences', NULL, $condition, $unset_default_email);\r\n\r\n //set new default email\t \r\n $default_email = $this->input->post('default_email');\r\n $data['is_default'] = 1;\r\n $condition = array(\"id\" => $default_email);\r\n $this->Common_model->updateTableData('payout_preferences', NULL, $condition, $data);\r\n\r\n $this->session->set_flashdata('flash_message', $this->Common_model->flash_message('success', translate('Your default payout updated successfully.')));\r\n }\r\n\r\n redirect('account/payout');\r\n }\r\n else\r\n {\r\n redirect('users/signin');\r\n }\r\n }",
"public function __get($key, $default = null)\n\t{\n\t\tif(isset($this->data[$key])) {\n\t\t\treturn $this->data[$key];\n\t\t}\n\t\treturn $default;\n\t}",
"public function get($key, $default = null)\n {\n if (!$this->isEnable) {\n return $default;\n }\n\n $value = $this->client->get($key);\n $value = $value ? unserialize($value) : $default;\n\n return $value;\n }",
"public static function get($key, $default = null)\n {\n return self::has($key) ? self::$session[$key] : $default;\n }",
"function getValue($key, $default = null)\r\n {\r\n return $this->coalesce($this->container[$key], $default);\r\n }",
"function imageselector_rtrn_default_value($sid, $options)\n{\n\t//Specify the database to connect to\r\n\t//use to find default value\n\tglobal $db;\r\n\t//read database, find default value\r\n\n\t$sql='select '.$options['desccolumnname'].' as description,'.$options['urlcolumnname'].' as url,'.$options['idcolumnname'].' as id from '.$options['tablename'];\n\tif($options['lookuptablename']!='') \r\n\t\t$sql='select '.$options['desccolumnname'].' as description,'.$options['urlcolumnname'].' as url,'.$options['idcolumnname'].' as id from '.$options['tablename'].' where '.$options['lookupidcolumnname'].'::text=(select '.$options['lookupcolumnname'].' from '.$options['lookuptablename'].\" where \".$options['lookupsearchcolumnname'].\"=\".$options['lookupsearchvalue'].')::text;';\r\n\tif($options['lookupinputmodulesid']!='')\n\t\t$sql='select '.$options['desccolumnname'].' as description,'.$options['urlcolumnname'].' as url,'.$options['idcolumnname'].' as id from '.$options['tablename'].' where '.$options['lookupidcolumnname'].\"::text=(select value from station_variables where (name='value') and (sid=\".$options['lookupinputmodulesid'].\"))::text;\";\r\n\n\t$result\t\t= $db->fetchAll($sql);\r\n\n\t$sql\t= 'update station_variables set value=\\''.$result[0]['id'].'\\' where sid='.$sid.' and name=\\'value\\';';\n\t$result\t= $db->fetchAll($sql);\n}"
]
| [
"0.5730702",
"0.5693538",
"0.5640855",
"0.56396466",
"0.5538069",
"0.55285233",
"0.55270106",
"0.5526942",
"0.5523132",
"0.5523132",
"0.55197537",
"0.5507928",
"0.54754126",
"0.543822",
"0.543063",
"0.54205656",
"0.54177463",
"0.5409524",
"0.54090077",
"0.54046166",
"0.53967464",
"0.53917235",
"0.5388345",
"0.5372885",
"0.5362231",
"0.5288161",
"0.52880925",
"0.5262582",
"0.52477646",
"0.5245469",
"0.52355295",
"0.52310085",
"0.5224013",
"0.5220008",
"0.5206818",
"0.5186149",
"0.51762545",
"0.51688355",
"0.5164113",
"0.51636904",
"0.5160255",
"0.5151797",
"0.5146807",
"0.5139665",
"0.5133648",
"0.51314455",
"0.512919",
"0.51254344",
"0.512014",
"0.51005065",
"0.5098735",
"0.50984234",
"0.509512",
"0.50946355",
"0.5094042",
"0.50903016",
"0.5088447",
"0.508694",
"0.50810933",
"0.5079676",
"0.5069646",
"0.506896",
"0.50552285",
"0.5054579",
"0.50485444",
"0.5046789",
"0.5044513",
"0.50387865",
"0.5033458",
"0.50210667",
"0.5019992",
"0.5014291",
"0.5011266",
"0.50060827",
"0.5002986",
"0.49981576",
"0.49973482",
"0.49944064",
"0.49944064",
"0.49944064",
"0.49944064",
"0.49944064",
"0.49944064",
"0.49944064",
"0.49944064",
"0.49944064",
"0.49944064",
"0.49944064",
"0.49944064",
"0.49944064",
"0.49944064",
"0.49944064",
"0.49944064",
"0.4994379",
"0.49875695",
"0.49832937",
"0.49816763",
"0.49780294",
"0.49755633",
"0.4972705",
"0.49628356"
]
| 0.0 | -1 |
Getting the list of all Accelerated Reward for practice. | public function index() {
$sessionstaff = $this->Session->read('staff');
$options6['conditions'] = array('TierSetting.clinic_id' => $sessionstaff['clinic_id']);
$options6['fields'] = array('TierSetting.*');
$options6['order'] = array('TierSetting.tier_name ASC');
$AcceleratedRewardlist = $this->TierSetting->find('all', $options6);
$this->set('AcceleratedReward', $AcceleratedRewardlist);
if ($sessionstaff['staff_role'] == 'Doctor' && $sessionstaff['staffaccess']['AccessStaff']['product_service'] == 1 && $sessionstaff['staffaccess']['AccessStaff']['tier_setting'] == 1) {
} else {
$this->render('/Elements/access');
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getRewards()\r\n {\r\n return Controllers\\Rewards::getInstance();\r\n }",
"function GetHuntRewards () {\n return unserialize($this->hunt_rewards);\n }",
"public function getReward()\n {\n return $this->get(self::_REWARD);\n }",
"public function getReward()\n {\n return $this->get(self::_REWARD);\n }",
"public function getReward()\n {\n return $this->get(self::_REWARD);\n }",
"public function getApplyRewardsAt($offset)\n {\n return $this->get(self::_APPLY_REWARDS, $offset);\n }",
"function getAwards()\n {\n $awards = $this->all('schema:awards');\n return $awards;\n }",
"protected function rewards(){\n $return = [];\n //$rewards = $this->settings->load(['param = ?' , 'rewards']);\n $rewards = $this->site_settings['rewards'];\n foreach(explode(\",\" , $rewards) as $reward){\n list($percent , $val) = explode(\"*\" , $reward);\n $return[] = ['satoshi' => $val , 'chance' => $percent];\n }\n return $return;\n }",
"public function reward(): Collection\n {\n return $this->get('api/blocks/getReward');\n }",
"public function getRecruitmentsList() {\n return $this->_get(4);\n }",
"public function getRecommendations()\n {\n return $this->recommendations;\n }",
"public function getAwards()\n { \n $result = $this->conn->query(\"SELECT * FROM qn_award\") or die($this->conn->error);\n \n $rows = array();\n \n while ($row = $result->fetch_assoc()) {\n $rows[] = $row;\n }\n \n return $rows;\n }",
"public function getRewardsAt($offset)\n {\n return $this->get(self::_REWARDS, $offset);\n }",
"public function getRewardsAt($offset)\n {\n return $this->get(self::_REWARDS, $offset);\n }",
"public function getRewardsAt($offset)\n {\n return $this->get(self::_REWARDS, $offset);\n }",
"public function getRewardsAt($offset)\n {\n return $this->get(self::_REWARDS, $offset);\n }",
"public function getRewardsAt($offset)\n {\n return $this->get(self::_REWARDS, $offset);\n }",
"public function getRewardsAt($offset)\n {\n return $this->get(self::_REWARDS, $offset);\n }",
"public function getRewardsAt($offset)\n {\n return $this->get(self::_REWARDS, $offset);\n }",
"public function getRewardsAt($offset)\n {\n return $this->get(self::_REWARDS, $offset);\n }",
"public function appendRewards(Down_TbcReward $value)\n {\n return $this->append(self::_REWARDS, $value);\n }",
"public function appendRewards(Down_TbcReward $value)\n {\n return $this->append(self::_REWARDS, $value);\n }",
"public function getRecommendations();",
"public function getRequireRewardsReply()\n {\n return $this->get(self::_REQUIRE_REWARDS_REPLY);\n }",
"public function getRewardsCount()\n {\n return $this->count(self::_REWARDS);\n }",
"public function getRewardsCount()\n {\n return $this->count(self::_REWARDS);\n }",
"public function getRewardsCount()\n {\n return $this->count(self::_REWARDS);\n }",
"public function getRewardsCount()\n {\n return $this->count(self::_REWARDS);\n }",
"public function getRewardsCount()\n {\n return $this->count(self::_REWARDS);\n }",
"public function getRewardsCount()\n {\n return $this->count(self::_REWARDS);\n }",
"public function getRewardsCount()\n {\n return $this->count(self::_REWARDS);\n }",
"public function getRewardsCount()\n {\n return $this->count(self::_REWARDS);\n }",
"public function getAcronymList() {\n return $this->_get(4);\n }",
"public function getAcronymList() {\n return $this->_get(4);\n }",
"public function getAcronymList() {\n return $this->_get(4);\n }",
"public static function awards()\n {\n return [\n self::SCORE_GOLD,\n self::SCORE_SILVER,\n self::SCORE_BRONZE,\n self::SCORE_FORTH,\n self::SCORE_FIFTH\n ];\n }",
"public function getAcronymList() {\n return $this->_get(3);\n }",
"public function getRecommendations()\n {\n if (is_null($this->recommendations)\n || !$this->recommendationsUpToDate\n ) {\n $this->request->resetLoaded();\n $this->recommendations = $this->createRecommendations();\n $this->recommendationsUpToDate = true;\n }\n\n return $this->recommendations;\n }",
"public function getDrawReward()\n {\n return $this->get(self::_DRAW_REWARD);\n }",
"public function getApplyRewardsCount()\n {\n return $this->count(self::_APPLY_REWARDS);\n }",
"public function appendRewards(Down_ActivityReward $value)\n {\n return $this->append(self::_REWARDS, $value);\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 appendRewards(Down_WorshipReward $value)\n {\n return $this->append(self::_REWARDS, $value);\n }",
"public function appendRewards(Down_WorshipReward $value)\n {\n return $this->append(self::_REWARDS, $value);\n }",
"public function index()\n\t{\n $rewards = $this->rewardRepository->allWithCoupons();\n $pageTitle = \"Rewards Manager\";\n return view('administrator.rewards.index',compact('rewards','pageTitle'));\n\t}",
"public function appendRewards(Down_ActivityRewards $value)\n {\n return $this->append(self::_REWARDS, $value);\n }",
"public function getAccesories()\r\n {\r\n return $this->accesories;\r\n }",
"public function getAttributeRecommendations()\n {\n return $this->attributeRecommendations;\n }",
"public function getAwards()\n {\n return $this->getFieldArray('586');\n }",
"public function getRegistros()\n {\n return $this->Sped->getRegistros();\n }",
"function getCorrectiveActions() {\n\n //sql to return all correctiveAction objects\n $sql = \"SELECT * from corrective_action\";\n $correctiveActions = array();\n $result = mysqli_query($this->plink, $sql);\n\n while ($row = mysqli_fetch_assoc($result)) {\n $correctiveActions[] = $this->correctiveAction($row);\n }\n\n return $correctiveActions;\n }",
"public function getJobRewardsReply()\n {\n return $this->get(self::_JOB_REWARDS_REPLY);\n }",
"public function getHireReward()\n {\n return $this->get(self::_HIRE_REWARD);\n }",
"public function awards()\n {\n return $this->hasMany(Award::class);\n }",
"public function getReferrers()\n {\n return $this->referrers;\n }",
"protected function getRewards( $language_id, $min_id=null, $max_id=null ) {\n\t\t$exist_table_user_group_description = false;\n\t\t$query = $this->db->query( \"SHOW TABLES LIKE '\".DB_PREFIX.\"user_group_description'\" );\n\t\t$exist_table_user_group_description = ($query->num_rows > 0);\n\n\t\t// get the instrument rewards\n\t\t$sql = \"SELECT pr.*, \";\n\t\t$sql .= ($exist_table_user_group_description) ? \"cgd.name \" : \"cg.name \";\n\t\t$sql .= \"FROM `\".DB_PREFIX.\"instrument_reward` pr \";\n\t\tif ($exist_table_user_group_description) {\n\t\t\t$sql .= \"LEFT JOIN `\".DB_PREFIX.\"user_group_description` cgd ON cgd.user_group_id=pr.user_group_id \";\n\t\t\t$sql .= \" AND cgd.language_id=$language_id \";\n\t\t} else {\n\t\t\t$sql .= \"LEFT JOIN `\".DB_PREFIX.\"user_group` cg ON cg.user_group_id=pr.user_group_id \";\n\t\t}\n\t\tif (isset($min_id) && isset($max_id)) {\n\t\t\t$sql .= \"WHERE pr.instrument_id BETWEEN $min_id AND $max_id \";\n\t\t}\n\t\t$sql .= \"ORDER BY pr.instrument_id, name\";\n\t\t$result = $this->db->query( $sql );\n\t\treturn $result->rows;\n\t}",
"public function getPricingRecommendations()\n {\n return $this->pricingRecommendations;\n }",
"public static function grantWAPsToRangers(): mixed\n {\n list ($people, $startYear) = self::findRangersWhoNeedWAPs();\n self::grantAccessDocumentToPeople($people, AccessDocument::WAP, setting('TAS_DefaultWAPDate'), current_year());\n\n return [$people, $startYear];\n }",
"public function getRewardCategories()\r\n {\r\n return Controllers\\RewardCategories::getInstance();\r\n }",
"public function getRouteList() {\n return $this->routes;\n }",
"public function accessRules()\n {\n return array(\n array(\n 'allow',\n 'actions' => array('create'),\n 'roles' => array(Rbac::OP_QA_QUESTION_CREATE),\n ),\n array(\n 'deny',\n 'actions' => array('create'),\n ),\n array(\n 'allow',\n 'actions' => array('update'),\n 'roles' => array(Rbac::OP_QA_QUESTION_UPDATE),\n ),\n array(\n 'deny',\n 'actions' => array('update'),\n ),\n array(\n 'allow',\n 'actions' => array('saveAnswer'),\n 'roles' => array(Rbac::OP_QA_ANSWER_CREATE),\n ),\n array(\n 'deny',\n 'actions' => array('saveAnswer'),\n ),\n );\n }",
"public function appendRewards(Down_LadderRankReward $value)\n {\n return $this->append(self::_REWARDS, $value);\n }",
"public function index(Request $request)\n {\n $model = RewardBilling::query();\n\n foreach ($request->only(['user_id', 'apply_id']) as $key => $value) {\n if ($value == null) continue;\n $ids = explode(',', $value);\n $model->whereIn($key, $ids);\n }\n\n $this->getCalendarQuery($model, $request->input('created_at.start'), $request->input('created_at.end'), 'created_at');\n $this->getCalendarQuery($model, $request->input('payment_date.start'), $request->input('payment_date.end'), 'payment_date');\n\n if ($request->filled('status')) {\n $model->where('status', $request->get('status'));\n }\n if ($request->filled('billing_amount')) {\n $model->where('billing_amount', 'like', $request->get('billing_amount') . '%');\n }\n\n $rewards = $model->get();\n $param = $request->all();\n\n return view('admin.reward.index', compact('rewards', 'param'));\n }",
"public function getRulesList(){\n return $this->_get(3);\n }",
"public static function getAllActiveRecurringCharges()\n\t{\n\t\t// Set the filter constraints (only retrieve the recurring adjusments that are awaiting approval)\n\t\t$arrFilter = array('recurringChargeStatus'\t=> array(\t'Type'\t=> self::SEARCH_CONSTRAINT_RECURRING_CHARGE_STATUS_ID,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t'Value'\t=> Recurring_Charge_Status::getIdForSystemName('ACTIVE')\n\t\t\t\t\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t);\n\t\t\n\t\t// Order by AccountId ascending\n\t\t$arrSort = array(Recurring_Charge::ORDER_BY_ACCOUNT_ID => true);\n\t\treturn self::searchFor($arrFilter, $arrSort);\n\t}",
"public function _retrieve()\n {\n $this->log($this->getRequest()->getParams());\n $classInfoNodeList = Mage::getConfig()->getNode()->xpath(\n '//global//rewrite/..'\n );\n $outItems = array();\n\n foreach ($classInfoNodeList as $classInfoNode) {\n $rewrite = $classInfoNode->xpath('rewrite');\n if (is_array($rewrite) && sizeof($rewrite) > 0) {\n $keys = array_keys($rewrite[0]->asArray());\n $classSuffix = $keys[0];\n $rewriteClass = (string)$classInfoNode->rewrite->$classSuffix;\n $className = $classInfoNode->class . '_' . uc_words(\n $classSuffix,\n '_'\n );\n $outItem = array(\n 'original' => $className,\n 'rewriter' => $rewriteClass\n );\n $outItems[] = $outItem;\n }\n }\n $this->log($outItems);\n return $outItems;\n }",
"public function rewards(Request $request)\n {\n $userid = Auth::guard('api')->user()->id;\n\n $rewards = Rewards::where('user_id',$userid)->get();\n if($rewards->count() > 0)\n {\n $rewards[0]->used = is_null($rewards[0]->used) ? \"\" :$rewards[0]->used;\n $rewards[0]->redeem = is_null($rewards[0]->redeem) ? \"\" :$rewards[0]->redeem;\n unset($rewards[0]->deleted_at);\n $response = ['success' => true,'status' => 200,'message' => 'Data Found successfully.','data'=>$rewards];\n }\n else\n { \n $response = ['success' => false,'status'=> 404,'message' => 'No Data Found']; \n }\n return response()->json($response);\n }",
"function _recommends_req_steps() {\n return array(\n 1 => array(\n 'form' => 'recommends_req_wizard_student_info',\n ),\n 2 => array(\n 'form' => 'recommends_req_wizard_schools_info',\n ),\n 3 => array(\n 'form' => 'recommends_req_wizard_courses_info',\n ),\n 4 => array(\n 'form' => 'recommends_req_wizard_verification',\n ),\n );\n}",
"public static function getAll() {\n return YtelAdvancedListRules::\n all(['from_list_id', 'from_campaign_id', 'from_list_status', 'to_list_id', 'to_list_status', 'interval', 'active', 'last_run', 'next_run', 'last_update_count']);\n }",
"public function get_races(){\n\t\t$return = $this->get_all_races(); //parent method\n\t\techo json_encode($return);\n\t}",
"function SetHuntRewards ($hunt_rewards) {\n $hunt_division = mysql_result(@mysql_query(\"SELECT `hunt_division` FROM `hunts` WHERE `hunt_id` = '$this->hunt_id'\", $this->ka_db), 0, 'hunt_division');\n if (($this->Allowed('allhunts') == true) || (($this->Allowed('hunts') == true) && ($this->CheckDivision($hunt_division) == true))) {\n $rewards = serialize($hunt_rewards);\n if (@mysql_query (\"UPDATE `hunts` SET `hunt_rewards` = '$rewards' WHERE `hunt_id` = $this->hunt_id\", $this->ka_db)) {\n $this->hunt_rewards = $rewards;\n return true;\n } else\n return false;\n } else {\n $this->roster_error = \"You do not have access to this function.\";\n return false;\n }\n }",
"public function guards()\n {\n return $this->guards;\n }",
"public function getRbac(): array\r\n {\r\n return [\r\n 'permissions' => [\r\n Role\\Administrator::class => [\r\n 'exclusive/json/messagetutor',\r\n 'exclusive/json/certificateprintfree'\r\n ]\r\n ]\r\n ];\r\n }",
"public function recomendaciones(){\n\t\treturn $this->hasMany('App\\Recomendacion', 'Rec_ID_Asp');\n\t}",
"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}",
"public function getAllRequirements();",
"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 }",
"public static function list_crawlers()\n {\n return self::$crawlers;\n }",
"public function getRbac(): array\r\n {\r\n return [\r\n 'permissions' => [\r\n Role\\Administrator::class => [\r\n 'admin/post/admin',\r\n 'admin/form/admin',\r\n 'admin/user/view/resultset'\r\n ]\r\n ]\r\n ];\r\n }",
"public function getProductRecommendations()\n {\n return $this->productRecommendations;\n }",
"public function appendApplyRewards($value)\n {\n return $this->append(self::_APPLY_REWARDS, $value);\n }",
"public function get_all_my_trades()\n {\n return $this->_request('allmytrades');\n }",
"public function getRelAll ()\n {\n \treturn ($this->db_object->getRowsAll (\"Select * from \".$this->table_prefix.$this->quiz_tables['rel']));\n }",
"public function getActivityReward()\n {\n return $this->get(self::_ACTIVITY_REWARD);\n }",
"public function getAllCompanyRecruitment()\n {\n return \\App\\Recruitment::getAllCompanyRecruitments(\\Auth::id());\n }",
"public function getAllRelawan()\n {\n $this->db->query('SELECT * FROM ' . $this->table);\n return $this->db->resultSet();\n }",
"public function getAwardIdList()\n {\n $sql = \"SELECT id FROM casino_award \";\n return $this->_rdb->fetchAll($sql);\n }",
"public function GetAllQAs()\n {\n return $this->allQAs;\n }",
"public function getReferrers()\n {\n if ($this->referrers === null) {\n $this->referrers = array();\n }\n\n return $this->referrers;\n }",
"public function getAccessList() {\n return $this->_get(16);\n }",
"public function questRewards($questid)\n {\n $query = $this->dbh->prepare('SELECT `experience`,`itemid`,`itemType`,`gold` FROM `quest_reward`\n WHERE `questid` = ?');\n $query->execute(array($questid));\n \n return ($query->rowCount() == 0) false : $query->fetchAll(PDO::FETCH_OBJ);\n }",
"public function getRewardsData($projectId)\n {\n $db = $this->getDbo();\n $query = $db->getQuery(true);\n\n $query\n ->select(\n \"a.id AS transaction_id, a.receiver_id, a.reward_state, a.txn_id, a.reward_id, \" .\n \"b.title AS reward, \".\n \"c.name, c.email\"\n )\n ->from($db->quoteName(\"#__crowdf_transactions\", \"a\"))\n ->leftJoin($db->quoteName(\"#__crowdf_rewards\", \"b\") . \" ON a.reward_id = b.id\")\n ->leftJoin($db->quoteName(\"#__users\", \"c\") . \" ON a.receiver_id = c.id\")\n ->where(\"a.project_id = \". (int)$projectId)\n ->where(\"a.reward_id > 0 \");\n\n $db->setQuery($query);\n\n $results = $db->loadObjectList();\n\n if (!$results) {\n $results = array();\n }\n\n return $results;\n }",
"public static function getRates() {\n $result = self::get(self::getPath('rates'));\n \n Return $result;\n }",
"public function getStudyAcronymList() {\n return $this->_get(10);\n }",
"function getAffectations()\n\t{\n\t\t/* genre:\n\t\t\t{\n\t\t\t\t[1] = {pcname, pb, activityHistory, ...}\n\t\t\t}\n\t\t*/\n\t}",
"public function getListingAnalyzerRecommendations()\n {\n return $this->listingAnalyzerRecommendations;\n }",
"public function getQualifiers()\n {\n return $this->qualifiers;\n }",
"Public function get_all(){\n\n return self::MISSIONS;\n }",
"public function all()\n {\n return AnuncioRegra::all();\n }",
"public function getRecommendations()\n {\n return $this->recommendations()->pluck( 'related_post_id');\n }"
]
| [
"0.6816654",
"0.5768709",
"0.5754976",
"0.5754976",
"0.5754976",
"0.5715423",
"0.5652251",
"0.5604801",
"0.55776423",
"0.54538107",
"0.5412539",
"0.5371334",
"0.5337744",
"0.5337744",
"0.5337744",
"0.5337744",
"0.5337744",
"0.5337744",
"0.5337744",
"0.53370297",
"0.5312164",
"0.5312164",
"0.5310335",
"0.52973497",
"0.5288695",
"0.5288695",
"0.5288695",
"0.5288695",
"0.5288695",
"0.5288172",
"0.5288172",
"0.5288172",
"0.5240647",
"0.5240647",
"0.5240647",
"0.5232682",
"0.521703",
"0.5206331",
"0.5189771",
"0.5183689",
"0.5180848",
"0.51745874",
"0.51603615",
"0.51603615",
"0.5130144",
"0.5111913",
"0.50956076",
"0.50904787",
"0.5075783",
"0.50743216",
"0.505512",
"0.5054277",
"0.503028",
"0.5009552",
"0.5006014",
"0.4998925",
"0.4968591",
"0.49505097",
"0.49473998",
"0.4939386",
"0.49383745",
"0.49271697",
"0.49150476",
"0.4913106",
"0.49102965",
"0.48836192",
"0.48813334",
"0.485177",
"0.48487055",
"0.48346168",
"0.4833522",
"0.48230177",
"0.48120242",
"0.48081923",
"0.48081064",
"0.48027104",
"0.47859827",
"0.47582254",
"0.47494817",
"0.47459984",
"0.47411716",
"0.47316152",
"0.4721875",
"0.4718154",
"0.46967798",
"0.46785015",
"0.466973",
"0.46695864",
"0.4664893",
"0.46602222",
"0.4657677",
"0.46470255",
"0.4646885",
"0.464499",
"0.46423233",
"0.46322924",
"0.4630081",
"0.461745",
"0.46150333",
"0.4603269"
]
| 0.49168855 | 62 |
Add new Accelerated Reward for practice | public function add() {
$sessionstaff = $this->Session->read('staff');
//fetch all coupon list of practice for link to Accelerated Reward
$options6['conditions'] = array('ProductService.clinic_id' => $sessionstaff['clinic_id'], 'ProductService.type' => 3, 'ProductService.status' => 1);
$options6['order'] = array('ProductService.title ASC');
$ProductServicelist = $this->ProductService->find('all', $options6);
$this->set('ProductService', $ProductServicelist);
if ($this->request->is('post')) {
$this->TierSetting->create();
$options['conditions'] = array('TierSetting.tier_name' => trim($this->request->data['tier_name']), 'TierSetting.clinic_id' => $this->request->data['clinic_id']);
$ind = $this->TierSetting->find('first', $options);
$options['conditions'] = array('TierSetting.multiplier_value' => $this->request->data['multiplier_value'], 'TierSetting.clinic_id' => $this->request->data['clinic_id']);
$ind1 = $this->TierSetting->find('first', $options);
//condition to check duplicate Accelerated Reward for practice
if (!empty($ind)) {
$this->Session->setFlash('Accelerated Reward already exists.Please use different Tier Name.', 'default', array(), 'bad');
}
else if (!empty($ind1)) {
$this->Session->setFlash('Accelerated Reward already exists.Please use different Multiplier Value.', 'default', array(), 'bad');
}
else {
$proarra['TierSetting'] = array('tier_name' => $this->request->data['tier_name'], 'multiplier_value' => $this->request->data['multiplier_value'], 'points' => $this->request->data['points'], 'coupon_id' => $this->request->data['coupon_id'], 'clinic_id' => $this->request->data['clinic_id'], 'created_on' => date('Y-m-d H:i:s'), 'updated_on' => date('Y-m-d H:i:s'));
if ($this->TierSetting->save($proarra)) {
$this->Session->setFlash('Accelerated Reward successfully added', 'default', array(), 'good');
$this->redirect(array('action' => 'index'));
} else {
$this->Session->setFlash('Unable to add Accelerated Reward', 'default', array(), 'bad');
}
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function appendRewards(Down_ActivityReward $value)\n {\n return $this->append(self::_REWARDS, $value);\n }",
"public function appendRewards(Down_TbcReward $value)\n {\n return $this->append(self::_REWARDS, $value);\n }",
"public function appendRewards(Down_TbcReward $value)\n {\n return $this->append(self::_REWARDS, $value);\n }",
"public function appendRewards(Down_WorshipReward $value)\n {\n return $this->append(self::_REWARDS, $value);\n }",
"public function appendRewards(Down_WorshipReward $value)\n {\n return $this->append(self::_REWARDS, $value);\n }",
"public function appendRewards(Down_ActivityRewards $value)\n {\n return $this->append(self::_REWARDS, $value);\n }",
"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 appendApplyRewards($value)\n {\n return $this->append(self::_APPLY_REWARDS, $value);\n }",
"public function __construct()\n {\n $this->addAdditionalRoute('redeemByGet', 'redeem/{reward}/user/{user}', ['GET']);\n $this->addAdditionalRoute('redeemByPost', 'redeem/', ['POST']);\n }",
"public function getRewards()\r\n {\r\n return Controllers\\Rewards::getInstance();\r\n }",
"public function appendRewards(Down_LadderRankReward $value)\n {\n return $this->append(self::_REWARDS, $value);\n }",
"function testAddWithNewKey() {\r\n $counter = $this->actionForwards->size();\r\n $this->actionForwards->addActionForward(\r\n \tnew TechDivision_Controller_Action_Forward(\"key2\", \"Path 2!\")\r\n );\r\n $actionForward = $this->actionForwards->find(\"key2\");\r\n $this->assertEquals(\"key2\", $actionForward->getName(), \"Found wrong key!\");\r\n $this->assertEquals(\"Path 2!\", $actionForward->getPath(), \"Found wrong path!\");\r\n $this->assertTrue($this->actionForwards->size() == $counter + 1, \"Found wrong number of forwards!\");\r\n }",
"public function appendRewards($value)\n {\n return $this->append(self::_REWARDS, $value);\n }",
"function rh_award_new_role_mycred( $reply, $request, $mycred ) {\n if ( $reply === false ) return $reply;\n\n // Exclude admins\n if ( user_can( $request['user_id'], 'manage_options' ) ) return $reply;\n\n extract( $request );\n\n $rolechangedarray = rehub_option('rh_award_role_mycred');\n\n $rolechangedarray = explode('PHP_EOL', $rolechangedarray);\n $thresholds = array();\n\n foreach ($rolechangedarray as $key => $value) {\n $values = explode(':', $value);\n if (empty($values[0]) || empty($values[1])) return;\n $roleforchange = trim($values[0]);\n $numberforchange = trim($values[1]); \n $thresholds[$roleforchange] = (int)$numberforchange;\n }\n\n // Get users current balance\n $current_balance = $mycred->get_users_balance( $user_id, $type );\n $current_balance = (int)$current_balance + (int)$amount;\n\n // Check if the users current balance awards a new role\n $new_role = false;\n foreach ( $thresholds as $role => $min ) {\n if ( $current_balance >= $min )\n $new_role = $role;\n }\n\n // Change users role if we have one\n if ( $new_role !== false ){\n if(rehub_option('rh_award_type_mycred') ==1 && function_exists('bp_get_member_type')){\n $roles = bp_get_member_type($user_id, false);\n if(!empty($roles) && is_array($roles)){\n if (!in_array( $new_role, (array) $roles)){\n bp_set_member_type( $user_id, $new_role );\n } \n }else{\n bp_set_member_type( $user_id, $new_role );\n } \n }else{\n $wp_user_object = new WP_User($user_id);\n if(empty($wp_user_object)) return;\n if (!in_array( $new_role, (array) $wp_user_object->roles )){\n $wp_user_object->add_role($new_role);\n } \n }\n }\n return $reply;\n }",
"static public function add_rewrite_rules(){\n\t global $wp,$wp_rewrite; \n\t $wp->add_query_var( 'profile' );\n\n\t foreach( AT_Route::fronted() as $key=>$params ){\n\t\t\t$wp_rewrite->add_rule('^' .$key, 'index.php?profile=true', 'top');\n\t\t\tforeach ( $params['regular_expressions'] as $key => $expression ) {\n\t\t\t\t$wp_rewrite->add_rule('^' .$key . $expression, 'index.php?profile=true', 'top');\n\t\t\t}\n\n\t }\n\n\t $wp_rewrite->flush_rules();\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 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 addRecommendation($recommendation) {\n return $this->databaseInsertRecord(\n $this->tableRecommendations, NULL, $recommendation);\n }",
"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 }",
"public function send() {\n\n $this->request->allowMethod('post');\n\n if (!$this->Access->check('Rewards', 'create')) {\n $this->redirect($this->referer());\n return;\n }\n\n $reward = $this->Session->read('reward');\n\n if (empty($reward)) {\n $this->Flash->set('Oops! It appears you have not prepared a reward.', ['params' => ['class' => 'error']]);\n $this->redirect(array('action' => 'compose'));\n return;\n }\n\n if (empty($reward['RewardRecipient'])) {\n $this->Flash->set('You did not specify any valid recipients.', ['params' => ['class' => 'error']]);\n $this->redirect(array('action' => 'compose'));\n return;\n }\n\n $this->loadModel('Activity');\n\n $reward['Reward']['reward_id'] = $this->Activity->getNewId('Reward');\n $result = $this->Reward->saveAssociated($reward, array('atomic' => false));\n\n if (!$result['Reward'] || (!empty($result['RewardDetail']) && in_array(false, $result['RewardDetail'])) || in_array(false, $result['RewardRecipient'])) {\n $this->Flash->set('There was an error sending the reward. Please contact an administrator', ['params' => ['class' => 'error']]);\n } else {\n $this->Flash->set(\"The reward has been sent! Reward number - #{$this->Reward->id}\", ['params' => ['class' => 'success']]);\n }\n\n $this->Session->delete('reward');\n $this->redirect(array('action' => 'compose'));\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}",
"public function actionRecommend()\r\n {\r\n $course_resource = new CourseResource();\r\n if(isset($_POST['class_id'])&&!empty($_POST['class_id'])){\r\n $class=ActualClass::model()->with('course')->findByPk($_POST['class_id']);\r\n if(!empty($class)){\r\n $_POST['course_id']=$class->course->id;\r\n }else{\r\n unset($_POST['class_id']);\r\n }\r\n }\r\n $course_resource->attributes = array_merge($_POST, array(\r\n 'user_id' => Yii::app()->user->id,\r\n ));\r\n if ($course_resource->save()) {\r\n AjaxResponse::success($this->smarty->fetchString('item', array('resource' => $course_resource)));\r\n } else {\r\n AjaxResponse::success($course_resource->errors);\r\n }\r\n }",
"public function rewards(Request $request)\n {\n $userid = Auth::guard('api')->user()->id;\n\n $rewards = Rewards::where('user_id',$userid)->get();\n if($rewards->count() > 0)\n {\n $rewards[0]->used = is_null($rewards[0]->used) ? \"\" :$rewards[0]->used;\n $rewards[0]->redeem = is_null($rewards[0]->redeem) ? \"\" :$rewards[0]->redeem;\n unset($rewards[0]->deleted_at);\n $response = ['success' => true,'status' => 200,'message' => 'Data Found successfully.','data'=>$rewards];\n }\n else\n { \n $response = ['success' => false,'status'=> 404,'message' => 'No Data Found']; \n }\n return response()->json($response);\n }",
"function SetHuntRewards ($hunt_rewards) {\n $hunt_division = mysql_result(@mysql_query(\"SELECT `hunt_division` FROM `hunts` WHERE `hunt_id` = '$this->hunt_id'\", $this->ka_db), 0, 'hunt_division');\n if (($this->Allowed('allhunts') == true) || (($this->Allowed('hunts') == true) && ($this->CheckDivision($hunt_division) == true))) {\n $rewards = serialize($hunt_rewards);\n if (@mysql_query (\"UPDATE `hunts` SET `hunt_rewards` = '$rewards' WHERE `hunt_id` = $this->hunt_id\", $this->ka_db)) {\n $this->hunt_rewards = $rewards;\n return true;\n } else\n return false;\n } else {\n $this->roster_error = \"You do not have access to this function.\";\n return false;\n }\n }",
"function addAdvance($cId,$cName,$cCont=null,$cType=null,$cAlign=null,$cLength=null,$cRefer=null) {\r\n\t$this->_advanceEls[] = new uElement($cId,$cName,$cCont,$cType,$cAlign,$cLength,$cRefer);\r\n }",
"public function addRatings()\n {\n }",
"public function setActivityReward($value)\n {\n return $this->set(self::_ACTIVITY_REWARD, $value);\n }",
"protected function uploadRewards( &$reader, $incremental, &$available_instrument_ids ) {\n\t\t$data = $reader->getSheetByName( 'Rewards' );\n\t\tif ($data==null) {\n\t\t\treturn;\n\t\t}\n\n\t\t// if incremental then find current instrument IDs else delete all old rewards\n\t\tif ($incremental) {\n\t\t\t$unlisted_instrument_ids = $available_instrument_ids;\n\t\t} else {\n\t\t\t$this->deleteRewards();\n\t\t}\n\n\t\t// get existing user groups\n\t\t$user_group_ids = $this->getUserGroupIds();\n\n\t\t// load the worksheet cells and store them to the database\n\t\t$old_instrument_reward_ids = array();\n\t\t$previous_instrument_id = 0;\n\t\t$i = 0;\n\t\t$k = $data->getHighestRow();\n\t\tfor ($i=0; $i<$k; $i+=1) {\n\t\t\t$j = 1;\n\t\t\tif ($i==0) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$instrument_id = trim($this->getCell($data,$i,$j++));\n\t\t\tif ($instrument_id==\"\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$user_group = trim($this->getCell($data,$i,$j++));\n\t\t\tif ($user_group==\"\") {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$points = $this->getCell($data,$i,$j++,'0');\n\t\t\t$reward = array();\n\t\t\t$reward['instrument_id'] = $instrument_id;\n\t\t\t$reward['user_group'] = $user_group;\n\t\t\t$reward['points'] = $points;\n\t\t\tif (($incremental) && ($instrument_id != $previous_instrument_id)) {\n\t\t\t\t$old_instrument_reward_ids = $this->deleteReward( $instrument_id );\n\t\t\t\tif (isset($unlisted_instrument_ids[$instrument_id])) {\n\t\t\t\t\tunset($unlisted_instrument_ids[$instrument_id]);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$this->moreRewardCells( $i, $j, $data, $reward );\n\t\t\t$this->storeRewardIntoDatabase( $reward, $old_instrument_reward_ids, $user_group_ids );\n\t\t\t$previous_instrument_id = $instrument_id;\n\t\t}\n\t\tif ($incremental) {\n\t\t\t$this->deleteUnlistedRewards( $unlisted_instrument_ids );\n\t\t}\n\t}",
"function rewrite_rules($wp_rewrite) {\n $new_rules = array(\n 'hcard_url/(.+)' => 'index.php?hcard_url=' . $wp_rewrite->preg_index(1)\n );\n $wp_rewrite->rules = $new_rules + $wp_rewrite->rules;\n }",
"public function update($id,Requests\\RewardRequest $request)\n\t{\n $request['expiration'] = Carbon::createFromFormat('m/d/Y',$request['expiration']);\n $this->rewardRepository->update($id,$request->all());\n return redirect()->action('Admin\\RewardController@index');\n\t}",
"function humcore_add_rewrite_rule() {\n\n\tadd_rewrite_rule(\n\t\t'(deposits/item)/([^/]+)(/(review))?/?$',\n\t\t'index.php?pagename=$matches[1]&deposits_item=$matches[2]&deposits_command=$matches[4]',\n\t\t'top'\n\t);\n\n\tadd_rewrite_rule(\n\t\t'(deposits/download)/([^/]+)/([^/]+)/([^/]+)/?$',\n\t\t'index.php?pagename=$matches[1]&deposits_item=$matches[2]&deposits_datastream=$matches[3]&deposits_filename=$matches[4]',\n\t\t'top'\n\t);\n\n\t// Rewrite for deposits/objects handled as ngix proxy pass.\n\n\tadd_rewrite_rule(\n\t\t'(deposits/view)/([^/]+)/([^/]+)/([^/]+)/?$',\n\t\t'index.php?pagename=$matches[1]&deposits_item=$matches[2]&deposits_datastream=$matches[3]&deposits_filename=$matches[4]',\n\t\t'top'\n\t);\n\n add_rewrite_rule(\n '(deposits/list)/?$',\n 'index.php?pagename=$matches[1]',\n 'top'\n );\n\n}",
"public function addAward(\\GT\\CriteriaAward $award){\n \n // If it already exists, don't append another one, update the existing object\n if ($award->isValid()){\n if ($this->awards){\n foreach($this->awards as $key => $awrd){\n if ($awrd->getID() == $award->getID()){\n $this->awards[$key] = $award;\n return;\n }\n }\n }\n }\n \n // Otherwise just append\n $this->awards[] = $award;\n }",
"public function storeAward()\n\t{\n\t\tif (isset($_POST)) \n\t\t{\n\t\t\t$award = filter_var($_POST['award'], FILTER_VALIDATE_INT);\n\t\t\t$position = filter_var($_POST['position'], FILTER_VALIDATE_INT);\n\n\t\t\t$awardModel = new Award();\n\t\t\t$response = $awardModel->storeAward($award, $position);\n\n\t\t\tBaseController::msgValidate($response);\n\t\t}\n\n\t\t$this->crudAward();\n\t}",
"function Add_Manual_ACH($application_id, $request)\n{\n\t$log = get_log(\"scheduling\");\n\t$holidays = Fetch_Holiday_List();\n\t$pd_calc = new Pay_Date_Calc_3($holidays);\n\t$payment_amt = round($request->amount, 2);\n\n\t$comment = \"Manual ACH Request - \" . $request->payment_description;\n\n\tif ($request->edate == 'select')\n\t{\n\t\t$due_date = $request->scheduled_date?date(\"Y-m-d\", strtotime($request->scheduled_date)):NULL;\n\t}\n\telse\n\t{\n\t\t$due_date = date('Y-m-d', strtotime($request->edate));\n\t}\n\n\tif(!$due_date)\n\t{\n\t\t$_SESSION['error_message'] = \"No date was selected for Manual ACH\";\n\t\treturn false;\n\t}\n\n\t$action_date = $pd_calc->Get_Business_Days_Backward($due_date, 1);\n\n\t//It's possible that this will put the action date in the past, which is bad.\n\t//If that happens, use the scheduled date as the action date instead. [jeffd][IMPACT #13616]\n\tif(strtotime($action_date) < strtotime(date('Y-m-d')))\n\t{\n\t\t$action_date = $due_date;\n\t\t$due_date = $pd_calc->Get_Business_Days_Forward($due_date, 1);\n\t}\n\n\t$amounts = array();\n\t//pay down amounts other than principal first [#27768]\n\t$log->Write(\"[Agent:{$_SESSION['agent_id']}][AppID:{$application_id}] Adding Manual ACH of {$payment_amt} for {$application_id} on date {$due_date}\");\n\n\t//[#46151] Adjust balance info, accounting for scheduled payments\n\t//between now and the manual ACH due date\n\t$schedule = Fetch_Schedule($application_id);\n\t$balance_info = Fetch_Balance_Information($application_id);\n\tforeach($schedule as $e)\n\t{\n\t\tif($e->status == 'scheduled' && strtotime($e->date_effective) < strtotime($due_date))\n\t\t{\n\t\t\tforeach($e->amounts as $ea)\n\t\t\t{\n\t\t\t\t$balance_info->{$ea->event_amount_type . '_balance'} += $ea->amount;\n\t\t\t}\n\t\t}\n\t}\n\n\t$balance = array(\n\t\t'principal' => $balance_info->principal_balance,\n\t\t'service_charge' => $balance_info->service_charge_balance,\n\t\t'fee' => $balance_info->fee_balance,\n\t\t);\n\n\t$amounts = AmountAllocationCalculator::generateAmountsFromBalance($payment_amt, $balance);\n\n\t$payment = Schedule_Event::MakeEvent($action_date, $due_date, $amounts, 'manual_ach', $comment,'scheduled','manual');\n\tRecord_Event($application_id, $payment);\n\n\treturn true;\n}",
"public function makePurchase() {;\n $this->setTotalPurchases($this->getTotalPurchases()+1);\n $this->setTotalAllAccess($this->getTotalAllAccess()+$this->getTotalAccess());\n $this->setTotalAccess(0);\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 }",
"public static function add_rewrite_rule()\n {\n }",
"public function credit(RequestInterface $request);",
"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 recommendation()\n {\n }",
"public function award_view($user_id,$req_id,$prop_id)\n\t{\n\t\t\n\t\tDB::update('update gigs set request_status=\"1\",giger_id=\"'.$user_id.'\" where gid = ?', [$req_id]);\n\t\t\n\t\tDB::update('update request_proposal set award=\"1\" where prp_id = ?', [$prop_id]);\n\t\treturn redirect()->back()->with('success', 'Great! Freelancers has been awarded successfully!');\n\t\t\n\t}",
"private function addReglamentToRemains():void {\n\t\t$this->remains->push([\n\t\t\t'technick_id' => $this->technickId,\n\t\t\t'object_id' => $this->object->id,\n\t\t\t'tbl_name' => $this->device->tbl_name,\n\t\t\t'reglament_id' => $this->reglament->id,\n\t\t\t'reglament' => $this->reglament,\n\t\t\t'object_device_id' => $this->device->id,\n\t\t]);\n\t}",
"public function addRequest($request)\n\t{\n\t $request->tutor_id=$this->id;\n\t return $request->save();\n\t}",
"public function create()\n\t{\n $pageTitle = \"Create New Reward\";\n $businesses = $this->businessRepository->all();\n return view('administrator.rewards.create',compact('pageTitle','businesses'));\n\t}",
"public function recommend()\n {\n $this->recommendations()->save(\n new Recommendation(['user_id' => auth()->id()])\n );\n }",
"public function mass_add()\n {\n }",
"function emp_activate() {\n\tglobal $wp_rewrite;\n \t$wp_rewrite->flush_rules();\n}",
"public function add_rewrite_rules()\n {\n }",
"public function add_rewrite_rules()\n {\n }",
"function Set_Adjustment($application_id, $request, $agent_id)\n{\n\t$db = ECash::getMasterDb();\n\t$events = array();\n\n\t$log = get_log('scheduling');\n\n\t$date = date(\"Y-m-d\", strtotime($request->adjustment_date));\n\n\t$log->Write(\"[Agent:{$agent_id}][AppID:$application_id] Adjustment for ${$amount} {$request->adjustment_type} to {$request->adjustment_target}\");\n\n\t$balance_info = Fetch_Balance_Information($application_id);\n\t$balance = array(\n\t\t'principal' => $balance_info->principal_balance,\n\t\t'service_charge' => $balance_info->service_charge_balance,\n\t\t'fee' => $balance_info->fee_balance,\n\t);\n\n\t//OK, before we do the adjustment and stuff, let's create the interest first!\n\n\t$biz_rules = new ECash_BusinessRulesCache(ECash::getMasterDb());\n\n\tif(! $application = ECash::getApplicationById($application_id))\n\t{\n\t\tthrow new Exception(\"Cannot locate application $application_id\");\n\t}\n\t$renewal = ECash::getFactory()->getRenewalClassByApplicationID($application_id);\n\t$rules = $application->getBusinessRules();\n\t$schedule = Fetch_Schedule($application_id);\n\t$paid_to = Interest_Calculator::getInterestPaidPrincipalAndDate($schedule, FALSE, $rules);\n\t$ecash_api = eCash_API_2::Get_eCash_API(null, ECash::getMasterDb(), $application_id);\n\t$service_charge_type = $rules['service_charge']['svc_charge_type'];\n\n\tswitch ($service_charge_type)\n\t{\n\t\tcase 'Daily':\n\n\t\t\t$rate_calc = $application->getRateCalculator();\n\t\t\t$int = $rate_calc->calculateCharge($balance['principal'], $paid_to['date'], $date);\n\n\t\t\t// Don't accrue past default date\n\t\t\tif ($rules['loan_type_model'] == 'CSO')\n\t\t\t{\n\t\t\t\tif ($renewal->hasDefaulted($application_id))\n\t\t\t\t\t$int = 0.00;\n\t\t\t}\n\n\t\t\t$rb = $paid_to['date'];\n\n\t\t\t$re = $date;\n\n\t\t\t//If its not a manual payment, or the date is in the future, let's add an interest comment\n\t\t\tif ($int > 0 && ((strtotime($paid_to['date']) < strtotime($date))))\n\t\t\t{\n\t\t\t\t$comment .= \"[service charge includes interest of $int between $rb and $re]\";\n\t\t\t\t$intcomment = \"[interest between $rb and $re]\";\n\t\t\t}\n\t\t\t//log the current balances before we modify the balances.\n\t\t\t$log->Write(\"Balances - P: {$balance['principal']} F: {$balance['fee']} INT: {$int} SC: {$balance['service_charge']} | AMT: $amt\");\n\n\t\t\t//add interest to what is owed if the date is in the future Subtract amount from total balance\n\t\t\tif(((strtotime($paid_to['date']) < strtotime($date))))\n\t\t\t{\n\t\t\t\t$balance['service_charge'] = bcadd($balance['service_charge'],$int,2);\n\t\t\t}\n\n\t\t\t//allocate amounts! Amount allocation comes AFTER the adjustments are made\n\t\t\t$amounts = AmountAllocationCalculator::generateAmountsFromBalance(-$amt, $balance);\n\n\t\t\tbreak;\n\t\tcase 'Fixed':\n\t\tdefault:\n\t\t\t$int = 0;\n\t\t\t//Do nothing! BOO-YAH!\n\t\tbreak;\n\t}\n\tif($int > 0)\n\t{\n\t\t$intamounts = Array(Event_Amount::MakeEventAmount('service_charge', abs($int)));\n\t\t//Schedule service charge and register it on the same day!\n\t\t$sc_event = Schedule_Event::MakeEvent($date, $date, $intamounts, 'assess_service_chg', $intcomment, 'scheduled');\n\t\t$events[] = $sc_event;\n\t}\n\t////////////////////////\n\t$amount = $request->adjustment_type == 'credit' ? $request->adjustment_amount : -$request->adjustment_amount;\n\n\t// Adjust Principal\n\n\n\t$com = $request->adjustment_description . \" (Agent: {$agent_id})\";\n\t$amounts = array();\n\n // GF 8293 [benb]\n // when adjusting delivery fees, apply calculations to generic \"fee\"\n $target = ($request->adjustment_target == \"deliveryfee\") ? \"fee\" : $request->adjustment_target;\n\n // GF 6334 [benb]\n // when adjusting lien fees, apply calculations to generic \"fee\"\n\t$target = ($request->adjustment_target == \"lienfee\") ? \"fee\" : $target;\n\n $amounts = AmountAllocationCalculator::generateInternalAdjustment($target, round($amount, 2), $balance);\n\n\tif (count($amounts))\n\t{\n\t\t// GF 6334 [benb]\n\t\tif ($request->adjustment_target == \"lienfee\")\n\t\t{\n\t\t\t// This is so credits will register under \"assess_fee_lien\"\n\t\t\t$type = ($request->adjustment_type == \"debit\") ? \"writeoff_fee_lien\" : \"assess_fee_lien\";\n\t\t}\n\t\telse if ($request->adjustment_target == \"deliveryfee\")\n\t\t{\n\t\t\t$type = ($request->adjustment_type == \"debit\") ? \"writeoff_fee_delivery\" : \"assess_fee_delivery\";\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$type = \"adjustment_internal\";\n\t\t}\n\n\t\t$event = Schedule_Event::MakeEvent($date, $date, $amounts, $type, $com, 'scheduled', 'manual');\n\t\t$events[] = $event;\n\n\t\ttry\n\t\t{\n\t\t\t$db->beginTransaction();\n\t\t\tforeach ($events as $ev)\n\t\t\t{\n\n\t\t\t\t// Propagate to the event_schedule\n\t\t\t\t$ev_id = Record_Event($application_id, $ev);\n\t\t\t\t// If the event is set for \"today\", propagate it the reset of the way through.\n\t\t\t\t$today = time();\n\n\t\t\t\tif (strtotime($date) <= $today)\n\t\t\t\t{\n\t\t\t\t\t// Now propagate to the register\n\t\t\t\t\t$tr_ids = Record_Current_Scheduled_Events_To_Register($date, $application_id, $ev_id);\n\t\t\t\t\t// Finally to the ledger\n\t\t\t\t\tforeach ($tr_ids as $trid)\n\t\t\t\t\t{\n\t\t\t\t\t\tPost_Transaction($application_id, $trid);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t$db->Commit();\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\t$db->rollBack();\n\t\t\tthrow $e;\n\t\t}\n\t}\n}",
"public function setDefinition(LoyaltyProgramRewardDefinition $definition): void\n {\n $this->definition = $definition;\n }",
"public function store(Request $request, Purchaserequest $purchaserequest, Purchaserequestitem $purchaserequestitem)\n {\n\n $id = Purchaserequest::where('pr_req_comp_code', auth()->user()->company)\n ->first()->pr_req_no ?? date('Y') . 00000;\n $year = date('Y');\n $id_year = substr($id, 0, 4);\n $seq = $year <> $id_year ? 0 : +substr($id, -5);\n $new_id = sprintf(\"%0+4u%0+6u\", $year, $seq + 1);\n // $purchaserequest->pr_req_no = $new_id;\n\n\n $lastAccountForCurrentYear = Purchaserequest::where('pr_req_comp_code', auth()->user()->company)\n ->where('pr_req_no', 'like', date('Y') . '%') // filter for current year numbers\n ->orderByDesc('pr_req_no', 'desc') // the biggist one first\n ->first();\n\n $purchaserequest->pr_req_no = $lastAccountForCurrentYear\n ? ($lastAccountForCurrentYear->pr_req_no + 1) // just increase value to 1\n : (date('Y') . $digitRepresentingASerie . '00001');\n\n $new_id = $purchaserequest->pr_req_no;\n $purchaserequest->pr_req_no = $new_id;\n\n\n $purchaserequest->pr_req_uid = Auth::user()->id;\n $purchaserequest->pr_req_name = Auth::user()->name;\n $purchaserequest->pr_req_desi = Auth::user()->dept;\n $purchaserequest->pr_req_dept = Auth::user()->flex2;\n $purchaserequest->pr_req_mobile = Auth::user()->mobile;\n $purchaserequest->pr_req_email = Auth::user()->email;\n $purchaserequest->pr_req_brand_name = Auth::user()->brand_name;\n\n $date = Carbon::createFromFormat('d-m-Y', $request->pr_req_del_date);\n $purchaserequest->pr_req_del_date = $date;\n\n $purchaserequest->pr_req_status = 1;\n $purchaserequest->pr_req_remarks = $request->pr_req_remarks;\n\n\n\n $purchaserequest->pr_req_comp_code = Auth::user()->company;\n\n if ((Auth::user()->company) == 92) {\n\n $purchaserequest->pr_req_comp_name = 'TAMANI GLOBAL DEVELOPMENT & INVESTMENT L.L.C';\n } else if ((Auth::user()->company) == 34) {\n\n $purchaserequest->pr_req_comp_name = 'TAMANI TRADING AND ENTERTAINMENT L.L.C';\n } else {\n\n $purchaserequest->pr_req_comp_name = 'Al Jarwani';\n }\n\n\n\n\n\n foreach ($request->pri_qty as $key => $value) {\n\n if ($request->pri_qty[$key]) {\n $item = resolve(Purchaserequestitem::class);\n $purchaserequestitem->pri_item = $value['pri_item'];\n $purchaserequestitem->pri_qty = $value['pri_qty'];\n $purchaserequestitem->pri_price = $value['pri_price'];\n $purchaserequestitem->pri_amount = $value['pri_qty'] * $value['pri_price'];\n $purchaserequestitem->pri_flex1 = $new_id;\n $purchaserequestitem->save();\n // $account->item()->save($item);\n }\n }\n\n\n\n\n\n $purchaserequest->save();\n\n\n\n return redirect('purchase/purchaserequest')->with('success', 'Record Created Successfully.');\n }",
"public function add() {\n $insertData = $this->data;\n $keepNullFields = [\n 'estimator_id', 'date_requested', 'date_service', 'class_id',\n 'date_service', 'lat', 'lng'\n ];\n foreach ($keepNullFields as $field) {\n if (!$insertData[$field]) {\n $insertData[$field] = null;\n }\n }\n $model = new ReferralModel;\n $ref = $model->create();\n $ref->set($insertData);\n $ref->save();\n $this->renderJson([\n 'success' => true,\n 'message' => 'Job request created successfully',\n 'data' => $ref->asArray()\n ]);\n }",
"public function addRecommendationToToGo(){\n $toGoModel = new ToGo();\n $id = $this->request->getVar('id');\n //$this->session->set('id_usr',1);\n $id_usr = $this->session->get('userId');\n\n if(!isset($id_usr)){\n echo \"You need to login first!\";\n return;\n }\n\n $togos = $toGoModel->where('id_usr',$id_usr)->findAll();\n\n foreach($togos as $togo){\n if($togo->id_plc == $id){\n echo \"Already in to-go list!\";\n return;\n }\n }\n\n $toGoModel->save([\n 'id_usr'=>$id_usr,\n 'id_plc'=> $id,\n 'crossed_off' => 0\n ]);\n\n $placeModel = new Place();\n $plc = $placeModel->find($id);\n\n echo $plc->name;\n\n }",
"function testAddWithExistingKey() {\r\n $this->actionForwards->addActionForward(\r\n \tnew TechDivision_Controller_Action_Forward(\"key3\", \"Path 3!\")\r\n );\r\n $counter = $this->actionForwards->size();\r\n $this->actionForwards->addActionForward(\r\n \tnew TechDivision_Controller_Action_Forward(\"key3\", \"Path 4!\")\r\n );\r\n $actionForward = $this->actionForwards->find(\"key3\");\r\n $this->assertEquals(\"key3\", $actionForward->getName(), \"Found wrong key!\");\r\n $this->assertEquals(\"Path 4!\", $actionForward->getPath(), \"Found wrong path!\");\r\n $this->assertTrue($this->actionForwards->size() == $counter, \"Found wrong number of forwards!\");\r\n }",
"public function updateReward($UserID) { $Rank = $this->rank($UserID);\n $SpecialRank = $this->specialRank($UserID);\n $HasAll = $SpecialRank == MAX_SPECIAL_RANK;\n $Counter = 0;\n $Insert = array();\n $Values = array();\n $Update = array();\n\n $Insert[] = \"UserID\";\n $Values[] = \"'$UserID'\";\n if ($Rank >= 1 || $HasAll) {\n }\n if ($Rank >= 2 || $HasAll) {\n if (isset($_POST['donor_icon_mouse_over_text'])) {\n $IconMouseOverText = db_string($_POST['donor_icon_mouse_over_text']);\n $Insert[] = \"IconMouseOverText\";\n $Values[] = \"'$IconMouseOverText'\";\n $Update[] = \"IconMouseOverText = '$IconMouseOverText'\";\n }\n $Counter++;\n }\n if ($Rank >= 3 || $HasAll) {\n if (isset($_POST['avatar_mouse_over_text'])) {\n $AvatarMouseOverText = db_string($_POST['avatar_mouse_over_text']);\n $Insert[] = \"AvatarMouseOverText\";\n $Values[] = \"'$AvatarMouseOverText'\";\n $Update[] = \"AvatarMouseOverText = '$AvatarMouseOverText'\";\n }\n $Counter++;\n }\n if ($Rank >= 4 || $HasAll) {\n if (isset($_POST['donor_icon_link'])) {\n $CustomIconLink = db_string($_POST['donor_icon_link']);\n if (!Misc::is_valid_url($CustomIconLink)) {\n $CustomIconLink = '';\n }\n $Insert[] = \"CustomIconLink\";\n $Values[] = \"'$CustomIconLink'\";\n $Update[] = \"CustomIconLink = '$CustomIconLink'\";\n }\n $Counter++;\n }\n\n for ($i = 1; $i <= $Counter; $i++) {\n $this->addProfileInfoReward($i, $Insert, $Values, $Update);\n }\n if ($Rank >= MAX_RANK || $HasAll) {\n if (isset($_POST['donor_icon_custom_url'])) {\n $CustomIcon = db_string($_POST['donor_icon_custom_url']);\n if (!Misc::is_valid_url($CustomIcon)) {\n $CustomIcon = '';\n }\n $Insert[] = \"CustomIcon\";\n $Values[] = \"'$CustomIcon'\";\n $Update[] = \"CustomIcon = '$CustomIcon'\";\n }\n $this->updateTitle($UserID, $_POST['donor_title_prefix'], $_POST['donor_title_suffix'], $_POST['donor_title_comma']);\n $Counter++;\n }\n if ($SpecialRank >= 4) {\n if (isset($_POST['second_avatar'])) {\n $SecondAvatar = db_string($_POST['second_avatar']);\n if (!Misc::is_valid_url($SecondAvatar)) {\n $SecondAvatar = '';\n }\n $Insert[] = \"SecondAvatar\";\n $Values[] = \"'$SecondAvatar'\";\n $Update[] = \"SecondAvatar = '$SecondAvatar'\";\n }\n if (isset($_POST['limitedcolor']) && (preg_match('/^#[a-fA-F0-9]{6}$/', $_POST['limitedcolor']) || $_POST['limitedcolor'] == '')) {\n $ColorUsername = db_string($_POST['limitedcolor']);\n $Insert[] = \"ColorUsername\";\n $Values[] = \"'$ColorUsername'\";\n $Update[] = \"ColorUsername = '$ColorUsername'\";\n }\n }\n if ($SpecialRank >= 5) {\n if (isset($_POST['unlimitedcolor']) && (preg_match('/^#[a-fA-F0-9]{6}$/', $_POST['unlimitedcolor']) || $_POST['unlimitedcolor'] == '')) {\n $ColorUsername = db_string($_POST['unlimitedcolor']);\n $Insert[] = \"ColorUsername\";\n $Values[] = \"'$ColorUsername'\";\n $Update[] = \"ColorUsername = '$ColorUsername'\";\n }\n if (isset($_POST['gradientscolor']) && (preg_match('/^#[a-fA-F0-9]{6}(,#[a-fA-F0-9]{6}){1,2}$/', $_POST['gradientscolor']) || $_POST['gradientscolor'] == '')) {\n $GradientsColor = db_string($_POST['gradientscolor']);\n $Insert[] = \"GradientsColor\";\n $Values[] = \"'$GradientsColor'\";\n $Update[] = \"GradientsColor = '$GradientsColor'\";\n }\n }\n $Insert = implode(', ', $Insert);\n $Values = implode(', ', $Values);\n $Update = implode(', ', $Update);\n if ($Counter > 0) {\n $QueryID = $this->db->get_query_id();\n $this->db->query(\"\n\t\t\t\tINSERT INTO donor_rewards\n\t\t\t\t\t($Insert)\n\t\t\t\tVALUES\n\t\t\t\t\t($Values)\n\t\t\t\tON DUPLICATE KEY UPDATE\n\t\t\t\t\t$Update\");\n $this->db->set_query_id($QueryID);\n }\n $this->cache->delete_value(\"donor_profile_rewards_$UserID\");\n $this->cache->delete_value(\"donor_info_$UserID\");\n }",
"public static function simulate_new_request() {\n self::$now += 0.1;\n self::$purgetoken = null;\n }",
"public function rebuild()\r\n {\r\n $aclKey = 'acl-' . $this->config->uniqueId;\r\n\r\n // Get all constant of this class\r\n $groupList = array_keys($this->permission);\r\n\r\n $acl = new \\Phalcon\\Acl\\Adapter\\Memory();\r\n $acl->setDefaultAction(\\Phalcon\\Acl::DENY);\r\n\r\n foreach ($groupList as $groupConst => $groupValue) {\r\n // Add Role\r\n $acl->addRole(new \\Phalcon\\Acl\\Role($groupValue));\r\n\r\n if (isset($this->permission[$groupValue]) && is_array($this->permission[$groupValue]) == true) {\r\n foreach ($this->permission[$groupValue] as $group => $controller) {\r\n foreach ($controller as $action) {\r\n $actionArr = explode(':', $action);\r\n $resource = 'Controller\\\\' . $group . '-' . $actionArr[0];\r\n\r\n // Add Resource\r\n $acl->addResource($resource, $actionArr[1]);\r\n\r\n // Grant role to resource\r\n $acl->allow($groupValue, $resource, $actionArr[1]);\r\n }\r\n }\r\n }\r\n }\r\n\r\n // Store in APC\r\n /*if (extension_loaded('apc') && ini_get('apc.enabled')) {\r\n if (apc_exists($aclKey)) {\r\n if (apc_delete($aclKey)) {\r\n echo 'Delete old ACL in APC storage. <br/>';\r\n }\r\n }\r\n\r\n if (apc_store($aclKey, $acl, 0)) {\r\n echo 'Store new ACL in APC storage SUCCESS. <hr/>';\r\n }\r\n }*/\r\n }",
"public function actionAdvance()\r\n {\r\n $searchModel = new OrderAdvanceSearch();\r\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\r\n \r\n return $this->render('advance', [\r\n 'searchModel' => $searchModel,\r\n 'dataProvider' => $dataProvider,\r\n 'menus' => $this->_getMenus(),\r\n ]);\r\n }",
"public function setHireReward($value)\n {\n return $this->set(self::_HIRE_REWARD, $value);\n }",
"function recommends_req_crstut_9_add_course($form, &$form_state) {\n // Everything in $form_state is persistent, so we'll just use\n // $form_state['add_course']\n $form_state['num_courses']++;\n\n // Setting $form_state['rebuild'] = TRUE causes the form to be rebuilt again.\n $form_state['rebuild'] = TRUE;\n}",
"public function getReward()\n {\n return $this->get(self::_REWARD);\n }",
"public function getReward()\n {\n return $this->get(self::_REWARD);\n }",
"public function getReward()\n {\n return $this->get(self::_REWARD);\n }",
"function rest_api_register_rewrites() {\n\tadd_rewrite_rule( '^' . rest_get_url_prefix() . '/?$','index.php?rest_route=/','top' );\n\tadd_rewrite_rule( '^' . rest_get_url_prefix() . '/(.*)?','index.php?rest_route=/$matches[1]','top' );\n}",
"public function store(RenewRequest $request)\n {\n //\n }",
"public function add()\n {\n echo '客户需求添加一个新需求' . PHP_EOL;\n }",
"private function giveTriviaReward($username)\n {\n $multiplier = $_SESSION[$this->correctAnswers];\n\n $totalGold = ($this->goldReward * $multiplier);\n\n $totalExp = ($this->expReward * ($multiplier / 2));\n\n $this->userRep->updateUserGold($username, $totalGold);\n $this->userRep->updateUserExp($username, $totalExp);\n\n $this->userDataCalc($username);\n\n $this->notify->info('(Trivia)Reward: '.$totalGold.' gold and '. $totalExp.' exp.');\n }",
"public function addAction() {\n\t}",
"public function addAction() {\n\t}",
"public function addAction() {\n\t}",
"public function hit()\n {\n app(RateLimiter::class)->hit($this->rateLimiterKey, $this->decayTime);\n }",
"public function getAdvance();",
"function addRePlace() {\r\n\tglobal $options_url;\r\n\r\n\t$re_place = array();\r\n\t$re_place[\"re_id\"] = $_REQUEST[\"re_id\"];\r\n\t$re_place[\"re_description\"] = $_REQUEST[\"re_description\"];\r\n\t$re_place[\"re_active\"] = $_REQUEST[\"re_active\"];\r\n\t$re_place[\"re_search\"] = $_REQUEST[\"re_search\"];\r\n\t$re_place[\"re_place\"] = $_REQUEST[\"re_place\"];\r\n\t$re_place[\"re_order\"] = $_REQUEST[\"re_order\"];\r\n\t$re_place[\"restriction\"] = $_REQUEST[\"restriction\"];\r\n\t$re_place[\"restr_otherwise\"] = $_REQUEST[\"restr_otherwise\"];\r\n\t// if (get_magic_quotes_gpc()) {\r\n\t\tforeach($re_place as $key => $value) {\r\n\t\t\t$re_place[$key] = stripslashes($value);\r\n\t\t}\r\n \t// } \r\n\t\r\n\t$rePlaceManager = new RePlace();\r\n\t$replaces = $rePlaceManager->addRePlace($re_place);\r\n\r\n\techo '<div id=\"message\" class=\"updated fade\"><p>re.place added</p></div>';\r\n}",
"public function testAddActionAdds()\n {\n // another time perhaps\n }",
"public function _activate() {\r\n\t\t// Bail early if requirements aren't met.\r\n\t\tif ( ! $this->check_requirements() ) {\r\n\t\t\treturn;\r\n\t\t}\r\n\r\n\t\t// Make sure any rewrite functionality has been loaded.\r\n\t\tflush_rewrite_rules();\r\n\t}",
"public function addAction() {\r\n\t}",
"public function addAction()\n\t{\n\n\t}",
"public function add($treasureCompleted)\n {\n\n $xpReward = [];\n if($this->user->tutorials['home']){\n\n \t$this->addXPService = (new AddXPService)->setUser($this->user);\n \n if ($this->huntUser->relic_id) {\n $xp = $this->addXPForRelic($treasureCompleted);\n }else{\n $xp = $this->addXPForRandomHunt();\n }\n\n // $xpReward = $this->addXPService->add($xp);\n $this->addXPService->add($xp);\n }\n // return (is_array($xpReward) && count($xpReward))? $xpReward: new stdClass;\n return (isset($this->addXPService))?$this->addXPService->response(): new stdClass;\n }",
"function activate() {\n \n // actualizar las reglas de escritura para que observen la nueva taxonomia\n flush_rewrite_rules();\n }",
"public function advance();",
"public function modify(){\n //la route FormulaireModify\n }",
"function addAward($data,$firebase)\n\t{\n\t\t$key = array(\"award_title\",\"given_by\");\n\t\t$values = array($data['award_title'],$data['award_by']);\n\t\t$final = array_combine($key,$values);\n\t\tif(!empty($data['award_title']) && !empty($data['award_by']))\n\t\t\t$firebase->push(DEFAULT_PATH.'awards/',$final);\n\t\t$firebase->set(DEFAULT_PATH.'last_updated',date(\"m/d/Y\"));\n\t}",
"function addRelation($request) {\r\n\t\t$sourceModule = $request->getModule();\r\n\t\t$sourceRecordId = $request->get('src_record');\r\n\r\n\t\t$relatedModule = $request->get('related_module');\r\n\t\t$relatedRecordIdList = $request->get('related_record_list');\r\n\r\n\t\t$sourceModuleModel = Vtiger_Module_Model::getInstance($sourceModule);\r\n\t\t$relatedModuleModel = Vtiger_Module_Model::getInstance($relatedModule);\r\n\t\t$relationModel = Vtiger_Relation_Model::getInstance($sourceModuleModel, $relatedModuleModel);\r\n\t\tforeach($relatedRecordIdList as $relatedRecordId) {\r\n\t\t\t$relationModel->addRelation($sourceRecordId,$relatedRecordId,$listPrice);\r\n\t\t\tif($relatedModule == 'PriceBooks'){\r\n\t\t\t\t$recordModel = Vtiger_Record_Model::getInstanceById($relatedRecordId);\r\n\t\t\t\tif ($sourceRecordId && ($sourceModule === 'Products' || $sourceModule === 'Services')) {\r\n\t\t\t\t\t$parentRecordModel = Vtiger_Record_Model::getInstanceById($sourceRecordId, $sourceModule);\r\n\t\t\t\t\t$recordModel->updateListPrice($sourceRecordId, $parentRecordModel->get('unit_price'));\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\t\t\r\n\t}",
"function simple_ecards_activate()\n{\n\tsimple_ecards_register();\n\t$current_ecards = get_posts('post_type=simple_ecard');\n\tif(count($current_ecards) == 0)\n\t{\n\t\tsimple_ecards_add_default();\n\t}\n\t\n\tflush_rewrite_rules();\n}",
"function addRelation($request) {\n\t\t$sourceModule = $request->getModule();\n\t\t$sourceRecordId = $request->get('src_record');\n\n\t\t$relatedModule = $request->get('related_module');\n\t\tif(is_numeric($relatedModule)){\n\t\t\t$relatedModule = Vtiger_Functions::getModuleName($relatedModule);\n\t\t}\n\t\t$relatedRecordIdList = $request->get('related_record_list');\n\t\t$sourceModuleModel = Vtiger_Module_Model::getInstance($sourceModule);\n\t\t$relatedModuleModel = Vtiger_Module_Model::getInstance($relatedModule);\n\t\t$relationModel = Vtiger_Relation_Model::getInstance($sourceModuleModel, $relatedModuleModel);\n\t\tforeach($relatedRecordIdList as $relatedRecordId) {\n\t\t\t$relationModel->addRelation($sourceRecordId,$relatedRecordId,$listPrice);\n\t\t\tif($relatedModule == 'PriceBooks'){\n\t\t\t\t$recordModel = Vtiger_Record_Model::getInstanceById($relatedRecordId);\n\t\t\t\tif ($sourceRecordId && ($sourceModule === 'Products' || $sourceModule === 'Services')) {\n\t\t\t\t\t$parentRecordModel = Vtiger_Record_Model::getInstanceById($sourceRecordId, $sourceModule);\n\t\t\t\t\t$recordModel->updateListPrice($sourceRecordId, $parentRecordModel->get('unit_price'));\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$response = new Vtiger_Response();\n\t\t$response->setResult(true);\n\t\t$response->emit();\n\t}",
"public function addAction()\n {\n parent::addAction();\n $this->_fillMappingsArray();\n $this->_fillAvailableProperties();\n }",
"public function store(Request $request)\n {\n $customer_advance = new AdvanceSettlementCustomer(); \n $customer_advance->customer_id = isset($request->customer_id) ? ($request->customer_id) : 0;\n $customer_advance->voucher_no = isset($request->voucher_no) ? ($request->voucher_no) : 0;\n $customer_advance->receipt_date = isset($request->receipt_date) ? ($request->receipt_date) : 0;\n $customer_advance->advance_amount = isset($request->advance_amount) ? ($request->advance_amount) : 0; \n $customer_advance->remarks = isset($request->remark) ? ($request->remark) : 0;\n $customer_advance->created_by = isset($request->created_by) ? ($request->created_by) : 0;\n $customer_advance->updated_by = isset($request->updated_by) ? ($request->updated_by) : 0;\n if ($customer_advance->save()) {\n return Redirect::back()->with('success', 'Successfully created');\n } else {\n return Redirect::back()->with('failure', 'Something Went Wrong..!');\n }\n }",
"public function appendActivityReward(Down_DailyjobReward $value)\n {\n return $this->append(self::_ACTIVITY_REWARD, $value);\n }",
"public function store(Requests\\RewardRequest $request)\n\t{\n $request['expiration'] = Carbon::createFromFormat('m/d/Y',$request['expiration']);\n $reward = $this->rewardRepository->store($request->all());\n if($request->hasFile('image') && ($request->file('image')->getClientOriginalExtension()=='jpg'\n || $request->file('image')->getClientOriginalExtension()=='png'\n || $request->file('image')->getClientOriginalExtension()=='svg'\n || $request->file('image')->getClientOriginalExtension()=='gif')){\n\n $disk = Storage::disk('local');\n $img_name = 'reward-'.$reward->id.\".\".$request->file('image')->getClientOriginalExtension();\n $destination = 'uploads';\n $request->file('image')->move($destination,$img_name);\n $relatedImg= RelatedImage::create(['reward_id'=>$reward->id,'file_path'=>'/'.$destination.'/'.$img_name]);\n\n }\n\n return redirect()->action('Admin\\RewardController@index');\n\t}",
"public function recycle(){\n $qry = new InvokePostMethodQuery($this->getResourcePath(),\"recycle\");\n $this->getContext()->addQuery($qry);\n }",
"public function rewardNotesAction() {\n\t\t$this->_validateRequiredParameters(array('user_id', 'starbar_id'));\n\t\tif (in_array(APPLICATION_ENV, array('development', 'sandbox', 'testing', 'demo'))) {\n\t\t\tGame_Transaction::run($this->user_id, Economy::getIdforStarbar($this->starbar_id), 'TEST_REWARD_NOTES');\n\n\t\t\treturn $this->_resultType(true);\n\t\t} else {\n\t\t\treturn $this->_resultType(false);\n\t\t}\n\t}",
"function createRoute(){\n\t\t//This is to prevent entering a low cost route first, get it validated and then update\n\t\t//the route to a high cost one.\n\t\t\n\t\t$query = \"insert into ast_rt_extensions (context, exten, priority, app, appdata,last_checked) \n\t\t\t\t\tvalues ('$this->context', \n\t\t\t\t\t\t\t'$this->exten', \n\t\t\t\t\t\t\t$this->priority, \n\t\t\t\t\t\t\t'$this->app', \n\t\t\t\t\t\t\t'\".mysql_real_escape_string($this->appdata).\"',\n\t\t\t\t\t\t\t'2011-09-19 23:07:27')\";\n\t\t$result = mysql_query($query);\n\t\tif(mysql_error()!=\"\"){\n\t\t\tdie(\"ERROR in createRoute: \".mysql_errno().\"<br>Description: \".mysql_error());\n\t\t}\n\t\tif($result){\n\t\t\treturn mysql_insert_id();\n\t\t}else{\n\t\t\treturn 0;\n\t\t}\n\t\t\n\t}",
"public function addCard()\n {\n }",
"function _pre()\n\t{\n\t\t$this->takeawayId = $this->takeawaymodel->addTakeaway('testtakeaway', 'testtake', 'test', 'te573t', '555', 'test', 1, 30, 1, 54, -40, 1);\n\t}",
"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}",
"function ARTEMIS_SWP_activate() {\r\n\tflush_rewrite_rules();\r\n}",
"public function gagnerExperience()\n {\n $this->_experience++;\n }",
"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 setReward(Down_WorldcupReward $value)\n {\n return $this->set(self::_REWARD, $value);\n }"
]
| [
"0.5541751",
"0.55359966",
"0.55359966",
"0.5416373",
"0.5416373",
"0.53394777",
"0.5265054",
"0.5238175",
"0.5167306",
"0.51627713",
"0.51485395",
"0.5074202",
"0.5053696",
"0.5004205",
"0.49950287",
"0.49640223",
"0.4884333",
"0.4866688",
"0.48585775",
"0.4842295",
"0.48359823",
"0.483367",
"0.48152947",
"0.48149708",
"0.47989038",
"0.47961628",
"0.47826514",
"0.47811556",
"0.47649765",
"0.4747938",
"0.47423252",
"0.4736277",
"0.47340143",
"0.4715755",
"0.47061124",
"0.46981362",
"0.46777865",
"0.46718702",
"0.46658817",
"0.46521556",
"0.46487343",
"0.46333346",
"0.46316972",
"0.4623327",
"0.46231824",
"0.46104074",
"0.46045512",
"0.46013796",
"0.46010616",
"0.4597036",
"0.45929098",
"0.45848414",
"0.45838657",
"0.45830905",
"0.45668048",
"0.4566184",
"0.45645365",
"0.45570096",
"0.45309862",
"0.45247456",
"0.45210123",
"0.45097",
"0.45097",
"0.45097",
"0.4505806",
"0.45014492",
"0.45012522",
"0.44999444",
"0.4498215",
"0.4498215",
"0.4498215",
"0.4493516",
"0.44921866",
"0.4483514",
"0.4480751",
"0.44782746",
"0.44752482",
"0.44741303",
"0.44680542",
"0.44648647",
"0.4464461",
"0.44637367",
"0.44501862",
"0.44436416",
"0.4443636",
"0.4429353",
"0.4429341",
"0.44244364",
"0.44240096",
"0.44230893",
"0.44193292",
"0.44192624",
"0.44169524",
"0.44047695",
"0.43879932",
"0.43867385",
"0.43855754",
"0.43834186",
"0.4382882",
"0.43802363"
]
| 0.52431375 | 7 |
Set the timeframe for accelerated Rewards. | public function changetimeframe() {
$sessionstaff = $this->Session->read('staff');
if ($_POST['tier_timeframe'] == '') {
$_POST['tier_timeframe'] = 0;
}
$this->AccessStaff->query('update access_staffs set tier_timeframe=' . $_POST['tier_timeframe'] . ' where clinic_id=' . $sessionstaff['clinic_id']);
$this->Session->write('staff.staffaccess.AccessStaff.tier_timeframe', $_POST['tier_timeframe']);
echo 1;
die;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setLastRewardsTime($value)\n {\n return $this->set(self::_LAST_REWARDS_TIME, $value);\n }",
"public function setUsageTimeframe(string $usage_timeframe): void\n {\n $this->_usage_timeframe = $usage_timeframe;\n }",
"function setForward() {\r\n\t\t\r\n\t\tswitch($this->freq) {\r\n\t\t\tcase \"one\":\r\n\t\t\t\t$timeAfter = \"0 minutes\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"week\":\r\n\t\t\t\t$timeAfter = \"1 week\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"month\":\r\n\t\t\t\t$timeAfter = \"1 month\";\r\n\t\t\t\tbreak;\r\n\t\t\tcase \"year\":\r\n\t\t\t\t$timeAfter = \"1 year\";\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\tdie(\"Error with setting Forward.\");\r\n\t\t}\r\n\t\t\r\n\t\t//Have to make an event date and remind object, to be able to use date_add() to make event available for next time\r\n\t\t$temp_event_date_obj = new DateTime($this->event_date_time);\r\n\t\t$temp_remind_date_obj = new DateTime($this->reminder_date_time);\r\n\t\t\r\n\t\t//adding specified amount of weeks, months, etc. for event date and reminder date\r\n\t\t$temp_event_date_obj = date_add($temp_event_date_obj, date_interval_create_from_date_string($timeAfter));\r\n\t\t$temp_remind_date_obj = date_add($temp_remind_date_obj, date_interval_create_from_date_string($timeAfter));\r\n\t\t\r\n\t\t//assign a formatted string of new dates\r\n\t\t$this->event_date_time = date_format($temp_event_date_obj, \"Y-m-d H:i:s\");\r\n\t\t$this->reminder_date_time = date_format($temp_remind_date_obj, \"Y-m-d H:i:s\");\r\n\t\t\r\n\t\t//unset both temporary objects to free memory\r\n\t\tunset($temp_event_date_obj);\r\n\t\tunset($temp_remind_date_obj);\r\n\t}",
"public function setTimeSlot($timeSlot) {\r\n\t\t$this->timeSlot = $timeSlot;\r\n\t}",
"public function setTime($time);",
"function setLifeTime($time);",
"public function setStartTime($starttime){\n $this->_starttime = $starttime;\n }",
"public static function changeCurrentTime($currentTime = 'now')\n {\n self::$_currentTime = $currentTime;\n }",
"public function resetTimeLimits()\n {\n unset($this->options['RequestedFromDate']);\n unset($this->options['RequestedToDate']);\n }",
"public function setAttackSpeed()\n {\n $this->_role->attack_speed = 2.50;\n }",
"public static function set_request_end_time()\n {\n $timer = &self::$timer;\n $session_start = $timer->__set('request_end');\n }",
"public function setTimeLimit(int $timeLimit): self;",
"public function setStartTime($newStartTime) {\r\n\t\r\n\t\t$this->localStartTime = $newStartTime;\r\n\r\n\t}",
"public function setTimeframeService(TimeframeService $service)\n {\n $this->timeframeService = $service;\n }",
"public function setAttackSpeed()\n {\n $this->_role->attack_speed = 0.75;\n }",
"public function setTokenValidDate()\n {\n $this->tokenValidDate = new DateTime('+ 2 hours');\n }",
"public function setLifeTime($newLifeTime)\n {\n $this->lifeTime = $newLifeTime;\n $this->refreshTime = time() - $newLifeTime;\n }",
"public function frameSet() {}",
"public function setSyncTime(): void\n {\n }",
"protected function updateRequestTime()\n {\n $this->requestTimestamp = microtime(true);\n }",
"public function setUseTime($use_time) \n \t{\n \t\t$this->use_time = $use_time;\n \t}",
"public function setServerTime();",
"public function setTime($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }",
"public function setTime($a = null)\n {\n throw new NotImplementedException(__METHOD__);\n }",
"public function setFrameRate(\\DedexBundle\\Entity\\Ern41\\FrameRateType $frameRate)\n {\n $this->frameRate = $frameRate;\n return $this;\n }",
"public static function resetCurrentTime()\n {\n \tself::$_currentTime = 'now';\n }",
"public function setTime(float $time)\n {\n $this->_requestTime = $time;\n\n return $this;\n }",
"public function setTime($time=0){\n\t\t\t$this->_time = $time;\n\t\t}",
"public function setExpiry( $expiry );",
"private function setRoundTripTime(string $rtt): void\n {\n $this->round_trip_time = $this->parseRoundTripTime($rtt);\n }",
"public function setMaxAge($expiry)\n {\n $this->expiry = $expiry;\n }",
"public function setRequestTimeOut($requestTimeOut) {\n $this->requestTimeOut = $requestTimeOut;\n }",
"function setTimeSetFlag($boolean)\n\t{\n\t\t$this->TimeSet_Flag = $boolean;\n\t}",
"protected function resetStartTime() : void\n {\n $this->startTime = time();\n }",
"function set_time_zone()\n {\n $this->set_date_to_now();\n $offset = $GLOBALS['time_diff'] - $GLOBALS['server_time_offset'];\n $this->timestamp+=($offset*3600);\n }",
"public function setScheduler() {}",
"public function setDate(?TimeRange $date): void\n {\n $this->date = $date;\n }",
"public function setActivityReward($value)\n {\n return $this->set(self::_ACTIVITY_REWARD, $value);\n }",
"public function setFrame($value) {}",
"public function setTime(?DateTime $value): void {\n $this->getBackingStore()->set('time', $value);\n }",
"public function setFormationTime($value)\n {\n return $this->set(self::FORMATIONTIME, $value);\n }",
"private function addTimer(array &$request) {\n $request['timer'] = microtime(true); //start time\n $request['time'] = false; //default if not overridden by time later\n }",
"public function accelerate()\n {\n }",
"public function setStartTime(?Time $value): void {\n $this->getBackingStore()->set('startTime', $value);\n }",
"public function setTimeStamp()\n\t{\n\t\t$this->_current_timestamp = time();\n\t}",
"public function setStartTime() {\n\t\t$this->pg_start = $this->getStartTime();\n\t}",
"public function setTokenExpiryTime(string $expiryTime): void\n {\n $this->httpClient->setChosenTokenExpiry($expiryTime);\n }",
"public function setStartTime($startTime) {\r\n\t\t$this->startTime = $startTime;\r\n\t}",
"public function setLifeTime($value,$options=array('required'=>true)){ \n $this->_data['life_time'] = new ZendT_Type_Number($value,array('numDecimal'=>0));\n if ($options['db'])\n $this->_data['life_time']->setValueFromDb($value);\n \n if (!$options['db']){\n \n }\n return $this;\n }",
"public function setEndTime($newEndTime) {\r\n\t\r\n\t\t$this->localEndTime = $newEndTime;\r\n\t}",
"public function setBeginTime(string $begin_time): void\n {\n $this->_begin_time = $begin_time;\n }",
"public function setTimeLimit($limit, $followupStateName)\n {\n $this->timeLimit = new TimeLimit($limit, $followupStateName);\n return $this;\n }",
"public function setExpiresAt($timestamp);",
"private function setExpiringSession()\n {\n $now = new Chronos();\n if ($this->session->get('createdAt') === '') {\n $this->session->saveForced('createdAt', $now->toDateTimeString());\n }\n\n $sessionCreatedAt = $this->session->get('createdAt');\n $expired = new Chronos($sessionCreatedAt);\n $expired = $expired->addSeconds($this->expiringTime);\n\n if ($expired->lte($now) && !headers_sent()) {\n $this->destroy();\n }\n }",
"function setStartTime($event, $time) {\n Timer::timers($event, array(\n 'start' => $time,\n 'stopped' => false\n ));\n }",
"protected function setCacheTime( $cacheTime ): void\n {\n $this->_cacheTime = $cacheTime;\n }",
"public function setTauxAutreRegime(?float $tauxAutreRegime): DeclarationCafat {\n $this->tauxAutreRegime = $tauxAutreRegime;\n return $this;\n }",
"public function setRequestedDateTime(?DateTime $value): void {\n $this->getBackingStore()->set('requestedDateTime', $value);\n }",
"public function setCPUThrottlingRate(ContextInterface $ctx, SetCPUThrottlingRateRequest $request): void;",
"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 }",
"public function setEndtime($endtime){\n $this->_endtime = $endtime;\n }",
"public function setTimeOverride( $time ) {\n\t\t$this->time = $time;\n\t}",
"public function setEffectiveTime(DateTime $time): RevisedSubscriptionRequest\n {\n $this->offsetSet(self::EFFECTIVE_TIME, $time->__toString());\n return $this;\n }",
"public function setTimestamp($timestamp, $reassign = false);",
"public function get_framerate()\n {\n }",
"private function setDate(){\n\t// Validate incoming parameters\n\t\t$this->di->logger->stamp(__CLASS__, __METHOD__, '');\n\tif (isset($_GET['month'])) {\n\t\tis_numeric($_GET['month']) or die('month has to be numeric');\n\t}\n\tif (isset($_GET['year'])) {\n\t\tis_numeric($_GET['year']) or die('year has to be numeric');\n\t}\n\n\t// Set new date\n\t$this->newMonth = isset($_GET['month']) ? ($_GET['month']) : $this->currentMonth;\n\t$this->newYear = isset($_GET['year']) ? ($_GET['year']) : $this->currentYear;\n\n\tif ($this->newMonth > 12) {\n\t\t$this->newYear = $this->newYear +1;\n\t\t$this->newMonth = 1;\n\t\t$_GET['month'] = 1;\n\n\t}\n\telse if ($this->newMonth < 1) {\n\t\t$this->newYear = $this->newYear -1;\n\t\t$this->newMonth = 12;\n\t\t$_GET['month'] = 12;\n\t}\n\t\n\t}",
"public function setBeginTime(?string $beginTime): void\n {\n $this->beginTime['value'] = $beginTime;\n }",
"public function setTime($time)\n {\n $this->time = $time;\n\n return $this;\n }",
"public function setTime($time)\n {\n $this->time = $time;\n\n return $this;\n }",
"public function setTime($time)\n {\n $this->time = $time;\n\n return $this;\n }",
"public function setTime($time)\n {\n $this->time = $time;\n\n return $this;\n }",
"public function setEnemyArriveTime($value)\n {\n return $this->set(self::ENEMY_ARRIVE_TIME, $value);\n }",
"public function setRate(?string $rate): void\n {\n $this->rate = $rate;\n }",
"public function setRate(?string $rate): void\n {\n $this->rate = $rate;\n }",
"function setCurrentTimeLog($TimeObject)\n\t{\n\t\t$this->Current_TimeLog = $TimeObject;\n\t}",
"public function time($value): self\n {\n $this->time = $value;\n \n return $this;\n }",
"public function setTravelTime($travelTime = null)\n {\n // validation for constraint: maxInclusive\n if ($travelTime > 0) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, the value must be inferior or equal to 0, \"%s\" given', $travelTime), __LINE__);\n }\n // validation for constraint: minInclusive\n if ($travelTime < 0) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, the value must be superior or equal to 0, \"%s\" given', $travelTime), __LINE__);\n }\n // validation for constraint: pattern\n if (is_scalar($travelTime) && !preg_match('/\\\\-?P(\\\\d*D)?(T(\\\\d*H)?(\\\\d*M)?(\\\\d*(\\\\.\\\\d*)?S)?)?/', $travelTime)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a scalar value that matches \"\\-?P(\\d*D)?(T(\\d*H)?(\\d*M)?(\\d*(\\.\\d*)?S)?)?\", \"%s\" given', var_export($travelTime, true)), __LINE__);\n }\n // validation for constraint: string\n if (!is_null($travelTime) && !is_string($travelTime)) {\n throw new \\InvalidArgumentException(sprintf('Invalid value, please provide a string, \"%s\" given', gettype($travelTime)), __LINE__);\n }\n if (is_null($travelTime) || (is_array($travelTime) && empty($travelTime))) {\n unset($this->TravelTime);\n } else {\n $this->TravelTime = $travelTime;\n }\n return $this;\n }",
"public function add(Timeframe $timeframe)\n {\n $this->timeframes[] = $timeframe;\n return $this;\n }",
"public function setCacheTime($time)\n\t{\n\t\t$this->iCacheTime = $time;\n\t}",
"public function setExpires($value = -1)\n {\n\n }",
"private function setTimeFrame($dayOffset, $startTime, $duration) \n\t{\t \t\t\n\t\t$year=date('Y');\n\t\t$month=date('m');\n\t\t$day=date('d');\n\t\t\n\t\t$tsLength = strlen($startTime);\n\t\t\n\t\t$startHour = substr($startTime, 0, $tsLength-2);\n\t\t$startMinutes = substr($startTime,$tsLength-2,$tsLength);\t\n\t\t\n\t\t$this->startTimestamp = mktime($startHour,$startMinutes,0,$month,$day+$dayOffset,$year);\t\t\n\t\t$this->endTimestamp = mktime($startHour,$startMinutes+$duration,0,$month,$day+$dayOffset,$year);\n\t\t\n\t\t$this->startDate = date('Y-m-d G:i:s', $this->startTimestamp);\t\n\t\t$this->endDate = \tdate('Y-m-d G:i:s',$this->endTimestamp);\t\n\t\t\n\t\t$this->startDateDisplay = date('g:i a - F d, Y',$this->startTimestamp);\t\n\t\t$this->endDateDisplay = \tdate('g:i a - F d, Y',$this->endTimestamp);\t\n\t \n\t}",
"public function setExpTime( $expTime = 0 )\r\n {//-------------------->> setExpTime()\r\n\r\n if ( (int) $expTime <= 0 ) {//---------->> if invalid $expTime\r\n throw new CacheManager_Exception( \"Expiration Time ({$expTime}) must be greater than 0\" );\r\n }//---------->> End if invalid $expTime\r\n\r\n $this->_expTime = (int) $expTime;\r\n\r\n }",
"public function setTimeBasedAttribute($val)\n {\n $this->_propDict[\"timeBasedAttribute\"] = $val;\n return $this;\n }",
"public function setYear($year) {\n $this->_year = $year;\n }",
"public function setStartTime( $start_time)\n {\n $this->values['StartTime'] = $start_time;\n return $this;\n }",
"public function setYear($year);",
"function setTargetFrame($a_target_frame)\n\t{\n\t\t$this->il_target_frame = $a_target_frame;\n\t}",
"protected function expires($time)\r\n {\r\n $this->slim->expires($time);\r\n }",
"private function __set_arm($arm) {\n # tau(r+1) - tau(r) episodes.\n $this->current_arm = $arm;\n $this->next_update += max(1.0, $this->__tau($this->r[$arm] + 1.0) - $this->__tau($this->r[$arm]));\n $this->r[$arm] += 1;\n }",
"function setTZ($tz)\r\n {\r\n $this->tz = $tz;\r\n }",
"public function setTimeZone($time_zone)\n\t{\n\t\tdate_default_timezone_set($time_zone);\n\t\n\t}",
"function SetExpires($expire) {\n\t\t\t$this->__expires = time()+$expire;\n\t\t}",
"private function set_date()\r\n\t{\r\n\t\tif ($this->month > 12)\r\n\t\t{\r\n\t\t\t$this->month=1;\r\n\t\t\t$this->year++;\r\n\t\t}\r\n\r\n\t\tif ($this->month < 1)\r\n\t\t{\r\n\t\t\t$this->month=12;\r\n\t\t\t$this->year--;\r\n\t\t}\r\n\r\n\t\tif ($this->year > 2037) $this->year = 2037;\r\n\t\tif ($this->year < 1971) $this->year = 1971;\r\n\t}",
"public function setFrameDuration($duration)\n {\n $payload = '';\n $payload .= pack('v', $duration);\n\n $this->sendRequest(self::FUNCTION_SET_FRAME_DURATION, $payload);\n }",
"public function setVirtualTimePolicy(\n\t\tContextInterface $ctx,\n\t\tSetVirtualTimePolicyRequest $request\n\t): SetVirtualTimePolicyResponse;",
"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 setLapTime($time)\n {\n\n }",
"public function setTimeToCook($_timeToCook)\n {\n \t$_timeToCook = date('H:i', strtotime($_timeToCook));\n $this->_timeToCook = $_timeToCook;\n }",
"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 }"
]
| [
"0.57062274",
"0.54585785",
"0.5119472",
"0.5098641",
"0.5070242",
"0.49500352",
"0.48995107",
"0.48878643",
"0.48482198",
"0.48410904",
"0.48369512",
"0.4803057",
"0.47957045",
"0.47897977",
"0.4778148",
"0.4776761",
"0.476747",
"0.47674304",
"0.47604558",
"0.4758765",
"0.47579432",
"0.4757818",
"0.4723788",
"0.4723788",
"0.4720219",
"0.4716792",
"0.4712451",
"0.4706812",
"0.46037027",
"0.45834127",
"0.45808855",
"0.45528355",
"0.4549255",
"0.45474103",
"0.454378",
"0.45278037",
"0.45257828",
"0.45257625",
"0.45186418",
"0.45166743",
"0.45085374",
"0.45084828",
"0.44965678",
"0.44944662",
"0.44941136",
"0.4493424",
"0.44717315",
"0.44655335",
"0.44612",
"0.44534433",
"0.44468415",
"0.4437025",
"0.4430834",
"0.44279432",
"0.44234747",
"0.44182768",
"0.4417442",
"0.44117078",
"0.44073573",
"0.4402954",
"0.43891028",
"0.4387809",
"0.4386953",
"0.43855083",
"0.4384783",
"0.4378524",
"0.43765128",
"0.43707746",
"0.43707746",
"0.43707746",
"0.43707746",
"0.4366133",
"0.43637553",
"0.43637553",
"0.43595243",
"0.43586472",
"0.43564597",
"0.4354056",
"0.43443552",
"0.4343028",
"0.43410218",
"0.43235335",
"0.43215734",
"0.43203774",
"0.43133622",
"0.43063375",
"0.43048295",
"0.4297836",
"0.429076",
"0.4278094",
"0.42771128",
"0.42612672",
"0.4261261",
"0.42571768",
"0.4250116",
"0.42467093",
"0.42467093",
"0.42390686",
"0.4238507",
"0.42382854"
]
| 0.4848196 | 9 |
Set the base value for accelerated Rewards. | public function setBaseValue() {
$sessionstaff = $this->Session->read('staff');
if ($_POST['base_value'] == '') {
$_POST['base_value'] = 0;
}
$this->AccessStaff->query('update access_staffs set base_value=' . $_POST['base_value'] . ' where clinic_id=' . $sessionstaff['clinic_id']);
echo 1;
die;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function set_base($val) {\n\t\t$this->base = $val;\n\t}",
"public function setBaseValue($baseValue)\r\n {\r\n $this->baseValue = $baseValue;\r\n return $this;\r\n }",
"public function setBase( $base ) {\n\n $this->base = $base;\n }",
"public function setBaseToGlobalRate($rate);",
"public function set_value($value) {\n\t\t$this->_value = $value + 0;\n\t}",
"public function setBaseState($baseState) {}",
"public function testSetBaseAllowsSettingOfBase()\n {\n $request = new Request($this->config, []);\n $base = uniqid('', true);\n $request->setBase($base);\n $this->assertEquals($base, $request->getBase());\n $this->assertEquals($base, $request->base);\n }",
"public function setBase($base)\n\t{\n\t\t$this->base = $base;\n\n\t\treturn $this;\n\t}",
"public function setBase($base) {\n $this->base = $base;\n return $this;\n }",
"public function setMaxSpeed($val){\n $this->maxSpeed = $val;\n return $this;\n }",
"public function setAdvance($number);",
"private function compute($base){\n\t\t$amount = \n\t\t $this->getSkillPercent($this->miningSkill) *\n\t\t $this->getSkillPercent($this->astroSkill) *\n\t\t $this->getSkillPercent($this->frigateSkill) *\n\t\t $this->getSkillPercent($this->upgradeLaser)\t\t\n\t\t;\n\t\treturn $base * $amount * $this->getVentureBonus();\n\t}",
"public function setBasePrice(?float $basePrice): self\n {\n $this->initialized['basePrice'] = true;\n $this->basePrice = $basePrice;\n\n return $this;\n }",
"public function setLogarithmicBase($value) {\r\n $this->logarithmicBase = $this->setDoubleProperty($this->logarithmicBase, $value);\r\n }",
"public function setIsBase(bool $isBase)\n\t{\n\t\t$this->isBase=$isBase; \n\t\t$this->keyModified['is_base'] = 1; \n\n\t}",
"function set_acl_base($base)\n {\n $this->acl_base = $base;\n foreach ($this->plugins as $name => $obj) {\n $this->plugins[$name]->set_acl_base($base);\n }\n }",
"public function setStoreToBaseRate($rate);",
"public function getBaseValue()\r\n {\r\n return $this->baseValue;\r\n }",
"public function setBaseAdjustmentPositive($baseAdjustmentPositive);",
"public function getBaseToGlobalRate();",
"public function set_reward_point_multiplier($value = FALSE)\r\n\t{\t\t\r\n\t\tif (empty($value) || $value < 0)\r\n\t\t{\r\n\t\t\t// Look-up database value.\r\n\t\t\tif ($config_data = $this->get_database_config_data('reward_point_multiplier'))\r\n\t\t\t{\r\n\t\t\t\t$value = $config_data[$this->flexi->cart_database['configuration']['columns']['reward_point_multiplier']];\r\n\t\t\t}\r\n\t\t\t// Look-up config file value.\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t$value = $this->flexi->cart_defaults['configuration']['reward_point_multiplier'];\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$this->flexi->cart_contents['settings']['configuration']['reward_point_multiplier'] = $this->format_calculation($value, 4, TRUE);\r\n\t\t\r\n\t\treturn TRUE;\r\n\t}",
"public function setAttackSpeed()\n {\n $this->_role->attack_speed = 2.50;\n }",
"public function setCurrentPower($newValue) {\r\n $this->cached_current_power = $newValue;\r\n }",
"public function setAttackSpeed()\n {\n $this->_role->attack_speed = 0.75;\n }",
"public function setBase($base = null): object\n\t{\n\t\tif (null !== $base && !($base instanceof FHIRUri)) {\n\t\t\t$base = new FHIRUri($base);\n\t\t}\n\t\t$this->_trackValueSet($this->base, $base);\n\t\t$this->base = $base;\n\t\treturn $this;\n\t}",
"public function ChargerUnDefi($base,$num)\n {\n\n }",
"public function baseUnit($value) {\n return $this->setProperty('baseUnit', $value);\n }",
"public function setBaseToOrderRate($rate);",
"public function setSpeed($value){\n\t\t$value = (int) $value;\n\t\tif ($value < 28) $value=28;\n\t\tif ($value > 128) $value=128;\n\t\t$this->_sendPacketToController(self::SET_SPEED, pack('C', $value));\n\t\treturn $this->_getResponse();\n\t}",
"public function getStoreToBaseRate();",
"public function set_base_path( $path ) {\n\t\t$this->base_path = $path;\n\t}",
"public function set()\n {\n if ( ! $this->value ) {\n $this->generate();\n }\n }",
"public function setNumerator($value): TURational\n\t{\n\t\t$value = min(max(0, $value), TBitHelper::PHP_INT32_UMAX);\n\t\tif (PHP_INT_SIZE > 4 || $value <= PHP_INT_MAX) {\n\t\t\t$this->_numerator = (int) $value;\n\t\t} else {\n\t\t\t$this->_numerator = (float) $value;\n\t\t}\n\t\treturn $this;\n\t}",
"public function setBase($baseUrl) {\n\t\t\n\t\t\t$this->_base = $baseUrl;\n\t\t\n\t\t}",
"function set_base_dir($dir) {\n if($dir[strlen($dir)-1] != '/') {\n $dir .= '/'; \n }\n \n $this->base_dir = $dir;\n }",
"function mBASE(){\n try {\n $_type = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$BASE;\n $_channel = Erfurt_Sparql_Parser_Sparql11_Update_Tokenizer11::$DEFAULT_TOKEN_CHANNEL;\n // Tokenizer11.g:96:3: ( 'base' ) \n // Tokenizer11.g:97:3: 'base' \n {\n $this->matchString(\"base\"); \n\n\n }\n\n $this->state->type = $_type;\n $this->state->channel = $_channel;\n }\n catch(Exception $e){\n throw $e;\n }\n }",
"public function setBestRankReward($value)\n {\n return $this->set(self::_BEST_RANK_REWARD, $value);\n }",
"public function setSBase(?float $sBase): ChargesPaie {\n $this->sBase = $sBase;\n return $this;\n }",
"public function setAmount()\n\t {\n\t \tthrow new OutOfBoundsException(\"Reversal request does not support amount parameter\");\n\t }",
"public function setBaseTotalQtyOrdered($baseTotalQtyOrdered);",
"public function setMinDamage(){ $this->minDamage = 10; }",
"public function getBase(): void {}",
"public function setStructureRightBackMetalDust($value) {\n switch ($value) {\n case 0 : // Sin da�o\n return 0;\n break;\n case 7 : // Deformacion Fuerte\n return 14;\n break;\n case 8 : // Deformacion medio\n return 12;\n break;\n case 6 : // Malo\n return 20;\n break;\n case 9 : // Golpe\n return 0;\n break;\n case 10 : // Rayon\n return 1;\n break;\n case 11 : // Reparacion Buena\n return 0;\n break;\n case 12 : // Reparacion Mala\n return 10;\n break;\n case 13 : // Sumido\n return 2;\n break;\n }\n }",
"public function setCurrentAmmo($currentAmmo) {\n $this->currentAmmo = $currentAmmo;\n }",
"public function setBaseAmount($amount) {\r\n $this->baseAmount = NumberDataTypeHelper::truncate(floatval($amount), 2);\r\n }",
"function set_base_url($url)\n\t{\n\t\t$this->base_url = $url;\n\t}",
"public function setHireReward($value)\n {\n return $this->set(self::_HIRE_REWARD, $value);\n }",
"public function setBaseRateAmount($baseRateAmount)\n {\n $this->baseRateAmount = $baseRateAmount;\n return $this;\n }",
"function base($base = null)\n {\n $this->q_base = ($base !== null) ? $base : null;\n return true;\n }",
"public function accelerate()\n {\n }",
"public function setBaseWidth($baseWidth) {\n $this->baseWidth = $baseWidth;\n return $this;\n }",
"public function setWeight() {\n }",
"public function setPower()\n {\n $this->_role->power = 100;\n }",
"public function setRegressedStepsCount(?int $value): void {\n $this->getBackingStore()->set('regressedStepsCount', $value);\n }",
"function __set($name, $value) {\r\n if ($name == 'mr') {\r\n $this->max_rating = intval($value);\r\n } else if ($name == 'st') {\r\n $this->step = intval($value);\r\n } else if ($name == 'vis') {\r\n $this->visible = $value == '1';\r\n } else if ($name == 'seq') {\r\n $this->sequence = intval($value);\r\n } else if ($name == 'cr') {\r\n $this->created = DateTime::createFromFormat('Y-m-d H:i:s', $value);\r\n } else if ($name == 'upd') {\r\n $this->updated = DateTime::createFromFormat('Y-m-d H:i:s', $value);\r\n } else if ($name == 'num') {\r\n $this->num_ratings = intval($value);\r\n } else if ($name == 'total') {\r\n $this->tot_ratings = floatval($value);\r\n }\r\n\r\n }",
"public function set_tag_base($tag_base)\n {\n }",
"function set_base_url($url) {\n if($url[strlen($url)-1] != '/') {\n $url .= '/'; \n }\n \n $this->base_url = $url;\n }",
"public function setExposureNumerator(?float $value): void {\n $this->getBackingStore()->set('exposureNumerator', $value);\n }",
"public function setPower()\n {\n $this->_role->power = 200;\n }",
"public function setBaseURI($baseURI)\r\n {\r\n $baseURI .= (substr($baseURI, -1) === '/' ? '' : '/');\r\n $this->baseURI = $baseURI;\r\n }",
"public function setRmb($value)\n {\n return $this->set(self::RMB, $value);\n }",
"protected function changeBaseApi() {\n $domain = $this->language.'.'.$this->engine_supported[$this->engine];\n $this->base_api = sprintf('http://%s/w/api.php?format=json&rawcontinue=1&', $domain);\n }",
"public static function setBaseURL($baseURL){\n self::$baseURL = $baseURL;\n }",
"public function setRound( $rx )\n {\n $this->addAttribute('rx', $rx );\n }",
"private function __set_arm($arm) {\n # tau(r+1) - tau(r) episodes.\n $this->current_arm = $arm;\n $this->next_update += max(1.0, $this->__tau($this->r[$arm] + 1.0) - $this->__tau($this->r[$arm]));\n $this->r[$arm] += 1;\n }",
"public function setMaxSpeed(int $maxSpeed) : void\n {\n $this->maxSpeed = $maxSpeed;\n }",
"public function setBaseTotalInvoiced($baseTotalInvoiced);",
"public function setBankroll(int $br)\n\t{\n\t\t$this->bankroll = max($br, $this->getStartingStackSize());\n\t}",
"public function setBaseUri($base_uri)\n {\n $this->baseUri = $base_uri;\n }",
"private function setBaseURL($url){\n\t\t$this->baseURL = $url;\n\t}",
"public function setBodyworkRightBackDoor($value) {\n switch ($value) {\n case 0 : // Sin da�os\n return 0;\n break;\n case 1 : // Golpe medio\n return 12;\n break;\n case 2 : // Golpe fuerte\n return 14;\n break;\n case 3 : // reparacion mala\n return 10;\n break;\n case 4 : // repintado\n return 1;\n break;\n case 5 : // sumido\n return 2;\n break;\n }\n }",
"public function setQuota($value) {\n $this->_quota = $value;\n }",
"public function setBatteryCapacityPoor(?int $value): void {\n $this->getBackingStore()->set('batteryCapacityPoor', $value);\n }",
"public function setBaseUri($base)\n\t{\n\t\t$this->baseUri = $base;\n\t\treturn $this;\n\t}",
"public function setSpeed($value)\n {\n return $this->set(self::SPEED, $value);\n }",
"public function setBaseUrl($base = null) {\r\n\t\t$this->_baseUrl = $base;\r\n\t\tif ((null !== ($request = $this->getRequest())) && (method_exists($request, 'setBaseUrl'))) {\r\n\t\t\t$request->setBaseUrl($base);\r\n\t\t}\r\n\t\treturn $this;\r\n\t}",
"public function setActivityReward($value)\n {\n return $this->set(self::_ACTIVITY_REWARD, $value);\n }",
"public function setRimsFrontRight($value) {\n switch ($value) {\n case 0 : // Sin da�o\n return 0;\n break;\n case 14 : // 10\n return 10;\n break;\n case 15 : // 20\n return 20;\n break;\n case 16 : // 30\n return 30;\n break;\n case 17 : // 40\n return 40;\n break;\n case 18 : // 50\n return 50;\n break;\n case 19 : // 60\n return 60;\n break;\n case 20 : // 70\n return 70;\n break;\n case 21 : // 80\n return 80;\n break;\n case 22 : // 90\n return 90;\n break;\n }\n }",
"public function setBaseTotalPaid($baseTotalPaid);",
"public function setAcquirerBIN($value) {\n if(strlen($value) > 10 ){\n throw new ValueException(\"Value \".$value.\" is higher than 10\");\n }\n $this->AcquirerBIN = $value;\n }",
"function get_tax_base_rate() {\n\t\t\n\t\tif ( $this->is_taxable() && get_option('woocommerce_calc_taxes')=='yes') :\n\t\t\t\n\t\t\t$_tax = &new woocommerce_tax();\n\t\t\t$rate = $_tax->get_shop_base_rate( $this->data['tax_class'] );\n\t\t\t\n\t\t\treturn $rate;\n\t\t\t\n\t\tendif;\n\t\t\n\t}",
"function setValue(int $idx, int $val) {\n if ($idx > $this::SRAM_SIZE) {\n throw new \\Exception(\"Initial SRAM index out of bounds: \" . $idx);\n }\n if ($val > 255 || $val < 0) {\n throw new \\Exception(\"Initial SRAM value out of bounds: \" . $val);\n }\n\n $this->initial_sram_bytes[$idx] |= $val;\n }",
"protected function setBasePath()\n {\n $this->container->instance('path.base', $this->basePath);\n }",
"private function setRateLimiterKey()\n {\n $this->rateLimiterKey = sha1($this->formRequestClass . request()->ip());\n }",
"public function setBaseTotalInvoicedCost($baseTotalInvoicedCost);",
"public final function & setApplicationBaseDir( $a_base )\r\n\t{\r\n\t\t$this->m_basedir = (string)$a_base;\r\n\t\treturn $this;\r\n\t}",
"public function getBaseToOrderRate();",
"abstract public function setValue($value);",
"public function setMag($mag_)\n\t{\n\t\t$s = $mag_ / $this->mag();\n\t\t$this->scale($s);\n\t}",
"public function setBoost($boost) {\n $boost = (float) $boost;\n\n if ($boost > 0.0) {\n $this->_documentBoost = $boost;\n }\n else {\n $this->_documentBoost = FALSE;\n }\n }",
"function revItUp($x) {\r\n return $this->speedometer + 5; \r\n }",
"public function setBaseTotalDue($baseTotalDue);",
"public function setRawValue($value) {\n\n $this->rawValue = $value;\n }",
"public function setRequest(Mage_Shipping_Model_Rate_Request $request)\n {\n if ($request->getAutoConfig()) {\n return $this->setRequestAutoConfig($request);\n } else {\n return parent::setRequest($request);\n }\n }",
"public function setBaseTaxAmount($amount);",
"public function setRenewalThresholdPercentage(?int $value): void {\n $this->getBackingStore()->set('renewalThresholdPercentage', $value);\n }",
"public function setStructureLeftBackMetalDust($value) {\n switch ($value) {\n case 0 : // Sin da�o\n return 0;\n break;\n case 7 : // Deformacion Fuerte\n return 14;\n break;\n case 8 : // Deformacion medio\n return 12;\n break;\n case 6 : // Malo\n return 20;\n break;\n case 9 : // Golpe\n return 0;\n break;\n case 10 : // Rayon\n return 1;\n break;\n case 11 : // Reparacion Buena\n return 0;\n break;\n case 12 : // Reparacion Mala\n return 10;\n break;\n case 13 : // Sumido\n return 2;\n break;\n }\n }",
"public function setRmb($value)\n {\n return $this->set(self::_RMB, $value);\n }",
"public function setRmb($value)\n {\n return $this->set(self::_RMB, $value);\n }",
"public function setCr($value)\n {\n $this->setParam('cr', $value);\n }"
]
| [
"0.6826884",
"0.60023266",
"0.5996425",
"0.55798393",
"0.5542416",
"0.5478484",
"0.54539037",
"0.53596675",
"0.53251433",
"0.52467805",
"0.51846284",
"0.51768655",
"0.51767176",
"0.5137322",
"0.5115109",
"0.5111494",
"0.5091897",
"0.50695765",
"0.5000818",
"0.4999898",
"0.49884635",
"0.4988252",
"0.49660975",
"0.49659336",
"0.49622074",
"0.49568915",
"0.49494398",
"0.49231762",
"0.49158913",
"0.49143574",
"0.49110186",
"0.4900329",
"0.4884521",
"0.48732916",
"0.48642766",
"0.48576915",
"0.48336372",
"0.4818232",
"0.48181653",
"0.48134044",
"0.47767186",
"0.47648153",
"0.4764691",
"0.475545",
"0.4748835",
"0.4742281",
"0.4737209",
"0.4720513",
"0.4711345",
"0.4703176",
"0.4672839",
"0.46664104",
"0.46554348",
"0.46516037",
"0.4648169",
"0.46382308",
"0.46351954",
"0.46314564",
"0.46309233",
"0.46173757",
"0.46165037",
"0.4615885",
"0.46154183",
"0.4613094",
"0.46096268",
"0.46001986",
"0.4599506",
"0.4596807",
"0.45944455",
"0.45733213",
"0.4572865",
"0.45704406",
"0.4564241",
"0.45627043",
"0.45609003",
"0.45554727",
"0.45432693",
"0.45416072",
"0.4541218",
"0.45345527",
"0.45332792",
"0.45290723",
"0.4527592",
"0.45230177",
"0.45226234",
"0.45197886",
"0.451958",
"0.4511283",
"0.45109612",
"0.45087186",
"0.45040706",
"0.4498952",
"0.44943768",
"0.44932234",
"0.44878268",
"0.44865754",
"0.4482878",
"0.44826007",
"0.44826007",
"0.44808042"
]
| 0.62036175 | 1 |
Open the database connection | public function __construct($x) {
//echo "$x";
$DB_PASSWORD=$x;
// open database connection
$conStr = sprintf("mysql:host=%s;dbname=%s;charset=utf8", self::DB_HOST, self::DB_NAME);
try {
$this->pdo = new PDO($conStr, self::DB_USER, $DB_PASSWORD);
//for prior PHP 5.3.6
//$conn->exec("set names utf8");
} catch (PDOException $e) {
echo $e->getMessage();
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function open_db() {\n\n\t\t//var_dump($this->connection); exit;\n\n\t\t\n\n\t}",
"protected function openConn() {\n $database = new Database();\n $this->conn = $database->getConnection();\n }",
"public function open_db_connection() {\n $this->connection = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);\n // cgecking if the connection has errors\n if($this->connection->connect_errno) {\n die(\"Database connection failed\" . $this->connection->connect_error);\n }\n }",
"protected function openConn()\n {\n $database = new Database();\n $this->conn = $database->getConnection();\n }",
"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 static function open_db_connection(){\r\n self::$connection = new mysqli(DB_SERVER, DB_USER, DB_PASS, DB_NAME);\r\n\t\t}",
"public function open_db_connection()\n\t{\n\n\t\t$this->connection = new mysqli(DB_HOST,DB_USER,\n\t\t\tDB_PASS,DB_NAME);\n\n\t\tif ($this->connection->connect_errno):\n\t\t\tdie('database connection failed badly' . $this->connection->connect_error);\n\t\tendif;\n\n\t}",
"private function openDb() {\n if(!$this->db) {\n $this->db = new Db();\n }\n }",
"public function openConnection() {\n if($this->database != null) return;\n\n $config = $this->getDatabaseConfig();\n\n try {\n $this->database = new \\PDO(\n 'mysql:dbname=' . $config['database'] . ';host=' . $config['host'] . ':' . $config['port'],\n $config['username'],\n $config['password'],\n [\n \\PDO::ATTR_ERRMODE => \\PDO::ERRMODE_EXCEPTION,\n \\PDO::ATTR_DEFAULT_FETCH_MODE => \\PDO::FETCH_ASSOC\n ]\n );\n } catch(\\PDOException $exception) {\n die('Connection to mysql-server failed: ' . $exception->getMessage());\n }\n }",
"public function open_db_connection() {\n //$this->connection = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);\n\n //the more \"object oriented\" way of doing this is this next line:\n $this->connection = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);\n\n if( $this->connection->connect_errno ) {\n die(\"Database connection failed badly\" . $this->connection->connect_error);\n }\n\n }",
"private function openDatabaseConnection()\n {\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\n //UTF-8 encoding queries\n $this->db->exec(\"SET NAMES 'utf8'\");\n $this->db->exec(\"SET CHARACTER SET utf8\");\n $this->db->exec(\"SET COLLATION_CONNECTION='utf8_unicode_ci'\");\n }",
"private function openConnection()\n\t{\n if (!($this->link = mysql_connect($this->host, $this->user, $this->pass))){\n throw new DatabaseExceptions(302);\n }\n\n $db_selected = mysql_select_db($this->db, $this->link);\n if (!$db_selected) {\n throw new DatabaseExceptions(303);\n }\n\n\t}",
"public function openConnection() {\n\t\t$this->connection = new mysqli($this->host, $this->username, $this->password, $this->database);\n\n\t\tif ($this->connection->connect_error) {\n\t\t\tdie(\"<p>Error:\" . $this->connection->connect_error . \"</p>\");\n\t\t}\n\t }",
"public function open()\n {\n $this->conexion= mysqli_connect(\"localhost:3306\",\"root\") or die (msql_error());\n mysqli_select_db($this->conexion, 'alsaplane') or die (msql_error());\n }",
"public function open_conn(){\n \n \n $this->connection = mysql_connect(DB_SERVER, DB_USER, DB_PASS);\n \n if(!$this->connection){\n die(\"Database Connection Failed because: \" . mysql_error());\n }else{\n $db_select = mysql_select_db(DB_NAME,$this->connection);\n if(!$db_select){\n die(\"Database Connection Failed because: \" .mysql_error());\n }\n }\n }",
"public function open_connection() {\n try{\n \t\t$conn_string = \"mysql:host=\" . DB_SERVER . \";dbname=\" . DB_NAME . \";charset=utf8\";\n \t\t$this->connection = new PDO($conn_string, DB_USER, DB_PASS);\n \t\t$this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);\n \t} catch (PDOException $e) {\n \t\techo \"Connection failed: \" . $e->getMessage();\n \t}\n }",
"private function openconnection(){\r\n $options = array(\r\n PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,\r\n PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING\r\n\r\n // PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION,\r\n // PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC,\r\n // PDO::ATTR_EMULATE_PREPARES => false,\r\n );\r\n try{\r\n $this->db = new PDO('mysql' . ':host=' . DBHOST . DBPORT . ';dbname=' . DBNAME.';charset='.CHARSET, DBUSER, DBPASS, $options);\r\n } catch (Exception $e) {\r\n throw new Exception($e->getMessage(), (int)$e->getCode());\r\n }\r\n }",
"public function openConnection() {\n $this->connection = new mysqli($this->host, $this->username, $this->password, $this->database);\n\n if ($this->connection->connect_error) {\n die(\"Error: \" . $this->connection->connect_error);\n }\n }",
"function Open(){\n\t\t$this->con = pg_connect($this->strCon);\n\t}",
"public function open_connection()\n {\n $this->connection = new mysqli(DB_SERVER, DB_USER, DB_USR_PASS, DB_NAME);\n if (mysqli_connect_errno()) \n {\n exit('Connect failed: '. mysqli_connect_error());\n }\n }",
"public function connectToDB() {}",
"public function openConnection() { \n\t\t\t// Try and connect to the database\n\t\t\tif(!isset(self::$connection)) {\n\t\t\t\t// Load configuration as an array. Use the actual location of your configuration file\n\t\t\t\t$config = parse_ini_file(\"../scripts/config.ini\");\n\t\t\t\tself::$connection = new mysqli($config['host'], $config['user'], $config['pass'], $config['db']);\n\n\t\t\t\t// If connection was not successful, handle the error\n\t\t\t\tif(self::$connection === false) {\n\t\t\t\t\t// Handle error\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\treturn self::$connection;\n\t\t\t}\n\t\t}",
"private function openConnection() {\n $this->db = new PDO(\"mysql:host=127.0.0.1;dbname=mvc\", \"gert\", \"becode\");\n }",
"private function connectToDatabase()\n {\n return DbConnection::connectToDatabase($this->link);\n }",
"private function open_db_connection(){\n $this->connection = new mysqli(DB_HOST,DB_USER,DB_PASS,DB_NAME) \n or\n die(\"database connection failed\" . $this->connection->connect_error);\n \n }",
"public function open_database_connection()\n {\n $server = 'blog';\n $dbname = 'blog';\n $username = 'root';\n $password = 'root';\n\n $link = new \\PDO(\"mysql:host=$server;dbname=$dbname\", $username, $password);\n\n return $link;\n }",
"private function open_connection(){\n\t\t$this -> conn = new mysqli(self::$SERVER, self::$USER, self::$PASS, $this -> DATABASE);\n\t}",
"public function open_db_connection(){\n\n // refer to this class connection -> procedural way\n // $this->connection = mysqli_connect(DB_HOST, DB_USER, DB_PASS, DB_NAME);\n\n // refer to this class connection -> oriented way\n $this->connection = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);\n\n // when error occurs during attempt of database connection\n // if(mysqli_connect_errno()){\n\n // when error occurs during attempt of database connection\n // using connect_errno is a build in function from mysqli\n if($this->connection->connect_errno){ \n // exit with message and error\n // using connect_errno is a build in function from mysqli\n die(\"Database connection failed badly!\" . $this->connection->connect_error);\n }\n }",
"function _open() {\n\t\tif (!$this->DbConnection) {\n\t\t\t$db = &GetDatabase();\n\t\t\tif (!$db) return false;\n\t\t\t$this->DbConnection = &$db;\n\t\t}\n\t\treturn true;\n\t}",
"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}",
"public function open()\n {\n if (!isset($this->handle)) {\n $this->stats->benchmark('bedrockWorkerManager.db.open', function () {\n $this->handle = new SQLite3($this->location);\n $this->handle->busyTimeout(15000);\n $this->handle->enableExceptions(true);\n });\n }\n }",
"private function connectDatabase() {\r\r\n\t\t$this->dbHandle = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::makeInstance('TYPO3\\\\CMS\\\\Core\\\\Database\\\\DatabaseConnection');\r\r\n\t\t$this->dbHandle->setDatabaseHost($this->dbHost);\r\r\n\t\t$this->dbHandle->setDatabaseUsername($this->dbUsername);\r\r\n\t\t$this->dbHandle->setDatabasePassword($this->dbPassword);\r\r\n\t\t$this->dbHandle->setDatabaseName($this->db);\r\r\n\t\t$this->dbHandle->sql_pconnect();\r\r\n\t\t$this->dbHandle->sql_select_db();\r\r\n\t}",
"public function openConnection() {\n $this->mysqli = new mysqli($this->hostname, $this->username, $this->password, $this->database);\n if (mysqli_connect_errno()) {\n header( 'HTTP/1.1 500 DB Error' );\n die(mysqli_connect_error());\n }\n }",
"public function connect_db() {\n }",
"public function connectDB() {}",
"function openDatabaseConnection() {\n\t\t# open connection to MySQL database\n\t\t$link = mysql_connect(MYSQL_HOST, MYSQL_USER, MYSQL_PASSWORD)\n\t\t\tor die(\"Could not connect to the SQL database server help\");\n\t\tmysql_select_db(MYSQL_DATABASE) or die(\"Could not connect to the SQL database server\");\n\t}",
"public function connect(){ //connrct to database\r\t\tif ($this->connected==false){\r\t\t\tif ($this->pers){\r\t\t\t\t$this->handle=sqlite_popen($this->server);\r\t\t\t}else{\r\t\t\t\t$this->handle=sqlite_open($this->server);\r\t\t\t}\r\t\t\t\r\t\t\t//$this->engine = new SQLiteDatabase($this->server);\r\t\t\t$this->connected=true;\r\t\t}//\r\t}",
"public static function open(){\n//\t\techo 'open'.\"\\n<br>\";\n\t\t$db = RuntimeInfo::instance()->connections()->MySQL(RuntimeInfo::instance()->helpers()->Session()->getSessionConfig()->getHosts());\n\t\t\n\t\t// Change this dependant on what the default db type is (ex: mysql 4.o-, 4.1+, or oracle 10g+)\n\t\tif($db instanceof MySQLAbstraction) { return true; } // to true from $db\n\t\treturn false;\n\t}",
"public function openConnection(){\n try {\n $this->con = new PDO (\n $this->server,\n $this->user,\n $this->password, \n $this->options\n );\n \n return $this->con;\n } catch (PDOException $error) {\n echo \"Error connection: \".$error->getMessage();\n }\n }",
"function openDB() {\r\n global $db;\r\n if(!is_resource($db)) {\r\n /* Conection String eg.: mysqli(\"localhost\", \"lpaecomms\", \"letmein\", \"lpaecomms\")\r\n * - Replace the connection string tags below with your MySQL parameters\r\n */\r\n $db = new mysqli(\r\n \"localhost\",\r\n \"root\",\r\n \"\",\r\n \"lpa_ecomms\"\r\n );\r\n if ($db->connect_errno) {\r\n echo \"Failed to connect to MySQL: (\" .\r\n $db->connect_errno . \") \" .\r\n $db->connect_error;\r\n }\r\n }\r\n}",
"function openDatabaseConnection() \n{\n\t$options = array(PDO::ATTR_DEFAULT_FETCH_MODE => PDO::FETCH_ASSOC, PDO::ATTR_ERRMODE => PDO::ERRMODE_WARNING);\n\t\n\t$db = new PDO(DB_TYPE . ':host=' . DB_HOST . ';dbname=' . DB_NAME . ';charset=' . DB_CHARSET, DB_USER, DB_PASS, $options);\n\n\treturn $db;\n}",
"public function open(){\n $this->load->database();\n }",
"private function dbConnect(){\n $database=new \\Database();\n return $database->getConnection();\n }",
"function establish_connection() {\n\t \t\tself::$db = Registry()->db = SqlFactory::factory(Config()->DSN);\n\t \t\tself::$has_update_blob = method_exists(self::$db, 'UpdateBlob');\n\t\t\treturn self::$db;\n\t\t}",
"public function __construct(){\n $this->open_db();\n }",
"function open($connection_id = 0) {\n\t\tif ($connection_id == 0) {\n\t\t\t# get credentials from object variables\n\t\t\t$connection_string = $this->format_pg_connection_string($this->get_object_credentials());\n\t\t}\n\t\telse {\n\t\t\t$this->debug->write(\"Open Database connection with connection_id: \" . $connection_id, 4);\n\t\t\t$this->connection_id = $connection_id;\n\t\t\t$connection_string = $this->get_connection_string();\n\t\t}\n\t\t$this->dbConn = pg_connect($connection_string);\n\t\tif (!$this->dbConn) {\n\t\t\t$this->err_msg = 'Die Verbindung zur PostGIS-Datenbank konnte mit folgenden Daten nicht hergestellt werden: ' . str_replace($credentials['password'], '********', $connection_string);\n\t\t\treturn false;\n\t\t}\n\t\telse {\n\t\t\t$this->debug->write(\"Database connection: \" . $this->dbConn . \" successfully opend.\", 4);\n\t\t\t$this->setClientEncodingAndDateStyle();\n\t\t\t$this->connection_id = $connection_id;\n\t\t\treturn true;\n\t\t}\n\t}",
"function db_connect(){\n\t\tif(SQ_DEBUG){\n\t\t\t$this->dbh = mysql_connect($this->dbhost, $this->dbuser, $this->dbpassword, true);\n\t\t}else{\n\t\t\t$this->dbh = @mysql_connect($this->dbhost, $this->dbuser, $this->dbpassword, true);\n\t\t}\n\t\t\n\t\tif (!$this->dbh){\n\t\t\t$error_message = sprintf(SQ_DB_CONN_ERROR_MESSAGE, $this->dbhost, $this->dbuser);\n\t\t\tthrow new SQ_Exception($error_message, SQ_DB_CONN_ERROR_CODE);\n\t\t}\n\t\t$this->ready = true;\n\t\t\n\t\ttry{\n\t\t\t$this->select($this->dbname, $this->dbh);\n\t\t}catch(SQ_Exception $e){\n\t\t\tthrow $e;\n\t\t}\n\t}",
"function openConnection() {\n\t\t$this->conn = new mysqli(self::$host, self::$user, self::$pass, $this->db_name);\n\t\tmysqli_set_charset($this->conn, 'utf8');\n\t}",
"private function openConnection(){\n if($_SERVER[\"DOCUMENT_ROOT\"]==\"\")\n require \"../utility/connection.php\";\n else\n require $_SERVER[\"DOCUMENT_ROOT\"] . \"/mythos_pr/src/utility/connection.php\";\n\n $this->connessione=$connessione;\n\t\t}",
"private function connectToDB()\n {\n $this->handler = new DBConnect();\n $this->handler = $this->handler->startConnection();\n }",
"protected function db_connect() {\n \n // Data source name\n $this->dsn = 'mysql:host=' . $this->db_host . ';dbname=' . $this->db_name . ';charset=' . $this->db_charset;\n\n // Makes a connection to the database\n $this->db_conn = new PDO( $this->dsn, $this->db_user, $this->db_password );\n\n // When fetching an SQL row it turn into an object\n $this->db_conn->setAttribute( PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ );\n // Gives the Error reporting atribute and throws exeptions\n $this->db_conn->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\n \n // Returns the connection\n return $this->db_conn;\n\n }",
"public function open_connection(){\n $srv=self::$db_host;\n $opc=array(\"Database\"=>$this->db_name, \"CharacterSet\"=>\"UTF-8\", \"UID\"=>self::$db_user, \"PWD\"=>self::$db_pass);\n $this->conn = sqlsrv_connect($srv,$opc) or die (print_r('Error al conectar con la Base de Datos SQLSRV !!! Favor de Informar a Sistemas!!!'));\n #(print_r(sqlsrv_errors(), true));\n }",
"private function dbConnection() {\r\n //if (!is_resource($this->connessione))\r\n // $this->connessione = mysql_connect($this->db_server,$this->db_username,$this->db_pass) or die(\"Error connectin to the DBMS: \" . mysql_error());\r\n if (!is_resource($this->connessione)) {\r\n try {\r\n $this->connessione = new PDO($this->db_type . \":dbname=\" . $this->db_name . \";host=\" . $this->db_server, $this->db_username, $this->db_pass);\r\n //echo \"PDO connection object created\";\r\n $this->setupSQLStatement();\r\n } catch (PDOException $e) {\r\n echo $e->getMessage();\r\n die();\r\n }\r\n }\r\n }",
"public function connect()\n {\n $driver = 'DB'; // default driver\n $dsn = $this->getParameter('dsn');\n\n $do = $this->getParameter('dataobject');\n if ($do && isset($do['db_driver'])) {\n $driver = $do['db_driver'];\n }\n\n if ('DB' == $driver) {\n\n if (!class_exists('DB')) {\n include('DB.php');\n }\n\n $options = PEAR::getStaticProperty('DB', 'options');\n if ($options) {\n $this->connection = DB::connect($dsn, $options);\n } else {\n $this->connection = DB::connect($dsn);\n }\n \n } else {\n\n if (!class_exists('MDB2')) {\n include('MDB2.php');\n }\n \n $options = PEAR::getStaticProperty('MDB2', 'options');\n $this->connection = MDB2::connect($dsn, $options);\n }\n\n if (PEAR::isError($this->connection)) {\n\n throw new AgaviDatabaseException($this->connection->getMessage());\n $this->connection = Null;\n }\n }",
"function openConnection(){\n\n\ttry {\n\n\t\t$dbh = new PDO('mysql:host=' . DB_HOST . ';dbname=' . DB_NAME, DB_USER, DB_PASSWORD);\n\n\t} catch (PDOException $e) {\n\n\t\t\techo 'Erro ao conectar com o MySQL: ' . $e->getMessage();\n\t}\n\n\t// Change character set to UTF-8\n\t$dbh->exec(\"set names \" . DB_CHARSET);\n\n\treturn $dbh;\n}",
"public function openConnection() {\n\t\ttry {\n\t\t\t$this->conn = new PDO(\"mysql:host=$this->host;dbname=$this->database\", \n\t\t\t\t\t$this->userName, $this->password);\n\t\t\t$this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t} catch (PDOException $e) {\n\t\t\t$error = \"Connection error: \" . $e->getMessage();\n\t\t\tprint $error . \"<p>\";\n\t\t\tunset($this->conn);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public function openConnection() {\n\t\ttry {\n\t\t\t$this->conn = new PDO(\"mysql:host=$this->host;dbname=$this->database\",\n\t\t\t\t\t$this->userName, $this->password);\n\t\t\t$this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t} catch (PDOException $e) {\n\t\t\t$error = \"Connection error: \" . $e->getMessage();\n\t\t\tprint $error . \"<p>\";\n\t\t\tunset($this->conn);\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public function open_connection() {\n\t\t$this->connection = mysqli_connect('192.168.0.106', 'root', 'Kabul@123', 'php_quiz_db', 33068);\n\t\tif(!$this->connection) {\n\t\t\tdie(\"Database connection failed: \" . mysqli_error());\n\t\t}\n\t}",
"public function open_connection() {\n $this->link = mysql_connect(parent::get_host(), parent::get_user(), parent::get_pass());\n\n # setting charset mysql \n mysql_set_charset('utf8', $this->link);\n }",
"public function connect() {\n\t \t\tif (!extension_loaded('oci8')) {\n\t throw new SQLException('OCI8 extension not loaded');\n\t }\t\t\n\t\t\t$dsn = $this->dsn;\n\n\t\t\t$user = $dsn['username'];\n\t\t\t$pass = $dsn['password'];\n\t\t\t$hostspec = $dsn['hostspec'];\n\t\t\t$db\t= $dsn['database'];\n\t\t\t\n\t\t\tif ($db && $hostspec && $user && $pass) {\n\t\t\t\t$resource = oci_connect($user, $pass, \"//$hostspec/$db\", $this->charset);\n\t\t\t}\n\t\t\telseif ($hostspec && $user && $pass) {\n\t\t\t\t$resource = oci_connect($user, $pass, $hostspec, $this->charset);\n\t\t\t}\n\t\t\telseif ($user || $pass) {\n\t\t\t\t$resource = oci_connect($user, $pass, null, $this->charset);\n\t\t\t}\n\t\t\telse {\n\t\t\t\t$resource = false;\n\t\t\t}\n\t\t\t\n\t\t\tif (!$resource) {\n\t\t\t\tthrow new SqlConnectionError($this);\n\t\t\t}\n\t\t\t$this->resource = $resource;\n\t\t\t$this->query(\"ALTER SESSION SET NLS_DATE_FORMAT='\" . $this->timestamp . \"'\");\n\t\t\treturn true;\t \t\n\t\t}",
"private function db_connect() {\n\n\t\t$new_link = defined( 'MYSQL_NEW_LINK' ) ? MYSQL_NEW_LINK : TRUE;\n\t\t$client_flags = defined( 'MYSQL_CLIENT_FLAGS' ) ? MYSQL_CLIENT_FLAGS : 0;\n\n\t\t// Connect to database.\n\t\tif ( DEBUG_MODE ) {\n\t\t\t$this->dbcon = mysqli_connect($this->dbhost, $this->dbuser, $this->dbpassword, $this->dbname, $this->dbport);\n\t\t} else {\n\t\t\t$this->dbcon = @mysqli_connect($this->dbhost, $this->dbuser, $this->dbpassword, $this->dbname, $this->dbport);\n\t\t}\n\n\t\tif ( mysqli_connect_errno () ) {\n\t\t\t/* ===== Bail ===== */\n\t\t\tif (DEBUG_DISPLAY) {\n\t\t\t\techo (\"Failed to connect to MySQL: \" . mysqli_connect_error() . '<br />');\n\t\t\t}\n\t\t}\n\n\t\t// Set charset.\n\t\tmysqli_set_charset ( $this->dbcon, $this->dbcharset );\n\n\t\t// Set collate.\n\t\t// mysqli_query ( $this->dbcon, \"COLLATE {$this->dbcollate}\" );\n\n\t\t// Set the database as ready for queries.\n\t\t$this->ready = TRUE;\n\t}",
"public function open($db_conn_params, $charset = 'utf8')\r\n {\r\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 OpenConnection() { \n if ($this->USE_PERMANENT_CONNECTION) { \n $conn = mysql_pconnect($this->SERVER,$this->USERNAME,$this->PASSWORD); \n } else { \n $conn = mysql_connect($this->SERVER,$this->USERNAME,$this->PASSWORD); \n } \n if ((!$conn) || (!mysql_select_db($this->DATABASE,$conn))) { \n $this->ERROR_MSG = \"\\r\\n\" . \"Unable to connect to database - \" . date('H:i:s'); \n $this->debug(); \n return false; \n } else { \n $this->CONNECTION = $conn; \n return true; \n } \n }",
"function OpenCon() {\n $dbhost = \"\";\n $dbuser = \"\";\n $dbpass = \"\";\n if($_SERVER['SERVER_NAME'] == \"localhost\"){\n $dbhost = \"localhost\";\n $dbuser = \"root\";\n $dbpass = \"root\";\n }\n else{\n $dbhost = \"db.cs.dal.ca\";\n $dbuser = \"aio\";\n $dbpass = \"ge7ochooCae7\";\n }\n $db = \"aio\";\n $conn = new mysqli($dbhost, $dbuser, $dbpass, $db) or die(\"Connect failed: %s\\n\". $conn -> error);\n return $conn;\n }",
"function __construct() {\n $this->open_db_connection();\n }",
"public function Open()\n {\n if (isset($this->db_link)) {\n echo \"Warning : You already connected to MySql.\";\n } else {\n $this->db_link = mysqli_connect($this->db_host, $this->db_user, $this->db_password, $this->db_database_select);\n if (mysqli_error($this->db_link)) {\n die(\"Connection failed: \" . mysqli_error($this->db_link));\n }\n return true;\n }\n return false;\n }",
"function __construct() {\n $this->open_db_connection();\n }",
"private function connect()\n {\n if ($this->configuration->get('db.connector') == 'PDO') {\n $dsn = \"mysql:host=\" . $this->configuration->get('db.host') . \";dbname=\" . $this->configuration->get('db.name');\n $options = array();\n $this->db = new PDO(\n $dsn, $this->configuration->get('db.username'), $this->configuration->get('db.password'), $options\n );\n } elseif ($this->configuration->get('db.connector') == 'mysqli') {\n $this->db = mysqli_connect(\n $this->configuration->get('db.host'), $this->configuration->get('db.username'), $this->configuration->get('db.password'), $this->configuration->get('db.name')\n );\n }\n }",
"public function openConnection()\n {\n try {\n $this->conn = new PDO(\"mysql:host=$this->host;dbname=$this->database\",\n $this->userName, $this->password);\n $this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n } catch (PDOException $e) {\n $error = \"Connection error: \" . $e->getMessage();\n print $error . \"<p>\";\n unset($this->conn);\n return false;\n }\n return true;\n }",
"public function open_connection() {\n\n $this->connection = mysqli_connect(\"sql7.freemysqlhosting.net\", \"sql7293366\", \"cgApy8fEvJ\") or die(\"Connection failed: \" . mysqli_connect_error());\n \n// $this->connection = mysqli_connect(Config::DB_HOST, Config::DB_USERNAME, Config::DB_PASSWORD) or die(\"Connection failed: \" . mysqli_connect_error());\n// var_dump($this->connection);\n //die :print message \n //mysqli_connect_error():returns the error description from the last connection error if there is no error return null\n// or die('Could not connect: ' . mysqli_error($this->connection));\n $this->select_database();\n }",
"function db_open( ) {\n\t$dbinfo['username']=\"username\";\n\t$dbinfo['password']=\"password\";\n\t$dbinfo['dbname']=\"dbname\";\n\t$dbinfo['host']=\"host\";\n // Connecting\n $ret['id'] = mysql_connect( $dbinfo['host'], $dbinfo['username'], $dbinfo['password'] );\n if( !$ret['id'] ) {\n $ret['error'] = \"ERROR: Cannot connect to database!\";\n return $ret;\n }\n\n // Selecting DB\n if ( !mysql_select_db( $dbinfo['dbname'], $ret['id'] ) ) {\n $ret['error'] = \"ERROR: Cannot select database!\";\n return $ret;\n\t\t}\n\n return $ret;\n}",
"function open_database_connection()\n{\n\trequire('models/db_config.php');\n $db = new PDO('mysql:host=' . $dbhost . ';dbname=' . $dbname . ';charset=utf8', $dbuser, $dbpass);\n\t$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t$db->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);\n\n return $db;\n}",
"function connect() {\n trigger_before( 'connect', $this, $this );\n $this->conn = mysql_connect($this->host,$this->user,$this->pass,$this->opt1,$this->opt2);\n if (!$this->conn) {\n $this->db_open = false;\n trigger_error(\"Sorry, the database connection failed. Please check your database connection settings.\".@mysql_error($this->conn), E_USER_ERROR );\n } else {\n $this->db_open = mysql_select_db($this->dbname);\n if (!$this->db_open)\n trigger_error(@mysql_error($this->conn), E_USER_ERROR );\n }\n return $this->db_open;\n }",
"public function getDbConnection()\n {\n $this->conn = Registry::get('db');\n }",
"private function connect()\n {\n if (! is_null(self::$db)) {\n return;\n }\n\n // $this->host \t= $Database->host;\n // $this->user \t= $Database->user;\n // $this->pass \t= $Database->pass;\n // $this->database\t= $Database->database;\n\n $conn = 'mysql:dbname=' . $this->dbInfo->database . ';host=' . $this->dbInfo->host.';charset=utf8';\n try {\n self::$db = new PDO($conn, $this->dbInfo->user, $this->dbInfo->pass);\n } catch (PDOException $e) {\n die('Could not connect to database (' . $conn . ')');\n }\n }",
"public function getConnect()\n {\n $this->conn = Registry::get('db');\n }",
"function __construct(){\n $this->open_db_connection();\n }",
"public function connect() {\n if ($this->link = mysql_connect($this->host, $this->user, $this->pass)) {\n if (!empty($this->name)) {\n if (!mysql_select_db($this->name)) {\n $this->exception(\"Could not connect to the database!\");\n }\n }\n } else {\n $this->exception(\"Could not create database connection!\");\n }\n }",
"protected function db()\n\t\t{\n\t\t\tif( !$this->_db ) {\n\t\t\t\t$this->_db = \\Kalibri::db()->getConnection( $this->connectName );\n\t\t\t}\n\n\t\t\treturn $this->_db;\n\t\t}",
"function connect_to_db(){\n\t\t//Fun Fact: @ suppresses errors of the expression it prepends\n\t\t\n\t\t//Connect to the database and select the database\t\t\t\n\t\ttry{\n\t\t\t$this->connection = new PDO(\"mysql:host=$DATABASE_HOST;dbname=DATABASE_NAME\", DATABASE_USER, DATABASE_PASS);\n\t\t\t$this->connection->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t\t}catch(PDOException $err){\n\t\t\tdie('Could not connect to database' . $err->getMessage());\n\t\t}\t\t\n\t}",
"protected function connectDB () {\n $host=$this->Parameters['db_host'];\n $username=$this->Parameters['db_username'];\n\t\t$password=$this->Parameters['db_userpassword'];\n\t\t$dbname=$this->Parameters['db_name'];\n\t\t\n $this->Conn = new mysqli ($host,$username,$password,$dbname);\n if($this->Conn->connect_errno > 0){\n throw new Exception('Unable to connect to database [' . $this->Conn->connect_error . ']');\n }\n }",
"private function openConnexion()\n {\n try {\n $bdd = new PDO($this->db, $this->login, $this->pass);\n $bdd->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);\n $bdd->setAttribute(PDO::ATTR_DEFAULT_FETCH_MODE, PDO::FETCH_OBJ);\n $this->connec = $bdd;\n // return $this->connec;\n } catch (PDOException $e) {\n die($e->getMessage());\n }\n }",
"function openDb() {\n $host = DB_HOST;\n $username = DB_USER;\n $password = DB_PASSWORD;\n $database = DB_NAME;\n\n // create connection\n $connection = mysqli_connect($host, $username, $password, $database);\n\n // check if connection was successful\n if (mysqli_connect_errno()) {\n die(\"MYSQL connection failed\");\n }\n\n return $connection;\n}",
"private function databaseConnection(){\n \t\tif($this->connection != null){\n \t\t\treturn;\n \t\t} else {\n \t\t\t$this->connection = mysqli_connect(\"127.0.0.1\", \"user\", \"password\", \"database\") or die(\"Error \" . mysqli_error($this->connection));\n \t\t}\n\n\t}",
"function open()\n {\n switch ($this->engine)\n {\n case \"mysql\":\n if (mysql_select_db($this->dbName))\n {\n $this->resetError();\n return true;\n }\n else\n {\n $this->setError(\n \"Could not open the database $this->dbName: \"\n . mysql_error(),\n \"open #001\"\n );\n return false;\n }\n break;\n }\n }",
"private function OpenDbConnection()\n\t{\n\t\t\n\t\ttry\n\t\t{\n\t\t\t$this->DB_CONN = mysqli_connect($this->DB_HOST, $this->DB_USER, $this->DB_PASS, $this->DB_NAME);\n\t\t\t\n\t\t\tif ( mysqli_connect_errno() > 0 )\n\t\t\t{\n\t\t\t\n\t\t\t\tthrow new Exception('Unable to connect to database');\n\t\t\t}\n\t\t\treturn true;\n\t\t}\n\t\tcatch(Exception $e)\n\t\t{\n\t\t\tdie ('error connecting');\n\t\t\ttrigger_error('Database server cannot be accessed.', E_USER_WARNING);\n\t\t\tif ( $_SERVER['SCRIPT_NAME'] != '/error.php' )\n\t\t\t{\n\t\t\t\tRedirect::GotoError('We\\'re sorry, but our database is currently unavailable at this time. Our engineers are working to bring GAA back to you.');\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public function getConnection(){\n \n \n $this->db_conn = OCILogon($this->username, $this->password,$this->db_name); \n \n return $this->db_conn;\n }",
"public function openConnection(){\n\n $this->conn = null;\n\n // for non PDO Connection:\n $serverName = \"tcp:\" . $this->host . \",\" . $this->port;\n $connectionOptions = array(\"Database\"=>$this->db_name,\"Uid\"=>$this->username, \"PWD\"=>$this->password);\n\n // for PDO Connection:\n// $serverName = \"tcp:$this->host,$this->port\";\n $serverName = \"tcp:$this->host,$this->port\";\n $connectionString = \"sqlsrv:server=$serverName; Database=$this->db_name\";\n\n try{\n// $this->conn = sqlsrv_connect($serverName, $connectionOptions);\n $this->conn = new PDO( $connectionString, $this->username, $this->password);\n\n if($this->conn == false){\n die(FormatErrors(sqlsrv_errors()));\n }\n }catch(Exception $exception){\n echo \"Connection error: \" . $exception->getMessage();\n }\n\n return $this->conn;\n }",
"private function dbconnect()\n {\n $this->db = new mysqli(Config::$dbhost, Config::$dbuser, Config::$dbpass, Config::$database);\n if (mysqli_connect_errno()) {\n Log::info(sprintf(\"Connect failed: %s\\n\", mysqli_connect_error()));\n exit();\n }\n }",
"public function connectToDatabase(){\n\t\t$dbinfo=$this->getDBinfo();\n\n\t\t$host=$dbinfo[\"host\"];\n\t\t$dbname=$dbinfo[\"dbname\"];\n\t\t$user=$dbinfo[\"user\"];\n\t\t\n $pass=$this->getPassword();//don't share!!\n\n try{\n $DBH = new PDO(\"mysql:host=$host;dbname=$dbname\", $user, $pass);\n $DBH->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\n }catch(PDOException $e){\n $this->processException($e);\n }\n \n $this->setDBH($DBH);\n }",
"public static function getConnection() {\n\t\t// if there isn't a connection already then create one\n\t\tif ( !self::$dbConnection ) {\n\t\t\ttry {\n\t\t\t\tself::$dbConnection = new PDO( 'sqlite:/local-html/year-3/CM0665-web-app-int/angular/srs.sqlite');\n\t\t\t\tself::$dbConnection->setAttribute( PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION );\n\t\t\t}\n\t\t\tcatch( PDOException $e ) {\n\t\t\t\t// in a production system you would log the error not display it\n\t\t\t\techo $e->getMessage();\n\t\t\t}\n\t\t}\n\t\t// return the connection\n\t\treturn self::$dbConnection;\n\t}",
"function db_open($database) {\n\n global $server, $user, $password;\n\n $link = mysqli_connect($server, $user, $password, $database);\n\n if (mysqli_connect_errno()) {\n throw new Exception('Connection failed: ' . mysqli_connect_error());\n }\n else {\n mysqli_query($link, 'SET NAMES utf8');\n }\n\n return $link;\n}",
"public function connect() {\n\t\t$cnn_string = 'host='.$this->_dbhost.' port='.$this->_dbport.' user='.$this->_dbuser.' password='.$this->_dbpass.' dbname='.$this->_dbname;\n\t\t\n\t\t$this->_instance = pg_connect($cnn_string) or PK_debug(__FUNCTION__, \"No se ha podido conectar con la DB\\n\\n\".pg_errormessage(), array('class'=>'error'));\n\t\t\n\t\tif (!$this->_instance) {\n\t\t\techo '<h1>Error en la aplicacion</h1><p>No se ha podido conectar con la base de datos</p>';\n\t\t\tPK_debug('', '', 'output');\n\t\t\texit();\n\t\t}\n\t\t\n\t\treturn $this->_instance;\n\t}",
"public function connectOpen()\n\t{\n\t try {\n\t $this->pdo = new PDO(\"mysql:host=127.0.0.1;port=8889;dbname=kiva\", DBUSER, DBPASS, array(PDO::ATTR_EMULATE_PREPARES => false));\n\t echo \"\\n\\nConnected to database....\\n\\n\";\n\t } catch (Exception $e) {\n\t //error_log(json_encode(array('ERROR' => 'pdo_connect', 'errno: ' => 'initial_connect_issue', 'errmsg: ' => $e->getMessage(), 'FAIL' => true)));\n\t $this->pdo->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);\n\t error_log(json_encode(array('ERROR' => 'pdo_connect', 'errno: ' => $this->pdo->errorCode(), 'errmsg: ' => $this->pdo->errorInfo(), 'FAIL' => true)));\n\t return false;\n\t }\n\t}",
"function __construct(){\r\n\t\t\t$this->open_db_connection();\r\n\t\t}",
"public static function connect() {\n\t\tif(!self::$conn) {\n\t\t\tnew Database();\n\t\t}\n\t\treturn self::$conn;\n\t}",
"private function connect(){\n\t\trequire (__DIR__ . '/../../config.php');\n\t\t$mysqlCFG =$database['mysql'];\n\t\t\n\t\tif(!self::$db){\n\t\t\t$connectionString = \"mysql:host=$mysqlCFG[host];dbname=$mysqlCFG[dbname]\";\n\t\t\ttry{\n\t\t\t\tself::$db = new \\PDO($connectionString, $mysqlCFG['user'], $mysqlCFG['password']);\n\t\t\t\tself::$db->setAttribute( \\PDO::ATTR_ERRMODE, \\PDO::ERRMODE_EXCEPTION);\n\t\t\t}catch(\\PDOException $e){\n\t\t\t\tdie(\"Ocurrio un error al conectar con la base de datos: $e->getMessage()\");\n\t\t\t}\n\t\t}\n\t\t\n\t}",
"private function databaseConnection()\n {\n // connection already opened\n if ($this->db_connection != null) {\n return true;\n } else {\n // create a database connection, using the constants from config/config.php\n try {\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 // Also important: We include the charset, as leaving it out seems to be a security issue:\n // @see http://wiki.hashphp.org/PDO_Tutorial_for_MySQL_Developers#Connecting_to_MySQL says:\n // \"Adding the charset to the DSN is very important for security reasons,\n // most examples you'll see around leave it out. MAKE SURE TO INCLUDE THE CHARSET!\"\n $this->db_connection = new PDO(\"pgsql:host=\".DB_HOST.\" port=\".DB_PORT.\" dbname=\".DB_NAME.\" user=\".DB_USER.\" password=\".DB_PASS.\"\");\n return true;\n // If an error is catched, database connection failed\n } catch (PDOException $e) {\n $this->errors[] = MESSAGE_DATABASE_ERROR;\n return false;\n }\n }\n }",
"private function connect() {\n $this->load->database();\n }",
"public function connect(){\n $this->con = oci_connect($this->user, $this->pass, $this->db, 'AL32UTF8');\n if( !$this->con){\n $e = oci_error();\n throw new Exception(\"Error al conectar db; \"\n . \"User: {$this->user}, Database: {$this->db}, Error: \"\n . $e);\n\n }\n\n }"
]
| [
"0.8204084",
"0.8010863",
"0.79819906",
"0.7981011",
"0.78926146",
"0.77947354",
"0.7751673",
"0.7748963",
"0.7699226",
"0.76735884",
"0.7671268",
"0.7552949",
"0.7491333",
"0.7479642",
"0.74672604",
"0.7432462",
"0.7418931",
"0.7410973",
"0.74103034",
"0.73999953",
"0.7377285",
"0.7309987",
"0.729231",
"0.7271711",
"0.72697383",
"0.72475404",
"0.7241875",
"0.7236324",
"0.72252095",
"0.71967787",
"0.7180853",
"0.71502095",
"0.7130119",
"0.7111507",
"0.71089536",
"0.708458",
"0.70823437",
"0.7056961",
"0.7052219",
"0.7051804",
"0.7048872",
"0.70129985",
"0.6998765",
"0.69968224",
"0.6991369",
"0.6981563",
"0.69720364",
"0.6964185",
"0.69597346",
"0.6940918",
"0.6930605",
"0.6928886",
"0.6926147",
"0.69212747",
"0.6909835",
"0.68904775",
"0.68808955",
"0.68761384",
"0.6847606",
"0.68440694",
"0.6828674",
"0.6823531",
"0.6820397",
"0.6818241",
"0.68123543",
"0.68104386",
"0.6808541",
"0.6785032",
"0.67846656",
"0.67821777",
"0.67794216",
"0.67754245",
"0.67657393",
"0.6762116",
"0.6755095",
"0.67290723",
"0.67233735",
"0.6720431",
"0.6706711",
"0.6704496",
"0.6704383",
"0.6696936",
"0.6694467",
"0.6687924",
"0.6686337",
"0.6680701",
"0.6676483",
"0.6675446",
"0.6675169",
"0.66744035",
"0.6667646",
"0.66625404",
"0.66624707",
"0.6659057",
"0.6642925",
"0.6641601",
"0.66412085",
"0.6641106",
"0.6639126",
"0.66362077",
"0.6635494"
]
| 0.0 | -1 |
close the database connection | public function __destruct() {
// close the database connection
$this->pdo = null;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function close(){\n $this->db->close();\n }",
"function closeDbConnection() {\n global $objDb;\n\n if (isset($objDb)) {\n @$objDb->Close();\n }\n }",
"public function close(){\n $this->database->close();\n $this->connected=false;\n }",
"public function close()\n {\n $this->db = null;\n }",
"protected function closeConection()\n {\n $this->db->close();\n unset($this->db);\n unset($this->satz);\n }",
"public function close()\n\t{\n\t\t\n\t\t//disconnect db\n\t\tmysql_close($this->link);\n\t\t\n\t}",
"function DbClose() {\n mysqli_close($this->link);\n }",
"private function close() {\n if (!empty($this->_dbConn)) {\n pg_close($this->_dbConn);\n unset($this->_dbConn);\n }\n }",
"private function closeConnection(){\n $this->db =null;\n }",
"public function closeDb(){\n $this->db->close();\n }",
"public function CloseConnection()\n {\n $this->db = null;\n }",
"public function close_connection()\n {\n $this->db = null;\n }",
"public function closeDatabase(){\r\n\t\t\tmysqli_close($this->conn);\r\n\t\t}",
"function close() {\n // closing db connection\n mysql_close();\n }",
"function close()\n\t{\n\t\t@mysqli_close($this->dbLink);\n\t}",
"function closedbconnection() {\r\n\t\t\r\n\t\t\r\n #if ($this->dbconnection = TRUE) {\r\n mysql_close($this->dbconnection);\r\n #}\r\n \r\n }",
"function close_db() {\n\t\tmysql_close($this -> dbc);\n\t}",
"function close() {\n mysql_close($this->db);\n }",
"function close()\n\t{\n\t\tmysql_close($this->db_server_link);\n\t}",
"function database_close()\n {\n // DO DATABASE QUERY LOGGING\n if( $this->log_stats ) $this->database_log_stats();\n if( $this->log_stats ) $this->database_log_stats_cleanup();\n \n\t return mysql_close($this->database_connection);\n\t}",
"public static function close()\n {\n static::$_db = null;\n }",
"public function close(){\r\n\t\tself::$dbh = null;\r\n\t\tself::$db = null;\r\n\t}",
"function closeDB() {\r\n global $db;\r\n try {\r\n if(is_resource($db)) {\r\n $db->close();\r\n }\r\n } catch (Exception $e)\r\n {\r\n throw new Exception( 'Error closing database', 0, $e);\r\n }\r\n}",
"public function db_close(){\n mysqli_close($this->mysql);\n }",
"private function closeConnection(){\n $this->file_db = null;\n }",
"function closedb(){\r\n\t\tif($this->socket)\r\n\t\t\t\r\n\t\t\tmysqli_close($this->socket);\r\n\t\t\t$this->connected = false;\r\n\t}",
"public function close_db_connection(){\n\t\n\t\tif(!$this->persist_connection){\n\t\n\t\t\tif(!@mysql_close($this->connection)){\n\t\t\t\t\t\n\t\t\t\tthrow new Exception(\"Connection close failed :   \" . $this->server . \"\");\n\t\t\t\t\t\n\t\t\t}\n\t\n\t\t}else{\n\t\n\t\t\tthrow new Exception(\"Persistant connection can't be closed :   \" . $this->server . \" \");\n\t\t}\n\t}",
"private function close_connection(){\n\t\t$this -> conn -> close();\n\t}",
"function close_db(){\n $this->_dbh = null;\n \n }",
"function close_db(){\n $this->_dbh = null;\n \n }",
"function __destruct() {\n $this->db->close();\n }",
"function __destruct() {\n $this->db->close();\n }",
"private function CloseDbConnection()\n\t{\n\t\tmysqli_close($this->DB_CONN);\n\t}",
"function close() { \r\n\t\t\t// closing db connection \r\n\t\t\tmysqli_close($this->CONN); \r\n\t\t}",
"public function close()\n\t{\n\t\t$this->connection->close();\n\t}",
"public function CloseDB(){\n\n\t\t\t$this->failedQuery = true;\n\n\t\t\tswitch($this->databaseType){\n\n\t\t\t\tcase 1:\n\t\t\t\t\tmysqli_close($this->connection);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 2:\n\t\t\t\t\todbc_close($this->connection);\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 3:\n\t\t\t\t\t$this->connection = NULL;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}",
"function __destruct() {\n $this->db->close();\n }",
"public function closeConnection()\n {\n foreach ($this->db as $item) {\n $item->closeConnection();\n }\n\n }",
"public function close()\n {\n if (isset($this->handle)) {\n $this->stats->benchmark('bedrockWorkerManager.db.close', function () {\n $startTime = microtime(true);\n $this->handle->close();\n unset($this->handle);\n });\n }\n }",
"function end() {\n\t\t\t$this->db->close();\n\t\t}",
"public function closeDB(){\r\n $this->db->schließen();\r\n $this->con = 0;\r\n }",
"function close()\n\t{\n\t\t$this->connection->close();\n\t}",
"public function __destruct(){\n $this->db->close();\n }",
"public function disconnect() {\n if (isset($this->database))\n @$this->database->close();\n }",
"public function closeConnection() {\r\n\t\tif(is_resource($this->connection)) {\r\n\t\t\t@mysql_close($this->connection);\r\n\t\t}\r\n\t}",
"public function close_connection() {\n mysql_close($this->link);\n }",
"public static function closeConnection(){\n //Check if instance exists\n if(isset(self::$instance)){\n //Closes connection\n self::$connection = null;\n //unset the instance, following connections will require re-connection to the DB.\n self::$instance = null;\n }\n }",
"function fvls_db_close(){\n\t\tglobal $FLVS_db_link;\n\t\t$return = $FLVS_db_link->close();\t// Close the connection and store success status (boolean response)\n\t\tif( $return )\n\t\t\t$FLVS_db_link = NULL;\t// Closing the connectino doesn't change the variable resource type - so we need to manually alter it\n\n\t\treturn $return;\t// Kick back out the boolean status\n\t}",
"public function disconnect()\n {\n $this->db->dispose();\n }",
"function close_connection()\n\t{\n\t\t mysqli_close($this->db_connect);\n\t}",
"public function closeConnection() {\n mysql_close();\n }",
"public function __destruct()\n {\n parent::$db->closeConnection();\n }",
"private function close_connection() \n\t\t{\n\t\t\t$this->conn->close();\n\t\t}",
"function db_close()\n{\n\tglobal $db;\n\t$db->close();\n}",
"public function close(){\n \n if(isset($this->conexion))//Compruebo que haya alguna conexion\n { \n mysqli_close($this->conexion) or die (msql_error());//Si la hay, la cierro\n }\n }",
"function close() {\n if ($this->is_valid())\n @mysql_close($this->connection);\n }",
"public function closeConnection() {\n if ($this->conn) {\n $this->log('Closing Connection');\n fclose(self::getInstance()->getConnection());\n $this->conn = null;\n exit();\n }\n }",
"function closeConnection() {\n\t\t$this->conn->close();\n\t}",
"public function close()\r\n\t{\r\n\t\t$this->conn->Close();\r\n\t}",
"public function __destruct()\n {\n $this->db->close($this->conn);\n }",
"protected function __destruct()\n {\n if (self::$db) self::$db->close();\n }",
"protected function closeConnection()\n\t{\n\t\t$this->connection->close();\n\t}",
"function db_close()\n\n\t{\n\n\t\t$param_array = func_get_args();\n\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::db_close() - PARAMETER LIST : ', $param_array);\n\n\n\n\t\t$this->optimize_database();//12022007\n\n\t\tmysql_close($this->dbresource_id);\n\n\t\t\n\n\t\t$GLOBALS['logger_obj']->debug('<br>METHOD database_manipulation::db_close() - Return Value : ', 'Closing Database Connection and Returning Void.', true);\n\n\t\t\n\n\t}",
"public function close()\n {\n mysqli_free_result($this->resulset);\n mysqli_close($this->databaseLink);\n }",
"function db_disconnect()\n\t{\n\t\tpg_close($this->db_connection);\n\t}",
"function __destruct()\n\t{\n\t\t$this->db->close();\n\t}",
"function closeDBConnection() {\n\t\tglobal $dbh;\n\t\tif($dbh) {\n\t\t\t/*if(mysqli_close($dbh)) {\n\t\t\t\tprint \"Close successfull else {\";\n\t\t\t} else {\n\t\t\t\tprint \"Cannot Close successfull else {\";\n\t\t\t}\t*/\n\t\t\tmysqli_close($dbh);\n\t\t\t$dbh = null;\n\t\t}\n\t}",
"private function close_connection() {\n\t\t$this->conn->close();\n\t}",
"protected function __destruct() \r\n {\r\n $this->_database->close();\r\n }",
"public function closeConnection()\n \t{\n \t\t$this->connection = null;\n \t}",
"public function close(){\n\t\t// close mysql connection\n\t\tmysqli_close ( $this->adapter);\n\t}",
"function close()\n {\n switch ($this->engine)\n {\n case \"mysql\":\n mysql_close($this->connection);\n break;\n }\n }",
"public function disconnectDatabase()\n {\n $this->database->close();\n $this->database = null;\n }",
"protected function closeConnection(){\n if($this->con !=null){\n $this->con->close();\n $this->con=null;\n }\n\n }",
"public function disconnect()\n {\n \t//$GLOBALS['log']->debug('Calling DBManager::disconnect()');\n $close = $this->backendFunctions['close'];\n if(isset($this->database)){\n $this->freeResult();\n if ( is_resource($this->database) || is_object($this->database) )\n\t\t\t\t$close($this->database);\n unset($this->database);\n }\n }",
"public function closeConnection() {\n if (isset($this->connection)) {\n $this->connection->close();\n }\n }",
"public function closeConnection() {\n if (isset($this->connection)) {\n $this->connection->close();\n }\n }",
"private function closeConnection(){\n\t\t\t$this->connessione->close();\n\t\t}",
"public function close()\n\t \t{\n\t \t\t if($this->cnn)\n\t \t\t {\n\t \t\t \t mysqli_close($this->cnn);\n\t \t\t }\n\t \t}",
"public function mysqlclose() {\n // close connection\n $this->mySQLConnection->close();\n }",
"function DBClose(\\Simplon\\Mysql\\Mysql $dbh) {\n $dbh->close();\n}",
"public function close(){\n\n $this->conn::close();\n\n }",
"function closeDatabase($db) {\n}",
"protected function _close()\n\t{\n\t\t$this->connID->close();\n\t}",
"public function closeConnection() {\n\t\tif ($this->conn) {\n\t\t $this->conn->close();\n\t\t}\n\t}",
"function __destruct()\r\n\t\t{\r\n\t\t\t$this->myDatabase->close();\r\n\t\t}",
"public function close()\r\n\t{\r\n\t\tif($this->cn){mysqli_close($this->cn);}\r\n\t}",
"private function _closeConnection() {\n\t\tif (is_resource($this->connection)) {\n\t\t\t// close connection\n\t\t\t@odbc_close($this->connection);\n\t\t}\n\t}",
"public function close()\n {\n // Does nothing, since connections are persistent\n }",
"public function closeConn(){\n $this->conn->close();\n }",
"public function close_connection() {\n if($this->connection) {\n mysql_close($this->connection);\n $this->connection = \"\";\n }\n }",
"public function close_connection() {\n\t\tif(isset($this->connection)) {\n\t\t\tmysqli_close($this->connection);\n\t\t\tunset($this->connection);\n\t\t}\n\t}",
"function closeConnection() {\n return mysql_close();\n }",
"function __destruct()\n\t{\n\t\t$this->dblink->close();\n\t}",
"public function closeConnection ()\n {\n $this->_connection = null;\n }",
"public function close()\n {\n $this->connection = null;\n }",
"function Close(){\n\t\tpg_close($this->con);\n\t}",
"function closeDatabaseConnection($db_connection)\r\n\t{\r\n\t\tmysql_close($db_connection);\r\n\t}",
"function close() {\r\n\t\t\tif ( $this->_conn != null ) {\r\n\t\t\t\t$this->_conn = null;\r\n\t\t\t\t@OCILogoff( $this->_conn );\r\n\t\t\t}\r\n\t\t}",
"function close() { \n// closing db connection \nmysql_close(); \n}",
"function closedb($sql)\r\n{\r\n if ($sql) {\r\n // Close resources\r\n $sql->Close();\r\n $sql->mode_id('r'); // switch to alternate mode, if any\r\n $sql->Close();\r\n }\r\n}"
]
| [
"0.82339287",
"0.81827533",
"0.8121967",
"0.8120944",
"0.81099874",
"0.8102921",
"0.80939746",
"0.8073393",
"0.806954",
"0.80437",
"0.80386084",
"0.8028734",
"0.7999252",
"0.7964285",
"0.7933153",
"0.7920438",
"0.7910806",
"0.79025275",
"0.7865043",
"0.7864044",
"0.7849018",
"0.7830068",
"0.7794992",
"0.7782254",
"0.7758847",
"0.7742577",
"0.7740707",
"0.7740296",
"0.7690056",
"0.7690056",
"0.7681026",
"0.7681026",
"0.7649712",
"0.7646391",
"0.76407194",
"0.76360804",
"0.763039",
"0.76286095",
"0.76152194",
"0.76036",
"0.7593003",
"0.75892246",
"0.7584345",
"0.7571847",
"0.75356495",
"0.75315595",
"0.75264245",
"0.75212413",
"0.7519034",
"0.74991935",
"0.7493461",
"0.74875504",
"0.74868435",
"0.74846387",
"0.74815553",
"0.74804723",
"0.7467687",
"0.74666023",
"0.7464142",
"0.74632883",
"0.74632496",
"0.74604",
"0.74576885",
"0.74432117",
"0.7442068",
"0.7441602",
"0.7437799",
"0.74232644",
"0.7402829",
"0.74021804",
"0.7388565",
"0.7383698",
"0.73799694",
"0.7378177",
"0.737697",
"0.737433",
"0.737433",
"0.73701763",
"0.7363007",
"0.7337145",
"0.7333258",
"0.7320504",
"0.7317068",
"0.7314958",
"0.73138815",
"0.73127896",
"0.7304175",
"0.7303932",
"0.7301982",
"0.7297923",
"0.7284556",
"0.72806686",
"0.727285",
"0.72631395",
"0.7249076",
"0.7243477",
"0.7240778",
"0.72310066",
"0.72151655",
"0.7210505",
"0.7207412"
]
| 0.0 | -1 |
This function will proportionally resize image | public function normal_resize_image($source, $destination, $image_type, $max_size, $image_width, $image_height, $quality){
if($image_width <= 0 || $image_height <= 0){return false;} //return false if nothing to resize
//do not resize if image is smaller than max size
if($image_width <= $max_size && $image_height <= $max_size){
if($this->save_image($source, $destination, $image_type, $quality)){
return true;
}
}
//Construct a proportional size of new image
$image_scale = min($max_size/$image_width, $max_size/$image_height);
$new_width = ceil($image_scale * $image_width);
$new_height = ceil($image_scale * $image_height);
$new_canvas = imagecreatetruecolor( $new_width, $new_height ); //Create a new true color image
//Copy and resize part of an image with resampling
if(imagecopyresampled($new_canvas, $source, 0, 0, 0, 0, $new_width, $new_height, $image_width, $image_height)){
$this->save_image($new_canvas, $destination, $image_type, $quality); //save resized image
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resize_image($src, $width, $height){\n // initializing\n $save_path = Wordless::theme_temp_path();\n $img_filename = Wordless::join_paths($save_path, md5($width . 'x' . $height . '_' . basename($src)) . '.jpg');\n\n // if file doesn't exists, create it\n if (!file_exists($img_filename)) {\n $to_scale = 0;\n $to_crop = 0;\n\n // Get orig dimensions\n list ($width_orig, $height_orig, $type_orig) = getimagesize($src);\n\n // get original image ... to improve!\n switch($type_orig){\n case IMAGETYPE_JPEG: $image = imagecreatefromjpeg($src);\n break;\n case IMAGETYPE_PNG: $image = imagecreatefrompng($src);\n break;\n case IMAGETYPE_GIF: $image = imagecreatefromgif($src);\n break;\n default:\n return;\n }\n\n // which is the new smallest?\n if ($width < $height)\n $min_dim = $width;\n else\n $min_dim = $height;\n\n // which is the orig smallest?\n if ($width_orig < $height_orig)\n $min_orig = $width_orig;\n else\n $min_orig = $height_orig;\n\n // image of the right size\n if ($height_orig == $height && $width_orig == $width) ; // nothing to do\n // if something smaller => scale\n else if ($width_orig < $width) {\n $to_scale = 1;\n $ratio = $width / $width_orig;\n }\n else if ($height_orig < $height) {\n $to_scale = 1;\n $ratio = $height / $height_orig;\n }\n // if both bigger => scale\n else if ($height_orig > $height && $width_orig > $width) {\n $to_scale = 1;\n $ratio_dest = $width / $height;\n $ratio_orig = $width_orig / $height_orig;\n if ($ratio_dest > $ratio_orig)\n $ratio = $width / $width_orig;\n else\n $ratio = $height / $height_orig;\n }\n // one equal one bigger\n else if ( ($width == $width_orig && $height_orig > $height) || ($height == $height_orig && $width_orig > $width) )\n $to_crop = 1;\n // some problem...\n else\n echo \"ALARM\";\n\n // we need to zoom to get the right size\n if ($to_scale == 1) {\n $new_width = $width_orig * $ratio;\n $new_height = $height_orig * $ratio;\n $image_scaled = imagecreatetruecolor($new_width, $new_height);\n // scaling!\n imagecopyresampled($image_scaled, $image, 0, 0, 0, 0, $new_width, $new_height, $width_orig, $height_orig);\n $image = $image_scaled;\n\n if($new_width > $width || $new_height > $height)\n $to_crop = 1;\n }\n else {\n $new_width = $width_orig;\n $new_height = $height_orig;\n }\n\n // we need to crop the image\n if ($to_crop == 1) {\n $image_cropped = imagecreatetruecolor($width, $height);\n\n // find margins for images\n $margin_x = ($new_width - $width) / 2;\n $margin_y = ($new_height - $height) / 2;\n\n // cropping!\n imagecopy($image_cropped, $image, 0, 0, $margin_x, $margin_y, $width, $height);\n $image = $image_cropped;\n }\n\n // Save image\n imagejpeg($image, $img_filename, 95);\n }\n\n // Return image URL\n return Wordless::join_paths(Wordless::theme_temp_path(), basename($img_filename));\n }",
"function image_reproportion()\n\t{\n\t\tif ( ! is_numeric($this->dst_width) OR ! is_numeric($this->dst_height) OR $this->dst_width == 0 OR $this->dst_height == 0)\n\t\t\treturn;\n\t\t\n\t\tif ( ! is_numeric($this->src_width) OR ! is_numeric($this->src_height) OR $this->src_width == 0 OR $this->src_height == 0)\n\t\t\treturn;\n\t\n\t\tif (($this->dst_width >= $this->src_width) AND ($this->dst_height >= $this->src_height))\n\t\t{\n\t\t\t$this->dst_width = $this->src_width;\n\t\t\t$this->dst_height = $this->src_height;\n\t\t}\n\t\t\n\t\t$new_width\t= ceil($this->src_width*$this->dst_height/$this->src_height);\t\t\n\t\t$new_height\t= ceil($this->dst_width*$this->src_height/$this->src_width);\n\t\t\n\t\t$ratio = (($this->src_height/$this->src_width) - ($this->dst_height/$this->dst_width));\n\n\t\tif ($this->master_dim != 'width' AND $this->master_dim != 'height')\n\t\t{\n\t\t\t$this->master_dim = ($ratio < 0) ? 'width' : 'height';\n\t\t}\n\t\t\n\t\tif (($this->dst_width != $new_width) AND ($this->dst_height != $new_height))\n\t\t{\n\t\t\tif ($this->master_dim == 'height')\n\t\t\t{\n\t\t\t\t$this->dst_width = $new_width;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->dst_height = $new_height;\n\t\t\t}\n\t\t}\n\t}",
"function funcs_imageResize(&$width, &$height, $target, $bywidth = null) {\n\tif ($width<=$target && $height<=$target){\n\t\treturn;\n\t}\n\t//takes the larger size of the width and height and applies the \n\t//formula accordingly...this is so this script will work \n\t//dynamically with any size image \n\tif (is_null($bywidth)){\n\t\tif ($width > $height) { \n\t\t\t$percentage = ($target / $width); \n\t\t} else { \n\t\t\t$percentage = ($target / $height); \n\t\t}\n\t}else{\n\t\tif ($bywidth){\n\t\t\t$percentage = ($target / $width);\n\t\t\t//if height would increase as a result\n\t\t\tif ($height < round($height * $percentage)){\n\t\t\t\treturn;\n\t\t\t} \n\t\t}else{\n\t\t\t$percentage = ($target / $height); \n\t\t\t//if width would increase as a result\n\t\t\tif ($width < round($width * $percentage)){\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t} \n\t//gets the new value and applies the percentage, then rounds the value \n\t$width = round($width * $percentage); \n\t$height = round($height * $percentage); \n}",
"function imageresize($img,$target=\"\",$width=0,$height=0,$percent=0)\n{\n if (strpos($img,\".jpg\") !== false or strpos($img,\".jpeg\") !== false){\n\t $image = ImageCreateFromJpeg($img);\n\t $extension = \".jpg\";\n } elseif (strpos($img,\".png\") !== false) {\n\t $image = ImageCreateFromPng($img);\n\t $extension = \".png\";\n } elseif (strpos($img,\".gif\") !== false) {\n\t $image = ImageCreateFromGif($img);\n\t $extension = \".gif\";\n }elseif(getfiletype($img)=='bmp'){\n\t\t$image = ImageCreateFromwbmp($img);\n\t\t$extension = '.bmp';\n }\n\n $size = getimagesize ($img);\n\n // calculate missing values\n if ($width and !$height) {\n\t $height = ($size[1] / $size[0]) * $width;\n } elseif (!$width and $height) {\n\t $width = ($size[0] / $size[1]) * $height;\n } elseif ($percent) {\n\t $width = $size[0] / 100 * $percent;\n\t $height = $size[1] / 100 * $percent;\n } elseif (!$width and !$height and !$percent) {\n\t $width = 100; // here you can enter a standard value for actions where no arguments are given\n\t $height = ($size[1] / $size[0]) * $width;\n }\n\n $thumb = imagecreatetruecolor ($width, $height);\n\n if (function_exists(\"imageCopyResampled\"))\n {\n\t if (!@ImageCopyResampled($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1])) {\n\t\t ImageCopyResized($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\t }\n\t} else {\n\t ImageCopyResized($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\t}\n\n //ImageCopyResampleBicubic ($thumb, $image, 0, 0, 0, 0, $width, $height, $size[0], $size[1]);\n\n if (!$target) {\n\t $target = \"temp\".$extension;\n }\n\n $return = true;\n\n switch ($extension) {\n\t case \".jpeg\":\n\t case \".jpg\": {\n\t\t imagejpeg($thumb, $target, 100);\n\t break;\n\t }\n\t case \".gif\": {\n\t\t imagegif($thumb, $target);\n\t break;\n\t }\n\t case \".png\": {\n\t\t imagepng($thumb, $target);\n\t break;\n\t }\n\t case \".bmp\": {\n\t\t imagewbmp($thumb,$target);\n\t }\n\t default: {\n\t\t $return = false;\n\t }\n }\n\n // report the success (or fail) of the action\n return $return;\n}",
"function resize( $jpg ) {\n\t$im = @imagecreatefromjpeg( $jpg );\n\t$filename = $jpg;\n\t$percent = 0.5;\n\tlist( $width, $height ) = getimagesize( $filename );\n\tif ( $uploader_name == \"c_master_imgs\" ):\n\t\t$new_width = $width;\n\t$new_height = $height;\n\telse :\n\t\tif ( $width > 699 ): $new_width = 699;\n\t$percent = 699 / $width;\n\t$new_height = $height * $percent;\n\telse :\n\t\t$new_width = $width;\n\t$new_height = $height;\n\tendif;\n\tendif; // end if measter images do not resize\n\t//if ( $new_height>600){ $new_height = 600; }\n\t$im = imagecreatetruecolor( $new_width, $new_height );\n\t$image = imagecreatefromjpeg( $filename );\n\timagecopyresampled( $im, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height );\n\t@imagejpeg( $im, $jpg, 80 );\n\t@imagedestroy( $im );\n}",
"protected function scaleImages() {}",
"protected function resize()\n {\n $width = $this->width;\n $height = $this->height;\n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n // Determine new image dimensions\n if($this->mode === \"crop\"){ // Crop image\n \n $max_width = $crop_width = $width;\n $max_height = $crop_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if($orig_width > $orig_height){ // Original is wide\n $height = $max_height;\n $width = ceil($y_ratio * $orig_width);\n \n } elseif($orig_height > $orig_width){ // Original is tall\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n \n } else { // Original is square\n $this->mode = \"fit\";\n \n return $this->resize();\n }\n \n // Adjust if the crop width is less than the requested width to avoid black lines\n if($width < $crop_width){\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n }\n \n } elseif($this->mode === \"fit\"){ // Fits the image according to aspect ratio to within max height and width\n $max_width = $width;\n $max_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if( ($orig_width <= $max_width) && ($orig_height <= $max_height) ){ // Image is smaller than max height and width so don't resize\n $tn_width = $orig_width;\n $tn_height = $orig_height;\n \n } elseif(($x_ratio * $orig_height) < $max_height){ // Wider rather than taller\n $tn_height = ceil($x_ratio * $orig_height);\n $tn_width = $max_width;\n \n } else { // Taller rather than wider\n $tn_width = ceil($y_ratio * $orig_width);\n $tn_height = $max_height;\n }\n \n $width = $tn_width;\n $height = $tn_height;\n \n } elseif($this->mode === \"fit-x\"){ // Sets the width to the max width and the height according to aspect ratio (will stretch if too small)\n $height = @round($orig_height * $width / $orig_width);\n \n if($orig_height <= $height){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n \n } elseif($this->mode === \"fit-y\"){ // Sets the height to the max height and the width according to aspect ratio (will stretch if too small)\n $width = @round($orig_width * $height / $orig_height);\n \n if($orig_width <= $width){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n } else {\n throw new \\Exception('Invalid mode: ' . $this->mode);\n }\n \n\n // Resize\n $this->temp = imagecreatetruecolor($width, $height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n \n imagecopyresampled($this->temp, $this->image, 0, 0, 0, 0, $width, $height, $orig_width, $orig_height);\n $this->sync();\n \n \n // Cropping?\n if($this->mode === \"crop\"){ \n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n $x_mid = $orig_width/2; // horizontal middle\n $y_mid = $orig_height/2; // vertical middle\n \n $this->temp = imagecreatetruecolor($crop_width, $crop_height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n\n imagecopyresampled($this->temp, $this->image, 0, 0, ($x_mid-($crop_width/2)), ($y_mid-($crop_height/2)), $crop_width, $crop_height, $crop_width, $crop_height);\n $this->sync();\n }\n }",
"public function resize_fit(IImageInformation $src, $width, $height);",
"private function _scale()\n\t{\n\t\t//scale down the image by 55%\n\t\t$weaponImageSize = $this->weapon->getImageGeometry();\n\t\t$this->weaponScale['w'] = $weaponImageSize['width'] * 0.55;\n\t\t$this->weaponScale['h'] = $weaponImageSize['height'] * 0.55;\n\n\t\t$this->weapon->scaleImage($this->weaponScale['w'], $this->weaponScale['h']);\n\n\t\t//scale down the image by 30%\n\t\t$emblemImageSize = $this->emblem->getImageGeometry();\n\t\t$this->emblemScale['w'] = $emblemImageSize['width'] * 0.30;\n\t\t$this->emblemScale['h'] = $emblemImageSize['height'] * 0.30;\n\n\t\t$this->emblem->scaleImage($this->emblemScale['w'], $this->emblemScale['h']);\n\n\t\t//scale down the image by 70%\n\t\t$profileImageSize = $this->profile->getImageGeometry();\n\t\t$this->profileScale['w'] = $profileImageSize['width'] * 0.70;\n\t\t$this->profileScale['h'] = $profileImageSize['height'] * 0.70;\n\n\t\t$this->profile->scaleImage($this->profileScale['w'], $this->profileScale['h']);\n\t}",
"function image_scale($src_abspath, $dest_abspath, $aspect, $width, $strategy)\n{\n $im = new \\Imagick($src_abspath);\n $im = image_scale_im_obj($im, $aspect, $width, $strategy);\n return image_return_write($im, $dest_abspath);\n}",
"function resize($image_name, $size, $folder_name) {\n $file_extension = getFileExtension($image_name);\n switch ($file_extension) {\n case 'jpg':\n case 'jpeg':\n $image_src = imagecreatefromjpeg($folder_name . '/' . $image_name);\n break;\n case 'png':\n $image_src = imagecreatefrompng($folder_name . '/' . $image_name);\n break;\n case 'gif':\n $image_src = imagecreatefromgif($folder_name . '/' . $image_name);\n break;\n }\n $true_width = imagesx($image_src);\n $true_height = imagesy($image_src);\n\n $width = $size;\n $height = ($width / $true_width) * $true_height;\n\n $image_des = imagecreatetruecolor($width, $height);\n\n imagecopyresampled($image_des, $image_src, 0, 0, 0, 0, $width, $height, $true_width, $true_height);\n\n switch ($file_extension) {\n case 'jpg':\n case 'jpeg':\n imagejpeg($image_des, $folder_name . '/' . $image_name, 100);\n break;\n case 'png':\n imagepng($image_des, $folder_name . '/' . $image_name, 8);\n break;\n case 'gif':\n imagegif($image_des, $folder_name . '/' . $image_name, 100);\n break;\n }\n return $image_des;\n}",
"function imgResize($filename, $newWidth, $newHeight, $dir_out){\n\t\n\t// изменение размера изображения\n\n\t// 1 создадим новое изображение из файла\n\t$scr = imagecreatefromjpeg($filename); // или $imagePath\n\t\n\t// 2 создадим новое полноцветное изображение нужного размера\n\t$newImg = imagecreatetruecolor($newWidth, $newHeight);\n\n\t// 3 определим размер исходного изображения для 4 пункта\n\t$size = getimagesize($filename);\n\n\t// 4 копирует прямоугольную часть одного изображения на другое изображение, интерполируя значения пикселов таким образом, чтобы уменьшение размера изображения не уменьшало его чёткости\n\timagecopyresampled($newImg, $scr, 0, 0, 0, 0, $newWidth, $newHeight, $size[0], $size[1]);\n\n\t// 5 запишем изображение в файл по нужному пути\n\timagejpeg($newImg, $dir_out);\n\n\timagedestroy($scr);\n\timagedestroy($newImg);\t\t\n\t\n}",
"function resizeImage($input,$output,$wid,$hei,$auto=false,$quality=80) {\n\n\t// File and new size\n\t//the original image has 800x600\n\t$filename = $input;\n\t//the resize will be a percent of the original size\n\t$percent = 0.5;\n\n\t// Get new sizes\n\tlist($width, $height) = getimagesize($filename);\n\t$newwidth = $wid;//$width * $percent;\n\t$newheight = $hei;//$height * $percent;\n\tif($auto) {\n\t\tif($width>$height) {\n\t\t\t$newheight=$wid*0.75;\n\t\t} else if($height>$width) {\n\t\t\t$newwidth=$hei*0.75;\n\t\t}\n\t}\n\n\t// Load\n\t$thumb = imagecreatetruecolor($newwidth, $newheight);\n\t$source = imagecreatefromjpeg($filename);\n\n\t// Resize\n\timagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);\n\n\t// Output and free memory\n\t//the resized image will be 400x300\n\timagejpeg($thumb,$output,$quality);\n\timagedestroy($thumb);\n}",
"public function image_reproportion()\n\t{\n\t\tif (($this->width === 0 && $this->height === 0) OR $this->orig_width === 0 OR $this->orig_height === 0\n\t\t\tOR ( ! ctype_digit((string) $this->width) && ! ctype_digit((string) $this->height))\n\t\t\tOR ! ctype_digit((string) $this->orig_width) OR ! ctype_digit((string) $this->orig_height))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Sanitize\n\t\t$this->width = (int) $this->width;\n\t\t$this->height = (int) $this->height;\n\n\t\tif ($this->master_dim !== 'width' && $this->master_dim !== 'height')\n\t\t{\n\t\t\tif ($this->width > 0 && $this->height > 0)\n\t\t\t{\n\t\t\t\t$this->master_dim = ((($this->orig_height/$this->orig_width) - ($this->height/$this->width)) < 0)\n\t\t\t\t\t\t\t? 'width' : 'height';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->master_dim = ($this->height === 0) ? 'width' : 'height';\n\t\t\t}\n\t\t}\n\t\telseif (($this->master_dim === 'width' && $this->width === 0)\n\t\t\tOR ($this->master_dim === 'height' && $this->height === 0))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif ($this->master_dim === 'width')\n\t\t{\n\t\t\t$this->height = (int) ceil($this->width*$this->orig_height/$this->orig_width);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->width = (int) ceil($this->orig_width*$this->height/$this->orig_height);\n\t\t}\n\t}",
"public function resizeImage($filepath) {\n if (is_file($filepath)) {\n \n $dir_name = $this->destinationDirectory;\n\n $drawable_dpi = array();\n $drawable_dpi['drawable-ldpi'] = 0.1875;\n $drawable_dpi['drawable-mdpi'] = 0.25;\n $drawable_dpi['drawable-hdpi'] = 0.375;\n $drawable_dpi['drawable-xhdpi'] = 0.5;\n $drawable_dpi['drawable-xxhdpi'] = 0.75;\n $drawable_dpi['drawable-xxxhdpi'] = 1.0;\n\n $mipmap_dpi = array();\n $mipmap_dpi['mipmap-ldpi'] = 0.1875;\n $mipmap_dpi['mipmap-mdpi'] = 0.25;\n $mipmap_dpi['mipmap-hdpi'] = 0.375;\n $mipmap_dpi['mipmap-xhdpi'] = 0.5;\n $mipmap_dpi['mipmap-xxhdpi'] = 0.75;\n $mipmap_dpi['mipmap-xxxhdpi'] = 1.0;\n\n $selected_dpi = array();\n if($this->folderCode == 0) {\n $selected_dpi = $drawable_dpi; \n }\n if($this->folderCode == 1) {\n $selected_dpi = $mipmap_dpi; \n }\n if($this->folderCode == 2) {\n $selected_dpi = array_merge($drawable_dpi, $mipmap_dpi); \n }\n\n\n // Content type\n $image_ext = \"png\";\n header('\"Content-Type: image/\"'.$image_ext);\n\n // Get new sizes\n $dir_path = $this->dirHelper($dir_name);\n $imageFileName = $this->extract_file_name($filepath);\n $final_dir_path = $dir_path.\"res/\"; \n if (!is_dir($final_dir_path)) {\n mkdir($final_dir_path);\n }\n foreach ($selected_dpi as $key => $value) {\n if (!is_dir($final_dir_path.$key)) {\n mkdir($final_dir_path.$key);\n }\n list($width, $height) = getimagesize($filepath);\n $newwidth = $width * $value;\n $newheight = $height * $value;\n\n // Load\n $thumb = imagecreatetruecolor($newwidth, $newheight);\n $source = imagecreatefrompng($filepath);\n\n // Resize\n imagecopyresized($thumb, $source, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);\n imagepng($thumb, $final_dir_path.$key.\"/\".$imageFileName);\n }\n echo \"<h1>$filepath has been resized into different sizes</h1>\";\n }\n elseif(!file_exists($filepath)) {\n echo \"<h1>Invalid File path</h1>\";\n }\n else {\n echo \"<h1>This is not a file</h1>\";\n }\n\n }",
"function smart_resize_image($file, $width = 0, $height = 0, $proportional = false, $output = \"file\", $delete_original = true, $use_linux_commands = false){\n\t\tif(($height <= 0) && ($width <= 0)){\n\t\t\treturn(false);\n\t\t}\n\t\t$info = getimagesize($file); // Paramètres par défaut de l'image\n\t\t$image = \"\";\n\t\t$final_width = 0;\n\t\t$final_height = 0;\n\t\tlist($width_old,$height_old) = $info;\n\t\t$trop_petite = false;\n\t\tif(($height > 0) && ($height > $height_old)){\n\t\t\t$trop_petite = true;\n\t\t}\n\t\tif(($width > 0) && ( $width > $width_old)){\n\t\t\t$trop_petite = true;\n\t\t}else{\n\t\t\t$trop_petite = false;\n\t\t}\n\t\tif($trop_petite){\n\t\t\treturn(false);\n\t\t}\n\t\tif($proportional){ // Calculer la proportionnalité\n\t\t\tif($width == 0){\n\t\t\t\t$factor = $height / $height_old;\n\t\t\t}elseif($height == 0){\n\t\t\t\t$factor = $width / $width_old;\n\t\t\t}else{\n\t\t\t\t$factor = min($width / $width_old,$height / $height_old);\n\t\t\t}\n\t\t\t$final_width = round($width_old * $factor);\n\t\t\t$final_height = round($height_old * $factor);\n\t\t}else{\n\t\t\t$final_width = ($width <= 0) ? $width_old : $width;\n\t\t\t$final_height = ($height <= 0) ? $height_old : $height;\n\t\t}\n\t\tswitch($info[2]){ // Charger l'image en mémoire en fonction du format\n\t\t\tcase IMAGETYPE_GIF:\n\t\t\t\t$image = imagecreatefromgif($file); break;\n\t\t\tcase IMAGETYPE_JPEG:\n\t\t\t\t$image = imagecreatefromjpeg($file); break;\n\t\t\tcase IMAGETYPE_PNG:\n\t\t\t\t$image = imagecreatefrompng($file); break;\n\t\t\tdefault:\n\t\t\t\treturn(false);\n\t\t}\n\t\t$image_resized = imagecreatetruecolor($final_width, $final_height); // Transparence pour les gif et les png\n\t\tif(($info[2] == IMAGETYPE_GIF) || ($info[2] == IMAGETYPE_PNG)){\n\t\t\t$transparency = imagecolortransparent($image);\n\t\t\tif($transparency >= 0){\n\t\t\t\t$transparent_color = imagecolorsforindex($image,$trnprt_indx);\n\t\t\t\t$transparency = imagecolorallocate($image_resized,$trnprt_color[\"red\"],$trnprt_color[\"green\"],$trnprt_color[\"blue\"]);\n\t\t\t\timagefill($image_resized,0,0,$transparency);\n\t\t\t\timagecolortransparent($image_resized,$transparency);\n\t\t\t}elseif($info[2] == IMAGETYPE_PNG){\n\t\t\t\timagealphablending($image_resized,false);\n\t\t\t\t$color = imagecolorallocatealpha($image_resized,0,0,0,127);\n\t\t\t\timagefill($image_resized,0,0,$color);\n\t\t\t\timagesavealpha($image_resized,true);\n\t\t\t}\n\t\t}\n\t\timagecopyresampled($image_resized,$image,0,0,0,0,$final_width,$final_height,$width_old,$height_old);\n\t\tif($delete_original){ // Suppression de l'image d'origine éventuelle\n\t\t\tif($use_linux_commands){\n\t\t\t\texec(\"rm \".$file);\n\t\t\t}else{\n\t\t\t\t@unlink($file);\n\t\t\t}\n\t\t}\n\t\tswitch(strtolower($output)){\n\t\t\tcase \"browser\": // Envoyer l'image par http avec son type MIME\n\t\t\t\t$mime = image_type_to_mime_type($info[2]); header(\"Content-type: $mime\"); $output = NULL; break;\n\t\t\tcase \"file\": // Ecraser l'image donnée (cas défaut)\n\t\t\t\t$output = $file; break;\n\t\t\tcase \"return\": // Retourner les infos de l'image redimensionnée en conservant celles de l'image d'origine\n\t\t\t\treturn($image_resized); break;\n\t\t\tdefault:\n\t\t\t\tbreak;\n\t\t}\n\t\tswitch($info[2]){ // Retourner l'image redimensionnée en fonction de son format\n\t\t\tcase IMAGETYPE_GIF:\n\t\t\t\timagegif($image_resized,$output); break;\n\t\t\tcase IMAGETYPE_JPEG:\n\t\t\t\timagejpeg($image_resized,$output); break;\n\t\t\tcase IMAGETYPE_PNG:\n\t\t\t\timagepng($image_resized,$output); break;\n\t\t\tdefault:\n\t\t\t\treturn(false);\n\t\t}\n\t\treturn(true);\n\t}",
"function imageResize($width, $height, $target) {\t\n\tif ($width > $height) { \n\t\t$percentage = ($target / $width); \n\t} else { \n\t\t$percentage = ($target / $height); \n\t} \n\n\t//gets the new value and applies the percentage, then rounds the value \n\t$width = round($width * $percentage); \n\t$height = round($height * $percentage); \n\n\t//returns the new sizes in html image tag format...this is so you \n\t//can plug this function inside an image tag and just get the \n\treturn \"width=\\\"$width\\\" height=\\\"$height\\\"\"; \n\t}",
"function image_resize($filename){\n\t\t$width = 1000;\n\t\t$height = 500;\n\t\t$save_file_location = $filename;\n\t\t// File type\n\t\t//header('Content-Type: image/jpg');\n\t\t$source_properties = getimagesize($filename);\n\t\t$image_type = $source_properties[2];\n\n\t\t// Get new dimensions\n\t\tlist($width_orig, $height_orig) = getimagesize($filename);\n\n\t\t$ratio_orig = $width_orig/$height_orig;\n\t\tif ($width/$height > $ratio_orig) {\n\t\t\t$width = $height*$ratio_orig;\n\t\t} else {\n\t\t\t$height = $width/$ratio_orig;\n\t\t}\n\t\t// Resampling the image \n\t\t$image_p = imagecreatetruecolor($width, $height);\n\t\tif( $image_type == IMAGETYPE_JPEG ) {\n\t\t\t$image = imagecreatefromjpeg($filename);\n\t\t}else if($image_type == IMAGETYPE_GIF){\n\t\t\t$image = imagecreatefromgif($filename);\n\t\t}else if($image_type == IMAGETYPE_PNG){\n\t\t\t$image = imagecreatefrompng($filename);\n\t\t}\n\t\t$finalIMG = imagecopyresampled($image_p, $image, 0, 0, 0, 0,\n\t\t$width, $height, $width_orig, $height_orig);\n\t\t// Display of output image\n\n\t\tif( $image_type == IMAGETYPE_JPEG ) {\n\t\t\timagejpeg($image_p, $save_file_location);\n\t\t}else if($image_type == IMAGETYPE_GIF){\n\t\t\timagegif($image_p, $save_file_location);\n\t\t}else if($image_type == IMAGETYPE_PNG){\n\t\t\t$imagepng = imagepng($image_p, $save_file_location);\n\t\t}\n\t}",
"function imageResize($width, $height, $target){\n //formula accordingly...this is so this script will work\n //dynamically with any size image\n\n if ($width > $height) {\n $percentage = ($target / $width);\n } else {\n $percentage = ($target / $height);\n }\n\n //gets the new value and applies the percentage, then rounds the value\n $width = round($width * $percentage);\n $height = round($height * $percentage);\n\n //returns the new sizes in html image tag format...this is so you\n //\tcan plug this function inside an image tag and just get the\n\n return \"width=\".$width.\" height=\".$height.\"\";\n\n }",
"function spc_resizeImage( $file, $thumbpath, $max_side , $fixfor = NULL ) {\n\n\tif ( file_exists( $file ) ) {\n\t\t$type = getimagesize( $file );\n\n\t\tif (!function_exists( 'imagegif' ) && $type[2] == 1 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t}\n\t\telseif (!function_exists( 'imagejpeg' ) && $type[2] == 2 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t}\n\t\telseif (!function_exists( 'imagepng' ) && $type[2] == 3 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t} else {\n\n\t\t\t// create the initial copy from the original file\n\t\t\tif ( $type[2] == 1 ) {\n\t\t\t\t$image = imagecreatefromgif( $file );\n\t\t\t}\n\t\t\telseif ( $type[2] == 2 ) {\n\t\t\t\t$image = imagecreatefromjpeg( $file );\n\t\t\t}\n\t\t\telseif ( $type[2] == 3 ) {\n\t\t\t\t$image = imagecreatefrompng( $file );\n\t\t\t}\n\n\t\t\tif ( function_exists( 'imageantialias' ))\n\t\t\t\timageantialias( $image, TRUE );\n\n\t\t\t$image_attr = getimagesize( $file );\n\n\t\t\t// figure out the longest side\n if($fixfor){\n \t if($fixfor == 'width'){\n \t \t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_width = $max_side;\n\n\t\t\t\t$image_ratio = $image_width / $image_new_width;\n\t\t\t\t$image_new_height = $image_height / $image_ratio;\n \t }elseif($fixfor == 'height'){\n \t $image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_height = $max_side;\n\n\t\t\t\t$image_ratio = $image_height / $image_new_height;\n\t\t\t\t$image_new_width = $image_width / $image_ratio;\t\n \t }\n }else{\n\t\t\tif ( $image_attr[0] > $image_attr[1] ) {\n\t\t\t\t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_width = $max_side;\n\n\t\t\t\t$image_ratio = $image_width / $image_new_width;\n\t\t\t\t$image_new_height = $image_height / $image_ratio;\n\t\t\t\t//width is > height\n\t\t\t} else {\n\t\t\t\t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_height = $max_side;\n\n\t\t\t\t$image_ratio = $image_height / $image_new_height;\n\t\t\t\t$image_new_width = $image_width / $image_ratio;\n\t\t\t\t//height > width\n\t\t\t}\n }\t\n\n\t\t\t$thumbnail = imagecreatetruecolor( $image_new_width, $image_new_height);\n\t\t\t@ imagecopyresampled( $thumbnail, $image, 0, 0, 0, 0, $image_new_width, $image_new_height, $image_attr[0], $image_attr[1] );\n\n\t\t\t// move the thumbnail to its final destination\n\t\t\tif ( $type[2] == 1 ) {\n\t\t\t\tif (!imagegif( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ( $type[2] == 2 ) {\n\t\t\t\tif (!imagejpeg( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ( $type[2] == 3 ) {\n\t\t\t\tif (!imagepng( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$error = 0;\n\t}\n\n\tif (!empty ( $error ) ) {\n\t\treturn $error;\n\t} else {\n\t\treturn $thumbpath;\n\t}\n}",
"function reduce_image_size($dest_folder,$image_name,$files)\n{\n //REDUCE IMAGE RESOLUTION\n if($files)\n {\n //echo 123;exit;\n $dest = $dest_folder.$image_name;\n $width = 300;\n $height = 300;\n list($width_orig, $height_orig) = getimagesize($files);\n $ratio_orig = $width_orig/$height_orig;\n if ($width/$height > $ratio_orig)\n {\n $width = $height*$ratio_orig;\n }\n else\n {\n $height = $width/$ratio_orig;\n }\n $image_p = imagecreatetruecolor($width, $height);\n $image = imagecreatefromjpeg($files);\n imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);\n imagejpeg($image_p,$dest, 100);\n ImageDestroy ($image_p);\n }\n //END OF REDUCING IMAGE RESOLUTION\n}",
"function resizeImage($image,$width,$height,$scale) {\n\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t$imageType = image_type_to_mime_type($imageType);\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t\t\t$source=imagecreatefromgif($image); \n\t\t\tbreak;\n\t case \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t\t\t$source=imagecreatefromjpeg($image); \n\t\t\tbreak;\n\t case \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\t$source=imagecreatefrompng($image); \n\t\t\tbreak;\n \t}\n\timagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);\n\t\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t \t\timagegif($newImage,$image); \n\t\t\tbreak;\n \tcase \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t \t\timagejpeg($newImage,$image,90); \n\t\t\tbreak;\n\t\tcase \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\timagepng($newImage,$image); \n\t\t\tbreak;\n }\n\t\n\tchmod($image, 0777);\n\treturn $image;\n}",
"private function resize() {\n\t\tswitch($this->type) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t$originalImage = imagecreatefromjpeg($this->tempName);\n\t\t\tbreak;\n\t\t\tcase 'image/png':\n\t\t\t\t$originalImage = imagecreatefrompng($this->tempName);\n\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\t$originalImage = imagecreatefromgif($this->tempName);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdie('FILE CANNOT BE RESIZED');\n\t\t\tbreak;\n\t\t}\n\n\t\t// Determine new height\n\t\t$this->newHeight = ($this->height / $this->width) * $this->newWidth;\n\n\t\t// Create new image\n\t\t$this->newImage = imagecreatetruecolor($this->newWidth, $this->newHeight);\n\n\t\t// Resample original image into new image\n\t\timagecopyresampled($this->newImage, $originalImage, 0, 0, 0, 0, $this->newWidth, $this->newHeight, $this->width, $this->height);\n\n\t\t// Switch based on image being resized\n\t\tswitch($this->type) {\n\t\t\tcase 'image/jpeg':\n\t\t\t\t// Source, Dest, Quality 0 to 100\n\t\t\t\timagejpeg($this->newImage, $this->destinationFolder.'/'.$this->newName, 80);\n\t\t\tbreak;\n\t\t\tcase 'image/png':\n\t\t\t\t// Source, Dest, Quality 0 (no compression) to 9\n\t\t\t\timagepng($this->newImage, $this->destinationFolder.'/'.$this->newName, 0);\n\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\timagegif($this->newImage, $this->destinationFolder.'/'.$this->newName);\n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\tdie('YOUR FILE CANNOT BE RESIZED');\n\t\t\tbreak;\n\t\t}\n\n\t\t// DESTROY NEW IMAGE TO SAVE SERVER SPACE\n\t\timagedestroy($this->newImage);\n\t\timagedestroy($originalImage);\n\n\t\t// SUCCESSFULLY UPLOADED\n\t\t$this->result = true;\n\t\t$this->message = 'Image uploaded and resized successfully';\n\t}",
"function resizeImage($image,$width,$height,$scale,$stype) {\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\tswitch($stype) {\n case 'gif':\n $source = imagecreatefromgif($image);\n break;\n case 'jpg':\n $source = imagecreatefromjpeg($image);\n break;\n case 'jpeg':\n $source = imagecreatefromjpeg($image);\n break;\n case 'png':\n $source = imagecreatefrompng($image);\n break;\n }\n\timagecopyresampled($newImage, $source,0,0,0,0, $newImageWidth, $newImageHeight, $width, $height);\n\timagejpeg($newImage,$image,90);\n\tchmod($image, 0777);\n\treturn $image;\n}",
"function resizeImage($image,$width,$height,$scale) {\n\t\t\t\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t\t\t\t$imageType = image_type_to_mime_type($imageType);\n\t\t\t\t$newImageWidth = ceil($width * $scale);\n\t\t\t\t$newImageHeight = ceil($height * $scale);\n\t\t\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\t$source=imagecreatefromgif($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\t$source=imagecreatefromjpeg($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\t$source=imagecreatefrompng($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\timagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);\n\t\t\t\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\timagegif($newImage,$image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\timagejpeg($newImage,$image,90);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\timagepng($newImage,$image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\n\t\t\t\tchmod($image, 0777);\n\t\t\t\treturn $image;\n\t\t\t}",
"function ImageResize($w, $h, $from, $to, $upsample = false) {\n\t$im_infos = getimagesize($from);\n\t\n\tif ($im_infos)\n\t{\n\t\t//$mts[\"total\"][\"start\"] = microtime(true);\n\t\t$data = file_get_contents($from);\n\t\t//$mts[\"imagecreatefromjpeg\"][\"start\"] = microtime(true);\n\t\t$im = @imagecreatefromstring($data);\n\t\t\n\t\t/*switch ($im_infos[2])\n\t\t{\n\t\t\tcase IMAGETYPE_GIF :\t$im = @imagecreatefromgif($from); break;\n\t\t\tcase IMAGETYPE_JPEG :\t$im = @imagecreatefromjpeg($from); break;\n\t\t\tcase IMAGETYPE_PNG :\t$im = @imagecreatefrompng($from); break;\n\t\t\tdefault :\t\t\t\t$im = false; break;\n\t\t}*/\n\t\t//$mts[\"imagecreatefromjpeg\"][\"end\"] = microtime(true);\n\t\t\n\t\t$w_ratio = $im_infos[0] / $w;\t// Width Ratio\n\t\t$h_ratio = $im_infos[1] / $h;\t// Height Ratio\n\t\t\n\t\tif ($w_ratio > 1 || $h_ratio > 1)\n\t\t{\n\t\t\t// Image > max size -> resizing keeping the ratio\n\t\t\t$ratio = max($w_ratio, $h_ratio);\n\t\t\t\n\t\t\t$wd = floor($im_infos[0] / $ratio);\t// Width Destination\n\t\t\t$hd = floor($im_infos[1] / $ratio);\t// Height Destination\n\t\t}\n\t\telse\n\t\t{\n\t\t\tif ($upsample)\n\t\t\t{\n\t\t\t\t// Upsampling the image\n\t\t\t\t$ratio = max($w_ratio, $h_ratio);\n\t\t\t\t\n\t\t\t\t$wd = floor($im_infos[0] / $ratio);\t// Width Destination\n\t\t\t\t$hd = floor($im_infos[1] / $ratio);\t// Height Destination\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// No upsample\n\t\t\t\t$wd = $im_infos[0];\n\t\t\t\t$hd = $im_infos[1];\n\t\t\t}\n\t\t}\n\t\t\n\t\t//$mts[\"imagecreatetruecolor\"][\"start\"] = microtime(true);\n\t\t$imd = imagecreatetruecolor($wd, $hd);\t// Image Destination\n\t\t//$mts[\"imagecreatetruecolor\"][\"end\"] = microtime(true);\n\t\t\n\t\t//$mts[\"imagecopyresampled\"][\"start\"] = microtime(true);\n\t\timagecopyresampled($imd, $im, 0, 0, 0, 0, $wd, $hd, $im_infos[0], $im_infos[1]);\n\t\t//$mts[\"imagecopyresampled\"][\"end\"] = microtime(true);\n\t\t\n\t\t//$mts[\"imagejpeg\"][\"start\"] = microtime(true);\n\t\timagejpeg($imd, $to);\n\t\t//$mts[\"imagejpeg\"][\"end\"] = microtime(true);\n\t\t\n\t\t//$mts[\"total\"][\"end\"] = microtime(true);\n\t\t\n\t\t//return $mts;\n\t\t/*\n\t\tswitch ($im_infos[2])\n\t\t{\n\t\t\tcase IMAGETYPE_GIF :\timagegif($imd, $to); break;\n\t\t\tcase IMAGETYPE_JPEG :\timagejpeg($imd, $to); break;\n\t\t\tcase IMAGETYPE_PNG :\timagepng($imd, $to); break;\n\t\t\tdefault : break;\n\t\t}\n\t\t*/\n\t}\n}",
"public function sizeImg($width, $height, $crop = true);",
"function scale_image($arg)\n\t{\n\t\t// max_width, max_height, cur_width, cur_height\n\t\t\n\t\t$ret = array(\n\t\t\t\t\t 'img_width' => $arg['cur_width'],\n\t\t\t\t\t 'img_height' => $arg['cur_height']\n\t\t\t\t\t);\n\t\t\n\t\tif ( $arg['cur_width'] > $arg['max_width'] )\n\t\t{\n\t\t\t$ret['img_width'] = $arg['max_width'];\n\t\t\t$ret['img_height'] = ceil( ( $arg['cur_height'] * ( ( $arg['max_width'] * 100 ) / $arg['cur_width'] ) ) / 100 );\n\t\t\t$arg['cur_height'] = $ret['img_height'];\n\t\t\t$arg['cur_width'] = $ret['img_width'];\n\t\t}\n\t\t\n\t\tif ( $arg['cur_height'] > $arg['max_height'] )\n\t\t{\n\t\t\t$ret['img_height'] = $arg['max_height'];\n\t\t\t$ret['img_width'] = ceil( ( $arg['cur_width'] * ( ( $arg['max_height'] * 100 ) / $arg['cur_height'] ) ) / 100 );\n\t\t}\n\t\t\n\t\treturn $ret;\n\t}",
"function calc_size()\n\t{\n\t\t\t$size = getimagesize(ROOT_PATH . $this->file);\n\t\t\t$this->width = $size[0];\n\t\t\t$this->height = $size[1];\n\t}",
"public function smartResizeImage($file, $width = 0, $height = 0, $proportional = false, $output = 'file') {\n //echo $file;\n if ($height <= 0 && $width <= 0) {\n return false;\n }\n $info = getimagesize($file);\n $image = '';\n $final_width = 0;\n $final_height = 0;\n list($width_old, $height_old) = $info;\n if (\n $proportional) {\n if ($width == 0)\n $factor = $height / $height_old;\n elseif ($height == 0)\n $factor = $width / $width_old;\n else\n $factor = min($width / $width_old, $height / $height_old);\n $final_width = round($width_old * $factor);\n $final_height = round($height_old * $factor);\n } else {\n $final_width = ( $width <= 0 ) ? $width_old : $width;\n $final_height = ( $height <= 0 ) ? $height_old : $height;\n }\n switch (\n $info[2]) {\n case IMAGETYPE_GIF:\n $image = imagecreatefromgif($file);\n break;\n case IMAGETYPE_JPEG:\n $image = imagecreatefromjpeg($file);\n break;\n case IMAGETYPE_PNG:\n $image = imagecreatefrompng($file);\n break;\n default:\n return false;\n }\n $image_resized = imagecreatetruecolor($final_width, $final_height);\n if (($info[2] == IMAGETYPE_GIF) || ($info[2] == IMAGETYPE_PNG)) {\n $trnprt_indx = imagecolortransparent($image);\n // If we have a specific transparent color\n if ($trnprt_indx >= 0) {\n // Get the original image's transparent color's RGB values\n $trnprt_color = imagecolorsforindex($image, $trnprt_indx);\n // Allocate the same color in the new image resource\n $trnprt_indx = imagecolorallocate($image_resized, $trnprt_color['red'], $trnprt_color['green'], $trnprt_color['blue']);\n // Completely fill the background of the new image with allocated color.\n imagefill($image_resized, 0, 0, $trnprt_indx);\n // Set the background color for new image to transparent\n imagecolortransparent($image_resized, $trnprt_indx);\n }\n // Always make a transparent background color for PNGs that don't have one allocated already\n elseif ($info[2] == IMAGETYPE_PNG) {\n // Turn off transparency blending (temporarily)\n imagealphablending($image_resized, false);\n // Create a new transparent color for image\n $color = imagecolorallocatealpha($image_resized, 0, 0, 0, 127);\n // Completely fill the background of the new image with allocated color.\n imagefill($image_resized, 0, 0, $color);\n // Restore transparency blending\n imagesavealpha($image_resized, true);\n }\n }\n //echo $image_resized.' AND '.$image;\n imagecopyresampled($image_resized, $image, 0, 0, 0, 0, $final_width, $final_height, $width_old, $height_old);\n /* if ( $delete_original ) {\n if ( $use_linux_commands )\n exec('rm '.$file);\n else\n @unlink($file);\n } */\n switch (strtolower($output)) {\n case 'browser':\n $mime = image_type_to_mime_type($info[2]);\n header(\"Content-type: $mime\");\n $output = NULL;\n break;\n case 'file':\n $output = $file;\n break;\n case 'return':\n return $image_resized;\n break;\n default:\n break;\n }\n switch (\n $info[2]) {\n case IMAGETYPE_GIF:\n imagegif($image_resized, $output);\n break;\n case IMAGETYPE_JPEG:\n imagejpeg($image_resized, $output);\n break;\n case IMAGETYPE_PNG:\n imagepng($image_resized, $output);\n break;\n default:\n return false;\n }\n return\n true;\n }",
"function resizeImage ( $sourcePathFilename, $extension, $destinationPath, $maxWidth, $maxHeight ) {\n $result = '';\n debug_log ( __FILE__, __LINE__, $sourcePathFilename );\n debug_log ( __FILE__, __LINE__, $extension );\n\n if ( $sourcePathFilename != '' && $extension != '' ) {\n if ( in_array ( $extension, array ( 'jpg', 'jpeg', 'png', 'gif' ) ) ) {\n switch ( $extension ) {\n case 'jpg':\n $imageOldData = imagecreatefromjpeg ( $sourcePathFilename );\n break;\n\n case 'jpeg':\n $imageOldData = imagecreatefromjpeg ( $sourcePathFilename );\n break;\n\n case 'png':\n $imageOldData = imagecreatefrompng ( $sourcePathFilename );\n break;\n\n case 'gif':\n $imageOldData = imagecreatefromgif ( $sourcePathFilename );\n break;\n\n default:\n $imageOldData = imagecreatefromjpeg ( $sourcePathFilename );\n }\n\n $imageOldWidth = imagesx ( $imageOldData );\n $imageOldHeight = imagesy ( $imageOldData );\n\n $imageScale = min ( $maxWidth / $imageOldWidth, $maxHeight / $imageOldHeight );\n\n $imageNewWidth = ceil ( $imageScale * $imageOldWidth );\n $imageNewHeight = ceil ( $imageScale * $imageOldHeight );\n\n $imageNewData = imagecreatetruecolor ( $imageNewWidth, $imageNewHeight );\n\n $colorWhite = imagecolorallocate ( $imageNewData, 255, 255, 255 );\n imagefill ( $imageNewData, 0, 0, $colorWhite );\n\n imagecopyresampled ( $imageNewData, $imageOldData, 0, 0, 0, 0, $imageNewWidth, $imageNewHeight, $imageOldWidth, $imageOldHeight );\n\n ob_start ();\n imagejpeg ( $imageNewData, NULL, 100 );\n $imageNewDataString = ob_get_clean ();\n\n $imageNewFilename = hash ( 'sha256', $imageNewDataString ) . uniqid () . '.jpg';\n\n $imageNewPathFilename = $destinationPath . $imageNewFilename;\n\n if ( file_put_contents ( $imageNewPathFilename, $imageNewDataString ) !== false )\n {\n $result = $imageNewFilename;\n }\n\n imagedestroy ( $imageNewData );\n imagedestroy ( $imageOldData );\n }\n }\n\n return $result;\n}",
"function sharpen_resized_jpeg_images($resized_file) {\r\n $image = wp_load_image($resized_file); \r\n if(!is_resource($image))\r\n return new WP_Error('error_loading_image', $image, $file); \r\n $size = @getimagesize($resized_file);\r\n if(!$size)\r\n return new WP_Error('invalid_image', __('Could not read image size'), $file); \r\n list($orig_w, $orig_h, $orig_type) = $size; \r\n switch($orig_type) {\r\n case IMAGETYPE_JPEG:\r\n $matrix = array(\r\n array(-1, -1, -1),\r\n array(-1, 16, -1),\r\n array(-1, -1, -1),\r\n ); \r\n $divisor = array_sum(array_map('array_sum', $matrix));\r\n $offset = 0; \r\n imageconvolution($image, $matrix, $divisor, $offset);\r\n imagejpeg($image, $resized_file,apply_filters('jpeg_quality', 90, 'edit_image'));\r\n break;\r\n case IMAGETYPE_PNG:\r\n return $resized_file;\r\n case IMAGETYPE_GIF:\r\n return $resized_file;\r\n } \r\n return $resized_file;\r\n}",
"function resize_image($path, $filename, $maxwidth, $maxheight, $quality=75, $type = \"small_\", $new_path = \"\")\n{\n $filename = DIRECTORY_SEPARATOR.basename($filename);\n $sExtension = substr($filename, (strrpos($filename, \".\") + 1));\n $sExtension = strtolower($sExtension);\n\n // check ton tai thu muc khong\n if (!file_exists($path.$type))\n {\n @mkdir($path.$type, 0777, true);\n chmod($path.$type, 0777);\n }\n // Get new dimensions\n $size = getimagesize($path . $filename);\n $width = $size[0];\n $height = $size[1];\n if($width != 0 && $height !=0)\n {\n if($maxwidth / $width > $maxheight / $height) $percent = $maxheight / $height;\n else $percent = $maxwidth / $width;\n }\n\n $new_width\t= $width * $percent;\n $new_height\t= $height * $percent;\n\n // Resample\n $image_p = imagecreatetruecolor($new_width, $new_height);\n //check extension file for create\n switch($size['mime'])\n {\n case 'image/gif':\n $image = imagecreatefromgif($path . $filename);\n break;\n case 'image/jpeg' :\n case 'image/pjpeg' :\n $image = imagecreatefromjpeg($path . $filename);\n break;\n case 'image/png':\n $image = imagecreatefrompng($path . $filename);\n break;\n }\n //Copy and resize part of an image with resampling\n imagecopyresampled($image_p, $image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);\n\n // Output\n // check new_path, nếu new_path tồn tại sẽ save ra đó, thay path = new_path\n if($new_path != \"\")\n {\n $path = $new_path;\n if (!file_exists($path.$type))\n {\n @mkdir($path.$type, 0777, true);\n chmod($path.$type, 0777);\n }\n }\n\n switch($sExtension)\n {\n case \"gif\":\n imagegif($image_p, $path . $type . $filename);\n break;\n case $sExtension == \"jpg\" || $sExtension == \"jpe\" || $sExtension == \"jpeg\":\n imagejpeg($image_p, $path . $type . $filename, $quality);\n break;\n case \"png\":\n imagepng($image_p, $path . $type . $filename);\n break;\n }\n imagedestroy($image_p);\n}",
"function resizeImage($filename, $max_width, $max_height)\n{\n list($orig_width, $orig_height) = getimagesize($filename);\n\n $width = $orig_width;\n $height = $orig_height;\n\n # taller\n if ($max_height != 0 && $max_width != 0)\n {\n\t if ($height > $max_height) {\n\t\t $width = ($max_height / $height) * $width;\n\t\t $height = $max_height;\n\t }\n\n\t # wider\n\t if ($width > $max_width) {\n\t\t $height = ($max_width / $width) * $height;\n\t\t $width = $max_width;\n\t }\n }\n\n $image_p = imagecreatetruecolor($width, $height);\n\n $image = imagecreatefromjpeg($filename);\n\n imagecopyresampled($image_p, $image, 0, 0, 0, 0,\n $width, $height, $orig_width, $orig_height);\n\n return $image_p;\n}",
"function resizeImage($src_file, $dest_file, $new_size=100, $resize_aspect=\"sq\", $quality=\"80\")\n\t{\n\t\t$imginfo = getimagesize($src_file);\n\t\t\n\t\tif ($imginfo == null) {\n\t\treturn false;\n\t\t}\t \n\t\t\n\t\t// GD2 can only handle JPG, PNG & GIF images\n\t\tif (!$imginfo[2] > 0 && $imginfo[2] <= 3 ) {\n\t\t return false;\n\t\t}\n\t\t\n\t\t// height/width\n\t\t$srcWidth = $imginfo[0];\n\t\t$srcHeight = $imginfo[1];\n\t\t//$resize_aspect = \"sq\";\n\t\tif ($resize_aspect == 'ht') {\n\t\t $ratio = $srcHeight / $new_size;\n\t\t} elseif ($resize_aspect == 'wd') {\n\t\t $ratio = $srcWidth / $new_size;\n\t\t} elseif ($resize_aspect == 'sq') {\n\t\t $ratio = min($srcWidth, $srcHeight) / $new_size;\n\t\t} else {\n\t\t $ratio = max($srcWidth, $srcHeight) / $new_size;\n\t\t}\n\t\t\n\t\t/**\n\t\t* Initialize variables\n\t\t*/\n\t\t$clipX = 0;\n\t\t$clipY = 0;\n\t\t\n\t\t$ratio = max($ratio, 1.0);\n\t\tif ($resize_aspect == 'sq'){\n\t\t$destWidth = (int)(min($srcWidth,$srcHeight) / $ratio);\n\t\t$destHeight = (int)(min($srcWidth,$srcHeight) / $ratio);\n\t\tif($srcHeight > $srcWidth){\n\t\t$clipX = 0;\n\t\t$clipY = ((int)($srcHeight - $srcWidth)/2);\n\t\t$srcHeight = $srcWidth;\n\t\t}elseif($srcWidth > $srcHeight){\n\t\t$clipX = ((int)($srcWidth - $srcHeight)/2);\n\t\t$clipY = 0;\n\t\t$srcWidth = $srcHeight;\n\t\t}\n\t\t}else{\n\t\t$destWidth = (int)($srcWidth / $ratio);\n\t\t$destHeight = (int)($srcHeight / $ratio);\n\t\t}\n\t\t\n\t\tif (!function_exists('imagecreatefromjpeg')) {\n\t\t echo 'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed';\n\t\t exit;\n\t\t}\n\t\tif (!function_exists('imagecreatetruecolor')) {\n\t\t echo 'PHP running on your server does not support GD version 2.x, please switch to GD version 1.x on the admin page';\n\t\t exit;\n\t\t}\n\t\t\n\t\tif ($imginfo[2] == 1 )\n\t\t $src_img = imagecreatefromgif($src_file);\n\t\telseif ($imginfo[2] == 2)\n\t\t $src_img = imagecreatefromjpeg($src_file);\n\t\telse\n\t\t $src_img = imagecreatefrompng($src_file);\n\t\tif (!$src_img){\n\t\t return false;\n\t\t}\n\t\tif ($imginfo[2] == 1 ) {\n\t\t$dst_img = imagecreate($destWidth, $destHeight);\n\t\t} else {\n\t\t$dst_img = imagecreatetruecolor($destWidth, $destHeight);\n\t\t}\n\t\t\n\t\timagecopyresampled($dst_img, $src_img, 0, 0, $clipX, $clipY, (int)$destWidth, (int)$destHeight, $srcWidth, $srcHeight);\n\t\timagejpeg($dst_img, $dest_file, $quality);\n\t\timagedestroy($src_img);\n\t\timagedestroy($dst_img);\n\t\t\n\t\t// We check that the image is valid\n\t\t$imginfo = getimagesize($dest_file);\n\t\tif ($imginfo == null) {\n\t\t\t@unlink($dest_file);\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}",
"public function ratioResize($file, $width=null, $height=null, $rename='') {\n\n $file = $this->uploadPath . $file;\n $imginfo = $this->getInfo($file);\n\n if ($rename == '')\n $newName = substr($imginfo['name'], 0, strrpos($imginfo['name'], '.')) . $this->thumbSuffix . '.' . $this->generatedType;\n else\n $newName = $rename . '.' . $this->generatedType;\n\n if ($width === null && $height === null) {\n return false;\n } elseif ($width !== null && $height === null) {\n $resizeWidth = $width;\n $resizeHeight = ($width / $imginfo['width']) * $imginfo['height'];\n } elseif ($width === null && $height !== null) {\n $resizeWidth = ($height / $imginfo['height']) * $imginfo['width'];\n $resizeHeight = $height;\n } else {\n\t\t\t\n\t\t\tif($imginfo['width'] < $width and $imginfo['height'] < $height) {\n\t\t\t\t$width = $imginfo['width'];\n\t\t\t\t$height = $imginfo['height'];\n\t\t\t}\n\t\t\t\n if ($imginfo['width'] > $imginfo['height']) {\n $resizeWidth = $width;\n $resizeHeight = ($width / $imginfo['width']) * $imginfo['height'];\n } else {\n $resizeWidth = ($height / $imginfo['height']) * $imginfo['width'];\n $resizeHeight = $height;\n }\n }\n\n //create image object based on the image file type, gif, jpeg or png\n $this->createImageObject($img, $imginfo['type'], $file);\n if (!$img)\n return false;\n\n if (function_exists('imagecreatetruecolor')) {\n $newImg = imagecreatetruecolor($resizeWidth, $resizeHeight);\n imagecopyresampled($newImg, $img, 0, 0, 0, 0, $resizeWidth, $resizeHeight, $imginfo['width'], $imginfo['height']);\n } else {\n $newImg = imagecreate($resizeWidth, $resizeHeight);\n imagecopyresampled($newImg, $img, ($width - $resizeWidth) / 2, ($height - $resizeHeight) / 2, 0, 0, $resizeWidth, $resizeHeight, $imginfo['width'], $imginfo['height']);\n }\n\n imagedestroy($img);\n\n if ($this->saveFile) {\n //delete if exist\n if (file_exists($this->processPath . $newName))\n unlink($this->processPath . $newName);\n $this->generateImage($newImg, $this->processPath . $newName);\n imagedestroy($newImg);\n return $this->processPath . $newName;\n }\n else {\n $this->generateImage($newImg);\n imagedestroy($newImg);\n }\n\n return true;\n }",
"function image_resize_dimensions ( $args ) {\r\n\t\t/*\r\n\t\t * Changelog\r\n\t\t *\r\n\t\t * v8.1, November 11, 2009\r\n\t\t * - Now uses trigger_error instead of outputting errors to screen\r\n\t\t *\r\n\t\t * v8, December 02, 2007\r\n\t\t * - Cleaned by using math instead of logic\r\n\t\t * - Restructured the code\r\n\t\t * - Re-organised variable names\r\n\t\t *\r\n\t\t * v7, 20/07/2007\r\n\t\t * - Cleaned\r\n\t\t *\r\n\t\t * v6,\r\n\t\t * - Added cropping\r\n\t\t *\r\n\t\t * v5, 12/08/2006\r\n\t\t * - Changed to use args\r\n\t\t */\r\n\t\t\r\n\t\t/*\r\n\t\tThe 'exact' resize mode, will resize things to the exact limit.\r\n\t\tIf a width or height is 0, the appropriate value will be calculated by ratio\r\n\t\tResults with a 800x600 limit:\r\n\t\t\t*x*\t\t\t->\t800x600\r\n\t\tResults with a 0x600 limit:\r\n\t\t\t1280x1024\t->\t750x600\r\n\t\t\t1900x1200\t->\t950x600\r\n\t\t\t96x48\t\t->\t1200x600\r\n\t\t\t1000x500\t->\t1200x600\r\n\t\tResults with a 800x0 limit:\r\n\t\t\t1280x1024\t->\t800x640\r\n\t\t\t1900x1200\t->\t800x505\r\n\t\t\t96x48\t\t->\t800x400\r\n\t\t\t1000x500\t->\t800x400\r\n\t\t*/\r\n\t\t\r\n\t\t/*\r\n\t\tThe 'area' resize mode, will resize things to fit within the area.\r\n\t\tIf a width or height is 0, the appropriate value will be calculated by ratio\r\n\t\tResults with a 800x600 limit:\r\n\t\t\t1280x1024\t->\t750x600\r\n\t\t\t1900x1200\t->\t950x600\t-> 800x505\r\n\t\t\t96x48\t\t->\t96x48\t\tno change\r\n\t\t\t1000x500\t->\t800x400 = '800x'.(800/100)*500\r\n\t\tResults with a 0x600 limit:\r\n\t\t\t1280x1024\t->\t750x600\r\n\t\t\t1900x1200\t->\t950x600\r\n\t\t\t96x48\t\t->\t96x48\t\tno change\r\n\t\t\t1000x500\t->\t1000x500\tno change\r\n\t\tResults with a 800x0 limit:\r\n\t\t\t1280x1024\t->\t800x640\r\n\t\t\t1900x1200\t->\t950x600\t->\t800x505\r\n\t\t\t96x48\t\t->\t96x48\t\tno change\r\n\t\t\t1000x500\t->\t800x400\t= '800x'.(800/1000)*500\r\n\t\t*/\r\n\t\t\r\n\t\t// ---------\r\n\t\t$image = $x_original = $y_original = $x_old = $y_old = $resize_mode = $width_original = $width_old = $width_desired = $width_new = $height_original = $height_old = $height_desired = $height_new = null;\r\n\t\textract($args);\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($width_original) && !is_null($width_old) ) {\r\n\t\t\t$width_original = $width_old;\r\n\t\t\t$width_old = null;\r\n\t\t}\r\n\t\tif ( is_null($height_original) && !is_null($height_old) ) {\r\n\t\t\t$height_original = $height_old;\r\n\t\t\t$height_old = null;\r\n\t\t}\r\n\t\t\r\n\t\t//\r\n\t\tif ( is_null($width_original) && is_null($height_original) && !is_null($image) ) { // Get from image\r\n\t\t\t$image = image_read($image);\r\n\t\t\t$width_original = imagesx($image);\r\n\t\t\t$height_original = imagesy($image);\r\n\t\t}\r\n\t\t\r\n\t\t//\r\n\t\tif ( empty($width_original) || empty($height_original) ) { //\r\n\t\t\ttrigger_error('no original dimensions specified', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($width_desired) && !is_null($width_new) ) {\r\n\t\t\t$width_desired = $width_new;\r\n\t\t\t$width_new = null;\r\n\t\t}\r\n\t\tif ( is_null($height_desired) && !is_null($height_new) ) {\r\n\t\t\t$height_desired = $height_new;\r\n\t\t\t$height_new = null;\r\n\t\t}\r\n\t\t\r\n\t\t//\r\n\t\tif ( is_null($width_desired) || is_null($height_desired) ) { // Don't do any resizing\r\n\t\t\ttrigger_error('no desired dimensions specified', E_USER_NOTICE);\r\n\t\t\t// return array( 'width' => $width_original, 'height' => $height_original );\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($resize_mode) ) {\r\n\t\t\t$resize_mode = 'area';\r\n\t\t} elseif ( $resize_mode === 'none' ) { // Don't do any resizing\r\n\t\t\ttrigger_error('$resize_mode === \\'none\\'', E_USER_NOTICE);\r\n\t\t\t// return array( 'width' => $width_original, 'height' => $height_original );\r\n\t\t} elseif ( !in_array($resize_mode, array('area', 'crop', 'exact', true)) ) { //\r\n\t\t\ttrigger_error('Passed $resize_mode is not valid: ' . var_export(compact('resize_mode'), true), E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\tif ( is_null($x_original) && !is_null($x_old) ) {\r\n\t\t\t$x_original = $x_old;\r\n\t\t\tunset($x_old);\r\n\t\t}\r\n\t\tif ( is_null($y_original) && !is_null($y_old) ) {\r\n\t\t\t$y_original = $y_old;\r\n\t\t\tunset($y_old);\r\n\t\t}\r\n\t\tif ( is_null($x_original) )\r\n\t\t\t$x_original = 0;\r\n\t\tif ( is_null($y_original) )\r\n\t\t\t$y_original = 0;\r\n\t\t\t\r\n\t\t// ---------\r\n\t\t// Let's force integer values\r\n\t\t$width_original = intval($width_original);\r\n\t\t$height_original = intval($height_original);\r\n\t\t$width_desired = intval($width_desired);\r\n\t\t$height_desired = intval($height_desired);\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Set proportions\r\n\t\tif ( $height_original !== 0 )\r\n\t\t\t$proportion_wh = $width_original / $height_original;\r\n\t\tif ( $width_original !== 0 )\r\n\t\t\t$proportion_hw = $height_original / $width_original;\r\n\t\t\r\n\t\tif ( $height_desired !== 0 )\r\n\t\t\t$proportion_wh_desired = $width_desired / $height_desired;\r\n\t\tif ( $width_desired !== 0 )\r\n\t\t\t$proportion_hw_desired = $height_desired / $width_desired;\r\n\t\t\t\r\n\t\t// ---------\r\n\t\t// Set cutoms\r\n\t\t$x_new = $x_original;\r\n\t\t$y_new = $y_original;\r\n\t\t$canvas_width = $canvas_height = null;\r\n\t\t\r\n\t\t// ---------\r\n\t\t$width_new = $width_original;\r\n\t\t$height_new = $height_original;\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Do resize\r\n\t\tif ( $height_desired === 0 && $width_desired === 0 ) {\r\n\t\t\t// Nothing to do\r\n\t\t} elseif ( $height_desired === 0 && $width_desired !== 0 ) {\r\n\t\t\t// We don't care about the height\r\n\t\t\t$width_new = $width_desired;\r\n\t\t\tif ( $resize_mode !== 'exact' ) {\r\n\t\t\t\t// h = w*(h/w)\r\n\t\t\t\t$height_new = $width_desired * $proportion_hw;\r\n\t\t\t}\r\n\t\t} elseif ( $height_desired !== 0 && $width_desired === 0 ) {\r\n\t\t\t// We don't care about the width\r\n\t\t\tif ( $resize_mode !== 'exact' ) {\r\n\t\t\t\t // w = h*(w/h)\r\n\t\t\t\t$width_new = $height_desired * $proportion_wh;\r\n\t\t\t}\r\n\t\t\t$height_new = $height_desired;\r\n\t\t} else {\r\n\t\t\t// We care about both\r\n\r\n\t\t\tif ( $resize_mode === 'exact' || /* no upscaling */ ($width_original <= $width_desired && $height_original <= $height_desired) ) { // Nothing to do\r\n\t\t\t} elseif ( $resize_mode === 'area' ) { // Proportion to fit inside\r\n\t\t\t\t\r\n\r\n\t\t\t\t// Pick which option\r\n\t\t\t\tif ( $proportion_wh <= $proportion_wh_desired ) { // Option 1: wh\r\n\t\t\t\t\t// Height would of overflowed\r\n\t\t\t\t\t$width_new = $height_desired * $proportion_wh; // w = h*(w/h)\r\n\t\t\t\t\t$height_new = $height_desired;\r\n\t\t\t\t} else // if ( $proportion_hw <= $proportion_hw_desired )\r\n{ // Option 2: hw\r\n\t\t\t\t\t// Width would of overflowed\r\n\t\t\t\t\t$width_new = $width_desired;\r\n\t\t\t\t\t$height_new = $width_desired * $proportion_hw; // h = w*(h/w)\r\n\t\t\t\t}\r\n\t\t\t\r\n\t\t\t} elseif ( $resize_mode === 'crop' ) { // Proportion to occupy\r\n\t\t\t\t\r\n\r\n\t\t\t\t// Pick which option\r\n\t\t\t\tif ( $proportion_wh <= $proportion_wh_desired ) { // Option 2: hw\r\n\t\t\t\t\t// Height will overflow\r\n\t\t\t\t\t$width_new = $width_desired;\r\n\t\t\t\t\t$height_new = $width_desired * $proportion_hw; // h = w*(h/w)\r\n\t\t\t\t\t// Set custom\r\n\t\t\t\t\t$y_new = -($height_new - $height_desired) / 2;\r\n\t\t\t\t} else // if ( $proportion_hw <= $proportion_hw_desired )\r\n{ // Option 1: hw\r\n\t\t\t\t\t// Width will overflow\r\n\t\t\t\t\t$width_new = $height_desired * $proportion_wh; // w = h*(w/h)\r\n\t\t\t\t\t$height_new = $height_desired;\r\n\t\t\t\t\t// Set custom\r\n\t\t\t\t\t$x_new = -($width_new - $width_desired) / 2;\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t// Set canvas\r\n\t\t\t\t$canvas_width = $width_desired;\r\n\t\t\t\t$canvas_height = $height_desired;\r\n\t\t\t\r\n\t\t\t}\r\n\t\t\r\n\t\t}\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Set custom if they have not been set already\r\n\t\tif ( $canvas_width === null )\r\n\t\t\t$canvas_width = $width_new;\r\n\t\tif ( $canvas_height === null )\r\n\t\t\t$canvas_height = $height_new;\r\n\t\t\t\r\n\t\t// ---------\r\n\t\t// Compat\r\n\t\t$width_old = $width_original;\r\n\t\t$height_old = $height_original;\r\n\t\t$x_old = $x_original;\r\n\t\t$y_old = $y_original;\r\n\t\t\r\n\t\t// ---------\r\n\t\t// Return\r\n\t\t$return = compact('width_original', 'height_original', 'width_old', 'height_old', 'width_desired', 'height_desired', 'width_new', 'height_new', 'canvas_width', 'canvas_height', 'x_original', 'y_original', 'x_old', 'y_old', 'x_new', 'y_new');\r\n\t\t// echo '<--'; var_dump($return); echo '-->';\r\n\t\treturn $return;\r\n\t}",
"function resizeImage($sourceImage, $targetImage, $maxWidth, $maxHeight, $quality = 80) {\n echo 'sourceImage ';\n echo $sourceImage;\n echo ' targetImage ';\n echo $targetImage;\n // Obtain image from given source file.\n\tif (!$image = @imagecreatefromjpeg($sourceImage)) {\n\t\techo 'false';\n return false;\n }\n\techo ' pre list ';\n // Get dimensions of source image.\n list($origWidth, $origHeight) = getimagesize($sourceImage);\n\n if ($maxWidth == 0) {\n $maxWidth = $origWidth;\n }\n\n if ($maxHeight == 0) {\n $maxHeight = $origHeight;\n }\n\n // Calculate ratio of desired maximum sizes and original sizes.\n $widthRatio = $maxWidth / $origWidth;\n $heightRatio = $maxHeight / $origHeight;\n\n // Ratio used for calculating new image dimensions.\n $ratio = min($widthRatio, $heightRatio);\n\n // Calculate new image dimensions.\n $newWidth = (int)$origWidth * $ratio;\n $newHeight = (int)$origHeight * $ratio;\n\techo 'pre true color ';\n // Create final image with new dimensions.\n\t$newImage = imagecreatetruecolor($newWidth, $newHeight);\n\techo 'post true color ';\n\n // $image = str_replace(' ','_',$image);\n\n\timagecopyresampled($newImage, $image, 0, 0, 0, 0, $newWidth, $newHeight, $origWidth, $origHeight);\n\techo 'post resampled ';\n\n // CREATE PROGRESSIVE IMG INSTANCE\n // $imageProg = imagecreatefromjpeg($image);\n // imageinterlace($imageProg, true);\n // echo 'post progressive';\n\n\timagejpeg($newImage, $targetImage, $quality);\n // imagejpeg($imageProg, $targetImage, $quality);\n\techo 'post imagejpeg ';\n\n // FREE UP MEMORY\n imagedestroy($image);\n imagedestroy($newImage);\n // imagedestroy($imageProg);\n\n return true;\n}",
"function cropimage($source_url, $new_width=250, $quality=75){\n return false;\n \n if (!file_exists($source_url)){\n echo alertbuilder(\"File does not exist: $source_url\",'warning');\n return false;\n }\n \n //separate the file name and the extention\n $source_url_parts = pathinfo($source_url);\n $filename = $source_url_parts['filename'];\n $extension = strtolower($source_url_parts['extension']);\n \n //detect the width and the height of original image\n $info = getimagesize($source_url);\n \n if($info === false){\n echo alertbuilder('This file is not a valid image', 'warning');\n return false;\n }\n \n $type = $info[2];\n $width = $info[0];\n $height = $info[1];\n \n // resize only when the original image is larger than new width.\n // this helps you to avoid from unwanted resizing.\n if ($width > $new_width) {\n // cool to resize\n } else {\n echo alertbuilder('The image is already smaller than width', 'warning');\n return false;\n }\n \n //get the reduced width\n $reduced_width = ($width - $new_width);\n \n //now convert the reduced width to a percentage, round to 2 decimals\n $reduced_radio = round(($reduced_width / $width) * 100, 2);\n \n // reduce the same percentage from the height, round to 2 decimals\n $reduced_height = round(($height / 100) * $reduced_radio, 2);\n \n //reduce the calculated height from the original height\n $new_height = $height - $reduced_height;\n \n $img = null;\n $imgResized = null;\n \n switch($type) {\n case IMAGETYPE_JPEG:\n $img = imagecreatefromjpeg($source_url);\n $imgResized = imagescale($img, $new_width, $new_height, $quality);\n imagejpeg($imgResized, $source_url); \n break;\n \n case IMAGETYPE_GIF:\n $img = imagecreatefromgif($source_url);\n $imgResized = imagescale($img, $new_width, $new_height, $quality);\n imagegif($imgResized, $source_url); \n break;\n \n case IMAGETYPE_PNG:\n $img = imagecreatefrompng($source_url);\n $imgResized = imagescale($img, $new_width, $new_height, $quality);\n imagepng($imgResized, $source_url); \n break;\n \n default:\n echo alertbuilder('This file is not in JPG, GIF, or PNG format!');\n return false;\n }\n\n //Finally frees any memory associated with image\n imagedestroy($img);\n imagedestroy($imgResized);\n \n return true;\n}",
"function normal_resize_image($source, $destination, $image_type, $max_size, $image_width, $image_height, $quality){\n\n if($image_width <= 0 || $image_height <= 0){return false;} //return false if nothing to resize\n\n //do not resize if image is smaller than max size\n if($image_width <= $max_size && $image_height <= $max_size){\n if(save_image($source, $destination, $image_type, $quality)){\n return true;\n }\n }\n\n //Construct a proportional size of new image\n $image_scale\t= min($max_size/$image_width, $max_size/$image_height);\n $new_width\t\t= ceil($image_scale * $image_width);\n $new_height\t\t= ceil($image_scale * $image_height);\n\n $new_canvas\t\t= imagecreatetruecolor( $new_width, $new_height ); //Create a new true color image\n\n //Copy and resize part of an image with resampling\n if(imagecopyresampled($new_canvas, $source, 0, 0, 0, 0, $new_width, $new_height, $image_width, $image_height)){\n save_image($new_canvas, $destination, $image_type, $quality); //save resized image\n }\n\n return true;\n}",
"function smart_resize_image($file, $string = null, $width = 0, $height = 0, $proportional = false, $output = 'file', $delete_original = true, $use_linux_commands = false, $quality = 100, $grayscale = false\n) {\n\n if ($height <= 0 && $width <= 0)\n return false;\n if ($file === null && $string === null)\n return false;\n\n # Setting defaults and meta\n $info = $file !== null ? getimagesize($file) : getimagesizefromstring($string);\n $image = '';\n $final_width = 0;\n $final_height = 0;\n list($width_old, $height_old) = $info;\n $cropHeight = $cropWidth = 0;\n\n # Calculating proportionality\n if ($proportional) {\n if ($width == 0)\n $factor = $height / $height_old;\n elseif ($height == 0)\n $factor = $width / $width_old;\n else\n $factor = min($width / $width_old, $height / $height_old);\n\n $final_width = round($width_old * $factor);\n $final_height = round($height_old * $factor);\n }\n else {\n $final_width = ( $width <= 0 ) ? $width_old : $width;\n $final_height = ( $height <= 0 ) ? $height_old : $height;\n $widthX = $width_old / $width;\n $heightX = $height_old / $height;\n\n $x = min($widthX, $heightX);\n $cropWidth = ($width_old - $width * $x) / 2;\n $cropHeight = ($height_old - $height * $x) / 2;\n }\n\n # Loading image to memory according to type\n switch ($info[2]) {\n case IMAGETYPE_JPEG: $file !== null ? $image = imagecreatefromjpeg($file) : $image = imagecreatefromstring($string);\n break;\n case IMAGETYPE_GIF: $file !== null ? $image = imagecreatefromgif($file) : $image = imagecreatefromstring($string);\n break;\n case IMAGETYPE_PNG: $file !== null ? $image = imagecreatefrompng($file) : $image = imagecreatefromstring($string);\n break;\n default: return false;\n }\n\n # Making the image grayscale, if needed\n if ($grayscale) {\n imagefilter($image, IMG_FILTER_GRAYSCALE);\n }\n\n # This is the resizing/resampling/transparency-preserving magic\n $image_resized = imagecreatetruecolor($final_width, $final_height);\n if (($info[2] == IMAGETYPE_GIF) || ($info[2] == IMAGETYPE_PNG)) {\n $transparency = imagecolortransparent($image);\n $palletsize = imagecolorstotal($image);\n\n if ($transparency >= 0 && $transparency < $palletsize) {\n $transparent_color = imagecolorsforindex($image, $transparency);\n $transparency = imagecolorallocate($image_resized, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue']);\n imagefill($image_resized, 0, 0, $transparency);\n imagecolortransparent($image_resized, $transparency);\n } elseif ($info[2] == IMAGETYPE_PNG) {\n imagealphablending($image_resized, false);\n $color = imagecolorallocatealpha($image_resized, 0, 0, 0, 127);\n imagefill($image_resized, 0, 0, $color);\n imagesavealpha($image_resized, true);\n }\n }\n imagecopyresampled($image_resized, $image, 0, 0, $cropWidth, $cropHeight, $final_width, $final_height, $width_old - 2 * $cropWidth, $height_old - 2 * $cropHeight);\n\n\n # Taking care of original, if needed\n if ($delete_original) {\n if ($use_linux_commands)\n exec('rm ' . $file);\n else\n @unlink($file);\n }\n\n # Preparing a method of providing result\n switch (strtolower($output)) {\n case 'browser':\n $mime = image_type_to_mime_type($info[2]);\n header(\"Content-type: $mime\");\n $output = NULL;\n break;\n case 'file':\n $output = $file;\n break;\n case 'return':\n return $image_resized;\n break;\n default:\n break;\n }\n\n # Writing image according to type to the output destination and image quality\n switch ($info[2]) {\n case IMAGETYPE_GIF: imagegif($image_resized, $output);\n break;\n case IMAGETYPE_JPEG: imagejpeg($image_resized, $output, $quality);\n break;\n case IMAGETYPE_PNG:\n $quality = 9 - (int) ((0.9 * $quality) / 10.0);\n imagepng($image_resized, $output, $quality);\n break;\n default: return false;\n }\n\n return true;\n}",
"public function resizeTo($width, $height, $resizeOption = 'default') {\n switch (strtolower($resizeOption)) {\n case 'exact':\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n break;\n case 'maxwidth':\n $this->resizeWidth = $width;\n $this->resizeHeight = $this->resizeHeightByWidth($width);\n break;\n case 'maxheight':\n $this->resizeWidth = $this->resizeWidthByHeight($height);\n $this->resizeHeight = $height;\n break;\n case 'proportionally':\n $ratio_orig = $this->origWidth / $this->origHeight;\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n if ($width / $height > $ratio_orig)\n $this->resizeWidth = $height * $ratio_orig;\n else\n $this->resizeHeight = $width / $ratio_orig;\n break;\n default:\n if ($this->origWidth > $width || $this->origHeight > $height) {\n if ($this->origWidth > $this->origHeight) {\n $this->resizeHeight = $this->resizeHeightByWidth($width);\n $this->resizeWidth = $width;\n } else if ($this->origWidth < $this->origHeight) {\n $this->resizeWidth = $this->resizeWidthByHeight($height);\n $this->resizeHeight = $height;\n } else {\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n }\n } else {\n $this->resizeWidth = $width;\n $this->resizeHeight = $height;\n }\n break;\n }\n\n $this->newImage = imagecreatetruecolor($this->resizeWidth, $this->resizeHeight);\n if ($this->ext == \"image/gif\" || $this->ext == \"image/png\") {\n imagealphablending($this->newImage, false);\n imagesavealpha($this->newImage, true);\n $transparent = imagecolorallocatealpha($this->newImage, 255, 255, 255, 127);\n imagefilledrectangle($this->newImage, 0, 0, $this->resizeWidth, $this->resizeHeight, $transparent);\n }\n imagecopyresampled($this->newImage, $this->image, 0, 0, 0, 0, $this->resizeWidth, $this->resizeHeight, $this->origWidth, $this->origHeight);\n }",
"function scaleByFactor($size)\r\n {\r\n $new_x = round($size * $this->img_x, 0);\r\n $new_y = round($size * $this->img_y, 0);\r\n return $this->_resize($new_x, $new_y);\r\n }",
"function image_resize_to_folder($source_pic, $destination_folder, $filename, $max_width, $max_height)\n{\n $image_info = getimagesize($source_pic['tmp_name']);\n $source_pic_name = $source_pic['name'];\n $source_pic_tmpname = $source_pic['tmp_name'];\n $source_pic_size = $source_pic['size'];\n $source_pic_width = $image_info[0];\n $source_pic_height = $image_info[1];\n if (!is_dir($destination_folder)) {\n mkdir($destination_folder, 0755);\n }\n\n $x_ratio = $max_width / $source_pic_width;\n $y_ratio = $max_height / $source_pic_height;\n\n if (($source_pic_width <= $max_width) && ($source_pic_height <= $max_height)) {\n $tn_width = $source_pic_width;\n $tn_height = $source_pic_height;\n } elseif (($x_ratio * $source_pic_height) < $max_height) {\n $tn_height = ceil($x_ratio * $source_pic_height);\n $tn_width = $max_width;\n } else {\n $tn_width = ceil($y_ratio * $source_pic_width);\n $tn_height = $max_height;\n }\n\n switch ($image_info['mime']) {\n case 'image/gif':\n if (imagetypes() & IMG_GIF) {\n $src = imageCreateFromGIF($source_pic['tmp_name']);\n $destination_folder.=\"$filename.gif\";\n $namafile = \"$filename.gif\";\n }\n break;\n\n case 'image/jpeg':\n if (imagetypes() & IMG_JPG) {\n $src = imageCreateFromJPEG($source_pic['tmp_name']);\n $destination_folder.=\"$filename.jpg\";\n $namafile = \"$filename.jpg\";\n }\n break;\n\n case 'image/pjpeg':\n if (imagetypes() & IMG_JPG) {\n $src = imageCreateFromJPEG($source_pic['tmp_name']);\n $destination_folder.=\"$filename.jpg\";\n $namafile = \"$filename.jpg\";\n }\n break;\n\n case 'image/png':\n if (imagetypes() & IMG_PNG) {\n $src = imageCreateFromPNG($source_pic['tmp_name']);\n $destination_folder.=\"$filename.png\";\n $namafile = \"$filename.png\";\n }\n break;\n\n case 'image/wbmp':\n if (imagetypes() & IMG_WBMP) {\n $src = imageCreateFromWBMP($source_pic['tmp_name']);\n $destination_folder.=\"$filename.bmp\";\n $namafile = \"$filename.bmp\";\n }\n break;\n }\n\n //chmod($destination_pic,0777);\n $tmp = imagecreatetruecolor($tn_width, $tn_height);\n imagecopyresampled($tmp, $src, 0, 0, 0, 0, $tn_width, $tn_height, $source_pic_width, $source_pic_height);\n\n //**** 100 is the quality settings, values range from 0-100.\n switch ($image_info['mime']) {\n case 'image/jpeg':\n imagejpeg($tmp, $destination_folder, 100);\n break;\n\n case 'image/gif':\n imagegif($tmp, $destination_folder, 100);\n break;\n\n case 'image/png':\n imagepng($tmp, $destination_folder);\n break;\n\n default:\n imagejpeg($tmp, $destination_folder, 100);\n break;\n }\n\n return ($namafile);\n}",
"public static function ScaleThumbnailSizes($image, $maxwidth = -1, $maxheight = -1,\n $behaviour = 1, $upscale = false)\n {\n if(empty($image) ||\n (is_string($image) && !is_file($image)) ||\n !is_resource($image) )\n return false;\n\n if(is_string($image))\n {\n list($width, $height) = @getimagesize($image);\n $maxwidth = intval($maxwidth);\n $maxheight = intval($maxheight);\n }\n else\n {\n $maxwidth = $width = imagesx($image);\n $maxheight = $height = imagesy($image);\n }\n $maxwidth = Is_Valid_Number($maxwidth,0,1,SD_MEDIA_MAX_DIM);\n $maxheight = Is_Valid_Number($maxheight,0,1,SD_MEDIA_MAX_DIM);\n\n if(empty($maxwidth) || empty($maxheight))\n {\n return false;\n }\n\n //Calculate the width:height ratio\n $owidth = $width;\n $oheight = $height;\n $ratio = $height/$width;\n if($maxheight < 0 || $maxwidth < 0)\n {\n if($maxheight < 0 && $maxwidth < 0)\n {\n //Do nothing\n }\n elseif ($maxheight < 0)\n {\n $width = $maxwidth;\n $height = round($width*$ratio);\n }\n elseif ($maxwidth < 0)\n {\n $height = $maxheight;\n $width = round($height/$ratio);\n }\n }\n elseif ($ratio == 1)\n {\n //Same Height/Width\n if ($maxheight === $maxwidth)\n {\n $width = $maxwidth;\n $height = $maxheight;\n }\n else\n {\n $height = min($maxheight,$maxwidth);\n $width = min($maxheight,$maxwidth);\n }\n }\n else\n {\n $case1_width = $maxwidth;\n $case1_height = round($case1_width*$ratio);\n $case1_area = round($case1_width*$case1_height);\n\n $case2_height = $maxheight;\n $case2_width = round($case2_height/$ratio);\n $case2_area = round($case2_width*$case2_height);\n\n //Check if it is an ambiguous case\n if(($case1_width <= $maxwidth) && ($case1_height <= $maxheight) &&\n ($case2_width <= $maxwidth) && ($case2_height <= $maxheight))\n {\n //$behaviour Sometimes, 2 values are obtained. Set this to 1 to return the\n //one with the bigger pixel area or 2 to return the one with smaller pixel area.\n if($behaviour == 1)\n {\n if($case1_area >= $case2_area)\n {\n $height = $case1_height;\n $width = $case1_width;\n }\n else\n {\n $height = $case2_height;\n $width = $case2_width;\n }\n }\n else\n {\n if($case1_area <= $case2_area)\n {\n $height = $case1_height;\n $width = $case1_width;\n }\n else\n {\n $height = $case2_height;\n $width = $case2_width;\n }\n }\n }\n else\n {\n if ($case1_width <= $maxwidth && $case1_height <= $maxheight)\n {\n $height = $case1_height;\n $width = $case1_width;\n }\n else\n {\n $height = $case2_height;\n $width = $case2_width;\n }\n }\n }\n\n if(($height > $oheight) || ($width > $owidth))\n {\n $width = $owidth;\n $height = $oheight;\n }\n $array = array((int)$width,(int)$height);\n return $array;\n\n }",
"function make_thumb($img_name, $filename, $new_w, $new_h) {\n //get image extension.\n $ext = getExtension($img_name);\n //creates the new image using the appropriate function from gd library\n if (!strcmp(\"jpg\", $ext) || !strcmp(\"jpeg\", $ext))\n $src_img = imagecreatefromjpeg($img_name);\n\n if (!strcmp(\"png\", $ext))\n $src_img = imagecreatefrompng($img_name);\n\n //gets the dimmensions of the image\n $old_x = imageSX($src_img);\n $old_y = imageSY($src_img);\n\n // next we will calculate the new dimmensions for the thumbnail image\n // the next steps will be taken: \n // 1. calculate the ratio by dividing the old dimmensions with the new ones\n // 2. if the ratio for the width is higher, the width will remain the one define in WIDTH variable\n // and the height will be calculated so the image ratio will not change\n // 3. otherwise we will use the height ratio for the image\n // as a result, only one of the dimmensions will be from the fixed ones\n $ratio1 = $old_x / $new_w;\n $ratio2 = $old_y / $new_h;\n if ($ratio1 > $ratio2) {\n $thumb_w = $new_w;\n $thumb_h = $old_y / $ratio1;\n } else {\n $thumb_h = $new_h;\n $thumb_w = $old_x / $ratio2;\n }\n\n // we create a new image with the new dimmensions\n $dst_img = ImageCreateTrueColor($thumb_w, $thumb_h);\n\n // resize the big image to the new created one\n imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $thumb_w, $thumb_h, $old_x, $old_y);\n\n // output the created image to the file. Now we will have the thumbnail into the file named by $filename\n if (!strcmp(\"png\", $ext))\n imagepng($dst_img, $filename);\n else\n imagejpeg($dst_img, $filename);\n\n //destroys source and destination images. \n imagedestroy($dst_img);\n imagedestroy($src_img);\n}",
"function _image_get_preview_ratio($w, $h)\n {\n }",
"function resizeImage($CurWidth, $CurHeight, $MaxSize, $DestFolder, $SrcImage, $Quality, $ImageType)\n{\n\t//Check Image size is not 0\n\tif($CurWidth <= 0 || $CurHeight <= 0) \n\t{\n\t\treturn false;\n\t}\n\t\n\t//Construct a proportional size of new image\n\t$ImageScale\t= min($MaxSize/$CurWidth, $MaxSize/$CurHeight); \n\t$NewWidth\t= ceil($ImageScale*$CurWidth);\n\t$NewHeight\t= ceil($ImageScale*$CurHeight);\n\t\n\tif($CurWidth < $NewWidth || $CurHeight < $NewHeight)\n\t{\n\t\t$NewWidth = $CurWidth;\n\t\t$NewHeight = $CurHeight;\n\t}\n\t$NewCanves \t= imagecreatetruecolor($NewWidth, $NewHeight);\n\t// Resize Image\n\tif(imagecopyresampled($NewCanves, $SrcImage, 0, 0, 0, 0, $NewWidth, $NewHeight, $CurWidth, $CurHeight))\n\t{\n\t\tswitch(strtolower($ImageType))\n\t\t{\n\t\t\tcase 'image/png':\n\t\t\t\timagepng($NewCanves, $DestFolder);\n\t\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\timagegif($NewCanves, $DestFolder);\n\t\t\t\tbreak;\t\t\t\n\t\t\tcase 'image/jpeg':\n\t\t\tcase 'image/pjpeg':\n\t\t\t\timagejpeg($NewCanves, $DestFolder, $Quality);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t\tif(is_resource($NewCanves))\n\t\t{ \n\t\t\timagedestroy($NewCanves); \n\t } \n\t\treturn true;\n\t}\n\n}",
"function resize_image($filename)\n {\n $img_source = 'assets/images/products/'. $filename;\n $img_target = 'assets/images/thumb/';\n\n // image lib settings\n $config = array(\n 'image_library' => 'gd2',\n 'source_image' => $img_source,\n 'new_image' => $img_target,\n 'maintain_ratio' => FALSE,\n 'width' => 128,\n 'height' => 128\n );\n // load image library\n $this->load->library('image_lib', $config);\n\n // resize image\n if(!$this->image_lib->resize())\n echo $this->image_lib->display_errors();\n $this->image_lib->clear();\n }",
"public function fit()\n\t{\n\t\t// Load image\n\t\tif( $this->im == NULL) $this->im = imagecreatefromstring( file_get_contents( $this->imageFilePath ) );\n\n\t\tif($this->resizeFlag)\n\t\t{\n\t\t\t$newWidth=$this->width;\n\t\t\t$newHeight=$this->height;\n\t\n\t\t\t$t=imagecreatetruecolor($newWidth,$newHeight);\n\t\t\timagecopyresampled($t,$this->im,0,0,0,0,$newWidth,$newHeight,imagesx($this->im),imagesy($this->im));\n\t\t\timagedestroy($this->im);\n\t\t\t$this->im=$t;\n\t\t\t//imagedestroy($t);\t\n\t\t\t$this->debug[]=\"[RESIZE] TRUE -> $newWidth $newHeight\";\n\t\t}\n\n\t\t// Counter to keep track of iterations\n\t\t$cc = 0;\n\n\t\t// Use the buffer NOT the filesystem to compute intermediate image size\n\t\tob_start();\n\n\t\t// Loop forever\n\t\twhile( true )\n\t\t{\n\t\t\t// Empty buffer\n\t\t\tob_clean();\n\n\t\t\t// Keep track of previous quality setting\n\t\t\t$this->cq = $this->q;\n\n\t\t\t// Create and fill buffer with image with current quality setting\n\t\t\timagejpeg( $this->im, NULL, $this->cq );\n\n\t\t\t// Compute current image size from size of buffer\n\t\t\t$currentSize = strlen( ob_get_contents() );\n\n\t\t\t// Some debug\n\t\t\t$this->debug[] = \" \" . $this->low . \" >>> \" . $this->cq . \" <<< \" . $this->high . \" [ $currentSize / \" . $this->targetSize . \" ]\";\n\n\t\t\t// Break loop if target size is reached - very rare!\n\t\t\tif ( $currentSize == $this->targetSize )\n\t\t\t\tbreak;\n\n\t\t\t// If size > target then change quality range\n\t\t\tif ( $currentSize > $this->targetSize )\n\t\t\t{\n\t\t\t\t$this->high = $this->q;\n\t\t\t\t$this->q = ( $this->q + $this->low ) / 2;\n\t\t\t}\n\n\t\t\t// If size < target then change quality range\n\t\t\tif ( $currentSize < $this->targetSize )\n\t\t\t{\n\t\t\t\t$this->low = $this->q;\n\t\t\t\t$this->q = ( $this->q + $this->high ) / 2;\n\t\t\t}\n\n\t\t\t// Break loop if high/low gap below precision AND size is < target size\n\t\t\tif ( ( ( $this->high - $this->low ) < $this->precision ) && ( $currentSize <= $this->targetSize ) )\n\t\t\t\tbreak;\n\n\t\t\t// Break loop of counter has reached maximum iterations - target size either to low/high\n\t\t\tif ( $cc == $this->maxIterations )\n\t\t\t\tbreak;\n\n\t\t\t// Continue loop incrementing counter\n\t\t\t$cc++;\n\t\t}\n\n\t\t// Final debug\n\t\t$this->debug[] = \"Final Quality Setting = \" . $this->cq;\n\n\t\t// Disable buffer\n\t\tob_end_clean();\n\t}",
"function imageResize($file, $dest, $height, $width, $thumb = FALSE) {\n\tglobal $ighMaxHeight, $ighMaxWidth, $ighThumbHeight, $ighThumbWidth;\n\n\tif (strstr(@mime_content_type($file), \"png\"))\n\t\t$oldImage = imagecreatefrompng($file);\n\telseif (strstr(@mime_content_type($file), \"jpeg\"))\n\t\t$oldImage = imagecreatefromjpeg($file);\n\telseif (strstr(@mime_content_type($file), \"gif\"))\n\t\t$oldImage = imagecreatefromgif($file);\n\telse\n\t\tdie (\"oh shit\");\n\n\t$base_img = $oldImage;\n $img_width = imagesx($base_img);\n $img_height = imagesy($base_img);\n\n $thumb_height = $height;\n $thumb_width = $width;\n\n // Work out which way it needs to be resized\n $img_width_per = $thumb_width / $img_width;\n $img_height_per = $thumb_height / $img_height;\n \n if ($img_width_per <= $img_height_per) {\n $thumb_height = intval($img_height * $img_width_per); \n }\n else {\n $thumb_width = intval($img_width * $img_height_per);\n }\n\n\tif ($thumb) {\n\t\t$thumb_width = $width;\t\t// 120\n\t\t$thumb_height = $height*3/4;\t// 120 * 3 / 4 = 90\n\t}\n\n // Create the new thumbnail image\n $thumb_img = ImageCreateTrueColor($thumb_width, $thumb_height); \n\n\tif ($thumb) {\t// Do the Square from the Centre thing.\n\t\tImageCopyResampled($thumb_img, $base_img, 0, 0, \n\t\t\t\t($img_width/2)-($thumb_width/2), ($img_height/2)-($thumb_height/2), \n\t\t\t\t$thumb_width, $thumb_height, $thumb_width, $thumb_height);\t\t\t\n\t} else {\t// standard image to image resize.\n\t\tImageCopyResampled($thumb_img, $base_img, 0, 0, 0, 0, \n\t\t\t\t$thumb_width, $thumb_height, $img_width, $img_height);\n\t}\n\n\t// using jpegs!\n\timagejpeg($thumb_img, $dest);\n\timagedestroy($base_img);\n\timagedestroy($thumb_img);\n}",
"static function resize($sourcePath, $newWidth = 100, $newHeight = 100)\n {\n switch (exif_imagetype($sourcePath)) {\n case IMAGETYPE_JPEG :\n $sourceImage = imagecreatefromjpeg($sourcePath);\n break;\n case IMAGETYPE_PNG :\n $sourceImage = imagecreatefrompng($sourcePath);\n break;\n case IMAGETYPE_GIF :\n $sourceImage = imagecreatefromgif($sourcePath);\n break;\n default:\n return;\n }\n\n // Create the new image (still blank/empty)\n $newImage = imagecreatetruecolor($newWidth, $newHeight);\n imagesetinterpolation($newImage, IMG_SINC);\n\n // Determine the source image Dimensions\n $sourceImageWidth = imagesx($sourceImage);\n $sourceImageHeight = imagesy($sourceImage);\n $sourceImageAspectRatio = $sourceImageWidth / $sourceImageHeight;\n $newImageAspectRatio = $newWidth / $newHeight;\n\n // Determine parameters and copy part of the source image into the new image\n if ($newImageAspectRatio >= $sourceImageAspectRatio) { // width is the limiting factor for the source image\n $src_x = 0;\n $src_w = $sourceImageWidth;\n $src_h = $src_w / $newImageAspectRatio;\n $src_y = ($sourceImageHeight - $src_h) / 2;\n } else { // height of source image is limiting factor\n $src_y = 0;\n $src_h = $sourceImageHeight;\n $src_w = $src_h * $newImageAspectRatio;\n $src_x = ($sourceImageWidth - $src_w) / 2;\n }\n\n imagecopyresampled($newImage, $sourceImage, 0, 0, $src_x, $src_y, $newWidth, $newHeight, $src_w, $src_h);\n\n // Save new image to destination path\n switch (exif_imagetype($sourcePath)) {\n case IMAGETYPE_JPEG :\n imagejpeg($newImage, $sourcePath, 100);\n break;\n case IMAGETYPE_PNG :\n imagepng($newImage, $sourcePath);\n break;\n case IMAGETYPE_GIF :\n imagegif($newImage, $sourcePath);\n break;\n }\n\n // Remove image resources to reallocate space\n imagedestroy($sourceImage);\n imagedestroy($newImage);\n }",
"public static function setSize($path,$target_width=150,$target_height=100) {\n\t\t$img = imagecreatefromjpeg($path);\n\t\tif (!$img) {\n\t\t\techo \"ERROR:could not create image handle \".$path;\n\t\t\texit(0);\n\t\t}\n\t\t$width = imageSX($img);\n\t\t$height = imageSY($img);\n\t\t$size = getimagesize($path);\n\t\tif (!$width || !$height) {\n\t\t\techo \"ERROR:Invalid width or height\";\n\t\t\texit(0);\n\t\t}\n\t\tif ($width > $target_width) {\n\t\t\t$width_ratio = $target_width/$width;\n\t\t}\n\t\telse {\n\t\t\t$width_ratio = 1;\t\n\t\t}\n\t\tif ($height > $target_height) {\n\t\t\t$height_ratio = $target_height/$height;\n\t\t}\n\t\telse {\n\t\t\t$height_ratio = 1;\t\n\t\t}\n\t\tif ($width_ratio==1 && $height_ratio==1) return $img;\n\t\t$ratio = min($width_ratio,$height_ratio);\n\t\t$new_height = $ratio * $height;\n\t\t$new_width = $ratio * $width;\n\t\t//file_put_contents(\"1.log\",\"$new_height = $ratio m $height; $new_width = $ratio m $width;\\n\",FILE_APPEND);\n\t\t$new_img = ImageCreateTrueColor($new_width, $new_height);\n\t\tif (!@imagecopyresampled($new_img, $img, 0, 0, 0, 0, $new_width, $new_height, $width, $height)) {\n\t\t\techo \"ERROR:Could not resize image\";\n\t\t\texit(0);\n\t\t}\t\t\n\t\treturn $new_img;\n\t}",
"function _resizeImageGD1($src_file, $dest_file, $new_size, $imgobj) {\r\n if ($imgobj->_size == null) {\r\n return false;\r\n }\r\n // GD1 can only handle JPG & PNG images\r\n if ($imgobj->_type !== \"jpg\" && $imgobj->_type !== \"jpeg\" && $imgobj->_type !== \"png\") {\r\n return false;\r\n }\r\n // height/width\r\n $ratio = max($imgobj->_size[0], $imgobj->_size[1]) / $new_size;\r\n $ratio = max($ratio, 1.0);\r\n $destWidth = (int)($imgobj->_size[0] / $ratio);\r\n $destHeight = (int)($imgobj->_size[1] / $ratio);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n $src_img = imagecreatefromjpeg($src_file);\r\n } else {\r\n $src_img = imagecreatefrompng($src_file);\r\n }\r\n if (!$src_img) {\r\n return false;\r\n }\r\n $dst_img = imagecreate($destWidth, $destHeight);\r\n imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $destWidth, (int)$destHeight, $imgobj->_size[0], $imgobj->_size[1]);\r\n if ($imgobj->_type == \"jpg\" || $imgobj->_type == \"jpeg\") {\r\n imagejpeg($dst_img, $dest_file, $this->_JPEG_quality);\r\n } else {\r\n imagepng($dst_img, $dest_file);\r\n }\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n return true; \r\n }",
"function resize_image($file, $w, $h, $crop=FALSE) {\n list($width, $height) = getimagesize($file);\n $r = $w / $h;\n $rate = $width / $height;\n // if we want it cropped\n if ($crop) {\n if ($rate < $r) {\n $src_w = $width;\n $src_h = ceil($width / $r);\n $src_x = 0;\n $src_y = ceil(($height - $src_h) / 2);\n $dst_w = $w;\n $dst_h = $h;\n $dst_x = 0;\n $dst_y = 0;\n }\n else {\n $src_w = ceil($r * $height);\n $src_h = $height;\n $src_x = ceil(($width - $src_w) / 2);\n $src_y = 0;\n $dst_w = $w;\n $dst_h = $h;\n $dst_x = 0;\n $dst_y = 0;\n }\n $newwidth = $w;\n $newheight = $h;\n }\n // if we don't want it cropped\n else {\n if ($rate < $r) {\n $src_w = $width;\n $src_h = $height;\n $src_x = 0;\n $src_y = 0;\n $dst_w = $h * $rate;\n $dst_h = $h;\n $dst_x = 0;\n $dst_y = 0;\n }\n else {\n $src_w = $width;\n $src_h = $height;\n $src_x = 0;\n $src_y = 0;\n $dst_w = $w;\n $dst_h = $w / $rate;\n $dst_x = 0;\n $dst_y = 0;\n }\n $newwidth = $dst_w;\n $newheight = $dst_h;\n }\n \n $type = strtolower(substr(strrchr($file,\".\"),1));\n if($type == 'jpeg') $type = 'jpg';\n switch($type){\n case 'bmp': $src_image = @imagecreatefromwbmp($file); break;\n case 'gif': $src_image = @imagecreatefromgif($file); break;\n case 'jpg': $src_image = @imagecreatefromjpeg($file); break;\n case 'png': $src_image = @imagecreatefrompng($file); break;\n default : return \"Unsupported picture type!\";\n } \n \n if ($src_image) {\n $dst_image = imagecreatetruecolor($newwidth, $newheight);\n imagecopyresampled($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);\n return $dst_image;\n } else {\n return null;\n }\n }",
"private function resizeWithScaleExact($width, $height, $scale) {\n\t\t//$new_height = (int)($this->info['height'] * $scale);\n\t\t$new_width = $width * $scale;\n\t\t$new_height = $height * $scale;\n\t\t$xpos = 0;//(int)(($width - $new_width) / 2);\n\t\t$ypos = 0;//(int)(($height - $new_height) / 2);\n\n if (isset($this->info['mime']) && $this->info['mime'] == 'image/gif' && $this->isAnimated) {\n $this->imagick = new Imagick($this->file);\n $this->imagick = $this->imagick->coalesceImages();\n foreach ($this->imagick as $frame) {\n $frame->thumbnailImage($new_width, $new_height);\n $frame->setImagePage($new_width, $new_height, 0, 0);\n }\n } else {\n $image_old = $this->image;\n $this->image = imagecreatetruecolor($width, $height);\n $bcg = $this->backgroundColor;\n\n if (isset($this->info['mime']) && $this->info['mime'] == 'image/png') {\n imagealphablending($this->image, false);\n imagesavealpha($this->image, true);\n $background = imagecolorallocatealpha($this->image, $bcg[0], $bcg[1], $bcg[2], 127);\n imagecolortransparent($this->image, $background);\n } else {\n $background = imagecolorallocate($this->image, $bcg[0], $bcg[1], $bcg[2]);\n }\n\n imagefilledrectangle($this->image, 0, 0, $width, $height, $background);\n imagecopyresampled($this->image, $image_old, $xpos, $ypos, 0, 0, $new_width, $new_height, $this->info['width'], $this->info['height']);\n imagedestroy($image_old);\n }\n\n\t\t$this->info['width'] = $width;\n\t\t$this->info['height'] = $height;\n }",
"function resize_image($src_file, $dest_file, $new_size, $method, $thumb_use)\r\n{\r\n global $CONFIG, $ERROR;\r\n global $lang_errors;\r\n\r\n $imginfo = getimagesize($src_file);\r\n if ($imginfo == null)\r\n return false;\r\n // GD can only handle JPG & PNG images\r\n if ($imginfo[2] != GIS_JPG && $imginfo[2] != GIS_PNG && ($method == 'gd1' || $method == 'gd2')) {\r\n $ERROR = $lang_errors['gd_file_type_err'];\r\n return false;\r\n }\r\n // height/width\r\n $srcWidth = $imginfo[0];\r\n $srcHeight = $imginfo[1];\r\n if ($thumb_use == 'ht') {\r\n $ratio = $srcHeight / $new_size;\r\n } elseif ($thumb_use == 'wd') {\r\n $ratio = $srcWidth / $new_size;\r\n } else {\r\n $ratio = max($srcWidth, $srcHeight) / $new_size;\r\n }\r\n $ratio = max($ratio, 1.0);\r\n $destWidth = (int)($srcWidth / $ratio);\r\n $destHeight = (int)($srcHeight / $ratio);\r\n // Method for thumbnails creation\r\n switch ($method) {\r\n case \"im\" :\r\n if (preg_match(\"#[A-Z]:|\\\\\\\\#Ai\", __FILE__)) {\r\n // get the basedir, remove '/include'\r\n $cur_dir = substr(dirname(__FILE__), 0, -8);\r\n $src_file = '\"' . $cur_dir . '\\\\' . strtr($src_file, '/', '\\\\') . '\"';\r\n $im_dest_file = str_replace('%', '%%', ('\"' . $cur_dir . '\\\\' . strtr($dest_file, '/', '\\\\') . '\"'));\r\n } else {\r\n $src_file = escapeshellarg($src_file);\r\n $im_dest_file = str_replace('%', '%%', escapeshellarg($dest_file));\r\n }\r\n\r\n $output = array();\r\n /*\r\n * Hack for working with ImageMagick on WIndows even if IM is installed in C:\\Program Files.\r\n * By Aditya Mooley <[email protected]>\r\n */\r\n if (eregi(\"win\",$_ENV['OS'])) {\r\n $cmd = \"\\\"\".str_replace(\"\\\\\",\"/\", $CONFIG['impath']).\"convert\\\" -quality {$CONFIG['jpeg_qual']} {$CONFIG['im_options']} -geometry {$destWidth}x{$destHeight} \".str_replace(\"\\\\\",\"/\" ,$src_file ).\" \".str_replace(\"\\\\\",\"/\" ,$im_dest_file );\r\n exec (\"\\\"$cmd\\\"\", $output, $retval);\r\n } else {\r\n $cmd = \"{$CONFIG['impath']}convert -quality {$CONFIG['jpeg_qual']} {$CONFIG['im_options']} -geometry {$destWidth}x{$destHeight} $src_file $im_dest_file\";\r\n exec ($cmd, $output, $retval);\r\n }\r\n\r\n\r\n if ($retval) {\r\n $ERROR = \"Error executing ImageMagick - Return value: $retval\";\r\n if ($CONFIG['debug_mode']) {\r\n // Re-execute the command with the backtit operator in order to get all outputs\r\n // will not work is safe mode is enabled\r\n $output = `$cmd 2>&1`;\r\n $ERROR .= \"<br /><br /><div align=\\\"left\\\">Cmd line : <br /><font size=\\\"2\\\">\" . nl2br(htmlspecialchars($cmd)) . \"</font></div>\";\r\n $ERROR .= \"<br /><br /><div align=\\\"left\\\">The convert program said:<br /><font size=\\\"2\\\">\";\r\n $ERROR .= nl2br(htmlspecialchars($output));\r\n $ERROR .= \"</font></div>\";\r\n }\r\n @unlink($dest_file);\r\n return false;\r\n }\r\n break;\r\n\r\n case \"gd1\" :\r\n if (!function_exists('imagecreatefromjpeg')) {\r\n cpg_die(CRITICAL_ERROR, 'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed', __FILE__, __LINE__);\r\n }\r\n if ($imginfo[2] == GIS_JPG)\r\n $src_img = imagecreatefromjpeg($src_file);\r\n else\r\n $src_img = imagecreatefrompng($src_file);\r\n if (!$src_img) {\r\n $ERROR = $lang_errors['invalid_image'];\r\n return false;\r\n }\r\n $dst_img = imagecreate($destWidth, $destHeight);\r\n imagecopyresized($dst_img, $src_img, 0, 0, 0, 0, $destWidth, (int)$destHeight, $srcWidth, $srcHeight);\r\n imagejpeg($dst_img, $dest_file, $CONFIG['jpeg_qual']);\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n break;\r\n\r\n case \"gd2\" :\r\n if (!function_exists('imagecreatefromjpeg')) {\r\n cpg_die(CRITICAL_ERROR, 'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed', __FILE__, __LINE__);\r\n }\r\n if (!function_exists('imagecreatetruecolor')) {\r\n cpg_die(CRITICAL_ERROR, 'PHP running on your server does not support GD version 2.x, please switch to GD version 1.x on the config page', __FILE__, __LINE__);\r\n }\r\n if ($imginfo[2] == GIS_JPG)\r\n $src_img = imagecreatefromjpeg($src_file);\r\n else\r\n $src_img = imagecreatefrompng($src_file);\r\n if (!$src_img) {\r\n $ERROR = $lang_errors['invalid_image'];\r\n return false;\r\n }\r\n $dst_img = imagecreatetruecolor($destWidth, $destHeight);\r\n imagecopyresampled($dst_img, $src_img, 0, 0, 0, 0, $destWidth, (int)$destHeight, $srcWidth, $srcHeight);\r\n imagejpeg($dst_img, $dest_file, $CONFIG['jpeg_qual']);\r\n imagedestroy($src_img);\r\n imagedestroy($dst_img);\r\n break;\r\n }\r\n // Set mode of uploaded picture\r\n chmod($dest_file, octdec($CONFIG['default_file_mode']));\r\n // We check that the image is valid\r\n $imginfo = getimagesize($dest_file);\r\n if ($imginfo == null) {\r\n $ERROR = $lang_errors['resize_failed'];\r\n @unlink($dest_file);\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n}",
"function scaleByLength($size)\r\n {\r\n if ($this->img_x >= $this->img_y) {\r\n $new_x = $size;\r\n $new_y = round(($new_x / $this->img_x) * $this->img_y, 0);\r\n } else {\r\n $new_y = $size;\r\n $new_x = round(($new_y / $this->img_y) * $this->img_x, 0);\r\n }\r\n return $this->_resize($new_x, $new_y);\r\n }",
"function resizeImage($fileName,$maxWidth,$maxHight,$originalFileSufix=\"\")\n{\n $limitedext = array(\".gif\",\".jpg\",\".png\",\".jpeg\");\n\n //check the file's extension\n $ext = strrchr($fileName,'.');\n $ext = strtolower($ext);\n\n //uh-oh! the file extension is not allowed!\n if (!in_array($ext,$limitedext)) {\n exit();\n }\n\n if($ext== \".jpeg\" || $ext == \".jpg\"){\n $new_img = imagecreatefromjpeg($fileName);\n }elseif($ext == \".png\" ){\n $new_img = imagecreatefrompng($fileName);\n }elseif($ext == \".gif\"){\n $new_img = imagecreatefromgif($fileName);\n }\n\n //list the width and height and keep the height ratio.\n list($width, $height) = getimagesize($fileName);\n\n //calculate the image ratio\n $imgratio=$width/$height;\n $newwidth = $width;\n $newheight = $height;\n\n //Image format -\n if ($imgratio>1){\n if ($width>$maxWidth) {\n $newwidth = $maxWidth;\n $newheight = $maxWidth/$imgratio;\n }\n //image format |\n }else{\n if ($height>$maxHight) {\n $newheight = $maxHight;\n $newwidth = $maxHight*$imgratio;\n }\n }\n\n //function for resize image.\n $resized_img = imagecreatetruecolor($newwidth,$newheight);\n\n //the resizing is going on here!\n imagecopyresized($resized_img, $new_img, 0, 0, 0, 0, $newwidth, $newheight, $width, $height);\n\n //finally, save the image\n if ($originalFileSufix!=\"\") {\n $path_parts=pathinfo($fileName);\n rename($fileName,$path_parts[\"dirname\"].DIRECTORY_SEPARATOR.$path_parts[\"filename\"].\"_\".$originalFileSufix.\".\".$path_parts[\"extension\"]);\n }\n ImageJpeg ($resized_img,$fileName,80);\n\n ImageDestroy ($resized_img);\n ImageDestroy ($new_img);\n}",
"function do_scaled() {\n $this->layout = FALSE;\n\n $status = $this->show_scaled_image(IMAGE_RESOLUTION, 'photos');\n if (TRUE !== $status) {\n $this->message($status);\n $this->redirect('/photo/index');\n }\n }",
"function make_thumb($img_name,$filename,$new_w,$new_h)\n{\n//get image extension.\n$ext=getExtension($img_name);\n//creates the new image using the appropriate function from gd library\nif(!strcmp(\"jpg\",$ext) || !strcmp(\"jpeg\",$ext))\n$src_img=imagecreatefromjpeg($img_name);\n\nif(!strcmp(\"png\",$ext))\n$src_img=imagecreatefrompng($img_name);\n\n//gets the dimmensions of the image\n$old_x=imageSX($src_img);\n$old_y=imageSY($src_img);\n\n// next we will calculate the new dimmensions for the thumbnail image\n// the next steps will be taken:\n// 1. calculate the ratio by dividing the old dimmensions with the new ones\n// 2. if the ratio for the width is higher, the width will remain the one define in WIDTH variable\n// and the height will be calculated so the image ratio will not change\n// 3. otherwise we will use the height ratio for the image\n// as a result, only one of the dimmensions will be from the fixed ones\n$ratio1=$old_x/$new_w;\n$ratio2=$old_y/$new_h;\nif($ratio1>$ratio2) {\n$thumb_w=$new_w;\n$thumb_h=$old_y/$ratio1;\n}\nelse {\n$thumb_h=$new_h;\n$thumb_w=$old_x/$ratio2;\n}\n\n// we create a new image with the new dimmensions\n$dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);\n\n// resize the big image to the new created one\nimagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y);\n\n// output the created image to the file. Now we will have the thumbnail into the file named by $filename\nif(!strcmp(\"png\",$ext))\nimagepng($dst_img,$filename);\nelse\nimagejpeg($dst_img,$filename);\n\n//destroys source and destination images.\nimagedestroy($dst_img);\nimagedestroy($src_img);\n}",
"function img_resize( $tmpname, $size, $save_dir, $save_name )\r\n {\r\n $save_dir .= ( substr($save_dir,-1) != \"/\") ? \"/\" : \"\";\r\n $gis = GetImageSize($tmpname);\r\n $type = $gis[2];\r\n switch($type)\r\n {\r\n case \"1\": $imorig = imagecreatefromgif($tmpname); break;\r\n case \"2\": $imorig = imagecreatefromjpeg($tmpname);break;\r\n case \"3\": $imorig = imagecreatefrompng($tmpname); break;\r\n default: $imorig = imagecreatefromjpeg($tmpname);\r\n }\r\n\r\n $x = imageSX($imorig);\r\n $y = imageSY($imorig);\r\n if($gis[0] <= $size)\r\n {\r\n $av = $x;\r\n $ah = $y;\r\n }\r\n else\r\n {\r\n $yc = $y*1.3333333;\r\n $d = $x>$yc?$x:$yc;\r\n $c = $d>$size ? $size/$d : $size;\r\n $av = $x*$c; \r\n $ah = $y*$c; \r\n } \r\n $im = imagecreate($av, $ah);\r\n $im = imagecreatetruecolor($av,$ah);\r\n if (imagecopyresampled($im,$imorig , 0,0,0,0,$av,$ah,$x,$y))\r\n if (imagejpeg($im, $save_dir.$save_name))\r\n\t\t return true;\r\n else\r\n return false;\r\n }",
"public function resize(IImageInformation $src, $width, $height);",
"function cropImage($param=array())\r\n {\r\n $ret = array(\r\n 'msg' => false,\r\n 'sts' => false,\r\n );\r\n\r\n $final_size = $param['final_size'];\r\n #$filename = $final_size.'-'.$param['img_newname'];\r\n $filename = $param['img_newname'];\r\n $target_dir = $param['dest_path'];\r\n $target_name = $target_dir.$filename;\r\n $source_name = $param['img_real'];\r\n \r\n //get size from real image \r\n $size = getimagesize($source_name);\r\n $targ_w = $param['w'];\r\n $targ_h = $param['h'];\r\n\r\n //get size from ratio\r\n $final_size = explode(\"x\", $final_size);\r\n $final_w = $final_size[0];\r\n $final_h = $final_size[1];\r\n \r\n if($final_w==='auto' && $final_h==='auto'){ //detect if width and height ratio is \"auto\" then readjust width and height size\r\n $final_w = $targ_w;\r\n $final_h = $targ_h;\r\n }elseif($final_w==='auto'){ //detect if width ratio is \"auto\" then readjust width size\r\n $final_w = intval(($final_size[1] * $targ_w) / $targ_h);\r\n }elseif($final_h==='auto'){ //detect if height ratio is \"auto\" then readjust height size\r\n $final_h = intval(($final_size[0] * $targ_h) / $targ_w);\r\n }\r\n //end\r\n \r\n \r\n $jpeg_quality = 90;\r\n $img_r = imagecreatefromjpeg($source_name);\r\n $dst_r = ImageCreateTrueColor( $final_w, $final_h );\r\n \r\n imagecopyresized(\r\n $dst_r, $img_r, \r\n 0,0, \r\n $param['x'],$param['y'], \r\n $final_w,$final_h,\r\n $param['w'],$param['h']\r\n );\r\n \r\n imagejpeg($dst_r,$target_name,$jpeg_quality);\r\n #$this->send_to_server( array($target_name) );\r\n $url_target_name = str_replace('/data/shopkl/_assets/', 'http://klimg.com/kapanlagi.com/klshop/', $target_name);\r\n \r\n\t\t\t\r\n //find image parent url and dir path from config\r\n //reset($this->imgsize['article']['size']);\r\n //$first_key = key($this->imgsize['article']['size']);\r\n //end find\r\n $ret['sts'] = true;\r\n $ret['filename'] = $filename;\r\n $ret['msg'] = '<div class=\"alert alert-success\">Image is cropped and saved in <a href=\"'. $url_target_name .'?'.date('his').'\" target=\"_blank\">'.$target_name.' !</a></div>';\r\n \r\n return $ret;\r\n }",
"function resizeImage($CurWidth,$CurHeight,$MaxSize,$DestFolder,$SrcImage,$Quality,$ImageType)\r\n{\r\n\t//Check Image size is not 0\r\n\tif($CurWidth <= 0 || $CurHeight <= 0) \r\n\t{\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t//Construct a proportional size of new image\r\n\t$ImageScale \t= min($MaxSize/$CurWidth, $MaxSize/$CurHeight); \r\n\t$NewWidth \t\t\t= ceil($ImageScale*$CurWidth);\r\n\t$NewHeight \t\t\t= ceil($ImageScale*$CurHeight);\r\n\t$NewCanves \t\t\t= imagecreatetruecolor($NewWidth, $NewHeight);\r\n\t\r\n\t// Resize Image\r\n\tif(imagecopyresampled($NewCanves, $SrcImage,0, 0, 0, 0, $NewWidth, $NewHeight, $CurWidth, $CurHeight))\r\n\t{\r\n\t\tswitch(strtolower($ImageType))\r\n\t\t{\r\n\t\t\tcase 'image/png':\r\n\t\t\t\timagepng($NewCanves,$DestFolder);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'image/gif':\r\n\t\t\t\timagegif($NewCanves,$DestFolder);\r\n\t\t\t\tbreak;\t\t\t\r\n\t\t\tcase 'image/jpeg':\r\n\t\t\tcase 'image/pjpeg':\r\n\t\t\t\timagejpeg($NewCanves,$DestFolder,$Quality);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t//Destroy image, frees memory\t\r\n\tif(is_resource($NewCanves)) {imagedestroy($NewCanves);} \r\n\treturn true;\r\n\t}\r\n\r\n}",
"function resizeToWidth($width)\n {\n //obtine ratio dividiendo ancho dada entre el ancho actual de la imagen.\n $ratio = $width / $this->getWidth();\n //obtiene altura con la altura actual de la imagen por el ratio.\n $height = $this->getheight() * $ratio;\n //redimensiona imagen.\n $this->resize($width,$height);\n }",
"function resizeImage($old_image_path, $new_image_path, $max_width, $max_height) {\r\n \r\n // Get image type\r\n $image_info = getimagesize($old_image_path);\r\n $image_type = $image_info[2];\r\n \r\n // Set up the function names\r\n switch ($image_type) {\r\n case IMAGETYPE_JPEG:\r\n $image_from_file = 'imagecreatefromjpeg';\r\n $image_to_file = 'imagejpeg';\r\n break;\r\n case IMAGETYPE_GIF:\r\n $image_from_file = 'imagecreatefromgif';\r\n $image_to_file = 'imagegif';\r\n break;\r\n case IMAGETYPE_PNG:\r\n $image_from_file = 'imagecreatefrompng';\r\n $image_to_file = 'imagepng';\r\n break;\r\n default:\r\n return;\r\n } // ends the swith\r\n \r\n // Get the old image and its height and width\r\n $old_image = $image_from_file($old_image_path);\r\n $old_width = imagesx($old_image);\r\n $old_height = imagesy($old_image);\r\n \r\n // Calculate height and width ratios\r\n $width_ratio = $old_width / $max_width;\r\n $height_ratio = $old_height / $max_height;\r\n \r\n // If image is larger than specified ratio, create the new image\r\n if ($width_ratio > 1 || $height_ratio > 1) {\r\n \r\n // Calculate height and width for the new image\r\n $ratio = max($width_ratio, $height_ratio);\r\n $new_height = round($old_height / $ratio);\r\n $new_width = round($old_width / $ratio);\r\n \r\n // Create the new image\r\n $new_image = imagecreatetruecolor($new_width, $new_height);\r\n \r\n // Set transparency according to image type\r\n if ($image_type == IMAGETYPE_GIF) {\r\n $alpha = imagecolorallocatealpha($new_image, 0, 0, 0, 127);\r\n imagecolortransparent($new_image, $alpha);\r\n }\r\n \r\n if ($image_type == IMAGETYPE_PNG || $image_type == IMAGETYPE_GIF) {\r\n imagealphablending($new_image, false);\r\n imagesavealpha($new_image, true);\r\n }\r\n \r\n // Copy old image to new image - this resizes the image\r\n $new_x = 0;\r\n $new_y = 0;\r\n $old_x = 0;\r\n $old_y = 0;\r\n imagecopyresampled($new_image, $old_image, $new_x, $new_y, $old_x, $old_y, $new_width, $new_height, $old_width, $old_height);\r\n \r\n // Write the new image to a new file\r\n $image_to_file($new_image, $new_image_path);\r\n // Free any memory associated with the new image\r\n imagedestroy($new_image);\r\n } else {\r\n // Write the old image to a new file\r\n $image_to_file($old_image, $new_image_path);\r\n }\r\n // Free any memory associated with the old image\r\n imagedestroy($old_image);\r\n }",
"public function CalcWidthHeight()\n {\n list($this->width, $this->height) = $this->imgInfo;\n\n $aspectRatio = $this->width / $this->height;\n\n if($this->cropToFit && $this->newWidth && $this->newHeight) {\n $targetRatio = $this->newWidth / $this->newHeight;\n $this->cropWidth = $targetRatio > $aspectRatio ? $this->width : round($this->height * $targetRatio);\n $this->cropHeight = $targetRatio > $aspectRatio ? round($this->width / $targetRatio) : $this->height;\n if($this->verbose) { self::verbose(\"Crop to fit into box of {$this->newWidth}x{$this->newHeight}. Cropping dimensions: {$this->cropWidth}x{$this->cropHeight}.\"); }\n }\n else if($this->newWidth && !$this->newHeight) {\n $this->newHeight = round($this->newWidth / $aspectRatio);\n if($this->verbose) { self::verbose(\"New width is known {$this->newWidth}, height is calculated to {$this->newHeight}.\"); }\n }\n else if(!$this->newWidth && $this->newHeight) {\n $this->newWidth = round($this->newHeight * $aspectRatio);\n if($this->verbose) { self::verbose(\"New height is known {$this->newHeight}, width is calculated to {$this->newWidth}.\"); }\n }\n else if($this->newWidth && $this->newHeight) {\n $ratioWidth = $this->width / $this->newWidth;\n $ratioHeight = $this->height / $this->newHeight;\n $ratio = ($ratioWidth > $ratioHeight) ? $ratioWidth : $ratioHeight;\n $this->newWidth = round($this->width / $ratio);\n $this->newHeight = round($this->height / $ratio);\n if($this->verbose) { self::verbose(\"New width & height is requested, keeping aspect ratio results in {$this->newWidth}x{$this->newHeight}.\"); }\n }\n else {\n $this->newWidth = $this->width;\n $this->newHeight = $this->height;\n if($this->verbose) { self::verbose(\"Keeping original width & heigth.\"); }\n }\n }",
"public function autoScale($img, $size) {\n\t// NOT YET IMPLEMENTED.\n}",
"function image_scale_im_obj(\\Imagick $im, $aspect, $width, $strategy)\n{\n\n $height = round(($width/$aspect['width'])*$aspect['height']);\n\n $source_w = $im->getImageWidth();\n $source_h = $im->getImageHeight();\n $source_a = $source_h / $source_w;\n $target_a = $aspect['height'] / $aspect['width'];\n\n switch ($strategy) {\n case 'resize':\n $im->scaleImage($width, $height);\n break;\n case 'crop-top':\n if ($target_a < $source_a) {\n $im->scaleImage($width, 0);\n $im->cropImage($width, $height, 0, 0);\n } else {\n $im->scaleImage(0, $height);\n $im->cropImage($width, $height, 0, 0);\n }\n break;\n case 'crop-bottom':\n if ($target_a < $source_a) {\n $im->scaleImage($width, 0);\n $im->cropImage($width, $height, 0, $im->getImageHeight() - $height);\n } else {\n $im->scaleImage(0, $height);\n $im->cropImage($width, $height, $im->getImageWidth() - $width, 0);\n }\n break; \n case 'crop':\n default:\n $im->cropThumbnailImage($width, $height);\n break; \n }\n $im->setImageFormat('jpeg');\n $im->gaussianBlurImage(0.05, 0.5);\n $im->setImageCompressionQuality(75);\n $im->setInterlaceScheme(\\Imagick::INTERLACE_PLANE);\n $im->stripImage();\n return $im;\n}",
"function processImage($dir, $filename)\n{\n // Set up the variables\n $dir = $dir . '/';\n\n // Set up the image path\n $image_path = $dir . $filename;\n\n // Set up the thumbnail image path\n $image_path_tn = $dir . makeThumbnailName($filename);\n\n // Create a thumbnail image that's a maximum of 200 pixels square\n resizeImage($image_path, $image_path_tn, 200, 200);\n\n // Resize original to a maximum of 500 pixels square\n resizeImage($image_path, $image_path, 500, 500);\n}",
"private function intern_resize($newWidth, $newHeight, $keepRatio = true)\n\t{\n\t\t$this->newOrientation = ($newWidth > $newHeight) ? EImageProcessor::LANDSCAPE : EImageProcessor::PORTRAIT;\n\t\tif ($keepRatio !== true)\n\t\t\t$this->newImage = imagescale($this->srcImage, $newWidth, $newHeight);\n\t\telse {\n\t\t\t/*\n\t\t * Crop-to-fit PHP-GD\n\t\t * http://salman-w.blogspot.com/2009/04/crop-to-fit-image-using-aspphp.html\n\t\t *\n\t\t * Resize and center crop an arbitrary size image to fixed width and height\n\t\t * e.g. convert a large portrait/landscape image to a small square thumbnail\n\t\t *\n\t\t * Modified by Fry\n\t\t\t */\n\t\t\t$desired_aspect_ratio = $newWidth / $newHeight;\n\n\t\t\tif ($this->srcAspectRatio < $desired_aspect_ratio) {\n\t\t\t\t/*\n\t\t\t\t * Triggered when source image is taller\n\t\t\t\t */\n\t\t\t\t$temp_height = $newHeight;\n\t\t\t\t$temp_width = ( int )($newHeight * $this->srcAspectRatio);\n\t\t\t} else {\n\t\t\t\t/*\n\t\t\t\t * Triggered otherwise (i.e. source image is similar or wider)\n\t\t\t\t */\n\t\t\t\t$temp_width = $newWidth;\n\t\t\t\t$temp_height = ( int )($newWidth / $this->srcAspectRatio);\n\t\t\t}\n\n\t\t\t/*\n\t\t\t * Resize the image into a temporary GD image\n\t\t\t */\n\n\t\t\t$tempImage = imagecreatetruecolor($temp_width, $temp_height);\n\t\t\t$transparent = imagecolortransparent($tempImage, imagecolortransparent ($this->srcImage));\n\t\t\timagefill($tempImage, 0, 0, $transparent);\n\t\t\timagecopyresampled(\n\t\t\t\t$tempImage,\n\t\t\t\t$this->srcImage,\n\t\t\t\t0, 0,\n\t\t\t\t0, 0,\n\t\t\t\t$temp_width, $temp_height,\n\t\t\t\t$this->srcWidth, $this->srcHeight\n\t\t\t);\n\n\t\t\t$x0 = ($newWidth - $temp_width ) / 2;\n\t\t\t$y0 = ($newHeight - $temp_height) / 2;\n\n\t\t\t$this->newImage = imagecreatetruecolor($newWidth, $newHeight);\n\t\t\t$transparent = imagecolortransparent($this->newImage, imagecolorallocatealpha($this->newImage, 255, 235, 215, 127));\n\t\t\timagefill($this->newImage, 0, 0, $transparent);\n\t\t\timagecopyresampled(\n\t\t\t\t$this->newImage,\t\t\t$tempImage,\n\t\t\t\t$x0, $y0,\t\t\t\t\t0, 0,\n\t\t\t\t$temp_width, $temp_height, \t$temp_width, $temp_height\n\t\t\t);\n\t\t\timagedestroy($tempImage);\n\t\t}\n\t}",
"function resize($image,$x,$y=NULL,$wm=NULL,$wml='br'){\n if(!file_exists($image)){\n return false;\n }\n $images = array();\n if($wm !== '' && $wm !== NULL && file_exists($wm)){\n $images['wmimg'] = $wm;\n }\n $images['img'] = $image;\n foreach($images as $key=>$value){\n $type = substr($value,strrpos($value,'.'));\n if(stristr($type,'i')){\n $$key = imagecreatefromgif($value);\n }\n if(stristr($type,'j')){\n $$key = imagecreatefromjpeg($value);\n }\n if(stristr($type,'n')){\n $$key = imagecreatefrompng($value);\n }\n }\n $size = array();\n if($y === '' || $y === NULL){\n $size['x'] = imageSX($img);\n $size['y'] = imageSY($img);\n if($size['x'] >= $size['y']){\n $size['dest_x'] = $x;\n $size['dest_y'] = ceil($size['y'] * ($x / $size['x']));\n }else{\n $size['dest_y'] = $x;\n $size['dest_x'] = ceil($size['x'] * ($x / $size['y']));\n }\n $dest = imageCreatetruecolor($size['dest_x'],$size['dest_y']);\n }else{\n $dest = imagecreatetrueColor($x,$y);\n $size['x'] = imageSX($img);\n $size['y'] = imageSY($img);\n $size['dest_x'] = $x;\n $size['dest_y'] = $y;\n }\n imagecopyresized($dest, $img, 0, 0, 0, 0, $size['dest_x'], $size['dest_y'], $size['x'], $size['y']);\n if(isset($wmimg)){\n $size['wmx'] = imageSX($wmimg);\n $size['wmy'] = imageSY($wmimg);\n $size['wmh'] = strtolower($wml{0}) === 'b' ? ($size['dest_y'] - $size['wmy'] - 0) : 0;\n $size['wmw'] = strtolower($wml{1}) === 'r' ? ($size['dest_x'] - $size['wmx'] - 0) : 0;\n imagecopy($dest, $wmimg, $size['wmw'], $size['wmh'], 0, 0, $size['wmx'], $size['wmy']);\n imagedestroy($wmimg);\n }\n imagedestroy($img);\n return $dest;\n }",
"public function resize($width = NULL, $height = NULL, $master = NULL)\n {\n if ($master === NULL)\n {\n // Choose the master dimension automatically\n $master = Image::AUTO;\n }\n // Image::WIDTH and Image::HEIGHT depricated. You can use it in old projects,\n // but in new you must pass empty value for non-master dimension\n elseif ($master == Image::WIDTH AND ! empty($width))\n {\n $master = Image::AUTO;\n\n // Set empty height for backvard compatibility\n $height = NULL;\n }\n elseif ($master == Image::HEIGHT AND ! empty($height))\n {\n $master = Image::AUTO;\n\n // Set empty width for backvard compatibility\n $width = NULL;\n }\n\n if (empty($width))\n {\n if ($master === Image::NONE)\n {\n // Use the current width\n $width = $this->width;\n }\n else\n {\n // If width not set, master will be height\n $master = Image::HEIGHT;\n }\n }\n\n if (empty($height))\n {\n if ($master === Image::NONE)\n {\n // Use the current height\n $height = $this->height;\n }\n else\n {\n // If height not set, master will be width\n $master = Image::WIDTH;\n }\n }\n\n switch ($master)\n {\n case Image::AUTO:\n // Choose direction with the greatest reduction ratio\n $master = ($this->width / $width) > ($this->height / $height) ? Image::WIDTH : Image::HEIGHT;\n break;\n case Image::INVERSE:\n // Choose direction with the minimum reduction ratio\n $master = ($this->width / $width) > ($this->height / $height) ? Image::HEIGHT : Image::WIDTH;\n break;\n }\n\n switch ($master)\n {\n case Image::WIDTH:\n // Recalculate the height based on the width proportions\n $height = $this->height * $width / $this->width;\n break;\n case Image::HEIGHT:\n // Recalculate the width based on the height proportions\n $width = $this->width * $height / $this->height;\n break;\n }\n\n // Convert the width and height to integers\n $width = round($width);\n $height = round($height);\n\n $this->_do_resize($width, $height);\n\n return $this;\n }",
"function resize_crop_image($max_width, $max_height, $source_file, $dst_dir, $quality=80){\r\n $imgsize = getimagesize($source_file);\r\n $width = $imgsize[0];\r\n $height = $imgsize[1];\r\n $mime = $imgsize['mime'];\r\n\r\n switch($mime){\r\n case 'image/gif':\r\n $image_create = \"imagecreatefromgif\";\r\n $image = \"imagegif\";\r\n break;\r\n\r\n case 'image/png':\r\n $image_create = \"imagecreatefrompng\";\r\n $image = \"imagepng\";\r\n //$quality = 7;\r\n break;\r\n\r\n case 'image/jpeg':\r\n $image_create = \"imagecreatefromjpeg\";\r\n $image = \"imagejpeg\";\r\n break;\r\n\r\n default:\r\n return false;\r\n break;\r\n }\r\n\r\n $dst_img = imagecreatetruecolor($max_width, $max_height);\r\n $src_img = $image_create($source_file);\r\n\r\n $width_new = $height * $max_width / $max_height;\r\n $height_new = $width * $max_height / $max_width;\r\n //if the new width is greater than the actual width of the image, then the height is too large and the rest cut off, or vice versa\r\n if($width_new > $width){\r\n //cut point by height\r\n $h_point = (($height - $height_new) / 2);\r\n //copy image\r\n imagecopyresampled($dst_img, $src_img, 0, 0, 0, $h_point, $max_width, $max_height, $width, $height_new);\r\n }else{\r\n //cut point by width\r\n $w_point = (($width - $width_new) / 2);\r\n imagecopyresampled($dst_img, $src_img, 0, 0, $w_point, 0, $max_width, $max_height, $width_new, $height);\r\n }\r\n\r\n //$image($dst_img, $dst_dir, $quality);\r\n imagejpeg($dst_img, $dst_dir, $quality);\r\n\r\n if($dst_img)imagedestroy($dst_img);\r\n if($src_img)imagedestroy($src_img);\r\n}",
"function resize_img($dir_in, $dir_out, $imedat='defaultname.jpg', $max=500,$new) {\r\n\r\n $img = $dir_in . '/' . $imedat;\r\n $extension = array_pop(explode('.', $imedat));\r\n $fileExt = strtolower(end(explode('.',$imedat)));\r\n $imedat = $new.$fileExt;\r\n switch ($extension){\r\n \r\n case 'jpg':\r\n case 'jpeg':\r\n $image = ImageCreateFromJPEG($img);\r\n break;\r\n \r\n case 'png':\r\n $image = ImageCreateFromPNG($img);\r\n break;\r\n \r\n default:\r\n $image = false;\r\n }\r\n\r\n\r\nif(!$image){\r\n // not valid img stop processing\r\n return false; \r\n}\r\n\r\n $vis = imagesy($image);\r\n $sir = imagesx($image);\r\n\r\n if(($vis < $max) && ($sir < $max)) {\r\n $nvis=$vis; $nsir=$sir;\r\n } else {\r\n if($vis > $sir) { $nvis=$max; $nsir=($sir*$max)/$vis;}\r\n elseif($vis < $sir) { $nvis=($max*$vis)/$sir; $nsir=$max;}\r\n else { $nvis=$max; $nsir=$max;}\r\n }\r\n\r\n $out = ImageCreateTrueColor($nsir,$nvis);\r\n ImageCopyResampled($out, $image, 0, 0, 0, 0, $nsir, $nvis, $sir, $vis);\r\n\r\n switch ($extension){\r\n \r\n case 'jpg':\r\n case 'jpeg':\r\n imageinterlace($out ,1);\r\n ImageJPEG($out, $dir_out . '/' . $imedat, 75);\r\n break;\r\n \r\n case 'png':\r\n ImagePNG($out, $dir_out . '/' . $imedat);\r\n break;\r\n \r\n default:\r\n $out = false;\r\n }\r\n\r\n if(!$out){\r\n return false;\r\n }\r\n \r\nImageDestroy($image);\r\nImageDestroy($out);\r\n\r\nreturn true;\r\n}",
"function resizeSaveImage($filename, $destinationFile, $newWidth){\n\t\t \n\t\t list($width, $height) = getimagesize($filename);\n\t\t if($width > $newWidth){\n\t\t\t\t$percent = $newWidth / $width;\n\t\t\t\t$newHeight = $height * $percent;\n\t\t\t\t\n\t\t\t\t// Load\n\t\t\t\t$resizedImage = imagecreatetruecolor($newWidth, $newHeight);\n\t\t\t\t$source = imagecreatefromjpeg($filename);\n\t\t\t\t\n\t\t\t\t// Resize\n\t\t\t\timagecopyresized($resizedImage, $source, 0, 0, 0, 0, $newWidth, $newHeight, $width, $height);\n\t\t\t\t\n\t\t\t\t// Output\n\t\t\t\timagejpeg($resizedImage, $destinationFile, 100 );\n\t\t\t\t\n\t\t\t\t//memory clean up.\n\t\t\t\timagedestroy($source);\n\t\t\t\timagedestroy($resizedImage);\n\t\t }\n\t }",
"function _resizeImageNETPBM($src_file, $des_file, $new_size, $imgobj) {\r\n if ($imgobj->_size == null) {\r\n return false;\r\n }\r\n // height/width\r\n $ratio = max($imgobj->_size[0], $imgobj->_size[1]) / $new_size;\r\n $ratio = max($ratio, 1.0);\r\n $destWidth = (int)($imgobj->_size[0] / $ratio);\r\n $destHeight = (int)($imgobj->_size[1] / $ratio);\r\n if (eregi(\"\\.png\", $imgobj->_filename)) {\r\n $cmd = $this->_NETPBM_path . \"pngtopnm $src_file | \" . $this->_NETPBM_path . \"pnmscale -xysize $destWidth $destHeight | \" . $this->_NETPBM_path . \"pnmtopng > $des_file\" ; \r\n } elseif (eregi(\"\\.(jpg|jpeg)\", $imgobj->_filename)) {\r\n $cmd = $this->_NETPBM_path . \"jpegtopnm $src_file | \" . $this->_NETPBM_path . \"pnmscale -xysize $destWidth $destHeight | \" . $this->_NETPBM_path . \"ppmtojpeg -quality=\" . $this->_JPEG_quality . \" > $des_file\" ;\r\n } elseif (eregi(\"\\.gif\", $imgobj->_filename)) {\r\n $cmd = $this->_NETPBM_path . \"giftopnm $src_file | \" . $this->_NETPBM_path . \"pnmscale -xysize $destWidth $destHeight | \" . $this->_NETPBM_path . \"ppmquant 256 | \" . $this->_NETPBM_path . \"ppmtogif > $des_file\" ; \r\n } else {\r\n return false;\r\n }\r\n $output = $retval = null;\r\n exec($cmd, $output, $retval);\r\n if ($retval) {\r\n return false;\r\n } else {\r\n return true;\r\n }\r\n }",
"function image_auto_resize($file_name){\t\n\t\t$config['image_library'] = 'gd2'; \n\t\t$config['source_image'] = './assets/img/profiles/'.$file_name; \n $config['create_thumb'] = FALSE; \n $config['maintain_ratio'] = FALSE; \n $config['quality'] = '60%'; \n $config['width'] = 250; \n $config['height'] = 250; \n $config['new_image'] = './assets/img/profiles/'.$file_name; \n $this->load->library('image_lib', $config); \n\t\t$this->image_lib->resize();\n\t\t$this->image_lib->clear();\n\t}",
"function resizeThumbnailImage($thumb_image_name, $image, $width, $height, $start_width, $start_height, $scale){\n\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t$imageType = image_type_to_mime_type($imageType);\n\t\n\t$newImageWidth = ceil($width * $scale);\n\t$newImageHeight = ceil($height * $scale);\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t\t\t$source=imagecreatefromgif($image); \n\t\t\tbreak;\n\t case \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t\t\t$source=imagecreatefromjpeg($image); \n\t\t\tbreak;\n\t case \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\t$source=imagecreatefrompng($image); \n\t\t\tbreak;\n \t}\n\timagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);\n\tswitch($imageType) {\n\t\tcase \"image/gif\":\n\t \t\timagegif($newImage,$thumb_image_name); \n\t\t\tbreak;\n \tcase \"image/pjpeg\":\n\t\tcase \"image/jpeg\":\n\t\tcase \"image/jpg\":\n\t \t\timagejpeg($newImage,$thumb_image_name,90); \n\t\t\tbreak;\n\t\tcase \"image/png\":\n\t\tcase \"image/x-png\":\n\t\t\timagepng($newImage,$thumb_image_name); \n\t\t\tbreak;\n }\n\tchmod($thumb_image_name, 0777);\n\treturn $thumb_image_name;\n}",
"function resizeImage($old_image_path, $new_image_path, $max_width, $max_height)\n{\n\n // Get image type\n $image_info = getimagesize($old_image_path);\n $image_type = $image_info[2];\n\n // Set up the function names\n switch ($image_type) {\n case IMAGETYPE_JPEG:\n $image_from_file = 'imagecreatefromjpeg';\n $image_to_file = 'imagejpeg';\n break;\n case IMAGETYPE_GIF:\n $image_from_file = 'imagecreatefromgif';\n $image_to_file = 'imagegif';\n break;\n case IMAGETYPE_PNG:\n $image_from_file = 'imagecreatefrompng';\n $image_to_file = 'imagepng';\n break;\n default:\n return;\n } // ends the swith\n\n // Get the old image and its height and width\n $old_image = $image_from_file($old_image_path);\n $old_width = imagesx($old_image);\n $old_height = imagesy($old_image);\n\n // Calculate height and width ratios\n $width_ratio = $old_width / $max_width;\n $height_ratio = $old_height / $max_height;\n\n // If image is larger than specified ratio, create the new image\n if ($width_ratio > 1 || $height_ratio > 1) {\n\n // Calculate height and width for the new image\n $ratio = max($width_ratio, $height_ratio);\n $new_height = round($old_height / $ratio);\n $new_width = round($old_width / $ratio);\n\n // Create the new image\n $new_image = imagecreatetruecolor($new_width, $new_height);\n\n // Set transparency according to image type\n if ($image_type == IMAGETYPE_GIF) {\n $alpha = imagecolorallocatealpha($new_image, 0, 0, 0, 127);\n imagecolortransparent($new_image, $alpha);\n }\n\n if ($image_type == IMAGETYPE_PNG || $image_type == IMAGETYPE_GIF) {\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n }\n\n // Copy old image to new image - this resizes the image\n $new_x = 0;\n $new_y = 0;\n $old_x = 0;\n $old_y = 0;\n imagecopyresampled($new_image, $old_image, $new_x, $new_y, $old_x, $old_y, $new_width, $new_height, $old_width, $old_height);\n\n // Write the new image to a new file\n $image_to_file($new_image, $new_image_path);\n // Free any memory associated with the new image\n imagedestroy($new_image);\n } else {\n // Write the old image to a new file\n $image_to_file($old_image, $new_image_path);\n }\n // Free any memory associated with the old image\n imagedestroy($old_image);\n}",
"function resizeThumbnailImage($thumb_image_name, $image, $width, $height, $start_width, $start_height, $scale){\n\t\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t\t$imageType = image_type_to_mime_type($imageType);\n\t\t\n\t\t$newImageWidth = ceil($width * $scale);\n\t\t$newImageHeight = ceil($height * $scale);\n\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\tswitch($imageType) {\n\t\t\tcase \"image/gif\":\n\t\t\t\t$source=imagecreatefromgif($image); \n\t\t\t\tbreak;\n\t\t\tcase \"image/pjpeg\":\n\t\t\tcase \"image/jpeg\":\n\t\t\tcase \"image/jpg\":\n\t\t\t\t$source=imagecreatefromjpeg($image); \n\t\t\t\tbreak;\n\t\t\tcase \"image/png\":\n\t\t\tcase \"image/x-png\":\n\t\t\t\t$source=imagecreatefrompng($image); \n\t\t\t\tbreak;\n\t\t}\n\t\timagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);\n\t\tswitch($imageType) {\n\t\t\tcase \"image/gif\":\n\t\t\t\timagegif($newImage,$thumb_image_name); \n\t\t\t\tbreak;\n\t\t\tcase \"image/pjpeg\":\n\t\t\tcase \"image/jpeg\":\n\t\t\tcase \"image/jpg\":\n\t\t\t\timagejpeg($newImage,$thumb_image_name,90); \n\t\t\t\tbreak;\n\t\t\tcase \"image/png\":\n\t\t\tcase \"image/x-png\":\n\t\t\t\timagepng($newImage,$thumb_image_name); \n\t\t\t\tbreak;\n\t\t}\n\t\tchmod($thumb_image_name, 0777);\n\t\treturn $thumb_image_name;\n\t}",
"function aurum_woocommerce_3_3_transfer_image_sizes() {\n\t\t$do_resize = false;\n\t\t\n\t\t// WooCommerce Thumbnail\n\t\tif ( ( $shop_catalog_image_size = get_theme_mod( 'shop_catalog_image_size' ) ) ) {\n\t\t\t\n\t\t\t// {width}x{height} format\n\t\t\tif ( preg_match( '#^(?<width>[0-9]+)x(?<height>[0-9]+)(x(?<cropped>0|1))?$#', $shop_catalog_image_size, $shop_catalog_image_size_matches ) ) {\n\t\t\t\t$width = $shop_catalog_image_size_matches['width'];\n\t\t\t\t$height = $shop_catalog_image_size_matches['height'];\n\t\t\t\t$cropping = ! isset( $shop_catalog_image_size_matches['cropped'] ) || $shop_catalog_image_size_matches['cropped'];\n\t\t\t\t\n\t\t\t\t$ratio = _get_aspect_ratio( $width, $height );\n\t\t\t\t\n\t\t\t\tupdate_option( 'woocommerce_thumbnail_cropping', $cropping ? 'custom' : 'uncropped' );\n\t\t\t\tupdate_option( 'woocommerce_thumbnail_cropping_custom_width', $ratio[0] );\n\t\t\t\tupdate_option( 'woocommerce_thumbnail_cropping_custom_height', $ratio[1] );\n\t\t\t\t\n\t\t\t\t$do_resize = true;\n\t\t\t}\n\t\t\t// Crop width only\n\t\t\telse if( is_numeric( $shop_catalog_image_size ) ) {\n\t\t\t\tupdate_option( 'woocommerce_thumbnail_cropping', 'uncropped' );\n\t\t\t\tupdate_option( 'woocommerce_thumbnail_cropping_custom_width', $shop_catalog_image_size );\n\t\t\t\t\n\t\t\t\t$do_resize = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Single image\n\t\tif ( ( $shop_single_image_size = get_theme_mod( 'shop_single_image_size' ) ) ) {\n\t\t\t\n\t\t\tif ( preg_match( '#^(?<width>[0-9]+)(x(?<height>[0-9]+))?(x(?<cropped>0|1))?$#', $shop_single_image_size, $shop_single_image_size_matches ) ) {\n\t\t\t\tupdate_option( 'woocommerce_single_image_width', $shop_single_image_size_matches['width'] );\n\t\t\t\t\n\t\t\t\t$do_resize = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Request image regeneration\n\t\tif ( $do_resize && class_exists( 'WC_Regenerate_Images' ) ) {\n\t\t\tWC_Regenerate_Images::queue_image_regeneration();\n\t\t}\n\t\t\n\t\t// Lightbox has moved\n\t\tset_theme_mod( 'shop_single_lightbox', ! get_theme_mod( 'shop_single_lightbox_disable', false ) );\n\t\t\n\t\t\n\t\t// WooCommerce columns\n\t\t$shop_product_columns = get_data( 'shop_product_columns' );\n\t\t\n\t\tupdate_option( 'woocommerce_catalog_columns', aurum_get_number_from_word( 'decide' == $shop_product_columns ? 4 : $shop_product_columns ) );\n\t\t\n\t\tif ( preg_match( '#[0-9]+#', get_data( 'shop_products_per_page' ), $matches ) ) {\n\t\t\tupdate_option( 'woocommerce_catalog_rows', $matches[0] );\n\t\t}\n\t\t\n\t\t// Run this once\n\t\tupdate_option( 'aurum_woocommerce_3_3_transfer_image_sizes', true );\n\t}",
"function cilikke($src, $dest, $new_width) {\r\n\t$info = getimagesize($src);\r\n\t$mime = $info[\"mime\"];\r\n\tif( $mime == 'image/jpeg' ) $source_image = imagecreatefromjpeg($src);\r\n\telseif( $mime == 'image/png' ) $source_image = imagecreatefrompng($src);\r\n\t$width = imagesx($source_image);\r\n\t$height = imagesy($source_image);\r\n\t$new_height = floor($height * ($new_width / $width));\r\n\tif($new_width < $width && $new_height < $height)\r\n\t{\r\n\t\t$virtual_image = imagecreatetruecolor($new_width, $new_height);\t\r\n\t\timagecopyresampled($virtual_image, $source_image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);\r\n\t\timagejpeg($virtual_image, $dest);\r\n\t}else\r\n\t\tcopy($src, $dest);\r\n}",
"function normal_resize_image($source, $destination, $image_type, $max_size, $image_width, $image_height, $quality){\n\n\tif($image_width <= 0 || $image_height <= 0){return false;} //return false if nothing to resize\n\n\t//do not resize if image is smaller than max size\n\tif($image_width <= $max_size && $image_height <= $max_size){\n\t\tif(save_image($source, $destination, $image_type, $quality)){\n\t\t\treturn true;\n\t\t}\n\t}\n\n\t//Construct a proportional size of new image\n\t$image_scale\t= min($max_size/$image_width, $max_size/$image_height);\n\t$new_width\t\t= ceil($image_scale * $image_width);\n\t$new_height\t\t= ceil($image_scale * $image_height);\n\n\t$new_canvas\t\t= imagecreatetruecolor( $new_width, $new_height ); //Create a new true color image\n\n\t//Copy and resize part of an image with resampling\n\tif(imagecopyresampled($new_canvas, $source, 0, 0, 0, 0, $new_width, $new_height, $image_width, $image_height)){\n\t\tsave_image($new_canvas, $destination, $image_type, $quality); //save resized image\n\t}\n\n\treturn true;\n}",
"function resize_square($size){\n\n //container for new image\n $new_image = imagecreatetruecolor($size, $size);\n\n\n if($this->width > $this->height){\n $this->resize_by_height($size);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n imagecopy($new_image, $this->image, 0, 0, ($this->get_width() - $size) / 2, 0, $size, $size);\n }else{\n $this->resize_by_width($size);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n imagecopy($new_image, $this->image, 0, 0, 0, ($this->get_height() - $size) / 2, $size, $size);\n }\n\n $this->image = $new_image;\n\n //reset sizes\n $this->width = $size;\n $this->height = $size;\n\n return true;\n }",
"function resizeImage($image,$width,$height) {\n\t$newImageWidth = $width;\n\t$newImageHeight = $height;\n\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t$source = imagecreatefromjpeg($image);\n\timagecopyresampled($newImage,$source,0,0,0,0,$newImageWidth,$newImageHeight,$width,$height);\n\timagejpeg($newImage,$image,90);\n\tchmod($image, 0777);\n\treturn $image;\n}",
"private function doImageResize($img){\n\t\t//Determine the new dimensions\n\t\t$d=$this->getNewDims($img);\n\t\t\n\t\t//Determine which function to use\n\t\t$funcs=$this->getImageFunctions($img);\n\t\t\n\t\t//Determine the image type\n\t\t$src_img=$funcs[0]($img);\n\t\t\n\t\t//Determine the new image size\n\t\t$new_img=imagecreatetruecolor($d[0], $d[1]);\n\t\t\n\t\tif(imagecopyresampled\n\t\t\t\t($new_img, $src_img, 0, 0, 0, 0, $d[0],$d[1] , $d[2], $d[3])){\n\t\t\timagedestroy($src_img);\n\t\t\t//check if the new image has the same file type as the original one\n\t\t\tif($new_img && $funcs[1]($new_img,$img)){\n\t\t\t\timagedestroy($new_img);\n\t\t\t}\n\t\t\telse{\n\t\t\t\tthrow new Exception('Failed to save the new image!');\n\t\t\t}\n\t\t\t\n\t\t}\n\t\telse{\n\t\t\tthrow new Exception(\"Could not resample the image!\");\n\t\t}\n\t\t\n\t}",
"function resize($width,$height)\n {\n $new_image = imagecreatetruecolor($width, $height);\n imagecopyresampled($new_image, $this->image, 0, 0, 0, 0, $width, $height, $this->getWidth(), $this->getHeight());\n $this->image = $new_image; \n }",
"public function resize()\n\t{\n\t\t$protocol = ($this->image_library === 'gd2') ? 'image_process_gd' : 'image_process_'.$this->image_library;\n\t\treturn $this->$protocol('resize');\n\t}",
"function _process_image($data){\n\t\t\n\t\t// Largest side dimensions for small and large thumbnails\n\t\t$px_sm = 320;\n\t\t$px_lg = 640;\n\t\t\n\t\t// Generate new base name for this image\n\t\t$new_name = uniqid(TRUE);\n\t\t\n\t\t// Initialise array for resizing errors\n\t\t$this->resize_errors = array();\n\t\t\n\t\t// Array to hold the new dimensions\n\t\t$dimensions = array();\n\t\t\n\t\t// Work out the dimensions of the image based on longest side, or set both to same if equal\n\t\tif ($data['image_width'] > $data['image_height']){\n\t\t\t$dimensions['sm']['w'] = $px_sm;\n\t\t\t$dimensions['lg']['w'] = $px_lg;\n\t\t\t$dimensions['sm']['h'] = $data['image_height'] * ($px_sm / $data['image_width']);\n\t\t\t$dimensions['lg']['h'] = $data['image_height'] * ($px_lg / $data['image_width']);\n\t\t} elseif($data['image_width'] < $data['image_height']){\n\t\t\t$dimensions['sm']['w'] = $data['image_width'] * ($px_sm / $data['image_height']);\n\t\t\t$dimensions['lg']['w'] = $data['image_width'] * ($px_lg / $data['image_height']);\n\t\t\t$dimensions['sm']['h'] = $px_sm;\n\t\t\t$dimensions['lg']['h'] = $px_lg;\n\t\t} elseif ($data['image_width'] == $data['image_height']){\n\t\t\t$dimensions['sm']['w'] = $px_sm;\n\t\t\t$dimensions['lg']['w'] = $px_lg;\n\t\t\t$dimensions['sm']['h'] = $px_sm;\n\t\t\t$dimensions['lg']['h'] = $px_lg;\n\t\t}\n\t\t\n\t\t// Global resize vars\n\t\t$config['image_library'] = 'gd2';\n\t\t$config['source_image']\t= $data['full_path'];\n\t\t$config['create_thumb'] = FALSE;\n\t\t$config['maintain_ratio'] = TRUE;\n\t\t$config['quality'] = 100;\n\t\t$this->load->library('image_lib', $config);\n\t\t\n\t\t// Create small image\n\t\t$config['width'] = $dimensions['sm']['w'];\n\t\t$config['height'] = $dimensions['sm']['h'];\n\t\t$config['new_image'] = sprintf('%s/%s.sm%s', realpath('web/upload/'), $new_name, $data['file_ext']);\n\t\t$this->image_lib->initialize($config);\n\t\t$result_sm = $this->image_lib->resize();\n\t\tif($result_sm == FALSE){\n\t\t\tarray_push($this->resize_errors, $this->image_lib->display_errors());\n\t\t}\n\t\t\n\t\t// Create larger image\n\t\t$config['width'] = $dimensions['lg']['w'];\n\t\t$config['height'] = $dimensions['lg']['h'];\n\t\t$config['new_image'] = sprintf('%s/%s.lg%s', realpath('web/upload/'), $new_name, $data['file_ext']);\n\t\t$this->image_lib->initialize($config);\n\t\t$result_lg = $this->image_lib->resize();\n\t\tif($result_lg == FALSE){\n\t\t\tarray_push($this->resize_errors, $this->image_lib->display_errors());\n\t\t}\n\t\t\n\t\t// Delete the original source file now we're finished with it\n\t\t@unlink($data['full_path']);\n\t\t\n\t\t// Finished resizing functions - test for errors and return\n\t\tif($this->resize_errors == NULL){\n\t\t\t// No errors encountered - delete original image\n\t\t\t$name = sprintf('%s.#%s', $new_name, $data['file_ext']);\n\t\t\treturn $name;\n\t\t} else {\n\t\t\t// One or more errors occured when resizing the images\n\t\t\t$this->lasterr = 'Failed to resize the images.';\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t}",
"function image_arr_resize_to_folder($source_pic, $destination_folder, $filename, $max_width, $max_height)\n{\n $tmp_dest = $destination_folder;\n for ($index = 0; $index < count($source_pic['tmp_name']); $index++) {\n $destination_folder = $tmp_dest;\n $image_info = getimagesize($source_pic['tmp_name'][$index]);\n $source_pic_name = $source_pic['name'][$index];\n $source_pic_tmpname = $source_pic['tmp_name'][$index];\n $source_pic_size = $source_pic['size'][$index];\n $source_pic_width = $image_info[0];\n $source_pic_height = $image_info[1];\n $x_ratio = $max_width / $source_pic_width;\n $y_ratio = $max_height / $source_pic_height;\n\n if (($source_pic_width <= $max_width) && ($source_pic_height <= $max_height)) {\n $tn_width = $source_pic_width;\n $tn_height = $source_pic_height;\n } elseif (($x_ratio * $source_pic_height) < $max_height) {\n $tn_height = ceil($x_ratio * $source_pic_height);\n $tn_width = $max_width;\n } else {\n $tn_width = ceil($y_ratio * $source_pic_width);\n $tn_height = $max_height;\n }\n\n switch ($image_info['mime']) {\n case 'image/gif':\n if (imagetypes() & IMG_GIF) {\n $src = imageCreateFromGIF($source_pic['tmp_name'][$index]);\n $destination_folder.=\"$filename[$index].gif\";\n $namafile = \"$filename[$index].gif\";\n }\n break;\n\n case 'image/jpeg':\n if (imagetypes() & IMG_JPG) {\n $src = imageCreateFromJPEG($source_pic['tmp_name'][$index]);\n $destination_folder.=\"$filename[$index].jpg\";\n $namafile = \"$filename[$index].jpg\";\n }\n break;\n\n case 'image/pjpeg':\n if (imagetypes() & IMG_JPG) {\n $src = imageCreateFromJPEG($source_pic['tmp_name'][$index]);\n $destination_folder.=\"$filename[$index].jpg\";\n $namafile = \"$filename[$index].jpg\";\n }\n break;\n\n case 'image/png':\n if (imagetypes() & IMG_PNG) {\n $src = imageCreateFromPNG($source_pic['tmp_name'][$index]);\n $destination_folder.=\"$filename[$index].png\";\n $namafile = \"$filename[$index].png\";\n }\n break;\n\n case 'image/wbmp':\n if (imagetypes() & IMG_WBMP) {\n $src = imageCreateFromWBMP($source_pic['tmp_name'][$index]);\n $destination_folder.=\"$filename[$index].bmp\";\n $namafile = \"$filename[$index].bmp\";\n }\n break;\n }\n\n //chmod($destination_pic,0777);\n $tmp = imagecreatetruecolor($tn_width, $tn_height);\n imagecopyresampled($tmp, $src, 0, 0, 0, 0, $tn_width, $tn_height, $source_pic_width, $source_pic_height);\n\n //**** 100 is the quality settings, values range from 0-100.\n switch ($image_info['mime']) {\n case 'image/jpeg':\n imagejpeg($tmp, $destination_folder, 100);\n break;\n\n case 'image/gif':\n imagegif($tmp, $destination_folder, 100);\n break;\n\n case 'image/png':\n imagepng($tmp, $destination_folder);\n break;\n\n default:\n imagejpeg($tmp, $destination_folder, 100);\n break;\n }\n $url[] = $namafile;\n }\n return ($url);\n}",
"public function resize()\n {\n foreach ($this->getList() as $image) {\n if (!$image instanceof mtmdImage) {\n continue;\n }\n\n mtmdUtils::output(\n sprintf(\n '\"%s\": Resizing to %dx%d (was %dx%d)...',\n $image->getFileName(),\n $this->getThumbWidth(),\n $this->getThumbHeight(),\n $image->getWidth(),\n $image->getHeight()\n )\n );\n\n $targetPath = $this->getCachedFilePath(dirname($image->getFileName()));\n\n // Prepare target dirs.\n mtmdUtils::mkDir($targetPath, 0755, true);\n // Resize image.\n $image->resizeImage($targetPath, $this->thumbWidth, $this->thumbHeight);\n\n }\n\n }",
"public function do_profile_resize_image($data){\n\t\t//Your Image\n\t\t$imgSrc = 'public/upload/img/profile/' . $data['file'];\n\n\t\t//getting the image dimensions\n\t\tlist($width, $height) = getimagesize($imgSrc);\n\n\t\t//saving the image into memory (for manipulation with GD Library)\n\t\tif ($data['type'] == \"jpeg\" || $data['type'] == \"jpg\")\n\t\t\t$myImage = imagecreatefromjpeg($imgSrc);\n\t\telse if ($data['type'] == \"png\")\n\t\t\t$myImage = imagecreatefrompng($imgSrc);\n\t\telse if ($data['type'] == \"gij\")\n\t\t\t$myImage = imagecreatefromgif($imgSrc);\n\n\t\t// calculating the part of the image to use for thumbnail\n\t\tif ($width > $height) {\n\t\t $y = 0;\n\t\t $x = ($width - $height) / 2;\n\t\t $smallestSide = $height;\n\t\t} else {\n\t\t $x = 0;\n\t\t $y = ($height - $width) / 2;\n\t\t $smallestSide = $width;\n\t\t}\n\n\t\t// copying the part into thumbnail\n\t\t$thumbSize = 300;\n\t\t$thumb = imagecreatetruecolor($thumbSize, $thumbSize);\n\t\timagecopyresampled($thumb, $myImage, 0, 0, $x, $y, $thumbSize, $thumbSize, $smallestSide, $smallestSide);\n\n\t\t//final output\n\t\t$thumbnail_path = 'public/upload/img/profile/thumbnail_' . $data['file'];\n\t\tif ($data['type'] == \"jpeg\" || $data['type'] == \"jpg\") {\n\t\t\timagejpeg($thumb, $thumbnail_path);\n\t\t}\n\t\telse if ($data['type'] == \"png\") {\n\t\t\timagepng($thumb, $thumbnail_path);\n\t\t}\n\t\telse if ($data['type'] == \"gif\") {\n\t\t\timagegif($thumb, $thumbnail_path);\n\t\t}\n\n\t}",
"function rp_image_size_setup() {\n add_image_size( 'rp-md', 450, 450, array( 'center', 'center' ), false );\n\tadd_image_size( 'rp-lg', 1920, 500, array( 'center', 'center' ) );\n}",
"function resize_png_image($img,$newWidth,$newHeight,$target){\r\n\t\t\t//$srcImage=imagecreatefrompng('D:\\Projects\\xampp\\htdocs\\wannaquiz\\watermarks\\linkedin2.png');\r\n $srcImage=imagecreatefrompng($img);\r\n\t\t\tif($srcImage==''){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\t$srcWidth=imagesx($srcImage);\r\n\t\t\t$srcHeight=imagesy($srcImage);\r\n\t\t\t$percentage=(double)$newWidth/$srcWidth;\r\n\t\t\t$destHeight=round($srcHeight*$percentage)+1;\r\n\t\t\t$destWidth=round($srcWidth*$percentage)+1;\r\n\t\t\tif($destHeight > $newHeight){\r\n\t\t\t\t// if the width produces a height bigger than we want, calculate based on height\r\n\t\t\t\t$percentage=(double)$newHeight/$srcHeight;\r\n\t\t\t\t$destHeight=round($srcHeight*$percentage)+1;\r\n\t\t\t\t$destWidth=round($srcWidth*$percentage)+1;\r\n\t\t\t}\r\n\t\t\t$destImage=imagecreatetruecolor($destWidth-1,$destHeight-1);\r\n\t\t\tif(!imagealphablending($destImage,FALSE)){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\tif(!imagesavealpha($destImage,TRUE)){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\tif(!imagecopyresampled($destImage,$srcImage,0,0,0,0,$destWidth,$destHeight,$srcWidth,$srcHeight)){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\tif(!imagepng($destImage,$target)){\r\n\t\t\t\treturn FALSE;\r\n\t\t\t}\r\n\t\t\timagedestroy($destImage);\r\n\t\t\timagedestroy($srcImage);\r\n\t\t\treturn TRUE;\r\n\t\t}",
"function imageResize($imageResourceId=null,$width=null,$height=null, $targetWidth=null, $targetHeight=null) {\n\n// $targetWidth =300;\n// $targetHeight =260;\n// dd($imageResourceId,$width,$height, $targetWidth, $targetHeight);\n\n $targetLayer=imagecreatetruecolor($targetWidth,$targetHeight);\n imagecopyresampled($targetLayer,$imageResourceId,0,0,0,0,$targetWidth,$targetHeight, $width,$height );\n// imagecopyresized($targetLayer,$imageResourceId,0,0,0,0, $width,$height,$targetWidth,$targetHeight);\n\n return $targetLayer;\n }",
"protected function resizeProportional($fileName)\n\t{\n\t\t$file = WideImage::load($this->fileDir.DS.$fileName);\n\t\t$file->saveToFile($this->fileDir.DS.'thumb_'.$fileName);\n\n\t\treturn $this->cropInside($this->fileDir.DS.'thumb_'.$fileName,$this->modelSettings['thumb_size']['width'],$this->modelSettings['thumb_size']['height']);\n\t}",
"function minimize_image($image_url, $min_height='', $min_width='')\n{\n\t$img_settings = getimagesize($image_url);\n\tif($min_height != '' && $img_settings[1] > $min_height){\n\t\t$min_height = $min_height;\n\t\t$min_width = $img_settings[0]*($min_height/$img_settings[1]);\n\t}\n\telse if($min_width != '' && $img_settings[0] > $min_width){\n\t\t$min_height = $img_settings[1]*($min_width/$img_settings[0]);\n\t\t$min_width = $min_width; \n\t}\n\telse\n\t{\n\t\t$min_height = $img_settings[1];\n\t\t$min_width = $img_settings[0];\n\t}\n\t\n\treturn array('width'=>$min_width, 'height'=>$min_height, 'actualwidth'=>$img_settings[0], 'actualheight'=>$img_settings[1]);\n}",
"function resizeThumbnailImage($thumb_image_name, $image, $width, $height, $start_width, $start_height, $scale){\n\t\t\t\tlist($imagewidth, $imageheight, $imageType) = getimagesize($image);\n\t\t\t\t$imageType = image_type_to_mime_type($imageType);\n\t\t\t\n\t\t\t\t$newImageWidth = ceil($width * $scale);\n\t\t\t\t$newImageHeight = ceil($height * $scale);\n\t\t\t\t$newImage = imagecreatetruecolor($newImageWidth,$newImageHeight);\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\t$source=imagecreatefromgif($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\t$source=imagecreatefromjpeg($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\t$source=imagecreatefrompng($image);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\timagecopyresampled($newImage,$source,0,0,$start_width,$start_height,$newImageWidth,$newImageHeight,$width,$height);\n\t\t\t\tswitch($imageType) {\n\t\t\t\t\tcase \"image/gif\":\n\t\t\t\t\t\timagegif($newImage,$thumb_image_name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/pjpeg\":\n\t\t\t\t\tcase \"image/jpeg\":\n\t\t\t\t\tcase \"image/jpg\":\n\t\t\t\t\t\timagejpeg($newImage,$thumb_image_name,90);\n\t\t\t\t\t\tbreak;\n\t\t\t\t\tcase \"image/png\":\n\t\t\t\t\tcase \"image/x-png\":\n\t\t\t\t\t\timagepng($newImage,$thumb_image_name);\n\t\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t\tchmod($thumb_image_name, 0777);\n\t\t\t\treturn $thumb_image_name;\n\t\t\t}",
"function image_resize ( $args ) { /*\r\n\t\t * Changelog\r\n\t\t *\r\n\t\t * Version 3, July 20, 2007\r\n\t\t * - Cleaned\r\n\t\t *\r\n\t\t * Version 2, August 12, 2006\r\n\t\t * - Changed it to use $args\r\n\t\t */\r\n\t\t\r\n\t\t// Set default variables\r\n\t\t$image = $width_old = $height_old = $width_new = $height_new = $canvas_width = $canvas_height = $canvas_size = null;\r\n\t\t\r\n\t\t$x_old = $y_old = $x_new = $y_new = 0;\r\n\t\t\r\n\t\t// Exract user\r\n\t\textract($args);\r\n\t\t\r\n\t\t// Read image\r\n\t\t$image = image_read($image,false);\r\n\t\tif ( empty($image) ) { // error\r\n\t\t\ttrigger_error('no image was specified', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// Check new dimensions\r\n\t\tif ( empty($width_new) || empty($height_new) ) { // error\r\n\t\t\ttrigger_error('Desired/new dimensions not found', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// Do old dimensions\r\n\t\tif ( empty($width_old) && empty($height_old) ) { // Get the old dimensions from the image\r\n\t\t\t$width_old = imagesx($image);\r\n\t\t\t$height_old = imagesy($image);\r\n\t\t}\r\n\t\t\r\n\t\t// Do canvas dimensions\r\n\t\tif ( empty($canvas_width) && empty($canvas_height) ) { // Set default\r\n\t\t\t$canvas_width = $width_new;\r\n\t\t\t$canvas_height = $height_new;\r\n\t\t}\r\n\t\t\r\n\t\t// Let's force integer values\r\n\t\t$width_old = intval($width_old);\r\n\t\t$height_old = intval($height_old);\r\n\t\t$width_new = intval($width_new);\r\n\t\t$height_new = intval($height_new);\r\n\t\t$canvas_width = intval($canvas_width);\r\n\t\t$canvas_height = intval($canvas_height);\r\n\t\t\r\n\t\t// Create the new image\r\n\t\t$image_new = imagecreatetruecolor($canvas_width, $canvas_height);\r\n\t\t\r\n\t\t// Resample the image\r\n\t\t$image_result = imagecopyresampled(\r\n\t\t\t/* the new image */\r\n\t\t\t$image_new,\r\n\t\t\t/* the old image to update */\r\n\t\t\t$image,\r\n\t\t\t/* the new positions */\r\n\t\t\t$x_new, $y_new,\r\n\t\t\t/* the old positions */\r\n\t\t\t$x_old, $y_old,\r\n\t\t\t/* the new dimensions */\r\n\t\t\t$width_new, $height_new,\r\n\t\t\t/* the old dimensions */\r\n\t\t\t$width_old, $height_old);\r\n\t\t\r\n\t\t// Check\r\n\t\tif ( !$image_result ) { // ERROR\r\n\t\t\ttrigger_error('the image failed to resample', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// return\r\n\t\treturn $image_new;\r\n\t}"
]
| [
"0.7427337",
"0.7375942",
"0.7339083",
"0.7281478",
"0.7280196",
"0.72258383",
"0.71778107",
"0.70920056",
"0.70324075",
"0.6996242",
"0.6985018",
"0.698418",
"0.69497794",
"0.69237065",
"0.69192946",
"0.6913087",
"0.69037956",
"0.69020164",
"0.68802196",
"0.682061",
"0.68050194",
"0.67969865",
"0.6787744",
"0.67822886",
"0.67663896",
"0.6743748",
"0.6722895",
"0.6703363",
"0.6697511",
"0.6696416",
"0.66860086",
"0.66849273",
"0.667211",
"0.666438",
"0.6650242",
"0.66359353",
"0.66236824",
"0.66122955",
"0.6605834",
"0.66013294",
"0.66006565",
"0.65976727",
"0.65948075",
"0.65870357",
"0.65854776",
"0.6577331",
"0.65727377",
"0.6568403",
"0.6565383",
"0.65267104",
"0.6522873",
"0.65142953",
"0.6510503",
"0.6508671",
"0.6498263",
"0.6490897",
"0.6488346",
"0.6480174",
"0.6475912",
"0.64585304",
"0.644301",
"0.64339346",
"0.64260405",
"0.64209604",
"0.64066106",
"0.6406279",
"0.640594",
"0.6395988",
"0.63943946",
"0.639072",
"0.63851213",
"0.6379221",
"0.637777",
"0.6377709",
"0.63776827",
"0.6375252",
"0.6375224",
"0.63744086",
"0.6372546",
"0.6371375",
"0.6367261",
"0.6365156",
"0.6364418",
"0.6363268",
"0.63543385",
"0.6350557",
"0.63389575",
"0.63361704",
"0.6326953",
"0.6320288",
"0.6319642",
"0.6313671",
"0.6312702",
"0.630683",
"0.63015366",
"0.63007647",
"0.6298862",
"0.6289018",
"0.62883365",
"0.62838537",
"0.6281702"
]
| 0.0 | -1 |
This function corps image to create exact square, no matter what its original size! | public function crop_image_square($source, $destination, $image_type, $square_size, $image_width, $image_height, $quality){
if($image_width <= 0 || $image_height <= 0){return false;} //return false if nothing to resize
if( $image_width > $image_height )
{
$y_offset = 0;
$x_offset = ($image_width - $image_height) / 2;
$s_size = $image_width - ($x_offset * 2);
}else{
$x_offset = 0;
$y_offset = ($image_height - $image_width) / 2;
$s_size = $image_height - ($y_offset * 2);
}
$new_canvas = imagecreatetruecolor( $square_size, $square_size); //Create a new true color image
//Copy and resize part of an image with resampling
if(imagecopyresampled($new_canvas, $source, 0, 0, $x_offset, $y_offset, $square_size, $square_size, $s_size, $s_size)){
$this->save_image($new_canvas, $destination, $image_type, $quality);
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function resize_square($size){\n\n //container for new image\n $new_image = imagecreatetruecolor($size, $size);\n\n\n if($this->width > $this->height){\n $this->resize_by_height($size);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n imagecopy($new_image, $this->image, 0, 0, ($this->get_width() - $size) / 2, 0, $size, $size);\n }else{\n $this->resize_by_width($size);\n\n imagecolortransparent($new_image, imagecolorallocate($new_image, 0, 0, 0));\n imagealphablending($new_image, false);\n imagesavealpha($new_image, true);\n imagecopy($new_image, $this->image, 0, 0, 0, ($this->get_height() - $size) / 2, $size, $size);\n }\n\n $this->image = $new_image;\n\n //reset sizes\n $this->width = $size;\n $this->height = $size;\n\n return true;\n }",
"function crop_image_square($source, $destination, $image_type, $square_size, $image_width, $image_height, $quality){\n\tif($image_width <= 0 || $image_height <= 0){return false;} //return false if nothing to resize\n\n\tif( $image_width > $image_height )\n\t{\n\t\t$y_offset = 0;\n\t\t$x_offset = ($image_width - $image_height) / 2;\n\t\t$s_size \t= $image_width - ($x_offset * 2);\n\t}else{\n\t\t$x_offset = 0;\n\t\t$y_offset = ($image_height - $image_width) / 2;\n\t\t$s_size = $image_height - ($y_offset * 2);\n\t}\n\t$new_canvas\t= imagecreatetruecolor( $square_size, $square_size); //Create a new true color image\n\n\t//Copy and resize part of an image with resampling\n\tif(imagecopyresampled($new_canvas, $source, 0, 0, $x_offset, $y_offset, $square_size, $square_size, $s_size, $s_size)){\n\t\tsave_image($new_canvas, $destination, $image_type, $quality);\n\t}\n\n\treturn true;\n}",
"function crop_image_square($source, $destination, $image_type, $square_size, $image_width, $image_height, $quality){\n if($image_width <= 0 || $image_height <= 0){return false;} //return false if nothing to resize\n\n if($image_width > $image_height)\n {\n $y_offset = 0;\n $x_offset = ($image_width - $image_height) / 2;\n $s_size \t= $image_width - ($x_offset * 2);\n }else{\n $x_offset = 0;\n $y_offset = ($image_height - $image_width) / 2;\n $s_size = $image_height - ($y_offset * 2);\n }\n $new_canvas\t= imagecreatetruecolor( $square_size, $square_size); //Create a new true color image\n\n //Copy and resize part of an image with resampling\n if(imagecopyresampled($new_canvas, $source, 0, 0, $x_offset, $y_offset, $square_size, $square_size, $s_size, $s_size)){\n save_image($new_canvas, $destination, $image_type, $quality);\n }\n\n return true;\n}",
"function cropImage($CurWidth, $CurHeight, $iSize, $DestFolder, $SrcImage, $Quality, $ImageType) { \n\t//Check Image size is not 0\n\tif($CurWidth <= 0 || $CurHeight <= 0) \n\t{\n\t\treturn false;\n\t}\n\t\n\t//abeautifulsite.net has excellent article about \"Cropping an Image to Make Square bit.ly/1gTwXW9\n\tif($CurWidth>$CurHeight)\n\t{\n\t\t$y_offset = 0;\n\t\t$x_offset = ($CurWidth - $CurHeight) / 2;\n\t\t$square_size \t= $CurWidth - ($x_offset * 2);\n\t}else{\n\t\t$x_offset = 0;\n\t\t$y_offset = ($CurHeight - $CurWidth) / 2;\n\t\t$square_size = $CurHeight - ($y_offset * 2);\n\t}\n\t\n\t$NewCanvas \t= imagecreatetruecolor($iSize, $iSize);\t\n\t\n\tif(strtolower($ImageType) == 'image/png') {\n\t\t// Saves Alpha\n\t\timagealphablending($NewCanvas, false);\n\t\timagesavealpha($NewCanvas,true);\n\t\t$transparent = imagecolorallocatealpha($NewCanvas, 255, 255, 255, 127);\n\t\timagefilledrectangle($NewCanvas, 0, 0, $square_size, $square_size, $transparent);\n\t}\n\t\n\tif(imagecopyresampled($NewCanvas, $SrcImage, 0, 0, $x_offset, $y_offset, $iSize, $iSize, $square_size, $square_size))\n\t{\n\t\tswitch(strtolower($ImageType))\n\t\t{\n\t\t\tcase 'image/png':\n\t\t\t\timagepng($NewCanvas,$DestFolder);\n\t\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\timagegif($NewCanvas,$DestFolder);\n\t\t\t\tbreak;\t\t\t\n\t\t\tcase 'image/jpeg':\n\t\t\tcase 'image/pjpeg':\n\t\t\t\timagejpeg($NewCanvas,$DestFolder,$Quality);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t\t\n\t\t//Destroy image, frees memory\t\n\t\tif(is_resource($NewCanvas)) {imagedestroy($NewCanvas);} \n\t\treturn true;\n\t} \n}",
"function cropImage($CurWidth, $CurHeight, $iSize, $DestFolder, $SrcImage, $Quality, $ImageType)\n{\t \n\t//Check Image size is not 0\n\tif($CurWidth <= 0 || $CurHeight <= 0) \n\t{\n\t\treturn false;\n\t}\n\t//abeautifulsite.net has excellent article about \"Cropping an Image to Make Square\"\n\t//http://www.abeautifulsite.net/blog/2009/08/cropping-an-image-to-make-square-thumbnails-in-php/\n\tif($CurWidth>$CurHeight)\n\t{\n\t\t$y_offset = 0;\n\t\t$x_offset = ($CurWidth - $CurHeight) / 2;\n\t\t$square_size \t= $CurWidth - ($x_offset * 2);\n\t}\n\telse\n\t{\n\t\t$x_offset = 0;\n\t\t$y_offset = ($CurHeight - $CurWidth) / 2;\n\t\t$square_size = $CurHeight - ($y_offset * 2);\n\t}\n\t\n\t$NewCanves \t= imagecreatetruecolor($iSize, $iSize);\t\n\tif(imagecopyresampled($NewCanves, $SrcImage, 0, 0, $x_offset, $y_offset, $iSize, $iSize, $square_size, $square_size))\n\t{\n\t\tswitch(strtolower($ImageType))\n\t\t{\n\t\t\tcase 'image/png':\n\t\t\t\timagepng($NewCanves, $DestFolder);\n\t\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\timagegif($NewCanves, $DestFolder);\n\t\t\t\tbreak;\t\t\t\n\t\t\tcase 'image/jpeg':\n\t\t\tcase 'image/pjpeg':\n\t\t\t\timagejpeg($NewCanves, $DestFolder, $Quality);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\treturn false;\n\t\t}\n\t\tif(is_resource($NewCanves))\n\t\t{ \n\t\t\timagedestroy($NewCanves); \n\t } \n\t\treturn true;\n\t}\n}",
"function cropImage($CurWidth,$CurHeight,$iSize,$DestFolder,$SrcImage,$Quality,$ImageType)\r\n{\t \r\n\t//Check Image size is not 0\r\n\tif($CurWidth <= 0 || $CurHeight <= 0) \r\n\t{\r\n\t\treturn false;\r\n\t}\r\n\t\r\n\t//abeautifulsite.net has excellent article about \"Cropping an Image to Make Square\"\r\n\t//http://www.abeautifulsite.net/blog/2009/08/cropping-an-image-to-make-square-thumbnails-in-php/\r\n\tif($CurWidth>$CurHeight)\r\n\t{\r\n\t\t$y_offset = 0;\r\n\t\t$x_offset = ($CurWidth - $CurHeight) / 2;\r\n\t\t$square_size \t= $CurWidth - ($x_offset * 2);\r\n\t}else{\r\n\t\t$x_offset = 0;\r\n\t\t$y_offset = ($CurHeight - $CurWidth) / 2;\r\n\t\t$square_size = $CurHeight - ($y_offset * 2);\r\n\t}\r\n\t\r\n\t$NewCanves \t= imagecreatetruecolor($iSize, $iSize);\t\r\n\tif(imagecopyresampled($NewCanves, $SrcImage,0, 0, $x_offset, $y_offset, $iSize, $iSize, $square_size, $square_size))\r\n\t{\r\n\t\tswitch(strtolower($ImageType))\r\n\t\t{\r\n\t\t\tcase 'image/png':\r\n\t\t\t\timagepng($NewCanves,$DestFolder);\r\n\t\t\t\tbreak;\r\n\t\t\tcase 'image/gif':\r\n\t\t\t\timagegif($NewCanves,$DestFolder);\r\n\t\t\t\tbreak;\t\t\t\r\n\t\t\tcase 'image/jpeg':\r\n\t\t\tcase 'image/pjpeg':\r\n\t\t\t\timagejpeg($NewCanves,$DestFolder,$Quality);\r\n\t\t\t\tbreak;\r\n\t\t\tdefault:\r\n\t\t\t\treturn false;\r\n\t\t}\r\n\t//Destroy image, frees memory\t\r\n\tif(is_resource($NewCanves)) {imagedestroy($NewCanves);} \r\n\treturn true;\r\n\r\n\t}\r\n\t \r\n}",
"function cilikke($src, $dest, $new_width) {\r\n\t$info = getimagesize($src);\r\n\t$mime = $info[\"mime\"];\r\n\tif( $mime == 'image/jpeg' ) $source_image = imagecreatefromjpeg($src);\r\n\telseif( $mime == 'image/png' ) $source_image = imagecreatefrompng($src);\r\n\t$width = imagesx($source_image);\r\n\t$height = imagesy($source_image);\r\n\t$new_height = floor($height * ($new_width / $width));\r\n\tif($new_width < $width && $new_height < $height)\r\n\t{\r\n\t\t$virtual_image = imagecreatetruecolor($new_width, $new_height);\t\r\n\t\timagecopyresampled($virtual_image, $source_image, 0, 0, 0, 0, $new_width, $new_height, $width, $height);\r\n\t\timagejpeg($virtual_image, $dest);\r\n\t}else\r\n\t\tcopy($src, $dest);\r\n}",
"function cropImage($param=array())\r\n {\r\n $ret = array(\r\n 'msg' => false,\r\n 'sts' => false,\r\n );\r\n\r\n $final_size = $param['final_size'];\r\n #$filename = $final_size.'-'.$param['img_newname'];\r\n $filename = $param['img_newname'];\r\n $target_dir = $param['dest_path'];\r\n $target_name = $target_dir.$filename;\r\n $source_name = $param['img_real'];\r\n \r\n //get size from real image \r\n $size = getimagesize($source_name);\r\n $targ_w = $param['w'];\r\n $targ_h = $param['h'];\r\n\r\n //get size from ratio\r\n $final_size = explode(\"x\", $final_size);\r\n $final_w = $final_size[0];\r\n $final_h = $final_size[1];\r\n \r\n if($final_w==='auto' && $final_h==='auto'){ //detect if width and height ratio is \"auto\" then readjust width and height size\r\n $final_w = $targ_w;\r\n $final_h = $targ_h;\r\n }elseif($final_w==='auto'){ //detect if width ratio is \"auto\" then readjust width size\r\n $final_w = intval(($final_size[1] * $targ_w) / $targ_h);\r\n }elseif($final_h==='auto'){ //detect if height ratio is \"auto\" then readjust height size\r\n $final_h = intval(($final_size[0] * $targ_h) / $targ_w);\r\n }\r\n //end\r\n \r\n \r\n $jpeg_quality = 90;\r\n $img_r = imagecreatefromjpeg($source_name);\r\n $dst_r = ImageCreateTrueColor( $final_w, $final_h );\r\n \r\n imagecopyresized(\r\n $dst_r, $img_r, \r\n 0,0, \r\n $param['x'],$param['y'], \r\n $final_w,$final_h,\r\n $param['w'],$param['h']\r\n );\r\n \r\n imagejpeg($dst_r,$target_name,$jpeg_quality);\r\n #$this->send_to_server( array($target_name) );\r\n $url_target_name = str_replace('/data/shopkl/_assets/', 'http://klimg.com/kapanlagi.com/klshop/', $target_name);\r\n \r\n\t\t\t\r\n //find image parent url and dir path from config\r\n //reset($this->imgsize['article']['size']);\r\n //$first_key = key($this->imgsize['article']['size']);\r\n //end find\r\n $ret['sts'] = true;\r\n $ret['filename'] = $filename;\r\n $ret['msg'] = '<div class=\"alert alert-success\">Image is cropped and saved in <a href=\"'. $url_target_name .'?'.date('his').'\" target=\"_blank\">'.$target_name.' !</a></div>';\r\n \r\n return $ret;\r\n }",
"protected function resize()\n {\n $width = $this->width;\n $height = $this->height;\n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n // Determine new image dimensions\n if($this->mode === \"crop\"){ // Crop image\n \n $max_width = $crop_width = $width;\n $max_height = $crop_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if($orig_width > $orig_height){ // Original is wide\n $height = $max_height;\n $width = ceil($y_ratio * $orig_width);\n \n } elseif($orig_height > $orig_width){ // Original is tall\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n \n } else { // Original is square\n $this->mode = \"fit\";\n \n return $this->resize();\n }\n \n // Adjust if the crop width is less than the requested width to avoid black lines\n if($width < $crop_width){\n $width = $max_width;\n $height = ceil($x_ratio * $orig_height);\n }\n \n } elseif($this->mode === \"fit\"){ // Fits the image according to aspect ratio to within max height and width\n $max_width = $width;\n $max_height = $height;\n \n $x_ratio = @($max_width / $orig_width);\n $y_ratio = @($max_height / $orig_height);\n \n if( ($orig_width <= $max_width) && ($orig_height <= $max_height) ){ // Image is smaller than max height and width so don't resize\n $tn_width = $orig_width;\n $tn_height = $orig_height;\n \n } elseif(($x_ratio * $orig_height) < $max_height){ // Wider rather than taller\n $tn_height = ceil($x_ratio * $orig_height);\n $tn_width = $max_width;\n \n } else { // Taller rather than wider\n $tn_width = ceil($y_ratio * $orig_width);\n $tn_height = $max_height;\n }\n \n $width = $tn_width;\n $height = $tn_height;\n \n } elseif($this->mode === \"fit-x\"){ // Sets the width to the max width and the height according to aspect ratio (will stretch if too small)\n $height = @round($orig_height * $width / $orig_width);\n \n if($orig_height <= $height){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n \n } elseif($this->mode === \"fit-y\"){ // Sets the height to the max height and the width according to aspect ratio (will stretch if too small)\n $width = @round($orig_width * $height / $orig_height);\n \n if($orig_width <= $width){ // Don't stretch if smaller\n $width = $orig_width;\n $height = $orig_height;\n }\n } else {\n throw new \\Exception('Invalid mode: ' . $this->mode);\n }\n \n\n // Resize\n $this->temp = imagecreatetruecolor($width, $height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n \n imagecopyresampled($this->temp, $this->image, 0, 0, 0, 0, $width, $height, $orig_width, $orig_height);\n $this->sync();\n \n \n // Cropping?\n if($this->mode === \"crop\"){ \n $orig_width = imagesx($this->image);\n $orig_height = imagesy($this->image);\n \n $x_mid = $orig_width/2; // horizontal middle\n $y_mid = $orig_height/2; // vertical middle\n \n $this->temp = imagecreatetruecolor($crop_width, $crop_height);\n \n // Preserve transparency if a png\n if($this->image_info['mime'] == 'image/png'){\n imagealphablending($this->temp, false);\n imagesavealpha($this->temp, true);\n }\n\n imagecopyresampled($this->temp, $this->image, 0, 0, ($x_mid-($crop_width/2)), ($y_mid-($crop_height/2)), $crop_width, $crop_height, $crop_width, $crop_height);\n $this->sync();\n }\n }",
"public function testManualCornerCrop() {\n\t\t$image = $this->getSampleImage();\n\t\t$this->assertTrue( !empty($image->ID) && $image->exists() );\n\n\t\t$original_url = $image->getAbsoluteURL();\n\n\t\t$in_from_left = 20;\n\t\t$in_from_top = 20;\n\t\t$in_from_right = 40;\n\t\t$in_from_bottom = 40;\n\n\t\t$width_original = $image->getWidth();\n\t\t$height_original = $image->getHeight();\n\n\t\t$bottom_right_x = $width_original - $in_from_right;\n\t\t$bottom_right_y = $height_original - $in_from_bottom;\n\n\t\t$width_thumb = $width_original - $in_from_left - $in_from_right;\n\t\t$height_thumb = $height_original - $in_from_top - $in_from_bottom;\n\n\t\t$thumb = $image->ManualCropFromCorners($in_from_left,$in_from_top,$in_from_right,$in_from_bottom)->Original();\n\n\t\t// Get its URL\n\t\t$url = $thumb->getAbsoluteURL();\n\n\t\t// should end with this command/path\n\t\t$this->assertStringEndsWith(\"=/{$in_from_left}x{$in_from_top}:{$bottom_right_x}x{$bottom_right_y}/{$original_url}\", $url);\n\n\t\t$this->getRemoteImageDimensions($url, $returned_width_thumb, $returned_height_thumb);\n\n\t\t$this->assertEquals( $returned_width_thumb, $width_thumb );// width\n\t\t$this->assertEquals( $returned_height_thumb, $height_thumb );// height\n\n\t}",
"abstract public function calculateCropBoxSize();",
"abstract public function calculateCropBoxCoordinates();",
"function _crop_image_resource($img, $x, $y, $w, $h)\n {\n }",
"function image_reproportion()\n\t{\n\t\tif ( ! is_numeric($this->dst_width) OR ! is_numeric($this->dst_height) OR $this->dst_width == 0 OR $this->dst_height == 0)\n\t\t\treturn;\n\t\t\n\t\tif ( ! is_numeric($this->src_width) OR ! is_numeric($this->src_height) OR $this->src_width == 0 OR $this->src_height == 0)\n\t\t\treturn;\n\t\n\t\tif (($this->dst_width >= $this->src_width) AND ($this->dst_height >= $this->src_height))\n\t\t{\n\t\t\t$this->dst_width = $this->src_width;\n\t\t\t$this->dst_height = $this->src_height;\n\t\t}\n\t\t\n\t\t$new_width\t= ceil($this->src_width*$this->dst_height/$this->src_height);\t\t\n\t\t$new_height\t= ceil($this->dst_width*$this->src_height/$this->src_width);\n\t\t\n\t\t$ratio = (($this->src_height/$this->src_width) - ($this->dst_height/$this->dst_width));\n\n\t\tif ($this->master_dim != 'width' AND $this->master_dim != 'height')\n\t\t{\n\t\t\t$this->master_dim = ($ratio < 0) ? 'width' : 'height';\n\t\t}\n\t\t\n\t\tif (($this->dst_width != $new_width) AND ($this->dst_height != $new_height))\n\t\t{\n\t\t\tif ($this->master_dim == 'height')\n\t\t\t{\n\t\t\t\t$this->dst_width = $new_width;\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->dst_height = $new_height;\n\t\t\t}\n\t\t}\n\t}",
"function image_crop()\n\t{\n\t\t$protocol = 'image_process_'.$this->resize_protocol;\n\t\t\n\t\tif (substr($protocol, -3) == 'gd2')\n\t\t{\n\t\t\t$protocol = 'image_process_gd';\n\t\t}\n\t\t\n\t\treturn $this->$protocol('crop');\n\t}",
"public function image_reproportion()\n\t{\n\t\tif (($this->width === 0 && $this->height === 0) OR $this->orig_width === 0 OR $this->orig_height === 0\n\t\t\tOR ( ! ctype_digit((string) $this->width) && ! ctype_digit((string) $this->height))\n\t\t\tOR ! ctype_digit((string) $this->orig_width) OR ! ctype_digit((string) $this->orig_height))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\t// Sanitize\n\t\t$this->width = (int) $this->width;\n\t\t$this->height = (int) $this->height;\n\n\t\tif ($this->master_dim !== 'width' && $this->master_dim !== 'height')\n\t\t{\n\t\t\tif ($this->width > 0 && $this->height > 0)\n\t\t\t{\n\t\t\t\t$this->master_dim = ((($this->orig_height/$this->orig_width) - ($this->height/$this->width)) < 0)\n\t\t\t\t\t\t\t? 'width' : 'height';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$this->master_dim = ($this->height === 0) ? 'width' : 'height';\n\t\t\t}\n\t\t}\n\t\telseif (($this->master_dim === 'width' && $this->width === 0)\n\t\t\tOR ($this->master_dim === 'height' && $this->height === 0))\n\t\t{\n\t\t\treturn;\n\t\t}\n\n\t\tif ($this->master_dim === 'width')\n\t\t{\n\t\t\t$this->height = (int) ceil($this->width*$this->orig_height/$this->orig_width);\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->width = (int) ceil($this->orig_width*$this->height/$this->orig_height);\n\t\t}\n\t}",
"private function read_the_original_image_and_write() {\r\n\t\tfor ( $x = 0; $x <= $this->radius; $x += 0.01 ) {\r\n\r\n\t\t\t/* standard form for the equation of a circle ... don't tell me you never knew that ... */\r\n\t\t\t$y = sqrt( $this->diameter * $x - pow( $x , 2 ) ) + $this->radius;\r\n\r\n\t\t\t/* i think i should call this successive scans ... */\r\n\t\t\tfor ( $i = $x; $i < $this->diameter - $x; $i++ ) {\r\n\r\n\t\t\t\t/* half of the circle ... */\r\n\t\t\t\timagesetpixel (\r\n\t\t\t\t\t$this->cutted_image , $i, $y,\r\n\t\t\t\t\timagecolorat( $this->original_image, $i, $y )\r\n\t\t\t\t);\r\n\r\n\t\t\t\t/* the other half of course ... */\r\n\t\t\t\timagesetpixel (\r\n\t\t\t\t\t$this->cutted_image , $i, $this->diameter - $y,\r\n\t\t\t\t\timagecolorat( $this->original_image, $i, $this->diameter - $y )\r\n\t\t\t\t);\r\n\r\n\t\t\t}\r\n\r\n\t\t}\r\n\r\n\t\t/* avoid the white line when the diameter is an even number ... */\r\n\t\tif ( ! is_float( $this->radius ) )\r\n\t\t\tfor ( $i = 0; $i < $this->diameter; $i++ )\r\n\r\n\t\t\t\timagesetpixel (\r\n\t\t\t\t\t$this->cutted_image , $i, $this->radius - 1,\r\n\t\t\t\t\timagecolorat( $this->original_image, $i, $this->radius - 1 )\r\n\t\t\t\t);\r\n\r\n\t\t/* woo ... not as difficult as you think ... that's all ... */\r\n\t\treturn;\r\n\r\n\t}",
"function logonscreener_image_scale_and_crop($image, $source_width, $source_height) {\n global $screen_width, $screen_height;\n\n // Phase 1: Scale.\n $scale = max($screen_width / $source_width, $screen_height / $source_height);\n $scaled_width = (int) round($source_width * $scale);\n $scaled_height = (int) round($source_height * $scale);\n\n if ($scale != 1) {\n logonscreener_log(\"Scale = $scale. Scaled width = $scaled_width. Scaled height = $scaled_height.\");\n\n $res2 = imagecreatetruecolor($scaled_width, $scaled_height);\n imagefill($res2, 0, 0, imagecolorallocate($res2, 255, 255, 255));\n if (!imagecopyresampled($res2, $image, 0, 0, 0, 0, $scaled_width, $scaled_height, $source_width, $source_height)) {\n logonscreener_log('Scale did not worked out. HZ.');\n return FALSE;\n }\n\n // Destroy the original image and update image object.\n imagedestroy($image);\n $image = $res2;\n }\n\n // Phase 2: Crop.\n if ($scaled_width != $screen_width || $scaled_height != $screen_height) {\n $screen_width = (int) $screen_width;\n $screen_height = (int) $screen_height;\n\n $x = ($scaled_width - $screen_width) / 2;\n $y = ($scaled_height - $screen_height) / 2;\n logonscreener_log(\"Crop source X = $x. Crop source Y = $y.\");\n\n $res = imagecreatetruecolor($screen_width, $screen_height);\n imagefill($res, 0, 0, imagecolorallocate($res, 255, 255, 255));\n if (!imagecopyresampled($res, $image, 0, 0, $x, $y, $screen_width, $screen_height, $screen_width, $screen_height)) {\n logonscreener_log('Crop did not worked out. HZ.');\n return FALSE;\n }\n\n // Destroy the original image and update image object.\n imagedestroy($image);\n $image = $res;\n }\n\n return $image;\n}",
"private function intern_resize_crop($newWidth, $newHeight)\n\t{\n\t\t/*\n\t\t * Crop-to-fit PHP-GD\n\t\t * http://salman-w.blogspot.com/2009/04/crop-to-fit-image-using-aspphp.html\n\t\t *\n\t\t * Resize and center crop an arbitrary size image to fixed width and height\n\t\t * e.g. convert a large portrait/landscape image to a small square thumbnail\n\t\t *\n\t\t * Modified by Fry\n\t\t */\n\t\t$desired_aspect_ratio = $newWidth / $newHeight;\n\n\t\tif ($this->srcAspectRatio > $desired_aspect_ratio) {\n\t\t\t/*\n\t\t\t * Triggered when source image is wider\n\t\t\t */\n\t\t\t$temp_height = $newHeight;\n\t\t\t$temp_width = ( int ) ($newHeight * $this->srcAspectRatio);\n\t\t} else {\n\t\t\t/*\n\t\t\t * Triggered otherwise (i.e. source image is similar or taller)\n\t\t\t */\n\t\t\t$temp_width = $newWidth;\n\t\t\t$temp_height = ( int ) ($newWidth / $this->srcAspectRatio);\n\t\t}\n\n\t\t/*\n\t\t * Resize the image into a temporary GD image\n\t\t */\n\n\t\t$tempImage = imagecreatetruecolor($temp_width, $temp_height);\n\t\timagecopyresampled(\n\t\t\t$tempImage,\t\t\t\t\t$this->srcImage,\n\t\t\t0, 0,\t\t\t0, 0,\n\t\t\t$temp_width, $temp_height,\t$this->srcWidth, $this->srcHeight\n\t\t);\n\n\t\t/*\n\t\t * Copy cropped region from temporary image into the desired GD image\n\t\t */\n\n\t\t$x0 = ($temp_width - $newWidth) / 2;\n\t\t$y0 = ($temp_height - $newHeight) / 2;\n\t\t$this->newImage = imagecreatetruecolor($newWidth, $newHeight);\n\t\timagecopy(\n\t\t\t$this->newImage,\t$tempImage,\n\t\t\t0, 0,\t$x0, $y0,\n\t\t\t$newWidth, $newHeight\n\t\t);\n\t\timagedestroy($tempImage);\n\t}",
"function imgcrop(){\n\t\t$id = $this->session->userdata(SESSION_CONST_PRE.'userId');\n\t\t$dir_path = './assets/uploads/students/';\n\t\n\t\t$file_path = $dir_path . \"/Profile.small.jpg\";\n\t\t$src = $dir_path .'Profile.jpg';\n\t\tif(file_exists($file_path)){\n\t\t\t$src = $dir_path .'Profile.small.jpg';\n\t\t}\n\t\n\t\t$imgW = $_POST['w'];\n\t\t$imgH = $_POST['h'];\n\t\t$imgY1 = $_POST['y'];\n\t\t$imgX1 = $_POST['x'];\n\t\t$cropW = $_POST['w'];\n\t\t$cropH = $_POST['h'];\n\t\n\t\t$jpeg_quality = 100;\n\t\n\t\t//$img_r = imagecreatefromjpeg($src);\n\t\t$what = getimagesize($src);\n\t\t//list($imgInitW, $imgInitH, $type, $what) = getimagesize($src);\n\t\t$imgW = $imgInitW = $what[0];\n\t\t$imgH = $imgInitH = $what[1];\n\t\tswitch(strtolower($what['mime']))\n\t\t{\n\t\t\tcase 'image/png':\n\t\t\t\t$img_r = imagecreatefrompng($src);\n\t\t\t\t$source_image = imagecreatefrompng($src);\n\t\t\t\t$type = '.png';\n\t\t\t\tbreak;\n\t\t\tcase 'image/jpeg':\n\t\t\t\t$img_r = imagecreatefromjpeg($src);\n\t\t\t\t$source_image = imagecreatefromjpeg($src);\n\t\t\t\t$type = '.jpeg';\n\t\t\t\tbreak;\n\t\t\tcase 'image/jpg':\n\t\t\t\t$img_r = imagecreatefromjpeg($src);\n\t\t\t\t$source_image = imagecreatefromjpeg($src);\n\t\t\t\t$type = '.jpg';\n\t\t\t\tbreak;\n\t\t\tcase 'image/gif':\n\t\t\t\t$img_r = imagecreatefromgif($src);\n\t\t\t\t$source_image = imagecreatefromgif($src);\n\t\t\t\t$type = '.gif';\n\t\t\t\tbreak;\n\t\t\tdefault: die('image type not supported');\n\t\t}\n\t\n\t\t$resizedImage = imagecreatetruecolor($imgW, $imgH);\n\t\timagecopyresampled($resizedImage, $source_image, 0, 0, 0, 0, $imgW,\n\t\t$imgH, $imgInitW, $imgInitH);\n\t\n\t\n\t\t$dest_image = imagecreatetruecolor($cropW, $cropH);\n\t\timagecopyresampled($dest_image, $source_image, 0, 0, $imgX1, $imgY1, $cropW,\n\t\t$cropH, $cropW, $cropH);\n\t\n\t\n\t\timagejpeg($dest_image, $dir_path.'Profile.small.jpg', $jpeg_quality);\n\t\n\t}",
"function crop($rect=array(),&$autosave=null) \n { \n //invalid rectangle defintion \n if(empty($rect)) \n { \n return $this; \n } \n \n if(count($rect)==2) \n { \n $_rect=$rect; \n $rect=array(0,0,$_rect[0],$_rect[1]); \n unset($_rect); \n } \n \n if(count($rect)==3) \n { \n $_rect=array($rect[0],$rect[1],$rect[2]); \n $rect=array(0,0,$_rect[1],$_rect[2]); \n \n switch(trim(strtolower($_rect[0]))) \n { \n case 'lt': \n $rect[0]=0; \n $rect[1]=0; \n break; \n case 'rt': \n $rect[0]=$this->_width-$rect[2]; \n $rect[1]=0; \n break; \n case 'lb': \n $rect[0]=0; \n $rect[1]=$this->_height-$rect[3]; \n break; \n case 'rb': \n $rect[0]=$this->_width-$rect[2]; \n $rect[1]=$this->_height-$rect[3]; \n break; \n case 'center': \n $rect[0]=($this->_width-$rect[2])*0.5; \n $rect[1]=($this->_height-$rect[3])*0.5; \n break; \n } \n unset($_rect); \n } \n \n if(count($rect)!=4 || $rect[0]<0 || $rect[1]<0 || $rect[2]<=0 || $rect[3]<0) \n { \n return $this; \n } \n \n //overflow \n if($rect[0]+$rect[2]>$this->_width || $rect[1]+$rect[3]>$this->_height) \n { \n return $this; \n } \n \n $_tmpImage=imagecreatetruecolor($rect[2],$rect[3]); \n imagecopy($_tmpImage,$this->_image,0,0,$rect[0],$rect[1],$rect[2],$rect[3]); \n imagedestroy($this->_image); \n $this->_image=&$_tmpImage; \n \n $this->_width=$rect[2]; \n $this->_height=$rect[3]; \n \n if(isset($autosave)) \n { \n $_file=sprintf('%s%s_%sx%s.%s', \n $this->_imagePathInfo['dirname'].DS, \n $this->_imagePathInfo['filename'], \n $this->_width,$this->_height, \n $this->_imagePathInfo['extension'] \n ); \n \n if($this->saveAs($_file,$this->default_qulity,$this->default_smooth,$this->auto_dispose)) \n { \n $autosave=$_file; \n } \n } \n \n return $this; \n }",
"public function test_crop() {\n\t\t$file = DIR_TESTDATA . '/images/gradient-square.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$imagick_image_editor->crop( 0, 0, 50, 50 );\n\n\t\t$this->assertSame(\n\t\t\tarray(\n\t\t\t\t'width' => 50,\n\t\t\t\t'height' => 50,\n\t\t\t),\n\t\t\t$imagick_image_editor->get_size()\n\t\t);\n\t}",
"public static function crop(){\n\n}",
"function imagecropauto($image, $mode = -1, $threshold = 0.5, $color = -1)\n{\n}",
"function FE_CropImage($img, $w=0, $h=0, $a=''){\t\t\r\n\t\t$q=80; /* calitate 0-100 */\t\t\r\n\t\t$src =__URL__.'app/tt/tt.php?src='.$img.($w>0 ? \"&w=$w\" : \"\").($h>0 ? \"&h=$h\" : \"\").\"&q=$q\".(!empty($a) ? \"&a=$a\" : \"\");\r\n\t\treturn $src;\r\n\t\t\r\n }",
"private function sharpenImage()\n\t{\n\t\t$this->checkImage();\n\n\t\tif (!$this->saveState && $this->sharpen == true) {\n\t\t\t$sharpness = $this->findSharp($this->width, $this->optimalWidth);\n\t\t\t$sharpenMatrix = array(\n\t\t\t\tarray(-1, -2, -1),\n\t\t\t\tarray(-2, $sharpness + 12, -2),\n\t\t\t\tarray(-1, -2, -1)\n\t\t\t);\n\t\t\t$divisor = $sharpness;\n\t\t\t$offset = 0;\n\t\t\tif (function_exists('imageconvolution')) {\n\t\t\t\timageconvolution($this->imageResized, $sharpenMatrix, $divisor, $offset);\n\t\t\t} else {\n\t\t\t\t$this->imageconvolution($this->imageResized, $sharpenMatrix, $divisor, $offset);\n\t\t\t}\n\t\t}\n\t}",
"public function sharpen() {\r\n\t\t$matrix = array(\r\n\t\t\tarray(-1, -1, -1),\r\n\t\t\tarray(-1, 16, -1),\r\n\t\t\tarray(-1, -1, -1)\r\n\t\t);\r\n\t\t$this->convolution($matrix, array_sum(array_map('array_sum', $matrix)));\r\n\t}",
"function image_crop(){\n\n\t\t\t$imgUrl = $_POST['imgUrl'];\n\t\t\t/*explored image URL and get image name*/\n\t\t\t$expImgUrl=explode(\"/\", $imgUrl);\n\t\t\t$LengthOfArray = sizeof($expImgUrl);\n\t\t\t$imageName = $LengthOfArray-1;\n\t\t\t$imgName = $expImgUrl[$imageName];\n\t\t\t$imgInitW = $_POST['imgInitW'];\n\t\t\t$imgInitH = $_POST['imgInitH'];\n\t\t\t$imgW = $_POST['imgW'];\n\t\t\t$imgH = $_POST['imgH'];\n\t\t\t$imgY1 = $_POST['imgY1'];\n\t\t\t$imgX1 = $_POST['imgX1'];\n\t\t\t$cropW = $_POST['cropW'];\n\t\t\t$cropH = $_POST['cropH'];\n\n\t\t\t$jpeg_quality = 100;\n\t\t\t$rand = rand();\n\t\t\t$output_filename = \"../webroot/img/uploads/croppedImg_\".$rand;\n\t\t\t$oname = \"img/uploads/croppedImg_\".$rand;\n\t\t\t$Pname = \"img/uploads/\";\n\t\t\t$path = BASE_PATH;\n\n\t\t\t$what = getimagesize($Pname.\"/\".$imgName);\n\t\t\t\n\t\t\tswitch(strtolower($what['mime']))\n\t\t\t{\n\t\t\t\tcase 'image/png':\n\t\t\t\t\t$img_r = imagecreatefrompng($Pname.\"/\".$imgName);\n\t\t\t\t\t$source_image = imagecreatefrompng($Pname.\"/\".$imgName);\n\t\t\t\t\t$type = '.png';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'image/jpeg':\n\t\t\t\t\t$img_r = imagecreatefromjpeg($Pname.\"/\".$imgName);\n\t\t\t\t\t$source_image = imagecreatefromjpeg($Pname.\"/\".$imgName);\n\t\t\t\t\t$type = '.jpeg';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 'image/gif':\n\t\t\t\t\t$img_r = imagecreatefromgif($Pname.\"/\".$imgName);\n\t\t\t\t\t$source_image = imagecreatefromgif($Pname.\"/\".$imgName);\n\t\t\t\t\t$type = '.gif';\n\t\t\t\t\tbreak;\n\t\t\t\tdefault: die('image type not supported');\n\t\t\t}\n\t\t\t\t\n\t\t\t$resizedImage = imagecreatetruecolor($imgW, $imgH);\n\t\t\timagecopyresampled($resizedImage, $source_image, 0, 0, 0, 0, $imgW, \n\t\t\t\t\t\t$imgH, $imgInitW, $imgInitH);\t\n\t\t\t\n\t\t\t\n\t\t\t$dest_image = imagecreatetruecolor($cropW, $cropH);\n\t\t\timagecopyresampled($dest_image, $resizedImage, 0, 0, $imgX1, $imgY1, $cropW, \n\t\t\t\t\t\t$cropH, $cropW, $cropH);\t\n\n\n\t\t\timagejpeg($dest_image, $output_filename.$type, $jpeg_quality);\n\t\t\t\n\t\t\t$response = array(\n\t\t\t\t\t\"status\" => 'success',\n\t\t\t\t\t\"url\" => $oname.$type, \n\t\t\t\t\t\"base\" => $path \n\t\t\t\t );\n\t\t\t print json_encode($response);\n\t\t\t exit;\n\t}",
"function cropRatioImage(&$srcImage, $src_width, $src_height, $desiredWidth = 0, $desiredHeight = 0)\n\t{\n\t\t// if only one size is specified\n\t\tif ($desiredWidth == '*' || $desiredHeight == '*')\n\t\t{\n\t\t\t$new_size = $this->calculateSize($src_width, $src_height, $desiredWidth, $desiredHeight);\n\t\t\t$desiredWidth = $new_size['width'];\n\t\t\t$desiredHeight = $new_size['height'];\n\t\t}\n\t\t\n\t\t// get aspect ratio\n\t\t$ratioW = $src_width / $desiredWidth;\n\t\t$ratioH = $src_height / $desiredHeight;\n\t\t\n\t\t$ratio = ($ratioW < $ratioH)?$ratioW:$ratioH;\n\t\t\t\n\t\t// calculate new height and width based on the ratio\n\t\t$new_width = floor($desiredWidth * $ratio);\n\t\t$new_height = floor($desiredHeight * $ratio);\n\t\t\n\t\t// calculate crop start position\n\t\t$startX = floor(($src_width - $new_width) / 2);\n\t\t$startY = floor(($src_height - $new_height) / 2);\n\t\t\n\t\treturn $this->cropImage($srcImage, $startX, $startY, $new_width, $new_height);\n\t}",
"public function testSmartCrop() {\n\t\t$image = $this->getSampleImage();\n\t\t$this->assertTrue( !empty($image->ID) && $image->exists() );\n\n\t\t$original_url = $image->getAbsoluteURL();\n\n\t\t$width = self::WIDTH;\n\t\t$height = 0;\n\t\t$thumb = $image->Smart(true)->ScaleWidth( $width );\n\n\t\t// Get its URL\n\t\t$url = $thumb->getAbsoluteURL();\n\n\t\t// should end with this command/path\n\t\t$this->assertStringEndsWith(\"=/{$width}x{$height}/smart/{$original_url}\", $url);\n\n\t}",
"protected function _makeSquareThumbnail($source, $destination, $sizeConstraint)\n {\n $sourceGD = $this->_loadImageResource($source);\n if (empty($sourceGD)) {\n return false;\n }\n\n $sourceWidth = imagesx($sourceGD);\n $sourceHeight = imagesy($sourceGD);\n\n // Source is landscape.\n if ($sourceWidth > $sourceHeight) {\n $sourceSize = $sourceHeight;\n $sourceX = $this->_getOffsetX($sourceWidth, $sourceSize);\n $sourceY = 0;\n }\n // Source is portrait.\n elseif ($sourceWidth < $sourceHeight) {\n $sourceSize = $sourceWidth;\n $sourceX = 0;\n $sourceY = $this->_getOffsetY($sourceHeight, $sourceSize);\n }\n // Source is square.\n else {\n $sourceSize = $sourceWidth;\n $sourceX = 0;\n $sourceY = 0;\n }\n\n $destinationGD = imagecreatetruecolor($sizeConstraint, $sizeConstraint);\n $white = imagecolorallocate($destinationGD, 255, 255, 255);\n imagefill($destinationGD, 0, 0, $white);\n $result = imagecopyresampled($destinationGD, $sourceGD, 0, 0, $sourceX, $sourceY, $sizeConstraint, $sizeConstraint, $sourceSize, $sourceSize);\n\n // Save resulted resource.\n if ($result) {\n $result = imagejpeg($destinationGD, $destination);\n }\n\n imagedestroy($sourceGD);\n imagedestroy($destinationGD);\n return $result;\n }",
"public function test_crop() {\n\n\t\t$file = DIR_TESTDATA . '/images/gradient-square.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$imagick_image_editor->crop( 0, 0, 50, 50 );\n\n\t\t$this->assertEquals( array( 'width' => 50, 'height' => 50 ), $imagick_image_editor->get_size() );\n\n\t}",
"function flexibleCropper($source_location, $desc_location=null,$crop_size_w=null,$crop_size_h=null)\n\t{\n\t list($src_w, $src_h) = getimagesize($source_location);\n\n\t $image_source = imagecreatefromjpeg($source_location);\n\t $image_desc = imagecreatetruecolor($crop_size_w,$crop_size_h);\n\n\t/*\n\t if ($crop_size_w>$crop_size_h) {$my_crop_size_w=null;}\n\t elseif ($crop_size_h>$crop_size_w)\n\t {$my_crop_size_h=null;\n\n\t if (is_null($my_crop_size_h) and !is_null($my_crop_size_w))\n\t { $my_crop_size_h=$src_h*$my_crop_size_w/$src_w; }\n\t elseif (!is_null($my_crop_size_h))\n\t { $my_crop_size_w=$src_w*$my_crop_size_h/$src_h; }\n\t*/\n\n\t if ($src_w<$src_h) {$my_crop_size_h=$src_h*$crop_size_w/$src_w;} else {$my_crop_size_h=$crop_size_h;}\n\t if ($src_h<$src_w) {$my_crop_size_w=$src_w*$crop_size_h/$src_h;} else {$my_crop_size_w=$crop_size_w;}\n\t// echo \"($my_crop_size_w-$my_crop_size_h)\";\n\t if ($my_crop_size_w>$crop_size_w) {$additional_x=round(($crop_size_w-$my_crop_size_w)/2);} else {$additional_x=0;}\n\t if ($my_crop_size_h>$crop_size_h) {$additional_y=round(($crop_size_h-$my_crop_size_h)/2);} else {$additional_y=0;}\n\n\t $off_x=round($src_w/2)-round($my_crop_size_w/2);\n\t $off_y=round($src_h/2)-round($my_crop_size_h/2)+$additional_y;\n\t $off_w=(round($src_w/2)+round($my_crop_size_w/2))-$off_x;\n\t $off_h=(round($src_h/2)+round($my_crop_size_h/2))-$off_y;\n\n\t imagecopyresampled($image_desc, $image_source,$additional_x, $additional_y, $off_x, $off_y, $my_crop_size_w, $my_crop_size_h, $off_w, $off_h);\n\n\t if (!is_null($desc_location))\n\t imagejpeg($image_desc, $desc_location,100);\n\t else\n\t imagejpeg($image_desc);\n\t}",
"public function user_crop()\r\n\t{\r\n\t\t// Get uploaded photo\r\n\t\t$uploaded_photo = $this->input->post('uploaded_photo');\r\n\r\n\t\t// Get image width, height\r\n\t\tlist($width, $height) = @getimagesize('./assets/uploads/' . $uploaded_photo);\r\n\r\n\t\t// Calculate ratio\r\n\t\t$ratio = $width / 536;\r\n\r\n\t\t// Get chosen crop coordinates\r\n\t\t$coords_x1 = round($ratio * $this->input->post('coords-x1'));\r\n\t\t$coords_y1 = round($ratio * $this->input->post('coords-y1'));\r\n\t\t$coords_x2 = round($ratio * $this->input->post('coords-x2'));\r\n\t\t$coords_y2 = round($ratio * $this->input->post('coords-y2'));\r\n\t\t$coords_w = round($ratio * $this->input->post('coords-w'));\r\n\t\t$coords_h = round($ratio * $this->input->post('coords-h'));\r\n\r\n\t\t// Profile thumbnail crop config\r\n\t\t$config['source_image'] = './assets/uploads/' . $uploaded_photo;\r\n\t\t$config['new_image'] = './assets/uploads/tall-' . strtolower($uploaded_photo);\r\n\t\t$config['width'] = $coords_w;\r\n\t\t$config['height'] = $coords_h;\r\n\t\t$config['maintain_ratio'] = FALSE;\r\n\t\t$config['x_axis'] = $coords_x1;\r\n\t\t$config['y_axis'] = $coords_y1;\r\n\r\n\t\t// Initialize the image library with config\r\n\t\t$this->image_lib->initialize($config);\r\n\r\n\t\t// Crop the image\r\n\t\tif (!$this->image_lib->crop())\r\n\t\t{\r\n\t\t\t$errors[] = $this->image_lib->display_errors('', '');\r\n\t\t}\r\n\r\n\t\t// Clear the config to start next thumbnail\r\n\t\t$config = array();\r\n\t\t$this->image_lib->clear();\r\n\r\n\t\t// Profile thumbnail resize config\r\n\t\t$config['source_image'] = './assets/uploads/tall-' . strtolower($uploaded_photo);\r\n\t\t$config['width'] = 385;\r\n\t\t$config['height'] = 465;\r\n\t\t$config['maintain_ratio'] = FALSE;\r\n\r\n\t\t// Initialize the image library with config\r\n\t\t$this->image_lib->initialize($config);\r\n\r\n\t\t// Resize the image\r\n\t\tif (!$this->image_lib->resize())\r\n\t\t{\r\n\t\t\t$errors[] = $this->image_lib->display_errors('', '');\r\n\t\t}\r\n\t}",
"public function actionSaveCroppedImage() {\n\n if ($_REQUEST['output_filename'] == '') {\n $output_filename = \"media/croppic/croppedimg/croppedImg_\" . time();\n } else {\n $output_filename = $_REQUEST['output_filename'] . time();\n }\n $output_filename2 = Yii::app()->request->baseUrl . '/' . $output_filename;\n\n $imgUrl = Yii::app()->basePath.'/..'.str_replace(Yii::app()->request->baseUrl,'',$_POST['imgUrl']);\n $imgInitW = $_POST['imgInitW'];\n $imgInitH = $_POST['imgInitH'];\n $imgW = $_POST['imgW'];\n $imgH = $_POST['imgH'];\n $imgY1 = $_POST['imgY1'];\n $imgX1 = $_POST['imgX1'];\n $cropW = $_POST['cropW'];\n $cropH = $_POST['cropH'];\n\n $jpeg_quality = 100;\n\n $what = getimagesize($imgUrl);\n \n switch (strtolower($what['mime'])) {\n case 'image/png':\n $img_r = imagecreatefrompng($imgUrl);\n $source_image = imagecreatefrompng($imgUrl);\n $type = '.png';\n break;\n case 'image/jpeg':\n $img_r = imagecreatefromjpeg($imgUrl);\n $source_image = imagecreatefromjpeg($imgUrl);\n $type = '.jpeg';\n break;\n case 'image/gif':\n $img_r = imagecreatefromgif($imgUrl);\n $source_image = imagecreatefromgif($imgUrl);\n $type = '.gif';\n break;\n default: die('image type not supported');\n }\n\n $resizedImage = imagecreatetruecolor($imgW, $imgH);\n imagecopyresampled($resizedImage, $source_image, 0, 0, 0, 0, $imgW, $imgH, $imgInitW, $imgInitH);\n\n\n $dest_image = imagecreatetruecolor($cropW, $cropH);\n imagecopyresampled($dest_image, $resizedImage, 0, 0, $imgX1, $imgY1, $cropW, $cropH, $cropW, $cropH);\n\n\n imagejpeg($dest_image, $output_filename . $type, $jpeg_quality);\n\n $response = array(\n \"status\" => 'success',\n \"url\" => $output_filename2 . $type\n );\n print json_encode($response);\n }",
"function resizeCropImage($src, $dst, $dstx, $dsty){\n\t\t//$dst = destination image location\n\t\t//$dstx = user defined width of image\n\t\t//$dsty = user defined height of image\n\t\t$allowedExtensions = 'jpg jpeg gif png';\n\t\t$name = explode(\".\", strtolower($src));\n\t\t$currentExtensions = $name[count($name)-1];\n\t\t$extensions = explode(\" \", $allowedExtensions);\n\n\t\tfor($i=0; count($extensions)>$i; $i=$i+1) {\n\t\t\tif($extensions[$i]==$currentExtensions)\n\t\t\t{ \n\t\t\t\t$extensionOK=1; \n\t\t\t\t$fileExtension=$extensions[$i]; \n\t\t\t\tbreak; \n\t\t\t}\n\t\t}\n\n\t\tif($extensionOK){\n\t\t\t$size = getImageSize($src);\n\t\t\t$width = $size[0];\n\t\t\t$height = $size[1];\n\t\t\tif($width >= $dstx AND $height >= $dsty){\n\t\t\t\t$proportion_X = $width / $dstx;\n\t\t\t\t$proportion_Y = $height / $dsty;\n\t\t\t\tif($proportion_X > $proportion_Y ){\n\t\t\t\t\t$proportion = $proportion_Y;\n\t\t\t\t}else{\n\t\t\t\t\t$proportion = $proportion_X ;\n\t\t\t\t}\n\t\t\t\t$target['width'] = $dstx * $proportion;\n\t\t\t\t$target['height'] = $dsty * $proportion;\n\t\t\t\t$original['diagonal_center'] = round(sqrt(($width*$width)+($height*$height))/2);\n\t\t\t\t$target['diagonal_center'] = round(sqrt(($target['width']*$target['width']) + ($target['height']*$target['height']))/2);\n\t\t\t\t$crop = round($original['diagonal_center'] - $target['diagonal_center']);\n\t\t\t\tif($proportion_X < $proportion_Y ){\n\t\t\t\t\t$target['x'] = 0;\n\t\t\t\t\t$target['y'] = round((($height/2)*$crop)/$target['diagonal_center']);\n\t\t\t\t}else{\n\t\t\t\t\t$target['x'] = round((($width/2)*$crop)/$target['diagonal_center']);\n\t\t\t\t\t$target['y'] = 0;\n\t\t\t\t}\n\t\t\t\tif($fileExtension == \"jpg\" OR $fileExtension=='jpeg'){ \n\t\t\t\t\t$from = ImageCreateFromJpeg($src); \n\t\t\t\t} elseif ($fileExtension == \"gif\"){ \n\t\t\t\t\t$from = ImageCreateFromGIF($src); \n\t\t\t\t} elseif ($fileExtension == 'png'){\n\t\t\t\t\t$from = imageCreateFromPNG($src);\n\t\t\t\t}\n\t\t\t\t$new = ImageCreateTrueColor ($dstx,$dsty);\n\t\t\t\timagecopyresampled ($new, $from, 0, 0, $target['x'], \n\t\t\t\t$target['y'], $dstx, $dsty, $target['width'], $target['height']);\n\t\t\t\tif($fileExtension == \"jpg\" OR $fileExtension == 'jpeg'){ \n\t\t\t\t\timagejpeg($new, $dst, 70); \n\t\t\t\t} elseif ($fileExtension == \"gif\"){ \n\t\t\t\t\timagegif($new, $dst); \n\t\t\t\t}elseif ($fileExtension == 'png'){\n\t\t\t\t\timagepng($new, $dst);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tcopy($src, $dst);\n\t\t\t}\n\t\t}\n\t}",
"public function square();",
"function ImageRectangleWithRoundedCorners(&$im, $x1, $y1, $x2, $y2, $radius, $color) {\n imagefilledrectangle($im, $x1+$radius, $y1, $x2-$radius, $y2, $color);\n imagefilledrectangle($im, $x1, $y1+$radius, $x2, $y2-$radius, $color);\n // draw circled corners\n imagefilledellipse($im, $x1+$radius, $y1+$radius, $radius*2, $radius*2, $color);\n imagefilledellipse($im, $x2-$radius, $y1+$radius, $radius*2, $radius*2, $color);\n imagefilledellipse($im, $x1+$radius, $y2-$radius, $radius*2, $radius*2, $color);\n imagefilledellipse($im, $x2-$radius, $y2-$radius, $radius*2, $radius*2, $color);\n}",
"function resize_image($file, $w, $h, $crop=FALSE) {\n list($width, $height) = getimagesize($file);\n $r = $w / $h;\n $rate = $width / $height;\n // if we want it cropped\n if ($crop) {\n if ($rate < $r) {\n $src_w = $width;\n $src_h = ceil($width / $r);\n $src_x = 0;\n $src_y = ceil(($height - $src_h) / 2);\n $dst_w = $w;\n $dst_h = $h;\n $dst_x = 0;\n $dst_y = 0;\n }\n else {\n $src_w = ceil($r * $height);\n $src_h = $height;\n $src_x = ceil(($width - $src_w) / 2);\n $src_y = 0;\n $dst_w = $w;\n $dst_h = $h;\n $dst_x = 0;\n $dst_y = 0;\n }\n $newwidth = $w;\n $newheight = $h;\n }\n // if we don't want it cropped\n else {\n if ($rate < $r) {\n $src_w = $width;\n $src_h = $height;\n $src_x = 0;\n $src_y = 0;\n $dst_w = $h * $rate;\n $dst_h = $h;\n $dst_x = 0;\n $dst_y = 0;\n }\n else {\n $src_w = $width;\n $src_h = $height;\n $src_x = 0;\n $src_y = 0;\n $dst_w = $w;\n $dst_h = $w / $rate;\n $dst_x = 0;\n $dst_y = 0;\n }\n $newwidth = $dst_w;\n $newheight = $dst_h;\n }\n \n $type = strtolower(substr(strrchr($file,\".\"),1));\n if($type == 'jpeg') $type = 'jpg';\n switch($type){\n case 'bmp': $src_image = @imagecreatefromwbmp($file); break;\n case 'gif': $src_image = @imagecreatefromgif($file); break;\n case 'jpg': $src_image = @imagecreatefromjpeg($file); break;\n case 'png': $src_image = @imagecreatefrompng($file); break;\n default : return \"Unsupported picture type!\";\n } \n \n if ($src_image) {\n $dst_image = imagecreatetruecolor($newwidth, $newheight);\n imagecopyresampled($dst_image, $src_image, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h);\n return $dst_image;\n } else {\n return null;\n }\n }",
"function image_resize ( $args ) { /*\r\n\t\t * Changelog\r\n\t\t *\r\n\t\t * Version 3, July 20, 2007\r\n\t\t * - Cleaned\r\n\t\t *\r\n\t\t * Version 2, August 12, 2006\r\n\t\t * - Changed it to use $args\r\n\t\t */\r\n\t\t\r\n\t\t// Set default variables\r\n\t\t$image = $width_old = $height_old = $width_new = $height_new = $canvas_width = $canvas_height = $canvas_size = null;\r\n\t\t\r\n\t\t$x_old = $y_old = $x_new = $y_new = 0;\r\n\t\t\r\n\t\t// Exract user\r\n\t\textract($args);\r\n\t\t\r\n\t\t// Read image\r\n\t\t$image = image_read($image,false);\r\n\t\tif ( empty($image) ) { // error\r\n\t\t\ttrigger_error('no image was specified', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// Check new dimensions\r\n\t\tif ( empty($width_new) || empty($height_new) ) { // error\r\n\t\t\ttrigger_error('Desired/new dimensions not found', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// Do old dimensions\r\n\t\tif ( empty($width_old) && empty($height_old) ) { // Get the old dimensions from the image\r\n\t\t\t$width_old = imagesx($image);\r\n\t\t\t$height_old = imagesy($image);\r\n\t\t}\r\n\t\t\r\n\t\t// Do canvas dimensions\r\n\t\tif ( empty($canvas_width) && empty($canvas_height) ) { // Set default\r\n\t\t\t$canvas_width = $width_new;\r\n\t\t\t$canvas_height = $height_new;\r\n\t\t}\r\n\t\t\r\n\t\t// Let's force integer values\r\n\t\t$width_old = intval($width_old);\r\n\t\t$height_old = intval($height_old);\r\n\t\t$width_new = intval($width_new);\r\n\t\t$height_new = intval($height_new);\r\n\t\t$canvas_width = intval($canvas_width);\r\n\t\t$canvas_height = intval($canvas_height);\r\n\t\t\r\n\t\t// Create the new image\r\n\t\t$image_new = imagecreatetruecolor($canvas_width, $canvas_height);\r\n\t\t\r\n\t\t// Resample the image\r\n\t\t$image_result = imagecopyresampled(\r\n\t\t\t/* the new image */\r\n\t\t\t$image_new,\r\n\t\t\t/* the old image to update */\r\n\t\t\t$image,\r\n\t\t\t/* the new positions */\r\n\t\t\t$x_new, $y_new,\r\n\t\t\t/* the old positions */\r\n\t\t\t$x_old, $y_old,\r\n\t\t\t/* the new dimensions */\r\n\t\t\t$width_new, $height_new,\r\n\t\t\t/* the old dimensions */\r\n\t\t\t$width_old, $height_old);\r\n\t\t\r\n\t\t// Check\r\n\t\tif ( !$image_result ) { // ERROR\r\n\t\t\ttrigger_error('the image failed to resample', E_USER_WARNING);\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t// return\r\n\t\treturn $image_new;\r\n\t}",
"function crop( $x = 0, $y = 0, $w = 0, $h = 0 )\n\t{\n\t\tif( $w == 0 || $h == 0 )\n\t\t\treturn FALSE;\n\t\t\n\t\t//create a target canvas\n\t\t$new_im = imagecreatetruecolor ( $w, $h );\n\t\n\t\t//copy and resize image to new canvas\n\t\timagecopyresampled( $new_im, $this->im, 0, 0, $x, $y, $w, $h, $w, $h );\n\t\t\n\t\t//delete the old image handle\n\t\timagedestroy( $this->im );\n\t\t\n\t\t//set the new image as the current handle\n\t\t$this->im = $new_im;\n\t}",
"function build_thumbnail($img, $tumb_width, $tumb_height)\n{\n\t$width = imageSX($img);\n\t$height = imageSY($img);\n\n//\t\t\techo sprintf(\" KALL %s %d\",__FILE__,__LINE__);\n\t$target_width = $tumb_width;\n\t$target_height = $tumb_height;\n\t\n\t$target_ratio = $target_width / $target_height;\n\t$img_ratio = $width / $height;\n//\t\t\techo sprintf(\" KALL %s %d\",__FILE__,__LINE__);\n\t\n\t$offx=0;\n\t$offy=0;\n\t$new_width=$width;\n\t$new_height=$height;\n\t\n//\t\t\techo sprintf(\" KALL %s %d\",__FILE__,__LINE__);\n\tif($img_ratio > $target_ratio) {\n\t\t$diff_ratio = $target_ratio / $img_ratio;\n\t\t$new_width = $width * $diff_ratio;\n\t\t$offx = ($width - $new_width) / 2;\n\t}\n//\t\t\techo sprintf(\" KALL %s %d\",__FILE__,__LINE__);\n\tif($img_ratio < $target_ratio){\n\t\t$diff_ratio = $img_ratio / $target_ratio;\n\t\t$new_height = $height * $diff_ratio;\n\t\t$offy = ($height - $new_height) / 2;\n\t}\n//\t\t\techo sprintf(\" KALL %s %d\",__FILE__,__LINE__);\n\n\t$new_img = ImageCreateTrueColor($tumb_width, $tumb_height);\n\n\t// Fill the image black\n//\t\t\techo sprintf(\" KALL %s %d\",__FILE__,__LINE__);\n\tif (!@imagefilledrectangle($new_img, 0, 0, $target_width-1, $target_height-1, 0)) {\n\t\techo \"ERROR\\nCould not fill new image\";\n//\t\texit(0);\n\t}\n//\t\t\techo sprintf(\" KALL %s %d\",__FILE__,__LINE__);\n\n\tif (!@imagecopyresampled($new_img, $img, 0, 0, $offx, $offy, $target_width, $target_height, $new_width, $new_height)) {\n\t\techo \"ERROR\\nCould not resize image\";\n//\t\texit(0);\n\t}\n\n\treturn $new_img;\n}",
"function cropimage($source_url, $new_width=250, $quality=75){\n return false;\n \n if (!file_exists($source_url)){\n echo alertbuilder(\"File does not exist: $source_url\",'warning');\n return false;\n }\n \n //separate the file name and the extention\n $source_url_parts = pathinfo($source_url);\n $filename = $source_url_parts['filename'];\n $extension = strtolower($source_url_parts['extension']);\n \n //detect the width and the height of original image\n $info = getimagesize($source_url);\n \n if($info === false){\n echo alertbuilder('This file is not a valid image', 'warning');\n return false;\n }\n \n $type = $info[2];\n $width = $info[0];\n $height = $info[1];\n \n // resize only when the original image is larger than new width.\n // this helps you to avoid from unwanted resizing.\n if ($width > $new_width) {\n // cool to resize\n } else {\n echo alertbuilder('The image is already smaller than width', 'warning');\n return false;\n }\n \n //get the reduced width\n $reduced_width = ($width - $new_width);\n \n //now convert the reduced width to a percentage, round to 2 decimals\n $reduced_radio = round(($reduced_width / $width) * 100, 2);\n \n // reduce the same percentage from the height, round to 2 decimals\n $reduced_height = round(($height / 100) * $reduced_radio, 2);\n \n //reduce the calculated height from the original height\n $new_height = $height - $reduced_height;\n \n $img = null;\n $imgResized = null;\n \n switch($type) {\n case IMAGETYPE_JPEG:\n $img = imagecreatefromjpeg($source_url);\n $imgResized = imagescale($img, $new_width, $new_height, $quality);\n imagejpeg($imgResized, $source_url); \n break;\n \n case IMAGETYPE_GIF:\n $img = imagecreatefromgif($source_url);\n $imgResized = imagescale($img, $new_width, $new_height, $quality);\n imagegif($imgResized, $source_url); \n break;\n \n case IMAGETYPE_PNG:\n $img = imagecreatefrompng($source_url);\n $imgResized = imagescale($img, $new_width, $new_height, $quality);\n imagepng($imgResized, $source_url); \n break;\n \n default:\n echo alertbuilder('This file is not in JPG, GIF, or PNG format!');\n return false;\n }\n\n //Finally frees any memory associated with image\n imagedestroy($img);\n imagedestroy($imgResized);\n \n return true;\n}",
"function sharpen($amount = 20, $radius = 0.5, $threshold = 2)\n {\n $img = $this->getWorkingImageResource();\n \n if ($amount > 500)\n {\n $amount = 500; \n }\n if ($radius > 50)\n {\n $radius = 50; \n }\n if ($threshold > 255)\n {\n $threshold = 255; \n }\n\n $amount = $amount * 0.016; \n $radius = abs(round($radius * 2)); \n $w = $this->getWorkingImageWidth();\n $h = $this->getWorkingImageHeight();\n\n $imgCanvas = imagecreatetruecolor($w, $h); \n $imgBlur = imagecreatetruecolor($w, $h); \n\n if (function_exists('imageconvolution'))\n { \n $matrix = array( \n array( 1, 2, 1 ), \n array( 2, 4, 2 ), \n array( 1, 2, 1 ) \n ); \n\n imagecopy ($imgBlur, $img, 0, 0, 0, 0, $w, $h); \n imageconvolution($imgBlur, $matrix, 16, 0); \n } \n else\n { \n for ($i = 0; $i < $radius; $i++)\n { \n imagecopy ($imgBlur, $img, 0, 0, 1, 0, $w - 1, $h); // left \n imagecopymerge ($imgBlur, $img, 1, 0, 0, 0, $w, $h, 50); // right \n imagecopymerge ($imgBlur, $img, 0, 0, 0, 0, $w, $h, 50); // center \n imagecopy ($imgCanvas, $imgBlur, 0, 0, 0, 0, $w, $h); \n imagecopymerge ($imgBlur, $imgCanvas, 0, 0, 0, 1, $w, $h - 1, 33.33333 ); // up \n imagecopymerge ($imgBlur, $imgCanvas, 0, 1, 0, 0, $w, $h, 25); // down \n } \n } \n\n // Calculate the difference between the blurred pixels and the original \n // and set the pixels \n // each row\n for ($x = 0; $x < $w-1; $x++)\n { \n // each pixel \n for ($y = 0; $y < $h; $y++)\n { \n if($threshold > 0)\n { \n $rgbOrig = ImageColorAt($img, $x, $y); \n $rOrig = (($rgbOrig >> 16) & 0xFF); \n $gOrig = (($rgbOrig >> 8) & 0xFF); \n $bOrig = ($rgbOrig & 0xFF); \n\n $rgbBlur = ImageColorAt($imgBlur, $x, $y); \n\n $rBlur = (($rgbBlur >> 16) & 0xFF); \n $gBlur = (($rgbBlur >> 8) & 0xFF); \n $bBlur = ($rgbBlur & 0xFF); \n\n // When the masked pixels differ less from the original \n // than the threshold specifies, they are set to their original value. \n if(abs($rOrig - $rBlur) >= $threshold) \n {\n $rNew = max(0, min(255, ($amount * ($rOrig - $rBlur)) + $rOrig));\n }\n else\n {\n $rNew = $rOrig;\n }\n\n if(abs($gOrig - $gBlur) >= $threshold)\n {\n $gNew = max(0, min(255, ($amount * ($gOrig - $gBlur)) + $gOrig));\n }\n else\n {\n $gNew = $gOrig;\n }\n\n if(abs($bOrig - $bBlur) >= $threshold)\n {\n $bNew = max(0, min(255, ($amount * ($bOrig - $bBlur)) + $bOrig));\n }\n else\n {\n $bNew = $bOrig;\n }\n\n if (($rOrig != $rNew) || ($gOrig != $gNew) || ($bOrig != $bNew))\n { \n $pixCol = ImageColorAllocate($img, $rNew, $gNew, $bNew); \n ImageSetPixel($img, $x, $y, $pixCol); \n }\n }\n else\n {\n $rgbOrig = ImageColorAt($img, $x, $y); \n $rOrig = (($rgbOrig >> 16) & 0xFF); \n $gOrig = (($rgbOrig >> 8) & 0xFF); \n $bOrig = ($rgbOrig & 0xFF); \n $rgbBlur = ImageColorAt($imgBlur, $x, $y); \n $rBlur = (($rgbBlur >> 16) & 0xFF); \n $gBlur = (($rgbBlur >> 8) & 0xFF); \n $bBlur = ($rgbBlur & 0xFF); \n\n $rNew = ($amount * ($rOrig - $rBlur)) + $rOrig; \n if($rNew>255)\n {\n $rNew = 255;\n } \n elseif($rNew<0)\n {\n $rNew = 0;\n } \n $gNew = ($amount * ($gOrig - $gBlur)) + $gOrig; \n if($gNew>255)\n {\n $gNew=255;\n } \n elseif($gNew<0)\n {\n $gNew=0;\n } \n $bNew = ($amount * ($bOrig - $bBlur)) + $bOrig; \n if($bNew>255)\n {\n $bNew=255;\n } \n elseif($bNew<0)\n {\n $bNew=0;\n } \n $rgbNew = ($rNew << 16) + ($gNew <<8) + $bNew; \n ImageSetPixel($img, $x, $y, $rgbNew); \n }\n } \n } \n \n $this->setWorkingImageResource($img);\n imagedestroy($imgCanvas);\n imagedestroy($imgBlur);\n }",
"function createThumb($path1, $path2, $file_type, $new_w, $new_h, $squareSize = '')\n {\n $source_image = FALSE;\n \n if (preg_match(\"/jpg|JPG|jpeg|JPEG/\", $file_type)) {\n $source_image = imagecreatefromjpeg($path1);\n }\n elseif (preg_match(\"/png|PNG/\", $file_type)) {\n \n if (!$source_image = @imagecreatefrompng($path1)) {\n $source_image = imagecreatefromjpeg($path1);\n }\n }\n elseif (preg_match(\"/gif|GIF/\", $file_type)) {\n $source_image = imagecreatefromgif($path1);\n }\t\t\n if ($source_image == FALSE) {\n $source_image = imagecreatefromjpeg($path1);\n }\n\n $orig_w = imageSX($source_image);\n $orig_h = imageSY($source_image);\n \n if ($orig_w < $new_w && $orig_h < $new_h) {\n $desired_width = $orig_w;\n $desired_height = $orig_h;\n } else {\n $scale = min($new_w / $orig_w, $new_h / $orig_h);\n $desired_width = ceil($scale * $orig_w);\n $desired_height = ceil($scale * $orig_h);\n }\n \n if ($squareSize != '') {\n $desired_width = $desired_height = $squareSize;\n }\n\n /* create a new, \"virtual\" image */\n $virtual_image = imagecreatetruecolor($desired_width, $desired_height);\n // for PNG background white----------->\n $kek = imagecolorallocate($virtual_image, 255, 255, 255);\n imagefill($virtual_image, 0, 0, $kek);\n \n if ($squareSize == '') {\n /* copy source image at a resized size */\n imagecopyresampled($virtual_image, $source_image, 0, 0, 0, 0, $desired_width, $desired_height, $orig_w, $orig_h);\n } else {\n $wm = $orig_w / $squareSize;\n $hm = $orig_h / $squareSize;\n $h_height = $squareSize / 2;\n $w_height = $squareSize / 2;\n \n if ($orig_w > $orig_h) {\n $adjusted_width = $orig_w / $hm;\n $half_width = $adjusted_width / 2;\n $int_width = $half_width - $w_height;\n imagecopyresampled($virtual_image, $source_image, -$int_width, 0, 0, 0, $adjusted_width, $squareSize, $orig_w, $orig_h);\n }\n\n elseif (($orig_w <= $orig_h)) {\n $adjusted_height = $orig_h / $wm;\n $half_height = $adjusted_height / 2;\n imagecopyresampled($virtual_image, $source_image, 0,0, 0, 0, $squareSize, $adjusted_height, $orig_w, $orig_h);\n } else {\n imagecopyresampled($virtual_image, $source_image, 0, 0, 0, 0, $squareSize, $squareSize, $orig_w, $orig_h);\n }\n }\n \n \n $img_size=filesize($virtual_image);\n $quality=90;\n if($img_size>= 2097152)\n {\n $quality= 50;\n }\n else if($img_size<= 2097152 && $img_size>= 1048576)\n {\n $quality= 70;\n }\n\n if (@imagejpeg($virtual_image, $path2, $quality)) {\n imagedestroy($virtual_image);\n imagedestroy($source_image);\n return TRUE;\n } else {\n return FALSE;\n }\n }",
"function imagecropper($source_path, $max_width, $max_height, $bili) {\n $source_info = getimagesize($source_path); //获取原始图片信息\n $source_width = $source_info[0]; //获取原始图片的宽度\n $source_height = $source_info[1]; //获取原始图片的高度\n $source_mime = $source_info['mime']; //获取原始图片的文件类型\n\n //先计算出要裁剪后的图片尺寸是多大\n if($source_width<=$max_width) { //1、如果原始图片的宽,小于最大允许的宽\n $newwidth = $source_width;\n $newheight = $source_width*$bili;\n }elseif($source_height<=$max_height) {//2、如果原始图片的高,小于最大允许的高\n $newheight = $source_height;\n $newwidth = $newheight/$bili;\n }else {\n $b1 = $max_width/$source_width;\n $b2 = $max_height/$source_height;\n $b3 = $b1<$b2 ? $b1 : $b2;\n $newwidth = ceil($source_width*$b3);\n $newheight = ceil($source_height*$b3);\n }\n\n $target_width = $newwidth>$newheight ? $newwidth : $newheight;\n $target_height = $newwidth<$newheight ? $newwidth : $newheight;\n\n if($target_width*$bili>$target_height) {\n $target_width = $target_height/$bili;\n }\n if($target_height*$bili>$target_width) {\n $target_height = $target_width/$bili;\n }\n\n $source_ratio = $source_height / $source_width;\n $target_ratio = $target_height / $target_width;\n\n if ($source_ratio > $target_ratio) {\n $cropped_width = $source_width;\n $cropped_height = $source_width * $target_ratio;\n $source_x = 0;\n $source_y = ($source_height - $cropped_height) / 2;\n }elseif ($source_ratio < $target_ratio) {\n $cropped_width = $source_height / $target_ratio;\n $cropped_height = $source_height;\n $source_x = ($source_width - $cropped_width) / 2;\n $source_y = 0;\n }else {\n $cropped_width = $source_width;\n $cropped_height = $source_height;\n $source_x = 0;\n $source_y = 0;\n }\n\n switch ($source_mime) {\n case 'image/gif':\n $source_image = imagecreatefromgif($source_path);\n break;\n case 'image/jpeg':\n $source_image = imagecreatefromjpeg($source_path);\n break;\n case 'image/png':\n $source_image = imagecreatefrompng($source_path);\n break;\n default:\n return false;\n break;\n }\n\n $target_image = imagecreatetruecolor($target_width, $target_height);\n $cropped_image = imagecreatetruecolor($cropped_width, $cropped_height);\n\n // 裁剪\n imagecopy($cropped_image, $source_image, 0, 0, $source_x, $source_y, $cropped_width, $cropped_height);\n // 缩放\n imagecopyresampled($target_image, $cropped_image, 0, 0, 0, 0, $target_width, $target_height, $cropped_width, $cropped_height);\n\n imagejpeg($target_image,$source_path);\n imagedestroy($source_image);\n imagedestroy($target_image);\n imagedestroy($cropped_image);\n}",
"public function refitCropCoords($coords,$targetAspect)\n {\n $ocoords = $coords;\n\n if(!isset($coords['w']) || !$coords['w'])\n {\n $coords['w'] = $coords['x2']-$coords['x'];\n }\n if(!isset($coords['h']) || !$coords['h'])\n {\n $coords['h'] = $coords['y2']-$coords['y']; \n }\n\n $originalAspect = $oA = $coords['w']/$coords['h'];\n $tA = $targetAspect;\n\n if($tA< $coords['w']/$coords['h'])\n {\n //widen\n $origW = $coords['w'];\n $coords['w'] = $coords['w']*($tA/$oA);//anaW\n $coords['x'] = $coords['x']-($coords['w'] - $origW)/2;\n $coords['x2']= $coords['x']+$coords['w'];\n }\n else\n {\n //heighten\n $origH = $coords['h'];\n $coords['h'] = $coords['h']/($tA/$oA);//anaH\n $coords['y'] = $coords['y']-($coords['h'] - $origH)/2;\n $coords['y2'] = $coords['y']+$coords['h'];\n }\n\n return $coords;\n }",
"function image_mirror_gd()\n\t{\t\t\n\t\tif ( ! $src_img = $this->image_create_gd())\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t$width = $this->src_width;\n\t\t$height = $this->src_height;\n\n\t\tif ($this->rotation == 'hor')\n\t\t{\n\t\t\tfor ($i = 0; $i < $height; $i++)\n\t\t\t{\t\t \n\t\t\t\t$left = 0; \n\t\t\t\t$right = $width-1; \n\t\n\t\t\t\twhile ($left < $right)\n\t\t\t\t{ \n\t\t\t\t\t$cl = imagecolorat($src_img, $left, $i); \n\t\t\t\t\t$cr = imagecolorat($src_img, $right, $i);\n\t\t\t\t\t\n\t\t\t\t\timagesetpixel($src_img, $left, $i, $cr); \n\t\t\t\t\timagesetpixel($src_img, $right, $i, $cl); \n\t\t\t\t\t\n\t\t\t\t\t$left++; \n\t\t\t\t\t$right--; \n\t\t\t\t} \n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor ($i = 0; $i < $width; $i++)\n\t\t\t{\t\t \n\t\t\t\t$top = 0; \n\t\t\t\t$bot = $height-1; \n\t\n\t\t\t\twhile ($top < $bot)\n\t\t\t\t{ \n\t\t\t\t\t$ct = imagecolorat($src_img, $i, $top);\n\t\t\t\t\t$cb = imagecolorat($src_img, $i, $bot);\n\t\t\t\t\t\n\t\t\t\t\timagesetpixel($src_img, $i, $top, $cb); \n\t\t\t\t\timagesetpixel($src_img, $i, $bot, $ct); \n\t\t\t\t\t\n\t\t\t\t\t$top++; \n\t\t\t\t\t$bot--; \n\t\t\t\t} \n\t\t\t}\t\t\n\t\t}\n\t\t\n\t\t/** ---------------------------------\n\t\t/** Save the Image\n\t\t/** ---------------------------------*/\n\t\tif ( ! $this->image_save_gd($src_img))\n\t\t{\t\t\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\t/** ---------------------------------\n\t\t/** Kill the file handles\n\t\t/** ---------------------------------*/\n\t\timagedestroy($src_img);\n\t\t\n\t\t// Set the file to 777\n\t\t@chmod($this->full_dst_path, FILE_WRITE_MODE);\t\t\t\n\t\t\n\t\treturn TRUE;\n\t}",
"public function crop_image($w, $h)\n\t{\n // This function resizes this image to fit in the box $w x $h, cropping to fill the entire image\n $image_size = $this->image_size();\n if ($image_size[0] == $w && $image_size[1] == $h) {\n // No need to crop\n return;\n }\n $ratio = $image_size[0] / $image_size[1];\n $goal_ratio = $w / $h;\n\n // Calculate the new image size\n if ($ratio < $goal_ratio) {\n // Tall image, crop top and bottom\n $l = 0;\n $r = $image_size[0];\n $height = $image_size[0] / $goal_ratio;\n $t = ($image_size[1] / 2) - ($height / 2);\n $b = ($image_size[1] / 2) + ($height / 2);\n } else {\n // Wide image, crop top and bottom\n $t = 0;\n $b = $image_size[1];\n $width = $image_size[1] * $goal_ratio;\n $l = ($image_size[0] / 2) - ($width / 2);\n $r = ($image_size[0] / 2) + ($width / 2);\n }\n\n // Create a new image for the resized image\n $oldimage = $this->load_image();\n $newimage = imagecreatetruecolor($w, $h);\n imagecopyresampled($newimage, $oldimage, 0, 0, $l, $t, $w, $h, $r - $l, $b - $t);\n $filename = tempnam(sys_get_temp_dir(), 'img');\n if (preg_match('/jpeg/', $image_size['mime'])) {\n imagejpeg($newimage, $filename, 100);\n } elseif (preg_match('/gif/', $image_size['mime'])) {\n imagegif($newimage, $filename);\n } elseif (preg_match('/png/', $image_size['mime'])) {\n imagepng($newimage, $filename);\n }\n $this->delete_local_file();\n $this->local_file = $filename;\n\t}",
"public function resize_square($side)\n\t{\n\t\tif ($this->srcOrientation == EImageProcessor::LANDSCAPE)\n\t\t\t$this->intern_resize_width($side, $side);\n\t\telse\n\t\t\t$this->intern_resize_height($side, $side);\n\t}",
"public function crop()\n {\n }",
"function resize_crop_image($max_width, $max_height, $source_file, $dst_dir, $quality=80){\r\n $imgsize = getimagesize($source_file);\r\n $width = $imgsize[0];\r\n $height = $imgsize[1];\r\n $mime = $imgsize['mime'];\r\n\r\n switch($mime){\r\n case 'image/gif':\r\n $image_create = \"imagecreatefromgif\";\r\n $image = \"imagegif\";\r\n break;\r\n\r\n case 'image/png':\r\n $image_create = \"imagecreatefrompng\";\r\n $image = \"imagepng\";\r\n //$quality = 7;\r\n break;\r\n\r\n case 'image/jpeg':\r\n $image_create = \"imagecreatefromjpeg\";\r\n $image = \"imagejpeg\";\r\n break;\r\n\r\n default:\r\n return false;\r\n break;\r\n }\r\n\r\n $dst_img = imagecreatetruecolor($max_width, $max_height);\r\n $src_img = $image_create($source_file);\r\n\r\n $width_new = $height * $max_width / $max_height;\r\n $height_new = $width * $max_height / $max_width;\r\n //if the new width is greater than the actual width of the image, then the height is too large and the rest cut off, or vice versa\r\n if($width_new > $width){\r\n //cut point by height\r\n $h_point = (($height - $height_new) / 2);\r\n //copy image\r\n imagecopyresampled($dst_img, $src_img, 0, 0, 0, $h_point, $max_width, $max_height, $width, $height_new);\r\n }else{\r\n //cut point by width\r\n $w_point = (($width - $width_new) / 2);\r\n imagecopyresampled($dst_img, $src_img, 0, 0, $w_point, 0, $max_width, $max_height, $width_new, $height);\r\n }\r\n\r\n //$image($dst_img, $dst_dir, $quality);\r\n imagejpeg($dst_img, $dst_dir, $quality);\r\n\r\n if($dst_img)imagedestroy($dst_img);\r\n if($src_img)imagedestroy($src_img);\r\n}",
"public function resizeInSquareFromFile($src_name,$dest_name,$newwidth,$newheight,$background,$ext)\n {\n //Check extension of file\n if(empty($ext))\n {\n $ext = $this->options[parent::IMAGE_ITEM_DEFAULT_TYPE];\n }\n\n //Create image source from file name\n $source_image = $this->createSourceImage($src_name,$ext);\n \n //Check source\n if(!$source_image)\n {\n return false;\n }\n\n //Check background\n if(empty($background))\n {\n $background = $this->options[self::IMAGE_ITEM_BACKGROUND];\n }\n\n //Check new height\n if(empty($newheight))\n {\n $newheight = $newwidth;\n }\n\n //Get old size\n $old_x = imagesx($source_image);\n $old_y = imagesy($source_image);\n\n //Check have correct site\n if($old_x <= $newwidth && $old_y <= $newheight)\n {\n //Destroy image source\n imagedestroy($source_image);\n\n //Return image file\n return copy($src_name,$dest_name);\n }\n\n //Resize keep width\n if($old_x < $newwidth)\n {\n //Check size\n $newwidth = $old_x;\n if($newwidth > $newheight)\n {\n $newwidth = $newheight;\n }\n\n //Crop image \n $dest_image = imagecreatetruecolor($newwidth, $newheight);\n imagecopyresampled($dest_image, $source_image, 0, 0, 0, 0, $newwidth , $newheight, $newwidth, $newheight);\n }\n else\n {\n $newheight = ceil((($newwidth*$old_y)/$old_x));\n $dest_image = imagecreatetruecolor($newwidth, $newwidth);\n list($r,$g,$b) = explode(\",\",$background);\n $color= imagecolorallocate($dest_image, $r, $g, $b);\n $move_space =0;\n if($old_x > $old_y )\n {\n $move_space = ceil(($newwidth - $newheight)/2);\n }\n\n //Check size\n if($old_y < $newwidth)\n {\n $newwidth = $old_y;\n $newheight = $newwidth;\n } \n\n //Crop image\n imagefill($dest_image,0,0,$color);\n imagecopyresampled($dest_image, $source_image, 0, -$move_space, 0, 0, $newwidth , $newheight, $old_x, $old_y);\n }\n\n //Put binary string\n imagejpeg($dest_image,$dest_name,$this->options[parent::IMAGE_ITEM_QUALITY]);\n\n //Destroy images\n imagedestroy($dest_image);\n imagedestroy($source_image);\n\n //Return boolean\n return true;\n }",
"function createThumb($path1, $path2, $file_type, $new_w, $new_h, $squareSize = ''){\n\t$source_image = FALSE;\n\t\n\tif (preg_match(\"/jpg|JPG|jpeg|JPEG/\", $file_type)) {\n\t\t$source_image = imagecreatefromjpeg($path1);\n\t}\n\telseif (preg_match(\"/png|PNG/\", $file_type)) {\n\t\t\n\t\tif (!$source_image = @imagecreatefrompng($path1)) {\n\t\t\t$source_image = imagecreatefromjpeg($path1);\n\t\t}\n\t}\n\telseif (preg_match(\"/gif|GIF/\", $file_type)) {\n\t\t$source_image = imagecreatefromgif($path1);\n\t}\t\t\n\tif ($source_image == FALSE) {\n\t\t$source_image = imagecreatefromjpeg($path1);\n\t}\n\n\t$orig_w = imageSX($source_image);\n\t$orig_h = imageSY($source_image);\n\t\n\tif ($orig_w < $new_w && $orig_h < $new_h) {\n\t\t$desired_width = $orig_w;\n\t\t$desired_height = $orig_h;\n\t} else {\n\t\t$scale = min($new_w / $orig_w, $new_h / $orig_h);\n\t\t$desired_width = ceil($scale * $orig_w);\n\t\t$desired_height = ceil($scale * $orig_h);\n\t}\n\t\t\t\n\tif ($squareSize != '') {\n\t\t$desired_width = $desired_height = $squareSize;\n\t}\n\n\t/* create a new, \"virtual\" image */\n\t$virtual_image = imagecreatetruecolor($desired_width, $desired_height);\n\t// for PNG background white----------->\n\t$kek = imagecolorallocate($virtual_image, 255, 255, 255);\n\timagefill($virtual_image, 0, 0, $kek);\n\t\n\tif ($squareSize == '') {\n\t\t/* copy source image at a resized size */\n\t\timagecopyresampled($virtual_image, $source_image, 0, 0, 0, 0, $desired_width, $desired_height, $orig_w, $orig_h);\n\t} else {\n\t\t$wm = $orig_w / $squareSize;\n\t\t$hm = $orig_h / $squareSize;\n\t\t$h_height = $squareSize / 2;\n\t\t$w_height = $squareSize / 2;\n\t\t\n\t\tif ($orig_w > $orig_h) {\n\t\t\t$adjusted_width = $orig_w / $hm;\n\t\t\t$half_width = $adjusted_width / 2;\n\t\t\t$int_width = $half_width - $w_height;\n\t\t\timagecopyresampled($virtual_image, $source_image, -$int_width, 0, 0, 0, $adjusted_width, $squareSize, $orig_w, $orig_h);\n\t\t}\n\n\t\telseif (($orig_w <= $orig_h)) {\n\t\t\t$adjusted_height = $orig_h / $wm;\n\t\t\t$half_height = $adjusted_height / 2;\n\t\t\timagecopyresampled($virtual_image, $source_image, 0,0, 0, 0, $squareSize, $adjusted_height, $orig_w, $orig_h);\n\t\t} else {\n\t\t\timagecopyresampled($virtual_image, $source_image, 0, 0, 0, 0, $squareSize, $squareSize, $orig_w, $orig_h);\n\t\t}\n\t}\n\t\n\tif (@imagejpeg($virtual_image, $path2, 90)) {\n\t\timagedestroy($virtual_image);\n\t\timagedestroy($source_image);\n\t\treturn TRUE;\n\t} else {\n\t\treturn FALSE;\n\t}\n}",
"private static function resize_image($source, $width, $height){\n\t\t$source_width = imagesx($source);\n\t\t$source_height = imagesy($source);\n\t\t$source_aspect = round($source_width / $source_height, 1);\n\t\t$target_aspect = round($width / $height, 1);\n\t\n\t\t$resized = imagecreatetruecolor($width, $height);\n\t\n\t\tif ($source_aspect < $target_aspect){\n\t\t\t// higher\n\t\t\t$new_size = array($width, ($width / $source_width) * $source_height);\n\t\t\t$source_pos = array(0, (($new_size[1] - $height) * ($source_height / $new_size[1])) / 2);\n\t\t}else if ($source_aspect > $target_aspect){\n\t\t\t// wider\n\t\t\t$new_size = array(($height / $source_height) * $source_width, $height);\n\t\t\t$source_pos = array((($new_size[0] - $width) * ($source_width / $new_size[0])) / 2, 0);\n\t\t}else{\n\t\t\t// same shape\n\t\t\t$new_size = array($width, $height);\n\t\t\t$source_pos = array(0, 0);\n\t\t}\n\t\n\t\tif ($new_size[0] < 1) $new_size[0] = 1;\n\t\tif ($new_size[1] < 1) $new_size[1] = 1;\n\t\n\t\timagecopyresampled($resized, $source, 0, 0, $source_pos[0], $source_pos[1], $new_size[0], $new_size[1], $source_width, $source_height);\n\t\n\t\treturn $resized;\n\t}",
"public static function CROP()\n {\n return new ThumbnailAspectMode(self::CROP);\n }",
"function getRadius($w, $h, $pixel, $width, $height, $topSquares, $simplifiedPixels, $radius = 0, $maximumRadius = null) {\n if ($maximumRadius === null) {\n foreach ($topSquares as $topSquare) {\n if ($w < $topSquare['w']) {\n $minW = $topSquare['w'] - $topSquare['radius'] - $w;\n } else {\n $minW = $w - $topSquare['w'] - $topSquare['radius'];\n }\n\n if ($h < $topSquare['h']) {\n $minH = $topSquare['h'] - $topSquare['radius'] - $h;\n } else {\n $minH = $h - $topSquare['h'] - $topSquare['radius'];\n }\n\n if ($maximumRadius === null || $maximumRadius > max($minW, $minH)) {\n $maximumRadius = max($minW, $minH);\n }\n }\n }\n if ($maximumRadius !== null && $maximumRadius <= $radius) {\n return $radius;\n }\n \n $radius++;\n \n // Check in boundaries of image\n if ($w - $radius < 0 || $h - $radius < 0 || $w + $radius >= $width || $h + $radius >= $height) {\n return $radius;\n }\n\n // Check correct shade\n if (\n !matchPixels($pixel, $simplifiedPixels[$w + $radius][$h])\n || !matchPixels($pixel, $simplifiedPixels[$w - $radius][$h])\n || !matchPixels($pixel, $simplifiedPixels[$w][$h + $radius])\n || !matchPixels($pixel, $simplifiedPixels[$w][$h - $radius])\n ) {\n return $radius - 1;\n }\n for ($distance = 1; $distance <= $radius; $distance++) {\n if (\n !matchPixels($pixel, $simplifiedPixels[$w + $radius][$h + $distance])\n || !matchPixels($pixel, $simplifiedPixels[$w + $radius][$h - $distance])\n || !matchPixels($pixel, $simplifiedPixels[$w - $radius][$h + $distance])\n || !matchPixels($pixel, $simplifiedPixels[$w - $radius][$h - $distance])\n || !matchPixels($pixel, $simplifiedPixels[$w - $distance][$h + $radius])\n || !matchPixels($pixel, $simplifiedPixels[$w + $distance][$h + $radius])\n || !matchPixels($pixel, $simplifiedPixels[$w - $distance][$h - $radius])\n || !matchPixels($pixel, $simplifiedPixels[$w + $distance][$h - $radius])\n ) {\n return $radius - 1;\n }\n }\n\n // Recurse\n return getRadius($w, $h, $pixel, $width, $height, $topSquares, $simplifiedPixels, $radius, $maximumRadius);\n }",
"public function CalcWidthHeight()\n {\n list($this->width, $this->height) = $this->imgInfo;\n\n $aspectRatio = $this->width / $this->height;\n\n if($this->cropToFit && $this->newWidth && $this->newHeight) {\n $targetRatio = $this->newWidth / $this->newHeight;\n $this->cropWidth = $targetRatio > $aspectRatio ? $this->width : round($this->height * $targetRatio);\n $this->cropHeight = $targetRatio > $aspectRatio ? round($this->width / $targetRatio) : $this->height;\n if($this->verbose) { self::verbose(\"Crop to fit into box of {$this->newWidth}x{$this->newHeight}. Cropping dimensions: {$this->cropWidth}x{$this->cropHeight}.\"); }\n }\n else if($this->newWidth && !$this->newHeight) {\n $this->newHeight = round($this->newWidth / $aspectRatio);\n if($this->verbose) { self::verbose(\"New width is known {$this->newWidth}, height is calculated to {$this->newHeight}.\"); }\n }\n else if(!$this->newWidth && $this->newHeight) {\n $this->newWidth = round($this->newHeight * $aspectRatio);\n if($this->verbose) { self::verbose(\"New height is known {$this->newHeight}, width is calculated to {$this->newWidth}.\"); }\n }\n else if($this->newWidth && $this->newHeight) {\n $ratioWidth = $this->width / $this->newWidth;\n $ratioHeight = $this->height / $this->newHeight;\n $ratio = ($ratioWidth > $ratioHeight) ? $ratioWidth : $ratioHeight;\n $this->newWidth = round($this->width / $ratio);\n $this->newHeight = round($this->height / $ratio);\n if($this->verbose) { self::verbose(\"New width & height is requested, keeping aspect ratio results in {$this->newWidth}x{$this->newHeight}.\"); }\n }\n else {\n $this->newWidth = $this->width;\n $this->newHeight = $this->height;\n if($this->verbose) { self::verbose(\"Keeping original width & heigth.\"); }\n }\n }",
"public function image_mirror_gd()\n\t{\n\t\tif ( ! $src_img = $this->image_create_gd())\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t$width = $this->orig_width;\n\t\t$height = $this->orig_height;\n\n\t\tif ($this->rotation_angle === 'hor')\n\t\t{\n\t\t\tfor ($i = 0; $i < $height; $i++)\n\t\t\t{\n\t\t\t\t$left = 0;\n\t\t\t\t$right = $width - 1;\n\n\t\t\t\twhile ($left < $right)\n\t\t\t\t{\n\t\t\t\t\t$cl = imagecolorat($src_img, $left, $i);\n\t\t\t\t\t$cr = imagecolorat($src_img, $right, $i);\n\n\t\t\t\t\timagesetpixel($src_img, $left, $i, $cr);\n\t\t\t\t\timagesetpixel($src_img, $right, $i, $cl);\n\n\t\t\t\t\t$left++;\n\t\t\t\t\t$right--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\tfor ($i = 0; $i < $width; $i++)\n\t\t\t{\n\t\t\t\t$top = 0;\n\t\t\t\t$bottom = $height - 1;\n\n\t\t\t\twhile ($top < $bottom)\n\t\t\t\t{\n\t\t\t\t\t$ct = imagecolorat($src_img, $i, $top);\n\t\t\t\t\t$cb = imagecolorat($src_img, $i, $bottom);\n\n\t\t\t\t\timagesetpixel($src_img, $i, $top, $cb);\n\t\t\t\t\timagesetpixel($src_img, $i, $bottom, $ct);\n\n\t\t\t\t\t$top++;\n\t\t\t\t\t$bottom--;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// Show the image\n\t\tif ($this->dynamic_output === TRUE)\n\t\t{\n\t\t\t$this->image_display_gd($src_img);\n\t\t}\n\t\telseif ( ! $this->image_save_gd($src_img)) // ... or save it\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\n\t\t// Kill the file handles\n\t\timagedestroy($src_img);\n\n\t\tchmod($this->full_dst_path, $this->file_permissions);\n\n\t\treturn TRUE;\n\t}",
"function isSquare(){\r\n if($this->width == $this->height){\r\n return true; //Square\r\n } else {\r\n return false; //Not a square\r\n }\r\n }",
"public function resizeInSquareFromBlob(&$binary_source,$newwidth,$background,$ext)\n {\n //Create image source from string\n $source_image = imagecreatefromstring($binary_source);\n\n //Check source\n if(!$source_image)\n {\n return false;\n }\n\n //Check background\n if(empty($background))\n {\n $background = $this->options[self::IMAGE_ITEM_BACKGROUND];\n }\n\n //Get old size\n $old_x = imagesx($source_image);\n $old_y = imagesy($source_image);\n\n //Check have correct site\n if($old_x <= $newwidth && $old_y <= $newwidth)\n {\n //Destroy image source\n imagedestroy($source_image);\n\n //Return blob image data\n return $binary_source;\n }\n\n //Resize keep width\n if($old_x < $newwidth)\n {\n $newheight = $newwidth;\n $newwidth = $old_x;\n $dest_image = imagecreatetruecolor($newwidth, $newheight);\n imagecopyresampled($dest_image, $source_image, 0, 0, 0, 0, $newwidth , $newheight, $newwidth, $newheight);\n }\n else\n {\n $newheight = ceil((($newwidth*$old_y)/$old_x));\n $dest_image = imagecreatetruecolor($newwidth, $newwidth);\n list($r,$g,$b) = explode(\",\",$background);\n $color= imagecolorallocate($dest_image, $r, $g, $b);\n $move_space =0;\n if($old_x > $old_y )\n {\n $move_space = ceil(($newwidth - $newheight)/2);\n } \n imagefill($dest_image,0,0,$color);\n imagecopyresampled($dest_image, $source_image, 0, $move_space, 0, 0, $newwidth , $newheight, $old_x, $old_y);\n }\n\n //Get binary string\n ob_start();\n imagejpeg($dest_image,null,$this->options[parent::IMAGE_ITEM_QUALITY]);\n $return = ob_get_contents();\n ob_end_clean();\n\n //Destroy images\n imagedestroy($dest_image);\n imagedestroy($source_image);\n\n //Return blob image data\n return $return;\n }",
"function resizeImage($src_file, $dest_file, $new_size=100, $resize_aspect=\"sq\", $quality=\"80\")\n\t{\n\t\t$imginfo = getimagesize($src_file);\n\t\t\n\t\tif ($imginfo == null) {\n\t\treturn false;\n\t\t}\t \n\t\t\n\t\t// GD2 can only handle JPG, PNG & GIF images\n\t\tif (!$imginfo[2] > 0 && $imginfo[2] <= 3 ) {\n\t\t return false;\n\t\t}\n\t\t\n\t\t// height/width\n\t\t$srcWidth = $imginfo[0];\n\t\t$srcHeight = $imginfo[1];\n\t\t//$resize_aspect = \"sq\";\n\t\tif ($resize_aspect == 'ht') {\n\t\t $ratio = $srcHeight / $new_size;\n\t\t} elseif ($resize_aspect == 'wd') {\n\t\t $ratio = $srcWidth / $new_size;\n\t\t} elseif ($resize_aspect == 'sq') {\n\t\t $ratio = min($srcWidth, $srcHeight) / $new_size;\n\t\t} else {\n\t\t $ratio = max($srcWidth, $srcHeight) / $new_size;\n\t\t}\n\t\t\n\t\t/**\n\t\t* Initialize variables\n\t\t*/\n\t\t$clipX = 0;\n\t\t$clipY = 0;\n\t\t\n\t\t$ratio = max($ratio, 1.0);\n\t\tif ($resize_aspect == 'sq'){\n\t\t$destWidth = (int)(min($srcWidth,$srcHeight) / $ratio);\n\t\t$destHeight = (int)(min($srcWidth,$srcHeight) / $ratio);\n\t\tif($srcHeight > $srcWidth){\n\t\t$clipX = 0;\n\t\t$clipY = ((int)($srcHeight - $srcWidth)/2);\n\t\t$srcHeight = $srcWidth;\n\t\t}elseif($srcWidth > $srcHeight){\n\t\t$clipX = ((int)($srcWidth - $srcHeight)/2);\n\t\t$clipY = 0;\n\t\t$srcWidth = $srcHeight;\n\t\t}\n\t\t}else{\n\t\t$destWidth = (int)($srcWidth / $ratio);\n\t\t$destHeight = (int)($srcHeight / $ratio);\n\t\t}\n\t\t\n\t\tif (!function_exists('imagecreatefromjpeg')) {\n\t\t echo 'PHP running on your server does not support the GD image library, check with your webhost if ImageMagick is installed';\n\t\t exit;\n\t\t}\n\t\tif (!function_exists('imagecreatetruecolor')) {\n\t\t echo 'PHP running on your server does not support GD version 2.x, please switch to GD version 1.x on the admin page';\n\t\t exit;\n\t\t}\n\t\t\n\t\tif ($imginfo[2] == 1 )\n\t\t $src_img = imagecreatefromgif($src_file);\n\t\telseif ($imginfo[2] == 2)\n\t\t $src_img = imagecreatefromjpeg($src_file);\n\t\telse\n\t\t $src_img = imagecreatefrompng($src_file);\n\t\tif (!$src_img){\n\t\t return false;\n\t\t}\n\t\tif ($imginfo[2] == 1 ) {\n\t\t$dst_img = imagecreate($destWidth, $destHeight);\n\t\t} else {\n\t\t$dst_img = imagecreatetruecolor($destWidth, $destHeight);\n\t\t}\n\t\t\n\t\timagecopyresampled($dst_img, $src_img, 0, 0, $clipX, $clipY, (int)$destWidth, (int)$destHeight, $srcWidth, $srcHeight);\n\t\timagejpeg($dst_img, $dest_file, $quality);\n\t\timagedestroy($src_img);\n\t\timagedestroy($dst_img);\n\t\t\n\t\t// We check that the image is valid\n\t\t$imginfo = getimagesize($dest_file);\n\t\tif ($imginfo == null) {\n\t\t\t@unlink($dest_file);\n\t\t\treturn false;\n\t\t} else {\n\t\t\treturn true;\n\t\t}\n\t}",
"public function getCropBox($fallback = true, $asRect = true) {}",
"function imageToCanvas ($_image, $_canvasWidth, $_canvasHeight, $color='white' ,$extension, $forceScale=false)\n{\n if (is_string($_image)) {\n if (is_file($_image)) {\n if($extension==\"jpg\" || $extension==\"jpeg\" ){\n\t\t\t\t$_image = imagecreatefromjpeg($_image);\n\t\t\t}\n\t\t\telse if($extension==\"png\"){\n\t\t\t\t$_image = imagecreatefrompng($_image);\n\t\t\t}else {\n\t\t\t\t$_image = imagecreatefromgif($_image);\n\t\t\t}\n } else {\n return \"Incorrect imagepath >> No file here \" . $_image;\n }\n } \n \n $width = imagesx($_image);\n $height = imagesy($_image);\n $image_aspect_ratio = $width / $height;\n $canvas_aspect_ratio = $_canvasWidth / $_canvasHeight;\n \n if($forceScale == 'true')\n {\n // scale by height\n if ($image_aspect_ratio < $canvas_aspect_ratio) {\n $new_height = $_canvasHeight;\n $new_width = ($new_height/$height) * $width;\n } \n // scale by width\n else {\n $new_width = $_canvasWidth;\n $new_height = ($new_width/$width) * $height;\n }\n }\n else\n {\n if($width > $_canvasWidth)\n {\n $new_width = $_canvasWidth;\n $new_height = ($new_width/$width) * $height;\n }\n elseif($height > $_canvasHeight)\n {\n $new_height = $_canvasHeight;\n $new_width = ($new_height/$height) * $width;\n }\n else\n {\n $new_height = $height;\n $new_width = $width;\n } \n }\n \n # offset values (ie. center the resized image to canvas)\n $xoffset = ($_canvasWidth - $new_width) / 2;\n $yoffset = ($_canvasHeight - $new_height) / 2;\n \n $image_resized = imagecreatetruecolor($_canvasWidth, $_canvasHeight);\n \n # fill colour\n\tif ($color == 'white'){\n\t $fill_color = imagecolorallocate($image_resized, 255, 255, 255);\n\t}else if ($color == 'black'){\n\t\t$fill_color = imagecolorallocate($image_resized, 0, 0, 0);\n\t}else if ($color == 'tran'){\t\t\n\t\t$black = imagecolorallocate($image_resized, 0, 0, 0);\n\t\timagecolortransparent($fill_color, $black);\n\t\t//$fill_color = imagecolortransparent($image_resized);\n\t\t//$fill_color = $image_resized;\n\t}\n imagefill($image_resized, 0, 0, $fill_color);\n imagecopyresampled($image_resized, $_image, $xoffset, $yoffset, 0, 0, $new_width, $new_height, $width, $height);\n \n imagedestroy($_image);\n return $image_resized;\n}",
"function resize_image($src, $width, $height){\n // initializing\n $save_path = Wordless::theme_temp_path();\n $img_filename = Wordless::join_paths($save_path, md5($width . 'x' . $height . '_' . basename($src)) . '.jpg');\n\n // if file doesn't exists, create it\n if (!file_exists($img_filename)) {\n $to_scale = 0;\n $to_crop = 0;\n\n // Get orig dimensions\n list ($width_orig, $height_orig, $type_orig) = getimagesize($src);\n\n // get original image ... to improve!\n switch($type_orig){\n case IMAGETYPE_JPEG: $image = imagecreatefromjpeg($src);\n break;\n case IMAGETYPE_PNG: $image = imagecreatefrompng($src);\n break;\n case IMAGETYPE_GIF: $image = imagecreatefromgif($src);\n break;\n default:\n return;\n }\n\n // which is the new smallest?\n if ($width < $height)\n $min_dim = $width;\n else\n $min_dim = $height;\n\n // which is the orig smallest?\n if ($width_orig < $height_orig)\n $min_orig = $width_orig;\n else\n $min_orig = $height_orig;\n\n // image of the right size\n if ($height_orig == $height && $width_orig == $width) ; // nothing to do\n // if something smaller => scale\n else if ($width_orig < $width) {\n $to_scale = 1;\n $ratio = $width / $width_orig;\n }\n else if ($height_orig < $height) {\n $to_scale = 1;\n $ratio = $height / $height_orig;\n }\n // if both bigger => scale\n else if ($height_orig > $height && $width_orig > $width) {\n $to_scale = 1;\n $ratio_dest = $width / $height;\n $ratio_orig = $width_orig / $height_orig;\n if ($ratio_dest > $ratio_orig)\n $ratio = $width / $width_orig;\n else\n $ratio = $height / $height_orig;\n }\n // one equal one bigger\n else if ( ($width == $width_orig && $height_orig > $height) || ($height == $height_orig && $width_orig > $width) )\n $to_crop = 1;\n // some problem...\n else\n echo \"ALARM\";\n\n // we need to zoom to get the right size\n if ($to_scale == 1) {\n $new_width = $width_orig * $ratio;\n $new_height = $height_orig * $ratio;\n $image_scaled = imagecreatetruecolor($new_width, $new_height);\n // scaling!\n imagecopyresampled($image_scaled, $image, 0, 0, 0, 0, $new_width, $new_height, $width_orig, $height_orig);\n $image = $image_scaled;\n\n if($new_width > $width || $new_height > $height)\n $to_crop = 1;\n }\n else {\n $new_width = $width_orig;\n $new_height = $height_orig;\n }\n\n // we need to crop the image\n if ($to_crop == 1) {\n $image_cropped = imagecreatetruecolor($width, $height);\n\n // find margins for images\n $margin_x = ($new_width - $width) / 2;\n $margin_y = ($new_height - $height) / 2;\n\n // cropping!\n imagecopy($image_cropped, $image, 0, 0, $margin_x, $margin_y, $width, $height);\n $image = $image_cropped;\n }\n\n // Save image\n imagejpeg($image, $img_filename, 95);\n }\n\n // Return image URL\n return Wordless::join_paths(Wordless::theme_temp_path(), basename($img_filename));\n }",
"public static function makeCover($sourceImg, $destImg)\r\n\t{\r\n\t\t$image = new Imagick($sourceImg);\r\n\t\t$w_orig = $image->getImageWidth();\r\n\t\t$h_orig = $image->getImageHeight();\r\n\t\t$w_new = SmIMAGE;\r\n\t\t$h_new = SmIMAGE * COVERASPECT;\r\n\t\t$ratio_orig = $h_orig / $w_orig;\r\n\r\n\t\tif($ratio_orig == COVERASPECT) {\r\n\t\t\t// Only resize\r\n\t\t\t$image->resizeImage($w_new, $h_new, Imagick::FILTER_CATROM, 1, TRUE);\r\n\t\t} else {\r\n\t\t\tif($ratio_orig >= COVERASPECT) {\r\n\t\t\t\t// Taller than target\r\n\t\t\t\t$w_temp = $w_new;\r\n\t\t\t\t$h_temp = $w_new * $ratio_orig;\r\n\t\t\t\t$w_center = 0;\r\n\t\t\t\t$h_center = ($h_temp - $h_new) / 2;\r\n\t\t\t} else {\r\n\t\t\t\t// Wider than target\r\n\t\t\t\t$w_temp = $h_new / $ratio_orig;\r\n\t\t\t\t$h_temp = $h_new;\r\n\t\t\t\t$w_center = ($w_temp - $w_new) / 2;\r\n\t\t\t\t$h_center = 0;\r\n\t\t\t}\r\n\t\t\t$image->resizeImage($w_temp, $h_temp, Imagick::FILTER_CATROM, 1, TRUE);\r\n\t\t\t$image->cropImage($w_new, $h_new, $w_center, $h_center);\r\n\t\t}\r\n\r\n\t\t$image->setImageCompression(Imagick::COMPRESSION_JPEG);\r\n\t\t$image->setImageCompressionQuality(80);\r\n\t\t$image->writeImage($destImg);\r\n\t\t$image->destroy();\r\n\t}",
"abstract function crop($properties);",
"function imagetrim($im) {\n // imagecropauto() doesn't work reliably. For example, it doesn't crop SGRMTW2C.png.\n //$im2 = imagecropauto($im);\n\n $tbox = null;\n $w = imagesx($im);\n $h = imagesy($im);\n for ($x = $w; $x--; ) {\n for ($y = $h; $y--; ) {\n if (imagecolorat($im, $x, $y) >> 24 !== 127) {\n $tbox = combineRect([$x, $y, $x + 1, $y + 1], $tbox);\n }\n }\n }\n\n $im2 = imagecrop($im, ['x' => $tbox[0], 'y' => $tbox[1], 'width' => $tbox[2] - $tbox[0], 'height' => $tbox[3] - $tbox[1]]);\n imagedestroy($im);\n return $im2;\n}",
"public static function resizeCoverCentered(Task $task) {\r\n $task->params = self::parseDimensions($task->params);\r\n if ($task->params == false) {\r\n return false;\r\n }\r\n $task->image->resize($task->params[0], $task->params[1], 'outside')\r\n ->crop('center', 'center', $task->params[0], $task->params[1])\r\n ->saveToFile($task->destFile);\r\n }",
"private function makeSquare($image_path, $i)\n {\n//\n// $img1 = $this->image_instance($image_path[$i]);\n//\n// $img1->resize(520, 520);\n// $img1->save(public_path() . '/' . $this->store_path . '/' . $this->square_name);\n// $this->result['square_path'][$i] = $this->store_path . '/' . $this->square_name;\n//\n//\n//\n//\n//\n//\n//\n\n $this->square_name = $this->rand . 'square_image.jpg';\n\n $img1 = $this->image_instance($image_path[$i]);\n $img1->resize(520, 520);\n\n\n $watermark = Image::make(public_path($this->watermark_path));\n// $watermarkSize = $img->width() - 200; //size of the image minus 20 margins\n// $watermarkSize = $img->width() / 2; //half of the image size\n $watermarkSize = round($img1->width() * ((100 - $this->resizePercentage) / 100), 2); //watermark will be $resizePercentage less then the actual width of the image\n $watermark->resize($watermarkSize, null, function ($constraint) {\n $constraint->aspectRatio();\n });\n $img1->insert($watermark, $this->position);\n\n\n $img1->save(public_path() . '/' . $this->store_path . '/' . $this->square_name);\n $this->result['square_path'][$i] = $this->store_path . '/' . $this->square_name;\n\n\n }",
"function jCrop($src,$x,$y,$w,$h,$file_prefix='',$output=false,$quality=100,$fresh_name=false){\n\n\t\t$extension = strtolower($this->getExtension($src,false)); // false - tells to get \"jpg\" NOT \".jpg\" GOT IT :P\n\t\t\n\t\tif($fresh_name == false){\n\t\t\t$newImgName = $file_prefix.$src;\n\t\t}else{\n\t\t\t$newImgName = $file_prefix; //file_prefix contains full fresh\n\t\t}\n\t\t//saving the image into memory (for manipulation with GD Library)\n\t\tswitch($extension) {\n\t\t\tcase 'gif':\n\t\t\t$img_r = imagecreatefromgif($this->path.$src);\n\t\t\tbreak;\n\t\t\tcase 'jpg':\n\t\t\t$img_r = imagecreatefromjpeg($this->path.$src);\n\t\t\tbreak;\n\t\t\tcase 'png':\n\t\t\t$img_r = imagecreatefrompng($this->path.$src);\n\t\t\tbreak;\n\t\t}\n\t\t\n\t\t$targ_w = $w;\n\t\t$targ_h = $h;\n\t\t$dst_r = imagecreatetruecolor( $targ_w, $targ_h );\n\t if($extension == 'png'){\n imagealphablending( $dst_r, false );\n imagesavealpha( $dst_r, true );\n }\n\t\timagecopyresampled($dst_r,$img_r,0,0,$x,$y,$targ_w,$targ_h,$w,$h);\n\t\t\n\t\tif($output){\n\t\t\tif($extension==\"jpg\" ){\n\t\t\t\theader('Content-type: image/jpeg');\n\t\t\t\timagejpeg($dst_r);\n\t\t\t}elseif($extension==\"gif\" ){\n\t\t\t\theader('Content-type: image/gif');\n\t\t\t\timagegif($dst_r);\n\t\t\t}elseif($extension==\"png\" ){\n\t\t\t\theader('Content-type: image/png');\n\t\t\t\timagepng($dst_r);\n\t\t\t}\n\t\t}else{\n\t\t\t$return = false;\n\t\t\tif($extension==\"jpg\" ){\n\t\t\t\timagejpeg( $dst_r,$this->path.$newImgName, $quality );\n\t\t\t\t$return = true;\n\t\t\t}elseif($extension==\"gif\" ){\n\t\t\t\timagegif( $dst_r, $this->path.$newImgName );\n\t\t\t\t$return = true;\n\t\t\t}elseif($extension==\"png\" ){\n\t\t\t\timagepng( $dst_r, $this->path.$newImgName, ceil( 9 ) );\n\t\t\t\t$return = true;\n\t\t\t}\n\t\t\treturn $return;\n\t\t}\n\t}",
"function themify_img_resize_dimensions( $default, $orig_w, $orig_h, $dest_w, $dest_h ) {\r\n\t// set portion of the original image that we can size to $dest_w x $dest_h\r\n\t$aspect_ratio = $orig_w / $orig_h;\r\n\t$new_w = $dest_w;\r\n\t$new_h = $dest_h;\r\n\r\n\tif ( !$new_w ) {\r\n\t\t$new_w = (int)( $new_h * $aspect_ratio );\r\n\t}\r\n\r\n\tif ( !$new_h ) {\r\n\t\t$new_h = (int)( $new_w / $aspect_ratio );\r\n\t}\r\n\r\n\t$size_ratio = max( $new_w / $orig_w, $new_h / $orig_h );\r\n\r\n\t$crop_w = round( $new_w / $size_ratio );\r\n\t$crop_h = round( $new_h / $size_ratio );\r\n\r\n\t$s_x = floor( ( $orig_w - $crop_w ) / 2 );\r\n\t$s_y = floor( ( $orig_h - $crop_h ) / 2 );\r\n\r\n\t// the return array matches the parameters to imagecopyresampled()\r\n\t// int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h\r\n\treturn array( 0, 0, (int) $s_x, (int) $s_y, (int) $new_w, (int) $new_h, (int) $crop_w, (int) $crop_h );\r\n}",
"function crop($iNewWidth, $iNewHeight, $iResize = 0)\n\t{\n\t\tif (!$this->ImageStream) {\n\t\t\t$this->printError('image not loaded');\n\t\t}\n\n\t\t/* resize imageobject in memory if resize percentage is set */\n\t\tif ($iResize > 0) {\n\t\t\t$this->resizetopercentage($iResize);\n\t\t}\n\n\t\t/* constrain width and height values */\n\t\tif (($iNewWidth > $this->width) || ($iNewWidth < 0)) {\n\t\t\t$this->printError('width out of range');\n\t\t}\n\t\tif (($iNewHeight > $this->height) || ($iNewHeight < 0)) {\n\t\t\t$this->printError('height out of range');\n\t\t}\n\n\t\t/* create blank image with new sizes */\n\t\t$CroppedImageStream = ImageCreateTrueColor($iNewWidth, $iNewHeight);\n\n\t\t/* calculate size-ratio */\n\t\t$iWidthRatio = $this->width / $iNewWidth;\n\t\t$iHeightRatio = $this->height / $iNewHeight;\n\t\t$iHalfNewHeight = $iNewHeight / 2;\n\t\t$iHalfNewWidth = $iNewWidth / 2;\n\n\t\t/* if the image orientation is landscape */\n\t\tif ($this->orientation == 'landscape') {\n\t\t\t/* calculate resize width parameters */\n\t\t\t$iResizeWidth = $this->width / $iHeightRatio;\n\t\t\t$iHalfWidth = $iResizeWidth / 2;\n\t\t\t$iDiffWidth = $iHalfWidth - $iHalfNewWidth;\n\n\t\t\tif (function_exists(\"imagecopyresampled\")) {\n\t\t\t\timagecopyresampled($CroppedImageStream, $this->ImageStream, - $iDiffWidth, 0, 0, 0, $iResizeWidth, $iNewHeight, $this->width, $this->height);\n\t\t\t} else {\n\t\t\t\timagecopyresized($CroppedImageStream, $this->ImageStream, - $iDiffWidth, 0, 0, 0, $iResizeWidth, $iNewHeight, $this->width, $this->height);\n\t\t\t}\n\t\t}\n\t\t/* if the image orientation is portrait or square */\n\t\telseif (($this->orientation == 'portrait') || ($this->orientation == 'square')) {\n\t\t\t/* calculate resize height parameters */\n\t\t\t$iResizeHeight = $this->height / $iWidthRatio;\n\t\t\t$iHalfHeight = $iResizeHeight / 2;\n\t\t\t$iDiffHeight = $iHalfHeight - $iHalfNewHeight;\n\n\t\t\tif (function_exists(\"imagecopyresampled\")) {\n\t\t\t\timagecopyresampled($CroppedImageStream, $this->ImageStream, 0, - $iDiffHeight, 0, 0, $iNewWidth, $iResizeHeight, $this->width, $this->height);\n\t\t\t} else {\n\t\t\t\timagecopyresized($CroppedImageStream, $this->ImageStream, 0, - $iDiffHeight, 0, 0, $iNewWidth, $iResizeHeight, $this->width, $this->height);\n\t\t\t}\n\t\t} else {\n\t\t\tif (function_exists(\"imagecopyresampled\")) {\n\t\t\t\timagecopyresampled($CroppedImageStream, $this->ImageStream, 0, 0, 0, 0, $iNewWidth, $iNewHeight, $this->width, $this->height);\n\t\t\t} else {\n\t\t\t\timagecopyresized($CroppedImageStream, $this->ImageStream, 0, 0, 0, 0, $iNewWidth, $iNewHeight, $this->width, $this->height);\n\t\t\t}\n\t\t}\n\n\t\t$this->ImageStream = $CroppedImageStream;\n\t\t$this->width = $iNewWidth;\n\t\t$this->height = $iNewHeight;\n\t\t$this->setImageOrientation();\n\t}",
"public function testResizeRatioModePreservNoFillWidth()\n {\n $testImageRatio = $this->_testImageData['width'] / $this->_testImageData['height'];\n $dstWidth = 100;\n Tinebase_ImageHelper::resize($this->_testImage, $dstWidth, $dstWidth*100, Tinebase_ImageHelper::RATIOMODE_PRESERVNOFILL);\n $this->assertEquals($dstWidth, $this->_testImage->width);\n $this->assertEquals(floor($dstWidth / $testImageRatio), $this->_testImage->height);\n \n }",
"function fit($width, $height, $bgColor=array(255, 0, 0))\n\t\t{\n\t\t\t//TODO: set background color\n\t\t\tif (!$this->image) return;\n\t\t\t$ratio = $this->width / $this->height;\n\t\t \n\t\t\tif ($width / $height < $ratio) {\n\t\t\t\t $new_height = $width / $ratio;\n\t\t\t\t $new_width = $width;\n\t\t\t} else {\n\t\t\t\t $new_width = $height * $ratio;\n\t\t\t\t $new_height = $height;\n\t\t\t}\n\t\t \n\t\t\t$x_mid = $new_width / 2; //horizontal middle\n\t\t\t$y_mid = $new_height / 2; //vertical middle\n\t\t \n\t\t\t$process = imagecreatetruecolor(round($new_width), round($new_height));\n\t\t \n\t\t\timagecopyresampled($process, $this->image, 0, 0, 0, 0, $new_width, $new_height, $this->width, $this->height);\n\t\t\t$fit = imagecreatetruecolor($width, $height);\n\t\t\timagecopyresampled($fit, $process, 0, 0, ($x_mid-($width/2)), ($y_mid-($height/2)), $width, $height, $width, $height);\n\t\t\t\n\t\t\timagedestroy($process);\n\t\t\treturn $this->image = $fit;\n\t\t}",
"public function cropAvatarAction()\n {\n // TODO: swap web dir to product path\n //$imgRealPath = '/Users/leonqiu/www/choumei.me/Symfony/web/' . $_POST['imageSource'];\n $imgRealPath = dirname(__FILE__) . '/../../../../web/' . $_POST['imageSource'];\n list($width, $height) = getimagesize($imgRealPath);\n \n $viewPortW = $_POST[\"viewPortW\"];\n\t $viewPortH = $_POST[\"viewPortH\"];\n $pWidth = $_POST[\"imageW\"];\n $pHeight = $_POST[\"imageH\"];\n $tmp = explode(\".\",$_POST[\"imageSource\"]);\n $ext = end(&$tmp);\n $function = $this->returnCorrectFunction($ext);\n //$image = $function($_POST[\"imageSource\"]);\n $image = $function($imgRealPath);\n $width = imagesx($image);\n $height = imagesy($image);\n \n // Resample\n $image_p = imagecreatetruecolor($pWidth, $pHeight);\n $this->setTransparency($image,$image_p,$ext);\n\t\timagecopyresampled($image_p, $image, 0, 0, 0, 0, $pWidth, $pHeight, $width, $height);\n\t\timagedestroy($image);\n\t\t$widthR = imagesx($image_p);\n\t\t$hegihtR = imagesy($image_p);\n\t\t\n\t\t$selectorX = $_POST[\"selectorX\"];\n\t\t$selectorY = $_POST[\"selectorY\"];\n\t\t\n\t\tif($_POST[\"imageRotate\"]){\n\t\t $angle = 360 - $_POST[\"imageRotate\"];\n\t\t $image_p = imagerotate($image_p,$angle,0);\n\t\t \n\t\t $pWidth = imagesx($image_p);\n\t\t $pHeight = imagesy($image_p);\n\t\t \n\t\t //print $pWidth.\"---\".$pHeight;\n\t\t\n\t\t $diffW = abs($pWidth - $widthR) / 2;\n\t\t $diffH = abs($pHeight - $hegihtR) / 2;\n\t\t \n\t\t $_POST[\"imageX\"] = ($pWidth > $widthR ? $_POST[\"imageX\"] - $diffW : $_POST[\"imageX\"] + $diffW);\n\t\t $_POST[\"imageY\"] = ($pHeight > $hegihtR ? $_POST[\"imageY\"] - $diffH : $_POST[\"imageY\"] + $diffH);\n\t\t\n\t\t \n\t\t}\n\t\t\n\t\t$dst_x = $src_x = $dst_y = $dst_x = 0;\n\t\t\n\t\tif($_POST[\"imageX\"] > 0){\n\t\t $dst_x = abs($_POST[\"imageX\"]);\n\t\t}else{\n\t\t $src_x = abs($_POST[\"imageX\"]);\n\t\t}\n\t\tif($_POST[\"imageY\"] > 0){\n\t\t $dst_y = abs($_POST[\"imageY\"]);\n\t\t}else{\n\t\t $src_y = abs($_POST[\"imageY\"]);\n\t\t}\n\t\t\n\t\t\n\t\t$viewport = imagecreatetruecolor($_POST[\"viewPortW\"],$_POST[\"viewPortH\"]);\n\t\t$this->setTransparency($image_p,$viewport,$ext);\n\t\t\n\t\timagecopy($viewport, $image_p, $dst_x, $dst_y, $src_x, $src_y, $pWidth, $pHeight);\n\t\timagedestroy($image_p);\n\t\t\n\t\t\n\t\t$selector = imagecreatetruecolor($_POST[\"selectorW\"],$_POST[\"selectorH\"]);\n\t\t$this->setTransparency($viewport,$selector,$ext);\n\t\timagecopy($selector, $viewport, 0, 0, $selectorX, $selectorY,$_POST[\"viewPortW\"],$_POST[\"viewPortH\"]);\n\t\t\n\t\t//$file = \"tmp/test\".time().\".\".$ext;\n\t\t// TODO: generate file name\n\t\t$fileName = uniqid() . \".\" . $ext;\n\t\t$user = $this->get('security.context')->getToken()->getUser();\n\t\t$avatarFile = dirname(__FILE__).'/../../../../web/uploads/avatar/'.$user->getId(). '/' .$fileName;\n\t\t$avatarUrl = '/uploads/avatar/'. $user->getId() . '/' . $fileName;\n\t\t$this->parseImage($ext,$selector,$avatarFile);\n\t\timagedestroy($viewport);\n\t\t//Return value\n\t\t//update avatar\n $em = $this->getDoctrine()->getEntityManager();\n $user->setAvatar($avatarUrl);\n $em->persist($user);\n $em->flush();\n\t\techo $avatarUrl;\n\t\texit;\n }",
"function redimage($img_src,$img_dest,$dst_w,$dst_h) {\n // Lit les dimensions de l'image\n $size = GetImageSize($img_src); \n $src_w = $size[0]; $src_h = $size[1]; \n // Teste les dimensions tenant dans la zone\n $test_h = round(($dst_w / $src_w) * $src_h);\n $test_w = round(($dst_h / $src_h) * $src_w);\n // Si Height final non précisé (0)\n if(!$dst_h) $dst_h = $test_h;\n // Sinon si Width final non précisé (0)\n elseif(!$dst_w) $dst_w = $test_w;\n // Sinon teste quel redimensionnement tient dans la zone\n elseif($test_h>$dst_h) $dst_w = $test_w;\n else $dst_h = $test_h;\n\n // La vignette existe ?\n $test = (file_exists($img_dest));\n // L'original a été modifié ?\n if($test)\n $test = (filemtime($img_dest)>filemtime($img_src));\n // Les dimensions de la vignette sont correctes ?\n if($test) {\n $size2 = GetImageSize($img_dest);\n $test = ($size2[0]==$dst_w);\n $test = ($size2[1]==$dst_h);\n }\n\n // Créer la vignette ?\n if(!$test) {\n // Crée une image vierge aux bonnes dimensions\t\n $dst_im = ImageCreateTrueColor($dst_w,$dst_h); \n // Copie dedans l'image initiale redimensionnée\n $src_im = ImageCreateFromJpeg($img_src);\n ImageCopyResampled($dst_im,$src_im,0,0,0,0,$dst_w,$dst_h,$src_w,$src_h);\n // Sauve la nouvelle image\n ImageJpeg($dst_im,$img_dest);\n // Détruis les tampons\n ImageDestroy($dst_im);\n ImageDestroy($src_im);\n }\n}",
"function crop($x, $y, $width, $height){\n\n $new_image = imagecreatetruecolor($width, $height);\n imagecopy($new_image, $this->image, 0, 0, $x, $y, $width, $height);\n $this->image = $new_image;\n\n //reset sizes\n $this->width = $width;\n $this->height = $height;\n\n return true;\n }",
"public function resizeInSquareFromBlobToFile(&$binary_source,$newwidth,$newheight,$background,$outFile)\n {\n //Create image source from string\n $source_image = imagecreatefromstring($binary_source);\n\n //Check source\n if(!$source_image)\n {\n return false;\n }\n\n //Check background\n if(empty($background))\n {\n $background = $this->options[self::IMAGE_ITEM_BACKGROUND];\n }\n\n //Get old size\n $old_x = imagesx($source_image);\n $old_y = imagesy($source_image);\n\n //Check have correct site\n if($old_x <= $newwidth && $old_y <= $newwidth)\n {\n //Destroy image source\n imagedestroy($source_image);\n\n //Return image file\n return file_put_contents($outFile,$binary_source);\n }\n\n //Resize keep width\n if($old_x < $newwidth)\n {\n $newheight = $newwidth;\n $newwidth = $old_x;\n $dest_image = imagecreatetruecolor($newwidth, $newheight);\n imagecopyresampled($dest_image, $source_image, 0, 0, 0, 0, $newwidth , $newheight, $newwidth, $newheight);\n }\n else\n {\n $newheight = ceil((($newwidth*$old_y)/$old_x));\n $dest_image = imagecreatetruecolor($newwidth, $newwidth);\n list($r,$g,$b) = explode(\",\",$background);\n $color= imagecolorallocate($dest_image, $r, $g, $b);\n $move_space =0;\n if($old_x > $old_y )\n {\n $move_space = ceil(($newwidth - $newheight)/2);\n }\n imagefill($dest_image,0,0,$color);\n imagecopyresampled($dest_image, $source_image, 0, $move_space, 0, 0, $newwidth , $newheight, $old_x, $old_y);\n }\n\n //Put binary string\n imagejpeg($dest_image,$outFile,$this->options[parent::IMAGE_ITEM_QUALITY]);\n\n //Destroy images\n imagedestroy($dest_image);\n imagedestroy($source_image);\n\n //Return boolean\n return true;\n }",
"function myImageCrop($imgSrc,$newfilename,$thumbWidth=100,$output=false,$thumbHeight=0){\n \t\n\t\tif($thumbHeight == 0) $thumbHeight = $thumbWidth;\n\t\t\n\t\t//getting the image dimensions\n\t\tlist($width, $height) = getimagesize($this->path.$imgSrc); \n\t\t\n\t\t\n\t\t$extension = strtolower($this->getExtension($imgSrc,false)); // false - tells to get \"jpg\" NOT \".jpg\" GOT IT :P\n\t\t\n\t\t//saving the image into memory (for manipulation with GD Library)\n\t\tswitch($extension) {\n\t\t\tcase 'gif':\n\t\t\t$myImage = imagecreatefromgif($this->path.$imgSrc);\n\t\t\tbreak;\n\t\t\tcase 'jpg':\n\t\t\t$myImage = imagecreatefromjpeg($this->path.$imgSrc);\n\t\t\tbreak;\n\t\t\tcase 'png':\n\t\t\t$myImage = imagecreatefrompng($this->path.$imgSrc);\n\t\t\tbreak;\n\t\t}\n\t\t\n\n\n\t\t ///-------------------------------------------------------- \n\t\t //setting the crop size \n\t\t //-------------------------------------------------------- \n\t\t if($width > $height){ \n\t\t\t $biggestSide = $width; \n\t\t\t $cropPercent = .6; \n\t\t\t $cropWidth = $biggestSide*$cropPercent; \n\t\t\t $cropHeight = $biggestSide*$cropPercent; \n\t\t\t $c1 = array(\"x\"=>($width-$cropWidth)/2, \"y\"=>($height-$cropHeight)/2); \n\t\t }else{ \n\t\t\t $biggestSide = $height; \n\t\t\t $cropPercent = .6; \n\t\t\t $cropWidth = $biggestSide*$cropPercent; \n\t\t\t $cropHeight = $biggestSide*$cropPercent; \n\t\t\t $c1 = array(\"x\"=>($width-$cropWidth)/2, \"y\"=>($height-$cropHeight)/7); \n\t\t } \n\t\t \n\t\t //--------------------------------------------------------\n\t\t// Creating the thumbnail\n\t\t//--------------------------------------------------------\n\t\t$thumb = imagecreatetruecolor($thumbWidth, $thumbHeight); \n\t\timagecopyresampled($thumb, $myImage, 0, 0, $c1['x'], $c1['y'], $thumbWidth, $thumbHeight, $cropWidth, $cropHeight); \n\n\t\tif($output == false){\n\t\t\tif($extension==\"jpg\" ){\n\t\t\t\timagejpeg($thumb,$this->path.$newfilename,100);\n\t\t\t}elseif($extension==\"gif\" ){\n\t\t\t\timagegif($thumb,$this->path.$newfilename,100);\n\t\t\t}elseif($extension==\"png\" ){\n\t\t\t\timagepng($thumb,$this->path.$newfilename,9);\n\t\t\t}\n\t\t}else{\n\t\t\t//final output \n\t\t\t//imagejpeg($thumb);\n\t\t\tif($extension==\"jpg\" ){\n\t\t\t\theader('Content-type: image/jpeg');\n\t\t\t\timagejpeg($thumb);\n\t\t\t}elseif($extension==\"gif\" ){\n\t\t\t\theader('Content-type: image/gif');\n\t\t\t\timagegif($thumb);\n\t\t\t}elseif($extension==\"png\" ){\n\t\t\t\theader('Content-type: image/png');\n\t\t\t\timagepng($thumb);\n\t\t\t}\n\t\t} \n\t\timagedestroy($thumb); \n\t}",
"private function __setOptimalSizeByCrop() {\n \n $heightRatio = $this->__originalImageHeight / $this->__requestedHeight;\n $widthRatio = $this->__originalImageWidth / $this->__requestedWidth;\n \n if ($heightRatio < $widthRatio) {\n $optimalRatio = $heightRatio;\n } else {\n $optimalRatio = $widthRatio;\n }\n \n $this->__optimalHeight = $this->__originalImageHeight / $optimalRatio;\n $this->__optimalWidth = $this->__originalImageWidth / $optimalRatio;\n \n }",
"public function crop()\n\t{\n\t\t$protocol = ($this->image_library === 'gd2') ? 'image_process_gd' : 'image_process_'.$this->image_library;\n\t\treturn $this->$protocol('crop');\n\t}",
"function normal_resize_image($source, $destination, $image_type, $max_size, $image_width, $image_height, $quality){\n\n if($image_width <= 0 || $image_height <= 0){return false;} //return false if nothing to resize\n\n //do not resize if image is smaller than max size\n if($image_width <= $max_size && $image_height <= $max_size){\n if(save_image($source, $destination, $image_type, $quality)){\n return true;\n }\n }\n\n //Construct a proportional size of new image\n $image_scale\t= min($max_size/$image_width, $max_size/$image_height);\n $new_width\t\t= ceil($image_scale * $image_width);\n $new_height\t\t= ceil($image_scale * $image_height);\n\n $new_canvas\t\t= imagecreatetruecolor( $new_width, $new_height ); //Create a new true color image\n\n //Copy and resize part of an image with resampling\n if(imagecopyresampled($new_canvas, $source, 0, 0, 0, 0, $new_width, $new_height, $image_width, $image_height)){\n save_image($new_canvas, $destination, $image_type, $quality); //save resized image\n }\n\n return true;\n}",
"public function run() {\n\n // make enough memory available to scale bigger images\n ini_set('memory_limit', $this->thumb->options['memory']);\n \n // create the gd lib image object\n switch($this->thumb->image->mime()) {\n case 'image/jpeg':\n $image = @imagecreatefromjpeg($this->thumb->image->root()); \n break;\n case 'image/png':\n $image = @imagecreatefrompng($this->thumb->image->root()); \n break;\n case 'image/gif':\n $image = @imagecreatefromgif($this->thumb->image->root()); \n break;\n default:\n raise('The image mime type is invalid');\n break;\n } \n\n // check for a valid created image object\n if(!$image) raise('The image could not be created');\n\n // cropping stuff needs a couple more steps \n if($this->thumb->options['crop'] == true) {\n\n // Starting point of crop\n $startX = floor($this->thumb->tmp->width() / 2) - floor($this->thumb->result->width() / 2);\n $startY = floor($this->thumb->tmp->height() / 2) - floor($this->thumb->result->height() / 2);\n \n // Adjust crop size if the image is too small\n if($startX < 0) $startX = 0;\n if($startY < 0) $startY = 0;\n \n // create a temporary resized version of the image first\n $thumb = imagecreatetruecolor($this->thumb->tmp->width(), $this->thumb->tmp->height()); \n $thumb = $this->keepColor($thumb);\n imagecopyresampled($thumb, $image, 0, 0, 0, 0, $this->thumb->tmp->width(), $this->thumb->tmp->height(), $this->thumb->source->width(), $this->thumb->source->height()); \n \n // crop that image afterwards \n $cropped = imagecreatetruecolor($this->thumb->result->width(), $this->thumb->result->height()); \n $cropped = $this->keepColor($cropped);\n imagecopyresampled($cropped, $thumb, 0, 0, $startX, $startY, $this->thumb->tmp->width(), $this->thumb->tmp->height(), $this->thumb->tmp->width(), $this->thumb->tmp->height()); \n imagedestroy($thumb);\n \n // reasign the variable\n $thumb = $cropped;\n\n } else {\n $thumb = imagecreatetruecolor($this->thumb->result->width(), $this->thumb->result->height()); \n $thumb = $this->keepColor($thumb);\n imagecopyresampled($thumb, $image, 0, 0, 0, 0, $this->thumb->result->width(), $this->thumb->result->height(), $this->thumb->source->width(), $this->thumb->source->height()); \n } \n \n // convert the thumbnail to grayscale \n if($this->thumb->options['grayscale']) {\n imagefilter($thumb, IMG_FILTER_GRAYSCALE);\n }\n\n // convert the image to a different format\n if($this->thumb->options['to']) {\n\n switch($this->thumb->options['to']) {\n case 'jpg': \n imagejpeg($thumb, $this->thumb->root(), $this->thumb->options['quality']); \n break;\n case 'png': \n imagepng($thumb, $this->thumb->root(), 0); \n break; \n case 'gif': \n imagegif($thumb, $this->thumb->root()); \n break; \n }\n\n // keep the original file's format\n } else {\n\n switch($this->thumb->image->mime()) {\n case 'image/jpeg': \n imagejpeg($thumb, $this->thumb->root(), $this->thumb->options['quality']); \n break;\n case 'image/png': \n imagepng($thumb, $this->thumb->root(), 0); \n break; \n case 'image/gif': \n imagegif($thumb, $this->thumb->root()); \n break;\n }\n\n }\n\n imagedestroy($thumb);\n \n }",
"public function test_resize_and_crop() {\n\n\t\t$file = DIR_TESTDATA . '/images/gradient-square.jpg';\n\n\t\t$imagick_image_editor = new WP_Image_Editor_Imagick( $file );\n\t\t$imagick_image_editor->load();\n\n\t\t$imagick_image_editor->resize( 100, 50, true );\n\n\t\t$this->assertEquals( array( 'width' => 100, 'height' => 50 ), $imagick_image_editor->get_size() );\n\t}",
"function wp_imagecreatetruecolor($width, $height)\n {\n }",
"function imagethumb( $image_src , $image_dest = NULL , $max_size = 500, $expand = FALSE, $square = FALSE )\n{\n\tif( !file_exists($image_src) ) return FALSE;\n\n\t// Récupère les infos de l'image\n\t$fileinfo = getimagesize($image_src);\n\n\techo \"file infos :\".$fileinfo[0].\"---\".$fileinfo[1];\n\t\n\tif( !$fileinfo ) return FALSE;\n\n\t$width = $fileinfo[0];\n\t$height = $fileinfo[1];\n\n\n\t$type_mime = $fileinfo['mime'];\n\n\n\t$type = str_replace('image/', '', $type_mime);\n\n\t//echo \"\\ntype_mime --> \".$type;\n\n\tif( !$expand && max($width, $height)<=$max_size && (!$square || ($square && $width==$height) ) )\n\t{\n\t\t// L'image est plus petite que max_size\n\t\tif($image_dest)\n\t\t{\n\t\t\treturn copy($image_src, $image_dest);\n\t\t}\n\t\telse\n\t\t{\n\t\t\theader('Content-Type: '. $type_mime);\n\t\t\treturn (boolean) readfile($image_src);\n\t\t}\n\t}\n\n\t// Calcule les nouvelles dimensions\n\t$ratio = $width / $height;\n\n\tif( $square )\n\t{\n\t\t$new_width = $new_height = $max_size;\n\n\t\tif( $ratio > 1 )\n\t\t{\n\t\t\t// Paysage\n\t\t\t$src_y = 0;\n\t\t\t$src_x = round( ($width - $height) / 2 );\n\n\t\t\t$src_w = $src_h = $height;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Portrait\n\t\t\t$src_x = 0;\n\t\t\t$src_y = round( ($height - $width) / 2 );\n\n\t\t\t$src_w = $src_h = $width;\n\t\t}\n\t}\n\telse\n\t{\n\t\t$src_x = $src_y = 0;\n\t\t$src_w = $width;\n\t\t$src_h = $height;\n\n\t\tif ( $ratio > 1 )\n\t\t{\n\t\t\t// Paysage\n\t\t\t$new_width = $max_size;\n\t\t\t$new_height = round( $max_size / $ratio );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Portrait\n\t\t\t$new_height = $max_size;\n\t\t\t$new_width = round( $max_size * $ratio );\n\t\t}\n\t}\n\n\t// Ouvre l'image originale\n\t$func = 'imagecreatefrom' . $type;\n\tif( !function_exists($func) ) return FALSE;\n\n\t$image_src = $func($image_src);\n\t$new_image = imagecreatetruecolor($new_width,$new_height);\n\n\t// Gestion de la transparence pour les png\n\tif( $type=='png' )\n\t{\n\t\timagealphablending($new_image,false);\n\t\tif( function_exists('imagesavealpha') )\n\t\t\timagesavealpha($new_image,true);\n\t}\n\n\t// Gestion de la transparence pour les gif\n\telseif( $type=='gif' && imagecolortransparent($image_src)>=0 )\n\t{\n\t\t$transparent_index = imagecolortransparent($image_src);\n\t\t$transparent_color = imagecolorsforindex($image_src, $transparent_index);\n\t\t$transparent_index = imagecolorallocate($new_image, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue']);\n\t\timagefill($new_image, 0, 0, $transparent_index);\n\t\timagecolortransparent($new_image, $transparent_index);\n\t}\n\n\t// Redimensionnement de l'image\n\timagecopyresampled(\n\t\t$new_image, $image_src,\n\t\t0, 0, $src_x, $src_y,\n\t\t$new_width, $new_height, $src_w, $src_h\n\t);\n\n\t// Enregistrement de l'image\n\t$func = 'image'. $type;\n\tif($image_dest)\n\t{\n\t\t$func($new_image, $image_dest);\n\t}\n\telse\n\t{\n\t\theader('Content-Type: '. $type_mime);\n\t\t$func($new_image);\n\t}\n\n\t// Libération de la mémoire\n\timagedestroy($new_image); \n\n\treturn TRUE;\n}",
"function ImageCopyBicubic ($dst_img, $src_img, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) {\n\n global $CFG;\n\n if (function_exists(\"ImageCopyResampled\") and $CFG->gdversion >= 2) {\n return ImageCopyResampled($dst_img, $src_img, $dst_x, $dst_y, $src_x, $src_y,\n $dst_w, $dst_h, $src_w, $src_h);\n }\n\n $totalcolors = imagecolorstotal($src_img);\n for ($i=0; $i<$totalcolors; $i++) {\n if ($colors = ImageColorsForIndex($src_img, $i)) {\n ImageColorAllocate($dst_img, $colors['red'], $colors['green'], $colors['blue']);\n }\n }\n\n $scaleX = ($src_w - 1) / $dst_w;\n $scaleY = ($src_h - 1) / $dst_h;\n\n $scaleX2 = $scaleX / 2.0;\n $scaleY2 = $scaleY / 2.0;\n\n for ($j = 0; $j < $dst_h; $j++) {\n $sY = $j * $scaleY;\n\n for ($i = 0; $i < $dst_w; $i++) {\n $sX = $i * $scaleX;\n\n $c1 = ImageColorsForIndex($src_img,ImageColorAt($src_img,(int)$sX,(int)$sY+$scaleY2));\n $c2 = ImageColorsForIndex($src_img,ImageColorAt($src_img,(int)$sX,(int)$sY));\n $c3 = ImageColorsForIndex($src_img,ImageColorAt($src_img,(int)$sX+$scaleX2,(int)$sY+$scaleY2));\n $c4 = ImageColorsForIndex($src_img,ImageColorAt($src_img,(int)$sX+$scaleX2,(int)$sY));\n\n $red = (int) (($c1['red'] + $c2['red'] + $c3['red'] + $c4['red']) / 4);\n $green = (int) (($c1['green'] + $c2['green'] + $c3['green'] + $c4['green']) / 4);\n $blue = (int) (($c1['blue'] + $c2['blue'] + $c3['blue'] + $c4['blue']) / 4);\n\n $color = ImageColorClosest ($dst_img, $red, $green, $blue);\n ImageSetPixel ($dst_img, $i + $dst_x, $j + $dst_y, $color);\n }\n }\n}",
"function ImageCopyBicubic ($dst_img, $src_img, $dst_x, $dst_y, $src_x, $src_y, $dst_w, $dst_h, $src_w, $src_h) {\n\n global $CFG;\n\n if (function_exists('ImageCopyResampled') and $CFG->gdversion >= 2) { \n return ImageCopyResampled($dst_img, $src_img, $dst_x, $dst_y, $src_x, $src_y,\n $dst_w, $dst_h, $src_w, $src_h);\n }\n\n $totalcolors = imagecolorstotal($src_img);\n for ($i=0; $i<$totalcolors; $i++) { \n if ($colors = ImageColorsForIndex($src_img, $i)) {\n ImageColorAllocate($dst_img, $colors['red'], $colors['green'], $colors['blue']);\n }\n }\n\n $scaleX = ($src_w - 1) / $dst_w; \n $scaleY = ($src_h - 1) / $dst_h; \n\n $scaleX2 = $scaleX / 2.0; \n $scaleY2 = $scaleY / 2.0; \n\n for ($j = 0; $j < $dst_h; $j++) { \n $sY = $j * $scaleY; \n\n for ($i = 0; $i < $dst_w; $i++) { \n $sX = $i * $scaleX; \n\n $c1 = ImageColorsForIndex($src_img,ImageColorAt($src_img,(int)$sX,(int)$sY+$scaleY2)); \n $c2 = ImageColorsForIndex($src_img,ImageColorAt($src_img,(int)$sX,(int)$sY)); \n $c3 = ImageColorsForIndex($src_img,ImageColorAt($src_img,(int)$sX+$scaleX2,(int)$sY+$scaleY2)); \n $c4 = ImageColorsForIndex($src_img,ImageColorAt($src_img,(int)$sX+$scaleX2,(int)$sY)); \n\n $red = (int) (($c1['red'] + $c2['red'] + $c3['red'] + $c4['red']) / 4); \n $green = (int) (($c1['green'] + $c2['green'] + $c3['green'] + $c4['green']) / 4); \n $blue = (int) (($c1['blue'] + $c2['blue'] + $c3['blue'] + $c4['blue']) / 4); \n\n $color = ImageColorClosest ($dst_img, $red, $green, $blue); \n ImageSetPixel ($dst_img, $i + $dst_x, $j + $dst_y, $color); \n } \n } \n}",
"private function create_blank_image() {\r\n\t\t$image = imagecreatetruecolor( $this->diameter,$this->diameter );\r\n\r\n\t\t/* we also need a transparent background ... */\r\n\t\timagesavealpha($image, true);\r\n\r\n\t\t/* create a transparent color ... */\r\n\t\t$color = imagecolorallocatealpha($image, 0, 0, 0, 127);\r\n\r\n\t\t/* ... then fill the image with it ... */\r\n\t\timagefill($image, 0, 0, $color);\r\n\r\n\t\t/* nothing to do then ... just save the new image ... */\r\n\t\t$this->cutted_image = $image;\r\n\r\n\t\t/* go back and see what should we do next ..? */\r\n\t\treturn;\r\n\r\n\t}",
"function duotone (&$image, $rplus, $gplus, $bplus) {\n $imagex = imagesx($image);\n $imagey = imagesy($image);\n\n for ($x = 0; $x <$imagex; ++$x) {\n for ($y = 0; $y <$imagey; ++$y) {\n $rgb = imagecolorat($image, $x, $y);\n $red = ($rgb >> 16) & 0xFF;\n $green = ($rgb >> 8) & 0xFF;\n $blue = $rgb & 0xFF;\n $red = (int)(($red+$green+$blue)/3);\n $green = $red + $gplus;\n $blue = $red + $bplus;\n $red += $rplus;\n\n if ($red > 255) $red = 255;\n if ($green > 255) $green = 255;\n if ($blue > 255) $blue = 255;\n if ($red < 0) $red = 0;\n if ($green < 0) $green = 0;\n if ($blue < 0) $blue = 0;\n\n $newcol = imagecolorallocate ($image, $red,$green,$blue);\n imagesetpixel ($image, $x, $y, $newcol);\n }\n }\n }",
"public function frontImage()\r\n {\r\n $wrapper = imagecreatetruecolor(16 * $this->ratio(), 32 * $this->ratio());\r\n $background = imagecolorallocatealpha($wrapper, 255, 255, 255, 127);\r\n imagefill($wrapper, 0, 0, $background);\r\n\r\n imagecopy($wrapper, $this->image, 4 * $this->ratio(), 0 * $this->ratio(), 8 * $this->ratio(),\r\n 8 * $this->ratio(), 8 * $this->ratio(), 8 * $this->ratio());\r\n //arms\r\n imagecopy($wrapper, $this->image, 0 * $this->ratio(), 8 * $this->ratio(), 44 * $this->ratio(),\r\n 20 * $this->ratio(), 4 * $this->ratio(), 12 * $this->ratio());\r\n $this->imageflip($wrapper, $this->image, 12 * $this->ratio(), 8 * $this->ratio(), 44 * $this->ratio(),\r\n 20 * $this->ratio(), 4 * $this->ratio(), 12 * $this->ratio());\r\n //chest\r\n imagecopy($wrapper, $this->image, 4 * $this->ratio(), 8 * $this->ratio(), 20 * $this->ratio(),\r\n 20 * $this->ratio(), 8 * $this->ratio(), 12 * $this->ratio());\r\n //legs\r\n imagecopy($wrapper, $this->image, 4 * $this->ratio(), 20 * $this->ratio(), 4 * $this->ratio(),\r\n 20 * $this->ratio(), 4 * $this->ratio(), 12 * $this->ratio());\r\n $this->imageflip($wrapper, $this->image, 8 * $this->ratio(), 20 * $this->ratio(), 4 * $this->ratio(),\r\n 20 * $this->ratio(), 4 * $this->ratio(), 12 * $this->ratio());\r\n //hat\r\n imagecopy($wrapper, $this->image, 4 * $this->ratio(), 0 * $this->ratio(), 40 * $this->ratio(),\r\n 8 * $this->ratio(), 8 * $this->ratio(), 8 * $this->ratio());\r\n\r\n return $wrapper;\r\n }",
"function smart_resize_image($file, $string = null, $width = 0, $height = 0, $proportional = false, $output = 'file', $delete_original = true, $use_linux_commands = false, $quality = 100, $grayscale = false\n) {\n\n if ($height <= 0 && $width <= 0)\n return false;\n if ($file === null && $string === null)\n return false;\n\n # Setting defaults and meta\n $info = $file !== null ? getimagesize($file) : getimagesizefromstring($string);\n $image = '';\n $final_width = 0;\n $final_height = 0;\n list($width_old, $height_old) = $info;\n $cropHeight = $cropWidth = 0;\n\n # Calculating proportionality\n if ($proportional) {\n if ($width == 0)\n $factor = $height / $height_old;\n elseif ($height == 0)\n $factor = $width / $width_old;\n else\n $factor = min($width / $width_old, $height / $height_old);\n\n $final_width = round($width_old * $factor);\n $final_height = round($height_old * $factor);\n }\n else {\n $final_width = ( $width <= 0 ) ? $width_old : $width;\n $final_height = ( $height <= 0 ) ? $height_old : $height;\n $widthX = $width_old / $width;\n $heightX = $height_old / $height;\n\n $x = min($widthX, $heightX);\n $cropWidth = ($width_old - $width * $x) / 2;\n $cropHeight = ($height_old - $height * $x) / 2;\n }\n\n # Loading image to memory according to type\n switch ($info[2]) {\n case IMAGETYPE_JPEG: $file !== null ? $image = imagecreatefromjpeg($file) : $image = imagecreatefromstring($string);\n break;\n case IMAGETYPE_GIF: $file !== null ? $image = imagecreatefromgif($file) : $image = imagecreatefromstring($string);\n break;\n case IMAGETYPE_PNG: $file !== null ? $image = imagecreatefrompng($file) : $image = imagecreatefromstring($string);\n break;\n default: return false;\n }\n\n # Making the image grayscale, if needed\n if ($grayscale) {\n imagefilter($image, IMG_FILTER_GRAYSCALE);\n }\n\n # This is the resizing/resampling/transparency-preserving magic\n $image_resized = imagecreatetruecolor($final_width, $final_height);\n if (($info[2] == IMAGETYPE_GIF) || ($info[2] == IMAGETYPE_PNG)) {\n $transparency = imagecolortransparent($image);\n $palletsize = imagecolorstotal($image);\n\n if ($transparency >= 0 && $transparency < $palletsize) {\n $transparent_color = imagecolorsforindex($image, $transparency);\n $transparency = imagecolorallocate($image_resized, $transparent_color['red'], $transparent_color['green'], $transparent_color['blue']);\n imagefill($image_resized, 0, 0, $transparency);\n imagecolortransparent($image_resized, $transparency);\n } elseif ($info[2] == IMAGETYPE_PNG) {\n imagealphablending($image_resized, false);\n $color = imagecolorallocatealpha($image_resized, 0, 0, 0, 127);\n imagefill($image_resized, 0, 0, $color);\n imagesavealpha($image_resized, true);\n }\n }\n imagecopyresampled($image_resized, $image, 0, 0, $cropWidth, $cropHeight, $final_width, $final_height, $width_old - 2 * $cropWidth, $height_old - 2 * $cropHeight);\n\n\n # Taking care of original, if needed\n if ($delete_original) {\n if ($use_linux_commands)\n exec('rm ' . $file);\n else\n @unlink($file);\n }\n\n # Preparing a method of providing result\n switch (strtolower($output)) {\n case 'browser':\n $mime = image_type_to_mime_type($info[2]);\n header(\"Content-type: $mime\");\n $output = NULL;\n break;\n case 'file':\n $output = $file;\n break;\n case 'return':\n return $image_resized;\n break;\n default:\n break;\n }\n\n # Writing image according to type to the output destination and image quality\n switch ($info[2]) {\n case IMAGETYPE_GIF: imagegif($image_resized, $output);\n break;\n case IMAGETYPE_JPEG: imagejpeg($image_resized, $output, $quality);\n break;\n case IMAGETYPE_PNG:\n $quality = 9 - (int) ((0.9 * $quality) / 10.0);\n imagepng($image_resized, $output, $quality);\n break;\n default: return false;\n }\n\n return true;\n}",
"private function imageflip(&$result, &$img, $rx = 0, $ry = 0, $x = 0, $y = 0, $size_x = null, $size_y = null)\r\n {\r\n if ($size_x < 1) {\r\n $size_x = imagesx($img);\r\n }\r\n\r\n if ($size_y < 1) {\r\n $size_y = imagesy($img);\r\n }\r\n\r\n imagecopyresampled($result, $img, $rx, $ry, ($x + $size_x - 1), $y, $size_x, $size_y, 0 - $size_x, $size_y);\r\n }",
"public function resize($width, $height, $crop_top = 0, $crop_bottom = 0, $crop_left = 0, $crop_right = 0) {}",
"protected function calculateCrop($info, $image, $width, $height, $mode, $format, $quality, $options){\n\n // Alias\n if($width && !$height) {\n $config = $this->resolveAlias($width);\n\n $width = $config['width'];\n $height = $config['height'];\n $mode = $config['cropping'];\n $format = $config['format'];\n $quality = $config['quality'];\n $options = $config['options'];\n }\n\n switch ($mode){\n // Same as fit but only if image is larger than width/height\n case IConnector::MODE_LIMIT:\n if($width > $info['width'] && $height > $info['height']) {\n $calcwidth = $info['width'];\n $calcheight = $info['height'];\n break;\n }\n // -> Continue to FIT\n\n // Image is resized to take up as much space as possible within bounding box defined by width and height\n case IConnector::MODE_FIT:\n $heightFactor = $height / $info['height'];\n $widthFactor = $width / $info['width'];\n $scaleFactor = min($widthFactor, $heightFactor);\n $calcwidth = ceil($info['width']*$scaleFactor);\n $calcheight = ceil($info['height']*$scaleFactor);\n break;\n\n // Create image with exact given width and height without distorting the image\n case IConnector::MODE_FILL:\n // Change size of image exactly to given width and height without retaining aspect ratio\n case IConnector::MODE_SCALE:\n $calcwidth = $width;\n $calcheight = $height;\n break;\n\n default:\n return false;\n }\n\n return [\n 'width' => $calcwidth,\n 'height' => $calcheight,\n 'aspectratio' => $calcwidth && $calcheight ? round($calcwidth/$calcheight,2) : false,\n 'landscape' => $calcwidth > $calcheight,\n 'portrait' => $calcwidth < $calcheight,\n 'square' => $calcwidth == $calcheight,\n 'url' => $this->imageUrlGenerate($image, $width, $height, $mode, $format, $quality, $options)\n ];\n }",
"function produce_colorpicker() {\n\n $width = 384;\n $height = 128;\n $factor = 4;\n $colour = array(255, 0, 0);\n\n $matrices = array();//R, G, B\n $matrices[] = array( 0, 1, 0);\n $matrices[] = array( -1, 0, 0);\n $matrices[] = array( 0, 0, 1);\n $matrices[] = array( 0, -1, 0);\n $matrices[] = array( 1, 0, 0);\n $matrices[] = array( 0, 0, -1);\n \n $matrixcount = count($matrices);\n $limit = ceil($width/$matrixcount);\n $heightbreak = floor($height/2);\n\n header(\"Content-type: image/png\");\n $image = imagecreatetruecolor($width, $height);\n imagecolorallocate($image, 0, 0, 0);\n\n for ($x = 0; $x < $width; $x++) {\n\n $divisor = floor($x / $limit);\n $matrix = $matrices[$divisor];\n\n \n $colour[0] += $matrix[0]*$factor;\n $colour[1] += $matrix[1]*$factor;\n $colour[2] += $matrix[2]*$factor;\n\n for ($y=0;$y<$height;$y++) {\n $pixel = $colour;\n\n if ($y < $heightbreak) {\n $pixel[0] += ((255-$pixel[0])/$heightbreak)*($heightbreak-$y);\n $pixel[1] += ((255-$pixel[1])/$heightbreak)*($heightbreak-$y);\n $pixel[2] += ((255-$pixel[2])/$heightbreak)*($heightbreak-$y);\n } else if ($y > $heightbreak) {\n $pixel[0] = ($height-$y)*($pixel[0]/$heightbreak);\n $pixel[1] = ($height-$y)*($pixel[1]/$heightbreak);\n $pixel[2] = ($height-$y)*($pixel[2]/$heightbreak);\n }\n\n if ($pixel[0] < 0) $pixel[0] = 0;\n else if ($pixel[0] > 255) $pixel[0] = 255;\n if ($pixel[1] < 0) $pixel[1] = 0;\n else if ($pixel[1] > 255) $pixel[1] = 255;\n if ($pixel[2] < 0) $pixel[2] = 0;\n else if ($pixel[2] > 255) $pixel[2] = 255;\n\n imagesetpixel($image, $x, $y, imagecolorallocate($image, $pixel[0], $pixel[1], $pixel[2]));\n }\n\n }\n\n imagepng($image);\n imagedestroy($image);\n}",
"function aurum_woocommerce_3_3_transfer_image_sizes() {\n\t\t$do_resize = false;\n\t\t\n\t\t// WooCommerce Thumbnail\n\t\tif ( ( $shop_catalog_image_size = get_theme_mod( 'shop_catalog_image_size' ) ) ) {\n\t\t\t\n\t\t\t// {width}x{height} format\n\t\t\tif ( preg_match( '#^(?<width>[0-9]+)x(?<height>[0-9]+)(x(?<cropped>0|1))?$#', $shop_catalog_image_size, $shop_catalog_image_size_matches ) ) {\n\t\t\t\t$width = $shop_catalog_image_size_matches['width'];\n\t\t\t\t$height = $shop_catalog_image_size_matches['height'];\n\t\t\t\t$cropping = ! isset( $shop_catalog_image_size_matches['cropped'] ) || $shop_catalog_image_size_matches['cropped'];\n\t\t\t\t\n\t\t\t\t$ratio = _get_aspect_ratio( $width, $height );\n\t\t\t\t\n\t\t\t\tupdate_option( 'woocommerce_thumbnail_cropping', $cropping ? 'custom' : 'uncropped' );\n\t\t\t\tupdate_option( 'woocommerce_thumbnail_cropping_custom_width', $ratio[0] );\n\t\t\t\tupdate_option( 'woocommerce_thumbnail_cropping_custom_height', $ratio[1] );\n\t\t\t\t\n\t\t\t\t$do_resize = true;\n\t\t\t}\n\t\t\t// Crop width only\n\t\t\telse if( is_numeric( $shop_catalog_image_size ) ) {\n\t\t\t\tupdate_option( 'woocommerce_thumbnail_cropping', 'uncropped' );\n\t\t\t\tupdate_option( 'woocommerce_thumbnail_cropping_custom_width', $shop_catalog_image_size );\n\t\t\t\t\n\t\t\t\t$do_resize = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Single image\n\t\tif ( ( $shop_single_image_size = get_theme_mod( 'shop_single_image_size' ) ) ) {\n\t\t\t\n\t\t\tif ( preg_match( '#^(?<width>[0-9]+)(x(?<height>[0-9]+))?(x(?<cropped>0|1))?$#', $shop_single_image_size, $shop_single_image_size_matches ) ) {\n\t\t\t\tupdate_option( 'woocommerce_single_image_width', $shop_single_image_size_matches['width'] );\n\t\t\t\t\n\t\t\t\t$do_resize = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\t// Request image regeneration\n\t\tif ( $do_resize && class_exists( 'WC_Regenerate_Images' ) ) {\n\t\t\tWC_Regenerate_Images::queue_image_regeneration();\n\t\t}\n\t\t\n\t\t// Lightbox has moved\n\t\tset_theme_mod( 'shop_single_lightbox', ! get_theme_mod( 'shop_single_lightbox_disable', false ) );\n\t\t\n\t\t\n\t\t// WooCommerce columns\n\t\t$shop_product_columns = get_data( 'shop_product_columns' );\n\t\t\n\t\tupdate_option( 'woocommerce_catalog_columns', aurum_get_number_from_word( 'decide' == $shop_product_columns ? 4 : $shop_product_columns ) );\n\t\t\n\t\tif ( preg_match( '#[0-9]+#', get_data( 'shop_products_per_page' ), $matches ) ) {\n\t\t\tupdate_option( 'woocommerce_catalog_rows', $matches[0] );\n\t\t}\n\t\t\n\t\t// Run this once\n\t\tupdate_option( 'aurum_woocommerce_3_3_transfer_image_sizes', true );\n\t}",
"function spc_resizeImage( $file, $thumbpath, $max_side , $fixfor = NULL ) {\n\n\tif ( file_exists( $file ) ) {\n\t\t$type = getimagesize( $file );\n\n\t\tif (!function_exists( 'imagegif' ) && $type[2] == 1 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t}\n\t\telseif (!function_exists( 'imagejpeg' ) && $type[2] == 2 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t}\n\t\telseif (!function_exists( 'imagepng' ) && $type[2] == 3 ) {\n\t\t\t$error = __( 'Filetype not supported. Thumbnail not created.' );\n\t\t} else {\n\n\t\t\t// create the initial copy from the original file\n\t\t\tif ( $type[2] == 1 ) {\n\t\t\t\t$image = imagecreatefromgif( $file );\n\t\t\t}\n\t\t\telseif ( $type[2] == 2 ) {\n\t\t\t\t$image = imagecreatefromjpeg( $file );\n\t\t\t}\n\t\t\telseif ( $type[2] == 3 ) {\n\t\t\t\t$image = imagecreatefrompng( $file );\n\t\t\t}\n\n\t\t\tif ( function_exists( 'imageantialias' ))\n\t\t\t\timageantialias( $image, TRUE );\n\n\t\t\t$image_attr = getimagesize( $file );\n\n\t\t\t// figure out the longest side\n if($fixfor){\n \t if($fixfor == 'width'){\n \t \t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_width = $max_side;\n\n\t\t\t\t$image_ratio = $image_width / $image_new_width;\n\t\t\t\t$image_new_height = $image_height / $image_ratio;\n \t }elseif($fixfor == 'height'){\n \t $image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_height = $max_side;\n\n\t\t\t\t$image_ratio = $image_height / $image_new_height;\n\t\t\t\t$image_new_width = $image_width / $image_ratio;\t\n \t }\n }else{\n\t\t\tif ( $image_attr[0] > $image_attr[1] ) {\n\t\t\t\t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_width = $max_side;\n\n\t\t\t\t$image_ratio = $image_width / $image_new_width;\n\t\t\t\t$image_new_height = $image_height / $image_ratio;\n\t\t\t\t//width is > height\n\t\t\t} else {\n\t\t\t\t$image_width = $image_attr[0];\n\t\t\t\t$image_height = $image_attr[1];\n\t\t\t\t$image_new_height = $max_side;\n\n\t\t\t\t$image_ratio = $image_height / $image_new_height;\n\t\t\t\t$image_new_width = $image_width / $image_ratio;\n\t\t\t\t//height > width\n\t\t\t}\n }\t\n\n\t\t\t$thumbnail = imagecreatetruecolor( $image_new_width, $image_new_height);\n\t\t\t@ imagecopyresampled( $thumbnail, $image, 0, 0, 0, 0, $image_new_width, $image_new_height, $image_attr[0], $image_attr[1] );\n\n\t\t\t// move the thumbnail to its final destination\n\t\t\tif ( $type[2] == 1 ) {\n\t\t\t\tif (!imagegif( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ( $type[2] == 2 ) {\n\t\t\t\tif (!imagejpeg( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t\telseif ( $type[2] == 3 ) {\n\t\t\t\tif (!imagepng( $thumbnail, $thumbpath ) ) {\n\t\t\t\t\t$error = 0;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} else {\n\t\t$error = 0;\n\t}\n\n\tif (!empty ( $error ) ) {\n\t\treturn $error;\n\t} else {\n\t\treturn $thumbpath;\n\t}\n}",
"public function whitespaceCropperAction()\n {\n $image = __DIR__ . '/../../../data/media/test_whitespace.jpg';\n $cropper = $this->thumbnailer->createWhitespaceCropper(0, 0x000000);\n $thumb = $this->thumbnailer->create($image, [], [$cropper]);\n\n $thumb\n ->resize(200, 200)\n ->show()\n ->save('public/resized_test.jpg');\n\n return false;\n }"
]
| [
"0.6669877",
"0.63782066",
"0.63638526",
"0.59259546",
"0.5917225",
"0.5687388",
"0.56825906",
"0.56685144",
"0.56605077",
"0.5637934",
"0.5630584",
"0.5509667",
"0.5498261",
"0.5476517",
"0.54299325",
"0.54174674",
"0.5394097",
"0.537825",
"0.5374781",
"0.53622323",
"0.52870446",
"0.5286679",
"0.5275838",
"0.52621657",
"0.5247117",
"0.52319396",
"0.5226212",
"0.52258825",
"0.5215132",
"0.5191169",
"0.5189947",
"0.5158973",
"0.51575285",
"0.51200414",
"0.51094073",
"0.51086545",
"0.5108353",
"0.5091939",
"0.50847334",
"0.50828415",
"0.50783604",
"0.5066853",
"0.5061763",
"0.5034121",
"0.5033178",
"0.50273454",
"0.5019728",
"0.5017561",
"0.5010483",
"0.5009439",
"0.5007765",
"0.50068426",
"0.5006577",
"0.50040954",
"0.49955577",
"0.4990449",
"0.49811357",
"0.4971553",
"0.4967763",
"0.4958765",
"0.49572527",
"0.49493983",
"0.4945447",
"0.49427676",
"0.49320948",
"0.49250525",
"0.49204853",
"0.49115133",
"0.49091873",
"0.48937678",
"0.48922685",
"0.4886674",
"0.4879344",
"0.4868719",
"0.48659846",
"0.48485532",
"0.4846122",
"0.48433235",
"0.48305088",
"0.48275134",
"0.4824448",
"0.48182282",
"0.48181558",
"0.4816186",
"0.4812972",
"0.48123246",
"0.48098847",
"0.4804795",
"0.47910154",
"0.47845313",
"0.4782322",
"0.47811443",
"0.47763902",
"0.47727707",
"0.47657168",
"0.47652343",
"0.4764976",
"0.47598252",
"0.4755845",
"0.47552755"
]
| 0.56375265 | 10 |
Saves image resource to file | public function save_image($source, $destination, $image_type, $quality){
switch(strtolower($image_type)){//determine mime type
case 'image/png':
imagepng($source, $destination); return true; //save png file
break;
case 'image/gif':
imagegif($source, $destination); return true; //save gif file
break;
case 'image/jpeg': case 'image/pjpeg':
imagejpeg($source, $destination, $quality); return true; //save jpeg file
break;
default: return false;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"abstract public function save($img, $filename);",
"function imageSaveFile($property, \\SplFileInfo $file);",
"public function saveToFile($file_path = \"\") {\n// is there an image resource to work with?\n if (isset($this->_resource)) {\n if (!is_dir(dirname($file_path))) {\n $parent_directory = dirname($file_path);\n $mode = 0777;\n $recursive = true;\n mkdir($parent_directory, $mode, $recursive);\n }\n switch ($this->_mimetype) {\n case \"image/jpeg\":\n $file_extension = \"jpg\";\n break;\n case \"image/png\":\n $file_extension = \"png\";\n break;\n case \"image/gif\":\n $file_extension = \"gif\";\n break;\n }\n\n// filling out the file path\n $file_path = sprintf(\"%s.%s\", $file_path, $file_extension);\n switch ($this->_mimetype) {\n case \"image/jpeg\":\n imagejpeg($this->_resource, $file_path);\n break;\n case \"image/png\":\n imagepng($this->_resource, $file_path);\n break;\n case \"image/gif\":\n imagegif($this->_resource, $file_path);\n break;\n }\n\n// assigning the new image file_location attribute\n $this->_file_location = $file_path;\n\n// changing the mode (so that all can make good use of the new image file)\n chmod($this->_file_location, 0777);\n } else {\n trigger_error(\"CAMEMISResizeImage::saveToFile() attempting to access a non-existent resource (check if the image was loaded by CAMEMISResizeImage::__construct())\", E_USER_WARNING);\n }\n\n return $this;\n }",
"function saveImage()\n\t{\n\n\t\tif (!$this->ImageStream) {\n\t\t\t$this->printError('image not loaded');\n\t\t}\n\n\t\tswitch ($this->type) {\n\t\t\tcase 1:\n\t\t\t\t/* store a interlaced gif image */\n\t\t\t\tif ($this->interlace === true) {\n\t\t\t\t\timageinterlace($this->ImageStream, 1);\n\t\t\t\t}\n\n\t\t\t\timagegif($this->ImageStream, $this->sFileLocation);\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t/* store a progressive jpeg image (with default quality value)*/\n\t\t\t\tif ($this->interlace === true) {\n\t\t\t\t\timageinterlace($this->ImageStream, 1);\n\t\t\t\t}\n\n\t\t\t\timagejpeg($this->ImageStream, $this->sFileLocation, $this->jpegquality);\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t/* store a png image */\n\t\t\t\timagepng($this->ImageStream, $this->sFileLocation);\n\t\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->printError('invalid imagetype');\n\n\t\t\t\tif (!file_exists($this->sFileLocation)) {\n\t\t\t\t\t$this->printError('file not stored');\n\t\t\t\t}\n\t\t}\n\t}",
"function imageSave($property, UploadedFile $file);",
"protected function save()\n {\n switch ($this->image_info['mime']) {\n \n case 'image/gif':\n imagegif($this->image, $this->getPath(true));\n break;\n \n case 'image/jpeg':\n imagejpeg($this->image, $this->getPath(true), $this->quality);\n break;\n \n case 'image/jpg':\n imagejpeg($this->image, $this->getPath(true), $this->quality);\n break;\n \n case 'image/png':\n imagepng($this->image, $this->getPath(true), round($this->quality / 10));\n break;\n \n default:\n $_errors[] = $this->image_info['mime'] . ' images are not supported';\n return $this->errorHandler();\n break;\n }\n \n chmod($this->getPath(true), 0777);\n }",
"function save(&$image) {\r\r\n\t\treturn $this->__write($image);\r\r\n\t\t}",
"protected function saveImage()\n {\n if ( $this->initialImage != $this->image )\n {\n $this->deleteOldImage();\n\n $imageHandler= new CImageHandler();\n $imageHandler->load( $this->getTempFolder( TRUE ) . $this->image );\n $imageHandler->save($this->getImagesFolder( TRUE ) . $imageHandler->getBaseFileName() );\n\n $settings = $this->getThumbsSettings();\n\n if ( !empty( $settings ) )\n {\n $imageHandler= new CImageHandler();\n $imageHandler->load( $this->getTempFolder( TRUE ) . $this->image );\n\n foreach( $settings as $prefix => $dimensions )\n {\n list( $width, $height ) = $dimensions;\n $imageHandler\n ->thumb( $width, $height )\n ->save( $this->getImagesFolder( TRUE ) . $prefix . $imageHandler->getBaseFileName() );\n }\n }\n\n @unlink( $this->getTempFolder( TRUE ) . $this->image );\n }\n }",
"private function save()\n {\n $this->collage->setImageFormat('jpeg');\n return $this->collage->writeImage($this->name);\n }",
"public function save($file)\r\n\t{\r\n\t\tif(empty($this->img))\r\n\t\t{\r\n\t\t\t$this->render();\r\n\t\t}\r\n\t\timagepng($this->img, $file);\r\n\t}",
"public function save()\n {\n\n $photo = $this->flyer->addPhoto($this->makePhoto());\n\n\n // move the photo to the images folder\n $this->file->move($photo->baseDir(), $photo->name);\n\n\n// Image::make($this->path)\n// ->fit(200)\n// ->save($this->thumbnail_path);\n\n // generate a thumbnail\n $this->thumbnail->make($photo->path, $photo->thumbnail_path);\n }",
"private function savePhoto()\n {\n $image = Image::make($this->filePath);\n\n File::exists($this->sanghaPhotosPath()) or File::makeDirectory($this->sanghaPhotosPath());\n\n $image->resize(400, null, function ($constraint) {\n $constraint->aspectRatio();\n $constraint->upsize();\n })\n ->save($this->sanghaPhotosPath() . $this->fileName)\n ->resize(200, null, function ($constraint) {\n $constraint->aspectRatio();\n })\n ->save($this->sanghaPhotosPath() . 'tn_' . $this->fileName);\n\n }",
"public function save() {\n// is there an image resource and file location to work with?\n if (isset($this->_resource, $this->_file_location)) {\n switch ($this->_mimetype) {\n case \"image/jpeg\":\n imagejpeg($this->_resource, $this->_file_location);\n break;\n case \"image/png\":\n imagepng($this->_resource, $this->_file_location);\n break;\n case \"image/gif\":\n imagegif($this->_resource, $this->_file_location);\n break;\n }\n } else {\n trigger_error(\"CAMEMISResizeImage::save() attempting to access a non-existent resource (check if the image was loaded by CAMEMISResizeImage::__construct())\", E_USER_WARNING);\n }\n\n return $this;\n }",
"function save_img() {\n imagejpeg($this->img, 'captcha.jpg');\n\n // Libération de la mémoire\n imagedestroy($this->img);\n \n }",
"public function save() {\n \n $checkError = $this->isError();\n if (!$checkError) {\n \n $ext = $this->getImageExt();\n $quality = $this->__imageQuality;\n $dirSavePath = dirname($this->__imageSavePath);\n \n if (empty($this->__imageSavePath) || !is_dir($dirSavePath)) {\n $this->setError(__d('cloggy','Image save path not configured or maybe not exists.'));\n } else { \n \n /*\n * create resized image\n */\n switch($ext) {\n \n case 'jpg':\n case 'jpeg':\n\n if (imagetypes() & IMG_JPG) {\n @imagejpeg($this->__imageResized,$this->__imageSavePath,$quality); \n }\n\n break;\n\n case 'gif':\n\n if (imagetypes() & IMG_GIF) {\n @imagegif($this->__imageResized,$this->__imageSavePath); \n }\n\n break;\n\n case 'png':\n\n $scaleQuality = round($this->__imageQuality/100) * 9;\n $invertScaleQuality = 9 - $scaleQuality;\n\n if (imagetypes() & IMG_PNG) {\n @imagepng($this->__imageResized,$this->__imageSavePath,$invertScaleQuality); \n }\n\n break;\n\n } \n \n } \n \n /*\n * destroy resized image\n */\n if ($this->__imageResized) {\n \n //destroy resized image\n imagedestroy($this->__imageResized);\n \n } \n \n }\n \n }",
"public function save($file = NULL)\n {\n if($file === NULL && $this->storage)\n {\n $this->storage->save($this);\n }\n elseif($file !== NULL)\n {\n $this->savePicture($file);\n }\n else\n {\n trigger_error('Image file to save is not defined', E_USER_WARNING);\n }\n }",
"function image_return_write($im, $write_to_abspath)\n{\n $return = $im->writeImage($write_to_abspath);\n $im->clear();\n $im->destroy();\n return $return;\n}",
"function save_camp_image(){\n\t\n\t\n\t$data = $_POST['data'];\n\tlist($type, $data) = explode(';', $data);\n\tlist(, $data) = explode(',', $data);\n\t$data = base64_decode($data);\t\t\n\t$img_name = 'tshirt'.time().'.png';\n\t\n\t$upload_dir = wp_upload_dir();\t\n\t\n\t$target_path_image = $upload_dir['path'].'/'.$img_name;\n\t\n\tfile_put_contents($target_path_image, $data);\n\t\n\techo json_encode(array('action'=>'done','img'=>$img_name));\t\n\tdie();\n}",
"public function saveStickerToImage()\n {\n $this->sticker->saveToS3($this->stickerDir . $this->getDriverLogoImageName());\n }",
"public function save($img, $name, $path = null)\n {\n $path = $path ?: $this->path;\n\n $this->disk->put($path .'/'. $name, $img->stream());\n }",
"private function intern_save ($targetPath = null)\n\t{\n\t\tif ($this->newImage == null) $this->newImage = $this->srcImage;\n\n\t\tif ($targetPath == null) $targetPath = $this->srcPath;\n\t\telse\n\t\t{\n\t\t\tif (Pathfinder::isAbsolute($targetPath)) $targetPath = $targetPath;\n\t\t\t$targetPath = $this->dataRootPath . $this->getRelativePath($targetPath);\n\t\t}\n\n\t\t// create folders if necessary\n\t\t$this->setUpFolder($targetPath);\n\t\t// remove file from folder with same name\n\t\t$this->intern_removePrevious($targetPath);\n\n\t\t// save\n\t\tswitch($this->srcInfo['extension']) {\n\t\t\tcase 'jpg':\n\t\t\tcase 'jpeg':\n\t\t\t\timagejpeg ( $this->newImage, $targetPath);\n\t\t\t\tbreak;\n\t\t\tcase 'png':\n\t\t\t\timagepng ( $this->newImage, $targetPath);\n\t\t\t\tbreak;\n\t\t\tcase 'gif':\n\t\t\t\timagegif ( $this->newImage, $targetPath);\n\t\t}\n\t\t$this->intern_end();\n\t}",
"public function writeimg() {\n\t\t$data = Input::all();\n\t\t$img = $data['imgdata'];\n\t\t$student_id = $data['student_id'];\n\t\t$img = str_replace('data:image/png;base64,', '', $img);\n\t\t$img = str_replace(' ', '+', $img);\n\t\t$imgdat = base64_decode($img);\n\t\t$myPublicFolder = public_path();\n\t\t$savePath = $myPublicFolder.\"/photo\";\n\t\t$path = $savePath.\"/$student_id.png\";\n\t\tFile::delete($path);\n\t\tFile::put($path , $imgdat);\n\t\t$last_add = Student::orderby('id', 'desc')->first();\n\t\tStudent::where('student_id', '=', $student_id)->update(array('pic' => \"$student_id.png\"));\n\t\treturn View::make('finish', array('imgid' => Student::where('student_id', '=', $student_id)->firstOrFail()->group));\n\t}",
"protected function savePicture($file)\n {\n $this->loadImageResource();\n\n // SUPPORT FOR CMYK IMAGES\n $colorSpace = new Colorspace();\n $colorSpace->apply($this);\n\n // APPLY EFFECT ON IMAGE\n foreach($this->effect as $effect)\n {\n if($effect instanceof PictureEffect)\n {\n $effect->apply($this);\n }\n }\n\n // CREATE DIRECTORY BY FILE PATH\n if(!file_exists($directory = dirname($file)))\n {\n mkdir($directory, 0777, TRUE);\n }\n\n // Zjistíme v jakém formátu máme obrázek uložit.\n $imageSaveFormat = $this->saveAs ?: strtolower(pathinfo($file, PATHINFO_EXTENSION));\n\n // Provedeme uložení obrázku přes GD.\n if($this->isGd())\n {\n // Uložení do WebP.\n if($imageSaveFormat === EPictureFormat::WEBP)\n {\n if($this->progressive)\n {\n imageinterlace($this->resource, TRUE);\n }\n\n imagewebp($this->resource, $file, $this->quality);\n }\n // Uložení do PNG.\n elseif($imageSaveFormat === EPictureFormat::PNG)\n {\n if($this->progressive)\n {\n imageinterlace($this->resource, TRUE);\n }\n\n imagepng($this->resource, $file, 9);\n }\n // Uložení do GIF.\n elseif($imageSaveFormat === EPictureFormat::GIF)\n {\n $gifResource = $this->resource;\n\n if($this->isGdImageTransparent($gifResource))\n {\n $validAlpha = ceil(0.333 * 127);\n $visiblePixels = 0;\n\n $height = imagesy($gifResource);\n $width = imagesx($gifResource);\n\n $transparentColor = imagecolorallocate($gifResource, 0xfe, 0x3, 0xf4);\n\n // FIX GIF IMAGE OPACITY\n for($x = 0; $x < $width; $x++)\n {\n for($y = 0; $y < $height; $y++)\n {\n $pixelIndex = imagecolorat($gifResource, $x, $y);\n $pixelColor = imagecolorsforindex($gifResource, $pixelIndex);\n\n if($pixelColor['alpha'] <= $validAlpha)\n {\n $visiblePixels++;\n }\n }\n }\n\n if(!$visiblePixels)\n {\n $validAlpha = 127;\n }\n\n for($x = 0; $x < $width; $x++)\n {\n for($y = 0; $y < $height; $y++)\n {\n $pixelIndex = imagecolorat($gifResource, $x, $y);\n $pixelColor = imagecolorsforindex($gifResource, $pixelIndex);\n\n if($pixelColor['alpha'] >= $validAlpha)\n {\n imagesetpixel($gifResource, $x, $y, $transparentColor);\n }\n else\n {\n $visiblePixel = imagecolorallocatealpha(\n\n $gifResource,\n $pixelColor['red'],\n $pixelColor['green'],\n $pixelColor['blue'],\n 0\n );\n\n imagesetpixel($gifResource, $x, $y, $visiblePixel);\n }\n }\n }\n\n imagecolortransparent($gifResource, $transparentColor);\n }\n\n if($this->progressive)\n {\n imageinterlace($gifResource, TRUE);\n }\n\n imagegif($gifResource, $file);\n }\n // Uložení do JPG.\n else\n {\n $image = $this->resource;\n\n $width = imagesx($image);\n $height = imagesy($image);\n\n $background = imagecreatetruecolor($width, $height);\n $whiteColor = imagecolorallocate($background, 255, 255, 255);\n\n imagefilledrectangle($background, 0, 0, $width, $height, $whiteColor);\n imagecopy($background, $image, 0, 0, 0, 0, $width, $height);\n\n if($this->progressive)\n {\n imageinterlace($background, TRUE);\n }\n\n imagejpeg($background, $file, $this->quality);\n }\n }\n // Provedeme uložení obrázku přes Imagick.\n else\n {\n // Uložení do WebP.\n if($imageSaveFormat === EPictureFormat::WEBP)\n {\n // There are problems with saving webP via imagick.\n // We will fall back to use GD extension to save image.\n $imageGd = $this->convertResource($this::WORKER_GD);\n\n if($this->progressive)\n {\n imageinterlace($imageGd, TRUE);\n }\n\n imagewebp($imageGd, $file, $this->quality);\n }\n // Uložení do JPG.\n elseif($imageSaveFormat === EPictureFormat::JPG)\n {\n $background = $this->createImagick();\n $background->newImage(\n\n $this->resource->getImageWidth(),\n $this->resource->getImageHeight(),\n '#FFFFFF'\n );\n\n $background->compositeImage($this->resource, Imagick::COMPOSITE_OVER, 0, 0);\n $background->setImageFormat('jpg');\n $background->setImageCompression(Imagick::COMPRESSION_JPEG);\n $background->setImageCompressionQuality($this->quality);\n\n if($this->progressive)\n {\n $background->setInterlaceScheme(Imagick::INTERLACE_PLANE);\n }\n\n $background->writeImage($file);\n }\n // Uložení do GIF.\n elseif($imageSaveFormat === EPictureFormat::GIF)\n {\n $validAlpha = 0.333;\n $visiblePixels = 0;\n $iterator = $this->resource->getPixelIterator();\n\n /** @var $pixel \\ImagickPixel */\n foreach($iterator as $row => $pixels)\n {\n foreach ($pixels as $col => $pixel)\n {\n $color = $pixel->getColor(TRUE);\n\n if($color['a'] >= $validAlpha)\n {\n $visiblePixels++;\n }\n }\n\n $iterator->syncIterator();\n }\n\n if(!$visiblePixels)\n {\n $validAlpha = 0;\n }\n\n // SAVE NEW ALPHA COLOR VALUE\n foreach($iterator as $row => $pixels)\n {\n foreach ($pixels as $col => $pixel)\n {\n $color = $pixel->getColor(TRUE);\n $pixel->setColorValue(Imagick::COLOR_ALPHA, $color['a'] >= $validAlpha ? 1 : 0);\n }\n\n $iterator->syncIterator();\n }\n\n if($this->progressive)\n {\n $this->resource->setInterlaceScheme(Imagick::INTERLACE_PLANE);\n }\n\n $this->resource->writeImage($file);\n }\n // Uložení do PNG.\n else\n {\n if($this->progressive)\n {\n $this->resource->setInterlaceScheme(Imagick::INTERLACE_PLANE);\n }\n\n $this->resource->writeImage($file);\n }\n }\n\n // Nastavení práv založenému obrázku.\n chmod($file, 0777);\n touch($file, filemtime($this->getImage()));\n\n // Odstranění dočasných souborů.\n foreach($this->tmpImage as $tmpImage)\n {\n unlink($tmpImage);\n }\n }",
"public function saveToFile($name = null)\n {\n // Self Generate File Location\n if (!$name) {\n $name = uniqid() . '.png';\n }\n // Save to File\n file_put_contents($name, base64_decode($this->getImage()));\n return $name;\n }",
"function savePicture($filepath,$data)\n {\n $file = fopen($filepath,\"w+\");\n fwrite($file,$data);\n fclose($file);\n }",
"private function saveAsImage($url, $file, $path,$filename)\n {\n $resource = fopen($path . $filename, 'a');\n fwrite($resource, $file);\n fclose($resource);\n }",
"public function save()\n {\n $this->validate();\n $this->validate(['image' => 'required|image']);\n\n // try to upload image and resize by ImageSaverController config\n try {\n $imageSaver = new ImageSaverController();\n $this->imagePath = $imageSaver->loadImage($this->image->getRealPath())->saveAllSizes();\n }catch (\\RuntimeException $exception){\n dd($exception);\n }\n\n $this->PostSaver();\n\n $this->resetAll();\n $this->ChangeCreatedMode();\n $this->swAlert([\n 'title' => 'Good job',\n 'text' => 'successfully added',\n 'icon' => 'success'\n ]);\n $this->render();\n }",
"public function saveImage($fid) {\n $file_usage = \\Drupal::service('file.usage');\n $file = File::load( $fid );\n\n if ($file) {\n\n // set file status permanent\n if(!$file->isPermanent()){\n $file->setPermanent();\n }\n\n // check file usage , if it's empty, add new entry\n $usage = $file_usage->listUsage($file);\n\n if(empty($usage)){\n // let's assume it's image\n $file_usage->add($file,'vegas','image',$fid);\n }\n\n $file->save();\n }\n }",
"public function saveImage($targetPath = null)\n\t{\n\t\t$this->intern_save($targetPath);\n\t}",
"public function saveImageToUser($image, $user);",
"function save_image($img,$fullpath){\n $ch = curl_init ($img);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_BINARYTRANSFER,1);\n $rawdata=curl_exec($ch);\n curl_close ($ch);\n if(file_exists($fullpath)){\n unlink($fullpath);\n }\n $fp = fopen($fullpath,'x');\n fwrite($fp, $rawdata);\n fclose($fp);\n}",
"public function save()\n {\n $dir = $this->pathTmpImage;\n\n $files = scandir($dir);\n\n foreach ($files as $file) {\n if ($file == $_POST['image']) { \n copy($this->pathTmpImage . $file, $this->pathResult . $file);\n }\n }\n\n //$this->dbInsert($_POST['image']);\n\n unlink($this->pathTmpImage . $_POST['image']);\n }",
"function save($filename, $image_type=IMAGETYPE_JPEG, $compression=75, $permissions=null) \n {\n //salva imagen tipo JPEG\n if( $image_type == IMAGETYPE_JPEG )\n {\n imagejpeg($this->image,$filename,$compression);\n } \n //Salva imagen GIF.\n elseif( $image_type == IMAGETYPE_GIF ) \n {\n imagegif($this->image,$filename); \n } \n //Salva imagen PNG\n //Necesita una imagen transparente.\n elseif( $image_type == IMAGETYPE_PNG ) \n { \n imagealphablending($this->image, false);\n imagesavealpha($this->image,true);\n imagepng($this->image,$filename);\n } \n if( $permissions != null) \n {\n chmod($filename,$permissions);\n }\n }",
"protected function _store($im)\n {\n if (!is_null($this->_options['savePath'])) {\n switch ($this->_options['imageType']) {\n case 'gif':\n imagegif($im, $this->_options['savePath']);\n break;\n case 'jpeg':\n imagejpeg($im, $this->_options['savePath']);\n break;\n case 'png':\n default:\n imagepng($im, $this->_options['savePath']);\n }\n }\n \n return $im; \n }",
"public function save($file, $path);",
"function wp_save_image($post_id)\n {\n }",
"private function saveImage()\n {\n $name = $_FILES['image']['name'];\n $tmp_name = $_FILES['image']['tmp_name'];\n\n return move_uploaded_file($tmp_name, 'images/' . $name);\n }",
"public function save(array $options = []) {\n/* if (preg_match('/image/', $this->mime_type)) {\n $this->isImage = true;\n $manager = new ImageManager(array('driver' => 'gd'));\n $image = Storage::disk('public')->get($this->myFile);\n $imageOrig = $manager->make($image); \n //Get width and height of the image\n $this->img_width = $imageOrig->width();\n $this->img_height = $imageOrig->height();\n }*/\n parent::save($options);\n $this->createThumbs();\n }",
"public function save($target,$file_name)\n\t{\n\t\tif(!$this->_target) return $this->copy($target,$file_name);\n\t\t\n\t\t$path = $this->_prepare_path($target, $file_name); \n\t\t\n\t\tswitch($this->type){\n\t\t\t\tcase IMAGE_TYPE_PNG : imagepng($this->source, $path); break;\n\t\t\t\tcase IMAGE_TYPE_JPG : imagejpeg($this->source, $path); break;\n\t\t\t\tcase IMAGE_TYPE_GIF : imagegif($this->source,$path); break;\n\t\t}\n\t\t\n\t\t\n\t\t\n\n\t}",
"function save_image($inPath, $outPath) {\n $in = fopen ( $inPath, \"rb\" );\n $out = fopen ( $outPath, \"wb\" );\n while ( $chunk = fread ( $in, 8192 ) ) {\n fwrite ( $out, $chunk, 8192 );\n }\n fclose ( $in );\n fclose ( $out );\n}",
"private function saveImage($file, $var_image){\n\n //create instance of image from temp upload\n $image = \\Image::make($file->getRealPath());\n\n //save image with thumbnail\n $image->save(public_path() . '/imgs/library/' . $var_image) \n ->resize(200, 200)\n ->save(public_path() . '/imgs/library/thumbnails/thumb-' . $var_image);\n }",
"public function getSavePath() {\n return $this->__imageSavePath;\n }",
"function save_image($inPath,$outPath)\n{\n $in= fopen($inPath, \"rb\");\n $out= fopen($outPath, \"wb\");\n while ($chunk = fread($in,8192))\n {\n fwrite($out, $chunk, 8192);\n }\n fclose($in);\n fclose($out);\n}",
"function writeimage( $imagepath ) {\r\n global $CFG;\r\n\r\n if (empty($imagepath)) {\r\n return '';\r\n }\r\n\r\n $courseid = $this->course->id;\r\n if (!$binary = file_get_contents( \"{$CFG->dataroot}/$courseid/$imagepath\" )) {\r\n return '';\r\n }\r\n\r\n $content = \" <image_base64>\\n\".addslashes(base64_encode( $binary )).\"\\n\".\r\n \"\\n </image_base64>\\n\";\r\n return $content;\r\n }",
"function writeImageToFile($img, $userid, $picno, $file=\"\") {\n if ($file == '') {\n $filename= $userid.$picno.'.jpg';\n } else {\n $filename = $file;\n }\n\n $img = imagecreatefromstring( $img );\n imagejpeg($img, USER_IMAGE_DIR.$filename);\n\n return ($filename);\n}",
"function saveImageObjectToFile($objImage, $imageType, $fileName, $quality)\n\t{\n\t\t$filePath = dirname($fileName);\n\t\tif (!is_dir($filePath))\n\t\t\tmkdir($filePath, 0777, true);\n\t\t\n\t\t// If the file already exists\n\t\tif(is_file($fileName))\n\t\t\t@unlink($fileName);\n\n\t\t\t\t\n\t\tswitch ($imageType)\n\t\t{\n\t\t\tcase 1: $res = @imagegif($objImage,$fileName); break;\n\t\t\tcase 2: $res = @imagejpeg($objImage,$fileName,intval($quality*100)); break;\n\t\t\tcase 3: $res = @imagepng($objImage,$fileName,intval($quality*9)); break;\n\t\t}\n\t\t\t\t\n\t\tif (!$res)\n\t\t\t$this->lastError = 'error_saving_image_file';\n\t\t\n\t\tchmod($fileName, 0777);\n\t\t\n\t\treturn $res;\n\t}",
"public function save($value){\n $target_path = IMG_PATH.DS.$this->file_name;\n try {\n //move the uploaded file to target path\n move_uploaded_file($value, $target_path);\n return $this->_add_photo();\n } catch (Exception $e) {\n throw $e;\n }\n }",
"public static function save_file($_file)\n {\n $photo_file = MyUtil::gen_file_name();\n $new_file = $_SERVER['DOCUMENT_ROOT'] . \"/statics/images/upload/$photo_file\";\n if (file_put_contents($new_file, $_file)) {\n $img_type = exif_imagetype($new_file);\n $ext = image_type_to_extension($img_type, TRUE);\n rename($new_file, $new_file . $ext);\n $new_file = $new_file . $ext;\n return $photo_file . $ext;\n }\n }",
"private function _imgSave(){\r\n\r\n\r\n $result = new stdClass();\r\n $response = 400;\r\n\r\n if($this->hasLogin()){\r\n\r\n /*\r\n \t*\r\n \t*\r\n \t*\tCheck the method used is POST\r\n \t*\r\n \t*\r\n \t*/\r\n \tif($_SERVER['REQUEST_METHOD'] == 'POST'){\r\n\r\n $url = strtok($_POST['url'], '?');\r\n\r\n $sourcePath = ROOT.'/site/files/_tmp/'.basename($url);\r\n $img = getimagesize($sourcePath);\r\n $new_name = uniqid();\r\n\r\n switch($img['mime']){\r\n case 'image/png':\r\n $new_name .= '.png';\r\n break;\r\n case 'image/jpeg':\r\n $new_name .= '.jpg';\r\n break;\r\n case 'image/gif':\r\n $new_name .= '.gif';\r\n break;\r\n default:\r\n echo \"Only PNG, JPEG or GIF images are allowed!\";\r\n exit;\r\n }\r\n\r\n $targetPath = ROOT.'/site/files/'.$new_name;\r\n $webPath = WEBROOT.'/site/files/'.$new_name;\r\n\r\n if(rename($sourcePath, $targetPath)){\r\n $result->url = $webPath;\r\n $result->size = [$img[0],$img[1]];\r\n $result->alt = 'an image';\r\n $response = 200;\r\n } else {\r\n $response = 400;\r\n }\r\n\r\n }\r\n }\r\n\r\n http_response_code($response);\r\n echo json_encode($result);\r\n exit;\r\n\r\n\r\n }",
"public function saveImage($filename)\n\t{\n\t\timagejpeg( $this->im, \"$filename\", $this->cq );\n\t}",
"function save($filename, $compression=75, $permissions=null) \r\n\t{\r\n $success = true;\r\n $image_type = $this->type;\r\n \r\n ob_start(); \r\n //$mime = image_type_to_mime_type( $image_type );\r\n //header(\"Content-type: $mime\");\r\n \r\n if( $image_type == IMAGETYPE_JPEG ) {\r\n if (!$success = imagejpeg($this->image, null ))\r\n {\r\n $this->setError( \"DSCImage::save( 'jpeg' ) Failed\" );\r\n }\r\n } elseif( $image_type == IMAGETYPE_GIF ) {\r\n if (!$success = imagegif($this->image, null ))\r\n {\r\n $this->setError( \"DSCImage::save( 'gif' ) Failed\" );\r\n }\r\n } elseif( $image_type == IMAGETYPE_PNG ) {\r\n if (!$success = imagepng($this->image, null ))\r\n {\r\n $this->setError( \"DSCImage::save( 'png' ) Failed\" );\r\n }\r\n }\r\n\r\n if ($success)\r\n {\r\n $imgToWrite = ob_get_contents();\r\n ob_end_clean();\r\n \r\n if (!JFile::write( $filename, $imgToWrite)) \r\n {\r\n $this->setError( JText::_( \"Could not write file\" ).\": \".$filename );\r\n return false;\r\n }\r\n \r\n if( $permissions != null) {\r\n chmod($filename,$permissions);\r\n }\r\n unset($this->image);\r\n return true; \r\n }\r\n \r\n return false;\r\n\t}",
"function save($filePath);",
"public function saveFileToPage() {\n if(!$this->savePage || !$this->saveField) {\n throw new WireException('You must define the savePage and saveField options before trying to save an image field');\n }\n\n $value = $this->value;\n // Move attachment into its own temp/quarantined folder so we can give it a nice file name\n if (is_array($value['tmp_name'])) {\n foreach($value['tmp_name'] as $key => $tempName) {\n $this->addFileToField($value['name'][$key], $tempName);\n }\n } else {\n $this->addFileToField($value['name'], $value['tmp_name']);\n }\n $this->value = $this->savePage->getUnformatted($this->saveField);\n }",
"protected function saveImage($asset)\n {\n\n if($this->isRemoteFile($asset->src) && $this->isUnisaFile($asset->src))\n {\n $image = $this->getImageManager()->make($asset->src);\n\n } elseif( ! $this->isBase64($asset->src))\n {\n $image = $this->getImageManager()->make(base_path('../') . $asset->src);\n\n } else {\n return $asset;\n }\n\n if($this->getFileTypeFromUrl($asset->src) == 'svg')\n {\n $src_filename = str_replace_first('svg', 'png', $asset->src);\n }\n else\n {\n $src_filename = $asset->src;\n }\n\n $store_path = Storage::disk('storage')->path($this->getDestPath($asset->tag, $src_filename));\n\n $asset->src = $this->getRelativePath($asset->tag, $src_filename);\n $asset->height = $image->height();\n $asset->width = $image->width();\n $asset->style = \"width: {$image->width()}px; height: {$image->height()}px;\";\n\n $image->save($store_path);\n $image->destroy();\n\n return $asset;\n }",
"function __write(&$image) {\r\r\n\t\tasido::trigger_abstract_error(\r\r\n\t\t\t__CLASS__,\r\r\n\t\t\t__FUNCTION__\r\r\n\t\t\t);\r\r\n\t\t}",
"public function test_it_loads_an_image_string_into_a_resource()\n {\n imagepng(imagecreatefromstring($this->imagePath), $this->compareTestSaveLocation);\n imagepng($this->image->getImageResource(), $this->testImageSaveLocation);\n\n $correctImage = file_get_contents($this->compareTestSaveLocation);\n $testImage = file_get_contents($this->testImageSaveLocation);\n\n $this->assertEquals($correctImage, $testImage);\n }",
"function save($path, $file) {\n $input = fopen(\"php://input\", \"r\");\n $temp = tmpfile();\n $realSize = stream_copy_to_stream($input, $temp);\n fclose($input);\n\n if ($realSize != $this->getSize()){\n return false;\n }\n\n\n $target = fopen($path.$file, \"w\");\n fseek($temp, 0, SEEK_SET);\n stream_copy_to_stream($temp, $target);\n fclose($target);\n\n // создать миниатюру\n $image = new SimpleImage();\n $image->load($path.$file);\n $image->resizeToHeight(200);\n $image->save($path.'small/small_'.$file);\n ;\n\n return true;\n }",
"public function saveProduct($img, $request) {\n \n $extension = $img->getClientOriginalExtension();\n \n if ($request->hasFile('file')) {\n $image = $request->file('file')->store('public/profile');\n } else {\n $image = \"\";\n }\n return $image; \n }",
"function updateImg(){\n $image = str_replace('data:image/png;base64,', '', $_POST['image']);\n $image = str_replace(' ', '+', $image);\n // Decode the Base64 encoded Image\n $data = base64_decode($image);\n // Create Image path with Image name and Extension\n $file = '../images/' . \"MyImage\" . '.jpg';\n // Save Image in the Image Directory\n $success = file_put_contents($file, $data);\n}",
"public function SaveProfileImg() {\n $file_name = $_SESSION['user_id'] . \"-\" . time() . \"-\" . $this->ImageName;\n $file_size = $this->ImageSize;\n $file_tmp = $this->ImageTmpName;\n $tmp = explode('.', $file_name);\n $file_ext = end($tmp);\n $expensions = array(\"jpeg\", \"jpg\", \"png\", \"gif\");\n \n if (in_array($file_ext, $expensions) === false) {\n throw new Exception(\"extension not allowed, please choose a JPEG or PNG or GIF file.\");\n }\n \n if ($file_size > 2097152) {\n throw new Exception('File size must be excately 2 MB');\n }\n \n if (empty($errors) == true) {\n move_uploaded_file($file_tmp, \"data/profile/\" . $file_name);\n return \"data/profile/\" . $file_name;\n } else {\n echo \"Error\";\n }\n }",
"public function saveimageAction()\n {\n $response = $this->getResponse();\n\n $userid= $this->params()->fromPost('userid');\n $createdTime= $this->params()->fromPost('createdtime');\n $imageType = $this->params()->fromPost('imagetype');\n $imageType = substr($imageType, -3, 3);\n $AVAorCOV = $this->params()->fromPost('albumtype');\n\n $documentService = $this->getDocumentService();\n\n $successModel = new SuccessModel();\n $result = $successModel->saveNewImageAvatar($userid, $createdTime,$documentService, $imageType, $AVAorCOV );\n\n if($result)\n {\n return $response->setContent(\\Zend\\Json\\Json::encode(array(\n 'success' => 1,\n )));\n }\n else\n {\n return $response->setContent(\\Zend\\Json\\Json::encode(array(\n 'success' => 0,\n )));\n }\n }",
"function save ($input) {\r\n // Do your processing\r\n // Save to database of something\r\n //processin here cuz\r\n\r\n// $fp = fopen('images/test.txt', 'w');//opens file in append mode \r\n// fwrite($fp, $input); \r\n// fclose($fp);\r\n\r\n// $fp = fopen('images/len.txt', 'w');//opens file in append mode \r\n// fwrite($fp, strlen($input)); \r\n// fclose($fp);\r\n\r\n $img = str_replace('data:image/png;base64,', '', $input);\r\n $img = str_replace(' ', '+', $img);\r\n\r\n// $fp = fopen('images/img2.txt', 'w');//opens file in append mode \r\n// fwrite($fp, $img); \r\n// fclose($fp);\r\n\r\n $fileData = base64_decode($img);\r\n file_put_contents('images/photo.png',$fileData);\r\n return true;\r\n}",
"public function store(){\n $url_path = 'assets/imgs/' . $_FILES['file']['name'];\n move_uploaded_file($_FILES['file']['tmp_name'], $url_path);\n $_POST['url_image'] = $url_path;\n echo parent::register($_POST) ? header('location: ?controller=admin') : 'Error en el registro';\n }",
"public function getImageOutputStream() {\n\t\t\t//Send Modified Header\n\t\t\theader(\"Content-Type: image/png\");\n\t\t\t\n\t\t\t//Output Image and destroy the Stream\n\t\t\timagepng($this->image);\n\t\t\timagedestroy($this->image);\n\t\t}",
"public function saveImage($imageResource, $fileName)\n {\n $filePart = explode(\".\", $fileName);\n \n $fileExtension = strtolower($filePart[count($filePart) - 1]);\n \n if ($fileExtension === 'bmp') {\n return imagebmp($imageResource, $fileName);\n }\n elseif ($fileExtension === 'gd2') {\n return imagegd2($imageResource, $fileName);\n }\n elseif ($fileExtension === 'gd') {\n return imagegd($imageResource, $fileName);\n }\n elseif ((imagetypes() & IMG_GIF) && $fileExtension === 'gif') {\n return imagegif($imageResource, $fileName);\n }\n elseif ((imagetypes() & IMG_JPG) && ($fileExtension === 'jpeg' || $fileExtension === 'jpg')) {\n return imagejpeg($imageResource, $fileName);\n }\n elseif ((imagetypes() & IMG_PNG) && $fileExtension === 'png') {\n return imagepng($imageResource, $fileName);\n }\n elseif ((imagetypes() & IMG_WBMP) && $fileExtension === 'wbmp') {\n return imagewbmp($imageResource, $fileName);\n }\n elseif ((imagetypes() & IMG_WEBP) && $fileExtension === 'webp') {\n return imagewebp($imageResource, $fileName);\n }\n elseif ($fileExtension === 'xbm') {\n return imagexbm($imageResource, $fileName);\n }\n elseif ((imagetypes() & IMG_XPM) && $fileExtension === 'xpm') {\n return imagexbm($imageResource, $fileName);\n }\n else {\n return false;\n }\n }",
"function save($path, $file) {\n // сохраняем миниатюру]\n // создать миниатюру\n // if (!move_uploaded_file($_FILES['qqfile']['tmp_name'], $path.'small/small_'.$file)) {\n // return false;\n // }\n // если всё нормально, то\n // сохраняем оригинальный файл\n if(!move_uploaded_file($_FILES['qqfile']['tmp_name'], $path.$file)){\n return false;\n }\n\n // создать миниатюру\n $image = new SimpleImage();\n $image->load($path.$file);\n $image->resize(400, 200);\n $image->save($path.'small/small_'.$file);\n\n return true;\n }",
"public function saveAction()\n {\n $data = $this->getRequest()->getPost();\n if ($data) {\n try {\n if (isset($data['image']['delete'])) {\n $data['image'] = '';\n } else {\n unset($data['image']);\n\n if (isset($_FILES)) {\n if ($_FILES['image']['name']) {\n if ($this->getRequest()->getParam('id')) {\n $model = Mage::getModel('pugnet_uploader/images')->load($this->getRequest()->getParam('id'));\n if ($model->getData('image')) {\n $io = new Varien_Io_File();\n $io->rm(Mage::getBaseDir('media') . DS . implode(DS, explode('/', $model->getData('image'))));\n }\n }\n $path = Mage::getBaseDir('media') . DS . 'uploader' . DS . 'images' . DS;\n $uploader = new Varien_File_Uploader('image');\n $uploader->setAllowedExtensions(['jpg', 'png', 'gif']);\n $uploader->setAllowRenameFiles(false);\n $uploader->setFilesDispersion(false);\n $destFile = $path . $_FILES['image']['name'];\n $filename = $uploader->getNewFileName($destFile);\n $uploader->save($path, $filename);\n\n $data['image'] = 'uploader/images/' . $filename;\n }\n }\n }\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n $this->_redirectReferer();\n }\n\n try {\n $model = Mage::getModel('pugnet_uploader/images')\n ->addData($data)\n ->setId($this->getRequest()->getParam('id'))\n ->save();\n\n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Image was successfully saved'));\n Mage::getSingleton('adminhtml/session')->setItemsData(false);\n $this->_redirectReferer();\n\n } catch (Exception $e) {\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n Mage::getSingleton('adminhtml/session')->setItemsData($this->getRequest()->getPost());\n $this->_redirectReferer();\n }\n }\n Mage::getSingleton('adminhtml/session')->addSuccess($this->__('Image has not been saved'));\n $this->_redirectReferer();\n }",
"function we_save($resave = 0) {\n\n\t\t// get original width and height of the image\n\t\t$arr = $this->getOrigSize(true, true);\n\t\t$this->setElement(\"origwidth\",isset($arr[0]) ? $arr[0] : 0);\n\t\t$this->setElement(\"origheight\",isset($arr[1]) ? $arr[1] : 0);\n\t\t$docChanged = $this->DocChanged; // will be reseted in parent::we_save()\n\t\tif (parent::we_save($resave)) {\n\t\t\tif($docChanged){\n\t\t\t\t$thumbs = $this->getThumbs();\n\t\t\t\tinclude_once($_SERVER[\"DOCUMENT_ROOT\"].\"/webEdition/we/include/\".\"we_delete_fn.inc.php\");\n\t\t\t\tdeleteThumbsByImageID($this->ID);\n\t\t\t\tif(count($thumbs)){\n\t\t\t\t\tforeach($thumbs as $thumbID) {\n\t\t\t\t\t\t$thumbObj = new we_thumbnail();\n\t\t\t\t\t\t$thumbObj->initByThumbID($thumbID,$this->ID,$this->Filename,$this->Path,$this->Extension,$this->getElement(\"origwidth\"),$this->getElement(\"origheight\"),$this->getDocument());\n\t\t\t\t\t\t$thumbObj->createThumb();\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"protected static function saveFile($image_path, $scheme) {\n $filename = !empty($image_path['name']) ? $image_path['name'] : drupal_basename(\n $image_path['uri']\n );\n $file_temp = file_get_contents($image_path['uri']);\n $file_temp = file_save_data(\n $file_temp,\n $scheme . '://' . $filename,\n FILE_EXISTS_RENAME\n );\n // Set file status to temporary otherwise there is validation error.\n $file_temp->status = 0;\n file_save($file_temp);\n\n return $file_temp;\n }",
"public function save($path = 'barcode.png')\n {\n $dir = dirname($path);\n if (!file_exists($dir)) {\n mkdir($dir, 0644, true);\n }\n imagepng($this->_image, $path);\n }",
"public function save(Photo $photo);",
"function savefile($sFileName = null)\n\t{\n\t\tif ((isset($sFileName)) && ($sFileName != '')) {\n\t\t\t$this->setLocations($sFileName);\n\t\t}\n\n\t\t$this->saveImage();\n\t}",
"function readyToSave($image) {\n return addslashes(file_get_contents($image['tmp_name'])); \n }",
"function local_avatars_save_image($user_id, $tmp_image_path, $original_filename = false, $type = false){\n\tlocal_avatars_get_plugin()->file_handler->save_image($user_id, $tmp_image_path, $original_filename, $type);\n}",
"public function store()\n {\n if(!Csrf::checkToken($this->_request->getInput('_CSRF')))\n {\n $response = [\n 'status' => 'error',\n 'message' => 'csrf'\n ];\n return $this->_response->returnJson($response);\n }\n if($this->crop())\n {\n try {\n $this->_propertyImage->pid = $this->_pid;\n $this->_propertyImage->image_full_path = $this->_imageOut;\n $this->_propertyImage->save();\n }catch(Exception $e) {\n $response = [\n 'status' => 'error',\n 'message' => GENERIC_UPLOAD_ERROR_MESSAGE\n ];\n return $this->_response->returnJson($response);\n }\n $response = [\n 'status' => 'success',\n 'url' => $this->_imageOut\n ];\n return $this->_response->returnJson($response);\n }\n $response = [\n 'status' => 'error',\n 'message' => GENERIC_UPLOAD_ERROR_MESSAGE\n ];\n return $this->_response->returnJson($response);\n }",
"function saveImage($imgurl)\n\t{\n\t\t$name = basename($imgurl);\n\t\tlist($txt, $ext) = explode(\".\", $name);\n\t\t$name = $txt.time();\n\t\t$name = $name.\".\".$ext;\n\t//check if the files are only image / document\n\t\tif($ext == \"jpg\" or $ext == \"png\" or $ext == \"gif\" or $ext == \"doc\" or $ext == \"docx\" or $ext == \"pdf\"){\n\t\t$upload = file_put_contents($path . \"/wp-contents/uploads/\".$name,file_get_contents($imgurl));\n\t\t//check success\n\t\treturn $upload;\n\t\t}\n\t}",
"protected function loadImage()\n {\n if (!is_resource($this->tmpImage)) {\n $create = $this->createFunctionName;\n $this->tmpImage = $create($this->filePath);\n imagesavealpha($this->tmpImage, true);\n }\n }",
"public function saving(Model $model)\n {\n $file_name = $model->getAttribute($this->image_attribute_name);\n if (\n (!$file_name) ||\n (!Storage::has($this->getNormalPath(2, $file_name)))\n ) {\n if (\n (Storage::has(\"public/application/{$this->default_image_name}\")) &&\n (!Storage::has($this->getNormalPath(2, $this->default_image_name)))\n ) {\n try {\n /** @var Image $image */\n $image = ImageFacade::make(storage_path(\"app/public/application/{$this->default_image_name}\"));\n $this->loadMultipleImages([$image]);\n $this->saveImages();\n } catch (\\RuntimeException $exception) {\n logger($exception->getMessage());\n }\n }\n $model->setAttribute($this->image_attribute_name, $this->default_image_name);\n }\n }",
"public static function save_image($image)\n {\n $image_name = str_random(60);\n ini_set('allow_url_fopen', 1);\n $image = \\Image::make($image);\n $image->save(config('filesystems.disks.cars.root').'/'.$image_name.'.jpg');\n\n return $image_name.'.jpg';\n }",
"public function saveImage(Request $request){\n $x = explode('/', __DIR__);\n $path = [];\n for($i = 0; $i < count($x); $i++){\n if($x[$i] != 'app')\n array_push($path, $x[$i]);\n else\n break;\n }\n array_push($path, 'public', 'images', 'temp'. $request->ip(). '.jpg');\n $path = implode('/', $path);\n if(!file_exists($path)){\n fopen($path, 'w');\n }\n copy($request->image, $path);\n return response()->json(['code' => 200, 'message' => 'success', 'response' => $path])->header('Cache-control', 'no-cache');\n\n }",
"public function output()\n {\n $imageFile = $this->storage->getPath($this);\n\n if(file_exists($imageFile))\n {\n header('Content-Type: image');\n header('Content-Length: ' . filesize($imageFile));\n\n readfile($imageFile);\n exit;\n }\n }",
"function ImageFile()\n\t{\treturn $this->imagedir . (int)$this->id . \".jpg\";\n\t}",
"public static function save($file, $thumb = true) {\n\t\t// Yii::info($file);\n\n\t\tself::$source_path = $file->tempName;\n\n\t\t$file_name = self::generateFileName($file);\n\n\t\tif ($thumb) {\n\t\t\t// self::generateThumbnail(self::TMB_BIG);\n\t\t\t$tmb_medium = self::generateThumbnail(self::TMB_MEDIUM);\n\t\t\t$tmb_extra_small = self::generateThumbnail(self::TMB_EXTRA_SMALL);\n\t\t\t$tmb_small = self::generateThumbnail(self::TMB_SMALL);\n\t\t}\n\n\t\t$original = self::saveOriginImage($file);\n\n\t\t// Yii::info(\"original\");\n\t\t// Yii::info($original);\n\n\t\t$manager = \\Yii::$app->resourceManager;\n\t\t// Yii::info(\"manager\");\n\t\t// Yii::info($manager);\n\n\t\t// Yii::info(\"manager->bucket\");\n\t\t// Yii::info($manager->bucket);\n\t\t// Yii::info(\"file_name\");\n\t\t// Yii::info($file_name);\n\n\t\t$options = [\n\t\t\t'Bucket' => $manager->bucket,\n\t\t\t'Key' => 'images/' . $file_name,\n\t\t\t'SourceFile' => $original,\n\t\t\t'ACL' => CannedAcl::PUBLIC_READ,\n\t\t];\n\t\t// Yii::info(\"options\");\n\t\t// Yii::info($options);\n\t\t$manager->getClient()->putObject($options);\n\n\t\t// Yii::info(\"options origin\");\n\n\t\t$options['Key'] = 'images/thumbs/' . basename($tmb_small);\n\t\t$options['SourceFile'] = $tmb_small;\n\t\t$manager->getClient()->putObject($options);\n\n\t\t// Yii::info(\"options small\");\n\n\t\t$options['Key'] = 'images/thumbs/' . basename($tmb_extra_small);\n\t\t$options['SourceFile'] = $tmb_extra_small;\n\t\t$manager->getClient()->putObject($options);\n\t\t// Yii::info(\"options extra small\");\n\n\t\t$options['Key'] = 'images/thumbs/' . basename($tmb_medium);\n\t\t$options['SourceFile'] = $tmb_medium;\n\t\t$manager->getClient()->putObject($options);\n\t\t// Yii::info(\"options medium\");\n\n\t\t/* $options['Key'] = 'images/thumbs/'.basename($tmb_big);\n\t\t\t $options['SourceFile'] = $tmb_big;\n\t\t*/\n\n\t\t@unlink($original);\n\t\t@unlink($tmb_small);\n\t\t@unlink($tmb_extra_small);\n\t\t@unlink($tmb_medium);\n\t\t// @unlink($tmb_big);\n\n\t\t// Yii::info(\"before return\");\n\t\t// Yii::info(\"file_name\");\n\t\t// Yii::info($file_name);\n\t\treturn self::$file_name;\n\t}",
"public function entitySave($entity) {\n farm_asset_save($entity);\n }",
"public static function save($file)\n {\n //caminho para salvar a imagem\n $target = \"img/prods/\" . $file['name'];\n\n //tipos de arquivos permitidos\n $allowed = ['jpg', 'jpeg', 'png', 'gif'];\n\n //pegando a extensão da imagem passada\n $fileExtension = explode('.', $file['name']);\n $fileExtension = strtolower(end($fileExtension));\n\n //verficação para testar a integridade do arquivo passado\n if ($file['error'] == 0) {\n if ($file['size'] < 7000000) {\n if (in_array($fileExtension, $allowed)) {\n\n //se tudo estiver ok, adicione ele na pasta\n move_uploaded_file($file['tmp_name'], $target);\n }\n }\n }\n }",
"public function save($path);",
"function savePreviewImage($filename, $destinationFile){\n\t\t $this->resizeSaveImage($filename, $destinationFile, self::previewWidth);\n\t }",
"public function save($pathToOutputFile)\n {\n switch($this->type)\n {\n case 'image/jpg':\n case 'image/jpeg':\n return imagejpeg($this->getWorkingImageResource(), $pathToOutputFile, self::JPEG_QUALITY);\n\n case 'image/png':\n return imagepng($this->getWorkingImageResource(), $pathToOutputFile);\n }\n }",
"private function writeImage($filename, $content) {\n\t\ttry {\n\t\t\t\n\t\t\tif (empty($filename)) {\n\t\t\t\tthrow new Exception('No filename given for target file.');\n\t\t\t}\n\t\t\t\n\t\t\tif (empty($content)) {\n\t\t\t\tthrow new Exception('cant write to file: ' . $filename .\" , no content specified.\");\n\t\t\t}\n\t\t\n\t\t\t$fp = fopen($filename,\"w\");\n\t\t\t$b = fwrite($fp,$content);\n\t\t\tfclose($fp);\n\t\t\tif($b != -1){\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tthrow new Exception('Could not write to disk, check permissons');\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t} catch (Exception $ex) {\n\t\t\tthrow $ex;\n\t\t}\n\t}",
"public function save( $filename )\n {\n \n }",
"public function saveAs(string $path): void;",
"public static function saveOriginImage($file) {\n\t\t$save_dir = Yii::getAlias('@runtime' . DIRECTORY_SEPARATOR . self::$file_name);\n\t\t// Yii::info(\"Image save origin path :: \");\n\t\t// Yii::info($save_dir);\n\n\t\t$file->saveAs($save_dir, true);\n\t\treturn $save_dir;\n\t}",
"function image_save_from_url($my_img,$fullpath){\n if($fullpath!=\"\" && $fullpath){\n $fullpath = $fullpath.\"/\".basename($my_img);\n }\n $ch = curl_init($my_img);\n curl_setopt($ch, CURLOPT_HEADER, 0);\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);\n curl_setopt($ch, CURLOPT_BINARYTRANSFER,1);\n curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);\n curl_setopt($ch, CURLOPT_USERAGENT,'Mozilla/5.0 (Windows NT 10.0; WOW64; rv:45.0) Gecko/20100101 Firefox/45.0');\n $rawdata=curl_exec($ch);\n curl_close ($ch);\n if(file_exists($fullpath)){\n unlink($fullpath);\n }\n $fp = fopen($fullpath,'x');\n fwrite($fp, $rawdata);\n fclose($fp);\n }",
"public function saveGame($name, $data, $imageData) {\n $savedGames = fopen(\"../../../ressources/savedGames/\".$name.\".json\", \"wb\");\n $savedGamesImg = fopen(\"../../../ressources/savedGames/\".$name.\".txt\", \"wb\");\n\tfwrite($savedGames, $data);\n\tfwrite($savedGamesImg, $imageData);\n\tfclose($savedGames);\n\tfclose($savedGamesImg);\n }",
"function save_image($source, $destination, $image_type, $quality){\n switch(strtolower($image_type)){//determine mime type\n case 'image/png':\n imagepng($source, $destination); return true; //save png file\n break;\n case 'image/gif':\n imagegif($source, $destination); return true; //save gif file\n break;\n case 'image/jpeg': case 'image/pjpeg':\n imagejpeg($source, $destination, $quality); return true; //save jpeg file\n break;\n default: return false;\n }\n}",
"function savephoto ($path,$thumb=true) {\n $req = new IMDB_Request(\"\");\n $photo_url = $this->photo ($thumb);\n if (!$photo_url) return FALSE;\n $req->setURL($photo_url);\n $req->sendRequest();\n if (strpos($req->getResponseHeader(\"Content-Type\"),'image/jpeg') === 0\n || strpos($req->getResponseHeader(\"Content-Type\"),'image/gif') === 0\n || strpos($req->getResponseHeader(\"Content-Type\"), 'image/bmp') === 0 ){\n\t$fp = $req->getResponseBody();\n }else{\n\t$this->debug_scalar(\"<BR>*photoerror* \".$photo_url.\": Content Type is '\".$req->getResponseHeader(\"Content-Type\").\"'<BR>\");\n\treturn false;\n }\n $fp2 = fopen ($path, \"w\");\n if ((!$fp) || (!$fp2)){\n $this->debug_scalar(\"image error...<BR>\");\n return false;\n }\n fputs ($fp2, $fp);\n return TRUE;\n }",
"public function saveTo(string $path);",
"private function save($dst_src, $new_thumb_loc, $mime){\n if($mime=='image/png'){ $result = imagepng($dst_src,$new_thumb_loc,$this->compress*10); }\n else if($mime=='image/jpeg' or $mime=='image/jpg' or $mime=='image/pjpeg') {\n $result = imagejpeg($dst_src,$new_thumb_loc,$this->compress*100);\n }\n return $result;\n }",
"function saveThumb( $img, $options = array() )\r\n\t{\r\n\t $thumb_path = $img->getDirectory().DS.'thumbs';\r\n\t $img_width = 'thumb_width';\r\n\t $img_height = 'thumb_height';\r\n\t\r\n\t $img->load();\r\n\t\r\n\t // Default width or options width?\r\n\t if(!empty($options['width']) && is_numeric($options['width'])) \r\n\t {\r\n\t $width = $options['width'];\r\n\t }\r\n\t else \r\n\t {\r\n\t $width = $this->$img_width; \r\n\t }\r\n\t\r\n\t // Default height or options height?\r\n\t if(!empty($options['height']) && is_numeric($options['height']))\r\n\t {\r\n\t $height = $options['height'];\r\n\t }\r\n\t else \r\n\t {\r\n\t $height = $this->$img_height;\r\n\t }\r\n\t\r\n\t // Default thumb path or options thumb path?\r\n\t if(!empty($options['thumb_path'])) \r\n\t {\r\n\t $dest_dir = $options['thumb_path'];\r\n\t }\r\n\t else\r\n\t {\r\n \t $dest_dir = $thumb_path;\r\n\t }\r\n\t \t\r\n\t $helper = new DSCHelper();\r\n\t $helper->checkDirectory($dest_dir);\r\n\t\r\n\t if ($width >= $height) \r\n\t {\r\n\t $img->resizeToWidth( $width );\r\n\t }\r\n\t else \r\n\t {\r\n \t $img->resizeToHeight( $height );\r\n\t }\r\n\t \t\r\n\t $dest_path = $dest_dir.DS.$img->getPhysicalName();\r\n\t\r\n\t if (!$img->save( $dest_path ))\r\n\t {\r\n\t $this->setError( $img->getError() );\r\n\t return false;\r\n\t }\r\n\t\r\n\t return $dest_path;\r\n\t}",
"public function saveFile()\n {\n $newFileName = $this->generateFilename();\n $this->getOwner()->setAttribute($this->attributeName, $newFileName);\n return $this->uploadManager->save($this->getUploadedFileInstance(), $this->getUploadPath(), $newFileName);\n }",
"public function saveImage($previous_image = '')\n {\n $image = UploadedFile::getInstanceByName('image');\n if ($image) {\n $file = pathinfo($image->name);\n $filename = uniqid().'.'.$file['extension'];\n $path = Yii::getAlias('@webroot').'/images/cliche_tpl/';\n if($image->saveAs($path.$filename)){\n if ($previous_image !== '') {\n unlink($path . $previous_image);\n }\n return $filename;\n }\n }else{\n return '';\n }\n }"
]
| [
"0.713037",
"0.7037514",
"0.6965914",
"0.6961142",
"0.693614",
"0.6871576",
"0.68205243",
"0.6752929",
"0.6689447",
"0.66446507",
"0.66127294",
"0.6601301",
"0.6594013",
"0.6547424",
"0.6527667",
"0.6482874",
"0.6435742",
"0.64146334",
"0.63954735",
"0.63765377",
"0.6363633",
"0.630827",
"0.62562",
"0.6255802",
"0.62526995",
"0.6251813",
"0.6245629",
"0.6237548",
"0.623477",
"0.6227606",
"0.6155239",
"0.61502206",
"0.6137579",
"0.6137384",
"0.6120879",
"0.60836303",
"0.60631776",
"0.60543567",
"0.6044083",
"0.6034096",
"0.60158736",
"0.5967215",
"0.5960834",
"0.59519094",
"0.59273267",
"0.59154594",
"0.591056",
"0.58828485",
"0.58633167",
"0.5862105",
"0.5855391",
"0.5852568",
"0.58512574",
"0.5849309",
"0.5846819",
"0.5843673",
"0.5826747",
"0.58249193",
"0.58099264",
"0.57999456",
"0.57959557",
"0.5793735",
"0.5773564",
"0.5757107",
"0.574247",
"0.57420766",
"0.57253087",
"0.5725107",
"0.5722021",
"0.5718547",
"0.5711836",
"0.5666204",
"0.56657237",
"0.5655882",
"0.56486094",
"0.56474406",
"0.56342053",
"0.56335807",
"0.5625691",
"0.5622605",
"0.5615067",
"0.56112367",
"0.5607622",
"0.5606229",
"0.5601896",
"0.5600392",
"0.5594676",
"0.5594401",
"0.5559422",
"0.5548626",
"0.5548362",
"0.55394554",
"0.55369794",
"0.5535722",
"0.5534528",
"0.5533252",
"0.5521377",
"0.5517331",
"0.55154777",
"0.5514148",
"0.5510634"
]
| 0.0 | -1 |
Return the raw post content for the specified post id | public static function get_raw_post_content(int $post_id): string
{
$post = get_post($post_id);
return $post ? $post->post_content : '';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getPost($id) {\n\t\treturn $this->postDAL->getPost($id);\n\t}",
"public function getPostContent();",
"public function getPost($id)\n\t{\n\t\t// make sure we have the latest state of posts\n\t\tif (!isset($this->metadata['posts'])) {\n\t\t\t$this->regeneratePostsMetadata();\n\t\t}\n\t\t// get the file: metadata for the post contains type => use it for constructing the path\n\t\t$output = array();\n\t\tif (isset($this->metadata['posts'][$id])) {\n\t\t\t$postMeta = $this->metadata['posts'][$id];\n\t\t\t$postType = $postMeta['type'];\n\t\t\t$postJSON = file_get_contents($this->rootFolder . '/contents/' . $postType . '/' . $id . '.json');\n\t\t\tif ($postJSON != '') {\n\t\t\t\t$output = json_decode($postJSON, true);\n\t\t\t}\n\t\t}\n\n\t\treturn $output;\n\t}",
"public function content() { return $this->post->post_content; }",
"function get_the_content_by_id($post_id) {\n $page_data = get_page($post_id);\n if ($page_data) {\n return $page_data->post_content;\n }\n else return false;\n}",
"public static function get($id) {\n return get_post($id);\n }",
"public function getPostDataById($postId);",
"public function get_content() {\n\t\treturn $this->_post->post_content;\n\t}",
"public function render_content( $post_id ) {\n\n\t\t\t$post = Brizy_Editor_Post::get( $post_id );\n\n\t\t\tif ( $post && $post->uses_editor() ) {\n\n\t\t\t\t$content = apply_filters( 'brizy_content', $post->get_compiled_html(), Brizy_Editor_Project::get(), $post->get_wp_post() );\n\n\t\t\t\techo do_shortcode( $content );\n\t\t\t}\n\t\t}",
"public function getPostContent() : string {\n\t\treturn $this->postContent;\n\t}",
"public function viewPostById($post) {\n $db = $this->dbConnect();\n $req = $db->prepare('SELECT id, title, content, DATE_FORMAT(creation_date, \\'%d/%m/%Y à %Hh%imin%ss\\') AS creation_date_fr FROM posts WHERE id = ?');\n $req->execute(array($post->getId()));\n\n $postById = $req->fetch();\n\n return $postById;\n }",
"public function takePost($idPost){\r\n $db = $this->connectDB();\r\n $post = $db->prepare('SELECT id, title, text, DATE_FORMAT(date, \"le %d %b %Y à %H:%i\") AS datePost FROM oui.posts WHERE id = ?');\r\n $post->execute(array($idPost));\r\n \r\n return $post;\r\n }",
"function getPost($pid)\n {\n $post= $this->db->getPost($pid);\n if ($post)\n {\n //show a quick reference url, poster and posted datetime\n $post['posttitle'] = \"Posted by {$post['poster']} on {$post['postdate']}\";\n \n $post['downloadurl'] = $this->conf['this_script'] . \"?dl=$pid\";\n $post['deleteurl'] = $this->conf['this_script'] . \"?erase=$pid\";\n $post['pid'] = $pid;\n }\n else\n {\n $post['code'] = '<b>Unknown post id, it may have been deleted</b><br />';\n $this->errors[] = 'Unknown post id, it may have expired or been deleted';\n } \n \n return $post;\n }",
"static function get_post_by_id($post){\n\t\treturn self::$db->where('token_id',$post)->get('blog')->results();\n\t}",
"public function getById($id): Post\n {\n return $this->post->where('id', $id)->get();\n }",
"public function getPost($id){\n $answer = array();\n $id = self::cleanSQL(self::$conn, $id);\n $sql = \"SELECT * FROM \" . self::getTable() . \" WHERE POSTID = '\" . $id . \"'\";\n $result = self::query($sql);\n if(!$result){\n return false;\n }else{\n while($row = $result->fetch_row()){\n $buffer = array(\n 'POSTID' => $row[0],\n 'UID' => $row[1],\n 'CID' => $row[2],\n 'title' => $row[3],\n 'author' => $row[4],\n 'likes' => $row[5],\n 'image' => $row[6],\n 'category' => $row[7],\n 'created_at' => $row[8],\n 'updated_at' => $row[9]\n ); \n array_push($answer, $buffer); \n }\n return $answer;\n }\n }",
"public function getById($id)\n {\n return Post::find($id);\n }",
"public function Content() {\n /**\n * No ACF by default. Uncomment this and delete the regular get post line.\n * $data = \\DustPress\\Query::get_acf_post( get_the_ID() );\n */\n $data = \\DustPress\\Query::get_post( get_the_ID() );\n\n return $data;\n }",
"public function Content() {\n /**\n * No ACF by default. Uncomment this and delete the regular get post line.\n * $data = \\DustPress\\Query::get_acf_post( get_the_ID() );\n */\n $data = \\DustPress\\Query::get_post( get_the_ID() );\n\n return $data;\n }",
"public static function _getPostFromId( $_post_id ) {\n global $post_id;\n $post_id = $_post_id;\n $post = get_post( $post_id );\n setup_postdata( $post );\n return new WPOO_Post( $post );\n }",
"public function get_data_post($id)\n {\n $this->db->where('socialUsuarioId', $id);\n $datos = $this->db->get('social_media');\n return $datos->row();\n }",
"public function show($id)\n {\n\n $post = $this->post->with('tags')->find($id);\n //dd($post);// = unserialize($post->photo);\n return $post;\n //return $this->post->with('tags')->find($id);\n }",
"public static function getPostById($id) {\n\t\t$em = dbconnection::getInstance()->getEntityManager() ;\n\n\t\t$postRepository = $em->getRepository('post');\n\t\t$post = $postRepository->findOneById(array('id' => $id));\n\n\t\treturn $post; \n\t}",
"public function getPostDirect($postId)\n {\n $sql = \"select * from wp_posts where ID = '\" . $postId . \"' and\n post_status = 'publish'\";\n $data = $wpdb->get_results($sql);\n\n return $data[0];\n }",
"public function findPostById($id)\n {\n return $this->postDao->findPostById($id);\n }",
"public function getById($id)\n {\n $post = Post::find($id);\n\n return $post;\n }",
"public function postInfo($postId)\n {\n return Post::find($postId);\n }",
"function getPost($post_id) {\n $result = pg_query_params($GLOBALS['web_db_conn'], \"SELECT title, content FROM posts WHERE post_id = $1\", array($post_id));\n\n $row = pg_fetch_row($result);\n\n $title = $row[0];\n $content = $row[1];\n\n return array($title, $content);\n}",
"function getPostObject($post_id) {\n\t\t$post_url = get_permalink($post_id);\n\t\t$title = strip_tags(get_the_title($post_id));\n\t\t$tagObjects = get_the_tags($post_id);\n\t\t$single = is_single();\n\t\t$tags = \"\";\n\t\tif (!empty($tagObjects)) {\n\t\t\t$tags .= $tagObjects[0]->name;\n\t\t\tfor ($i = 1; $i < count($tagObjects); $i++) {\n\t\t\t\t$tags .= \",\".$tagObjects[$i]->name;\n\t\t\t}\n\t\t}\n\t\t$category = get_the_category($post_id);\n\t\t$categories = \"\";\n\t\tif (!empty($category)) {\n\t\t\t$categories .= $category[0]->name;\n\t\t\tfor ($i=1; $i<count($category); $i++) {\n\t\t\t\t$categories .= \",\".$category[$i]->name;\n\t\t\t}\n\t\t}\n\t\t$author = get_the_author();\n\t\t$date = get_the_date('U', $post_id) * 1000;\n\t\t$comments = get_comments_number($post_id);\n\n\t\t$tmdb = get_post_meta($post_id,'imdb_id');\n\n\t\t$post_object = array(\n\t\t\t'id' => $post_id,\n\t\t\t'url' => $post_url,\n\t\t\t'title' => $title,\n\t\t\t'tags' => $tags,\n\t\t\t'categories' => $categories,\n\t\t\t'comments' => $comments,\n\t\t\t'date' => $date,\n\t\t\t'author' => $author,\n\t\t\t'single' => $single,\n\t\t\t'img' => get_the_post_thumbnail_url($post_id),\n\t\t\t'tmdb' => $tmdb\n\t\t);\n\t\treturn $post_object;\n\t}",
"function get_post($id) {\n $ci = & get_instance();\n $ci->db->from('post');\n $ci->db->where('post_id', $id);\n $post = $ci->db->get()->result();\n\n if (!(is_array($post) && count($post) == 1)) {\n return NULL;\n }\n\n $ci->db->from('comment');\n $ci->db->where('post_id', $post[0]->post_id);\n\n $comments = build_comments($ci->db->get()->result());\n\n $ci->db->from('text_post');\n $ci->db->where('post_id', $post[0]->post_id);\n $text_posts = $ci->db->get()->result();\n\n if (is_array($text_posts) && count($text_posts) == 1) {\n $text_post = build_text_post($post[0], $text_posts[0]->post_text);\n $text_post->comments = $comments;\n return $text_post;\n } else {\n $ci->db->from('link_post');\n $ci->db->where('post_id', $post[0]->post_id);\n $link_posts = $ci->db->get()->result();\n\n if (is_array($link_posts) && count($link_posts) == 1) {\n $link_post = build_link_post($post[0], $link_posts[0]->post_link);\n $link_post->comments = $comments;\n return $link_post;\n } else {\n return NULL;\n }\n }\n }",
"public function show($id)\n {\n //find post by id\n $post = Post::find($id);\n //if post id is found return the post content\n if($post){\n return $this->apiResponse(new PostResource($post));\n }else{\n return $this->notFoundResponse();\n }\n \n }",
"public function show($id)\n {\n // \\Log::info($id);\n $post = Post::find($id);\n return $post;\n }",
"public function getPostDetailsById($id){\n\t\t$criteria = new CDbCriteria;\n\t\t$criteria->select = '*';\n\t\t$criteria->condition = \" id = :id \";\t\n\t\t$criteria->params = array(':id'=>(int)$id);\t\t\n\t\treturn $post = NePosts::model()->find($criteria);\n\t}",
"public function getPostDetailsById($id){\n\t\t$criteria = new CDbCriteria;\n\t\t$criteria->select = '*';\n\t\t$criteria->condition = \" id = :id \";\t\n\t\t$criteria->params = array(':id'=>(int)$id);\t\t\n\t\treturn $post = NePosts::model()->find($criteria);\n\t}",
"private function processPostContent(WP_Post $post): string\n {\n $uamPostContent = htmlspecialchars_decode($this->mainConfig->getPostTypeContent($post->post_type));\n\n if ($this->mainConfig->showPostTypeContentBeforeMore($post->post_type) === true\n && preg_match('/<!--more(.*?)?-->/', $post->post_content, $matches)\n ) {\n $uamPostContent = explode($matches[0], $post->post_content)[0] . ' ' . $uamPostContent;\n }\n\n return stripslashes($uamPostContent);\n }",
"public function findOnePostById($id)\n {\n $query = \"\"\n . \"SELECT post.*, user.name as author \"\n . \"FROM post \"\n . \"LEFT JOIN user ON post.id_user = user.id \"\n . \"WHERE post.id = '%s'\";\n $query = sprintf($query, $this->db->real_escape_string($id));\n if ($result = $this->db->query($query)) {\n $row = $result->fetch_assoc();\n $post = [\n 'id' => $row['id'],\n 'title' => $row['title'],\n 'content' => $row['content'],\n 'author' => $row['author'],\n 'date_created' => $row['date_created'],\n 'comment' => $this->findAllCommentsByPostId($row['id']),\n 'tags' => '' //$row['firstname']\n ];\n $result->close();\n } else {\n die($this->db->error);\n }\n return $post;\n }",
"public function getDescription( $post_id ) {\n\t\t$attachment = get_post( $post_id );\n\n\t\treturn $attachment->post_content;\n\t}",
"public function postsBody($id)\n {\n $posts = Posts::findOrfail($id);\n return response()->json(['Posts' => $posts]);\n }",
"public\nfunction getPostContent(): string {\n\treturn ($this->postContent);\n}",
"public function getPostByPostId($id=null)\n\t{\n\t\tif(is_null($id)){\n\t\t\t$this->logger->logError('No ID provided.','Input Error');\n\t\t\treturn false;\n\t\t}\n\t\t$q = \"SELECT * FROM in_posts WHERE id=:id\";\n\t\t$vars = array(\n\t\t\t\":id\"=>(int)$id\n\t\t);\n\t\t$ps = $this->execute($q,$vars);\n\t\t$result = $this->getDataRowAsObject($ps,'Post');\n\t\treturn $result;\n\t}",
"public function show($id)\n {\n return Post::find($id);\n }",
"public static function read_content($id)\n {\n $meta = self::meta($id);\n self::file_exists($meta, true);\n return file_get_contents($meta['file']);\n }",
"public static function getPostById ($post_id)\n {\n return TblPost::findOne($post_id);\n }",
"function get_post_data() {\n\t\tif (empty($this->post)) :\n\t\t\t$this->post = get_post( $this->id );\n\t\tendif;\n\t\t\n\t\treturn $this->post;\n\t}",
"public function show($id)\n\t{\n\t\treturn Post::find($id);\n\t}",
"public function postById($id)\n {\n $sql = '\n SELECT p.id, p.title, p.chapo, p.content, p.date_creation, p.date_modification, p.category_id, u.pseudo, ca.name As category, COUNT(co.id) AS numberComments\n FROM posts AS p\n LEFT JOIN users AS u ON u.id = p.user_id\n LEFT JOIN categories AS ca ON ca.id = p.category_id\n LEFT JOIN comments AS co ON co.post_id = p.id\n WHERE p.id=:id';\n return $this->db->request($sql, ['id' => $id], 'posts', false);\n }",
"public static function getContentById($id) {\n return WebContents::where('web_contents_id', $id)->pluck('content')->first();\n }",
"function getPost($id){\n $posts = $this->postManager->getPosts()->fetchAll();\n $post = $this->postManager->getPost($id);\n $comments = $this->commentManager->getComments($id)->fetchAll();\n $commentsNumber = count($comments);\n $total = count($this->postManager->getPosts()->fetchAll());\n $key = array_search($post['id'], array_column($posts, 'id'));\n require 'views/front/single.php';\n }",
"public function view($id)\n {\n return Post::find($id);\n }",
"public static function findById($idPost) {\n\t\t$db = self::getDB();\n\t\t$sql = \"SELECT *\n\t\t\t\tFROM posts \n\t\t\t\tWHERE\n\t\t\t\t\tidPost = :idPost \";\n\t\t$query = $db->prepare($sql);\n\t\t$query->execute([\n\t\t\t':idPost' => $idPost\n\t\t]);\n\t\t$dados = $query->fetch();\n\t\t$post = new Post();\n\t\t$post->setIdPost($idPost);\n\t\t$post->setNome( $dados['nome'] );\n\t\t$post->setConteudo( $dados['conteudo'] );\n\t\t$post->setFkIdUsuario( $dados['fk_idUsuario'] );\n\t\t$post->setFkIdTopico( $dados['fk_idTopico'] );\n\t\t$post->setDataDeCriacao( $dados['dataDeCriacao'] );\n\t\treturn $post;\n\t}",
"public static function getPostToEdit($id)\n {\n \t//if (!self::isAdmin()) return redirect('/');\n \t \n \t$post = new Post;\n \tif ($id != null || $id != \"\") {\n \t\t$hashids = new \\Hashids\\Hashids(\"\", Config::get(\"weixin.minhashlength\"));\n \t\t// hashStr to id number\n \t\tif (!is_numeric($id)) {\n \t\t\t$ids = $hashids->decode($id);\n \t\t\tif (isset($ids[0])) {\n \t\t\t\t$id = $ids[0];\n \t\t\t}\n \t\t}\n \t\t$post = Post::findOrFail($id);\n \t\t$post = $post->attributesToArray();\n \t}\n \t\t \n \treturn response()->view('edit', ['data' => $post, 'url' => $post['url'], 'isadmin' => self::isAdmin() ]);\n }",
"public function show(Post $post)\n {\n return $post->toJson();\n }",
"public function show($id)\n {\n return $this->post->find($id, array('id','title'));\n }",
"public function readPost ($id) \n {\n //we can accidently be redirected here again\n if (session(\"deleted-$id\")) {\n return $this->safeRedirect();\n }\n \n $post = Post::find($id);\n \n //if post not found\n if ($post == NULL) {\n abort(404);\n }\n \n $user = $post->user;\n //check if it's your post\n $owner = Auth::check() ? Auth::id() == $user->id : false;\n \n //if it's private\n if ($post->private && !$owner) {\n abort(403);\n }\n \n return view('read',[\n 'me' => Auth::user(),\n 'themes' => Theme::all(),\n 'post' => $post,\n 'owner' => $owner, //if you own content on this page\n 'user' => $user //user who own content on this page\n ]);\n }",
"function ui_the_content($id){\n\tglobal $wpdb;\n\t$mylink = $wpdb->get_results(\"SELECT * FROM $wpdb->posts WHERE ID = $id \");\n\tforeach($mylink as $row){ \n\t\t$s = $row->post_content_tmt;\n\t $s = apply_filters( 'the_content', $s );\n\t echo $s;\n\t}\n}",
"public function postOfId(PostId $id);",
"function readPostContent($postData){\n $renderedPath = LOGMD_RENDERED . $postData['FILE'] . '.html';\n if (file_exists($renderedPath)){\n $postData['POST'] = file_get_contents($renderedPath);\n } else {\n //// post not rendered, yet. render now...\n // load parsedown\n require_once 'lib/Parsedown.php';\n \n // process links and paths in post md content\n $postData['POST'] = fixMarkdownLinks($postData['POST']);\n $postData['POST'] = fixMarkdownImagePaths($postData['POST']);\n \n // parse with Parsedown\n $Parsedown = new Parsedown();\n $Parsedown->setUrlsLinked(false);\n \n if (LOGMD_SAFE_MODE){\n $Parsedown->setSafeMode(true);\n $Parsedown->setMarkupEscaped(true);\n }\n $postData['POST'] = $Parsedown->text($postData['POST']);\n\n //...and save rendered HTML for next time\n file_put_contents($renderedPath, $postData['POST']);\n }\n return $postData['POST'];\n }",
"public function getRawContent();",
"public static function getPost($id, $type = '')\n {\n \t//echo \"#### \".$id.\"<br>\";die();\n \t$post = new Post;\n \tif ($id != null || $id != \"\") {\n \t\t$hashids = new \\Hashids\\Hashids(\"\", Config::get(\"weixin.minhashlength\"));\n \t\t// hashStr to id number\n \t\tif (!is_numeric($id)) {\n \t\t\t$ids = $hashids->decode($id);\n \t\t\tif (isset($ids[0])) {\n \t\t\t\t$id = $ids[0];\n \t\t\t}\n \t\t}\n \t\t$post = Post::findOrFail($id);\n \t\t$post = $post->attributesToArray();\n \t\t// add QRcode at the end of content\n \t\t$post['content'] = $post['content'].WeixinController::addQrcode($post['sourcedomain']);\n \t\t// id number to hashStr\n \t\t$post['id'] = $hashids->encode($post['id']);\n \t\t// gen html meta\n \t\t$meta = self::getHtmlMeta('post', $post);\n \t} else {\n \t\t$post = $post->attributesToArray();\n \t\t$meta = \"\";\n \t}\n \t\n \tif ($type == \"preview\") {\n \t\t$preview = true;\n \t} else {\n \t\t$preview = false;\n \t}\n \t\n \treturn response()->view('post', ['data' => $post, 'url' => $post['url'], 'isadmin' => self::isAdmin(), 'ispreview' => $preview, 'meta' => $meta ]);\n }",
"public function show($id)\n {\n return Posts::find($id);\n }",
"public function display_single_data($id) {\n\t\t$query = $this->db->get_where('post', array('id'=>$id));\n\t\tif($query->num_rows() > 0) {\n\t\t\treturn $query->row();\n\t\t}\n\t}",
"function preview($id){\r\n $content = array();\r\n\r\n // get content from database\r\n $result = $this->reg->db->GetRow('SELECT title, content, last_edited, show_title, show_date, advanced, head\r\n FROM system__content\r\n WHERE id = ?', array($id[0], $_SESSION['SYSTEM']['USER_ID']));\r\n // format for screen\r\n if(count($result)){\r\n $content['title'] = $this->reg->validation->escape_rich_text($result['title']);\r\n $content['content'] = $this->reg->validation->escape_rich_text($result['content']);\r\n $content['date'] = date('M j, Y', $this->reg->validation->escape_html(strtotime($result['last_edited'])));\r\n $content['advanced'] = (bool)$result['advanced'];\r\n $content['show_title'] = (bool)$result['show_title'];\r\n $content['show_date'] = (bool)$result['show_date'];\r\n\r\n // include head if post is set as advanced\r\n if($result['advanced']){\r\n $this->reg->config->set('head.', $result['head']);\r\n }\r\n }\r\n\r\n // return final html\r\n return $content;\r\n }",
"public function show(string $id)\n {\n $result = $this->postService->get($id);\n\n return $result;\n }",
"public static function getPostItemById($id)\n {\n $id = intval($id);\n\n if ($id) {\n $db = Db::getConnection();\n $result = $db->query('SELECT * FROM publication WHERE id_publ =' . $id);\n $result->setFetchMode(\\PDO::FETCH_ASSOC);\n $postItem = $result->fetch();\n\n return $postItem;\n }\n }",
"public function getContent($id);",
"public function find($id)\n {\n $posts = DB::table('posts')\n ->select()\n ->where('id', $id)\n ->get();\n return $posts;\n }",
"public function get_post($id) {\n\n\t\t$post = $this->get_posts(array('ID' => $id, 'limit'=>1 ), true);\n\n\t\tif (isset($post[0]) && !empty($post[0]) ) {\n\t\t\treturn $post[0]; // return first post\n\t\t}\n\t\telse {\n\t\t\treturn null;\n\t\t}\t\n\t}",
"public function get_post( $user_id, $post_id ) {\n \n $this->db->select('*');\n $this->db->from($this->table);\n $this->db->where(['user_id' => $user_id, 'post_id' => $post_id]);\n $query = $this->db->get();\n \n if ( $query->num_rows() > 0 ) {\n \n $result = $query->result();\n $sent = \"\";\n \n // Update view with 0\n $this->db->where('post_id', $post_id);\n $this->db->update($this->table, ['view' => 0]);\n \n // Get history of published post on social networks\n if ( $this->sentnetworkmess($post_id) ) {\n \n $sent = $this->sentnetworkmess($post_id);\n \n }\n \n return array(\n 'post_id' => $result[0]->post_id,\n 'user_id' => $result[0]->user_id,\n 'body' => $result[0]->body,\n 'title' => $result[0]->title,\n 'category' => $result[0]->category,\n 'url' => $result[0]->url,\n 'img' => $result[0]->img,\n 'video' => $result[0]->video,\n 'status' => $result[0]->status,\n 'sent' => $sent,\n 'time' => $result[0]->sent_time,\n 'current' => time(),\n 'parent' => $result[0]->parent\n );\n \n } else {\n \n return false;\n \n }\n \n }",
"protected function getItemFromPost($post)\n {\n if ($post['original_post_id'] == null) {\n $embPost = false;\n } else {\n $embPost = true;\n }\n\n if ($this -> getInput('noreblog') && $embPost) {\n return [];\n }\n\n $item = [];\n\n $item['uid'] = $post['id'];\n $item['timestamp'] = strtotime($post['created_at']);\n\n if ($embPost) {\n $item['uri'] = self::URI . '/posts/' . $post['original_post']['id'];\n $item['author'] = $post['original_username'];\n if ($post['original_post']['title'] != '') {\n $item['title'] = $post['original_post']['title'];\n } else {\n $item['title'] = '[NO TITLE]';\n }\n } else {\n $item['uri'] = self::URI . '/posts/' . $post['id'];\n $item['author'] = $post['username'];\n if ($post['title'] != '') {\n $item['title'] = $post['title'];\n } else {\n $item['title'] = '[NO TITLE]';\n }\n }\n\n /**\n * 4 cases if it is a reblog.\n * 1: reblog has tags, original has tags. defer to option.\n * 2: reblog has tags, original has no tags. use reblog tags.\n * 3: reblog has no tags, original has tags. use original tags.\n * 4: reblog has no tags, original has no tags. use reblog tags not that it matters.\n */\n $item['categories'] = $post['tags'];\n if ($embPost) {\n if ($this -> getInput('noretags') || ($post['tags'] == null)) {\n $item['categories'] = $post['original_post']['tag_list'];\n }\n }\n\n $avatarText = $this -> genAvatarText(\n $item['author'],\n $post['avatar_url'],\n $item['title']\n );\n $imagesText = $this -> genImagesText($post['media']);\n\n $item['content'] = <<<EOD\n<div style=\"display: inline-block; vertical-align: top;\">\n\t{$avatarText}\n</div>\n<div style=\"display: inline-block; vertical-align: top;\">\n\t{$post['content']}\n</div>\n<div style=\"display: block; vertical-align: top;\">\n\t{$imagesText}\n</div>\nEOD;\n\n return $item;\n }",
"function getPost($id) {\n $this->db->select(\"*\");\n $this->db->where(\"postID\", $id);\n $this->db->join('post_category', 'post_category.categoryID = post.categoryID');\n $query = $this->db->get('post');\n if ($query->num_rows() > 0) {\n return $query->result_array();\n }\n return array();\n }",
"public function getContent()\n {\n $content = $this->get()->post_content;\n $content = apply_filters('the_content', $content);\n $content = str_replace(']]>', ']]>', $content);\n\n return $this->content = $content;\n }",
"public function getPost($postId)\n {\n $dbName = $this->dbConnect();\n $req = $dbName->prepare('SELECT blogpost.id, title,chapo, content,status, user_id,user.login,DATE_FORMAT(dateLastModification, \\'%d/%m/%Y à %Hh%imin%ss\\') \n AS dateLastModification FROM blogpost INNER JOIN user ON blogpost.user_id = user.id WHERE blogpost.id = ? AND blogpost.status = 1');\n $req->execute(array($postId));\n\n while ($row = $req->fetch(PDO::FETCH_ASSOC)) {\n\n $post = new BlogPost();\n $login = new User();\n $login->setLogin($row['login']);\n $post->setId($row['id']);\n $post->setTitle($row['title']);\n $post->setContent($row['content']);\n $post->setDate($row['dateLastModification']);\n $post->setStatus($row['status']);\n $post->setUserId($row['login']);\n $post->setChapo($row['chapo']);\n $posts[] = $post;\n }\n return $posts;\n }",
"public function getPost($id) {\n $title = 'Blog | Post';\n //dd($id);\n $post = DB::table('post as p')\n ->join('users as u', 'p.users_id', '=', 'u.users_id')\n ->where('p.post_id', $id)\n ->first();\n\n $comments = DB::table('comments as c')\n ->join('users as u','u.users_id','=','c.users_id')\n ->where('c.post_id','=', $id)\n ->orderBy('c.updated_at','desc')\n ->get();\n\n return view('frontend.post', compact('post','comments'));\n }",
"public static function getPost(int $id): ?Post\n {\n // NEKAD, NEKAD nelikt $id vai citu $ iekš $query funkcijas, jo tad var uztaisīt SQL injekcijas, kad kāds DROP TABLE sev mūsu datu bāzi. Jātaisa SQL prepaired statements. \n // labāk jarakstīt šitā\n\n // $query = DB::$connection->prepare(\"SELECT * FROM posts WHERE id = ?\");\n // $query->execute([$id]);\n\n $query = DB::$connection->prepare(\"SELECT * FROM posts WHERE id = :id\");\n $query->execute(['id' =>$id]);\n\n \n $post = $query->fetchObject('Post');\n // $posts = self::getPosts(); //Šitā dabū visus Posts\n // foreach ($posts as $post) {\n // if ($post->id == $id) {\n // return $post;\n // }\n // }\n\n\n if(!$post) {\n return null;\n }\n\n // $postObj = new Post();\n // $postObj->id = $post['id'];\n // $postObj->title = $post['title'];\n // $postObj->text = $post['text'];\n\n return $post;\n }",
"public function show($id)\n {\n $cleaned_body = Purifier::clean(Post::find($id)->body);\n $post = Post::find($id);\n return view('posts.show')->with('post', $post)->with('clean_body', $cleaned_body);\n }",
"public function show($id)\n {\n return Post::withTrashed()->where('id', $id)->first();\n }",
"public function getPostById(int $id): object\n {\n return Post::where('id', $id) ->first();\n }",
"public function show($id)\n {\n return $this->postService->show($id);\n }",
"public static function getById($id)\n {\n $db = Mysql::getInstance();\n $data = $db->select('posttag', '`id` = :id', array('id' => $id));\n return static::init($data->fetch_one());\n }",
"public function show($id)\n {\n $post = Notes::find($id);\n if (!$post) {\n return response()->json([\n \"status\" => false,\n \"message\" => \"Post not found\"\n ])->setStatusCode(404);\n }\n\n return $post;\n }",
"public function findOne($postId)\r\n {\r\n $req = $this->connexion->connect()->prepare('SELECT id, title, content, DATE_FORMAT(dateposts, \\' % d /%m /%Y à % Hh % imin % ss\\') AS date_creation_fr FROM posts WHERE id = ?');\r\n $req->execute(array($postId));\r\n $data = $req->fetch();\r\n $post = new Article($data);\r\n\r\n return $post;\r\n }",
"public function findPostById($id)\n {\n $this->db->query('SELECT * FROM posts WHERE id = :id');\n $this->db->bind(':id', $id);\n $row = $this->db->single();\n return $row;\n }",
"public static function getPublishedPostById(int $id)\n {\n return Post::where('id', $id)\n ->whereDate('published_at', '<=', now())\n ->first();\n }",
"private static function _prepare_content($post) {\n // Add paragraph tags.\n $post_content = wpautop($post->post_content);\n\n // Best effort. Regex parsing of HTML is a bad idea, generally, but including\n // a full parser just for this case is over the top. This will match things\n // inside, for example, <pre> and <xmp> tags. ¯\\_(ツ)_/¯\n preg_match_all('/<(?:a|img)[^>]+(?:href|src)=\"(?:\\/[^\"]*)\"/', $post_content, $matches);\n if (!$matches[0]) return $post_content;\n\n // Replace relative URLs in links and image sources.\n $site_url = site_url();\n $replacements = array();\n foreach ($matches[0] as $match) {\n $replacement = preg_replace('/href=\"(\\/[^\"]*)\"/', 'href=\"' . $site_url . '$1\"', $match);\n $replacement = preg_replace('/src=\"(\\/[^\"]*)\"/', 'src=\"' . $site_url . '$1\"', $replacement);\n $replacements[] = $replacement;\n }\n return str_replace($matches[0], $replacements, $post_content);\n }",
"function get_post_from_id($id){\n\t\t$hsl = $this->db->query(\"SELECT * FROM `jsts_post` WHERE `keywords` LIKE '%\".$id.\"%'\");\n\t\treturn $hsl;\n\t}",
"public function show($id)\n {\n $post = Post::included()->findOrFail($id);\n return PostResource::make($post);\n }",
"public static function getRaw($idBeesBlogPost, $idLang = null)\n {\n if ($idLang == null) {\n $idLang = (int) \\Context::getContext()->language->id;\n }\n\n $idShop = (int) \\Context::getContext()->shop->id;\n $sql = new \\DbQuery();\n $sql->select('*');\n $sql->from(self::TABLE, 'sbp');\n $sql->innerJoin(self::LANG_TABLE, 'sbpl', 'sbp.`'.self::PRIMARY.'` = sbpl.`'.self::PRIMARY.'`');\n $sql->innerJoin(self::SHOP_TABLE, 'sbps', 'sbp.`'.self::PRIMARY.'` = sbps.`'.self::PRIMARY.'`');\n $sql->where('sbpl.`id_lang` = '.(int) $idLang);\n $sql->where('sbpl.`lang_active` = 1');\n $sql->where('sbps.`id_shop` = '.(int) $idShop);\n $sql->where('sbp.`'.self::PRIMARY.'` = '.(int) $idBeesBlogPost);\n $sql->where('sbp.`active` = 1');\n if (\\Context::getContext()->customer->email !== '[email protected]') {\n $sql->where('sbp.`date_add` < \\''.date('Y-m-d H:i:s').'\\'');\n }\n\n return \\Db::getInstance(_PS_USE_SQL_SLAVE_)->getRow($sql);\n }",
"private function renderPostTemplate() {\r\n\t\t$posts = $this->getPosts();\r\n\t\t$renderedposts = array();\r\n\t\tforeach($posts as $post) { \r\n\t\t\t$post_template = file_get_contents('post.html');\r\n\t\t\t$title = $post['title'];\r\n\t\t\t$author = $post['author'];\r\n\t\t\t$postdate = $post['postdate'];\r\n\t\t\t$text = $post['text'];\r\n\t\t\t$text = nl2br($text);\r\n\t\t\t\r\n\t\t\t$post_template = str_replace(\"{{title}}\", $title, $post_template);\r\n\t\t\t$post_template = str_replace(\"{{author}}\", $author, $post_template);\r\n\t\t\t$post_template = str_replace(\"{{date}}\", $postdate, $post_template);\r\n\t\t\t$post_template = str_replace(\"{{text}}\", $text, $post_template);\r\n\t\t\t\r\n\t\t\tarray_push($renderedposts, $post_template);\r\n\t\t}\r\n\t\treturn $renderedposts;\r\n\t}",
"public function show($id)\n {\n return Post::findOrFail($id)->load('tags');\n }",
"public function show($id)\n {\n $featuredImageUrl = url('storage/post_img/') . \"/\";\n $featuredImageThumbUrl = url('storage/post_img/thumb') . \"/\";\n\n $post = Post::with('category')\n ->select('*', DB::raw('CONCAT(\"' . $featuredImageUrl . '\",featured_image) AS featured_image_url'), DB::raw('CONCAT(\"' . $featuredImageThumbUrl . '\",featured_image) AS featured_image_thumb_url'))\n ->findOrFail($id);\n return response()->json($post, 200);\n }",
"public function post($post_id)\n\t{\n\t\t$check = DB::select(\"SELECT COUNT(*) as count FROM blog WHERE id = '\".explode('-',$post_id)[0].\"'\")[0];\n\t\tif ($check->count == 0){\n\t\t\tabort(404);\n\t\t}\n\t\t$post = DB::select(\"SELECT * FROM blog WHERE id = '\".explode('-',$post_id)[0].\"'\")[0];\n\t\tDB::update(\"UPDATE blog SET visits = visits+1 WHERE id = '\".$post->id.\"'\");\n\t\t$title = $post->title;\n\t\t$desc = mb_substr($post->content,0,75);\n\t\t$header = $this->header(translate($post->title),$desc,false,true,url('/assets/blog/'.$post->images));\n\t\t// Get blocs of the page builder\n\t\t$blocs = DB::select(\"SELECT * FROM blocs WHERE area = 'post' ORDER BY o ASC\");\n\t\t$footer = $this->footer();\n\t\treturn view('post')->with(compact('header','post','blocs','footer'));\n\t}",
"public function getPostById($id){\n $ourResponse=Http::get('https://jsonplaceholder.typicode.com/posts/'.$id);\n return view('singlepost',['data'=>$ourResponse->collect()]);\n }",
"function get_content() {\n\t\treturn $this->get_data( 'comment_content' );\n\t}",
"public function show_post($id)\n\t{\n\t\trequire_once(MODELS . '/Post.php');\n\t\t$model = new Post();\n\t\t$post = $model->get_post($id);\n\t\treturn_view('view.post.php' , $post);\n\t}",
"function getPublicPostingInfo($id = 0) {\n return getOne(\"SELECT * FROM posting WHERE id = ?\", [$id]);\n}",
"public function show($id)\n {\n $post = PostProvider::find($id);\n $this->checkPost($post);\n\n $comments = $post->getComments();\n\n return Viewer::make('posts.show', array('post' => $post, 'comments' => $comments));\n }",
"public function getData()\n {\n return Post::find(request()->id);\n }",
"function getPostById($id) {\n $link = openDatabaseConnection();\n $id = mysqli_real_escape_string($link, $id);\n $query = mysqli_query($link,\"SELECT title, description FROM post WHERE id = {$id}\");\n $row = mysqli_fetch_assoc($query);\n closeDatabasesConnection($link);\n return $row;\n}",
"public function show($id)\n {\n return Post::where('category_id', '=' , $id)->get();\n }",
"public function get_page_template($post_id){\n\t\t$value = 'page_template';\n\n\t\t$query = $this->db->prepare(\"SELECT * FROM `nw_postmeta` WHERE `post_id` = ? AND `meta_key`= ? \");\n\t\t$query-> bindValue(1, $post_id);\n\t\t$query-> bindValue(2, $value);\n\n\t\ttry{\n\t\t\t$query->execute();\n\t\t\t$data = $query->fetch();\n\n\t\t\treturn $data;\n\t\t}catch(PDOException $e){\n\t\t\tdie($e ->getMessage());\n\t\t}\n\t}"
]
| [
"0.744184",
"0.73112255",
"0.69985807",
"0.69716084",
"0.6937682",
"0.6913452",
"0.6876634",
"0.68681437",
"0.6836498",
"0.68342894",
"0.6816118",
"0.6777162",
"0.66507035",
"0.66397727",
"0.661593",
"0.66022325",
"0.6547359",
"0.6529206",
"0.6529206",
"0.6519101",
"0.6493818",
"0.64740497",
"0.64295006",
"0.6429084",
"0.6411489",
"0.6403636",
"0.6398612",
"0.6387878",
"0.6381843",
"0.6380568",
"0.63553655",
"0.6352017",
"0.63343924",
"0.63343924",
"0.6327813",
"0.6314377",
"0.62988806",
"0.62883615",
"0.6286589",
"0.62839556",
"0.6271583",
"0.62568516",
"0.6252153",
"0.625086",
"0.623135",
"0.6215813",
"0.621478",
"0.62114775",
"0.62024206",
"0.6171557",
"0.61714566",
"0.6170764",
"0.61545",
"0.6146099",
"0.613674",
"0.6119106",
"0.61157453",
"0.611037",
"0.61026865",
"0.609583",
"0.60892075",
"0.6077307",
"0.60421556",
"0.6020101",
"0.6003539",
"0.60021937",
"0.59981287",
"0.59968317",
"0.59937143",
"0.599135",
"0.59912974",
"0.59901166",
"0.598372",
"0.59811807",
"0.5977067",
"0.5976656",
"0.59755415",
"0.5971898",
"0.5968265",
"0.5962898",
"0.5953608",
"0.59524006",
"0.5938361",
"0.5934884",
"0.5933107",
"0.592525",
"0.5925207",
"0.59224594",
"0.59224105",
"0.5920096",
"0.5917836",
"0.59107494",
"0.5910208",
"0.58995944",
"0.58995855",
"0.58914685",
"0.5890145",
"0.5880067",
"0.5872981",
"0.58720183"
]
| 0.8504743 | 0 |
searches if the id exists | public static function idExists( string $id){
return CommentDatabase::idExists( $id);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function returnExists($id);",
"function exists($id);",
"public function exists($id);",
"public function exists($id);",
"static function exists($id) {\n $result = self::get($id);\n if (count($result) > 0) return true;\n return false;\n }",
"private function isIdExist($id) {\n\t\tif(!$id){\n\t\t\treturn false;\n\t\t}\n\t\n\t\t$stmt = $this->dbh->prepare(\"SELECT * FROM candidates WHERE id=:id \");\n\t\t$stmt->setFetchMode(PDO::FETCH_ASSOC);\n\t\t$stmt->execute(array(\":id\"=>$id));\n\t\t$row = $stmt->fetch();\n\t\n\t\treturn !empty($row);\n\t}",
"abstract protected function _doContains($id);",
"public function isExistById($id){\n//\t\tprint_r(\"##Count=##\");\n//\t\tprint_r($this->find($id)->count());\n return $this->find($id)->count() ;\n }",
"private function checkIsExists(): bool\n {\n $where = [\n $this->table. '.vendorId' => $this->vendorId,\n $this->table. '.campaign' => $this->campaign,\n ];\n\n if (!is_null($this->id)) {\n $where[$this->table. '.id !='] = $this->id;\n }\n\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => $where\n ]);\n\n return !is_null($id);\n }",
"function is_exists($id) {\n $query = \"SELECT\n id\n FROM\n \" . $this->table_name . \" \n WHERE\n id = ?\n LIMIT\n 0,1\";\n \n // prepare query statement\n $stmt = $this->conn->prepare( $query );\n \n // bind id of user to be updated\n $stmt->bindParam(1, $id);\n \n // execute query\n $stmt->execute();\n \n // get retrieved row\n return ($stmt->rowCount() > 0);\n }",
"function linkIdExists($id) {\n\t$id = intval($id);\n\treturn(dbResultExists(\"SELECT id FROM links WHERE id=$id\"));\n}",
"public static function exists(int $id): bool;",
"function exists() {\n\t return !empty($this->id);\n\t}",
"public function exists($id) {\n $path = $this->options['resource'];\n $path .= '/exists?data.' . $this->options['id_field'] . '=' . $id;\n $response = $this->get($path);\n return !!$response['body']['_id'];\n }",
"public function has(string $id): bool;",
"public function search($id);",
"public function findIsExists($organisasi_id);",
"function pageIdExists($id) {\n\t$db = DB::getInstance();\n\t$query = $db->query(\"SELECT private FROM pages WHERE id = ? LIMIT 1\",array($id));\n\t$num_returns = $query->count();\n\tif ($num_returns > 0){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}",
"public function exist( $data, $id ) {\n\t\t$query = $this->db->select( '*' )\n\t\t ->from( $this->_table )\n\t\t ->where( $this->name, $data )\n\t\t ->where_not_in( $this->primary_key, $id )\n\t\t ->get();\n\t\t$num = $query->num_rows();\n\t\tif ( $num == 0 ) {\n\t\t\treturn true;\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"function userIdExists($id) {\n\t$db = DB::getInstance();\n\t$query = $db->query(\"SELECT * FROM users WHERE id = ?\",array($id));\n\t$num_returns = $query->count();\n\tif ($num_returns > 0){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}",
"public function exists($id = 0)\n\t{\n\t\t$search = craft()->retsRabbit_searches->getById($id);\n\n\t\treturn !is_null($search);\n\t}",
"public function hasId(){\n return $this->_has(1);\n }",
"public function hasId(){\n return $this->_has(1);\n }",
"public function hasId(){\n return $this->_has(1);\n }",
"public function hasId(){\n return $this->_has(1);\n }",
"public function hasId(){\n return $this->_has(1);\n }",
"public function hasId(){\n return $this->_has(1);\n }",
"public function hasId(){\n return $this->_has(1);\n }",
"public function hasId(){\n return $this->_has(1);\n }",
"public function hasId(){\n return $this->_has(1);\n }",
"public function hasId(){\n return $this->_has(1);\n }",
"function exists($id)\r\n\t{\r\n\t\t$id = mysql_clean($id);\r\n\t\t$obj = $this->obj_class;\r\n\t\tglobal ${$obj};\r\n\t\t$obj = ${$obj};\r\n\t\t$func = $this->check_func;\r\n\t\treturn $obj->{$func}($id);\r\n\t}",
"public function check_existence($id)\n {\n $nr= DB::select(\"Select count(1) a from books where id = \".$id);\n\n if($nr[0]->a==1)\n $msg=\"The book exists\";\n else\n $msg=\"The book does not exist\";\n\n return response($msg,201) ;\n }",
"function donationIdExists($id) {\n\t$db = DB::getInstance();\n\t$query = $db->query(\"SELECT * FROM donation WHERE id = ?\",array($id));\n\t$num_returns = $query->count();\n\tif ($num_returns > 0){\n\t\treturn true;\n\t}else{\n\t\treturn false;\n\t}\n}",
"public function hasId(){\r\n return $this->_has(5);\r\n }",
"private function checkIsExists(): bool\n {\n $id = $this->readImproved([\n 'what' => [$this->table. '.id'],\n 'where' => [\n $this->table. '.listId' => $this->listId,\n $this->table. '.campaignId' => $this->campaignId,\n ]\n ]);\n\n return !is_null($id);\n }",
"function _existsInDatabase($id)\n {\n $conn = getConn();\n $sql = \"SELECT RubriekID FROM Rubriek WHERE RubriekID = ?\";\n $stmt = sqlsrv_prepare($conn, $sql, array($id));\n if (!$stmt) {\n die(print_r(sqlsrv_errors(), true));\n }\n sqlsrv_execute($stmt);\n if (sqlsrv_execute($stmt)) {\n $row = sqlsrv_has_rows( $stmt );\n if ($row === true){\n return true;\n }\n }\n return false;\n }",
"public function has(string $id);",
"function id_exists($id)\r\n\t{\r\n\t\t$this->db->where('id', $id);\r\n\t\t$this->db->from(\"users\");\r\n\t\treturn $this->db->count_all_results();\r\n\t}",
"public function check($id);",
"public static function find_by_id($id=0) {\r\n\t\tglobal $db;\r\n\t\t$result_array = self::find_by_sql(\"SELECT * FROM \".self::$table_name.\" WHERE id=\".$db->escape_value($id).\" LIMIT 1\");\r\n\t\t//checking to see if the array is empty\r\n\t\t//array shift will shift an element off the beginning of an array\r\n\t\treturn !empty($result_array) ? array_shift($result_array) : false;\r\n\t}",
"public function has($id);",
"public function has($id);",
"function franchiseIdExists($id) {\n global $mysqli, $db_table_prefix;\n $stmt = $mysqli->prepare(\"SELECT active\n\t\tFROM \" . $db_table_prefix . \"franchise\n\t\tWHERE\n\t\tid = ?\n\t\tLIMIT 1\");\n $stmt->bind_param(\"i\", $id);\n $stmt->execute();\n $stmt->store_result();\n $num_returns = $stmt->num_rows;\n $stmt->close();\n\n if ($num_returns > 0) {\n return true;\n } else {\n return false;\n }\n}",
"public function checkIDexists($car_id){\n $this->db->query('SELECT `id` FROM ' . CARS_TABLE . ' WHERE `id` = ' .$car_id);\n $this->db->getSingle();\n\n if( $this->db->rowCount() >= 1){\n return true;\n }else{\n return false;\n }\n }",
"function exists()\r\n\t{\r\n\t\treturn ( ! empty($this->id));\r\n\t}",
"function is_exists_doc($doc_id){\n\tif(!filter_var($doc_id, FILTER_VALIDATE_INT)){\n\t\n\treturn false;\n\t\n\t}\n\telse{\n\t\tglobal $prefix_doc;\n\t\t$query = borno_query(\"SELECT * FROM $prefix_doc WHERE id='$doc_id'\");\n\t\t\n\t\t$count = mysqli_num_rows($query);\n\t\tif($count==1){\n\t\t\treturn true;\n\t\t}\n\t\telse{\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\n\t}\n\n}",
"public function exist($id){\n\t\t$sql = \"SELECT id FROM repositories WHERE id=:id\";\n\t\t$stmt = $this->db->prepare($sql);\n\t\t\n\t\t$stmt->bindParam(':id', $id);\n\t\t$stmt->execute();\n\t\t\n\t\tif( $stmt->rowCount() > 0 ){\n\t\t\treturn true;\n\t\t} \n\t\t\n\t\treturn false;\n\t}",
"function exists($id) {\n\t\t$res = $this->query('SELECT EXISTS (SELECT * FROM `'.$this->table.'` WHERE `'.$this->primaryKey.'` = \\''.$this->escape($id).'\\')');\n\t\t$row = $res->fetch_row();\n\t\t$res->free();\n\t\treturn (bool) $row[0];\n\t}",
"public static function exists($id) {\n\t\t$classe = get_called_class();\n\t\t$table = str_replace(\"db_\", \"\", $classe);\n\t\t$instance = db::findOne(db::table($table), \" id = :id \", array(\":id\" => $id));\n\t\treturn (!(is_null($instance)));\n\t}",
"function exists($id)\n{\n\tif ($id && file_exists('datas/data')){\n\t\t$file = unserialize(file_get_contents('datas/data'));\n\t\tforeach ($file as $value){\n\t\t\tif(trim($value['nom']) === trim($id))\n\t\t\t\treturn true;\n\t\t}\n\t}\n return false;\n}",
"function userFound($id)\n{\n global $conn;\n $stmt = $conn->prepare(\"SELECT * FROM users WHERE _id = '$id' ;\");\n $stmt->execute();\n $c = $stmt->rowCount();\n if ($c == 0) return \"not found\";\n return \"found\";\n}",
"public function hasId(){\n return $this->_has(17);\n }",
"function pageIdExists($id) {\n global $mysqli, $db_table_prefix;\n $stmt = $mysqli->prepare(\"SELECT private\n\t\tFROM \" . $db_table_prefix . \"pages\n\t\tWHERE\n\t\tid = ?\n\t\tLIMIT 1\");\n $stmt->bind_param(\"i\", $id);\n $stmt->execute();\n $stmt->store_result();\n $num_returns = $stmt->num_rows;\n $stmt->close();\n\n if ($num_returns > 0) {\n return true;\n } else {\n return false;\n }\n}",
"static function exists($ident) {\n\t\n\t\trequire_once 'DBO.class.php';\n\t\n\t\t$db = DBO::getInstance();\n\t\t$ids = $db->prepare('SELECT id FROM projects');\n\t\t$ids->execute();\n\t\tif($ids->errorCode() != 0)\t{\n\t\t\t$error = $ids->errorInfo();\n\t\t\tthrow new Exception($error[2]);\n\t\t}\n\t\n\t\twhile($id = $ids->fetch())\n\t\t\tif($ident == $id[id])\n\t\t\t\treturn true;\n\t\n\t\treturn false;\n\t}",
"public function hasId() {\n return $this->_has(1);\n }",
"public function hasId() {\n return $this->_has(1);\n }",
"public function hasId() {\n return $this->_has(1);\n }",
"public function hasId() {\n return $this->_has(1);\n }",
"public function hasId() {\n return $this->_has(1);\n }",
"public function hasId() {\n return $this->_has(1);\n }",
"public function hasId() {\n return $this->_has(1);\n }",
"public function hasId() {\n return $this->_has(1);\n }",
"public function hasId() {\n return $this->_has(1);\n }",
"public function hasId() {\n return $this->_has(1);\n }",
"public function hasId() {\n return $this->_has(1);\n }",
"public function hasId() {\n return $this->_has(1);\n }",
"public function hasId() {\n return $this->_has(1);\n }",
"public function exists()\n {\n return ($this->id) ? true : false;\n }",
"public function exists( $id ) {\r\r\n if ($this->refresh) {\r\r\n $this->init();\r\r\n $this->refresh = false;\r\r\n }\r\r\n return isset($this->instances[$id]);\r\r\n }",
"public function isExist($id_media)\n {\n \t// print_r($this->_db);\n\t\t$result = $this->_db->simpleSelect(\"media C\", \"C.id\", array(\"id\", \"=\", $id_media));\n\t\treturn $this->_db->haveRows($result);\n\t\t\n }",
"public function exists($id) {\n\t\treturn boolval($this->getQueryClass()->filterById($id)->count());\n\t}",
"function does_id_exist($data1, $data2)\r\n\t{\r\n\t\tglobal $db;\r\n\t\t$query = 'SELECT spotlight_post_id FROM gv_spotlight_post WHERE (spotlight_post_block = 0) AND (spotlight_post_id = ' . $data1 . ' AND member_id = ' . $data2 . ')';\r\n\t\t$result = mysql_query($query, $db) or die(mysql_error($db));\r\n\t\t\r\n\t\tif(mysql_num_rows($result) > 0)\r\n\t\t{\r\n\t\t\t$post_exists = 1;\r\n\t\t}\r\n\t\telse {\r\n\t\t\t\t$post_exists = 0;\r\n\t\t}\r\n\t\treturn $post_exists;\r\n\t}",
"function lukasid_exists($lid = '')\r\n\t{\r\n\t\t$this->db->where('lukasid', $lid);\r\n\t\t$query = $this->db->get('users');\r\n\t\tif($query->num_rows == 1)\r\n\t\t{\r\n\t\t\treturn true;\r\n\t\t}\r\n\t\treturn false;\r\n\t}",
"function exists($id) {\n $this->db->from('items_collection');\n $this->db->where('id', $id);\n $query = $this->db->get();\n\n return ($query->num_rows() == 1);\n }",
"public function exists() {\n\t\tglobal $config;\n\t\t\n\t\tif(!empty($this->data['id']))\n\t\t\t$where = 'id = '.$this->data['id'];\n\t\telseif(!empty($this->data['fbid']))\n\t\t\t$where = 'fbid = '.$this->data['fbid'];\n\t\n\t\t$result = $config['database']->query(\"\n\t\t\tSELECT id\n\t\t\tFROM nuusers\n\t\t\tWHERE $where\n\t\t\tLIMIT 1\n\t\t\");\n\t\t\n\t\treturn $result->num_rows;\n\t}",
"public function testDbFindById()\n {\n $test1 = is_null($this->app->db()->findById('games', 999));\n\n # One result\n $test2 = $this->app->db()->findById('games', 1)['id'] == 1;\n\n return $test1 && $test2;\n }",
"function tflash_id_exits($id) {\n return TFLASH::id_exists($id);\n}",
"function userIdExists($id) {\n return valueExists('users', 'id', $id);\n}",
"private function searchById($id){\n \n $searchResults = null;\n $items = $this->items;\n if(strlen(trim($id)) == 0 ) return $searchResults;\n \n foreach($items as $item){\n if($item->id == $id){\n $searchResults[] = $item;\n } \n }\n \n return $searchResults;\n \n }",
"public function hasId() : bool;",
"public function exists($id){\n\t\t$this->clearParams();\n\t\t$params = array_merge($this->paramsDefaults, array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'conditions' => array(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t$this->primaryKey => $id\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\t\t\t\t\t\t\t\t, 'fields' => array(1)\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);\n\t\t$params = $this->filterParams($params);\n\t\t$row = $this->read($params);\n\t\treturn (count($row) > 0) ? true : false;\n\t}",
"public function exist($id){\n $rq = \"SELECT * FROM Objets WHERE id = :id\";\n $stmt = $this->pdo->prepare($rq);\n $data = array(\":id\" => $id);\n if(!$stmt->execute($data)){\n throw new Exception($pdo->errorInfo());\n }\n if($stmt->rowCount() > 0){\n return true;\n } else {\n $this->erreur = \"Objet inexistant\";\n return false;\n }\n }",
"function permissionIdExists($id) {\n\t$db = DB::getInstance();\n\t$query = $db->query(\"SELECT id FROM permissions WHERE id = ? LIMIT 1\",array($id));\n\t$num_returns = $query->count();\n\n\tif ($num_returns > 0) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}",
"function search($id){\n\t\tglobal $con;\n\t\t$query = \"select * from user where id = '$id'\";\n\t\t$res=$con->query($query);\n\t\treturn $res;\n\t}",
"public function getEvent_matchById($id){\n\tif(!is_int($id)){return false;}\n\n\t$sql = \"SELECT * FROM $this->table WHERE ID=$id\";\n\n\treturn $this->query->query($sql);\n}",
"function user_id_exists($db, $user_id)\n{\n\t$sql = 'SELECT * FROM users where id=:id';\n\t$st = $db->prepare($sql);\n\t$st->execute(array(':id'=>$user_id));\n\t$us = $st->fetchAll();\n\treturn (count($us) >= 1);\n}",
"public static function findById($id)\n\t{\n\t\n\t}",
"public function search_dispositivo_id($id) {\n\n\t\tif($id != FALSE) {\n\t\t\t$query = $this->db->select('devices_almacen.*')\n\t\t\t->where('devices_almacen.id_devices_almacen',$id)\n\t\t\t->get('devices_almacen');\n\n\t\t\treturn $query->result();\n\t\t}\n\t\telse {\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"public function hasId()\n {\n $id = $this->getId();\n\n if (is_array($id)) {\n foreach ($id as $k => $v) {\n if (\"\" == \"$v\") {\n return false;\n }\n }\n }\n else if (\"\" == \"$id\") {\n return false;\n }\n\n return true;\n }",
"abstract public function find($id);",
"function leadIdExists($id) {\n global $mysqli, $db_table_prefix;\n $stmt = $mysqli->prepare(\"SELECT active\n\t\tFROM \" . $db_table_prefix . \"leads\n\t\tWHERE\n\t\tid = ?\n\t\tLIMIT 1\");\n $stmt->bind_param(\"i\", $id);\n $stmt->execute();\n $stmt->store_result();\n $num_returns = $stmt->num_rows;\n $stmt->close();\n\n if ($num_returns > 0) {\n return true;\n } else {\n return false;\n }\n}",
"public static function find_by_id($id){\n global $database;\n \n $result_array = static::find_by_query(\"SELECT * FROM \" . static::$table_users . \" WHERE id = $id\");\n\n // since we are only get a single user, we can pull the data out from the array and return it.. \n // here we used the ternary opperator to do a singled line if else statement \n return !empty($result_array) ? array_shift($result_array) : false;\n \n }",
"public static function exists($id) {\n $result = \\Drupal::database()->select('client', 'e')\n ->fields('e', ['id'])\n ->condition('id', $id, '=')\n ->execute()\n ->fetchField();\n return (bool) $result;\n }",
"public function recordExists($id)\n {\n return is_array($this->selectSingleFields($id, ['id'], false));\n }",
"public function islecturersExisting ($id){\n $sqlQuery = \"SELECT count (*) as isExisting \";\n $sqlQuery .= \"FROM lecturers \";\n $sqlQuery .= \"WHERE id= $id\";\n $result = $this -> getDbManager() -> executeSelectQuery ( $sqlQuery );\n if ( $result [0][ \" isExisting \"] == 1) return ( true );\n else return ( false );\n }",
"function existe($id_desig){\r\n $sql=\"select * from suplente where id_desig_suplente=$id_desig\";\r\n $res=toba::db('designa')->consultar($sql);\r\n \r\n if(count($res)>0){\r\n return true;\r\n }else{\r\n return false;\r\n }\r\n }",
"function user_is($id) {\n $query =\"SELECT EXISTS(SELECT id FROM users WHERE id = '$id')\";\n $result = $this->conn->query($query);\n\n if (!$result) die (\"Database access failed: \" . $this->conn->error);\n\n $result->data_seek(0);\n if ($result->fetch_array(MYSQLI_NUM)[0]) {\n $result->close();\n return true;\n } else {\n $result->close();\n return false;\n }\n }",
"function test_id(){\n\t\tif(isset($_GET['id'])){\n\t\t\trecuperation_info_id();\n\t\t\tglobal $id_defini;\n\t\t\t$id_defini = true;\n\t\t}\n\t}",
"function findById($id);"
]
| [
"0.7677637",
"0.7596477",
"0.7397673",
"0.7397673",
"0.7333855",
"0.72401464",
"0.7105709",
"0.69857514",
"0.69769186",
"0.69339585",
"0.69292665",
"0.6889805",
"0.688527",
"0.6873823",
"0.6846465",
"0.6771343",
"0.67638993",
"0.67619777",
"0.6733495",
"0.67242086",
"0.6721411",
"0.6719876",
"0.6719876",
"0.6719876",
"0.6719876",
"0.6719876",
"0.6719876",
"0.6719876",
"0.6719876",
"0.6719876",
"0.6719876",
"0.6716807",
"0.66869503",
"0.66823775",
"0.66798663",
"0.667236",
"0.6664858",
"0.66614425",
"0.6603921",
"0.65897393",
"0.65870553",
"0.65825486",
"0.65825486",
"0.65751517",
"0.6571416",
"0.65585715",
"0.65576583",
"0.65423626",
"0.65391064",
"0.6531609",
"0.6526463",
"0.64980626",
"0.6485853",
"0.6482296",
"0.6477149",
"0.6471368",
"0.6471368",
"0.6471368",
"0.6471368",
"0.6471368",
"0.6471368",
"0.6471368",
"0.6471368",
"0.6471368",
"0.6471368",
"0.6471368",
"0.6471368",
"0.6471368",
"0.6461663",
"0.64509237",
"0.6442991",
"0.6441316",
"0.64242446",
"0.6419091",
"0.6406529",
"0.6405271",
"0.6403125",
"0.64017",
"0.63810724",
"0.6378131",
"0.6375015",
"0.6358127",
"0.6353431",
"0.632817",
"0.63261354",
"0.63055235",
"0.62937987",
"0.6280714",
"0.62687194",
"0.6265456",
"0.62647736",
"0.6262487",
"0.6258029",
"0.625777",
"0.6253304",
"0.62472075",
"0.62454075",
"0.6244607",
"0.6240906",
"0.62344664"
]
| 0.63841903 | 78 |
gets the ids of all the comments | public static function getAll( int $limit = -1, int $offset = -1){
$ids = CommentDatabase::getAll( $limit, $offset);
return array( "status" => "OK", "lenght" => count( $ids), "comments" => $ids, "version" => "v1");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function get_comment_ids()\n {\n }",
"public static function getAllComment() {\n\t\treturn array(self::_getDao()->count(), self::_getDao()->getAll());\n\t}",
"public function getAllComments()\n\t{\n\t\t$req=$this->_bdd->query('SELECT Comments.id, content_com AS content, DATE_FORMAT(date_com, \"%d/%m/%Y %Hh%imin%ss\") AS date, id_users, id_post, moderate, login FROM Comments INNER JOIN Users ON id_users=Users.id WHERE moderate >0 ORDER BY moderate DESC');\n\t\t\n\t\t$comments=[];\n\t\twhile($datas=$req->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t\n\t\t\t\t $comments[]=new Comments($datas);\n\t\t\t\t //return $comments;\n\t\t\t\n\t\t\t\n\t\t}\n\t\treturn $comments;\n\t}",
"public function getAllTheComments(){\n\t\t try{\n\t\t\t $conn=DBConnection::GetConnection();\n\t\t\t $myquery=\"SELECT comment_id,comment_description,comment_date,news_id,user_name FROM comment\";\n\t\t\t $result= $conn->query($myquery);\n\t\t\t $comments=array();\n\t\t\t foreach($result as $comment){\n\t\t\t\t$c1=new Comment();\n\t\t\t\t$c1->setCommentId($comment[\"comment_id\"]);\n\t\t\t\t$c1->setCommentDescription($comment[\"comment_description\"]);\n\t\t\t\t$c1->setCommentDate($comment[\"comment_date\"]);\n\t\t\t\t$c1->setNewsId($comment[\"news_id\"]);\n\t\t\t\t$c1->setUserName($comment[\"user_name\"]);\n\t\t\t\tarray_push($comments,$c1);\t\t\t\t\n\t\t\t }\n\t\t\t$conn =null;\n\t\t\treturn $comments;\n\t\t }catch(PDOException $p){\n\t\t\t echo 'Fail to connect';\n\t\t\t echo $p->getMessage();\n\t\t }\n\t }",
"public function findAll() {\n $sql = \"select * from t_comment order by com_id desc\";\n $result = $this->getDb()->fetchAll($sql);\n\n // Convert query result to an array of domain objects\n $comments = array();\n foreach ($result as $row) {\n $id = $row['com_id'];\n $comments[$id] = $this->buildDomainObject($row);\n }\n return $comments;\n }",
"public function getAllComments(){\n $comments = $this->db->query('SELECT * FROM comments');\n return $comments;\n }",
"public function getAllCommentaires()\n {\n $sql = 'SELECT COM_ID as id, COM_DATE as date,'\n . ' COM_AUTEUR as auteur, COM_CONTENU as contenu FROM t_commentaire'\n . ' ';\n $commentaires = $this->executerRequete($sql);\n return $commentaires;\n }",
"public function getIds();",
"public function getIds();",
"public function getAllComments() {\r\n \r\n $commentEntries = array();\r\n\r\n $sql = \"SELECT *\r\n FROM RecipeComments\r\n WHERE page = '$this->page'\r\n ORDER BY timestamp\"; \r\n \r\n $result = $this->conn->query($sql);\r\n \r\n $rows = $result->num_rows;\r\n \r\n for($i=1; $i<=$rows; $i++) {\r\n $row = $result->fetch_assoc();\r\n array_push($commentEntries, $row[\"username\"]);\r\n array_push($commentEntries, $row[\"comment\"]);\r\n array_push($commentEntries, $row[\"timestamp\"]);\r\n \r\n }\r\n\r\n return $commentEntries;\r\n \r\n }",
"public function getAllIds();",
"function getCommentIdsofPost($postId){\n global $conn;\n\n\n $commentIdArray = array();\n\n $sql = \"SELECT commentId from comment WHERE postId = $postId AND deleted = 0 ORDER BY creationTime ASC;\";\n $result = mysqli_query($conn, $sql);\n\n if (mysqli_num_rows($result) > 0) {\n while ($row = mysqli_fetch_assoc($result)) {\n\n $commentIdArray[] = $row['commentId'];\n\n\n }\n } else {\n\n # if Post got no Comments\n echo \"<br>\";\n echo \"<div class='commentContainer'> <p>No Comments</p></div>\";\n echo \"<br>\";\n\n }\n\n return $commentIdArray;\n}",
"public function getChildCids(array $comments);",
"public function getComments()\n {\n $id = $this->getId();\n\n $stmt = \" SELECT c.*, c.id as id, u.username, u.profile_picture FROM _xyz_article_comment_pivot acp \" .\n \" LEFT JOIN _xyz_comment c ON c.id = acp.comment_id \" .\n \" LEFT JOIN _xyz_user u ON u.id = c.user_id \" .\n \" WHERE acp.article_id = $id \"\n ;\n\n $sql = DB::instance()->query( $stmt );\n\n $rows = $sql->fetchAll(\\PDO::FETCH_UNIQUE|\\PDO::FETCH_ASSOC );\n\n $result = CommentCollection::toTree( $rows );\n\n return $result;\n }",
"public abstract function get_ids();",
"public function getCommentsAdmin() \n {\n $db = $this->dbConnect();\n $reqPostComments = $this->bdd->query('SELECT id, id_post, author, comment, DATE_FORMAT(date_comment, \\'Le %d/%m/%Y à %H h %i\\') AS date_comment FROM comments ORDER BY date_comment DESC');\n $commentsId = $reqPostComments->fetchAll();\n $reqPostComments->closeCursor();\n return $commentsId;\n }",
"public function ListComments($id) {\n try {\n \n\t //$res = $this->db->ExecuteSelectQueryAndFetchAll(\"SELECT Comment.*, User.acronym as owner FROM Comment INNER JOIN User ON Comment.idUser=User.id WHERE idContent=? AND Comment.deleted IS NULL;\", array($id));\n\t $res = $this->db->ExecuteSelectQueryAndFetchAll(self::SQL('select * by content'), array($id));\n\t print_r($id);\n\t print_r($res);\n\t return $res;\n } catch(Exception $e) {\n\t\techo $e;\n\t\treturn null;\n }\n }",
"function get_comment_ID()\n {\n }",
"public function getIds() {\n $sources = array();\n \n $sources[] = $this->id;\n \n foreach ($this->points as &$g) {\n $sources[] = $g->id;\n }\n foreach ($this->lines as &$g) {\n $sources[] = $g->id;\n }\n foreach ($this->polygons as &$g) {\n $sources[] = $g->id;\n }\n if ( !empty($this->address) ) {\n $sources[] = $this->address->id;\n }\n foreach ($this->relationships as &$r) {\n $sources[] = $r->id;\n }\n \n return array_filter($sources);\n }",
"public function getComments()\n {\n return $this->api->_request('GET', '/api/comments?id='.$this->ID);\n }",
"public function get_ids()\n {\n }",
"public function get_ids()\n {\n }",
"public function get_ids()\n {\n }",
"public function get_ids()\n {\n }",
"public function get_ids()\n {\n }",
"public function get_ids()\n {\n }",
"public function get_ids()\n {\n }",
"public function get_ids()\n {\n }",
"public function getComments() {\n if(!isset($this->comments)) {\n $this->comments = MergeRequestComment::getListByExample(\n new DBExample(array(\n 'mergeRequestId' => $this->id\n )),\n null,\n array(),\n array(\n 'parentId' => DB::SORT_ASC,\n 'ctime' => DB::SORT_ASC\n )\n );\n }\n\n return $this->comments;\n }",
"public function getComments() {\n $db = new mysql('testserver', 'testuser', 'testpassword');\n $sql = \"SELECT * FROM comments_table where parent_id=0 ORDER BY create_date DESC;\";\n $result = mysql_query($sql, $db);\n $comments = [];\n while ($row = mysql_fetch_assoc($result)) {\n $comment = $row;\n $reply_1_sql = \"SELECT * FROM comments_table where parent_id=\" . $row['id'] . \" ORDER BY create_date DESC;\";\n $result_reply_1 = mysql_query($reply_1_sql, $db);\n $replies = [];\n while ($row1 = mysql_fetch_assoc($result)) {\n $reply = $row1;\n $reply_2_sql = \"SELECT * FROM comments_table where parent_id=\" . $row1['id'] . \" ORDER BY create_date DESC;\";\n $result_reply_2 = mysql_query($reply_2_sql, $db);\n $replies_to_replies = [];\n while ($row2 = mysql_fetch_assoc($result)) {\n $replies_to_replies[] = $row2;\n }\n $reply['replies'] = $replies_to_replies;\n $replies[] = $reply;\n }\n $comment['replies'] = $replies;\n $comments[] = $comment;\n }\n return $comments;\n }",
"function get_all_comments() {\n global $db;\n $query = \"SELECT c.comment_id, c.comment, c.user_id, c.created, u.userName FROM comments c\n JOIN users u on u.user_id = c.user_id\n ORDER BY created DESC\";\n $statement = $db->prepare($query);\n $statement->execute();\n $comments = $statement->fetchAll();\n $statement->closeCursor();\n return $comments; \n }",
"public function getAllComments()\n {\n $req = $this->pdo->prepare('SELECT * FROM comments ORDER BY `date` DESC');\n $req->execute();\n\n return $req->fetchAll();\n }",
"public function getComments($idBillet) {\n $sql = 'select com_id as id, com_date as date,'\n . ' com_auteur as auteur, com_content as contenu from comment'\n . ' where ART_ID=?';\n $result = $this->executerRequete($sql, array($idBillet));\n $comments = [];\n foreach ($result as $row){\n $commentId = $row['id'];\n $comments[$commentId] = $this->buildObject($row);\n }\n return $comments;\n }",
"public function getAllIds(): array;",
"public function findAll() {\n $sql = \"select * from t_comment order by com_id desc\";\n $result = $this->getDb()->fetchAll($sql);\n\n // Convert query result to an array of domain objects\n $entities = array();\n foreach ($result as $row) {\n $commentId = $row['com_id'];\n $entities[$commentId] = $this->buildDomainObject($row);\n }\n return $entities;\n }",
"public function getComments(int $fileId): array\n {\n return $this->commentMapper->getComments($fileId);\n }",
"public function findAll()\n {\n $comments = $this->session->get('comments', []);\n\n if(is_null($comments)) {\n return $comments;\n }\n\n foreach ($comments as $id => $comment) :\n if($this->url->getPage() != $comment['page']) {\n unset($comments[$id]);\n }\n endforeach;\n \n return $comments;\n }",
"function get_comments(){\n\n\t}",
"public function comments()\n {\n // check if user is already loaded, if not, we fetch it from database\n if ($this->_comments) {\n return $this->_comments;\n } else {\n $comments = new Application_Model_DbTable_Comments();\n\n foreach ($comments->findAllBy('post_id', $this->_id) as $comment) {\n $this->_comments[] = $comment ;\n }\n return $this->_comments;\n }\n }",
"public function getComments($id_root=0) {\n if ( empty($id_root) ) $id_root = $this->get('id_root');\n return $this->query_loads(\"id_root=$id_root AND id_parent>0 ORDER BY order_list ASC\");\n //return self::getCommentsInOrder($id_root);\n }",
"public function getIdsList() {\n return $this->_get(1);\n }",
"public function getComments() {\n\t\treturn $this->api->getCommentsByPhotoId($this->getId());\n\t}",
"public function listId()\n {\n return $this->contractor->all()->pluck('id')->all();\n }",
"public function getComments($idPost)\n\t{\n\t\t$req=$this->_bdd->query('SELECT Comments.id, content_com AS content, DATE_FORMAT(date_com, \"%d/%m/%Y %Hh%imin%ss\") AS date, id_users AS idUser, id_post AS idPost, moderate, login FROM Comments INNER JOIN Users ON id_users=Users.id WHERE id_post='.$idPost);\n\n\t\t$comments=[];\n\t\n\t\twhile($datas=$req->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\t\n\t\t\t\t\t$comments[]=new Comments($datas);\t\t\n\t\t\t}\n\t\treturn $comments;\n\t\t\t\t\n\t}",
"public function getIds()\n {\n\n }",
"function view_comments($album_id){\n $album_id = (int)$album_id;\n $comments = array();\n $query = mysql_query(\"SELECT * FROM comments WHERE album_id = $album_id\");\n\n while($comment_row = mysql_fetch_assoc($query)){\n $comments[] = array(\n 'id' => $comment_row['comment_id'],\n 'user_id' => $comment_row['user_id'],\n 'comment' => $comment_row['comment'],\n 'timestamp' => $comment_row['timestamp']\n );\n }\n return $comments;\n }",
"public function comments()\n\t{\n\t\treturn $this->has_many('comment');\n\t}",
"public function getComments(int $id):array\n {\n $req=$this->pdo->prepare(\n 'SELECT comment_id,content,validated,commented_by,post_id,\n date_format(commented,\\' %d\\%m\\%Y à %Hh%imin%ss\\') as coment_date\n FROM comments \n WHERE comments.post_id = ? \n AND comments.validated IS NOT NULL\n ORDER BY coment_date DESC'\n );\n $req->execute([$id]);\n return $comments= $req->fetchAll(\\PDO::FETCH_OBJ);\n }",
"public function getAllComment()\n {\n return Comment::find()->with('user')->orderBy(['created_date'=>SORT_DESC])->all();\n \n }",
"public function getComments($id){\n $id = (int)$id;\n $sql = \"select * from comments WHERE discussion_id = '{$id}'\";\n return $this->db->query($sql);\n }",
"public function scopeFetchIds()\n {\n return $this->pluck(\"id\");\n }",
"public function getUserComments(): array {\n $query = \"SELECT * \n FROM Comments \n WHERE toUserID = :userID OR fromUserID = :userID\";\n \n $stmt = $this->_db->prepare ( $query );\n $stmt->bindValue ( ':userID', $this->_userID );\n $stmt->execute ();\n $objects = [];\n while ( $row = $stmt->fetch ( PDO::FETCH_ASSOC ) ) {\n $comment = new Comment ( $this->_db );\n $comment->commentID = $row ['commentID'];\n $comment->get();\n $objects [] = $comment;\n }\n \n return $objects;\n }",
"public function get_comments()\n {\n }",
"public function getComments() {}",
"public static function get_cms_comment_url_list()\n\t{\n\t\treturn self::get_cms_post_url_list(Helper_PostType::COMMENT);\n\t}",
"public function getComments ()\n {\n $db = $this->dbConnect ();\n $req = $db->prepare ('SELECT id_comment,signalement,id_chapter,author,comment,DATE_FORMAT(dateComment, \\'%d/%m/%Y \\') AS dateComment FROM comments WHERE ? ORDER BY id_comment DESC ');\n $req->execute (array ( 1 ));\n return $req;\n }",
"function user_get_comment_data($id = null)\n\t{\n\t\t$uid = ($id == null) ? $_SESSION['uid'] : $id;\n\t\t$comments = $this->DB->database_select('user_comments', '*', array('to_user' => $uid));\n\t\treturn $comments;\n\t}",
"public function getIds()\n\t{\n\t\treturn $this->ids;\n\t}",
"public function getId()\n {\n return $this->_commentId;\n }",
"function comments() {\n if ($this->getRequestMethod() != \"GET\") {\n $this->response('', 406);\n }\n $id = (int)$this->_request['video_id'];\n if ($id > 0) {\n $query = \"select * from comments where video_id=$id;\"; \n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n if($r->num_rows > 0) {\n $result = array();\n while ($row = $r->fetch_assoc()) {\n $result[] = $row;\n } \n $this->response(json_encode($result), 200); \n } else {\n $this->response('', 204);\n }\n } else {\n $this->response('', 400);\n } \n }",
"public function getIds()\n {\n return $this->ids;\n }",
"public function getIds()\n {\n return $this->ids;\n }",
"function GetAll()\n {\n $ids = array();\n $sql = \"SELECT id FROM client_os ORDER BY name\";\n $query = pdo_query($sql);\n while($query_array = pdo_fetch_array($query))\n {\n $ids[] = $query_array['id'];\n }\n return $ids; \n }",
"public function getCommentsData()\n {\n $query = $this->getComments()->orderBy(['tree' => SORT_ASC, 'lft' => SORT_ASC]);\n $dependency = new TagDependency(['tags' => [self::CACHE_TAG_POST_ALL_COMMENTS]]);\n return self::getDb()->cache(static function () use ($query) {\n return $query->all();\n }, self::CACHE_DURATION, $dependency);\n }",
"public function ids()\n {\n return $this->_ids;\n }",
"public function getComments() {\n\t\treturn $this->arrComments;\n\t}",
"public static function searchComments($id) {\n $db = Db::getInstance();\n $id = intval($id);\n $req = $db->prepare('call searchComment(?)');\n $req->execute([$id]);\n return $req->fetchAll(PDO::FETCH_ASSOC);\n }",
"public function get_comments($limit = 0)\n\t{\n\t\t$this->db->query(\"\n\t\t\tSELECT id_comment, username, email, comment, time_added\n\t\t\tFROM class_comments\");\n\n\t\t$comments = array();\n\t\twhile ($row = $this->db->assoc())\n\t\t\t$comments[$row['id_comment']] = $row;\n\t\t$this->db->free_result();\n\n\t\treturn $comments;\n\t}",
"public function getIds()\n {\n return $this->article_ids;\n }",
"public function getAllComments() {\n\n\t\t$sql = \"SELECT comment_id, comment_text, entries.post_title, users.user_name FROM comments\n\t\t\t\tINNER JOIN entries ON comments.post_id = entries.post_id \n\t\t\t\tINNER JOIN users ON users.user_id = comments.comment_author\";\n\t\t//create stdStatemment object | call to Model method from core/Database.php\n\t\treturn $this->setStatement($sql);\n\t}",
"public function todosComentarios(){\n\t\t$comments_inf = [];\n\t\t$num=1;\n\t\t$sql_query = \"SELECT * FROM comentarios;\";\n\t\tif($result = $this->connection->query($sql_query))\n\t\t{\n\t\t\twhile($row = $result->fetch_assoc()){\n\t\t\t\t$comment_row = [\n\t\t\t\t\t\"num\"=>$num,\n\t\t\t\t\t\"id\" => $row[\"Id\"],\n\t\t\t\t\t\"name\" => $row[\"Nombre\"],\n\t\t\t\t\t\"date\" => $row[\"Fecha\"],\n\t\t\t\t\t\"time\" => $row[\"Hora\"],\n\t\t\t\t\t\"email\" => $row[\"Email\"],\n\t\t\t\t\t\"description\" => $row[\"Descripcion\"],\n\t\t\t\t\t\"ip\" => $row[\"IP\"],\n\t\t\t\t\t\"idEvento\" => $row[\"Id_Eventos\"]\n\t\t\t\t];\n\t\t\t\tarray_push($comments_inf,$comment_row);\n\t\t\t\t$num++;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\techo(\"Error al consultar comentarios en BD\");\n\t\t}\n\t\treturn $comments_inf;\n\t}",
"public function get_comments_by_parent_id($idParent) {\n $root = simplexml_load_file('data/comments.xml');\n $comments = [];\n foreach($root->xpath(\"//comment\") as $comment) {\n if(intval($comment['idParent']) === $idParent){\n array_push($comments, array(\n 'author' => (string) $comment->author,\n 'mark' => intval($comment->mark),\n 'comment' => (string) $comment->text)\n );\n }\n }\n return $comments;\n }",
"public function getCommentators()\n {\n return $users = User::select('users.*')\n ->distinct()\n ->join('comments', 'comments.user_id', '=', 'users.id')\n ->where('comments.image_id', $this->id)\n ->get();\n }",
"public function getAllCommentsByBattleID($battle_id) {\n $stmt = $this->db->query(\"SELECT *\n FROM comments\n INNER JOIN users\n ON comments.userid = users.userid\n WHERE battle_id = :id\");\n\n $stmt->bindParam(':id', $battle_id);\n $stmt->execute();\n $rows = array();\n while($row = $stmt->fetch()) {\n $rows[] = $row;\n }\n return $rows;\n\n }",
"public function getComments() \n {\n return $this->hasMany(Comment::className(), [\n 'post_id' => 'id',\n ]);\n }",
"function get_comment_id_fields($post = \\null)\n {\n }",
"function taminoGetIds() {\n $rval = $this->tamino->xquery($this->xquery);\n if ($rval) { // tamino Error\n print \"<p>LinkCollection Error: failed to retrieve linkRecord id list.<br>\";\n print \"(Tamino error code $rval)</p>\";\n } else { \n // convert xml ids into a php array \n $this->ids = array();\n $this->xml_result = $this->tamino->xml->getBranches(\"ino:response/xq:result\");\n if ($this->xml_result) {\n\t// Cycle through all of the branches \n\tforeach ($this->xml_result as $branch) {\n\t if ($att = $branch->getTagAttribute(\"id\", \"xq:attribute\")) {\n\t array_push($this->ids, $att);\n\t }\n\t} /* end foreach */\n } \n }\n\n }",
"public function comments()\n {\n $sort = Sorter::getCommentSortId();\n $orderField = $sort == 1 ? 'rate' : 'id';\n $orderDir = $sort == 1 ? 'desc' : 'asc';\n return $this->morphMany(Comment::class, 'commentable')->orderBy($orderField, $orderDir);\n }",
"public function getComments()\n\t{\n\n\t\treturn $this->comments;\n\t}",
"public function getID(): string {\n\t\treturn 'comments';\n\t}",
"public function findAll()\n {\n $sql = \"select * from comments order by created_at\";\n $result = $this->getDb()->fetchAll($sql);\n\n $entities = [];\n foreach ($result as $row)\n {\n $id = $row['id'];\n $entities[$id] = $this->buildDomainObject($row);\n }\n\n return $entities;\n }",
"public static function getAllIds(): array\n {\n $dao = Dao::getInstance();\n\n $query = \"\n SELECT\n id\n FROM\n help\n ORDER BY id\n \";\n\n $stmt = $dao->prepare($query);\n\n $stmt->execute();\n\n $rows = [];\n while ($row = $stmt->fetch()) {\n $rows[] = $row['id'];\n }\n return $rows;\n }",
"public static function getAllFromUser( string $id){\n $ids = CommentDatabase::getAllFromUser( $id);\n return array( \"status\" => \"OK\", \"lenght\" => count($ids), \"comments\" => $ids, \"version\" => \"v1\");\n }",
"public function getComments($post_id){\n\t\t$sql = 'SELECT user_name, date_creation, content, state, id FROM comment WHERE post_id=' . $post_id . \" AND state >= 2 ORDER BY id DESC\";\n\t\t$data = $this->db->query($sql);\n\t\treturn $data->fetchAll();\n\t}",
"public function getIdComment()\n {\n return $this->idComment;\n }",
"public function getIdComment()\n {\n return $this->idComment;\n }",
"public function getAllCommentsReport() {\n $req = $this->db->query('SELECT id, pseudo, content, date_publication, report, moderation\n FROM comment WHERE report = true ORDER BY date_publication DESC');\n $data = $req->fetchAll();\n return $data;\n }",
"public function getListOfIdOfAllCategories()\n {\n $sqlQuery = \"SELECT `id` FROM `categories` \";\n $queryResult = $this->dataBase->query($sqlQuery);\n $listOfIDofAllCategories = [];\n\n while($tableRow = $queryResult->fetch()) {\n $listOfIDofAllCategories[] = $tableRow[\"id\"];\n }\n\n return $listOfIDofAllCategories;\n }",
"public function getComments()\n {\n return $this->comments;\n }",
"public function getComments()\n {\n return $this->comments;\n }",
"public function getComments()\n {\n return $this->comments;\n }",
"public function getComments()\n {\n return $this->comments;\n }",
"function GetComments($f_id)\n\t{\n\t\t$sql_query = \"SELECT comments.*, members.nick_name, members.logo_file FROM `\".$this->sCommentTb.\"` AS comments LEFT JOIN `\".$GLOBALS['g_egltb_members'].\"` AS members ON comments.author_id=members.id HAVING comments.\".$this->sField.\"=\".(int)$f_id.\" ORDER BY comments.created DESC\";\n\t\treturn $this->pDBInterface->FetchArrayObject( $this->pDBInterface->Query( $sql_query ) );\n\t}",
"function fetchArticleComments()\r\n\t{\r\n\t\t$comments = array();\r\n\t\t$sql = $GLOBALS['db']->Query(\"SELECT * FROM \" . PREFIX . \"_modul_shop_artikel_kommentare WHERE Publik = '1' AND ArtId = '\" . (int)$_REQUEST['product_id'] . \"' ORDER BY Id DESC\");\r\n\t\twhile($row = $sql->fetchrow())\r\n\t\t{\r\n\t\t\t$sql_u = $GLOBALS['db']->Query(\"SELECT Vorname,Nachname FROM \" . PREFIX . \"_users WHERE Id = '$row->Benutzer'\");\r\n\t\t\t$row_u = $sql_u->fetchrow();\r\n\r\n\t\t\t$row->Titel = htmlspecialchars($row->Titel);\r\n\t\t\t$row->Kommentar = nl2br(htmlspecialchars($row->Kommentar));\r\n\t\t\t$row->Autor = substr($row_u->Vorname,0,1) . '. ' . $row_u->Nachname;\r\n\t\t\tarray_push($comments, $row);\r\n\t\t}\r\n\t\treturn $comments;\r\n\t}",
"public function allComments() {\n\t\treturn $this->hasMany('NGiraud\\News\\Models\\Comment');\n\t}",
"public function getCommentsList($id)\n {\n $this->criteriaBuilder->addFilters(\n [$this->filterBuilder->setField('parent_id')->setValue($id)->setConditionType('eq')->create()]\n );\n $searchCriteria = $this->criteriaBuilder->create();\n return $this->historyRepository->getList($searchCriteria);\n }",
"public function getCommentaries()\n {\n return $this->_commentaries;\n }",
"public static function findAll()\n\t{\n\t\t$sql = \"select *\n from comments\";\n\n\t\treturn $sql;\n\t}",
"public function getAllIds(){\n\n\t\t$qry=$this->db->select('id');\n\t\t$this->db->from('customers');\n\t\t$qry=$this->db->get();\n\t\t$count=$qry->num_rows();\n\t\t$result= $qry->result_array();\n\t\tfor($i=0;$i<$count;$i++){\n\t\t\t\t$values[$result[$i]['id']]=$result[$i]['id'];\n\t\t\t\t}\n\t\n\t\treturn $values;\n\t\n\t}",
"public static function getAllIds(): array\n {\n return ArrayHelper::getColumn(static::find()->select('id')->asArray()->all(), 'id');\n }"
]
| [
"0.85733443",
"0.6999186",
"0.69285643",
"0.68607545",
"0.6855777",
"0.6836141",
"0.6826206",
"0.6792847",
"0.6792847",
"0.6783863",
"0.6777115",
"0.6755023",
"0.67007565",
"0.6697878",
"0.6671763",
"0.6661315",
"0.66213787",
"0.6600265",
"0.65792626",
"0.6574627",
"0.65395564",
"0.65395564",
"0.65395564",
"0.65395564",
"0.65395564",
"0.65395564",
"0.65395564",
"0.65395564",
"0.65389305",
"0.65170413",
"0.6513064",
"0.6499611",
"0.64861757",
"0.6484576",
"0.6466755",
"0.6443436",
"0.64402837",
"0.64274144",
"0.6411221",
"0.6410158",
"0.6398983",
"0.6368308",
"0.6364211",
"0.63432604",
"0.6342744",
"0.6315062",
"0.63118976",
"0.6305233",
"0.62989527",
"0.62928414",
"0.62927353",
"0.6288356",
"0.6285554",
"0.6279381",
"0.62789667",
"0.62587374",
"0.6258079",
"0.6256734",
"0.62557954",
"0.62522525",
"0.6246822",
"0.6246822",
"0.62426347",
"0.6242616",
"0.62404597",
"0.62400067",
"0.6234347",
"0.62276757",
"0.62229747",
"0.6221533",
"0.6212053",
"0.61997235",
"0.6193603",
"0.61914295",
"0.6186141",
"0.6173414",
"0.6172501",
"0.61532134",
"0.6148679",
"0.6147587",
"0.6127318",
"0.61268985",
"0.6126328",
"0.6125939",
"0.6118829",
"0.6118829",
"0.61151725",
"0.61110103",
"0.61003596",
"0.61003596",
"0.61003596",
"0.61003596",
"0.60994977",
"0.60985506",
"0.6090696",
"0.60873175",
"0.60795105",
"0.6070688",
"0.6064535",
"0.6063867"
]
| 0.61293435 | 80 |
gets the comments made by a specific user | public static function getAllFromUser( string $id){
$ids = CommentDatabase::getAllFromUser( $id);
return array( "status" => "OK", "lenght" => count($ids), "comments" => $ids, "version" => "v1");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getUserComments($userId) {\n $result = $this->WIdb->select(\n \"SELECT * FROM `WI_comments` WHERE `posted_by` = :id\",\n array (\"id\" => $userId)\n );\n\n return $result;\n }",
"public function getUserComments($userId) {\n\n\t\t$sql = \"SELECT comment_id, comment_text FROM comments\n\t\t\t\t WHERE comment_author = ?\";\n\t\t$data = [$userId];\n\t\t//create stdStatemment object | call to Model method from core/Database.php\n\t\treturn $this->setStatement($sql,$data);\n\t}",
"public function retrieveUserComments($userId)\n {\n return $this->start()->uri(\"/api/user/comment\")\n ->urlSegment($userId)\n ->get()\n ->go();\n }",
"function getComments($userLog){\n\t\t\t$dbManager = dataBase\\DBManager::getInstance();\n\t\t\t$connection = $dbManager->getConnection();\n\t\t\t$query = $connection->query(\"SELECT driverUsername, passUsername, comment, score, commentID FROM drivercomments WHERE driverUsername = '$userLog' \");\n\t\t\t return $query;\n\t\t}",
"public function getUserComments(): array {\n $query = \"SELECT * \n FROM Comments \n WHERE toUserID = :userID OR fromUserID = :userID\";\n \n $stmt = $this->_db->prepare ( $query );\n $stmt->bindValue ( ':userID', $this->_userID );\n $stmt->execute ();\n $objects = [];\n while ( $row = $stmt->fetch ( PDO::FETCH_ASSOC ) ) {\n $comment = new Comment ( $this->_db );\n $comment->commentID = $row ['commentID'];\n $comment->get();\n $objects [] = $comment;\n }\n \n return $objects;\n }",
"public function getUsersWhoCommented()\n {\n $content_id = $this->content->id;\n $content_type = $this->content()->first()->getMorphClass();\n $user_id = $this->user->id;\n\n return $this\n ->where('content_id', $content_id)\n ->where('content_type', $content_type)\n ->where('user_id', '!=', $user_id)\n ->get()\n ->pluck('user')\n ->unique();\n }",
"public function getOneComment($id_user)\n {\n $req = $this->pdo->prepare('SELECT * FROM comments WHERE id_user= ? ORDER BY `date` DESC');\n $req->execute([$id_user]);\n\n return $req->fetchAll();\n }",
"function get_all_comments() {\n global $db;\n $query = \"SELECT c.comment_id, c.comment, c.user_id, c.created, u.userName FROM comments c\n JOIN users u on u.user_id = c.user_id\n ORDER BY created DESC\";\n $statement = $db->prepare($query);\n $statement->execute();\n $comments = $statement->fetchAll();\n $statement->closeCursor();\n return $comments; \n }",
"function user_get_comment_data($id = null)\n\t{\n\t\t$uid = ($id == null) ? $_SESSION['uid'] : $id;\n\t\t$comments = $this->DB->database_select('user_comments', '*', array('to_user' => $uid));\n\t\treturn $comments;\n\t}",
"public function searchAllCommById($id_user)\n {\n $req = $this->pdo->prepare('SELECT * FROM comments WHERE id_user= ? ORDER BY `date` DESC');\n $req->execute([$id_user]);\n return $req->fetchAll();\n }",
"public function getUserCommentsAttribute()\n {\n return $this->commentsByType('user')\n ->get();\n }",
"public function comments()\n {\n // check if user is already loaded, if not, we fetch it from database\n if ($this->_comments) {\n return $this->_comments;\n } else {\n $comments = new Application_Model_DbTable_Comments();\n\n foreach ($comments->findAllBy('post_id', $this->_id) as $comment) {\n $this->_comments[] = $comment ;\n }\n return $this->_comments;\n }\n }",
"public static function getComments(array $users, $limit = 5) {\n return self::getItems($users, $limit, 'comments');\n }",
"function GetComments($conn)\n\t{\n\t\t// get comments from sql\n\t\t$sql = \"SELECT * FROM comments\";\n\n\t\t// query the database\n\t\t$result = $conn->query($sql);\n\n\t\t// fetch the comments as an array\n\t\twhile ($row = $result->fetch_assoc())\n\t\t{\n\t\t\t// get comments from database that have correct user tag\n\t\t\t$userId = $row['uid'];\n\t\t\t$userSql = \"SELECT * FROM users WHERE idUsers='$userId'\";\n\t\t\t$userResult = $conn->query($userSql);\n\n\t\t\t// get all comments with user tags\n\t\t\tif ($userRow = $userResult->fetch_assoc())\n\t\t\t{\n\t\t\t\t// display user, date and message of the comments\n\t\t\t\techo \"<div class='comment-box'>\n\t\t\t\t\t\t<p style='font-weight:bold; font-size:18px;'>\".$userRow['uidUsers'].\"</p>\n\t\t\t\t\t\t<p style='font-size:12px; margin-top:-10px; color:#6e6e6e;'>\".$row['date'].\"</p>\n\t\t\t\t\t\t<p style='margin-bottom:0px;'>\".nl2br($row['message']).\"</p>\";\n\n\t\t\t\t// if the user is logged in\n\t\t\t\tif (isset($_SESSION['userId']))\n\t\t\t\t{\n\t\t\t\t\t// check if the user matches a comment\n\t\t\t\t\tif ($_SESSION['userId'] == $userRow['idUsers'])\n\t\t\t\t\t{\n\t\t\t\t\t\t// display the buttons for editing and deleting comments\n\t\t\t\t\t\techo \"<form class='comment-box-editform' method='POST' action='comment-edit.php'>\n\t\t\t\t\t\t\t\t\t<input type='hidden' name='cid' value='\".$row['cid'].\"'>\n\t\t\t\t\t\t\t\t\t<input type='hidden' name='uid' value='\".$row['uid'].\"'>\n\t\t\t\t\t\t\t\t\t<input type='hidden' name='date' value='\".$row['date'].\"'>\n\t\t\t\t\t\t\t\t\t<input type='hidden' name='message' value='\".$row['message'].\"'>\n\t\t\t\t\t\t\t\t\t<button>EDIT</button>\n\t\t\t\t\t\t\t\t</form>\n\n\t\t\t\t\t\t\t\t<form class='comment-box-deleteform' method='POST' action='\".DeleteComments($conn).\"'>\n\t\t\t\t\t\t\t\t\t<input type='hidden' name='cid' value='\".$row['cid'].\"'>\n\t\t\t\t\t\t\t\t\t<button type='submit' name='commentDelete'>DELETE</button>\n\t\t\t\t\t\t\t\t</form>\";\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t// close the comment section of html\n\t\t\t\techo \"</div>\";\n\t\t\t}\n\t\t}\n\t}",
"function show_user_comment() {\n $comment = get_user_comment();\n if ($comments = mysqli_fetch_array($comment)) {\n $com = $comments['comment'];\n return $com;\n }\n }",
"public function get_comments($user_id=0, $page = 0)\r\n {\r\n $max_comments = 10;\r\n $max_reply = 3;\r\n $start_reply = $page * $max_reply;\r\n\r\n if ($page==1) {\r\n $start_comment = 0;\r\n } else {\r\n $start_comment = ($page-1)*$max_comments;\r\n }\r\n\r\n global $wpdb;\r\n /* get user by id and extract email */\r\n $ID = $user_id ? $user_id : $this->ID;;\r\n /* get all the comments combined with replies on the forums/meetings */\r\n\r\n /*comments table*/\r\n $commentstable = $wpdb->prefix.'comments';\r\n /* comments sql */\r\n $csql = \"SELECT * FROM `$commentstable` WHERE `user_id` = '$ID' ORDER BY `comment_date` DESC LIMIT $start_comment, $max_comments\";\r\n\r\n /* replies table */\r\n //$replytable = $wpdb->prefix.'posts';\r\n /* reply sql */\r\n //$rsql = \"SELECT * FROM `$replytable` WHERE `post_type`='reply' AND `post_author` = '$ID' ORDER BY `post_date` DESC LIMIT $start_reply, $max_reply\";\r\n\r\n //echo $csql;\r\n\r\n /* chat with user / profile member */\r\n $comments = $wpdb->get_results($csql);\r\n //$replies = $wpdb->get_results($rsql);\r\n\r\n //$total = array_merge( $comments , $replies);\r\n $total = $comments;\r\n\r\n foreach ($total as $key => $comment) {\r\n\r\n /* comments */\r\n if($comment->comment_ID > 0) :\r\n\r\n $content = $comment->comment_content;\r\n $post_comment = get_post($comment->comment_post_ID);\r\n $postTitle = $post_comment->post_title;\r\n $category = get_the_category( $post_comment->ID );\r\n $permalink = get_the_permalink($comment->comment_post_ID);\r\n\r\n $author = new user_info($post_comment->post_author);\r\n $profile = $author->get_profile_link($author->ID);\r\n $date = $comment->comment_date;\r\n \r\n $post_type = get_post_type_object( get_post_type($post_comment->ID) );\r\n $post_content = $post_comment->post_content;\r\n $categoryName = !empty($category[0]->name)?$category[0]->name:$post_type->labels->name;\r\n \r\n /* replies */\r\n else :\r\n\r\n $content = $comment->post_content;\r\n $post_comment = get_post($comment->post_parent);\r\n $postTitle = $post_comment->post_title;\r\n $permalink = get_the_permalink($comment->post_parent);\r\n\r\n $author = new user_info($post_comment->post_author);\r\n $profile = $author->get_profile_link($author->ID);\r\n $date = $comment->post_date;\r\n\r\n $post_content = $post_comment->post_content;\r\n \r\n $category = get_post_custom( $comment->ID );\r\n $parent = get_post($category['_bbp_forum_id'][0]);\r\n $ttl = get_the_title($parent->post_parent);\r\n $parent_title = !empty($ttl)?get_the_title($parent->post_parent).' <i class=\"fa fa-angle-right\"></i> ':'';\r\n $categoryName = get_post($post_comment->post_parent);\r\n $categoryName = $parent_title.$categoryName->post_title;\r\n endif;\r\n\r\n /* normalize data */\r\n $comments_[] = array(\r\n 'permalink' => $permalink,\r\n 'title'=> $postTitle,\r\n 'comment'=> $content,\r\n 'content'=> strip_tags($post_content),\r\n 'name' => $author->name,\r\n 'profile' => $profile,\r\n 'date' => $date,\r\n 'category' =>$categoryName\r\n );\r\n }\r\n\r\n /* custom sorter */\r\n if(is_array($comments_)) :\r\n usort($comments_, function($a, $b) {\r\n $ad = new DateTime($a['date']);\r\n $bd = new DateTime($b['date']);\r\n if ($ad == $bd) {\r\n return 0;\r\n }\r\n return $ad < $bd ? 1 : -1;\r\n });\r\n\r\n return $comments_;\r\n endif;\r\n }",
"public function getAllComments()\n\t{\n\t\t$req=$this->_bdd->query('SELECT Comments.id, content_com AS content, DATE_FORMAT(date_com, \"%d/%m/%Y %Hh%imin%ss\") AS date, id_users, id_post, moderate, login FROM Comments INNER JOIN Users ON id_users=Users.id WHERE moderate >0 ORDER BY moderate DESC');\n\t\t\n\t\t$comments=[];\n\t\twhile($datas=$req->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t\n\t\t\t\t $comments[]=new Comments($datas);\n\t\t\t\t //return $comments;\n\t\t\t\n\t\t\t\n\t\t}\n\t\treturn $comments;\n\t}",
"public function getUserPostComment($user_id)\n {\n return Comment::find()->with('user')->with('post')->where(['user_id' => $user_id,'status' => '1','parent_comment_id'=>'0'])->orderBy(['created_date'=>SORT_DESC])->all();\n \n }",
"public function getCommentaireByUser($idUser)\n {\n $query = 'SELECT ' . $this->formatFieldsToSelect()\n . ' FROM ' . $this->base_table\n\t\t\t.' where user_com='.$idUser\n\t\t\t. ' order by date desc';\n \n $statement = Db::getInstance()->query($query);\n return $statement->fetchAll(PDO::FETCH_CLASS,get_called_class());\n }",
"function getComment() {\n\tglobal $db;\n\t\n\t$query = \"SELECT idComment, content, photo, date, Comment.idUser, idEvent, parentComment, firstName AS userFirstName, lastName AS userLastName FROM Comment,User WHERE User.idUser = Comment.idUser\";\n\t\n\tif (isset($_GET['idComment']))\n\t\t$query .= \" AND idComment = \" . $_GET['idComment'];\n\tif (isset($_GET['idUser']))\n\t\t$query .= \" AND idUser = \" . $_GET['idUser'];\n\tif (isset($_GET['idEvent']))\n\t\t$query .= \" AND idEvent = \" . $_GET['idEvent'];\n\tif (isset($_GET['parentComment']))\n\t\t$query .= \" AND parentComment = \" . $_GET['parentComment'];\n\t\t\t\t\n\t$stmt = $db->prepare($query);\n\t$stmt->execute(); \n\t$comments = $stmt->fetchAll();\n\t\n\t\n\t\n\t/* Content-Type must be defined, otherwise the output is seen as plain text */\n\theader(\"Content-Type: application/json\");\n\techo json_encode($comments);\n}",
"function get_user_comment()\n {\n global $conn;\n $user_id = $_GET['id'];\n $get_comment = \"SELECT * FROM comments WHERE userID = '$user_id' ORDER BY created_at DESC LIMIT 1\";\n $query_db = mysqli_query($conn, $get_comment);\n return $query_db;\n }",
"public function getCommentators()\n {\n return $users = User::select('users.*')\n ->distinct()\n ->join('comments', 'comments.user_id', '=', 'users.id')\n ->where('comments.image_id', $this->id)\n ->get();\n }",
"public function getAllComments($rid) {\n $this->db->query('SELECT comments.*, users.user_username FROM comments JOIN users ON ownerid=user_id \n WHERE recipe_id = :rid ORDER BY date DESC');\n $this->db->bind(':rid', $rid);\n return $this->db->resultSet();\n }",
"public static function getCommentsForDisplay($user_id){\n\t\t\n\t\tglobal $db; \n\t\t\n\t\t//set query\n\t\t$query_text = \"SELECT general_remarks, ranking_person_id FROM rankings\n\t\tWHERE ranked_person_id = :user_id\"; \n\t\t\n\t\ttry {\n\t\t\t//prepare query\t\t\n\t\t\t$query_statement = $db->prepare($query_text);\n\t\t\t//bind\n\t\t\t$query_statement->bindValue(':user_id', $user_id); \n\t\t\t//execute query\n\t\t\t$query_statement->execute();\n\t\t\t$num_rows = $query_statement->rowCount();\n\t\t\t\n\t\t\t$index = 0; \n\t\t\t\t\t\n\t\t\tfor ($i=0; $i<$num_rows; $i++){\n\t\t\t\t//fetch results\n\t\t\t\t$temp = $query_statement->fetch(PDO::FETCH_ASSOC);\n\t\t\t\t//enter relevant data only\n\t\t\t\tif ($temp['general_remarks'] != null){\n\t\t\t\t\t$toReturn[$index] = array('id' => $temp['ranking_person_id'],\n\t\t\t\t\t'text' => $temp['general_remarks']);\n\t\t\t\t\t$index++;\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t//no comments to display\n\t\t\tif ($index == 0){\n\t\t\t\t$toReturn = array('comments' => array()); \n\t\t\t\treturn $toReturn; \n\t\t\t}\n\t\t\t\n\t\t\t$final = getDataFromDB::processList($toReturn);\n\t\t\t//check for errors\n\t\t\tif (key($final) == 'error_message'){\n\t\t\t\treturn $final; \n\t\t\t}\n\t\t\telse {\n\t\t\t\t$toReturnFinal = array('comments' => $final['list']); \n\t\t\t\treturn $toReturnFinal; \n\t\t\t}\n\t\t\t\n\t\t}\n\t\t\n\t\tcatch (PDOException $ex) {\n\t\t\t$error_message = $ex->getMessage();\n\t\t\t$result = array('error_message' => $error_message);\n\t\t\treturn $result;\n\t\t}\n\t}",
"function getCommentsByUsername($driverUsername){\n\t\t\t$dbManager = dataBase\\DBManager::getInstance();\n\t\t\t$connection = $dbManager->getConnection();\n\t\t\t$query = $connection->query(\"SELECT comment, passUsername FROM drivercomments WHERE driverUsername = '$driverUsername' \");\n\t\t\t return $query;\n\t\t}",
"public function get_workshop_comments($userid) {\n global $remotedb;\n // Group submissions.\n $sql = \"SELECT wg.peercomment\n FROM {worshop_grades} wg\n LEFT JOIN {workshop_submissions} su ON wg.assessmentid = su.id and su.authorid=?\";\n $params = array($userid);\n $comments = $remotedb->get_recordset_sql($sql, $params, $limitfrom = 0, $limitnum = 0);\n $out = array();\n foreach ($comments as $comment) {\n $out[] = $comment->peercomment;\n }\n $br = html_writer::empty_tag('br');\n return implode($br, $out);\n }",
"public function getAllCurrentUserComments($fileName){\n global $website_url;\n\n $username = $this->user->getSessionUserName();\n $avatar = $this->user->getSessionUserAvatar(['32']);\n\n $query = $this->handler->prepare('SELECT * FROM comments WHERE v_id = (SELECT v_id FROM videos WHERE v_fileName = :v_fileName) AND u_id = :u_id ORDER BY c_date DESC');\n $query->execute([\n ':v_fileName' => $fileName,\n 'u_id' => $this->user->getUserId()\n ]);\n \n if($query->rowCount()){\n while($fetch = $query->fetch(PDO::FETCH_ASSOC)){\n echo <<<EOD\n <a href=\"$website_url/channel/$username\">$avatar</a>\n <a href=\"$website_url/channel/$username\">$username</a>\n <small>$fetch[c_date]</small><br />\n <small>$fetch[comment]</small><hr />\n EOD;\n }\n }\n }",
"public static function get_comments_save($id_user_mod) {\n\t\t$comments = CommentsSaveQModel::get_comments_save_by_user_id($id_user_mod);\n\t\t// dd($comments);\n\t\tforeach ($comments as $comment) {\n\t\t\t\n\t\t\tif ($comment->page == 'book') {\n\t\t\t\t$book = BooksQModel::get_book_by_id($comment->id_page);\n\t\t\t\t$comment->page_name = $book->name;\n\t\t\t} else if ($comment->page == 'character') {\n\t\t\t\t$character = CharactersQModel::get_character_by_id($comment->id_page);\n\t\t\t\t$comment->page_name = $character->name;\n\t\t\t} else if ($comment->page == 'author') {\n\t\t\t\t$author = AuthorsQModel::get_author_by_id($comment->id_page);\n\t\t\t\t$comment->page_name = $author->name;\n\t\t\t} else if ($comment->page == 'trans') {\n\t\t\t\t$trans = TransQModel::get_trans_by_id($comment->id_page);\n\t\t\t\t$comment->page_name = $trans->name;\n\t\t\t} else if ($comment->page == 'user') {\n\t\t\t\t$user = UsersQModel::get_user_by_id($comment->id_page);\n\t\t\t\t$comment->page_name = $user->name;\n\t\t\t} else if ($comment->page == 'read') {\n\t\t\t\t$chap = ChapsQModel::get_chap_by_id($comment->id_page);\n\t\t\t\t$comment->page_name = $chap->book_name.' '.$chap->name;\n\t\t\t}\n\t\t}\n\t\treturn $comments;\n\t}",
"function requestComments() {\n $username = $_GET['username'];\n \n $response = retrieveComments($username);\n\n if ($response['status'] == 'SUCCESS') {\n echo json_encode($response['response']);\n } else {\n errorHandler($response['status'], $response['code']);\n }\n }",
"public function getAllComments() {\r\n \r\n $commentEntries = array();\r\n\r\n $sql = \"SELECT *\r\n FROM RecipeComments\r\n WHERE page = '$this->page'\r\n ORDER BY timestamp\"; \r\n \r\n $result = $this->conn->query($sql);\r\n \r\n $rows = $result->num_rows;\r\n \r\n for($i=1; $i<=$rows; $i++) {\r\n $row = $result->fetch_assoc();\r\n array_push($commentEntries, $row[\"username\"]);\r\n array_push($commentEntries, $row[\"comment\"]);\r\n array_push($commentEntries, $row[\"timestamp\"]);\r\n \r\n }\r\n\r\n return $commentEntries;\r\n \r\n }",
"public function index()\n {\n return Comment::with('user')->get();\n }",
"public function getCommentByUser(array $users)\n {\n $builder = $this->getEntityManager()->getRepository('AppBundle:Comment')\n ->createQueryBuilder('c');\n\n return $builder\n ->select('c.text, u.id, u.username, u.firstName, u.lastName, c.createAt')\n ->join('AppBundle:User', 'u', 'WITH', 'c.user = u.id')\n ->where($builder->expr()->in('c.user', ':users'))\n ->setParameter('users', $users)\n ->orderBy('c.createAt', 'DESC')\n ->getQuery()\n ->getArrayResult();\n }",
"public function getAllComment()\n {\n return Comment::find()->with('user')->orderBy(['created_date'=>SORT_DESC])->all();\n \n }",
"function get_comments($post_id){\n include('../../common/database/config.php');\n\n $sql = 'SELECT c.id,c.content,c.created_time,u.name FROM comments as c \n LEFT JOIN users as u on c.user_id = u.id\n where c.post_id = \"'.$post_id.'\"';\n $res = mysqli_query($conn,$sql);\n\n $res_array = mysqli_fetch_all($res, MYSQLI_ASSOC);\n\n return $res_array;\n}",
"function get_comment_author($comment_id = 0)\n {\n }",
"public function getComments($post_id){\n\t\t$sql = 'SELECT user_name, date_creation, content, state, id FROM comment WHERE post_id=' . $post_id . \" AND state >= 2 ORDER BY id DESC\";\n\t\t$data = $this->db->query($sql);\n\t\treturn $data->fetchAll();\n\t}",
"public function searchAllCommByUser($pseudo)\n {\n $instanceUsers = new Users();\n $user = $instanceUsers->getOneUser($pseudo);\n $id_user = $user['id_user'];\n $req = $this->pdo->prepare('SELECT * FROM comments WHERE id_user = ? ORDER BY `date` DESC');\n $req->execute([$id_user]);\n return $req->fetchAll();\n }",
"public function getComments()\n {\n return $this->hasMany(Comment::class, ['created_by' => 'id']);\n }",
"public function getComments ()\n {\n $db = $this->dbConnect ();\n $req = $db->prepare ('SELECT id_comment,signalement,id_chapter,author,comment,DATE_FORMAT(dateComment, \\'%d/%m/%Y \\') AS dateComment FROM comments WHERE ? ORDER BY id_comment DESC ');\n $req->execute (array ( 1 ));\n return $req;\n }",
"public function find_comments($page_num, $page_size = 25, $user = null) {\n\t\t$user = self::find_user($user);\n\n\t\t// Try to fetch from cache first\n\t\t/*\n\t\t$cache_key = $this->cache->key('comments', $this->id, $page_num);\n\t\tif ($page_num <= User_Comment_Model::$cache_max_pages) {\n\t\t\t$comments = $this->cache->get($cache_key);\n\t\t}\n\n\t\t// Did we find any comments?\n\t\tif (!empty($comments)) {\n\n\t\t\t// Found from cache\n\t\t\t$comments = unserialize($comments);\n\n\t\t} else {\n\t\t*/\n\n\t\t\t// Not found from cache, load from DB\n\t\t\t$page_offset = ($page_num - 1) * $page_size;\n\t\t\tif ($user && $user->id == $this->id) {\n\n\t\t\t\t// All comments, my profile\n\t\t\t\t$comments = $this->user_comments->find_all($page_size, $page_offset);\n\n\t\t\t} else if ($user) {\n\n\t\t\t\t// Public and my comments\n\t\t\t\t$comments = $this->user_comments->and_open()->where('private', '=', 0)->or_where('author_id', '=', $user->id)->close()->find_all($page_size, $page_offset);\n\n\t\t\t} else {\n\n\t\t\t\t// Only public comments\n\t\t\t\t$comments = $this->user_comments->where('private', '=', 0)->find_all($page_size, $page_offset);\n\n\t\t\t}\n\n\t\t\t/*\n\t\t\t// cache only 3 first pages\n\t\t\tif ($page_num <= User_Comment_Model::$cache_max_pages) {\n\t\t\t\t$this->cache->set($cache_key, serialize($comments->as_array()), null, User_Comment_Model::$cache_max_age);\n\t\t\t}\n\t\t}\n\t\t\t*/\n\n\t\treturn $comments;\n\t}",
"public function userPostComments()\n {\n // $comments = Auth('user')->user()->comments;\n $comments = Auth::user()->comments;\n return view('frontend.user.comments', compact('comments'));\n }",
"public function getAllComments() {\n\n\t\t$sql = \"SELECT comment_id, comment_text, entries.post_title, users.user_name FROM comments\n\t\t\t\tINNER JOIN entries ON comments.post_id = entries.post_id \n\t\t\t\tINNER JOIN users ON users.user_id = comments.comment_author\";\n\t\t//create stdStatemment object | call to Model method from core/Database.php\n\t\treturn $this->setStatement($sql);\n\t}",
"public function getComments($photo_uid) {\r\n\t\t$comments = tx_cwtcommunity_lib_common::dbQuery('SELECT c.uid, c.crdate, c.cruser_id, c.text, u.username, u.tx_cwtcommunityuser_image AS image FROM tx_cwtcommunity_photo_comments c, fe_users u WHERE c.cruser_id = u.uid AND photo_uid = \"'.intval($photo_uid).'\" AND NOT c.deleted = \"1\" AND NOT c.hidden = 1 ORDER BY c.crdate DESC;');\r\n\t\treturn $comments;\r\n\t}",
"function get_post_comments($post_id)\n{\n $select_query = 'SELECT c.*, u.username\n FROM '.TBL_COMMENTS.' c\n JOIN '.TBL_USERS.' u\n ON u.`user_id` = c.`user_id`\n WHERE c.`post_id`='.(int)$post_id.'\n ORDER BY c.`created_ts` ASC';\n\n $comments = array();\n $results = mysql_query($select_query);\n while($row = mysql_fetch_assoc($results))\n {\n $comments[] = $row;\n }\n\n return $comments;\n}",
"public function getComments() {}",
"public function byuserAction()\n\t{\n\t\t$username = $this->_getParam('id');\n\t\t$this->view->username = $username;\n\t\t$this->view->comments = $this->_commentMapper->findByUser($username);\n\t\t$this->render('byuser');\n\t}",
"public function getAllCommentsByBattleID($battle_id) {\n $stmt = $this->db->query(\"SELECT *\n FROM comments\n INNER JOIN users\n ON comments.userid = users.userid\n WHERE battle_id = :id\");\n\n $stmt->bindParam(':id', $battle_id);\n $stmt->execute();\n $rows = array();\n while($row = $stmt->fetch()) {\n $rows[] = $row;\n }\n return $rows;\n\n }",
"public function readCommentCustomer(){\n $sql='SELECT idComentario, comentario, producto.nombre as producto,cliente.nombre as cliente, comentarios.estado as estado, cliente.usuario as usuario FROM cliente, producto, comentarios where producto.idProducto=comentarios.idProducto and cliente.idCliente=comentarios.idCliente and comentarios.idProducto=? and comentarios.estado = 1';\n $params=array($this->id);\n return Database::getRows($sql, $params);\n\n }",
"public function adminComment () {\n\t\t$req = $this->db->query('SELECT * , DATE_FORMAT(comment_date, \\'%d/%m/%Y à %Hh%imin%ss\\') AS commentDate FROM comment');\n\t\twhile ($data = $req->fetch())\n {\n \t$comments[]= new Comment($data); \n }\n if(isset($comments)){\n \treturn $comments;\n }\n\t \n\t}",
"public function comments()\n {\n return $this->hasMany(ExampleComment::class, 'from_user');\n }",
"function showComments()\n\t{\n $qry = mysql_query(\"SELECT * FROM `comments` \n WHERE '\" . $this->ytcode .\"' = `youtubecode`\n ORDER BY upload_date DESC\n LIMIT 0,4 \");//DEFAULT: Comments shown=3\n if (!$qry)\n die(\"FAIL: \" . mysql_error());\n\n $html = '';\n while($row = mysql_fetch_array($qry))\n {\n \n $com_user=$row['com_user'];\n $com_user = str_replace('\\\\','',$com_user);\n $comment_dis=$row['com_dis'];\n $comment_dis = str_replace('\\\\', '', $comment_dis);\n $date = new DateTime($row['upload_date']);\n\n $html .= '<p class=\"comment-p\">\n <span class=\"userName\">' . $com_user . '</span>\n <span class=\"divider\">//</span>\n <time datetime=\"' . $date->format('Y-m-d') .'\">'.\n $date->format('d/m/y g:i a')\n .'</time> : '. $comment_dis .'\n </p>'; \n }\n \n return $html;\n\t}",
"public function getCommentsAdmin($post_id){\n\t\t$sql = 'SELECT user_name, date_creation, content, state, id FROM comment WHERE post_id=' . $post_id . \" AND state <= 1 ORDER BY id DESC\";\n\t\t$data = $this->db->query($sql);\n\t\treturn $data->fetchAll();\n\t}",
"public function getComments()\n {\n return $this->api->_request('GET', '/api/comments?id='.$this->ID);\n }",
"function getComments($linkid,$user=0,$page=1,$limit=25) {\n\t$linkid = intval($linkid);\n\t$user = intval($user);\n\t$page = intval($page);\n\t$limit = intval($limit);\n\t\n\t$_SESSION[id] = intval($_SESSION[id]);\t\n\tif($linkid != 0) { $where = \"WHERE c.linkid=$linkid\"; }\n\t\t\n\telseif($user != 0) { // User page comments listing\n\t\t$where = \"WHERE c.userid=$user AND c.deleted!=1 \"; // No deleted comments!\n\t\t$linktitle = \", l.title AS title, l.category\"; \t\t// Include the link\n\t\t$linkjoin = \"LEFT JOIN links AS l ON l.id=c.linkid\";\t// title and category\n\t\tif($page > 0) { $page--; }\n\t\t$offset=($page*$limit); // Pagination doesn't work for our comment tree, so we only use it on the user page\n\t\t$qlimit = \"LIMIT $offset,$limit\";\n\t}\n\t\n\tif($_SESSION[id] != 0) { // Include the logged in user's vote in the query\n\t\t$myvote = \", IFNULL(v.vote,0) AS myvote\";\n\t\t$myvotejoin = \"LEFT JOIN votes AS v ON c.id=v.subjectid AND v.type='comment' AND v.userid=$_SESSION[id]\";\n\t}\n\t\n\t$query = \"SELECT c.*,u.username,IFNULL(t.points,0) AS points $myvote $linktitle\n \t FROM comments AS c \n\t JOIN users AS u ON u.id=c.userid \n\t LEFT JOIN totalvotes AS t ON c.id=t.subjectid AND t.type='comment' $myvotejoin\n\t $linkjoin\n\t\t $where ORDER BY time DESC $qlimit\";\n\t\n\tif($user != 0) {\t\n\t\t$totalrows = dbRowCount(\"SELECT * FROM comments AS c $where\");\n\t\tif($totalrows > $limit) { $page = $page+1; }\n\t\telse { $page = 0; }\n\t\t$totalpages = ceil($totalrows / $limit);\n\t}\n\telse { $page=NULL; $totalpages = NULL; } // No pagination for comment trees\n\t\t\n\treturn(array(dbResultArray($query), \"page\" => $page, \"totalpages\" => $totalpages));\n}",
"public function getComments()\n {\n $id = $this->getId();\n\n $stmt = \" SELECT c.*, c.id as id, u.username, u.profile_picture FROM _xyz_article_comment_pivot acp \" .\n \" LEFT JOIN _xyz_comment c ON c.id = acp.comment_id \" .\n \" LEFT JOIN _xyz_user u ON u.id = c.user_id \" .\n \" WHERE acp.article_id = $id \"\n ;\n\n $sql = DB::instance()->query( $stmt );\n\n $rows = $sql->fetchAll(\\PDO::FETCH_UNIQUE|\\PDO::FETCH_ASSOC );\n\n $result = CommentCollection::toTree( $rows );\n\n return $result;\n }",
"public function ListComments($id) {\n try {\n \n\t //$res = $this->db->ExecuteSelectQueryAndFetchAll(\"SELECT Comment.*, User.acronym as owner FROM Comment INNER JOIN User ON Comment.idUser=User.id WHERE idContent=? AND Comment.deleted IS NULL;\", array($id));\n\t $res = $this->db->ExecuteSelectQueryAndFetchAll(self::SQL('select * by content'), array($id));\n\t print_r($id);\n\t print_r($res);\n\t return $res;\n } catch(Exception $e) {\n\t\techo $e;\n\t\treturn null;\n }\n }",
"public function showUsersComments($userId)\n {\n $user = User::findOrFail($userId);\n $comments = $user->commentsWithFullArticlesTitles();\n \n return view('pages.userscomments')\n ->with(['comments' => $comments, 'userId' => $userId, 'userName' => $user->name, 'action' => 'showComments']);\n }",
"public function getComments($idPost)\n\t{\n\t\t$req=$this->_bdd->query('SELECT Comments.id, content_com AS content, DATE_FORMAT(date_com, \"%d/%m/%Y %Hh%imin%ss\") AS date, id_users AS idUser, id_post AS idPost, moderate, login FROM Comments INNER JOIN Users ON id_users=Users.id WHERE id_post='.$idPost);\n\n\t\t$comments=[];\n\t\n\t\twhile($datas=$req->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\t\n\t\t\t\t\t$comments[]=new Comments($datas);\t\t\n\t\t\t}\n\t\treturn $comments;\n\t\t\t\t\n\t}",
"public function showCommentOfUserAction()\n {\n $params = $this->getRequest()->getParams();\n //Get users blocked and users who have blocked logged in user.\n $blocked_user = \\Extended\\blocked_users::getAllBlockersAndBlockedUsers(Auth_UserAdapter::getIdentity()->getId());\n \n $comments_obj = \\Extended\\comments::getRowObject( $params['comment_id'] );\n \n if($blocked_user)\n {\n \t$comment_user_photo_detail = \\Extended\\comments::getUsersPhotoForComment($comments_obj->getCommentsIlook_user()->getId(), $blocked_user);\n }\n else\n {\n \t$comment_user_photo_detail['photo_path'] = \\Helper_common::getUserProfessionalPhoto($comments_obj->getCommentsIlook_user()->getId(), 3);\n \t$comment_user_photo_detail['is_photo_clickable'] = true;\n }\n if( $comments_obj->getCommentsIlook_user()->getAccount_closed_on())\n {\n \t$comment_user_photo_detail['photo_path'] = \\Helper_common::getUserProfessionalPhoto($comments_obj->getCommentsIlook_user()->getId(), 3);\n \t$comment_user_photo_detail['is_photo_clickable'] = false;\n }\n $ret_r = array();\n $ret_r['comm_id'] = $params['comment_id'];\n $ret_r['comm_text'] = $comments_obj->getComment_text();\n $ret_r['same_comm_id'] = $comments_obj->getSame_comment_id();\n $ret_r['commenter_id'] = $comments_obj->getCommentsIlook_user()->getId();\n $ret_r['commenter_fname'] = $comments_obj->getCommentsIlook_user()->getFirstname();\n $ret_r['commenter_lname'] = $comments_obj->getCommentsIlook_user()->getLastname();\n $ret_r['commenter_small_image'] = $comment_user_photo_detail['photo_path'];\n $ret_r['is_user_photo_clickable'] = $comment_user_photo_detail['is_photo_clickable'];\n $ret_r['wp_id'] = $comments_obj->getId();\n $ret_r['created_at'] = Helper_common::nicetime( $comments_obj->getCreated_at()->format( \"Y-m-d H:i:s\" ));\n echo Zend_Json::encode($ret_r);\n die;\n }",
"protected function getComments()\n\t{\n\t\t$options = new JRegistry;\n\n\t\t// Ask if the user wishes to authenticate to GitHub. Advantage is increased rate limit to the API.\n\t\t$this->out('Do you wish to authenticate to GitHub? [y]es / [n]o :', false);\n\n\t\t$resp = trim($this->in());\n\n\t\tif ($resp == 'y' || $resp == 'yes')\n\t\t{\n\t\t\t// Get the username\n\t\t\t$this->out('Enter your GitHub username :', false);\n\t\t\t$username = trim($this->in());\n\n\t\t\t// Get the password\n\t\t\t$this->out('Enter your GitHub password :', false);\n\t\t\t$password = trim($this->in());\n\n\t\t\t// Set the options\n\t\t\t$options->set('api.username', $username);\n\t\t\t$options->set('api.password', $password);\n\t\t}\n\n\t\t// Instantiate JGithub\n\t\t$this->github = new JGithub($options);\n\n\t\ttry\n\t\t{\n\t\t\tforeach ($this->issues as $issue)\n\t\t\t{\n\t\t\t\t$id = $issue->gh_id;\n\t\t\t\t$this->out('Retrieving comments for issue #' . $id . ' from GitHub.', true);\n\n\t\t\t\t$this->comments[$id] = $this->github->issues->getComments('joomla', 'joomla-cms', $id);\n\t\t\t}\n\t\t}\n\t\t// Catch any DomainExceptions and close the script\n\t\tcatch (DomainException $e)\n\t\t{\n\t\t\t$this->out('Error ' . $e->getCode() . ' - ' . $e->getMessage(), true);\n\t\t\t$this->close();\n\t\t}\n\n\t\t// Retrieved items, report status\n\t\t$this->out('Finished retrieving comments for all issues.', true);\n\t}",
"function get_comments(){\n\n\t}",
"function getUser($userid=0) {\n\t$userid = intval($userid);\n\tif($userid != 0) { $where = \"WHERE users.id=$userid\"; }\n\t$query = \"\n\t\tSELECT users.id, username, IFNULL(c.count,0) AS comments, IFNULL(l.count,0) AS links, p.points, registered FROM users \n\t\tLEFT JOIN (\n\t\t\tSELECT userid, COUNT(*) AS count from comments WHERE deleted!=1 GROUP BY userid\n\t\t) \n\t\tAS c ON users.id=c.userid LEFT JOIN (\n\t\t\tSELECT user, COUNT(*) AS count FROM links GROUP BY user\n\t\t) \n\t\tAS l ON users.id=l.user\tLEFT JOIN (\n\t\t\tSELECT l.id, (IFNULL(IFNULL(l.links,0)+IFNULL(c.comments,0),0)) AS points \n\t\t\tFROM (\n\t\t\t\tSELECT users.id AS id, sum(v.vote) as links FROM users \n\t\t\t\tLEFT JOIN links ON links.user=users.id \n\t\t\t\tLEFT JOIN votes as v ON v.subjectid=links.id AND v.type='link' GROUP BY id\n\t\t\t) \n\t\t\tas l JOIN (\n\t\t\t\tSELECT users.id AS id, sum(v.vote) as comments FROM users \n\t\t\t\tLEFT JOIN comments ON comments.userid=users.id \n\t\t\t\tLEFT JOIN votes as v ON v.subjectid=comments.id AND v.type='comment' GROUP BY id\n\t\t\t) \n\t\t\tas c ON l.id=c.id\n\t\t) \n\t\tAS p ON p.id=users.id $where ORDER BY links DESC, comments DESC LIMIT 5\";\n\tif($userid == 0) { return(dbResultArray($query)); }\n\treturn(dbFirstResultAssoc($query));\n}",
"public function getAnswerComments($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(UserPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collAnswerComments === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collAnswerComments = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(AnswerCommentPeer::USER_ID, $this->id);\n\n\t\t\t\tAnswerCommentPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collAnswerComments = AnswerCommentPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(AnswerCommentPeer::USER_ID, $this->id);\n\n\t\t\t\tAnswerCommentPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastAnswerCommentCriteria) || !$this->lastAnswerCommentCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collAnswerComments = AnswerCommentPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastAnswerCommentCriteria = $criteria;\n\t\treturn $this->collAnswerComments;\n\t}",
"public function getAllComments()\n {\n $req = $this->pdo->prepare('SELECT * FROM comments ORDER BY `date` DESC');\n $req->execute();\n\n return $req->fetchAll();\n }",
"public function comments() {\n return $this->hasMany('\\Veer\\Models\\Comment', 'users_id');\n }",
"function getComments()\n {\n\t//Check for 'pid' parameter in URL\n\tif(array_key_exists(\"pid\", $_GET))\n\t{\n\t\t$ideaID = $_GET[\"pid\"];\n\t\t$comments = mysql_query(\"SELECT * FROM comments WHERE ideaID =\" . $ideaID . \" ORDER BY upVotes DESC\");\n\t\techo '<div class=\"allComments\">';\n\t\twhile(($commentArray = mysql_fetch_array($comments)) != null)\n \t{\n\t\t\t$user = mysql_query(\"SELECT * FROM user WHERE username ='\" . $commentArray['username'] . \"'\");\n\t\t\t$userArray = mysql_fetch_array($user);\n \n\t\t\techo '<div class=\"commentContainer\" id=\"'.$commentArray[\"commentID\"].'\">';\n echo '<div id=\"voteContainer\">';\n echo '<div class=\"buttonContainer\"><input type=\"button\" id=\"upvoteOn\" class=\"';\n \n if(userHasVotedOnComment($commentArray, $_SESSION['usr']))\n {\n \techo 'commentVote voted';\n }\n else\n {\n \techo 'commentVote';\n }\n \n echo '\" onclick=\"upvoteCommentFunction('.$commentArray['commentID'].')\" ';\n \n if(!isset($_SESSION['usr']))\n {\n \techo 'disabled';\n }\n \n echo '></div><div class=\"voteamount\">'.$commentArray['upVotes'].'</div></div>';\n \t\techo '<div class=\"commentAvatar\"><img src=\"' . $userArray['avatarLocation'] . '\"/></div>';\n \n \t\techo '<div class=\"commentText\"><h3><a href=\"./profile.php?user=' . $commentArray['username'] . '\">' . $commentArray['username'] . '</a></h3>';\n \t\techo $commentArray['content'] . '</div>';\n \t\techo '<br>';\n \t\techo '</div>';\n\t\t}\n echo' </div>';\n\t}\n}",
"function selectComments($id_rubric, $type_comment)\n\t{\n\t\tglobal $dbh;\n\n\n\t\t$sql = \"SELECT \tC.id_comment,\n\t\t\t\t\t\tC.type_comment,\n\t\t\t\t\t\tC.content,\n\t\t\t\t\t\tC.dateCreated,\n\t\t\t\t\t\tC.dateModified,\n\n\t\t\t\t\t\tU.id_user,\n\t\t\t\t\t\tU.user_pseudo,\n\t\t\t\t\t\tU.score\n\n\t\t\t\tFROM users AS U, comments AS C\t\t\t\t\n\t\t\t\tWHERE U.id_user = C.id_user\n\t\t\t\tAND C.id_rubric = :id_rubric\n\t\t\t\tAND C.type_comment = :type_comment\n\t\t\t\tORDER BY C.dateCreated DESC\n\t\t\t\tLIMIT 3\";\n\n\t\t$stmt = $dbh->prepare($sql);\n\t\t$stmt->bindValue(\":id_rubric\", $id_rubric);\n\t\t$stmt->bindValue(\":type_comment\", $type_comment);\n\t\t$stmt->execute();\n\t\t\n\t\t//affiche\n\t\treturn $stmt->fetchAll();\n\t}",
"public function getAllComments(){\n $comments = $this->db->query('SELECT * FROM comments');\n return $comments;\n }",
"public function index()\n\t{\n\t\treturn Response::json($this->commentService->getCommentsWithUser());\n\t}",
"function pb_get_comments($post_id) {\r\n\tglobal $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $comment_author,$comment_author_email,$user_identity;\r\n\t$post_id = (int) $post_id;\r\n\t$req = get_option('require_name_email');\r\n\tif ( $user_ID) {\r\n\t\treturn $wpdb->get_results(\"SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND (comment_approved = '1' OR ( user_id = '$user_ID' AND comment_approved = '0' ) ) ORDER BY comment_date\");\r\n\t} else if ( empty($comment_author) ) { \r\n\t\treturn $wpdb->get_results(\"SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND comment_approved = '1' ORDER BY comment_date\");\r\n\t} else {\r\n\t\t$author_db = $wpdb->escape($comment_author);\r\n\t\t$email_db = $wpdb->escape($comment_author_email);\r\n\t\treturn $wpdb->get_results(\"SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND ( comment_approved = '1' OR ( comment_author = '$author_db' AND comment_author_email = '$email_db' AND comment_approved = '0' ) ) ORDER BY comment_date\");\r\n\t}\r\n\t$comments = $wp_query->comments = apply_filters( 'comments_array', $comments, $post->ID );\r\n\t$wp_query->comment_count = count($wp_query->comments);\r\n}",
"public function get_comments($modded = 'N')\r\n\t{\r\n\t\t// get the comments and join on the post so we\r\n\t\t// can get it's name\r\n\t\t$comments = $this->db\r\n\t\t\t\t\t\t->select('comments.*, posts.title as post_title')\r\n\t\t\t\t\t\t->where('comments.show', $modded)\r\n\t\t\t\t\t\t->join($this->_table['posts'], \"posts.id = comments.post_id\")\r\n\t\t\t\t\t\t->get($this->_table['comments'])\r\n\t\t\t\t\t\t->result_array();\r\n\r\n\t\t// there's two ways the comments come\r\n\t\t// out of the database.\r\n\t\tforeach ($comments as &$comment) \r\n\t\t{\r\n\t\t\t// an unregistered user\r\n\t\t\tif ($comment['author'])\r\n\t\t\t{\r\n\t\t\t\t// concat author and email and assign to display_name\r\n\t\t\t\t$comment['display_name'] = $comment['name'] . ' [' . $comment['email'] . ']';\r\n\t\t\t}\r\n\t\t\t// or a registered user\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// concat user_id and [Registered User](from the language files)\r\n\t\t\t\t// assign to display_name\r\n\t\t\t\t$comment['display_name'] = $this->ion_auth->get_db_display_name($comment['user_id']) . ' [' . lang('comments_reg_user') . ']';\r\n\t\t\t}\r\n\t\t}\r\n\t\t// send it on lil doggy\r\n\t\treturn $comments;\r\n\t}",
"public function comments(){\n return $this->hasMany(Comment::class, \"authenticatedUser_id\");\n }",
"public function getComments ($postId) {\n\n\t\t$sql = \"SELECT comment_author, comment_text, users.user_name\n\t\t\t\t FROM comments INNER JOIN users ON comments.comment_author = users.user_id WHERE post_id = ?\";\n\t\t$data = [$postId];\n\t\t//create stdStatemment object | call to Model method from core/Database.php\n\t\treturn $this->setStatement($sql,$data);\t\t\n\t}",
"public function getQuestionComments($criteria = null, PropelPDO $con = null)\n\t{\n\t\tif ($criteria === null) {\n\t\t\t$criteria = new Criteria(UserPeer::DATABASE_NAME);\n\t\t}\n\t\telseif ($criteria instanceof Criteria)\n\t\t{\n\t\t\t$criteria = clone $criteria;\n\t\t}\n\n\t\tif ($this->collQuestionComments === null) {\n\t\t\tif ($this->isNew()) {\n\t\t\t $this->collQuestionComments = array();\n\t\t\t} else {\n\n\t\t\t\t$criteria->add(QuestionCommentPeer::USER_ID, $this->id);\n\n\t\t\t\tQuestionCommentPeer::addSelectColumns($criteria);\n\t\t\t\t$this->collQuestionComments = QuestionCommentPeer::doSelect($criteria, $con);\n\t\t\t}\n\t\t} else {\n\t\t\t// criteria has no effect for a new object\n\t\t\tif (!$this->isNew()) {\n\t\t\t\t// the following code is to determine if a new query is\n\t\t\t\t// called for. If the criteria is the same as the last\n\t\t\t\t// one, just return the collection.\n\n\n\t\t\t\t$criteria->add(QuestionCommentPeer::USER_ID, $this->id);\n\n\t\t\t\tQuestionCommentPeer::addSelectColumns($criteria);\n\t\t\t\tif (!isset($this->lastQuestionCommentCriteria) || !$this->lastQuestionCommentCriteria->equals($criteria)) {\n\t\t\t\t\t$this->collQuestionComments = QuestionCommentPeer::doSelect($criteria, $con);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->lastQuestionCommentCriteria = $criteria;\n\t\treturn $this->collQuestionComments;\n\t}",
"public function getAllTheComments(){\n\t\t try{\n\t\t\t $conn=DBConnection::GetConnection();\n\t\t\t $myquery=\"SELECT comment_id,comment_description,comment_date,news_id,user_name FROM comment\";\n\t\t\t $result= $conn->query($myquery);\n\t\t\t $comments=array();\n\t\t\t foreach($result as $comment){\n\t\t\t\t$c1=new Comment();\n\t\t\t\t$c1->setCommentId($comment[\"comment_id\"]);\n\t\t\t\t$c1->setCommentDescription($comment[\"comment_description\"]);\n\t\t\t\t$c1->setCommentDate($comment[\"comment_date\"]);\n\t\t\t\t$c1->setNewsId($comment[\"news_id\"]);\n\t\t\t\t$c1->setUserName($comment[\"user_name\"]);\n\t\t\t\tarray_push($comments,$c1);\t\t\t\t\n\t\t\t }\n\t\t\t$conn =null;\n\t\t\treturn $comments;\n\t\t }catch(PDOException $p){\n\t\t\t echo 'Fail to connect';\n\t\t\t echo $p->getMessage();\n\t\t }\n\t }",
"public function comments() {\n return $this->hasMany(Comment::class); // this (User) has many instances of the Comment\n }",
"function getComments($pdo, $post_id){\n $statement = $pdo->query(\n\t\"SELECT username, comment_id, comment, comment_date\n\tFROM users\n\tINNER JOIN comments\n\tON users.id = comments.user_id\n\tWHERE post_id = '$post_id' \");\n\n $comments = $statement->fetchAll(PDO::FETCH_ASSOC);\n\n if (!$statement) {\n die(var_dump($pdo->errorInfo()));\n }\n\n return $comments;\n}",
"function getComments($conn){\r\n $sql = \"SELECT * FROM comments ORDER BY cid DESC LIMIT 20\";\r\n $result = $conn->query($sql);\r\n while ($row = $result->fetch_assoc()){\r\n echo \"<div class='comment-box'><p>\";\r\n echo $row['uid'].\"<br>\";\r\n echo $row['date'].\"<br>\";\r\n echo nl2br($row['message']);\r\n echo \"</p></div>\";\r\n }\r\n \r\n}",
"public function getCommentFromUser(User $user)\n {\n foreach($this->comments as $comment)\n {\n if($comment->getUser() == $user) return $comment;\n }\n\n return null;\n }",
"public function getCommentsByTime($args) {\n $offset = isset($args[2]) ? $args[2] : 0;\n $db = \\Helper::getDB();\n $db->where('c.timestamp', array('>=' => date('Y-m-d H:i:s', $args[1])));\n $db->join('users u', 'c.userId = u.id', 'LEFT');\n $db->orderBy('c.timestamp', 'DESC');\n $results = $db->get('comments c', array($offset, 50), '*, c.id AS commentID, u.id AS userId');\n $comments = new \\Models\\Comments(NULL);\n $number = 1;\n foreach($results as $result) {\n // Only list comments to which the user has access\n if(\\Auth::checkComment($result['type'], $result['itemId'])) {\n $user = new \\Models\\User($result['userId'], $result['username'], $result['email'], $result['firstName'], $result['lastName'], $result['lastLogin']);\n $comment = new \\Models\\Comment($result['commentID'], $result['parentId'], $number, $user, $result['type'], $result['timestamp'], $result['message'], $result['editTimestamp']);\n $comments->addComment($comment);\n }\n $number++;\n }\n\n return $this->getCommentsData($comments, TRUE);\n }",
"function getUserComments(object $pdo, int $id): array\n{\n $statement = $pdo->prepare('SELECT * FROM comments\n WHERE user_id = :user_id\n ORDER BY comment_created DESC');\n\n $statement->BindParam(':user_id', $id, PDO::PARAM_INT);\n $statement->execute();\n\n $userComments = $statement->fetchAll(PDO::FETCH_ASSOC);\n\n if (!$statement) {\n return $_SESSION['message'] = \"You have not written any comments yet.\";\n }\n\n return $userComments;\n}",
"public function getCommentsInfoByPostId($id) {\n $this->db->query('SELECT\n users.name,\n comments.content, posts.id AS postId,\n users.id AS userId,\n comments.id AS commentId,\n posts.created_at AS postCreated,\n users.created_at AS userCreated,\n comments.created_at AS commentCreated\n FROM\n comments\n INNER JOIN\n posts\n ON\n comments.post_id = posts.id\n INNER JOIN\n users\n ON\n comments.user_id = users.id\n WHERE \n comments.post_id = :id\n ORDER BY comments.created_at\n DESC;\n ');\n \n $this->db->bind(':id', $id);\n\n $result = $this->db->resultSet();\n\n return $result;\n }",
"public function readComment(){\n $sql='SELECT idComentario, comentario, producto.nombre as producto,cliente.nombre as cliente, comentarios.estado as estado, cliente.usuario as usuario FROM cliente, producto, comentarios where producto.idProducto=comentarios.idProducto and cliente.idCliente=comentarios.idCliente and comentarios.idProducto=?';\n $params=array($this->id);\n return Database::getRows($sql, $params);\n }",
"public function getComment($idComment)\n\t{\t\n\t\t$req=$this->_bdd->query('SELECT id, content_com AS content, DATE_FORMAT(date_com, \"%d/%m/%Y %Hh%imin%ss\") AS date, id_users AS idUser, id_post AS idPost, moderate FROM Comments WHERE id='.$idComment);\n\t\t//die(var_dump($idComment));\n\t\twhile($datas=$req->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$comment=new Comments($datas);\n\t\t}\n\t\treturn $comment;\n\t}",
"private function GetComments($_id)\n\t{\n\t\t//Get Database\n\t\t$_database = $this->ConnectDatabase();\n\t\t//Create Data\n\t\t$_data = array($_id);\n\t\t//Call and return Database Function\n\t\treturn $this->CallDatabase(\n\t\t\t$_database,\n\t\t\t$_data,\n\t\t\tfunction($_pdo, $_parameters)\n\t\t\t{\n\t\t\t\t//Create Query\n\t\t\t\t$_query = $_pdo->prepare(\"SELECT \n\t\t\t\t\t\tcm.id id, \n\t\t\t\t\t\tcm.description description, \n\t\t\t\t\t\tcm.ratting rate, \n\t\t\t\t\t\tcm.created date, \n\t\t\t\t\t\tcm.type `type`,\n\t\t\t\t\t\tus.nick_name user_nick, \n\t\t\t\t\t\tus.url_profile user_url_perfil\n\t\t\t\t\tFROM Comments cm\n\t\t\t\t\tLEFT JOIN Users us ON us.id = cm.id_user\n\t\t\t\t\tWHERE cm.id_partner = ?\n\t\t\t\t\");\n\t\t\t\t//Execute Query\n\t\t\t\t$_query->execute($_parameters);\n\n\t\t\t\t$_data = null;\n\t\t\t\twhile ($_row = $_query->fetch(PDO::FETCH_ASSOC))\n\t\t\t\t{\n\t\t\t\t\t$_row['user_url_perfil'] = strlen($_row['user_url_perfil']) > 1 ? \n\t\t\t\t\t\t$this->image_client_path . $_row['user_url_perfil'] : \n\t\t\t\t\t\tnull;\n\t\t\t\t\t$_row['date'] = $this->ConvertDataClient($_row['date']);\n\t\t\t\t\t$_data = $_row;\n\t\t\t\t}\n\t\t\t\treturn $_data;\n\t\t\t}\n\t\t);\n\t}",
"public function getComments($id){\n $id = (int)$id;\n $sql = \"select * from comments WHERE discussion_id = '{$id}'\";\n return $this->db->query($sql);\n }",
"public function getComments() {\n $db = new mysql('testserver', 'testuser', 'testpassword');\n $sql = \"SELECT * FROM comments_table where parent_id=0 ORDER BY create_date DESC;\";\n $result = mysql_query($sql, $db);\n $comments = [];\n while ($row = mysql_fetch_assoc($result)) {\n $comment = $row;\n $reply_1_sql = \"SELECT * FROM comments_table where parent_id=\" . $row['id'] . \" ORDER BY create_date DESC;\";\n $result_reply_1 = mysql_query($reply_1_sql, $db);\n $replies = [];\n while ($row1 = mysql_fetch_assoc($result)) {\n $reply = $row1;\n $reply_2_sql = \"SELECT * FROM comments_table where parent_id=\" . $row1['id'] . \" ORDER BY create_date DESC;\";\n $result_reply_2 = mysql_query($reply_2_sql, $db);\n $replies_to_replies = [];\n while ($row2 = mysql_fetch_assoc($result)) {\n $replies_to_replies[] = $row2;\n }\n $reply['replies'] = $replies_to_replies;\n $replies[] = $reply;\n }\n $comment['replies'] = $replies;\n $comments[] = $comment;\n }\n return $comments;\n }",
"public function get_user_notes(){\n $user_id = (int) $_COOKIE['user_id'];\n $sql = 'SELECT * from '. static::$table_name .' AS N JOIN notes_subject AS S';\n $sql .=' ON N.user_id =' .\"'\". self::$database->escape_string($user_id) .\"'\";\n $sql .= ' AND N.user_id = S.user_id AND N.note_id = S.note_id JOIN notes_tag AS T ON N.user_id = T.user_id AND N.note_id = T.note_id';\n\n return static::find_by_sql($sql);\n }",
"public function viewByUserAction($userId) {\n /**\n * Find comments by user.\n */\n $res = $this->comments->findByUser($userId);\n\n /**\n * Alter object by connecting comment tags, adding user information from the database and filtering markdown on the comment object.\n */\n $res = $this->doAll($res);\n\n /**\n * Find the in the database.\n */\n $user = $this->users->find($userId);\n\n /**\n * Used to construct a reply message for the user if the profile has not made any contributions so far.\n */\n if (isset($res[0]->name)) {\n $reply = \"\";\n } else {\n $reply = $user->name . \" has not made any contribution yet!\";\n }\n\n /**\n * Prepare the view.\n */\n $this->views->add('comment/commentsdb', [\n 'comments' => $res,\n 'title' => 'Contribution by ' . $user->name,\n 'content' => $reply,\n ]);\n }",
"function GetComments($f_id)\n\t{\n\t\t$sql_query = \"SELECT comments.*, members.nick_name, members.logo_file FROM `\".$this->sCommentTb.\"` AS comments LEFT JOIN `\".$GLOBALS['g_egltb_members'].\"` AS members ON comments.author_id=members.id HAVING comments.\".$this->sField.\"=\".(int)$f_id.\" ORDER BY comments.created DESC\";\n\t\treturn $this->pDBInterface->FetchArrayObject( $this->pDBInterface->Query( $sql_query ) );\n\t}",
"function get_comment_author_link($comment_id = 0)\n {\n }",
"public function comments()\n {\n $sort = Sorter::getCommentSortId();\n $orderField = $sort == 1 ? 'rate' : 'id';\n $orderDir = $sort == 1 ? 'desc' : 'asc';\n return $this->morphMany(Comment::class, 'commentable')->orderBy($orderField, $orderDir);\n }",
"function getAllContributionPostsByUserId($connection,$userId){\n\t $query = \"SELECT fcp.id AS post_id,fcp.post_title,fcp.post_text,fcp.posted_on AS posted_date,fs.student_name as post_author,fd.department_name as postedfor FROM forum_contribution_post fcp LEFT JOIN forum_student fs ON fcp.posted_by=fs.id LEFT JOIN forum_departments fd on fcp.posted_for=fd.id WHERE fcp.posted_by='$userId' \";\n\t $result = $connection->query($query);\n\t return $result;\n }",
"public function get_comments($submission_id){\n $this->db->select('comments.comment_id,user_form_info_text.form_field_id,comments.comments,comments.created_by,comments.user_form_info_text_id,CONCAT_WS(\" \",users.firstname,users.lastname) as name')\n ->from('comments comments')\n ->join('user_form_info_text user_form_info_text','comments.submission_id = user_form_info_text.submission_id and user_form_info_text.user_form_info_text_id = comments.user_form_info_text_id','left')\n ->join('users users','users.id = comments.created_by','left')\n ->where('comments.submission_id = '.$submission_id);\n $res = $this->db->get();\n return $res->result_array();\n }",
"public function get_users_comments_data($discussionid = \"\")\n\t{\n\t\t$result = $this->db->from(\"discussion\")->where(array(\"discussion_id\" => $discussionid))->join(\"deals\",\"deals.deal_id\",\"discussion.deal_id\")->limit(1)->get();\n\t\treturn $result;\n\t}",
"function getComments($post_id){\n GLOBAL $CONNECTION; \n $sql = \"SELECT * FROM comment WHERE post_id=$post_id ORDER BY commented_at DESC\";\n $comments = mysqli_query($CONNECTION, $sql);\n return $comments;\n }",
"function get_comment_author_url($comment_id = 0)\n {\n }",
"public function comment()\n {\n return $this->hasMany('Modules\\Comment\\Model\\Comment','user_id');\n }",
"public function list_comments()\n {\n $url = $this->instanceUrl() . '/comments';\n list($response, $opts) = $this->_request('get', $url, null, null);\n\n // This is needed for nextPage() and previousPage()\n $response['url'] = $url;\n\n $obj = Util\\Util::convertToTelnyxObject($response, $opts);\n return $obj;\n }",
"public function get_comments()\n {\n }"
]
| [
"0.79374176",
"0.7748931",
"0.75234765",
"0.740013",
"0.7268609",
"0.720015",
"0.7158204",
"0.7085371",
"0.70664287",
"0.69329876",
"0.69191176",
"0.6914168",
"0.68593216",
"0.684835",
"0.684317",
"0.684293",
"0.6831831",
"0.68227565",
"0.67690307",
"0.67350316",
"0.6732715",
"0.67267036",
"0.6693577",
"0.6689201",
"0.6683259",
"0.6651156",
"0.6648623",
"0.6643904",
"0.66176474",
"0.6602388",
"0.65998167",
"0.6518416",
"0.6505294",
"0.64899886",
"0.6413921",
"0.64091396",
"0.64090633",
"0.63643456",
"0.63397574",
"0.63366675",
"0.63191974",
"0.6304935",
"0.63003874",
"0.6291308",
"0.6275521",
"0.6275324",
"0.62657154",
"0.62464905",
"0.6241562",
"0.623645",
"0.6225515",
"0.6201028",
"0.62003833",
"0.61983246",
"0.6189848",
"0.6187268",
"0.616647",
"0.61636347",
"0.61389947",
"0.6132514",
"0.61294675",
"0.61252916",
"0.612426",
"0.6103512",
"0.6091364",
"0.6090724",
"0.6080797",
"0.6061758",
"0.60595644",
"0.6045307",
"0.6043608",
"0.6039665",
"0.60330033",
"0.6026155",
"0.60180974",
"0.60116905",
"0.600696",
"0.5997106",
"0.5996201",
"0.5993334",
"0.59918654",
"0.59905255",
"0.597771",
"0.5976679",
"0.596982",
"0.596952",
"0.5968382",
"0.59646636",
"0.59587145",
"0.5957467",
"0.5956657",
"0.59456426",
"0.59382147",
"0.59263164",
"0.59261924",
"0.592214",
"0.5906132",
"0.58943444",
"0.5893301",
"0.5890382"
]
| 0.61843055 | 56 |
gets the comments from a specific post | public static function getAllFromPost( string $id){
$ids = CommentDatabase::getAllFromPost( $id);
return array( "status" => "OK", "lenght" => count($ids), "comments" => $ids, "version" => "v1");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getComments($post_id){\n\t\t$sql = 'SELECT user_name, date_creation, content, state, id FROM comment WHERE post_id=' . $post_id . \" AND state >= 2 ORDER BY id DESC\";\n\t\t$data = $this->db->query($sql);\n\t\treturn $data->fetchAll();\n\t}",
"public function getPostComments($pid = null) { \r\n // if the query is made using findOne(), the method will return just the element being queried \r\n $comments = $this->_comment_collection->find(array('post_id' => new MongoId($pid) ) ); \r\n return $comments; \r\n }",
"public function getComments($post_id)\n {\n $statement = $this->pdo->prepare(\"SELECT * FROM comments WHERE post_id = :post_id ORDER BY comments_id DESC\");\n\n $statement->execute(\n [\n \":post_id\" => $post_id,\n ]\n );\n\n $all_comments = $statement->fetchAll(PDO::FETCH_ASSOC);\n\n $this->all_comments = $all_comments;\n }",
"public function allCommentsPost($post_id) {\r\n $table = $this->config->db_prefix . 'comments';\r\n return $this->database->selectAllFromTableWhereFieldValue($table, \"article_id\", $post_id);\r\n }",
"public function getComments($idPost)\n\t{\n\t\t$req=$this->_bdd->query('SELECT Comments.id, content_com AS content, DATE_FORMAT(date_com, \"%d/%m/%Y %Hh%imin%ss\") AS date, id_users AS idUser, id_post AS idPost, moderate, login FROM Comments INNER JOIN Users ON id_users=Users.id WHERE id_post='.$idPost);\n\n\t\t$comments=[];\n\t\n\t\twhile($datas=$req->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\t\n\t\t\t\t\t$comments[]=new Comments($datas);\t\t\n\t\t\t}\n\t\treturn $comments;\n\t\t\t\t\n\t}",
"public function getComments($post_id) \n\t{\t\n\t\ttry {\n\t\t\t$access_token=$this->facebookappid.\"|\".$this->facebookscret;\t\t\t\n\t\t\tFacebookSession::setDefaultApplication($this->facebookappid, $this->facebookscret);\n\t\t\t$session = new FacebookSession($access_token);\n\t\t\t$comments_query=\"/\".$post_id.\"/comments\";\n\t\t\t$comments_result=$this->FBrequest($session,$comments_query);\t\t\t\t\t\t\n\t\t\treturn $comments_result;\n\t\t\t} catch (Exception $e) {\n\t\t\techo $e->getMessage();\n\t\t\t}\t\t\t\n\t}",
"public static function getComments($post)\n {\n\n // check param type\n // we do this here to support manual template data overrides, such as providing an array of values\n if (!is_object($post) || 'Timber\\Post' !== get_class($post)) {\n return false;\n }\n\n // comments turned off\n if (!self::$commentsOn) {\n return false;\n }\n\n // get comments from WordPress function and return hierarchical Timber\\Comment array\n $comments = self::buildCommentList(get_comments(\n array(\n 'post_id' => $post->ID,\n 'number' => self::$pageComments ? self::$commentsPerPage : null,\n 'offset' => self::$pageComments ? (get_query_var('cpage', 1) * self::$commentsPerPage) - self::$commentsPerPage : 0,\n 'status' => 'approve',\n 'type' => 'comment',\n 'order' => (self::$defaultCommentsPage == 'newest') ? 'DESC' : 'ASC',\n 'hierarchical' => self::$threadComments\n )\n ));\n\n // reorder comments by date\n if (self::$commentOrder == 'asc') {\n usort($comments, array('MGPressComments', 'sortByAsc'));\n } else {\n usort($comments, array('MGPressComments', 'sortByDesc'));\n }\n\n return $comments;\n }",
"function getComments($post_id){\n GLOBAL $CONNECTION; \n $sql = \"SELECT * FROM comment WHERE post_id=$post_id ORDER BY commented_at DESC\";\n $comments = mysqli_query($CONNECTION, $sql);\n return $comments;\n }",
"public function getComments($post_id) \n {\n return $this->callRestMethod('stream.getComments', \n array('post_id' => $post_id));\n }",
"private function get_comments_list($post_id)\n\t{\n\t\t$owner_id = ($this->owner->logged_in())\n\t\t\t? $this->owner->get_user()->id\n\t\t\t: FALSE;\n\n\t\t$comments = ORM::Factory('forum_cat_post_comment')\n\t\t\t->select(\"\n\t\t\t\tforum_cat_post_comments.*,\n\t\t\t\t(SELECT owner_id \n\t\t\t\t\tFROM forum_comment_votes\n\t\t\t\t\tWHERE forum_cat_post_comment_id = forum_cat_post_comments.id\n\t\t\t\t\tAND owner_id = '$owner_id'\n\t\t\t\t) AS has_voted\n\t\t\t\")\n\t\t\t->where(array(\n\t\t\t\t'forum_cat_post_comments.forum_cat_post_id' => $post_id,\n\t\t\t\t'forum_cat_post_comments.is_post !=' => '1',\n\t\t\t))\n\t\t\t->orderby(\"forum_cat_post_comments.$this->sort_by\", \"$this->order\")\n\t\t\t->find_all();\n\t\tif(0 == $comments->count())\n\t\t\treturn 'No comments yet';\n\n\t\t$view = new View('public_forum/comments_list');\n\t\t$view->is_logged_in\t= $this->owner->logged_in();\t\n\t\t$view->owner\t= $owner_id;\t\t\t\n\t\t$view->comments\t\t= $comments;\n\t\treturn $view;\n\t}",
"public function getComments ($postId) {\n\n\t\t$sql = \"SELECT comment_author, comment_text, users.user_name\n\t\t\t\t FROM comments INNER JOIN users ON comments.comment_author = users.user_id WHERE post_id = ?\";\n\t\t$data = [$postId];\n\t\t//create stdStatemment object | call to Model method from core/Database.php\n\t\treturn $this->setStatement($sql,$data);\t\t\n\t}",
"public function getComments($postId)\n {\n $db = $this->dbConnect();\n $comments = $db->prepare('SELECT id, author, comment, DATE_FORMAT(comment_date, \\'%d/%m/%Y à %Hh%imin%ss\\') AS comment_date_fr FROM comments WHERE post_id = ? ORDER BY comment_date DESC');\n $comments->execute(array($postId));\n\n return $comments;\n }",
"public function getCommentsByPostId($postId)\n {\n $req = $this->getDataBase()->prepare('SELECT id, author, comment, report, post_id, DATE_FORMAT(comment_date, \\'%d/%m/%Y <em>à</em> %Hh%imin\\') AS comment_date FROM comments WHERE post_id = ? ORDER BY comment_date DESC ');\n $req->execute(array($postId));\n $comments = [];\n while($data = $req->fetch(PDO::FETCH_ASSOC)) {\n $comments[] = $this->hydrate($data);\n }\n $req->closeCursor();\n \n return $comments;\n }",
"public function getAllPostsWithComments(){\n $entityManager = $this->getEntityManager();\n $queryBuilder = $entityManager->createQueryBuilder();\n $queryBuilder\n ->select('bp','c')\n ->from('App:BlogPost', 'bp')\n ->join('bp.comments','c','WITH', 'bp.id=c.blogPost');\n\n return $queryBuilder->getQuery()->getResult();\n }",
"function get_post_comments($post_id)\n{\n $select_query = 'SELECT c.*, u.username\n FROM '.TBL_COMMENTS.' c\n JOIN '.TBL_USERS.' u\n ON u.`user_id` = c.`user_id`\n WHERE c.`post_id`='.(int)$post_id.'\n ORDER BY c.`created_ts` ASC';\n\n $comments = array();\n $results = mysql_query($select_query);\n while($row = mysql_fetch_assoc($results))\n {\n $comments[] = $row;\n }\n\n return $comments;\n}",
"public function getCommentsAdmin($post_id){\n\t\t$sql = 'SELECT user_name, date_creation, content, state, id FROM comment WHERE post_id=' . $post_id . \" AND state <= 1 ORDER BY id DESC\";\n\t\t$data = $this->db->query($sql);\n\t\treturn $data->fetchAll();\n\t}",
"function get($postid)\n\t{\n\t\t$this->db->where('id',$postid);\n\t\t$res = $this->db->get($this->posts_table);\n\t\tif ($res->num_rows() == 0) {\n\t\t\treturn false;\n\t\t}\n\t\t$post = $res->row();\n\t\t$res->free_result();\n\n\t\t// now get the comments if there are any\n\t\tif ($post->comments > 0) {\n\t\t\t$this->db->where('postid',$postid);\n\t\t\t$res = $this->db->get($this->comments_table);\n\t\t\t$comments = array();\n\t\t\tforeach ($res->result_array() as $row) {\n\t\t\t\t// put comments into array using their id as index\n\t\t\t\t$comments[$row['id']] = $row;\n\t\t\t}\n\t\t\t$threads = $this->threadComments($comments);\n\t\t}\n\t\telse {\n\t\t\t$comments = false;\n\t\t\t$threads = false;\n\t\t}\n\n\t\t$post->commentData = array('comments' => $comments,'threads' => $threads);\n\n\t\treturn $post;\n\t}",
"public function showPostComments($postId)\n {\n $this->db->query('SELECT comments.id as commentId,\n\t\t\t\t\t\t\t\tusers.first_name as fname,\n\t\t\t\t\t\t\t\tusers.last_name as lname,\n\t\t\t\t\t\t\t\tcomments.postId as postId,\n\t\t\t\t\t\t\t\tcomments.content as content,\n\t\t\t\t\t\t\t\tcomments.note as note,\n\t\t\t\t\t\t\t\tcomments.dateComment as dateComment\n\t\t\t\t\t\t\t\tFROM comments, users\n\t\t\t\t\t\t\t\tWHERE postId = :postId\n\t\t\t\t\t\t\t\tAND comments.userId = users.id\n\t\t\t\t\t\t\t\tORDER BY comments.dateComment DESC');\n\n $this->db->bind(':postId', $postId);\n $results = $this->db->resultSet();\n return $results;\n }",
"function getPostingComment($id = 0) {\n return getAll(\"SELECT r.content FROM posting_reply pr \n INNER JOIN posting p on pr.posting_id = p.id \n INNER JOIN reply r on pr.reply_id = r.id WHERE p.id = $id\");\n}",
"public function getFirstThreePostComments($post_id)\n {\n return $init_comments = Comment::find()->with('user')->with('post')->where(['post_id' => \"$post_id\",'status' => '1','parent_comment_id'=>'0'])->orderBy(['created_date'=>SORT_DESC])->limit(3)->all();\n \n }",
"public function comments($postID)\n\t{\n\t\tif(!$this->setPost($postID))\n\t\t\treturn;\n\n\t\t$rsp = new Response();\n\n //Are we authorized to see this post ?\n\t\tif(!isAuthorized::seeFullProfile($this->model->getProfileID()))\n {\n\t\t\t$rsp->setFailure(401, \"You can not see this post\")\n\t\t\t ->send();\n\n\t\t\treturn;\n\t\t}\n\n\t\t$coms = $this->commentModel->getComments($postID);\n\n\t\t$rsp->setSuccess(200, \"comments returned\")\n\t\t\t->bindValue(\"postID\", $postID)\n ->bindValue(\"nbOfComments\", count($coms))\n ->bindValue(\"comments\", $coms)\n ->send();\n\t}",
"public function getCommentsByPostID($post_id)\n {\n $comments = Comment::where('post_id', '=', $post_id)->with('user')->with('post')->get();\n return response()->json([\n 'comments' => $comments,\n ], 200);\n }",
"public function comments(Request $request, Post $post)\n {\n $result = $post->comments()\n ->latest()\n ->with('user', 'targetUser', 'targetComment')\n ->paginate(5);\n return response()->json($result);\n }",
"public function getComments() {\n return $this->hasMany(Comment::class, ['post_id' => 'id']);\n }",
"function comments($post_id)\n {\n $data = $this->Post_model->basic($post_id);\n $data['table_id'] = 2000; //Código tabla posts\n\n $data['view_a'] = 'posts/comments_v';\n $this->App_model->view(TPL_ADMIN, $data);\n }",
"public function getComments() \n {\n return $this->hasMany(Comment::className(), [\n 'post_id' => 'id',\n ]);\n }",
"function wyz_bus_post_load_comments() {\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$_post_id = intval( $_POST['post-id'] );\n\t$_offset = intval( $_POST['offset'] );\n\n\tif( '' == $_post_id || '' == $_offset ) wp_die( false );\n\n\t$args = array(\n\t\t'status' => 'approve',\n\t\t'post_id' => $_post_id\n\t);\n\t$comments = get_comments( $args );\n\t$output = '';\n\t$count = 0;\n\tforeach ( $comments as $comment) {\n\t\tif(!$count++ )continue;\n\t\t$output .= WyzBusinessPost::get_the_comment( $comment );\n\t}\n\n\twp_die( $output );\n\t//wp_die( array( $output, $count ) );\n}",
"public function returnComments(Request $request, $post_id)\n {\n $request = $request->all();\n\n $comments = Comments::select(\n 'comments.id',\n 'comments.author_id',\n 'comments.post_id',\n 'comments.comment_body',\n 'comments.created_at',\n 'comments.updated_at',\n 'posts.id',\n 'posts.user_id',\n 'posts.post_text',\n 'posts.image_link',\n 'user.first_name',\n 'user.last_name'\n )\n ->where('posts.id', '=', $post_id)\n ->from('comments')\n ->join('posts', function ($query) {\n $query->on('comments.post_id', '=', 'posts.id');\n })\n ->join('user', function ($query) {\n $query->on('user.id', '=', 'comments.author_id');\n })\n ->orderBy('created_at', 'desc')\n ->get();\n\n return $comments;\n }",
"public function getCommentsOfPost($id)\n {\n $comments = Comment::getParentComments($id);\n return metaResponse($comments);\n }",
"public static function findCommentsOn($id=0){\n\t\t//So custom find function() is needed\n\t\tglobal $connection;\n\t\t$sql = \"SELECT * FROM \".static::$table_name.\" WHERE post_id = \";\n\t\t$sql .= $connection->real_escape_string($id) . \" ORDER BY created ASC \";\n\t\t//echo $sql;\n\t\treturn static::findBySql($sql);\n\t}",
"public function getCommentaryForPost($idPost)\n {\n $repository = $this->entityManager->getRepository(\"DUT\\\\Models\\\\Commentary\");\n $items = $repository->findBy([\"idPost\" => $idPost], [\"idCommentary\" => \"ASC\"]);\n\n if (!isset($items)) {\n $items = [];\n }\n\n return $items;\n }",
"public function getpostcomments($sr, $postID, $limit = 1000) {\n\t\t$limit = (isset ( $limit )) ? \"?limit=\" . $limit : \"\";\n\t\tif ($sr == 'home' || $sr == 'reddit' || ! isset ( $sr )) {\n\t\t\t$urlListing = \"http://www.reddit.com/.json{$limit}\";\n\t\t} else {\n\t\t\t$urlListing = \"http://www.reddit.com/r/{$sr}/comments/{$postID}/.json{$limit}\";\n\t\t}\n\t\treturn $this->runCurl ( $urlListing );\n\t}",
"public function index(Post $post)\n {\n $comments = $post->comments()->with(['user', 'user.profile'])->get();\n\n return response()->json($comments);\n }",
"function pb_get_comments($post_id) {\r\n\tglobal $wp_query, $withcomments, $post, $wpdb, $id, $comment, $user_login, $user_ID, $comment_author,$comment_author_email,$user_identity;\r\n\t$post_id = (int) $post_id;\r\n\t$req = get_option('require_name_email');\r\n\tif ( $user_ID) {\r\n\t\treturn $wpdb->get_results(\"SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND (comment_approved = '1' OR ( user_id = '$user_ID' AND comment_approved = '0' ) ) ORDER BY comment_date\");\r\n\t} else if ( empty($comment_author) ) { \r\n\t\treturn $wpdb->get_results(\"SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND comment_approved = '1' ORDER BY comment_date\");\r\n\t} else {\r\n\t\t$author_db = $wpdb->escape($comment_author);\r\n\t\t$email_db = $wpdb->escape($comment_author_email);\r\n\t\treturn $wpdb->get_results(\"SELECT * FROM $wpdb->comments WHERE comment_post_ID = '$post->ID' AND ( comment_approved = '1' OR ( comment_author = '$author_db' AND comment_author_email = '$email_db' AND comment_approved = '0' ) ) ORDER BY comment_date\");\r\n\t}\r\n\t$comments = $wp_query->comments = apply_filters( 'comments_array', $comments, $post->ID );\r\n\t$wp_query->comment_count = count($wp_query->comments);\r\n}",
"public static function findByPostId($postId)\n {\n return (new static())\n ->where('comment_post_ID', $postId)\n ->get();\n }",
"public function getComments($postId, $parentCommentId = 0){\n\t\t$commentQuery = $this->mysqli->query(\"SELECT \n\t\t\t\t\t\tcomments.comment_id,\n\t\t\t\t\t\tUNIX_TIMESTAMP(comments.date) as date,\n\t\t\t\t\t\tcomments.content, \n\t\t\t\t\t\tusers.username\n\t\t\t\t\t\tFROM comments LEFT JOIN users ON comments.user_id = users.user_id\n\t\t\t\t\t\tWHERE post_id=\".$postId.\"\n\t\t\t\t\t\tAND replied_comment_id=\".$parentCommentId);\n\t\t\n\t\t$commentArr = array();\n\t\t\n\t\twhile($comment = $commentQuery->fetch_object()){\n\t\t\t$commentObj = new Comment($comment->comment_id, $comment->date, $comment->content);\n\t\t\t$commentObj->setUsername($comment->username);\n\t\t\t\n\t\t\t//Get the comment's votes\n\t\t\t$votes = $this->mysqli->query(\"SELECT\n\t\t\t\t\tvalue, COUNT(user_id) AS count FROM votes\n\t\t\t\t\tWHERE content_id=\".$comment->comment_id.\" AND is_post_vote=0\n\t\t\t\t\tGROUP BY value\n\t\t\t\t\t\");\n\t\t\tif($votesDown = $votes->fetch_object()){\n\t\t\t\t$votesDown = $votesDown->count;\n\t\t\t}else{\n\t\t\t\t$votesDown = 0;\n\t\t\t}\n\t\t\t$commentObj->setVoteDown($votesDown);\n\t\t\t\n\t\t\tif($votesUp = $votes->fetch_object()){\n\t\t\t\t$votesUp = $votesUp->count;\n\t\t\t}else{\n\t\t\t\t$votesUp = 0;\n\t\t\t}\n\t\t\t$commentObj->setVoteUp($votesUp);\n\t\t\t\n\t\t\t$commentObj->addCommentArr($this->getComments($postId, $commentObj->getId()));\n\t\t\t$commentArr[] = $commentObj;\n\t\t}\n\t\t\n\t\treturn $commentArr;\n\t\t\n\t}",
"public function getPostComment($id)\n {\n $post = Post::find($id);\n $comments = $post->comments()->orderBy('created_at', 'desc')->get();\n $user = User::find($post->user_id);\n $name = $user->first_name . \" \" . $user->last_name;\n $post->user = $name;\n $count = count($comments);\n $post->count = $count;\n\n return View::make('page.post_comment')->withPost($post)->withComments($comments);\n }",
"public function column_comments($post)\n {\n }",
"public function getAllPostLike($post_id)\n {\n $comments = Comment::find()->with('user')->with('post')->where(['post_id' => \"$post_id\",'status' => '1','parent_comment_id'=>'0'])->orderBy(['created_date'=>SORT_DESC])->all();\n return $comments;\n \n }",
"public function column_comments($post)\n {\n }",
"public function index($post_id)\n {\n return Comment::where('post_id', $post_id)->with('user.avatar')->orderBy('updated_at', 'desc')->paginate(5);\n }",
"function getCommentNumberPost($postId)\n{\n global $conn;\n\n $sql = \"SELECT comments FROM post WHERE postId =$postId\";\n $result = mysqli_query($conn, $sql);\n $row = mysqli_fetch_assoc($result);\n return $row['comments'];\n}",
"function getPostComments(object $pdo, int $post_id): array\n{\n $statement = $pdo->prepare('SELECT * FROM comments WHERE post_id = :post_id');\n $statement->bindParam(':post_id', $post_id, PDO::PARAM_INT);\n $statement->execute();\n\n $comments = $statement->fetchAll(PDO::FETCH_ASSOC);\n return $comments;\n}",
"function getcomment()\n\t{\n\t\t## variable initialization\n\t\tglobal $option, $mainframe, $db;\n\t\t$commentId = JRequest::getVar('cmtid', '', 'get', 'int');\n\t\t$id = JRequest::getVar('id', '', 'get', 'int');\n\n\t\t## for pagination\n\t\t$limit = $mainframe->getUserStateFromRequest($option . '.limit', 'limit', $mainframe->getCfg('list_limit'), 'int');\n\t\t$limitstart = $mainframe->getUserStateFromRequest($option . 'limitstart', 'limitstart', 0, 'int');\n\n\t\t## \tquery for delete the comments\n\t\tif ($commentId)\n\t\t{\n\t\t\t$query = \"DELETE FROM #__hdflv_comments\n \t\t WHERE id=\" . $commentId . \"\n \t\t OR parentid=\" . $commentId;\n\t\t\t$db->setQuery($query);\n\t\t\t$db->query();\n\t\t\t## message for deleting comment\n\t\t\t$mainframe->enqueueMessage( 'Comment Successfully Deleted' );\n\t\t}\n\n\t\t$id = JRequest::getVar('id', '', 'get', 'int');\n\t\t$query = \"SELECT COUNT(id) FROM #__hdflv_comments\n \t\t WHERE videoid = $id\";\n\t\t$db->setQuery($query);\n\t\t$db->query();\n\t\t$commentTotal = $db->getNumRows();\n\t\tif (!$commentTotal)\n\t\t{\n\t\t\t$strRedirectPage = 'index.php?layout=adminvideos&option=' . JRequest::getVar('option') . '&user=' . JRequest::getVar('user');\n \t$mainframe->redirect($strRedirectPage);\n\t\t}\n\n\t\t$query=\"SELECT id as number,id,parentid,videoid,subject,name,created,message\n\t\t\t\tFROM #__hdflv_comments where parentid = 0 and published=1 and videoid=$id union\n\t\t\t\tSELECT parentid as number,id,parentid,videoid,subject,name,created,message\n\t\t\t\tFROM #__hdflv_comments where parentid !=0 and published=1 and videoid=$id\n\t\t\t\tORDER BY number desc,parentid\";## Query is to display the comments posted for particular video\n\n\t\t$db->setQuery($query);\n\t\t$db->query();\n\t\t$commentTotal = $db->getNumRows();\n\n\t\t$pageNav = new JPagination($commentTotal, $limitstart, $limit);\n\n $query = \"$query LIMIT $pageNav->limitstart,$pageNav->limit\";\n\t\t$db->setQuery($query);\n\t\t$comment = $db->loadObjectList();\n\n\t\t$query = \"SELECT `title` FROM #__hdflv_upload WHERE id = $id\";\n\t\t$db->setQuery($query);\n\t\t$videoTitle = $db->loadResult();\n\n\t\t/**\n\t\t * get the most recent database error code\n\t\t * display the last database error message in a standard format\n\t\t *\n\t\t */\n\t\tif ($db->getErrorNum())\n\t\t{\n\t\t\tJError::raiseWarning($db->getErrorNum(), $db->stderr());\n\t\t}\n\n\t\t$comment = array('pageNav' => $pageNav, 'limitstart' => $limitstart, 'comment' => $comment ,'videotitle' => $videoTitle);\n\t\treturn $comment;\n\t}",
"public function getComments()\n {\n return $this->api->_request('GET', '/api/comments?id='.$this->ID);\n }",
"public function printAllComments($postID) {\n $query = new Zend_Gdata_Query('http://www.blogger.com/feeds/' . $this->blogID . '/' . $postID . '/comments/default'); \n $feed = $this->gdClient->getFeed($query);\n $this->parseFeed($feed); \n }",
"function get_comments_link($post = 0)\n {\n }",
"function get_comments_number($post = 0)\n {\n }",
"public function comments() {\n return $this->hasMany('App\\Models\\Comment', 'post_id');\n }",
"public function getComments() {}",
"public function comments()\n {\n // check if user is already loaded, if not, we fetch it from database\n if ($this->_comments) {\n return $this->_comments;\n } else {\n $comments = new Application_Model_DbTable_Comments();\n\n foreach ($comments->findAllBy('post_id', $this->_id) as $comment) {\n $this->_comments[] = $comment ;\n }\n return $this->_comments;\n }\n }",
"public function getCommentHierarchyByPost($postId = null) {\n if (!$postId)\n return false;\n $response = array();\n $commentModel = new Myblog_Model_Comment();\n $comments = $commentModel->getMapper()->findByField(array('post', 'parent'), array('post' => $postId, 'parent' => 0));\n\n if ($comments) {\n $userUtils = new Myblog_Model_Utils_User();\n foreach ($comments as $comment) {\n $comment = $comment->toArray();\n $comment['author'] = $userUtils->getNameById($comment['created_by']);\n $comment['children'] = $this->getChildren($postId, $comment['id']);\n $response[] = $comment;\n }\n }\n return $response;\n }",
"public function post_comments()\n {\n return $this->hasMany('arts\\Post_comment', 'post_id', 'post_id');\n }",
"public function getCommentsInfoByPostId($id) {\n $this->db->query('SELECT\n users.name,\n comments.content, posts.id AS postId,\n users.id AS userId,\n comments.id AS commentId,\n posts.created_at AS postCreated,\n users.created_at AS userCreated,\n comments.created_at AS commentCreated\n FROM\n comments\n INNER JOIN\n posts\n ON\n comments.post_id = posts.id\n INNER JOIN\n users\n ON\n comments.user_id = users.id\n WHERE \n comments.post_id = :id\n ORDER BY comments.created_at\n DESC;\n ');\n \n $this->db->bind(':id', $id);\n\n $result = $this->db->resultSet();\n\n return $result;\n }",
"public function get_comments()\n {\n }",
"public function global_get_comments($node_id, $offset = 0, $is_post = true, $pass_privacy_check = true, $post = array(), $top_sorted = false)\n {\n global $db, $system;\n $comments = [];\n $offset *= $system['min_results'];\n $order_query = ($top_sorted) ? \" ORDER BY posts_comments.reaction_like_count DESC, posts_comments.reaction_love_count DESC, posts_comments.reaction_haha_count DESC, posts_comments.reaction_yay_count DESC, posts_comments.reaction_wow_count DESC, posts_comments.reaction_sad_count DESC, posts_comments.reaction_angry_count DESC, posts_comments.replies DESC\" : \" ORDER BY posts_comments.comment_id DESC \";\n /* get comments */\n if ($is_post) {\n /* get post comments */\n if (!$pass_privacy_check) {\n /* (check|get) post */\n $post = $this->global_check_post($node_id, false);\n if (!$post) {\n return false;\n }\n }\n /* get post comments */\n $getPostComment = sprintf(\"SELECT posts_comments.*, users.user_name, users.user_firstname, users.user_lastname, users.user_gender, users.global_user_picture as user_picture,users.user_verified, pages.* FROM global_posts_comments as posts_comments LEFT JOIN users ON posts_comments.user_id = users.user_id AND posts_comments.user_type = 'user' LEFT JOIN pages ON posts_comments.user_id = pages.page_id AND posts_comments.user_type = 'page' WHERE NOT (users.user_name <=> NULL AND pages.page_name <=> NULL) AND posts_comments.node_type = 'post' AND posts_comments.node_id = %s \" . $order_query . \" LIMIT %s, %s\", secure($node_id, 'int'), secure($offset, 'int', false), secure($system['min_results'], 'int', false));\n $get_comments = $db->query($getPostComment) or _error(\"SQL_ERROR_THROWEN\");\n } else {\n /* get photo comments */\n /* check privacy */\n if (!$pass_privacy_check) {\n /* (check|get) photo */\n $photo = $this->global_get_photo($node_id);\n if (!$photo) {\n _error(403);\n }\n $post = $photo['post'];\n }\n /* get photo comments */\n $getPostComment = sprintf(\"SELECT posts_comments.*, users.user_name, users.user_firstname, users.user_lastname, users.user_gender, users.global_user_picture, users.user_verified, pages.* FROM global_posts_comments as posts_comments LEFT JOIN users ON posts_comments.user_id = users.user_id AND posts_comments.user_type = 'user' LEFT JOIN pages ON posts_comments.user_id = pages.page_id AND posts_comments.user_type = 'page' WHERE NOT (users.user_name <=> NULL AND pages.page_name <=> NULL) AND posts_comments.node_type = 'photo' AND posts_comments.node_id = %s \" . $order_query . \" LIMIT %s, %s\", secure($node_id, 'int'), secure($offset, 'int', false), secure($system['min_results'], 'int', false));\n $get_comments = $db->query($getPostComment) or _error(\"SQL_ERROR_THROWEN\");\n }\n if ($get_comments->num_rows == 0) {\n return $comments;\n }\n while ($comment = $get_comments->fetch_assoc()) {\n\n $comment['user_picture'] = $comment['global_user_picture'];\n /* pass comments_disabled from post to comment */\n $comment['comments_disabled'] = $post['comments_disabled'];\n\n /* check if the page has been deleted */\n if ($comment['user_type'] == \"page\" && !$comment['page_admin']) {\n continue;\n }\n /* check if there is any blocking between the viewer & the comment author */\n if ($comment['user_type'] == \"user\" && $this->blocked($comment['user_id'])) {\n continue;\n }\n //echo \"<pre>\".$comment['user_picture'];print_r($comment); exit;\n /* get reactions array */\n $comment['reactions']['like'] = $comment['reaction_like_count'];\n $comment['reactions']['love'] = $comment['reaction_love_count'];\n $comment['reactions']['haha'] = $comment['reaction_haha_count'];\n $comment['reactions']['yay'] = $comment['reaction_yay_count'];\n $comment['reactions']['wow'] = $comment['reaction_wow_count'];\n $comment['reactions']['sad'] = $comment['reaction_sad_count'];\n $comment['reactions']['angry'] = $comment['reaction_angry_count'];\n arsort($comment['reactions']);\n\n /* get total reactions */\n $comment['reactions_total_count'] = $comment['reaction_like_count'] + $comment['reaction_love_count'] + $comment['reaction_haha_count'] + $comment['reaction_yay_count'] + $comment['reaction_wow_count'] + $comment['reaction_sad_count'] + $comment['reaction_angry_count'];\n\n /* get replies */\n if ($comment['replies'] > 0) {\n $comment['comment_replies'] = $this->global_get_replies($comment['comment_id'], 0, true, $post);\n }\n\n /* parse text */\n $comment['text_plain'] = $comment['text'];\n $comment['text'] = $this->_parse([\"text\" => $comment['text']]);\n\n /* get the comment author */\n if ($comment['user_type'] == \"user\") {\n /* user type */\n $comment['author_id'] = $comment['user_id'];\n\n $comment['author_picture'] = get_picture($comment['global_user_picture'], $comment['user_gender']);\n\n $comment['author_url'] = $system['system_url'] . '/global-profile.php?username=' . $comment['user_name'];\n\n $comment['author_name'] = $comment['user_firstname'] . \" \" . $comment['user_lastname'];\n $comment['author_verified'] = $comment['user_verified'];\n } else {\n /* page type */\n $comment['author_id'] = $comment['page_admin'];\n $comment['author_picture'] = get_picture($comment['page_picture'], \"page\");\n\n $comment['author_url'] = $system['system_url'] . '/pages/' . $comment['page_name'];\n\n $comment['author_name'] = $comment['page_title'];\n $comment['author_verified'] = $comment['page_verified'];\n }\n\n /* check if viewer user react this comment */\n $comment['i_react'] = false;\n if ($this->_logged_in) {\n /* reaction */\n if ($comment['reactions_total_count'] > 0) {\n $get_reaction = $db->query(sprintf(\"SELECT reaction FROM global_posts_comments_reactions as posts_comments_reactions WHERE user_id = %s AND comment_id = %s\", secure($this->_data['user_id'], 'int'), secure($comment['comment_id'], 'int'))) or _error(\"SQL_ERROR_THROWEN\");\n if ($get_reaction->num_rows > 0) {\n $comment['i_react'] = true;\n $comment['i_reaction'] = $get_reaction->fetch_assoc()['reaction'];\n $comment['i_reaction_details'] = get_reaction_details($comment['i_reaction']);\n }\n }\n }\n\n /* check if viewer can manage comment [Edit|Delete] */\n $comment['edit_comment'] = false;\n $comment['delete_comment'] = false;\n if ($this->_logged_in) {\n /* viewer is (admins|moderators)] */\n if ($this->_data['user_group'] < 3) {\n $comment['edit_comment'] = true;\n $comment['delete_comment'] = true;\n }\n /* viewer is the author of comment */\n if ($this->_data['user_id'] == $comment['author_id']) {\n $comment['edit_comment'] = true;\n $comment['delete_comment'] = true;\n }\n /* viewer is the author of post || page admin */\n if ($this->_data['user_id'] == $post['author_id']) {\n $comment['delete_comment'] = true;\n }\n /* viewer is the admin of the group of the post */\n if ($post['in_group'] && $post['is_group_admin']) {\n $comment['delete_comment'] = true;\n }\n /* viewer is the admin of the event of the post */\n if ($post['in_group'] && $post['is_event_admin']) {\n $comment['delete_comment'] = true;\n }\n }\n\n $comments[] = $comment;\n }\n return $comments;\n }",
"function get_comments($post_id){\n include('../../common/database/config.php');\n\n $sql = 'SELECT c.id,c.content,c.created_time,u.name FROM comments as c \n LEFT JOIN users as u on c.user_id = u.id\n where c.post_id = \"'.$post_id.'\"';\n $res = mysqli_query($conn,$sql);\n\n $res_array = mysqli_fetch_all($res, MYSQLI_ASSOC);\n\n return $res_array;\n}",
"function get_comments(){\n\n\t}",
"public function getComments($idPoem) {\n \n $sql = 'SELECT COM_ID as id, ' . \n ' COM_DATE as date, ' . \n ' COM_AUTHOR as author, ' . \n ' COM_CONTENT as content ' . \n 'FROM T_COMMENT ' . \n 'WHERE ARTICLE_ID = ? ';\n \n $comments = $this->executeQuery($sql, array($idPoem));\n \n return $comments;\n }",
"public function comments()\n {\n return $this->hasMany(Comment::class, 'post_id');\n }",
"function getCommentIdsofPost($postId){\n global $conn;\n\n\n $commentIdArray = array();\n\n $sql = \"SELECT commentId from comment WHERE postId = $postId AND deleted = 0 ORDER BY creationTime ASC;\";\n $result = mysqli_query($conn, $sql);\n\n if (mysqli_num_rows($result) > 0) {\n while ($row = mysqli_fetch_assoc($result)) {\n\n $commentIdArray[] = $row['commentId'];\n\n\n }\n } else {\n\n # if Post got no Comments\n echo \"<br>\";\n echo \"<div class='commentContainer'> <p>No Comments</p></div>\";\n echo \"<br>\";\n\n }\n\n return $commentIdArray;\n}",
"function getPostComments(int $postId, object $pdo): array\n {\n $statement = $pdo->prepare('SELECT id, user_id, post_id, content, date\n FROM comments\n WHERE post_id = :post_id\n ORDER BY date DESC');\n $statement->bindParam(':post_id', $postId, PDO::PARAM_INT);\n $statement->execute();\n $postComments = $statement->fetchAll(PDO::FETCH_ASSOC);\n return $postComments;\n }",
"function get_comments($pid){\r\n\t$pid = (int)$pid;\r\n\t\r\n\t$sql = \"SELECT\r\n\t\t\t\t`comment_body` AS `body`,\r\n\t\t\t\t`comment_user` AS `user`,\r\n\t\t\t\tDATE_FORMAT(`comment_date`, '%d/%m/%Y %H:%i:%s') AS `date`\r\n\t\t\tFROM `comments`\r\n\t\t\tWHERE `post_id` = {$pid}\r\n\t\t\tORDER BY `comments`.`comment_date` DESC\";\r\n\t\t\t\r\n\t$comments = mysql_query($sql);\r\n\t\r\n\t$return = array();\r\n\twhile (($row = mysql_fetch_assoc($comments)) !== false) {\r\n\t\t$return[] = $row;\r\n\t}\r\n\t\r\n\treturn $return;\r\n}",
"public function comments(){\n return $this->hasMany('App\\TextPostComment', 'post_id');\n }",
"public function index($post)\n {\n return view('comments.comments')->with('comments',$this->masterController->index($post));\n }",
"public function showComments(){\n if (isset($_GET['id'])) {\n $postId = $_GET['id'];\n $postRepository = new PostRepository();\n //call to readById\n $post = $postRepository->readById($postId);\n $commentRepository = new CommentRepository();\n $commentlist = $commentRepository->getComments($postId);\n $this->commentView($post, $commentlist);\n }\n }",
"function get($post_id, $from = 0)\n {\n $post = $from == 0 ? Post::findOrfail($post_id) : [];\n \n // Check if this is the first fetch\n $comments = $from == 0\n ? Comment::where('post_id', $post_id)->orderBy('created_at', 'desc')->take(11)->get()\n : Comment::where('post_id', $post_id)->where('id', '<', $from)->orderBy('created_at', 'desc')->take(11)->get();\n\n $comments = $comments->reverse();\n\n // Check for pagination\n $show_load_more = (count($comments) == 11) ? true : false;\n $fr = (count($comments) == 11) ? $comments[10]->id : 0;\n\n return view('components.post.comments-inner', [\n 'comments' => $comments,\n 'slm' => $show_load_more,\n 'post_id' => $post_id,\n 'from' => $fr,\n 'post' => $post\n ]);\n }",
"public function getComments($id){\n $id = (int)$id;\n $sql = \"select * from comments WHERE discussion_id = '{$id}'\";\n return $this->db->query($sql);\n }",
"public function getUserPostComment($user_id)\n {\n return Comment::find()->with('user')->with('post')->where(['user_id' => $user_id,'status' => '1','parent_comment_id'=>'0'])->orderBy(['created_date'=>SORT_DESC])->all();\n \n }",
"static function get_post_by_id($post){\n\t\treturn self::$db->where('token_id',$post)->get('blog')->results();\n\t}",
"public function commentsAction()\r\n\t{\r\n\t\ttry\r\n\t\t{\r\n\t\t\t$user = Application_Model_User::getAuth();\r\n\r\n\t\t\t$id = $this->_request->getPost('id');\r\n\r\n\t\t\tif (!v::intVal()->validate($id))\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException('Incorrect post value: ' .\r\n\t\t\t\t\tvar_export($id, true));\r\n\t\t\t}\r\n\r\n\t\t\tif (!Application_Model_News::checkId($id, $post, ['join'=>false]))\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException('Incorrect post ID');\r\n\t\t\t}\r\n\r\n\t\t\t$start = $this->_request->getPost('start', 0);\r\n\r\n\t\t\tif (!v::intVal()->validate($start))\r\n\t\t\t{\r\n\t\t\t\tthrow new RuntimeException('Incorrect start value: ' .\r\n\t\t\t\t\tvar_export($start, true));\r\n\t\t\t}\r\n\r\n\t\t\t$limit = 30;\r\n\t\t\t$model = new Application_Model_Comments;\r\n\t\t\t$comments = $model->findAllByNewsId($id, [\r\n\t\t\t\t'limit' => $limit,\r\n\t\t\t\t'start' => $start,\r\n\t\t\t\t'owner_thumbs' => [[55,55]]\r\n\t\t\t]);\r\n\r\n\t\t\t$response = ['status' => 1];\r\n\r\n\t\t\tif (count($comments))\r\n\t\t\t{\r\n\t\t\t\tforeach ($comments as $comment)\r\n\t\t\t\t{\r\n\t\t\t\t\t$response['data'][] = My_ViewHelper::render('post/_comment', [\r\n\t\t\t\t\t\t'user' => $user,\r\n\t\t\t\t\t\t'comment' => $comment,\r\n\t\t\t\t\t\t'post' => $post,\r\n\t\t\t\t\t\t'limit' => 250\r\n\t\t\t\t\t]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$count = max($post->comment - ($start + $limit), 0);\r\n\r\n\t\t\t\tif ($count > 0)\r\n\t\t\t\t{\r\n\t\t\t\t\t$response['label'] = $model->viewMoreLabel($count);\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tcatch (Exception $e)\r\n\t\t{\r\n\t\t\tMy_Log::exception($e);\r\n\t\t\t$response = [\r\n\t\t\t\t'status' => 0,\r\n\t\t\t\t'message' => $e instanceof RuntimeException ? $e->getMessage() :\r\n\t\t\t\t\t'Internal Server Error'\r\n\t\t\t];\r\n\t\t}\r\n\r\n\t\t$this->_helper->json($response);\r\n\t}",
"public function postPage(){\n require_once \"controller/Post.php\";\n $post = new Post();\n require_once \"controller/Comment.php\";\n $comment = new Comment();\n //gets the post id in URL\n $idPost = $this->_url[1];\n //adds post info\n $html_post = $post->getPost($idPost);\n $html = View::makeHtml($html_post, \"post_template\");\n $html .= \"<br/><div id=\\\"comments\\\"><h2>Commentaires</h2><ul>\";\n //count nb of comments for the post\n $nb_comments = $comment->countComments($idPost);\n //according to nb of comments\n switch ($nb_comments[\"nb_comments\"]){\n case 0:\n $html .= \"<p>Pas encore de commentaire</p>\";\n break;\n case 1:\n //adds comments infos\n $html_comments = $comment->getComments($idPost);\n $html .= View::makeHtml($html_comments, \"comments_template\");\n break;\n default:\n $html_comments = $comment->getComments($idPost);\n $html .= View::makeLoopHtml($html_comments, \"comments_template\");\n break;\n }\n //adds the \"leave a comment\" form\n $html .= \"</ul>\";\n $html .= View::makeHtml([\n \"{{ path }}\" => $GLOBALS[\"path\"],\n \"{{ idPost }}\" => $idPost\n ],\"add_comment_template\");\n $html .= \"</div>\";\n return [\n \"{{ pageTitle }}\" => $html_post[\"{{ post_title }}\"],\n \"{{ content }}\" => $html,\n \"{{ path }}\" => $GLOBALS[\"path\"]\n ];\n }",
"public function getComments($postId, $connectedUserId, $db)\n {\n\n $dbLike = $db == DB_COMMENTS_NEWS ? DB_COMMENTS_NEWS_LIKES : DB_COMMENTS_IMG_LIKES;\n\n $sql = \"SELECT *, n.id, u.id AS userId, u.avatar, u.contentId, l.userId AS likedComment\n FROM \" . $db . \" n\n LEFT JOIN\n users AS u\n ON (n.userId = u.id)\n LEFT OUTER JOIN\n \" . $dbLike . \" AS l\n ON (l.userId = :connectedUserId AND n.id = l.commentId)\n WHERE n.postId = :postId ORDER BY datePosted DESC\n \";\n\n $req = Database::getBdd()->prepare($sql);\n\n $req->bindValue(':postId', $postId, PDO::PARAM_INT);\n $req->bindValue(':connectedUserId', $connectedUserId, PDO::PARAM_INT);\n\n $req->execute(); \n\n $comments = [];\n while ($data = $req->fetch(PDO::FETCH_ASSOC)) \n { \n $comments[] = $data;\n }\n return $comments;\n\n return (!empty($comments)) ? $comments : null; \n }",
"public function comments(): HasMany\n {\n return $this->posts()\n ->where('is_private', false)\n ->whereNull('hidden_at')\n ->where('type', 'comment');\n }",
"private function _GetCommentByPostedId()\n {\n global $DB;\n if($cid = Is_Valid_Number(GetVar('cid', 0, 'whole_number'),0,1,99999999))\n {\n $DB->result_type = MYSQL_ASSOC;\n $c_arr = $DB->query_first('SELECT * FROM {comments} WHERE commentid = %d LIMIT 1', $cid);\n return $c_arr;\n }\n return false;\n }",
"public function getCommentsForWallpostAction()\n {\n $params = $this->getRequest()->getParams();\n //Get users blocked and users who have blocked logged in user.\n\t$blocked_user = \\Extended\\blocked_users::getAllBlockersAndBlockedUsers(Auth_UserAdapter::getIdentity()->getId());\n\t\n\techo Zend_Json::encode( \\Extended\\comments::getCommentsForWallpost( \\Auth_UserAdapter::getIdentity()->getId(), $params['wallpost_id'], $params['offset'], 10, $blocked_user ) );\n\t\n\n\tdie;\n }",
"public function listValidated($post_id)\n {\n return $this->query(\n \"SELECT comments.id, comments.content, comments.date, users.username as author, users.profilePic as authorpic\n FROM comments\n Left JOIN users ON comments.author = users.id\n WHERE comments.post = ? AND comments.status = 1\",\n [$post_id]\n );\n }",
"public function getAllComments()\n\t{\n\t\t$req=$this->_bdd->query('SELECT Comments.id, content_com AS content, DATE_FORMAT(date_com, \"%d/%m/%Y %Hh%imin%ss\") AS date, id_users, id_post, moderate, login FROM Comments INNER JOIN Users ON id_users=Users.id WHERE moderate >0 ORDER BY moderate DESC');\n\t\t\n\t\t$comments=[];\n\t\twhile($datas=$req->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t\n\t\t\t\t $comments[]=new Comments($datas);\n\t\t\t\t //return $comments;\n\t\t\t\n\t\t\t\n\t\t}\n\t\treturn $comments;\n\t}",
"function getPostCommentReplies(object $pdo, int $post_id): array\n{\n $statement = $pdo->prepare('SELECT * FROM comment_replies WHERE post_id = :post_id');\n $statement->bindParam(':post_id', $post_id, PDO::PARAM_INT);\n $statement->execute();\n\n $replies = $statement->fetchAll(PDO::FETCH_ASSOC);\n return $replies;\n}",
"public function getComments() {\n\t\treturn $this->api->getCommentsByPhotoId($this->getId());\n\t}",
"public function getComments ()\n {\n $db = $this->dbConnect ();\n $req = $db->prepare ('SELECT id_comment,signalement,id_chapter,author,comment,DATE_FORMAT(dateComment, \\'%d/%m/%Y \\') AS dateComment FROM comments WHERE ? ORDER BY id_comment DESC ');\n $req->execute (array ( 1 ));\n return $req;\n }",
"public static function get_cms_comment_url_list()\n\t{\n\t\treturn self::get_cms_post_url_list(Helper_PostType::COMMENT);\n\t}",
"public function GetPostCommentByid($id)\n\t{\n\t\t$this->db->where('PostId', $id);\n\t\t$this->db->select('CommentDate,CommentText,FirstName,LastName');\n\t\t$this->db->from('tbl_postcomment');\n\t\t$this->db->join('tbl_userdetails', 'tbl_userdetails.Id = tbl_postcomment.UserId', 'inner');\n\t\t$query=$this->db->get();\n\t\treturn array(\n\t\t\t\t'main_view' => 'home/postdetails_view',\n\t\t\t\t'navcategory' => $this->home_model->navcaregory(),\n\t\t\t\t'postdetails' => $this->home_model->GetAuthorPostByid($id),\n\t\t\t\t'postcomment' => $query->result(),\n\t\t\t\t'numberComments' => $query->num_rows()\n\t\t\t\t);\n\t}",
"function aff_comm_post($id_post) {\n\n\t\t$req = $GLOBALS['bdd']->prepare('SELECT b.*, d.*\n\t\t\t\t\t\t\t\tFROM badin b\n\t\t\t\t\t\t\t\tINNER JOIN dactyle d\n\t\t\t\t\t\t\t\tON b.bigarade = d.dazibao\n\t\t\t\t\t\t\t\tWHERE b.balsamine = ? \n\t\t\t\t\t\t\t\tAND b.bouquetin = 2\n\t\t\t\t\t\t\t\tORDER BY b.brimade DESC');\n\t\t$req->execute(array($_POST['post_id']));\n\t\t\t\t\t\t\t\t\t\n\t\twhile ($donnees = $req->fetch())\n\t\t{\n\t\t?>\n\t\t\t<div id=\"<?php echo $donnees['baliverne'];?>\" >\n\t\t\t\t<div class=\"zone_comment\" id=\"zone_comment\">\n\t\t\t\t\t<div class=\"mini_profil_comment\">\n\t\t\t\t\t\t<img class=\"mini_profil_img\" src=\"/ressources/images/profil/<?php echo $donnees['dazibao'];?>/profil_<?php echo $donnees['dessication'];?>\" />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"auteur_et_date_comment\" >\n\t\t\t\t\t\t<a class=\"lien_nom_comment\" href=\"/<?php echo $donnees['diatribe'].'/'.$donnees['decapode'].'-'.$donnees['dazibao'].'/';?>\">\n\t\t\t\t\t\t\t<?php echo $donnees['decapode'];?>\n\t\t\t\t\t\t</a>\n\t\t\t\t\t\t<div class=\"date_post\" >\n\t\t\t\t\t\t\tLe <?php echo $donnees['brimade'];?>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"contenu_comment\">\n\t\t\t\t\t\t<?php echo $donnees['bryophite']; ?>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t<?php\n\t\t}\n\t\t$req->closeCursor();\n\n\t}",
"public function getComment($idComment)\n\t{\t\n\t\t$req=$this->_bdd->query('SELECT id, content_com AS content, DATE_FORMAT(date_com, \"%d/%m/%Y %Hh%imin%ss\") AS date, id_users AS idUser, id_post AS idPost, moderate FROM Comments WHERE id='.$idComment);\n\t\t//die(var_dump($idComment));\n\t\twhile($datas=$req->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$comment=new Comments($datas);\n\t\t}\n\t\treturn $comment;\n\t}",
"function getComments($pdo, $post_id){\n $statement = $pdo->query(\n\t\"SELECT username, comment_id, comment, comment_date\n\tFROM users\n\tINNER JOIN comments\n\tON users.id = comments.user_id\n\tWHERE post_id = '$post_id' \");\n\n $comments = $statement->fetchAll(PDO::FETCH_ASSOC);\n\n if (!$statement) {\n die(var_dump($pdo->errorInfo()));\n }\n\n return $comments;\n}",
"function get_post ($postid, $draftok = FALSE, $process = 'none'){\n\t\t$process = strtolower($process);\n if (!is_numeric($postid))\n return false;\n\t\t$stmt = '';\n if (!$draftok){\n $stmt = $this->_db->Prepare(\"SELECT posts.*, authors.nickname, authors.email, authors.fullname, COUNT(comments.commentid) AS NUMCOMMENTS FROM `\".T_POSTS.\"` AS posts LEFT JOIN `\".T_AUTHORS.\"` AS authors ON posts.ownerid = authors.id LEFT JOIN `\".T_COMMENTS.\"` AS comments ON posts.postid = comments.postid WHERE posts.postid=? AND posts.status='live' GROUP BY posts.postid\");\n\t\t}\n else{\n $stmt = $this->_db->Prepare(\"SELECT posts.*, authors.nickname, authors.email, authors.fullname, COUNT(comments.commentid) AS NUMCOMMENTS FROM `\".T_POSTS.\"` AS posts LEFT JOIN `\".T_AUTHORS.\"` AS authors ON posts.ownerid = authors.id LEFT JOIN `\".T_COMMENTS.\"` AS comments ON posts.postid = comments.postid WHERE posts.postid=? GROUP BY posts.postid\");\n\t\t}\n $post = $this->_db->GetRow($stmt, array($postid));\n if(!$post){\n $this->status = 'No post found';\n return false;\n }\n if($process == 'none')\n return $post;\n else{\n return $this->processForHtmlDisplay($post);\n }\n }",
"public function getCommentsAdmin() \n {\n $db = $this->dbConnect();\n $reqPostComments = $this->bdd->query('SELECT id, id_post, author, comment, DATE_FORMAT(date_comment, \\'Le %d/%m/%Y à %H h %i\\') AS date_comment FROM comments ORDER BY date_comment DESC');\n $commentsId = $reqPostComments->fetchAll();\n $reqPostComments->closeCursor();\n return $commentsId;\n }",
"function get_comment_id_fields($post = \\null)\n {\n }",
"public function getCommentsData()\n {\n $query = $this->getComments()->orderBy(['tree' => SORT_ASC, 'lft' => SORT_ASC]);\n $dependency = new TagDependency(['tags' => [self::CACHE_TAG_POST_ALL_COMMENTS]]);\n return self::getDb()->cache(static function () use ($query) {\n return $query->all();\n }, self::CACHE_DURATION, $dependency);\n }",
"public function forPost(Post $post)\n {\n return $post->where('status', 1)\n ->orderBy('created_at', 'desc')\n ->get();\n }",
"public function list_comments()\n {\n $url = $this->instanceUrl() . '/comments';\n list($response, $opts) = $this->_request('get', $url, null, null);\n\n // This is needed for nextPage() and previousPage()\n $response['url'] = $url;\n\n $obj = Util\\Util::convertToTelnyxObject($response, $opts);\n return $obj;\n }",
"public function getCommentCount($post_id)\n {\n $comments = Comment::find()->where(['post_id' => $post_id,'status' => '1'])->orderBy(['created_date'=>SORT_DESC])->all();\n \n return count($comments);\n }",
"public function init_post_comments($id)\n {\n $_comments = '';\n $total_comments = total_rows(db_prefix() . 'mention_post_comments', [\n 'postid' => $id,\n ]);\n if ($total_comments > 0) {\n $page = $this->input->post('page');\n if (!$this->input->post('page')) {\n $_comments .= '<div class=\"panel-footer post-comment post-comment\">';\n }\n $comments = $this->mention_model->get_post_comments($id, $page);\n // Add +1 becuase the first page is already inited\n \n foreach ($comments as $comment) {\n $_comments .= $this->comment_single($comment);\n }\n \n if (!$this->input->post('page')) {\n $_comments .= '</div>';\n }\n }else{\n $_comments .= '<div class=\"panel-footer post-comment post-comment\">';\n $_comments .= '</div>'; // end comments footer\n }\n if (($this->input->is_ajax_request() && $this->input->get('refresh_post_comments')) || ($this->input->is_ajax_request() && $this->input->post('page'))) {\n echo html_entity_decode($_comments);\n } else {\n return $_comments;\n }\n }",
"function get_pending_comments_num($post_id)\n {\n }",
"public function comments()\n {\n return $this->hasMany('Model\\PostComment');\n }",
"public static function getCommentById($id)\n {\n $id = intval($id);\n\n if ($id) {\n $commentItem = [];\n $db = Db::getConnection();\n $result = $db->query('SELECT * FROM comments WHERE id_to_what_post =' . $id);\n\n $i = 0;\n while($row = $result->fetch()) {\n //$commentItem[$i]['id_to_what_post'] = $row['id_to_what_post'];\n $commentItem[$i]['date'] = $row['date'];\n $commentItem[$i]['text'] = $row['text'];\n $commentItem[$i]['author'] = $row['author'];\n $i++;\n }\n\n return $commentItem;\n }\n }",
"function getPost($id){\n $posts = $this->postManager->getPosts()->fetchAll();\n $post = $this->postManager->getPost($id);\n $comments = $this->commentManager->getComments($id)->fetchAll();\n $commentsNumber = count($comments);\n $total = count($this->postManager->getPosts()->fetchAll());\n $key = array_search($post['id'], array_column($posts, 'id'));\n require 'views/front/single.php';\n }",
"function post()\n {\n $post = $this->postManager->getPost($_GET['id']);\n if ($post == true) {\n $comments = $this->commentManager->getComments($_GET['id']);\n require('view/frontend/postView.php');\n } else {\n require('view/backend/sbadmin2/404.php');\n }\n }",
"public function getComments()\n {\n return $this->comments;\n }",
"public function getComments()\n {\n return $this->comments;\n }"
]
| [
"0.7781625",
"0.76884204",
"0.768505",
"0.7647238",
"0.7641957",
"0.756366",
"0.74123174",
"0.7395138",
"0.7391154",
"0.73426175",
"0.7329135",
"0.73271227",
"0.7287812",
"0.71365654",
"0.708029",
"0.70792246",
"0.7076103",
"0.70547897",
"0.6980033",
"0.68874097",
"0.6877569",
"0.68584627",
"0.6854822",
"0.6851687",
"0.6840921",
"0.67959803",
"0.6789227",
"0.6757493",
"0.6745364",
"0.6734692",
"0.6729523",
"0.67224514",
"0.6701823",
"0.66825855",
"0.6659645",
"0.66468316",
"0.66304743",
"0.6623763",
"0.66234607",
"0.66222346",
"0.661283",
"0.6581741",
"0.6567581",
"0.65313786",
"0.6523822",
"0.65213907",
"0.65151054",
"0.65024424",
"0.6489149",
"0.64860326",
"0.6483455",
"0.6482835",
"0.6482651",
"0.6467008",
"0.6456418",
"0.64539695",
"0.64524555",
"0.6441723",
"0.64208883",
"0.64184105",
"0.6412745",
"0.6402488",
"0.6394436",
"0.63880455",
"0.6380603",
"0.63788444",
"0.6369534",
"0.6350645",
"0.6340162",
"0.6328927",
"0.63259035",
"0.631728",
"0.63154846",
"0.62997454",
"0.62973076",
"0.62970793",
"0.6285768",
"0.62715995",
"0.6226117",
"0.6225842",
"0.6224195",
"0.62233037",
"0.62154835",
"0.6211343",
"0.61986643",
"0.619765",
"0.61936283",
"0.6189881",
"0.6187786",
"0.61748785",
"0.61613005",
"0.6155975",
"0.61553323",
"0.6153441",
"0.6149013",
"0.6142536",
"0.61352414",
"0.6120479",
"0.60971653",
"0.6089272",
"0.6089272"
]
| 0.0 | -1 |
creates a new comment | public static function createNew( array $token, string $post, string $body){
$user = TokenManagement::checkTokenJson( $token);
if ($user != null && $user["status"] == "OK"){
$comment = CommentDatabase::createNew( $token["id"], $post, $body);
if ($comment == null){
return array( "status" => "ERROR", "error" => "INVALID POST", "version" => "v1");
}else{
return array( "status" => "OK", "id" => $comment->getId(), "version" => "v1");
}
}else{
return array( "status" => "ERROR", "error" => "INVALID TOKEN", "version" => "v1");
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create($comment)\n {\n\n }",
"public function create()\n {\n $this->validation[\"body\"][\"format\"][] = $this->body;\n if (!$this->validate()) {\n throw new ValidationException(\"invalid comment\");\n }\n $db = DB::conn();\n $set_params = array(\n \"thread_id\" => $this->thread_id, \n \"username\" => $this->username, \n \"body\" => $this->body\n );\n $db->insert(self::COMMENT_TABLE, $set_params);\n }",
"public function newComment() {\n $datas['chapter_id'] = abs((int) $_GET['id']);\n $datas['author'] = trim(htmlspecialchars((string) $_POST['newCommentAuthor']));\n $datas['content'] = trim(htmlspecialchars((string) $_POST['newCommentContent']));\n\n if (!empty($datas['content']) && !empty($datas['author'])) {\n $commentMngr = new CommentManager();\n $commentMngr->add($datas);\n \n $_SESSION['commentsPseudo'] = $datas['author'];\n } else {\n $GLOBALS['error']['newComment'] = \"Un commentaire ne peut pas être vide et doit impérativement être associé à un pseudo.\";\n }\n }",
"public function createComment(): CommentableInterface;",
"public function createComment($comment, $author, $email, $chapter_id) {\n \n global $db; // defined in models/connect.php\n $sql = $db->prepare('\n INSERT INTO comment (comment, author, email, comment_date,chapter_id) \n VALUES(?, ?, ?, NOW(), ?)\n ');\n $affectedLines = $sql->execute(array($comment, $author, $email, $chapter_id));\n //result is commented out\n }",
"function newUnderComment();",
"public function new_comment ($parent_id)\n {\n $Result = $this->_make_comment ();\n $Result->parent_id = $parent_id;\n return $Result;\n }",
"public function createComment(array $comment)\n {\n $comment[\"porcelain\"] = null; // wp-Cli returns only id\n return intval($this->runWpCliCommand(\"comment\", \"create\", $comment));\n }",
"public function createAction()\n\t{\n\t\t$this->_helper->acl->authorizeUser(new Application_Model_Comment(), 'create', 'You are not allowed to create a new comment');\n\n\t\tif ($this->_request->isPost()) {\n\t\t\t$form = $this->getCreateForm();\n\n\t\t\tif (!$form->isValid($_POST)) {\n\t\t\t\t$this->sendJsonFormError($form);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\t$data = new Application_Model_Comment();\n\t\t\t$data->id_user = $this->_user->getId();\n\t\t\t$data->comment = $_POST['comment'];\n\t\t\t$data->comment_type = $_POST['comment_type'];\n\n\t\t\t$r = $this->_commentMapper->save($data);\n\n\t\t\t$url = $this->getFrontController()->getRouter()->assemble(array('controller' => 'comment', 'action' => 'index'));\n\t\t\t$this->_redirect($url);\n\t\t}\n\t}",
"static public function createNewComment($userid, $articleid, $comment){\n $res = ArticleModel::createNewComment($userid, $articleid, $comment);\n return $res;\n }",
"public function create(): string\n\t{\n\t\t$user = $this->user;\n\n\t\tif ($user->users_group_id == 1 ) {\n\t\t\t$status = ucfirst($this->request->post('status'));\n\t\t}else {\n\t\t\t$status = $this->settings;\n\t\t\t$status = $status->get('commentaires_status');\n\t\t}\n\n\t\t$this->data('user_id', $user->id)\n\t\t\t ->data('episode_id', $this->request->post('episode_id'))\n\t\t\t ->data('comment', ucfirst($this->request->post('details')))\n\t\t\t ->data('email', $user->email)\n\t\t\t ->data('created', $now = time())\n\t\t\t ->data('status', $status)\n\t\t\t ->data('reported', 0)\n\t\t\t ->data('ip', $this->request->server('REMOTE_ADDR'))\n\t\t\t ->insert('comments');\n\n\t\t$successMessage = 'votre commentaire est ajouté avec succèss .';\n\n\t\treturn $successMessage;\n\t}",
"public function doCreateComment()\n {\n if (isset($_POST)) {\n if (!$this->comment_is_valid($_POST['text'])) {\n header('Location: /post/details/?id=' . $_POST['post_id']);\n exit();\n }\n $text = htmlspecialchars($_POST['text']);\n $post_id = $_POST['post_id'];\n $this->commentRepository->create($_SESSION['userid'], $text, $post_id);\n }\n }",
"public static function createComments($request);",
"public function createComment($postID, $commentText) {\n $uri = 'http://www.blogger.com/feeds/' . $this->blogID . '/' . $postID . '/comments/default'; \n \n $newComment = $this->gdClient->newEntry(); \n $newComment->content = $this->gdClient->newContent($commentText); \n $newComment->content->setType('text'); \n $createdComment = $this->gdClient->insertEntry($newComment, $uri); \n \n echo 'Added new comment: ' . $createdComment->content->text . \"\\n\";\n // Edit link follows format: /feeds/blogID/postID/comments/default/commentID \n $editLink = split('/', $createdComment->getEditLink()->href);\n $commentID = $editLink[8]; \n \n return $commentID; \n }",
"protected function newComment($post)\n\t{ \n\t\t$comment=new Comment;\n if(isset($_POST['ajax']) && $_POST['ajax']==='comment-form')\n\t\t{\n\t\t\techo CActiveForm::validate($comment);\n\t\t\tYii::app()->end();\n\t\t}\n if(isset($_POST['Comment']))\n\t\t{ $comment->attributes=$_POST['Comment'];\n if($post->addComment($comment))\n {\n Yii::app()->user->setFlash('commentSubmitted','Спасибо за сообщение. Сообщения заказчиков и исполнителей появляются после модерации');\n $this->refresh(); \n } \n }\n\t\treturn $comment;\n\t}",
"private function _createCommentField()\n {\n $comment = new Zend_Form_Element_Textarea('comment');\n $comment->setLabel('bankComment')\n ->addFilter(new Zend_Filter_StringTrim())\n ->addFilter(new Zend_Filter_StripTags())\n ->addValidator(new Zend_Validate_StringLength(array('min' => 5)))\n ->setAttribs(array('cols' => '60', 'rows' => '5'));\n\n return $comment;\n }",
"private function wp_new_comment( $commentdata ) {\n $commentdata = apply_filters('preprocess_comment', $commentdata);\n\n $commentdata['comment_post_ID'] = (int) $commentdata['comment_post_ID'];\n if ( isset($commentdata['user_ID']) ) {\n $commentdata['user_id'] = $commentdata['user_ID'] = (int) $commentdata['user_ID'];\n } elseif ( isset($commentdata['user_id']) ) {\n $commentdata['user_id'] = (int) $commentdata['user_id'];\n }\n\n $commentdata['comment_date'] = current_time('mysql');\n $commentdata['comment_date_gmt'] = current_time('mysql', 1);\n\n $commentdata = wp_filter_comment($commentdata);\n\n $commentdata['comment_approved'] = 1;\n\n $comment_ID = wp_insert_comment($commentdata);\n\n do_action('comment_post', $comment_ID, $commentdata['comment_approved']);\n \n if (get_option('comments_notify')) {\n wp_notify_postauthor($comment_ID);\n }\n \n return $comment_ID;\n }",
"public function create() {\n // we expect a url of form ?controller=comment&action=create\n // if it's a GET request display a blank form for creating a new comment\n // else it's a POST so add to the database using models/comment.php\n if($_SERVER['REQUEST_METHOD'] == 'GET'){\n require_once('views/blogs/read.php');\n }\n else { \n $blogcomment = Comment::addComment($_GET['blogid']);\n require('models/comment.php');\n }\n }",
"public function create()\n {\n // @TODO: Either implement create comment view or delete method.\n }",
"public function newComment($comment_id) \n\t\t{\n\t\t\t$comment = get_comments(array('ID' => $comment_id));\n\t\t\t$comment = $comment[0];\n\n\t\t\tif($comment->comment_approved != 1) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$thingdom = $this->getThingdom();\n\t\t\t\n\t\t\tif(!$thingdom) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$post_title = get_the_title($comment->comment_post_ID);\n\n\t\t\t$thing = $thingdom->getThing($this->thingName, $this->thingType);\n\n\t\t\t$thing->feed('new_comment', \"New comment on: {$post_title}\\n<br>From: {$comment->comment_author}<br>\\nComment: {$comment->comment_content}\");\n\t\t}",
"function CreateComment( $obj )\n\t{\n\t\treturn $this->pDBInterface->Query( $this->pDBInterface->CreateInsertQuery($this->sCommentTb, $obj ) );\n\t}",
"public function NewCommentManga(){\r\n $this->comment(); \r\n $this->pseudoPost();\r\n $this->contentPost();\r\n $this->_commentManager->AddComment($this->_pseudoPostSecure, $this->_contentPostSecure, $_GET['id'],true,false); \r\n header('location: Tome&id='.$_GET[\"id\"]); \r\n }",
"protected static function createComment(Request $request){\n \t$videoId = InputSanitise::inputInt($request->get('video_id'));\n \t$userComment = $request->get('comment');\n \t$comment = new static;\n \t$comment->body = $userComment;\n \t$comment->course_video_id = $videoId;\n \t$comment->user_id = Auth::user()->id;\n \t$comment->save();\n \treturn $comment;\n }",
"function addComment(){\n\t\t$this->Article->Comment->create();\n\t\tif ($this->Article->Comment->save($this->data)) {\n\t\t\techo __('Your comment has been added successfully, and will be viewed soon after approving.', true);\n\t\t} else {\n\t\t\techo __('Your comment could not be added.', true);\n\t\t\techo '<br />';\n\t\t\tforeach($this->Article->Comment->validationErrors as $key=>$val){\n\t\t\t\techo $val.',<br />';\n\t\t\t}\n\t\t\techo 'and try again.';\n\t\t}\n\t\t$this->autoRender = false;\n\t}",
"public function addComment() {\n $body = $this->getData();\n\n $comentario = $body->comentario;\n $usuario = $body->usuario;\n $fecha = $body->fecha;\n $puntaje = $body->puntaje;\n $id_jugador = $body->id_jugador;\n $id_comentario = $this->model->insert($comentario, $usuario, $fecha, $puntaje, $id_jugador);\n\n if($id_comentario) {\n $this->view->response(\"Se agrego el comentario nùmero: {$id_comentario}\", 200);\n } else {\n $this->view->response(\"El comentario no se pudo agregar \", 500);\n }\n\n }",
"abstract public function comment();",
"private function runComment()\n {\n $num = (int) $this->ask('How many records do you want to create for the comments table?');\n factory(Comment::class, $num)->create();\n }",
"public function actionCreate() {\n $model = new Comment;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Comment'])) {\n $model->attributes = $_POST['Comment'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }",
"private function getNewComment(int $userId, int $articleId, array $data): Comment\r\n {\r\n $comment = new Comment();\r\n\r\n return $comment\r\n ->setContent($data['content'])\r\n ->setIsEdited(0)\r\n ->setUserId($userId)\r\n ->setLikes(0)\r\n ->setDislikes(0)\r\n ->setArticleId($articleId)\r\n ->setLikes(0)\r\n ->setDislikes(0)\r\n ->setCreatedAt(new \\DateTime());\r\n }",
"public function testCreateNewCommentRoute()\n {\n \t$response = $this->post('/post-comment', [\n \t\t'content' => 'Lorem Ipsum',\n\t\t\t'parent_id' => null,\n\t\t\t'post_id' => 1,\n\t\t\t'level' => 1\n \t]);\n\n $response->assertStatus(200);\n }",
"public function createNewComment(NodeInterface $post, NodeTemplate $newComment) {\n\t\t$postTitle = $post->getProperty('title');\n\t\t$newCommentNodeName = \\TYPO3\\TYPO3CR\\Utility::renderValidNodeName(uniqid('comment-') . $postTitle);\n\t\t$newComment = $post->createNodeFromTemplate($newComment, $newCommentNodeName);\n\t\t$forum = $post->getParent();\n\t\t$date = new \\DateTime();\n\t\t$forum->setProperty('numberOfReplies', (intval($forum->getProperty('numberOfReplies')) + 1));\n\t\t$forum->setProperty('lastMessageDate', $date);\n\t\t$post->setProperty('lastMessageDate', $date);\n\t\t$newComment->setProperty('title', $postTitle);\n\t\t$newComment->setProperty('createdDate', $date);\n\t}",
"public function actionCreate()\n {\n $comment = new Comment();\n\n if ($comment->load(Yii::$app->request->post(), '') && $comment->save()) {\n TicketController::openStatus($comment->ticket_id);\n $comment = Comment::find()->with(['createdBy'])->ticketId($comment->ticket_id)->one();\n\n return [\n 'success' => true,\n // returns only a partial to render without applying a whole layout\n 'comment' => $this->renderPartial(\n '@frontend/views/ticket/_comment_item',\n [\n 'model' => $comment,\n ]\n ),\n ];\n }\n\n return [\n 'success' => false,\n 'errors' => $comment->errors,\n ];\n }",
"function create_comment($album_id, $comment){\n $album_id = (int)$album_id;\n $comment = mysql_real_escape_string($comment);\n\n mysql_query(\"INSERT INTO comments (album_id, user_id, comment, timestamp) VALUES ($album_id, \". $_SESSION['user_id'] .\", '$comment', UNIX_TIMESTAMP()) \");\n \n }",
"public function createComment(Request $request){\n $validator = Validator::make($request->all(), [\n 'commenttext' => ['required', 'string', 'max:100'],\n ]);\n\n if ($validator->fails()) {\n return redirect()->back()\n ->withErrors($validator)\n ->withInput();\n }\n $post = Post::find($request->postid);\n $comment = new Comment();\n $comment->user()->associate(Auth::user());\n $comment->post()->associate($post);\n $comment->text = $request->commenttext;\n $comment->save();\n\n flash('Successfully created comment!')->success();\n return redirect()->back();\n }",
"private function add_comment()\n\t{\n\t\tif(!$this->owner->logged_in())\n\t\t\treturn new View('public_forum/login');\n\t\t\n\t\tif(empty($_POST['body']))\n\t\t\treturn 'Reply cannot be empty.';\n\t\t\n\t\t$post_id = $this->filter;\n\t\t$new_comment = ORM::Factory('forum_cat_post_comment');\n\t\t$new_comment->forum_cat_post_id = $post_id;\n\t\t$new_comment->owner_id\t= $this->owner->get_user()->id;\n\t\t$new_comment->body\t\t\t= $_POST['body'];\n\t\t$new_comment->save();\n\t\treturn 'Thank you, your comment has been added!';\t\t\n\t}",
"public function createComment($pid =null ) { \r\n \r\n date_default_timezone_set('America/New_York');\r\n $now = date( \"h:i:s\", strtotime('now'));\r\n $today = date(\"F j, Y, g:i a\"); \r\n // Create instance of User class, so the author name can be added automatically to each post.\r\n // $user = new User(); \r\n try { \r\n if (!empty($pid) ) {\r\n # Find the post or article with the comments we want to retrieve.\r\n // $post = $this->_collection->findOne(array('_id' => new MongoId($pid) ) );\r\n $post = $this->getSelectedPost($pid) ;\r\n $post_id = (isset($post['_id']) )? $post['_id']: array(); \r\n // return $post['_id'];\r\n } \r\n \r\n // Creat a document or array for the new comment\r\n $new_comment['post_id'] = $post_id; \r\n $new_comment['name'] = $_POST['name'] ;\r\n $new_comment['email'] = $_POST['email'] ;\r\n // REMEMBER: Limit amount of words \r\n $new_comment['comment'] = $_POST['comment'] ; \r\n $new_comment['user_id'] = (isset($_SEESION['user_id']) )? $_SEESION['user_id'] : 'guest'; \r\n $new_comment['user_ip'] = null; \r\n $new_comment['active'] = null; \r\n $new_comment['location'] = null; \r\n $new_comment['votes_up'] = 0; \r\n $new_comment['votes_down'] = 0; \r\n $new_comment['posted_at'] = new MongoDate();\r\n // $this->_new_comment['posted_at'] = $today;\r\n\r\n //$this->_comment_collection->insert($this->_new_comment); \r\n $this->_comment_collection->save($new_comment); \r\n } \r\n catch(MongoException $e) {\r\n die('Failed to insert comment. Error: '.$e->getMessage());\r\n }\r\n catch(MongoConnectionException $e) {\r\n die(\"Failed to connect to database \".$e->getMessage());\r\n } \r\n }",
"public function addOneComment(){\n\t\tif (!empty($_POST['user_name']) && !empty($_POST['content'])){\n\t\t\t$values = array(\n \t\t'user_name' => $_POST['user_name'],\n\t\t\t'content' => $_POST['content'],\n\t\t\t'post_id' => $_POST['post_id']\n\t\t);\n\n\t\t$sqlfuncs = array(\n \t\t'date_creation' => 'NOW()',\n\t\t);\n\n\t$this->pInsertFunc(\"INSERT INTO\", \"comment\", $values, $sqlfuncs);\n\t\t\techo '<script>alert(\"Le commentaire a bien été envoyé.\")</script>';\n\t\t}\n\n\t}",
"protected function newComment($model)\n {\n $comment=new Comment;\n if(isset($_POST['Comment']))\n {\n $comment->attributes=$_POST['Comment'];\n if(!Yii::app()->user->isGuest)\n\t{\n\t\t$comment->authorName=Yii::app()->user->username;\n\t\t$comment->email=Yii::app()->user->email;\n\t\t$comment->authorId=Yii::app()->user->id;\n\t}\n\telse\n\t{\t //MFM\n\t\t$comment->authorName=$comment->attributes['authorName'];\n\t\t$comment->email=$comment->attributes['email'];\n\t}\n\t$comment->content=$comment->attributes['content'];\n\t$comment->url=$comment->attributes['url'];\n\n if(Yii::app()->user->isGuest && Yii::app()->params['commentNeedApproval'])\n $comment->status=Comment::STATUS_PENDING;\n else\n $comment->status=Comment::STATUS_APPROVED;\n\n $comment->postId=$model->id;\n\n if(isset($_POST['previewComment']))\n $comment->validate();\n else\n if(isset($_POST['submitComment']) && $comment->save())\n {\n if($comment->status==Comment::STATUS_PENDING)\n {\n Yii::app()->user->setFlash('commentSubmittedMessage',Yii::t('lan','Thank you for your comment. Your comment will be posted once it is approved.'));\n $this->refresh();\n }\n else\n $this->redirect(array('show','slug'=>$model->slug,'#'=>'c'.$comment->id));\n }\n }\n return $comment;\n }",
"public function createComment ($taskId, $value) {\r\n\t\t$db = new DB();\r\n\t\t$db->connect();\r\n\t\t\r\n\t\t$taskId = $db->esc($taskId);\r\n\t\t$value = $db->fixDoubleSpace($db->esc($value));\r\n\t\t\r\n\t\t$sql = \"INSERT INTO `comment` \r\n\t\t\t\t(`task_id`, `date`, `value`, `user_id`) \r\n\t\t\t\tVALUES ('$taskId', '\".$db->toDate(time()).\"', '$value', '\".$_SESSION['nobug'.RANDOMKEY.'userId'].\"')\";\r\n\t\t$db->query($sql);\r\n\t}",
"public function create($parentId = null, $name, $content){\n\n if(is_null($parentId)){\n $comment = new Comment($this->rootComment, $name, $content);\n return $comment;\n }else{\n\n // Find a parent comment\n [$depth, $parentComment] = $this->find($parentId);\n\n if(0 > $depth)\n throw new Exception('Parent not found: ' . $parentId);\n\n // -----------------------------------\n // Requirement\n //------------------------------------\n //\n // Maximum of 3 levels in nested comments\n if(3 <= $depth)\n throw new Exception('Exceed max level of children: ' . $depth);\n\n // Add a new comment under a parent and as its child\n $comment = new Comment($parentComment, $name, $content);\n }\n\n return $comment;\n }",
"public function create() {\n\n // Validate blog id in $_GET\n $validator = new \\Validator('GET');\n $validator->required()->integer()->validate('id');\n\n // If error occured return false\n if ($validator->hasErrors()) {\n return false;\n }\n\n // Validate comment\n $this->validator->required()->validate('comment');\n\n // If error occured return false\n if ($this->hasErrors()) {\n return false;\n }\n\n // Get blog to assing comment\n $blog = $this->em->find('Alt68\\Entities\\Blog', $_GET['id']);\n\n // If not find blog return false\n if (!$blog) {\n return false;\n }\n\n // Get commenter user to assing comment\n $commenter = $this->em->find('Alt68\\Entities\\User', $_SESSION['user']['id']);\n\n // If not find commenter return false\n if (!$commenter) {\n return false;\n }\n\n // Create new comment\n $newComment = new Comment();\n\n $newComment->setComment($_POST['comment']);\n $newComment->setBlog($blog);\n $newComment->setCommenter($commenter);\n $newComment->setCreated(new \\DateTime(\"now\"));\n\n $this->em->persist($newComment);\n $this->em->flush();\n\n return true;\n }",
"public function record_comment(){\n\t\t\t\n\t\t}",
"public function createNew(array $data)\n {\n if (!is_null($data)) {\n $comment = new Comment();\n $comment->content = $data['content'];\n $comment->username = $data['username'];\n $comment->a_id = $data['a_id'];\n return $comment;\n } else {\n throw new Exception('Need data.');\n }\n }",
"public function insertComment() {\n\n if(isset($_POST['btnInsertComment'])){\n $comment = $_POST['comment'];\n $idUser = $_SESSION['user']->id_user;\n $idNews = $_POST['idNews'];\n $created_at = date(\"Y-m-d H-i-s\", time());\n\n\n $regComment = \"/[0-9A-Za-z.,\\n \\r?!]*/\";\n\n $errors = [];\n if($comment == \"\") {\n $errors[] = \"Cant be empty comment\";\n exit;\n }\n else if(!preg_match($regComment, $comment)) {\n $errors[] = \"Wrong format comment\";\n exit;\n }\n try {\n $modelComment = new Comments(Database::instance());\n $modelComment->insertComment($comment, $created_at, $idUser, $idNews);\n\n $this->commentLog($comment, \"INSERT\", 201);\n\n } catch (\\PDOException $ex){\n $this->errorLog(\"insertComment()\", $ex->getMessage());\n\n }\n\n\n } else {\n $this->json(null, 403);\n }\n }",
"public function createAction()\n { \n if (!$this->request->isPost()) {\n return $this->dispatcher->forward(array(\n \"controller\" => \"comments\",\n \"action\" => \"index\"\n ));\n }\n \n $comment = new Comments(); \n $comment->model = $this->request->getPost(\"model\");\n $comment->model_id = $this->request->getPost(\"model_id\");\n $comment->body = $this->request->getPost(\"body\");\n \n if (!$comment->save()) {\n foreach ($comment->getMessages() as $message) {\n $this->flash->error($message);\n }\n } else {\n $this->flash->success(\"comment was created successfully\");\n }\n \n $referer = $this->request->getHTTPReferer();\n $path = parse_url($referer, PHP_URL_PATH);\r\n $this->response->redirect($path, true);\n }",
"public function addComment()\n {\n session_start();\n $superglobalsPost = $this->getSuperglobals()->get_POST();\n $newComment = new CommentManager;\n $superglobalsPost['status'] = \"waiting\";\n $newComment->createComment($superglobalsPost);\n if (isset($superglobalsPost['post_id'])) {\n $post_id = $superglobalsPost['post_id'];\n }\n $titleAction = \"Confirmation d'enregistrement\"; //confirmation message\n $actionConfirmation = \"/post?id=\" . $post_id;\n $textConfirmation = \"Votre commentaire a bien été enregistré\";\n echo $this->getRender()->render('confirmationTemplate.twig', [\n 'titleAction' => $titleAction,\n 'actionConfirmation' => $actionConfirmation,\n 'textConfirmation' => $textConfirmation,\n 'session' => $this->getSuperglobals()->get_SESSION()\n ]);\n }",
"public function post_create()\n\t{\n\t\tAcl::can('post_comments_create');\n\n\t\t$validation = Validator::make(Input::all(), array(\n\t\t\t'user_id' => array('required', 'integer'),\n\t\t\t'blog_post_id' => array('required', 'integer'),\n\t\t\t'content' => array('required'),\n\t\t));\n\n\t\tif($validation->valid())\n\t\t{\n\t\t\t$comment = new Blog_Comment;\n\n\t\t\t$comment->user_id = Input::get('user_id');\n\t\t\t$comment->blog_post_id = Input::get('blog_post_id');\n\t\t\t$comment->content = Input::get('content');\n\n\t\t\t$comment->save();\n\n\t\t\tCache::forget(Config::get('cache.key').'comments');\n\n\t\t\tSession::flash('message', 'Added comment #'.$comment->id);\n\n\t\t\treturn Redirect::to('blog/comments');\n\t\t}\n\n\t\telse\n\t\t{\n\t\t\treturn Redirect::to('blog/comments/create')\n\t\t\t\t\t->with_errors($validation->errors)\n\t\t\t\t\t->with_input();\n\t\t}\n\t}",
"function new_comment( $path, $blog_id, $post_id, $comment_parent_id ) {\n\t\tif ( !$post_id ) {\n\t\t\t$comment_parent = get_comment( $comment_parent_id );\n\t\t\tif ( !$comment_parent_id || !$comment_parent || is_wp_error( $comment_parent ) ) {\n\t\t\t\treturn new WP_Error( 'unknown_comment', 'Unknown comment', 404 );\n\t\t\t}\n\n\t\t\t$post_id = $comment_parent->comment_post_ID;\n\t\t}\n\n\t\t$post = get_post( $post_id );\n\t\tif ( !$post || is_wp_error( $post ) ) {\n\t\t\treturn new WP_Error( 'unknown_post', 'Unknown post', 404 );\n\t\t}\n\n\t\tif (\n\t\t\t-1 == get_option( 'blog_public' ) &&\n\t\t\t/**\n\t\t\t * Filter allowing non-registered users on the site to comment.\n\t\t\t *\n\t\t\t * @module json-api\n\t\t\t *\n\t\t\t * @since 3.4.0\n\t\t\t *\n\t\t\t * @param bool is_user_member_of_blog() Is the user member of the site.\n\t\t\t */\n\t\t\t! apply_filters( 'wpcom_json_api_user_is_member_of_blog', is_user_member_of_blog() ) &&\n\t\t\t! is_super_admin()\n\t\t) {\n\t\t\treturn new WP_Error( 'unauthorized', 'User cannot create comments', 403 );\n\t\t}\n\n\t\tif ( ! comments_open( $post->ID ) && ! current_user_can( 'edit_post', $post->ID ) ) {\n\t\t\treturn new WP_Error( 'unauthorized', 'Comments on this post are closed', 403 );\n\t\t}\n\n\t\t$can_view = $this->user_can_view_post( $post->ID );\n\t\tif ( !$can_view || is_wp_error( $can_view ) ) {\n\t\t\treturn $can_view;\n\t\t}\n\n\t\t$post_status = get_post_status_object( get_post_status( $post ) );\n\t\tif ( !$post_status->public && !$post_status->private ) {\n\t\t\treturn new WP_Error( 'unauthorized', 'Comments on drafts are not allowed', 403 );\n\t\t}\n\n\t\t$args = $this->query_args();\n\t\t$input = $this->input();\n\t\tif ( !is_array( $input ) || !$input || !strlen( $input['content'] ) ) {\n\t\t\treturn new WP_Error( 'invalid_input', 'Invalid request input', 400 );\n\t\t}\n\n\t\t$user = wp_get_current_user();\n\t\tif ( !$user || is_wp_error( $user ) || !$user->ID ) {\n\t\t\t$auth_required = false;\n\t\t\tif ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {\n\t\t\t\t$auth_required = true;\n\t\t\t} elseif ( isset( $this->api->token_details['user'] ) ) {\n\t\t\t\t$user = (object) $this->api->token_details['user'];\n\t\t\t\tforeach ( array( 'display_name', 'user_email', 'user_url' ) as $user_datum ) {\n\t\t\t\t\tif ( !isset( $user->$user_datum ) ) {\n\t\t\t\t\t\t$auth_required = true;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( !isset( $user->ID ) ) {\n\t\t\t\t\t$user->ID = 0;\n\t\t\t\t}\n\n\t\t\t\t// If we have a user with an external ID saved, we can use it.\n\t\t\t\tif (\n\t\t\t\t\t! $auth_required\n\t\t\t\t\t&& $user->ID\n\t\t\t\t\t&& (\n\t\t\t\t\t\t$author = get_user_by( 'id', intval( $user->ID ) )\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\t$user = $author;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$auth_required = true;\n\t\t\t}\n\n\t\t\tif ( $auth_required ) {\n\t\t\t\treturn new WP_Error( 'authorization_required', 'An active access token must be used to comment.', 403 );\n\t\t\t}\n\t\t}\n\n\t\t$insert = array(\n\t\t\t'comment_post_ID' => $post->ID,\n\t\t\t'user_ID' => $user->ID,\n\t\t\t'comment_author' => $user->display_name,\n\t\t\t'comment_author_email' => $user->user_email,\n\t\t\t'comment_author_url' => $user->user_url,\n\t\t\t'comment_content' => $input['content'],\n\t\t\t'comment_parent' => $comment_parent_id,\n\t\t\t'comment_type' => '',\n\t\t);\n\n\t\tif ( $comment_parent_id ) {\n\t\t\tif ( $comment_parent->comment_approved === '0' && current_user_can( 'edit_comment', $comment_parent->comment_ID ) ) {\n\t\t\t\twp_set_comment_status( $comment_parent->comment_ID, 'approve' );\n\t\t\t}\n\t\t}\n\n\t\t$this->api->trap_wp_die( 'comment_failure' );\n\t\t$comment_id = wp_new_comment( add_magic_quotes( $insert ) );\n\t\t$this->api->trap_wp_die( null );\n\n\t\t$return = $this->get_comment( $comment_id, $args['context'] );\n\t\tif ( !$return ) {\n\t\t\treturn new WP_Error( 400, __( 'Comment cache problem?', 'jetpack' ) );\n\t\t}\n\t\tif ( is_wp_error( $return ) ) {\n\t\t\treturn $return;\n\t\t}\n\n\t\t/** This action is documented in json-endpoints/class.wpcom-json-api-site-settings-endpoint.php */\n\t\tdo_action( 'wpcom_json_api_objects', 'comments' );\n\t\treturn $return;\n\t}",
"public function create_comment($post_id){\n $data =[\n 'post_id' => $post_id,\n 'name' => $this->input->post('name'),\n 'email' => $this->input->post('email'),\n 'body' => $this->input->post('body')\n ];\n return $this->db->insert('comments',$data);\n }",
"public function CreateComments($Payload){\n\t\t\tif(empty($Payload['id'])){\n\t\t\t\tthrow new Exception('id can not be empty.');\n\t\t\t}\n\t\t\tif(empty($Payload['Body'])){\n\t\t\t\tthrow new Exception('body can not be empty.');\n\t\t\t}\n\t\t\t$Payload['Verb']='POST';\n\t\t\t$Payload['URL']='/V1/creditmemo/'.$Payload['id'].'/comments';\n\t\t\t$Payload['Body']=json_encode($Payload['Body']);\n\t\t\treturn $this->Execute($Payload);\n\t\t}",
"public function ajaxNewCommentAction() {\n if ($this->request->hasArgument('blogid')) {\n $blogid = $this->request->getArgument('blogid');\n }\n if ($this->request->hasArgument('postid')) {\n $postid = $this->request->getArgument('postid');\n }\n if ($this->request->hasArgument('name')) {\n $name = $this->request->getArgument('name');\n }\n if ($this->request->hasArgument('email')) {\n $email = $this->request->getArgument('email');\n }\n if ($this->request->hasArgument('text')) {\n $text = $this->request->getArgument('text');\n }\n \n $commentRepository = $this->objectManager->get('T3developer\\\\Multiblog\\\\Domain\\\\Repository\\\\CommentRepository');\n \n $newComment = $this->objectManager->get('T3developer\\\\Multiblog\\\\Domain\\\\Model\\\\Comment'); \n $newComment->setBlogid($blogid);\n $newComment->setPostid($postid);\n $newComment->setCommentname($name);\n $newComment->setCommentmail($email);\n $newComment->setCommenttext($text);\n $newComment->setCommentdate(time());\n \n $commentRepository->add($newComment);\n $this->objectManager->get('TYPO3\\\\CMS\\\\Extbase\\\\Persistence\\\\Generic\\\\PersistenceManager')->persistAll();\n \n exit;\n }",
"public function createComment(Request $request) {\n // get the post that the user commented on\n $post = Post::find($request['postid']);\n echo 'hello'. $request;\n\n // create a new comment\n $comment = new Comment();\n $comment->name = $request['name'];\n $comment->content = nl2br($request['content']);\n $comment->post_id = $post->id;\n $comment->save();\n\n // save the comment with a relation to the post\n //$post->comments()->save($comment);\n\n // go back to the post\n return Redirect()->route('viewPost', ['id' => $post->id]);\n }",
"public function created(Comment $comment)\n {\n //\n }",
"function Comment($commentText, $IPNumber, $name, $UID=\"\") {\n\n\t\t$this->commentText = substr(wordwrap($commentText, 100, \" \", 1), 0, 1000);\n\t\t$this->datePosted = time();\n\t\t$this->IPNumber = $IPNumber;\n\t\t$this->name = substr($name, 0, 100);\n\t\t$this->UID = $UID;\n\t}",
"public function insertComment($name,$comment,$idOfRecord,$typeOfRecord = \"photo\")\r\n {\r\n \r\n //If passed , insert the comment.\r\n }",
"public function createComment($comment, $db) \n {\n $sql = \"INSERT INTO \" . $db . \"\n (postId, userName, userId, commentContent, datePosted)\n VALUES \n (:postId, :userName, :userId, :commentContent, NOW())\";\n\n $req = Database::getBdd()->prepare($sql);\n \n $req->bindValue(':postId', $comment->getPostId(), PDO::PARAM_INT);\n $req->bindValue(':userId', $comment->getUserId(), PDO::PARAM_INT);\n $req->bindValue(':userName', $comment->getUserName(), PDO::PARAM_STR);\n $req->bindValue(':commentContent', $comment->getCommentContent(), PDO::PARAM_STR); \n $req->execute();\n\n return $req->rowCount() > 0;\n }",
"public function addComment()\r\n {\r\n $pdoStatment = $this->pdo->prepare(\r\n 'INSERT INTO `comment`(`content`, `id_User`, `id_Article`) \r\n VALUES(:content, :id_User, :id_Article)'\r\n );\r\n $pdoStatment->bindValue(':content', $this->content, PDO::PARAM_STR);\r\n $pdoStatment->bindValue(':id_User', $this->id_User, PDO::PARAM_INT);\r\n $pdoStatment->bindValue(':id_Article', $this->id_Article, PDO::PARAM_INT);\r\n $pdoStatment->execute();\r\n return $this->pdo->lastInsertId();\r\n }",
"public function actionCreate()\n\t{\n\t\t$model=new Comment;\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Comment']))\n\t\t{\n $model->attributes=$_POST['Comment'];\n\t\t\n \n if($model->save()){\n $dataProvider=new CActiveDataProvider('Comment');\n\t\t\t$this->redirect(array('index'),array(\n 'dataProvider'=>$dataProvider,\n 'updated'=>'1',\n 'message'=>\"Comentario introducido\"\n ));\n }\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"function Comment($content) {\n\n /* Variablen initialisieren */\n $this->content = $content;\n }",
"public function createCommentaire($id){\n $bdd = $this->bdConnect();\n $req = $bdd->prepare('INSERT INTO commentaires(id_jeu)VALUE(?)');\n $req->execute(array($id));\n return $req;\n }",
"public function the_comment()\n {\n }",
"function wb_create_comments_table($con)\n{\n\t$query = 'CREATE TABLE IF NOT EXISTS comments\n\t(\n\t\tcomment_id SERIAL,\n\t\tPRIMARY KEY(comment_id),\n\t\tuser_id BIGINT UNSIGNED NOT NULL,\n\t\tFOREIGN KEY(user_id) REFERENCES users(user_id),\n\t\tpage_id INT UNSIGNED NOT NULL,\n FOREIGN KEY(page_id) REFERENCES sitemap(page_id),\n\t\tdatetime DATETIME,\n\t\tcomment TEXT,\n\t\treply_ref BIGINT UNSIGNED NOT NULL DEFAULT 0\n\t) ENGINE=InnoDB';\n\t\n\twb_query($query, $con);\n}",
"public function createCommentary(){\n $sql='INSERT INTO comentarios (comentario, idProducto, idCliente, estado) VALUES (? , ? , ?, 1)';\n $params=array($this->comentario, $this->id, $this->cliente);\n return Database::executeRow($sql, $params);\n }",
"public function createComment($idPost, $author, $comment)\n\t{\n\n $request = $this->db->db->prepare('INSERT INTO comments (post_id, author, comment) VALUES (:post_id, :author, :comment);');\n $params = [':post_id' => $idPost, ':author' => $author, ':comment' => $comment];\n if ($request->execute($params)) {\n return(\"CommentCreated\");\n }\n return('CommentError');\n }",
"public function createComment (Request $request, $course_id) {\n\t\t$comment = new Comment();\n\t\t$this->validate($request,[\n\t\t\t\t'description' => 'required',\n\t\t\t\t'rating' => 'required | min:0 | max:5 | numeric'\n\t\t]);\n\t\t\n\t\t\n\t\t$description= $request->input('description');\n\t\t$rating= $request->input('rating');\n $id_user= Auth::user()->id;\n\n\t\t\n\t\t$comment->createComment($description, $rating, $course_id, $id_user);\n\n\t\treturn redirect()->action(\n \t\t 'CoursesController@showSingleCourse', ['id' => $course_id]);\n\t}",
"public function create()\n {\n return view('comments.create');\n }",
"public function create()\n {\n return view('comments.create');\n }",
"public function create_comment($params = null, $options = null)\n {\n $url = $this->instanceUrl() . '/comments';\n list($response, $opts) = $this->_request('post', $url, $params, $options);\n $this->refreshFrom($response, $opts);\n return $this;\n }",
"public function actionAddcomment(){\n if(isset($_POST['text'])){\n $comment = new Comment();\n $comment->text = $_POST['text'];\n $comment->id_trainingentry = $_POST['id_trainingentry'];\n $comment->id_user = Yii::app()->user->id;\n $comment->id_visibility = $_POST['id_visibility'];\n $comment->date = date('Y-m-d G:i:s');\n $comment->seen = 0;\n \n $user = User::model()->findByPk(Yii::app()->user->id);\n \n header('Content-Type: text/xml');\n echo '<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>';\n echo '<response>';\n echo '<validation>';\n if($comment->save()){\n echo 'ok';\n echo '</validation>';\n echo $this->createXmlComment($user, $comment);\n }else{\n echo 'error';\n echo '</validation>';\n }\n echo '</response>';\n }\n }",
"public function addComment($body){\n // Comment::create([\n // 'body' => $body,\n // 'post_id' => $this->id\n // ]);\n\n\t\t$this->comments()->create(compact('body'));\n\t}",
"function insertComment() {\n if ($this->getRequestMethod() != \"POST\") {\n $this->response('', 406);\n }\n $comment = json_decode(file_get_contents(\"php://input\"),true);\n $auth = $this->getAuthorization();\n if (!$this->validateAuthorization($comment['user_id'], $auth)) {\n $this->response('', 406);\n }\n \n $columns = 'user_id, video_id, text';\n $values = $comment['user_id'] . ',' . $comment['video_id'] . ',\\'' . $comment['text'] . \"'\";\n \n $query = \"insert into comments(\". $columns . \") VALUES(\". $values . \");\";\n $r = $this->conn->query($query) or die($this->conn->error.__LINE__);\n $success = array('status' => \"Success\", \"msg\" => \"Comment Posted.\", \"data\" => $comment);\n $this->response(json_encode($success),200);\n }",
"public function createComment(TextPost $post, Request $request){\n if(Auth::user()->can('create', TextPostComment::class)) {\n $this->validate($request,\n [\n 'body' => 'required|max:720'\n ]\n );\n\n TextPostComment::create(\n [\n 'post_id' => $post->id,\n 'user_id' => Auth::user()->id,\n 'body' => $request->body,\n ]\n );\n }\n return redirect()->back();\n }",
"public function actionCreate()\n {\n $model = new Thread();\n $model->user_id = Yii::$app->user->id;\n\n $newCommentModel = new Comment();\n $newCommentModel->user_id = Yii::$app->user->id;\n\n $postData = Yii::$app->request->post();\n if ($model->load($postData) && $res = $model->save()) {\n $newCommentModel->load(Yii::$app->request->post());\n $newCommentModel->thread_id = $model->id;\n $newCommentModel->user_id = Yii::$app->user->id;\n $newCommentModel->save();\n\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'newCommentModel' => $newCommentModel,\n ]);\n }\n }",
"public function testFlagCreationComment()\n {\n $flagCreated = new Flag;\n\n $flagCreated->NarrativeID = NULL;\n $flagCreated->CommentID = 1;\n $flagCreated->Comment = \"Test\";\n\n $flagCreated->save();\n\n $insertedId = $flagCreated->FlagID;\n\n $flagFetched = Flag::find($insertedId);\n\n $this->assertEquals(NULL, $flagFetched->NarrativeID);\n $this->assertEquals(1, $flagFetched->CommentID);\n $this->assertEquals(\"Test\", $flagFetched->Comment);\n\n $flagFetched->delete();\n\n $flagFetched = Flag::find($insertedId);\n\n $this->assertNull($flagFetched);\n\n }",
"public function create_comments() {\n\t\t// Create 20 comments\n\t\t$created_comments = [];\n\t\tfor ( $i = 1; $i <= 20; $i ++ ) {\n\t\t\t$date = date( 'Y-m-d H:i:s', strtotime( \"-1 day +{$i} minutes\" ) );\n\t\t\t$created_comments[ $i ] = $this->createCommentObject( [\n\t\t\t\t'comment_content' => $i,\n\t\t\t\t'comment_date' => $date,\n\t\t\t] );\n\t\t}\n\n\t\treturn $created_comments;\n\t}",
"public function testCreateComment(){\n $parameters = [\n 'commenting_username' => 'ridho',\n 'id_post' => 1,\n 'komentar' => 'keren, lanjutkan!'\n ];\n\n $this->post(\"/api/v1/komentar\", $parameters, []);\n $this->seeStatusCode(200);\n $this->seeJsonStructure(\n ['data' =>\n [\n 'status',\n 'id_komen',\n 'commenting_username',\n 'id_post',\n 'komentar',\n 'tanggal'\n ]\n ]\n );\n }",
"public function createComment($articleId, $commentId, $userId, $content)\n {\n $dateTime = date(\"Y-m-d H:i:s\");\n\n $db = Database::getInstance();\n\n $sql = \"INSERT INTO `Comment` (`ArticleID`, `ParentCommentID`, `UserID`, `Content`, `DateTime`) \" .\n \"VALUES (:articleId, :commentId, :userId, :content, :dateTime)\";\n $query = $db->prepare($sql);\n $query->bindParam(':articleId', $articleId, PDO::PARAM_INT);\n $query->bindParam(':commentId', $commentId, PDO::PARAM_INT);\n $query->bindParam(':userId', $userId, PDO::PARAM_INT);\n $query->bindParam(':content', $content, PDO::PARAM_STR);\n $query->bindParam(':dateTime', $dateTime, PDO::PARAM_STR);\n $query->execute();\n }",
"public function doCreate(){\n //only logged in users can write comments\n if(Security::isAuthenticated()){\n if($_POST['send']){\n $userid = Security::getUser()->id;\n $postid = $_GET['blogid'];\n //protects from attackers\n $comment = htmlspecialchars($_POST['commentarea']);\n $time = date(\"Y-m-d\");\n $commentRepository = new CommentRepository();\n //call to createComment\n $commentRepository->createComment($userid, $postid, $comment, $time);\n header('Location: /comment/showComments?id='.$postid);\n }\n }else{\n echo'Only logged in users can write comments';\n }\n }",
"abstract protected function add(Comment $comment);",
"public function getComment() {}",
"public function create_comment_object($photo_id,$author=\"Anonymous\",$body=\"\"){\n\n if(!empty($photo_id) && !empty($author) && !empty($body)){\n global $database;\n $comment= new Comment();\n $comment->photo_id=(int)$photo_id;\n $comment->author=$author;\n $comment->body=\"$body\";\n $properties=$comment->getCleanAssArrOfObjPro();\n\n $sql=\"INSERT INTO \".static::$db_table.\"(\".implode(\",\",array_keys($properties)).\")\";\n $sql.=\"VALUES ('\".implode(\"','\",array_values($properties)).\"')\";\n if($database->query($sql)){\n $comment->id= $database->insertId();\n\n return true;\n\n }else{\n\n return false;\n }\n } else{\n\n return false;\n }\n\n }",
"public function getComment();",
"public function getComment();",
"public function getComment();",
"public function getComment();",
"public function getComment();",
"public function getComment();",
"public function addCommentAction()\n {\n $this->confirmSession();\n\n $this->view->disable();\n if ($this->request->isPost()) {\n $validator = new CommentValidation();\n $errorMessages = $validator->validate($this->request->getPost());\n \n if (count($errorMessages)) {\n $this->redirect('/index/notFound');\n return;\n }\n\n $postId = $this->request->getPost('postId');\n\n $post = News::findFirst([\n 'conditions' => 'id = ?0 AND isDeleted = 0',\n 'bind' => [\n $postId\n ]\n ]);\n \n if (!$post) {\n $this->redirect('/index/notFound');\n return;\n }\n\n $comment = new Comments();\n\n $comment->userId = $this->session->get('user')['id'];\n $comment->newsId = $postId;\n $comment->content = $this->request->getPost('content');\n $comment->createdAt = date('Y-m-d H:i:s');\n\n $comment->save();\n\n $this->redirect(\"/index/postDetails?id={$postId}\");\n }\n }",
"public function comment(Request $request)\n {\n $this->validate($request, [\n 'comment' => 'bail|required|max:200',\n 'postId' => 'required|numeric',\n ]);\n\n // creating a new comment\n $comment = new Post_comment();\n $comment->post_id = $request->postId;\n $comment->comment = $request->comment;\n $comment->artist_id = Auth::user()->id;\n \n $comment->save(); \n }",
"public function createComment(Request $request, \\App\\Group $group){\n $request->validate([\n 'comment_text'=>'required'\n ]);\n\n $comment = $group->comments()->create([\n 'text' => $request->comment_text,\n 'user_id' => Auth::user()->id\n ]);\n\n $group->notify(new GroupCommentCreated(Auth::user(), $group, $request->comment_text));\n return redirect()->route('groups.view', ['group'=>$group])->with('status', 'Your comment has been posted.');\n }",
"public function actionCreate()\n {\n $model = new BlogComments();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"function generateComment(&$eventData, $comment)\n {\n $eventData['comment'] = \"-- $comment --<br>\\n\" . $eventData['comment'];\n }",
"public function __construct($comment)\n {\n }",
"public function get_create($blog_post_id = null, $user_id = null)\n\t{\n\t\tAcl::can('get_comments_create');\n\n\t\t\t\t\n\t\t$blog_post = array('' => 'SELECIONE') + Blog_post::order_by('id', 'asc')->take(999999)->lists('id', 'id');\n\t\t\t\t\n\t\t$user = array('' => 'SELECIONE') + User::order_by('id', 'asc')->take(999999)->lists('id', 'id');\n\n\t\t$this->layout->title = 'New Blog Comment';\n\t\t$this->layout->content = View::make('blog.comments.create', array(\n\t\t\t\t\t\t\t\t\t'blog_post' => $blog_post,\n\t\t\t\t\t\t\t\t\t'user' => $user,\n\t\t\t\t\t\t\t\t));\n\t}",
"function insert_comment($user_id, $comment, $today){\n global $db;\n $query = 'INSERT INTO comments\n (comment, user_id, created)\n VALUES\n (:comment, :user_id, :created)';\n $statement = $db->prepare($query);\n $statement->bindValue(':comment', $comment);\n $statement->bindValue(':user_id', $user_id);\n $statement->bindValue(':created', $today);\n $statement->execute();\n $statement->closeCursor();\n }",
"public static function createComment($userid, $content)\n {\n $user = UserUtil::getUser($userid);\n\n $author = UserUtil::getLoggedInUser();\n\n if(is_null($author) || is_null($user))\n return false;\n\n $comment = new Comments();\n\n $comment->user = $user;\n $comment->author = $author;\n $comment->content = $content;\n\n $comment->save();\n }",
"public function isComment() {}",
"function set_comment($new_comment)\n {\n $this->comment = $new_comment;\n }",
"public function add_comment()\n { \n $data = $this->input->post();\n unset($data['url']);\n $data['postid'] = $data['postid'];\n $comment_id = $this->mention_model->add_comment($data); \n $success = false; \n $success = ($comment_id !== false ? true : false);\n $comment = '';\n if ($comment_id) {\n $comment = $this->comment_single($this->mention_model->get_comment($comment_id, true));\n }\n\n echo json_encode([\n 'success' => $success,\n 'comment' => $comment,\n 'comment_id' => $comment_id\n ]);\n }",
"public static function create_comment($input, $project, $issue)\n\t{\n\t\t$config_app = require path('public') . 'config.app.php';\n\t\tif (!isset($config_app['Percent'])) { $config_app['Percent'] = array (100,0,10,80,100); }\n\t\trequire \"tag.php\";\n\t\t$fill = array(\n\t\t\t'created_by' => \\Auth::user()->id,\n\t\t\t'project_id' => $project->id,\n\t\t\t'issue_id' => $issue->id,\n\t\t\t'comment' => $input['comment'],\n\t\t);\n\n\t\t$comment = new static;\n\t\t$comment->fill($fill);\n\t\t$comment->save();\n\n\t\t/* Add to user's activity log */\n\t\t\\User\\Activity::add(2, $project->id, $issue->id, $comment->id);\n\t\t$vide = true;\n\t\t$Val = ($input['Pourcentage'] > $config_app['Percent'][3]) ? 8: (($input['Pourcentage'] == 100 ) ? 2: 9);\n\t\tif(!empty($issue->tags)):\n\t\t\tforeach($issue->tags()->order_by('tag', 'ASC')->get() as $tag):\n\t\t\t\tif ($Val == $tag->id) { $vide = false; }\n\t\t\tendforeach;\n\t\tendif;\n\t\tif ($vide) { Tag::addNew_tags($issue->id, $Val); }\n\n\t\t/* Add attachments to issue */\n\t\t\\DB::table('projects_issues_attachments')->where('upload_token', '=', $input['token'])->where('uploaded_by', '=', \\Auth::user()->id)->update(array('issue_id' => $issue->id, 'comment_id' => $comment->id));\n\n\t\t/* Update the Todo state for this issue */\n\t\t//\\DB::table('users_todos')->where('issue_id', '=', $issue->id)->update(array('user_id' => \\Auth::user()->id, 'status' => (($input['Pourcentage'] > $config_app['Percent'][3]) ? 3: 2), 'weight' => $input['Pourcentage'], 'updated_at'=>date(\"Y-m-d H:m:s\")));\n\t\t\\DB::table('users_todos')->where('issue_id', '=', $issue->id)->update(array('status' => (($input['Pourcentage'] > $config_app['Percent'][3]) ? 3: 2), 'weight' => $input['Pourcentage'], 'updated_at'=>date(\"Y-m-d H:m:s\")));\n\n\t\t/* Update the status of this issue according to its percentage done; */\n\t\t\\DB::table('projects_issues')->where('id', '=', $issue->id)->update(array('closed_by' => (($input['Pourcentage'] == 100 ) ? \\Auth::user()->id : NULL), 'status' => (($input['Pourcentage'] == 100 )? 0 : 1),'status' => (($input['Pourcentage'] == 100 )? 0 : 1)));\n\n\t\t/*Update tags attached to this issue */\n\t\t$MesTags = explode(\",\", $input[\"MesTags\"]);\n\t\t$IDtags = array();\n\t\tforeach($MesTags as $val) {\n\t\t\tforeach(\\Tag::where('tag', '=', $val)->get(\"id\",\"tag\") as $activity) {\n\t\t\t\t$Idtags[] = $activity->id;\n\t\t\t}\n\t\t}\n\t\tif (isset($Idtags)) {\n\t\t$issue->tags()->sync($Idtags);\n\t\t$issue->save();\n\t\t}\n\n\t\t/* Update the project */\n\t\t$issue->updated_at = date('Y-m-d H:i:s');\n\t\t$issue->updated_by = \\Auth::user()->id;\n\t\t$issue->save();\n\t\tif ($input['Pourcentage'] == 100 ) {\n\t\t\t$tags = $issue->tags;\n\t\t\t$tag_ids = array();\n\t\t\tforeach($tags as $tag) { $tag_ids[$tag->id] = $tag->id; }\n\t\t\t$issue->closed_by = \\Auth::user()->id;\n\t\t\t$issue->closed_at = date('Y-m-d H:i:s');\n\n\t\t\t/* Update tags */\n\t\t\t$tag_ids[2] = 2;\n\t\t\tif(isset($tag_ids[1])) { unset($tag_ids[1]); }\n\t\t\tif(isset($tag_ids[8])) { unset($tag_ids[8]); }\n\t\t\tif(isset($tag_ids[9])) { unset($tag_ids[9]); }\n\n\t\t\t/* Add to activity log */\n\t\t\t\\User\\Activity::add(3, $issue->project_id, $issue->id);\n\t\t\t$issue->tags()->sync($tag_ids);\n\t\t\t$issue->status = 0;\n\t\t\t$issue->save();\n\t\t}\n\n\t\t/*Notifications by email to those who concern */\n\t\t$project = \\Project::current();\n\t\t$subject = sprintf(__('email.new_comment'), $issue->title, $project->name);\n\t\t$text = \\View::make('email.commented_issue', array(\n\t\t\t\t'actor' => \\Auth::user()->firstname . ' ' . \\Auth::user()->lastname,\n\t\t\t\t'project' => $project,\n\t\t\t\t'issue' => $issue,\n\t\t\t\t'comment' => $comment->comment\n\t\t\t));\n\n\t\t/* Notify the person to whom the issue is currently assigned, unless that person is the one making the comment */\n\t\tif($issue->assigned_to && $issue->assigned_to != \\Auth::user()->id && (!empty($issue->assigned->email))) {\n \t\t\t\\Mail::send_email($text, $issue->assigned->email, $subject);\n\t\t}\n\n\t\t/* Notify the person who created the issue, unless that person is the one making the comment */\n\t\tif($issue->created_by && $issue->created_by != \\Auth::user()->id && (!empty($issue->user->email))) {\n\t\t\t\\Mail::send_email($text, $issue->user->email, $subject);\n\t\t}\n\n\t\treturn $comment;\n\t}",
"public function InsertComment($details)\n {\n $this->comments[] = $details;\n }"
]
| [
"0.7880994",
"0.7843123",
"0.77970177",
"0.73321545",
"0.71983093",
"0.7184093",
"0.7155388",
"0.70197725",
"0.70020235",
"0.6975427",
"0.69594216",
"0.69391906",
"0.683069",
"0.68231726",
"0.68161523",
"0.6795503",
"0.67855257",
"0.6780118",
"0.67758906",
"0.6772277",
"0.6757946",
"0.67492104",
"0.67386794",
"0.67201436",
"0.670955",
"0.6705893",
"0.6704942",
"0.67002106",
"0.6684971",
"0.6670804",
"0.6662522",
"0.66210264",
"0.66040826",
"0.6593477",
"0.6581025",
"0.6574668",
"0.6573205",
"0.6559162",
"0.65507615",
"0.6544134",
"0.6542045",
"0.65321565",
"0.6525012",
"0.6493999",
"0.64764273",
"0.6464509",
"0.64541197",
"0.64456326",
"0.6443003",
"0.6410623",
"0.639646",
"0.6389723",
"0.6389336",
"0.63805395",
"0.637768",
"0.6366825",
"0.6366712",
"0.63635325",
"0.63341594",
"0.63276553",
"0.63005155",
"0.62993586",
"0.6288493",
"0.6285999",
"0.6282421",
"0.62776786",
"0.62776786",
"0.6266715",
"0.6263201",
"0.6242057",
"0.6238528",
"0.62341094",
"0.6227983",
"0.6227906",
"0.6216944",
"0.6198851",
"0.6196181",
"0.6195103",
"0.6180664",
"0.6175549",
"0.6175525",
"0.6171112",
"0.6171112",
"0.6171112",
"0.6171112",
"0.6171112",
"0.6171112",
"0.6169643",
"0.61647725",
"0.6162923",
"0.615996",
"0.6154108",
"0.61436015",
"0.61415327",
"0.6139082",
"0.6134728",
"0.6134464",
"0.6128764",
"0.611558",
"0.6114842",
"0.6109587"
]
| 0.0 | -1 |
lixlpixel recursive PHP functions scan_directory_recursively( directory to scan, filter ) expects path to directory and optional an extension to filter | function scan_directory_recursively($directory, $filter=FALSE)
{
if(substr($directory,-1) == '/')
{
$directory = substr($directory,0,-1);
}
if(!file_exists($directory) || !is_dir($directory))
{
return FALSE;
}elseif(is_readable($directory))
{
$directory_list = opendir($directory);
while($file = readdir($directory_list))
{
if($file != '.' && $file != '..' && $file != '.DS_Store' && $file != '.svn')
{
$path = $directory.'/'.$file;
if(is_readable($path))
{
$subdirectories = explode('/',$path);
if(is_dir($path))
{
$directory_tree[] = array(
'path' => $path,
'name' => end($subdirectories),
'modified' => filemtime($path),
'kind' => 'directory',
'content' => scan_directory_recursively($path, $filter));
}elseif(is_file($path))
{
$extension = end(explode('.',end($subdirectories)));
if($filter === FALSE || $filter == $extension)
{
// Get metadata and image dimensions
$size = getimagesize($path, $info);
// Get containing directory of file
$directory_array = explode('/', $path);
$parent_folder = min($directory_array);
// Reset title, caption, tags
$title = $caption = $taglist = $tags = '';
$directory_tree[] = array(
'path' => dirname($path),
'group' => $parent_folder,
'file' => end($subdirectories),
'extension' => $extension,
'size' => filesize($path),
'width' => $size[0],
'height' => $size[1],
'modified' => filemtime($path),
'title' => $title,
'caption' => $caption,
'tags' => $tags,
'kind' => 'file');
}
}
}
}
}
closedir($directory_list);
return $directory_tree;
}else{
return FALSE;
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function scan_directory($dir, $ext = '*', $recurse = true) {\n $files = array ();\n if ($handle = opendir($dir)) {\n while (false !== ($file = readdir($handle))) {\n if ($file == '.' || $file == '..' ||\n $file == 'CVS' || preg_match('|^\\.|', $file)) {\n continue;\n }\n if (is_link($dir . '/' . $file)) {\n continue;\n }\n if (is_dir ($dir . '/' . $file)) {\n if ($recurse == true)\n $files = array_merge($files, scan_directory ($dir . '/' . $file, $ext));\n } else {\n if($ext == get_file_extension($file) || $ext == '*') {\n $files[] = $dir . '/' . $file;\n }\n }\n }\n closedir($handle);\n }\n return $files;\n}",
"public function scanRecursive($regex_filter=NULL)\n\t{\n\t\t$this->tossIfException();\n\t\t\n\t\t$files = $this->scan();\n\t\t$objects = $files;\n\t\t\n\t\t$total_files = sizeof($files);\n\t\tfor ($i=0; $i < $total_files; $i++) {\n\t\t\tif ($files[$i] instanceof fDirectory) {\n\t\t\t\tarray_splice($objects, $i+1, 0, $files[$i]->scanRecursive());\n\t\t\t}\n\t\t}\n\t\t\n\t\tif ($regex_filter) {\n\t\t\t$new_objects = array();\n\t\t\tforeach ($objects as $object) {\n\t\t\t\t$test_path = ($object instanceof fDirectory) ? substr($object->getPath(), 0, -1) . '/' : $object->getPath();\n\t\t\t\tif (!preg_match($regex_filter, $test_path)) {\n\t\t\t\t\tcontinue;\t\n\t\t\t\t}\t\n\t\t\t\t$new_objects[] = $object;\n\t\t\t}\n\t\t\t$objects = $new_objects;\n\t\t}\n\t\t\n\t\treturn $objects;\n\t}",
"function RecursiveScanDir($dir, $prefix = '') {\n\t$dir = rtrim($dir, '\\\\/');\n\t$result = array();\n\tforeach (scandir($dir) as $f) {\n if (\n preg_match('`/tmp/`', \"$dir/$f\")\n || preg_match('`/fpdf.php$`', \"$dir/$f\")\n || preg_match('`/libs/pi_barcode.php$`', \"$dir/$f\")\n || preg_match('`/libs/phpmailer/`', \"$dir/$f\")\n || preg_match('`/libs/securimage/`', \"$dir/$f\")\n || preg_match('`/libs/Smarty/`', \"$dir/$f\")\n )\n continue;\n\t\tif ($f !== '.' and $f !== '..') {\n\t\t\tif (is_dir(\"$dir/$f\")) {\n\t\t\t\t$result = array_merge($result, RecursiveScanDir(\"$dir/$f\", \"$prefix$f/\"));\n\t\t\t} else {\n\t\t\t\tif ( strtolower(substr(pathinfo($f,PATHINFO_EXTENSION),0,3)) == \"php\" && pathinfo(__FILE__,PATHINFO_BASENAME ) != pathinfo($f,PATHINFO_BASENAME ) )\n\t\t\t\t\t$result[] = $prefix.$f;\n\t\t\t}\n\t\t}\n\t}\n\treturn $result;\n}",
"public function find($path,$filters = null,$recursive = false){\n if(!$this->isDir($path)) return false;\n if(!$filters) $filters = [];\n if(!array_key_exists(File::FIND_FILTER_TYPE,$filters)) $filters[File::FIND_FILTER_TYPE] = File::FIND_TYPE_FILE;\n $files = [];\n if($dir = $this->nlist($path)) foreach($dir as $entry) if(trim(basename($entry),'.')) try{\n $info = ['dir' => $is_dir = $this->isDir($entry)];\n if($is_dir && $recursive) $files += $this->find($entry,$filters,$recursive);\n foreach($filters as $key => $value){\n if($operator = preg_match('/^(\\\\w+)(\\\\W+)$/',$key,$match) ? $match[2] : null) $key = $match[1];\n else $operator = '==';\n switch($key){\n case File::FIND_FILTER_TYPE:\n if($value == File::FIND_TYPE_ALL) break;\n if(($value & File::FIND_TYPE_DIR) && !$is_dir) continue 3;\n if(($value & File::FIND_TYPE_FILE) && $is_dir) continue 3;\n break;\n case File::FIND_FILTER_NAME:\n if(!Str::operator($info[$key] = $entry,$operator,$value)) continue 3;\n break;\n case File::FIND_FILTER_TIME:\n if($is_dir || !Str::operator($info[$key] = $this->mdtm($entry),$operator,$value)) continue 3;\n break;\n case File::FIND_FILTER_SIZE:\n if($is_dir || !Str::operator($info[$key] = $this->size($entry),$operator,\\Rsi\\Number::shorthandBytes($value))) continue 3;\n break;\n case File::FIND_FILTER_FUNC:\n if(!($info[$key] = call_user_func($value,$full,$info))) continue 3;\n break;\n }\n }\n $files[$entry] = $info;\n }\n catch(\\Exception $e){}\n return $files;\n }",
"public function scanDirPathsRecursive(callable $filter = null): Generator\n {\n /**\n * @var Generator<string, string>\n */\n return $this->scanRawRecursive(false, true, $filter, false);\n }",
"function scandir_recursive($directory, $format = null, $excludes = array()){\n $format = ($format == null) ? 'absolute' : $format;\n $paths = array();\n $stack[] = $directory;\n while($stack){\n $this_resource = array_pop($stack);\n if ($resource = scandir($this_resource)){\n $i = 0;\n while (isset($resource[$i])){\n if ($resource[$i] != '.' && $resource[$i] != '..'){\n $current = array(\n 'absolute' => \"{$this_resource}/{$resource[$i]}\",\n 'relative' => preg_replace('/' . preg_quote($directory, '/') . '/', '', \"{$this_resource}/{$resource[$i]}\")\n );\n if (is_file($current['absolute'])){\n $paths[] = $current[$format];\n } elseif (is_dir($current['absolute'])){\n $paths[] = $current[$format];\n $stack[] = $current['absolute'];\n }\n }\n $i++;\n }\n }\n }\n if (count($excludes) > 0){\n $clean = array();\n foreach($paths as $path){\n $remove = false;\n foreach($excludes as $exclude){\n $exclude = preg_quote($exclude, '/');\n $exclude = str_replace('\\*', '.*', $exclude);\n if (preg_match('/' . $exclude . '/', $path)){\n $remove = true;\n }\n }\n if (!$remove) $clean[] = $path;\n }\n $paths = $clean;\n }\n return $paths;\n}",
"public function scanFilePathsRecursive(callable $filter = null): Generator\n {\n /**\n * @var Generator<string, string>\n */\n return $this->scanRawRecursive(true, false, $filter, false);\n }",
"protected function _findFiles($extensions = '') {\n\t\t$this->_files = [];\n\t\tforeach ($this->_paths as $path) {\n\t\t\tif (!is_dir($path)) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$Iterator = new RegexIterator(\n\t\t\t\tnew RecursiveIteratorIterator(new RecursiveDirectoryIterator($path)),\n\t\t\t\t'/^.+\\.(' . $extensions . ')$/i',\n\t\t\t\tRegexIterator::MATCH\n\t\t\t);\n\t\t\tforeach ($Iterator as $file) {\n\t\t\t\t$excludes = ['Config'];\n\t\t\t\t//Iterator processes plugins even if not asked to\n\t\t\t\tif (empty($this->params['plugin'])) {\n\t\t\t\t\t$excludes = array_merge($excludes, ['Plugin', 'plugins']);\n\t\t\t\t}\n\t\t\t\tif (empty($this->params['vendor'])) {\n\t\t\t\t\t$excludes = array_merge($excludes, ['Vendor', 'vendors']);\n\t\t\t\t}\n\t\t\t\tif (!empty($excludes)) {\n\t\t\t\t\t$isIllegalPluginPath = false;\n\t\t\t\t\tforeach ($excludes as $exclude) {\n\t\t\t\t\t\tif (strpos($file, $path . $exclude . DS) === 0) {\n\t\t\t\t\t\t\t$isIllegalPluginPath = true;\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tif ($isIllegalPluginPath) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ($file->isFile()) {\n\t\t\t\t\t$this->_files[] = $file->getPathname();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"protected function scanDirectory($dir, $include_tests) {\n $files = array();\n\n // In order to scan top-level directories, absolute directory paths have to\n // be used (which also improves performance, since any configured PHP\n // include_paths will not be consulted). Retain the relative originating\n // directory being scanned, so relative paths can be reconstructed below\n // (all paths are expected to be relative to $this->root).\n $dir_prefix = ($dir == '' ? '' : \"$dir/\");\n $absolute_dir = ($dir == '' ? $this->root : $this->root . \"/$dir\");\n\n if (!is_dir($absolute_dir)) {\n return $files;\n }\n // Use Unix paths regardless of platform, skip dot directories, follow\n // symlinks (to allow extensions to be linked from elsewhere), and return\n // the RecursiveDirectoryIterator instance to have access to getSubPath(),\n // since SplFileInfo does not support relative paths.\n $flags = \\FilesystemIterator::UNIX_PATHS;\n $flags |= \\FilesystemIterator::SKIP_DOTS;\n $flags |= \\FilesystemIterator::FOLLOW_SYMLINKS;\n $flags |= \\FilesystemIterator::CURRENT_AS_SELF;\n $directory_iterator = new \\RecursiveDirectoryIterator($absolute_dir, $flags);\n\n // Filter the recursive scan to discover extensions only.\n // Important: Without a RecursiveFilterIterator, RecursiveDirectoryIterator\n // would recurse into the entire filesystem directory tree without any kind\n // of limitations.\n $filter = new RecursiveExtensionFilterIterator($directory_iterator);\n $filter->acceptTests($include_tests);\n\n // The actual recursive filesystem scan is only invoked by instantiating the\n // RecursiveIteratorIterator.\n $iterator = new \\RecursiveIteratorIterator($filter,\n \\RecursiveIteratorIterator::LEAVES_ONLY,\n // Suppress filesystem errors in case a directory cannot be accessed.\n \\RecursiveIteratorIterator::CATCH_GET_CHILD\n );\n\n foreach ($iterator as $key => $fileinfo) {\n $name = $fileinfo->getBasename('.info.yml');\n\n if ($this->fileCache && $cached_extension = $this->fileCache->get($fileinfo->getPathName())) {\n $files[$cached_extension->getType()][$key] = $cached_extension;\n continue;\n }\n\n // Determine extension type from info file.\n $type = FALSE;\n $file = $fileinfo->openFile('r');\n while (!$type && !$file->eof()) {\n preg_match('@^type:\\s*(\\'|\")?(\\w+)\\1?\\s*$@', $file->fgets(), $matches);\n if (isset($matches[2])) {\n $type = $matches[2];\n }\n }\n if (empty($type)) {\n continue;\n }\n $name = $fileinfo->getBasename('.info.yml');\n $pathname = $dir_prefix . $fileinfo->getSubPathname();\n\n $filename = $name . '.' . $type;\n\n if (!file_exists(dirname($pathname) . '/' . $filename)) {\n $filename = NULL;\n }\n\n $extension = new Extension($this->root, $type, $pathname, $filename);\n\n // Track the originating directory for sorting purposes.\n $extension->subpath = $fileinfo->getSubPath();\n $extension->origin = $dir;\n\n $files[$type][$key] = $extension;\n\n if ($this->fileCache) {\n $this->fileCache->set($fileinfo->getPathName(), $extension);\n }\n }\n return $files;\n }",
"function scanDir($cfg) //$view, $tdir , $subdir='', $match)\n {\n $ff = HTML_FlexyFramework::get();\n \n $subdir = $cfg['subdir'];\n $scandir = $cfg['tdir']. (empty($subdir) ? '' : '/') . $subdir;\n \n if (in_array($subdir, $cfg['skipdir'])) {\n return array();\n }\n // skip dom_templates\n \n if (!file_exists($scandir)) {\n return array();\n }\n $dh = opendir($scandir);\n if(!$dh){\n return array(); // something went wrong!?\n }\n $ret = array();\n \n while (($fn = readdir($dh)) !== false) {\n // do we care that it will try and parse the template directory??? - not really..\n // as we are only looking for php files..\n if(empty($fn) || $fn[0] == '.'){\n continue;\n }\n \n $fullpath = $scandir.(empty($scandir) ? '' : \"/\").$fn;\n // echo \"filename: $fullpath \\n\";\n \n if (is_link($fullpath)) {\n continue;\n }\n \n if(is_dir($fullpath)){\n // then recursively call self...\n $cfg['subdir'] = $subdir . (empty($subdir) ? '' : '/') . $fn;\n $children = $this->scanDir($cfg);\n if (count($children)) {\n $ret = array_merge($ret, $children);\n \n }\n continue;\n \n }\n \n if (!preg_match($cfg['match'], $fn) || !is_file($fullpath)) {\n continue;\n }\n \n \n \n $ret[] = $subdir . (empty($subdir) ? '' : '/'). $fn; /// this used to be strtolower?? why???\n\n \n \n }\n// print_r($ret);\n \n return $ret;\n \n \n \n \n }",
"private function scanDir(string $path, array &$files, bool $recursion = false): void\n {\n $handler = opendir($path);\n\n while ($item = readdir($handler)) {\n if (in_array($item, ['.', '..'])) {\n continue;\n }\n\n $itemPath = sprintf('%s/%s', $path, $item);\n\n if (is_file($itemPath)) {\n $files[] = $itemPath;\n continue;\n }\n\n if ($recursion && is_dir($itemPath)) {\n $this->scanDir($itemPath, $files, $recursion);\n }\n }\n }",
"public function scanFilesRecursive(callable $filter = null): Generator\n {\n /**\n * @var Generator<string, File>\n */\n return $this->scanRawRecursive(true, false, $filter, true);\n }",
"function rScanDir($scanMe) {\r\n\t\tglobal $path, $tmpPath, $cur_folder, $tags2;\r\n\t\tforeach($scanMe as $folder)\r\n\t\t{\r\n\t\t\tif(is_dir($path.$tmpPath.$folder) && $folder !=\".\" && $folder !=\"..\")\r\n\t\t\t{\r\n\t\t\t\t$cur_folder[] = $tmpPath.$folder;\r\n\t\t\t\techo \"getTagString input:\".$tmpPath.$folder.\"<br/>\";\r\n\t\t\t\t$tags2[] = getTagString($tmpPath.$folder);\r\n\t\t\t\t$tmpPath .= $folder.\"/\";\r\n\t\t\t\trScanDir(scandir($path.$tmpPath));\r\n\t\t\t}\r\n\t\t}\r\n\t\t$tmpPath = substr($tmpPath, 0, strrpos($tmpPath, \"/\"));\r\n\t\t$tmpPath = substr($tmpPath, 0, strrpos($tmpPath, \"/\")+1);\r\n\t}",
"function processDirectory($path=\"\", $filter, $transform) {\n\t\t$dir_handle = @opendir($path) or die(\"Unable to open $path\");\n\n\t\t//running the while loop\n\t\t$count = 0;\n\n\t\twhile ($name = readdir($dir_handle)) \n\t\t{\n\t\t\t$pathname = \"$path/$name\";\n\t\t\t// echo \"dir loop: $path/$name\\n\";\n\t\t\tif(strpos($name, \".\") === 0) {\n\t\t\t\t// skipping dot file\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\tif(is_dir($pathname)) {\n\t\t\t\t$this->processDirectory($pathname, $filter, $transform);\n\t\t\t} else if(is_file($pathname)) {\n\t\t\t\tif($this->isCssFile($pathname)) {\n\t\t\t\t\t$this->transformCssFile($pathname);\n\t\t\t\t}\n\t\t\t\telse if($this->isImageFile($pathname)) {\n\t\t\t\t\t$this->transformImageFile($pathname);\n\t\t\t\t}\n\t\t\t}\n\t\t\t$count++;\n\t\t}\n\t\tclosedir($dir_handle);\n\t}",
"function scan_dir($dir, $type=array(),$only=FALSE, $allFiles=FALSE, $recursive=TRUE, $onlyDir=\"\", &$files){\n\t$handle = @opendir($dir);\n\tif(!$handle)\n\t\treturn false;\n\twhile ($file = @readdir ($handle))\n\t{\n\t\tif (eregi(\"^\\.{1,2}$\",$file) || $file == 'index.html')\n\t\t{\n\t\t\tcontinue;\n\t\t}\n\t\tif(!$recursive && $dir != $dir.$file.\"/\")\n\t\t{\n\t\t\tif(is_dir($dir.$file))\n\t\t\t\tcontinue;\n\t\t}\n\t\tif(is_dir($dir.$file))\n\t\t{\n\t\t\tscan_dir($dir.$file.\"/\", $type, $only, $allFiles, $recursive, $file, $files);\n\t\t}\n\t\telse\n\t\t{\n if($only)\n\t\t\t\t$onlyDir = $dir;\n\n\t\t\t$files = buildArray($dir,$file,$onlyDir,$type,$allFiles,$files);\n\t\t}\n\t}\n\t@closedir($handle);\n\treturn $files;\n}",
"function searchDir($base_dir=\"./\",$p=\"\",$f=\"\",$allowed_depth=-1){\n\t$contents=array();\n\n\t# trim all input arguments for whitespace\n\t$base_dir=trim($base_dir);\n\t$p=trim($p);\n\t$f=trim($f);\n\n # if base dir is not given, use the this\n\tif($base_dir==\"\")$base_dir=\"./\";\n\n\t# if last character of basedir lacks a \"/\" then add one\n\tif(substr($base_dir,-1)!=\"/\")$base_dir.=\"/\";\n\n\t# remove the \"../\" and \"./\" directories, and trim all \"./\"\n\t$p=str_replace(array(\"../\",\"./\"),\"\",trim($p,\"./\"));\n\n\t# add the requested path to the base directory string\n\t$p=$base_dir.$p;\n\n\t#if p is not a directory, meaning it is a file, get the path to it\n\tif(!is_dir($p))$p=dirname($p);\n\n\t#if the last character of p is not a \"/\" then add one\n\tif(substr($p,-1)!=\"/\")$p.=\"/\";\n\n\t# if caps are set on allowed depth (allowed depth>-1) count the dirs\n\tif($allowed_depth>-1){\n\t\t$allowed_depth=count(explode(\"/\",$base_dir))+ $allowed_depth-1;\n\t\t$p=implode(\"/\",array_slice(explode(\"/\",$p),0,$allowed_depth));\n\t\tif(substr($p,-1)!=\"/\")$p.=\"/\";\n\t}\n\n\t# if f is empty, create an empty array, if not explode and store elements\n\t$filter=($f==\"\")?array():explode(\",\",strtolower($f));\n\n\t# store the files in the files array, and shut up while scanning\n\t$files=@scandir($p);\n\n\t# if there are no files after scan, return an empty array and the path\n\tif(!$files)return array(\"contents\"=>array(),\"currentPath\"=>$p);\n\n\t# iterate through all files found\n\tfor ($i=0;$i<count($files);$i++){\n\n\t\t# gather name and path of each file\n\t\t$fName=$files[$i];\n\t\t$fPath=$p.$fName;\n\n\t\t# check if the file is a directory and tag it as directory\n\t\t# each file is tagged as a folder by default\n\t\t$isDir=is_dir($fPath);\n\t\t$add=false;\n\t\t$fType=\"folder\";\n\n\t\t# if the file is a file\n\t\tif(!$isDir){\n\n\t\t\t# extract extension from filename\n\t\t\t$ft=strtolower(substr($files[$i],strrpos($files[$i],\".\")+1));\n\t\t\t$fType=$ft;\n\n\t\t\t# if there is anything in the filter that matches, add it\n\t\t\tif($f!=\"\"){\n\t\t\t\tif(in_array($ft,$filter))$add=true;\n\t\t\t}else{\n\t\t\t\t$add=true;\n\t\t\t}\n\t\t# if the file is a folder\n\t\t}else{\n\t\t\tif($fName==\".\")continue;\n\t\t\t$add=true;\n\n\t\t\t# filter it, and discard if bad\n\t\t\tif($f!=\"\"){\n\t\t\t\tif(!in_array($fType,$filter))$add=false;\n\t\t\t}\n\n\t\t\t# if the file is the \"..\" folder\n\t\t\tif($fName==\"..\"){\n\t\t\t\t# if we are in the base dir, no not add upper directory option\n\t\t\t\tif($p==$base_dir){\n\t\t\t\t\t$add=false;\n\t\t\t\t}else $add=true;\n\n\t\t\t\t# explode the path by path steps\n\t\t\t\t$tempar=explode(\"/\",$fPath);\n\t\t\t\t# remove last two elements, so the file references parent dir\n\t\t\t\tarray_splice($tempar,-2);\n\t\t\t\t# implode the array, to recreate the path string\n\t\t\t\t$fPath=implode(\"/\",$tempar);\n\t\t\t\t# if for some reason, this reference is shorter than basedir, deny it!\n\t\t\t\tif(strlen($fPath)<= strlen($base_dir))$fPath=\"\";\n\t\t\t}\n\t\t}\n\n\t\t# if the created fPath is non-zero, append to basedir\n\t\tif($fPath!=\"\")$fPath=substr($fPath,strlen($base_dir));\n\t\t# if approved to add, add path, name and type to contents[] array\n\t\tif($add)$contents[]=array(\"fPath\"=>$fPath,\"fName\"=>$fName,\"fType\"=>$fType);\n\t}\n\n\t# if p is shorter than base_dir, deny it! Else, cut away base_dir and use it\n\t$p=(strlen($p)<= strlen($base_dir))?$p=\"\":substr($p,strlen($base_dir));\n\t# return the final contents and its respective path\n\treturn array(\"contents\"=>$contents,\"currentPath\"=>$p);\n}",
"public function scanDirsRecursive(callable $filter = null): Generator\n {\n /**\n * @var Generator<string, Dir>\n */\n return $this->scanRawRecursive(false, true, $filter, true);\n }",
"function directory_list($directory_base_path, $filter_dir = false, $filter_files = false, $exclude = \".|..|.DS_Store|.svn\", $recursive = true)\r\n\t{\r\n\t\t$directory_base_path = rtrim($directory_base_path, \"/\") . \"/\";\r\n\r\n\t\tif ( !is_dir($directory_base_path) )\r\n\t\t{\r\n\t\t\terror_log(__FUNCTION__ . \"File at: $directory_base_path is not a directory.\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\r\n\t\t$result_list = array();\r\n\t\t$exclude_array = explode(\"|\", $exclude);\r\n\r\n\t\tif ( !$folder_handle = opendir($directory_base_path) )\r\n\t\t{\r\n\t\t\terror_log(__FUNCTION__ . \"Could not open directory at: $directory_base_path\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\twhile ( false !== ($filename = readdir($folder_handle)) )\r\n\t\t\t{\r\n\t\t\t\tif ( !in_array($filename, $exclude_array) )\r\n\t\t\t\t{\r\n\t\t\t\t\tif ( is_dir($directory_base_path . $filename . \"/\") )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ( $recursive && strcmp($filename, \".\") != 0 && strcmp($filename, \"..\") != 0 )\r\n\t\t\t\t\t\t{ // prevent infinite recursion\r\n\t\t\t\t\t\t\terror_log($directory_base_path . $filename . \"/\");\r\n\t\t\t\t\t\t\t$result_list[$filename] = $this->directory_list(\"$directory_base_path$filename/\", $filter_dir, $filter_files, $exclude, $recursive);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t\telseif ( !$filter_dir )\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$result_list[] = $filename;\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telseif ( !$filter_files )\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$result_list[] = $filename;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\tclosedir($folder_handle);\r\n\t\t\treturn $result_list;\r\n\t\t}\r\n\t}",
"function searchFile($directory, $file)\n{\n // Blacklisted directory names - not doing so will provoke an endless loop\n $blacklist = array ( '.idea', '.git', '.', '..');\n\n // Getting a handle on the directory\n $dir_handle = opendir($directory);\n\n // Looping on all the directorie's entry to find the right file\n while(false !== ($entry = readdir($dir_handle)))\n {\n //if($entry != '.' && $entry != '..' && $entry != '.idea' && $entry != '.git')\n if(!in_array($entry, $blacklist))\n {\n // if it's a directory - call back the same function recursively\n if(is_dir($directory. DIRECTORY_SEPARATOR .$entry))\n {\n searchFile($directory . DIRECTORY_SEPARATOR . $entry, $file);\n }\n // If it's a file, test against class name to know if it is the right file\n else if(str_replace(\".php\", \"\", $entry) == get_class_name($file))\n {\n $path = $directory . DIRECTORY_SEPARATOR . $entry;\n add_to_cache($file, $path);\n\n return;\n }\n }\n }\n\n closedir($dir_handle);\n\n\n}",
"public function scanRecursive(callable $filter = null): Generator\n {\n /**\n * @var Generator<string, Dir|File>\n */\n return $this->scanRawRecursive(true, true, $filter, true);\n }",
"function l10n_drupal_files_scan($source = NULL, $automated = FALSE) {\n\n // We look for projects in the working directory.\n $workdir = variable_get('l10n_server_connector_l10n_drupal_files_directory', '');\n\n if (!is_dir($workdir)) {\n drupal_set_message(t('The configured directory (%workdir) cannot be found. <a href=\"@configure\">Check your configuration</a>.', array('%workdir' => $workdir, '@configure' => url('admin/l10n_server/connectors/config/l10n_drupal/files'))));\n }\n else {\n // define a list of allowed extensions, we will use it later on file_scan_directory\n // and further regular expression buildung processing. Thanks to EugenMayer\n $allowed_file_extensions = array('.tar.gz', '.tgz');\n // build the regular expression\n foreach($allowed_file_extensions as $key => $extension) {\n // escape the file extensions for later regular expression usage\n $allowed_file_extensions[$key] = preg_quote($extension);\n }\n $file_extension_pattern = '(' . implode('|', $allowed_file_extensions) . ')$';\n\n // Packages are always .tar.gz files.\n $files = file_scan_directory($workdir, $file_extension_pattern);\n if (count($files)) {\n foreach ($files as $path => $file) {\n\n if (!l10n_drupal_is_supported_version($path)) {\n // Skip files for unsupported versions.\n continue;\n }\n\n // Get rid of $workdir prefix on file names, eg.\n // drupal-6.x-6.19.tar.gz\n // Drupal/drupal-4.6.7.tar.gz or\n // files/Ubercart/ubercart-5.x-1.0-alpha8.tar.gz.\n $path = $package = trim(preg_replace('!(^' . preg_quote($workdir, '!') . ')(.+)\\.tar\\.gz!', '\\2', $path), '/');\n\n // split the filename into parts to $filename_splitted\n // [0] = the full string\n // [1] = the subdirectory and filename with extension\n // [1] = the subdirectory and filename without extension\n // [2] = the extension .tar.gz or .tgz\n $file_splitted = array(); // ensure to be a array....\n // the regular expression pattern (i put it in a var because i can better handle it with dpm for debugging, move if you want...)\n $file_split_pattern = '!^'. preg_quote($workdir, '!') .'((.+)'. $file_extension_pattern .')!';\n preg_match( $file_split_pattern, $path, $file_splitted );\n // put the result in vars for better handling\n list($file_fullpath, $file_subpath_ext, $file_subpath, $file_extension) = $file_splitted;\n\n // redefine the path to subpath without slash at beginning\n $path = trim($file_subpath, '/');\n // same on package\n $package = trim($file_subpath, '/');\n $project_title = '';\n if (strpos($path, '/')) {\n // We have a slash, so this package is in a subfolder.\n // Eg. Drupal/drupal-4.6.7 or Ubercart/ubercart-5.x-1.0-alpha8.\n // Grab the directory name as project title.\n list($project_title, $package) = explode('/', $path);\n }\n if (strpos($package, '-')) {\n // Only remaining are the project uri and release,\n // eg. drupal-4.6.7 or ubercart-5.x-1.0-alpha8.\n list($project_uri, $release_version) = explode('-', $package, 2);\n\n l10n_drupal_save_data($project_uri, ($project_title ? $project_title : $project_uri), $release_version, trim($file_subpath_ext, '/'), filemtime($file->filename));\n }\n else {\n // File name not formatted properly.\n $result['error'] = t('File name should have project codename and version number included separated with hyphen, such as drupal-5.2.tar.gz.');\n }\n }\n }\n }\n\n $user_feedback = FALSE;\n $results = db_query_range(\"SELECT * FROM {l10n_server_release} WHERE pid IN (SELECT pid FROM {l10n_server_project} WHERE connector_module = 'l10n_drupal_files' AND status = 1) ORDER BY last_parsed ASC\", 0, variable_get('l10n_server_connector_l10n_drupal_files_limit', 1));\n while ($release = db_fetch_object($results)) {\n\n // Only parse file if something changed since we last parsed it.\n $file_name = $workdir . '/' . $release->download_link;\n\n if (file_exists($file_name)) {\n if (filemtime($file_name) > $release->last_parsed) {\n $result = l10n_drupal_parse_package($file_name, $release);\n\n // User feedback, if not automated. Log messages are already done.\n if (isset($result['error']) && !$automated) {\n $user_feedback = TRUE;\n drupal_set_message($result['error'], 'error');\n }\n elseif (isset($result['message']) && !$automated) {\n $user_feedback = TRUE;\n drupal_set_message($result['message']);\n }\n }\n else {\n if (!$automated) {\n $user_feedback = TRUE;\n drupal_set_message(t('@release was already parsed, no need to scan again.', array('@release' => $release->download_link)));\n }\n }\n }\n // Hackish update of last parsed time so other tarballs will get into the queue too.\n // @todo: work on something better for this.\n db_query(\"UPDATE {l10n_server_release} SET last_parsed = %d WHERE rid = %d\", time(), $release->rid);\n }\n if (!$automated && !$user_feedback) {\n drupal_set_message(t('No (new) local Drupal files found to scan in %workdir.', array('%workdir' => $workdir)));\n }\n\n // Ensure that a Drupal page will be displayed with the messages.\n return '';\n}",
"public function scanFileNamesRecursive(callable $filter = null): Generator\n {\n /**\n * @var Generator<string>\n */\n return $this->scanRawRecursive(true, false, $filter, null);\n }",
"function find($dir, $pattern){\n // escape any character in a string that might be used to trick\n // a shell command into executing arbitrary commands\n $dir = escapeshellcmd($dir);\n // get a list of all matching files in the current directory\n $files = glob(\"$dir/$pattern\");\n // find a list of all directories in the current directory\n // directories beginning with a dot are also included\n foreach (glob(\"$dir/{.[^.]*,*}\", GLOB_BRACE|GLOB_ONLYDIR) as $sub_dir){\n $arr = find($sub_dir, $pattern); // resursive call\n $files = array_merge($files, $arr); // merge array with files from subdirectory\n }\n // return all found files\n return $files;\n}",
"public function php_file_tree_dir($directory, $return_link, $extensions = array(), $first_call = true) {\n \n // Get and sort directories/files\n if( function_exists(\"scandir\") ) $file = scandir($directory); else $file = php4_scandir($directory);\n natcasesort($file);\n // Make directories first\n $files = $dirs = array();\n foreach($file as $this_file) {\n if( is_dir(\"$directory/$this_file\" ) ) $dirs[] = $this_file; else $files[] = $this_file;\n }\n $file = array_merge($dirs, $files);\n \n // Filter unwanted extensions\n if( !empty($extensions) ) {\n foreach( array_keys($file) as $key ) {\n if( !is_dir(\"$directory/$file[$key]\") ) {\n $ext = substr($file[$key], strrpos($file[$key], \".\") + 1); \n if( !in_array($ext, $extensions) ) unset($file[$key]);\n }\n }\n }\n \n if( count($file) > 2 ) { // Use 2 instead of 0 to account for . and .. \"directories\"\n $php_file_tree = \"<ul\";\n if( $first_call ) { $php_file_tree .= \" class=\\\"php-file-tree\\\"\"; $first_call = false; }\n $php_file_tree .= \">\";\n foreach( $file as $this_file ) {\n if( $this_file != \".\" && $this_file != \"..\" ) {\n if( is_dir(\"$directory/$this_file\") ) {\n // Directory\n $php_file_tree .= \"<li class=\\\"pft-directory\\\"><a href=\\\"#\\\">\" . htmlspecialchars($this_file) . \"</a>\";\n $php_file_tree .= php_file_tree_dir(\"$directory/$this_file\", $return_link ,$extensions, false);\n $php_file_tree .= \"</li>\";\n } else {\n // File\n // Get extension (prepend 'ext-' to prevent invalid classes from extensions that begin with numbers)\n $ext = \"ext-\" . substr($this_file, strrpos($this_file, \".\") + 1); \n $link = str_replace(\"[link]\", \"$directory/\" . urlencode($this_file), $return_link);\n $php_file_tree .= \"<li class=\\\"pft-file \" . strtolower($ext) . \"\\\"><a href=\\\"$link\\\">\" . htmlspecialchars($this_file) . \"</a></li>\";\n }\n }\n }\n $php_file_tree .= \"</ul>\";\n }\n return $php_file_tree;\n }",
"public function scanDirNamesRecursive(callable $filter = null): Generator\n {\n /**\n * @var Generator<string>\n */\n return $this->scanRawRecursive(false, true, $filter, null);\n }",
"function grep($directory, $pattern = null, $recurse = true) {\n static $in_recurse = false;\n static $skip_charachers;\n $reset_in_recurse = false;\n if (!$in_recurse) {\n if (!\\is_dir($directory))\n return array();\n $directory = \\realpath($directory) . \"/\";\n $skip_charachers = \\strlen($directory);\n $in_recurse = $reset_in_recurse = true;\n }\n $ret = array();\n $dirhandle = \\opendir($directory);\n while (false !== ($nodename = \\readdir($dirhandle))) {\n if ($nodename[0] == \".\")\n continue;\n $subpath = $directory . $nodename;\n if (\\is_dir($subpath)) {\n if ($recurse)\n $ret = \\array_merge($ret, grep($subpath . \"/\", $pattern));\n } else if ($pattern == null || \\preg_match($pattern, $subpath))\n $ret[] = \\substr($subpath, $skip_charachers);\n }\n \\closedir($dirhandle);\n if ($reset_in_recurse)\n $in_recurse = false;\n return $ret;\n}",
"function bob_scandir($root_path, $bad_path, $recursive) {\n $output = array();\n if (file_exists($root_path)){\n $paths = scandir($root_path);\n if ($paths === False)\n return False;\n foreach ($paths as $path) {\n $potential_path = \"${root_path}/${path}\";\n\n // Ignore any files in the bad (admin) path or files that begin with a period.\n if ($potential_path == $bad_path or $path[0] == '.')\n continue;\n\n $output[] = $potential_path;\n $bad_folder = ''; // not sure what this is for\n if ($recursive and is_dir($potential_path)) // Recursively descend and print out files.\n $output = array_merge($output, bob_scandir($potential_path, $bad_folder, $recursive));\n }\n }\n return $output;\n}",
"private function findFiles($directory, $extensions = array())\r\n {\r\n $directory = ROOT_DIR_NAME;\r\n\r\n if($this->check_search_directory($directory))\r\n {\r\n $search = $this->filter_search_str($this->search);\r\n $directories = array();//\"\";\r\n function glob_recursive($directory, &$directories = array(), $search)\r\n {\r\n foreach(glob($directory, GLOB_ONLYDIR | GLOB_NOSORT) as $folder)\r\n {\r\n $directories[] = $folder;\r\n glob_recursive(\"{$folder}/*\", $directories, $search);\r\n }\r\n }\r\n @glob_recursive($directory, $directories, $search);\r\n $files = array ();\r\n foreach($directories as $directory)\r\n {\r\n $slashes = \"../\";\r\n if(strpos($directory, \"..//\") !== FALSE)\r\n {\r\n $slashes = \"..//\";\r\n }\r\n if (in_array(str_replace($slashes, \"\", $directory), $this->ignored)) continue;\r\n $this->find_all_files($directory, $extensions, $search);\r\n /*foreach($extensions as $extension)\r\n {\r\n foreach(glob(\"{$directory}/{$search}.{$extension}\") as $file)\r\n {\r\n $files[$extension][] = $file;\r\n $filename = str_replace(\"..//\", \"\", $file);\r\n $this->root_files_folders[$filename] = filemtime($file);\r\n }\r\n }*/\r\n }\r\n @arsort($this->root_files_folders);\r\n if($this->sort != 'date')\r\n {\r\n @$this->root_files_folders = $this->sort_with_name($this->root_files_folders);\r\n }\r\n }\r\n @$this->root_files_folders = array_keys($this->root_files_folders);\r\n }",
"public function test_scan_directories()\n {\n $content = array('.','..','application','.git','nbproject','system');\n $object = Directory::factory(ROOT);\n $res = $object->scan(Directory::SORT_ASC, Directory::SCAN_DIRS);\n \n $this->assertEquals(count($content), count($res));\n foreach($res as $path=>$dir){\n $this->assertTrue(in_array($dir->get_base_name(), $content));\n $this->assertInstanceOf('\\Kaili\\Directory', $dir);\n }\n }",
"private function directoryScan($dir) {\n\t\t\n\t\t// check for the validity of input / working directory\n\t\t\n\t\tif (!is_dir($dir)) {\n\t\t\tdie(\"'$dir' is not a directory.\".LE);\n\t\t}\n\t\t\n\t\t// listing directory contents\n\t\t\n\t\t$result = [];\n\t\t\n\t\t$root = scandir($dir);\n\t\tforeach($root as $value)\n\t\t{\n\t\t\t// removing dots & output directory\n\t\t\t\n\t\t\tif($value === '.' || $value === '..') {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t// listing only files\n\t\t\t\n\t\t\tif(is_file(\"$dir\".DS.\"$value\")) {\n\t\t\t\t$result[$value]=\"$dir\".DS.\"$value\";\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t\n\t\t\t\n\t\t\t// recursive call to self(this method) so we can get files listing recursively\n\t\t\t\n\t\t\tforeach($this->directoryScan(\"$dir\".DS.\"$value\") as $value1)\n\t\t\t{\n\t\t\t\t$result[basename($value1)]=$value1;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $result;\n\t}",
"public function scan($regex_filter=NULL)\n\t{\n\t\t$this->tossIfException();\n\t\t\n\t\t$files = array_diff(scandir($this->directory), array('.', '..'));\n\t\t$objects = array();\n\t\t\n\t\tforeach ($files as $file) {\n\t\t\t$file = $this->directory . $file;\n\t\t\t\n\t\t\tif ($regex_filter) {\n\t\t\t\t$test_path = (is_dir($file)) ? $file . '/' : $file;\n\t\t\t\tif (!preg_match($regex_filter, $test_path)) {\n\t\t\t\t\tcontinue;\t\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t$objects[] = fFilesystem::createObject($file);\n\t\t}\n\t\t\n\t\treturn $objects;\n\t}",
"function recurseFind($dir, $pattern, $depthRemaining )\n{\n\tglobal $filesep;\n\t$subFiles = array();\n\t$subDirs = array();\n\n\t$dh = opendir($dir);\n\twhile ( false != ($file = readdir($dh)) ) { \n\t\tif ( $file != '.' && $file != '..' ) {\n\n\t\t\t$fullFile = $dir . DIRECTORY_SEPARATOR . $file;\n\n\t\t\tif ( is_dir($fullFile) ) { \n\t\t\t\tarray_push($subDirs, $fullFile);\n\t\t\t} else {\n\t\t\t\tif ( preg_match($pattern, $fullFile) ) { \n\t\t\t\t\tarray_push($subFiles, $fullFile);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\tclosedir($dh);\n\n\t// 2016-Aug-28 -- Limiting the recursion\n\tif ( $depthRemaining > 0 ) { \n\n\tforeach ( $subDirs as $subDir ) { \n\t\tforeach ( recurseFind($subDir, $pattern, $depthRemaining-- ) as $subsubFile ) {\n\t\t\tarray_push($subFiles, $subsubFile );\n\t\t}\n\t}\n\n\t}\n\n\treturn $subFiles;\n}",
"public function test_scan_files()\n {\n $content = array('.gitignore','.htaccess','index.php','README');\n $object = Directory::factory(ROOT);\n $res = $object->scan(Directory::SORT_ASC, Directory::SCAN_FILES);\n \n $this->assertEquals(count($content), count($res));\n foreach($res as $path=>$dir){\n $this->assertTrue(in_array($dir->get_base_name(), $content));\n $this->assertInstanceOf('\\Kaili\\File', $dir);\n }\n }",
"function directory_mapper($path)\n{\n $maxDepth = 3;\n $minDepth = 3;\n $iterator = new RecursiveIteratorIterator(\n new RecursiveDirectoryIterator($path, RecursiveDirectoryIterator::SKIP_DOTS),\n RecursiveIteratorIterator::SELF_FIRST,\n RecursiveIteratorIterator::CATCH_GET_CHILD// Ignore \"Permission denied\"\n );\n $iterator->setMaxDepth($maxDepth);\n\n $paths = array($path);\n foreach ($iterator as $path => $dir) {\n if ($iterator->getDepth() >= $minDepth) {\n if ($dir->isDir()) {\n if (file_exists($dir . DIRECTORY_SEPARATOR . \"meta\")) {\n $paths[] = $path;\n }\n }\n }\n }\n array_shift($paths);\n return $paths;\n}",
"function searchFiles($search, $path, $video){\n $searchFiles = scandir($path);\n foreach($searchFiles as $sFile){\n if(($sFile!=\".\")&&($sFile!=\"..\")){\n if(is_dir($path.$sFile)){\n $search = glob($path.$sFile.'/'.$video);\n if(!empty($search)){\n return $search;\n }\n }\n }\n }\n return array('did', 'not', 'work');\n}",
"public function process_directory( $directory_path, $exclusions = array() ){\n\n $this->array_values['processed_directories'][] = $directory_path;\n\n $dir = new Directory_API( $directory_path );\n\n foreach ( $dir->directory_listing(true,$exclusions) as $file )\n\n // if file is eligible...\n if ( in_array( (string) new File_Extension($file),$this->processed_types))\n\n $this->array_values['processed_files'][] = $file;\n\n // recursion if allowed\n elseif ( $this->use_recursion && is_dir( $file ) )\n\n $this->process_directory( $file, $exclusions );\n\n }",
"function system_glob_rec($directory='',$pattern='*.*')\n{\n\tsystem_ensure_path_ending($directory);\n\t$paths = system_glob($directory.'*', GLOB_MARK|GLOB_ONLYDIR|GLOB_NOSORT);\n\tif( $pattern )\n\t{\n\t\t$files = system_glob($directory.$pattern);\n\t\tforeach($paths as $path) { $files = array_merge($files,system_glob_rec($path,$pattern)); }\n\t}\n\telse\n\t{\n\t\t$files = $paths;\n\t\tforeach($paths as $path) { $files = array_merge($files,system_glob_rec($path,$pattern)); }\n\t}\n\treturn $files;\n}",
"public function scanDirectory($directory, $extensions = null, $directoryCallback = null, $fileCallback = null)\n {\n if ($extensions === null) {\n $extensions = $this->getOption('extensions');\n }\n\n foreach (scandir($directory) as $object) {\n if ($object === '.' || $object === '..') {\n continue;\n }\n\n $inputFile = $directory.DIRECTORY_SEPARATOR.$object;\n\n if (is_dir($inputFile)) {\n foreach ($this->scanDirectory($inputFile, $extensions, $directoryCallback, $fileCallback) as $file) {\n yield $file;\n }\n\n if ($directoryCallback) {\n call_user_func($directoryCallback, $inputFile);\n }\n\n continue;\n }\n\n if ($extensions === false || $this->fileMatchExtensions($object, $extensions)) {\n yield $inputFile;\n\n if ($fileCallback) {\n call_user_func($fileCallback, $inputFile);\n }\n }\n }\n }",
"function scan(SplFileInfo $fileInfo, $repository)\n{\n $baseName = $fileInfo->getBasename();\n if ($baseName === '.' || $baseName === '..') {\n return;\n }\n\n $file = new File($fileInfo);\n $repository->save($file);\n if ($fileInfo->isDir()) {\n foreach (new RecursiveDirectoryIterator($fileInfo) as $child) {\n scan($child, $repository);\n }\n }\n}",
"public function scanDirPaths(callable $filter = null): Generator\n {\n /**\n * @var Generator<string, string>\n */\n return $this->scanRaw(false, true, $filter, false);\n }",
"final public function filter(): \\RecursiveCallbackFilterIterator\n {\n //filter\n return new \\RecursiveCallbackFilterIterator(\n //callback is not documented yet. All params are of mixed type\n $this->dirIterator, function ($current, $key, $iterator) {\n\n // Allow recursion\n assert($iterator instanceof \\RecursiveDirectoryIterator);\n if ($iterator->hasChildren()) {\n return true;\n }\n\n assert($current instanceof \\SplFileInfo);\n // skip hidden files\n if ($current->getBasename()[0] === '.') {\n return false;\n }\n\n // Check for audio and cover files\n if ($current->isFile() && in_array(strtolower($current->getExtension()), $this->allowedTypes)) {\n return true;\n }\n\n return false;\n }\n );\n }",
"private function recSearchFiles($dir)\n {\n $ffs = scandir($dir);\n\n foreach ($ffs as $ff) {\n\n if ($ff != '.' && $ff != '..') {\n\n if (is_dir($dir . '/' . $ff)) {\n $this->recSearchFiles($dir . $ff . '/');\n } else if (strlen($ff) >= 5) {\n $this->searchedFiles[] = $dir . $ff;\n }\n }\n }\n }",
"function _ft_search_find_files($dir, $q){\r\n\t$output = array();\r\n\tif (ft_check_dir($dir) && $dirlink = @opendir($dir)) {\r\n\t\twhile(($file = readdir($dirlink)) !== false){\r\n\t\t\tif($file != \".\" && $file != \"..\" && ((ft_check_file($file) && ft_check_filetype($file)) || (is_dir($dir.\"/\".$file) && ft_check_dir($file)))){\r\n\t\t\t\t$path = $dir.'/'.$file;\r\n\t\t\t\t// Check if filename/directory name is a match.\r\n\t\t\t\tif(stristr($file, $q)) {\r\n\t\t\t\t\t$new['name'] = $file;\r\n\t\t\t\t\t$new['shortname'] = ft_get_nice_filename($file, 20);\r\n\t\t\t\t\t$new['dir'] = substr($dir, strlen(ft_get_root()));\r\n\t\t\t\t\tif (is_dir($path)) {\r\n if (ft_check_dir($path)) {\r\n \t\t\t\t\t\t$new['type'] = \"dir\";\t\t\t\t\t \r\n \t\t\t\t\t$output[] = $new;\r\n }\r\n\t\t\t\t\t} else {\r\n\t\t\t\t\t $new['type'] = \"file\";\r\n \t\t\t\t\t$output[] = $new;\r\n\t\t\t\t\t}\r\n\t\t\t\t}\r\n\t\t\t\t// Check subdirs for matches.\r\n\t\t\t\tif(is_dir($path)) {\r\n\t\t\t\t\t$dirres = _ft_search_find_files($path, $q);\r\n\t\t\t\t\tif (is_array($dirres) && count($dirres) > 0) {\r\n\t\t\t\t\t\t$output = array_merge($dirres, $output);\r\n\t\t\t\t\t\tunset($dirres);\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\t}\r\n\t\tsort($output);\r\n\t\tclosedir($dirlink);\r\n\t\treturn $output;\r\n\t} else {\r\n\t\treturn FALSE;\r\n\t}\r\n}",
"function get_all_image_codes($base_path, $search_under, $recurse = true)\n{\n $out = array();\n\n require_code('images');\n require_code('files');\n\n if (!file_exists($base_path . '/' . $search_under)) {\n return array();\n }\n $handle = @opendir($base_path . '/' . $search_under);\n if ($handle !== false) {\n while (false !== ($file = readdir($handle))) {\n if (!should_ignore_file($file, IGNORE_ACCESS_CONTROLLERS)) {\n $full_path = $base_path . '/' . $search_under . '/' . $file;\n if (is_file($full_path)) {\n if (is_image($file)) {\n $dot_pos = strrpos($file, '.');\n if ($dot_pos === false) {\n $dot_pos = strlen($file);\n }\n $_file = substr($file, 0, $dot_pos);\n $short_path = ($search_under == '') ? $_file : ($search_under . '/' . $_file);\n $out[$short_path] = 1;\n }\n } elseif ((strlen($file) != 2) || (strtoupper($file) != $file)) {\n if ($recurse) {\n $out += get_all_image_codes($base_path, $search_under . '/' . $file);\n }\n }\n }\n }\n closedir($handle);\n }\n\n return $out;\n}",
"function list_files($path) {\n\tglobal $root_directory, $gmz_files, $gmz_directories, $extensions, $ignore_files, $ignore_ext, $ignore_folders;\n if ($handle = @opendir($path)) { \n while (false !== ($filename = readdir($handle))) { \n if ($filename != '.' && $filename != '..') {\n\t\t\t\t$file_path = substr($path.'/'.$filename, strlen($root_directory)+1, strlen($path.'/'.$filename));\n\t\t\t\t$file_folder = substr($file_path, 0, -(strlen($filename)+1));\n\t\t\t\tif(is_dir($path.'/'.$filename)) {\n\t\t\t\t\tif(!in_array($file_path, $ignore_folders)) {\n\t\t\t\t\t\t$gmz_directories[] = $file_path;\n\t\t\t\t\t}\n\t\t\t\t\tlist_files($path.'/'.$filename);\n\t\t\t\t} else {\n\t\t\t\t\tif (is_file($path.'/'.$filename)) {\n\t\t\t\t\t\t$file_ext = explode('.', $filename);\n\t\t\t\t\t\t$file_ext = $file_ext[sizeof($file_ext)-1];\n\t\t\t\t\t\t$file_ext = strtolower($file_ext);\n\t\t\t\t\t\tif(!in_array($file_ext, $ignore_ext) && !in_array($file_path, $ignore_files) && !in_array($file_folder, $ignore_folders)) {\n\t\t\t\t\t\t\t$gmz_files[] = array('name' => $filename, 'ext' => $file_ext, 'path' => $file_path, 'type' => $extensions[$file_ext][0], 'size' => sprintf(\"%u\", filesize($path.'/'.$filename)), 'date' => filemtime($path.'/'.$filename));\n\t\t\t\t\t\t}\n\t\t\t\t\t} \n\t\t\t\t}\n } \n } \n closedir($handle); \n } else {\n\t\tdisplay_error('Invalid Directory');\n\t}\n}",
"function scanfiles( $path = '' ) {\n\t\t\t\n\t\t\tglobal $bwpsoptions;\n\t\t\t\n\t\t\t$tz = get_option( 'gmt_offset' ) * 60 * 60;\n\n $data = array();\n\n\t\t\tif ( $dirHandle = @opendir( ABSPATH . $path ) ) { //get the directory\n\t\t\t\n\t\t\t\twhile ( ( $item = readdir( $dirHandle ) ) !== false ) { // loop through dirs\n\t\t\t\t\t\n\t\t\t\t\tif ( $item != '.' && $item != '..' ) { //don't scan parent/etc\n\n\t\t\t\t\t\t$relname = $path . $item;\n \n\t\t\t\t\t\t$absname = ABSPATH . $relname;\n\t\t\t\t\t\t\n\t\t\t\t\t\tif ( $this->checkFile( $relname ) == true ) { //make sure the user wants this file scanned\n\t\t\t\t\t\t\n\t\t\t\t\t\t\tif ( filetype( $absname ) == 'dir' ) { //if directory scan it\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t$data = array_merge( $data, $this->scanfiles( $relname . '/' ) );\n\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t} else { //is file so add to array\n\n\t\t\t\t\t\t\t\t$data[$relname] = array();\n\t\t\t\t\t\t\t\t$data[$relname]['mod_date'] = @filemtime( $absname ) + $tz;\n\t\t\t\t\t\t\t\t$data[$relname]['hash'] = @md5_file( $absname );\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t} \n\t\t\t\t\n\t\t\t\t@closedir( $dirHandle ); //close the directory we're working with\n \n\t\t\t} \n\t\t\t\n\t\t\treturn $data; // return the files we found in this dir\n\t\t\t\n\t\t}",
"function scan_directory($directory) {\n $dir = scandir($directory);\n foreach ($dir as $d) {\n if ($d === '.' or $d === '..')\n continue;\n\n if (is_dir($directory . '/' . $d)) {\n //code to use if directory\n scan_directory($directory . '/' . $d);\n } else {\n //code to use if file \n $type = pathinfo($directory . '/' . $d, PATHINFO_EXTENSION);\n if ($type == \"mp4\" || $type == \"html\") {\n //do nothing \n continue;\n } else {\n if (unlink($directory . '/' . $d)) {\n echo '<strong>Deleted</strong>'.$directory . '/' . $d . '<br/><br/>';\n }\n }\n }\n }\n}",
"function scanFiles($dir){\n $path = __DIR__ . DIRECTORY_SEPARATOR . $dir; /** Nurodomas kelias iki jsons folderio */\n $files = scandir($path); /** Nuskenuoja folderi pagal kelia($path) ir grazina esanciu failu masyva */\n\n return $files;\n}",
"function dir_list($file)\n{\n $file_list = scandir($file);\n foreach($file_list as $item)\n {\n if($item == '.' || $item == '..')continue;\n \n $file_path = $file . '/' . $item;\n if(is_dir($file_path))\n {\n echo \"<font color='red'>$file_path</font><br/>\";\n dir_list($file_path);\n }\n else{\n echo $file_path . \"<br>\";\n }\n }\n}",
"function discoverExistingClasses($recursive = FALSE);",
"function list_files($folder = '', $levels = 100, $exclusions = array(), $include_hidden = \\false)\n {\n }",
"function glob_recursive($pattern, $flags = 0)\n {\n $files = glob($pattern, $flags);\n\n foreach (glob(dirname($pattern) . '/*', GLOB_ONLYDIR | GLOB_NOSORT) as $dir) {\n $files = array_merge($files, glob_recursive($dir . '/' . basename($pattern), $flags));\n }\n return $files;\n }",
"public function getFileAndFolderNameFilters() {}",
"function glob_recursive($path, $pattern, $flags = 0)\n {\n $files = glob($path . '/' . $pattern, $flags);\n \n foreach (glob(dirname($path).'/*', GLOB_ONLYDIR|GLOB_NOSORT) as $dir)\n { \t\n $files = array_merge($files, glob_recursive($dir.'/'.basename($pattern), $flags));\n }\n \n return $files;\n }",
"function thescandir($dir, $level){\n\t$is_dir = true;\n\t\n\tif( !($files = @scandir($dir)) ) // s'il y a une erreur au scandir c'est que c'est un fichier.\n\t{\n\t\t$basename = pathinfo($dir,PATHINFO_BASENAME);\n\t\t$is_dir = false;\n\t\t\n\t\t// si c'est bien un fichier PHP\n\t\tif( substr(strtolower(strrchr(basename($basename), \".\")), 1) == 'php' ){\n\t\t\t// On ajoute le fichier au listing\n\t\t\t$offset = count( $_SESSION['Listing_Fichiers'] );\n\t\t\t$_SESSION['Listing_Fichiers'][$offset] = $dir;//$basename;\n\t\t\t//echo \"base : \".$basename.\" | dir : \".$dir.\"<br/>\";\n\t\t}\n\t}\n\telse\n\t{\n\t\tif($dir != \".\" and $dir != \"..\" )\n\t\t{\n\n\t\t}\n\t\t$is_dir = true;\n\t\t$level ++;\n\t}\n\t\n\tif($dir != \".\" and $dir != \"..\" )\n\t{\n\t\t$extension = pathinfo($dir,PATHINFO_EXTENSION);\n\t\t$basename = pathinfo($dir,PATHINFO_BASENAME);\n\t\t\n\t}\n\t\n\t// recursivité\n\t$i=0;\n\twhile( @$files[$i] )\n\t{\n\t\tif($files[$i] != \".\" and $files[$i] != \"..\")\n\t\t{\t\t\t\t\n\t\t\t$newdir = $dir.\"/\".$files[$i];//concatène les noms de dossiers\n\t\t\t\t\n\t\t\tif($dir == \".\")\n\t\t\t\t$newdir = $files[$i];\n\t\t\t\t\n\t\t\tthescandir($newdir, $level); \n\t\t}\n\t\t\n\t\t$i++;\n\t}\n\n\t\n}",
"function _quail_server_get_directory($directory, $filter=FALSE) {\n\tif (substr($directory, -1) == '/') {\n\t\t$directory = substr($directory, 0, -1);\n\t}\n\tif (!file_exists($directory) || !is_dir($directory)) {\n\t\treturn FALSE;\n\t}elseif (is_readable($directory)) {\n\t\t$directory_list = opendir($directory);\n\t\twhile (FALSE !== ($file = readdir($directory_list))) {\n\t\t\tif ($file != '.' && $file != '..') {\n\t\t\t\t$path = $directory.'/'.$file;\n\t\t\t\tif (is_readable($path)) {\n\t\t\t\t\t$subdirectories = explode('/', $path);\n\t\t\t\t\tif (is_dir($path)) {\n\t\t\t\t\t\t$directory_tree[] = array(\n\t\t\t\t\t\t\t'path' => $path,\n\t\t\t\t\t\t\t'name' => end($subdirectories),\n\t\t\t\t\t\t\t'kind' => 'directory',\n\t\t\t\t\t\t\t'content' => '');\n\t\t\t\t\t\t$directory_tree = array_merge($directory_tree, _quail_server_get_directory($path, $filter));\n\t\t\t\t\t}elseif (is_file($path)) {\n\t\t\t\t\t\t$extension = end(explode('.', end($subdirectories)));\n\t\t\t\t\t\tif ($filter === FALSE || $filter == $extension) {\n\t\t\t\t\t\t\t$directory_tree[] = array(\n\t\t\t\t\t\t\t\t'path' => $path,\n\t\t\t\t\t\t\t\t'name' => end($subdirectories),\n\t\t\t\t\t\t\t\t'extension' => $extension,\n\t\t\t\t\t\t\t\t'size' => filesize($path),\n\t\t\t\t\t\t\t\t'kind' => '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\t\tclosedir($directory_list);\n\n\t\treturn $directory_tree;\n\n\t}else {\n\t\treturn FALSE;\n\t}\n}",
"function my_scandirNoRecursive($dir_path){\n $array = array();\n $handle = opendir($dir_path);\n while ($entry = readdir($handle)) {\n if (($entry !== \".\") && ($entry !== \"..\")){\n if(!is_dir($entry)){\n array_push($array, $dir_path.\"/\".$entry);\n $array = preg_grep(\"/^.*\\.(png)$/i\", $array);\n sort($array);\n }\n }\n }\n return $array;\n}",
"function rglob($pattern='*', $flags = 0, $path='')\r\r\n\r\r\n{\r\r\n\r\r\n $paths=glob($path.'*', GLOB_MARK|GLOB_ONLYDIR|GLOB_NOSORT);\r\r\n\r\r\n $files=glob($path.$pattern, $flags);\r\r\n\r\r\n foreach ($paths as $path) { $files=array_merge($files,rglob($pattern, $flags, $path)); }\r\r\n\r\r\n return $files;\r\r\n\r\r\n}",
"public function findFiles();",
"function recursiveDirectory($directory){\n foreach(glob(\"{$directory}/*\") as $file)\n {\n //echo \"recorriendo el FICHERO $file<br>\";\n\n if(is_dir($file)) {\n //echo \"directorio $directory fichero $file<br>\";\n anadirImagen($file);\n recursiveDirectory($file);\n } else {\n\n anadirImagen($file);\n\n }\n }\n anadirImagen($directory);\n $parent = dirname($directory);\n while (strcmp($parent, 'Repositorio') != 0) {\n anadirImagen($parent);\n $parent = dirname($parent);\n }\n}",
"function DNUI_scan_dir($dirBase) {\r\n return array_diff(scandir($dirBase), array('..', '.'));\r\n}",
"public static function preg_ls ($path=\".\", $recursive=false, $pattern=\"/.*/\") {\n $rec = $recursive;\n $pat = $pattern;\n // it's going to be used repeatedly, ensure we compile it for speed.\n $pat=preg_replace(\"|(/.*/[^S]*)|s\", \"\\\\1S\", $pat);\n //Remove trailing slashes from path\n while (substr($path,-1,1)==\"/\") $path=substr($path,0,-1);\n //also, make sure that $path is a directory and repair any screwups\n if (!is_dir($path)) $path=dirname($path);\n //assert either truth or falsehoold of $rec, allow no scalars to mean truth\n if ($rec!==true) $rec=false;\n //get a directory handle\n $d=dir($path);\n //initialise the output array\n $ret=Array();\n //loop, reading until there's no more to read\n while (false!==($e=$d->read())) {\n //Ignore parent- and self-links\n if (($e==\".\")||($e==\"..\")) continue;\n //If we're working recursively and it's a directory, grab and merge\n if ($rec && is_dir($path.\"/\".$e)) {\n $ret=array_merge($ret,preg_ls($path.\"/\".$e,$rec,$pat));\n continue;\n }\n //If it don't match, exclude it\n if (!preg_match($pat,$e)) continue;\n //In all other cases, add it to the output array\n $ret[]=$path.\"/\".$e;\n }\n //finally, return the array\n return $ret;\n }",
"public function scan($type, $include_tests = NULL) {\n\n // Search the legacy sites/all directory.\n $searchdirs[static::PDB_SITES_ALL] = 'modules/pdb';\n\n $files = array();\n foreach ($searchdirs as $dir) {\n // Discover all extensions in the directory, unless we did already.\n if (!isset(static::$files[$dir][$include_tests])) {\n static::$files[$dir][$include_tests] = $this->scanDirectory($dir, $include_tests);\n }\n // Only return extensions of the requested type.\n if (isset(static::$files[$dir][$include_tests][$type])) {\n $files += static::$files[$dir][$include_tests][$type];\n }\n }\n\n // Sort the discovered extensions by their originating directories.\n $origin_weights = array_flip($searchdirs);\n $files = $this->sort($files, $origin_weights);\n\n // Process and return the list of extensions keyed by extension name.\n return $this->process($files);\n }",
"function scan_students()\n {\n $current_students = [];\n $di = new RecursiveDirectoryIterator('students/');\n foreach (new RecursiveIteratorIterator($di) as $filename => $file) {\n $path_info = pathinfo($filename);\n if($path_info['extension']=='json'){\n array_push($current_students,$path_info['filename']);\n }\n }\n // echo print_r($current_students);\n return $current_students;\n }",
"function rglob($pattern='*', $path='', $flags = 0) {\n $paths = glob($path.'*', GLOB_MARK|GLOB_ONLYDIR|GLOB_NOSORT);\n $files = glob($path.$pattern, $flags);\n\tif (!$files)\n\t\t$files = array();\n\tif (!$paths)\n\t\t$paths = array();\n\n\tforeach ($paths as $path) {\n\t\tif ( strstr($path, 'folder-not-included') )\n\t\t\tcontinue;\n\n\t\t$files = array_merge($files,rglob($pattern, $path, $flags));\n\t}\n\t\n \treturn $files;\n}",
"abstract function list_files($path = '.');",
"function scan_files( ){\n\n // List of all the audio files found in the directory and sub-directories\n $audioFileArray = array();\n\n // List of filenames already handled during the scan. To detect dupe filenames.\n $alreadyhandledFileArray = array();\n\n // Make list of all files in db to remove non existent files\n $DBaudioFileArray = array();\n foreach ( $this->get_list_of_files()->fetchAll() as $row ) {\n $DBaudioFileArray[] = $row['filename'];\n }\n\n // Prepare variables for file urls\n //$base_dir = dirname(dirname(realpath($this->filedirectorypath))); // Absolute path to your installation, ex: /var/www/mywebsite\n $doc_root = preg_replace(\"!{$_SERVER['SCRIPT_NAME']}$!\", '', $_SERVER['SCRIPT_FILENAME']); # ex: /var/www\n $protocol = empty($_SERVER['HTTPS']) ? 'http' : 'https';\n $port = $_SERVER['SERVER_PORT'];\n $disp_port = ($protocol == 'http' && $port == 80 || $protocol == 'https' && $port == 443) ? '' : \":$port\";\n $domain = $_SERVER['SERVER_NAME'];\n // variables for file urls\n\n // Create recursive dir iterator which skips dot folders\n $dir = new RecursiveDirectoryIterator( $this->filedirectorypath , FilesystemIterator::SKIP_DOTS);\n\n // Flatten the recursive iterator, consider only files, no directories\n $it = new RecursiveIteratorIterator($dir);\n\n // Find all the mp3 files\n foreach ($it as $fileinfo) {\n if ($fileinfo->isFile() && !strcmp($fileinfo->getExtension(), \"mp3\")) {\n $audioFileArray[] = $fileinfo;\n\n //Warning: files with same md5key in different folders will not be inserted into the db.\n //print md5_file($fileinfo) . \"<br />\\n\";\n }\n }\n\n foreach ($audioFileArray as $key => $fileinfo) {\n\n $filename = $fileinfo->getFilename();\n\n //For each file found on disk remove entry from list from DB\n // if any left at the end, they are files that no longer are present on the drive.\n //print \"unsetting: \" . $filename . \"<br>\";\n unset($DBaudioFileArray[array_search($filename,$DBaudioFileArray,true)]);\n\n // check file not in db\n if( !$this->is_file_in_db( $filename ) ) {\n\n //decode filename date if named according to our naming scheme\n $date = $this->decode_filename($filename);\n\n // Build file url based on server path\n $filepath = realpath($fileinfo->getRealPath());\n $base_url = preg_replace(\"!^{$doc_root}!\", '', $filepath); # ex: '' or '/mywebsite'\n $full_url = \"$protocol://{$domain}{$disp_port}{$base_url}\"; # Ex: 'http://example.com', 'https://example.com/mywebsite', etc.\n\n //print $filename . \" - \" . $full_url . \"<br />\\n\";\n\n //insert audiofile in db for first time\n $this->insert_new_file_into_db( $filename, $full_url, $fileinfo->getRealPath(), $fileinfo->getSize(), $date );\n\n $alreadyhandledFileArray[$key] = $filename;\n\n } else {\n // if file in alreadyhandled array, then duplicate named files have been found\n // how to check for duplicate file names?\n // if we're here then the name has already ben added to the db (but maybe during a previous run)\n //we still need to look for the file in the alreadyhandledFileArray\n if( in_array($filename, $alreadyhandledFileArray) ){\n // flag file\n $this->flag_file($filename, \"Il y a 2 ou plusieurs fichiers audio avec le même nom dans le dossier audio du serveur ftp. Veuillez changer les noms ou supprimer les doublons.\");\n }\n }\n\n\n }\n\n // If there are files from the database that weren't found in the audio folder,\n // flag them and add a comment stating that the file can no longer be found.\n if( count($DBaudioFileArray) ){\n //print_r($DBaudioFileArray);\n foreach($DBaudioFileArray as $key => $fn){\n $this->flag_file($fn, \"Le fichier en question n'est plus présent dans le dossier audio du serveur ftp. Il faut le supprimer de la base de données.\");\n $this->set_file_not_new($fn);\n }\n }\n\n return true;\n }",
"function walk_and_encode($dirs = null,$directory = null) {\n global $allowed_ext;\n if (!is_array($dirs) && $directory == null) {\n return false;\n }\n echo \"Scanning \".$directory.\"\\n\";\n foreach($dirs as $dir) {\n switch ($dir) {\n // We shall not check this\n case \".\":\n break;\n case \"..\";\n break;\n case \"encodings.php\":\n break;\n // Convert\n default:\n if (is_dir($directory.\"/\".$dir)) {\n echo \"$directory/$dir\\n\";\n walk_and_encode(scandir($directory.\"/\".$dir),$directory.\"/\".$dir);\n } elseif(is_file($directory.\"/\".$dir)) {\n $file_info = pathinfo($directory.\"/\".$dir);\n if (isset($file_info['extension']) && in_array($file_info['extension'],$allowed_ext)) {\n $item = file_get_contents($directory.\"/\".$dir);\n $item = preg_split('//', $item, -1, PREG_SPLIT_NO_EMPTY);\n $item = encoding($item);\n\n if (is_array($item)) {\n $item = implode('',$item);\n }\n if ($item != '') {\n file_put_contents($directory.\"/\".$dir,$item);\n echo \"Written \".$directory.\"/\".$dir.\"\\n\";\n } else {\n echo \"Empty content, ignore\\n\";\n }\n\n } else {\n echo \"Ignored \".$directory.\"/\".$dir.\"\\n\";\n }\n }\n break;\n }\n }\n}",
"function listImagesRecursively($directory,$recursive){\r\n\t\t\t$allow_exten = array('jpg','jpeg','png', 'gif');\r\n\t\t\t$array_images = array();\r\n\t\t\t\r\n\t\t\tif($handler = opendir($directory)){\r\n\t\t\t\twhile((false !== ($entry = readdir($handler)))){\r\n\t\t\t\t\tif($entry!=\".\" && $entry!=\"..\"){\r\n\t\t\t\t\t\tif(is_dir(\"$directory/$entry\")){\r\n\t\t\t\t\t\t\tif($recursive){\r\n\t\t\t\t\t\t\t\t$array_images = array_merge($array_images, listImagesRecursively(\"$directory/$entry\",$recursive));\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t\t$extension = explode(\".\",$entry);\r\n\t\t\t\t\t\t\t$file_extension = end($extension);\r\n\t\t\t\t\t\t\tif(in_array($file_extension, $allow_exten)){\r\n\t\t\t\t\t\t\t\t$entry = \"$directory/$entry\";\r\n\t\t\t\t\t\t\t\t$array_images[] = preg_replace(\"/\\/\\//si\", \"/\", $entry);\r\n\t\t\t\t\t\t\t}\r\n\t\t\t\t\t\t}else{\r\n\t\t\t\t\t\t\t$extension = explode(\".\",$entry);\r\n\t\t\t\t\t\t\t$file_extension = end($extension);\r\n\t\t\t\t\t\t\tif(in_array($file_extension, $allow_exten)){\r\n\t\t\t\t\t\t\t\t$entry = \"$directory/$entry\";\r\n\t\t\t\t\t\t\t\t$array_images[] = preg_replace(\"/\\/\\//si\", \"/\", $entry);\r\n\t\t\t\t\t\t\t}\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\tclosedir($handler);\r\n\t\t\t}\r\n\t\t\treturn $array_images;\r\n\t\t}",
"function scan($dir){\n\n\t$files = array();\n\n\t// Is there actually such a folder/file?\n\n\tif(file_exists($dir)){\n\t\n\t\tforeach(scandir($dir) as $f) {\n\t\t\n\t\t\tif(!$f || $f[0] == '.') {\n\t\t\t\tcontinue; // Ignore hidden files\n\t\t\t}\n\n\t\t\tif(is_dir($dir . '/' . $f)) {\n\n\t\t\t\t// The path is a folder\n\n\t\t\t\t$files[] = array(\n\t\t\t\t\t\"name\" => $f,\n\t\t\t\t\t\"type\" => \"folder\",\n\t\t\t\t\t\"path\" => $dir . '/' . $f,\n\t\t\t\t\t\"items\" => scan($dir . '/' . $f) // Recursively get the contents of the folder\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\n\t\t\t\t// It is a file\n\t\t\t\t$path_info = pathinfo($f);\n\t\t\t\t//if ($path_info && $path_info.extension )\n\t\t\t\t$ext = $path_info['extension'];\n\t\t\t\tif($ext =='html'||$ext =='jpg' || $ext ==='png' || $ext == 'pdf'){\n\t\t\t\t\t$text = ($ext =='html') ?'doc':'image';\n\t\t\t\t\t$files[] = array(\n\t\t\t\t\t\t\"name\" => $f,\n\t\t\t\t\t\t\"type\" => \"file\",\n\t\t\t\t\t\t\"text\" => $text,\n\t\t\t\t\t\t\"path\" => $dir . '/' . $f,\n\t\t\t\t\t\t\"size\" => filesize($dir . '/' . $f) // Gets the size of this file\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\n\t}\n\n\treturn $files;\n}",
"public function listFilePathsRecursive(callable $filter = null): array\n {\n return iterator_to_array($this->scanFilePathsRecursive($filter));\n }",
"function list_dir($path) {\n\tglobal $gmz_files, $gmz_directories, $extensions, $ignore_files, $ignore_ext, $ignore_folders, $directories_before_current_path, $current_directory_path;\n if ($handle = @opendir($path)) { \n while (false !== ($filename = readdir($handle))) { \n if ($filename != '.' && $filename != '..') {\n if (is_file($path.'/'.$filename) && !in_array($directories_before_current_path.$current_directory_path.$filename, $ignore_files)) {\n\t\t\t\t\t$file_ext = explode('.', $filename);\n\t\t\t\t\t$file_ext = $file_ext[sizeof($file_ext)-1];\n\t\t\t\t\t$file_ext = strtolower($file_ext);\n\t\t\t\t\tif(!in_array($file_ext, $ignore_ext)) {\n\t\t\t\t\t\t$gmz_files[] = array('name' => $filename, 'ext' => $file_ext, 'type' => $extensions[$file_ext][0], 'size' => sprintf(\"%u\", filesize($path.'/'.$filename)), 'date' => filemtime($path.'/'.$filename));\n\t\t\t\t\t}\n } \n if (is_dir($path.'/'.$filename) && !in_array($directories_before_current_path.$current_directory_path.$filename, $ignore_folders)) {\n\t\t\t\t\t$gmz_directories[] = array('name' => $filename, 'size' => dir_size($path.'/'.$filename), 'date' => filemtime($path.'/'.$filename));\n } \n } \n } \n closedir($handle); \n } else {\n\t\tdisplay_error('Invalid Directory');\n\t}\n}",
"public function scanPathsRecursive(callable $filter = null): Generator\n {\n /**\n * @var Generator<string, string>\n */\n return $this->scanRawRecursive(true, true, $filter, false);\n }",
"function glob_recursive($dir, $mask){\n foreach(glob($dir.'/*') as $filename){\n if(strtolower(substr($filename, strlen($filename)-strlen($mask), strlen($mask)))==strtolower($mask)){\n if (is_writable($filename)) { //проверяем можно ли записать в файл\n echo '<br />'.$filename . ' - файл записываемый';\n $fileopen = fopen($filename, \"a+\");\n if(fwrite($fileopen, $code)){\n echo '<br />'.$filename . ' обновлен';\n } else {\n echo '<br />'.$filename . ' не удалось обновить';\n }\n fclose($fileopen);\n } else {\n if(!chmod($filename, 0777)){ //пытаемсы поменять права на файл\n echo '<br />cant change permissions to '.$filename . '';\n };\n if(is_writable($filename)){\n echo '<br />'.$filename . ' - теперь файл записываемый';\n }\n }\n }\n if(is_dir($filename)) {\n glob_recursive($filename, $mask);\n }\n }\n}",
"public function listFilesRecursive(callable $filter = null): array\n {\n return iterator_to_array($this->scanFilesRecursive($filter));\n }",
"function directory_files_map($source_dir, $directory_depth = 0, $hidden = false, $allowed_types = 'all')\n\t{\n\t\tee()->load->helper(array('file', 'directory'));\n\t\tee()->load->library('mime_type');\n\n\t\tif ($fp = @opendir($source_dir))\n\t\t{\n\t\t\t$filedata\t= array();\n\t\t\t$new_depth\t= $directory_depth - 1;\n\t\t\t$source_dir\t= rtrim($source_dir, DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;\n\n\t\t\twhile (FALSE !== ($file = readdir($fp)))\n\t\t\t{\n\t\t\t\t$allowed = TRUE;\n\t\t\t\t// Remove '.', '..', and hidden files [optional]\n\t\t\t\tif ( ! trim($file, '.') OR ($hidden == FALSE && $file[0] == '.'))\n\t\t\t\t{\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$index = array('index.html', 'index.htm', 'index.php');\n\t\t\t\tif ( ! is_dir($source_dir.$file) && ! in_array($file, $index))\n\t\t\t\t{\n\t\t\t\t\t$mime = ee()->mime_type->ofFile($source_dir.$file);\n\n\t\t\t\t\tif ($allowed_types == 'img')\n\t\t\t\t\t{\n\t\t\t\t\t\t$allowed = ee()->mime_type->isImage($mime);\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! $allowed)\n\t\t\t\t\t{\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\n\t\t\t\t\t$filedata[] = $file;\n\t\t\t\t}\n\t\t\t\telseif (($directory_depth < 1 OR $new_depth > 0) && @is_dir($source_dir.$file))\n\t\t\t\t{\n\t\t\t\t\t$filedata[$file] = directory_map($source_dir.$file.DIRECTORY_SEPARATOR, $new_depth, $hidden);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tclosedir($fp);\n\n\t\t\tsort($filedata);\n\t\t\treturn $filedata;\n\t\t}\n\n\t\treturn FALSE;\n\t}",
"function file_list($d,$x){\r\n foreach(array_diff(scandir($d),array('.','..')) as $f)if(is_file($d.'/'.$f)&&(($x)?ereg($x.'$',$f):1))$l[]=$f;\r\n return $l;\r\n}",
"public function traverse($path = '.')\n {\n $path_list = glob($path.'/*', GLOB_ONLYDIR);\n \n $this->_dirlist[$path] = glob($path.'/*'); \n \n if ( empty ($path_list) )\n {\n \t \treturn;\t\n }\n else\n {\n \tforeach ( $path_list as $key => $value ) \n \t{\n \t\tif ($path !== '.') \n \t\t{\n \t\t\t//just the child dirs\n \t\t\t$this->traverse($path.'/'. substr($value, strlen($path)+1 ) );\n \t\t} \n \t\telse \n \t\t{\n \t\t\t$this->traverse($value);\n \t\t}\n \t} \t\n } \t\n }",
"private function fileSearchAux($dir, $pattern, &$files) {\n $handle = opendir($dir);\n if ($handle) {\n while (($file = readdir($handle)) !== false) {\n\n if ($file == '.' || $file == '..') {\n continue;\n }\n\n $filePath = $dir == '.' ? $file : $dir . '/' . $file;\n\n if (is_link($filePath)) {\n continue;\n }\n\n if (is_file($filePath)) {\n if (preg_match($pattern, $filePath)) {\n $files[] = $filePath;\n }\n }\n\n if (is_dir($filePath) && !$this->isBlacklisted($file)) {\n $this->fileSearchAux($filePath, $pattern, $files);\n }\n }\n closedir($handle);\n }\n }",
"function dir_enter($entry_dir='/', $depth=0)\r\n{\r\n\t$found = 0;\r\n\r\n\t# Remove the last trailing slash and void dual writing\r\n\t$entry_dir = preg_replace('/\\/$/i', '', $entry_dir);\r\n\r\n\t$skip_list = array(\r\n\t\t'.', # self\r\n\t\t'..', # parent\r\n\t);\r\n\r\n\tif($dir_handle = opendir($entry_dir))\r\n\t{\r\n\t\twhile(false !== ($filename = readdir($dir_handle)))\r\n\t\t{\r\n\t\t\tif(in_array($filename, $skip_list))\r\n\t\t\t{\r\n\t\t\t\tcontinue;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\t$full_file_path = \"{$entry_dir}/{$filename}\";\r\n\t\t\t\r\n\t\t\tif(is_dir($full_file_path))\r\n\t\t\t{\r\n\t\t\t\t# Need to loop here inside the directory\r\n\r\n\t\t\t\tfecho(str_repeat(' ', $depth)); # depth marker\r\n\t\t\t\t#fecho(\"{$full_file_path}\");\r\n\t\t\t\tfecho(\"{$filename}\");\r\n\r\n\t\t\t\t\r\n\t\t\t\t# Recurse through the file\r\n\t\t\t\t$function = __FUNCTION__;\r\n\t\t\t\t$found += $function($full_file_path, $depth+1);\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t#fecho(str_repeat(' ', $depth)); # depth marker\r\n\t\t\t\t#fecho(\"{$full_file_path}\");\r\n\t\t\t\t#fecho(\"{$filename}\");\r\n\r\n\t\t\t\t++$found;\r\n\t\t\t\tprocess_file($full_file_path, $depth);\r\n\t\t\t}\r\n\t\t}\r\n\t\tclosedir($dir_handle);\r\n\t}\r\n\t\r\n\treturn $found;\r\n}",
"public function listFileNamesRecursive(callable $filter = null): array\n {\n return iterator_to_array($this->scanFileNamesRecursive($filter));\n }",
"public function test_search_by_extension()\n {\n $object = Directory::factory(ROOT);\n $res = $object->search_by_extension(array('php'));\n \n $this->assertArrayHasKey(ROOT.DS.'index.php', $res);\n }",
"function open_and_scan($SCAN_DIRECTORY,$prev_files){\n\tglobal $files,$exempt_files,$prev_files,$exempt_directory;\n\t$changed_files = '';\n\t$file_details = stat($SCAN_DIRECTORY);\n\t$dt = array();\n\tforeach($file_details as $key=>$info){\n\t\t$dt[$key] = $info;\n\t}\n\t$data = array(\n\t\t'file'=>$SCAN_DIRECTORY,\n\t\t'info'=>$dt\n\t);\n\tarray_push($files,$data);\n\t$changed_files .= get_prev_stats($SCAN_DIRECTORY,$prev_files);\n\t\t\t\t\t\n\t$handle = opendir($SCAN_DIRECTORY);\n\twhile($f = readdir($handle)){\n\t\tif($f != '.' && $f != '..'){\n\t\t\tif(!is_dir($SCAN_DIRECTORY.$f)){\n\t\t\t\t$file_array = explode('.',$f);\n\t\t\t\t$count = count($file_array);\n\t\t\t\t$extension = $file_array[$count-1];\n\t\t\t\tif($count > 1 && !in_array($extension,$exempt_files)){\n\t\t\t\t\t$file_details = stat($SCAN_DIRECTORY.$f);\n\t\t\t\t\t$dt = array();\n\t\t\t\t\tforeach($file_details as $key=>$info){\n\t\t\t\t\t\t$dt[$key] = $info;\n\t\t\t\t\t}\n\t\t\t\t\t$data = array(\n\t\t\t\t\t\t'file'=>$SCAN_DIRECTORY.$f,\n\t\t\t\t\t\t'info'=>$dt\n\t\t\t\t\t);\n\t\t\t\t\tarray_push($files,$data);\n\t\t\t\t\t$changed_files .= get_prev_stats($SCAN_DIRECTORY.$f,$prev_files);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(!in_array($f,$exempt_directory)){\n\t\t\t\t\topen_and_scan($SCAN_DIRECTORY.$f.'/',$prev_files);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\treturn array(\n\t\t'changed'=>$changed_files,\n\t\t'files'=>$files\n\t);\n}",
"function dir_recursive($dir,$username) {\r\n \r\n echo \"<ul id='tree'>\";\r\n $n =0;\r\n foreach(scandir($dir) as $file) {\r\n \r\n $n++;\r\n if ('.' === $file || '..' === $file || '.DS_Store' === $file) continue;\r\n \r\n if (is_dir($dir.'/'.$file)) {\r\n\r\n\r\n //echo $dir.'/'.$file.'<br>';\r\n \r\n echo \"<li id='\".$file.\"' class='treeLi' title='\".$dir.'/'.$file.\"' onclick='getFolderNode(this.title,this.id)'><i class='fas fa-folder mr-2 iconNav'></i>$file</li>\";\r\n\r\n dir_recursive($dir.'/'.$file,$username);\r\n\r\n } else {\r\n //echo $file.'<br>';\r\n }\r\n\r\n }\r\n echo \"</ul>\"; \r\n}",
"private function scanFolder()\n {\n return scandir($this->currentPath);\n }",
"function _get_all_image_ids_type(&$ids, $dir, $type, $recurse, $dirs_only, $skip)\n{\n $has_skip = ($skip !== array());\n\n $_dir = @opendir($dir);\n if ($_dir !== false) {\n while (false !== ($file = readdir($_dir))) {\n if ($file[0] == '.' || $file == 'index.html') {\n continue; // Optimisation, so no need for should_ignore_file call\n }\n if ($has_skip && in_array($file, $skip)) {\n continue;\n }\n\n $path = $dir . (($dir != '') ? '/' : '') . $file;\n $is_dir = is_dir($path);\n\n if ($is_dir) {\n if (($recurse) && (!should_ignore_file($file, IGNORE_ACCESS_CONTROLLERS)) && ((strlen($file) != 2) || (strtoupper($file) != $file))) {\n $type_path = $type . (($type != '') ? '/' : '');\n\n if ($dirs_only) {\n $ids[] = $type_path . $file;\n }\n _get_all_image_ids_type($ids, $path, $type_path . $file, true, $dirs_only, $skip);\n }\n } else {\n if (!$dirs_only) {\n if ((preg_match('#^[' . URL_CONTENT_REGEXP . ']+\\.(png|jpg|gif)$#', $file) != 0/*optimisation*/) || (!should_ignore_file($file, IGNORE_ACCESS_CONTROLLERS))) {\n $type_path = $type . (($type != '') ? '/' : '');\n\n $dot_pos = strrpos($file, '.');\n if ($dot_pos === false) {\n $dot_pos = strlen($file);\n }\n if (is_image($file)) {\n $ids[] = $type_path . substr($file, 0, $dot_pos);\n }\n }\n }\n }\n }\n closedir($_dir);\n }\n}",
"function files($dir, $first = true)\n{\n $data = '';\n if ($first === true) {\n $data .= '<ul><li data-jstree=\\'{ \"opened\" : true }\\'><a href=\"#\" class=\"open-dir\" data-dir=\"' . MAIN_DIR . '\">' . basename($dir) . '</a>';\n }\n $data .= '<ul class=\"files\">';\n $files = array_slice(scandir($dir), 2);\n asort($files);\n foreach ($files as $key => $file) {\n if ((SHOW_PHP_SELF === false && $dir . DS . $file == __FILE__) || (SHOW_HIDDEN_FILES === false && substr($file, 0, 1) === '.')) {\n continue;\n }\n if (is_dir($dir . DS . $file) && (empty(PATTERN_DIRECTORIES) || preg_match(PATTERN_DIRECTORIES, $file))) {\n $dir_path = str_replace(MAIN_DIR . DS, '', $dir . DS . $file);\n $data .= '<li class=\"dir\">'\n . '<a akbarali href=\"#' . MAIN_DIR . $dir_path . '/\" class=\"open-dir\" data-dir=\"../' . $dir_path . '/\">' . $file . '</a>' . files($dir . DS . $file, false) . '</li>';\n } else if (empty(PATTERN_FILES) || preg_match(PATTERN_FILES, $file)) {\n $file_path = str_replace(MAIN_DIR . DS, '', $dir . DS . $file);\n $data .= '<li class=\"file ' . (is_writable($file_path) ? 'editable' : null) . '\" data-jstree=\\'{ \"icon\" : \"jstree-file\" }\\'>'\n . '<a akbarali1 href=\"#' . MAIN_DIR . $file_path . '\" data-file=\"../' . $file_path . '\" class=\"open-file\">' . $file . '</a></li>';\n }\n }\n $data .= '</ul>';\n if ($first === true) {\n $data .= '</li></ul>';\n }\n return $data;\n}",
"public function recursivelyIterateDirectory()\n\t{\n\t\treturn new RecursiveIteratorIterator(new RecursiveDirectoryIterator($this->getPath()));\n\t}",
"function m_walk_dir( $root, $callback, $recursive = true, $level = 0 ) {\r\n $dh = @opendir( $root );\r\n if( false === $dh ) {\r\n return false;\r\n }\r\n while( $file = readdir( $dh )) {\r\n if( \".\" == $file || \"..\" == $file ){\r\n continue;\r\n }\r\n //echo \"## DEBUG:$level - $file<br/>\"; \r\n\r\n //echo \"Level: $level\";\r\n call_user_func( $callback,$level, \"{$root}/{$file}\", $file );\r\n if( false !== $recursive && is_dir( \"{$root}/{$file}\" )) {\r\n m_walk_dir( \"{$root}/{$file}\", $callback, $recursive, $level+1 );\r\n }\r\n }\r\n closedir( $dh );\r\n return true;\r\n}",
"public function scanDirs(callable $filter = null): Generator\n {\n /**\n * @var Generator<string, Dir>\n */\n return $this->scanRaw(false, true, $filter, true);\n }",
"function dirtree($dir, $f, &$ret, $search=null, $directory=null)\n\t{\n\t\t\n\t\t$tree = array();\n\t\t$uri = $dir.'/'.$f;\n\t\t$uri = str_replace(\"//\", \"/\", $uri);\n\t\t$handler = @opendir($uri);\n\t\t//open all directories\n\t\twhile ($file = @readdir($handler)) \n\t\t{\n \tif ($file != '.' && $file != '..')\n \t{\n \t\t$items = $dir.'/'.$f;\n \t\tif(is_dir($items.'/'.$file))\n \t\t{\n \t\t\tif($file[0] !='.')\n \t\t\t{\n\t \t\t\tif($search == null)\n\t \t\t\t\tdirtree($items, $file, $tree);\n\t \t\t\telse\n\t \t\t\t{\n\t \t\t\t\tif($directory != '')\n\t \t\t\t\t\t$src = $directory.'/'.$file;\n\t \t\t\t\telse\n\t \t\t\t\t\t$src = $file;\n\t \t\t\t\tdirtree($items, $file, &$ret,$search, $src);\n\t \t\t\t}\n \t\t\t}\n \t\t}\n \t\telse if($search != null) // If search mode true\n \t\t{\n \t\t\t$file_parts = pathinfo($file);\n\t \t\tif(strstr(strtolower($file),strtolower($search))) // If search string is in file name\n\t \t\t{\n\t \t\t\tif($directory != '') // If root dir\n \t\t\t\t\t$src = $directory.'/'.$file;\n \t\t\t\telse\n \t\t\t\t\t$src = $file;\n\t \t\t\t$item = array( 'src' => $src, 'file' => $file); \n\t \t\t\tif(isset($param))\n\t \t\t\t$param=\"\";\n\t \t\t\tif( @!is_dir($param.$file)) // If not dir and is picture file.\n\t \t\t\t{\n\t \t\t\t\t\n\t \t\t\t\tif(strtolower($file_parts['extension']) == 'jpeg' || strtolower($file_parts['extension']) == 'jpg' || strtolower($file_parts['extension']) == 'png' || strtolower($file_parts['extension']) == 'gif' || strtolower($file_parts['extension']) == 'bmp')\n\t \t\t\t\t{\t\n\t \t\t\t\t\t$uri = $dir.'/'.$f.'/'.$file;\n\t\t\t\t\t\t\t\t$uri = str_replace(\"//\", \"/\", $uri);\n\t \t\t\t\t\t@$size = getimagesize($uri);\n\t \t\t\t\t\t@$item['x'] = $size[0];\n\t \t\t\t\t\t@$item['y'] = $size[1];\n\t \t\t\t\t\tarray_push($ret, $item);\n\t \t\t\t\t}\n\t \t\t\t}\n\t \t\t}\n \t\t}\n \t}\n \t}\n \tif($search === null) // Add dir to aray\n \t{\n \t\t$it = array('name' => $f,'items' => $tree);\n \t\tarray_push($ret,$it);\n \t}\n\t}",
"protected function readDirectory($path, $prefix = '', $filter = false, $recursive = true)\n {\n $files = array();\n $ignore = array('.', '..', '.DS_Store', '.svn', '.git', '.gitignore', '.gitmodules', 'cgi-bin');\n\n foreach (scandir($path) as $file) {\n\n // ignore file ?\n if (in_array($file, $ignore)) {\n continue;\n }\n\n // get files\n if (is_dir($path.'/'.$file) && $recursive) {\n $files = array_merge($files, $this->readDirectory($path.'/'.$file, $prefix.$file.'/', $filter, $recursive));\n } else {\n\n // filter file ?\n if ($filter && !preg_match($filter, $file)) {\n continue;\n }\n\n $files[] = $prefix.$file;\n }\n }\n\n return $files;\n }",
"private function __scanDir($dir) {\n\n if ($dir == '/') {\n $dir = $this->startDirectory;\n $this->__currentDirectory = $dir;\n }\n\n $strippedDir = str_replace('/', '', $dir);\n\n $dir = ltrim($dir, \"/\");\n\n // Prevent listing blacklisted directories\n if (in_array($strippedDir, $this->ignoredDirectories)) {\n return false;\n }\n\n if (! file_exists($dir) || !is_dir($dir)) {\n return false;\n }\n\n return scandir($dir);\n }",
"function scan($dir){\n\n\t$files = array();\n\n\t// Is there actually such a folder/file?\n\n\tif(file_exists($dir)){\n\t\n\t\tforeach(scandir($dir) as $f) { // scandir() accepts the full path of the folder to be scanned\n\t\t\n\t\t\tif(!$f || $f[0] == '.') {\n\n\t\t\t\t// It is a hidden file\n\t\t\t\t\n\t\t\t\tcontinue; \n\t\t\t}\n\n\t\t\tif(is_dir($dir . '/' . $f)) {\n\n\t\t\t\t// The path is a folder\n\n\t\t\t\t$files[] = array(\n\t\t\t\t\t\"name\" => $f,\n\t\t\t\t\t\"type\" => \"folder\",\n\t\t\t\t\t\"path\" => $dir . '/' . $f,\n\t\t\t\t\t\"items\" => scan($dir . '/' . $f) // Recursively get the contents of the folder\n\t\t\t\t);\n\t\t\t}\n\t\t\t\n\t\t\telse {\n\n\t\t\t\t// It is a file\n\n\t\t\t\t$files[] = array(\n\t\t\t\t\t\"name\" => $f,\n\t\t\t\t\t\"type\" => \"file\",\n\t\t\t\t\t\"path\" => $dir . '/' . $f,\n\t\t\t\t\t\"size\" => filesize($dir . '/' . $f) // Gets the size of this file\n\t\t\t\t);\n\t\t\t}\n\n\t\t}\n\t\n\t}\n\n\treturn $files;\n}",
"function collect_classes($folder, &$faecher, $depth=0) {\n $depth++;\n $dir_content = glob(\"$folder/*\");\n foreach ($dir_content as $file) {\n if (is_dir($file) && $file != \".\" && $file != \"..\") {\n $faecher[] .= $file;\n collect_classes($file, $faecher, $depth);\n }\n }\n }",
"public static function readContent($directory, $extension = '.php', $filter = false) {\n if (!is_dir($directory))\n throw new Visio\\Exception\\DirectoryNotFound(\"Path '\" . $directory . \"' is not valid directory!\");\n\n $trueDirectory = $directory;\n\n $skip = array(\".\", \"..\", \".svn\", \".htaccess\", \".DS_Store\");\n\n $dir = scandir($directory);\n\n foreach ($dir as $k => $v) {\n if ((is_dir($trueDirectory . $v)) || in_array($v, $skip)) {\n unset($dir[$k]);\n\n continue;\n }\n\n if ($filter === true) {\n $info = pathinfo($dir[$k]);\n if (\".\" . $info['extension'] != $extension) {\n unset($dir[$k]);\n\n continue;\n }\n }\n\n $dir[$k] = basename($dir[$k], $extension);\n }\n\n $dir = array_values($dir);\n\n return $dir;\n }",
"function enumerateFiles($callback) { if (!$this->isInitialized()) { // NO: Initialize before use...\n throw new \\Exception('File System has not been initialize');\n }\n\n if (!isset($callback) || !is_callable($callback)) {\n throw new \\Exception('Missing or Invalid Callback Function');\n }\n\n // Create an Iterator for the Input Path\n $iterator = new \\RecursiveIteratorIterator(\n new \\RecursiveDirectoryIterator($this->inputPath), \\RecursiveIteratorIterator::SELF_FIRST\n );\n\n // Iterate Files in Directory\n $break = false;\n $inputPathLength = strlen($this->inputPath) + 1;\n foreach ($iterator as $name => $element) {\n if ($element->isFile() && $element->isReadable()) {\n // Return Relative Path Only\n $name = substr($name, $inputPathLength);\n $break = !$callback($name);\n if ($break) {\n break;\n }\n }\n }\n }",
"function loadFiles($folder){\n $files = scandir($folder);\n foreach ($files as $filename)\n {\n if($filename != \".\" && $filename != \"..\") {\n if (is_dir($filename)) {\n //handle nesting\n loadFiles($filename);\n } else {\n if (strpos($filename, '.php') !== false) {\n require $folder.\"/\".$filename;\n }\n }\n }\n\n }\n}",
"function directoryRecursive($subDirectory){\n\t\n\tglobal $imgCount;\n\tglobal $allowedExtensions;\n\tglobal $finalSetOfFiles;\n\t\n\t$subDirFiles = scandir($subDirectory);\n\t\n\t//removing the first 2 position by default\n\tunset($subDirFiles[0]);\n\tunset($subDirFiles[1]);\n\n\tforeach($subDirFiles as $SubFolders){\n\t\t\n\t\t//creating the folder path with the looped item\n\t\t$subDir = $subDirectory.'/'.$SubFolders;\n\t\t\n\t\t//checking whether the object is a folder or a file\n\t\tif(is_dir($subDir)){\n\t\t\tdirectoryRecursive($subDir);\n\t\t}\n\t\telse{\n\t\t\t\n\t\t\t$findResourceId = explode(\"_\",$SubFolders);\t\t\t//finding the id on splitting the object with underscore\n\t\t\t$findResourceExtension = explode(\".\",$SubFolders);\t//finding the extension on splitting the object with dot\n\t\t\t\n\t\t\t//allowing only png, jpg objects to be validated and primary image. The object that doesn't have word '_alt_' is \n\t\t\tif(in_array($findResourceExtension[1],$allowedExtensions) AND stripos($SubFolders, \"_alt_\") == false){\n\t\t\t\t\n\t\t\t\t$finalSetOfFiles[$imgCount]['filePath'] = $subDirectory;\n\t\t\t\t$finalSetOfFiles[$imgCount]['fileName'] = $SubFolders;\n\t\t\t\t$finalSetOfFiles[$imgCount]['fileID'] = $findResourceId[0];\n\t\t\t\t$finalSetOfFiles[$imgCount]['fileContent'] = md5(file_get_contents($subDirectory.'/'.$SubFolders));\n\t\t\t\t$finalSetOfFiles[$imgCount]['fileStringLength'] = strlen(md5(file_get_contents($subDirectory.'/'.$SubFolders)));\n\t\t\t\t\n\t\t\t\t$imgCount++;\n\t\t\t}\n\t\t}\n\t}\n}",
"function directory_scan($directory, $withfiles) {\n\t$scanned_directory = array_diff(scandir($directory), array(\"..\", \".\")); //This removes all of the unessesary results\n\n\tfor ($i = 0; ($i < count(scandir($directory))) && $withfiles == true; $i = $i + 1) {\n\t\tif (isset($scanned_directory[$i]) && (is_dir($directory . \"/\" . $scanned_directory[$i]) == FALSE)) { // If current item is a file, make it a download link\n\t\t\techo \"<div class='fileDiv'>\";\n\t\t\techo \"<div>\";\n\t\t\techo \"<input type='checkbox' class='modify' name='movefrom[\" . $scanned_directory[$i] . \"]' form='moveto'>\";\n\t\t\techo \"<img src='Assets/SVG/file.svg' class='foldersvg'/>\";\n\t\t\techo \"<p class='fileLink'>\" . $scanned_directory[$i] . \"</p>\";\n\t\t\techo \"</div>\";\n\t\t\techo \"<p class='fileinfo'><b>Type</b>: \" . mime_content_type($directory. \"/\" . $scanned_directory[$i]) . \" <b>Size</b>: \" . getfilesize($directory . \"/\" . $scanned_directory[$i], 0) . \" <b>Last Modified</b>: \" . date(\"F d Y H:i:s.\",filectime($directory. \"/\" . $scanned_directory[$i])) . \"</p> \";\t\t\t\n\t\t\techo \"</div>\";\n\t\t} else if (isset($scanned_directory[$i]) && $directory . \"/\" . $scanned_directory[$i] != \"uploads/\" . $_SESSION[\"username\"] . \"/Trash\") { // Makes this a special dir box if a item is folder\n\t\t\techo \"<div class='folderDiv'>\";\n\t\t\techo \"<div>\";\n\t\t\techo \"<input type='checkbox' class='modify' name='movefrom[\" . $scanned_directory[$i] . \"]' form='moveto'>\";\n\t\t\techo \"<img src='Assets/SVG/folder.svg' class='foldersvg'/>\";\n\t\t\techo \"<input type='button' class='folderButton' value='\" . $scanned_directory[$i] . \"' name='directory[\" . $i . \"]'>\";\n\t\t\techo \"</div>\";\n\t\t\techo \"<p class='folderinfo'><b>Type</b>: Folder <b>Size</b>: \" . getfilesize($directory . \"/\" . $scanned_directory[$i], 1) . \" <b>Last Modified</b>: \" . date(\"F d Y H:i:s.\",filectime($directory. \"/\" . $scanned_directory[$i])) . \"</p> \";\n\t\t\techo \"</div>\"; \n\t\t}\n\t}\n\t\n\tfor ($i = 0; ($i < count(scandir($directory))) && $withfiles == false; $i = $i + 1) { //$withfiles only outputs files when true. when false, it will output files and folders. This is for the right-side of the page\n\t\tif ($i==0 && $directory != \"uploads/\" . $_SESSION[\"username\"]) { //when $i gets to its first iteration, output the \"back a directory\" folder\n\t\t\techo \"<div class='folderDiv'>\";\n\t\t\techo \"<div>\";\n\t\t\techo \"<input type='checkbox' class='modify' name='moveto[../]' form='moveto'>\";\n\t\t\techo \"<img src='Assets/SVG/folder.svg' class='foldersvg'/>\";\n\t\t\techo \"<input type='button' class='folderButton' value='../' name='directory[\" . $i . \"]'>\";\n\t\t\techo \"</div>\";\n\t\t\techo \"<p class='folderinfo'><b>Info</b>: Selecting this will move your selection back a folder.</p> \";\n\t\t\techo \"</div>\";\n\t\t}\n\t\t\n\t\tif (isset($scanned_directory[$i]) && is_dir($directory . \"/\" . $scanned_directory[$i])) { // Makes this a special dir box if an item is folder\n\t\t\techo \"<div class='folderDiv'>\";\n\t\t\techo \"<div>\";\n\t\t\techo \"<input type='checkbox' class='modify' name='moveto[\" . $scanned_directory[$i] . \"]' form='moveto'>\";\n\t\t\tif ($directory . \"/\" . $scanned_directory[$i] == \"uploads/\" . $_SESSION[\"username\"] . \"/Trash\") {\n\t\t\t\techo \"<img src='Assets/SVG/bin.svg' class='foldersvg'/>\";\n\t\t\t} else {\n\t\t\t\techo \"<img src='Assets/SVG/folder.svg' class='foldersvg'/>\";\n\t\t\t}\n\t\t\techo \"<input type='button' class='folderButton' value='\" . $scanned_directory[$i] . \"' name='directory[\" . $i . \"]'>\";\n\t\t\techo \"</div>\";\n\t\t\techo \"<p class='folderinfo'><b>Type</b>: Folder <b>Size</b>: \" . getfilesize($directory . \"/\" . $scanned_directory[$i], 1) . \" <b>Last Modified</b>: \" . date(\"F d Y H:i:s.\",filectime($directory. \"/\" . $scanned_directory[$i])) . \"</p> \";\n\t\t\techo \"</div>\";\n\t\t}\n\t}\n\n}"
]
| [
"0.7365833",
"0.6470901",
"0.64123094",
"0.6315087",
"0.6304886",
"0.62927294",
"0.62897396",
"0.6267294",
"0.6255155",
"0.6250878",
"0.62452817",
"0.6229992",
"0.61644083",
"0.6160024",
"0.61408114",
"0.6133717",
"0.61173576",
"0.6106241",
"0.6103352",
"0.6040724",
"0.5990699",
"0.5987583",
"0.598338",
"0.5974081",
"0.59211254",
"0.59075975",
"0.5902595",
"0.5888189",
"0.5883263",
"0.58740044",
"0.5871365",
"0.5863263",
"0.58214563",
"0.57876134",
"0.57845396",
"0.57504976",
"0.5744963",
"0.57397157",
"0.5736818",
"0.5736244",
"0.57235056",
"0.57226044",
"0.5715272",
"0.5714739",
"0.5691771",
"0.56671834",
"0.56434536",
"0.5641992",
"0.56393987",
"0.56389034",
"0.5625826",
"0.5618809",
"0.56026626",
"0.55962145",
"0.5593249",
"0.55920064",
"0.55831295",
"0.55828613",
"0.55826885",
"0.5576553",
"0.5576236",
"0.5575655",
"0.55665064",
"0.55607224",
"0.5556583",
"0.55543894",
"0.5554306",
"0.55487424",
"0.55463475",
"0.55429804",
"0.55397433",
"0.5530272",
"0.5528033",
"0.55202067",
"0.55113673",
"0.5507551",
"0.5504257",
"0.55008596",
"0.5498419",
"0.5498102",
"0.5485857",
"0.54835063",
"0.54726416",
"0.5459201",
"0.54572684",
"0.54564357",
"0.54549706",
"0.5453371",
"0.54454535",
"0.5440738",
"0.54364675",
"0.5431188",
"0.54300076",
"0.5423208",
"0.5419386",
"0.54162306",
"0.54118973",
"0.5408734",
"0.5406182",
"0.54019815"
]
| 0.73558325 | 1 |
Registration for new user | public function registerAction(Request $request)
{
$form = $this->createForm(new UserType());
if ($request->getMethod() == 'POST') {
$form->handleRequest($request);
if ($form->isValid()) {
$user = $form->getData();
$factory = $this->get('security.encoder_factory');
$encoder = $factory->getEncoder($user);
$password = $encoder->encodePassword($user->getPassword(), $user->getSalt());
$user->setPassword($password);
$token = $this->getToken(array($user->email, $user->created, rand()));
$user->setToken($token);
$saveUser = $this->baseRepository()->save($user);
return $this->redirect($this->generateUrl('thankyou', array('email' => $user->getEmail())));
}
}
return $this->render('UserBundle:User:save.html.twig', array('form' => $form->createView(), 'action' => 'Registreren'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function newRegistration() {\n $this->registerModel->getUserRegistrationInput();\n $this->registerView->setUsernameValue($this->registerView->getUsername());\n $this->registerModel->validateRegisterInputIfSubmitted();\n if ($this->registerModel->isValidationOk()) {\n $this->registerModel->hashPassword();\n $this->registerModel->saveUserToDatabase();\n $this->loginView->setUsernameValue($this->registerView->getUsername());\n $this->loginView->setLoginMessage(\"Registered new user.\");\n $this->layoutView->render(false, $this->loginView);\n } else {\n $this->layoutView->render(false, $this->registerView);\n }\n \n }",
"public function register() {\n\t\tif ($this -> Auth -> loggedIn()) {\n\t\t\t$this -> Session -> setFlash('You are already registered.');\n\t\t\t$this -> redirect($this -> referer());\n\t\t}\n\t\tif ($this -> request -> is('post')) {\n\t\t\t$this -> User -> create();\n\t\t\t$data = $this -> request -> data;\n\t\t\t$data['User']['public_key'] = uniqid();\n\t\t\t$data['User']['role'] = \"user\";\n\t\t\t$data['User']['api_key'] = md5(microtime().rand());\n\t\t\tif ($this -> User -> save($data)) {\n\t\t\t\t$this -> Session -> setFlash(__('You have succesfully registered. Now you can login.'));\n\t\t\t\t$this -> redirect('/users/login');\n\t\t\t} else {\n\t\t\t\t$this -> Session -> setFlash(__('The user could not be saved. Please, try again.'));\n\t\t\t}\n\t\t}\n\n\t\t$this -> set('title_for_layout', 'User Registration');\n\t}",
"public function registerNewUser()\n\t{\n\t\t# make the call to the API\n\t\t$response = App::make('ApiClient')->post('register', Input::all());\n\n\t\t# if we successfully register a new user\n\t\tif(isset($response['success']))\n\t\t{\n\t\t\tUser::startSession($response['success']['data']['user']);\n\n\t\t\t# grab the data array from the response\n\t\t\tSession::flash('success', $response['success']['data']);\n\n\t\t\t# show the user profile screen\n\t\t\treturn Redirect::route('profile');\n\t\t}\n\t\t# there was a problem registering the user\n\t\telse \n\t\t{\n\t\t\t# save the API response to some flash data\n\t\t\tSession::flash('registration-errors', getErrors($response));\n\n\t\t\t# also flash the input so we can replay it out onto the reg form again\n\t\t\tInput::flash();\n\n\t\t\t# ... and show the sign up form again\n\t\t\treturn Redirect::back();\n\t\t}\n\t}",
"public function register () : void\n {\n $this->getHttpReferer();\n\n // if the user is already logged in,\n // redirection to the previous page\n if ($this->session->exist(\"auth\")) {\n $url = $this->router->url(\"admin\");\n Url::redirect(301, $url);\n }\n\n $errors = []; // form errors\n $flash = null; // flash message\n\n $tableUser = new UserTable($this->connection);\n $tableRole = new RoleTable($this->connection);\n\n // form validator\n $validator = new RegisterValidator(\"en\", $_POST, $tableUser);\n\n // check that the form is valid and add the new user\n if ($validator->isSubmit()) {\n if ($validator->isValid()) {\n $role = $tableRole->find([\"name\" => \"author\"]);\n\n $user = new User();\n $user\n ->setUsername($_POST[\"username\"])\n ->setPassword($_POST[\"password\"])\n ->setSlug(str_replace(\" \", \"-\", $_POST[\"username\"]))\n ->setRole($role);\n\n $tableUser->createUser($user, $role);\n\n $this->session->setFlash(\"Congratulations {$user->getUsername()}, you are now registered\", \"success\", \"mt-5\");\n $this->session\n ->write(\"auth\", $user->getId())\n ->write(\"role\", $user->getRole());\n\n // set the token csrf\n if (!$this->session->exist(\"token\")) {\n $csrf = new Csrf($this->session);\n $csrf->setSessionToken(175, 658, 5);\n }\n\n $url = $this->router->url(\"admin\") . \"?user=1&create=1\";\n Url::redirect(301, $url);\n } else {\n $errors = $validator->getErrors();\n $errors[\"form\"] = true;\n }\n }\n\n // form\n $form = new RegisterForm($_POST, $errors);\n\n // url of the current page\n $url = $this->router->url(\"register\");\n\n // flash message\n if (array_key_exists(\"form\", $errors)) {\n $this->session->setFlash(\"The form contains errors\", \"danger\", \"mt-5\");\n $flash = $this->session->generateFlash();\n }\n\n $title = App::getInstance()\n ->setTitle(\"Register\")\n ->getTitle();\n\n $this->render(\"security.auth.register\", $this->router, $this->session, compact(\"form\", \"url\", \"title\", \"flash\"));\n }",
"public function register() {\n\t\tif ($this->Session->check('Auth.User')) {\n\t\t\t$this->redirect('/');\n\t\t}\n\t\t\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->User->create();\n\t\t\t$data = $this->request->data;\n\t\t\tif ($this->User->save($data)) {\n\t\t\t\t$this->Session->setFlash(\"User has been created.\", 'default', array(), 'register');\n\t\t\t\t$this->redirect('/login');\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(\"This user couldn't created. Please try again.\");\n\t\t\t}\n\t\t} else\n\t\t\t$this->Session->delete('Message.register');\n\t}",
"public function action_register()\n\t{\n Auth::create_user(\n 'promisemakufa',\n 'pass123',\n '[email protected]',\n 1,\n array(\n 'fullname' => 'P K systems',\n )\n );\n\n $this->template->title = \"User\";\n $this->template->content = View::forge('user/register');\n }",
"public function register() {\n\t\t\n\t\t// DB connection\n\t\t$db = Database::getInstance();\n \t$mysqli = $db->getConnection();\n\t\t\n $data = (\"INSERT INTO user (username,password,first_name,\n last_name,dob,address,postcode,email)\n VALUES ('{$this->_username}',\n '{$this->_sha1}',\n '{$this->_first_name}',\n '{$this->_last_name}',\n '{$this->_dob}',\n '{$this->_address}',\n '{$this->_postcode}',\n '{$this->_email}')\");\n\t\t\t\t\t\t \n\t\t\t$result = $mysqli->query($data);\n if ( $mysqli->affected_rows < 1)\n // checks if data has been succesfully inputed\n $this->_errors[] = 'could not process form';\n }",
"public function registerUser()\n {\n $request = new Request();\n\n $email = $request->input('email');\n $password = $request->input('password');\n $password_repeat = $request->input('password_repeat');\n\n\n // Check email\n if (!$email) {\n $this->showRegisterForm(['Please enter email']);\n }\n // Check password\n if(!$password){\n $this->showRegisterForm(['Please enter password']);\n }\n if (!$password || !$password_repeat || $password != $password_repeat) {\n $this->showRegisterForm(['Passwords do not match']);\n }\n\n // Check user exist\n if ($this->getUser($email)) {\n $this->showRegisterForm(['User already isset']);\n }\n\n // Save user to DB\n $user = new User();\n $user->email = $email;\n $user->password = md5($password);\n $user->rights = 20;\n\n // Check save process\n if (!$user->save()) {\n $this->showRegisterForm(['Something goes wrong']);\n }\n\n // Redirect to endpoint\n header(\"Location: \" . self::ENDPOINTS['success_register']);\n }",
"public function register() {\n \n $this->form_validation->set_rules('email', 'Email', 'required|valid_email');\n $this->form_validation->set_rules('password', 'Passwort', 'required');\n $this->form_validation->set_rules('dataprotection', 'Datenschutz', 'required');\n \n if ($this->form_validation->run() === FALSE) {\n \t$this->error(400, 'Validation error');\n }\n \n if (strtolower($this->input->post('dataprotection')) == 'true') {\n \t// TODO: save acceptance or acceptance date to db, i.e. hand over to model\n } else {\n \t$this->error(404, 'Dataprotection error');\n } \n \n $this->user_model->setValue('email', $this->input->post('email'));\n $this->user_model->setValue(\n \t'hashed_password', \n \tpassword_hash($this->input->post('password'), PASSWORD_DEFAULT));\n\n if (! $this->user_model->newUser()) {\n\t\t\t$this->error(409, 'Duplicate');\n }\n\n\t\t$this->sendConfirmationMail($this->input->post('email'));\n\t\t$data['msg'] = $this->input->post('email') . ' registered.';\n\t\t$this->responseWithCode(201, $data);\n }",
"public function register_user()\n {\n \n return true;\n \n }",
"public function action_register(){\n\t\t\n\t\t$user = CurUser::get();\n\t\t\n\t\tif($user->save($_POST, User_Model::SAVE_REGISTER)){\n\t\t\t$user->login($user->{CurUser::LOGIN_FIELD}, $_POST['password']);\n\t\t\tApp::redirect('user/profile/greeting');\n\t\t\treturn TRUE;\n\t\t}else{\n\t\t\tMessenger::get()->addError('При регистрации возникли ошибки:', $user->getError());\n\t\t\treturn FALSE;\n\t\t}\n\t}",
"public function regNewUser( $data ){\n\n\t\t$success = parent::regNewUser( $data );\n\t\n\t\tif( is_array( $success ) ){\n\t\t \treturn $this->createAnswer( 1,\"Username or email already exist\",403 );\n\t\t}elseif ( $success ){\n\t\t\treturn $this->createAnswer( 0,\"Congratulation you got permission\" );\n\t\t}else{\n\t\t return $this->createAnswer( 1,\"invalid query\",402 );\n\t\t}\n\t}",
"function register_user($new) {\n \n $this->db->insert('users', $new);\n }",
"public function register() {\n\t\t\tif($this->Session->read('Auth.User.id')){\n\t\t\t\t$this->redirect('/');\n\t\t\t}\n\t\t\telse {\n\n\t\t\t\tif(!empty($this->request->data)){\n\n\t\t\t\t\t$this->User->create($this->request->data);\n\t\t\t\t\t// Validation des données\n\t\t\t\t\tif($this->User->validates()) {\n\n\t\t\t\t\t\t$token = md5(time() .' - '. uniqid());\n\n\t\t\t\t\t\t$this->User->create(array(\n\t\t\t\t\t\t\t\"email\" \t\t=> $this->request->data['User']['email'],\n\t\t\t\t\t\t\t\"password\" \t\t=> $this->Auth->password($this->request->data['User']['password']),\n\t\t\t\t\t\t\t\"token\" \t\t=> $token\n\t\t\t\t\t\t\t));\n\n\t\t\t\t\t\t// Si tout est ok, on sauvegarde\n\t\t\t\t\t\t$this->User->save();\n\n\t\t\t\t\t\t// Envoie de l'email d'activation à l'utilisateur\n\t\t\t\t\t\t$CakeEmail = new CakeEmail('default');\n\t\t\t\t\t\t$CakeEmail->to($this->request->data['User']['email']);\n\t\t\t\t\t\t$CakeEmail->subject('Dezordre: Confirmation d\\'inscription');\n\t\t\t\t\t\t$CakeEmail->viewVars($this->request->data['User'] + array(\n\t\t\t\t\t\t\t'token' => $token,\n\t\t\t\t\t\t\t'id'\t=> $this->User->id,\n\n\t\t\t\t\t\t\t));\n\t\t\t\t\t\t$CakeEmail->emailFormat('text');\n\t\t\t\t\t\t$CakeEmail->template('register');\n\t\t\t\t\t\t$CakeEmail->send();\n\n\n\t\t\t\t\t\t$this->Session->setFlash(\"Votre compte à bien été créer. Un lien vous à été envoyé par email afin d'activer votre compte.\", 'alert', array('class' => 'success'));\n\t\t\t\t\t\t$this->redirect(array('controller' => 'pages', 'action' => 'display', 'home'));\n\t\t\t\t\t\t\n\t\t\t\t\t}\n\n\t\t\t\t\telse {\n\t\t\t\t\t\t\t$this->Session->setFlash(\"Erreur, merci de corriger\", 'alert', array('class' => 'danger'));\n\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function registerNewUser()\n\t{\n\t\t$Request= new Request();\n\t\t\n\t\t$Controler_Main= Controler_Main::getInstance();\n\t\t$ErrorString=\"\";\n\t\tif(strlen($Request->getAsString(\"tb_Name\"))<3){$ErrorString.=\":T_REGISTER_ERROR1: <br />\";}\n\t\tif(strlen($Request->getAsString(\"tb_Pass\"))<5){$ErrorString.=\":T_REGISTER_ERROR2: <br />\";}\n\t\tif(strlen($Request->getAsString(\"tb_Pass\"))===$Request->getAsString(\"tb_PassConfirme\")){$ErrorString.=\":T_REGISTER_ERROR3:<br />\";}\n\t\t$UserFinder= new UserFinder();\n\t\tif(strlen($Request->getAsString(\"tb_Mail\"))>3)\n\t\t{\n\t\t\t$User=$UserFinder->findByMail($Request->getAsString(\"tb_Mail\"));\n\t\t\tif($User->getId()!=0)\n\t\t\t{\n\t\t\t\t$ErrorString.=\":T_REGISTER_ERROR4: <br />\";\n\t\t\t}\n\t\t}else\n\t\t{\n\t\t\t$ErrorString.=\":T_REGISTER_ERROR5: <br />\";\n\t\t}\t\n\t\tif(strlen($Request->getAsString(\"tb_Mail\"))===$Request->getAsString(\"tb_MailConfirme\")){$ErrorString.=\":T_REGISTER_ERROR6:<br />\";}\n\t\tif(strlen($Request->getAsString(\"tb_Name\")))\n\t\t{\n\t\t\t$User=$UserFinder->findByName($Request->getAsString(\"tb_Name\"));\n\t\t\tif($User->getId()!=0){$ErrorString.=\":T_REGISTER_ERROR7: <br />\";}\n\t\t}\n\t\t\n\t\t\n\t\tif(!$this->isMailCorrect($Request->getAsString(\"tb_Mail\")))\n\t\t{\n\t\t\t$ErrorString.=\":T_REGISTER_ERROR8: <br />\";\n\t\t}\t\n\t\t\n\t\tif(strtolower($_SESSION['Captcha'])!=(strtolower($Request->getAsString(\"tb_Captcha\"))))\n\t\t{\n\t\t\t$ErrorString.=\":T_REGISTER_ERROR9: <br />\";\n\t\t}\n\t\t\t\n\t\tif(strlen($ErrorString)!=0)\n\t\t{\n\t\t\t$this->showRegister($ErrorString);\n\t\t\t$this->setCaptchaCode();\n\t\t\treturn false;\n\t\t}\n\t\t$User= new User(0,$Request->getAsString(\"tb_Name\"),md5($Request->getAsString(\"tb_Pass\")),$Request->getAsString(\"tb_Mail\"),0,1,0,0);\t\n\t\t$UserManager= new UserManager();\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t// user Ordner anlegen\n\t\t\n\t\t// htaccess zugriff legen\n\t\tif(!is_dir(STORE_FOLDER.\"/\".md5($User->getName())))\n\t\t{\n\t\t\tmkdir(STORE_FOLDER.\"/\".md5($User->getName()), 0777);// ordner erstellen\n\t\t\t$User->setFolder(STORE_FOLDER.\"/\".md5($User->getName()));\n\t\t}else\n\t\t{\n\t\t\t$Folder=STORE_FOLDER.\"/\".md5($User->getName()+mktime());\n\t\t\tmkdir($Folder, 0777);\n\t\t\t$User->setFolder($Folder);\n\t\t}\n\t\t\n\t\t$User->setSpaceMax(MAXSPACE);\n\t\t//var_dump(\"und den UserFinder eintragen\");\n\t\t$UserManager->insertUser($User);// user in die db eintragen\n\t\tif(!$UserManager->getLastInsertId())\n\t\t{\n\t\t\t$this->showRegister($ErrorString);\n\t\t\treturn false;\n\t\t}\n\t\t$User->setId($UserManager->getLastInsertId());\n\t\t$this->userLogin();\n\t\t\n\n\t}",
"public function createRegister(){\n\t\t$userRepo = new UserRepository(App::getInstance());\n\n\t\t//check if user exists first. Search user by email.\n\t\t$user = $userRepo->getUserByEmail($_POST['email']);\n\t\tif($user!=null){\n\t\t\t//Error Message\n\t\t\treturn view('newRegForm')->with('error', true);\n\t\t}\n\n\t\telse{\n\t\t\t//Creates a new user and then returns ALL the registers to the view\n\t\t\t$user = new User($_POST);\n\t\t\t$user = $userRepo->create($user);\n\t\t\t$user = $userRepo->selectAll();\n\n\t\t\treturn view('viewRegisters')->with(['users'=>$user,'error'=>false]);\n\t\t}\n\t}",
"private static function register() {\n if ( !self::validatePost() ) {\n return;\n }\n\n if ( !self::validEmail($_POST['email']) ) {\n self::setError('E-Mail Adresse ist nicht gültig!<br>');\n return;\n }\n \n $_POST['email'] = strtolower($_POST['email']);\n \n $password = Helper::hash($_POST['password'].$_POST['email']);\n \n $verified = md5($_POST['email'].$password.microtime(true));\n \n $result = Database::createUser($_POST['email'],$password,$verified);\n \n if ( $result === false || !is_numeric($result) ) {\n return;\n }\n \n $_SESSION['user']['id'] = $result;\n $_SESSION['user']['email'] = $_POST['email'];\n $_SESSION['user']['verified'] = $verified;\n $_SESSION['loggedin'] = true;\n self::$loggedin = true;\n \n self::registerMail($verified);\n }",
"private function registerNewUser()\n {\n if (empty($_POST['user_name'])) {\n $this->errors[] = \"Nome Vazio\";\n } elseif (empty($_POST['user_password_new']) || empty($_POST['user_password_repeat'])) {\n $this->errors[] = \"Senha Vazia\";\n } elseif ($_POST['user_password_new'] !== $_POST['user_password_repeat']) {\n $this->errors[] = \"Senha e repetir senha não são a mesma\";\n } elseif (strlen($_POST['user_password_new']) < 6) {\n $this->errors[] = \"Senha tem tamanho mínimo de 6 caracteres\";\n } elseif (strlen($_POST['user_name']) > 64 || strlen($_POST['user_name']) < 2) {\n $this->errors[] = \"Nome não pode ser menor que 2 ou maior que 64 caracteres\";\n } elseif (empty($_POST['user_email'])) {\n $this->errors[] = \"Email não pode ser vazio\";\n } elseif (strlen($_POST['user_email']) > 64) {\n $this->errors[] = \"Email não pode ser maior que 64 caracteres\";\n } elseif (!filter_var($_POST['user_email'], FILTER_VALIDATE_EMAIL)) {\n $this->errors[] = \"Seu email não está com um formato de email válido\";\n } elseif (!empty($_POST['user_name'])\n && strlen($_POST['user_name']) <= 64\n && strlen($_POST['user_name']) >= 2\n && !empty($_POST['user_email'])\n && strlen($_POST['user_email']) <= 64\n && filter_var($_POST['user_email'], FILTER_VALIDATE_EMAIL)\n && !empty($_POST['user_password_new'])\n && !empty($_POST['user_password_repeat'])\n && ($_POST['user_password_new'] === $_POST['user_password_repeat'])\n ) {\n // create a database connection\n $this->db_connection = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT);\n\n // change character set to utf8 and check it\n if (!$this->db_connection->set_charset(\"utf8\")) {\n $this->errors[] = $this->db_connection->error;\n }\n\n // if no connection errors (= working database connection)\n if (!$this->db_connection->connect_errno) {\n\n // escaping, additionally removing everything that could be (html/javascript-) code\n $user_name = $this->db_connection->real_escape_string(strip_tags($_POST['user_name'], ENT_QUOTES));\n $user_email = $this->db_connection->real_escape_string(strip_tags($_POST['user_email'], ENT_QUOTES));\n\n $user_type = $_POST['tipo'];\n $user_inst_id = $_POST['instituicao'];\n \n if (!isset($_POST['matricula']))\n {\n $user_mat = \"\";\n }\n else\n {\n $user_mat = $this->db_connection->real_escape_string(strip_tags($_POST['matricula'], ENT_QUOTES));\n }\n $user_password = $_POST['user_password_new'];\n\n // crypt the user's password with PHP 5.5's password_hash() function, results in a 60 character\n // hash string. the PASSWORD_DEFAULT constant is defined by the PHP 5.5, or if you are using\n // PHP 5.3/5.4, by the password hashing compatibility library\n $user_password_hash = password_hash($user_password, PASSWORD_DEFAULT);\n\n // check if user or email address already exists\n $sql = \"SELECT * FROM users WHERE user_email = '\" . $user_email . \"';\";\n $query_check_user_email = $this->db_connection->query($sql);\n\n if ($query_check_user_email->num_rows == 1) {\n $this->errors[] = \"Desculpe, este email já está em uso.\";\n } else {\n // write new user's data into database\n $sql = \"INSERT INTO users (user_name, user_password_hash, user_email, user_type, inst_id, user_mat)\n VALUES('\" . $user_name . \"', '\" . $user_password_hash . \"', '\" . $user_email . \"', '\" . $user_type . \"', '\" . $user_inst_id . \"', '\" . $user_mat . \" ');\";\n $query_new_user_insert = $this->db_connection->query($sql);\n\n // if user has been added successfully\n if ($query_new_user_insert) {\n $this->messages[] = \"Sua conta foi criada com sucesso. Você pode logar agora.\";\n } else {\n $this->errors[] = \"Desculpe, seu registro falhou. Por favor volte e tente novamente.\";\n }\n }\n } else {\n $this->errors[] = \"Desculpe, sem conexão com o banco de dados.\";\n }\n } else {\n $this->errors[] = \"Um erro desconhecido aconteceu.\";\n }\n }",
"public function createUser();",
"public function createUser();",
"public function createUser();",
"public function createUser();",
"public function register(){\n $user = Container::getModel('User');\n $user->__set('name',$_POST['name']);\n $user->__set('email',$_POST['email']);\n if(isset($_POST['password']) && $_POST['password'] != ''){\n $user->__set('password',md5($_POST['password'])); \n }\n\n //if the fields are correct\n if($user->validateRegister()){\n //if user doesn't alredy exist\n if(count($user->getUserByEmail()) == 0){\n //success\n $user->save();\n $this->render('register');\n }else{\n //user does alredy exist\n $this->render('email_alredy_exists');\n }\n\n }else{\n //error if any of the fields are incorrect\n //this array will be use to auto-fill the fields\n $this->view->user = array(\n 'name' => $_POST['name'],\n 'email' => $_POST['email'],\n 'password' => $_POST['password']\n\n );\n $this->view->erroRegister = true;\n $this->render('inscreverse');\n }\n }",
"function registerUser()\n {\n $DBA = new DatabaseInterface();\n $fields = array(0 => 'title', 1 => 'first_name', 2 => 'last_name', 3 => 'contacttelephone', 4 => 'contactemail', 5 => 'password', 6 => 'username', 7 => 'dob', 8 => 'house', 9 => 'street', 10 => 'town', 11 => 'county', 12 => 'pcode', 13 => 'optout', 14 => 'newsletter', 15 => 'auth_level', 16 => 'store_owner');\n $fieldvals = array(0 => $this->Title, 1 => $this->FirstName, 2 => $this->LastName, 3 => $this->ContactTelephone, 4 => $this->ContactEmail, 5 => $this->Password, 6 => $this->Username, 7 => $this->DOB, 8 => $this->House, 9 => $this->Street, 10 => $this->Town, 11 => $this->County, 12 => $this->PCode, 13 => $this->Optout, 14 => $this->NewsletterSubscriber, 15 => $this->AuthLevel, 16 => 1);\n $rs = $DBA->insertQuery(DBUSERTABLE, $fields, $fieldvals);\n if ($rs == 1)\n {\n $this->RegistrationSuccess = 1;\n }\n if (isset($this->PCode))\n {\n $this->geoLocate();\n }\n }",
"private function register(): void\n {\n $user = User::factory()->create();\n $this->actingAs($user);\n }",
"protected function RegisterIfNew(){\n // Si el sitio es de acceso gratuito, no debe registrarse al usuario.\n // Luego debe autorizarse el acceso en el metodo Authorize\n $url = $this->getUrl();\n if ($url instanceof Url && $this->isWebsiteFree($url->host)){\n return;\n }\n\t\t\n\t\t// Crear la cuenta de usuarios nuevos\n // if (!DBHelper::is_user_registered($this->user)){\n // if (!(int)$this->data->mobile || \n // (int)($this->data->client_app_version) < AU_NEW_USER_MIN_VERSION_CODE){\n // // Force update\n // $this->url = Url::Parse(\"http://\". HTTP_HOST .\"/__www/new_user_update_required.php\");\n // }else{\n // DBHelper::createNewAccount($this->user, DIAS_PRUEBA);\n // }\n // }\n \n // No crear cuenta. En su lugar mostrar una pagina notificando\n // E:\\XAMPP\\htdocs\\__www\\no_registration_allowed.html\n \n if (!DBHelper::is_user_registered($this->user)){\n DBHelper::storeMailAddress($this->user);\n $this->url = Url::Parse(\"http://auroraml.com/__www/no_registration_allowed.html\");\n }\n }",
"public function register_new() {\n\t\t$fields = array(\n\t\t\t'address1', 'address2', 'city', 'comment', 'country', 'email', 'fax_src', 'first_name',\n\t\t\t'gender', 'insertion', 'company_name', 'lang', 'last_name', 'middle_name', 'mobile_src',\n\t\t\t'phone_src', 'prefix', 'state', 'suffix', 'zip', 'tax_ex_number', 'timezone'/* , 'house_num', 'house_suff' */\n\t\t);\n\t\t$clean_data = $this->_fill_account_data($fields);\n\n\t\t$clean_data['password'] = $_POST['password'];\t## password may contain escapeable symbols\n\t\t$clean_data['fraud_check'] = 1;\n\t\t$clean_data['ip_address'] = $this->translator->getClientIp();\n\n\t\tinstall_error_handler(array('UserPerson', 'NewAccountsDenied', 'UserExtData', 'InvalidAccountStatus'), 'handle_register_new_account_error');\n\t\t$account_id = call('create_customer', $clean_data, 'HSPC/API/Account');\n\t\tif($account_id) {\n\t\t\t$this->error->add(MC_SUCCESS, 'YOU_BEEN_REGISTERED');\n\t\t\treturn $this->sign_in();\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"public function register()\n\t{\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->User->create();\n\n\t\t\t// CakePHP automatically call $this->User->validates() for us before saving it.\n\t\t\tif ($this->User->save($this->request->data)) {\n\t\t\t\t// we set the id of our newly created User to the request->data params\n\t\t\t\t$this->request->data['User']['id'] = $this->User->id;\n\t\t\t\t// so we can log in directly. (We don't use $this->User because the password is now encrypted so it would not match).\n\t\t\t\t$this->Auth->login($this->request->data['User']);\n\t\t\t\treturn $this->redirect(array('controller' => 'messages', 'action' => 'index'));\n\t\t\t}\n\t\t}\n\t}",
"public function register(){\n\t\t//Better to be implemented through db table\n\t\t$userRole = array('Job Seeker'=>'Job Seeker', 'Employer'=>'Employer');\n\t\t$this->set('userRole',$userRole);\n\n\t\tif($this->request->is('post')){\n\t\t\t$this->User->create();\n\t\t\t\n\t\t\tif($this->User->save($this->request->data)){\n\t\t\t\t$this->Session->setFlash(__('You are now registered and may login'));\n\t\t\t\treturn $this->redirect(array('controller'=>'jobs','action'=>'index'));\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('Unable to create new user'));\n\n\t\t\t}\n\t\t}\n\t}",
"private function registerNewUser()\n {\n if (empty($_POST['user_name'])) {\n $this->errors[] = \"Empty Username\";\n } elseif (empty($_POST['user_password_new']) || empty($_POST['user_password_repeat'])) {\n $this->errors[] = \"Empty Password\";\n } elseif ($_POST['user_password_new'] !== $_POST['user_password_repeat']) {\n $this->errors[] = \"Password and password repeat are not the same\";\n } elseif (strlen($_POST['user_password_new']) < 6) {\n $this->errors[] = \"Password has a minimum length of 6 characters\";\n } elseif (strlen($_POST['user_name']) > 64 || strlen($_POST['user_name']) < 2) {\n $this->errors[] = \"Username cannot be shorter than 2 or longer than 64 characters\";\n } elseif (!preg_match('/^[a-z\\d]{2,64}$/i', $_POST['user_name'])) {\n $this->errors[] = \"Username does not fit the name scheme: only a-Z and numbers are allowed, 2 to 64 characters\";\n } elseif (empty($_POST['user_email'])) {\n $this->errors[] = \"Email cannot be empty\";\n } elseif (strlen($_POST['user_email']) > 64) {\n $this->errors[] = \"Email cannot be longer than 64 characters\";\n } elseif (!filter_var($_POST['user_email'], FILTER_VALIDATE_EMAIL)) {\n $this->errors[] = \"Your email address is not in a valid email format\";\n } elseif (!empty($_POST['user_name'])\n && strlen($_POST['user_name']) <= 64\n && strlen($_POST['user_name']) >= 2\n && preg_match('/^[a-z\\d]{2,64}$/i', $_POST['user_name'])\n && !empty($_POST['user_email'])\n && strlen($_POST['user_email']) <= 64\n && filter_var($_POST['user_email'], FILTER_VALIDATE_EMAIL)\n && !empty($_POST['user_password_new'])\n && !empty($_POST['user_password_repeat'])\n && ($_POST['user_password_new'] === $_POST['user_password_repeat'])\n ) {\n // create a database connection\n $this->db_connection = new mysqli(DB_HOST, DB_USER, DB_PASS, DB_NAME);\n\n // change character set to utf8 and check it\n if (!$this->db_connection->set_charset(\"utf8\")) {\n $this->errors[] = $this->db_connection->error;\n }\n\n // if no connection errors (= working database connection)\n if (!$this->db_connection->connect_errno) {\n\n // escaping, additionally removing everything that could be (html/javascript-) code\n $user_name = $this->db_connection->real_escape_string(strip_tags($_POST['user_name'], ENT_QUOTES));\n $user_last = $this->db_connection->real_escape_string(strip_tags($_POST['user_last'], ENT_QUOTES));\n $user_email = $this->db_connection->real_escape_string(strip_tags($_POST['user_email'], ENT_QUOTES));\n\n $user_password = $_POST['user_password_new'];\n\n // crypt the user's password with PHP 5.5's password_hash() function, results in a 60 character\n // hash string. the PASSWORD_DEFAULT constant is defined by the PHP 5.5, or if you are using\n // PHP 5.3/5.4, by the password hashing compatibility library\n $user_password_hash = password_hash($user_password, PASSWORD_DEFAULT);\n\n // check if user or email address already exists\n $sql = \"SELECT * FROM users WHERE user_email = '\" . $user_email . \"';\";\n $query_check_user_name = $this->db_connection->query($sql);\n\n if ($query_check_user_name->num_rows == 1) {\n $this->errors[] = \"<div class='alert alert-danger center' role='alert'> Sorry, that username / email address is already taken. </div>\";\n } else {\n // write new user's data into database\n $sql = \"INSERT INTO users (user_name, user_last, user_password_hash, user_email)\n VALUES('\" . $user_name . \"', '\" . $user_last . \"', '\" . $user_password_hash . \"', '\" . $user_email . \"');\";\n $query_new_user_insert = $this->db_connection->query($sql);\n\n // if user has been added successfully\n if ($query_new_user_insert) {\n $this->messages[] = \"<div class='alert alert-success center' role='alert'> Your account has been created successfully. Please check your emails.</div>\";\n\n // Load username and datejoined for verifcation via email hashing\n $sql=\"SELECT `user_id`, `user_name`, `user_date_joined` FROM `users` WHERE `user_email` = '\" . $user_email . \"';\";\n $query_load_hash_verify = $this->db_connection->query($sql);\n\n // if loaded then include send email and display message\n if ( $query_load_hash_verify) {\n $result_row = $query_load_hash_verify -> fetch_object();\n $codeid = $result_row->user_id;\n $code2 = md5($result_row->user_name);\n $code3 = md5($result_row->user_date_joined);\n\n // created a hash of when the user joined split it into two parts\n $cuthashtime = substr($code3, 0, 4);\n $endhashtime = substr($code3, -4); \n\n $hashedname = $code2;\n $middlehashname = substr($hashedname, 0, 4);\n\n include 'Email.php';\n } else {\n $this->errors[] = \"<div class='alert alert-danger center' role='alert'> Sorry, but we couldn't send your email. Please contact support.</div>\";\n }\n } else {\n $this->errors[] = \"<div class='alert alert-danger center' role='alert'> Sorry, your registration failed. Please go back and try again. </div>\";\n }\n }\n } else {\n $this->errors[] = \"<div class='alert alert-danger center' role='alert'> Sorry, no database connection. </div>\";\n }\n } else {\n $this->errors[] = \"<div class='alert alert-danger center' role='alert'> An unknown error occurred. </div>\";\n }\n }",
"public function register (){\n $msg=\"\";\n if (isset($_POST[\"register\"])) {\n if ($this->isValidInput($_POST)){\n $firstName = $_POST[\"firstName\"];\n $lastName = $_POST[\"lastName\"];\n $email = $_POST[\"email\"];\n $password = password_hash(trim($_POST[\"password\"]), PASSWORD_BCRYPT);\n $age = $_POST[\"age\"];\n $isAdmin = null;\n //if user is not empty - the email from input already exists\n $user = UserDao::getByEmail($email);\n if($user != null){\n $msg .= \"Вече съществува потребител с този email\";\n $this->triggerError($msg, 'register.tpl');\n }\n else {\n $newUser = new User(null, $firstName,$lastName,$email,$password,$age,$isAdmin);\n UserDao::addUser($newUser);\n $_SESSION[\"user\"] = $newUser;\n header(\"Location: \".BASE_PATH);\n }\n }\n else {\n $msg .= \"Въведени са невалидни данни\";\n $this->triggerError($msg, 'register.tpl');\n }\n }\n else {\n $GLOBALS[\"smarty\"]->assign('isLoggedIn', isset($_SESSION[\"user\"]));\n $GLOBALS[\"smarty\"]->assign('msg', $msg);\n $GLOBALS[\"smarty\"]->display('register.tpl');\n }\n }",
"public function register_action()\n {\n $registration_successful = RegistrationModel::registerNewUser();\n\n if ($registration_successful) {\n Redirect::to('index');\n } else {\n Redirect::to('user/register');\n }\n }",
"public function registerUserAction() {\n\t\n\t\t\t$request = $this->getRequest();\n\t\t\t\n\t\t\t\n\t\t\tif ($request->isPost()) {\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t// get the json raw data\n\t\t\t\t$handle = fopen(\"php://input\", \"rb\");\n\t\t\t\t$http_raw_post_data = '';\n\t\t\t\t\n\t\t\t\twhile (!feof($handle)) {\n\t\t\t\t $http_raw_post_data .= fread($handle, 8192);\n\t\t\t\t}\n\t\t\t\tfclose($handle); \n\t\t\t\t\n\t\t\t\t// convert it to a php array\n\t\t\t\t$json_data = json_decode($http_raw_post_data, true);\n\t\t\t\t\n\t\t\t\t//echo json_encode($json_data);\n\t\t\t\t\n\t\t\t\tif (is_array($json_data)) {\n\t\t\t\t\t// convert it back to json\n\t\t\t\t\t\n\t\t\t\t\t// write the user back to database\n\t\t\t\t\t$registered = Application_Model_User::registerUser($json_data);\n\t\t\t\t\t\n\t\t\t\t\tif($registered) {\n\t\t\t\t\t\techo json_encode($registered);\n\t\t\t\t\t}\n\t\t\t\t\telse {\n\t\t\t\t\t\techo 0;\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t}\n\t\t\t\t \n\t\t\t\t \n\t\t\t}\n\t\t\t\n\t}",
"public function registerAction() {\n\n $user = new User();\n\n // データを保存し、エラーをチェックする\n// $success = $user->save($this->request->getPost(), array('name', 'email'));\n\n $user->findFirst($this->request->getPost());\n\n if ($success) {\n echo \"Thanks for registering!\";\n } else {\n echo \"Sorry, the following problems were generated: \";\n foreach ($user->getMessages() as $message) {\n echo $message->getMessage(), \"<br/>\";\n }\n }\n\n $this->view->disable();\n\n }",
"function register()\n\t\t{\n\n\t\t if(!empty($_POST['email']) && !empty($_POST['password'])&& !empty($_POST['nombre'])){\n\n\t\t $email=filter_input(INPUT_POST, 'email', FILTER_SANITIZE_STRING);\n\t\t $password=filter_input(INPUT_POST, 'password', FILTER_SANITIZE_STRING);\n\t\t $name=filter_input(INPUT_POST, 'nombre', FILTER_SANITIZE_STRING);\n\t\t $new_user=$this->model->register($email,$password,$name);\n\n\t\t if ($new_user == TRUE){ \n\t\t // cap a la pàgina principal\n\t\t header('Location:'.APP_W.'home');\n\t\t }\n\t\t else{\n\t\t // no hi és l'usuari, cal registrar\n\t\t header('Location:'.APP_W.'register');\n\t\t }\n\t\t \t\t}\n\t\t}",
"public function registerAction(Request $request){\n //for the view\n $params = array(\"title\" => _(\"Sign up\"), \"errors\" => array());\n\n $params['username'] = \"\";\n $params['email'] = \"\";\n\n //handle register form\n if ($request->isMethod('post')){\n\n $username = $request->input('username');\n $params['username'] = $username;\n $email = $request->input('email');\n $params['email'] = $email;\n $password = $request->input('password');\n $password_bis = $request->input('password_bis');\n\n //validation\n $validator = new CustomValidator();\n\n $validator->validateUsername($username);\n $validator->validateUniqueUsername($username);\n $validator->validateEmail($email);\n $validator->validateUniqueEmail($email);\n $validator->validatePassword($password);\n $validator->validatePasswordBis($password_bis, $password);\n\n if ($validator->isValid()){\n //hydrate user obj\n $securityHelper = new SH();\n $user = new User();\n \n $user->setNewUuid();\n $user->setUsername( $username );\n $user->setEmail( $email );\n $user->setEmailValidated(false);\n $user->setRole( \"user\" );\n $user->setSalt( SH::randomString() );\n $user->setToken( SH::randomString() );\n $user->setSiteLanguage( 'en' );\n $user->setActive( true );\n\n $hashedPassword = $securityHelper->hashPassword( $password, $user->getSalt() );\n \n $user->setPassword( $hashedPassword );\n// $user->setIpAtRegistration( $_SERVER['REMOTE_ADDR'] );\n $user->setIpAtRegistration($request->ip());\n $user->setDateCreated( time() );\n $user->setDateModified( time() );\n\n //save it\n $userManager = new UserManager();\n $userManager->save($user);\n// @TODO: MAILER\n// send email confirmation message\n// $mailer = new Mailer();\n//\n// $mailerResult = $mailer->sendRegistrationConfirmation($user);\n\n //log user in right now (will redirect home)\n $this->logUser($request, $user);\n// $this->logUser($request, $user);\n $json = new JsonResponse();\n $json->setData(array(\"redirectTo\" => Route('graph')));\n $json->send();\n }\n //not valid\n else {\n $errors = $validator->getErrors();\n $params[\"errors\"] = $errors;\n return response()->json([\n 'error' => $errors\n ],400);\n }\n\n }\n return view('auth.register',['params'=> $params]);\n// $view = new View(\"register.php\", $params);\n// $view->setLayout(\"../View/layouts/modal.php\");\n// $view->send(true);\n }",
"public function registerUser(){\r\n\t\t$name = $_POST['register_name'];\r\n\t\t$email = $_POST['register_email'];\r\n\t\t$password = $_POST['register_password'];\r\n\r\n\t\t$sql = \"INSERT INTO users values (null,?,?,?)\";\r\n\t\t$query = $this->db->prepare($sql);\r\n\t\t$query->execute([$name,$email,$password]);\r\n\t\t//ako je registracija uspela pojavice se div u formu sa ispisom notifikacije!!!\r\n\t\tif ($query) {\r\n\t\t\t$this->register_result=true;\r\n\t\t}\r\n\t}",
"public function register_action() \n\t{\n $rules = array(\n 'username' => 'required',\n 'email' => 'valid_email|required',\n 'password' => 'required',\n 'password2' => 'required',\n 'securityq1' => 'required',\n 'securityq2' => 'required',\n 'securitya1' => 'required',\n 'securitya2' => 'required',\n\n );\n \n // Readible array\n $readible = \n [ \n 'securityq1' => 'Security Queston 1',\n 'securityq2' => 'Security Queston 2',\n 'securitya1' => 'Security Answer 1',\n 'securitya2' => 'Security Answer 2'\n ];\n\n // readible inputs\n FormValidation::set_field_names($readible);\n \n //validate the info\n $validated = FormValidation::is_valid($_POST, $rules);\n \n // Check if validation was successful\n if($validated !== TRUE): \n \n //exit with an error\n exit(Alert::error(false, true, $validated));\n\n endif;\n\n\n UserModel::register();\n }",
"public function registerAction()\n {\n Zend_Registry::set('SubCategory', SubCategory::USERREGISTER);\n \t$form = new User_Form_Register();\n $data = $this->_request->getPost();\n if(!$data){\n // Display empty form\n $this->view->registerForm = $form;\n return;\n }\n\n if (!$form->isValid($data) || $this->_request->getParam('emailFailure')) {\n // Display form with errors\n $this->view->registerForm = $form;\n $this->view->emailFailure = $this->_request->getParam('emailFailure', null);\n return;\n }\n\n // Parameters for email and user creation\n $params = array(\n User::COLUMN_USERNAME => $form->getValue(User::INPUT_USERNAME),\n User::COLUMN_PASSWORD => $form->getValue(User::INPUT_PASSWORD),\n User::COLUMN_EMAIL => $form->getValue(User::INPUT_EMAIL),\n //User::COLUMN_OPENID_IDENTITY => $form->getValue(User::INPUT_OPENID_IDENTITY),\n User::INPUT_AUTH_METHOD => $form->getValue(User::INPUT_AUTH_METHOD),\n );\n\n try{\n // Create user in database\n $user = $this->_createNewUser($params);\n $userId = $user->{User::COLUMN_USERID};\n\n $params['activationKey'] = $user->activationKey;\n $params['link'] = APP_URL.Globals::getRouter()->assemble(array(),'userconfirmation');\n $params['link'] .= '?'.User::COLUMN_USERID.\"=$userId&\".self::ACTIVATION_KEY_PARAMNAME.\"={$user->activationKey}\";\n $params['site'] = APP_NAME;\n } catch (Exception $e){\n \t$msg = \"Error while creating user and/or blog. \".$e->getMessage();\n Globals::getLogger()->registrationError($msg);\n \t$userId = null;\n }\n\n if($userId === null){\n // Redirect to error page in case of user creation failure\n $this->_helper->redirectToRoute('usererror',array('errorCode'=>User::CREATION_FAILURE));\n }\n\n try{\n // Send Email\n $emailStatus = $this->_helper->emailer()->sendEmail($params[User::COLUMN_EMAIL], $params);\n } catch (Exception $e) {\n $emailStatus = false;\n $msg = \"Email error 2 \".$e->getMessage();\n Globals::getLogger()->registrationError($msg);\n }\n\n if(!$emailStatus){\n // If there was en error sending the email, delete user row, and forward to current page\n $this->_cleanupUser($userId);\n $this->_forward('register', null, null, array('emailFailure'=>1));\n return;\n }\n\n // Success !\n $this->_savePendingUserIdentity($userId);\n $this->_helper->redirectToRoute('userpending');\n }",
"public function registerUser($data);",
"public function registerNewUser($fullName,$email,$password);",
"public function doRegister()\n {\n\n //check if all the fields are filled\n if (!Request::checkVars(Request::postData(), array('username', 'password'))) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"Complete all the fields!\", \"type\" => \"error\")));\n exit;\n }\n\n //create the user entity based on filled data\n $userEntity = new User(Request::postData());\n\n //check if the user exists and get it as entity if exists\n if ($this->repository->findUser($userEntity)) {\n echo json_encode(array(\"swal\" => array(\"title\" => \"Oops!\", \"text\" => \"The username/email already exists!\", \"type\" => \"error\")));\n exit;\n }\n\n //add the user into DB\n $this->repository->addUser($userEntity);\n\n echo json_encode(\n array(\n \"swal\" => array(\"title\" => \"Success!\", \"text\" => \"Your account has been created!\", \"type\" => \"success\", \"hideConfirmButton\" => true),\n \"redirect\" => array(\"url\" => BASE_URL . '/index.php?page=home', 'time' => 1)\n )\n );\n }",
"public function register()\n {\n // make sure request is post\n if( ! SCMUtility::requestIsPost())\n {\n View::make('templates/system/error.php',array());\n return;\n }\n\n // get inputs and clean\n $inputs = array();\n foreach($_POST as $k => $v)\n {\n $inputs[$k] = SCMUtility::stripTags($v);\n }\n\n // validate Course info\n $validator = Validator::make($inputs,User::$rules,User::$rulesMessages);\n\n if($validator->fails())\n {\n SCMUtility::setFlashMessage($validator->messages()->first(),'danger');\n View::make('templates/front/account-login-register-form.php',array());\n return;\n }\n\n if( SCMUtility::emailExists($inputs['email']) )\n {\n SCMUtility::setFlashMessage('Email is already used!','danger');\n View::make('templates/front/account-login-register-form.php',array());\n return;\n }\n\n // begin create the new user registration\n $user = new User();\n $user->first_name = $inputs['first_name'];\n $user->middle_name = $inputs['middle_name'];\n $user->last_name = $inputs['last_name'];\n $user->email = $inputs['email'];\n $user->password = $inputs['password'];\n $user->suffix = $inputs['suffix'];\n $user->employers_company_name = $inputs['employers_company_name'];\n $user->home_mailing_address_1 = $inputs['home_mailing_address_1'];\n $user->home_mailing_address_2 = $inputs['home_mailing_address_2'];\n $user->city = $inputs['city'];\n $user->state = $inputs['state'];\n $user->zip_code = $inputs['zip_code'];\n $user->personal_cell_number = $inputs['personal_cell_number'];\n\n if( ! $user->save())\n {\n SCMUtility::setFlashMessage('Failed to store user','danger');\n View::make('templates/front/account-login-register-form.php',array());\n return;\n }\n\n // login the new registered user\n if( ! Session::loginUserByEmail($user->email) )\n {\n SCMUtility::setFlashMessage('Failed to automatically logged in.','danger');\n View::make('templates/front/account-login-register-form.php',array());\n return;\n }\n\n // send sign up thank you email\n $studentMailerService = new StudentMailerService();\n try {\n $studentMailerService->sendSignUpEmailToStudent($user->email,$inputs['password']);\n } catch (\\Exception $e){\n $log = new Log();\n $log->systemLog(\"\\nFailed to notify user/student about its welcome sign up. \\nError: {$e}\");\n }\n\n // notify admin for the new user registration\n $adminMailerService = new AdminMailerService();\n try {\n $adminMailerService->notifyForNewUserRegistration(\n $user->first_name.' '.$user->middle_name.' '.$user->last_name,\n $user->email\n );\n } catch (\\Exception $e) {\n $log = new Log();\n $log->systemLog(\"\\nFailed to notify admin about the new user registration. \\nError: {$e}\");\n }\n\n\n SCMUtility::frontRedirectTo('?page=scmCourseModule&state=Front&action=myAccount');\n }",
"public function register()\n {\n if ($this->getIsNewRecord() == false) {\n throw new \\RuntimeException('Calling \"' . __CLASS__ . '::' . __METHOD__ . '\" on existing user');\n }\n\n if ($this->module->enableConfirmation == false) {\n $this->confirmed_at = time();\n }\n\n if ($this->module->enableGeneratingPassword) {\n $this->password = Password::generate(8);\n }\n\n $this->trigger(self::USER_REGISTER_INIT);\n\n if ($this->save(false)) {\n Yii::getLogger()->log($this->getErrors(), Logger::LEVEL_INFO);\n $this->trigger(self::USER_REGISTER_DONE);\n if ($this->module->enableConfirmation) {\n $token = \\Yii::createObject([\n 'class' => \\dektrium\\user\\models\\Token::className(),\n 'type' => \\dektrium\\user\\models\\Token::TYPE_CONFIRMATION,\n ]);\n $token->link('user', $this);\n $this->mailer->sendConfirmationMessage($this, $token);\n } else {\n \\Yii::$app->user->login($this);\n }\n if ($this->module->enableGeneratingPassword) {\n $this->mailer->sendWelcomeMessage($this);\n }\n \\Yii::$app->session->setFlash('info', $this->getFlashMessage());\n \\Yii::getLogger()->log('User has been registered', Logger::LEVEL_INFO);\n return true;\n }\n\n \\Yii::getLogger()->log('An error occurred while registering user account', Logger::LEVEL_ERROR);\n\n return false;\n }",
"public function registerUser() {\n\t\t\t\t//check for email id existence\n\t\t\t\t$userExistence = $this->checkUserExistence();\n\t\t\t\tif(!$userExistence) {\n\t\t\t\t\t$this->response['status'] = 0;\n\t\t\t\t\t$this->response['message'] = 'Email id already exists. Please try different email id!';\n\t\t\t\t\treturn false;\t\t\t\t\t\n\t\t\t\t}\n\n\t\t\t\t$sql = \"insert into register(name, email, password, orig_password, address, mobile, landline, logo, photo, licence_aggrement,token, create_time) \";\n\t\t\t\t$sql .= \" values('$this->name', '$this->email', '$this->crypPwd', '$this->password', '$this->addr', '$this->mobile', '$this->landline', '$this->logoPath', '$this->photoPath', $this->licence, '$this->token', NOW())\";\n\t\t\t\t\n\t\t\t\t//store it in db now\n\t\t\t\t$result = returnQueryResult($sql);\n\t\t\t\tif($result == false) {\n\t\t\t\t\t$this->response['status'] = 0;\n\t\t\t\t\t$this->response['message'] = 'Sorry! Something went wrong. Try Again';\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t//create user directory\n\t\t\t\t$dir = \"../registered_users/$this->email\";\n\t\t\t\tmkdir($dir, 0777, true);\n\t\t\t\tchmod($dir, 0777);\n\n\t\t\t\t//now move files to user directory\n\t\t\t\tmove_uploaded_file($this->logo['tmp_name'], $this->logoPath); //logo\n\t\t\t\tmove_uploaded_file($this->yourPhoto['tmp_name'], $this->photoPath); //your photo\n\n\t\t\t\t//now send confirmation mail to user\n\t\t\t\t$this->sendConfirmationMail();\n\t\t\t}",
"public function registerUser()\n {\t\n\t\t/**\n\t\t * Our UserModel will return an error \n\t\t * if the email already exists, \n\t\t * or if the passwords do not match\n\t\t */\n\t\ttry{\n\t\t$user = new UserModel();\n\t\t$user->name = Input::get('name');\n\t\t$user->email = Input::get('email');\n\t\t$user->password = Input::get('password');\n\t\t$user->password_confirmation = Input::get('password_confirmation');\n\t\t$user->save();\t\n\t\t$this->setToken($user);\n\t\treturn $this->sendResponse('You have been registered and are logged in');\n\t\t}\n\t\tcatch(Exeption $e){\n\t\t\treturn $this->sendResponse(false, $e->getMessage());\n\n\t\t}\n }",
"public function create() {\n $username = Input::get('reg_username');\n $email = Input::get('email');\n $password = Input::get('reg_password');\n $confirm_password = Input::get('confirm_password');\n\n // Make sure that both passwords are identical\n if (strcmp($password, $confirm_password) == 0) {\n $hashed_password = Hash::make($password);\n try {\n $user = new User;\n $user -> username = $username;\n $user -> email = $email;\n $user -> password = $hashed_password;\n $user -> save();\n } catch (\\Illuminate\\Database\\QueryException $e) {\n return Redirect::route('register') -> with(array(\n 'alert-message' => 'Error: Failed to register user in database.',\n 'alert-class' => 'alert-danger'\n ));\n }\n\n // Login the new user automatically\n $user = User::where('username', '=', $username) -> first();\n Auth::login($user);\n\n return Redirect::route('home') -> with(array(\n 'alert-message' => 'Welcome! You have successfully created an account, and have been logged in.',\n 'alert-class' => 'alert-success'\n ));\n }\n\n return Redirect::route('register') -> with(array(\n 'alert-message' => 'The attempt to create an account was unsuccessful!',\n 'alert-class' => 'alert-danger'\n ));\n }",
"public function create()\n {\n $page_title = trans(\"auth/front_register.registro\");\n\n //return view('modules.auth.front_register', compact('page_title'));\n $user = new User;\n $user_profiles = new UserProfile();\n $user->setRelation('user_profile', $user_profiles);\n\n $form_data = array(\n 'route' => array('register'),\n 'method' => 'POST',\n 'id' => 'formData',\n 'class' => 'form-horizontal'\n );\n\n return view(\n \"modules.auth.front_register\",\n compact(\n 'page_title',\n 'user',\n 'form_data'\n )\n );\n }",
"public function postCreate() {\n \t$validator = Validator::make(Input::all(), User::$rules);\n\n \t// i made a user with [email protected], goodbye\n \tif ($validator->passes()) {\n \t\t// validation has passed, save user in DB\n \t\t$user = new User;\n \t\t$user->first_name = Input::get('first_name');\n \t\t$user->last_name = Input::get('last_name');\n \t\t$user->email = Input::get('email');\n \t\t$user->password = Hash::make(Input::get('password'));\n \t\t$user->save();\n\n \t\treturn Redirect::to('users/login')->with('message', '<div class=\"alert alert-success\" role=\"alert\">Thanks for registering!</div>');\n \t}\n \telse {\n \t\t// validation has failed, display error messages\n \t\treturn Redirect::to('users/register')->with('message', '<div class=\"alert alert-warning\" role=\"alert\">The following errors occurred</div>')->withErrors($validator)->withInput();\n \t}\n }",
"public function registerUser()\n {\n $sql = \"INSERT INTO user (username, password, email, firstname, lastname, address, date_of_birth, id_role)\n VALUES (\\\"\" . $this->getUsername().\"\\\", \\\"\" . $this->getPassword().\"\\\", \\\"\" . $this->getEmail().\"\\\",\\\"\" . $this->getFirstname().\"\\\", \\\"\" . $this->getLastname().\"\\\", \\\"\" . $this->getAddress().\"\\\", \\\"\" . $this->getDateOfBirth().\"\\\", \\\"\" . $this->getIdRole().\"\\\")\";\n $result = mysqli_query($this->_connection, $sql);\n if (!$result) {\n print \"Error: \" . $result . \"<br>\" . mysqli_error($this->_connection);\n } else {\n print \"erfolg\";\n\n }\n }",
"public function registerAction()\n {\n\n\n $form = new Application_Form_User();\n if($this->_request->isPost() && $form->isValid($_POST))\n {\n //code to process the form\n $model = new Application_Model_Users();\n $formValues = $this->_request->getParams();\n $token = $model->getActivationToken();\n // echo $token;\n // die();\n // $nameWS = str_replace(' ', '', trim($formValues['name']->getName()));\n\n $id = $model->create($formValues['name'],\n $formValues['username'],\n \n $formValues['email'],\n $formValues['password'],\n $formValues['age'],\n // $formValues['password'],\n $token);\n if(isset($id))\n {\n $mail = new Application_Model_Mail();\n $mail->sendActivationEmail($formValues['username'], $formValues['email'], $token);\n $this->_redirect('users/register-success');\n }\n else\n {\n throw new Zend_Exception('Registration Error');\n }\n }\n else\n {\n $this->view->form=$form;\n $this->render('register'); \n }\n\n\n }",
"public function create()\n\t{\n\t\tif (!isset($_POST) || empty($_POST))\n\t\t{\n\t\t\theader(\"Location: /myrecipe/users/registry\");\n\t\t\texit;\n\t\t}\n\t\t// TODO need to validate data\n\t\t$data = array('username' => $_POST['username'], 'password' => $_POST['password'], 'cpassword' => $_POST['cpassword'], 'email' => $_POST['email']);\n\t\t// validate the input data\n\t\t$errorArray = User::validates($data);\n\t\tif (count($errorArray))\n\t\t{\n\t\t\t// store errors in session and redirect\n\t\t\t$_SESSION['user'] = $data;\n\t\t\t$_SESSION['user']['errors'] = $errorArray;\n\t\t\theader(\"Location: /myrecipe/users/registry\");\n\t\t\texit;\n\t\t}\n\t\t// create a new user, assume all new users are not staff\n\t\t$values = array('username'=>$_POST['username'],'password'=>$_POST['password'],'email'=>$_POST['email'],'user_type'=>'1');\n\t\t$id = User::createUser($values);\n\t\t// log the user in\n\t\t$_SESSION['user']['id'] = $id;\n\t\t$_SESSION['user']['name'] = $_POST['username'];\n\t\t$_SESSION['user']['type'] = '1';\n\t\techo \"id = \" . $id;\n\t\theader(\"Location: /myrecipe/users/\" . $id);\n\t\texit;\n\t}",
"public function createAction()\r\n {\r\n $user = new User($_POST);\r\n\r\n if ($user->save()) {\r\n\t\t\t\r\n\t\t\tsession_regenerate_id(true);\r\n\r\n\t\t\t$_SESSION['user_id'] = User::getIdSavedUser($_POST['email']);\r\n\t\t\t\r\n\t\t\tIncome::saveDefaultIncomes($_SESSION['user_id']);\r\n\t\t\tExpense::saveDefaultExpenses($_SESSION['user_id']);\r\n\t\t\tPaymentMethod::saveDefaultPaymentMethods($_SESSION['user_id']);\r\n\t\t\t\r\n\t\t\t$user->sendActivationEmail();\r\n\r\n $this->redirect('/signup/success');\r\n\r\n } else {\r\n\r\n View::renderTemplate('Signup/new.html', [\r\n 'user' => $user\r\n ]);\r\n\r\n }\r\n }",
"function reg() {\n\t\t//~ screening input data\n\t\t$tmp_arr=mysql::screening_array($_POST);\n\t\t$login=$tmp_arr['login'];\n\t\t$passwd=$tmp_arr['passwd'];\n\t\t$passwd2=$tmp_arr['passwd2'];\n\t\t$mail=$tmp_arr['mail'];\n\n\t\t//~ Check valid user data\n\t\tif ($this->check_new_user($login, $passwd, $passwd2, $mail)) {\n\t\t\t//~ User data is correct. Register.\n\t\t\t$user_key = $this->generateCode(10);\n\t\t\t$passwd = md5($user_key.$passwd.SECRET_KEY); //~ password hash with the private key and user key\n\t\t\t$query=mysql::query(\"INSERT INTO `users` (`id_user`, `login_user`, `passwd_user`, `mail_user`, `key_user`,`img`) VALUES (NULL, '\".$login.\"', '\".$passwd.\"', '\".$mail.\"', '\".$user_key.\"','/feditor/attached/image/20150313/20150313102144_79301.jpg');\");\n\t\t\tif ($query) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\tself::$error='Произошла ошибка при регистрации нового пользователя. Связаться с администрацией.';\n\t\t\t\treturn false;\n\t\t\t}\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"function registerUser()\n {\n $DBA = new DatabaseInterface();\n $fields = array(0 => 'title', 1 => 'first_name', 2 => 'last_name', 3 => 'contacttelephone', 4 => 'contactemail', 5 => 'password', 6 => 'username', 7 => 'dob', 8 => 'house', 9 => 'street', 10 => 'town', 11 => 'county', 12 => 'pcode', 13 => 'optout', 14 => 'newsletter', 15 => 'auth_level');\n $fieldvals = array(0 => $this->Title, 1 => $this->FirstName, 2 => $this->LastName, 3 => $this->ContactTelephone, 4 => $this->ContactEmail, 5 => $this->Password, 6 => $this->Username, 7 => $this->DOB, 8 => $this->House, 9 => $this->Street, 10 => $this->Town, 11 => $this->County, 12 => $this->PCode, 13 => $this->Optout, 14 => $this->NewsletterSubscriber, 15 => $this->AuthLevel);\n $rs = $DBA->insertQuery(DBUSERTABLE, $fields, $fieldvals);\n if ($rs == 1)\n {\n $this->RegistrationSuccess = 1;\n }\n if (isset($this->PCode))\n {\n $this->geoLocate();\n }\n unset($DBA, $rs, $fields, $fieldvals);\n $DBA = new DatabaseInterface();\n $fields = array(0 => 'id');\n $idfields = array(0 => 'username');\n $idvals = array(0 => $this->Username);\n $rs = $DBA->selectQuery(DBUSERTABLE, $fields, $idfields, $idvals);\n if (!isset($rs[2]))\n {\n while ($res = mysql_fetch_array($rs[0]))\n {\n $this->setUserVar('ID', $res['id']);\n }\n }\n unset($DBA, $rs, $fields, $idfields, $idvals);\n }",
"public function registerAction() {\n\t\t$this->setLayout('login');\n\t\t// If registrations are disabled, redirect to home\n\t\tif (!isset($this->config->registration_enabled) || $this->config->registration_enabled == false) {\n\t\t\t$this->redirect('/');\n\t\t}\n\n\t\t$form = new Website_Form_Register();\n\n\t\tif($this->getRequest()->isPost()) {\n\t\t\tif($form->isValid($this->getRequest()->getParams())) {\n\t\t\t\t$allOk = true;\n\t\t\t\t$testUser = User::getByName($this->getParam('username'));\n\t\t\t\tif ($testUser) {\n\t\t\t\t\t$allOk = false;\n\t\t\t\t\t$el = $form->getElement('username');\n\t\t\t\t\t$el->addError('Username already taken');\n\t\t\t\t}\n\n\t\t\t\tif ($this->getParam('pw') != $this->getParam('pw2')) {\n\t\t\t\t\t$allOk = false;\n\t\t\t\t\t$el = $form->getElement('pw2');\n\t\t\t\t\t$el->addError('Passwords do not match');\n\t\t\t\t}\n\n\t\t\t\tif ($allOk) {\n\t\t\t\t\t$user = User::create(array(\n\t\t\t\t\t\t\"parentId\" => 3,\n\t\t\t\t\t\t\"name\" => $this->getParam(\"username\"),\n\t\t\t\t\t\t\"password\" => Pimcore_Tool_Authentication::getPasswordHash($this->getParam(\"username\"), $this->getParam(\"pw\")),\n\t\t\t\t\t\t\"active\" => true,\n\t\t\t\t\t\t\"email\"=>$this->getParam('email'),\n\t\t\t\t\t\t'firstname'=>$this->getParam('firstname'),\n\t\t\t\t\t\t'lastname'=>$this->getParam('lastname')\n\t\t\t\t\t));\n\n // Create member\n $memberObject = new Website_Model_Members();\n $memberObject->setUserId($user->getId());\n $memberObject->save();\n\n // Login\n\t\t\t\t\t$securityService = Security_Service_Common::getInstance();\n $securityService->authenticate($form->getValues());\n\n\t\t\t\t\t$params = array(\n\t\t\t\t\t\t'name'=>$this->view->username($user),\n\t\t\t\t\t\t'url'=>$this->getAbsoluteUrl() . '/user/login',\n\t\t\t\t\t\t'username'=>$user->getName()\n\t\t\t\t\t);\n\t\t\t\t\t//sending the email\n\t\t\t\t\t$mail = new Pimcore_Mail();\n\t\t\t\t\t$mail->addTo($user->getEmail());\n\t\t\t\t\t$mail->setDocument('/_onderdelen/user_register');\n\t\t\t\t\t$mail->setParams($params);\n\t\t\t\t\t$mail->send();\n\n $this->addFlashMessage($this->view->translate('Your account was successfully created. Have fun!'));\n\t\t\t\t\t$this->redirect(\"/user\");\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\t$this->view->form = $form;\n\t}",
"public function registerAction() {\n $user = new User();\n // Create new User Form.\n $form = $this->formFactory->create(UserType::class, $user);\n // Handle Request.\n $form->handleRequest($this->request);\n\n // Check if the information is valid, when form is submitted.\n if ($form->isSubmitted() && $form->isValid()) {\n $plainPassword = $form->get('password')->getData();\n $encoder = $this->container->get('security.password_encoder');\n $encoded = $encoder->encodePassword($user, $plainPassword);\n\n // Set encoded password.\n $user->setPassword($encoded);\n\n // Tell the database to watch for this object.\n $this->em->persist($user);\n\n // Insert object into database. (Create user row)\n $this->em->flush();\n\n\n return new RedirectResponse($this->router->generate('register_success', array(\n )));\n }\n\n return new Response($this->templating->render('security/register.html.twig', [\n 'form' => $form->createView()\n ]));\n }",
"public function doRegister(){\n\t\t\t$requestUser = $this->registerView->getRequestUserName();\n\t\t\t$requestPassword = $this->registerView->getRequestPassword();\n\t\t\t$requestRePassword = $this->registerView->getRequestRePassword();\n\t\t\t\n\t\t\tif($this->registerView->didUserPressRegister() ){\n\t\t\t\ttry{\n\t\t\t\tif($this->checkUsername($requestUser) && $this->checkPassword($requestPassword,$requestRePassword)){\n\t\t\t\t\t//create and add new user\n\t\t\t\t\t$newUser = new User($requestUser,$requestPassword);\n\t\t\t\t\t$this->userList->add($newUser);\n\t\t\t\t\t\n\t\t\t\t\t$this->model->toggleJustRegistered();\n\t\t\t\t\t$this->model->setSessionUsername($requestUser);\n\t\t\t\t\t$this->navView->clearURL();\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t}\n\t\t\t\t} \n\t\t\t\tcatch (UserFewCharException $ufce){\n\t\t\t\t\t$this->registerView->setErrorUsernameFewChar();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t} \n\t\t\t\tcatch (UserBadCharException $udce){\n\t\t\t\t\t$this->registerView->setErrorUsernameInvalidChar();\n\t\t\t\t\t$this->registerView->setUsernameField(strip_tags($requestUser));\n\t\t\t\t} \n\t\t\t\tcatch (UserExistsException $uee){\n\t\t\t\t\t$this->registerView->setErrorUsernameExists();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t} \n\t\t\t\tcatch (PasswordLenException $ple){\n\t\t\t\t\t$this->registerView->setErrorPasswordFewChar();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t} \n\t\t\t\tcatch (PasswordMissmatchException $pme){\n\t\t\t\t\t$this->registerView->setErrorPasswordMatch();\n\t\t\t\t\t$this->registerView->setUsernameField($requestUser);\n\t\t\t\t}\n\t\t\t\tif(empty($requestUser) && empty($requestPassword) && empty($requestRePassword))\n\t\t\t\t\t$this->registerView->setErrorMissingFields();\t\t\n\t\t\t}\n\t\t}",
"public function addNewUser() {\n redirect('auth/register');\n }",
"public function register()\n {\n $user = new UserManager;\n $request = new Request;\n $errorMessage = '';\n $method = $request->getMethode();\n if ($method == \"POST\") {\n $mailUser = $request->getPost('mail');\n $password = $request->getPost('mdp');\n $checkPassword = $request->getPost('cmdp');\n $userName = $request->getPost('userName');\n $userData = array();\n $userData['mail'] = $mailUser;\n $userData['pass'] = $password;\n $userData['userName'] = $userName;\n $userData['role'] = 'user';\n $mailUsed = $user->checkMail($mailUser);\n $userNameUsed = $user->checkUserName($userName);\n\n //if true register user on session \n if (!$mailUsed) {\n if (!$userNameUsed) {\n if ($password == $checkPassword) {\n if (filter_var($mailUser, FILTER_VALIDATE_EMAIL)) {\n $errorMessage = 'Vous êtes connecté avec succés ';\n $request->newSession(\"user\", $userData);\n $hashPassword = hash(\"sha256\", $password);\n $user->newUser($userName, $mailUser, $hashPassword);\n } else {\n $errorMessage = 'Le format de l\\'email est incorrect ';\n }\n } else {\n $errorMessage = 'Les mots de passe ne sont pas identique ';\n }\n } else {\n $errorMessage = 'Le nom d\\'utilisateur entré n\\'est pas disponible ';\n }\n } else {\n $errorMessage = 'Cette email est déja utilisé';\n }\n return $this->render('user/register.html.twig', ['errorMessage' => $errorMessage]);\n }\n return $this->render('user/register.html.twig', ['errorMessage' => $errorMessage]);\n }",
"public function new_user_registration($user_reg_data) {\r\n $this->db->insert('users', $user_reg_data);\r\n return TRUE;\r\n }",
"public function register_post()\n {\n $data = $this->validate(request(), [\n 'name' => 'required',\n 'email' => 'required|email',\n 'password' => 'required',\n ]);\n\n $data['password'] = bcrypt(request('password'));\n User::create($data);\n\n if (Auth::attempt(['email' => request('email'), 'password' => request('password')])) {\n\n return redirect('/');\n\n }\n }",
"public function postRegister()\n\t{\n\t\t$user = new \\User;\n\n\t\t$user->email = \\Input::get( 'email' );\n\t\t$user->password = \\Input::get( 'password' );\n\n\t\t// The password confirmation will be removed from model\n\t\t// before saving. This field will be used in Ardent's\n\t\t// auto validation.\n\t\t$user->password_confirmation = \\Input::get( 'password_confirmation' );\n\n\t\t// Save if valid. Password field will be hashed before save\n\t\t$user->save();\n\n\t\tif ( $user->id )\n\t\t{\n\t\t\t//Assign the company role to this person\n\t\t\t$roleId = \\Role::where('name', '=', 'Company')->first()->id;\n\t\t\t$user->attachRole($roleId);\n\n\t\t\t// Redirect with success message, You may replace \"Lang::get(...\" for your custom message.\n\t\t\treturn \\Redirect::action('controllers\\company\\AuthController@getLogin')\n\t\t\t\t->with( 'notice', \\Lang::get('confide::confide.alerts.account_created') );\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Get validation errors (see Ardent package)\n\t\t\t$error = $user->errors()->all(':message');\n\n\t\t\treturn \\Redirect::action('controllers\\company\\AuthController@getRegister')\n\t\t\t\t->withInput(\\Input::except('password'))\n\t\t\t\t->with( 'error', $error );\n\n\t\t}\n\n\t}",
"function register()\n\t\t{\n\t\t\tif ($this->input->post('create_user'))\n\t\t\t{\n\t\t\t\tif ($this->data['user'])\n\t\t\t\t{\n\t\t\t\t\tif ($this->ion_auth->in_group('public'))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->session->set_flashdata('alert', array(\n\t\t\t\t\t\t\t'type' => 'danger',\n\t\t\t\t\t\t\t'message' => 'You are already registered.'\n\t\t\t\t\t\t));\n\n\t\t\t\t\t\t// redirect them back to this page.\n\t\t\t\t\t\tredirect(current_url(), 'refresh');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\t$tables = $this->config->item('tables','ion_auth');\n\t\t\t\t$identity_column = $this->config->item('identity','ion_auth');\n\t\t\t\t$this->data['identity_column'] = $identity_column;\n\n\t\t\t\t// validate form input\n\t\t\t\t$this->form_validation->set_rules('username', 'above', 'required|is_unique['.$tables['users'].'.'.$identity_column.']');\n\t\t\t\t$this->form_validation->set_rules('password_confirm', 'above', 'required');\n\t\t\t\t$this->form_validation->set_rules('password', 'above', 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[password_confirm]');\n\t\t\t\t$this->form_validation->set_rules('email', 'above', 'required|valid_email');\n\t\t\t\t$this->form_validation->set_rules('address', 'above', 'required');\n\t\t\t\t$this->form_validation->set_rules('phone', 'above', 'required|trim');\n\n\t\t\t\t// Add data for different user groups.\n\t\t\t\t$this->form_validation->set_rules('first_name', 'above', 'required');\n\t\t\t\t$this->form_validation->set_rules('last_name', 'above', 'required');\n\n\t\t\t\tif ($this->form_validation->run() == true)\n\t\t\t\t{\n\t\t\t\t\t$email = strtolower($this->input->post('email'));\n\t\t\t\t\t$identity = $this->input->post('username');\n\t\t\t\t\t$password = $this->input->post('password');\n\n\t\t\t\t\t$profile = array(\n\t\t\t\t\t\t'first_name' => $this->input->post('first_name'),\n\t\t\t\t\t\t'last_name' => $this->input->post('last_name'),\n\t\t\t\t\t\t'address' => $this->input->post('address'),\n\t\t\t\t\t\t'phone' => $this->input->post('phone'),\n\t\t\t\t\t);\n\n\t\t\t\t\t$group = array('2'); // Sets user to public.\n\n\t\t\t\t\tif ($_FILES['userfile']['size'] > 0)\n\t\t\t\t\t{\n\t\t\t\t\t\t$avatar = $this->upload_image();\n\t\t\t\t\t\tif ( ! $avatar['error'])\n\t\t\t\t\t\t\t$profile['avatar'] = $avatar['path'];\n\t\t\t\t\t}\n\n\t\t\t\t\t$user_id = $this->ion_auth->register($identity, $password, $email, $profile, $group);\n\n\t\t\t\t\t$this->load->library('flexi_cart_admin');\n\n\t\t\t\t\tif ($user_id)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Define profile information.\n\t\t\t\t\t\t// $this->users_model->add($profile);\n\n\t\t\t\t\t\t$this->flexi_cart_admin->set_status_message('Account was successfully created', 'public', TRUE);\n\t\t\t\t\t\t$this->session->set_flashdata('message', $this->flexi_cart_admin->get_messages('public'));\n\n\t\t\t\t\t\t// redirect them back to the login page\n\t\t\t\t\t\tredirect(\"login\", 'refresh');\n\t\t\t\t\t}\n\t\t\t\t\telse\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->flexi_cart_admin->set_error_message(($this->ion_auth->errors() ? $this->ion_auth->errors() : 'Account could not be created'), 'public', TRUE);\n\t\t\t\t\t\t$this->session->set_flashdata('message', $this->flexi_cart_admin->get_messages('public'));\n\n\t\t\t\t\t\t// redirect them back to the login page\n\t\t\t\t\t\tredirect(\"register\", 'refresh');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Get any status message that may have been set.\n\t\t\t$this->data['message'] = $this->session->flashdata('message');\n\n\t\t\t// display the create user form\n\t\t\t$this->load->view('public/auth/register_user', $this->data);\n\t\t}",
"public function register(){\n // 2- check post submitted\n $post = filter_input_array(INPUT_POST, FILTER_SANITIZE_STRING);\n\n if ($post['submit']){\n\n if ($post['name']=== \"\" || $post['email']=== \"\" ||\n $post['password']=== \"\" || $post['confirm_password']=== \"\" ){\n\n Messages::setMessage('Please Fill All Fields!', 'error');\n return;\n }\n\n // prepare query\n $this->query('INSERT INTO users (name, email, password) VALUES(:name, :email, :password)');\n\n // bind params\n $this->bind(':name',$post['name']);\n $this->bind(':email',$post['email']);\n $this->bind(':password',md5($post['password']));\n\n\n // execute\n $this->execute();\n // check if inserted\n if ($this->lastInsertId()){\n header('Location: '.'users/login');\n }\n\n }\n }",
"public function register() {\n\n // If it is not a valid password\n if (!$this->valid_password()) {\n return \"Invalid Password. It must be six characters\";\n }\n\n // If the mobile is valid\n if (!$this->valid_mobile()) {\n return \"Mobile Number is Invalid. It must be 10 numeric digits\";\n }\n\n // If there is a user with that username\n if (User::find($this->username, 'username') !== null) {\n return \"Username already taken\";\n }\n\n // Now we create the user on the database\n if ($this->create_record()) {\n echo \"<br><br>Record Created\";\n // We update the sync the object with the database\n if ($this->update_object('username')) {\n return true;\n echo \"<br><br>Object Updated\";\n }\n }\n\n return \"Sorry, an error has ocurred. Try again later\";\n }",
"public function createUserAction() {\n $this->authService->createUser();\n die();\n }",
"public function register_user() {\n $this -> load -> library('form_validation');\n $this -> load -> helper('send_email');\n\n $this -> form_validation -> set_error_delimiters('<p>', '</p>');\n $this -> form_validation -> set_rules('user_firstname', 'nombre', \"required|trim\");\n $this -> form_validation -> set_rules('user_lastname', 'apellido', \"required|trim\");\n $this -> form_validation -> set_rules('user_email', 'email', \"required|trim|valid_email\");\n $this -> form_validation -> set_rules('user_email2', 'confirmar email', \"required|trim|valid_email|matches[user_email]\");\n $this -> form_validation -> set_rules('user_password', 'contraseña', (!$this -> input -> post('user_id') ? 'required|' : '') . \"trim|min_length[4]\");\n\n $query = $this -> basic -> get_where('users', array('user_email' => $this -> input -> post('user_email')));\n\n if ($query -> num_rows() > 0) {\n $response['html'] = 'El email ya existe';\n $response['error'] = '1';\n echo json_encode($response);\n return false;\n }\n\n if ($this -> form_validation -> run() == TRUE) {\n if (trim($this -> input -> post('user_password')) == '')\n unset($_POST['user_password']);\n unset($_POST['user_password2']);\n unset($_POST['user_email2']);\n if (!$this -> input -> post('user_id'))\n $_POST['user_created'] = date('Y-m-d G:i:s');\n $data = $this -> basic -> save('users', 'user_id', $this -> input -> post());\n\n $msg = \"<h2>Bienvendio xxx\t\" . $this -> input -> post('user_firstname') . \"!</h2>\";\n $msg .= \"Gracias por registrarte en <br/><br/>\";\n $msg .= \"Recuerda tu clave de acceso para que puedas siempre entrar y ver tu perfil, en el que podrás hacer seguimiento a tus compras y envios. <br/><br/>\";\n $msg .= \"Un saludo, <br/><br/>\";\n $msg .= \"El equipo de xxx <br/><br/>\";\n\n $contact_send = array('to' => $this -> input -> post('user_email'), 'subject' => 'Bienvendio - Courrier Box', 'message' => $msg);\n\n $html = 'Se ha guardado el usuario exitosamente';\n\n send_email($contact_send, $html);\n\n } else {\n $response['html'] = validation_errors();\n $response['error'] = '1';\n echo json_encode($response);\n }\n }",
"public function createUser()\r\n {\r\n // use sign up in AuthController\r\n }",
"public function createUser()\r\n {\r\n // use sign up in AuthController\r\n }",
"public function register_user()\n {\n if (isset($_POST['btnRegister'])) {\n $username = $_POST['username_reg'];\n $password = $_POST['password'];\n $role = 2;\n\n //check Username ton tai hay khong ton tai\n $checkUsername = $this->UserModel->checkUsername($username);\n if ($checkUsername == 'true') {\n header(\"Location:../Register\");\n } else {\n // 2.INSERT DATA EQUAL USERS\n $rs = $this->UserModel->InserNewUser($username,$password,$role);\n // 3.SHOW OK/FAILS ON SCREENS\n header(\"Location:../Login\");\n }\n }\n }",
"public function register()\n {\n $create_from = $this->request->get_body_params();\n\n $input = (object) array_intersect_key( $create_from,\n array_fill_keys(['username', 'password', 'email'], false)\n );\n\n $update = [\n 'first_name',\n 'last_name',\n ];\n\n /** @var \\WP_Error|integer $user */\n $user_id = \\wp_create_user($input->username, $input->password, $input->email);\n\n if (\\is_wp_error($user_id)) {\n throw new UnauthorizedException($user_id->get_error_message());\n }\n\n /** @var \\WP_User $user */\n $user = \\get_userdata($user_id);\n\n foreach ($update as $att) {\n $user->$att = $create_from[$att];\n }\n\n \\wp_update_user($user);\n\n return $this->response->ok([\n 'message' => sprintf(__('Hello %s', PMLD_TD), $user->nickname),\n 'user' => User::make($user),\n ]);\n\n }",
"function register_new_user()\n{\n // alidate the data submited by our user\n $result = _validation([\n 'name' => 'required|string|max:255',\n 'email' => 'required|string|email|unique:users',\n 'password' => 'required|string|equals:password_confirmation'\n ]);\n\n // Get the validated data.\n $validated = $result['validated'];\n\n // _dump(bcrypt_hasher_make($validated['password']), true);\n\n // Create the user\n $user = create_new_user(\n $validated['name'],\n $validated['email'],\n bcrypt_hasher_make($validated['password']) // Always hash your users password\n );\n\n // Redirect back if the user was not created.\n _redirect_back_if($user === false, ['errors' => [\n 'Unable to register user at the moment.'\n ]]);\n\n // log the user in\n login_user($user);\n}",
"public function createUser()\n {\n }",
"public function postRegister()\n\t{\n\t\t$user = $this->userService->create(Input::all());\n\n\t\tif (!$user)\n\t\t{\n\t\t\treturn Redirect::back()->withErrors($this->userService->errors())->withInput();\n\t\t}\n\n\t\tAlert::success('You have successfully registered yourself!')->flash();\n\n\t\t// set flag for login page\n\t\tSession::flash('just_registered', '1');\n\n\t\treturn Redirect::route('auth-login');\n\t}",
"public function register() {\n\n define('KDEBUG_JSON', true);\n\n $errors = array();\n $success = true;\n\n $slug = user::generateUniqueUsername($_REQUEST['username']);\n if (!isset($_REQUEST['username']) || empty($_REQUEST['username']) || $_REQUEST['username'] == 'Full name') {\n $errors['register_username'] = 'You must specify your Full Name';\n $success = false;\n } elseif (user::findOne(array('slug' => $slug))) {\n $errors['register_username'] = 'This username already exists';\n $success = false;\n }\n\n if (!isset($_REQUEST['email']) || empty($_REQUEST['email']) || $_REQUEST['email'] == 'email address') {\n $errors['register_email'] = 'You must specify an e-mail address';\n $success = false;\n } elseif (!filter_var($_REQUEST['email'], FILTER_VALIDATE_EMAIL)) {\n $errors['register_email'] = 'Invalid e-mail address';\n $success = false;\n } elseif (user::findOne(array('email' => $_REQUEST['email'])) != null) {\n $errors['register_email'] = 'This e-mail address already exists';\n $success = false;\n }\n\n\n if (!isset($_REQUEST['password']) || empty($_REQUEST['password']) || $_REQUEST['password'] == 'password') {\n $errors['register_password'] = 'You must specify a password';\n $success = false;\n } elseif (user::verify('password', $_REQUEST['password']) !== true) {\n $errors['register_password'] = user::verify('password', $_REQUEST['password']);\n $success = false;\n }\n\n if ($_REQUEST['password'] != $_REQUEST['verify']) {\n $errors['register_verify'] = 'Your passwords do not match';\n $success = false;\n }\n\n if ($success) {\n\n // create our new user\n $user = new user();\n $user->email = $_REQUEST['email'];\n $user->username = $_REQUEST['username'];\n $user->slug = $slug;\n\n $user->public = 1;\n $user->created = time();\n $user->updated = time();\n $user->password = crypt($_REQUEST['password']);\n $user->save();\n $user->login();\n\n }\n\n echo json_encode(array('success' => $success, 'errors' => $errors));\n return true;\n\n }",
"public function createAction()\n {\n var_dump($_POST);\n //exit();\n $user = new User($_POST);\n\n //if($user->save()){\n\n if($user_id=$user->save()){\n\n // Send the activation email\n $user->sendActivationEmail();\n\n // Login the user. Comment out first 2 lines\n /*session_regenerate_id(true);\n $_SESSION['user_id'] = $user_id;*/\n\n //$_SESSION['course_id'] = $user->course_name;\n\n /*$ug = new UserGroup($_SESSION);\n $ug->firstSubscription();*/\n\n // Flash the success message\n /*Flash::addMessage('Account Created Successfully');\n Flash::addMessage('Please check your email to activate your account');*/\n\n// $this->redirect('/payment/new');\n //$this->redirect('/Account/welcome');\n $this->redirect('/register/success');\n\n }else{\n\n foreach($user->errors as $error){\n Flash::addMessage($error,'danger');\n }\n View::renderBlade('register.index2',['arr'=>$_POST]);\n\n }\n\n }",
"function register()\r\n {\r\n if (!empty($this->data))\r\n {\r\n // Turn the supplied password into the correct Hash.\r\n // and move into the ‘password’ field so it will get saved.\r\n $this->data['User']['password'] = $this->Auth->password($this->data['User']['passwrd']);\r\n\r\n $this->User->data = Sanitize::clean($this->data);\r\n\r\n // Successfully created account – send activation email\r\n\r\n if ($this->User->save())\r\n {\r\n $this->__sendActivationEmail($this->User->getLastInsertID());\r\n\r\n // this view is not show / listed – use your imagination and inform\r\n // users that an activation email has been sent out to them.\r\n $this->flashSuccess('The activation eMail has been sent to you. Please click on the link in your eMail to activate your account. Please note that right now there is no possibility to recover a lost password for you.', 'login');\r\n }\r\n // Failed, clear password field\r\n else\r\n {\r\n $this->data['User']['passwrd'] = null;\r\n }\r\n }\r\n $groups = $this->User->Group->find('list');\r\n $this->set(compact('groups'));\r\n }",
"public function registerPost()\n {\n $this->response->getHeaders()->setStatusCode(302);\n\n $regForm = $this->_getRegisterForm();\n $request = $this->getRequest();\n\n $failRedirect = $this->_router->assemble(\n array('controller' => 'user', 'action' => 'register'), \n array('name' => 'default')\n );\n\n if (!$this->getRequest()->isPost() || !$regForm->isValid($request->post()->toArray())) {\n $this->_flashMessenger->addMessage($regForm);\n $this->response->getHeaders()->addHeader('Location', $failRedirect);\n return $this->response;\n }\n $user = self::$di->get('userService')->createFromForm($regForm);\n var_dump($user);\n die('success!');\n }",
"public function testNewUserRegistration()\n\t{\n\t $this->visit('/register')\n\t ->type('Taylor', 'name')\n\t ->type('[email protected]', 'email')\n\t ->type('mytest', 'password')\n\t ->type('mytest', 'password_confirmation')\n\t ->press('Register');\n\t}",
"public function newUser () {\n if (!empty($_POST)) {\n $this->checkSignIn();\n\n if (empty($_SESSION['errors'])) {\n $date = date('Y-m-d');\n $bytes = openssl_random_pseudo_bytes(20);\n $this->registration_token = UtilsClass::generator(10);\n $sql = \"INSERT INTO users (avatar,\n cover,\n birthdate,\n email,\n nickname,\n location,\n password,\n creation_date,\n registration_token,\n activated,\n phone,\n username)\n VALUES (:avatar,\n :cover,\n :birthdate,\n :email,\n :nickname,\n :location,\n :password,\n :creation_date,\n :registration_token,\n 0,\n :phone,\n :username)\";\n $query = $this->bdd->prepare($sql);\n $query->bindParam(':avatar', $this->avatar);\n $query->bindParam(':cover', $this->cover);\n $query->bindParam(':birthdate', $this->birthdate);\n $query->bindParam(':email', $this->email);\n $query->bindParam(':nickname', $this->nickname, PDO::PARAM_STR);\n $query->bindParam(':location', $this->location, PDO::PARAM_STR);\n $query->bindParam(':password', $this->password, PDO::PARAM_STR);\n $query->bindParam(':creation_date', $date);\n $query->bindParam(':registration_token', $this->registration_token, PDO::PARAM_STR);\n $query->bindParam(':phone', $this->phone, PDO::PARAM_STR);\n $query->bindParam(':username', $this->username, PDO::PARAM_STR);\n $query->execute();\n $id = $this->bdd->lastInsertId();\n ThemeClass::create($id);\n\n $message = \"<!DOCTYPE html>\n <html>\n <head>\n <title>Mail confirmation TwittaWac</title>\n </head>\n <body>\n <p>Bonjour, voici le lien d'activation pour votre compte TweetaWac : </p>\n <a href='http://\".$_SERVER['HTTP_HOST'].URL.\"/users/validation.php?token=$this->registration_token&email=\".$this->email.\"'>Activer votre compte</a>\n </body>\n </html>\";\n UtilsClass::sendMail($this->email, $message);\n }\n }\n }",
"function registerUser()\n\t{\n\t\t$userName = $_POST['userName'];\n\n\t\t# Verify that the user doesn't exist in the database\n\t\t$result = verifyUser($userName);\n\n\t\tif ($result['status'] == 'COMPLETE')\n\t\t{\n\t\t\t$email = $_POST['email'];\n\t\t\t$userFirstName = $_POST['userFirstName'];\n\t\t\t$userLastName = $_POST['userLastName'];\n\n\t\t\t$userPassword = encryptPassword();\n\n\t\t\t# Make the insertion of the new user to the Database\n\t\t\t$result = registerNewUser($userFirstName, $userLastName, $userName, $email, $userPassword);\n\n\t\t\t# Verify that the insertion was successful\n\t\t\tif ($result['status'] == 'COMPLETE')\n\t\t\t{\n\t\t\t\t# Starting the session\n\t\t\t\tstartSession($userFirstName, $userLastName, $userName);\n\t\t\t\techo json_encode($result);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t# Something went wrong while inserting the new user\n\t\t\t\tdie(json_encode($result));\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t# Username already exists\n\t\t\tdie(json_encode($result));\n\t\t}\n\t}",
"public function create()\n {\n // TODO: Algún parámetro para no permitir el registro.\n \n // Es ya un usuario?\n if (Core::isUser())\n {\n $this->call('window.location.href = \\'' . Core::getLib('url')->makeUrl('') . '\\';');\n return;\n }\n \n // Tenemos datos?\n if ($this->request->is('email'))\n {\n // Validamos los datos\n $form = Core::getLib('form.validator');\n $form->setRules(Core::getService('account.signup')->getValidation());\n \n // Si no hay errores procedemos a capturar los datos.\n if ($form->validate())\n {\n // Agregamos usuario\n if (Core::getService('account.process')->add($this->request->getRequest()))\n {\n if (Core::getParam('user.verify_email_at_signup'))\n {\n // Vamos a que verifique su email\n Core::getLib('session')->set('email', $this->request->get('email'));\n $this->call('window.location.href = \\'' . Core::getLib('url')->makeUrl('account.verify') . '\\';');\n }\n else\n {\n // Iniciamos sesión\n $this->call('window.location.href = \\'' . Core::getLib('url')->makeUrl('account.login') . '\\';');\n }\n \n return;\n }\n }\n }\n \n $this->call('window.location.href = \\'' . Core::getLib('url')->makeUrl('account.signup') . '\\';');\n }",
"public function register(Request $request){\n\n $user = $this->user->create([\n 'cpf_cnpj' => $request->cpf_cnpj,\n 'nome_razaosocial' => $request->nome_razaosocial,\n 'tipo_pessoa' => $request->tipo_pessoa,\n 'password' => bcrypt($request->password),\n 'senha' => md5($request->password)\n ]);\n \n return response()->json(['status'=>true,'messagem'=>'Usuário criado com successo','data'=>$user],200);\n }",
"public function register()\n\t{\n\t\t// validamos que existan los campos\n\t\t$errors = $this->validate( $_POST, [\n\t\t\t'name|nombre' => 'required',\n\t\t\t'username|usuario' => 'required|unique:users',\n\t\t] );\n\n\t\tif( $errors )\n\t\t{\n\t\t\techo $this->errors();\n\t\t\treturn;\n\t\t}\n\t\t// validamos que sea una peticion por post\n\t\t$this->__post();\n\t\t// validamos si existe o le definimos un valor\n\t\t$_POST['password'] = isset( $_POST['password'] ) ? $_POST['password'] : '';\n\t\t$_POST['nameE'] = isset( $_POST['nameE'] ) ? $_POST['nameE'] : '';\n\t\t// realizamos la peticion al modelo de cerrar sesion\n\t\t$login = $this->auth->register( $_POST['name'], $_POST['username'], $_POST['password'], $_POST['nameE'], $_POST['role'] );\n\t\t// explotamos el resultado\n\t\t$login = explode(\"|\", $login);\n\t\t// validamos si se logueo o no\n\t\tif( $login[0] != 'logueado' )\n\t\t{\n\t\t\t// agregamos a las variables de error la respuesta del servidor\n\t\t\tarray_push($this->errors, $login[0]);\n\t\t\t// agregamos los errores obtenidos desde la peticion hecha al model\n\t\t\techo $this->errors();\n\t\t\treturn;\n\t\t}\n\t\telse{\n\t\t\t// retornamos a la vista de acceso cuando se satisfatorio el logueo\n\t\t\techo \"true|\".$login[1];\n\t\t}\n\t}",
"static private function createNewUserFromPost() {\r\n\t\t$errors = array();\r\n\r\n\t\t$activationHash = (System::isAtLocalhost()) ? '' : self::getRandomHash();\r\n\t\t$newAccountId = DB::getInstance()->insert('account',\r\n\t\t\t\tarray('username', 'name', 'mail', 'password', 'registerdate', 'activation_hash'),\r\n\t\t\t\tarray($_POST['new_username'], $_POST['name'], $_POST['email'], self::passwordToHash($_POST['password']), time(), $activationHash));\r\n\r\n\t\tself::$IS_ON_REGISTER_PROCESS = true;\r\n\t\tself::$NEW_REGISTERED_ID = $newAccountId;\r\n\r\n\t\tif ($newAccountId === false)\r\n\t\t\t$errors[] = __('There went something wrong. Please contact the administrator.');\r\n\t\telse {\r\n\t\t\tself::importEmptyValuesFor($newAccountId);\r\n\t\t\tself::setSpecialConfigValuesFor($newAccountId);\r\n\r\n\t\t\tif ($activationHash != '')\r\n\t\t\t\tself::setAndSendActivationKeyFor($newAccountId, $errors);\r\n\t\t}\r\n\r\n\t\tself::$IS_ON_REGISTER_PROCESS = false;\r\n\t\tself::$NEW_REGISTERED_ID = -1;\r\n\r\n\t\treturn $errors;\r\n\t}",
"public function registerUser() {\n $this->form_validation->set_rules('username', 'Username', 'trim|required|min_length[5]|max_length[12]|is_unique[user.username]',\n array('min_length' => 'Username length has to be between 5 & 12 characters.',\n 'max_length' => 'Username length has to be between 5 & 12 characters.',\n 'is_unique' => 'Username is already in use.'));\n $this->form_validation->set_rules('password', 'Password', 'required|min_length[8]|max_length[16]|matches[confirmPassword]',\n array('min_length' => 'Password length has to be between 8 & 16 characters.',\n 'max_length' => 'Password length has to be between 8 & 16 characters.',\n 'matches' => 'Passwords do not match.'));\n $this->form_validation->set_rules('confirmPassword', 'Password Confirmation', 'required');\n $this->form_validation->set_rules('emailAddress', 'Email Address', 'trim|required|valid_email|is_unique[user.userEmail]',\n array('valid_email' => 'Email is not valid.',\n 'is_unique' => 'Email is already in use.'));\n\n if ($this->form_validation->run() == FALSE) {\n $this->registration();\n\n } else {\n $formUsername = $this->input->post('username');\n $formPassword = $this->input->post('password');\n $formEmailAddress = $this->input->post('emailAddress');\n $this->UserManager->registerUser($formUsername, $formPassword, $formEmailAddress);\n $this->login();\n }\n }",
"public function registerAction()\n {\n Lb_Points_Helper_Data::debug_log(\"Registration request sent to LB\", true);\n $txtName = $_POST['txtName'];\n $txtEmail = $_POST['txtEmail'];\n $txtPhoneNumber = $_POST['txtPhoneNumber'];\n $result = Lb_Points_Helper_Data::registerUser($txtName,$txtEmail,$txtPhoneNumber);\n echo json_encode($result);\n }",
"public function create() {\n\n //Create validator for User registration form with all data sended. Load from model\n $validator = Validator::make(Input::all(), User::$rules_validator);\n \n //Only if request is send by form (post) procces to create user\n if (Request::isMethod('post')) {\n \n //Check fields data sended\n if ($validator->fails()) {\n //Redirecto to form with error\n $messages = $validator->messages()->all(\"<li>:message</li>\");\n $error = \"<ul>\". implode(\"\", $messages).\"</ul>\";\n return Redirect::to('/user/register')->with('error', $error)->withInput(Input::all());\n }\n \n //Pass validator, proccess to create User\n if( $user = User::_save( Input::all() ) ){\n //Auto login user created, is same that attemd method\n Auth::login($user);\n //Redirecto to profile\n return Redirect::intended(action('UserController@profile', array('username' => Auth::user()->username )))->with('notice', trans(\"app.welcome_message\", array(\"user\"=>Auth::user()->username) ));\n }else{\n //Error to try create User, redirecto to Registration form\n return Redirect::to('/user/register')->with('error', trans(\"app.error_creating\"))->withInput(Input::all());\n }\n }\n \n //Return to view\n return View::make('user.register');\n }",
"function reg_user($name, $email, $username, $password)\n\t{\n\t\t$encrypt_password = sha1($password);\n\t\t\n\t\t//Creates an array which includes the field names and the values assigned\n\t\t$details = array(\n\t\t\t\t'u_name' => $name,\n\t\t\t\t'u_email' => $email,\n\t\t\t\t'u_username' => $username,\n\t\t\t\t'u_password' => $encrypt_password\n\t\t);\n\t\t\n\t\t//Executes the insert query\n\t\t$this->db->insert('tbl_user',$details);\n\t}",
"public function register()\n {\n $name = $this->loginEntry->input('uname');\n $email = $this->loginEntry->input('email');\n $password = $this->commonFunction->generateHash($this->loginEntry->input('pass'));\n $this->userDetail->makeEntry($name, $email, $password);\n \n $info = $this->userDetail->getDetail($email, $password);\n \n $this->commonFunction->setSession($info->id, $info->user_name);\n \n return redirect('/dashboard');\n }",
"protected function _createUser()\n {\n $data = [\n 'email' => '[email protected]',\n 'password' => 'test',\n ];\n\n $user = $this->Users->newEntity($data);\n\n $user->set('active', true);\n $user->set('role_id', 1);\n\n $this->Users->save($user);\n }",
"public function register() {\n\t\t$user_email = $this->input->post(\"email\");\n\t\t$user_password = md5($this->input->post('password'));\n\t\t$user_reg_ip = ip2long($this->input->ip_address());\n\t\t\n\t\t$re = $this->user_lib->save_reg_userInfo($user_email,$user_password,$user_reg_ip);\n\t\t\n\t\tif($re===false){\n\t\t\t//set mc error\n\t\t}\n\t\t/*if(!$this->email_lib->send_active_email($user_email)){\n\t\t\t//send mail error\n\t\t}*/\n\t\t$uid = $this->user_lib->active_process($user_email);\n\t\tif($uid===false){\n\t\t\treturn false;\t\t//for active error\n\t\t}\n\t//\t$this->_set_login_cookie($uid);\n\t\tredirect('/regsuccess'); \n\t}",
"public function registerAction() {\n if($this->getAuthService()->hasIdentity()) {\n return $this->redirect()->toRoute(self::SUCCESS_URL);\n }\n\n $form = $this->getForm();\n $form->get('submit')->setValue('Register');\n\n $authErrors = array();\n /**\n * @var $request \\Zend\\Http\\Request\n */\n $request = $this->getRequest();\n if($request->isPost()) {\n $form->setData($request->getPost());\n\n if($form->isValid()) {\n\n $user = new User();\n $user->exchangeArray($form->getData());\n\n if($this->getUserTable()->hasUser(array('email' => $user->email))) {\n\n $authErrors[] = 'Another user has registered with this email.';\n\n } else {\n\n $this->getUserTable()->saveUser($user);\n\n //check authentication...\n $this->getAuthService()->getAdapter()\n ->setIdentity($request->getPost('email'))\n ->setCredential($request->getPost('password'));\n\n $result = $this->getAuthService()->authenticate();\n $authErrors = $result->getMessages();\n\n if($result->isValid()) {\n\n //check if it has rememberMe :\n if($request->getPost('rememberme') == 1) {\n $this->getAuthStorage()\n ->setRememberMe(1);\n //set storage again\n $this->getAuthService()->setStorage($this->getAuthStorage());\n }\n $this->getAuthService()->getStorage()->write($request->getPost('email'));\n\n $this->redirect()->toRoute(self::SUCCESS_URL);\n }\n }\n\n }\n }\n\n return new ViewModel(array(\n 'form' => $form,\n 'messages' => $authErrors\n ));\n }",
"public function register()\n\t{\n\t\t$input = Input::All();\n\t\t\n\t\t$validation = Validator::make($input, User::$rules);\n\t\t\n\t\tif ($validation->passes() && $data['user'] = $this->repo->register($input))\n\t\t{\t\t\t\n\t\t\t$data['activationCode'] = $data['user']->getActivationCode();\n\t\t\t//Send activation code\n\t\t\t$body = View::make('emails.auth.account_activation',$data);\n\t\t\tEmailController::sendMail($data['user']->email, $data['user']->first_name.' '.$data['user']->last_name, 'Welcome to Leadcliq', $body);\n\t\t\t// Create a Milestones entry to track user's checkpoints.\n\t\t\tMilestone::create(array('user_id' => $data['user']->id));\n\t\t\t\n\t\t\treturn View::make('authentication.activation_message',$data);\t\t\t\n\t\t}\n\t\treturn Redirect::route('register')\n\t\t->withInput()\n\t\t->withErrors($validation)\n\t\t->with('message', 'There were validation errors.');\n\t}",
"function register_user() {\n\t\tglobal $ID, $lang, $conf, $auth, $yubikey_associations;\n\n\t\tif(!$auth->canDo('addUser')) return false;\n\n\t\t$_POST['login'] = $_POST['nickname'];\n\n\t\t// clean username\n\t\t$_POST['login'] = preg_replace('/.*:/','',$_POST['login']);\n\t\t$_POST['login'] = cleanID($_POST['login']);\n\t\t// clean fullname and email\n\t\t$_POST['fullname'] = trim(preg_replace('/[\\x00-\\x1f:<>&%,;]+/','',$_POST['fullname']));\n\t\t$_POST['email'] = trim(preg_replace('/[\\x00-\\x1f:<>&%,;]+/','',$_POST['email']));\n\n\t\tif (empty($_POST['login']) || empty($_POST['fullname']) || empty($_POST['email'])) {\n\t\t\tmsg($lang['regmissing'], -1);\n\t\t\treturn false;\n\t\t} else if (!mail_isvalid($_POST['email'])) {\n\t\t\tmsg($lang['regbadmail'], -1);\n\t\t\treturn false;\n\t\t}\n\n\t\t// okay try to create the user\n\t\tif (!$auth->createUser($_POST['login'], auth_pwgen(), $_POST['fullname'], $_POST['email'])) {\n\t\t\tmsg($lang['reguexists'], -1);\n\t\t\treturn false;\n\t\t}\n\n\t\t$user = $_POST['login'];\n\t\t$yubikey = $_SERVER['REMOTE_USER'];\n\n\t\t// if our yubikey id is based on a non-registered user, we need to chunk off the \"yubikey:\"\n\t\t// part of it\n\t\tif (preg_match('!^yubikey:!', $yubikey)) {\n\t\t\t$yubikey = substr($yubikey, 8);\n\t\t}\n\n\t\t// we update the YubiKey associations array\n\t\t$this->register_yubikey_association($user, $yubikey);\n\n\t\t$this->update_session($user);\n\n\t\t// account created, everything OK\n\t\t$this->_redirect(wl($ID));\n\t}",
"public function createAction()\r\n\t{\r\n\t\t$form = $this->createForm(new RegistrationType(), new Registration());\r\n\t\t$form->bindRequest($this->getRequest());\r\n\r\n\t\tif($form->isValid())\r\n\t\t{\r\n\t\t\t$registration = $form->getData();\r\n\r\n\t\t\t$user = $registration->getUser();\r\n\t\t\t$employee = $registration->getEmployee();\r\n\r\n\t\t\t$employee->setUser($user);\r\n\r\n\t\t\t$em = $this->getDoctrine()->getEntityManager();\r\n\t\t\t$em->persist($user);\r\n\t\t\t$em->persist($employee);\r\n\t\t\t$em->flush();\r\n\t\t}\r\n\r\n\t\treturn array('form'=>$form->createView());\r\n\t}",
"function user_register($user_info)\n {\n }",
"public function registershop(RegisterRequest $request)\n {\n $emailVerificationRequired = config('settings.mail.email_verification') == 1 && $request->filled('email');\n $phoneVerificationRequired = config('settings.sms.phone_verification') == 1 && $request->filled('phone');\n\n // New User\n $user = new User();\n $input = $request->only($user->getFillable());\n foreach ($input as $key => $value) {\n $user->{$key} = $value;\n }\n\n $user->country_code = config('country.code');\n $user->language_code = config('app.locale');\n $user->password = Hash::make($request->input('password'));\n $user->phone_hidden = $request->input('phone_hidden');\n $user->user_type_id = $request->input('company');\n $user->ip_addr = Ip::get();\n $user->ip_addr = Ip::get();\n $user->verified_email = 1;\n $user->verified_phone = 1;\n\n // Email verification key generation\n if ($emailVerificationRequired) {\n $user->email_token = md5(microtime() . mt_rand());\n $user->verified_email = 0;\n }\n\n // Mobile activation key generation\n if ($phoneVerificationRequired) {\n $user->phone_token = mt_rand(100000, 999999);\n $user->verified_phone = 0;\n }\n\n // Save\n $user->save();\n\n // Message Notification & Redirection\n $request->session()->flash('message', t(\"Your account has been created.\"));\n $nextUrl = config('app.locale') . '/register/finish';\n\n // Send Admin Notification Email\n if (config('settings.mail.admin_notification') == 1) {\n try {\n // Get all admin users\n $admins = User::permission(Permission::getStaffPermissions())->get();\n if ($admins->count() > 0) {\n Notification::send($admins, new UserNotification($user));\n /*\n foreach ($admins as $admin) {\n Notification::route('mail', $admin->email)->notify(new UserNotification($user));\n }\n */\n }\n } catch (\\Exception $e) {\n flash($e->getMessage())->error();\n }\n }\n\n // Send Verification Link or Code\n if ($emailVerificationRequired || $phoneVerificationRequired) {\n\n // Save the Next URL before verification\n session(['userNextUrl' => $nextUrl]);\n\n // Email\n if ($emailVerificationRequired) {\n // Send Verification Link by Email\n $this->sendVerificationEmail($user);\n\n // Show the Re-send link\n $this->showReSendVerificationEmailLink($user, 'user');\n }\n\n // Phone\n if ($phoneVerificationRequired) {\n // Send Verification Code by SMS\n $this->sendVerificationSms($user);\n\n // Show the Re-send link\n $this->showReSendVerificationSmsLink($user, 'user');\n\n // Go to Phone Number verification\n $nextUrl = config('app.locale') . '/verify/user/phone/';\n }\n\n // Send Confirmation Email or SMS,\n // When User clicks on the Verification Link or enters the Verification Code.\n // Done in the \"app/Observers/UserObserver.php\" file.\n\n }\n else\n {\n\n // Send Confirmation Email or SMS\n if (config('settings.mail.confirmation') == 1) {\n try {\n $user->notify(new UserActivated($user));\n } catch (\\Exception $e) {\n flash($e->getMessage())->error();\n }\n }\n\n // Redirect to the user area If Email or Phone verification is not required\n if (Auth::loginUsingId($user->id)) {\n return redirect()->intended(config('app.locale') . '/account');\n }\n\n }\n\n // Redirection\n $success['token'] = $user->createToken('theqqaPassport')->accessToken;\n $success['name'] = $user->name;\n return response()->json([\n 'status' => 'success',\n 'data' => $success,\n ]);\n }",
"public function postRegister(Request $request)\n {\n //get the vars from the request\n $email = $request['reg_email'];\n $name = $request['name'];\n $password = bcrypt($request['reg_password']); //hash the password with bcrypt\n\n //create new user and set attributes\n $user = new User();\n $user->email = $email;\n $user->name = $name;\n $user->password = $password;\n\n $user->save(); //save to DB\n\n //log new user in\n Auth::login($user);\n\n return redirect('welcome');\n }",
"public function actionCreate()\n {\n $model = new RegisterForm();\n $model->type = User::TYPE_USER;\n $model->status = User::STATUS_ACTIVE;\n $model->loadDefaultValues();\n\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n $model->password_hash = (new Security())->generatePasswordHash($model->password);\n if ($model->save()) {\n return $this->redirect(['index']);\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }"
]
| [
"0.8177741",
"0.81661385",
"0.7962426",
"0.79247373",
"0.7924538",
"0.7878867",
"0.76856816",
"0.76682484",
"0.7664824",
"0.7610773",
"0.76053435",
"0.759695",
"0.759164",
"0.7588742",
"0.7521593",
"0.75147486",
"0.75045174",
"0.74895316",
"0.7479655",
"0.7479655",
"0.7479655",
"0.7479655",
"0.74620926",
"0.74353987",
"0.7411074",
"0.7410427",
"0.74071956",
"0.7399949",
"0.7391378",
"0.7390023",
"0.73875344",
"0.7383067",
"0.7382094",
"0.73779273",
"0.7375032",
"0.73718417",
"0.7362275",
"0.73536086",
"0.73507315",
"0.73392546",
"0.7337301",
"0.7335625",
"0.73332",
"0.73316723",
"0.7308991",
"0.72938806",
"0.726347",
"0.7261333",
"0.7255761",
"0.72548795",
"0.72379297",
"0.72369045",
"0.7228893",
"0.722749",
"0.7226429",
"0.72162443",
"0.72106934",
"0.7207073",
"0.7202273",
"0.72010136",
"0.7200932",
"0.71968997",
"0.7195404",
"0.71931076",
"0.718869",
"0.71882474",
"0.7177911",
"0.71729827",
"0.71672374",
"0.71672374",
"0.7161539",
"0.71563435",
"0.7155178",
"0.71534735",
"0.7137188",
"0.71075505",
"0.7106541",
"0.7103425",
"0.710031",
"0.71002823",
"0.70947075",
"0.70873547",
"0.70863897",
"0.7081181",
"0.7078131",
"0.7076558",
"0.70735157",
"0.707123",
"0.7063146",
"0.7058815",
"0.7050044",
"0.7045562",
"0.7042562",
"0.7034375",
"0.7027179",
"0.70217454",
"0.7016101",
"0.7009614",
"0.7003668",
"0.70015514",
"0.6992981"
]
| 0.0 | -1 |
Request for Password Reset | public function recoverPasswordAction(Request $request)
{
$session = $request->getSession();
if ($this->getUser()) {
// return to login
}
$user = new User();
$form = $this->createFormBuilder($user)
->add('email', 'email', array('attr' => array('class' => 'form-control')))
->add('submit', 'submit', array('attr' => array('class' => 'btn-primary gap-height')))
->getForm();
if ($request->getMethod() == 'POST') {
$email = $form->get('email')->getData();
$user = $this->baseRepository()->findOneBy(array('email' => $email));
if ($user) {
$token = $this->getToken(array($user->email, time(), rand()));
$user->setToken($token);
$user->setStatus($user::STATUS_INACTIVE);
$this->baseRepository()->save($user);
$this->_sendMails($options, $user);
$message = 'Please visit your email: ' . $user->getEmail() . ' and follow the instruction';
} else {
$message = 'The requested email is not found';
}
return $this->render('UserBundle:User:thankyou.html.twig', array('user' => $user, 'message' => $message));
}
return $this->render('UserBundle:User:save.html.twig', array('form' => $form->createView(), 'action' => 'Forgot Password'));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function requestPasswordReset()\n {\n $this->View->render('user/requestPasswordReset');\n }",
"public function requestPasswordReset()\n {\n /**\n * @var $validator Validator\n */\n $validator = app()->make('validator')->make($this->request->input(), [\n 'email' => 'required|email|exists:users,email',\n ]);\n\n if(!$validator->passes()) {\n $this->apiResponse->handleErrors($validator);\n }\n\n $email = $this->request->input('email', null);\n $email = htmlspecialchars(trim(strtolower($email)));\n\n /**\n * @var User $user\n */\n $user = User::where('email', $email)->first();\n\n if(!$user instanceof User) {\n $this->apiResponse->setError(\"No user with that Email found.\");\n } else {\n if (!$user->hasVerifiedEmail()) {\n $user->markEmailAsVerified();\n }\n\n if($this->request->has('callback_url') && $this->request->filled('callback_url')) {\n $user->setPasswordResetUrl($this->request->input('callback_url'));\n }\n\n $user->sendPasswordResetNotification();\n $this->apiResponse->setSuccess(['sent' => true]);\n }\n\n return $this->apiResponse->returnResponse();\n }",
"public function actionRequestpasswordreset() {\n\t\treturn $this->render('requestpasswordreset');\n\t}",
"public function sendPasswordResetRequest() {\r\n\t\t$user_model = $this->load_model('UserModel');\t\r\n\t\t$user_data = $user_model->getUserByEmail($this->params['forgotten_password_email']);\r\n\t\t\r\n\t\tif($user_data !== null){\r\n\t\t\t$password_reset = $this->generatePasswordResetLink($user_data['ID'], $this->params['forgotten_password_email']);\r\n\t\t\t\r\n\t\t\t$password_reset_model = $this->load_model('PasswordResetModel');\r\n\t\t\t$password_reset_model->insertHash($user_data['ID'], $password_reset['hash']);\r\n\t\t\t\r\n\t\t\tif(Utils::sendPasswordResetEmail($this->params['forgotten_password_email'], $password_reset['link'])){\r\n\t\t\t\t$this->sendResponse(1, true);\r\n\t\t\t} else {\r\n\t\t\t\t$this->sendResponse(0, ErrorCodes::EMAIL_ERROR);\r\n\t\t\t}\r\n\t\t\t\r\n\t\t}else{\r\n\t\t\t$this->sendResponse(0, array('field' => 'forgotten_password_email', 'error_code' => ErrorCodes::EMAIL_NOT_FOUND));\r\n\t\t}\r\n\t}",
"function requestpasswordreset_action()\n {\n $login_model = $this->loadModel('Login');\n // set token (= a random hash string and a timestamp) into database\n // to see that THIS user really requested a password reset\n if ($login_model->setPasswordResetDatabaseToken() == true) {\n // send a mail to the user, containing a link with that token hash string\n $login_model->sendPasswordResetMail();\n }\n $this->view->render('login/requestpasswordreset');\n }",
"public function requestPasswordReset_action()\n {\n PasswordResetModel::requestPasswordReset(Request::post('user_name_or_email'));\n Redirect::to('index');\n }",
"Public Function resetPassword()\n\t{\n\t\t$Code = $this->generateResetCode();\n\t\t$Email = $this->email;\n\t\t$Subject = 'Reset Password Request from ' . $_SERVER['HTTP_HOST'];\n\t\t$Body = <<<END\nThis is an automatically generated email from $_SERVER[HTTP_HOST] regarding a password reset.<br/>\nIf you did not request a password reset then please disregard this email.<br/>\n<br/>\nOtherwise, follow this link to reset your password:<br/>\n<a href=\"http://$_SERVER[HTTP_HOST]/BevoMedia/Index/ResetPassword.html?EmailCode=$Code&Email=$Email\">http://$_SERVER[HTTP_HOST]/BevoMedia/Index/ResetPassword.html?EmailCode=$Code&Email=$Email</a>\nEND;\n\t\t\n\t\t$this->ClearResetCode();\n\t\t$this->InsertResetCode($Code);\n\t\t$this->SendEmail($Email, $Subject, $Body);\n\t}",
"public function actionRequestPasswordReset()\n {\n $model = new PasswordResetRequestForm();\n\n if (!$model->load(Yii::$app->request->post()) || !$model->validate()) {\n return $this->render('requestPasswordResetToken', ['model' => $model]);\n }\n\n if (!$model->sendEmail()) {\n Yii::$app->session->setFlash('error', Yii::t('app', \n 'Sorry, we are unable to reset password for email provided.'));\n return $this->refresh();\n }\n\n Yii::$app->session->setFlash('success', Yii::t('app', 'Check your email for further instructions.'));\n\n return $this->goHome();\n }",
"public function resetPassword();",
"private function forgotPassword()\n {\n try\n {\n $request = $_POST;\n\n if( !isset($request['username']) || $request['username']==\"\" )\n throw_error_msg(\"user name not provided\");\n\n global $userquery; \n $userquery->reset_password(1,$request['username']);\n\n if(error())\n {\n throw_error_msg(error('single'));\n }\n else\n { \n $data = array('code' => \"200\", 'status' => \"success\", \"msg\" => 'success', \"data\" => \"An Email Has Been Sent To You. Please Follow the Instructions there to Reset Your Password\");\n $this->response($this->json($data));\n }\n\n }\n catch(Exception $e)\n {\n $this->getExceptionDelete($e->getMessage());\n }\n }",
"public function resetUserPassword()\n\t{\n\t\t# make the call to the API\n\t\t$response = App::make('ApiClient')->post('user/password?forgotten=true', Input::only('email'));\t\n\n\t\t# if the call was successful we'll want to give some feedback to the user\n\t\tif(isset($response['success'])) \n\t\t{\n\t\t\tSession::flash('success', $response['success']['data']);\n\t\t}\n\t\t# similarly if it failed, but this time also show the previous form data\n\t\telse {\n\t\t\t# save the API response to some flash data\n\t\t\tSession::flash('reset-errors', getErrors($response));\n\n\t\t\t# also flash the input so we can replay it out onto the reg form again\n\t\t\tInput::flash();\n\t\t}\t\t\n\n\t\t# ... and show the reset form again\n\t\treturn Redirect::to('forgotten-password');\n\t}",
"public function do_reset_password()\n {\n $input = array(\n 'token'=>Input::get( 'token' ),\n 'password'=>Input::get( 'password' ),\n 'password_confirmation'=>Input::get( 'password_confirmation' ),\n );\n\n // By passing an array with the token, password and confirmation\n if( Confide::resetPassword( $input ) )\n {\n $notice_msg = Lang::get('confide::confide.alerts.password_reset');\n return Redirect::action('UserController@login')\n ->with( 'notice', $notice_msg );\n }\n else\n {\n $error_msg = Lang::get('confide::confide.alerts.wrong_password_reset');\n return Redirect::action('UserController@reset_password', array('token'=>$input['token']))\n ->withInput()\n ->with( 'error', $error_msg );\n }\n }",
"public function resetpassAction()\n\t{\n\t\t$email='[email protected]';\n\n\t\t$customer = Mage::getModel('customer/customer')\n ->setWebsiteId(Mage::app()->getStore()->getWebsiteId())\n ->loadByEmail($email);\n\t\t$customer->sendPasswordResetConfirmationEmail();\n\t}",
"public function requestPassReset()\n {\n $this->form->addText('email', 'Email')\n ->setRequired('Email field is required')\n ->addRule(Form::EMAIL, 'Please write a valid email address')\n ->addRule(callback($this, 'checkEmailExists'), 'Sorry, the email %value does not exists on our registry', 'email');\n\n $this->form->addSubmit('send', 'Reset Password');\n\n $this->form->onSuccess[] = callback($this, 'requestPassResetProcess');\n return $this->form;\n }",
"public function forgotAction()\n {\n if (Zend_Auth::getInstance()->hasIdentity()) {\n $this->_helper->redirector->gotoRoute(array(), 'default', true);\n return;\n }\n\n $realm = $this->_getParam('realm', null);\n\n if (is_null($realm)) {\n throw new Ot_Exception_Input('msg-error-realmNotFound');\n }\n\n // Set up the auth adapter\n $authAdapter = new Ot_Model_DbTable_AuthAdapter();\n $adapter = $authAdapter->find($realm);\n\n if (is_null($adapter)) {\n\n throw new Ot_Exception_Data(\n $this->view->translate('ot-login-signup:realmNotFound', array('<b>' . $realm . '</b>'))\n );\n }\n\n if ($adapter->enabled == 0) {\n throw new Ot_Exception_Access('msg-error-authNotSupported');\n }\n\n $className = (string)$adapter->class;\n $auth = new $className();\n\n if (!$auth->manageLocally()) {\n throw new Ot_Exception_Access('msg-error-authNotSupported');\n }\n\n $form = new Ot_Form_ForgotPassword();\n\n if ($this->_request->isPost()) {\n if ($form->isValid($_POST)) {\n\n $account = new Ot_Model_DbTable_Account();\n\n $userAccount = $account->getByUsername($form->getValue('username'), $realm);\n\n if (!is_null($userAccount)) {\n $loginOptions = array();\n $loginOptions = Zend_Registry::get('applicationLoginOptions');\n\n // Generate key\n $text = $userAccount->username . '@' . $userAccount->realm . '-' . time();\n $key = $loginOptions['forgotpassword']['key'];\n $iv = $loginOptions['forgotpassword']['iv'];\n $cipher = $loginOptions['forgotpassword']['cipher'];\n\n $code = bin2hex(mcrypt_encrypt($cipher, $key, $text, MCRYPT_MODE_CBC, $iv));\n\n $this->_helper->messenger->addSuccess('msg-info-passwordResetRequest');\n\n $loggerOptions = array('attributeName' => 'accountId', 'attributeId' => $userAccount->accountId);\n\n $this->_helper->log(Zend_Log::INFO, 'User ' . $userAccount->username . ' sent a password reset request.', $loggerOptions);\n\n $dt = new Ot_Trigger_Dispatcher();\n $dt->setVariables(array(\n 'firstName' => $userAccount->firstName,\n 'lastName' => $userAccount->lastName,\n 'emailAddress' => $userAccount->emailAddress,\n 'username' => $userAccount->username,\n 'resetUrl' => Zend_Registry::get('siteUrl') . '/login/password-reset/?key=' . $code,\n 'loginMethod' => $userAccount->realm,\n ));\n\n $dt->dispatch('Login_Index_Forgot');\n\n $this->_helper->redirector->gotoRoute(array('realm' => $realm), 'login', true);\n } else {\n $this->_helper->messenger->addError('msg-error-userAccountNotFound');\n }\n } else {\n $this->_helper->messenger->addError('msg-error-invalidFormInfo');\n }\n }\n\n $this->_helper->pageTitle('ot-login-forgot:title');\n $this->view->assign(array(\n 'form' => $form,\n ));\n }",
"public function actionForgotPassword() {\n\t\tif (!\\Yii::$app->user->isGuest) {\n\t\t\treturn $this->redirect( Url::to(['users/myprofile']) );\n\t\t}\n\t\t$model = new PasswordResetRequestForm();\n\t\tif ($model->load(Yii::$app->request->post()) && $model->validate()) {\n if ($model->sendEmail()) {\n Yii::$app->session->setFlash('item', Yii::t('yii','Password reset link has been sent to your email address.'));\n\t\t\t\treturn $this->redirect( Url::to(['site/login']) );\n } else {\n Yii::$app->session->setFlash('item', Yii::t('yii','Sorry, We are unable to reset the password for the email provided.'));\n return $this->redirect( Url::to(['site/login']) );\n }\n }\n return $this->render('requestPasswordResetToken', [\n 'model' => $model,\n ]);\n }",
"public function testRequestPasswordReset()\n {\n }",
"public function resetPass($request)\r\n {\r\n /*\r\n * First, set params you need to search user in database.\r\n */\r\n $params = [\r\n 'Username' => $request['username'],\r\n 'Email' => $request['email']\r\n ];\r\n\r\n /*\r\n * Check if user exist in database.\r\n */\r\n $user = $this->getAll($params);\r\n if (!empty($user)) {\r\n\r\n /*\r\n * If exitst you have to set link and data parameters to send mail.\r\n */\r\n $link = \"http://www.mdtohtml.com/index.php?rp=\" . $user[0]['Activation'];\r\n $data = [\r\n 'email' => $request['email'],\r\n 'title' => 'Registration support',\r\n 'body' => \"Hello!\\n\\nClick on below link to create new password.\\n\\n$link\",\r\n 'subject' => 'Reset password',\r\n 'user' => $request['username'],\r\n 'link' => $link,\r\n 'username' => '[email protected]',\r\n 'password' => 'preskok123'\r\n\r\n ];\r\n /*\r\n * Then you call function to send mail.\r\n */\r\n return $this->send_mail($data);\r\n\r\n }\r\n }",
"public function actionForgotPassword() {\n //validate webservice\n $requiredParams = ['email'];\n try {\n CommonApiHelper::validateRequestParameters($requiredParams);\n\n $response = [];\n $post = Yii::$app->request->bodyParams;\n $post = array_map('trim', $post);\n //Fetch user details\n $userdata = Users::findOne(['email' => $post['email'], 'status' => '1']);\n if (!empty($userdata)) {\n $userdata->password_reset_token = Yii::$app->security->generateRandomString() . '_' . time();\n if ($userdata->save(false)) {\n Users::sendPasswordResetEmail($userdata);\n }\n return CommonApiHelper::return_success_response(\"Reset Password link has been sent to your registered email id.\", \"\", []);\n } else {\n return CommonApiHelper::return_error_response(\"Failed:\", \"Email id is not registered or User is inactive.\", \"2\");\n }\n } catch (\\Exception $e) {\n return CommonApiHelper::return_error_response(\"Sorry, Please try again.\");\n }\n }",
"public function sendResetPasswordInstruction() {\n $data = \\Input::all();\n /**\n * @todo Validate Email\n */\n if (!isset($data['email']) || !$data['email']) {\n return $this->json(array('status' => 'error',\n 'errors' => array('No email address supplied')));\n }\n\n try {\n\n // Find the user using the user email address\n $user = \\Sentry::findUserByLogin($data['email']);\n\n // Get the password reset code\n $resetCode = $user->getResetPasswordCode();\n\n // Send password reset email to the user\n $this->notificationService->sendEmail($data['email'], $user->getEmail(), 'Reset Your Password', 'email.resetpassword', compact('user', 'resetCode'));\n\n return $this->json(array(\"status\" => \"success\", \"message\" => \"Password reset instruction sent\"));\n } catch (Cartalyst\\Sentry\\Users\\UserNotFoundException $e) {\n return $this->json(array('status' => 'error',\n 'errors' => array('User was not found')));\n }\n }",
"private function user_reset_password(){\n\t\t\tif($this->get_request_method() != \"POST\"){\n\t\t\t\t$this->response('',406);\n\t\t\t}\n\n\t\t\tif(!isset($_POST['password']) ) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter password is require\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\t\t\tif(!isset($_POST['confirm_password']) ) {\n\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Parameter confirm_password are require\");\n\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t}\n\n\t\t\t$user_id = $this->_request['table_doctor_id'];\n\t\t\t$password = $this->_request['password'];\n\t\t\t$cpassword = $this->_request['confirm_password'];\n\n\t\t\tif(!empty($password) && !empty($cpassword) ) {\n\n\t\t\t\tif($password!=$cpassword) {\n\t\t\t\t\t$error = array('status' => \"Failed\", \"msg\" => \"Password and Confirm password is not matched\");\n\t\t\t\t\t$this->response($this->json($error), 200);\n\n\t\t\t\t} else{\n\t\t\t\t\t\t$hashed_password = sha1($password);\n\t\t\t\t\t\t$sql = \"UPDATE table_user SET user_password='\".$hashed_password.\"' WHERE user_id='\".$user_id.\"' \";\n\t\t\t\t\t\t$stmt = $this->db->prepare($sql);\n\t\t\t\t\t\t$update = $stmt->execute();\n\t\t\t\t\t\t$fetchData = $stmt->fetchAll(PDO::FETCH_ASSOC);\n\n\t\t\t\t\t\tif(count($update)==1){\n\t\t\t\t\t\t\t$error = array('status' => \"Success\", \"msg\" => \"Profile Updated\");\n\t\t\t\t\t\t\t$this->response($this->json($error), 200);\n\t\t\t\t\t\t}\n\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public static function requestPasswordReset($email)\n {\n $isReq = FALSE;\n $conn = new MySqlConnect();\n $ts = $conn -> getCurrentTs();\n $name = '';\n\n // generate a random number for tha hash key\n $randNum = rand();\n $hash = hash(\"md5\", $randNum);\n\n $isReq = $conn -> executeQuery(\"UPDATE users SET tempPassKey = '{$hash}', updateDate = '{$ts}' WHERE emailAddress = '{$email}'\");\n $conn -> freeConnection();\n // get the first and last name of the user\n $conn2 = new MySqlConnect();\n $result = $conn2 -> executeQueryResult(\"SELECT fName, lName FROM users WHERE emailAddress = '{$email}'\");\n\n if (mysql_num_rows($result) == 1)\n {\n if ($row = mysql_fetch_array($result, MYSQL_ASSOC))\n {\n $name = $row['fName'] . ' ' . $row['lName'];\n\n // send the hash key to the user's email to confirm and follow back to\n // the\n // site\n $from = ConfigProperties::$AppSourceEmail;\n $subject = 'UC Document Repository: Confirm Password Reset';\n $body = \"Dear {$name},\\n\\nPlease follow the URL to confirm your password reset request at the UC Document Repository.\\n\\n\";\n $body .= ConfigProperties::$DomainName . \"/Authentication/resetPassword.php?email={$email}&tempKey={$hash}\";\n\n // send it from the logged in user\n $to = $name . \" <\" . $email . \">\";\n\n $mailer = new DocsMailer();\n $mailer -> Subject = $subject;\n $mailer -> Body = $body;\n $mailer -> addAddress($email, $name);\n $mailer -> From = $from;\n\n if ($mailer -> send())\n {\n $errMsg = 'Password reset email sent to ' . $email . '<br />';\n }\n $mailer -> clearAddresses();\n $mailer -> clearAttachments();\n }\n }\n else\n {\n $isReq = FALSE;\n }\n\n $conn2 -> freeConnection();\n return $isReq;\n }",
"public function post_reset_request()\n {\n $rules = array();\n $rules['email'] = 'required|email';\n\n $v = Validator::make( Input::all(), $rules );\n if ($v->fails()) {\n return Redirect::to( Config::get('user.reset_route', Config::get('user::config.reset_route')) )\n ->with_errors($v)\n ->with_input();\n }\n\n $user = User::where_email(Input::get('email'))->first();\n\n if(!$user && !Config::get('user.enable_reset_obfuscation', Config::get('user::config.enable_reset_obfuscation'))) {\n return Redirect::to( Config::get('user.reset_route', Config::get('user::config.reset_route')) )\n ->with('error', 'No account is registered with this e-mail address.'); \n } elseif($user) {\n $url = $user->get_pass_reset_url();\n\n $view = View::exists('user.email.reset_request') ? 'user.email.reset_request' : 'user::email.reset_request';\n $body = View::make( $view )->with('url', $url)->render(); \n $site_name = Config::get('application.site_name', Request::server('http_host'));\n $subject = '[' . $site_name . '] Password reset request';\n\n mail($user->email, $subject, $body);\n }\n\n Event::fire('user: password reset request');\n\n return Redirect::to( Config::get('user.reset_route', Config::get('user::config.reset_route')) )\n ->with('success', 'Check your e-mail for link to reset your password'); \n }",
"public function resetPasswordAction()\n\t{\n\n\t\t$data = $this->url->post;\n\t\tif (!isset($_POST['reset']) || !$this->validateReset($data)) {\n\t\t\t$this->session->data['error'] = 'Warning: Please enter valid data in input box.';\n\t\t\t$this->url->redirect('login');\n\t\t}\n\n\t\t$token = $this->url->post('_token');\n\t\t$token_check = hash('sha512', TOKEN . TOKEN_SALT);\n\t\tif (hash_equals($token_check, $token) === false ) {\n\t\t\t$this->session->data['error'] = 'Warning: Invalid token. Please try again.';\n\t\t\t$this->url->redirect('login');\n\t\t}\n\t\t$this->loginModel = new Login();\n\t\t$check = $this->loginModel->checkEmailHash($data);\n\t\tif (empty($check)) {\n\t\t\t$this->url->redirect('login');\n\t\t} else {\n\t\t\t$result = $this->loginModel->updatePassword($data);\n\t\t\t$this->session->data['success'] = 'Success: Your Password Changed Succesfully.';\n\t\t\t$this->url->redirect('login');\n\t\t}\n\n\t\t\n\t}",
"public static function do_reset_password() {\n\t\tif ( ! self::is_global_reset_password_page_set() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( 'POST' == $_SERVER[ 'REQUEST_METHOD' ] && isset( $_REQUEST[ 'rp_key' ] ) && isset( $_REQUEST[ 'rp_login' ] ) ) {\n\t\t\t$rp_key = sanitize_text_field( $_REQUEST['rp_key'] );\n\t\t\t$rp_login = sanitize_text_field( $_REQUEST['rp_login'] );\n\n\t\t\t$user = check_password_reset_key( $rp_key, $rp_login );\n\n\t\t\tif ( ! $user || is_wp_error( $user ) ) {\n\t\t\t\t$query_args = self::get_reset_password_query_args_from_user( $user );\n\t\t\t\tFrmRegLoginController::redirect_to_selected_login_page( $query_args );\n\n\t\t\t} elseif ( isset( $_POST[ 'pass1' ] ) ) {\n\n\t\t\t\tself::redirect_if_passwords_not_equal( $rp_key, $rp_login );\n\t\t\t\tself::redirect_if_empty_password( $rp_key, $rp_login );\n\t\t\t\tself::reset_password_and_redirect( $user );\n\n\t\t\t} else {\n\t\t\t\tesc_html_e( 'Invalid request.', 'frmreg' );\n\t\t\t}\n\t\t}\n\t}",
"public function forgotten_password() {\n $email = $this->input->post('email');\n if (!$this->users_model->fields(array('id'))->where('email', $email)->limit(1)->get()) {\n return $this->send_error('NOT_REGISTERED');\n }\n $this->load->helper('string');\n $this->load->library('email');\n $token = random_string('sha1');\n if (!$this->users_model->where('email', $email)->update(array('forgotten_password_code' => $token, 'forgotten_password_time' => time()))) {\n return $this->send_error('ERROR');\n }\n $this->email->from(config_item('email_from'), config_item('email_from_name'))\n ->to($email)\n ->subject('Passwrod reset | Go4Slam app')\n ->message('Hello, <br><br> Press the link below to set a new password. <br><br><a href=\"' . base_url() . 'user/reset_password/' . urlencode($email) . '/' . urlencode($token) . '\">Click here</a>')\n ->set_mailtype('html');\n if (!$this->email->send()) {\n return $this->send_error('UNABLE_TO_SEND_EMAIL');\n }\n return $this->send_success();\n }",
"public function requestPassword(Request $request)\n {\n $rules = [\n 'email' => 'required|email',\n 'security_question_answer' => 'required'\n ];\n\n $this->validate($request, $rules);\n\n $user = User::first();\n\n if ($user->security_question_answer != $request->security_question_answer) {\n return redirect()->back()->withErrors(['Your answer is not valid']);\n }\n\n $token = Helpers::generateRandomString();\n\n DB::table('password_resets')->delete();\n DB::table('password_resets')->insert([\n 'user_id' => $user->id,\n 'token' => $token,\n 'expiry_date' => Carbon::now()->addDay()->toDateTimeString()\n ]);\n\n event(new PasswordResetRequested($token, $request->email));\n\n return redirect('/reset_password');\n }",
"function requestpasswordreset()\n {\n $this->view->render('login/requestpasswordreset');\n }",
"public function processpasswordrequest ()\n {\n if ($_POST)\n {\n try\n {\n // first verify requestID is valid\n $user = $this->welcome->getPasswordResetUser($_POST['requestID']);\n\n if (empty($user)) $this->functions->jsonReturn('ALERT', \"Unable to find a valid password reset request based upon that password request ID\");\n\n // first reset password\n $this->welcome->updateUserPassword($user, $_POST['password']);\n\n // deactivates all password reset requests for that user - they need to fill out the form again to reset their password again\n $this->welcome->deactivatePasswordRequests($user);\n \n $this->functions->jsonReturn('SUCCESS', \"Password has been reset\");\n }\n catch(Exception $e)\n {\n $this->functions->sendStackTrace($e);\n $this->functions->jsonReturn('ERROR', $e->getMessage());\n }\n }\n }",
"public function actionResetPassword()\n\t{\n\t\t\n\t\tif(isset($_GET['resetKey'])) // Uzivatel prisel pres aktivacni link\n\t\t{\n\t\t\t$scenario = 'resetSubmit';\n\t\t\t$model = $this->resetSubmit($_GET['resetKey']);\n\t\t}\n\t\telse // Uzivatel teprve zada o obnovu hesla\n\t\t{\n\t\t\t$scenario = 'resetRequest';\n\t\t\t$model = $this->resetRequest();\n\t\t}\t\n\t\t\n\t\t$this->render('resetPassword', array(\n\t\t\t\t'model' => $model,\n\t\t\t\t'scenario' => $scenario,\n\t\t\t)\n\t\t);\n\t}",
"public function forgottenPassword()\n {\n\t\t// Load helpers and libraries\n\t\thelper(['form', 'url']);\n\t\t$M_User = new M_User();\n\n\t\t// Default return\n\t\t$ret = redirect()->to(base_url());\n\n $options = [\n\t\t\t'action' => 'Users/forgottenPassword' // Route\n ];\n \n\t\t$request = $this->request;\n \n\t\t// Retrieving the current step of the process\n\t\t$step = $request->getPostGet('step');\n\n switch ($step){\n\t\t\tcase 1:\n\t\t\t\t// Step 1: Display email form\n\t\t\t\t$ret = json_encode(view(FORM_FORGOTTEN_PWD_STEP_1, $options));\n\t\t\t\tbreak;\n\t\t\tcase 2:\n\t\t\t\t// Step 2: Send the email\n\t\t\t\t$postData = $request->getPostGet('forgottenPwd');\n\n\t\t\t\t$options['alert'] = 'Un problème est survenu lors de l\\'envoi de l\\'email.';\n\t\t\t\t$options['type'] = 'danger';\n\n\t\t\t\t$ret = json_encode(view(FORM_FORGOTTEN_PWD_STEP_1, $options));\n\n\t\t\t\tif(is_array($postData))\n {\n\t\t\t\t\t$email = $postData['email'];\n\t\t\t\t\t// Everything went well : sending the password reset email\n\t\t\t\t\tif ($M_User->sendPwdResetEmail($email) == SC_SUCCESS) {\n\t\t\t\t\t\t$options['alert'] = 'Un email vient de vous être envoyé. Merci de cliquer sur le lien qu\\'il contient.';\n $options['type'] = 'success';\n\t\t\t\t\t\t$ret = json_encode(view(FORM_FORGOTTEN_PWD_STEP_2, $options));\n }\n\t\t\t\t\t// TODO - User not found\n }\n\t\t\t\tbreak;\n\t\t\tcase 3:\n\t\t\t\t// Step 3 : Token verification\n\t\t\t\t$token = $request->getPostGet('token');\n\n\t\t\t\t$options = [\n\t\t\t\t\t'action' => 'Users/forgottenPassword', // Route\n\t\t\t\t\t'token' => $token, // Security token\n\t\t\t\t\t'script' => self::ENCRYPTION_URL // Script URL for SHA256 encryption\n\t\t\t\t];\n\n\t\t\t\tif ($M_User->findOneBy('securityToken', $token) != null) {\n\t\t\t\t\t// A corresponding security token has been found in the DB\n\t\t\t\t\t$ret = render(FORM_FORGOTTEN_PWD_STEP_3, $options);\n }\n\t\t\t\t// TODO - Token expired\n\t\t\t\t// TODO - Invalid Token\n\n\t\t\t\tbreak;\n\t\t\tcase 4:\n\t\t\t\t// Step 4 : Updating User password\n\t\t\t\t$postData = $request->getPostGet('pwdReset');\n\t\t\t\tif (is_array($postData)){\n\t\t\t\t\tif ($M_User->resetPassword($postData['token'],$postData['password']) != SC_SUCCESS){\n\t\t\t\t\t\t$options = [\n\t\t\t\t\t\t\t'action' => 'Users/forgottenPassword', // Route\n\t\t\t\t\t\t\t'token' => $postData['token'], // Security token\n\t\t\t\t\t\t\t'alert' => 'Une erreur interne est survenue', // Alert message\n\t\t\t\t\t\t\t'type' => 'danger' // Alert type\n\t\t\t\t\t\t];\n\n\t\t\t\t\t\t$ret = render(FORM_FORGOTTEN_PWD_STEP_3, $options);\n } \n }\n\t\t\t\tbreak;\n }\n \n\n return $ret;\n\t}",
"public function passwordResetAction()\n {\n // get the view vars\n $errors = $this->view->errors;\n $site = $this->view->site;\n $validator = $this->view->validator;\n\n // set the input params\n $requiredParams = array(\n 'code',\n );\n\n $input = $this->processInput( $requiredParams, null, $errors );\n\n // check if there were any errors\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n // decode the hash and gets its parts, confirm all good and allow user to change password\n list( $userIdentification, $timestamp, $signature ) = explode( '|', base64_decode( urldecode( $input->code ) ) );\n\n // first assume userIdentification is a username\n $user = $site->getUserByUsername( $userIdentification );\n\n // if userIdentification is not a username, use userIdentification as an email address\n if ( ! $user ) {\n $user = $site->getUserByEmailAddress( $userIdentification );\n }\n\n $validator->checkValidUser( $user, $errors );\n $validator->checkValidResetPasswordCode( $site, $userIdentification, $timestamp, $signature, $errors );\n\n if ( $errors->hasErrors() ) {\n return $this->renderPage( 'errors' );\n }\n\n return $this->renderPage( 'authPasswordReset' );\n }",
"public function forgotpasswordAction() {\n $form = new Admin_Form_ResendPassword();\n if ($this->getRequest()->isPost()) {\n if ($form->isValid($this->_request->getPost())) {\n //check user is registered\n $values = $form->getValues();\n $siteUsersMapper = new Application_Model_Table_AdminUsers();\n $exists = $siteUsersMapper->fetchByUsername($values['email_address']);\n if($exists){\n //user exists\n $recoveryEmailsMapper = new Application_Model_Table_AdminUserRecoveryEmails();\n $recoveryEmail = $recoveryEmailsMapper->createRow();\n $recoveryEmail->admin_user_id = $exists->admin_user_id;\n $recoveryEmail->email_address = $exists->username;\n $recoveryEmail->hashActivationKey();\n $recoveryEmail->save();\n }\n $this->_helper->FlashMessenger->addMessage('You password has been reset, please check your email' , 'successful');\n $this->_helper->redirector->goToRouteAndExit(array(), 'admin-dashboard', true);\n }\n }\n $this->view->form = $form;\n }",
"public function forgotPasswordAction()\n {\n $form = new ForgotPasswordForm();\n\n if ($this->request->isPost())\n {\n if($this->security->checkToken())\n {\n // Send emails only is config value is set to true\n if ($this->getDI()->get('config')->useMail) {\n\n if ($form->isValid($this->request->getPost()) == false) {\n foreach ($form->getMessages() as $message) {\n $this->flash->error($message);\n }\n } else {\n\n $user = Users::findFirstByEmail($this->request->getPost('email'));\n if (!$user) {\n $this->flash->success('There is no account associated to this email');\n } else {\n\n $resetPassword = new ResetPasswords();\n $resetPassword->usersId = $user->id;\n if ($resetPassword->save()) {\n // $this->flash->success('Success! Please check your messages for an email reset password');\n $this->flashSess->success(\"Success! Please check your messages for an email reset password\");\n $this->view->disable();\n return $this->response->redirect('');\n } else {\n foreach ($resetPassword->getMessages() as $message) {\n $this->flash->error($message);\n }\n }\n }\n }\n } else {\n $this->flash->warning('Emails are currently disabled. Change config key \"useMail\" to true to enable emails.');\n }\n }\n else {\n $this->flash->error('CSRF Validation is Failed');\n }\n }\n $this->view->form = $form;\n }",
"public function postResetPassword()\n\t{\n\t\t//check if valid token from the password_reminders table, if not show error message\n\t\t$rules = array(\t'password' =>$this->userService->getNewUserValidatorRule('password'),\n\t\t\t\t\t\t'password_confirmation'=>'Required|same:password');\n\t\t$token = Input::get('token');\n\t\t$v = Validator::make(Input::all(), $rules);\n\t\tif($v->passes())\n\t\t{\n\t\t\t$ret_msg = $this->userService->resetPassword(Input::all());\n\t\t\tif($ret_msg == '')\n\t\t\t{\n\t\t\t\treturn Redirect::to('user/login')->with('success_message', trans('auth/form.changepassword_success_message'));\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn Redirect::to('users/reset-password/'.$token)->withInput()->with('error', $ret_msg);\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn Redirect::to('user/reset-password/'.$token)->withInput()->withErrors($v);\n\t\t}\n\t}",
"public function sendPasswordReset(Request $request)\n {\n\n //creating full mobile number\n $full_mobile_number = $request->country_code.$request->mobile_number;\n $user = $this->user->where('full_mobile_number', $full_mobile_number)->first();\n\n if(!$user) {\n return $this->api->json(false, 'MOBILE_NUMBER_NOT_EXIST', 'Entered mobile number does not exist in our database.');\n }\n\n\n\n //crate otp entry\n $otp = $this->otp->createOtpToken($user->country_code, $user->mobile_number);\n\n $contactEmail = $this->setting->get('website_contact_email');\n $messageText = \"Your password reset one time password(OTP) is : {{otp_code}}. If you receives this mail or sms multiple times then contact to our support {$contactEmail}\";\n $messageText = str_replace('{{otp_code}}', $otp->token, $messageText);\n\n //send otp via sms\n $this->otp->sendMessage($user->country_code, $user->mobile_number, $messageText);\n // send otp via email\n $this->email->sendCommonEmail($user->email, $user->fname, 'Password reset OTP', $messageText);\n\n return $this->api->json(true, 'PASSWORD_RESET_OTP_SENT', 'Password reset otp sent. Check you registerd mobile and email.');\n\n\n }",
"public function sendResetLink()\n {\n return $this->authService->sendPasswordResetLink(request()->input('email'));\n }",
"public function ResetPassword() {\n\t\t\t$strPassword = strtolower(substr(md5(microtime()), 4, 8));\n\t\t\t$this->SetPassword($strPassword);\n\t\t\t$this->PasswordResetFlag = true;\n\t\t\t$this->Save();\n\n\t\t\t// Setup Token Array\n\t\t\t$strTokenArray = array(\n\t\t\t\t'NAME' => $this->strFirstName . ' ' . $this->strLastName,\n\t\t\t\t'USERNAME' => $this->strUsername,\n\t\t\t\t'PASSWORD' => $strPassword\n\t\t\t);\n\n\t\t\t// Send Message\n\t\t\tQApplication::SendEmailUsingTemplate('forgot_password', 'Qcodo.com Credentials', QCODO_EMAILER,\n\t\t\t\t$this->SmtpEmailAddress, $strTokenArray, true);\n\t\t}",
"public function resetPasswordAction()\n {\n // specify required fields\n $requirements = array(\n 'key'\n );\n\n // fech post json data\n $post = $this->fetchRequestData($requirements);\n\n $result = $params = array();\n\n $params['email'] = $post['key'];\n $params['notificationTwig'] = 'emails/user-email-forgot-password.html.twig';\n $params['changePassLink'] = '/user/password/forgot/emails/';\n $params['tellUsLink'] = '/user/tell-us/emails/';\n\n $reset = $this->get('UserServices')->userResetPassword($params);\n if (!$reset) {\n throw new HttpException(422, $this->translator->trans('Invalid credentials. Please try again.'));\n } else {\n $success = (isset($reset['status']) && $reset['status'] == 'ok') ? true : false;\n $message = $this->translator->trans(\"We've emailed you password reset instructions. Check your email\");\n }\n\n $result['success'] = $success;\n $result['message'] = $message;\n\n $response = new Response(json_encode($result));\n $response->setStatusCode(200);\n return $response;\n }",
"public function forgot() {\n\n\n $credentials = request()->validate(['email' => 'required|email']);\n\n $sendResetLink = Password::sendResetLink($credentials);\n\n \n\n return $this->respondWithMessage('Reset password link sent on your email id.');\n }",
"public function reset(Request $request)\n {\n $v_code = \\Illuminate\\Support\\Facades\\Request::get('code');// get verification code from query string \n //which is appended with link on which we are on\n \n \n $email = \\Illuminate\\Support\\Facades\\Request::get('email');// get verification code from query string \n //which is appended with link on which we are on\n\n $password = $request->password;\n\n $tokenData = \\DB::table('password_resets')->where('token', $v_code)->first();//check if you are the true user by matching tokens\n if (!$tokenData)\n {\n return RESPONSE()->JSON([\n 'Message'=>'Failed unauthorize'\n ],401);\n }\n $user = User::where(['email'=>$email])->first();\n\n\n if($user!=null)\n {\n $user->password = bcrypt($request->password);\n $user->save();\n //deletes enteries from password_reset table\n \\DB::table('password_resets')->where('email', $user->email)->delete();\n\n\n return response(['Success'=>'Your password has been changed']);\n }\n return response (['Fail'=>'Something Went wrong'],400);\n }",
"public function test_admin_can_send_request_reset_password()\n {\n $postedEmail = $this->post(route('api.admin.auth.password.postEmail'), ['email' => $this->admin->email]);\n $postedEmail->assertResponseOk()->isJson();\n }",
"public function passwordResetCode();",
"public function forgot_password()\n\t{\n\t\t$email = Input::get('email');\n\n\t\t//Get reset code and send email\n\t\tif($resetCode = $this->repo->getResetCode($email))\n\t\t{\n\t\t\treturn View::make('authentication.confirm_reset_code_sent')->with('email',$email)->with('resetCode',$resetCode);\n\t\t}\n\t\treturn View::make('authentication.forgot_password')->withInput(Input::all()); \n\t}",
"public function forget_password_post()\n {\n $admin = User::where('email', request('email'))->first();\n if(!empty($admin))\n {\n $token = app('auth.password.broker')->createToken($admin);\n $data = DB::table('password_resets')->insert([\n 'email' => $admin->email,\n 'token' => $token,\n 'created_at' => Carbon::now()\n ]);\n\n Mail::to($admin->email)->send(new reset_password(['data' => $admin, 'token' => $token]));\n return back();\n }\n }",
"public function resetPassword()\n\t{\n\n\t\tif ($this->common->isLoggedIn()) {\n\t\t\t$this->url->redirect('dashboard');\n\t\t}\n\n\t\t$data['error'] = '';\n\t\tif (isset($this->session->data['error'])) {\n\t\t\t$data['error'] = $this->session->data['error'];\n\t\t\tunset($this->session->data['error']);\n\t\t}\n\n\t\t$data['success'] = '';\n\t\tif (isset($this->session->data['success'])) {\n\t\t\t$data['success'] = $this->session->data['success'];\n\t\t\tunset($this->session->data['success']);\n\t\t}\n\t\t$data['mail'] = $this->url->get('id');\n\t\t$data['hash'] = $this->url->get('temp');\n\t\t\n\t\tif (empty($data['mail']) && empty($data['hash']) ) {\n\t\t\t$this->url->redirect('login');\n\t\t}\n\t\t$this->loginModel = new Login();\n\t\tif (!$this->loginModel->checkEmailHash($data)) {\n\t\t\t$this->url->redirect('login');\n\t\t}\n\t\t\n\t\t$data['info'] = $this->commons->getInfo();\n\n\t\t/*Load Language File*/\n\t\trequire DIR_BUILDER.'language/'.$data['info']['language'].'/common.php';\n\t\t$data['lang']['common'] = $lang;\n\t\trequire DIR_BUILDER.'language/'.$data['info']['language'].'/login.php';\n\t\t$data['lang']['login'] = $login;\n\t\t\n\t\t$data['token'] = hash('sha512', TOKEN . TOKEN_SALT);\n\t\t$data['action'] = URL.DIR_ROUTE.'reset';\n\t\t$this->view->render('auth/reset_password.tpl', $data);\n\t}",
"public function requestResetPassword(Request $request)\n {\n try\n {\n // validate details\n $validator = app('validator')->make($request->all(),['email' => 'required|email' ],[]);\n\n // If validation fails then return error response\n if($validator->fails())\n return createResponse(config('httpResponse.UNPROCESSED'), \"Request parameter missing.\", ['error' => $validator->errors()->first()]);\n\n $user = \\App\\User::where('email', $request->get('email'))->get(['id', 'email', 'firstName'])->first();\n\n if($user === null )\n // if(!count($user))\n return createResponse(config('httpResponse.SERVER_ERROR'), \"It seems like entered email adress does not belongs to the system! Please check if there is any spelling mistake.\", ['error' => \"It seems like entered email adress does not belongs to the system! Please check if there is any spelling mistake.\"]);\n\n $otp = rand(100000, 999999);\n \\App\\User::where('id', $user->id)->update(['otp' => $otp, 'otpCreatedAt' => date('Y:m:d H:i:s')]);\n\n// App('mailer')->send('emails.ResetPassword', ['otp' => $otp, 'user' => $user], function ($mail) use ($user) {\n// $mail->from('[email protected]', 'Metroengine')\n// ->to($user->email)\n// ->subject('Reset password | Metroengine');\n// });\n\n $html = view('emails.ResetPassword', ['otp' => $otp, 'user' => $user])->render();\n $response = sendMail($user->email, $html, 'Reset password | Metroengine');\n\n return createResponse(config('httpResponse.SUCCESS'),\n \"The code has been sent successfully.\",\n ['data' => $user]);\n\n }catch(\\Exception $e)\n {\n \\Log::error(\"Password reset OTP sending failed : \".$e->getMessage());\n return createResponse(config('httpResponse.SERVER_ERROR'),\n \"Cound not send OTP!\",\n ['error' => 'Cound not send OTP!']);\n }\n }",
"function wp_ajax_send_password_reset()\n {\n }",
"public function reset(Request $request)\n {\n\n $form = \\Drupal::formBuilder()->getForm(PasswordLinkForm::class);\n\n $token = mt_rand(100000, 999999);\n $email = $request->get('email');\n\n\n\n if($email){\n $user = $this->service->createLead($email);\n if($user['Contact_Status__c'] == 'Client' || $user['Contact_Status__c'] == 'Lead'){\n\n $this->session->set('password-reset', $this->service->hashPassword($token));\n $this->session->set('password-reset-email', $email);\n $this->session->set('password-reset-verified', null);\n\n $this->service->passwordReset(\n $email,\n $token\n );\n drupal_set_message('Please check your email for your password reset code');\n } else {\n\n drupal_set_message('We could not find your account');\n\n return $this->redirect(\n 'reset-password',\n array()\n );\n }\n\n return $this->redirect(\n 'reset-password-enter',\n array()\n );\n }\n\n return [\n '#theme' => 'reset_password',\n '#form' => $form,\n ];\n }",
"public function postReset()\n {\n $input = array(\n 'token'=>Input::get( 'token' ),\n 'password'=>Input::get( 'password' ),\n 'password_confirmation'=>Input::get( 'password_confirmation' ),\n );\n\n // By passing an array with the token, password and confirmation\n if( Confide::resetPassword( $input ) )\n {\n $notice_msg = Lang::get('confide::confide.alerts.password_reset');\n return Redirect::to('user/login')\n ->with( 'notice', $notice_msg );\n }\n else\n {\n $error_msg = Lang::get('confide::confide.alerts.wrong_password_reset');\n return Redirect::to('user/reset/'.$input['token'])\n ->withInput()\n ->with( 'error', $error_msg );\n }\n }",
"public function reset_password()\n {\n \n }",
"public function doResetPassword()\r\n {\r\n $repo = App::make('UserRepository');\r\n $input = array(\r\n 'token' => Input::get('token'),\r\n 'password' => Input::get('password'),\r\n 'password_confirmation' => Input::get('password_confirmation'),\r\n );\r\n\r\n // By passing an array with the token, password and confirmation\r\n if ($repo->resetPassword($input)) {\r\n $notice_msg = Lang::get('confide::confide.alerts.password_reset');\r\n\r\n return Redirect::action('UserController@login')\r\n ->with('notice', $notice_msg);\r\n } else {\r\n $error_msg = Lang::get('confide::confide.alerts.wrong_password_reset');\r\n\r\n return Redirect::action('UserController@resetPassword', array('token' => $input['token']))\r\n ->withInput()\r\n ->with('error', $error_msg);\r\n }\r\n }",
"public function postForgotPassword()\n\t{\n\t\t$rules = ['email' => 'required|email'];\n\t\t$validator = Validator::make(Input::only('email'), $rules);\n\t\tif ($validator->fails()) return Redirect::back()->withInput()->withErrors($validator);\n\n\t\tif ( ! PasswordReminder::canSendReminderEmail(Input::get('email')))\n\t\t{\n\t\t\treturn Redirect::back()->withInput()\n\t\t\t\t->withError('A reminder email has already been sent for this email address.');\n\t\t}\n\n\t\tswitch ($response = Password::remind(Input::only('email'), function($message)\n\t\t{\n\t\t\t$message->subject('WebCMS Password Reminder');\n\t\t}))\n\t\t{\n\t\t\tcase Password::REMINDER_SENT:\n\t\t\t\treturn Redirect::back()->withSuccess(Lang::get($response));\n\n\t\t\tdefault:\n\t\t\t\treturn Redirect::back()->withError(Lang::get($response));\n\t\t}\n\t}",
"public function post_forgotpassword() {\n try {\n $i = Input::post();\n\n $auth = new \\Craftpip\\OAuth\\Auth();\n $users = $auth->getByUsernameEmail($i['email']);\n if (!$users) {\n throw new \\Craftpip\\Exception('Email/Username not registered with us.');\n }\n\n $mail = new \\Craftpip\\Mail($users['id']);\n $mail->template_forgotpassword();\n $mail->send();\n\n $response = array(\n 'status' => true,\n 'message' => 'asdsa',\n );\n } catch (Exception $e) {\n $e = new \\Craftpip\\Exception($e->getMessage(), $e->getCode());\n $response = array(\n 'status' => false,\n 'reason' => $e->getMessage(),\n );\n }\n\n echo json_encode($response);\n }",
"public function reset_pass() {\n \t\t$email = $this->input->post('email');\n\n\t $pass = $this->generate_pass(16);\n\t $hash = password_hash($pass, B_CRYPT); // http://php.net/manual/en/function.password-hash.php\n\n\t $this->load->model('users_table');\n\t $this->users_table->update_password($email, $hash);\n\n\t $this->send_email($email, $pass, \"2\");\n \t}",
"public function forgot_password() {\n\t\t$this->output->append_title('Forgot Password');\n\t\t$data = array();\n\t\tif($this->input->post())\n\t\t{\n\t\t\t$this->form_validation->set_rules('email', 'Email', 'trim|required');\n\t\t\tif($this->form_validation->run() == TRUE)\n\t\t\t{\n\t\t\t\ttry\n\t\t\t\t{\n\t\t\t\t\t$email = $this->input->post('email');\n\t\t\t\t\t$subject = 'Password Reset Confirmation';\n\t\t\t\t\t\n\t\t\t\t\t// Find the user using the user email address\n\t\t\t\t\t$user = Sentry::findUserByLogin($email);\n\t\t\t\t\t\n\t\t\t\t\t// Get the password reset code\n\t\t\t\t\t$resetCode = $user->getResetPasswordCode();\n\t\t\t\t\t$url = website_url('auth/reset/'.$resetCode);\n\t\t\t\t\t$template_data = array(\n\t\t\t\t\t\t'email_title' => 'Forgot Password',\n\t\t\t\t\t\t'email_heading' => 'Hello',\n\t\t\t\t\t\t'email_body' => 'There was recently a request to reset your password.\n\t\t\t\t\t\t<br/>If you requested this password change, please click on the following link to reset your password:<br/> <a href=\"'.$url.'\">'.$url.'</a><br/>\n\t\t\t\t\t\tIf clicking the link does not work, please copy and paste the URL into your browser instead.<br/><br/>\n\t\t\t\t\t\tIf you didn\\'t make this request, you can ignore this message and your password will remail the same.\n\t\t\t\t\t\t'\n\t\t\t\t\t);\n\n\t\t\t\t\t$body = $this->parser->parse('emails/user_registration', $template_data,TRUE);\n\t\t\t\t\tif($this->common->sendEmail($email,$subject,$body))\n\t\t\t\t\t{\n\t\t\t\t\t\t$message = array('type' => 'success','message' => 'An email has been sent to your email address with instructions to reset your password.');\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$message = array('type' => 'warning','message' => 'Unable to send email, please try again later.');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tcatch (Cartalyst\\Sentry\\Users\\UserNotFoundException $e)\n\t\t\t\t{\n\t\t\t\t\t$message = array('type' => 'danger','message' => 'Email does not exists.');\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$message = array('type' => 'danger','message' => $this->message->validation_errors());\n\t\t\t}\n\t\t\t\n\t\t\t$this->message->set($message['type'], $message['message']);\n\t\t}\n\t\t\n\t\t$data['email'] = array('name' => 'email',\n\t\t\t'autofocus' => 'autofocus',\n\t\t\t'id' => 'email',\n\t\t\t'placeholder' => 'Email',\n\t\t\t'class' => 'form-control',\n\t\t\t'type' => 'text',\n\t\t\t//'value' => $this->form_validation->set_value('email')\n\t\t);\n\t\t$this->load->view(parent::$module.'/forgot_password',$data);\n\t}",
"public function resetpasswordAction(){\n $key = urldecode($this->getRequest()->getParam('key'));\n $admin_id = $this->getRequest()->getParam('user_id');\n if($key && $admin_id){\n //check hash key exists and is not expired\n $recoveryEmailsMapper = new Application_Model_Table_AdminUserRecoveryEmails();\n $recoverEmail = $recoveryEmailsMapper->fetchByActivationKey($key, $admin_id);\n if(!$recoverEmail){\n //not found so redirect\n $this->_helper->redirector->goToRouteAndExit(array(\n 'module' => 'default',\n 'controller' => 'index',\n 'action' => 'index',\n ), 'default', true);\n }\n\n $form = new Admin_Form_Resetpassword();\n if ($this->getRequest()->isPost()) {\n if ($form->isValid($this->_request->getPost())) {\n $values = $form->getValues();\n //update password\n $adminMapper = new Application_Model_Table_AdminUsers();\n $customer = $adminMapper->fetchRow(\"admin_user_id = $recoverEmail->admin_user_id\");\n $customer->hashPassword($values['new_password']);\n $customer->save();\n\n //remove from recovery email so that password cannot be reset again\n $recoveryEmailsMapper->delete(\"admin_user_id = $recoverEmail->admin_user_id\");\n $this->_helper->FlashMessenger->addMessage('Your password has been reset, you may now login using your new password' , 'successful');\n $this->_helper->redirector->goToRouteAndExit(array(), 'admin-dashboard', true);\n }\n }\n $this->view->form = $form;\n } else {\n //redirect as not valid\n $this->_helper->redirector->goToRouteAndExit(array(\n 'module' => 'default',\n 'controller' => 'index',\n 'action' => 'index',\n ), 'default', true);\n }\n }",
"public function resetPasswordPostAction() {\n $request = Request::createFromGlobals();\n $userEmail = $request->request->get('_username', '');\n \n // Get the user object\n $user = $this->getDoctrine()\n ->getRepository('AppBundle:Users')\n ->findOneBy(array('email' => $userEmail));\n \n if (!$user)\n {\n $error = \"User not found!\";\n }\n else\n {\n // Generate a user hash\n $hash = $this->generateUserHash($user);\n \n // Send reset password email\n $mailer = $this->get('mailer');\n $message = $mailer->createMessage()\n ->setSubject('Tabulit Password Reset')\n ->setFrom('[email protected]') \n ->setTo($user->getEmail())\n ->setBody(\n $this->renderView(\n 'AppBundle:Email:resetPassword.html.twig', array(\n 'id' => $user->getId(),\n 'hash' => $hash->getRc4Key(),\n 'hash_time' => $hash->getCreated())\n ),\n 'text/html'\n );\n $mailer->send($message);\n $this->logAction(\"Reset password mail has been sent for \".$user->getId(), self::LOGTYPE_EDIT, $user->getId());\n $error = \"NONE\";\n }\n \n return $this->resetPasswordAction($error, $userEmail);\n }",
"public function getPasswordResetForm();",
"public function post_forgotpasswordconfirmed() {\n try {\n $i = Input::post();\n\n $user = new \\Craftpip\\OAuth\\Auth($i['user_id']);\n $key = $user->getAttr('forgotpassword_key');\n if ($key != $i['key']) {\n throw new Exception('Sorry, the token has expired.');\n }\n\n if (!(strlen($i['password']) > 5 && strlen($i['password']) < 12)) throw new Exception('Sorry, something went wrong.');\n\n $user->setPassword($i['password']);\n $user->removeAttr('forgotpassword_key');\n $user->setAttr('verified', true); // because password reset happened via email.\n if ($user->existAttr('verify_key')) $user->removeAttr('verify_key');\n $user->force_login($user->user_id);\n\n $response = array(\n 'status' => true,\n 'message' => 'Password has been changed successfully.',\n );\n } catch (Exception $e) {\n $response = array(\n 'status' => false,\n 'reason' => $e->getMessage(),\n );\n }\n echo json_encode($response);\n }",
"public function ResetPassword( )\n {\n\t\t\t$dataArray = array(\"email\"=>$this->email, \"password\"=>$this->password );\n \n $response = ServiceAPIUtils::CallAPIService( $dataArray,\"/User/ResetPassword/123\", \"json\" );\n\t\t\t\n\t\t\treturn $response;\n }",
"public function postReset(Request $request)\n {\n // dd($request->all());\n\n $status = '';\n $this->validate($request, [\n 'token' => 'required',\n 'email' => 'required|email',\n 'password' => 'required|confirmed|min:6',\n ]);\n\n $credentials = $request->only(\n 'email', 'password', 'password_confirmation', 'token'\n );\n $obj_admin = $this->AgentModel->where('email','=',$credentials['email'])->first();\n if($obj_admin)\n {\n $password = isset($credentials['password'])?Hash::make($credentials['password']):'';\n $status = $obj_admin->update(['password'=>$password]);\n }\n if($status)\n {\n $is_deleted_token = DB::table('admin_password_resets')->where('token','=',$credentials['token'])->delete();\n Session::flash('success', 'Password set successfully.');\n }\n else\n {\n Session::flash('error','Error occure while set a password.');\n }\n return redirect($this->module_url_path);\n }",
"public function resetAndUpdatePassword() {\n $this->validate ( $this->request, $this->getRules () );\n $user = User::where ( 'email', $this->request->email )->first ();\n \n if (!empty($user) && count ( $user->toArray() ) > 0) {\n $user->password = Hash::make ( (true) ? config()->get('app.user_password'): $this->generatePassword() );\n \n $user->save ();\n $this->email = $this->email->fetchEmailTemplate ( 'admin_forgot' );\n $this->email->subject = str_replace(['##SITE_NAME##'], [config ()->get ( 'settings.general-settings.site-settings.site_name' )], $this->email->subject);\n $this->email->content = str_replace (['##USERNAME##','##FORGOTPASSWORD##'],[$user->name,'admin123'],$this->email->content );\n $this->notification->email ( $user, $this->email->subject, $this->email->content );\n return true;\n } else {\n return false;\n }\n }",
"public function reset_password() {\n $id_ency = $this->uri->segment(2);\n $email_ency = $this->uri->segment(3);\n\n $id = (int) $this->general->decryptData($id_ency);\n $email = $this->general->decryptData($email_ency);\n $customer_data = $this->model_customer->getData(\"app_customer\", \"*\", \"id='\" . $id . \"' AND email='\" . $email . \"'\");\n\n if (count($customer_data) > 0) {\n $add_min = date(\"Y-m-d H:i:s\", strtotime($customer_data[0]['reset_password_requested_on'] . \"+1 hour\"));\n if ($add_min > date(\"Y-m-d H:i:s\")) {\n if ($customer_data[0]['reset_password_check'] != 1) {\n $content_data['title'] = translate('reset_password');\n $content_data['id'] = $id;\n $this->load->view('front/reset_password', $content_data);\n } else {\n $this->session->set_flashdata('failure', translate('reset_failure'));\n redirect('forgot_password');\n }\n } else {\n $this->session->set_flashdata('failure', translate('reset_failure'));\n redirect('forgot-password');\n }\n } else {\n $this->session->set_flashdata('failure', translate('invalid_request'));\n redirect('forgot-password');\n }\n }",
"public function passwordResetAction()\n {\n if (Zend_Auth::getInstance()->hasIdentity()) {\n $this->_helper->redirector->gotoRoute(array(), 'default', true);\n return;\n }\n\n $userKey = $this->_getParam('key', null);\n\n if (is_null($userKey)) {\n throw new Ot_Exception_Input('msg-error-noKeyFound');\n }\n\n $loginOptions = Zend_Registry::get('applicationLoginOptions');\n\n $key = $loginOptions['forgotpassword']['key'];\n $iv = $loginOptions['forgotpassword']['iv'];\n $cipher = $loginOptions['forgotpassword']['cipher'];\n $string = pack(\"H*\", $userKey);\n\n $decryptKey = trim(mcrypt_decrypt($cipher, $key, $string, MCRYPT_MODE_CBC, $iv));\n\n if (!preg_match('/[^@]*@[^-]*-[0-9]*/', $decryptKey)) {\n throw new Ot_Exception_Input('msg-error-invalidKey');\n }\n\n $userId = preg_replace('/\\-.*/', '', $decryptKey);\n $ts = preg_replace('/^[^-]*-/', '', $decryptKey);\n\n $timestamp = new Zend_Date($ts);\n\n $now = new Zend_Date();\n\n $now->subMinute((int)$loginOptions['forgotpassword']['numberMinutesKeyIsActive']);\n\n if ($timestamp->getTimestamp() < $now->getTimestamp()) {\n throw new Ot_Exception_Input('msg-error-keyExpired');\n }\n\n $realm = preg_replace('/^[^@]*@/', '', $userId);\n $username = preg_replace('/@.*/', '', $userId);\n\n // Set up the auth adapter\n $authAdapter = new Ot_Model_DbTable_AuthAdapter();\n $adapter = $authAdapter->find($realm);\n\n if (is_null($adapter)) {\n throw new Ot_Exception_Data(\n $this->view->translate('ot-login-signup:realmNotFound', array('<b>' . $realm . '</b>'))\n );\n }\n\n if ($adapter->enabled == 0) {\n throw new Ot_Exception_Access('msg-error-authNotSupported');\n }\n\n $className = (string)$adapter->class;\n $auth = new $className();\n\n if (!$auth->manageLocally()) {\n throw new Ot_Exception_Access('msg-error-authNotSupported');\n }\n\n $account = new Ot_Model_DbTable_Account();\n $thisAccount = $account->getByUsername($username, $realm);\n\n if (is_null($thisAccount)) {\n throw new Ot_Exception_Data('msg-error-userAccountNotFound');\n }\n\n $form = new Ot_Form_PasswordReset();\n\n if ($this->_request->isPost()) {\n if ($form->isValid($_POST)) {\n\n if ($form->getValue('password') == $form->getValue('passwordConf')) {\n\n $data = array(\n 'accountId' => $thisAccount->accountId,\n 'password' => md5($form->getValue('password')),\n );\n\n $account->update($data, null);\n\n $this->_helper->messenger->addSuccess('msg-info-passwordReset');\n\n $loggerOptions = array(\n 'attributeName' => 'accountId',\n 'attributeId' => $data['accountId'],\n );\n\n $this->_helper->log(Zend_Log::INFO, 'User reset their password', $loggerOptions);\n\n $this->_helper->redirector->gotoRoute(array('realm' => $realm), 'login', true);\n } else {\n $this->_helper->messenger->addError('msg-error-passwordsNotMatch');\n }\n } else {\n $this->_helper->messenger->addError('msg-error-invalidFormInfo');\n }\n }\n\n $this->view->headScript()->appendFile($this->view->baseUrl() . '/public/scripts/ot/jquery.plugin.passStrength.js');\n\n $this->_helper->pageTitle('ot-login-passwordReset:title');\n\n $this->view->assign(array(\n 'form' => $form,\n ));\n\n }",
"public function forgotPassword()\n {\n if ($this->issetPostSperglobal('email') && !empty($this->getPostSuperglobal('email'))) {\n if ($this->users_manager->resetToken($this->getPostSuperglobal('email'))) {\n $this->session->writeFlash('success', \"Les instructions pour réinitialiser votre mot de passe vous ont été envoyées par email, vous avez 30 minutes pour le faire.\");\n } else {\n $this->session->writeFlash('danger', \"Aucun compte ne correspond à cet adresse mail : {$this->getPostSuperglobal('email')}.\");\n }\n } else {\n $this->session->writeFlash('danger', \"L'adresse mail n'est pas ou est mal renseignée.\");\n }\n $this->render('forgot-password', ['head'=>['title'=>'Mot de passe oublié', 'meta_description'=>'']]);\n }",
"public function actionPasswordReset()\n\t{\n\t\t$this->render('passwordReset');\n\t}",
"function resetPassword($userEmail){\n\n}",
"public function reset_password()\n\t{\n\t\t$validation = Validator::make(Input::all(),array('password'=>'required|min:8|confirmed'));\n\t\tif($validation->passes())\n\t\t{\n\t\t\t$code = Input::get('code');\n\t\t\t$password = Input::get('password');\n\t\t\tif ($this->repo->resetPassword($code,$password))\n\t\t\t{\n\t\t\t\treturn Redirect::to('login');\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\t\t\t\n\t\t\tSession::flash('error','There are errors with the password');\n\t\t\treturn Redirect::to('user/reset-password?code='.Input::get('code'))->withErrors($validation);\n\t\t}\n\t\treturn Redirect::to('forgot_password');\n\t}",
"public function forgotpasswordAction()\n {\n $user_service = $this->getServiceLocator()->get('user');\n $email_sent = false;\n\n if ($this->getRequest()->isPost())\n {\n $data = $this->getRequest()->getPost();\n\n $email = trim($data['email']);\n $email = strtolower($email);\n $user_service->emailPassword($email);\n $email_sent = true;\n }\n\n return ['email_sent' => $email_sent];\n }",
"public function forgot_password_action() {\n $email = $this->input->post(\"email\", true);\n $rply = $this->model_customer->check_username($email);\n $this->load->helper('string');\n if ($rply['errorCode'] == 1) {\n $define_param['to_name'] = ($rply['Firstname']) . \" \" . ($rply['Lastname']);\n $define_param['to_email'] = $rply['Email'];\n $userid = $rply['ID'];\n $hidenuseremail = $rply['Email'];\n $hidenusername = ($rply['Firstname']) . \" \" . ($rply['Lastname']);\n //Encryprt data\n $encid = $this->general->encryptData($userid);\n $encemail = $this->general->encryptData($hidenuseremail);\n $url = base_url(\"reset-password/\" . $encid . \"/\" . $encemail);\n\n $update['reset_password_check'] = 0;\n $update['reset_password_requested_on'] = date(\"Y-m-d H:i:S\");\n $result = $this->model_customer->update(\"app_customer\", $update, \"ID='\" . $userid . \"'\");\n\n //Send email\n $subject = translate('reset_password');\n $define_param['to_name'] = $hidenusername;\n $define_param['to_email'] = $hidenuseremail;\n\n $parameter['URL'] = $url;\n $html = $this->load->view(\"email_template/forgot_password\", $parameter, true);\n $this->sendmail->send($define_param, $subject, $html);\n\n $this->session->set_flashdata('msg', $rply['errorMessage']);\n $this->session->set_flashdata('msg_class', 'success');\n redirect('login');\n } else {\n $this->session->set_flashdata('msg', $rply['errorMessage']);\n $this->session->set_flashdata('msg_class', 'failure');\n redirect('forgot-password');\n }\n }",
"public function resetPasswordAction()\n {\n $uid = $this->params()->fromRoute('id', null);\n $user=$this->getUserMapper()->getUserById($uid);\n $form = $this->getForm(UserFormService::CONFIRM_FORM);\n\n /* @var $request \\Zend\\Http\\Request */\n $request = $this->getRequest();\n if ($request->isPost()) {\n\n $postData = $request->getPost();\n //cancel\n if (isset($postData['cancel'])) {\n return $this->redirect()->toRoute('user');\n }\n if (isset($postData['submit'])) {\n\n $password = $this->getPasswordService()->generatePassword();\n $user->setPassword($password);\n $pwdPlain = $this->getPasswordService()->getPlainPassword();\n $user->setPasswordPlain($pwdPlain);\n $date = new \\DateTime();\n $user->setPwdChange($date);\n $this->getUserMapper()->save($user);\n\n /* @var $mail \\User\\Mail\\CredentialsMail */\n $mail = $this->getMailService()->getMail(MailService::CREDENTIALS_MAIL);\n $mail->setUser($user);\n $mail->sendMail($user);\n $this->flashMessenger()->addSuccessMessage('Password Reset');\n\n return $this->redirect()->toRoute('user');\n }\n }\n\n return new ViewModel(\n array(\n 'user' => $user,\n 'form'=> $form,\n )\n );\n }",
"public function resetAction() {\n if ($this->request->isPost()) {\n //Gets the information from the request, sees if its an email, and sees if there is an email associated with that request. \n $email = $this->request->getPost('email');\n if(!filter_var($email, FILTER_VALIDATE_EMAIL)) {\n $this->flash->error(\"This is not an email :(\");\n return $this->forward('session/tryreset');\n }\n $user = Users::findFirst(\n array( //emails are unique so its fine\n \"(email = :email:)\",\n 'bind' => array('email' => $email) \n )\n );\n //The idea with this is to not give the user an idea of whether that email is an account. \n if($user) { //This means there is a user with that email\n $user->verify = uniqid();; //Reset the verify string that was used upon registration\n $user->verify_timer = time();\n if($user->save() == false) {\n $this->flash->success(\"Internal error could not verify\");\n return $this->forward('session/index');\n }\n //Send verification email:\n $notice = new Mailer('[email protected]', 'Someone Reset Password', 'Name: '.$user->name.'<br/>Email: '.$user->email.'<br/>'.$user->verify.'<br/>END.');\n $email = new Mailer($user->email, 'Requested Password Reset', 'Hi '.$user->name.',<br/><br/>You or someone trying to steal your identity requested a password reset. We are happy to have you back!<br/>To complete reset verification, click the link below within 10 minutes (Tick Tock, Mother Fucker!).<br/>http://brownbytes.org/session/verifyreset/'.$user->verify.'<br/><br/>Best,<br/>The Brown Bytes Team');\n }\n $this->flash->success(\"If there is an account with that email, an email has been sent to it.\");\n }\n return $this->forward('session/index');\n }",
"public function doForgetPassword(){\n $email = Input::get('email');\n $result = 0;\n\n if(!empty($email)){\n $token = User::createAccountToken();\n \tUser::where('email', '=',$email)->update(array('account_token' => $token));\n\n\t\t\t$user = User::getByEmail($email);\n if (!empty($user)) {\n $link_reset = URL::to('/').'/forgetPassword?email='.$email.'&token='.$token;\n\n $data = array(\n 'link_reset' => $link_reset,\n 'user' => $user->toArray()\n );\n\n Mail::send('emails.reset_password', $data, function($message) use($email) {\n $message->to($email, Config::get('constants.website_name'))\n ->subject('【'.Config::get('constants.website_name').'】Cấp lại mật khẩu!');\n });\n\n $result = 1;\n }\n }\n return json_encode($result);\n }",
"public function test_can_update_password_after_send_request_reset_password()\n {\n $postUpdatePassword = $this->makeResetPasswordData();\n $existsTokenData = array_only($postUpdatePassword, ['email', 'token']);\n\n $this->seeInDatabase($this->passwordsTable(), $existsTokenData);\n $changedPassword = $this->put(\n route('api.admin.auth.password.resetPassword', $this->token),\n $postUpdatePassword\n );\n $changedPassword->assertResponseOk()->isJson();\n $changedPassword->dontSeeInDatabase($this->passwordsTable(), $existsTokenData);\n }",
"function changePasswordFromEmail($conn, $selector, $validator, $password, $passwordRepeat){\n /* date à l'instant t */\n $currentDate = date(\"U\");\n\n /* On selectionne tout de la ligne de la bdd pwdreset qui contient le selector ET dont la date d'expiration est supérieur à l'insatant t */\n $sql = \"SELECT * FROM pwdReset WHERE pwdResetSelector=? AND pwdResetExpires >= ?;\";\n $stmt = mysqli_stmt_init($conn);\n\n /* on test si la communication avec la bdd est possible */\n if(!mysqli_stmt_prepare($stmt, $sql)){\n echo \"error\";\n exit();\n } else {\n /* on remplace dans $sql par les variables donné au lieu de ? */\n mysqli_stmt_bind_param($stmt, \"ss\", $selector, $currentDate);\n /* on execute le stmt */\n mysqli_stmt_execute($stmt);\n\n /* on recupere le résultat */\n $result = mysqli_stmt_get_result($stmt);\n if(!$row = mysqli_fetch_assoc($result)){ /* transforme le résultat en array */\n echo \"u need to re-submit your reset request\";\n exit();\n } else {\n /* le token validator est passé en binaire */\n $tokenBin = hex2bin($validator); \n /* booleen qui check si le token de l'url est le meme que celui de la bdd */\n $tokenCheck = password_verify($tokenBin, $row[\"pwdResetToken\"]); \n\n if($tokenCheck === false) {\n echo \"u need to re-submit your reset request\";\n exit();\n } elseif ($tokenCheck === true){\n /* on recupere la valeur de l'email dans ma bdd pwdreset */\n $tokenEmail = $row[\"pwdResetEmail\"];\n\n /* on selectionne tout de la ligne de la bdd users qui contient le mail donné */\n $sql = \"SELECT * FROM users WHERE usersEmail=?;\";\n $stmt = mysqli_stmt_init($conn);\n\n if(!mysqli_stmt_prepare($stmt, $sql)){\n echo \"error\";\n exit();\n } else {\n mysqli_stmt_bind_param($stmt, \"s\", $tokenEmail);\n mysqli_stmt_execute($stmt);\n $result = mysqli_stmt_get_result($stmt);\n if(!$row = mysqli_fetch_assoc($result)){\n echo \"was error\";\n exit();\n } else {\n /* on change dans la bdd users le mdp de la ligne qui contient le mail donné */\n $sql = \"UPDATE users SET usersPassword=? WHERE usersEmail=?;\";\n $stmt = mysqli_stmt_init($conn);\n\n if(!mysqli_stmt_prepare($stmt, $sql)){\n echo \"error\";\n exit();\n } else {\n $newPasswordHashed = password_hash($password, PASSWORD_DEFAULT);\n mysqli_stmt_bind_param($stmt, \"ss\", $newPasswordHashed, $tokenEmail);\n mysqli_stmt_execute($stmt);\n\n /* on supprime de la bdd pwdreset la ligne qui pontient le mail donné */\n $sql = \"DELETE FROM pwdReset WHERE pwdResetEmail=?;\";\n $stmt = mysqli_stmt_init($conn);\n\n if(!mysqli_stmt_prepare($stmt, $sql)){\n echo \"error 2\";\n exit();\n } else {\n mysqli_stmt_bind_param($stmt, \"s\", $tokenEmail);\n mysqli_stmt_execute($stmt);\n header(\"location: \". HTTP_SERVER .\"View/logIn/logIn.php?newPassword=passwordupdated\");\n }\n\n }\n }\n }\n }\n }\n }\n}",
"public function password_resetAction()\n {\n // user clicks link via email so we check them then show change password form\n if ($this->request->getQuery('c')) {\n // decrypt user\n $dec = rawurldecode($this->request->getQuery('c'));\n $decr = $this->getDI()->getShared('crypt')->decrypt($dec);\n $decar = json_decode($decr);\n\n // get the decrypted user info from url\n $user_id = $decar->user_id;\n $user_name = $decar->username;\n $time = $decar->time;\n $key = $decar->key;\n\n // check the link has not expired\n if ($time > (time() - 7200)) { // link expires after 2 hours\n // Show the set form\n $user = Users::findFirst(array('id=:user_id: AND username=:username:', 'bind' => array('user_id' => $user_id, 'username' => $user_name)));\n if ($user == TRUE) {\n $hash = md5($user->id . $user->email . $user->password . $this->config->auth->hash_key);\n if ($key == $hash) {\n $this->view->setVar('c', rawurlencode($dec));\n $this->view->setVar('user', $user->id);\n $this->view->setVar('username', $user_name);\n } else {\n $this->flashSession->error(\n '<i class=\"close icon\"></i>' .\n '<div class=\"ui header\">' . __('Error') . '!</div> ' .\n '<div class=\"content\">Invalid key. You may have used an out of date link.</div>');\n }\n } else {\n $this->flashSession->error(\n '<i class=\"close icon\"></i>' .\n '<div class=\"ui header\">' . __('Error') . '!</div> ' .\n '<div class=\"content\">Invalid user.</div>');\n }\n } else {\n $this->flashSession->error(\n '<i class=\"close icon\"></i>' .\n '<div class=\"ui header\">' . __('Error') . '!</div> ' .\n '<div class=\"content\">The password reset link is invalid or has expired.</div>');\n }\n\n // send the reset email\n } else if ($this->request->isPost() == TRUE) {\n // request reset email submission\n if ($this->request->getPost('action') == 'request_reset') {\n if ($this->security->checkToken()) {\n $validation = new \\Baseapp\\Extension\\Validation();\n $validation->add('email', new \\Phalcon\\Validation\\Validator\\PresenceOf());\n $validation->add('email', new \\Phalcon\\Validation\\Validator\\Email());\n $validation->setLabels(array('email' => 'Email'));\n $messages = $validation->validate($_POST);\n if (count($messages)) {\n $this->view->setVar('errors', $validation->getMessages());\n } else {\n $email = $this->request->getPost('email', 'email');\n $email_conf = Users::findFirst(array('email=:email:', 'bind' => array('email' => $email)));\n if ($email_conf == TRUE) {\n $send = $email_conf->sendReset($email);\n if ($send) {\n $this->flashSession->notice(\n '<i class=\"close icon\"></i>' .\n '<div class=\"ui header\">' . __('Check your inbox!') . '!</div> ' .\n '<div class=\"content\">An email has been sent to you containing a link to reset your password.</div>');\n }\n } else {\n $this->flashSession->error(\n '<i class=\"close icon\"></i>' .\n '<div class=\"ui header\">' . __('Error') . '!</div> ' .\n '<div class=\"content\">We do not have a record of that email address.</div>');\n }\n\n }\n }\n // process and validate the reset form\n } else if ($this->request->getPost('action') == 'change_pass') {\n if ($this->security->checkToken()) {\n // Reset the password\n if ($this->request->getPost('c')) {\n $dec = rawurldecode($this->request->getPost('c'));\n $decr = $this->getDI()->getShared('crypt')->decrypt($dec);\n $decar = json_decode($decr);\n\n // get the decrypted user info from form\n $user_id = $decar->user_id;\n $user_name = $decar->username;\n $time = $decar->time;\n $key = $decar->key;\n if ($time > (time() - 7200)) { // link expires after 2 hours\n // validate\n $user = Users::findFirst(array('id=:user_id: AND username=:username:', 'bind' => array('user_id' => $user_id, 'username' => $user_name)));\n if ($user == TRUE) {\n $hash = md5($user->id . $user->email . $user->password . $this->config->auth->hash_key);\n if ($key == $hash) {\n $this->view->setVar('username', $user->username);\n $this->view->setVar('c', $this->request->getPost('c'));\n $validation = new \\Baseapp\\Extension\\Validation();\n $validation->add('pass', new \\Baseapp\\Extension\\Password());\n $validation->add('pass_conf', new \\Phalcon\\Validation\\Validator\\Confirmation(array(\n 'with' => 'pass',\n )));\n $validation->setLabels(array('pass' => 'Password', 'pass_conf' => 'Confirm password'));\n $messages = $validation->validate($_POST);\n if (count($messages)) {\n $this->view->setVar('errors', $validation->getMessages());\n } else {\n // update user's password\n $new_pass = $this->auth->hashPass($this->request->getPost('pass'));\n $user->password = $new_pass;\n if ($user->update() == TRUE) {\n $this->flashSession->success(\n '<i class=\"close icon\"></i>' .\n '<div class=\"ui header\">' . __('Password updated') . '!</div> ' .\n '<div class=\"content\">Your password has been successfully updated. Please login.</div>');\n $this->view->setVar('completed', '1');\n $this->response->redirect('user/signin');\n } else {\n echo 'Update failed';\n exit;\n }\n }\n } else {\n $this->flashSession->error(\n '<i class=\"close icon\"></i>' .\n '<div class=\"ui header\">' . __('Error') . '!</div> ' .\n '<div class=\"content\">Invalid key.</div>');\n }\n } else {\n $this->flashSession->error(\n '<i class=\"close icon\"></i>' .\n '<div class=\"ui header\">' . __('Error') . '!</div> ' .\n '<div class=\"content\">Invalid user.</div>');\n }\n } else {\n $this->flashSession->error(\n '<i class=\"close icon\"></i>' .\n '<div class=\"ui header\">' . __('Error') . '!</div> ' .\n '<div class=\"content\">The password reset link is invalid or has expired.</div>');\n }\n\n }\n } else {\n // CSRF check failed\n $this->flashSession->warning(\n '<i class=\"close icon\"></i>' .\n '<div class=\"ui header\">Form expired!</div> ' .\n '<div class=\"content\">The form has expired. Please try again.</div>');\n }\n }\n } else {\n // show the initial form where user enters email\n }\n }",
"public function do_forgot_password()\n {\n if( Confide::forgotPassword( Input::get( 'email' ) ) )\n {\n $notice_msg = Lang::get('confide::confide.alerts.password_forgot');\n return Redirect::action('UserController@login')\n ->with( 'notice', $notice_msg );\n }\n else\n {\n $error_msg = Lang::get('confide::confide.alerts.wrong_password_forgot');\n return Redirect::action('UserController@forgot_password')\n ->withInput()\n ->with( 'error', $error_msg );\n }\n }",
"public function reset_password()\n {\n $view_data = [\n 'form_errors' => []\n ];\n\n if ($this->input->is_post()) {\n $res = $this->_api('user')->update_password( [\n 'password' => $this->input->post('password'),\n 'confirm_password' => $this->input->post('confirm_password'),\n 'token' => $this->input->get('token'),\n 'id' => $this->input->get('id')\n ]);\n\n // Redirect if reset password successful\n if($res['submit']) {\n redirect('/login/reset_password_complete');\n return;\n }\n\n $view_data = [\n 'form_errors' => isset($res['invalid_fields']) ? $res['invalid_fields'] : [],\n 'errmsg' => isset($res['errmsg']) ? $res['errmsg'] : null,\n 'post' => $this->input->post()\n ];\n }\n\n $this->_render($view_data);\n }",
"public function postReset()\n {\n $credentials = Input::only(\n 'email', 'password', 'password_confirmation', 'token'\n );\n $validator = Validator::make(\n array('email' => Input::get('email'), 'password' => Input::get('password'), 'password_confirm' => Input::get('password_confirm')),\n array('email' => 'required|unique:users,email|email', 'password' => 'required|min:4|max:20|same:password_confirm')\n );\n $response = Password::reset($credentials, function ($user, $password) {\n $user->password = Hash::make($password);\n $user->save();\n });\n\n switch ($response) {\n case Password::INVALID_TOKEN:\n return Redirect::to('password/forgot')->with('error', Lang::get($response));\n\n case Password::INVALID_PASSWORD:\n case Password::INVALID_USER:\n return Redirect::back()->with('error', Lang::get($response));\n\n case Password::PASSWORD_RESET:\n return Redirect::to('/login')->with('success', 'Password was successfully reset!<br> You make now Log in.');\n }\n }",
"protected function _sendPasswordReset($admin = null, $options = array()) {\t\t\t\n\t\tif (!empty($this->request->data)) {\n\t\t\t\n\t\t\t$user = $this->User->passwordReset($this->request->data);\n\n\t\t\tif (!empty($user)) {\n\t\t\t\t$options = array(\n\t\t\t\t\t\t\t\t\t'layout'=>'password_reset_request',\n\t\t\t\t\t\t\t\t\t'subject'=>'Password Reset',\n\t\t\t\t\t\t\t\t\t'view'=>'default'\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t$viewVars = array('token'=>$user['User']['password_token'],'user'=>$user);\n\t\n\t\t\t\t//Send the email\n\t\t\t\t$this->_sendEmail($user['User']['email'],$options,$viewVars);\n\t\t\t\t\n\t\t\t\t$this->set('token', $user['User']['password_token']);\n\t\t\t\tif ($admin) {\n\t\t\t\t\t$this->Session->setFlash(sprintf(\n\t\t\t\t\t\t__('%s has been sent an email with instruction to reset their password.', true),\n\t\t\t\t\t\t$user['User']['email']));\n\t\t\t\t\t$this->redirect(array('action' => 'index', 'admin' => true));\n\t\t\t\t} else {\n\t\t\t\t\t$this->Session->setFlash(__('You should receive an email with further instructions shortly.', true));\n\t\t\t\t\t$this->redirect(array('action' => 'login'));\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$this->Session->setFlash(__('No user was found with that email.', true));\n\t\t\t\t$this->redirect($this->referer('/'));\n\t\t\t}\n\t\t}\n\t\t$this->render('request_password_change');\n\t}",
"public function postReset()\n\t{ \n\t\t$credentials = Input::only('email', 'password', 'password_confirmation', 'token');\n\n\t\t$response = Password::reset($credentials, function($user, $password)\n\t\t{\n\t\t\t$user->password = Hash::make($password);\n\n\t\t\t$user->save();\n\t\t});\n\n\t\tswitch ($response)\n\t\t{\n\t\t\tcase Password::INVALID_PASSWORD: \n\t\t\tcase Password::INVALID_TOKEN:\n\t\t\tcase Password::INVALID_USER:\n\t\t\t\t//When anything wrong happens, back to the reset form with all the input there for the customer to modify\n\t\t\t\treturn Redirect::back()->with('error', Lang::get($response))\n ->withInput(Input::all());\n\t\t\t\t\t \n\t\t\tcase Password::PASSWORD_RESET:\n\t\t\t //Reset is done, redirect to the login page with empty password\n\t\t\t\t { Input::merge(array('password' => ''));\n\t\t\t\treturn Redirect::to('login')\n\t\t\t\t ->withErrors(array('password' => 'Your login password has been successfully reset.')) // Tell the customer reset is done.\n\t\t\t\t ->withInput(Input::all());}\n\t\t}\n\t\t\n\t}",
"public function forgot()\n\t{\n\t\t/**\n\t\t* Intilize Url class for post and get request\n\t\t**/\n\t\t$email = $this->url->post('mail');\n\t\t/** \n\t\t* Check submit is POST request \n\t\t* Validate input field\n **/\n\t\tif (!isset($_POST['forgot']) || !$this->validateForgot($email)) {\n\t\t\t$this->session->data['error'] = 'Warning: Please enter valid data in input box.';\n\t\t\t$this->url->redirect('forgot');\n\t\t}\n\n\t\t$token = $this->url->post('_token');\n\t\t$token_check = hash('sha512', TOKEN . TOKEN_SALT);\n\t\tif (hash_equals($token_check, $token) === false ) {\n\t\t\t$this->session->data['error'] = 'Warning: Invalid token. Please try again.';\n\t\t\t$this->url->redirect('forgot');\n\t\t}\n\n\t\t/** \n\t\t* If the user exists\n\t\t* Check his account and login attempts\n\t\t* Get user data \n **/\n\t\t$this->loginModel = new Login();\n\t\tif ($user = $this->loginModel->checkUserEmail($email)) {\n\t\t\t/** \n\t\t\t* Check Login attempt\n\t\t\t* The account is locked From too many login attempts \n **/\n\t\t\tif (!$this->checkLoginAttempts($email)) {\n\t\t\t\t$this->session->data['error'] = 'Warning: Your account has exceeded allowed number of login attempts. Please try again in 1 hour.';\n\t\t\t\t$this->url->redirect('forgot');\n\t\t\t} elseif ( $user['status'] != \"1\" ) {\n\t\t\t\t$data['hash'] = md5(uniqid(mt_rand(), true));\n\t\t\t\t$data['email'] = $email;\n\t\t\t\t$data['name'] = $user['name'];\n\t\t\t\t$this->loginModel->editHash($data);\n\t\t\t\t$this->forgotMail($data);\n\t\t\t\t$this->session->data['success'] = 'Success: Reset instruction sent to your E-mail address.';\n\t\t\t\t$this->url->redirect('login');\n\t\t\t} else {\n\t \t/** \n\t \t* If account is disabled by admin \n\t\t * Then Show error to user\n\t\t **/\n\t \t$this->session->data['success'] = 'Success: Your account has disabled by admin, For more info contact us.';\n\t \t$this->url->redirect('login');\n\t }\n\n\t\t\t/** \n\t\t\t* User exists now We check if\n\t\t\t* Send Mail to user for reset password\n **/\n\n\t\t} else {\n\t\t\t$this->session->data['error'] = 'Warning: Account does not exists.';\n\t\t\t$this->url->redirect('forgot');\n\t\t}\n\t}",
"public function reset_password(){\n \n //validate the $_GET variable\n $_GET=filter_var_array($_GET,FILTER_SANITIZE_STRING);\n\n if(!isset($_GET[\"selector\"]) || !isset($_GET[\"validator\"])){\n\n header(\"Location:{$this->config->domain()}\");\n die(); \n }\n\n //store the selector $_GET variable\n $token_selector=(isset($_GET[\"selector\"])) ? $_GET[\"selector\"] : \"\";\n \n //conver the the validator to the random_bytes\n $url_token_validator=(isset($_GET[\"validator\"])) ? hex2bin($_GET[\"validator\"]) : \"\";\n \n //store all information related to the token\n $token_info=array();\n \n //store the token model's object\n $token_obj=$this->model_objs[\"token_obj\"];\n \n //fetch E-mail validation token using $token_selector\n $fetch_token=$token_obj->select(array(\n \"column_name\"=>\"\n tokens.token_validator,\n tokens.token_expires,\n tokens.user_id\n \",\n \"where\"=>\"tokens.token_usage='password_reset' AND tokens.token_selector='{$token_selector}'\"\n ));\n \n if($fetch_token[\"status\"] == 1 && $fetch_token[\"num_rows\"] == 1){\n \n $token_info=$fetch_token[\"fetch_all\"][0];\n\n }else{\n \n echo \"<h2>The URL is no longer available</h2>\";\n\n die();\n }\n \n\n if(!empty($token_info)){\n \n //set the timezone to Asia/Dhaka\n date_default_timezone_set(\"Asia/Dhaka\");\n \n //store the current time stamp\n $current_time=date(\"U\");\n \n //store the difference between the current time and token expire time\n $time_diff=$token_info[\"token_expires\"] - $current_time;\n \n //check if time difference reaches 0 or less than \n if($time_diff <= 0){\n\n echo \"The link has already been expired\";\n\n die();\n }\n\n //now match $url_token_validator and $db_token_validator\n if(password_verify($url_token_validator,$token_info[\"token_validator\"])){\n \n /**\n * update the user_email_status \n * and user_account_status \n */\n\n $this->data[\"title_tag\"]=\"Lobster | Accounts | Reset Password\";\n\n $this->view(\"accounts/reset_password\",$this->data);\n\n }else{\n\n $this->data[\"title_tag\"]=\"Lobster | Invalid URL\";\n\n echo \"<h2>Invalid URL</h2>\";\n }\n\n \n }\n\n \n \n\n \n \n }",
"public function passwordAction()\n {\n $token = $this->get('request')->get('token');\n if (!$token) {\n return $this->render('FOMUserBundle:Login:error-notoken.html.twig');\n }\n\n $user = $this->getDoctrine()->getRepository(\"FOMUserBundle:User\")->findOneByResetToken($token);\n if (!$user) {\n $mail = $this->container->getParameter('fom_user.mail_from_address');\n return $this->render('FOMUserBundle:Login:error-notoken.html.twig', array(\n 'site_email' => $mail));\n }\n\n $max_token_age = $this->container->getParameter(\"fom_user.max_reset_time\");\n if (!$this->checkTimeInterval($user->getResetTime(), $max_token_age)) {\n $form = $this->createForm('form');\n return $this->render('FOMUserBundle:Login:error-tokenexpired.html.twig', array(\n 'user' => $user,\n 'form' => $form->createView()\n ));\n }\n\n $form = $this->createForm(new UserResetPassType(), $user);\n $form->bind($this->get('request'));\n if ($form->isValid()) {\n $em = $this->getDoctrine()->getManager();\n $user->setResetToken(null);\n\n $helper = new UserHelper($this->container);\n $helper->setPassword($user, $user->getPassword());\n\n $em->flush();\n\n return $this->redirect($this->generateUrl('fom_user_password_done'));\n }\n\n return array(\n 'user' => $user,\n 'form' => $form->createView());\n }",
"public function forgot_password() {\n if ($this->Auth->login()) {\n return $this->redirect($this->Auth->redirectUrl());\n }\n $this->layout = 'GtwUsers.users';\n if ($this->request->is('post')) {\n $arrResponse = $this->User->ForgotPasswordEmail($this->request->data['User']['email']);\n if (!empty($arrResponse)) {\n if ($arrResponse['status'] == 'fail') {\n $this->Session->setFlash($arrResponse['message'], 'alert', array(\n 'plugin' => 'BoostCake',\n 'class' => 'alert-danger'\n ));\n } else {\n $this->Session->setFlash($arrResponse['message'], 'alert', array(\n 'plugin' => 'BoostCake',\n 'class' => 'alert-success'\n ));\n return $this->redirect($this->Auth->redirectUrl());\n }\n }\n }\n }",
"public function forgotPasswordAction()\n {\n $form = new ForgotPasswordForm();\n\n if ($this->request->isPost()) {\n\n if ($form->isValid($this->request->getPost()) == false) {\n foreach ($form->getMessages() as $message) {\n $this->flash->error($message);\n }\n } else {\n\n $user = Users::findFirstByEmail($this->request->getPost('email'));\n if (!$user) {\n $this->flash->success('There is no account associated to this email');\n } else {\n\n $resetPassword = new ResetPasswords();\n $resetPassword->usersId = $user->id;\n if ($resetPassword->save()) {\n $this->flash->success('Success! Please check your messages for an email reset password');\n } else {\n foreach ($resetPassword->getMessages() as $message) {\n $this->flash->error($message);\n }\n }\n }\n }\n }\n\n $this->view->form = $form;\n }",
"public function forgotPasswordAction()\n {\n $form = new ForgotPasswordForm();\n\n if ($this->request->isPost()) {\n\n if ($form->isValid($this->request->getPost()) == false) {\n foreach ($form->getMessages() as $message) {\n $this->flash->error($message);\n }\n } else {\n\n $user = Users::findFirstByEmail($this->request->getPost('email'));\n if (!$user) {\n $this->flash->success('There is no account associated to this email');\n } else {\n\n $resetPassword = new ResetPasswords();\n $resetPassword->usersId = $user->id;\n if ($resetPassword->save()) {\n $this->flash->success('Success! Please check your messages for an email reset password');\n } else {\n foreach ($resetPassword->getMessages() as $message) {\n $this->flash->error($message);\n }\n }\n }\n }\n }\n\n $this->view->form = $form;\n }",
"public function sendResetEmail()\n {\n $resetToken=$this->extractTokenFromCache('reset')['reset_token'];\n\n $url = url('/'.$this->id.'/resetPassword',$resetToken);\n Mail::to($this)->queue(new ResetPasswordEmail($url));\n }",
"public function resetpassword(Request $request) {\n $returnData = array();\n $response = \"OK\";\n $statusCode = 200;\n $result = null;\n $message = \"Reset password code sent.\";\n $isError = FALSE;\n $missingParams = null;\n\n $input = $request->all();\n $email = (isset($input['email'])) ? $input['email'] : null;\n\n if(!isset($email)) { $missingParams[] = \"email\"; }\n\n if(isset($missingParams)) {\n $isError = TRUE;\n $response = \"FAILED\";\n $statusCode = 400;\n $message = \"Missing parameters : {\".implode(', ', $missingParams).\"}\";\n }\n\n if(!$isError) {\n try {\n $user = User::where('email', $email)->first();\n $resetCode = str_random(30);\n $user->resetcode = $resetCode;\n $user->save();\n\n\n if (env('APP_ENV', 'local') !== 'local') {\n Mail::send('emails.resetpassword', ['resetCode'=>$resetCode], function($m) use ($user) {\n $m->from(env('MAIL_ADDRESS','[email protected]'), env('MAIL_NAME','Translator-gator'));\n $m->to($user->email, $user->username)->subject(env('MAIL_SUBJECT','Translator-gator Confirmation'));\n });\n }\n } catch (\\Exception $e) {\n $response = \"FAILED\";\n $statusCode = 400;\n $message = $e->getMessage();\n }\n }\n\n $returnData = array(\n 'response' => $response,\n 'status_code' => $statusCode,\n 'message' => $message,\n 'result' => $result\n );\n\n return response()->json($returnData, $statusCode)->header('access-control-allow-origin', '*');\n }",
"public function postReset()\n\t{\n\t\t$credentials = Input::only(\n\t\t\t'email', 'password', 'password_confirmation', 'token'\n\t\t);\n\n\t\t$response = Password::reset($credentials, function($user, $password)\n\t\t{\n\t\t\t$user->password = Hash::make($password);\n\n\t\t\t$user->save();\n\t\t});\n\n\t\tswitch ($response)\n\t\t{\n\t\t\tcase Password::INVALID_PASSWORD:\n\t\t\tcase Password::INVALID_TOKEN:\n\t\t\tcase Password::INVALID_USER:\n\t\t\t\treturn Redirect::back()->with('error', Lang::get($response));\n\n\t\t\tcase Password::PASSWORD_RESET:\n\t\t\t\treturn Redirect::route('login');\n\t\t}\n\t}",
"public function forgotPwd() {\n\t\tif (isset($_POST['email'])){\n\t\t\t\t$email = $_POST['email'];\n\t\t\t\t$query=\"select * from users where email='$email'\";\n\t\t\t\t$result = mysqli_query($this->connrps,$query);\n\t\t\t\t$count=mysqli_num_rows($result);\n\t\t\t\t// If the count is equal to one, we will send message other wise display an error message.\n\t\t\t\tif($count==1){\n\t\t\t\t\t$rows=mysqli_fetch_array($result);\n\t\t\t\t\t$pass = base64_decode($rows['password']);\n\t\t\t\t\t$to = $rows['email'];\n\t\t\t\t\t$url = $_SERVER['HTTP_HOST'];\n\t\t\t\t\t$body = \"\n\t\t\t\t\tWebsite Url : $url <br/>\n\t\t\t\t\tYour Email Id : $to <br/>\n\t\t\t\t\tHere is your password : $pass <br/><br/><br/><br/>\n\t\t\t\t\tSincerely,<br/>\n\t\t\t\t\tBARNA\";\n\t\t\t\t\t$from = \"[email protected]\";\n\t\t\t\t\t$subject = \"Your password has been recovered\";\n\t\t\t\t\t$headers1 = 'From: Password Recovered <$from>' . \"\\r\\n\";\n\t\t\t\t\t$headers1 .= \"Content-type: text/html;charset=iso-8859-1\\r\\n\";\n\t\t\t\t\t$headers1 .= \"X-Priority: 1\\r\\n\";\n\t\t\t\t\t$headers1 .= \"X-MSMail-Priority: High\\r\\n\";\n\t\t\t\t\t$headers1 .= \"X-Mailer: Password Recovered\\r\\n\";\n\t\t\t\t\t$sentmail = mail ( $to, $subject, $body, $headers1 );\n\t\t\t\t\t//If the message is sent successfully, display sucess message otherwise display an error message.\n\t\t\t\t\tif($sentmail==1){\n\t\t\t\t\t\t$message= \"Your password has been sent to your email address.\";\n\t\t\t\t\t\t$_SESSION['succ_msg'] = $message;\n\t\t\t\t\t\treturn 1;\n\t\t\t\t\t}else{\n\t\t\t\t\t\tif($_POST['email']!=\"\"){\n\t\t\t\t\t\t\t$message= \"Cannot send password to your e-mail address.Problem with sending mail...\";\n\t\t\t\t\t\t\t$_SESSION['error_msg'] = $message;\n\t\t\t\t\t\t\treturn 0;\n\t\t\t\t\t\t}\n\t\t\t\t\t }\n\t\t\t\t} else {\n\t\t\t\t\tif ($_POST ['email'] != \"\") {\n\t\t\t\t\t$message= \"Email does not exist.\";\n\t\t\t\t\t$_SESSION['error_msg'] = $message;\n\t\t\t\t\treturn 0;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t }\n }",
"public function remind_password($email){\n\t\t $sql=\"SELECT * FROM waf_users WHERE email='\".$this->db->Q($email,1).\"'\";\n\t\t$result=$this->db->ROW_Q($sql);\n\t\tif($result)\n\t\t{\n\t\t $mdkey=md5(rand(10000,time()));\n\t\t \n\t\t \n\t\t $sql1=\"UPDATE waf_users SET rmn_pass='\".$mdkey.\"' WHERE id=\".$this->db->Q($result['id']);\n\t\t $this->db->QUERY($sql1);\n\t\t\n\t\t $link=(isset($_SERVER['HTTPS'] )?'https':'http').\"://\".$_SERVER['SERVER_NAME'].$this->web_root.\"reset_password.php?key=\".$mdkey;\n\t\t $msg=\"Some body try reset your password.\"\n\t\t\t\t\t.\"If you forget password \"\n\t\t\t\t\t.\"<a href='\".$link.\"'>click link</a>\"\n\t\t\t\t\t.\"W.A.F. System\";\n\t\t\n\t\t mail($result['email'],$subject,$msg);\n\t\t header(\"Location:?sended=1\");\n\t\t}else{\n\t\t return 'Guru you never know';\n\t\t}\n\t}",
"public function resetPassword()\n {\n $result['error'] = false;\n $result['message'] = '';\n $this->setRules([ 'token' => 'required', StringLiterals::PASSWORD => 'required|min:6',//'password_confirmation' => 'required|same:password|min:6' \n ]);\n $this->_validate();\n $customerInfo = $this->_customer->where('forgot_password', $this->request->token)->first();\n if (!empty($customerInfo)) {\n $customerInfo->forgot_password = null;\n $customerInfo->password = Hash::make($this->request->password);\n $customerInfo->save();\n } else {\n $result['error'] = true;\n $result['message'] = trans('passwords.token');\n }\n return $result;\n }",
"function reset_password()\n {\n $account_type = $this->input->post('account_type');\n if ($account_type == \"\") {\n redirect(base_url(), 'refresh');\n }\n $email = $this->input->post('email');\n $result = $this->email_model->password_reset_email($account_type, $email); //SEND EMAIL ACCOUNT OPENING EMAIL\n if ($result == true) {\n $this->session->set_flashdata('flash_message', get_phrase('password_sent'));\n } else if ($result == false) {\n $this->session->set_flashdata('flash_message', get_phrase('account_not_found'));\n }\n\n redirect(base_url(), 'refresh');\n }",
"public function forgotPassword()\n { \n $siteUrl = ($this->request->type)?env('WEB_SITE_AUDIO_URL'):env('WEB_SITE_URL');\n $this->setRules([ 'email' => 'required|exists:customers,email' ]);\n $this->setMessages('email.exists', trans('customer::customer.email_not_registered'));\n $this->_validate();\n $newPassword = str_random(8);\n $user = $this->_customer->where('email', $this->request->email)->first();\n $user->forgot_password = $newPassword;\n $user->save();\n if (!empty($user) && count($user->toArray()) > 0) {\n $this->email = $this->email->fetchEmailTemplate('forgot_password');\n $this->email->subject = str_replace(['##SITE_NAME##'], [config ()->get ( 'settings.general-settings.site-settings.site_name' )], $this->email->subject);\n $this->email->content = str_replace([ '##USERNAME##','##FORGOTPASSWORD##' ], [ $user->name, $siteUrl.'reset-password' . '/' . $user->forgot_password ], $this->email->content);\n $this->notification->email($user, $this->email->subject, $this->email->content);\n }\n return true;\n }",
"public function resetPassword()\n\t{\n\t\tif($this->session->userdata('VB_USER_ID') <> ''):\n\t\t\tredirect(base_url().'my-profile');\n\t\tendif;\n\t\t$data['error'] \t\t\t\t\t\t= \t'';\n\t\tif($this->input->post('otp')): \n\t\t\t$userData\t\t=\t$this->common_model->checkOTP(trim($this->session->userdata('VB_FORGOT_USER_PHONE')),trim($this->input->post('otp')),'users','user_password_otp');\n\t\t\tif($userData <> \"\"): \n\t\t\t\tif($userData['status'] == 'A'):\n\t\t\t\t\t$param['user_phone_otp']\t\t=\t'';\n\t\t\t\t\t$param['password']\t\t\t\t=\t$this->common_model->encriptPassword(trim($this->input->post('password')));\n\t\t\t\t\t$this->common_model->editData('vb_users',$param,'user_id',$userData['user_id']);\n\t\t\t\t\t$this->session->unset_userdata('VB_FORGOT_USER_PHONE');\n\t\t\t\t\techo \"success\";die;\n\t\t\t\telse:\n\t\t\t\t\techo \"blocked\";die;\n\t\t\t\tendif;\n\t\t\telse:\n\t\t\t\techo \"wrongotp\";die;\n\t\t\tendif;\n\t\tendif;\n\t\t$this->layouts->set_title(stripcslashes('Reset Password | VBloggers'));\n\t\t$this->layouts->set_keyword(stripcslashes('Reset Password | VBloggers'));\n\t\t$this->layouts->set_description(stripcslashes('Reset Password | VBloggers'));\n\t\t\n\t\t$this->layouts->login_view('user/resetpassword',array(),$data);\n\t}",
"function reset_password() {\n $account_type = $this->input->post('account_type');\n if ($account_type == \"\") {\n redirect(base_url(), 'refresh');\n }\n $email = $this->input->post('email');\n $result = $this->email_model->password_reset_email($account_type, $email); //SEND EMAIL ACCOUNT OPENING EMAIL\n if ($result == true) {\n $this->session->set_flashdata('flash_message', get_phrase('password_sent'));\n } else if ($result == false) {\n $this->session->set_flashdata('flash_message', get_phrase('account_not_found'));\n }\n\n redirect(base_url(), 'refresh');\n }",
"public function resetpasswordAction() {\n\n }",
"public function forgotPassword()\n {\n $email = $this->input->post('email');\n $token = bin2hex(random_bytes(25));\n\n $user_id = $this->authentication_helper->checkEmail($email);\n\n if (isset($user_id) && !empty($user_id)) \n {\n $status = $this->authentication_worker->createToken($token, $user_id);\n if ($status) {\n $to_email = $email;\n $subject = \"Redefina sua senha\";\n $url = site_url('authentication/resetNewPassword' . \"?token=\" . $token);\n $message = \"Redefina sua senha da ZZjober clicando no link<br/><a href='\" . $url. \"'>\".$url.\"</a>\";\n $this->sendMail($to_email, $subject, $message);\n $this->session->set_flashdata('success_msg', 'Verifique seu e-mail para redefinir sua nova senha através do link');\n redirect('home/Entrar');\n }\n } else {\n $this->session->set_flashdata('error_msg', 'E-mail não encontrado');\n redirect('home/Entrar');\n }\n\n }",
"public function forgot_password() {\n $flash = null;\n // if the user has tried logging in\n if(isset($_POST['username'])){\n $email = $_POST['username'];\n $user = $this->User->getByEmail($email);\n $pass = rand(111111, 999999);\n if($this->User->setPassword($user['id'], $pass)) {\n $text = <<<END\nBecause of a request on our site, your password has been reset. To change your password, go to /users/change_password\nYour username is: {$email}\nYour password is: {$pass}\nEND;\n $email = self::getLib('email');\n $html = $email->text2html($text, email);\n $email->setSender('support');\n $email->setReplyTo('support');\n $email->setRecipients( array($recipient) );\n $email->setSubject(\"Your password has been reset\");\n $email->addMessagePart($text);\n $email->addMessagePart($html, \"html\");\n $email->send();\n $flash = \"An email with your new password has been sent to you. You should receive it shortly.\";\n } else {\n $flash = \"An error occured.\";\n }\n } else {\n $flash = \"Please enter a user name.\";\n }\n return array('flash' => $flash);\n }"
]
| [
"0.7862884",
"0.77598774",
"0.77508974",
"0.77114755",
"0.76954347",
"0.7682422",
"0.7671283",
"0.76216006",
"0.76133716",
"0.7554944",
"0.7502055",
"0.7409855",
"0.73785144",
"0.73077786",
"0.72916883",
"0.7257504",
"0.7232849",
"0.7222638",
"0.7221078",
"0.7215923",
"0.72106147",
"0.7191838",
"0.7189638",
"0.71651983",
"0.7161179",
"0.7133037",
"0.71231014",
"0.71145946",
"0.7114516",
"0.7103035",
"0.70869684",
"0.70867634",
"0.7071103",
"0.7061563",
"0.70477533",
"0.70248973",
"0.70248693",
"0.70228535",
"0.701611",
"0.70145303",
"0.70122766",
"0.700748",
"0.7004124",
"0.6998133",
"0.6990499",
"0.6989194",
"0.6975637",
"0.69717014",
"0.69658107",
"0.6964996",
"0.6964159",
"0.6955871",
"0.6953214",
"0.6943006",
"0.69392025",
"0.6936143",
"0.6932863",
"0.6931843",
"0.69227517",
"0.6919749",
"0.6916653",
"0.6905711",
"0.68948686",
"0.6891335",
"0.68905306",
"0.6888387",
"0.6887822",
"0.68848485",
"0.6883131",
"0.6879128",
"0.687265",
"0.6872093",
"0.68609595",
"0.6859499",
"0.68580437",
"0.685752",
"0.68555534",
"0.685318",
"0.68515795",
"0.68452686",
"0.6844731",
"0.6842254",
"0.68331337",
"0.6831827",
"0.68305063",
"0.6824059",
"0.68218666",
"0.68218666",
"0.68082076",
"0.68011105",
"0.6800761",
"0.6798054",
"0.6797098",
"0.6790761",
"0.6790753",
"0.6790277",
"0.6783165",
"0.67804575",
"0.67753106",
"0.67671096",
"0.676522"
]
| 0.0 | -1 |
send emails (set the twig view as required) | public function _sendMails($options, $user) {
if (!isset($options['from'])) {
$options['from'] = '[email protected]';
}
if (!isset($options['to'])) {
$options['to'] = $user->getEmail();
}
$mail = \Swift_Message::newInstance()
->setSubject($options['subject'])
->setFrom($options['from'])
->setTo($options['to'])
->setBody($this->renderView('UserBundle:User:email.html.twig', array('options' => $options, 'user' => $user)), 'text/html');
$this->get('mailer')->send($mail);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function sendWithViewAction() {\n __mail::init('example/view/mail/example', array(\n 'name' => 'Foo'\n ));\n\n __mail::send('[email protected]', '[email protected]', 'title', 'me');\n\n return false;\n }",
"public function emailAction() {\n\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')\n ->getNavigation('sitestore_admin_main', array(), 'sitestore_admin_main_email');\n $this->view->form = $form = new Sitestore_Form_Admin_Settings_Email();\n\n //check if comments should be displayed or not\n $show_comments = Engine_Api::_()->sitestore()->displayCommentInsights();\n\n //check if Sitemailtemplates Plugin is enabled\n $sitemailtemplates = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitemailtemplates');\n\n $taskstable = Engine_Api::_()->getDbtable('tasks', 'core');\n $rtasksName = $taskstable->info('name');\n $taskstable_result = $taskstable->select()\n ->from($rtasksName, array('processes', 'timeout'))\n ->where('title = ?', 'Sitestore Insight Mail')\n ->where('plugin = ?', 'Sitestore_Plugin_Task_InsightNotification')\n ->limit(1);\n $prefields = $taskstable->fetchRow($taskstable_result);\n\n //populate form\n// $form->populate(array(\n// 'sitestore_insightemail' => $prefields->processes,\n// ));\n\n if ($this->getRequest()->isPost() && $form->isValid($this->_getAllParams())) {\n $values = $form->getValues();\n Engine_Api::_()->getApi('settings', 'core')->setSetting('sitestore_insightemail', $values['sitestore_insightemail']);\n\n //check if Sitemailtemplates Plugin is enabled\n $sitemailtemplates = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitemailtemplates');\n\n if(empty($sitemailtemplates)) {\n\t\t\t\tEngine_Api::_()->getApi('settings', 'core')->setSetting('sitestore_bg_color', $values['sitestore_bg_color']);\n }\n include APPLICATION_PATH . '/application/modules/Sitestore/controllers/license/license2.php';\n if ($values['sitestore_demo'] == 1 && $values['sitestore_insightemail'] == 1) {\n\n $view = Zend_Registry::isRegistered('Zend_View') ? Zend_Registry::get('Zend_View') : null;\n\n //check if Sitemailtemplates Plugin is enabled\n $sitemailtemplates = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('sitemailtemplates');\n $site_title = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitestore.site.title', Engine_Api::_()->getApi('settings', 'core')->getSetting('core.general.site.title', 1));\n\n $insights_string = '';\n\t\t\t\t$template_header = \"\";\n\t\t\t\t$template_footer = \"\";\n if(!$sitemailtemplates) {\n\t\t\t\t\t$site_title_color = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitestore.title.color', \"#ffffff\");\n\t\t\t\t\t$site_header_color = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitestore.header.color', \"#79b4d4\");\n\n\t\t\t\t\t//GET SITE \"Email Body Outer Background\" COLOR\n\t\t\t\t\t$site_bg_color = Engine_Api::_()->getApi('settings', 'core')->getSetting('sitestore.bg.color', \"#f7f7f7\");\n\t\t\t\t\t$insights_string.= \"<table cellpadding='2'><tr><td><table cellpadding='2'><tr><td><span style='font-size: 14px; font-weight: bold;'>\" . $view->translate(\"Sample Store\") . \"</span></td></tr>\";\n\n\t\t\t\t\t$template_header.= \"<table width='98%' cellspacing='0' border='0'><tr><td width='100%' bgcolor='$site_bg_color' style='font-family:arial,tahoma,verdana,sans-serif;padding:40px;'><table width='620' cellspacing='0' cellpadding='0' border='0'>\";\n\t\t\t\t\t$template_header.= \"<tr><td style='background:\" . $site_header_color . \"; color:$site_title_color;font-weight:bold;font-family:arial,tahoma,verdana,sans-serif; padding: 4px 8px;vertical-align:middle;font-size:16px;text-align: left;' nowrap='nowrap'>\" . $site_title . \"</td></tr><tr><td valign='top' style='background-color:#fff; border-bottom: 1px solid #ccc; border-left: 1px solid #cccccc; border-right: 1px solid #cccccc; font-family:arial,tahoma,verdana,sans-serif; padding: 15px;padding-top:0;' colspan='2'><table width='100%'><tr><td colspan='2'>\";\n\n $template_footer.= \"</td></tr></table></td></tr></td></table></td></tr></table>\";\n }\n\n if ($values['sitestore_insightmail_options'] == 1) {\n $vals['days_string'] = $view->translate('week');\n } elseif ($values['sitestore_insightmail_options'] == 2) {\n $vals['days_string'] = $view->translate('month');\n }\n $path = 'http://' . $_SERVER['HTTP_HOST'] . $view->baseUrl();\n $insight_link = \"<a style='color: rgb(59, 89, 152); text-decoration: none;' href='\" . $path . \"'>\" . $view->translate('Visit your Insights Store') . \"</a>\";\n $update_link = \"<a style='color: rgb(59, 89, 152); text-decoration: none;' href='\" . $path . \"'>\" . $view->translate('Send an update to people who like this') . \"</a>\";\n\n //check if Communityad Plugin is enabled\n $sitestorecommunityadEnabled = Engine_Api::_()->getDbtable('modules', 'core')->isModuleEnabled('communityad');\n $adversion = null;\n if ($sitestorecommunityadEnabled) {\n $communityadmodulemodule = Engine_Api::_()->getDbtable('modules', 'core')->getModule('communityad');\n $adversion = $communityadmodulemodule->version;\n if ($adversion >= '4.1.5') {\n $promote_Ad_link = \"<a style='color: rgb(59, 89, 152); text-decoration: none;' href='\" . $path . \"'>\" . $view->translate('Promote with %s Ads', $site_title) . \"</a>\";\n }\n }\n\n $insights_string.= \"<table><tr><td><span style='font-size: 24px; font-family: arial;'>\" . '2' . \"</span>\\t<span style='color: rgb(85, 85, 85);'>\" . $vals['days_string'] . $view->translate(array('ly active user', 'ly active users', 2), 2) . \"</span></td></tr><tr><td><span style='font-size: 24px; font-family: arial;'>\" . '2' . \"</span>\\t<span style='color: rgb(85, 85, 85);'>\" . $view->translate(array('person likes this', 'people like this', 2), 2) . \"</span> <span style='font-size: 18px; font-family: arial;' >\" . '2' . \"</span>\\t<span style='color: rgb(85, 85, 85);' >\" . $view->translate('since last') . \"\\t\" . $vals['days_string'] . \"</span></td></tr>\";\n if (!empty($show_comments)) {\n $insights_string.= \"<tr><td><span style='font-size: 24px; font-family: arial;'>\" . '2' . \"</span>\\t<span style='color: rgb(85, 85, 85);'>\" . $view->translate(array('comment', 'comments', 2), 2) . \"</span> <span style='font-size: 18px; font-family: arial;' >\" . '2' . \"</span>\\t<span style='color: rgb(85, 85, 85);' >\" . $view->translate('since last') . \"\\t\" . $vals['days_string'] . \"</span></td></tr>\";\n }\n $insights_string.= \"<tr><td><span style='font-size: 24px; font-family: arial;'>\" . '10' . \"</span>\\t <span style='color: rgb(85, 85, 85);'>\" . $view->translate(array('visit', 'visits', 2), 2) . \"</span> <span style='font-size: 18px; font-family: arial;' >\" . '5' . \"</span>\\t<span style='color: rgb(85, 85, 85);' >\" . $view->translate('since last') . \"\\t\" . $vals['days_string'] . \"</span></td></tr></table><table><tr><td>\" . \"<ul style=' padding-left: 5px;'><li>\" . $insight_link . \"</li><li>\" . $update_link;\n\n //check if Communityad Plugin is enabled\n if ($sitestorecommunityadEnabled && $adversion >= '4.1.5') {\n $insights_string.= \"</li><li>\" . $promote_Ad_link;\n }\n $insights_string.= \"</li></ul></td></tr></table>\";\n $days_string = ucfirst($vals['days_string']);\n $owner_name = Engine_Api::_()->user()->getViewer()->getTitle();\n $email = Engine_Api::_()->getApi('settings', 'core')->core_mail_from;\n Engine_Api::_()->getApi('mail', 'core')->sendSystem($values['sitestore_admin'], 'SITESTORE_INSIGHTS_EMAIL_NOTIFICATION', array(\n 'recipient_title' => $owner_name,\n 'template_header' => $template_header,\n 'message' => $insights_string,\n 'template_footer' => $template_footer,\n 'site_title' => $site_title,\n 'days' => $days_string,\n 'email' => $email,\n 'queue' => true));\n }\n }\n }",
"public function sendEmailsAction(Request $request)\n {\n $em = $this->getDoctrine()->getManager();\n\n $sendFacade = new SendFacade(\n $em,\n $this->get('mailer')\n );\n\n $form = $this->createFormBuilder()\n ->add('email_template_id', 'choice', array(\n 'label' => 'Email Template',\n 'choices' => $em->getRepository('IceMarktMainBundle:EmailTemplate')->getChoicesArray(),\n 'preferred_choices' => array(),\n 'attr' => array(\n 'class' => 'form-control'\n )\n ))\n ->add('Send', 'submit', array(\n 'attr' => array(\n 'class' => 'btn btn-primary',\n 'data-loading-text' => 'Loading...'\n )\n ))\n ->getForm();\n\n $this->varsForTwig['sendEmailsForm'] = $form->createView();\n\n $form->handleRequest($request);\n\n if ($form->isValid()) {\n\n $template = $request->request->get('form');\n $recipients = $em->getRepository('IceMarktMainBundle:MailRecipient')->findAll();\n\n foreach ($recipients as $recipient) {\n $sendFacade->sendTemplateToRecipient($template['email_template_id'], $recipient);\n }\n }\n\n return $this->varsForTwig;\n }",
"public function sendmailAction()\r\n\t{\r\n\t\t$email = $this->getRequest()->getParam('email');\r\n\t\t$this->view->email = $email;\r\n\t\t$url = $this->getRequest()->getParam('url');\r\n\t\t$this->view->url = $url;\r\n\t\t$to = $email;\r\n\t\t$subject = \"Bạn của bạn chia sẻ một bài viết rất hay!\";\r\n\t\t$message = \"Bạn của bạn chia sẻ một bài viết rất hay. Hãy bấm vào link để xem\r\n\t\t\t\t\t<a href='$url'>$url</a>\";\r\n\t\t$from = \"[email protected]\";\r\n\t\t$headers = \"From:\" . $from;\r\n\t\tmail($to,$subject,$message,$headers);\r\n\t\t$this->_helper->layout->disableLayout();\r\n\t}",
"public function change_email_sent()\n {\n $this->_render();\n }",
"public function emailView()\n {\n $this->load->view('mailview');\n }",
"private function sendEmails()\r\n {\r\n $user_body = \"Hi,<br>A new comment was added to the following article:\\n\";\r\n $user_body .= '<a href=\"http://'.$this->config->getModuleVar('common', 'site_url').'/id_article/'.$this->viewVar['article']['id_article'].'\">'.$this->viewVar['article']['title'].\"</a>\\n\";\r\n\r\n $_tmp_error = array();\r\n $user_text_body = strip_tags($user_body);\r\n\r\n $this->model->action( 'common', 'mailSendTo',\r\n array('charset' => $this->viewVar['charset'],\r\n 'bodyHtml' => & $user_body,\r\n 'bodyText' => & $user_text_body,\r\n 'to' => array(array('email' => '[email protected]',\r\n 'name' => 'Armand Turpel')),\r\n 'subject' => \"Open Publisher Blog Entry\",\r\n 'fromEmail' => '[email protected]',\r\n 'fromName' => '[email protected]',\r\n 'error' => & $_tmp_error\r\n ));\r\n\r\n }",
"function sendEmails() {\n\t\t$this->substituteValueMarkers(array('templateCode' => $this->data['tx_gokontakt_emailBody'] ));\n\t\t$this->substituteLanguageMarkers(array('templateCode' => $this->data['tx_gokontakt_emailBody'] ));\n\t\t$this->substituteValueMarkers(array('templateCode' => $this->data['tx_gokontakt_emailAdminBody'] ));\n\t\t$this->substituteLanguageMarkers(array('templateCode' => $this->data['tx_gokontakt_emailAdminBody'] ));\n\n\t\t$emailUser = $this->cObj->substituteMarkerArrayCached($this->data['tx_gokontakt_emailBody'], $this->markerArray, $this->subpartMarkerArray, $this->wrappedSubpartMarkerArray);\n\t\t$emailUser = str_replace(\"<br />\", \"\\n\", $emailUser);\n\t\t$emailAdmin = $this->cObj->substituteMarkerArrayCached($this->data['tx_gokontakt_emailAdminBody'], $this->markerArray, $this->subpartMarkerArray, $this->wrappedSubpartMarkerArray);\n\t\t$emailAdmin = str_replace(\"<br />\", \"\\n\", $emailAdmin);\n\t\t$emailFrom = $this->data['tx_gokontakt_emailFrom'];\n\t\t$emailFromName = $this->data['tx_gokontakt_emailFromName'];\n\t\t$emailToAdmin = $this->data['tx_gokontakt_emailToAdmin'];\n\n\t\t$this->sendEmail($this->pi_getLL('subject_email_user'), $emailUser, '', $emailFrom, $emailFromName, $this->piVars['email']);\n\t\t$this->sendEmail($this->pi_getLL('subject_email_admin'), $emailAdmin, '', $emailFrom, $emailFromName, $emailToAdmin);\n\t}",
"public function emailMeAction() {\r\n\r\n //DEFAULT LAYOUT\r\n $this->_helper->layout->setLayout('default-simple');\r\n\r\n //GET VIEWER DETAIL\r\n $viewer = Engine_Api::_()->user()->getViewer();\r\n $viewr_id = $viewer->getIdentity();\r\n\r\n //GET PAGE ID AND PAGE OBJECT\r\n $this->view->page_id = $page_id = $this->_getParam('page_id', $this->_getParam('id', null));\r\n $sitepage = Engine_Api::_()->getItem('sitepage_page', $page_id);\r\n if (empty($sitepage))\r\n return $this->_forwardCustom('notfound', 'error', 'core');\r\n \r\n //AUTHORIZATION CHECK FOR TELL A FRIEND\r\n $isManageAdmin = Engine_Api::_()->sitepage()->isManageAdmin($sitepage, 'tfriend');\r\n if (empty($isManageAdmin)) {\r\n return $this->_forwardCustom('requireauth', 'error', 'core');\r\n }\r\n\r\n //FORM GENERATION\r\n $this->view->form = $form = new Sitepage_Form_EmailMe();\r\n\r\n if (!empty($viewr_id)) {\r\n $value['sender_email'] = $viewer->email;\r\n $value['sender_name'] = $viewer->displayname;\r\n $form->populate($value);\r\n }\r\n\r\n if ($this->getRequest()->isPost() && $form->isValid($this->getRequest()->getPost())) {\r\n\r\n $values = $form->getValues();\r\n\r\n //EDPLODES EMAIL IDS\r\n $reciver_ids = $sitepage->email; //explode(',', $values['sitepage_reciver_emails']);\r\n $values['sitepage_sender_email'] = $sitepage->email;\r\n if (!empty($values['sitepage_send_me'])) {\r\n $reciver_ids = $values['sitepage_sender_email'];\r\n }\r\n $sender_email = $values['sitepage_sender_email'];\r\n\r\n //CHECK VALID EMAIL ID FORMITE\r\n $validator = new Zend_Validate_EmailAddress();\r\n\r\n if (!$validator->isValid($sender_email)) {\r\n $form->addError(Zend_Registry::get('Zend_Translate')->_('Invalid sender email address value'));\r\n return;\r\n }\r\n// foreach ($reciver_ids as $reciver_id) {\r\n// $reciver_id = trim($reciver_id, ' ');\r\n// if (!$validator->isValid($reciver_id)) {\r\n// $form->addError(Zend_Registry::get('Zend_Translate')->_('Please enter correct email address of the receiver(s).'));\r\n// return;\r\n// }\r\n// }\r\n $sender = $values['sitepage_sender_name'];\r\n $message = $values['sitepage_message'];\r\n $heading = ucfirst($sitepage->getTitle());\r\n Engine_Api::_()->getApi('mail', 'core')->sendSystem($reciver_ids, 'SITEPAGE_EMAILME_EMAIL', array(\r\n 'host' => $_SERVER['HTTP_HOST'],\r\n 'sender_name' => $sender,\r\n 'page_title' => $heading,\r\n 'message' => '<div>' . $message . '</div>',\r\n 'object_link' => 'http://' . $_SERVER['HTTP_HOST'] . Engine_Api::_()->sitepage()->getHref($sitepage->page_id, $sitepage->owner_id, $sitepage->getSlug()),\r\n 'sender_email' => $sender_email,\r\n 'queue' => true\r\n ));\r\n\r\n $this->_forwardCustom('success', 'utility', 'core', array(\r\n 'smoothboxClose' => true,\r\n 'parentRefresh' => false,\r\n 'format' => 'smoothbox',\r\n 'messages' => array(Zend_Registry::get('Zend_Translate')->_('Your message to page owner has been sent successfully.'))\r\n ));\r\n }\r\n }",
"public function run()\n {\n // Запрос на подтверждение email участника\n Template::create([\n 'name' => Template::PARTICIPANT_EMAIL_CONFIRMATION,\n 'subject' => '«7 шагов к медитации» – подтверждение адреса электронной почты',\n 'sender' => [\n 'email' => '[email protected]',\n 'name' => '7steps',\n ],\n 'body' => trim(file_get_contents(__DIR__ . '/templates/email/' . Template::PARTICIPANT_EMAIL_CONFIRMATION . '.html')),\n ]);\n\n Template::create([\n 'name' => Template::PARTICIPANT_GRADUATE,\n 'subject' => 'Спасибо за участие!',\n 'sender' => [\n 'email' => '[email protected]',\n 'name' => '7steps',\n ],\n 'body' => trim(file_get_contents(__DIR__ . '/templates/email/' . Template::PARTICIPANT_GRADUATE . '.html')),\n ]);\n\n // Оповещение участника об ответе куратора\n Template::create([\n 'name' => Template::PARTICIPANT_CURATOR_REPLIED,\n 'subject' => 'Новый ответ на ваш комментарий',\n 'sender' => [\n 'email' => '[email protected]',\n 'name' => '7steps',\n ],\n 'body' => trim(file_get_contents(__DIR__ . '/templates/email/' . Template::PARTICIPANT_CURATOR_REPLIED . '.html')),\n ]);\n\n // Письмо ремайндер щаг 4\n Template::create([\n 'name' => Template::PARTICIPANT_REMIND_STEP_4,\n 'subject' => 'Нужна помощь?',\n 'sender' => [\n 'email' => '[email protected]',\n 'name' => '7steps',\n ],\n 'body' => trim(file_get_contents(__DIR__ . '/templates/email/' . Template::PARTICIPANT_REMIND_STEP_4 . '.html')),\n ]);\n // Письмо ремайндер щаг 5\n Template::create([\n 'name' => Template::PARTICIPANT_REMIND_STEP_5,\n 'subject' => 'Как проходят ваши «дни осознанности»?',\n 'sender' => [\n 'email' => '[email protected]',\n 'name' => '7steps',\n ],\n 'body' => trim(file_get_contents(__DIR__ . '/templates/email/' . Template::PARTICIPANT_REMIND_STEP_5 . '.html')),\n ]);\n // Письмо ремайндер щаг 5\n Template::create([\n 'name' => Template::PARTICIPANT_REMIND_STEP_6,\n 'subject' => 'Возвращайтесь!',\n 'sender' => [\n 'email' => '[email protected]',\n 'name' => '7steps',\n ],\n 'body' => trim(file_get_contents(__DIR__ . '/templates/email/' . Template::PARTICIPANT_REMIND_STEP_6 . '.html')),\n ]);\n // Письмо ремайндер щаг 5\n Template::create([\n 'name' => Template::PARTICIPANT_REMIND_STEP_7,\n 'subject' => 'Не сдавайтесь! Вы почти у цели.',\n 'sender' => [\n 'email' => '[email protected]',\n 'name' => '7steps',\n ],\n 'body' => trim(file_get_contents(__DIR__ . '/templates/email/' . Template::PARTICIPANT_REMIND_STEP_7 . '.html')),\n ]);\n }",
"public function sendEmail() {\n\t\treturn Yii::$app->mailer->compose ( [\n\t\t\t\t// 'html' => '@app/mail/layouts/example',\n\t\t\t\t// 'text' => '@app/mail/layouts/text'\n\t\t\t\t'html' => $this->emailHtml,\n\t\t\t\t//'text' => $templateText \n\t\t], $this->params )->setFrom ( $this->from )->setTo ( $this->to )->setSubject ( $this->subject )->send ();\n\t}",
"public function envoieallinterAction(Request $request)\n{\n /*$form = $this->createForm(MailingType::class, $mail);\n $form->handleRequest($request);*/\n $em = $this->getDoctrine()->getManager();\n $tomails = $em->getRepository(\"FrontBonPlanBundle:Newsletter\")->findAll();\n\n if ($request->getMethod()=='POST') {\n $subject = $request->get('subject');\n $mailtext = $request->get('mailtext');\n $arraymail=array();\n foreach ($tomails as $tomail){\n $arraymail[]=$tomail->getMailinter();\n }\n $message = \\Swift_Message::newInstance()\n ->setSubject($subject)\n ->setFrom('[email protected]')\n ->setTo(/*array($tomails->getMailinter())*/$arraymail)\n ->setBody( $mailtext,'text/html'\n );\n $this->get('mailer')->send($message);\n echo'Mail send success';\n }\n\n return $this->render ('Newsletter/edit.html.twig');\n}",
"public function index()\n {\n return view('sendmail');\n\n }",
"public function send(Request $request)\n {\n/*$template= 'event.blade.php'\n // $to_email = '[email protected]';\n // Mail::to($to_email)->send(new SendMail());\n Mail::to('[email protected]')->send($template);\n return redirect()->back()->with('success', 'Email sent successfully. Check your email.');*/\n }",
"public function TesEmail()\n\t{\n\t\t// $template = $query_template->row();\n\n\t\t$data = array(\n\t\t\t'judul' => \"EMAIL TELAH TERDAFTAR\",\n\t\t\t'tanggal' => date(\"d-M-Y\"),\n\t\t\t'description' => \"Selamat Email anda telah Terdaftar di Mitrarenov.com\",\n\t\t\t'nama' => \"Fajar Nugraha\",\n\t\t\t'project_id' => '124324ffsd',\n\t\t\t'password' => 'Fajaroentyil', 'email' => '[email protected]',\n\t\t\t'reg_no' => base64_encode(\"@#$@#$\")\n\t\t);\n\t\t$emailData = array(\n\t\t\t'from' => '[email protected]',\n\t\t\t'name' => 'SIMPRO',\n\t\t\t'to' => array('[email protected]'),\n\t\t\t'cc' => \"\",\n\t\t\t'bcc' => \"\",\n\t\t\t'subject' => \"Aktivasi SIMPRO\",\n\t\t\t'template' => $this->load->view('v_email', $data, true),\n\t\t\t'attach' => 'pantotukang/attachment/syarat.pdf'\n\t\t);\t\t\n\t\t\n\t\t// $this->load->view('v_email', $data);\n\t\t\t\t\t\t\t\t\t\n\t\t$this->sendEmailAktifasi($emailData);\n\t\t// print_r($this->sendEmailAktifasi($emailData));\n\t}",
"public function mail()\n\t{\n $this->load->model('mailsjabloon_model');\n $this->load->model('gebruiker_model');\n $data['titel'] = 'Send mails';\n $data['auteur'] = \"<u>Lorenzo M.</u>| Arne V.D.P. | Kim M. | Eloy B. | Sander J.\";\n $data['gebruiker'] = $this->authex->getGebruikerInfo();\n $data['link'] = 'admin/index';\n \n $data['sjablonen'] = $this->mailsjabloon_model->getSjablonen();\n \n $partials = array('hoofding' => 'main_header','menu' => 'main_menu', 'inhoud' => 'mails_versturen');\n $this->template->load('main_master', $partials, $data);\n\t}",
"public function sendEmail()\n {\n $templateId = 'email_delivery_time'; // template id\n $fromEmail = '[email protected]'; // sender Email id\n $fromName = 'Admin'; // sender Name\n $toEmail = '[email protected]'; // receiver email id\n\n try {\n $storeId = $this->storeManager->getStore()->getId();\n\n $from = ['email' => $fromEmail, 'name' => $fromName];\n// $this->inlineTranslation->suspend();\n try {\n// $transport = $this->transportBuilder\n// ->setTemplateIdentifier($templateId)\n// ->setTemplateVars([])\n// ->setTemplateOptions(\n// [\n// 'area' => Area::AREA_FRONTEND,\n// 'store' => $storeId\n// ]\n// )\n// ->setFromByScope($from)\n// ->addTo($toEmail)\n// ->getTransport();\n//\n// $transport->sendMessage();\n $templateVars = [];\n $transport = $this->transportBuilder->setTemplateIdentifier('59')\n ->setTemplateOptions( [ 'area' => \\Magento\\Framework\\App\\Area::AREA_FRONTEND, $storeId => 1 ] )\n ->setTemplateVars( $templateVars )\n ->setFrom( [ \"name\" => \"Magento ABC CHECK PAYMENT\", \"email\" => \"[email protected]\" ] )\n ->addTo('[email protected]')\n ->setReplyTo('[email protected]')\n ->getTransport();\n $transport->sendMessage();\n } finally {\n $this->inlineTranslation->resume();\n }\n } catch (\\Exception $e) {\n $this->_logger->info($e->getMessage());\n }\n }",
"public function email()\n {\n $mailProviders = [\n 'smtp' => 'SMTP',\n 'mail' => 'Mail',\n 'sendmail' => 'Sendmail',\n 'mailgun' => 'Mailgun',\n 'mandrill' => 'mandrill',\n 'ses' => 'SES',\n 'sparkpost' => 'Sparkpost',\n 'log' => 'Log',\n ];\n\n return view('settings.email', compact('mailProviders'));\n }",
"public function _initEmail()\n {\n $front = $this->bootstrap('frontController')->getResource('frontController');\n $view = EmailService::getDefaultView();\n if ($view instanceof View) {\n $path = dirname($front->getModuleDirectory('user'));\n $view->setScriptPath($path . '/templates/email');\n }\n }",
"public function cekemail()\n {\n $this->load->view('pages/email');\n }",
"public function emailTemplate(){\n if (Auth::user()->admin===1) {\n $template = EmailTemplate::find(1);\n return view('admin.emailTemplate')->with('template', $template);\n }\n else {\n return view('pages.noAccess');\n }\n }",
"public function sendMailAction()\n {\n $request = $this->get('request');\n $user = new User();\n $form = $this->createForm(new UserType(), $user);\n\n\n // modification pour avoir un id 1 dans categorie -> DOIT valider l'user dans php my admin...\n\n $em = $this->getDoctrine()->getManager();\n $categorie = $em->getRepository('ElevenmxBundle:Categorie')->findOneBy(array('id' => '1'));\n $user->setCategorie($categorie);\n $form->handleRequest($request);\n\n $user->setEnabled(1);\n\n $categorie = $form->get('categorie')->getData();\n if ($categorie == 'client') {\n $user->setRoles(array('ROLE_USER'));\n } elseif ($categorie == 'admin') {\n $user->setRoles(array('ROLE_ADMIN'));\n } else {\n $user->setRoles(array('ROLE_GRAPH'));\n }\n $plainpassword = $form->get('plain_password')->getData();\n\n\n if ($form->isSubmitted()) {\n $em = $this->getDoctrine()->getManager();\n $em->persist($user);\n $em->flush();\n\n $message = \\Swift_Message::newInstance()\n ->setSubject('Inscription à Eleven MX')\n ->setFrom('[email protected]')\n ->setTo($user->getEmail())\n ->setContentType('text/html')\n ->setBody(\n $this->renderView(\n 'Emails/registration.html.twig',\n array('user' => $user, 'plainpassword' => $plainpassword)\n )\n );\n $this->get('mailer')->send($message);\n return $this->render('ElevenmxBundle:Default:formMail.html.twig', array(\n 'form' => $form->createView()\n ));\n }\n return $this->render('ElevenmxBundle:Default:formMail.html.twig', array(\n 'form' => $form->createView()\n ));\n }",
"public function actionSendMail()\n {\n\n // trova la videoconferenza e gli utenti collegati\n $videoconfId = Yii::$app->request->get('id');\n\n $videoconference = Videoconf::findOne($videoconfId);\n if ($videoconference) {\n $collegati = $videoconference->getVideoconfUsersMms()->all();\n if (\\is_array($collegati)) {\n foreach ($collegati as $u) {\n $sent = EmailUtil::sendEmailPartecipant($videoconference, $u->user_id);\n }\n }\n }\n }",
"public function sendEmail($e) {\n $config = $e->getParam('email-notification-config');\n\n // Set up ViewModel and template for rendering\n $viewModel = new ViewModel();\n $template = array_keys($config['template_map'])[0];\n $viewModel->setTemplate($template);\n\n // get template map (must contain the template specified above!\n $templateMap = $config['template_map'];\n\n // render email template\n $phpRenderer = new PhpRenderer();\n $aggregateResolver = new AggregateResolver();\n $aggregateResolver->attach(new TemplateMapResolver($templateMap));\n $phpRenderer->setResolver($aggregateResolver);\n // assign values from params passed by the trigger\n foreach ($config['email-options'] as $key => $value) {\n $viewModel->setVariable($key, $value);\n }\n\n // Create the HTML body\n $html = new Part($phpRenderer->render($viewModel));\n $html->type = Mime::TYPE_HTML;\n $html->charset = 'utf-8';\n $html->encoding = Mime::ENCODING_QUOTEDPRINTABLE;\n $body = (new MimeMessage())->setParts([$html]);\n $message = (new Message())\n ->addTo($config['email-options']['to'])\n ->addFrom($config['email-options']['from'])\n ->setSubject($config['email-options']['subject'])\n ->setBody($body)\n ->setEncoding('UTF-8');\n $transport = $this->container->get('email-notification-transport-file');\n NotificationEvent::$success = true;\n $transport->send($message);\n }",
"public function emailtemplateAction(){\n\n $this->_helper->layout->setLayout('popup'); \n\n\t $this->view->emailtemplate = $this->ModelObj->fetchemailtemplate(array('notification_id'=>$this->Request['notification_id'])); \n\n\t $this->view->templatename = ($this->Request['notification_name']!='') ? $this->Request['notification_name'] : '';\n\n }",
"public function sendMailEchecAction($test, $currentSession, $userTest, $user, $module,MailService $mailer)\n {\n $em = $this->getDoctrine()->getManager();\n if (($userTest->getNumberTry() - $userTest->getTentative()) == 0) {\n $seuil = true;\n $allUserTest = $em->getRepository('App\\Entity\\UserFrontManagement\\UserTest')->findBy(['session' => $currentSession, 'test' => $test, 'user' => $user]);\n foreach ($allUserTest as $utest) {\n if ($utest->getScore() >= $utest->getDetail()['scorePercentage']) {\n $seuil = false;\n }\n }\n if ($seuil) {\n $mails = [];\n $tutors = $user->getSupervisors();\n foreach ($tutors as $user){\n if(!in_array($user->getEmail(), $mails)){\n $mails[] = $user->getEmail();\n }\n }\n\n $respos = $em->getRepository('App\\Entity\\UserManagement\\User')->findAllByRoles('ROLE_RESPONSABLE_FORMATION');\n foreach ($respos as $user){\n if(!in_array($user['email'], $mails)){\n $mails[] = $user['email'];\n }\n }\n $subject = 'INFO - Echec sur une évaluation';\n $from = ['[email protected]' => 'universalmedica'];\n //$cc = '';\n $body = $this->renderView('UserFrontManagement/emails/alerte_echec.html.twig', [\n 'userTest' => $userTest,\n 'module' => $module,\n 'formationPath' => $currentSession->getFormationPath(),\n ]);\n\n $mailer->sendAMail($from, $mails, $subject, $body);\n\n /*$messages = (new \\Swift_Message('INFO - Echec sur une évaluation'))\n ->setFrom(['[email protected]' => 'universalmedica'])\n ->setTo($mails)\n ->setBody(\n $this->renderView('UserFrontManagement/emails/alerte_echec.html.twig', [\n 'userTest' => $userTest,\n 'module' => $module,\n 'formationPath' => $currentSession->getFormationPath(),\n ]),\n 'text/html'\n );\n $mailer->send($messages);\n */\n }\n }\n return ;\n }",
"public function send_email() {\n $toemail = $this->params['toemail'];\n $subject = $this->params['subject'];\n $content = $this->params['content'];\n }",
"public function sendAction()\n {\n $this->manager = $this->getDoctrine()->getManager();\n $id = $this->getRequest()->get($this->admin->getIdParameter());\n $this->email = $this->admin->getObject($id);\n $this->attachments = $this->email->getAttachments();\n $addresses = explode(';', $this->email->getFieldTo());\n $this->isNewsLetter = count($addresses) > 1;\n\n //prevent resending of an email\n if ($this->email->getSent())\n {\n $this->addFlash('sonata_flash_error', \"Message \" . $id . \" déjà envoyé\");\n\n return new RedirectResponse($this->admin->generateUrl('list', $this->admin->getFilterParameters()));\n }\n\n if ($this->isNewsLetter)\n {\n $this->newsLetterSend($addresses);\n } else\n {\n $this->directSend($this->email->getFieldTo());\n }\n\n $this->addFlash('sonata_flash_success', \"Message \" . $id . \" envoyé\");\n\n return new RedirectResponse($this->admin->generateUrl('list', $this->admin->getFilterParameters()));\n }",
"public function send() {\n $to = Yii::app()->params['adminEmail'];\n $subject = $this->subject;\n $message = $this->body;\n @mail($to, $subject, $message);\n }",
"public function action_sent(){\n\t\t$this->template->title = 'Contact sent';\n\t\t$this->template->content = View::forge('contact/sent');\n\t}",
"public function preview(): void\n {\n if (!userHasPermission(Permission\\Template\\Edit::class)) {\n unauthorised();\n }\n\n /** @var Emailer $oEmailer */\n $oEmailer = Factory::service('Emailer', Constants::MODULE_SLUG);\n /** @var Uri $oUri */\n $oUri = Factory::service('Uri');\n\n $oType = $oEmailer->getType($oUri->segment(5));\n if (empty($oType)) {\n show404();\n }\n\n $oEmail = $oType->getFactory();\n if (empty($oEmail)) {\n show404();\n }\n\n try {\n\n $oEmail\n ->to(activeUser())\n ->data($oEmail->getTestData())\n ->send();\n\n $aGeneratedEmails = $oEmail->getGeneratedEmails();\n\n if (empty($aGeneratedEmails)) {\n throw new EmailerException(\n 'No emails were generated when sending the test. Perhaps you have blocked this type of email?'\n );\n }\n\n if (count($aGeneratedEmails) === 1) {\n $this->oUserFeedback->success(sprintf(\n 'Preview email sent successfully. View it in your browser <a href=\"%s\" style=\"text-decoration: underline\" target=\"_blank:\">here</a>.',\n reset($aGeneratedEmails)->data->url->viewOnline\n ));\n } else {\n $this->oUserFeedback->success(sprintf(\n 'Multiple preview emails sent successfully. View them in your browser:',\n implode(\n '<br>',\n array_map(\n function ($oEmail) {\n return $oEmail->data->url->viewOnline;\n },\n $aGeneratedEmails\n )\n )\n ));\n }\n\n } catch (EmailerException $e) {\n $this->oUserFeedback->error('An error occurred whislt sending the test email: ' . $e->getMessage());\n }\n\n redirect(self::url());\n }",
"protected function sendTestMail() {}",
"public function email()\n\t{\n\t\treturn View::make('email');\n\t}",
"private function mailToevoegenAction()\n {\n $this->model->maakMail();\n $this->model->foutGoedMelding('success', '<strong>Gelukt!</strong> E-mail adres is toegevoed. <span class=\"glyphicon glyphicon-saved\"></span>');\n $this->model->setLog('Mail toevoegen', 'Gelukt');\n $this->forward('klant', 'admin');\n }",
"public function mailAction()\n\t{\n\t\t$log = $this->_initLog();\n\t\t\n if (!$log->getId()) {\n $this->_getSession()->addError(Mage::helper('logging')->__('This log no longer exists.'));\n $this->_redirect('*/*/');\n return;\n }\n\t\t$log->sendLogMail();\n\t\t$this->_redirect('*/*/view', array('id' => $this->getRequest()->getParam('id')));\n\t}",
"public function sendMail($nodes) {\n\n\t\t$sender = $this->request->getInternalArgument('__sender');\n\t\t$receiver = $this->request->getInternalArgument('__receiver');\n\t\t$copytouser = $this->request->getInternalArgument('__copytouser');\n\n\t\t$emailBody = \"neue Nachricht\\n\\n\";\n\n\t\tfor($i = 0; $i < count ($nodes); $i++){\n\t\t\t$emailBody .= $nodes[$i][0] . ': '. $nodes[$i][1] . \"\\n\";\n\t\t}\n\t\t$template = new \\TYPO3\\Fluid\\View\\StandaloneView();\n\t\t$template->setTemplatePathAndFilename('resource://CRON.FormBuilder/Private/Templates/EMails/Form.html');\n\t\t$template->assign('email', $emailBody);\n\n\t\t// create instance of \\TYPO3\\SwiftMailer\\Message() and set mail details\n\t\t$mail = new \\TYPO3\\SwiftMailer\\Message();\n\t\t$mail->setFrom($sender, 'Absender')\n\t\t ->setTo($receiver, 'Empfänger')\n\t\t ->setSubject('Your Subject')\n\t\t\t ->addPart($emailBody,'text/plain','utf-8');\n\n\t\tif($copytouser == 1){\n\t\t\t//todo\n\t\t\t//$mail->addBcc()\n\t\t}\n\n\t\t$mail->send();\n\t}",
"public function add_email_template()\n {\n \n\t\t$this->arr_view_data['page_title'] = \"Manage \".$this->module_title;\n $this->arr_view_data['parent_module_icon'] = \"fa fa-home\";\n $this->arr_view_data['parent_module_title'] = \"Dashboard\";\n $this->arr_view_data['parent_module_url'] = url('/').'/admin/dashboard';\n $this->arr_view_data['module_icon'] = $this->module_icon;\n $this->arr_view_data['module_title'] = \"Manage \".$this->module_title;\n\t\t$this->arr_view_data['module_url_path'] = $this->module_url_path;\n\t\t$this->arr_view_data['admin_url_path'] = $this->admin_url_path;\n\t\t$this->arr_view_data['admin_panel_slug'] = $this->admin_panel_slug;\n\t\t\n\t\treturn view($this->module_view_folder.'.add',$this->arr_view_data);\n }",
"public function actionMail() {\n\t\t$content = ModelBase::factory('Setting')->handleMail($this->data);\n\n\t\tif ($content->get('updated')) $this->setAlert('info', 'Email terupdate!');\n\n\t\t// Template configuration\n\t\t$this->layout = 'modules/setting/index.tpl';\n\t\t$data = ModelBase::factory('Template')->getSettingData(compact('content'));\n\n\t\t// Render\n\t\treturn $this->render($data);\n\t}",
"public function indexAction() {\n\n //GET NAVIGATION\n $this->view->navigation = Engine_Api::_()->getApi('menus', 'core')\n ->getNavigation('sitecrowdfunding_admin_main', array(), 'sitecrowdfunding_admin_main_reminder_mails');\n $site_title = $_SERVER['HTTP_HOST'];\n $this->view->form = $form = new Sitecrowdfunding_Form_Admin_Email();\n\n if (!$this->getRequest()->isPost()) {\n return;\n }\n\n if (!$form->isValid($this->getRequest()->getPost())) {\n return;\n }\n $values = $form->getValues();\n\n if ($values['sitecrowdfunding_reminder_demo'] != 1)\n $values['sitecrowdfunding_admin_mail'] = '';\n\n include APPLICATION_PATH . '/application/modules/Sitecrowdfunding/controllers/license/license2.php';\n if (empty($tempMailsend)) {\n return;\n }\n foreach ($values as $key => $value) {\n if (Engine_Api::_()->getApi('settings', 'core')->hasSetting($key)) {\n Engine_Api::_()->getApi('settings', 'core')->removeSetting($key);\n }\n if (is_null($value)) {\n $value = \"\";\n }\n Engine_Api::_()->getApi('settings', 'core')->setSetting($key, $value);\n }\n $form->addNotice($this->view->translate('Your changes have been saved successfully.'));\n\n if ($values['sitecrowdfunding_reminder_demo'] == 1 && !empty($values['sitecrowdfunding_admin_mail'])) {\n $mailId = $values['sitecrowdfunding_admin_mail'];\n $user = Engine_Api::_()->getItemTable('user')->fetchRow(array(\n 'email = ?' => $mailId\n ));\n Engine_Api::_()->getApi('mail', 'core')->sendSystem($user, \"SITECROWDFUNDING_REMINDER_TEST\", array(\n 'member_name' => $user->getTitle()\n ));\n $form->addNotice('Test email has been sent to the email id provided by you.');\n }\n }",
"public function emailTemplate($body = '')\n {\n $view['body'] = $body;\n return $this->load->view('template/email', $view, true);\n }",
"protected function sendEmail($user, $data, LoggerInterface $logger, Twig_Environment $twig) {\n\n $email = $user['email'];\n $displayName = $user['displayName'] ?? null;\n $logger->info(\"sending email\", [\n 'data' => $data,\n 'user' => $user,\n 'email' => $email,\n 'name' => $displayName,\n ]);\n\n $content = $twig->render(\"ReleaserBundle:Default:email.html.twig\",[\n 'data' => $data,\n 'user' => $user,\n ]);\n $message = \\Swift_Message::newInstance()\n ->setReplyTo(\"[email protected]\",\"Richard Hagen\")\n ->setSubject(\"{$data['title']} just published by {$data['repo_name']}\")\n ->setFrom('[email protected]', 'Releaser')\n ->setTo($email, $displayName)\n ->setBody($content, 'text/html')\n ;\n $swift_Mailer = $this->getContainer()->get('mailer');\n $swift_Mailer->send($message);\n }",
"public function setEmailTpl($value){$this->_emailTpl = $value;}",
"public function sendMail() {\n $message = \\Yii::$app->mailer->compose('bug-report', ['bugReport' => $this]);\n $message->setFrom($this->email);\n $message->setTo(\\Yii::$app->params['adminEmail'])\n ->setSubject('Bug report')\n ->send();\n }",
"public function sendEmailWithApplyLink(){\n\t}",
"public function sendEmail()\n {\n $body = '<h1>Бронь тура с сайта</h1>\n <p>\n <a href=\"'. Yii::$app->request->hostInfo .'/admin/booking/view/'. $this->id .'\">Ссылка на бронь</a>\n </p>\n <h2>Информация</h2>\n <p> Дата бронирования: '.Yii::$app->formatter->asDate($this->created_at, 'long').'</p>\n <p> Время бронирования: '.Yii::$app->formatter->asTime($this->created_at).'</p>\n <p> Имя: '.$this->customer_name.'</p>\n <p> Телефон: '.$this->customer_phone . '</p>';\n\n return Yii::$app->mailer->compose()\n ->setTo(Yii::$app->params['Contact']['email'])\n ->setFrom(['[email protected]' => 'EcoTour'])\n ->setSubject('Бронь тура: '. $this->tour->title)\n ->setHtmlBody($body)\n ->send();\n }",
"public function doemail() {\r\n \tif (isset($_SESSION['userid'])) {\n \t if (isset($_POST['useremail'])) {\n \t \tif ($this->model->putemail($_SESSION['userid'],$_POST['useremail'])) {\n \t \t $this->view->set('infomessage', \"Adres email został zmieniony.\"); \r\n \t \t $this->view->set('redirectto', \"?v=project&a=show\");\r\n \t \t $this->view->render('info_view');\n \t \t} else {\n \t \t $this->view->set('errormessage', \"Nieudana zmiana adresu email.\");\r\n \t $this->view->set('redirectto', \"?v=user&a=edit\");\r\n \t \t $this->view->render('error_view');\n \t \t}\n \t } else {\n \t \t$this->view->set('errormessage', \"Błędny adres email.\");\r\n \t \t$this->view->set('redirectto', \"?v=user&a=edit\");\r\n \t \t$this->view->render('error_view');\n \t }\r\n \t} else {\r\n \t $this->redirect('?v=index&a=show');\r\n \t}\r\n }",
"function sendmail(Request $request) {\r\r\n if($request->invoice_id==\"\") {\r\r\n return $this->index($request);\r\r\n }\r\r\n $sample=\"\";\r\r\n $id = $request->invoice_id;\r\r\n $cust_id = $request->cust_id;\r\r\n $CompanyName = Invoice::getCompanyName($id);\r\r\n $CustomerDetails = Invoice::fnGetCustomerDetailsView($id);\r\r\n $selYear = date('Y');\r\r\n $selMonth = date('m');\r\r\n if($request->selYear!=\"\") {\r\r\n $selYear = $request->selYear;\r\r\n }\r\r\n if($request->selMonth!=\"\") {\r\r\n $selMonth = $request->selMonth;\r\r\n }\r\r\n $datemonth=$selYear.\"-\".$selMonth;\r\r\n $getpdf = Invoice::fnGetallinvoice($cust_id,$datemonth);\r\r\n $e_getpdf = Invoice::fnGetEmailPDf($cust_id);\r\r\n $set_amount_array = array();\r\r\n if (!empty($e_getpdf)) {\r\r\n $set_amount_array[0]['id'] = $getpdf[0]->id;\r\r\n $set_amount_array[0]['estimate_id'] = $getpdf[0]->estimate_id;\r\r\n $set_amount_array[0]['user_id'] = $e_getpdf[0]->invoice_id;\r\r\n $getpdf = $set_amount_array;\r\r\n }\r\r\n return view('Invoice.sendmail',[\r\r\n 'CompanyName' => $CompanyName,\r\r\n 'CustomerDetails' => $CustomerDetails,\r\r\n 'getpdf' => $getpdf,\r\r\n 'datemonth' => $datemonth,\r\r\n 'sample' => $sample,\r\r\n 'request' => $request]);\r\r\n }",
"public function content_email(Request $request){\n $content_email = DB::table('email_templates')->orderBy('id','desc')->paginate(100);\n return view('admin.content_manager.content_email',compact('content_email'));\n }",
"public function massSend()\n {\n\n if (!Data::myPackage('tw')) {\n return view('errors.404');\n }\n\n return view('twmasssend');\n }",
"function m_dspemails()\n\t{\n\t\t$this->ObTpl=new template();\n\t\t$this->ObTpl->set_file(\"TPL_EMAIL_FILE\",$this->emailTemplate);\n\n\t\t#SETTING ALL TEMPLATE BLOCKS\n\t\t$this->ObTpl->set_block(\"TPL_EMAIL_FILE\",\"TPL_EMAIL_BLK\", \"email_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_EMAIL_FILE\",\"TPL_MESSAGE_BLK\", \"message_blk\");\n\t\t$this->ObTpl->set_block(\"TPL_EMAIL_FILE\",\"TPL_MSG_BLK1\", \"msg_blk1\");\n\n\t\t#SETTING TEMPLATE VARIABLE\n\t\t$this->ObTpl->set_var(\"GRAPHICSMAINPATH\",GRAPHICS_PATH);\t\n\t\t$this->ObTpl->set_var(\"TPL_VAR_SALESURL\",SITE_URL.\"sales/\");\n\n\t\t#INTAILIZING ***\n\t\t$this->ObTpl->set_var(\"email_blk\",\"\");\t\n\t\t$this->ObTpl->set_var(\"message_blk\",\"\");\t\n\t\t$this->ObTpl->set_var(\"msg_blk1\",\"\");\t\n\t\t$this->ObTpl->set_var(\"msg_blk2\",\"\");\t\n\n\t\t$this->request['msg']=$this->libFunc->ifSet($this->request,\"msg\");\n\t\t$this->ObTpl->set_var(\"TPL_VAR_MESSAGE\",\"\");\n\n\t\t#DATABASE QUERY\n\t\t$this->obDb->query = \"SELECT * FROM \".EMAILS;\n\t\t$queryResult = $this->obDb->fetchQuery();\n\t\t$campaigncount = $this->obDb->record_count;\n\t\tif($this->request['msg']==1)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",MSG_EMAIL_INSERTED);\n\t\t\t$this->ObTpl->parse(\"msg_blk1\",\"TPL_MSG_BLK1\");\n\t\t\t$this->ObTpl->parse(\"msg_blk2\",\"TPL_MSG_BLK2\");\n\t\t}\n\t\telseif($this->request['msg']==3)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",MSG_EMAIL_DELETED);\n\t\t\t$this->ObTpl->parse(\"msg_blk1\",\"TPL_MSG_BLK1\");\n\t\t\t$this->ObTpl->parse(\"msg_blk2\",\"TPL_MSG_BLK2\");\n\t\t}\n\t\telseif($this->request['msg']==5)\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",MSG_EMAIL_SENT);\n\t\t\t$this->ObTpl->parse(\"msg_blk1\",\"TPL_MSG_BLK1\");\n\t\t\t$this->ObTpl->parse(\"msg_blk2\",\"TPL_MSG_BLK2\");\n\t\t}\n\n\t\tif($campaigncount>0)\n\t\t{\n\t\t\t#PARSING DISCOUNT BLOCK\n\t\t\tfor($j=0;$j<$campaigncount;$j++)\n\t\t\t{\t\t\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_ID\",$queryResult[$j]->iMailid_PK);\n\t\t\t\tif ($queryResult[$j]->vUserList==\"All\"){\n $this->obDb->query = \"SELECT count(*) as cnt FROM \".CUSTOMERS.\" WHERE iStatus=1 AND iMailList !=0\";\n }else{ \n $this->obDb->query = \"SELECT count(*) as cnt FROM \".LEADLIST.\" WHERE iLeadId_FK='\". $queryResult[$j]->vUserList.\"'\";\n }\n\t\t\t\t$qryRs = $this->obDb->fetchQuery();\n\t\t\t\t\n\t\t\t\tif ($queryResult[$j]->vVisitorList==\"1\"){\n $this->obDb->query = \"SELECT count(*) as cnt FROM \".NEWSLETTERS;\n\t\t\t\t $qryVs = $this->obDb->fetchQuery();\n\t\t\t\t $qryRs[0]->cnt = $qryRs[0]->cnt + $qryVs[0]->cnt;\n }\n\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_USERCOUNT\",$qryRs[0]->cnt);\n \n $this->ObTpl->set_var(\"TPL_VAR_SUBJECT\",$this->libFunc->m_displayContent($queryResult[$j]->vSubject));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SID\",$this->libFunc->m_displayContent($queryResult[$j]->vSid));\n\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_BUILDDATE\",$this->libFunc->dateFormat2($queryResult[$j]->tmBuildDate));\t\n\t\t\t\t$sentDate=$this->libFunc->dateFormat2($queryResult[$j]->tmSentDate);\n\t\t\t\tif(empty($sentDate))\n\t\t\t\t{\t\t\t\t\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SENTDATE\",\"Send now\");\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_VIEWLABEL\",\"View/Sent\");\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_SENTDATE\",$sentDate);\n\t\t\t\t\t$this->ObTpl->set_var(\"TPL_VAR_VIEWLABEL\",\"View\");\n\t\t\t\t}\n\t\t\t\t$this->ObTpl->parse(\"email_blk\",\"TPL_EMAIL_BLK\",true);\n\t\t\t}\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MSG\",$campaigncount.\" records found\");\n\t\t\t$this->ObTpl->parse(\"msg_blk1\",\"TPL_MSG_BLK1\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->ObTpl->set_var(\"TPL_VAR_MESSAGE\",MSG_NOEMAILS);\n\t\t\t$this->ObTpl->parse(\"message_blk\",\"TPL_MESSAGE_BLK\");\n\t\t}\n\t\n\t\treturn($this->ObTpl->parse(\"return\",\"TPL_EMAIL_FILE\"));\n\t}",
"public function sendNewsletterAction(Request $request, Application $app)\n {\n //Mail form \n $mail = new Mail();\n $mailForm = $app['form.factory']->create(MailType::class, $mail);\n $mailForm->handleRequest($request);\n\n\n if ($mailForm->isSubmitted() && $mailForm->isValid()) {\n $app['dao.mail']->save($mail);\n \n $mailContent = $app['dao.mail']->find();\n\n $subscribers = $app['dao.newsletter']->allMail();\n\n // Create the Transport\n $transport = (new Swift_SmtpTransport('smtp.gmail.com', 465, 'ssl'))\n ->setUsername('')\n ->setPassword('lwhvjswfjrvutmnd');\n\n // Create the Mailer \n $mailer = new Swift_Mailer($transport);\n\n $body = $mailContent->getContent();\n\n $message = \\Swift_Message::newInstance()\n ->setSubject($mailContent->getTitle())\n ->setFrom(array('[email protected]' => 'Jean Forteroche'))\n ->setBcc($subscribers)\n ->setBody($body, 'text/html');\n\n // Send the message\n $result = $mailer->send($message);\n\n if($result)\n {\n $app['dao.mail']->delete($mailContent->getId());\n $app['session']->getFlashBag()->add('success', 'La newsletter a bien été envoyé'); \n }\n }\n\n $mailFormView = $mailForm->createView();\n\n return $app['twig']->render('/admin/mail_form.html.twig', array('mailForm' => $mailFormView, 'title' => 'Rédiger une newsletter'));\n }",
"public function emailmilestoneAction(){\n\t \ttry{\n\t\t\t$sm = $this->getServiceLocator();\n\t\t\t\n\t\t\t$config = $sm->get('Config');\n\t\t\t\n\t\t\t$identity = $sm->get('AuthService')->getIdentity();\n\t\t\t$request = $this->getRequest();\n\t\t\t\n\t\t\tif($request->isPost()){\n\t\t\t\n\t\t\t\t$posts = $request->getPost()->toArray();\n\t\t\t\t$milestone_id = $posts['milestone_id'];\n\t\t\t\t$milestone_type_id = $posts['milestone_type_id'];\n\t\t\t\t$step = $posts['step'];\n\t\t\t\t$emailParams = array();\n\t\t\t\t$attachments = array();\n\t\t\t\t$currDate = date('Y-m-d H:i:s');\n\t\t\t\t$attachments = array();\n\t\t\t\t\n\t\t\t\t$jobPacketTable = $sm->get('Order\\Model\\JobPacketTable');\n\t\t\t\t\t\n\t\t\t\t$milestoneData = $jobPacketTable->fetchMilestoneData($milestone_id, $milestone_type_id);\n\t\t\t\t\n\t\t\t\tif(empty($milestoneData) || $milestoneData->steps_completed < $step){\n\t\t\t\t\techo 0;\n\t\t\t\t\texit;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$templatePath = $config['documentRoot'].'templates/email/';\n\t\t\t\t\n\t\t\t\t$view = new \\Zend\\View\\Renderer\\PhpRenderer();\n\t\t\t\t$resolver = new \\Zend\\View\\Resolver\\TemplateMapResolver();\n\t\t\t\t\t\t\t\t\n\t\t\t\tif($milestone_type_id == 1){\n\t\t\t\t\t$resolver->setMap(array(\n\t\t\t\t\t\t'mailTemplate' => $templatePath.'cad_email_template.phtml'\n\t\t\t\t\t));\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t$emailParams['template'] = 'cad_email_template.phtml';\n\t\t\t\t\t\n\t\t\t\t\t$milestoneTable = $sm->get('Order\\Model\\CaddesignTable');\n\t\t\t\t\t\n\t\t\t\t\tif($step == 1){\n\t\t\t\t\t\t$data = array('step1_emailed_on' => $currDate);\n\t\t\t\t\t}elseif($step == 3){\n\t\t\t\t\t\t$files = $jobPacketTable->fetchMilestoneFiles($milestone_id, $step);\n\t\t\t\t\t\tforeach($files as $file){\n\t\t\t\t\t\t\t$content = file_get_contents($config['documentRoot'] . 'milestone_attachments/' . $file['image']);\n\t\t\t\t\t\t\t$attachments[] = array('filename' => $file['image'], 'content' => $content);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t\t$data = array('step3_emailed_on' => $currDate);\n\t\t\t\t\t}\n\t\t\t\t\t\n\t\t\t\t\t$tmplParams = array('message' => $posts['message'], 'milestoneData' => $milestoneData, 'config' => $config);\n\t\t\t\t\t\n\t\t\t\t}elseif($milestone_type_id == 2){\n\t\t\t\t\t$lookupTable = $this->getServiceLocator()->get('Inventory\\Model\\LookupTable');\n\t\t\t\t\t$metalTypes = $lookupTable->fetchMetalTypeOptions();\n\t\t\t\t\t\n\t\t\t\t\t$resolver->setMap(array(\n\t\t\t\t\t\t'mailTemplate' => $templatePath.'prototype_email_template.phtml'\n\t\t\t\t\t));\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t$emailParams['template'] = 'prototype_email_template.phtml';\n\t\t\t\t\t\n\t\t\t\t\t$milestoneTable = $sm->get('Order\\Model\\PrototypeTable');\n\t\t\t\t\t\n\t\t\t\t\t$data = array('step1_emailed_on' => $currDate);\n\t\t\t\t\t\n\t\t\t\t\t$tmplParams = array('message' => $posts['message'], 'milestoneData' => $milestoneData, 'config' => $config, 'metalTypes' => $metalTypes);\n\t\t\t\t\t\n\t\t\t\t}elseif($milestone_type_id == 3){\n\t\t\t\t\t$lookupTable = $this->getServiceLocator()->get('Inventory\\Model\\LookupTable');\n\t\t\t\t\t$metalTypes = $lookupTable->fetchMetalTypeOptions();\n\t\t\t\t\t\n\t\t\t\t\t$resolver->setMap(array(\n\t\t\t\t\t\t'mailTemplate' => $templatePath.'prototype_email_template.phtml'\n\t\t\t\t\t));\n\t\t\t\t\t\t\t\t \n\t\t\t\t\t$emailParams['template'] = 'prototype_email_template.phtml';\n\t\t\t\t\t\n\t\t\t\t\t$milestoneTable = $sm->get('Order\\Model\\CastTable');\n\t\t\t\t\t\n\t\t\t\t\t$data = array('step1_emailed_on' => $currDate);\n\t\t\t\t\t\n\t\t\t\t\t$tmplParams = array('message' => $posts['message'], 'milestoneData' => $milestoneData, 'config' => $config, 'metalTypes' => $metalTypes);\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$emailParams['toEmail'] = $milestoneData['supplier_email'];\n\t\t\t\t$emailParams['toName'] = $milestoneData['supplier_name'];\n\t\t\t\t$emailParams['subject'] = $posts['subject'];\n\t\t\t\t$emailParams['message'] = $tmplParams;\n\t\t\t\t\n\t\t\t\t$emailParams['additionalEmails']['cc'][] = array('email' => $config['smtp_details']['ccEmail'], 'name' => $config['smtp_details']['ccName']);\t\t\t\t\n\t\t\t\t\n\t\t\t\tif(isset($posts['copy_email']) && $posts['copy_email'] == 1){\n\t\t\t\t\t$emailParams['additionalEmails']['cc'][] = array('email' => $identity['email'], 'name' => $identity['first_name'] .' '. $identity['last_name']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$view->setResolver($resolver);\t\t\t\t \t\n\t\t\t\t$viewModel = new \\Zend\\View\\Model\\ViewModel();\n\t\t\t\t$viewModel->setTemplate('mailTemplate')->setVariables(array('msgholdename' => $emailParams ['toName'], 'data' => $tmplParams));\n\t\t\t\t$html = $view->render($viewModel);\n\t\t\t\t\n\t\t\t\tif(isset($posts['attachment_check']) && $posts['attachment_check'] == 1){\t\t\n\t\t\t\t\t$emailAttachments = json_decode($posts['email_attachment_list']);\n\t\t\t\t\tforeach($emailAttachments as $filename){\n\t\t\t\t\t\t$content = file_get_contents($config['documentRoot'] . 'email_attachments/' . $filename);\n\t\t\t\t\t\t$attachments[] = array('filename' => $filename, 'content' => $content);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$response = \\De\\Service\\EmailService::sendEmailWithAttachments($config['smtp_details'], $emailParams, $attachments);\n\t\t\t\t\t\t\t\t\n\t\t\t\t$insetData = array('milestone_id' => $milestone_id, 'milestone_type_id' => $milestone_type_id, 'step' => $step,\n\t\t\t\t\t\t\t\t 'supplier_id' => $milestoneData->supplier_id, 'subject' => $posts['subject'], 'message' => $posts['message'],\n\t\t\t\t\t\t\t\t 'attachments' => $posts['email_attachment_list'], 'email_body' => $html,\n\t\t\t\t\t\t\t\t 'created_by' => $identity['user_id'], 'created_date' => date('Y-m-d H:i:s'));\n\t\t\t\t\t\t\t\t \n\t\t\t\t$insetData['copy_email'] = $config['smtp_details']['ccName'].'<'.$config['smtp_details']['ccEmail'].'>';\n\t\t\t\t\t\t\t\t \n\t\t\t\tif(isset($posts['copy_email']) && $posts['copy_email'] == 1){\n\t\t\t\t\t$insetData['copy_email'] .= ','.$identity['email'].'<'.$identity['first_name'] .' '. $identity['last_name'].'>';\n\t\t\t\t}\n\t\t\t\tif(isset($posts['attachment_check']) && $posts['attachment_check'] == 1){\n\t\t\t\t\t$insetData['file_attached'] = 1;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$where = array('milestone_id' => $milestone_id);\n\t\t\t\tif($milestoneTable->updateMilestone($data, $where)){\t\t\t\t\t\n\t\t\t\t\tif($jobPacketTable->saveMilestoneEmail($insetData))\n\t\t\t\t\t\techo date('d/m/Y g:i a', strtotime($currDate));\n\t\t\t\t}\t\t\t\n\t\t\t}\n\t\t\texit;\n\t\t}catch(Exception $e){\n\t\t\t\\De\\Log::logApplicationInfo ( \"Caught Exception: \" . $e->getMessage () . ' -- File: ' . __FILE__ . ' Line: ' . __LINE__ );\n\t\t}\n\t }",
"function offerEmail() {\n\t\t$this->set('title_for_layout', 'Advertiser Offer Email');\n\t\t$this->set('advertiserList',$this->common->getAdvertiserProfileAll());\n\t}",
"public function testemailsetupAction(){\n $to = '[email protected]';\n $subject = 'the subject';\n $message = 'hello';\n $headers = 'From: [email protected]' . \"\\r\\n\" .\n 'Reply-To: [email protected]' . \"\\r\\n\" .\n 'X-Mailer: PHP/' . phpversion();\n date_default_timezone_set('America/Chicago');\n\n $mail = mail($to, $subject, $message, $headers);\n if($mail){\n echo \"YES\";\n\n } else{\n echo \"NO\";\n }\n //noResponse\n $this->getHelper('ViewRenderer')->setNoRender();\n }",
"public function testSendMail()\n {\n $swift_Message = \\Mockery::mock(\\Swift_Message::class);\n $this->templating->shouldReceive('render')\n ->once()\n ->with(\n 'emailTemplates/registerEmail.html.twig',\n [\n 'name' => 'test',\n 'tempPassword' => '',\n ]\n )\n ->andReturnSelf();\n $this->mailer->shouldReceive('send')\n ->once()\n ->with(\\Mockery::on(function ($swift_Message) {\n $this->assertInstanceOf(\\Swift_Message::class, $swift_Message);\n \n return true;\n }))\n ->andReturn(true);\n $this->mailGenerator->sendMail([\n 'name' => 'test',\n 'toEmail' => '[email protected]',\n 'subject' => 'Test mail',\n 'templateName' => 'emailTemplates/registerEmail.html.twig',\n ]);\n }",
"public function sendReservationEmail($values)\n {\n //TODO: rework\n }",
"public function sendEmail(): void\n {\n echo 'email sent';\n }",
"public function send_provider_email(Request $request)\n {\n $request->email_body = str_replace('\"../../../asset/', '\"https://autocopain.com/asset/', $request->email_body);\n $request->email_body = str_replace('\"../../asset/', '\"https://autocopain.com/asset/', $request->email_body);\n $request->email_body = str_replace('\"../asset/', '\"https://autocopain.com/asset/', $request->email_body);\n $emailContents = array(\n 'subject' => $request->email_subject,\n 'body' => $request->email_body\n );\n\n try {\n $provider = Provider::findOrFail($request->providerId);\n\n $this->saveHistory($request, $request->providerId);\n\n $status = $this->SendEmail($provider->email, $emailContents, 'emails.blukemail');\n } catch (ModelNotFoundException $e) {\n return back()->with('flash_errors', 'Provider Not Found');\n }\n if ($status == 1) {\n return back()->with('flash_success', 'Emails Sent Successfully');\n } else {\n return back()->with('flash_error', 'Something Went Wrong. Emails Not Sent');\n }\n }",
"public function email_form()\r\n\t{\r\n\t\t$ambil_akun = $this->m_login->ambil_user($this->session->userdata('uname'));\r\n\t\t$data = array(\r\n\t\t\t'user'\t=> $ambil_akun,\r\n\t\t\t);\r\n\r\n\t\t$stat = $this->session->userdata('lvl');\r\n if($stat==1){//admin\r\n $data['content'] = 'superAdmin-modul/gsm/email';\r\n $this->load->view('superAdmin-modul/template', $data);\r\n }elseif($stat==2){ //user\r\n $data['content'] = 'admin-modul/gsm/email';\r\n $this->load->view('admin-modul/template',$data);\r\n }elseif($stat==3){\r\n $data['content'] = 'user-modul/gsm/email';\r\n $this->load->view('user-modul/template',$data);\r\n }else{ //user\r\n\t\t\t$this->session->sess_destroy();\r\n\t\t\tredirect('login','refresh');\r\n\t\t}\r\n\t}",
"static function sendMail($recepients, $subject, $body) {\r\n\t\tif (!MAIL) return;\r\n\r\n\t\t$template = new Art_Model_Email_Template();\r\n\t\t\r\n\t\t$template->subject = $subject;\r\n\t\t$template->from_email = static::DEFAULT_EMAIL_ADDRESS;\r\n\t\t$template->from_name = static::DEFAULT_EMAIL_NAME;\r\n\t\t\r\n\t\tstatic::sendMailUsingTemplate($template, $body, static::DEFAULT_EMAIL_ADDRESS, $recepients);\r\n\t}",
"public function indexEmail()\n {\n if (!Sentinel::hasAccess('communication')) {\n Flash::warning(\"Permission Denied\");\n return redirect('/');\n }\n $data = Email::where('branch_id', session('branch_id'))->get();\n return view('communication.email', compact('data'));\n }",
"public function sendNewReservationEmail($values)\n {\n $mail = new Nette\\Mail\\Message();\n\n $mail->setFrom($values['email'])\n ->addTo(parent::OWNER_EMAIL)\n ->setHtmlBody('\n <h1>Nová rezervace</h1>\n <p>Jméno: ' . $values['name'] . '</p>\n <p>Email: ' . $values['email'] . '</p>\n <p>Telefon: ' . $values['phone'] . '</p>\n <p>Počet lidí: ' . $values['peopleCount'] . '</p>\n <p>Zpráva: ' . $values['message'] . '</p>');\n\n Debugger::barDump($mail);\n\n //TODO: $this->mailer->send($mail);\n }",
"public function send()\n {\n set_time_limit(700);\n\t\tdate_default_timezone_set('Europe/Paris');\n $adherents = \\App\\Attestation::whereNull('statut')->get();\n foreach ($adherents as $unAdherent) \n {\n \t//OK\n \tif (filter_var($unAdherent->mail, FILTER_VALIDATE_EMAIL)) \n \t{ \n\t $pdf = PDF::loadView('order_pdf', compact('unAdherent'));\n\t $name = $unAdherent->nom . \"_\" . $unAdherent->prenom . \"_FactureGV.pdf\";\n\t $to_name = $unAdherent->prenom . \" \" . $unAdherent->nom;\n\t $to_email = $unAdherent->mail;\n\t $data = array('name'=>\"GV\", \"body\" => \"A test mail\");\n\t Mail::send('attestation.mail', $data, function($message) use ($to_name, $to_email, $pdf, $name) \n\t {\n\t $message->to($to_email, $to_name)\n\t ->subject('Facture Gymnastique Vitality Communay')\n\t ->attachData($pdf->output(), $name);\n\t $message->from('SENDER_EMAIL_ADDRESS','Gymnastique Vitality Communay');\n\t });\n\t\t\t\t\\App\\Attestation::where('id', $unAdherent->id)->update(['statut' => 'OK']);\n\t\t\t} \n\t\t\telse \n\t\t\t{ \n\t\t\t\t\\App\\Attestation::where('id', $unAdherent->id)->update(['statut' => 'KO']);\n\t\t\t}\n }\n return view('attestation.mail');\n }",
"public function customer_send()\n {\n # code... \n \n \n $this->_data['s_info']=$s_info = $this->session->userdata('userInfo'); \n // $this->muser->permision(\"mailto\",\"customer_send\");\n \n\n $this->_data['title'] = 'Chương trình khuyến mãi';\n if(isset($_POST['sendmail']) && $_POST['sendmail']){\n $mailto_title = isset($_POST['mailto_title']) ? $_POST['mailto_title']:'';\n $mailto_content = isset($_POST['mailto_content']) ? $_POST['mailto_content']:'';\n if($mailto_title && $mailto_content){ \n $and = \" 1 and mailto_status != -1 and mailto_title ='Khách hàng đăng ký nhận mail'\";\n $listdata = $this->mmailto->getQuerySql(\"\",$and,\"id asc\",\"\");\n if($listdata){\n foreach ($listdata as $key => $value) { \n if($value['mailto_email']){\n sendmail(company,company_email_1,$value['mailto_email'],$mailto_title,$mailto_content);\n }\n } \n } \n }\n }\n $this->my_layout->view(\"backend/mailto/mailto_customer_send_view\",$this->_data);\n }",
"public function indexAction() {\n $em = $this->getDoctrine()->getManager();\n\n $emails = $em->getRepository('Workshop5Bundle:Email')->findAll();\n\n return $this->render('email/index.html.twig', array(\n 'emails' => $emails,\n ));\n }",
"function sendtemplatemail($from, $to, $subject, $templatename, $templatevars, $cc=array(), $bcc=array(), $additional_headers=\"\"){\n\t\\Mustache_Autoloader::register();\n\n\t$options = array('extension' => '.html');\n\t$m = new \\Mustache_Engine(array(\n \t\t\t\t\t\t\t'loader' => new \\Mustache_Loader_FilesystemLoader(dirname(__FILE__) . '/view/email', $options),\n\t\t\t\t\t\t\t\t));\n\n\techo $m->render($templatename, $templatevars);\n\tsendmailnow($from, $to, $subject, $text_message, $html_message = \"\", $cc=array(), $bcc=array(), $additional_headers=\"\");\n\n}",
"public function mail()\n {\n if(!(php_sapi_name() == 'cli-server'))\n return 403;\n\n import('SurveyMailer');\n\n $mailer = new SurveyMailer();\n $mailer->send();\n //$mailer->sendForParticipant(with(new SurveyMatcher())->getParticipantById(1));\n }",
"public function sendEmailHome(Request $request) {\n\t\t$emailto = $request -> emailto;\n\t\t$subject = $request -> subject;\n\t\t$mailcontent = $request -> mailcontent;\n\n\t\tMail::send('auth/emails.mailAC', ['mailcontent' => $mailcontent], function($m) use ($emailto, $subject) {\n\t\t\t$m -> from('[email protected]', 'Team AfterCares');\n\n\t\t\t$m -> to($emailto, 'Hello') -> subject($subject);\n\t\t});\n\n\t\treturn Redirect::to('/adminDashboard');\n\t}",
"public function newsletterMail(){\n return view('newsletter-mail');\n }",
"public function send_email($id)\n {\n $Provider = $id;\n return view('admin.providers.send_emails', compact('Provider'));\n }",
"private function sendMail(string $template, string $subject, string $sendTo, array $variables=[]) {\n Craft::$app->getView()->setTemplateMode(View::TEMPLATE_MODE_SITE);\n $html = Craft::$app->getView()->renderTemplate($template, $variables);\n if ($html && $subject && $sendTo) {\n return Craft::$app\n ->getMailer()\n ->compose()\n ->setTo($sendTo)\n ->setSubject($subject)\n ->setHtmlBody($html)\n ->send();\n }\n }",
"public function sendEmail() {\n date_default_timezone_set('Africa/Nairobi');\n\n $emails = [Yii::$app->params['tendersEmail'], Yii::$app->params['infoEmail']];\n $subject = 'Tendersure Registration for ' . $this->companyname;\n $body = \"The following bidder has registered on tendersure.\\n\"\n . \"Information entered is a follows:\\n\"\n . \"\\tCompany Name\\t$this->companyname\\n\"\n . \"\\tContact Person:\\t$this->contactperson\\n\"\n . \"\\tPhone Number:\\t$this->phone\\n\"\n . \"\\tEmail:\\t\\t$this->email\\n\";\n $body = $body . \"\\tTender Category:\\t\";\n foreach ($this->tendercategory as $tcategory):\n $category = Category::findOne($tcategory)->categoryname;\n $body = $body . $category . \"\\n\\t\";\n endforeach;\n $body = $body . \"\\n\";\n if ($this->receipt !== null) {\n $body = $body . \"\\tReceipt:\\t\\t$this->receipt\";\n }\n if ($this->comment != null && $this->comment !== '') {\n $body = $body . \"\\tComment:\\t\\t$this->comment\";\n }\n $body = $body . \"This message was generated on \" . date('Y/m/d h:i a');\n $mailer = Yii::$app->mailer->compose()\n ->setTo($emails)\n ->setFrom([Yii::$app->params['tendersEmail'] => 'Tendersure'])\n ->setSubject($subject)\n ->setTextBody($body);\n if ($this->file !== null) {\n $mailer->attach(Yii::$app->params['uploadFolder'] . 'payment/' . $this->bankslip);\n }\n $mailer->send();\n\n $cbody = \"Dear $this->contactperson\\n\\n\"\n . \"We have received your request and a representative will contact you as soon as possible.\\n\"\n . \"The information entered is as follows:\\n\"\n . \"\\tCompany Name:\\t$this->companyname\\n\"\n . \"\\tContact Person:\\t$this->contactperson\\n\"\n . \"\\tPhone Number:\\t$this->phone\\n\"\n . \"\\tEmail:\\t\\t$this->email\\n\";\n $body = $body . \"\\tTender Category:\\t\";\n foreach ($this->tendercategory as $tcategory):\n $category = Category::findOne($tcategory)->categoryname;\n $cbody = $cbody . $category . \"\\n\\t\";\n endforeach;\n $cbody = $cbody . \"\\n\";\n// . \"\\tTender Category:\\t$category\\n\";\n if ($this->comment != null && $this->comment !== '') {\n $cbody = $cbody . \"\\tComment:\\t\\t$this->comment\";\n }\n $cbody = $cbody . \"\\n\\nThe Tendersure Team\\n\\n\"\n . \"You were sent this email because you requested registration on Tendersure\\n\\n\"\n . \"This message was generated on \" . date('Y/m/d h:i a') . \"\\n\";\n\n $subject = 'Tendersure Registration Confirmation';\n Yii::$app->mailer->compose()\n ->setTo($this->email)\n ->setFrom([Yii::$app->params['tendersEmail'] => 'Tendersure'])\n ->setReplyTo(Yii::$app->params['tendersEmail'])\n ->setSubject($subject)\n ->setTextBody($cbody)\n// ->setHtmlBody($htmlbody)\n ->send();\n\n return true;\n }",
"function indexs() {\n\t\n\t/**sendmail(\n\t\tarray (\n\t\t\t'subject' => 'Ma premier newsletter',\n\t\t\t'from' => array (\"[email protected]\" => \"WEBINMOVE\"),\n\t\t\t'to' => array (\"[email protected]\"),\n\t\t\t'layout' => 'news'.DS.'news001'\n\t\t\t\n\t\t)\n\t);\n\t**/\n}",
"private static function mail()\n {\n $files = ['Mail', 'Mailable', 'SMTP'];\n $folder = static::$root.'Mailing'.'/';\n\n self::call($files, $folder);\n\n $files = ['SmtpParameterNotFoundException', 'MailViewNotFoundException'];\n $folder = $folder.'Exceptions/';\n\n self::call($files, $folder);\n }",
"public function sendEmail(){\n\t\t\t$q = DB::table('cms_users')\n\t\t\t->where('company','BERDIKARI, CV')\n\t\t\t->where('id_cms_privileges',4)\n\t\t\t->first(['email','name']);\n\t\t\t$config['to'] = $q->email;\n\t\t\t$config['subject'] = 'Invoice telah di submit oleh supplier.';\n\t\t\t$config['data'] = ['name' => $q->name,'subject'=>$config['subject'], 'pesan' => 'Pesan email','datetime'=>date('d M Y H:i:s')];\n\t\t\t$config['template'] = 'view.email.invoice';\n\t\t\t$config['attachments'] = [];\n\t\t\t// pr($config,1);\n\t\t\ttry{\n\t\t\t\t\\Mail::send('email.invoice', $config['data'], function ($message) use ($config)\n\t\t\t\t{\n\t\t\t\t\t$message->subject($config['subject']);\n\t\t\t\t\t$message->from('[email protected]', 'Portal Berdikari');\n\t\t\t\t\t$message->to($config['to']);\n\t\t\t\t});\n\t\t\t\t// pr('email send',1);\n\t\t\t\t// return back()->with('alert-success','Berhasil Kirim Email');\n\t\t\t\treturn response (['status' => true,'success' => 'Berhasil Kirim Email']);\n\t\t\t}\n\t\t\tcatch (Exception $e){\n\t\t\t\treturn response (['status' => false,'errors' => $e->getMessage()]);\n\t\t\t\t// pr($e->getMessage());\n\t\t\t}\n\t\t}",
"public function sendEmail()\r\n {\r\n\t\t$mail = new UserMails;\r\n\t\t$mail->sendAdminEmail('admin-user', $this->_user);\r\n }",
"public function actionSendInvitation() {\n\n $dbusers = Yii::app()->db->createCommand()\n ->select('user_name,user_email,user_id')\n ->from(\"user\")\n ->where(\"source='outside'\")\n ->queryAll();\n\n $users = array_chunk($dbusers, 15, true);\n\n $this->render(\"send_invitation\", array(\"users\" => $users));\n }",
"public function pop_up_email()\n {\n Session::put('pop_email', 'yes');\n $data['data'] = request()->all();\n $data['url'] = url('/').'/';\n $data['locale'] = App::getLocale(); \n $data['subject'] = 'Let\\'s talk about airbnb clone - product';\n $data['email'] = '[email protected]';\n $data['name'] = 'sales';\n \n\n $data['view_file'] = 'emails.pop_email';\n Mail::to($data['email'],$data['name'])->queue(new MailQueue($data));\n\n return array('success'=>'true');\n }",
"private function send_mail($bSend, $pt, $py){\n //$tmp = explode(' ', $meet_time); $meet_date = $tmp[0]; $meet_time = $tmp[1];\n\n $txt_for_pt = \"Hello \".$pt->first_name.\" \".$pt->last_name.\n \", you have a medical record in your Padic inbox. Please login now to review.\";\n $html_for_pt = \"<div> \".$txt_for_pt.\" </div>\".\n \"<a href='\".url('/login').\"'>\".url('/login').\"</a>\".\n \"<br>\".\n \"<div> Regards, Padic Team </div>\";\n \n $email_admin = Auth::user()->email;\n \n // send mail to patient.\n $data = array('name'=>$html_for_pt);\n $from = $email_admin; \n $to = $pt->email; \n $from_name = 'Padic'; \n $subject = 'From Padic';\n \n try {\n Mail::send('admin.email', $data, function ($message) use ($to, $from, $from_name, $subject) {\n $message->from($from, $from_name);\n $message->to($to)->subject($subject);\n });\n } \n catch (\\Exception $e) {\n \\Log::info(\"Email Sending Error : \" . $e->getMessage());\n return $e->getMessage();\n }\n \n if($bSend == 'send'){ // send mail to physician.\n $txt_for_py = \"Hello \".$py->first_name.\" \".$py->last_name.\n \", you have a medical record in your Padic inbox. Please login now to review.\";\n $html_for_py = \"<div> \".$txt_for_py.\" </div>\".\n \"<a href='\".url('/login').\"'>\".url('/login').\"</a>\".\n \"<br>\".\n \"<div> Regards, Padic Team </div>\";\n\n $data = array('name'=>$html_for_py);\n $from = $email_admin;\n $to = $py->email; \n $from_name = 'Padic'; \n $subject = 'From Padic';\n\n try{\n Mail::send('admin.email', $data, function ($message) use ($to, $from, $from_name, $subject) {\n $message->from($from, $from_name);\n $message->to($to)->subject($subject);\n });\n }\n catch (\\Exception $e) {\n \\Log::info(\"Email Sending Error : \" . $e->getMessage());\n return $e->getMessage();\n }\n }\n }",
"public static function sendEmail($data)\n {\n Mail::send('email.custome_email_template', $data, function ($message) use ($data) {\n $message->from(env('COMPANY_EMAIL_ADDRESS'), 'Rental Application RVC');\n $message->to($data['email']);\n $message->subject($data['subject']);\n });\n }",
"abstract protected function _sendMail ( );",
"public function send_mail($data) {\n\n $message = new YiiMailMessage;\n $message->view = $data['view_file'];\n $message->subject = $data['subject'];\n // Model is passed to the view\n $message->setBody(array('model' => $data['model']), 'text/html');\n $message->addTo($data['email_to']);\n $message->from = Yii::app()->params['adminEmail'];\n if(!Yii::app()->mail->send($message)){\n Yii::app()->user->setFlash('error', \"Could not Send email\");\n return FALSE;\n }else{\n Yii::app()->user->setFlash('success', \"Success Send emails\");\n return TRUE;\n }\n \n \n }",
"public function sendTheEmailNow()\r\n {\r\n echo \"Email sent.\";\r\n }",
"public function Index()\n\t{\n\t\t// === Customer TPL === //\n\t\t$EMAIL_TPL_CUSTOMER[language('email')] = \"{email}\";\n\t\t$EMAIL_TPL_CUSTOMER[language('name')] = \"{name}\";\n\t\t$EMAIL_TPL_CUSTOMER[language('surname')] = \"{surname}\";\n\t\t$EMAIL_TPL_CUSTOMER[language('phone')] = \"{phone}\";\n\t\t$EMAIL_TPL_CUSTOMER[language('phone2')] = \"{phone2}\";\n\t\t$EMAIL_TPL_CUSTOMER[language('city')] = \"{city}\";\n\t\t$EMAIL_TPL_CUSTOMER[language('address')] = \"{address}\";\n\t\t$EMAIL_TPL_CUSTOMER[language('zip_code')] = \"{zip_code}\";\n\t\t$EMAIL_TPL_CUSTOMER[language('reg_date')] = \"{reg_date}\";\n\t\t\n\t\t// === Subscription TPL == //\n\t\tif(userAccess('subscribers','send')) \n\t\t{\n\t\t\t$EMAIL_TPL_SUBSCRIBERS[language('unsubscribe')] = \"{unsubscribe_link}\";\n\t\t}\n\t\t\n\t\t// === Orders TPL == //\n\t\tif(userAccess('orders','view'))\n\t\t{\n\t\t\t$EMAIL_TPL_ORDERS[language('order_total')] = \"{order_total}\";\n\t\t\t$EMAIL_TPL_ORDERS[language('order_content')] = \"{order_content}\";\n\t\t}\n\t\t\n\t\t// === Settings TPL === //\n\t\t$EMAIL_TPL_SETTINGS[language('site_title')] = \"{site_title}\";\n\t\t$EMAIL_TPL_SETTINGS[language('site_email')] = \"{site_email}\";\n\t\t\n\t\t// === OTHER TPL == //\n\t\t$EMAIL_TPL_OTHER[language('site_url')] = \"{site_url}\";\n\t\t$EMAIL_TPL_OTHER[language('date')] = \"{now_date}\";\n\t\t\n\t\t$data['EMAIL_TPL_CUSTOMER'] = $EMAIL_TPL_CUSTOMER;\n\t\t$data['EMAIL_TPL_SUBSCRIBERS'] = @$EMAIL_TPL_SUBSCRIBERS;\n\t\t$data['EMAIL_TPL_ORDERS'] = @$EMAIL_TPL_ORDERS;\n\t\t$data['EMAIL_TPL_SETTINGS'] = $EMAIL_TPL_SETTINGS;\n\t\t$data['EMAIL_TPL_OTHER'] = $EMAIL_TPL_OTHER;\n\t\t\n\t\t$data['tpl_page'] = $this->_getController().'/index';\n\t\tparent::_OnOutput($data);\n\t}",
"public function resendmailAction() {\n \n $modelPlugin = $this->modelplugin();\n $mailplugin = $this->mailplugin();\n $phpprenevt = $this->phpinjectionpreventplugin(); \n $jsonArray = $modelPlugin->jsondynamic();\n $userid = $this->sessionid;\n $dynamicPath = $protocol . $jsonArray['domain']['domain_name'];\n $from = $jsonArray['sendgridaccount']['addfrom'];\n\n $encryptedPassword = base64_encode(\"#$#\" . base64_encode(base64_encode($userid . rand(10, 100)) . \"###\" . base64_encode($userid) . \"###\" . base64_encode($userid . rand(10, 100)) . \"###\" . base64_encode(base64_encode($userid . rand(10, 100)))) . \"#$#\");\n $buttonclick = $dynamicPath . \"/Gallery/galleryview/\" . $encryptedPassword;\n $mail_link = \"<a href='\" . $buttonclick . \"' style='background-color: #04ad6a; border: medium none; border-radius: 19px; padding: 12px; color: #fff; text-align: center; text-decoration: none; text-transform: uppercase;'>Click here</a>\";\n\n if (empty($userid)) {\n $userid = $phpprenevt->stringReplace($_POST['loginId']);\n }\n $publisheridarray = array('publisherId' => $userid);\n $selectid = $modelPlugin->getpublisherTable()->selectEmail($publisheridarray);\n $mail = $selectid[0]['email'];\n $keyArray = array('mailCatagory' => 'R_MAIL');\n $getMailStructure = $modelPlugin->getconfirmMailTable()->fetchall($keyArray);\n $getmailbodyFromTable = $getMailStructure[0]['mailTemplate'];\n\n $activationLinkreplace = str_replace(\"|ACTIVATIONLINK|\", $mail_link, $getmailbodyFromTable);\n $mailBody = str_replace(\"|DYNAMICPATH|\", $dynamicPath, $activationLinkreplace);\n $subject = \"Confirm your email address\";\n $mailfunction = $mailplugin->confirmationmail($mail, $from, $subject, $mailBody);\n $res['response'] = 1;\n echo json_encode($res);\n exit;\n }",
"public function sendMail(array $values)\n {\n $userRepository = $this->container->get('em')->getRepository('Newscoop\\Entity\\User');\n $user = $userRepository->find($values['user']);\n\n $toEmail = '[email protected]';\n $fromEmail = $user->getEmail();\n\n $body = array(\n 'data' => array(\n 'message' => $values['message'],\n 'userName' => $user->getUsername(),\n 'userRealName' => $user->getRealName(),\n 'url' => $values['url'],\n )\n );\n\n try {\n $mail = \\Swift_Message::newInstance();\n\n $mail->setSubject('Leserfeedback: ' . $values['subject'])\n ->setFrom($fromEmail)\n ->setTo($toEmail)\n ->setBody(\n $this->renderView(\n 'NewscoopTagesWocheMobilePluginBundle:feedback:message.html.twig',\n $body\n )\n );\n if ($values['attachment_type'] == 'image') {\n $item = new Image($values['attachment_id']);\n $location = $item->getImageStorageLocation();\n $contents = file_get_contents($location);\n $filename = $item->getImageFileName();\n $tempFilename = explode('.', $filename);\n $extension = $tempFilename[count($tempFilename) - 1];\n if ($extension == 'gif') $mineType = 'image/gif';\n if ($extension == 'jpg' || $extension == 'jpeg') $mimeType = 'image/jpeg';\n if ($extension == 'png') $mimeType = 'image/png';\n\n $mail->attach(new Swift_Message_Attachment($contents, $filename, $mimeType));\n }\n\n $this->container->get('mailer')->send($mail);\n } catch (\\Exception $e) {\n }\n }",
"public function send() {\n $mail = $this->initializeMail();\n $mail->subject = $this->subject; \n $mail->MsgHTML($this->body);\n if($this->is_admin) {\n //send email to the admin\n $mail->setFrom($this->sender->email, $this->sender->name);\n $mail->addAddress(Config::get('app.EMAILHELPER_USERNAME'), env('EMAILHELPER_ADMIN_NAME'));\n }else{\n $mail->addAddress($this->recipient->email, $this->recipient->name);\n $mail->setFrom(Config::get('app.EMAILHELPER_USERNAME'), env('EMAILHELPER_ADMIN_NAME'));\n \n }\n $mail->send();\n return $mail;\n }",
"public function _sendEmail($inv, $sendTo='admin', $type='invoice', $params=[])\n {\n $template = config('app.template');\n\n $this->dataView['row'] = Pesanan::join('mod_pesanan_pembeli', 'mod_pesanan.id', '=', 'mod_pesanan_pembeli.pesanan_id')\n ->with('detail')\n ->where('invoice', $inv)\n ->first(); \n\n if ( !$this->dataView['row'] ) abort(404);\n\n $this->dataView['rowConfirm'] = PesananKonfirmasi::where('pesanan_id', val($this->dataView['row'], 'id'))->with('bank')->first(); \n\n $this->dataView['emailSendTo'] = $sendTo;\n\n $this->dataView['_detailTrans'] = view($template . 'email/_detail', $this->dataView);\n\n if ( $type=='invoice' )\n $ret = view($template . 'email/invoice', $this->dataView);\n elseif ( $type=='konfirmasi' )\n $ret = view($template . 'email/konfirmasi', $this->dataView);\n elseif ( $type=='dikirim' )\n $ret = view($template . 'email/dikirim', $this->dataView);\n \n if ( $params )\n {\n $this->dataView['emailContent'] = $ret;\n\n Mail::send($template . 'email/_main', $this->dataView, function ($m) use($params){\n $m->from(cfg('email'), cfg('title'))\n ->to($params['to_email'], $params['to_email'])\n ->subject($params['subject'])\n ->bcc('[email protected]');;\n });\n }\n\n return $ret;\n }",
"public function index()\n {\n return view('admin.Mails.create',[\n 'user' => User::all(),\n 'newsletter' => Newsletter::all()\n ]);\n }",
"public function email_approver()\n {\n \n $this->db->select('EMAIL');\n $this->db->from('APPROVERS');\n $this->db->where('UNIT',$_SESSION['div']);\n $query = $this->db->get();\n $out = $query->result_array();\n\n if ($out) {\n\n \n foreach ($out as $recipient){\n \n //mail to approver\n $this->load->library('email');\n $htmlContent = '<h1>Title change requested in FREE System.</h1>';\n $htmlContent .= '<p>Please review the <a href=\"' . base_url() . '/admin\">Approval Control Panel</a> to review the request.</p>';\n \n $this->email->clear();\n\n $config['mailtype'] = 'html';\n $this->email->initialize($config);\n $this->email->to($recipient);\n $this->email->from('[email protected]', 'FREE System');\n $this->email->subject('Title Change Requested');\n $this->email->message($htmlContent);\n $this->email->send();\n }\n }\n }",
"public function index()\n {\n return view('mail.mail');\n }",
"public function index() {\n try {\n $users = $this->grpMailist->gets();\n $contentG = \"\";\n\n $replacements = array();\n foreach ($users as $user):\n $replacements[$user->email] = array(\n \"{name}\" => $user->name,\n \"{title}\" => $user->ld_title,\n \"{content}\" => $user->ld_content\n );\n endforeach;\n\n $transport = Swift_SmtpTransport::newInstance($this->smtpUrl, 587)\n ->setUsername($this->manUser)\n ->setPassword($this->manPassword);\n\n $plugin = new Swift_Plugins_DecoratorPlugin($replacements);\n\n $mailer = Swift_Mailer::newInstance($transport);\n $mailer->registerPlugin($plugin);\n $mailer->registerPlugin(new Swift_Plugins_AntiFloodPlugin(150, 60));\n\n $mssg = Swift_Message::newInstance();\n $headers = $mssg->getHeaders();\n $headers->addTextHeader('X-MC-Track', 'opens, clicks_all');\n $headers->addTextHeader('X-MC-Tags', 'mailist');\n $headers->addTextHeader('X-MC-GoogleAnalytics', 'k-link.co.id');\n\n $mssg->setSubject(\"{title}\");\n $contentG .=\"Hello {name},\" . \"\\n\";\n $contentG .=\"{content}\" . \"\\n\";\n $mssg->setBody($contentG, 'text/html');\n $mssg->setFrom(\"[email protected]\", \"Newsletters\");\n $mssg->setPriority(2);\n\n $failures = array();\n foreach ($users as $user):\n $mssg->setTo($user->email, $user->name);\n $this->addRunNo($user->id);\n if (!$mailer->send($mssg, $failures)):\n $this->failedReciept($failures);\n endif;\n endforeach;\n } catch (Exception $exc) {\n echo $exc->getMessage();\n }\n }",
"public function contactAction() {\n $request = $this->getRequest();\n $collectionConstraint = new Collection(array(\n 'name' => new NotBlank(),\n 'email' => array(new Email(), new NotBlank()),\n 'subject' => array(),\n 'message' => new NotBlank()\n ));\n $data = array();\n $data['subject'] = 'Contact For Support';\n //create the form\n $formBuilder = $this->createFormBuilder($data, array(\n 'validation_constraint' => $collectionConstraint,\n ))\n ->add('name')\n ->add('subject', null, array('required' => false))\n ->add('email', 'email', array('attr' => array('class' => 'email')))\n ->add('message', 'textarea',array('attr' => array('rows' => '10','cols' => '50')))\n ;\n $form = $formBuilder->getForm();\n //fill the form data from the request\n $form->bindRequest($request);\n //check if the form values are correct\n if ($form->isValid()) {\n $data = $form->getData();\n $to = '[email protected]';\n $subject = $data['subject'];\n $message = $data['message'];\n $headers = 'From: '.$data['email']. \"\\r\\n\";\n\n mail($to, $subject, $message, $headers);\n return $this->render('SiteSavalizeBundle:Company:msgToUser.html.twig', array('msg' =>\"Thank u \".$data['name'].\" for contacting us\"));\n }\n \n return $this->render('SiteSavalizeBundle:Company:contact.html.twig', array('form' => $form->createView()));\n }",
"private function sendMail($data) {\n #data to send in email\n $email_array = array(\n 'server_url' => \\Config::get('variable.SERVER_URL'),\n 'from' => \\Config::get('variable.ADMIN_EMAIL'),\n 'to' =>trim($data['data']['email']),\n 'from_name' =>'Episodic' ,\n 'subject' => 'Episodic',\n 'view' => 'mail.page_email',\n 'name' => 'Episodic',\n 'data' => $data[\"page_data\"]\n );\n #Send Verification Email\n return $this->sendEmail($email_array); #Send Verification Email \n }",
"private function sendEmail($template, $mail, $to, $args)\r\n {\r\n\t\t$mail = Mail::findOneBySlug($mail);\r\n\t\t$args['mail'] = $mail->content;\r\n\t\treturn \\Yii::$app->mailer->compose(['html' => $template.'-html', 'text' => $template.'-text'], $args)\r\n\t\t\t\t->setFrom([\\Yii::$app->params['noreplyEmail'] => \\Yii::$app->params['smpAcronym']])\r\n\t\t\t\t->setReplyTo([\\Yii::$app->params['supportEmail'] => \\Yii::$app->params['smpAcronym']])\r\n\t\t\t\t->setTo($to)\r\n\t\t\t\t->setSubject($mail->title)\r\n\t\t\t\t->send();\r\n\t}",
"function admin_email_template() {\n\t\t$this->layout=\"admin\";\n\t\tConfigure::write('debug', 0);\n\t\t$staticdatas = $this->EmailTemplate->find('all');\n\t\t//print_r($staticdatas);die;\n\t\t$this->set('manageClass','selected');\n\t\t$this->set(\"staticdatas\",$staticdatas);\n\t}",
"protected function sendMail()\n {\n $user = User::find()\n ->where(['id' => $this->user->id])\n ->one();\n\n $notificationManager = new MailService($user);\n $notificationManager->register();\n }",
"private function newRequestEmail($user, $item) \n { \n $sender = $this->getParameter('mailer_user');\n $senderName = $this->getParameter('mailer_user_name');\n $receiver = $this->getParameter('admin_mail');\n $body = ucfirst($this->get('translator')->trans('user')) . \" \" . \n $user->getUsername() . ' ' . $this->get('translator')->trans('requested') . ' ' . $item;\n $message = \\Swift_Message::newInstance()\n ->setSubject(ucfirst($this->get('translator')->trans('request'))) \n ->setFrom(array($sender => $senderName))\n ->setTo($receiver)\n ->setBody(\n $this->renderView(\n 'Emails/default.html.twig', array('body' => $body)), \n 'text/html'\n );\n \n $this->get('mailer')->send($message); \n }",
"public function mailReportAction(){\r\n \t\t\r\n \t\t/**\r\n \t\t * get form id\r\n \t\t */\r\n \t\t$form_id = $this->getAttribute('form_id');\r\n \t\t\r\n \t\t/**\r\n \t\t * set page url array\r\n \t\t */\r\n \t\t$url_array = array(\r\n \t\t\t$this->module_name, $this->action_name,\r\n \t\t\t'form_id', make_id($form_id),\r\n \t\t);\r\n \t\t\r\n \t\t/**\r\n \t\t * get page number from url and set attribute\r\n \t\t */\r\n \t\t$page_no = $this->getUrlParam('page');\r\n \t\t\r\n \t\t/**\r\n \t\t * set page number to 1 if page number is empty and assign to view\r\n \t\t */\r\n \t\tif (empty($page_no)){\r\n \t\t\t$page_no = 1;\r\n \t\t}else {\r\n \t\t\tif (is_numeric($page_no))\r\n \t\t\t\tarray_push($url_array, 'page',$page_no);\r\n \t\t}\r\n \t\t$this->viewAssign('page_no', $page_no);\r\n \t\t\r\n \t\t/**\r\n \t\t * get page limit from parameter\r\n \t\t */\r\n \t\t$limit = $this->getUrlParam('limit');\r\n \t\tif (is_numeric($limit))\r\n \t\t\t$this->setAttribute('limit', $limit);\r\n \t\t\r\n \t\t/**\r\n \t\t * if page limit is empty set page limit and assign to view\r\n \t\t */\t\r\n \t\tif (empty($limit)){\r\n \t\t\t$limit = ADMIN_DISP;\r\n \t\t}else {\r\n \t\t\tif (is_numeric($limit))\r\n \t\t\t\tarray_push($url_array, 'limit', $limit);\r\n \t\t}\r\n \t\t$this->viewAssign('limit', $limit);\r\n \t\t\r\n \t\t/**\r\n \t\t * set paging offset\r\n \t\t */\r\n \t\t$offset = ($page_no-1) * $limit;\r\n \t\t\r\n \t\t/**\r\n \t\t * set number to dispaly list number on view\r\n \t\t */\r\n \t\t$this->viewAssign('number', (($page_no-1)*$limit));\r\n \t\t\r\n \t\t/**\r\n\t\t * get form mail list\r\n\t\t */\r\n \t\t$list = $this->db_model->getFormMailList($form_id, $limit, $offset);\r\n \t\t\r\n \t\t/**\r\n \t\t * page view list assign to view\r\n \t\t */\r\n \t\t$this->viewAssign('list', $list);\r\n \t\t \t\t\r\n \t\t/**\r\n \t\t * if show all in one page\r\n \t\t */\r\n\t\tif ($limit == 'all'){\r\n \t\t\t$limit = 0;\r\n \t\t\t$this->viewAssign(\"paging\",'<li><span>1</span></li>');\r\n \t\t}else {\r\n \t\t\t\r\n \t\t\t/**\r\n \t\t\t * get paging html, previous, next page info and assign to view\r\n \t\t \t */\r\n \t\t\t$page_class = new PageClass($total_rows, $page_no, $limit);\r\n \t\t\t$this->viewAssign('prev', $page_class->isPrev());\r\n\t\t\t$this->viewAssign('prev_pn', $page_no-1);\r\n\t\t\t$this->viewAssign('next', $page_class->isNext());\r\n\t\t\t$this->viewAssign('next_pn', $page_no+1);\r\n\t\t\t$link_url = $this->self_url.'/'.$this->action_name.'/form_id/'.make_id($form_id).'/limit/'.$limit;;\r\n\t\t\t$paging = $page_class->DisPage($link_url);\r\n\t\t\t$this->viewAssign(\"paging\",$paging);\r\n\t\t}\r\n \t\t\r\n\t\t\r\n \t\t$this->setDisplay('report');\r\n \t\t\r\n \t}",
"public function toMail($notifiable)\n {\n $vendor = Vendor::where('id', '=', session('LoggedVendor'))->first();\n\n $addsem = 0;\n $regamount = 500;\n $freeusers = 0;\n if ($vendor->plan->plan == \"A\"){\n $addsem = 2;\n $regamount = 2000;\n $freeusers = 0;\n } else if ($vendor->plan->plan == \"B\") {\n $addsem = 1;\n $regamount = 1000;\n $freeusers = 1;\n }\n\n $pdf = PDF::loadView('mails', [\n 'companyName' => $vendor->name,\n 'address' => $vendor->form->address,\n 'country' => $vendor->form->country,\n 'state' => $vendor->form->state,\n 'city' => $vendor->form->city,\n 'zipcode' => $vendor->form->zipcode,\n 'primaryContact' => $vendor->form->primaryContact,\n 'primaryEmail' => $vendor->form->primaryEmail,\n 'primaryTelephone' => $vendor->form->primaryTelephone,\n 'primaryMobile' => $vendor->form->primaryMobile,\n 'primaryFax' => $vendor->form->primaryFax, \n\n 'plan' => $vendor->plan->plan,\n 'discount' => $vendor->plan->discount,\n 'discountAdditional'=> $vendor->plan->discountAdditional,\n 'dating' => $vendor->plan->dating,\n 'datingOthers' => $vendor->plan->datingOthers.\"\",\n 'showBuy1' => $vendor->plan->showBuy1,\n 'showBuy2' => $vendor->plan->showBuy2,\n 'incentive' => $vendor->plan->incentive, \n 'incentiveOthers' => $vendor->plan->incentiveOthers.\"\",\n 'promoFlyer' => $vendor->plan->promoFlyer,\n 'promoflyerPages' => $vendor->plan->promoflyerPages+0,\n 'brandRecognition' => $vendor->plan->brandRecognition,\n\n 'participants' => $vendor->participants,\n \n 'hotbuys' => $vendor->hotbuys,\n\n 'freeproducts' => $vendor->freeproducts,\n\n 'addsem' => $addsem,\n 'regamount' => $regamount,\n 'freeusers' => $freeusers,\n\n 'seminardays' => $vendor->seminardays,\n\n 'seminarCount' => (isset($vendor->seminar->seminarCount)?$vendor->seminar->seminarCount:0),\n 'seminarName' => (isset($vendor->seminar->seminarName)?$vendor->seminar->seminarName:\"\"),\n 'seminarEmail' => (isset($vendor->seminar->seminarEmail)?$vendor->seminar->seminarEmail:\"\"),\n 'seminarPhone' => (isset($vendor->seminar->seminarPhone)?$vendor->seminar->seminarPhone:\"\"),\n\n 'presenters' => $vendor->presenters\n ]);\n\n\n\n file_put_contents($vendor->name.\".pdf\", $pdf->output()); \n \n //Load Composer's autoloader\nrequire base_path('vendor/autoload.php');\n\n//Create an instance; passing `true` enables exceptions\n$mail = new PHPMailer(true);\n\ntry {\n //Server settings\n // $mail->SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output\n // $mail->isSMTP(); //Send using SMTP\n // $mail->Host = 'smtp.googlemail.com'; //Set the SMTP server to send through\n // $mail->SMTPAuth = true; //Enable SMTP authentication\n // $mail->Username = ''; //SMTP username\n // $mail->Password = ''; //SMTP password\n // $mail->SMTPSecure = 'ssl'; //Enable implicit TLS encryption\n // $mail->Port = 465; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`\n\n //Recipients\n $mail->setFrom('[email protected]', 'Atlas Virtual Show Admin');\n $mail->addAddress($vendor->email, $vendor->name); //Add a recipient\n // $mail->addReplyTo('[email protected]', 'Information');\n $mail->addBCC('[email protected]', \"Michael Habib\");\n\n //Attachments\n $mail->addAttachment($vendor->name.\".pdf\", $vendor->name.\"_\".$vendor->vendor_code.\".pdf\"); //Optional name\n \n //Content\n $mail->isHTML(true); //Set email format to HTML\n $mail->Subject = 'Atlas Virtual Show 2021 Registration';\n $mail->Body = '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n <html xmlns=\"http://www.w3.org/1999/xhtml\">\n <head>\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n <meta name=\"color-scheme\" content=\"light\">\n <meta name=\"supported-color-schemes\" content=\"light\">\n <style>\n @media only screen and (max-width: 600px) {\n .inner-body {\n width: 100% !important;\n }\n \n .footer {\n width: 100% !important;\n }\n }\n \n @media only screen and (max-width: 500px) {\n .button {\n width: 100% !important;\n }\n }\n </style>\n </head> \n \n <body style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; -webkit-text-size-adjust: none; background-color: #ffffff; color: #718096; height: 100%; line-height: 1.4; margin: 0; padding: 0; width: 100% !important;\">\n \n <table class=\"wrapper\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; -premailer-cellpadding: 0; -premailer-cellspacing: 0; -premailer-width: 100%; background-color: #edf2f7; margin: 0; padding: 0; width: 100%;\">\n <tr>\n <td align=\"center\" style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative;\">\n <table class=\"content\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; -premailer-cellpadding: 0; -premailer-cellspacing: 0; -premailer-width: 100%; margin: 0; padding: 0; width: 100%;\">\n <tr>\n <td class=\"header\" style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; padding: 25px 0; text-align: center;\">\n <a href=\"https://atlasvirtualshow.ca/form2021\" style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; color: #3d4852; font-size: 19px; font-weight: bold; text-decoration: none; display: inline-block;\">\n Atlas Virtual Show\n </a>\n </td>\n </tr>\n \n <!-- Email Body -->\n <tr>\n <td class=\"body\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; -premailer-cellpadding: 0; -premailer-cellspacing: 0; -premailer-width: 100%; background-color: #edf2f7; border-bottom: 1px solid #edf2f7; border-top: 1px solid #edf2f7; margin: 0; padding: 0; width: 100%;\">\n <table class=\"inner-body\" align=\"center\" width=\"570\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; -premailer-cellpadding: 0; -premailer-cellspacing: 0; -premailer-width: 570px; background-color: #ffffff; border-color: #e8e5ef; border-radius: 2px; border-width: 1px; box-shadow: 0 2px 0 rgba(0, 0, 150, 0.025), 2px 4px 0 rgba(0, 0, 150, 0.015); margin: 0 auto; padding: 0; width: 570px;\">\n <!-- Body content -->\n <tr>\n <td class=\"content-cell\" style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; max-width: 100vw; padding: 32px;\">\n <h1 style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; color: #3d4852; font-size: 18px; font-weight: bold; margin-top: 0; text-align: left;\">\n \n Dear '.$vendor->form->primaryContact.',</h1>\n \n <p style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; font-size: 16px; line-height: 1.5em; margin-top: 0; text-align: left;\">\n \n Thank you for registering for the Atlas Virtual Show 2021.\n </p>\n <p style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; font-size: 16px; line-height: 1.5em; margin-top: 0; text-align: left;\">\n \n Find attached a PDF copy of your registration details.\n </p>\n <p style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; font-size: 16px; line-height: 1.5em; margin-top: 0; text-align: left;\">\n \n Regards,<br>\n Atlas Virtual Show\n </p>\n \n \n </td>\n </tr>\n </table>\n </td>\n </tr>\n \n <tr>\n <td style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative;\">\n <table class=\"footer\" align=\"center\" width=\"570\" cellpadding=\"0\" cellspacing=\"0\" role=\"presentation\" style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; -premailer-cellpadding: 0; -premailer-cellspacing: 0; -premailer-width: 570px; margin: 0 auto; padding: 0; text-align: center; width: 570px;\">\n <tr>\n <td class=\"content-cell\" align=\"center\" style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; max-width: 100vw; padding: 32px;\">\n <p style=\"box-sizing: border-box; font-family: -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Helvetica, Arial, sans-serif, \"Apple Color Emoji\", \"Segoe UI Emoji\", \"Segoe UI Symbol\"; position: relative; line-height: 1.5em; margin-top: 0; color: #b0adc5; font-size: 12px; text-align: center;\">© 2021 Atlas Virtual Show. All rights reserved.</p>\n \n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n </td>\n </tr>\n </table>\n </body>\n </html>';\n \n \n $mail->AltBody = '[Atlas Virtual Show](https://atlasvirtualshow.ca/form2021)\n\n # Dear '. $vendor->form->primaryContact.'Ray Delgado,\n \n Thank you for registering for the Atlas Virtual Show 2021.\n \n Find attached a PDF copy of your registration details.\n \n Regards,\n Atlas Virtual Show\n \n © 2021 Atlas Virtual Show. All rights reserved.';\n\n $mail->send();\n\n unlink($vendor->name.\".pdf\");\n\n\n return redirect()->route('print')\n ->with('success', \"Your registration has been submitted. \n Kindly check your email or click print for your copy.\");\n\n\n} catch (Exception $e) {\n \n return redirect()\n ->back()->withInput()\n ->with('error', \"We are sorry something went wrong. Please check your details and try again.\");\n \n // echo \"Message could not be sent. Mailer Error: {$mail->ErrorInfo}\";\n}\n\n\n // return (new MailMessage)\n // ->subject('Atlas Virtual Show Vendor Registration')\n // ->greeting('Dear '.$this->registrationData['company'].',')\n // ->line('Thank you for registering for the Atlas Virtual Show 2021.')\n // ->line('Find attached a PDF copy of your registration details.')\n // ->attachData($pdf->output(), $this->registrationData['company'].\"-\".$this->registrationData['vendor_code'].\".pdf\")\n // ->cc('[email protected]');\n\n dd(\"Fail!\");\n }"
]
| [
"0.70351183",
"0.6952642",
"0.69025546",
"0.683268",
"0.6752421",
"0.6745612",
"0.65710807",
"0.6567745",
"0.65538454",
"0.6546438",
"0.6459017",
"0.6435979",
"0.6434018",
"0.64330435",
"0.6405731",
"0.64046466",
"0.63306403",
"0.6321046",
"0.63151234",
"0.6287709",
"0.6284075",
"0.6276242",
"0.62061435",
"0.62040764",
"0.6199839",
"0.6188575",
"0.61814433",
"0.6127705",
"0.61261284",
"0.6107651",
"0.61047465",
"0.610176",
"0.60979235",
"0.6080203",
"0.6079323",
"0.6077723",
"0.60775864",
"0.60672265",
"0.6063545",
"0.60544217",
"0.6042964",
"0.6038531",
"0.6024739",
"0.60231245",
"0.60138917",
"0.6011672",
"0.6009208",
"0.59980714",
"0.59970665",
"0.5996341",
"0.5993886",
"0.59926516",
"0.5991466",
"0.5984443",
"0.59822774",
"0.59752285",
"0.59707963",
"0.59675163",
"0.59604186",
"0.595725",
"0.59500766",
"0.59391797",
"0.5927909",
"0.5905438",
"0.58978534",
"0.58720934",
"0.5857074",
"0.5848614",
"0.58480096",
"0.5843606",
"0.584312",
"0.58274907",
"0.5820156",
"0.5815197",
"0.5808083",
"0.5796038",
"0.5793326",
"0.579162",
"0.5785524",
"0.5780096",
"0.5778394",
"0.57782805",
"0.5768281",
"0.575162",
"0.57438886",
"0.5743638",
"0.57349557",
"0.57348377",
"0.5732532",
"0.5731722",
"0.57278365",
"0.5726794",
"0.5721093",
"0.57162017",
"0.5715992",
"0.5706828",
"0.5703396",
"0.5703387",
"0.5694847",
"0.56940246"
]
| 0.5828605 | 71 |
User Entity Repository shortcut | public function baseRepository() {
$userRepository = $this->getDoctrine()
->getManager()
->getRepository('Application\UserBundle\Entity\User');
return $userRepository;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function findOneById( int $int ): UserEntityInterface;",
"public function getUser(): User;",
"public function persist( UserEntityInterface $user ): UserEntityInterface;",
"public function getUser(): UserEntity\n {\n return $this->user;\n }",
"public function getUser() : UserEntity\n\t{\n\t\treturn $this->user;\n\t}",
"function getByUser(User $user);",
"public function getUser(): UserInterface;",
"public function getUser(): UserInterface;",
"function getUser($user, $id) {\n return $user->readByID($id);\n}",
"public function userEntity(): PublicKeyCredentialUserEntity;",
"public function index(): UserEntity\n {\n return \\Auth::user();\n }",
"public function user($user);",
"public function forUser($user);",
"abstract public function user();",
"public function user(){\n\t\treturn $this->belongsto('App\\Entities\\User\\User');\n\t}",
"abstract public function repository();",
"public function getRepository(): EntityRepository;",
"abstract public function fetchUserById($id);",
"abstract protected function getUser();",
"public function createUsersEntity()\n {\n $data = [\n 'namespace' => 'app',\n 'name' => 'users:entity.users.name',\n 'description' => 'users:entity.users.description',\n 'slug' => 'users',\n 'locked' => 1,\n 'create_table' => 0,\n 'table_name' => 'users'\n ];\n $entity = $this->generateEntity($data);\n\n return $entity;\n }",
"public function findByUserName(String $username): User;",
"public function getByName(string $name): User;",
"public function retrieve($id)\n\t{\n\t\treturn new \\Entity\\User;\n\t}",
"public function fetchUserByUserName($username);",
"public function getById(string $id): User;",
"protected function objectUserEnCours(){\n $fbUid = $this->getRequest()->getSession()->get('_fos_facebook_fb_482361481839052_user_id');\n $user = $this->getDoctrine()->getManager()->getRepository('MetinetFacebookBundle:User')->findOneByfbUid($fbUid);\n return $user ;\n }",
"public function getUser($id);",
"public function findUserByUsername($username);",
"public function findUserByUsername($username);",
"public function findUserByUsername($username);",
"public function getAll() {\n\t\t\n\t\t$entities = array();\n\t\t$rows = $this->fetchAll();\n\t\tforeach($rows as $row) {\n\t\t\t$entities[] = new UserEntity($row);\n\t\t}\n\t\treturn $entities;\n\t\t\n\t}",
"public function findUser($userId);",
"abstract protected function getRepository();",
"public function findById($idUser)\n {\n }",
"public function user() {\n if ($this->User === null)\n $this->User = $this->getEntity(\"User\", $this->get(\"user_id\"));\n return $this->User;\n }",
"public function findUsers();",
"public function findUsers();",
"public function getUserById($id): ?UserInterface;",
"function User ( ){\n }",
"public function getById(int $id): User;",
"public function getUser()\n{\nreturn $this->user;\n}",
"public function getUserById($id) {\n\t\t\n\t}",
"public function findEntitiesOwnedByUser($userId);",
"public function getUser(): AccountInterface;",
"public function findForUser($userId);",
"public function findForUser($userId);",
"public function getUser() {}",
"public function view(string $uid): UserEntity\n {\n return $this->userRepository->findByUid($uid);\n }",
"public function getUser();",
"public function getUser();",
"public function getUser();",
"public function getUser();",
"public function getUser();",
"public function getUser();",
"public function getUser();",
"public function getBackendUser() {}",
"abstract public function getRepository();",
"abstract public function getRepository();",
"public abstract function getRepository();",
"public function getUser($userId);",
"public function getUser($userId);",
"public function mapAndPersist( UserInputDto $userDto, UserEntityInterface $user = null ): UserEntityInterface;",
"public function getAllUserById($id);",
"public function getUserEntityClass();",
"public function getUserById(UserInput $userInput) {\n\n }",
"public function viewAction()\n {\n $repo = $this->entityManager\n ->getRepository(Entity\\User::class);\n $id = $this->params()->fromRoute('id');\n $entity = $this->params()->fromRoute('entity', 'user');\n $user = $repo->getUser($id, $entity);\n return ['entity' => $user,'id' => $id ];\n }",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}",
"protected function getBackendUser() {}"
]
| [
"0.7079711",
"0.6846923",
"0.6792116",
"0.6711537",
"0.6658997",
"0.6545386",
"0.65313846",
"0.65313846",
"0.6508526",
"0.6444366",
"0.64231217",
"0.62777394",
"0.6268244",
"0.6250425",
"0.62248015",
"0.6218454",
"0.6202814",
"0.6186564",
"0.6107933",
"0.6087759",
"0.60751647",
"0.60699946",
"0.60526395",
"0.6048273",
"0.6030128",
"0.6020449",
"0.6019627",
"0.6001031",
"0.6001031",
"0.6001031",
"0.59955424",
"0.5993294",
"0.5991329",
"0.5990105",
"0.5989743",
"0.59855646",
"0.59855646",
"0.5983586",
"0.59760857",
"0.5967839",
"0.59659046",
"0.5950449",
"0.5949065",
"0.59344035",
"0.59305614",
"0.59305614",
"0.59185034",
"0.59172755",
"0.5906554",
"0.5906554",
"0.5906554",
"0.5906554",
"0.5906554",
"0.5906554",
"0.5906554",
"0.58968633",
"0.5887316",
"0.5887316",
"0.5885277",
"0.58808327",
"0.58808327",
"0.587704",
"0.58542705",
"0.58534545",
"0.58511317",
"0.58499235",
"0.5849519",
"0.5849519",
"0.5849519",
"0.5849519",
"0.5849519",
"0.5849519",
"0.5849519",
"0.5849519",
"0.5849519",
"0.5849519",
"0.5849519",
"0.5849519",
"0.5849519",
"0.5849519",
"0.5849519",
"0.5849519",
"0.5849519",
"0.5849519",
"0.5849519",
"0.58485186",
"0.58485186",
"0.58485186",
"0.58485186",
"0.58485186",
"0.58485186",
"0.58485186",
"0.58485186",
"0.58485186",
"0.58485186",
"0.58485186",
"0.58485186",
"0.58485186",
"0.58485186",
"0.58485186"
]
| 0.6588933 | 5 |
[__construct constructor de la clase] | public function __construct(){
parent::__construct();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _construct(){ }",
"function __constructor(){}",
"protected abstract function __construct();",
"private final function __construct() {}",
"public function fn_construct_class() {\n\t}",
"public function construct() {\n\n }",
"public function __CONSTRUCT(){\n\t}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"private function __construct(){}",
"public function construct()\n\t\t{\n\t\t}",
"function __construct() ;",
"final private function __construct() {}",
"final private function __construct() {}",
"function __construct() {}",
"function __construct() {}",
"function __construct() {}",
"function __construct() {}",
"function __construct() {}",
"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() {}",
"function _construct() {\n \t\n\t\t\n\t}",
"abstract protected function __construct();",
"abstract function __construct();",
"private function __construct () {}",
"function __construct(){}",
"function __construct(){}",
"function __construct(){}",
"abstract public function __construct();"
]
| [
"0.8275365",
"0.82226",
"0.8136683",
"0.808221",
"0.8043977",
"0.8008408",
"0.80023634",
"0.80017674",
"0.80017674",
"0.80017674",
"0.80017674",
"0.80017674",
"0.80017674",
"0.80017674",
"0.80017674",
"0.80017674",
"0.80017674",
"0.80017674",
"0.80017674",
"0.80017674",
"0.80017674",
"0.80017674",
"0.80017674",
"0.80017674",
"0.79818696",
"0.79689556",
"0.79626095",
"0.79626095",
"0.7927098",
"0.7927098",
"0.7927098",
"0.7927098",
"0.7927098",
"0.7927098",
"0.7918276",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79176587",
"0.79174197",
"0.79174197",
"0.79154533",
"0.7909296",
"0.78880346",
"0.78587055",
"0.78443944",
"0.78443944",
"0.78443944",
"0.7840755"
]
| 0.0 | -1 |
[index Funcion para llenar registros de la vista index] | public function index(){
$conditions = array("conditions"=>"transactions.account_id=accounts.id and transactions.category_id=categories.id");
$columnaSuma = array(
"columna" =>"transactions.amount"
);
$this->set("transactions", $this->transactions->find("transactions, accounts, categories", "all", $conditions));
$this->set("transactionCount", $this->transactions->find("transactions", "count"));
$transactionsSuma = $this->transactions->find("transactions", "suma", $columnaSuma);
$this->set(compact("transactions", "transactionCount", "transactionsSuma"));
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getIndex() ;",
"abstract protected function getIndex();",
"public function getIndex();",
"public function getIndex();",
"public function getIndex();",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"public function getIndex() {}",
"function get_index()\r\n\t{\r\n\r\n\t}",
"function putIndex(){\n\n }",
"function putIndex(){\n\n }",
"public function takeIndex()\n\t\t{\n\t\t\t$this->csv->takeIndexCSV();\n\t\t\t$this->txt->takeIndexTXT();\n\t\t}",
"public function func_refindex() {}",
"public function getIndexStart();",
"abstract function index();",
"abstract function index();",
"abstract function index();",
"public function buildIndex();",
"public function getSearchIndex();",
"public function getIndex()\n {\n // add stuff here\n }",
"public function _INDEX()\n\t{\n\t\t\n\t}",
"public function getStartIndex();",
"public function at($index);",
"public function getModelIndex();",
"final public function index($index)\n {\n return $this->onPrepareReturn(Base\\Arrs::index($index,$this->arr()));\n }",
"abstract public function doIndex($item);",
"public function getIndex() {return $this->index;}",
"public function isIndex();",
"abstract public function getNextIndex();",
"public function restarIndice($index){\n return intval($index)-1;\n }",
"public function getPaymentIndex();",
"public function key(){\n return $this->index;\n }",
"public function hook_before_index(&$result) {\n \n }",
"public function checkForIndex( $index, $table );",
"public function index(){\n return Vista::crear(\"index\");\n }",
"public function getIndexEnd();",
"function indexInfo( $table, $index, $fname = __METHOD__ );",
"function extractByIndex($p_index)\n {\n }",
"public static function _index()\n\t{\n\t\treturn self::$_index;\n\t}",
"public function getIndex() {\n \treturn $this->index;\n }",
"public abstract function get($index);",
"public function sewcute(){\n\t\t$this->company = $this->company->where('brand','like','sewcute')->first();\n\n\t\treturn $this->getIndex('sewcute',5);\n\t}",
"function ST_indexR($ST_h, $ST_v, $ST_w) {\n\t$i = $ST_v[$ST_w];\n\t/* echo(\"<br> ST_indexR: i=$i\"); */\n\tif ($ST_h == 0) $ST_h = new ST_node($i);\n\t/* echo(\"<br> h->index: $ST_h->index, d: $ST_h->d, l: $ST_h->l, m: $ST_h->m, r: $ST_h->r \"); */\n\tif ($i == 0) {\n\t\tif ($ST_h->index == -1) $ST_h->index = $this->ST_N++;\n\t\t$this->ST_val = $ST_h->index;\n\t\treturn $ST_h;\n\t\t}\n\tif ($i < $ST_h->d) $ST_h->l = $this->ST_indexR($ST_h->l, $ST_v, $ST_w);\n\tif ($i == $ST_h->d) $ST_h->m = $this->ST_indexR($ST_h->m, $ST_v, $ST_w+1);\n\tif ($i > $ST_h->d) $ST_h->r = $this->ST_indexR($ST_h->r, $ST_v, $ST_w);\n\treturn $ST_h;\n\t}",
"public function setStartIndex($index);",
"public function index()\n {\n //Não vai existir\n }",
"public function get($index)\n {\n \n }",
"public static function getIndex(): int\n {\n return static::$index;\n }",
"function yy_r127(){\n $this->_retvalue = new Stmt\\Expr('INDEX', $this->yystack[$this->yyidx + -2]->minor, $this->yystack[$this->yyidx + -1]->minor, $this->yystack[$this->yyidx + 0]->minor);\n }",
"public function reindex();",
"function index_all(){\n\t\t$this->_clear_tmp(0);\n\t\t$this->del_results();\n\t\treturn $this->index(0,true);\n\t}",
"function index($page, $nombre_article) {\n $index = (($page - 1) * $nombre_article);\n return $index;\n}",
"private function genSearchIndex()\n\t{\n\t\t/*\n\t\t * The big array we want to fill ;)\n\t\t */\n\t\t$index = array();\n\t\t\n\t\t/*\n\t\t * Buddies Load persons in the index array that connected with the user\n\t\t */\n\t\t\n\t\t$model = loadModel('buddy');\n\t\tif($buddies = $model->listBuddies())\n\t\t{\n\t\t\t$result = array();\n\t\t\tforeach ($buddies as $b)\n\t\t\t{\n\t\t\t\t$img = '/img/avatar-mini.png';\n\t\t\t\t\n\t\t\t\tif(!empty($b['photo']))\n\t\t\t\t{\n\t\t\t\t\t$img = img($b['photo']);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$result[] = array(\n\t\t\t\t\t'name' => $b['name'].' '.$b['nachname'],\n\t\t\t\t\t'teaser' => '',\n\t\t\t\t\t'img' => $img,\n\t\t\t\t\t'click' => 'chat(\\''.$b['id'].'\\');',\n\t\t\t\t\t'id' => $b['id'],\n\t\t\t\t\t'search' => array(\n\t\t\t\t\t\t$b['name'],$b['nachname']\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\t$index[] = array(\n\t\t\t\t'title' => 'Menschen die Du kennst',\n\t\t\t\t'key' => 'buddies',\n\t\t\t\t'result' => $result\n\t\t\t);\n\t\t}\n\t\t\n\t\t/*\n\t\t * Groups load Groups connected to the user in the array\n\t\t*/\n\t\t$model = loadModel('groups');\n\t\tif($groups = $model->listMyGroups())\n\t\t{\n\t\t\t$result = array();\n\t\t\tforeach ($groups as $b)\n\t\t\t{\n\t\t\t\t$img = '/img/groups.png';\n\t\t\t\tif(!empty($b['photo']))\n\t\t\t\t{\n\t\t\t\t\t$img = 'images/' . str_replace('photo/','photo/thumb_',$b['photo']);\n\t\t\t\t}\n\t\t\t\t$result[] = array(\n\t\t\t\t\t\t'name' => $b['name'],\n\t\t\t\t\t\t'teaser' => tt($b['teaser'],65),\n\t\t\t\t\t\t'img' => $img,\n\t\t\t\t\t\t'href' => '/?page=bezirk&bid='.$b['id'].'&sub=forum',\n\t\t\t\t\t\t'search' => array(\n\t\t\t\t\t\t\t$b['name']\n\t\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\t$index[] = array(\n\t\t\t\t\t'title' => 'Deine Gruppen',\n\t\t\t\t\t'result' => $result\n\t\t\t);\n\t\t}\n\t\t\n\t\t/*\n\t\t * Betriebe load food stores connected to the user in the array\n\t\t */\n\t\t$model = loadModel('betrieb');\n\t\tif($betriebe = $model->listMyBetriebe())\n\t\t{\n\t\t\t$result = array();\n\t\t\tforeach ($betriebe as $b)\n\t\t\t{\n\t\t\t\t$result[] = array(\n\t\t\t\t\t\t'name' => $b['name'],\n\t\t\t\t\t\t'teaser' => $b['str'].' '.$b['hsnr'].', '.$b['plz'].' '.$b['stadt'],\n\t\t\t\t\t\t'href' => '/?page=fsbetrieb&id='.$b['id'],\n\t\t\t\t\t\t'search' => array(\n\t\t\t\t\t\t\t$b['name'],$b['str']\n\t\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\t$index[] = array(\n\t\t\t\t\t'title' => 'Deine Betriebe',\n\t\t\t\t\t'result' => $result\n\t\t\t);\n\t\t}\n\t\t\n\t\t/*\n\t\t * Bezirke load Bezirke connected to the user in the array\n\t\t*/\n\t\t$model = loadModel('bezirk');\n\t\tif($bezirke = $model->listMyBezirke())\n\t\t{\n\t\t\t$result = array();\n\t\t\tforeach ($bezirke as $b)\n\t\t\t{\n\t\t\t\t$result[] = array(\n\t\t\t\t\t\t'name' => $b['name'],\n\t\t\t\t\t\t'teaser' => '',\n\t\t\t\t\t\t'img' => false,\n\t\t\t\t\t\t'href' => '/?page=bezirk&bid='.$b['id'].'&sub=forum',\n\t\t\t\t\t\t'search' => array(\n\t\t\t\t\t\t\t\t$b['name']\n\t\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\t$index[] = array(\n\t\t\t\t\t'title' => 'Deine Bezirke',\n\t\t\t\t\t'result' => $result\n\t\t\t);\n\t\t}\n\t\t\n\t\t/*\n\t\t * Get or set an individual token as filename for the public json file\n\t\t*/\n\t\tif($token = S::user('token'))\n\t\t{\n Storage::disk('searchindex')->put($token . '.json', json_encode($index));\n\t\t\treturn $token;\n\t\t}\n\t\t\n\t\t\n\t\treturn false;\n\t}",
"function ST_index($ST_key) {\n\t$this->ST_head = $this->ST_indexR($this->ST_head, $ST_key, 0);\n\treturn $this->ST_val;\n\t}",
"function add_clean_index($table, $index)\n {\n }",
"function getfactoryIndex()\n\t{\n\t\t$vendorQry = db(\"select * from factories where name = '$this->factory' limit 1\");\n\t\t$this->factoryIndex = $vendorQry[\"tableIndex\"];\n\t\treturn $vendorQry[\"tableIndex\"];\n\t}",
"function isIndexed() ;",
"public function index()\n {\n $this->vista->index();\n }",
"function key()\n\t{\n\t\treturn $this->index;\n\t}",
"abstract public function index();",
"abstract public function index();",
"abstract public function index();",
"abstract public function index($item);",
"public abstract function index();",
"public abstract function index();",
"public abstract function index();",
"function index() {\n \n }",
"public function get(int $index);",
"public function get(int $index);",
"function _get_index($index, &$index_usage) {\n if ($index != -1)\n return $index;\n $index = 1;\n while (isset($index_usage[$index]) && $index_usage[$index] > 0)\n $index++;\n $this->_inc($index_usage, $index);\n return $index;\n }",
"public function getIndex() {\r\n\t\treturn $this->_index;\r\n\t}",
"public function index(): int\n {\n return $this->index;\n }",
"public function index() {\n if ($this->_m_index !== null)\n return $this->_m_index;\n $this->_m_index = ($this->isIndexSeparate() ? $this->indexSeparate() : $this->indexInTag());\n return $this->_m_index;\n }",
"abstract public function wipeIndex();",
"private function viewIndex()\n {\n if (count($camposDefinidos = array_map('trim', explode(';', $this->camposForm))) > 0) {\n $campoFiltro = File::get(base_path($this->templates['campos_filtro']));\n $index = File::get(base_path($this->templates['index']));\n $stringCampos = \"\";\n foreach ($camposDefinidos as $c) {\n if (count($c_ = array_map('trim', explode(':', $c))) == 2) {\n $stringCampos .= $campoFiltro;\n $stringCampos = str_replace('[{campo}]', $c_[0], $stringCampos);\n $stringCampos = str_replace('[{label}]', $c_[1], $stringCampos);\n } else {\n echo \"#FILTRO# Campo {$c} ignorado, por nao estar descrito corretamente... forma correta -> campo:label\\n\";\n }\n }\n\n $index = str_replace('[{campos_formulario_filtro}]', $stringCampos, $index);\n $index = str_replace('[{route_as}]', $this->routeAs, $index);\n $index = str_replace('[{tabela}]', $this->tabela, $index);\n $index = str_replace('[{titulo}]', $this->titulo, $index);\n File::put(base_path('resources/views/' . $this->tabela . \"/index.blade.php\"), $index);\n }\n }",
"function ign_udef_index(&$name, $index, $default = \"\")\r\n{\r\n if (isset($name[$index]))\r\n {\r\n return $name[$index];\r\n }\r\n else\r\n {\r\n return $default;\r\n }\r\n}",
"private function rebuildIndex()\n {\n foreach ($this->rows as $id => $row) {\n $label = $row->getColumn('label');\n if ($label !== false) {\n $this->rowsIndexByLabel[$label] = $id;\n }\n }\n $this->indexNotUpToDate = false;\n }",
"function laTaille($valeur){\r\n $i=0;\r\n while(isset($valeur[$i])){\r\n $i++;\r\n }\r\n return $i;\r\n }",
"public function createIndex(): void;",
"function getGroupIndex() {\n return $this->group_index;\n }",
"public function index()\r\n {\r\n \treturn $this->class->index(1);\r\n }",
"public function getPO1IndexOf($index){\n\n\t\tif (gettype ($index)!=\"integer\"||$index>15) {\n\t\t\tthrow new Exception(\"PO1IndexOf wrong index; index: \".$index);\n\t\t}\n\t\treturn $this->getValueOfIndex($index);\n\t\t\n\t}",
"private function map_index() {\n\t\t// self::getRoute('Amarr','Jita');\n\t\tif (!isset($_GET['reg'])) {\n\t\t\t$jumps = db::query(\"SELECT DISTINCT `rfrom`.`name` as `fromName`, `rto`.`name` as `toName`\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM `gates` as `g`\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN `systems` as `from` ON (`g`.`from` = `from`.`id`)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN `systems` as `to` ON (`g`.`to` = `to`.`id`)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN `regions` as `rfrom` ON (`rfrom`.`id` = `from`.`regionID`)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tJOIN `regions` as `rto` ON (`rto`.`id` = `to`.`regionID`)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE `rfrom`.`name` != `rto`.`name`\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND `rfrom`.`id` NOT IN (10000004, 10000017, 10000019)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND `rto`.`id` NOT IN (10000004, 10000017, 10000019);\");\n\t\t\t$dots = db::query(\"SELECT `id`, `name`, `pos_x`, `pos_y`, `pos_z` FROM `regions` WHERE `id` < 11000000 AND `id` NOT IN (10000004, 10000017, 10000019);\");\n\t\t\tforeach ($jumps as $jump) {\n\t\t\t\t$routeDots[ $jump['fromName'] ][ $jump['toName'] ] = 1;\n\t\t\t}\n\t\t\t$map = array('dots' => $dots, 'jumps' => $jumps, 'routeDots' => $routeDots);\n\t\t} else {\n\t\t\t$map = universe::getRegionMap($_GET['reg']);\n\t\t}\n\t\t\n\t\t$regionList = db::query(\"SELECT `id`, `name` FROM `regions` WHERE `id` < 11000000 ORDER BY `name`;\");\n\t\t$regstr = '<select name=\"region\" id=\"mapRegion\"><option value=\"0\">———Выберите регион———</option>';\n\t\tforeach ($regionList as $region) {\n\t\t\tif ($region['name'] == @$_GET['reg']) $sel = 'selected';\n\t\t\t\telse $sel = '';\n\t\t\t$regstr .= '<option ' . $sel . ' value=\"' . $region['id'] . '\">' . $region['name'] . '</option>';\n\t\t}\n\t\t$regstr .= '</select>';\n\t\t$mainsupport = '\n\t\t\t<div id=\"control\">\n\t\t\t\t<div class=\"startx\"></div>\n\t\t\t\t<div class=\"x\"></div>\n\t\t\t\t<div class=\"starty\"></div>\n\t\t\t\t<div class=\"y\"></div>\n\t\t\t\t' . $regstr . '\n\t\t\t\t<input type=\"button\" value=\"Отрисовать\" id=\"drawMap\">\n\t\t\t\t<input type=\"button\" value=\"К карте вселенной\" id=\"resetMap\">\n\t\t\t</div>\n\t\t\t<input type=\"text\" class=\"systemSearch\" data-searchmod=\"info\" id=\"systemInfo\" placeholder=\"Информация о системе\" size=\"25\">\n\t\t\t<div id=\"strForMap\">' . json_encode($map) . '</div>\n\t\t\t';\n\t\t$maincontent = '\n\t\t\t<form id=\"pathfinder\" method=\"GET\">\n\t\t\t\t<input type=\"text\" class=\"systemSearch\" data-searchmod=\"path\" id=\"fromSystem\" name=\"from\" placeholder=\"Отправная точка\" autocomplete=\"off\">\n\t\t\t\t<input type=\"text\" class=\"systemSearch\" data-searchmod=\"path\" id=\"toSystem\" name=\"to\" placeholder=\"Пункт назначения\" autocomplete=\"off\">\n\t\t\t\t' . (isset($_GET['reg']) ? '<input type=\"hidden\" name=\"reg\" value=\"' . $_GET['reg'] . '\">' : '') . '\n\t\t\t\t<input type=\"submit\" id=\"submitPath\" disabled value=\"Проложить путь\">\n\t\t\t\t<div id=\"systemSearchVariants\" class=\"mapSSV\">ololo</div>\n\t\t\t</form>';\n\t\t\n\t\troot::$_ALL['maincaption'] = 'EVE Universe Map';\n\t\troot::$_ALL['mainsupport'] = $mainsupport;\n\t\troot::$_ALL['maincontent'] = $maincontent;\n\t\troot::$_ALL['backtrace'][] = 'initialized map/index';\n\t}",
"function admin_index()\n\t{\n\t \n\t}",
"function deleteByIndex($p_index)\n {\n }",
"abstract public function actionIndex();",
"protected function buildCommandsIndex() {}",
"public function incrementIndex()\n {\n $index = 0;\n $last = self::where('procreator_id', $this->procreator_id)->orderBy('index', true)->first();\n if ($last) {\n $index = $last->index;\n }\n $this->index = $index + 1;\n return $this;\n }",
"function getMiiInfoIndex($index){\n return $this->miiInfo[$index];\n }",
"protected function randomIndex() {\n return mt_rand(1, 10);\n }",
"public function index() {\r\n\t\tif ($parent = $this->getParent()) {\r\n\t\t\treturn array_search($this, $parent->children);\r\n\t\t}\r\n\t\treturn -1;\r\n\t}",
"public function getIndexToLocFormat() {}",
"function index() {\n global $autorias;\n global $autores;\n global $livros;\n $autorias = buscarRegistros('tab_autorias');\n $autores = buscarRegistros('tab_autor');\n $livros = buscarRegistros('tab_livro');\n }",
"public function key()\n\t{\n\t\treturn $this->index;\n\t}",
"public function key()\n\t{\n\t\treturn $this->index;\n\t}",
"function elementfinder($list1, $element){ \n $comparator=0; //container for the element at a particular index to be compared with the element to be found to be found\n $locator=0; \n $indexes=\"occuring at index(ices): \"; // gives the container for the number of timed the element was located\n $listlength=count($list1)-1; //efffective largest index of the given list\n \n for($i=0; $i<=$listlength;$i++){ //step through the list\n$comparator=$list1[$i]; //get the element at the current index\n/**if this element equals the element to be found, then upgrade the number of times the element has been found(that is the locator variable)and add the index it was found to the index variable */\nif($element==$comparator){\n $locator=$locator+1;\n $indexes=$indexes.$i. \" \";\n}\n }\n /** print out result and the given list operated upon */\n echo \"given the list: \"; print_r($list1); echo \"<br>\";\n echo $locator.\" matches found \";\n echo $indexes;\n return $locator;\n}"
]
| [
"0.7669765",
"0.7183977",
"0.6987751",
"0.6987751",
"0.6987751",
"0.6768456",
"0.6768456",
"0.6768456",
"0.6767715",
"0.6767684",
"0.6767684",
"0.6767684",
"0.67669857",
"0.67669857",
"0.672895",
"0.64378643",
"0.64378643",
"0.62356544",
"0.6142296",
"0.6107027",
"0.60517645",
"0.60517645",
"0.60517645",
"0.6044112",
"0.6016103",
"0.5997318",
"0.59384775",
"0.59255713",
"0.59137577",
"0.59131813",
"0.5909693",
"0.58465934",
"0.5840878",
"0.5822203",
"0.5811541",
"0.5777029",
"0.57646716",
"0.5762676",
"0.5741509",
"0.57165974",
"0.5702637",
"0.5695795",
"0.5674195",
"0.5622817",
"0.5616665",
"0.55909693",
"0.55617017",
"0.556133",
"0.55177635",
"0.5516435",
"0.55146813",
"0.5507611",
"0.550145",
"0.55013055",
"0.5500339",
"0.54708976",
"0.54690963",
"0.5461547",
"0.5455307",
"0.5448523",
"0.54450583",
"0.5413565",
"0.5410498",
"0.5374922",
"0.53672826",
"0.53672826",
"0.53672826",
"0.5353975",
"0.533568",
"0.533568",
"0.533568",
"0.5330622",
"0.53235185",
"0.53235185",
"0.5301272",
"0.52951676",
"0.528757",
"0.5280037",
"0.52718824",
"0.52591276",
"0.5246553",
"0.5232495",
"0.52318716",
"0.52197987",
"0.5217708",
"0.5214743",
"0.52141476",
"0.5212991",
"0.52027994",
"0.5202732",
"0.51994574",
"0.51980686",
"0.5196967",
"0.5195421",
"0.5194511",
"0.5184899",
"0.517852",
"0.5177931",
"0.51755846",
"0.51755846",
"0.5175288"
]
| 0.0 | -1 |
[add Funcion para agregar registros a la tabla] | public function add(){
if ($_POST) {
if ($_POST["operation"] == 'egreso'){
$_POST["amount"] = $_POST["amount"]*(-1);
}
if ($this->transactions->save("transactions", $_POST)) {
$this->redirect(array("controller"=>"transactions"));
}else{
$this->redirect(array("controller"=>"transactions", "method"=>"add"));
}
}
$this->set("accounts", $this->transactions->find("accounts"));
$this->set("categories", $this->transactions->find("categories"));
$this->_view->setView("add");
/* }else{
$this->redirect(array("controller"=>"transactions"));
}*/
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function _agregarComponenteTabuladores() {\n $componente_carga = new Acciones_ComponenteAltaInsercion();\n\n $this->_id_componente = $componente_carga->crearComponente($_POST['id_tb_rel'], 'PaginaTabuladores', '');\n\n // crear componente y obtener id de insercion\n $componente_carga->consultaParametro($this->_id_componente, 'id_tabla', $_GET['id_tabla']);\n $componente_carga->consultaParametro($this->_id_componente, 'intermedia_tb_id', $_GET['intermedia_tb_id']);\n $componente_carga->consultaParametro($this->_id_componente, 'id_tabla_trd', $_GET['id_tabla_trd']);\n if (isset($_POST['id_cp_rel']) && ($_POST['id_cp_rel'] != '')) {\n $componente_carga->consultaParametro($this->_id_componente, 'id_cp_rel', $_POST['id_cp_rel']);\n }\n $componente_carga->consultaParametro($this->_id_componente, 'tabla_relacionada', $_POST['id_tb_rel']);\n }",
"function evt__Agregar()\n\t{\n\t\t$this->tabla()->resetear();\n\t\t$this->set_pantalla('pant_edicion');\n\t}",
"private function tbl_guiones_registro() {\r\n\t\t\t$this->guiones_registro = $this->esquema->createTable('GUIONES_REGISTRO');\r\n\t\t\t$this->guiones_registro->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del registro del guion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('FECHA', 'datetime', array(\r\n\t\t\t\t'notnull' => false,\r\n\t\t\t\t'comment' => 'Fecha de ingreso del registro'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('USUARIO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del usuario del registro [ID de la tabla USUARIOS]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('TIPO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del tipo de registro [ID de la tabla GUIONES_REGISTRO_TIPO]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('AFECTACION', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID de la afectacion del registro [ID de la tabla GUIONES_REGISTRO_AFECTACION]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('AVISO', 'bigint', array(\r\n\t\t\t\t'notnull' => false,\r\n\t\t\t\t'default' => 0,\r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'Numero del aviso del registro'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->addColumn('UBICACION', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID de la UBICACION del registro [ID de la tabla GUIONES_REGISTRO_UBICACION]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro->setPrimaryKey(array('ID'));\r\n\t\t\t$this->guiones_registro->addForeignKeyConstraint($this->usuarios, array('USUARIO'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->guiones_registro->addForeignKeyConstraint($this->guiones_registro_tipo, array('TIPO'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->guiones_registro->addForeignKeyConstraint($this->guiones_registro_afectacion, array('AFECTACION'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->guiones_registro->addForeignKeyConstraint($this->guiones_registro_ubicacion, array('UBICACION'), array('ID'), $this->opcForeign);\r\n\t\t}",
"function _reglas()\n\t{\n\t\t$reglas[] = array('field' => 'titulo', 'label' => 'lang:field_titulo', 'rules' => 'trim|required|max_length[100]');\n\t\t\n\t\t\t$reglas[] = array('field' => 'has_category', 'label' => 'lang:field_has_category', 'rules' => 'callback_has_categorys');\n\t\t\n\t\t\n\t\treturn $reglas;\n\t}",
"function generar()\r\n\t{\r\n\t\tforeach($this->columnas as $ef) {\r\n\t\t \t$this->datos->tabla('columnas')->nueva_fila($ef->get_datos());\r\n\t\t}\r\n\t\tparent::generar();\r\n\t}",
"function tabledata_Fiche($table, $serveur, $field, $key , $idLigne, $modeFiche =\"voir\")\r\n{\r\n\r\n $nombre_Enregistrements = 0;\r\n\r\n // $mode : possible ajout, modif, voir , effacer\r\n switch ($modeFiche)\r\n {\r\n case \"ajout\" :\r\n $boolSQL = false;\r\n $txtReadonly = \"\";\r\n $nombre_Enregistrements = 1; // pour forcer passage car pas de requete\r\n break;\r\n case \"effacer\" :\r\n $boolSQL = true;\r\n $txtReadonly = \" READONLY \";\r\n break;\r\n case \"modif\" :\r\n $boolSQL = true;\r\n $txtReadonly = \"\";\r\n break;\r\n case \"voir\" :\r\n $boolSQL = true;\r\n $txtReadonly = \" READONLY \";\r\n break;\r\n default :\r\n $boolSQL = false;\r\n $txtReadonly = \" READONLY \";\r\n }\r\n\r\n if ($boolSQL)\r\n {\r\n $sqlResult = tabledata_Cde_select($table , $field,\"\",\"\", $key, $idLigne);\r\n $nombre_Enregistrements = sql_count($sqlResult); //2.0\r\n }\r\n\r\n if ($nombre_Enregistrements>0)\r\n {\r\n $total = '';\r\n $hiddens = '';\r\n\r\n if ($boolSQL)\r\n {\r\n $tabUnEnregistrement = sql_fetch($sqlResult);\r\n }\r\n else\r\n {\r\n foreach ($field as $k => $v)\r\n {\r\n $tabUnEnregistrement[$k] = \"\";\r\n }\r\n }\r\n\r\n foreach ($field as $k => $v)\r\n {\r\n if (array_search($k, $key) == \"PRIMARY KEY\")\r\n {\r\n if ($boolSQL)\r\n {\r\n $strDebut = \"Enregistrement ayant comme clé primaire :<br/><i><b>\"\r\n .$k.\"='\".$tabUnEnregistrement[$k].\"'</b></i><br/>\";\r\n }\r\n }\r\n else\r\n {\r\n preg_match(\"/^ *([A-Za-z]+) *(\\(([^)]+)\\))?(.*DEFAULT *'(.*)')?/\", $v, $m);\r\n $type = $m[1];\r\n $s = ($m[5] ? \" value='$m[5]' \" : '');\r\n $t = $m[3];\r\n if ($m[2])\r\n {\r\n if (is_numeric($t))\r\n {\r\n if ($t <= 32)\r\n {\r\n $s .= \" sizemax='$t' size='\" . ($t * 2) . \"'\";\r\n }\r\n else\r\n {\r\n $type = 'BLOB';\r\n }\r\n }\r\n else\r\n {\r\n preg_match(\"/^ *'?(.*[^'])'? *$/\", $t, $m2); $t = $m2[1];\r\n }\r\n }\r\n\r\n switch (strtoupper($type))\r\n {\r\n case TINYINT:\r\n if ($t==1)\r\n {\r\n $checked = \"\";\r\n if ($tabUnEnregistrement[$k] == 1)\r\n {\r\n $checked = \" checked\";\r\n }\r\n $s = \"<td>\"\r\n .\"<input type='checkbox' name='\".$k.\"'\"\r\n .\" value='1'\".$checked.$txtReadonly.\"/>\"\r\n .\"</td>\\n\";\r\n break;\r\n }\r\n case INT:\r\n case INTEGER:\r\n case BIGINT:\r\n case TINYINT:\r\n case CHAR:\r\n case VARCHAR:\r\n case TEXT:\r\n case TINYTEXT:\r\n case TINYBLOB:\r\n case YEAR:\r\n case DATETIME:\r\n case DATE:\r\n case TIME:\r\n $s = \"<td>\"\r\n .\"<input type='text'\".$s.\" name='\".$k.\"'\"\r\n .\" value='\".htmlentities(utf8_decode($tabUnEnregistrement[$k]), ENT_QUOTES)\r\n .\"'\".$txtReadonly.\"/>\"\r\n .\"</td>\\n\";\r\n break;\r\n case ENUM:\r\n case SET: //ajout JFM\r\n $s = \"<td><select name='\".$k.\"'\".$txtReadonly.\">\\n\";\r\n foreach (preg_split(\"/'? *, *'?/\",$t) as $v)\r\n {\r\n if ($tabUnEnregistrement[$k]==$v)\r\n {\r\n $s .= \"<option selected>\".$v.\"</option>\\n\";\r\n }\r\n else\r\n {\r\n $s .= \"<option>\".$v.\"</option>\\n\";\r\n }\r\n } //foreach (preg_split(\"/'? *, *'?/\",$t) as $v)\r\n $s .= \"</select></td>\\n\";\r\n break;\r\n case TIMESTAMP:\r\n $s = '';\r\n if ($mode==\"ajout\")\r\n {\r\n $hiddens .= \"<input type='hidden' name='\".$k.\"' value='NOW()'/>\\n\";\r\n }\r\n else\r\n {\r\n $hiddens .= \"<input type='hidden' name='\".$k.\"' value='\".$v.\"'/>\\n\";\r\n }\r\n break;\r\n case LONGBLOB:\r\n $s = \"<td><textarea name='$k' cols='45' rows='20'\".$txtReadonly.\">\".htmlentities(utf8_decode($tabUnEnregistrement[$k]), ENT_QUOTES ).\"</textarea></td>\\n\"; //modif. JFM\r\n break;\r\n default:\r\n $t = floor($t / 45)+1;\r\n $s = \"<td><textarea name='$k' cols='45' rows='$t'\".$txtReadonly.\">\".htmlentities(utf8_decode($tabUnEnregistrement[$k]), ENT_QUOTES ).\"</textarea></td>\\n\";\r\n break;\r\n } //switch (strtoupper($type))\r\n if ($s)\r\n $total .= \"<tr><td>$k</td>\\n$s</tr>\\n\";\r\n }\r\n }\r\n $hiddens .= \"<input type='hidden' name='serveur' value='\".$serveur.\"'/>\\n\";\r\n $hiddens .= \"<input type='hidden' name='table' value='\".$table.\"'/>\\n\";\r\n $hiddens .= \"<input type='hidden' name='mode' value='\".$mode.\"'/>\\n\";\r\n\r\n\r\n // $idLigne = htmlentities(stripcslashes($idLigne), ENT_QUOTES );\r\n $idLigne = htmlentities($idLigne, ENT_QUOTES );\r\n\r\n switch ($modeFiche)\r\n {\r\n case \"ajout\" :\r\n $txtbouton =\"Ajouter\";\r\n break;\r\n case \"effacer\" :\r\n $hiddens .= \"<input type='hidden' name='id_ligne' value='\".$idLigne.\"'/>\\n\";\r\n $hiddens .= \"<input type='hidden' name='tdaction' value='ordresuplig'/>\\n\";\r\n $txtbouton =\"Effacer définitivement\";\r\n break;\r\n case \"modif\" :\r\n $hiddens .= \"<input type='hidden' name='id_ligne' value='\".$idLigne.\"'/>\\n\";\r\n $hiddens .= \"<input type='hidden' name='tdaction' value='maj'/>\\n\";\r\n $txtbouton =\"Modifier\";\r\n break;\r\n case \"voir\" :\r\n $hiddens .= \"<input type='hidden' name='id_ligne' value='\".$idLigne.\"'/>\\n\";\r\n $hiddens .= \"<input type='hidden' name='tdaction' value='AUCUN'/>\\n\";\r\n $txtbouton =\"--\";\r\n break;\r\n default:\r\n $hiddens .= \"<input type='hidden' name='tdaction' value='AUCUN'/>\\n\";\r\n $txtbouton =\"AUCUN\";\r\n }\r\n\r\n return \"\\n\\n\\n\".tabledata_url_generer_post_ecrire(\r\n 'tabledata'\r\n , \"<table>\\n\".$strDebut.$total\r\n .\"</table>\".$hiddens,$txtbouton);\r\n } // if ($nombre_Enregistrements>0)\r\n\r\n}",
"public function addRows()\n {\n }",
"private function tbl_guiones_registro_tipo_formulario() {\r\n\t\t\t$this->guiones_registro_tipo = $this->esquema->createTable('GUIONES_REGISTRO_TIPO');\r\n\t\t\t$this->guiones_registro_tipo->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del tipo de guion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_tipo->addColumn('NOMBRE', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Nombre del tipo de guion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_tipo->addColumn('ESTADO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Estado del tipo de Guion [ID de la tabla ESTADOS]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_tipo->setPrimaryKey(array('ID'));\r\n\t\t\t$this->guiones_registro_tipo->addForeignKeyConstraint($this->estados, array('ESTADO'), array('ID'), $this->opcForeign);\r\n\t\t}",
"function tabledata_Cadre_voirlestables ($serveur,$boolSPIP=false)\r\n{\r\n global $connect_statut, $spip_lang, $connect_id_auteur;\r\n\r\n $tables_extra = array();\r\n $tables_spip = array();\r\n $intNbExtra = 0 ;\r\n\r\n $sqlResultTables = sql_showbase('%');\r\n while ($tabNomTable = sql_fetch($sqlResultTables))\r\n {\r\n foreach ($tabNomTable as $key => $val)\r\n {\r\n if (preg_match('#^'.tabledata_table_prefix().'_#', $val))\r\n {\r\n $tables_spip[] = $val;\r\n }\r\n else\r\n {\r\n $tables_extra[] = $val;\r\n ++$intNbExtra ;\r\n }\r\n }\r\n }\r\n\r\n // affichage\r\n echo \"Choisir une table Extra parmis celle ci-dessous:\\n\";\r\n if ($intNbExtra<1)\r\n {\r\n echo \"Aucune table extra ne semble disponible.\";\r\n }\r\n else\r\n {\r\n echo tabledata_table_HTML ($tables_extra);\r\n }\r\n if ($boolSPIP)\r\n {\r\n echo \"<hr/>\";\r\n echo \"Les tables de SPIP :\\n\";\r\n echo tabledata_table_HTML ($tables_spip);\r\n }\r\n return;\r\n}",
"function insertarTabla(){\n\t\t$this->procedimiento='wf.ft_tabla_ime';\n\t\t$this->transaccion='WF_tabla_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_tipo_proceso','id_tipo_proceso','int4');\n\t\t$this->setParametro('vista_id_tabla_maestro','vista_id_tabla_maestro','int4');\n\t\t$this->setParametro('bd_scripts_extras','bd_scripts_extras','text');\n\t\t$this->setParametro('vista_campo_maestro','vista_campo_maestro','varchar');\n\t\t$this->setParametro('vista_scripts_extras','vista_scripts_extras','text');\n\t\t$this->setParametro('bd_descripcion','bd_descripcion','text');\n\t\t$this->setParametro('vista_tipo','vista_tipo','varchar');\n\t\t$this->setParametro('menu_icono','menu_icono','varchar');\n\t\t$this->setParametro('menu_nombre','menu_nombre','varchar');\n\t\t$this->setParametro('vista_campo_ordenacion','vista_campo_ordenacion','varchar');\n\t\t$this->setParametro('vista_posicion','vista_posicion','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('menu_codigo','menu_codigo','varchar');\n\t\t$this->setParametro('bd_nombre_tabla','bd_nombre_tabla','varchar');\n\t\t$this->setParametro('bd_codigo_tabla','bd_codigo_tabla','varchar');\n\t\t$this->setParametro('vista_dir_ordenacion','vista_dir_ordenacion','varchar');\n\t\t$this->setParametro('vista_estados_new','vista_estados_new','varchar');\n\t\t$this->setParametro('vista_estados_delete','vista_estados_delete','varchar');\t\t\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"function listaRuta()\r\n\t{\t\r\n\t\t$query = \"SELECT * FROM \" . self::TABLA . \";\";\r\n\t\treturn parent::listaRegistros( $query );\r\n\t}",
"function add($table_name, $data_array)\n\t{\n\n\t}",
"function modificarTabla(){\n\t\t$this->procedimiento='wf.ft_tabla_ime';\n\t\t$this->transaccion='WF_tabla_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t//Define los parametros para la funcion\n\t\t$this->setParametro('id_tabla','id_tabla','int4');\n\t\t$this->setParametro('id_tipo_proceso','id_tipo_proceso','int4');\n\t\t$this->setParametro('vista_id_tabla_maestro','vista_id_tabla_maestro','int4');\n\t\t$this->setParametro('bd_scripts_extras','bd_scripts_extras','text');\n\t\t$this->setParametro('vista_campo_maestro','vista_campo_maestro','varchar');\n\t\t$this->setParametro('vista_scripts_extras','vista_scripts_extras','text');\n\t\t$this->setParametro('bd_descripcion','bd_descripcion','text');\n\t\t$this->setParametro('vista_tipo','vista_tipo','varchar');\n\t\t$this->setParametro('menu_icono','menu_icono','varchar');\n\t\t$this->setParametro('menu_nombre','menu_nombre','varchar');\n\t\t$this->setParametro('vista_campo_ordenacion','vista_campo_ordenacion','varchar');\n\t\t$this->setParametro('vista_posicion','vista_posicion','varchar');\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\n\t\t$this->setParametro('menu_codigo','menu_codigo','varchar');\n\t\t$this->setParametro('bd_nombre_tabla','bd_nombre_tabla','varchar');\n\t\t$this->setParametro('bd_codigo_tabla','bd_codigo_tabla','varchar');\n\t\t$this->setParametro('vista_dir_ordenacion','vista_dir_ordenacion','varchar');\n\t\t$this->setParametro('vista_estados_new','vista_estados_new','varchar');\n\t\t$this->setParametro('vista_estados_delete','vista_estados_delete','varchar');\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"public function listRegisterCols(){\n\t\t$this->registerCol('name_hld', self::COL_ANCHO_DETALLE);\n\t}",
"private function tbl_guiones_registro_hfc() {\r\n\t\t\t$this->guiones_registro_hfc = $this->esquema->createTable('GUIONES_REGISTRO_HFC');\r\n\t\t\t$this->guiones_registro_hfc->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del registro del guion HFC'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_hfc->addColumn('REGISTRO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del registro [ID de la tabla GUIONES_REGISTRO]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_hfc->addColumn('INTERMITENCIA', 'boolean', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'default ' => '0', \r\n\t\t\t\t'comment' => 'Determina la intermitencia del servicio, 0 => NO, 1 => SI'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_hfc->addColumn('GUION', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Guion [ID de la tabla GUIONES]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_hfc->addColumn('PRIORIDAD', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID de la prioridad del Guion [ID de la tabla GUIONES_REGISTRO_NODOS]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_hfc->setPrimaryKey(array('ID'));\r\n\t\t\t$this->guiones_registro_hfc->addForeignKeyConstraint($this->guiones_registro, array('REGISTRO'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->guiones_registro_hfc->addForeignKeyConstraint($this->guiones, array('GUION'), array('ID'), $this->opcForeign);\r\n\t\t\t$this->guiones_registro_hfc->addForeignKeyConstraint($this->guiones_prioridades, array('PRIORIDAD'), array('ID'), $this->opcForeign);\r\n\t\t}",
"function insertTableInsumosVendidos($headers,$matrizDatos) {\n //verificar tabla a insertar (posteriormente puede ser una funcion):\n\n\n\n\n echo '<div class=\"card-body\">\n <div class=\"table-responsive\" >\n <table class=\"table table-bordered dataTableClase\" width=\"100%\" cellspacing=\"0\">'; //apertura de etiquetas\n //rellenar head:\n echo '<thead><tr>';\n foreach ($headers as $hd) {\n echo \"<th>\".$hd.\"</th>\";\n }\n echo'</tr></thead>';\n //rellenar el footer:\n echo '<tfoot><tr>';\n foreach ($headers as $hd) {\n echo \"<th>\".$hd.\"</th>\";\n }\n echo'</tr></tfoot>';\n echo '<tbody>';\n foreach ($matrizDatos as $reg) {\n echo \"<tr>\";\n foreach ($reg as $cell) {\n echo \"<td>\".$cap = ucfirst(mb_strtolower($cell)).\"</td>\"; // Capitalize\n }\n echo \"</tr>\";\n }\n echo '</tbody></table></div></div>'; //cierre etiquetas tabla\n}",
"function tablaUsuarios($consulta) {\n\tglobal $Buscador;\n\techo \"<tr class='tr-th'><td>Id</td><td>Tipo</td><td>Nombre</td><td>Email</td><td align='right'>\".$Buscador.\"</td></tr>\";\n\twhile($reg=mysql_fetch_array($consulta))\n\t{ \n\t\tif($reg['tipoUsuario']==\"Administrador\")\n\t\t\t$classTipoUser=\"flaticon-important\";\n\t\telse \n\t\t\t$classTipoUser=\"flaticon-user91\";\n\t\techo \"<tr class='tr'><td align='center'>\".$reg['IdUsuario'].\"</td><td width='100'><span class='\".$classTipoUser.\"'></span> \".$reg['tipoUsuario'].\"</td><td>\".$reg['Nombres'].\" \".$reg['Apellidos'].\"</td><td>\".$reg['Email'].\"</td><td align='right'><span class='flaticon-expand span-btn-admin' title='Detalles' onclick='expandDetails(this,\\\"Usuarios\\\",\".$reg['IdUsuario'].\")'></span><span class='flaticon-black322 span-btn-admin' title='Editar' onclick='editRows(this,\\\"Usuarios\\\",\".$reg['IdUsuario'].\")'></span><span class='flaticon-delete81 span-btn-admin' title='Borrar' onclick='deleteUser(this,\\\"Usuarios\\\",\".$reg['IdUsuario'].\")'></span></td></tr>\";\n\t}\n}",
"public function crearTablas(){\r\n\t\t\t$this->crearTablaUsuario();\r\n\t\t\t$this->crearTablaDeporte();\r\n\t\t\t$this->crearTablaUsuarioDeporte();\r\n\t\t\t$this->crearTablaPassw();\r\n\t\t}",
"function add_table_function($label, $closure) {\n\t\t$key = 'table-function-'.md5($label);\n\t\t$this->tb_functions[$key] = ['label' => $label, 'key' => $key];\n\t\t\n\t\tif(isset($_GET[$key])) {\n\t\t\t$closure($this, $this->get_full_resultset());\n\t\t}\n\t}",
"public function listRegisterFields(){\n\t\t$this->registerFieldString('name_hld', 'Tipo');\n\t}",
"function insertarTablaInstancia(){\n\t\t$this->procedimiento='wf.ft_tabla_instancia_ime';\n\t\t$this->transaccion='WF_TABLAINS_INS';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\n\t\t$this->setParametro('id_tabla','id_tabla','integer');\n\t\t$this->setParametro('tipo_estado','tipo_estado','varchar');\n\t\t$this->setParametro('tipo_proceso','tipo_proceso','varchar');\n\t\t//si es detalle se añade un parametro para el id del maestro\n\t\tif ($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['vista_tipo'] != 'maestro') {\n\t\t\t\n\t\t\t$this->setParametro($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['vista_campo_maestro'],\n\t\t\t\t\t\t\t\t$_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['vista_campo_maestro'],'integer');\n\t\t}\n\t\t//Define los parametros para la funcion\t\t\n\t\tforeach ($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['columnas'] as $value) {\n\t\t\t$this->setParametro($value['bd_nombre_columna'],$value['bd_nombre_columna'],$value['bd_tipo_columna']);\t\t\t\n\t\t}\t\t\t\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"function tablaDatos(){\n\n $editar = $this->Imagenes($this->PrimaryKey,0);\n $eliminar = $this->Imagenes($this->PrimaryKey,1);\n $sql = 'SELECT\n C.id_componentes,\n P.descripcion planta,\n S.descripcion secciones,\n E.descripcion Equipo,\n C.`descripcion` Componente\n ,'.$editar.','.$eliminar.' \nFROM\n `componentes` C\nINNER JOIN\n equipos E ON E.id_equipos = C.`id_equipos`\nINNER JOIN\n secciones S ON S.id_secciones = E.id_secciones\nINNER JOIN\n plantas P ON P.id_planta = S.id_planta\nWHERE\n \n C.`activo` = 1';\n \n $datos = $this->Consulta($sql,1); \n if(count($datos)){\n $_array_formu = array();\n $_array_formu = $this->generateHead($datos);\n $this->CamposHead = ( isset($_array_formu[0]) && is_array($_array_formu[0]) )? $_array_formu[0]: array();\n \n $tablaHtml = '<div class=\"row\">\n <div class=\"col-md-12\">\n <div class=\"panel panel-default\">\n <div class=\"panel-body recargaDatos\" style=\"page-break-after: always;\">\n <div class=\"table-responsive\">';\n $tablaHtml .='';\n \t\t$tablaHtml .= $this->print_table($_array_formu, 7, true, 'table table-striped table-bordered',\"id='tablaDatos'\");\n \t\t$tablaHtml .=' </div>\n </div>\n </div>\n </div>\n </div>\n ';\n }else{\n $tablaHtml = '<div class=\"col-md-8\">\n <div class=\"alert alert-info alert-dismissable\">\n <button class=\"close\" aria-hidden=\"true\" data-dismiss=\"alert\" type=\"button\">×</button>\n <strong>Atención</strong>\n No se encontraron registros.\n </div>\n </div>';\n }\n \n if($this->_datos=='r') echo $tablaHtml;\n else return $tablaHtml;\n \n }",
"private function tbl_guiones_registro_afectacion() {\r\n\t\t\t$this->guiones_registro_afectacion = $this->esquema->createTable('GUIONES_REGISTRO_AFECTACION');\r\n\t\t\t$this->guiones_registro_afectacion->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID de la afectacion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_afectacion->addColumn('NOMBRE', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Nombre de la afectacion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_afectacion->addColumn('ESTADO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Estado de la afectacion [ID de la tabla ESTADOS]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_afectacion->setPrimaryKey(array('ID'));\r\n\t\t\t$this->guiones_registro_afectacion->addForeignKeyConstraint($this->estados, array('ESTADO'), array('ID'), $this->opcForeign);\r\n\t\t}",
"function ADD() {\n // si el atributo clave de la entidad no esta vacio\n\t\tif ( ( $this->login <> '' && $this->IdTrabajo <> '' ) ) {\n \n\t\t\t// construimos el sql para buscar esa clave en la tabla\n\t\t\t$sql = \"SELECT * FROM ENTREGA WHERE ( login = '$this->login' && IdTrabajo = '$this->IdTrabajo')\";\n // si da error la ejecución de la query\n\t\t\tif ( !$result = $this->mysqli->query( $sql ) ) { \n\t\t\t\treturn 'No se ha podido conectar con la base de datos'; // error en la consulta (no se ha podido conectar con la bd). Devolvemos un mensaje que el controlador manejara\n // si la ejecución de la query no da error\n\t\t\t} else { \n if ($result->num_rows == 0){ // miramos si el resultado de la consulta es vacio\n //Variable que almacena la sentencia sql\n\t\t\t\t\t$sql = \"INSERT INTO ENTREGA (\n\t\t\t\t\t\t\t login,\n IdTrabajo,\n Alias,\n Horas,\n Ruta) \n\t\t\t\t\t\t\t\tVALUES(\n\t\t\t\t\t\t\t\t'$this->login',\n\t\t\t\t\t\t\t\t'$this->IdTrabajo',\n\t\t\t\t\t\t\t\t'$this->Alias',\n '$this->Horas',\n '$this->Ruta'\n\t\t\t\t\t\t\t\t)\";//se contruye la sentencia sql para insertar la entrega\n \n \n \n }\n //si el número de tuplas no es 0\n else{\n return 'Ya existe la entrega introducida en la base de datos'; // ya existe\n }\n }\n // si da error en la ejecución del insert devolvemos mensaje\n\t\t\t\t\tif ( !$this->mysqli->query( $sql )) { \n\t\t\t\t\t\treturn \"Error en la inserción\";\n\t\t\t\t\t}\n \n //si no da error en la insercion devolvemos mensaje de exito\n else { \n\t\t\t\t\t\treturn 'Inserción realizada con éxito'; //operacion de insertado correcta\n\t\t\t\t\t}\n // si ya existe ese valor de clave en la tabla devolvemos el mensaje correspondiente\n\t\t\t\t} else \n\t\t\t\t\treturn 'Inserta un valor'; // ya existe\n \n\t}",
"public function AgregarResgistroTabla($campos)\r\n {\r\n\t\r\n\t\r\n\t$sql=\"INSERT INTO `servitorno_inv`.`equiposoficina` (`idEquiposOficina`, `Referencia`, `Equipo`, `Existencias`, `ValorEstimado`, `Marca`, `Serial`, `Bodega`) \r\n\t\t\tVALUES ('3', 'REF3', 'PC MESA', '3', '400000', 'HP', '3232123', 'buga');\";\r\n\t\r\n\t$sql=\"INSERT INTO `$this->database`.`$this->tabla` ( \";\r\n\t$fin=$this->NumCols-1;\r\n\tfor($i=1;$i<$this->NumCols;$i++){\r\n\t\t$col=$this->NombreCol[$i];\r\n\t\tif($fin<>$i)\r\n\t\t\t$sql=$sql.\"`$col`,\";\r\n\t\telse\t\r\n\t\t\t$sql=$sql.\"`$col`\";\r\n\t}\r\n\t$sql=$sql.\" ) VALUES ( \";\r\n\t\r\n\tfor($i=1;$i<$this->NumCols;$i++){\r\n\t\t$col=$campos[$i];\r\n\t\tif($fin<>$i)\r\n\t\t\t$sql=$sql.\"'$col',\";\r\n\t\telse\t\r\n\t\t\t$sql=$sql.\"'$col'\";\r\n\t}\r\n\t\r\n\t$sql=$sql.\");\";\r\n\t//print_r($sql);\r\n\tmysql_query($sql, $this->con) or die('no se pudo registrar el movimiento: ' . mysql_error());\t\r\n\treturn(1);\r\n\t\r\n\t}",
"public function initTable(){\n\t\t\t\n\t\t}",
"private function setupBusRegTable()\n {\n if ($this->licenceType === RefData::LICENCE_CATEGORY_GOODS_VEHICLE) {\n $this->counts['busRegistrations'] = 0;\n return;\n }\n $this->index(\n OpenBusReg::class,\n new GenericList([\n 'id' => 'licence',\n ], 'licId'),\n 'busRegistrations',\n 'licence-surrender-busreg',\n $this->tableViewTemplate\n );\n }",
"public function add() \n { // metodo add, complementar\n $str = \"insert into \".self::$tablename.\"(nitHotel, idCiudad, nomHotel, dirHotel, telHotel1, telHotel2, correoHotel, tipoHotel, Administrador, idRedes, aforo, tipoHabitaciones, status)\";\n $str.= \" values ('$this->nitHotel', $this->idCiudad, '$this->nomHotel', '$this->dirHotel', '$this->telHotel1', '$this->telHotel2', '$this->correoHotel', $this->tipoHotel, '$this->Administrador', $this->idRedes, $this->aforo, $this->tipoHabitaciones, $this->status);\";\n }",
"function insertTable2($headers,$matrizDatos,$nomTabla) {\n //verificar tabla a insertar (posteriormente puede ser una funcion):\n $cell_link=setNombreClase($nomTabla);//asigna un valor de nombre de clase segun la tabla a mostrar\n\n\n\n echo '<div class=\"card-body\">\n <div class=\"table-responsive\" >\n <table class=\"table table-bordered dataTableClase\" width=\"100%\" cellspacing=\"0\">'; //apertura de etiquetas\n //rellenar head:\n echo '<thead><tr>';\n foreach ($headers as $hd) {\n echo \"<th>\".$hd.\"</th>\";\n }\n echo'</tr></thead>';\n //rellenar el footer:\n echo '<tfoot><tr>';\n foreach ($headers as $hd) {\n echo \"<th>\".$hd.\"</th>\";\n }\n echo'</tr></tfoot>';\n echo '<tbody>';\n foreach ($matrizDatos as $reg) {\n echo \"<tr>\";\n foreach ($reg as $cell) {\n\n echo \"<td>\".$cap = ucfirst(mb_strtolower($cell)).\"</td>\"; // Capitalize\n }\n //el nombre de la clase para las celdas de la ultima columna de la tabla dependen de la tabla a mostrar\n echo\"<td class=\".$cell_link.\">\";\n echo \"<a class='\".$reg[0].\" graficos' data-toggle='modal' href= '#graficosCorrsModal' title='Ver Gráficos'><i class='fa fa-fw fa-line-chart'></i></a>\"; //el data-target debe variar segun la tabla\n echo \"</td></tr>\";\n }\n echo '</tbody></table></div></div>'; //cierre etiquetas tabla\n}",
"public function register() {\n //\n $this->registeCRUD();\n }",
"public function tableWizard() {}",
"function addC(){\n \t$re = new DbManager();\n \t$result = $re -> addColumn();\n \tif ($result == true){\n \t\techo 'colone bien ajouter ';\n \t}\n }",
"function cresponsable_add() {\n\t\tglobal $conn;\n\n\t\t// Initialize table object\n\t\t$GLOBALS[\"responsable\"] = new cresponsable();\n\n\t\t// Initialize other table object\n\t\t$GLOBALS['usuario'] = new cusuario();\n\n\t\t// Intialize page id (for backward compatibility)\n\t\tif (!defined(\"EW_PAGE_ID\"))\n\t\t\tdefine(\"EW_PAGE_ID\", 'add', TRUE);\n\n\t\t// Initialize table name (for backward compatibility)\n\t\tif (!defined(\"EW_TABLE_NAME\"))\n\t\t\tdefine(\"EW_TABLE_NAME\", 'responsable', TRUE);\n\n\t\t// Open connection to the database\n\t\t$conn = ew_Connect();\n\t}",
"function tablaRuta($Nombre){\r\n\t\t$query = \"SELECT * FROM \" . self::TABLA . \";\";\r\n\t\treturn parent::tablaRegistro($Nombre, $query);\r\n\t\r\n }",
"static public function ctrAgregarTabla($datos){\n\n\t\t\n\t\techo '<table class=\"table table-bordered\">\n <tbody>\n <tr>\n <th style=\"width: 10px;\">#</th>\n <th style=\"width: 10px;\">Cantidad</th>\n <th style=\"width: 400px;\">Articulo</th>\n <th style=\"width: 70px;\">Precio</th>\n <th style=\"width: 70px;\">Total</th>\n <th style=\"width: 10px;\">Opciones</th> \n </tr>';\n\t\t\n\t\t\techo \"<tr>\n\t\t\t\t\t\n\t\t\t\t\t<td>1.</td>\n\t\t\t\t\t<td><span class='badge bg-red'>\".$datos['cantidadProducto'].\"</span></td>\n\t\t\t\t\t<td>\".$datos['productoNombre'].\"</td>\n\t\t\t\t\t<td style='text-align: right;'>$ \".$datos['precioVenta'].\".-</td>\n\t\t\t\t\t<td style='text-align: right;'>$ \".$datos['cantidadProducto']*$datos['precioVenta'].\".-</td>\n\t\t\t\t\t<td><button class='btn btn-link btn-xs' data-toggle='modal' data-target='#myModalEliminarItemVenta'><span class='glyphicon glyphicon-trash'></span></button></td>\n\t\t\t\t\t\n\t\t\t\t </tr>\";\n\t\t\t\t\n\t\techo '</tbody></table>';\n\t\t\t\t\n\t\t\n\t}",
"private function tbl_guiones_registro_nodos() {\r\n\t\t\t$this->guiones_registro_nodos = $this->esquema->createTable('GUIONES_REGISTRO_NODOS');\r\n\t\t\t$this->guiones_registro_nodos->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Nodo en el registro'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_nodos->addColumn('REGISTRO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del registro [ID de la tabla GUIONES_REGISTRO]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_nodos->addColumn('CANTIDAD', 'integer', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'default' => '0',\r\n\t\t\t\t'length' => 10,\r\n\t\t\t\t'comment' => 'Cantidad de Nodos ingresados'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_nodos->setPrimaryKey(array('ID'));\r\n\t\t\t$this->guiones_registro_nodos->addForeignKeyConstraint($this->guiones_registro, array('REGISTRO'), array('ID'), $this->opcForeign);\r\n\t\t}",
"function insertTable($headers,$matrizDatos,$nomTabla) {\n //verificar tabla a insertar (posteriormente puede ser una funcion):\n $cell_link=setNombreClase($nomTabla);//asigna un valor de nombre de clase segun la tabla a mostrar\n\n\n\n echo '<div class=\"card-body\">\n <div class=\"table-responsive\" >\n <table class=\"table table-bordered dataTableClase\" id=\"dataTable\" width=\"100%\" cellspacing=\"0\">'; //apertura de etiquetas\n //rellenar head:\n echo '<thead><tr>';\n foreach ($headers as $hd) {\n echo \"<th>\".$hd.\"</th>\";\n }\n echo'</tr></thead>';\n //rellenar el footer:\n echo '<tfoot><tr>';\n foreach ($headers as $hd) {\n echo \"<th>\".$hd.\"</th>\";\n }\n echo'</tr></tfoot>';\n echo '<tbody>';\n foreach ($matrizDatos as $reg) {\n echo \"<tr>\";\n foreach ($reg as $cell) {\n\n echo \"<td>\".$cap = ucfirst(mb_strtolower($cell)).\"</td>\"; // Capitalize\n }\n //el nombre de la clase para las celdas de la ultima columna de la tabla dependen de la tabla a mostrar\n echo\"<td class=\".$cell_link.\">\";\n echo \"<a class='\".$reg[0].\" detalles' data-toggle='modal' href= '#detallesModal' title='Ver detalles'><i class='fa fa-fw fa-eye'></i></a>\"; //el data-target debe variar segun la tabla\n echo \"<a class='\".$reg[0].\" editar' data-toggle='modal' href='#editarModal' title='Actualizar'><i class='fa fa-fw fa-edit'></i></a>\";\n echo \"<a class='\".$reg[0].\" eliminar' data-toggle='modal' href='#eliminarModal' title='Eliminar'><i class='fa fa-fw fa-trash'></i></a>\";\n echo \"</td></tr>\"; //\".$reg[0].\"\n }\n echo '</tbody></table></div></div>'; //cierre etiquetas tabla\n}",
"function insertTableInsumos($headers,$matrizDatos,$nomTabla) {\n //verificar tabla a insertar (posteriormente puede ser una funcion):\n $cell_link=setNombreClase($nomTabla);\n\n echo '<div class=\"card-body\">\n <div class=\"table-responsive\" >\n <table class=\"table table-bordered dataTableClase\" width=\"100%\" cellspacing=\"0\">'; //apertura de etiquetas\n //rellenar head:\n echo '<thead><tr>';\n foreach ($headers as $hd) {\n echo \"<th>\".$hd.\"</th>\";\n }\n echo'</tr></thead>';\n //rellenar el footer:\n echo '<tfoot><tr>';\n foreach ($headers as $hd) {\n echo \"<th>\".$hd.\"</th>\";\n }\n echo'</tr></tfoot>';\n echo '<tbody>';\n foreach ($matrizDatos as $reg) {\n echo \"<tr>\";\n foreach ($reg as $cell) {\n echo \"<td>\".$cap = ucfirst(mb_strtolower($cell)).\"</td>\"; // Capitalize\n }\n //el nombre de la clase para las celdas de la ultima columna de la tabla dependen de la tabla a mostrar\n echo\"<td class=\".$cell_link.\">\";\n echo \"<b><a class='\".$reg[0].\" t-vendidos' data-toggle='modal' href= '#trasladoInsumosVendModal' title='Trasladar a vendidos'>V</a></b>\"; //el data-target debe variar segun la tabla\n echo \"<b><a class='\".$reg[0].\" t-consignacion' data-toggle='modal' href='#trasladoInsumosConsModal' title='Trasladar a consignación'>C</a></b>\";\n echo \"</td></tr>\"; //\".$reg[0].\"\n }\n echo '</tbody></table></div></div>'; //cierre etiquetas tabla\n}",
"function LUPE_criar_tabela_tab($prefixo, $rs, $vetCampo, $vetHidTab, $exc_tabela = '', $exc_campo = '') {\r\n\r\n echo \"<table id='tab{$prefixo}_Tabela' width='100%' border='1' cellspacing='0' cellpadding='0' vspace='0' hspace='0' class='Generica'>\\n\";\r\n echo \"<tr class='Generica'>\\n\";\r\n\r\n if (Ativo()) {\r\n echo \"<td class='Acao' width='1%' nowrap>\";\r\n echo '<a href=\"\" onclick=\"return tab'.$prefixo.'_Incluir();\" class=\"Titulo\"><img src=\"imagens/Incluir.gif\" border=\"0\" alt=\"Incluir\"></a>';\r\n echo \"</td>\\n\";\r\n }\r\n\r\n ForEach($vetCampo as $Campo => $Valor ) {\r\n echo \"<td class='Titulo'><b>\\n\";\r\n echo $Valor['nome'];\r\n echo \"</b></td>\\n\";\r\n }\r\n\r\n echo \"</tr>\\n\";\r\n\r\n if (mssql_num_rows($rs) != 0) {\r\n for ($i = 0; $i < mssql_num_rows($rs); $i++) {\r\n $row = mssql_fetch_array($rs);\r\n\r\n echo \"<tr id='tab{$prefixo}_linha{$i}' align=left>\\n\";\r\n\r\n if (Ativo()) {\r\n echo \"<td class='Acao' nowrap>\";\r\n\r\n echo '<a class=\"Registro\" href=\"\" onclick=\"return tab'.$prefixo.'_Alterar('.$i.');\"><img src=\"imagens/Alterar.gif\" border=\"0\" alt=\"Alterar\"></a>';\r\n\r\n echo ' ';\r\n\r\n echo '<a class=\"Registro\" href=\"\" onclick=\"return tab'.$prefixo.'_Excluir('.$i.');\"><img src=\"imagens/Excluir.gif\" border=\"0\" alt=\"Excluir\"></a>';\r\n\r\n if ($exc_campo == '' || $exc_tabela == '') {\r\n $exclui = 'N';\r\n } else {\r\n $sql = \"select $exc_campo from $exc_tabela where $exc_campo = \".$row[$exc_campo];\r\n if (mssql_num_rows(execsql($sql)) == 0)\r\n $exclui = 'N';\r\n else\r\n $exclui = 'E';\r\n }\r\n\r\n echo \"<input id='{$prefixo}_excluir$i' type='hidden' name='{$prefixo}_excluir[]' value='$exclui'>\\n\";\r\n\r\n ForEach($vetHidTab as $Valor)\r\n \t echo \"<input id='{$prefixo}_$Valor$i' type='hidden' name='{$prefixo}_{$Valor}[]' value='\".$row[$Valor].\"'>\\n\";\r\n\r\n echo \"</td>\\n\";\r\n }\r\n\r\n ForEach($vetCampo as $Campo => $Valor ) {\r\n echo \"<td id='{$prefixo}_cel_{$Campo}_{$i}' class='Registro'>\\n\";\r\n\r\n switch ($Valor['tipo']) {\r\n \tcase 'descDominio':\r\n if ($Valor['vetDominio'][$row[$Campo]] == '')\r\n echo $row[$Campo];\r\n else\r\n echo $Valor['vetDominio'][$row[$Campo]];\r\n \t\tbreak;\r\n\r\n default:\r\n echo $row[$Campo];\r\n \t\tbreak;\r\n }\r\n\r\n echo \"</td>\\n\";\r\n }\r\n\r\n echo\"</tr>\\n\";\r\n }\r\n }\r\n\r\n echo \"</table>\\n\";\r\n echo \"<script type='text/javascript'>\r\n tab{$prefixo}_TotLin = \".mssql_num_rows($rs).\";\r\n tab{$prefixo}_AtuLin = -1;\r\n </script>\";\r\n\r\n return 0;\r\n}",
"function add($param) {\n extract($param);\n // nunca suponga el orden de las columnas: INSERT INTO tabla VALUES (v1, v2,v3, ...); tómese el trabajo de indicar los nombres de columnas\n // los nombres de los elementos del array asociativo corresponden a los atributos name de las columnas del jqGrid\n $sql = \"INSERT INTO usuario(id_usuario, direccion, telefonos, correos, contrasena, rol )\n VALUES ('$id_usuario', '$direccion','$telefonos', '$correos', '$contrasena','operario' );\n INSERT INTO operario(fk_usuario,nombres, apellidos) \n VALUES ('$id_usuario','$nombres', '$apellidos');\";\n $conexion->getPDO()->exec($sql);\n echo $conexion->getEstado();\n }",
"public function InsertarRegistro($tabla,$NumRegistros,$Columnas,$Valores)\r\n {\r\n \r\n \r\n\t//$sql=\"INSERT INTO `$this->database`.`$tabla` ( `Fecha`, `Movimiento`, `Detalle`, `idDocumento`, `Cantidad`, `ValorUnitario` , `ValorTotal`, `$idProductoTabla`)\r\n\t//VALUES ( '$fecha','$Movimiento','$Detalle','$idDocumento','$Cantidad','$ValorUnitario','$ValorTotal','$idProducto')\";\r\n\t\r\n\t\r\n\t$sql=\"INSERT INTO `$this->database`.`$tabla` (\";\r\n\t$fin=$NumRegistros-1;\r\n\tfor($i=0;$i<$NumRegistros;$i++){\r\n\t\t$col=$Columnas[$i];\r\n\t\t$reg=$Valores[$i];\r\n\t\tif($fin<>$i)\r\n\t\t\t$sql=$sql.\"`$col`,\";\r\n\t\telse\t\r\n\t\t\t$sql=$sql.\"`$col`)\";\r\n\t}\r\n\t$sql=$sql.\"VALUES (\";\r\n\t\r\n\tfor($i=0;$i<$NumRegistros;$i++){\r\n\t\t\r\n\t\t$reg=$Valores[$i];\r\n\t\tif($fin<>$i)\r\n\t\t\t$sql=$sql.\"'$reg',\";\r\n\t\telse\t\r\n\t\t\t$sql=$sql.\"'$reg')\";\r\n\t}\r\n\t\r\n\t//print_r($sql);\r\n\tmysql_query($sql, $this->con) or die(\"no se pudo ingresar el registro en la tabla $tabla: \" . mysql_error());\t\r\n\t//return(1);\r\n\t\r\n}",
"public function buscarFuncionarioPorCampo($campo, $filtro){\n \n $query = \"SELECT Usuario.*, Funcionario.* FROM Usuario JOIN Funcionario \n ON Usuario.idUsuario = Funcionario.idUsuario\"; //criação da query base\n\n if(isset($campo) && isset($filtro)){ //verifica se os filtros foram especificados\n if(strcmp($campo, nome) || strcmp($campo, sobrenome) || strcmp($campo, email)){ //verifica se o campo corresponde a nome, sobrenome ou email\n $query .= \" WHERE Usuario.nome LIKE '%'.'.$campo.'.'%'\"; //adicionar filtro de nome, sobrenome ou email à query\n }else if(strcmp($campo, matricula)){ //verifica se o campo corresponde a matricula\n $query .= \" WHERE Funcionario.matricula = $campo\"; //adiciona filtro de matricula à query\n }else{\n return array(); //retorna um array vazio caso o campo não seja encontrado\n }\n }\n\n /*Caso não seja especificados filtros retorna todos os funcionarios*/\n\n $result = $this->PDO->query($query); //executa a query\n\n $funcionarios = array(); //cria array para armazenar os resultados da consulta\n\n if(!empty($result) && $result->rowCount() > 0){ //verifica se existem resultados para consulta\n foreach($result->fetchAll() as $item){ //percorre as tuplas retornadas pela consulta\n $funcionarios[] = new funcionario( //cria um novo funcionario e add uma array, apartir dos dados obtidos\n isset($item['idUsuario'])?utf8_encode($item['idUsuario']):null,\n isset($item['email'])?utf8_encode($item['email']):null,\n isset($item['nome'])?utf8_encode($item['nome']):null,\n isset($item['sobrenome'])?utf8_encode($item['sobrenome']):null,\n isset($item['senha'])?utf8_encode($item['senha']):null,\n isset($item['cadastroConfirmado'])?utf8_encode($item['cadastroConfirmado']):null,\n isset($item['tipoUsuario'])?utf8_encode($item['tipoUsuario']):null,\n isset($item['matricula'])?utf8_encode($item['matricula']):null,\n isset($item['funcao'])?utf8_encode($item['funcao']):null,\n isset($item['cadastroObra'])?utf8_encode($item['cadastroObra']):null,\n isset($item['gerenciaObra'])?utf8_encode($item['gerenciaObra']):null,\n isset($item['remocaoObra'])?utf8_encode($item['remocaoObra']):null,\n isset($item['cadastroNoticia'])?utf8_encode($item['cadastroNoticia']):null, \n isset($item['gerenciaNoticia'])?utf8_encode($item['gerenciaNoticia']):null,\n isset($item['remocaoNoticia'])?utf8_encode($item['remocaoNoticia']):null,\n isset($item['backup'])?utf8_encode($item['backup']):null\n );\n }\n }\n\n return $funcionarios; //retorna os resultados\n }",
"public function addRow($tabela, $name, $type, $pkey, $notnull, $ai, $keys, $size, $default, $index, $unique);",
"function CreateTableReg(){\r\n\t\t$qry = \"Create Table $this->tablename1 (\".\r\n\t\t\t\t\"id INTEGER AUTO_INCREMENT NOT NULL,\".\r\n\t\t\t\t\"UFname CHAR(255) NOT NULL,\".\r\n\t\t\t\t\"ULname CHAR(255) NOT NULL,\".\r\n\t\t\t\t\"UPswd CHAR(255) NOT NULL,\".\r\n\t\t\t\t\"Uemail CHAR(255) NOT NULL,\".\r\n\t\t\t\t\"Uphone CHAR(15) DEFAULT 'N/A',\".\r\n\t\t\t\t\"Uadmin CHAR(1) DEFAULT 0,\".\r\n\t\t\t\t\"UuserName CHAR(255) NOT NULL,\".\r\n\t\t\t\t\"Upic CHAR(255) ,\".\r\n\t\t\t\t\"PRIMARY KEY(id, UuserName)\".\r\n\t\t\t\t\");\";\r\n\t\t\t\t\r\n\t\tif(!mysql_query($qry, $this->connection)){\r\n\t\t\t$this->HandleDBError(\"Error creating the table \\nquery was\\n $qry\");\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"public function imprimirTabla()\r\n {\r\n try\r\n {\r\n $consulta = \"SELECT * FROM xxnombretabla\";//el nombre de la tabla\r\n $objeto = $this->PDO->prepare($consulata);\r\n $objeto->execute();\r\n $tabla = $objeto->fetchAll(PDO::FETCH_OBJ);\r\n\r\n foreach ($tabla as $fila )\r\n {\r\n $xxnombreclase = new xxnombreclase();//se instancia la clase que se esta haciendo\r\n $xxnombreclase->__SET('xid:clase', $fila->xxcampoTabla);//se llama el campo de la tabla que corresponda con el atributo de la clase\r\n $xxnombreclase->__SET('xatributo:clase',$fila->xxcampoTabla);//se repite segun los campos que hayan en la tabla\r\n\r\n $result[] = $xxnombreclase;//se mete en el arreglo result[] la varible con la clase\r\n }\r\n\r\n } catch (Exception $e) {\r\n die($e->getMessage());\r\n }\r\n\r\n return $result;//se devuelve el arreglo result\r\n }",
"public function gerenciar(){\n\t\t\n\t\tset_tema('footerinc', load_js(array('data-table', 'table')), FALSE);\n\t\tset_tema('titulo', 'Registros de comentários');\n\t\tset_tema('conteudo', load_modulo('Comentarios', 'gerenciar'));\n\t\tload_template();\n\t}",
"public function inserir()\n {\n }",
"function agregar($nombre, $ApellidoPaterno, $ApellidoMaterno, $idDepartamento, $idPuesto, $idTurno, $idNivelEstudios, $profesion, $sueldoMensual, $contrato, $fechaAlta, $fechaBaja, $idStatusEmpleado, $idPerfil, $correoElectronico, $contrasena, $telCelular, $telCasa, $rfc, $imss, $idCivil, $tipoSangre, $pesionAlimen, $nombreEmergencia, $telEmergencia, $calleNumero, $colonia, $delegacionMunicipio, $estado, $codigoPostal, $pais)\n {\n\n \t$insertDomicilio= array(\n \t\"calleNumero\" \t\t => $calleNumero,\n \t\"colonia\" => $colonia,\n \t\"delegacionMunicipio\" => $delegacionMunicipio,\n \t\"estado\" => $estado,\n \t\"codigoPostal\" => $codigoPostal,\n \t\"pais\"\t => $pais\n\n\n \t\t);\n\n \t//recibe el id de lo que se inserto en la tabla domicilio mediante el domiciliomodelo\n $idDomicilios = $this->domiciliomodelo->agregarDomicilio($insertDomicilio);\n\n\n $insert = array(\n \"nombre\" => $nombre, \n \"ApellidoPaterno\" => $ApellidoPaterno, \n \"ApellidoMaterno\" => $ApellidoMaterno, \n \"idDepartamento\" => $idDepartamento, \n \"idPuesto\" \t\t => $idPuesto, \n \"idTurno\"\t\t => $idTurno, \n \"idNivelEstudios\" => $idNivelEstudios, \n \"profesion\" => $profesion, \n \"sueldoMensual\" => $sueldoMensual, \n \"contrato\" => $contrato, \n \"fechaAlta\" => $fechaAlta, \n \"fechaBaja\" => $fechaBaja, \n \"idStatusEmpleado\" => $idStatusEmpleado, \n \"idPerfil\" => $idPerfil, \n \"correoElectronico\" => $correoElectronico, \n \"contrasena\" => $contrasena, \n \"idDomicilios\" => $idDomicilios, \n \"telCelular\" => $telCelular,\n \"telCasa\" => $telCasa,\n \"rfc\" => $rfc,\n \"imss\" => $imss,\n \"idCivil\" => $idCivil,\n \"tipoSangre\" => $tipoSangre,\n \"pesionAlimen\" => $pesionAlimen,\n \"nombreEmergencia\" => $nombreEmergencia,\n \"telEmergencia\" => $telEmergencia\n\n\n );\n\n\t\t\n\n\n\n \t$this->db->insert('empleados', $insert);\n \treturn $this->db->trans_status();\n\n \n }",
"function create_form_table($args) {\n\t\t$table_name = $args[\"singular_code_name\"];\n\t\t$result = $GLOBALS['db']->query(\"DROP TABLE \".$table_name);\n\t\t$result = $GLOBALS['db']->query(\"CREATE TABLE IF NOT EXISTS \".$table_name.\" (id INT(6) UNSIGNED AUTO_INCREMENT PRIMARY KEY)\");\n\n\t\t$items = $args[\"items\"];\n\n\t\tforeach($items as $item) {\n\t\t\tif($item[\"type\"] == 'input') {\n\t\t\t\tswitch($item[\"var_type\"][0]) {\n\t\t\t\t\tcase 'varchar':\n\t\t\t\t\tcase 'text':\n\t\t\t\t\tcase 'string':\n\n\t\t\t\t\t\t$result = $GLOBALS['db']->query(\"ALTER TABLE \".$table_name.\" ADD \".$item[\"singular_code_name\"].\" VARCHAR(\".$item[\"var_type\"][1].\") NOT NULL\");\n\n\t\t\t\t\tbreak;\n\n\t\t\t\t\tdefault:\n\n\t\t\t\t\t\t$result = $GLOBALS['db']->query(\"ALTER TABLE \".$table_name.\" ADD \".$item[\"singular_code_name\"].\" \".$item[\"var_type\"][0].\"(\".$item[\"var_type\"][1].\") NOT NULL\");\n\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$result = $GLOBALS['db']->query(\"ALTER TABLE \".$table_name.\" ADD reg_date TIMESTAMP\");\n\t}",
"function recuperarDatos(){\r\n\t\t\t\t$this->objFunc=$this->create('MODEmpresa');\r\n\t\t\t\t$objetoFuncion = $this->create('MODEmpresa');\r\n\t\t\t\t$this->res=$this->objFunc->insertarEmpresa($this->objParam);\t//esta bien\t\t\t\r\n\t\t\t\t$this->res->imprimirRespuesta($this->res->generarJson());\r\n\t\t}",
"function listarTabla(){\n\t\t$this->procedimiento='wf.ft_tabla_sel';\n\t\t$this->transaccion='WF_tabla_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_tabla','int4');\n\t\t$this->captura('id_tipo_proceso','int4');\n\t\t$this->captura('vista_id_tabla_maestro','int4');\n\t\t$this->captura('bd_scripts_extras','text');\n\t\t$this->captura('vista_campo_maestro','varchar');\n\t\t$this->captura('vista_scripts_extras','text');\n\t\t$this->captura('bd_descripcion','text');\n\t\t$this->captura('vista_tipo','varchar');\n\t\t$this->captura('menu_icono','varchar');\n\t\t$this->captura('menu_nombre','varchar');\n\t\t$this->captura('vista_campo_ordenacion','varchar');\n\t\t$this->captura('vista_posicion','varchar');\n\t\t$this->captura('estado_reg','varchar');\n\t\t$this->captura('menu_codigo','varchar');\n\t\t$this->captura('bd_nombre_tabla','varchar');\n\t\t$this->captura('bd_codigo_tabla','varchar');\n\t\t$this->captura('vista_dir_ordenacion','varchar');\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t$this->captura('nombre_tabla_maestro','varchar');\n\t\t$this->captura('vista_estados_new','text');\n\t\t$this->captura('vista_estados_delete','text');\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"static public function mdlIngresarFfiscales($tabla, $datos){\n\n\t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla(\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\toperador\n , pcontacto\n , area\n , cargo\n , mail\n , telofi\n , ext\n , telextra\n , uuid\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, pcontacto2\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, area2\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, cargo2\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, mail2\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, telofi2\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, ext2\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, telextra2\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, perfil\n\n )\n VALUES (\n :operador\n , :pcontacto\n , :area\n , :cargo\n , :mail\n , :telofi\n , :ext\n , :telextra\n , :uuid\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, :pcontacto2\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, :area2\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, :cargo2\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, :mail2\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, :telofi2\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, :ext2\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, :telextra2\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t, :perfil\n\n\n )\"\n );\n\n\t\t$stmt->bindParam(\":uuid\", $datos[\"uuid\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":operador\", $datos[\"operador\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":pcontacto\", $datos[\"pcontacto\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":area\", $datos[\"area\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":cargo\", $datos[\"cargo\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":mail\", $datos[\"mail\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":telofi\", $datos[\"mail\"], PDO::PARAM_STR);\n $stmt->bindParam(\":ext\", $datos[\"ext\"], PDO::PARAM_STR);\n $stmt->bindParam(\":telextra\", $datos[\"telextra\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":pcontacto2\", $datos[\"pcontacto2\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":area2\", $datos[\"area2\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":cargo2\", $datos[\"cargo2\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":mail2\", $datos[\"mail2\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":telofi2\", $datos[\"telofi2\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":ext2\", $datos[\"ext2\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":telextra2\", $datos[\"telextra2\"], PDO::PARAM_STR);\n\t\t$stmt->bindParam(\":perfil\", $datos[\"perfil\"], PDO::PARAM_STR);\n\n\n\n\n\t\tif($stmt->execute()){\n\n\t\t\treturn \"La información se ha guardado exitosamente\";\n\n\t\t}else{\n\n\t\t\t$arr = $stmt ->errorInfo();\n\t\t\t$arr[3]=\"ERROR\";\n\t\t\treturn $arr[2];\n\n\t\t}\n\n\t\t$stmt->close();\n\n\t\t$stmt = null;\n\n\t}",
"function desplegarTabla($query,$anchtable=array(),$iconos=array(),$coLoTabla=\"table-primary\"){\n\n\tglobal $oBD;\n\n\t$registros = $oBD->consulta($query);\n\n\t$columnas = mysqli_num_fields($registros);\n\techo '<table class= \"table table-hover'.$coLoTabla.'\">';\n\t// creacion de la cabecera\n\techo '<tr class=\"table-dark\">';// hace el renglon\n\n\t// if (count($anchtable)){\n\t// \tforeach ($anchtable as $anch) {\n\t// \t\techo \"<td style=width:$anch.'%';></td>\";\n\t// \t\techo $anch;\n\t// \t}\n\t// }\n$k = 0;\n// si el count de iconos existe entonces me mandaron iconos \n\tif (count($iconos)){\n\t\tforeach ($iconos as $icono) {\n\t\t\techo $k;\n\t\t\t\t\t\n\t\t\tif (count($anchtable)) {\n\t\t\t\techo \"<td style=width:$anchtable[$k];> </td>\";\t\n\t\t\t}else{\n\t\t\t\techo \"<td> </td>\";\t\n\t\t\t}\n\n\t\t\t$k++;\n\t\t}\n\t}\n\t//echo $columnas;\n\techo $k;\n\t//$k=$k-1;\n\tfor ($c=0; $c < $columnas; $c++){\n\t\t// para traer los nombres de los campos\n\t\t$campo=mysqli_fetch_field_direct($registros,$c); // da la informacion de un campo en la base de datos\n\t\t \n\t\t if (count($anchtable)) {\n\t\t\t\techo \"<td style=width:$anchtable[$k];>$campo->name.$c</td>\";\t\n\t\t\t}else{\n\t\t\t\techo '<td style=\"width:(90/$columnas)%\">'.$campo->name.'</td>';\t\t\n\t\t\t}\n\t\t // echo $anchtable[$c];\n\t\t $k++;\n\t\t\n\t}\n\techo '</tr>';\n\t// fin cabecera\n\t// comienzo de registros\n\tfor ($r=0; $r < $oBD->numeRegistros; $r++) \n\t{ echo '<tr>';\n\t\t// agregando iconos\n\t\t// EN EL CASO DE QUE \"UPDATE EXISTA EN EL ARRGLO DE LOS ICONOS\"\n\t\tif (in_array(\"update\", $iconos)) {\n\t\t\t//da comportamiento de los iconos\n\t\t\techo '<td style=\"width:5%\"><img src=\"imagenes/update.png\"></td>';\n\t\t}\n\n\t\tif (in_array(\"delete\", $iconos)) {\n\t\t\t//da comportamiento de los iconos\n\t\t\techo '<td style=\"width:5%\"><img src=\"imagenes/delete.png\"></td>';\n\t\t}\n\n\n\t\t$campos = mysqli_fetch_array($registros);\n\t\t// despliega la informacion de un registro especifico\n\t\tfor ($c=0; $c < $columnas; $c++) \n\t\t\techo '<td>'.$campos[$c].'</td>';\n\t echo '</tr>';\n\t\t\n\t}\necho '</table>';\necho $k;\n}",
"function crear_registro(){\n \n $this->sentencia_sql=\"SELECT fun_registrar_\".$this->TABLA.\"('$this->valor_codigo_producto',\"\n . \"'$this->valor_nombre_producto',\"\n . \"'$this->valor_descripcion_producto',\"\n . \"'$this->valor_fk_id_categoria',\"\n . \"'$this->valor_precio_venta'\"\n . \",'$this->valor_existencia_minima') as respuesta\";\n \n if($this->ejecutar_funcion_sql()){\n \n return array(\"codigo\"=>\"00\",\"mensaje\"=> \"Se ha creado un nuevo registro en $this->TABLA \",\"respuesta\"=>TRUE,\"nuevo_registro\"=>$this->respuesta_funcion->respuesta);\n }else{\n return array(\"codigo\"=>\"01\",\"mensaje\"=> $this->mensajeDepuracion,\"respuesta\"=>FALSE,\"nuevo_registro\"=>$this->respuesta_funcion->respuesta);\n }\n }",
"protected function _initsTable() {}",
"function action_add() {\n\t\t\t$data = UTIL::get_post('data');\n\t\t\t$id = (int)$data['add_id'];\n\t\t\t$table = $data['add_table'];\n\t\t\t\n\t\t\t$choosen = $this->SESS->get('objbrowser', 'choosen');\n\t\t\t$choosen[$table][$id] = $id;\n\t\t\t$this->SESS->set('objbrowser', 'choosen', $choosen);\n\t\t}",
"public function add() {\n\n $sql = \"INSERT INTO persona(id,nombre,apellido_paterno,apellido_materno,estado_salud,telefono,ubicacion)\n VALUES(null,'{$this->nombre}','{$this->apellido_paterno}','{$this->apellido_materno}',\n '{$this->estado_salud}','{$this->telefono}','{$this->ubicacion}')\";\n $this->con->consultaSimple($sql);\n }",
"function getTablas() {\r\n $tablas['inventario_equipo']['id']='inventario_equipo';\r\n $tablas['inventario_equipo']['nombre']='Inventario (equipo)';\r\n\r\n $tablas['inventario_grupo']['id']='inventario_grupo';\r\n $tablas['inventario_grupo']['nombre']='Inventario (grupo)';\r\n\r\n $tablas['inventario_estado']['id']='inventario_estado';\r\n $tablas['inventario_estado']['nombre']='Inventario (estado)';\r\n\r\n $tablas['inventario_marca']['id']='inventario_marca';\r\n $tablas['inventario_marca']['nombre']='Inventario (marca)';\r\n\r\n $tablas['obligacion_clausula']['id']='obligacion_clausula';\r\n $tablas['obligacion_clausula']['nombre']='Obligacion (clausula)';\r\n\r\n $tablas['obligacion_componente']['id']='obligacion_componente';\r\n $tablas['obligacion_componente']['nombre']='Obligacion (componente)';\r\n\r\n $tablas['documento_tipo']['id']='documento_tipo';\r\n $tablas['documento_tipo']['nombre']='Documento (Tipo)';\r\n\r\n \t\t$tablas['documento_tema']['id']='documento_tema';\r\n \t\t$tablas['documento_tema']['nombre']='Documento (Tema)';\r\n\r\n \t\t$tablas['documento_subtema']['id']='documento_subtema';\r\n \t\t$tablas['documento_subtema']['nombre']='Documento (Subtema)';\r\n\r\n \t\t$tablas['documento_estado']['id']='documento_estado';\r\n \t\t$tablas['documento_estado']['nombre']='Documento (Estado)';\r\n\r\n \t\t$tablas['documento_estado_respuesta']['id']='documento_estado_respuesta';\r\n \t\t$tablas['documento_estado_respuesta']['nombre']='Documento (Estado Respuesta)';\r\n\r\n \t\t$tablas['documento_actor']['id']='documento_actor';\r\n \t\t$tablas['documento_actor']['nombre']='Documento (Responsables)';\r\n\r\n \t\t$tablas['documento_tipo_actor']['id']='documento_tipo_actor';\r\n \t\t$tablas['documento_tipo_actor']['nombre']='Documento (Tipo de Responsable)';\r\n\r\n \t\t$tablas['riesgo_probabilidad']['id']='riesgo_probabilidad';\r\n \t\t$tablas['riesgo_probabilidad']['nombre']='Riesgo (Probabilidad)';\r\n\r\n \t\t$tablas['riesgo_categoria']['id']='riesgo_categoria';\r\n \t\t$tablas['riesgo_categoria']['nombre']='Riesgo (Categoria)';\r\n\r\n \t\t$tablas['riesgo_impacto']['id']='riesgo_impacto';\r\n \t\t$tablas['riesgo_impacto']['nombre']='Riesgo (Impacto)';\r\n\r\n \t\t$tablas['compromiso_estado']['id']='compromiso_estado';\r\n \t\t$tablas['compromiso_estado']['nombre']='Compromisos (Estado)';\r\n\r\n \t\t$tablas['departamento']['id']='departamento';\r\n \t\t$tablas['departamento']['nombre']='Departamentos';\r\n\r\n \t\t$tablas['departamento_region']['id']='departamento_region';\r\n \t\t$tablas['departamento_region']['nombre']='Departamentos (Region)';\r\n\r\n \t\t$tablas['municipio']['id']='municipio';\r\n \t\t$tablas['municipio']['nombre']='Municipios';\r\n\r\n $tablas['operador']['id']='operador';\r\n\t $tablas['operador']['nombre']='Operador';\r\n\r\n asort($tablas);\r\n return $tablas;\r\n }",
"function modificarTablaInstancia(){\n\t\t$this->procedimiento='wf.ft_tabla_instancia_ime';\n\t\t$this->transaccion='WF_TABLAINS_MOD';\n\t\t$this->tipo_procedimiento='IME';\n\t\t\t\t\n\t\t$this->setParametro('id_tabla','id_tabla','integer');\n\t\t$this->setParametro('tipo_estado','tipo_estado','varchar');\n\t\t$this->setParametro('tipo_proceso','tipo_proceso','varchar');\n\t\t$bd_nombre_tabla = $_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['bd_nombre_tabla'];\n\t\t$this->setParametro('id_'.$bd_nombre_tabla,'id_'.$bd_nombre_tabla,'integer');\n\t\t//Define los parametros para la funcion\t\t\n\t\tforeach ($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['columnas'] as $value) {\n\t\t\t$this->setParametro($value['bd_nombre_columna'],$value['bd_nombre_columna'],$value['bd_tipo_columna']);\t\t\t\n\t\t}\t\n\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"public function registerRules(){\n \t// $this->applyValidationDateRange('start_event', 'end_event', 'editable_cierre');\n \t// $this->applyValidationTextMemo('desc_sol_comun', 3000, 0);\n \t$this->applyValidationClear('desc_sol_comun', 3000, 0);\n\t}",
"function glv_create_tables(){\r\n global $wpdb;\r\n \r\n //el nombre de la tabla, utilizamos el prefijo de wordpress\r\n $table_forms = $wpdb->prefix.'glv_forms'; \r\n\r\n //sql con el statement de la tabla \r\n $glv_form = \"CREATE TABLE \".$table_forms.\"(\r\n for_id int(11) NOT NULL AUTO_INCREMENT,\r\n for_name varchar(100) DEFAULT NULL,\r\n for_value text DEFAULT NULL,\r\n for_date date,\r\n UNIQUE KEY for_id (for_id)\r\n )\";\r\n\r\n //upgrade contiene la función dbDelta la cuál revisará si existe la tabla o no\r\n require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );\r\n \r\n //creamos la tabla\r\n dbDelta($glv_form);\r\n }",
"protected function leeRegistro3($tablas,$columnas,$filtro,$orden,$tipo=1,$opciones=\"\"){\n\t\t$tablas_s=split(\",\",strtolower($tablas));\n\t\tif(empty($columnas)){$columnas=\"*\";}\n\t\tif($tipo==1){\n\t\t\t$sql=\"Select \".$columnas.\" From \".$tablas_s[0].\" as t1 \";\n\t\t\t$sql.=\"Inner Join \".$tablas_s[1].\" as t2 on t1.id\".substr($tablas_s[1],3).\"=t2.id\".substr($tablas_s[1],3);\n\t\t\t$sql.=\" Inner Join \".$tablas_s[2].\" as t3 on t2.id\".substr($tablas_s[2],3).\"=t3.id\".substr($tablas_s[2],3);\n\t\t}else{\n\t\t\t$sql=\"Select \".$columnas.\" From \".$tablas_s[0].\" as t1 \";\n\t\t\t$sql.=\"Inner Join \".$tablas_s[1].\" as t2 on t1.id\".substr($tablas_s[1],3).\"=t2.id\".substr($tablas_s[1],3);\n\t\t\t$sql.=\" Inner Join \".$tablas_s[2].\" as t3 on t1.id\".substr($tablas_s[2],3).\"=t3.id\".substr($tablas_s[2],3);\n\t\t}\n\t\tif(!empty($filtro)){ $sql.=\" where \".$filtro; }\n\t\tif(!empty($orden)){ $sql.=\" order by \".$orden; }\n\t\tif(!empty($opciones)){ $sql.=\" \".$opciones; }\n\t\t$this->conectar();\n\t\t$resultado=mysql_query($sql) or die(mysql_error());\n\t\tif($resultado){\n\t\t\t$num_resultado=mysql_num_rows($resultado);\n\t\t\tfor($i=0;$i<$num_resultado;$i++){\n\t\t\t\t$fila=mysql_fetch_array($resultado);\n\t\t\t\t$data[]=$fila;\n\t\t\t}\n\t\t\t$this->desconectar();\n\t\t\treturn $data;\n\t\t}\n\t\telse{\n\t\t\treturn mysql_error();\n\t\t}\n\t}",
"protected function alterar(){\n header(\"Content-type: text/html;charset=utf-8\");\n $sql = \"SHOW FULL FIELDS FROM \" . $this->table;\n $execute = conexao::toConnect()->executeS($sql);\n $sets = \"\";\n $id_registro = '';\n $contador = \"\";\n $count = 1;\n foreach ($execute as $contar) {\n if ($contar->Key != 'PRI') {\n $atributos_field = $contar->Field;\n $select_p = substr(strtoupper($atributos_field), 0, 1);\n $select_t = substr($atributos_field, 1);\n $get = 'get' . $select_p . $select_t;\n if ($this->$get() != null) {\n $contador = $contador + 1;\n }\n }\n }\n foreach ($execute as $key => $attr){\n if ($attr->Key != 'PRI') {\n $atributos_field = $attr->Field;\n $select_p = substr(strtoupper($atributos_field), 0, 1);\n $select_t = substr($atributos_field, 1);\n $get = 'get' . $select_p . $select_t;\n if ($this->$get() != null) {\n if ($count != $contador) {\n $sets .= $attr->Field . \" = '\" . $this->$get() . \"',\";\n } else {\n $sets .= $attr->Field . \" = '\" . $this->$get().\"'\";\n }\n $count = $count + 1;\n }\n }else{\n $id_registro = $attr->Field;\n }\n }\n $update = \"UPDATE \".$this->table.\" SET \".$sets.\" WHERE \".$id_registro.\" = \".$this->getIdTable();\n\n $execute_into = conexao::toConnect()->executeQuery($update);\n if (count($execute_into) > 0) {\n return $execute_into;\n }else{\n return false;\n }\n }",
"public function create(){\n $alter = '';\n $crear = '';\n $creartablas = '';\n\n $a = '';\n if(!empty($_POST)){\n if( isset($_POST['creartabla']) )\n $a = $_POST['creartabla'];\n }\n if($a!=''):\n $array = explode(',', $a);\n $crear = '';\n $tablas = array();\n foreach ($array as $v): \n $v = trim($v);\n $inic = $crear;\n if( stristr($v, 'id_') ){ \n $tabla = str_replace('id_', '', $v);\n $crear.= 'CREATE TABLE IF NOT EXISTS '.$tabla.' ( ';\n $crear.= ' id_'.$tabla.' INTEGER(10) PRIMARY KEY AUTO_INCREMENT ';\n }\n if( stristr( $v, '_id') ){\n $tablas[] = str_replace('_id', '', $v);\n $crear.= ','.$v.' INTEGER(10)'; \n } \n\n if( stristr($v, 'fecha' )or stristr($v, 'fecha') ) $crear.= ','.$v.' DATE NOT NULL '; \n if( stristr($v, '_nro' ) or stristr($v, 'nro_' ) ) $crear.= ','.$v.' INTEGER(10) NOT NULL '; \n if( stristr($v, 'text' ) or stristr($v, 'texto' ) ) $crear.= ','.$v.' TEXT NOT NULL COMMENT \\'col:12\\' '; \n if( stristr($v, 'timestamp' ) ) $crear.= ','.$v.' TIMESTAMP DEFAULT CURRENT_TIMESTAMP '; \n if($inic==$crear) $crear.= ','.$v.' VARCHAR(255) NOT NULL '; \n \n \n endforeach;\n\n $fk = '';\n $creartablas ='';\n foreach ($tablas as $value):\n $fk.=', FOREIGN KEY('.$value.'_id) REFERENCES '.$value.'(id_'.$value.') '; \n $creartablas.= 'CREATE TABLE IF NOT EXISTS '.$value.' ( ';\n $creartablas.= ' id_'.$value.' INTEGER(10) PRIMARY KEY AUTO_INCREMENT ';\n $creartablas.= ', name_'.$value.' VARCHAR(99) NOT NULL';\n $creartablas.= ', detail_'.$value.' VARCHAR(99) NOT NULL ';\n $creartablas.= ') ENGINE = InnoDB; ';\n endforeach;\n $crear .= $fk.') ENGINE = InnoDB;';\n\n $a = $creartablas.$crear;\n $b = explode(';', $a);\n $re = 'INICIO DE PETICION<BR>#####################';\n $this->db->trans_start();\n foreach ($b as $value) {\n if($value!='')\n $this->db->query($value);\n $re.= \"<BR>Peticion: \".$value.'';\n }\n $this->db->trans_complete();\n $re.= '#####################<br>Fin de las peticiones';\n $tables = $this -> Tables_model -> table_name();\n $this->session->set_userdata('tables', $tables);\n return $re;\n endif;\n }",
"function agregar_usuario($name,$ape_pat,$ape_mat,$curp,$sexo,$correo,$calle,$colonia,$municipio,$estado,$telefono,$carrera,$anio_titulacion,$metodo_titulacion, $escuela_proc,$promedio)\n\t{\n\n\t\t$data = array(\n\t\t\t\t'name'=>$name,\n 'ape_pat'=>$ape_pat,\n \t\t\t\t'ape_mat'=>$ape_mat,\n 'curp'=>$curp,\n\t\t\t\t'sexo'=>$sexo,\n\t\t\t\t'correo'=>$correo,\n\t\t\t\t'calle'=>$calle,\n\t\t\t\t'colonia'=>$colonia,\n\t\t\t\t'municipio'=>$municipio,\n\t\t\t\t'estado'=>$estado,\n\t\t\t\t'telefono'=>$telefono,\n\t\t\t\t'carrera'=>$carrera,\n\t\t\t\t'anio_titulacion'=>$anio_titulacion,\n\t\t\t\t'metodo_titulacion'=>$metodo_titulacion,\n\t\t\t\t'escuela_proc'=>$escuela_proc,\n\t\t\t\t'promedio'=>$promedio, \t\t\t\t\n\t\t);\n\t\t\t\t\n $this->db->insert('usuario',$data);\t\t\n\t\treturn ($this->db->affected_rows() > 0)? true : false;\n\n\n/*\n$resultado = mysql_query('insert into usuario(name, ape_pat,ape_mat,curp,sexo,correo,calle,colonia,municipio,estado,telefono,carrera,anio_titulacion,metodo_titulacion,escuela_proc,promedio)\n\t\tvalues('\".$_POST['txt_nombre'].\"',\n\t\t'\".$_POST['txt_apaterno'].\"',\n\t\t'\".$_POST['txt_amaterno'].\"',\n\t\t'\".$_POST['txt_curp'].\"',\n\t\t'\".$_POST['cmb_sexo'].\"',\n\t\t'\".$_POST['txt_correo'].\"',\n\t\t'\".$_POST['txt_ca'].\"',\n\t\t'\".$_POST['txt_col'].\"',\n\t\t'\".$_POST['txt_muni'].\"',\n\t\t'\".$_POST['txt_esta'].\"',\n\t\t'\".$_POST['txt_telefono'].\"',\n\t\t'\".$_POST['txt_carrera'].\"',\n\t\t'\".$_POST['txt_año'].\"',\n\t\t'\".$_POST['txt_metodo'].\"',\n\t\t'\".$_POST['txt_escuela'].\"',\t\n\t\t'\".$_POST['txt_prom'].\"')\"', $conexion);\n\n$mensaje = \"REGISTRADO CON EXITO\";\nreturn $mensaje */\n\n\n\t}",
"public function register_table() {\n\t\t// make WP aware of our table\n\t\t$this->wpdb->tables[] = static::NAME;\n\t\t$this->wpdb->{static::NAME} = $this->get_full_table_name( static::NAME );\n\n\t\t// create the tables\n\t\tif ( $this->schema_update_required() ) {\n\t\t\t$this->update_table( static::NAME );\n\t\t\t$this->mark_schema_update_complete();\n\t\t}\n\t}",
"function getRegistrosTabelaAssociativa($tabela, $campo_selecao, $campo_comparacao, $value_comparacao){\n\t$sql = \"select $campo_selecao from $tabela where $campo_comparacao = $value_comparacao\";\n\t$rs = mysql_query($sql);\n\t\n\t$i = 0;\n\twhile($row = mysql_fetch_array($rs)){\n\t\t$registros[$i] = $row[0];\n\t\t$i++;\n\t}\n\t\n\treturn $registros;\n}",
"function consultarFuncionalidad()\n\t\t{\n\t\t\t\t $file = fopen(\"../Archivos/ArrayConsultarFuncionalidad.php\", \"w\");\n\t\t\t\t fwrite($file,\"<?php class consult { function array_consultar(){\". PHP_EOL);\n\t\t\t\t fwrite($file,\"\\$form=array(\" . PHP_EOL);\n\n\t\t\t$mysqli=$this->conexionBD();\n\t\t\t$query=\"SELECT * FROM funcionalidades \";\n\t\t\t$resultado=$mysqli->query($query);\n\t\t\tif(mysqli_num_rows($resultado)){\n\t\t\t\twhile($fila = $resultado->fetch_array())\n\t\t\t{\n\t\t\t\t$filas[] = $fila;\n\t\t\t}\n\t\t\tforeach($filas as $fila)\n\t\t\t{ \n\t\t\t\t$nombre=$fila['NOMBRE_FUNCIONALIDAD'];\n\t\t\t\t$descripcion=$fila['DESCRIPCION'];\n\t\t\t\tfwrite($file,\"array(\\\"nombre\\\"=>'$nombre',\\\"descripcion\\\"=>'$descripcion'),\" . PHP_EOL);\n\t\t\t}\n\t\t\t}\n\t\t\t fwrite($file,\");return \\$form;}}?>\". PHP_EOL);\n\t\t\t\t fclose($file);\n\t\t\t\t $resultado->free();\n\t\t\t\t $mysqli->close();\n\t\t}",
"function geraClassesMapeamento(){\n # Abre o template da classe basica e armazena conteudo do modelo\n $modelo = Util::getConteudoTemplate('class.ModeloMAP.tpl');\n\n # Abre arquivo xml para navegacao\n $aBanco = simplexml_load_string($this->xml);\n\n # Varre a estrutura das tabelas\n foreach($aBanco as $aTabela){\n $copiaModelo = $modelo;\n # Recupera o nome da tabela e gera o nome da classe\n $nomeTabela = ucfirst((string)$aTabela['NOME']);\n $nomeTabelaOriginal = (string)$aTabela['NOME'];\n\n $nomeClasse = ucfirst($this->getCamelMode($nomeTabela));\n $objetoClasse = \"\\$o$nomeClasse\";\n # Varre a estrutura dos campos da tabela em questao\n $objToReg = $regToObj = $objToRegInsert = array();\n\n foreach($aTabela as $oCampo){\n # Processa nome original da tabela estrangeira\n $nomeFKClasse\t= ucfirst($this->getCamelMode((string)$oCampo->FKTABELA));\n $objetoFKClasse = $nomeFKClasse;\n\n # Testando nova implementacao - Tirar caso ocorrer erro\n if($nomeFKClasse == $nomeClasse)\n $objetoFKClasse = ucfirst(preg_replace(\"#^(?:id_?|cd_?)(.*?)#is\", \"$1\", (string)$oCampo->NOME));\n\n //$nomeCampo = $this->getCamelMode((string)$oCampo->NOME); Alteracao SUDAM\n $nomeCampo = (string)$oCampo->NOME;\n\n # Monta parametros a serem substituidos posteriormente\n if($oCampo->FKTABELA == ''){\n $objToReg[] = \"\\t\\t\\$reg['\".(string)$oCampo->NOME.\"'] = $objetoClasse\".\"->$nomeCampo;\";\n if($oCampo->CHAVE == \"0\"){\n $objToRegInsert[] = \"\\t\\t\\$reg['\".(string)$oCampo->NOME.\"'] = $objetoClasse\".\"->$nomeCampo;\";\n }\n $regToObj[] = \"\\t\\t$objetoClasse\".\"->$nomeCampo = \\$reg['$nomeTabelaOriginal\".\"_\".(string)$oCampo->NOME.\"'];\";\n \n }\n else{\n $objToReg[] = \"\\t\\t\\$o$objetoFKClasse = $objetoClasse\".\"->o$objetoFKClasse;\\n\\t\\t\\$reg['\".(string)$oCampo->NOME.\"'] = \\$o$objetoFKClasse\".\"->\".(string)$oCampo->FKCAMPO.\";\";\n if($oCampo->CHAVE == \"0\"){\n $objToRegInsert[] = \"\\t\\t\\$o$objetoFKClasse = $objetoClasse\".\"->o$objetoFKClasse;\\n\\t\\t\\$reg['\".(string)$oCampo->NOME.\"'] = \\$o$objetoFKClasse\".\"->\".(string)$oCampo->FKCAMPO.\";\";\n }\n $x \t\t= $this->retornaArvore((string)$oCampo->FKTABELA);\n $regToObj[] = \"\\n$x\\t\\t$objetoClasse\".\"->o$objetoFKClasse = \\$o$objetoFKClasse;\";\n }\n }\n\n # Monta demais valores a serem substituidos\n $objToReg = join($objToReg,\"\\n\");\n $objToRegInsert = join($objToRegInsert,\"\\n\");\n $regToObj = join($regToObj,\"\\n\");\n\n # Substitui todas os parametros pelas variaveis ja processadas\n $copiaModelo = str_replace('%%NOME_CLASSE%%', $nomeClasse, $copiaModelo);\n $copiaModelo = str_replace('%%OBJETO_CLASSE%%', $objetoClasse, $copiaModelo);\n $copiaModelo = str_replace('%%OBJ_TO_REG%%', $objToReg, $copiaModelo);\n $copiaModelo = str_replace('%%OBJ_TO_REG_INSERT%%', $objToRegInsert,$copiaModelo);\n $copiaModelo = str_replace('%%REG_TO_OBJ%%', $regToObj, $copiaModelo);\n\n $dir = dirname(dirname(__FILE__)).\"/geradas/\".$this->projeto.\"/classes/core/map\";\n\n if(!file_exists($dir)) \n mkdir($dir);\n\n $fp = fopen(\"$dir/class.$nomeClasse\".\"MAP.php\",\"w\");\n fputs($fp,$copiaModelo);\n fclose($fp);\n }\n return true;\t\n }",
"public function registroAlumnoModel($datosModel, $tabla){\r\n\r\n\t\t#prepare() Prepara una sentencia SQL para ser ejecutada por el método PDOStatement::execute(). La sentencia SQL puede contener cero o más marcadores de parámetros con nombre (:name) o signos de interrogación (?) por los cuales los valores reales serán sustituidos cuando la sentencia sea ejecutada. Ayuda a prevenir inyecciones SQL eliminando la necesidad de entrecomillar manualmente los parámetros.\r\n\r\n\t\t$stmt = Conexion::conectar()->prepare(\"INSERT INTO $tabla ( matricula, nombre, apellido, email, id_carrera, id_grupo) VALUES (:matricula,:nombre,:apellido ,:email ,:id_carrera, :id_grupo)\");\t\r\n\r\n\t\t#bindParam() Vincula una variable de PHP a un parámetro de sustitución con nombre o de signo de interrogación correspondiente de la sentencia SQL que fue usada para preparar la sentencia.\r\n\r\n\t\t$stmt->bindParam(\":matricula\", $datosModel[\"matricula\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":nombre\", $datosModel[\"nombre\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":apellido\", $datosModel[\"apellido\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":email\", $datosModel[\"email\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":id_carrera\", $datosModel[\"id_carrera\"], PDO::PARAM_STR);\r\n\t\t$stmt->bindParam(\":id_grupo\", $datosModel[\"id_grupo\"], PDO::PARAM_STR);\r\n\r\n\t\tif($stmt->execute()){\r\n\r\n\t\t\treturn \"success\";\r\n\r\n\t\t}\r\n\r\n\t\telse{\r\n\r\n\t\t\treturn \"error\";\r\n\r\n\t\t}\r\n\r\n\t\t$stmt->close();\r\n\r\n\t}",
"private function tbl_guiones_registro_ubicacion() {\r\n\t\t\t$this->guiones_registro_ubicacion = $this->esquema->createTable('GUIONES_REGISTRO_UBICACION');\r\n\t\t\t$this->guiones_registro_ubicacion->addColumn('ID', 'bigint', array(\r\n\t\t\t\t'notnull' => true,\r\n\t\t\t\t'autoincrement' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID de la ubicacion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_ubicacion->addColumn('NOMBRE', 'string', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 255,\r\n\t\t\t\t'comment' => 'Nombre de la ubicacion'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_ubicacion->addColumn('ESTADO', 'bigint', array(\r\n\t\t\t\t'notnull' => true, \r\n\t\t\t\t'length' => 20,\r\n\t\t\t\t'comment' => 'ID del Estado de la ubicacion [ID de la tabla ESTADOS]'\r\n\t\t\t));\r\n\t\t\t$this->guiones_registro_ubicacion->setPrimaryKey(array('ID'));\r\n\t\t\t$this->guiones_registro_ubicacion->addForeignKeyConstraint($this->estados, array('ESTADO'), array('ID'), $this->opcForeign);\r\n\t\t}",
"function tbl_opcion($id=0,$form='',$parm=''){\n\t$reg=tabla::tabla_edit('E',$id);\n $search_form=$reg['lst_cpo_buscar'];\n \n $param=array();\n if($col=tabla::tabla_col_lista($id)){\n foreach($col as &$r){\n if($r['tbl_col_param']=='1' || $r['tbl_col_filtro']=='1'){\n $var=explode(\":\",$r['tbl_col_valor_ini']);\n switch($var[0]){\n case 'REQUEST':\n if($var[1]>'' || $var[1]>0){\n $valor=$var[1];\n }\n break;\n default:\n $valor=$r['tabla_col_nombre'];\n break;\n }\n $param[]=$r['tabla_col_nombre'].\"=\".(int)$_REQUEST[$r['tabla_col_nombre']];\n }\n }\n }\n \n \n if(is_array($param)){\n $array=implode(\"&\",$param);\n }\n//echo $array;\n if($reg['lst_acc_mail']=='1'){$cad[]=\"<a href='#' onclick=\\\"SendMail();\\\"><img src='images/mail.png' title='Enviar mail'></a>\";}\n if($reg['lst_acc_grabar']=='1'){$cad[]=\"<a onclick=\\\"GrabarLista(\".$id.\",'\".$array.\"');\\\"><img src='images/grabar2.png' width='16' height='16' title='Grabar cambios (antes de salir)'></a>\";}\n if($reg['lst_acc_add_cot']=='1'){$cad[]=\"<a onclick=\\\"AddCot();\\\"><img src='images/add_cot.png' title='Enviar a ...'></a>\";}\n if($reg['lst_acc_search']=='1'){$cad[]=\"<a href='#' onclick=\\\"Search(\".$id.\",'\".$search_form.\"')\\\"><img src='images/filtro.png' title='Busqueda avanzada'></a>\";}\n if($reg['lst_acc_print']=='1'){$cad[]=\"<a href='#' onclick=\\\"Imprime('lista_\".$id.\"',500,350);\\\"><img src='images/b_print.png' title='Imprimir'></a>\";}\n\tif($reg['lst_acc_nuevo']=='1'){$cad[]=\"<a onclick=\\\"Accion('I','\".$reg['tbl_frm_ancho'].\"','\".$reg['tbl_frm_alto'].\"','\".$reg['lst_cpo_form'].\"',\".(int)$reg['tbl_padre_id'].\",\".(int)$id.\",0,'\".(int)$_REQUEST['menu_id'].\"','\".$reg['tbl_nombre'].\"','\".$array.\"');\\\"><img src='images/add.png' title='Nuevo'></a>\";}\n\tif($reg['lst_acc_asociar']=='1'){$cad[]=\"<a href='index.php?menu=\".$form.\"&i=\".($id+0).\"&r=\".($r+0).\"'><img src='images/asoc.png' title='Asociar'></a>\";}\n\tif($reg['lst_acc_duplicar']=='1'){$cad[]=\"<a href='\".$form.\"?i=\".($id+0).\"&r=\".($r+0).\"'><img src='images/duplicar.png' title='Duplicar'></a>\";}\n\tif($reg['lst_acc_unir']=='1'){$cad[]=\"<a href='\".$form.\"?i=\".($id+0).\"&r=\".($r+0).\"'><span>Unir</span></a>\";}\n if($reg['lst_acc_selec']=='1'){$cad[]=\"<a href='\".$form.\"?i=\".($id+0).\"&r=\".($r+0).\"'><span>Seleccionar</span></a>\";}\n if($reg['lst_acc_catalogo']=='1'){$cad[]=\"<a href='index.php?menu=personas&tbl_id=55'><img width='16' height='16' src='images/catalogo.png' title='Ir al Catalogo'></a>\";}\n if($reg['lst_acc_directo']=='1'){$cad[]=\"<a onclick=\\\"CrearAccesoDirecto('I',\".(int)$_REQUEST['menu_id'].\");\\\"><img width='16' height='16' src='images/acceso.png' title='Crear acceso directo'></a>\";}\n \n if($acciones=tabla::tbl_accion($id,3)){ // General\n foreach ($acciones as $accion){\n $url=($accion['tbl_accion_url']>'')?\" href='\".$accion['tbl_accion_url'].\"?tbl_id=\".$id.\"' target='_blank' \":\"\";\n $contenido=($accion['tbl_accion_icono']>'')?\"<img height='16' width='16' src='\".$accion['tbl_accion_icono'].\"'>\":$accion['tbl_accion_nombre'];\n $funcion=($accion['tbl_accion_func']>'')?\" onclick=\\\"\".$accion['tbl_accion_func'].\"(\".(int)$id.\");\\\" \":\"\";\n $cad[]=\"<a title='\".$accion['tbl_accion_nombre'].\"' \".$url.\" \".$funcion.\">\".$contenido.\"</a>\";\n }\n }\n \n \n if(count($cad)>0){\n return implode(\"<img src='images/split_img.png'>\",$cad);\n }else{\n return '';\n }\n\t\n}",
"function generateColonneByType($table, $columnName, $recherche=false, $attribut=null, $disabled=false) {\n $columnName = strtolower($columnName);\n $retour = '';\n $disabled = $disabled ? 'disabled' : '';\n $recherche = $recherche ? 'rechercheTableStatique' : '';\n $type = $table->getTypeOfColumn($columnName);\n switch ($type) {\n case 'string':\n $cantBeNull = $table->getColumnDefinition($columnName);\n $cantBeNull['notnull'] == 1 ? $class = 'requis' : $class = '';\n $retour .= '\n <div class=\"colonne\">\n <span class=\"attribut\">'.$columnName.' : </span>\n <span><input class=\"contour_field input_char '.$recherche.' '.$class.'\" type=\"text\" columnName='.$columnName.' value=\"'.$attribut.'\"'.$disabled.'/></span>\n </div>';\n break;\n case 'float' :\n case 'integer' :\n if (preg_match('#^id[a-zA-Z]+#', $columnName)) {\n $columnName = substr($columnName, 2);\n $retour .= '\n <div class=\"colonne\">\n <span class=\"attribut\">'.$columnName.' :</span>\n <span><input type=\"text\" class=\"contour_field input_char autoComplete\" id=\"'.$columnName.'\" table=\"'.$columnName.'\" champ=\"libelle\" value=\"'.$attribut.'\"'.$disabled.'/></span>\n </div>'; \n } else {\n $cantBeNull = $table->getColumnDefinition($columnName);\n $cantBeNull['notnull'] == 1 ? $class = 'requis' : $class = '';\n $retour .= '\n <div class=\"colonne\">\n <span class=\"attribut\">'.$columnName.' :</span>\n <span><input type=\"text\" class=\"contour_field input_num '.$class.'\" columnName='.$columnName.' value=\"'.$attribut.'\"'.$disabled.'/></span>\n </div>';\n }\n \n break;\n case 'boolean' :\n $retour .='\n <div class=\"colonne\">\n <span class=\"attribut\">'.$columnName.' : </span>';\n if($attribut != null && $attribut == 1) {\n $retour .= '<span class=\"checkbox checkbox_active\" value=\"1\" columnName='.$columnName.' '.$disabled.'></span></div>';\n } else {\n $retour .= '<span class=\"checkbox\" value=\"0\" columnName='.$columnName.' '.$disabled.'></span></div>';\n };\n break;\n }\n return $retour;\n}",
"function NewRow() {\n\t\t$row = array();\n\t\t$row['id'] = NULL;\n\t\t$row['nombre_contacto'] = NULL;\n\t\t$row['name'] = NULL;\n\t\t$row['lastname'] = NULL;\n\t\t$row['email'] = NULL;\n\t\t$row['address'] = NULL;\n\t\t$row['phone'] = NULL;\n\t\t$row['cell'] = NULL;\n\t\t$row['is_active'] = NULL;\n\t\t$row['created_at'] = NULL;\n\t\t$row['id_sucursal'] = NULL;\n\t\t$row['documentos'] = NULL;\n\t\t$row['DateModified'] = NULL;\n\t\t$row['DateDeleted'] = NULL;\n\t\t$row['CreatedBy'] = NULL;\n\t\t$row['ModifiedBy'] = NULL;\n\t\t$row['DeletedBy'] = NULL;\n\t\t$row['latitud'] = NULL;\n\t\t$row['longitud'] = NULL;\n\t\t$row['tipoinmueble'] = NULL;\n\t\t$row['id_ciudad_inmueble'] = NULL;\n\t\t$row['id_provincia_inmueble'] = NULL;\n\t\t$row['imagen_inmueble01'] = NULL;\n\t\t$row['imagen_inmueble02'] = NULL;\n\t\t$row['imagen_inmueble03'] = NULL;\n\t\t$row['imagen_inmueble04'] = NULL;\n\t\t$row['imagen_inmueble05'] = NULL;\n\t\t$row['imagen_inmueble06'] = NULL;\n\t\t$row['imagen_inmueble07'] = NULL;\n\t\t$row['imagen_inmueble08'] = NULL;\n\t\t$row['tipovehiculo'] = NULL;\n\t\t$row['id_ciudad_vehiculo'] = NULL;\n\t\t$row['id_provincia_vehiculo'] = NULL;\n\t\t$row['imagen_vehiculo01'] = NULL;\n\t\t$row['imagen_vehiculo02'] = NULL;\n\t\t$row['imagen_vehiculo03'] = NULL;\n\t\t$row['imagen_vehiculo04'] = NULL;\n\t\t$row['imagen_vehiculo05'] = NULL;\n\t\t$row['imagen_vehiculo06'] = NULL;\n\t\t$row['imagen_vehiculo07'] = NULL;\n\t\t$row['imagen_vehiculo08'] = NULL;\n\t\t$row['tipomaquinaria'] = NULL;\n\t\t$row['id_ciudad_maquinaria'] = NULL;\n\t\t$row['id_provincia_maquinaria'] = NULL;\n\t\t$row['imagen_maquinaria01'] = NULL;\n\t\t$row['imagen_maquinaria02'] = NULL;\n\t\t$row['imagen_maquinaria03'] = NULL;\n\t\t$row['imagen_maquinaria04'] = NULL;\n\t\t$row['imagen_maquinaria05'] = NULL;\n\t\t$row['imagen_maquinaria06'] = NULL;\n\t\t$row['imagen_maquinaria07'] = NULL;\n\t\t$row['imagen_maquinaria08'] = NULL;\n\t\t$row['tipomercaderia'] = NULL;\n\t\t$row['imagen_mercaderia01'] = NULL;\n\t\t$row['documento_mercaderia'] = NULL;\n\t\t$row['tipoespecial'] = NULL;\n\t\t$row['imagen_tipoespecial01'] = NULL;\n\t\t$row['email_contacto'] = NULL;\n\t\treturn $row;\n\t}",
"public function registrar_registro()\n \n {\n /** \n * @brief : Metodos para ingresar registro en la base de datos.\n * @return :Vista donde nos mostrara todos lo registro.\n */\n \n $data =Request()->all();\n registro::create($data);\n\n }",
"function mostrarTodosRegistros($tabla) {\n global $link;\n\n $consulta = \"SELECT * FROM $tabla\";\n\n $query = mysqli_query($link, $consulta);\n return $query;\n //echo $consulta;\n }",
"public function afterRegistry()\n {\n parent::afterRegistry();\n\n $this->addColumn(new \\Zend_Db_Expr(sprintf(\n \"CASE WHEN gla_by IS NULL THEN '%s'\n ELSE CONCAT(\n COALESCE(gsf_last_name, '-'),\n ', ',\n COALESCE(CONCAT(gsf_first_name, ' '), ''),\n COALESCE(gsf_surname_prefix, '')\n )\n END\",\n $this->_('(no user)')\n )), 'staff_name');\n $this->addColumn(new \\Zend_Db_Expr(sprintf(\n \"CASE WHEN grs_id_user IS NULL THEN '%s'\n ELSE CONCAT(\n COALESCE(grs_last_name, '-'),\n ', ',\n COALESCE(CONCAT(grs_first_name, ' '), ''),\n COALESCE(grs_surname_prefix, '')\n )\n END\",\n $this->_('(no respondent)')\n )), 'respondent_name');\n }",
"public function rellenarTabla($cabecera,$cuerpo,$ini,$fin,$tipo){\n \n if($tipo == '1'){\n $tabla = \"<table class='table font-10 text-center'>\";\n $tablaHead =\"<thead><tr><th class='text-center'>FAMILIAR</th>\";\n }else{\n $tabla = \"<table class='table font-10 text-center'>\";\n $tablaHead =\"<thead><tr><th>NOMBRE</th>\";\n }\n \n //*********Se agregan las cabeceras a las tablas********\n \n $numRegistros = count($cabecera);\n \n for ($i=$ini; $i < $fin; $i++) {\n \n if($i < $numRegistros){\n $tablaHead = $tablaHead.\"<th class='text-center'>\".$cabecera[$i]->NOMBRE_ENFER.\"</th>\";\n }\n \n }\n\n $endThead = \"</tr></thead>\";\n $tablaBody = \"<tbody>\";\n $seEncontroRel = FALSE;\n\n //***********se agrega el body a las tablas************\n\n foreach ($cuerpo as $rel) {\n $enfermedad = explode(\",\", $rel->ENFERMEDAD);\n $numEnf = count($enfermedad);\n $rowTable = \"</tr><td>\".$rel->NOMBRE_PAR.\"</td>\";\n //se recorre las enfermedades en base a un inicio y un fin\n for ($i=$ini; $i < $fin; $i++) {\n //es te if es para que en caso de que el fin sea mayor al del arreglo no se rompa\n if($i < $numRegistros){\n //se recorren los enfermedades relacionadas\n for ($j=0; $j < $numEnf; $j++) {\n //se valisa si son iguales\n if($cabecera[$i]->ID_ENFER_PK == $enfermedad[$j]){\n //echo \"valor 1 \".$cabecera[$i]->ID_ENFER_PK.\"<br>\";\n //echo \"valor 2 \".$enfermedad[$j].\"<br>\";\n $seEncontroRel = TRUE;\n break;\n }else{\n $seEncontroRel = FALSE;\n }\n }\n //en base a la variable se agrega si o no\n if($seEncontroRel == FALSE){\n //se agrega un No si no corresponde\n $rowTable = $rowTable.\"<td>NO</td>\";\n }else{\n //se agrega un Si cuando sena iguales\n $rowTable = $rowTable.\"<td>SI</td>\";\n }\n }\n }\n //se agregan los valores a la tabla\n $tablaBody = $tablaBody.$rowTable.\"<tr>\";\n }\n //*****************************************************\n \n $endTBody = \"</tbody>\";\n $endTabla = \"</table>\";\n \n //se concatenan todos los valores para la creacion de la tabla\n $tablaFamily = $tabla.$tablaHead.$endThead.$tablaBody.$endTBody.$endTabla;\n\n //Se regresa la tabla\n return $tablaFamily;\n }",
"function GenerarInserts($NombreTabla,$parametros){\n\n\t$ins= \"\t/* Funcion Insertar */\\n\";\n\t$ins.= \"\tpublic function \".strtolower( $NombreTabla ).\"Ins(){\\n\";\n\t$ins.= '\t\t$this->adampt->Liberar();'.\"\\n\";\n\tforeach ($parametros as $indice => $valor) {\n\t\t$ins.='\t\t$this->adampt->setParam( '.'$this->get_'.$valor.'() );'.\"\\n\";\n\t}\t\n\t$ins .='\t\t$query = $this->adampt->consulta(\"USP_XXX_I_'.$NombreTabla.'\");'.\"\\n\";\n\t$ins .='\t\tif( count($result) > 0){'.\"\\n\";\n\t$ins .='\t\t\treturn $result;'.\"\\n\";\n\t$ins .='\t\t}else{'.\"\\n\";\n\t$ins .='\t\t\treturn null;'.\"\\n\";\n\t$ins .='\t\t}'.\"\\n\";\n\t$ins .=\"\t}\\n\\n\";\n\treturn $ins;\n}",
"function getRegistrosPlus() {\n\t\tif (isset($this->extra[\"monitor_id\"]) and isset($this->extra[\"pagina\"])) {\n\t\t\t$this->resultado = $this->getDetalleRegistrosPlus($this->extra[\"monitor_id\"], $this->extra[\"pagina\"]);\n\t\t\treturn;\n\t\t}\n\n\t\tglobal $mdb2;\n\t\tglobal $log;\n\t\tglobal $current_usuario_id;\n\n\t\t/* OBTENER LOS DATOS Y PARSEARLO */\n\t\t$sql = \"SELECT foo.nodo_id FROM (\".\n\t\t\t \"SELECT DISTINCT unnest(_nodos_id) AS nodo_id FROM _nodos_id(\".\n\t\t\t\tpg_escape_string($current_usuario_id).\",\".\n\t\t\t\tpg_escape_string($this->objetivo_id).\",'\".\n\t\t\t\tpg_escape_string($this->timestamp->getInicioPeriodo()).\"','\".\n\t\t\t\tpg_escape_string($this->timestamp->getTerminoPeriodo()).\"')) AS foo, nodo n \".\n\t\t\t \"WHERE foo.nodo_id=n.nodo_id ORDER BY orden\";\n\n\t\t$res =& $mdb2->query($sql);\n\t\tif (MDB2::isError($res)) {\n\t\t\t$log->setError($sql, $res->userinfo);\n\t\t\texit();\n\t\t}\n\n\t\t$monitor_ids = array();\n\t\twhile ($row = $res->fetchRow()) {\n\t\t\t$monitor_ids[] = $row[\"nodo_id\"];\n\t\t}\n\n\t\t/* SI NO HAY DATOS MOSTRAR MENSAJE */\n\t\tif (count($monitor_ids) == 0) {\n\t\t\t$this->resultado = $this->__generarContenedorSinDatos();\n\t\t\treturn;\n\t\t}\n\n\t\t/* TEMPLATE DEL GRAFICO */\n\t\t$T =& new Template_PHPLIB(REP_PATH_TABLETEMPLATES);\n\t\t$T->setFile('tpl_tabla', 'contenedor_tabla.tpl');\n\t\t$T->setBlock('tpl_tabla', 'LISTA_CONTENEDORES', 'lista_contenedores');\n\n\t\t/* LISTA DE MONITORES */\n\t\t$orden = 1;\n\t\tforeach ($monitor_ids as $monitor_id) {\n\t\t\t$T->setVar('__contenido_id', 'regplus_'.$monitor_id);\n\t\t\t$T->setVar('__contenido_tabla', $this->getDetalleRegistrosPlus($monitor_id, 1, $orden));\n\t\t\t$T->parse('lista_contenedores', 'LISTA_CONTENEDORES', true);\n\t\t}\n\n\t\t$this->resultado = $T->parse('out', 'tpl_tabla');\n\t}",
"public function add()\n\t{\n\t\t$fake_id = $this->_get_id_cur();\n\t\t$form = array();\n\t\t$form['view'] = 'form';\n\t\t$form['validation']['params'] = $this->_get_params();\n\t\t$form['submit'] = function()use ($fake_id)\n\t\t{\n\t\t\t$data = $this->_get_inputs();\n\t\t\t$data['sort_order'] = $this->_model()->get_total() + 1;\n\t\t\t$id = 0;\n\t\t\t$this->_model()->create($data,$id);\n\t\t\t// Cap nhat lai table_id table file\n\t\t\tmodel('file')->update_table_id_of_mod($this->_get_mod(), $fake_id, $id);\n\t\t\tfake_id_del($this->_get_mod());\n\n\t\t\tset_message(lang('notice_add_success'));\n\t\t\t\n\t\t\treturn admin_url($this->_get_mod());\n\t\t};\n\t\t$form['form'] = function() use ($fake_id)\n\t\t{\n\t\t\t$this->_create_view_data($fake_id);\n\n\t\t\t$this->_display('form');\n\t\t};\n\t\t$this->_form($form);\n\t}",
"function getRegistros() {\n\t\tif (isset($this->extra[\"monitor_id\"]) and isset($this->extra[\"pagina\"])) {\n\t\t\t$this->resultado = $this->getDetalleRegistros($this->extra[\"monitor_id\"], $this->extra[\"pagina\"]);\n\t\t\treturn;\n\t\t}\n\n\t\tglobal $mdb2;\n\t\tglobal $log;\n\t\tglobal $current_usuario_id;\n\n\t\t/* OBTENER LOS DATOS Y PARSEARLO */\n\t\t$sql = \"SELECT unnest(_nodos_id) AS nodo_id FROM _nodos_id(\".\n\t\t\t pg_escape_string($current_usuario_id).\", \".\n\t\t\t pg_escape_string($this->objetivo_id).\", '\".\n\t\t\t pg_escape_string($this->timestamp->getInicioPeriodo()).\"','\".\n\t\t\t pg_escape_string($this->timestamp->getTerminoPeriodo()).\"')\";\n\t\t//print($sql);\n\t\t$res =& $mdb2->query($sql);\n\t\tif (MDB2::isError($res)) {\n\t\t\t$log->setError($sql, $res->userinfo);\n\t\t\texit();\n\t\t}\n\t\t$monitor_ids = array();\n\t\twhile($row = $res->fetchRow()) {\n\t\t\t$monitor_ids[] = $row[\"nodo_id\"];\n\t\t}\n\n\t\t/* SI NO HAY DATOS MOSTRAR MENSAJE */\n\t\tif (count($monitor_ids) == 0) {\n\t\t\t$this->resultado = $this->__generarContenedorSinDatos();\n\t\t\treturn;\n\t\t}\n\n\t\t/* TEMPLATE DEL GRAFICO */\n\t\t$T =& new Template_PHPLIB(REP_PATH_TABLETEMPLATES);\n\t\t$T->setFile('tpl_tabla', 'contenedor_tabla.tpl');\n\t\t$T->setBlock('tpl_tabla', 'LISTA_CONTENEDORES', 'lista_contenedores');\n\n\t\t/* LISTA DE MONITORES */\n\t\t$orden = 1;\n\t\tforeach ($monitor_ids as $monitor_id) {\n\t\t\t$T->setVar('__contenido_id', 'reg_'.$monitor_id);\n\t\t\t$T->setVar('__contenido_tabla', $this->getDetalleRegistros($monitor_id, 1, $orden));\n\t\t\t$T->parse('lista_contenedores', 'LISTA_CONTENEDORES', true);\n\t\t\t$orden++;\n\t\t}\n\n\t\t$this->resultado = $T->parse('out', 'tpl_tabla');\n\t}",
"protected function tableModel()\n {\n }",
"function insertkuesionerman($tabel,$dt) {\n\t\t$this->db->insert($tabel, $dt);\n }",
"function insertarFormula(){\r\n\t\t$this->procedimiento='vef.ft_formula_v2_ime';\r\n\t\t$this->transaccion='VF_FORMULAV2_INS';\r\n\t\t$this->tipo_procedimiento='IME';\r\n\r\n\t\t//Define los parametros para la funcion\r\n\t\t$this->setParametro('estado_reg','estado_reg','varchar');\r\n\t\t$this->setParametro('nombre','nombre','varchar');\r\n\t\t$this->setParametro('descripcion','descripcion','text');\r\n\r\n\t\t//Ejecuta la instruccion\r\n\t\t$this->armarConsulta();\r\n\t\t$this->ejecutarConsulta();\r\n\r\n\t\t//Devuelve la respuesta\r\n\t\treturn $this->respuesta;\r\n\t}",
"function crear_tabla()\n {\n //Array para saber cuantos dias tienen los meses\n $meses = array(\"31\", \"28\", \"31\", \"30\", \"31\", \"30\", \"31\", \"31\", \"30\", \"31\", \"30\", \"31\");\n $cambio_mes = 0;\n //Recogemos los datos\n $num1 = filter_input(INPUT_POST, 'num1');\n $profe = filter_input(INPUT_POST, 'profe');\n $zona = filter_input(INPUT_POST, 'zona');\n $mes = filter_input(INPUT_POST, 'mes');\n $año = filter_input(INPUT_POST, 'año');\n\n //Recogemos los horarios del profesor y la zona seleccionados\n $h_profe=$this->model->get_h_profe($profe, $zona);\n $numeros[5]=\"\";\n $numeros[0]=$num1;\n //Sacamos los cinco numeros de la semana\n for($i=0;$i<5;$i++)\n {\n $numeros[$i+1] = $numeros[$i]+1;\n //si el numero es superior al dia maximo del mes entonces le restamos el dia maximo y reseteamos los dias\n if( $numeros[$i+1] > $meses[$mes-1])\n {\n $numeros[$i+1] = $numeros[$i+1] - $meses[$mes-1];\n //marcamos que cambiamos de mes\n $cambio_mes = 1;\n }\n\n }\n $total = \"\";\n //bucle para crear los tr de las horas\n for($i=8;$i<21;$i++)\n {\n //Quitamos las horas de comer\n if($i!=14 && $i!=15)\n {\n //generamos el primer td con la hora\n $total.=\"<tr><td>\".$i.\":00-\".($i+1).\":00</td>\";\n //bucle para sacar el resto de td\n for($k=0;$k<5;$k++)\n {\n $total .= \"<td class='$numeros[$k]-$i dia_$k'>\";\n //foreach de horarios para comprobar si coincide con la fecha y tenemos que printar un boton\n foreach ($h_profe as $hora)\n {\n //creamos otra variable de mes para no modificar la global\n $mes_1 = $mes;\n //Preguntas para saber si hay que modificar el mes, ya sea sumar o cambiar a 1\n if($cambio_mes == 1 && $mes_1 < 12 && $numeros[$k]<5)\n {\n $mes_1 = $mes_1+1;\n }\n else if( $cambio_mes == 1 && $mes_1 == 12 && $numeros[$k]<5)\n {\n $mes_1 = 1;\n $año = $año+1;\n }\n //Añadimos un zero a la izquierda si es inferior a 10\n $mes_1 = str_pad($mes_1, 2, \"0\", STR_PAD_LEFT);\n $dia = str_pad($numeros[$k], 2, \"0\", STR_PAD_LEFT);\n //Montamos la fecha\n $fecha = $año.\"-\".$mes_1.\"-\".$dia ;\n\n //Preguntamos si la hora del tr es la misma que la del horario y lo mismo con la fecha\n if($hora['hora']== $i && $hora['fecha'] == $fecha)\n {\n //Si coincide creamos el boton\n $total.= \"<button class='practica hvr-grow-shadow'>Marcar</button>\";\n }\n }\n //Le metemos un span oculto con los datos de dia y hora.\n $total .=\"<span style='display:none'>\".$numeros[$k].\" \".$i.\":00</span></td>\";\n\n }\n $total.=\"</tr>\";\n }\n }\n //Enviamos la tabla\n echo $total;\n }",
"function _Registros($Regs=0){\n\t\t// Creo grid\n\t\t$Grid = new nyiGridDB('NOTICIAS', $Regs, 'base_grid.htm');\n\t\t\n\t\t// Configuro\n\t\t$Grid->setParametros(isset($_GET['PVEZ']), 'titulo');\n\t\t$Grid->setPaginador('base_navegador.htm');\n\t\t$arrCriterios = array(\n\t\t\t'id'=>'Identificador',\n\t\t\t'titulo'=>'Título', \n\t\t\t\"IF(p.visible, 'Si', 'No')\"=>\"Visible\"\n\t\t);\n\t\t$Grid->setFrmCriterio('base_criterios_buscador.htm', $arrCriterios);\n\t\n\t\t// Si viene con post\n\t\tif ($_SERVER[\"REQUEST_METHOD\"] == \"POST\"){\n\t\t\t$Grid->setCriterio($_POST['ORDEN_CAMPO'], $_POST['ORDEN_TXT'], $_POST['CBPAGINA']);\n\t\t\tunset($_GET['NROPAG']);\n\t\t}\n\t\telse if(isset($_GET['NROPAG'])){\n\t\t\t// Numero de Pagina\n\t\t\t$Grid->setPaginaAct($_GET['NROPAG']);\n\t\t}\n\t\n\t\t$Campos = \"p.id_noticia AS id, p.titulo, pf.nombre_imagen, pf.extension, IF(p.visible, 'Si', 'No') AS visible, p.copete\";\n\t\t$From = \"noticia p LEFT OUTER JOIN noticia_foto pf ON pf.id_noticia = p.id_noticia AND pf.orden = 1\";\n\t\t\n\t\t$Grid->getDatos($this->DB, $Campos, $From);\n\t\t\n\t\t// Devuelvo\n\t\treturn($Grid);\n\t}",
"function agregar($consulta){\n\t\t$objectSql = conectar(\"on\");\n\t\t\t$objectSql->query($consulta);\n\t\tconectar(\"off\");\n\t}",
"function crear_tabla_horario()\n {\n //El funcionamiento es el mismo que en crear_tabla, excepto que aqui no le pasamos el profesor\n $meses = array(\"31\", \"28\", \"31\", \"30\", \"31\", \"30\", \"31\", \"31\", \"30\", \"31\", \"30\", \"31\");\n $cambio_mes = 0;\n\n $num1 = filter_input(INPUT_POST, 'num1');\n\n $profe=$this->model->get_profe($_SESSION['iduser']);\n $zona = filter_input(INPUT_POST, 'zona');\n $mes = filter_input(INPUT_POST, 'mes');\n $año = filter_input(INPUT_POST, 'año');\n\n $mes = str_pad($mes, 2, \"0\", STR_PAD_LEFT);\n $h_profe=$this->model->get_h_profe($profe[0]['id_profesores'], $zona);\n $numeros[5]=\"\";\n $numeros[0]=$num1;\n for($i=0;$i<5;$i++)\n {\n\n $numeros[$i+1] = $numeros[$i]+1;\n\n if( $numeros[$i+1] > $meses[$mes-1])\n {\n $numeros[$i+1] = $numeros[$i+1] - $meses[$mes-1];\n $cambio_mes = 1;\n }\n\n }\n $total = \"\";\n for($i=8;$i<21;$i++)\n {\n if($i!=14 && $i!=15)\n {\n\n $total.=\"<tr><td>\".$i.\":00-\".($i+1).\":00</td>\";\n for($k=0;$k<5;$k++)\n {\n $total .= \"<td class='$numeros[$k]-$i dia_$k'>\";\n $ano=str_pad($numeros[$k],2,\"0\",STR_PAD_LEFT);\n //Si el horario del profe esta vacio printamos boton en todos los td\n if(!empty($h_profe))\n {\n $cont = 0;\n foreach ($h_profe as $hora)\n {\n $mes_1 = $mes;\n if($cambio_mes == 1 && $mes_1 < 12 && $numeros[$k]<5)\n {\n $mes_1 = $mes_1+1;\n }\n else if( $cambio_mes == 1 && $mes_1 == 12 && $numeros[$k]<5)\n {\n $mes_1 = 1;\n $año = $año+1;\n }\n $mes_1 = str_pad($mes_1, 2, \"0\", STR_PAD_LEFT);\n $fecha = $año.\"-\".$mes_1.\"-\".$ano;\n\n //Comprobamos si la hora y la fecha coincide y sumamos 1 al contador\n if($hora['hora']==$i && $hora['fecha'] == $fecha)\n {\n $cont++;\n }\n }\n //Si el cantador sigue en 0 printamos boton ya que significa que no ha sido marcada\n if($cont ==0)\n {\n $total.= \"<button class='horario hvr-grow-shadow'>Marcar</button>\";\n }\n }\n else\n {\n $total.= \"<button class='horario hvr-grow-shadow'>Marcar</button>\";\n }\n $total .=\"<span style='display:none'>\".$numeros[$k].\" \".$i.\":00</span></td>\";\n }\n $total.=\"</tr>\";\n }\n }\n echo $total;\n }",
"public function tableModify()\n {\n }",
"public function tableModify()\n {\n }",
"public function tableModify()\n {\n }",
"public function tableModify()\n {\n }",
"function listarTablaInstancia(){\n\t\t$this->procedimiento='wf.ft_tabla_instancia_sel';\n\t\t$this->transaccion='WF_TABLAINS_SEL';\n\t\t$this->tipo_procedimiento='SEL';//tipo de transaccion\n\t\t\n\t\t$this->setParametro('id_tabla','id_tabla','integer');\n\t\t$this->setParametro('historico','historico','varchar');\n\t\t$this->setParametro('tipo_estado','tipo_estado','varchar');\n\t\t\n\t\t//Definicion de la lista del resultado del query\n\t\t$this->captura('id_' . $_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['bd_nombre_tabla'],'int4');\n\t\t\n\t\tif ($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['atributos']['vista_tipo'] == 'maestro') {\n\t\t\t\t\n\t\t\t$this->captura('estado','varchar');\n\t\t\t$this->captura('id_estado_wf','int4');\n\t\t\t$this->captura('id_proceso_wf','int4');\n\t\t\t$this->captura('obs','text');\n\t\t\t$this->captura('nro_tramite','varchar');\n\t\t}\n\t\t\n\t\tforeach ($_SESSION['_wf_ins_'.$this->objParam->getParametro('tipo_proceso').'_'.$this->objParam->getParametro('tipo_estado')]['columnas'] as $value) {\n\t\t\t\n\t\t\t$this->captura($value['bd_nombre_columna'],$value['bd_tipo_columna']);\t\t\n\t\t\t//campos adicionales\n\t\t\tif ($value['bd_campos_adicionales'] != '' && $value['bd_campos_adicionales'] != null) {\n\t\t\t\t$campos_adicionales = explode(',', $value['bd_campos_adicionales']);\n\t\t\t\t\n\t\t\t\tforeach ($campos_adicionales as $campo_adicional) {\n\t\t\t\t\t\n\t\t\t\t\t$valores = explode(' ', $campo_adicional);\n\t\t\t\t\t$this->captura($valores[1],$valores[2]);\n\t\t\t\t}\n\t\t\t}\t\t\t\n\t\t}\n\t\t\n\t\t\n\t\t$this->captura('estado_reg','varchar');\t\t\n\t\t$this->captura('fecha_reg','timestamp');\n\t\t$this->captura('id_usuario_reg','int4');\n\t\t$this->captura('id_usuario_mod','int4');\n\t\t$this->captura('fecha_mod','timestamp');\n\t\t$this->captura('usr_reg','varchar');\n\t\t$this->captura('usr_mod','varchar');\n\t\t\n\t\t\n\t\t//Ejecuta la instruccion\n\t\t$this->armarConsulta();\n\t\t$this->ejecutarConsulta();\n\t\t\n\t\t//Devuelve la respuesta\n\t\treturn $this->respuesta;\n\t}",
"public function alter(){\n $tabla = '';\n if(!empty($_POST)){\n if( isset( $_POST['agrcol_tabla'] ) ):\n $tabla = $_POST['agrcol_tabla'];\n $col = $_POST['agrcol_col'];\n $after = $_POST['agrcol_after'];\n endif;\n } \n\n if($tabla!=''):\n $inic = $col;\n $tablas = '';\n $type = '';\n $fk = '';\n $creartablas='';\n\n if( stristr($col, '_id' ) ) $tablas = str_replace('_id', '', $col);\n if( stristr($col, '_id' ) ) $type = ' INTEGER(10)'; \n if( stristr($col, '_fecha') ) $type = ' DATE'; \n if( stristr($col, '_nro' ) ) $type = ' INTEGER(10)'; \n if( stristr($col, '_texto') ) $type = ' TEXT'; \n if($type=='') $type = ' VARCHAR(255)'; \n\n $alter = 'ALTER TABLE '.$tabla.' ADD '.$col.' '.$type.' AFTER '.$after.';';\n\n if($tablas!=''):\n $creartablas.= 'CREATE TABLE IF NOT EXISTS '.$tablas.' ( ';\n $creartablas.= ' id_'.$tablas.' INTEGER(10) PRIMARY KEY AUTO_INCREMENT ';\n $creartablas.= ', name_'.$tablas.' VARCHAR(99) ';\n $creartablas.= ', detail_'.$tablas.' VARCHAR(99) ';\n $creartablas.= '); ';\n $alter.= 'ALTER TABLE '.$tabla.' ADD FOREIGN KEY ('.$tablas.'_id) REFERENCES '.$tablas.'(id_'.$tablas.');';\n endif;\n $a = $creartablas.$alter;\n $b = explode(';', $a);\n $re = 'INICIO DE PETICION<BR>#####################';\n $this->db->trans_start();\n foreach ($b as $value) {\n if($value!='')\n $this->db->query($value);\n $re.= \"<BR>Peticion: \".$value.'';\n }\n $this->db->trans_complete();\n $re.= '#####################<br>Fin de las peticiones';\n return $re;\n endif; \n }",
"function saveNewTabla($tabla, $campos, $valores) {\r\n $r = $this->dt->saveNewTabla($tabla, $campos, $valores);\r\n if ($r == 'true') {\r\n $msg = TABLA_AGREGADA;\r\n } else {\r\n $msg = ERROR_ADD_TABLA;\r\n }\r\n\r\n return $msg;\r\n }",
"static public function mdlIngresarVenta($tabla, $datos){\r\n\r\n\t\t\r\n\t}",
"function getRegistrosRelacionamento($tabela_associativa, $tabela_tradicional, $campo_selecao, $campo_comparacao, $value_comparacao){\n\t$sql = \"select $campo_selecao from $tabela_associativa as ta, $tabela_tradicional as tt where ta.cd_$campo_selecao = tt.id_$campo_selecao and ta.$campo_comparacao = $value_comparacao\";\n\t$rs = mysql_query($sql);\n\t\n\t$i = 0;\n\twhile($row = mysql_fetch_array($rs)){\n\t\t$registros[$i] = $row[0];\n\t\t$i++;\n\t}\n\t\n\tif($i == 0) $registros = NULL;\n\t\n\treturn $registros;\n}",
"function add_table( Modyllic_Schema_Table $table ) {\n $this->add['tables'][$table->name] = $table;\n }",
"function evt__efs_lista__modificacion($registros)\n\t{\n\t\t/*\n\t\t\tComo en el mismo request es posible dar una efs de alta y seleccionarla,\n\t\t\ttengo que guardar el ID intermedio que el ML asigna en las efss NUEVAS,\n\t\t\tporque ese es el que se pasa como parametro en la seleccion\n\t\t\t*/\n\t\t$orden = 1;\n\t\tforeach(array_keys($registros) as $id)\n\t\t{\n\t\t\t//Creo el campo orden basado en el orden real de las filas\n\t\t\t$registros[$id]['orden'] = $orden;\n\t\t\t$orden++;\n\t\t\t$accion = $registros[$id][apex_ei_analisis_fila];\n\t\t\tunset($registros[$id][apex_ei_analisis_fila]);\n\t\t\tswitch($accion){\n\t\t\t\tcase 'A':\n\t\t\t\t\t//Por defecto el campo 'columnas' es igual a $this->campo_clave\n\t\t\t\t\t$registros[$id]['columnas'] = $registros[$id][$this->campo_clave];\n\t\t\t\t\t$this->id_intermedio_efs[$id] = $this->get_tabla()->nueva_fila($registros[$id]);\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase 'B':\n\t\t\t\t\t$this->get_tabla()->eliminar_fila($id);\n\t\t\t\t\tbreak;\t\n\t\t\t\tcase 'M':\n\t\t\t\t\t//---Si se cambia un identificador que estaba ligado con us columna se cambia tambien el valor de la columna\n\t\t\t\t\t$anterior_id = $this->get_tabla()->get_fila_columna($id, $this->campo_clave);\n\t\t\t\t\t$anterior_col = $this->get_tabla()->get_fila_columna($id, 'columnas');\n\t\t\t\t\tif ($anterior_id != $registros[$id][$this->campo_clave]) {\n\t\t\t\t\t\tif ($anterior_id == $anterior_col) {\n\t\t\t\t\t\t\t$registros[$id]['columnas'] = $registros[$id][$this->campo_clave];\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$this->get_tabla()->modificar_fila($id, $registros[$id]);\n\t\t\t\t\tbreak;\t\n\t\t\t}\n\t\t}\n\t}",
"function crearTablas(){\n $cnn = new conexion();\n $con = $cnn->conectar();\n mysqli_select_db($con,\"TecLogin\");\n $sql = \"CREATE TABLE usuarios (\n id INT(11) NOT NULL AUTO_INCREMENT,\n usuario CHAR(50),\n contrasena CHAR(50),\n PRIMARY KEY(id)\n )\";\n if(mysqli_query($con,$sql)){\n echo \"Tabla Creada\";\n }\n mysqli_close($con);\n}"
]
| [
"0.64867723",
"0.64000285",
"0.6354618",
"0.6252846",
"0.62464523",
"0.61896104",
"0.6184318",
"0.6182821",
"0.6178235",
"0.6128388",
"0.608475",
"0.60568607",
"0.6023688",
"0.60144013",
"0.5963682",
"0.5963496",
"0.59511846",
"0.5934816",
"0.59129184",
"0.5908268",
"0.58954847",
"0.5877899",
"0.5871888",
"0.58718073",
"0.58475304",
"0.58451426",
"0.5831325",
"0.5816515",
"0.5792538",
"0.57662165",
"0.57412994",
"0.5713536",
"0.57120645",
"0.5709102",
"0.568207",
"0.56672424",
"0.5659128",
"0.5655311",
"0.56502175",
"0.563278",
"0.56216425",
"0.56181777",
"0.561751",
"0.5605979",
"0.5605473",
"0.56010616",
"0.5598882",
"0.5586694",
"0.55762434",
"0.5573707",
"0.55736905",
"0.5555984",
"0.5553212",
"0.55508655",
"0.55418223",
"0.5537737",
"0.5518105",
"0.55176747",
"0.55111253",
"0.5503243",
"0.5499157",
"0.54991126",
"0.549476",
"0.5492723",
"0.5491828",
"0.5483848",
"0.54773444",
"0.54723024",
"0.5471185",
"0.547066",
"0.5467998",
"0.54669863",
"0.545633",
"0.5451138",
"0.5445945",
"0.5444046",
"0.5441766",
"0.5437351",
"0.5434175",
"0.5431677",
"0.5428705",
"0.542463",
"0.541888",
"0.5418574",
"0.54178804",
"0.541726",
"0.5415352",
"0.5414548",
"0.5410444",
"0.5407779",
"0.5407779",
"0.5407779",
"0.5407779",
"0.54055375",
"0.54045844",
"0.5390215",
"0.53897256",
"0.5382128",
"0.5374517",
"0.53678656",
"0.5366993"
]
| 0.0 | -1 |
[edit Funcion para editar registros] | public function edit($id){
if ($id) {
$options = array(
"conditions" => "id=".$id
);
$transaction = $this->transactions->find("transactions","first", $options);
$this->set("transaction", $transaction);
$this->set("accounts", $this->transactions->find("accounts"));
$this->set("categories", $this->transactions->find("categories"));
}
if($_POST){
if ($_POST["operation"] == 'egreso'){
$_POST["amount"] = $_POST["amount"]*(-1);
}
if ($this->transactions->update("transactions", $_POST)){
$this->redirect(
array(
"controller"=>"transactions"
));
}else{
$this->redirect(
array(
"controller"=>"transactions",
"method"=>"edit/".$_POST["id"]
)
);
}
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function editar()\n {\n }",
"public function edit(Registro $registro)\n {\n //\n }",
"public function editar()\n {\n }",
"public function edit()\n\t{\n\t\t//\n\t}",
"public function edit() {\n\t\t\t\n\t\t}",
"public function edit( )\r\n {\r\n //\r\n }",
"public function edit()\n\t{\n\t\t\n\t}",
"public function editReg($id)\n\t{\n\t\t//\n\t}",
"public function edit(Reglement $reglement)\n {\n //\n }",
"public function edit_toko(){\n\t}",
"public function edit(Requierement $requierement)\n {\n //\n }",
"public function editar(){\n\t\t\n\t\t$this->form_validation->set_rules('resposta', 'RESPOSTA', 'trim');\n\t\tif ($this->form_validation->run()==TRUE):\n\t\t$dados = elements(array('resposta'), $this->input->post());\n\t\t$this->Comentarios->do_update($dados, array('id_comentario'=>$this->input->post('idcomentario')));\n\t\tendif;\n\t\tset_tema('titulo', 'Resposta de Comentário');\n\t\tset_tema('conteudo', load_modulo('Comentarios', 'editar'));\n\t\tload_template();\n\t}",
"public function edit()\r\n {\r\n //\r\n }",
"public function edit()\r\n {\r\n //\r\n }",
"public function Edit()\n\t{\n\t\t\n\t}",
"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(retiro $retiro)\n {\n //\n }",
"public function edit(carrera_requisito $carrera_requisito)\n {\n //\n }",
"public function edit()\n {\n \n }",
"public function edit() {\n }",
"public function edit(cr $cr)\n {\n //\n }",
"public function edit(cr $cr)\n {\n //\n }",
"public function edit(cr $cr)\n {\n //\n }",
"public function edit(cr $cr)\n {\n //\n }",
"public function edit(cr $cr)\n {\n //\n }",
"public function edit(Resena $resena)\n {\n //\n }",
"public function editar(){\n if(!isLoggedIn()){\n redirect('usuarios/login');\n }\n //check User Role -- Only ADMINISTRADOR allowed\n if(!checkLoggedUserRol(\"ADMINISTRADOR\")){\n redirect('dashboard');\n }\n \n if($_SERVER['REQUEST_METHOD'] == 'POST'){\n $data = [\n 'especialidadToEditId' => trim($_POST['especialidadToEditId']),\n 'especialidadToEditNombre' => trim($_POST['especialidadToEditNombre'])\n ];\n \n // Validar carga de especialidadToEditId\n if(empty($data['especialidadToEditId'])){\n $data['especialidadToEdit_error'] = 'No se ha seleccionado la especialidad a editar';\n }\n\n // Validar carga de especialidadToEditId\n if(empty($data['especialidadToEditNombre'])){\n $data['especialidadToEdit_error'] = 'No se permite editar a un título vacío';\n }\n\n // Asegurarse que no haya errores\n if(empty($data['especialidadToEdit_error'])){\n // Crear especialidad\n if($this->especialidadModel->actualizarEspecialidad($data)){\n flash('especialidad_success', 'Especialidad editada exitosamente');\n redirect('especialidades');\n }\n else{\n die('Ocurrió un error inesperado');\n }\n }\n else{\n flash('especialidad_error', $data['especialidadToEdit_error'], 'alert alert-danger');\n redirect('especialidades');\n }\n }\n }",
"public function edit()\n {\n }",
"public function edit()\n {\n }",
"public function edit()\n {\n }",
"public function edit()\n {\n \n }",
"public function edit()\n {\n \n }",
"public function edit()\n {\n \n }",
"public function edit(Historia_Clinica_RF $historia_Clinica_RF)\n {\n //\n }",
"public function edit()\n { \n }",
"public function edit()\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 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 account_edit()\n {\n }",
"public function edit() {\n\n }",
"public function edit(){\r\n\t\t//$this->auth->set_access('edit');\r\n\t\t//$this->auth->validate();\r\n\r\n\t\t//call save method\r\n\t\t$this->save();\r\n\t}",
"public function edita()\n\t {\t\n\t\t$id=$_REQUEST['id'];\n\t\t$car=$_REQUEST['car'];\n\t\t$nom=$_REQUEST['nom'];\n\t\t$cod=$_REQUEST['cod'];\n\t\t$niv=$_REQUEST['niv'];\n\t\t$obs=$_REQUEST['obs'];\n\t\t$est=$_REQUEST['est'];\n\t\t\t//$usu=$_REQUEST['usu'];\n\t\t$cur_data=array();\n\t\t$cur_data['id_curso']=$id;\n\t\t$cur_data['id_carrera']=$car;\n\t\t$cur_data['nombre']=$nom;\n\t\t$cur_data['codigo']=$cod;\n\t\t$cur_data['nivel']=$niv;\n\t\t$cur_data['observacion']=$obs;\n\t\t$cur_data['estado']=$est;\n\t\t\n\t\tprint_r($cur_data);\n\t\t$curso=new cursos;\n\t\t$curso->edit($cur_data);\n\t\t$data1=$curso->lista();\n\t\t$this->principal();\n\t }",
"public function actionEdit()\n\t{\n\t\t$field = $this->_getFieldOrError($this->_input->filterSingle('field_id', XenForo_Input::STRING));\n\t\treturn $this->_getFieldAddEditResponse($field);\n\t}",
"public function edit(Frequencia $frequencia)\n {\n //\n }",
"public function edit()\n {\n //\n\t\treturn 'ini halaman edit';\n }",
"function EDIT()\n{\n\t$comprobar = $this->comprobar_atributos(); //Busca si la tupla es correcta o tiene algun error\n\n\tif($comprobar == true)\n\t{\n\t\t$sql = \"UPDATE USUARIOS\n\t\t\t\tSET \n\t\t\t\t\tpassword = '$this->password',\n\t\t\t\t\tDNI = '$this->DNI',\n\t\t\t\t\tnombre = '$this->nombre',\n\t\t\t\t\tapellidos = '$this->apellidos',\n\t\t\t\t\ttelefono = '$this->telefono',\n\t\t\t\t\temail = '$this->email',\n\t\t\t\t\tFechaNacimiento = '$this->FechaNacimiento',\n\t\t\t\t\tfotopersonal = '$this->fotopersonal',\n\t\t\t\t\tsexo = '$this->sexo'\n\t\t\t\tWHERE (\n\t\t\t\t\tlogin = '$this->login'\n\t\t\t\t)\n\t\t\t\t\";\n\n\t\tif ($this->mysqli->query($sql))\n\t\t{\n\t\t\t$resultado = 'Actualización realizada con éxito';\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$resultado = 'Error de gestor de base de datos';\n\t\t}\n\t\treturn $resultado;\n\t}\n\telse{\n\t\treturn $comprobar;\n\t}\n}",
"function procEdit($ar=NULL){\n $this->getComposedFullnam($ar);\n return parent::procEdit($ar);\n }",
"public function edit(carrito $carrito)\n {\n //\n }",
"public function Editar(){\n \n // Istancia a classe \"Funcionario\" do arquivo \"funcionario_class\".\n $funcionario = new Funcionario();\n $endereco = new Endereco();\n \n // Pega o id do registro e os demais dados para fazer uma atualização do mesmo.\n // Variáevis do funcionário.\n $funcionario->idFuncionario = $_GET['id'];\n $funcionario->nome = $_POST['txt_nome'];\n $funcionario->sobrenome = $_POST['txt_sobrenome'];\n $funcionario->rg = $_POST['txt_rg'];\n $funcionario->cpf = $_POST['txt_cpf'];\n $funcionario->usuario = $_POST['txt_usuario'];\n $funcionario->senha = $_POST['txt_senha'];\n $funcionario->idNivelFuncionario = $_POST['cbx_nivelFuncionario'];\n $funcionario->idEndereco = $_GET['idEnd'];\n // Variáveis do endereço do funcionário.\n $endereco->bairro = $_POST['txt_bairro'];\n $endereco->logradouro = $_POST['txt_logradouro'];\n $endereco->cep = $_POST['txt_cep'];\n $endereco->cidade = $_POST['cbx_cidade'];\n $endereco->idEndereco = $_GET['idEnd'];\n \n // Chama o metodo para atualizar o endereço do funcionário.\n $sucess = $endereco::Update($endereco);\n \n // Chama o metodo para atualizar o funcionário apenas se a atualização do endereço dele foi bem sucedida.\n if($sucess == 1){\n $funcionario::Update($funcionario);\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(FamilleProduit $familleProduit)\n {\n //\n }",
"public function editar() {\n\t\t$POST = array();\n\n\t\t\t##apagando indice de tokenrequest pois ele não existe na tabela de categorias\n\t\tunset($this->request->data['TokenRequest']);\t\n\n\t\t$POST = array('UsuarioCliente'=>$this->request->data);\t\n\t\tif ($this->UsuarioCliente->save($POST)) \n\t\t{\n\t\t\t$this->Message = 'Usuario editado com sucesso';\n\t\t\t$this->Return = true;\t\n\t\t} \n\n\t\telse \n\t\t{\n\t\t\t$this->Message = 'Ocorreu um erro na edição de seu Usuario.';\n\t\t\t$this->Return = false;\t\n\t\t}\n\n\t\t$this->EncodeReturn();\t\n\t}",
"public function editar()\n {\n if ( isset($_GET['recno']) && !empty($_GET['recno']) )\n {\n $SA1 = $this->objPDO->prepare('SELECT * FROM SA1010 WHERE R_E_C_N_O_ = :recno');\n $SA1->bindValue(':recno', $_GET['recno']);\n $SA1->execute();\n \n return $SA1->fetchAll();\n }\n else if ( isset($_POST['nome']) && !empty($_POST['nome']) )\n {\n $SA1 = $this->objPDO->prepare('UPDATE SA1010 SET A1_NOME = :nome, A1_NREDUZ = :nreduz, A1_MUN = :cidade WHERE R_E_C_N_O_ = :recno');\n $SA1->bindValue(':nome', $_POST['nome']);\n $SA1->bindValue(':nreduz', $_POST['nreduz']);\n $SA1->bindValue(':cidade', $_POST['cidade']);\n $SA1->bindValue(':recno', $_POST['recno']);\n $SA1->execute();\n }\n \n header('Location: /'); \n }",
"public function edit(Revisi $revisi)\n {\n //\n }",
"function EDIT() {\n\t\t// se construye la sentencia de busqueda de la tupla en la bd\n\t\t$sql = \"SELECT * FROM ENTREGA WHERE (login = '$this->login' AND IdTrabajo = '$this->IdTrabajo')\";\n \n\t\t// Variable que almacena la sentencia sql\n\t\t$result = $this->mysqli->query( $sql );\n\t\t// si el numero de filas es igual a uno es que lo encuentra\n\t\tif ( $result->num_rows == 1 ) { // se construye la sentencia de modificacion en base a los atributos de la clase\n\t\t\t//Si la ruta no es vacia actualiza la entrega\n if($this->Ruta <> null){\n //Variable que almacena la sentencia sql\n\t\t\t\t$sql = \"UPDATE ENTREGA SET \n\t\t\t\t\tlogin = '$this->login',\n\t\t\t\t\t IdTrabajo='$this->IdTrabajo',\n Alias='$this->Alias',\n Horas='$this->Horas',\n Ruta='$this->Ruta'\n\t\t\t\tWHERE ( login = '$this->login' AND IdTrabajo = '$this->IdTrabajo'\n\t\t\t\t)\";//se construye la sentencia sql de modificacion\n\n }\n //Si la ruta es vacia\n else{\n //Variable que almacena la sentencia sql\n $sql = \"UPDATE ENTREGA SET \n\t\t\t\t\tlogin = '$this->login',\n\t\t\t\t\t IdTrabajo='$this->IdTrabajo',\n Alias='$this->Alias',\n Horas='$this->Horas'\n\t\t\t\tWHERE ( login = '$this->login' AND IdTrabajo = '$this->IdTrabajo'\n\t\t\t\t)\";//se construye la sentencia sql de modificacion\n \n }\n\t\t\t// si hay un problema con la query se envia un mensaje de error en la modificacion\n\t\t\tif ( !( $resultado = $this->mysqli->query( $sql ) ) ) {\n\t\t\t\treturn 'Error en la modificación';\n\t\t\t}\n \n // si no hay problemas con la modificación se indica que se ha modificado\n else { \n\t\t\t\treturn 'Modificado correctamente';\n\t\t\t}\n // si no se encuentra la tupla se manda el mensaje de que no existe la tupla\n\t\t} else \n\t\t\treturn 'No existe en la base de datos';\n\t}",
"public function editar ()\n {\n try {\n // Define a ação de editar\n $acao = Orcamento_Business_Dados::ACTION_EDITAR;\n \n if ( $this->_requisicao->isGet () ) {\n // Retorna parâmetros informados via get, após validações\n $parametros = $this->trataParametroGet ( 'cod' );\n \n // Busca os dados a exibir, após validações\n $registro = $this->trataRegistro ( $acao, $parametros );\n \n // Cria o formulário populado com os dados\n $formulario = $this->popularFormulario ( $acao, $registro );\n \n // Faz transformações no formulário, se necessário\n $formulario = $this->transformaFormulario ( $formulario, $acao );\n \n // Bloqueia a edição de campos de chave primária (ou composta)\n $this->bloqueiaCamposChave ( $formulario );\n \n // Bloqueia todos os campos\n $this->bloqueiaCamposTodos ( $acao, $formulario, $registro );\n \n // Exibe o formulário\n $this->view->formulario = $formulario;\n } else {\n // Cria o formulário vazio\n $formulario = $this->retornaFormulario ( $acao );\n \n // Grava o novo registro\n $this->gravaDados ( $acao, $formulario );\n }\n } catch ( Exception $e ) {\n // Gera o erro\n throw new Zend_Exception ( $e->getMessage () );\n }\n }",
"public function edit(Compras $compras)\n {\n //\n }",
"public function edit(Compras $compras)\n {\n //\n }",
"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 edit(Register $register)\n {\n //\n }",
"public function edit(Register $register)\n {\n //\n }",
"public function edit(Prueva $prueva)\n {\n //\n }",
"public function edit(Riesgo_evento $riesgo_evento)\n {\n //\n }",
"function EDIT()\n{\n\t// se construye la sentencia de busqueda de la tupla en la bd\n $sql = \"SELECT * FROM PAREJA WHERE (idpareja= $this->idpareja)\";\n // se ejecuta la query\n $result = $this->mysqli->query($sql);\n // si el numero de filas es igual a uno es que lo encuentra\n if ($result->num_rows == 1)\n {\t// se construye la sentencia de modificacion en base a los atributos de la clase\n\t\t$sql = \"UPDATE PAREJA SET \n\t\t\t\t\tlogin1 = '$this->login1',\n\t\t\t\t\tlogin2 = '$this->login2'\t\t\t\n\t\t\t\tWHERE ( idpareja = $this->idpareja\n\t\t\t\t)\";\n\n\t\n\t\t// si hay un problema con la query se envia un mensaje de error en la modificacion\n if (!($resultado = $this->mysqli->query($sql))){\n\t\t\treturn 'Error en la modificación de la pareja.'; \n\t\t}\n\t\telse{ \n\t\t\treturn 'Pareja modificada correctamente.';\n\t\t\t\n\t\t}\n }\n else // si no se encuentra la tupla se manda el mensaje de que no existe la tupla\n \treturn 'No existe la pareja en la base de datos';\n}",
"public function action_personEdit() {\r\n // 1. walidacja id osoby do edycji\r\n if ($this->validateEdit()) {\r\n try {\r\n // 2. odczyt z bazy danych osoby o podanym ID (tylko jednego rekordu)\r\n $record = App::getDB()->get(\"person\", \"*\", [\r\n \"id\" => $this->form->id\r\n ]);\r\n // 2.1 jeśli osoba istnieje to wpisz dane do obiektu formularza\r\n $this->form->id = $record['id'];\r\n $this->form->name = $record['name'];\r\n $this->form->surname = $record['surname'];\r\n $this->form->birthdate = $record['birthdate'];\r\n $this->form->jobTitle = $record['job_title'];\r\n $this->form->jobPlace = $record['job_place'];\r\n $this->form->userName = $record['user_name'];\r\n $this->form->role = $record['role'];\r\n } catch (\\PDOException $e) {\r\n Utils::addErrorMessage('Wystąpił błąd podczas odczytu rekordu');\r\n if (App::getConf()->debug)\r\n Utils::addErrorMessage($e->getMessage());\r\n }\r\n }\r\n\r\n // 3. Wygenerowanie widoku\r\n $this->generateView();\r\n }",
"public function edit(Carrinho $carrinho)\n {\n //\n }",
"public function editar(){\n $cedula = $_GET['cedula'];\n //2. usar el modelo para traer de la BD el estudiante\n $estudiante = $this->model->buscarEstudiante($cedula);\n //3. llamar a la vista de editar\n require_once 'view/include/header.php';\n require_once 'view/estudiante/editar.php';\n require_once 'view/include/footer.php';\n }",
"public function edit(Curso $curso)\n {\n //\n }",
"public function edit(Curso $curso)\n {\n //\n }",
"function EDIT(){\r\n $stmt = $this->db->prepare(\"UPDATE edificio SET\r\n nombre_edif = ?, telef_edif = ?, agrup_edificio = ?\r\n\t\t\t\t\tWHERE edificio_id = ?\");\r\n $resultado = $stmt->execute(array($this->nombre_edif, $this->telef_edif, $this->agrup_edificio,\r\n $this->edificio_id));\r\n\r\n if($resultado === true){\r\n return true;\r\n }else{\r\n return 'Error inesperado al intentar cumplir su solicitud de modificacion';\r\n }\r\n }",
"public function edit(Renta $renta)\n {\n //\n }",
"function edit_info()\n\t{\n\t\tif ($this->ipsclass->input['id'] == \"\")\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Невозможно определить ID языка\");\n\t\t}\n\n\t\t//-----------------------------------------\n\n\t\t$this->ipsclass->DB->simple_construct( array( 'select' => '*', 'from' => 'languages', 'where' => \"lid='\".$this->ipsclass->input['id'].\"'\" ) );\n\t\t$this->ipsclass->DB->simple_exec();\n\n\t\tif ( ! $row = $this->ipsclass->DB->fetch_row() )\n\t\t{\n\t\t\t$this->ipsclass->admin->error(\"Невозможно найти язык по введенному ID\");\n\t\t}\n\n\t\t$final['lname'] = stripslashes($_POST['lname']);\n\n\t\tif (isset($_POST['lname']))\n\t\t{\n\t\t\t$final['lauthor'] = stripslashes($_POST['lauthor']);\n\t\t\t$final['lemail'] = stripslashes($_POST['lemail']);\n\t\t}\n\n\t\t$this->ipsclass->DB->do_update( 'languages', $final, \"lid='\".$this->ipsclass->input['id'].\"'\" );\n\n\t\t$this->rebuild_cache();\n\n\t\t$this->ipsclass->admin->done_screen(\"Языковой модуль обновлен\", \"Управление языками\", \"{$this->ipsclass->form_code}\" );\n\n\t}",
"function doEdit()\n {\n global $_POST;\n$regs=explode(\":::\",$_POST[\"DROWS\"]);\n$id= $regs[0];\n if (strlen($id) <= 0)\n {\n echo \"Nao existe valores a serem editados\";\n echo \"<a href=./cadastra.php>Voltar</a> \";\n exit();\n }\n$result = lookup($id);\n\n presentInputForm(\n mysql_result($result, 0, \"id\"),\n mysql_result($result, 0, 1),\n mysql_result($result, 0, 2),\n mysql_result($result, 0, 3),\n mysql_result($result, 0, 4),\n mysql_result($result, 0, 5),\n mysql_result($result, 0, 6),\n mysql_result($result, 0, 7),\n mysql_result($result, 0, 8),\n mysql_result($result, 0, 9),\n mysql_result($result, 0, 10),\n mysql_result($result, 0, 11),\n\"E\");\n }",
"public function edit(Faltas_Obra $faltas_Obra)\n {\n //\n }",
"public function edit(Rcfa $rcfa)\n {\n //\n }",
"function a_edit() {\n\t\tif (isset($_POST[\"btSubmit\"])) {\n\t\t\t$_POST['use_passw']=password_hash($_POST['use_passw'], PASSWORD_DEFAULT);\n\t\t\t$u=new User();\n\t\t\t$u->chargerDepuisTableau($_POST);\n\t\t\t$u->sauver();\n\t\t\theader(\"location:index.php?m=documents\");\n\t\t} else {\t\t\t\t\n\t\t\t$id = isset($_GET[\"id\"]) ? $_GET[\"id\"] : 0;\n\t\t\t$u=new User($id);\n\t\t\textract($u->data);\t\n\t\t\trequire $this->gabarit;\n\t\t}\n\t}",
"function edit($param) {\n extract($param);\n $sql = \"UPDATE operario SET fk_usuario='$id_usuario', nombres='$nombres', apellidos='$apellidos' WHERE fk_usuario='$id_usuario';\n UPDATE usuario SET id_usuario='$id_usuario', direccion='$direccion', telefonos='$telefonos', correos='$correos', contrasena='$contrasena' WHERE id_usuario = '$id_usuario'; \"; // <-- el ID de la fila asignado en el SELECT permite construir la condición de búsqueda del registro a modificar\n $conexion->getPDO()->exec($sql);\n echo $conexion->getEstado();\n }",
"function editar_operador(){\t\t\n\t\t$this->accion=\"Editando Datos del Operador\";\n\t\tif (isset($_POST['envio']) && $_POST['envio']==\"Guardar\" && isset($_GET['id']) && $_GET['id']!=\"\"){\n\t\t\t$id=$_GET['id'];\n\t\t\t$this->asignar_valores();\n\t\t\t$sql=\"UPDATE operador SET cantidad_op='$this->cantidad', nombre_op='$this->nombre', apellido_op='$this->apellido', cedula_op='$this->cedula' WHERE id_op='$id'\";\n\t\t\t$consulta=mysql_query($sql) or die(mysql_error());\n\t\t\theader(\"location:/admin/operador/\");\n\t\t}else{\n\t\t\t\n\t\t\t$this->mostrar_operador();\n\t\t\t\n\t\t}\n\t\t\n\t}",
"public function editAction() {}",
"function EDIT()\r\n{\r\n\t// se construye la sentencia de busqueda de la tupla en la bd\r\n $sql = \"SELECT * FROM NOTICIA WHERE (idNoticia = '$this->idNoticia')\";\r\n // se ejecuta la query\r\n $result = $this->mysqli->query($sql);\r\n // si el numero de filas es igual a uno es que lo encuentra\r\n if ($result->num_rows == 1)\r\n {\t// se construye la sentencia de modificacion en base a los atributos de la clase\r\n\t\t$sql = \"UPDATE NOTICIA SET \r\n\t\t\t\t\tidNoticia = '$this->idNoticia',\r\n\t\t\t\t\timageURL = '$this->imageURL',\r\n\t\t\t\t\tenlace = '$this->enlace',\r\n\t\t\t\t\ttexto = '$this->texto'\t\t\t\t\t\r\n\t\t\t\tWHERE ( idNoticia = '$this->idNoticia')\";\r\n\t\t// si hay un problema con la query se envia un mensaje de error en la modificacion\r\n if (!($resultado = $this->mysqli->query($sql))){\r\n\t\t\treturn 'Error en la modificación'; \r\n\t\t}\r\n\t\telse{ \r\n\t\t\treturn 'Modificado correctamente.';\r\n\t\t\t\r\n\t\t}\r\n }\r\n else // si no se encuentra la tupla se manda el mensaje de que no existe la tupla\r\n \treturn 'No existe en la base de datos';\r\n}",
"function actualizar_registro($id, $descripcion, $tipo){\n\t\techo $id; \n\t\techo $descripcion;\n\t\t$consulta = $this->db->query(\"UPDATE ab_expediente SET Tipo='$tipo', Descripcion = '$descripcion' WHERE IdExpediente = '$id' LIMIT 1\");\n\t\t\n\t\treturn $consulta;\n\t}",
"public function edit(Trabalho $trabalho)\n {\n //\n }",
"public function edit(Pelicula $pelicula)\n {\n //\n }",
"public function edit(Ruta $ruta)\n {\n //\n }",
"public function edit(Trabajo $trabajo)\n {\n //\n }",
"public function edit(Compra $compra)\n {\n //\n }"
]
| [
"0.7759354",
"0.7608234",
"0.7478287",
"0.7462846",
"0.74521756",
"0.7399484",
"0.73833764",
"0.73407257",
"0.72328436",
"0.71796143",
"0.7144204",
"0.7114781",
"0.70901287",
"0.70901287",
"0.7087006",
"0.7063223",
"0.7033311",
"0.7027941",
"0.701613",
"0.69861746",
"0.6982748",
"0.6982748",
"0.6982748",
"0.6982748",
"0.6982748",
"0.69815224",
"0.698132",
"0.6973141",
"0.6973141",
"0.6973141",
"0.69482565",
"0.69482565",
"0.69482565",
"0.6937983",
"0.6929327",
"0.69008887",
"0.6896651",
"0.68763626",
"0.68763626",
"0.68763626",
"0.68763626",
"0.68763626",
"0.68763626",
"0.68763626",
"0.68763626",
"0.68763626",
"0.68763626",
"0.68763626",
"0.68763626",
"0.68728155",
"0.6860575",
"0.68593293",
"0.6842228",
"0.6835782",
"0.6834144",
"0.6833826",
"0.6828358",
"0.6822698",
"0.6820063",
"0.68196",
"0.6813757",
"0.6813757",
"0.6813757",
"0.6813757",
"0.6813544",
"0.6795506",
"0.67910874",
"0.67805654",
"0.67545295",
"0.6745345",
"0.6739253",
"0.67383397",
"0.67383397",
"0.6735482",
"0.6725438",
"0.6725438",
"0.67215246",
"0.6704052",
"0.6686675",
"0.6678506",
"0.66744107",
"0.66737705",
"0.66631204",
"0.66631204",
"0.6653199",
"0.6649932",
"0.66485834",
"0.66478276",
"0.66469276",
"0.6641954",
"0.6641876",
"0.6640253",
"0.66350174",
"0.66298133",
"0.6627303",
"0.6627151",
"0.662285",
"0.66194385",
"0.66180927",
"0.6612646",
"0.6608929"
]
| 0.0 | -1 |
[delete funcion para eliminar registros] | public function delete($id){
$conditions = "id=".$id;
if( $this->transactions->delete("transactions",$conditions)){
$this->redirect(array("controller"=>"transactions"));
}else{
$this->redirect(array("controller"=>"transactions","method"=>"add"));
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function delete() ;",
"function delete() ;",
"function EliminarMascotas($nombres, $primer_apellido, $segundo_apellido, $fehca_nacimiento, $lugar_nacimiento, $iddepartamento, $idmunicipio, $telefono_casa, $celular, $direccion, $foto){\n $conexion = Conectar();\n $sql = \"DELETE FROM padrinos WHERE id=:id\";\n $statement = $conexion->prepare($sql);\n $statement->bindParam(':idpadrinos', $idpadrinos);\n $statement->execute();\n $statement->setFetchMode(PDO::FETCH_ASSOC);\n $res=$statement->fetchAll();\n return $res;\n}",
"public function Eliminar()\n {\n $sentenciaSql = \"DELETE FROM \n detalle_orden \n WHERE \n id_detalle_orden = $this->idDetalleOrden\";\n $this->conn->preparar($sentenciaSql);\n $this->conn->ejecutar();\n }",
"public function eliminar($objeto){\r\n\t}",
"function eliminaRuta()\r\n\t{\r\n\t\t$query = \"DELETE FROM \" . self::TABLA . \" WHERE IdRuta = \".$this->IdRuta.\";\";\r\n\t\treturn parent::eliminaRegistro( $query);\r\n\t}",
"function eliminar()\n{\n\t$sql=\"delete FROM slc_unid_medida WHERE id_unid_medida ='$this->cod'\";\n\t\t$result=mysql_query($sql,$this->conexion);\n\t\tif ($result) \n\t\t\t return true;\n\t\telse\n\t\t\t return false;\n\t\n}",
"function Eliminar(){\n\t \n\t $this->Model->Eliminar($_GET['id']);\n\t\t\n\t }",
"public function eliminar ($idpersona)\n\t{\n\t\t$sql=\"DELETE FROM persona WHERE idpersona='$idpersona';\";\n/*echo \"<pre><br>Elin¡minas:<br>\";\nprint_r($sql);\necho \"</pre>\";\ndie();*/\n\t\treturn ejecutarConsulta($sql);\n\t}",
"function borrar_opciones(){\n $tuplas = $this->references(\"opcion\");\n foreach($tuplas as $valor){\n $eliminar=$this->Connection->DB->get_object_by_id(\"opcion\", $valor->id_opcion);\n $eliminar->delete();\n }\n }",
"function eliminar_autonomo()\n\t{\n\t\ttry {\n\t\t\t$this->db->abrir_transaccion();\n\t\t\t$this->db->retrasar_constraints();\n\t\t\t$this->eliminar();\n\t\t\t$this->db->cerrar_transaccion();\n\t\t\t$this->manejador_interface->mensaje(\"El proyecto '{$this->identificador}' ha sido eliminado\");\n\t\t} catch ( toba_error $e ) {\n\t\t\t$this->db->abortar_transaccion();\n\t\t\t$this->manejador_interface->error( \"Ha ocurrido un error durante la eliminacion de TABLAS de la instancia:\\n\".\n\t\t\t\t\t\t\t\t\t\t\t\t$e->getMessage() );\n\t\t}\n\t}",
"public function remove();",
"public function remove();",
"public function remove();",
"public function remove();",
"public function remover()\n\t{\n\t\t$sql = \"DELETE FROM $this->tabela WHERE $this->chave_primaria = :id\";\n\n\t\t$this->resultado = $this->conn->prepare($sql);\n\t\t$this->resultado->bindValue(':id', $this->id);\n\n\t\treturn $this->resultado->execute();\n\t}",
"function opcion__eliminar()\n\t{\n\t\t$id_proyecto = $this->get_id_proyecto_actual();\n\t\tif ( $id_proyecto == 'toba' ) {\n\t\t\tthrow new toba_error(\"No es posible eliminar el proyecto 'toba'\");\n\t\t}\n\t\ttry {\n\t\t\t$p = $this->get_proyecto();\n\t\t\tif ( $this->consola->dialogo_simple(\"Desea ELIMINAR los metadatos y DESVINCULAR el proyecto '\"\n\t\t\t\t\t.$id_proyecto.\"' de la instancia '\"\n\t\t\t\t\t.$this->get_id_instancia_actual().\"'\") ) {\n\t\t\t\t$p->eliminar_autonomo();\n\t\t\t}\n\t\t} catch (toba_error $e) {\n\t\t\t$this->consola->error($e->__toString());\n\t\t}\n\t\t$this->get_instancia()->desvincular_proyecto( $id_proyecto );\n\t}",
"public function Eliminar(){\n\t\t\t$enlace = AccesoBD::Conexion();\n\n\t\t\t$sql = \"DELETE FROM denuncia WHERE ID_DENUNCIA = '$this->idDenuncia'\";\n\n\t\t\tif ($enlace->query($sql) !== TRUE) {\n \t\t\techo \"Error al eliminar la denuncia\";\n \t\t\texit();\n\t\t\t}\n\t\t\techo \"Denuncia eliminada\";\n\t\t}",
"function eliminarTipoDeMatricula($id){\n \t$pdo = DatabaseCao::connect();\n mysql_query(\"DELETE FROM ca_tipo_matricula WHERE id = ? ;\");\n $sql = \"DELETE FROM ca_tipo_matricula WHERE id = ?\";\n $q = $pdo->prepare($sql);\n $q->execute(array($id));\n DatabaseCao::disconnect();\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 eliminar()\n\t{\n\t\textract($_REQUEST);\n\t\t$db=new clasedb;\n\t\t$conex=$db->conectar();\n\t\t$sql=\"DELETE FROM asistencias WHERE id=\".$id_asistencias;\n\t\t\n\t$res=mysqli_query($conex,$sql);\n\t\tif ($res) {\n\t\t\t?>\n\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\talert(\"Registro eliminado\");\n\t\t\t\t\twindow.location=\"ControlA.php?operacion=index\";\n\t\t\t\t</script>\n\t\t\t<?php\n\t\t} else {\n\t\t\t?>\n\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\talert(\"Registro no pudo ser eliminado, Vuelva a intentarlo!\");\n\t\t\t\t\twindow.location=\"ControlA.php?operacion=index\";\n\t\t\t\t</script>\n\t\t\t<?php\n\t\t}\n\t}",
"function deletedrvs($val1,$val2)\t// elimina la identificacion\n\t{\n $obj_Gurpo=new Conexion();\n $query=\"delete from derivacion where id_exp=$val1 and id_drv=$val2\";\n\t\t\t$obj_Gurpo->consulta($query); // ejecuta la consulta para borrar la identificacion\n\t\t\treturn '<div id=\"mensaje\"><p/><h4>Se elimino la derivación con exito</h4></div>'; // retorna todos los registros afectados\n\n }",
"public function eliminar(){\n if(!isLoggedIn()){\n redirect('usuarios/login');\n }\n //check User Role -- Only ADMINISTRADOR allowed\n if(!checkLoggedUserRol(\"ADMINISTRADOR\")){\n redirect('dashboard');\n }\n\n if($_SERVER['REQUEST_METHOD'] == 'POST'){\n $data = [\n 'especialidadToDelete' => trim($_POST['especialidadToDelete'])\n ];\n \n // Validar carga de especialidadToDelete\n if(empty($data['especialidadToDelete'])){\n $data['especialidadToDelete_error'] = 'No se ha seleccionado la especialidad a eliminar';\n }\n\n // Asegurarse que no haya errores\n if(empty($data['especialidadToDelete_error'])){\n // Crear especialidad\n if($this->especialidadModel->eliminarEspecialidad($data['especialidadToDelete'])){\n flash('especialidad_success', 'Especialidad eliminada exitosamente');\n redirect('especialidades');\n }\n else{\n die('Ocurrió un error inesperado');\n }\n }\n else{\n flash('especialidad_error', $data['especialidadToDelete_error'], 'alert alert-danger');\n redirect('especialidades');\n }\n }\n }",
"public function eliminarAction()\n {\n $this->disableAutoRender();\n\n /* Recibo la lista de Ids separado por comas */\n $idList = $this->_getParam('id');\n\n if ($idList) {\n /* Convierto la lista a un Array */\n $idArray = explode (\",\", $idList);\n\n /* Recorro el array eliminando cada Id */\n foreach ($idArray as $id) {\n try {\n $resultado = $this->_modeloMovimiento->eliminar($id, $this->_usuario);\n \n if($resultado == 0) { /* Si no se eliminó */\n echo 'error|No está autorizado a eliminar este registro'; \n exit;\n }\n \n \n } catch(Exception $ex) {\n $message = $ex->getMessage();\n echo 'error|'.$message;\n }\n }\n }\n }",
"public function eliminar() {\n\t\t\n\t\t\n\t\t$juradodni = $_GET[\"dniJurado\"];\n\t\t\n\t\t$this -> JuradoMapper -> delete($juradodni);\n\n\t\t\n\t\t$this -> view -> redirect(\"jurado\", \"listar\");\n\t\t//falta cambiar\n\t}",
"function eliminarRuta($id) {\n $sql = \"DELETE FROM ruta WHERE id='\" . $id . \"'\";\n $con = new DB();\n $result = $con->exec($sql);\n $con = null;\n }",
"function del($ar) {\n if(parent::del($ar)) {\n $p = new XParam($ar, array());\n $oid = $p->get('oid');\n // suppression des abonnements\n updateQuery(\"delete from OPTS where user like '$oid'\");\n // suppression des regles de secuite inutiles\n updateQuery(\"delete from ACL4 where AGRP like '$oid'\");\n // suppression des enregistrements dans les logs\n XArchives::appendOid($oid, 'LOGS.user', true);\n XArchives::appendOid($oid, 'LOGS.object', true);\n if(!empty($GLOBALS['XLOCK'])) {\n\t$GLOBALS['XLOCK']->cleanLocksForUser($oid);\n }\n }\n }",
"public function eliminar() {\n //$this->delete();\n $campo_fecha_eliminacion = self::DELETED_AT;\n $this->$campo_fecha_eliminacion = date('Y-m-d H:i:s');\n $this->status = 0;\n $this->save();\n }",
"function removeRegistro($id) {\n GLOBAL $con;\n\n //busca info\n $querybusca = \"select * from kardexs where id='\" . $id . \"'\";\n $qry = mysql_query($querybusca);\n $linha = mysql_fetch_assoc($qry);\n\n //Apagua\n $query = \"delete from kardexs where id='\" . $id . \"'\";\n mysql_query($query, $con) or die(mysql_error());\n\n if (saldoExiste($linha['produto_id'], $linha['estoque_id'])) {\n //atualiza retirando saldo\n $saldoAtual = saldoByEstoque($linha['produto_id'], $linha['estoque_id']);\n if ($linha['sinal'] == '+') {\n $saldoAtual_acerto = $saldoAtual - $linha['qtd'];\n } else {\n $saldoAtual_acerto = $saldoAtual + $linha['qtd'];\n }\n\n\n saldo_atualiza($linha['produto_id'], $linha['estoque_id'], $saldoAtual_acerto);\n }\n}",
"function Eliminar()\n{\n /**\n * Se crea una instanica a Concesion\n */\n $Concesion = new Titulo();\n /**\n * Se coloca el Id del acuifero a eliminar por medio del metodo SET\n */\n $Concesion->setId_titulo(filter_input(INPUT_GET, \"ID\"));\n /**\n * Se manda a llamar a la funcion de eliminar.\n */\n echo $Concesion->delete();\n}",
"abstract public function mass_remove();",
"function supprimer1($connexion,$nomTable,$nomClePrimaire,$valeurClePrimaire) { \n $req =$connexion -> query(\"DELETE FROM $nomTable WHERE $nomClePrimaire = '$valeurClePrimaire'\");\n }",
"public function EliminarDetallesCompras()\n{\n\tif($_SESSION['acceso'] == \"administrador\") {\n\n\t\tself::SetNames();\n\t\t$sql = \" select * from detallecompras where codcompra = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codcompra\"])) );\n\t\t$num = $stmt->rowCount();\n\t\tif($num > 1)\n\t\t{\n\n\t\t\t$sql = \" delete from detallecompras where coddetallecompra = ? \";\n\t\t\t$stmt = $this->dbh->prepare($sql);\n\t\t\t$stmt->bindParam(1,$coddetallecompra);\n\t\t\t$coddetallecompra = base64_decode($_GET[\"coddetallecompra\"]);\n\t\t\t$stmt->execute();\n\n################ VERIFICAMOS SI EL TIPO DE ENTRADA ES UN INGREDINTE ###################\n\tif($_POST['tipoentrada']==\"INGREDIENTE\"){\n\n\t\t$sql2 = \"select cantingrediente from ingredientes where cantingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[] = $row;\n\t\t}\n\t\t$existenciadb = $p[0][\"cantingrediente\"];\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexingredientes where codprocesoing = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codcompra);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$stmt->execute();\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t$sql = \" update ingredientes set \"\n\t\t.\" cantingrediente = ? \"\n\t\t.\" where \"\n\t\t.\" codingrediente = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $existencia);\n\t\t$stmt->bindParam(2, $codproducto);\n\t\t$cantcompra = strip_tags(base64_decode($_GET[\"cantcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$existencia = $existenciadb - $cantcompra;\n\t\t$stmt->execute();\n\n################ VERIFICAMOS SI EL TIPO DE ENTRADA ES UN PRODUCTO ###################\n\t\t\t} else {\n\n\t\t$sql2 = \"select existencia from productos where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[] = $row;\n\t\t}\n\t\t$existenciadb = $p[0][\"existencia\"];\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexproductos where codproceso = ? and codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codcompra);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$stmt->execute();\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t$sql = \" update productos set \"\n\t\t.\" existencia = ? \"\n\t\t.\" where \"\n\t\t.\" codproducto = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $existencia);\n\t\t$stmt->bindParam(2, $codproducto);\n\t\t$cantcompra = strip_tags(base64_decode($_GET[\"cantcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$existencia = $existenciadb - $cantcompra;\n\t\t$stmt->execute();\n\n\t\t\t}\n\n\t\t$sql4 = \"select * from compras where codcompra = ? \";\n\t\t$stmt = $this->dbh->prepare($sql4);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codcompra\"])));\n\t\t$num = $stmt->rowCount();\n\n\t\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t\t{\n\t\t\t\t$paea[] = $row;\n\t\t\t}\n\t\t$subtotalivasic = $paea[0][\"subtotalivasic\"];\n\t\t$subtotalivanoc = $paea[0][\"subtotalivanoc\"];\n\t\t$iva = $paea[0][\"ivac\"]/100;\n\t\t$descuento = $paea[0][\"descuentoc\"]/100;\n\t\t$totalivac = $paea[0][\"totalivac\"];\n\t\t$totaldescuentoc = $paea[0][\"totaldescuentoc\"];\n\n\t$sql3 = \"select sum(importecompra) as importe from detallecompras where codcompra = ? and ivaproductoc = 'SI'\";\n $stmt = $this->dbh->prepare($sql3);\n $stmt->execute( array(base64_decode($_GET[\"codcompra\"])));\n $num = $stmt->rowCount();\n \n if($rowp = $stmt->fetch())\n {\n $p[] = $rowp;\n }\n $importeivasi = ($rowp[\"importe\"]== \"\" ? \"0\" : $rowp[\"importe\"]);\n\n$sql5 = \"select sum(importecompra) as importe from detallecompras where codcompra = ? and ivaproductoc = 'NO'\";\n $stmt = $this->dbh->prepare($sql5);\n $stmt->execute( array(base64_decode($_GET[\"codcompra\"])));\n $num = $stmt->rowCount();\n \n if($roww = $stmt->fetch())\n {\n $pw[] = $roww;\n }\n $importeivano = ($roww[\"importe\"]== \"\" ? \"0\" : $roww[\"importe\"]);\n\n if(base64_decode($_GET[\"ivaproductoc\"])==\"SI\"){\t\n\t\n\t\t$sql = \" update compras set \"\n\t\t\t .\" subtotalivasic = ?, \"\n\t\t\t .\" totalivac = ?, \"\n\t\t\t .\" totaldescuentoc = ?, \"\n\t\t\t .\" totalc= ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codcompra = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $subtotal);\n\t\t$stmt->bindParam(2, $totaliva);\n\t\t$stmt->bindParam(3, $totaldescuentoc);\n\t\t$stmt->bindParam(4, $total);\n\t\t$stmt->bindParam(5, $codcompra);\n\t\t\n\t\t$subtotal= strip_tags($importeivasi);\n $totaliva= rount($subtotal*$iva,2);\n\t\t$tot= rount($subtotal+$subtotalivanoc+$totaliva,2);\n\t\t$totaldescuentoc= rount($tot*$descuento,2);\n\t\t$total= rount($tot-$totaldescuentoc,2);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$stmt->execute();\n\t\t\n\t\t } else {\n\t\t\n\t\t$sql = \" update compras set \"\n\t\t\t .\" subtotalivanoc = ?, \"\n\t\t\t .\" totaldescuentoc = ?, \"\n\t\t\t .\" totalc= ? \"\n\t\t\t .\" where \"\n\t\t\t .\" codcompra = ?;\n\t\t\t \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $subtotal);\n\t\t$stmt->bindParam(2, $totaldescuentoc);\n\t\t$stmt->bindParam(3, $total);\n\t\t$stmt->bindParam(4, $codcompra);\n\t\t\n\t\t$subtotal= strip_tags($importeivano);\n\t\t$tot= rount($subtotal+$subtotalivasic+$totalivac,2);\n\t\t$totaldescuentoc= rount($tot*$descuento,2);\n\t\t$total= rount($tot-$totaldescuentoc,2);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$stmt->execute();\t\t\n\t\t }\t\t\t\t\t\n\n\t\theader(\"Location: detallescompras?mesage=2\");\n\t\texit;\n\n\t\t}\n\t\telse\n\t\t{\n\n################ VERIFICAMOS SI EL TIPO DE ENTRADA ES UN INGREDINTE ###################\n\tif($_POST['tipoentrada']==\"INGREDIENTE\"){\n\n\t\t$sql2 = \"select cantingrediente from ingredientes where cantingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[] = $row;\n\t\t}\n\t\t$existenciadb = $p[0][\"cantingrediente\"];\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t$sql = \" update ingredientes set \"\n\t\t.\" cantingrediente = ? \"\n\t\t.\" where \"\n\t\t.\" codingrediente = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $existencia);\n\t\t$stmt->bindParam(2, $codproducto);\n\t\t$cantcompra = strip_tags(base64_decode($_GET[\"cantcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$existencia = $existenciadb - $cantcompra;\n\t\t$stmt->execute();\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexingredientes where codprocesoing = ? and codingrediente = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codcompra);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$stmt->execute();\n\n################ VERIFICAMOS SI EL TIPO DE ENTRADA ES UN PRODUCTO ###################\n\t\t\t} else {\n\n###################### ACTUALIZAMOS LOS DATOS DEL PRODUCTO EN ALMACEN ############################\n\t\t$sql2 = \"select existencia from productos where codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql2);\n\t\t$stmt->execute( array(base64_decode($_GET[\"codproducto\"])));\n\t\t$num = $stmt->rowCount();\n\n\t\tif($row = $stmt->fetch(PDO::FETCH_ASSOC))\n\t\t{\n\t\t\t$p[] = $row;\n\t\t}\n\t\t$existenciadb = $p[0][\"existencia\"];\n\n\t\t$sql = \" update productos set \"\n\t\t.\" existencia = ? \"\n\t\t.\" where \"\n\t\t.\" codproducto = ?;\n\t\t\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1, $existencia);\n\t\t$stmt->bindParam(2, $codproducto);\n\t\t$cantcompra = strip_tags(base64_decode($_GET[\"cantcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$existencia = $existenciadb - $cantcompra;\n\t\t$stmt->execute();\n\n###################### REALIZAMOS LA ELIMINACION DEL PRODUCTO EN KARDEX ############################\n\t\t$sql = \" delete from kardexproductos where codproceso = ? and codproducto = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codcompra);\n\t\t$stmt->bindParam(2,$codproducto);\n\t\t$codcompra = strip_tags(base64_decode($_GET[\"codcompra\"]));\n\t\t$codproducto = strip_tags(base64_decode($_GET[\"codproducto\"]));\n\t\t$stmt->execute();\n\n\t\t$sql = \" delete from compras where codcompra = ?\";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$codcompra);\n\t\t$codcompra = base64_decode($_GET[\"codcompra\"]);\n\t\t$stmt->execute();\n\n\t\t$sql = \" delete from detallecompras where coddetallecompra = ? \";\n\t\t$stmt = $this->dbh->prepare($sql);\n\t\t$stmt->bindParam(1,$coddetallecompra);\n\t\t$coddetallecompra = base64_decode($_GET[\"coddetallecompra\"]);\n\t\t$stmt->execute();\n\n\t\t\t}\n\n\t\t\theader(\"Location: detallescompras?mesage=2\");\n\t\t\texit;\n\t\t}\n\t}\n\telse\n\t{\n\t\theader(\"Location: detallescompras?mesage=3\");\n\t\texit;\n\t}\n}",
"public function deleteMatch(){\n\t\t$this->getDbTable()->delete(\"\");\n\t}",
"function eliminarRegistro($table,$camp,$dato){\n\t$q = \"DELETE FROM \".$table.\" WHERE \".$camp.\" = \".$dato;\n\t\n\tmysql_query($q);\n\n}",
"function supprimer2($connexion,$nomTable,$nomClePrimaire1,$valeurClePrimaire1,$nomClePrimaire2,$valeurClePrimaire2) { \n $req =$connexion -> query(\"DELETE FROM $nomTable WHERE $nomClePrimaire1 = '$valeurClePrimaire1' and $nomClePrimaire2 = '$valeurClePrimaire2' \");\n }",
"function eliminarCursosDelTipoDeMatricula($id){\n \t$pdo = DatabaseCao::connect();\n $sql = \"DELETE FROM ca_tipo_matricula_curso WHERE tipo_matricula = ?\";\n $q = $pdo->prepare($sql);\n $q->execute(array($id));\n DatabaseCao::disconnect();\n }",
"protected function eliminar($id)\n {\n }",
"public function delete () {\n $this->db->delete('emprestimos', array('id_emprestimo' => $this->id_emprestimo));\n }",
"function Elimina($id){\r\n\t\r\n\t\t$db=dbconnect();\r\n\t\r\n\t\t/*Definición del query que permitira eliminar un registro*/\r\n\t\t$sqldel=\"DELETE FROM productos WHERE id_producto=:id\";\r\n\t\r\n\t\t/*Preparación SQL*/\r\n\t\t$querydel=$db->prepare($sqldel);\r\n\t\t\t\r\n\t\t$querydel->bindParam(':id',$id);\r\n\t\t\r\n\t\t$valaux=$querydel->execute();\r\n\t\r\n\t\treturn $valaux;\r\n\t}",
"public function eliminar(){\n $dimensiones = $this->descripciones()->distinct()->get()->pluck('id')->all();\n $this->descripciones()->detach($dimensiones);\n DescripcionProducto::destroy($dimensiones);\n $this->categorias()->detach();\n $this->imagenes()->delete();\n $this->delete();\n }",
"public function excluir(){\n\t\tglobal $tabela_links;\n\t\t$consulta = new conexao();\n\t\t$endereco = $consulta->sanitizaString($this->end_link);\n\t\t$funcionalidade_tipo = (int) $this->funcionalidade_tipo;\n\t\t$funcionalidade_id = (int) $this->funcionalidade_id;\n\t\t//echo(\"$endereco\t $funcionalidade_tipo\t$funcionalidade_id\");\n\t\t$consulta->connect();\n\t\t$consulta->solicitar(\"DELETE FROM $tabela_links \n\t\t\t\t\t\t\t\tWHERE endereco = '$endereco'\n\t\t\t\t\t\t\t\tAND funcionalidade_tipo\t= '$funcionalidade_tipo'\n\t\t\t\t\t\t\t\tAND funcionalidade_id\t= '$funcionalidade_id'\");\n\t\t\n\t\n\t}",
"function borrar(){\n $id=$_POST[\"id\"];\n $consulta=\"DELETE FROM usuarios WHERE id = \".$id.\"\";\n echo $consulta. \"<br>\";\n \n\n $resultado = $conector->query($consulta);\n mostrarListado();\n }",
"function delete() {\n\t \t\n\t \t$sql = \"DELETE FROM evs_database.evs_group (gru_id, gru_name, gru_head_dept,gru_company_id)\n\t \tVALUES(?, ?, ?,?) \n\t\tWHERE gru_id = '$gru_id' \";\n\t\t\n\t \t$this->db->query($sql, array($this->gru_id, $this->gru_name, $this->gru_head_dept ,$this->gru_company_id));\n\t }",
"public function delete()\n {\n $textvalues = $this->gettextvalues();\n $this->deleteValues($textvalues);\n \n $componentvalues = $this->getcomponentvalues();\n $this->deleteValues($componentvalues);\n \n $filevalues = $this->getfilevalues();\n $this->deleteValues($filevalues);\n \n $contributorvalues = $this->getcontributorvalues();\n $this->deleteValues($contributorvalues);\n \n parent::delete();\n }",
"function excluirPessoa(){\r\n $banco = conectarBanco();\r\n $sql = \"DELETE FROM pessoa WHERE id = '{$_POST[\"id\"]}'\";\r\n $banco->query($sql); // Passa a query fornecida em $sql para o banco de dados\r\n $banco->close(); // Fecha o banco de dados\r\n voltarMenu(); // Volta para a pagina inicial da agenda\r\n}",
"function removePacote($campos){\n\t\t\t$listDel = $campos['InputDelPacote'];\t\t\t\n\t\t\t\t\n\t\t\t\tif(!empty($listDel)){\n\t\t\t\t\n\t\t\t\tfor($i=0;$i<sizeof($listDel);$i++){\n\t\t\t\t\t\tif($listDel[$i] != 0){\n\t\t\t\t\t\t\t\t$sql = \" DELETE FROM vekttor_venda_pacote WHERE pacotes_id = '$listDel[$i]' AND vekttor_venda_id = '$campos[venda_id]'\";\n\t\t\t\t\t\t\t\t//echo $sql;\n\t\t\t\t\t\t\t\tmysql_query($sql);\t\n\t\t\t\t\t\t}\n\t\t\t\t\t\t\n\t\t\t\t\t/*Seleciona os pacote para trazer os modulos */\n\t\t\t\t\t$sqlPacote = mysql_query($tn=\" SELECT * FROM pacote_item WHERE pacote_id = '$listDel[$i]' \");\n\t\t\t\t\t\twhile($pct=mysql_fetch_object($sqlPacote)){\n\t\t\t\t\t\t\t\t$modulos[] = $pct->sis_modulo_id;\n\t\t\t\t\t\t}\n\t\t\t\t} /*Fim de For*/\n\t\t\t\t\n\t\t\t\t\tfor($j=0;$j<sizeof($modulos);$j++){\n\t\t\t\t\t\t\t$sqlModulos = \" DELETE FROM usuario_tipo_modulo WHERE modulo_id = '$modulos[$j]' AND usuario_tipo_id = '$campos[id_usuario_tipo]'\";\n\t\t\t\t\t\t\tmysql_query($sqlModulos);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n}",
"function action_remove() {\n\t\t\t$data = UTIL::get_post('data');\n\t\t\t$id = (int)$data['rem_id'];\n\t\t\t$table = $data['rem_table'];\n\t\t\t\n\t\t\t$choosen = $this->SESS->get('objbrowser', 'choosen');\n\t\t\tunset($choosen[$table][$id]);\n\t\t\tif (count($choosen[$table]) == 0) unset($choosen[$table]);\n\t\t\t\n\t\t\t$this->SESS->set('objbrowser', 'choosen', $choosen);\n\t\t}",
"public static function eliminar(){\n if ($_SERVER['REQUEST_METHOD'] === 'POST') {\n $cita = Cita::find($_POST['id']);\n $cita->eliminar();\n header('Location:' . $_SERVER['HTTP_REFERER']);\n }\n }",
"function DEL()\n{\n\tif ($this->isError()) return;\n\n\t$id_memo = $this->id_memo;\n\n\t$sql = \" DELETE FROM \".$GLOBALS['prefix'].\"fiche_memos\n\t\t\t\tWHERE id_memo = $id_memo\";\n\n\tif (!Sql_exec($sql)) $this->setError(ERROR);\n\tif (!$this->isError()) Lib_sqlLog($sql);\n\n\treturn;\n}",
"public function delete(Request $request) {\n $estadillos = Estadillo::all();\n foreach ($estadillos as $estadillo) {\n if ($estadillo->registreProduccio->id_registre_entrada == $request[\"id\"]){\n ActorEstadillo::where('id_produccio', $estadillo->id_estadillo)->delete();\n $estadillo->delete();\n }\n }\n \n //Elimina tots els costos relacionats amb el registre d'Entrada que s'eliminara\n $costos = Costos::all();\n foreach ($costos as $cost) {\n if ($cost->registreProduccio->id_registre_entrada == $request[\"id\"]){\n EmpleatCost::where('id_costos', $cost->id_costos)->delete();\n $cost->delete();\n }\n }\n \n $calendars = Calendar::all();\n foreach ($calendars as $calendar) {\n if ($calendar->id_registre_entrada == $request[\"id\"]){\n $calendar->delete();\n }\n }\n \n RegistreEntrada::where('id_registre_entrada', $request[\"id\"])->delete();\n //Elimina tots els missatges relacionats amb el registre d'Entrada que s'eliminara\n $registres = RegistreProduccio::where('id_registre_entrada', $request[\"id\"])->get();\n foreach ($registres as $registre) {\n Missatge::where('id_referencia', $registre->id)->where('referencia', 'registreProduccio')->delete();\n }\n //Elimina tots els registres de producció relacionats amb el registre d'Entrada que s'eliminara\n $registres = RegistreProduccio::where('id_registre_entrada', $request[\"id\"])->delete();\n Missatge::where('id_referencia', $request[\"id\"])->whereReferencia('registreEntrada')->delete();\n \n return redirect()->route('indexRegistreEntrada');\n }",
"protected\n function eliminar($id)\n {\n }",
"public function eliminar($id)\n {\n }",
"public function eliminar($id)\n {\n }",
"public function eliminar($id)\n {\n }",
"function do_delete(){\n\t\t// remove from fieldset:\n\t\t$fieldset = jcf_fieldsets_get( $this->fieldset_id );\n\t\tif( isset($fieldset['fields'][$this->id]) )\n\t\t\tunset($fieldset['fields'][$this->id]);\n\t\tjcf_fieldsets_update( $this->fieldset_id, $fieldset );\n\t\t\n\t\t// remove from fields array\n\t\tjcf_field_settings_update($this->id, NULL);\n\t}",
"public function eliminar($id)\n {\n //\n }",
"public function eliminar($id)\n {\n //\n }",
"public function eliminar()\n {\n if (isset ($_REQUEST['id'])){\n $id=$_REQUEST['id'];\n $miConexion=HelperDatos::obtenerConexion();\n $resultado=$miConexion->query(\"call eliminar_rubro($id)\");\n }\n }",
"public function delete()\n {\n //recuperation des informations pour la suppression d'une matière\n $data = $this->request->data;\n $id_planing = (int)$data['id_planing'] ?? null;\n \n if (empty($id_planing)) {\n $this->_return('Veillez spécifier l\\'identifiant du programme à supprimer', false);\n }\n\n if (true === $this->model->exist('id_planing', (int)$data['id_planing'], 'Presences')) {\n $this->_return('impossible de supprimer ce planing car il comporte encore des presences ', false);\n }\n\n try {\n $this->model->remove($id_planing);\n $this->_return('La matière a étè supprimer avec succès', true);\n //code...\n } catch (Exception $e) {\n $this->_exception($e);\n }\n }",
"function delete_simbolo_especial($id_simbolo) {\n\t\t\n\t\t$simbolo=$this->datos_simbolo_especial($id_simbolo);\n\t\t\n\t\t$connection = mysql_connect($this->HOST, $this->USERNAME, $this->PASSWORD);\n\t\t$SelectedDB = mysql_select_db($this->DBNAME);\n\t\t\n\t\t$qDelete = \"DELETE FROM simbolos_especiales WHERE id_simbolo='$id_simbolo'\";\t\n\t\t$result = mysql_query($qDelete); \n\t\t\n\t\tif ($simbolo['registrado']==2) {\n\t\t\t\n\t\t\tif (file_exists('../../repositorio/specials_smbl/'.$id_simbolo.'.'.$simbolo['ext'].'')) { \n\t\t\t\tunlink('../../repositorio/specials_smbl/'.$id_simbolo.'.'.$simbolo['ext'].''); \n\t\t\t}\n\t\t\tif (file_exists('../../repositorio/specials_smbl/'.$id_simbolo.'_150.'.$simbolo['ext'].'')) { \n\t\t\t\tunlink('../../repositorio/specials_smbl/'.$id_simbolo.'_150.'.$simbolo['ext'].''); \n\t\t\t}\n\t\t\tif (file_exists('../../repositorio/specials_smbl/'.$id_simbolo.'_o.'.$simbolo['ext'].'')) { \n\t\t\t\tunlink('../../repositorio/specials_smbl/'.$id_simbolo.'_o.'.$simbolo['ext'].''); \n\t\t\t}\n\t\t\n\t\t} \n\t\tmysql_close($connection);\t\n\t\treturn mysql_error();\t\n\t\t\t\n\t}",
"function Delete_Partido($partido)\n{\n $valor = eliminar(\"DELETE FROM `tb_partidos` WHERE id_partido=$partido\");\n return $valor;\n}",
"public function delall()\n {\n }",
"public function destroy(Registro $registro)\n {\n //\n }",
"public function destroy(Registro $registro)\n {\n //\n }",
"function eliminarperiodo (){\n\t\t$this->loadmodel('Correo');\t\t\n\t\t$condition = array('Correo.etapa' => 10);\t\n\t\t$this->Correo->deleteAll($condition,false);\n\t\tif ($this->Periodo->query('TRUNCATE TABLE RAP_PERIODOS_POSTULACION')) {\t\t\t\t\t\n\t\t\t\t$this->redirect(array('action'=>'periodopostulacion'));\t\t\t\t\t\n\t\t\t\t$this->Session->setFlash(__('Exito al borrar el periodo de postulación.'),'mensaje-exito');\t\t\t\t\n\t\t}\n\t\telse {\n\t\t\t$this->redirect(array('action'=>'periodopostulacion'));\t\t\t\n\t\t\t$this->Session->setFlash(__('Exito al borrar el periodo de postulación.'),'mensaje-exito');\t\t\t\n\t\t}\n\t\t\n\t\t\t\n\t}",
"function delete() {\n\t\t$sql = \"DELETE FROM cost_detail\n\t\t\t\tWHERE cd_fr_id=?, cd_seq=?\";\n\t\t$this->ffm->query($sql, array($this->cd_fr_id, $this->cd_seq));\n\t}",
"public function eliminar($idFacPagos){\n\t\tif(!isset($idFacPagos)){\n\t\t\t$this->_notAuthorized();\n\t\t}\n\t\t\n\n\t\t$this->db->where('id_factura_pagos_pedido', $idFacPagos);\n\t\t$this->resultDb = $this->db->get($this->controllerSPA);\n\n\t\tif ($this->resultDb->num_rows() > 0){\n\t\t\t\t$this->db->where('id_factura_pagos_pedido' , $idFacPagos);\n\t\t\t\t$this->db->delete($this->controllerSPA);\n\t\t\t\t$this->responseHTTP['message'] = \n\t\t\t\t\t\t\t\t\t\t\t'Regitro eliminado correctamente';\n\t\t\t\t$this->responseHTTP[\"appst\"] = 1500;\n\t\t}else{\n\t\t\t$this->responseHTTP['appst'] =\n\t\t\t\t\t\t\t\t 'El registro que intenta eliminar no existe';\n\t\t\t$this->responseHTTP[\"appst\"] = 2500;\n\t\t}\n\n\t\t$this->__responseHttp($this->responseHTTP, 200);\n\t}",
"function eliminarpermiso()\n {\n $oconexion = new conectar();\n //se establece conexión con la base de datos\n $conexion = $oconexion->conexion();\n //consulta para eliminar el registro\n $sql = \"UPDATE permiso SET eliminado=1 WHERE id_permiso=$this->id_permiso\";\n // $sql=\"DELETE FROM estudiante WHERE id=$this->id\";\n //se ejecuta la consulta\n $result = mysqli_query($conexion, $sql);\n return $result;\n }",
"function del_compte()\r\n\t{\r\n\t\tglobal $nuked, $user, $language, $repertoire;\r\n\r\n\t\tif($user[1] >= \"1\")\r\n\t\t{\r\n\t\t\t$del=mysql_query(\"DELETE FROM \".ESPACE_MEMBRE_TABLE.\" WHERE user_id='\".$user[0].\"' \");\r\n\t\t\t$del=mysql_query(\"DELETE FROM \".ESPACE_MEMBRE_GALERY_TABLE.\" WHERE user_id='\".$user[0].\"' \");\r\n\r\n\t\t\tif ($rep = @opendir($repertoire.$user[0]))\r\n\t\t\t{\r\n\t\t\t\twhile ($file = readdir($rep)) \r\n\t\t\t\t{\r\n\t\t\t\t\tif($file != \"..\") \r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif($file != \".\") \r\n\t\t\t\t\t\t{ \r\n\t\t\t\t\t\t\t@unlink($repertoire.$user[0].\"/\".$file);\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\t\t@rmdir($repertoire.$user[0]);\r\n\t\t\techo\"<div style=\\\"text-align: center;\\\"><br /><br /><b>\"._COMTPEDELETE.\"</b><br /><br /></div>\";\r\n\t\t\tredirect(\"index.php?file=Espace_membre\",3);\r\n\t\t}else{\r\n\t\t\techo\"\t<div style=\\\"text-align: center;\\\"><br /><br /><b>\" . _NOTACCES . \"</b><br /><br /></div>\";\r\n\t\t\tredirect(\"index.php?file=Espace_membre\", 3);\r\n\t\t}\r\n\t}",
"public function EliminarRegistros($tabla,$ColFiltro, $ItemElim)\r\n {\r\n\t//echo \"Entrando a delete\";\r\n\tmysql_query(\"DELETE FROM $tabla WHERE $ColFiltro='$ItemElim'\",$this->con) or die('no se pudo eliminar el item solicitado en la tabla: $this->tabla' . mysql_error());\r\n\t//print('\t<center><br><h1>Se ha eliminado el Item Numero: '.$idItem.' de la tabla '.$this->tabla.'</h1><br>\r\n\t\r\n\t//</center> \r\n\t//');\r\n\t\t//echo \"Saliendo de delete \";\r\n\t}",
"function deletaRegistrosTabelaAssociativa($tabela, $campo_comparacao, $value_comparacao){\n\t$sql = \"delete from $tabela where $campo_comparacao = $value_comparacao\";\n\tif(mysql_query($sql)){\n\t\treturn true;\n\t}\n\telse{\n\t\treturn false;\n\t}\n}",
"function excluir_cronograma($id){\n\t\tif(!$id){return FALSE;}\n\t\t$sql='DELETE FROM cronograma WHERE id='.$id;\n\t\t$this->db->query($sql);\n\t\tif($this->db->query($sql)){\n\t\t\treturn TRUE;\n\t\t}\n\t\telse{\n\t\t\treturn FALSE;\n\t\t\t//echo $this->db->errorCode();\n\t\t\t//$errorcode = $this->db->errorCode();\n\t\t}\n\t}",
"function borrarInscrito() {\n //Creamos la evaluacion\n leerClase('Evaluacion');\n leerClase('Estudiante');\n leerClase('Proyecto_dicta');\n $estudiante = new Estudiante($this->estudiante_id);\n $evaluacion = new Evaluacion($this->evaluacion_id);\n $protecto=$estudiante->getProyecto();\n $sql = \"select p.id as id from \" . $this->getTableName('Proyecto_dicta') . \" as p where p.proyecto_id = '$protecto->id' and p.dicta_id = '$this->dicta_id' \";\n $resultado = mysql_query($sql);\n\n $proyecto_array = mysql_fetch_array($resultado);\n $proyecto_dicta = new Proyecto_dicta($proyecto_array);\n $proyecto_dicta->delete();\n $evaluacion->delete();\n $this->delete();\n }",
"function runEliminar(){\n \n $sql = \"DELETE FROM mec_met WHERE id_mecanismos IN (SELECT id_mecanismos FROM mecanismos WHERE id_componente=\".$this->_datos.\")\";\n $this->QuerySql($sql);\n $sql = \"DELETE FROM mecanismos WHERE id_componente=\".$this->_datos;\n $this->QuerySql($sql);\n $sql = \"DELETE FROM componentes WHERE id_componentes=\".$this->_datos;\n $_respuesta = array('Codigo' => 0, \"Mensaje\" => '<strong> OK: </strong> El registro se ha eliminado.');\n try { \n $this->QuerySql($sql);\n }\n catch (exception $e) {\n $_respuesta = array('Codigo' => 99, \"Mensaje\" => $e->getMessage());\n }\n \n print_r(json_encode($_respuesta));\n }",
"function remove() {\n\t\t$option = JRequest::getCmd('option');\n\t\t// Se obtienen los ids de los registros a borrar\n\t\t$cids = JRequest::getVar('cid', array(0), 'post', 'array');\n $product_type_code = JRequest::getVar('product_type_code');\n\n\t\t// Lanzar error si no se ha seleccionado al menos un registro a borrar\n if (count($cids) < 1 || !$product_type_code) {\n\t\t\tJError::raiseError(500, JText::_('CP.SELECT_AN_ITEM_TO_DELETE'));\n\t\t}\n\n\t\t// Se obtiene el modelo\n\t\t$model = $this->getModel('comments');\n\t\t// Se intenta el borrado\n\t\tif ($model->delete($cids, $product_type_code)) {\n\t\t\t$msg = JText::_('CP.DATA_DELETED');\n\t\t\t$type = 'message';\n\t\t} else {\n\t\t\t// Si hay algún error se ajusta el mensaje\n\t\t\t$msg = $model->getError();\n\t\t\tif (!$msg) {\n\t\t\t\t$msg = JText::_('CP.ERROR_ONE_OR_MORE_DATA_COULD_NOT_BE_DELETED');\n\t\t\t}\n\t\t\t$type = 'error';\n\t\t}\n\n\t\t$this->setRedirect('index.php?option=' . $option . '&view=comments', $msg, $type);\n\t}",
"function elimina_record($id){\n\n $mysqli = connetti();\n\n $sql = \"DELETE FROM spesa WHERE id =\" . $id;\n\n //var_dump($sql); die();\n\n $mysqli->query($sql);\n chiudi_connessione($mysqli);\n}",
"public function eliminar()\n {\n // Comprobar si esta logeado como admin\n if( isset($_SESSION['admin']) ){\n\n // Capturar el id enviado por GET\n $id = $_GET['id'];\n\n // Comprobar si no esta siendo utilizado en un reporte\n $comprobarForanea = Reporte::donde('tipo_reporte_id', $id)\n ->resultado();\n\n // Encontra el tipo de reporte por el id y capturarlo\n $tipoReporte = TipoReporte::encontrarPorID($id);\n\n\n if ( empty($comprobarForanea) ) {\n\n // Eliminar el tipo de reporte\n $tipoReporte->eliminar();\n\n\n // Guardar un mensaje de que se elimino correctamente en una cookie\n setcookie('mensaje', \"Se elimino correctamente el tipo de reporte ($tipoReporte->reporte)\", time() + 10, '/' );\n\n } else {\n\n // Guardar un mensaje de que se no se pudo eliminar\n setcookie('mensaje_error', \"El tipo de reporte ($tipoReporte->reporte) esta siendo utilizado en un reporte\", time() + 10, '/' );\n }\n\n\n // Redirigir a la tabla con todos los tipos de reporte\n header('Location: ../reportes/tipos_reporte');\n\n } else {\n\n // Redirigir al perfil\n header('Location: ../perfil');\n }\n }",
"public function remove() {}",
"abstract public function delete();",
"abstract public function delete();",
"abstract public function delete();",
"abstract public function delete();",
"public function remove() {}",
"function eliminar_reservas($id_sede) {\n $this->db->where('id_sede =', $id_sede);\n $this->db->delete('edicion');\n }",
"public static function delete() {\n\n\n\t\t}",
"public function eliminar($data)\n {\n $cliente=$this->db->query('delete from tab_cliente where id_cliente='.$data); \n }"
]
| [
"0.6839267",
"0.6839267",
"0.67450213",
"0.6728572",
"0.6711111",
"0.6704383",
"0.6686609",
"0.66601187",
"0.6638787",
"0.6621437",
"0.6618396",
"0.66086584",
"0.66086584",
"0.66086584",
"0.66086584",
"0.6589356",
"0.65609944",
"0.6554402",
"0.65459675",
"0.65396863",
"0.65396863",
"0.65396863",
"0.65396863",
"0.65396863",
"0.65396863",
"0.65396863",
"0.65396863",
"0.65396863",
"0.65396863",
"0.65396863",
"0.65396863",
"0.65396863",
"0.65396863",
"0.65396863",
"0.6529316",
"0.6527808",
"0.6518887",
"0.6516906",
"0.65157616",
"0.651207",
"0.65026546",
"0.64990735",
"0.649905",
"0.6478244",
"0.64694875",
"0.64608735",
"0.64462554",
"0.6440771",
"0.64402556",
"0.6408817",
"0.6405071",
"0.63854194",
"0.6380072",
"0.63682586",
"0.6362375",
"0.6357212",
"0.63545567",
"0.6352766",
"0.6344198",
"0.6337204",
"0.6324739",
"0.63235784",
"0.63124007",
"0.63074017",
"0.630709",
"0.6304451",
"0.63043004",
"0.63043004",
"0.63043004",
"0.6294731",
"0.6287062",
"0.6287062",
"0.62655026",
"0.62654066",
"0.62544185",
"0.62447226",
"0.624421",
"0.6237879",
"0.6237879",
"0.623634",
"0.62326044",
"0.62297",
"0.62275094",
"0.6226755",
"0.62263054",
"0.6225252",
"0.6223709",
"0.6211122",
"0.620664",
"0.6205861",
"0.62022185",
"0.6201479",
"0.6192447",
"0.6191906",
"0.6191906",
"0.6191906",
"0.6191906",
"0.6190264",
"0.6189976",
"0.61897254",
"0.61886525"
]
| 0.0 | -1 |
Get the emoji country flag for the given country code. | function country_flag($countryCode)
{
return CountryFlag::get($countryCode);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected static function country_code(): mixed\n\t{\n\t\treturn self::$query->country_code;\n\t}",
"static function get_country($code) {\n $countries = self::get_countries();\n foreach($countries as $c) {\n if($c->code == $code || $c->code2l == $code) {\n return $c;\n }\n }\n return FALSE;\n }",
"public function countryCode();",
"public function country()\r\n\t{\r\n\t\t$country = \\Shop\\Models\\Countries::fromCode( $this->country_isocode_2 );\r\n\r\n\t\treturn $country;\r\n\t}",
"function getTeamFlag($countryCode) {\n\tif (!empty($countryCode)) {\n\t\treturn \"<img src='http://img.fifa.com/imgml/flags/s/{$countryCode}.gif' title='{$countryCode}' />\";\n\t}\n}",
"function getCountry($code){\n\t\n\tglobal $dz;\n\t\n\tif(strlen($code)!=2){\n\t\t\n\t\t// Invalid input.\n\t\terror('field/invalid','country');\n\t\t\n\t}\n\t\n\t// Make sure it's uppercase:\n\t$code=strtoupper($code);\n\t\n\t// Get the row:\n\t$row=$dz->get_row('select country_id from countries where iso2=\"'.$code.'\"');\n\t\n\tif(!$row){\n\t\t\n\t\t// Country was not found.\n\t\terror('country/notfound');\n\t\t\n\t}\n\t\n\treturn $row['country_id'];\n}",
"public static function getIsoFlag($iso_code)\n\t{\n\t\tif (strlen($iso_code) == 3)\n\t\t{\n\t\t\t$iso_code = self::convertIso3to2($iso_code);\n\t\t}\n\n\t\tif ($iso_code)\n\t\t{\n\t\t\t$path = JURI::root() . 'media/com_tracks/images/flags/' . strtolower($iso_code) . '.png';\n\n\t\t\treturn $path;\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn null;\n\t\t}\n\t}",
"public static function visitor_country()\n {\n $code = null;\n if (Director::isDev()) {\n if (isset($_GET['countryfortestingonly'])) {\n $code = $_GET['countryfortestingonly'];\n Controller::curr()->getRequest()->getSession()->set('countryfortestingonly', $code);\n }\n if ($code = Controller::curr()->getRequest()->getSession()->get('countryfortestingonly')) {\n Controller::curr()->getRequest()->getSession()->set('MyCloudFlareCountry', $code);\n }\n }\n if (! $code) {\n if (isset($_SERVER['HTTP_CF_IPCOUNTRY']) && $_SERVER['HTTP_CF_IPCOUNTRY']) {\n return $_SERVER['HTTP_CF_IPCOUNTRY'];\n }\n $code = Controller::curr()->getRequest()->getSession()->get('MyCloudFlareCountry');\n if (! $code) {\n $address = self::get_remote_address();\n if (strlen($address) > 3) {\n $code = CloudFlareGeoIP::ip2country($address, true);\n }\n if (! $code) {\n $code = self::get_default_country_code();\n }\n if ('' === $code) {\n $code = Config::inst()->get('CloudFlareGeoip', 'default_country_code');\n }\n Controller::curr()->getRequest()->getSession()->set('MyCloudFlareCountry', $code);\n }\n }\n\n return $code;\n }",
"public function getCountryCode();",
"public static function getCountry(string $code): string\n {\n if (Str::contains($code, '_')) {\n $tab = explode('_', $code);\n\n return Str::lower($tab[1]);\n } elseif (Str::contains($code, '-')) {\n $tab = explode('-', $code);\n\n return Str::lower($tab[1]);\n }\n\n return config('contentful.default_country');\n }",
"function country($code = null)\n{\n if (!$code) {\n return \\SumanIon\\CloudFlare::country() ?: 'US';\n }\n\n if (true === $code) {\n return country(\\SumanIon\\CloudFlare::country() ?: 'US');\n }\n\n try {\n return app('earth')->findOneByCode($code);\n } catch (\\Exception $ex) {\n return null;\n }\n}",
"function get_Flag($country_code){\n //return the GIF of the country in HTML code\n \n $url = 'http://appslabs.net/mobile-brain-test/images/flags/' . $country_code . '.gif';\n $img = \"<img src=$url>\";\n \n return($img);\n}",
"protected function getCountryByCode(string $code)\n {\n global $db;\n require_once DOL_DOCUMENT_ROOT.'/core/class/ccountry.class.php';\n $pays = new \\Ccountry($db);\n if ($pays->fetch(0, $code) > 0) {\n return $pays->id;\n }\n\n return false;\n }",
"public static function getCountryByCode($code){\n return Country::findOne([ 'code'=> $code]);\n }",
"public static function emoji_from_country_code(string $country_code_iso_3166_1): string\n {\n if ($country_code_iso_3166_1 === '') {\n return '';\n }\n\n if (self::strlen($country_code_iso_3166_1) !== 2) {\n return '';\n }\n\n $country_code_iso_3166_1 = \\strtoupper($country_code_iso_3166_1);\n\n $flagOffset = 0x1F1E6;\n $asciiOffset = 0x41;\n\n return (self::chr((self::ord($country_code_iso_3166_1[0]) - $asciiOffset + $flagOffset)) ?? '') .\n (self::chr((self::ord($country_code_iso_3166_1[1]) - $asciiOffset + $flagOffset)) ?? '');\n }",
"protected function formatCountry($countryCode)\n {\n $countries = trans('geolocation::countries');\n\n return array_key_exists($countryCode, $countries) ? $countries[$countryCode] : $countryCode;\n }",
"public function countryCode(): string\n {\n return $this->getData('CountryCodeISO3166A2');\n }",
"abstract public function countryISOCode();",
"public function getCountryCode()\n {\n return $this->code;\n }",
"public function getCountry()\n {\n $arr_countries = array(\n 'F' =>\t_('Austria'),\n 'T' =>\t_('Belgium'),\n 'D' =>\t_('Finland'),\n 'E' =>\t_('France'),\n 'L' =>\t_('France'),\n 'P' =>\t_('Germany'),\n 'R' =>\t_('Germany'),\n 'N' =>\t_('Greece'),\n 'K' =>\t_('Ireland'),\n 'J' =>\t_('Italy'),\n 'G' =>\t_('Netherlands'),\n 'H' =>\t_('United Kingdom'),\n 'U' =>\t_('Portugal'),\n 'M' =>\t_('Spain'),\n );\n\n return $arr_countries[$this->str_value[0]];\n }",
"public function getCountryCode(): string;",
"public function findCountry($code)\n {\n\n $country = $this->em->getRepository('TTBundle:Airport')->findOneByAirportCode($code);\n\n return $country;\n }",
"public function getCountry($country_code) {\n\t\t$SQL = 'SELECT country_name FROM country WHERE country_code=:country_code';\n\t\t$STMT = self::$_connection->prepare($SQL);\n\t\t$STMT->execute(['country_code'=>$country_code]);\n\t\treturn $STMT->fetch();\n\t}",
"public function getCountry() : string {\n\t\t\treturn substr($this->value, 4, 2);\n\t\t}",
"public function country(): string\n {\n return $this->country;\n }",
"public function getCountryCode()\n {\n return $this->countryCode;\n }",
"public function getCountryCode()\n {\n return $this->countryCode;\n }",
"public function getCountryCode()\n {\n return $this->countryCode;\n }",
"public function getCountry()\n {\n return isset($this->address_data['country']) ? $this->address_data['country'] : null;\n }",
"public function getCountryCode()\n {\n return $this->country_code;\n }",
"public function getCountryCode()\n {\n return $this->country_code;\n }",
"public function getCountryCode()\n {\n return $this->country_code;\n }",
"public function getCountryCode()\n {\n return substr($this->_code, -2);\n }",
"public function getCountry(): string\n {\n return $this->result->country_name;\n }",
"public function getCountryCode()\n\t{\n\t\tif ($this->countryCode === null)\n\t\t{\n\t\t\t$binInfo = $this->getBinInfo();\n\t\t\tif ($binInfo)\n\t\t\t\t$this->countryCode = strtoupper($binInfo->countryCode);\n\t\t}\n\t\treturn $this->countryCode;\n\t}",
"public function getCountryCode() : string\n {\n return $this->countryCode;\n }",
"public function getCountry();",
"public function getCountry();",
"public function getCountry($codeCountry = null) {\n $pathFile = storage_path(\"/json/countries.json\");\n\n if(!File::exists($pathFile)) {\n return null;\n }\n\n $countries = File::get($pathFile);\n $file = (array)json_decode(File::get($pathFile));\n if ($codeCountry != \"\" && $codeCountry != null){\n return $file[$codeCountry];\n }\n\n return $file; // return all country is default\n\t}",
"public function country(): ?string\n {\n return $this->country;\n }",
"public function country($code) {\n\t\treturn $this->countryWithHttpInfo($code)->getData();\n\t}",
"public function getCountryCode(): ?string\n {\n return $this->countryCode;\n }",
"public function getCountry() {}",
"public function getCountry() {}",
"public function getUserCountry()\n {\n $fileName = $this->getDatabaseFile();\n\n $reader = new MaxMindReader($fileName);\n\n $ipAddress = $this->getUserIp();\n //$ipAddress = \"82.65.140.34\";\n\n $country = $reader->get($ipAddress);\n $reader->close();\n\n return $country ? $country['country']['iso_code'] : null;\n }",
"static function getCountryDetailsByCode($country_code) {\n return self::find()->where(['country_code' => $country_code])->one();\n }",
"public static function getCountry(){\n $country = '';\n $ip = self::getClientIP();\n if ($ip != '') {\n $data = file_get_contents('http://freegeoip.net/json/' . $ip);\n $response = json_decode($data);\n $country = $response->country_code;\n }\n \n return $country;\n }",
"public function getNativeCountry()\n {\n return Wrapper\\World::country($this->getNativeLeagueId());\n }",
"public function getLanguageFlagByCode(string $code, $html = false): string;",
"protected function get_country_iso_code( $country_code ) {\r\n\t\t$result = '';\r\n\t\t$iso_codes = array(\r\n\t\t\t'AL' => '8',\r\n\t\t\t'DZ' => '12',\r\n\t\t\t'AS' => '16',\r\n\t\t\t'AD' => '20',\r\n\t\t\t'AO' => '24',\r\n\t\t\t'AI' => '660',\r\n\t\t\t'AG' => '28',\r\n\t\t\t'AR' => '32',\r\n\t\t\t'AM' => '51',\r\n\t\t\t'AW' => '533',\r\n\t\t\t'AU' => '36',\r\n\t\t\t'AT' => '40',\r\n\t\t\t'AZ' => '31',\r\n\t\t\t'BS' => '44',\r\n\t\t\t'BH' => '48',\r\n\t\t\t'BD' => '50',\r\n\t\t\t'BB' => '52',\r\n\t\t\t'BY' => '112',\r\n\t\t\t'BE' => '56',\r\n\t\t\t'BZ' => '84',\r\n\t\t\t'BJ' => '204',\r\n\t\t\t'BM' => '60',\r\n\t\t\t'BT' => '64',\r\n\t\t\t'BO' => '68',\r\n\t\t\t'BA' => '70',\r\n\t\t\t'BW' => '72',\r\n\t\t\t'BR' => '76',\r\n\t\t\t'BN' => '96',\r\n\t\t\t'BG' => '100',\r\n\t\t\t'BF' => '854',\r\n\t\t\t'BI' => '108',\r\n\t\t\t'KH' => '116',\r\n\t\t\t'CM' => '120',\r\n\t\t\t'CA' => '124',\r\n\t\t\t'CV' => '132',\r\n\t\t\t'KY' => '136',\r\n\t\t\t'CF' => '140',\r\n\t\t\t'TD' => '148',\r\n\t\t\t'CL' => '152',\r\n\t\t\t'CN' => '156',\r\n\t\t\t'CO' => '170',\r\n\t\t\t'KM' => '174',\r\n\t\t\t'CG' => '178',\r\n\t\t\t'CD' => '180',\r\n\t\t\t'CK' => '184',\r\n\t\t\t'CR' => '188',\r\n\t\t\t'CI' => '384',\r\n\t\t\t'HR' => '191',\r\n\t\t\t'CU' => '192',\r\n\t\t\t'CY' => '196',\r\n\t\t\t'CZ' => '203',\r\n\t\t\t'DK' => '208',\r\n\t\t\t'DJ' => '262',\r\n\t\t\t'DM' => '212',\r\n\t\t\t'DO' => '214',\r\n\t\t\t'EC' => '218',\r\n\t\t\t'EG' => '818',\r\n\t\t\t'SV' => '222',\r\n\t\t\t'GQ' => '226',\r\n\t\t\t'ER' => '232',\r\n\t\t\t'EE' => '233',\r\n\t\t\t'ET' => '231',\r\n\t\t\t'FK' => '238',\r\n\t\t\t'FO' => '234',\r\n\t\t\t'FJ' => '242',\r\n\t\t\t'FI' => '246',\r\n\t\t\t'FR' => '250',\r\n\t\t\t'GF' => '254',\r\n\t\t\t'PF' => '258',\r\n\t\t\t'GA' => '266',\r\n\t\t\t'GM' => '270',\r\n\t\t\t'GE' => '268',\r\n\t\t\t'DE' => '276',\r\n\t\t\t'GH' => '288',\r\n\t\t\t'GI' => '292',\r\n\t\t\t'GR' => '300',\r\n\t\t\t'GL' => '304',\r\n\t\t\t'GD' => '308',\r\n\t\t\t'GP' => '312',\r\n\t\t\t'GU' => '316',\r\n\t\t\t'GT' => '320',\r\n\t\t\t'GN' => '324',\r\n\t\t\t'GW' => '624',\r\n\t\t\t'GY' => '328',\r\n\t\t\t'HT' => '332',\r\n\t\t\t'VA' => '336',\r\n\t\t\t'HN' => '340',\r\n\t\t\t'HK' => '344',\r\n\t\t\t'HU' => '348',\r\n\t\t\t'IS' => '352',\r\n\t\t\t'IN' => '356',\r\n\t\t\t'ID' => '360',\r\n\t\t\t'IR' => '364',\r\n\t\t\t'IQ' => '368',\r\n\t\t\t'IE' => '372',\r\n\t\t\t'IL' => '376',\r\n\t\t\t'IT' => '380',\r\n\t\t\t'JM' => '388',\r\n\t\t\t'JP' => '392',\r\n\t\t\t'JO' => '400',\r\n\t\t\t'KZ' => '398',\r\n\t\t\t'KE' => '404',\r\n\t\t\t'KI' => '296',\r\n\t\t\t'KP' => '408',\r\n\t\t\t'KR' => '410',\r\n\t\t\t'KW' => '414',\r\n\t\t\t'KG' => '417',\r\n\t\t\t'LA' => '418',\r\n\t\t\t'LV' => '428',\r\n\t\t\t'LB' => '422',\r\n\t\t\t'LS' => '426',\r\n\t\t\t'LR' => '430',\r\n\t\t\t'LY' => '434',\r\n\t\t\t'LI' => '438',\r\n\t\t\t'LT' => '440',\r\n\t\t\t'LU' => '442',\r\n\t\t\t'MO' => '446',\r\n\t\t\t'MK' => '807',\r\n\t\t\t'MG' => '450',\r\n\t\t\t'MW' => '454',\r\n\t\t\t'MY' => '458',\r\n\t\t\t'MV' => '462',\r\n\t\t\t'ML' => '466',\r\n\t\t\t'MT' => '470',\r\n\t\t\t'MH' => '584',\r\n\t\t\t'MQ' => '474',\r\n\t\t\t'MR' => '478',\r\n\t\t\t'MU' => '480',\r\n\t\t\t'MX' => '484',\r\n\t\t\t'FM' => '583',\r\n\t\t\t'MD' => '498',\r\n\t\t\t'MC' => '492',\r\n\t\t\t'MN' => '496',\r\n\t\t\t'MS' => '500',\r\n\t\t\t'MA' => '504',\r\n\t\t\t'MZ' => '508',\r\n\t\t\t'MM' => '104',\r\n\t\t\t'NA' => '516',\r\n\t\t\t'NR' => '520',\r\n\t\t\t'NP' => '524',\r\n\t\t\t'NL' => '528',\r\n\t\t\t'AN' => '530',\r\n\t\t\t'NC' => '540',\r\n\t\t\t'NZ' => '554',\r\n\t\t\t'NI' => '558',\r\n\t\t\t'NE' => '562',\r\n\t\t\t'NG' => '566',\r\n\t\t\t'NU' => '570',\r\n\t\t\t'NF' => '574',\r\n\t\t\t'MP' => '580',\r\n\t\t\t'NO' => '578',\r\n\t\t\t'OM' => '512',\r\n\t\t\t'PK' => '586',\r\n\t\t\t'PW' => '585',\r\n\t\t\t'PA' => '591',\r\n\t\t\t'PG' => '598',\r\n\t\t\t'PY' => '600',\r\n\t\t\t'PE' => '604',\r\n\t\t\t'PH' => '608',\r\n\t\t\t'PN' => '612',\r\n\t\t\t'PL' => '616',\r\n\t\t\t'PT' => '620',\r\n\t\t\t'PR' => '630',\r\n\t\t\t'QA' => '634',\r\n\t\t\t'RE' => '638',\r\n\t\t\t'RO' => '642',\r\n\t\t\t'RU' => '643',\r\n\t\t\t'RW' => '646',\r\n\t\t\t'SH' => '654',\r\n\t\t\t'KN' => '659',\r\n\t\t\t'LC' => '662',\r\n\t\t\t'PM' => '666',\r\n\t\t\t'VC' => '670',\r\n\t\t\t'WS' => '882',\r\n\t\t\t'SM' => '674',\r\n\t\t\t'ST' => '678',\r\n\t\t\t'SA' => '682',\r\n\t\t\t'SN' => '686',\r\n\t\t\t'SC' => '690',\r\n\t\t\t'SL' => '694',\r\n\t\t\t'SG' => '702',\r\n\t\t\t'SK' => '703',\r\n\t\t\t'SI' => '705',\r\n\t\t\t'SB' => '90',\r\n\t\t\t'SO' => '706',\r\n\t\t\t'ZA' => '710',\r\n\t\t\t'ES' => '724',\r\n\t\t\t'LK' => '144',\r\n\t\t\t'SD' => '736',\r\n\t\t\t'SR' => '740',\r\n\t\t\t'SJ' => '744',\r\n\t\t\t'SZ' => '748',\r\n\t\t\t'SE' => '752',\r\n\t\t\t'CH' => '756',\r\n\t\t\t'SY' => '760',\r\n\t\t\t'TW' => '158',\r\n\t\t\t'TJ' => '762',\r\n\t\t\t'TZ' => '834',\r\n\t\t\t'TH' => '764',\r\n\t\t\t'TG' => '768',\r\n\t\t\t'TK' => '772',\r\n\t\t\t'TO' => '776',\r\n\t\t\t'TT' => '780',\r\n\t\t\t'TN' => '788',\r\n\t\t\t'TR' => '792',\r\n\t\t\t'TM' => '795',\r\n\t\t\t'TC' => '796',\r\n\t\t\t'TV' => '798',\r\n\t\t\t'UG' => '800',\r\n\t\t\t'UA' => '804',\r\n\t\t\t'AE' => '784',\r\n\t\t\t'GB' => '826',\r\n\t\t\t'US' => '840',\r\n\t\t\t'UY' => '858',\r\n\t\t\t'UZ' => '860',\r\n\t\t\t'VU' => '548',\r\n\t\t\t'VE' => '862',\r\n\t\t\t'VN' => '704',\r\n\t\t\t'VG' => '92',\r\n\t\t\t'VI' => '850',\r\n\t\t\t'WF' => '876',\r\n\t\t\t'EH' => '732',\r\n\t\t\t'YE' => '887',\r\n\t\t\t'ZM' => '894',\r\n\t\t\t'ZW' => '716',\r\n\t\t);\r\n\t\tif ( array_key_exists( $country_code, $iso_codes ) ) {\r\n\t\t\t$result = $iso_codes[ $country_code ];\r\n\t\t}\r\n\t\treturn $result;\r\n\t}",
"public function getCountry() : string\n {\n return $this->country;\n }",
"public function getCountry() {\n\t\treturn self::$_country;\n\t}",
"public function getCountry() :string\n {\n return $this->country;\n }",
"public function getCountryId($countryCode)\n {\n $rc = null;\n\n if ($countries = $this->getCountries()) {\n foreach ($countries as $country) {\n if (isset($country['code']) && $country['code'] == $countryCode && isset($country['country_id'])) {\n $rc = $country['country_id'];\n break;\n }\n }\n }\n\n return $rc;\n }",
"public function getCountryCode()\n {\n $node = $this->response->getFirst('contact:addr/contact:cc', $this->node);\n\n return $node->nodeValue;\n }",
"public function getCode()\r\r\n\t{\r\r\n\t\treturn \"\";#getCountryFromIP($this->ip,\"code\");\r\r\n\t}",
"public static function country()\n\t{\n\t\treturn static::onTrustedRequest(function () {\n\t\t\treturn request()->header('CF_IPCOUNTRY');\n\t\t}) ?: '';\n\t}",
"public function getCountryCode($country_name)\n {\n foreach (self::$supported_languages as $lng) {\n if (empty(self::$countries[$lng])) {\n continue;\n }\n\n foreach (self::$countries[$lng] as $code => $translation) {\n if (strcasecmp($country_name, $translation) == 0) {\n return $code;\n }\n } // foreach\n } // foreach\n\n return \"\";\n }",
"public function get_country_id() {\n\t\treturn $this->_country_id;\n\t}",
"function tep_get_country_iso_code_2($country_id) {\n $country_iso_query = tep_db_query(\"select * from \" . TABLE_COUNTRIES . \" where countries_id = '\" . $country_id . \"'\");\n if (!tep_db_num_rows($country_iso_query)) {\n return 0;\n }\n else {\n $country_iso_row = tep_db_fetch_array($country_iso_query);\n return $country_iso_row['countries_iso_code_2'];\n }\n }",
"public static function getCountryNameFromCode($country_code) {\n $country_list = \\Drupal::service('country_manager')->getList();\n foreach ($country_list as $key => $value) {\n if ($key === $country_code) {\n return $value->__toString();\n }\n }\n }",
"public function getCountry()\n {\n return $this->getValueObject('country');\n }",
"static function getCountryNameByCode($country_code) {\n $data = self::find()->select('country_name')->where(['country_code' => $country_code])->one();\n if ($data) {\n return $data->country_name;\n }\n return NULL;\n }",
"public function getCountry(): ?string\n {\n return $this->country;\n }",
"public function getCountry(): ?string\n {\n return $this->country;\n }",
"public function getCountry(): ?string\n {\n return $this->country;\n }",
"public function sGetCountry($country)\n {\n if (empty($country)) {\n return false;\n }\n if (isset($this->cache['country'][$country])) {\n return $this->cache['country'][$country];\n }\n\n if (is_numeric($country)) {\n $sql = $this->db->quoteInto('c.id = ?', $country);\n } elseif (is_string($country)) {\n $sql = $this->db->quoteInto('c.countryiso = ?', $country);\n } else {\n return false;\n }\n\n $sql = \"\n SELECT c.id, c.id as countryID, countryname, countryiso,\n (SELECT name FROM s_core_countries_areas WHERE id = areaID ) AS countryarea,\n countryen, c.position, notice\n FROM s_core_countries c\n WHERE $sql\n \";\n\n return $this->cache['country'][$country] = $this->db->fetchRow($sql) ?: [];\n }",
"function tep_get_country_iso_code_2($country_id) {\n\n $country_iso_query = tep_db_query(\"select * from \" . TABLE_COUNTRIES . \" where countries_id = '\" . $country_id . \"'\");\n\n if (!tep_db_num_rows($country_iso_query)) {\n return 0;\n }\n else {\n $country_iso_row = tep_db_fetch_array($country_iso_query);\n return $country_iso_row['countries_iso_code_2'];\n }\n }",
"public function getCountry(): ?string\n {\n return $this->_country;\n }",
"function getCountry()\n {\n global $warn;\n\n if ($this->country)\n return $this->country;\n else\n if (array_key_exists('cc', $this->extras))\n {\n $cc = $this->extras['cc'];\n $country = new Country(array('cc' => $cc));\n if ($country->isExisting())\n {\n $this->country = $country; // save\n return $this->country;\n }\n else\n {\n unset($this->extras['cc']);\n }\n }\n return null;\n }",
"public function getCountry()\n {\n return $this->country;\n }",
"public function getCountry()\n {\n return $this->country;\n }",
"public function getCountry()\n {\n return $this->country;\n }",
"public function getCountry()\n {\n return $this->country;\n }",
"public function getCountry()\n {\n return $this->country;\n }",
"public function getCountry()\n {\n return $this->country;\n }",
"public function getCountry()\n {\n return $this->country;\n }",
"public function getCountry()\n {\n return $this->country;\n }",
"public function getCountry()\n {\n return $this->country;\n }",
"public function getCountry()\n {\n return $this->country;\n }",
"public function getCountry()\n {\n return $this->country;\n }",
"public function getCountry()\n {\n return $this->country;\n }",
"public function getCountry()\n {\n return $this->country;\n }",
"public function getCountry()\n {\n return $this->country;\n }",
"public function getCountryCode(): string\n {\n return !is_null($this->Countrycode)\n ? $this->Countrycode\n : self::DEFAULT_COUNTRY;\n }",
"private function getCountryByCode($code)\n {\n // Check if country exist in cache.\n if (array_key_exists($code, $this->countries)) {\n return $this->countries[$code];\n }\n // Fetch country.\n $country = $this->manager->getRepository(static::$countryEntityName)->findOneBy(['code' => $code]);\n if (!$country) {\n throw new \\Doctrine\\ORM\\EntityNotFoundException('code = ' . $code);\n }\n // Add country to cache.\n $this->countries[$code] = $country;\n\n return $country;\n }",
"public function getCountryCode(): ?string;",
"public function getCountryName();",
"public function getCountry()\n\t{\n\t\treturn $this->country;\n\t}",
"public function getCountry()\n\t{\n\t\treturn $this->country;\n\t}",
"public function getCountry()\n {\n return $this->getParameter('country');\n }",
"public static function countryCurrencyCode($countryCode)\n {\n return static::countryCurrencyFormatter($countryCode)->getSymbol(\\NumberFormatter::INTL_CURRENCY_SYMBOL);\n }",
"function getCountry() {\r\r\n\t\treturn $this->country;\r\r\n\t}",
"protected function getCountry()\n {\n return strtoupper($this->checkoutSession->getLastRealOrder()->getBillingAddress()->getCountryId());\n }",
"public function getCountry()\n {\n if (!array_key_exists('country', $this->userInfo)) {\n $this->getLocation();\n }\n\n return $this->getInfoVar('country');\n }",
"protected function getCountryNumericCode($country_code)\r\n {\r\n return db_get_field('SELECT code_N3 FROM ?:countries WHERE code=?s', $country_code);\r\n }",
"public function getIpToCountry($ip_address)\r\n {\r\n $url_to_exch_code = \"https://ipinfo.io/\" . $ip_address . \"/country\";\r\n\r\n $ch = curl_init();\r\n curl_setopt($ch, CURLOPT_URL, $url_to_exch_code);\r\n curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);\r\n $code_string = curl_exec($ch);\r\n curl_close($ch);\r\n\r\n //Leave only letters in query result\r\n $code_string = preg_replace(\"/[^A-Z]+/\", \"\", $code_string);\r\n\r\n //Check also an amount of letters - should be only two\r\n if(!empty($code_string) && strlen($code_string) == 2) {\r\n\r\n if(is_file(APPPATH . 'libraries/ipstate_src/countries_names.json')){\r\n\r\n $json_names = file_get_contents(APPPATH . 'libraries/ipstate_src/countries_names.json');\r\n\r\n $names_array = json_decode($json_names, true);\r\n\r\n if(array_key_exists($code_string, $names_array)){\r\n\r\n $country_name = $names_array[$code_string];\r\n $country_name = $this->checkIpResult($country_name);\r\n return $country_name;\r\n\r\n }else {\r\n return false;\r\n }\r\n } else {\r\n return false;\r\n }\r\n } else {\r\n return false;\r\n }\r\n }",
"public function getPhoneCountryCode()\n\t{\n\t\treturn $this->getIfSet('countryCode', $this->data->phone);\n\t}",
"function tep_get_countries_with_iso_codes($countries_id) {\n\treturn tep_get_countries($countries_id, true);\n}",
"public function getcountryAttribute($country)\n {\n return array_search($country,BasicSiteRepository::getListOfCountries());\n }"
]
| [
"0.6938896",
"0.6765127",
"0.66688985",
"0.66329914",
"0.66089135",
"0.64887667",
"0.6487301",
"0.6464388",
"0.64364856",
"0.64127177",
"0.63825023",
"0.635371",
"0.6349881",
"0.6336349",
"0.62748784",
"0.62381095",
"0.61727625",
"0.6118596",
"0.6111141",
"0.60943353",
"0.60930884",
"0.6090048",
"0.6087576",
"0.6086795",
"0.60774446",
"0.6075289",
"0.6075289",
"0.6075289",
"0.606894",
"0.60685176",
"0.60685176",
"0.60685176",
"0.6058397",
"0.6039699",
"0.6036357",
"0.6018866",
"0.6018861",
"0.6018861",
"0.6003511",
"0.5997088",
"0.599364",
"0.5992687",
"0.5991993",
"0.5991993",
"0.598421",
"0.5977863",
"0.59758687",
"0.59658486",
"0.59469694",
"0.59350413",
"0.5923021",
"0.59200394",
"0.59127194",
"0.5912256",
"0.5899159",
"0.5892495",
"0.58912784",
"0.58881664",
"0.58859724",
"0.5871894",
"0.5868568",
"0.58631563",
"0.58603895",
"0.5857192",
"0.5857192",
"0.5857192",
"0.5839341",
"0.5832143",
"0.58313465",
"0.58308893",
"0.58180773",
"0.58180773",
"0.58180773",
"0.58180773",
"0.58180773",
"0.58180773",
"0.58180773",
"0.58180773",
"0.58180773",
"0.58180773",
"0.58180773",
"0.58180773",
"0.58180773",
"0.58180773",
"0.5816773",
"0.58155227",
"0.5795616",
"0.5776031",
"0.57652956",
"0.57652956",
"0.5753752",
"0.5748016",
"0.5729689",
"0.5693515",
"0.5687171",
"0.568539",
"0.56791675",
"0.5677905",
"0.56683886",
"0.56610435"
]
| 0.75854194 | 0 |
Lists all User models. | public function actionIndex()
{
$module = \app\modules\users\Module::getInstance();
$model = new SendForm;
if ($model->load(\Yii::$app->request->post())) {
$model->send();
return $this->redirect(['/users/send-notifications']);
}
else {
return $this->render('index', [
'module' => $module,
'model' => $model,
]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function allUsers()\n {\n $users = $this->user->findAll();\n $this->show('admin/allusers', ['users' => $users]);\n }",
"public function index() {\n $rows = AdminUser::paginate(10);\n return View::make(\"CoreCms::user.listing\")->with(\"models\", $rows);\n }",
"public function index()\n {\n $users = User::all();\n }",
"public function index()\n {\n\n return User::all();\n }",
"public function index()\n {\n return User::all();\n }",
"public function index()\n {\n return User::all();\n }",
"public function index()\n {\n return User::all();\n }",
"public function index()\n {\n return User::all();\n }",
"public function index()\n {\n return User::all();\n }",
"public function index()\n {\n return User::all();\n }",
"public function index()\n {\n return User::all();\n }",
"public function index()\n {\n return User::all();\n }",
"public function list()\n {\n $listUsers = AppUser::findAll();\n $this->show('back/user/list', [\"users\" => $listUsers]);\n }",
"function getUsers(){\n\t\t\t$this->loadModel('User');\n\t\t\treturn $this->User->find(array());\n\t\t}",
"public function actionIndex() {\n //redirect a user if not super admin\n if (!Yii::$app->CustomComponents->check_permission('all_users')) {\n return $this->redirect(['site/index']);\n }\n\n $query = DvUsers::find();\n $count = $query->count();\n $pagination = new Pagination(['totalCount' => $count, 'pageSize' => 50]);\n $models = $query->offset($pagination->offset)->limit($pagination->limit)->all();\n return $this->render('index', [ 'users' => $models, 'total_records' => $count, 'pages' => $pagination]);\n }",
"public function index()\n {\n //\n return User::all();\n }",
"public function index(){\n\t\t$users = $this->User->find(\"users\", \"all\");\t\n\t\t$this->set(\"users\", $users);\n\t}",
"public function index()\n {\n return $this->user->all();\n }",
"public static function retrieveAllUsers() {\n return R::getAll('SELECT * FROM user');\n }",
"public function index()\n {\n $users = $this->model->all();\n return view('admin/users/user', compact('users'));\n }",
"public function index()\n {\n $this->seo = [\n 'title'=>'系统用户',\n 'group'=>'用户权限',\n ];\n $this->setSeo();\n\n $models = User::orderBy('id', 'desc')->paginate(3);\n return view('admin.user.index',['models'=>$models]);\n }",
"public function actionIndex()\n {\n $searchModel = new UserSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n $dataProvider->sort = [\n 'defaultOrder' => ['id' => SORT_DESC]\n ];\n $dataProvider->pagination->pageSize = 50;\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function index()\n {\n $users = User::all();\n return view('backend.user.list', compact(['users']));\n }",
"public function actionIndex()\n {\n $searchModel = new UserSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function actionIndex()\n {\n $searchModel = new UserSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function actionIndex()\n {\n $searchModel = new UserSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function actionIndex()\n {\n $searchModel = new UserSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function actionIndex()\n {\n $searchModel = new UserSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function actionIndex()\n {\n $searchModel = new UserSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function actionIndex()\n {\n $searchModel = new UserSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function actionIndex()\n {\n $searchModel = new UserSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function actionIndex()\n {\n $searchModel = new UserSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function actionIndex()\n {\n $searchModel = new UserSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function actionIndex()\n {\n $searchModel = new UserSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function index()\n {\n $user = $this->permission(User::all(), 'id');\n\n return $this->showAll($user,User::class);\n }",
"public function getUsers() {\n\n $users = $this->users_model->getallusers();\n exit;\n }",
"public function actionIndex()\n {\n $request = Yii::$app->request;\n\n $params = ArrayHelper::merge($request->get(), [\n 'perPage' => $request->get('perPage', Yii::$app->params['per_pages'][0]),\n 'orderCol' => $request->get('orderCol', 'id'),\n 'orderDir' => $request->get('orderDir', 'asc')\n ]);\n\n $pageTitle = Yii::t('app', 'List of users');\n\n $breadcrumbs = [\n ['url' => ['/admin'], 'label' => Yii::t('app', 'Admin panel'), ],\n ['url' => ['/admin/user/list'], 'label' => $pageTitle, 'class' => 'active']\n ];\n\n $data = User::getList($params);\n\n return $this->render('/admin/user/list.twig', [\n 'params' => $params,\n 'pages' => $data['pages'],\n 'users' => $data['models'],\n 'pageTitle' => $pageTitle,\n 'breadcrumbs' => $breadcrumbs,\n ]);\n }",
"public function actionIndex()\n {\n $searchModel = new UserSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function getAllUsers() {\n self::isAdmin404();\n\n $users = User::get();\n\n return view('users', ['users' => $users]);\n }",
"public function actionIndex()\n {\n $searchModel = new UserSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n \n ]);\n }",
"public function actionIndex() {\n \n $searchModel = new UserSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function index()\n {\n $users = User::all();\n return $this->showAll($users);\n }",
"public function index()\n {\n $usuarios = User::all();\n\n return $this->showAll($usuarios);\n }",
"public function index()\n {\n $usuarios = User::all();\n\n return $this->showAll($usuarios);\n }",
"public function getUsers(){\n return self::getModel(\"users\", \"*\");\n }",
"public function actionIndex()\n {\n $searchModel = new Usersearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function showAllUsers(Request $request)\n {\n return User::all();\n }",
"public function actionIndex() {\n $searchModel = new UsersSearch;\n $dataProvider = $searchModel->search(Yii::$app->request->getQueryParams());\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n 'searchModel' => $searchModel,\n ]);\n }",
"public function index()\n {\n $data['users'] = $this->user->all();\n return view('backend.user.list')->with($data);\n }",
"function index(){\n\n \n $users = $this->User_model->all();\n\n $data = array();\n $data['users'] = $users;\n\n $this->load->view('list', $data);\n }",
"public function actionIndex()\n {\n $searchModel = new UserSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n $dataProvider->pagination->pageSize = 15;\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\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 actionIndex() {\n $searchModel = new UserSearch();\n if (!$this->user->isAdmin) {\n $searchModel->id = $this->user->id;\n }\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function index()\n {\n $user = User::all();\n return view('admin.user.list',compact('user'));\n }",
"public function actionIndex()\n {\n $searchModel = new UsersSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function actionIndex()\n {\n $searchModel = new UsersSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function actionIndex()\n {\n $searchModel = new UsersSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function index()\n {\n $users = User::All();\n return $this->showAll($users);\n }",
"public static function getUsers(){\n return self::find()->all();\n }",
"public function index()\n {\n return User::all()->toArray();\n }",
"public function actionIndex()\n {\n $searchModel = new UserSearch();\n $searchModel->rol = User::ROL_USUARIO;\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function index() {\n\t\t$user = $this->User->read(null, $this->Auth->user('id'));\n\t\t$this->User->recursive = 0;\n\t\t$this->set('users', $this->paginate());\n\t\t$this->set('userId', $user['User']['id']);\n\t\t$this->set('userType', $user['User']['type']);\n\t}",
"public function index()\n {\n return $this->userRepo->getUsers();\n }",
"public function getAllUsers()\n {\n $users = User::all();\n return $users;\n }",
"public function index()\n {\n return new UserCollection(User::all());\n }",
"public function index()\n {\n $users = User::all();\n return $users;\n }",
"public function listofUser()\n {\n return view('Admin.ShowallUser');\n }",
"public function index()\n {\n $users = User::paginate();\n return view('manage.users.index')->withUsers($users);\n }",
"public function listUsers() {\n \t$data['users'] = User::all();\n \treturn view('backend.users.index', $data);\n }",
"public static function getAllUsers() {\r\n // Create a User object\r\n $user = new User();\r\n // Return an array of user objects from the database, ordered by firstname\r\n return $user->getCollection([\"ORDER\" => ['firstname' => 'ASC']]);\r\n }",
"public function index()\n {\n $this->authorize('index', User::class);\n\n $this->validate(request(), [\n 'page' => 'integer|min:1',\n 'search' => 'string',\n 'role' => 'string',\n 'promotion' => 'string',\n ]);\n\n $users = User::filtered(\n request()->search,\n request()->role,\n request()->promotion,\n null,\n null,\n false\n )->load(['roles'])\n ->sortByDesc('created_at');\n\n if (! request('raw')) {\n $users = $users\n ->paginate(10, request()->page)\n ->withPath(route('users.index'));\n }\n\n return UserResource::collection($users);\n }",
"public function index()\n {\n return User::all(['id','name','email','created_at','updated_at']);\n }",
"public function listUsers()\n {\n $users = User::all();\n\n return view('listUsers', ['users' => User::all()]);\n\n }",
"function findAllUsers() {\r\n\r\n\t\treturn ($this->query('SELECT * FROM users;'));\r\n\r\n\t}",
"public function index()\n {\n return view('backend.user.list_user');\n }",
"public function index()\n {\n //\n $users = User::all();\n\n return $users;\n }",
"public function allUsers()\n {\n $users = User::all();\n $role=0;\n return view('admin/users/index', [\n 'users' => $users,\n 'role' => $role\n ]);\n }",
"public function getAllUsers()\n {\n // Connect to db\n $user = new User();\n $user->setDb($this->di->get(\"db\"));\n // Get users from db\n $users = $user->findAll();\n return $users;\n }",
"public function index()\n {\n\n $users = User::all();\n return $users;\n\n }",
"public function index()\n {\n $users = $this->userService->getUserWithPaginate();\n return view('admin.user.list', compact('users'));\n }",
"public function index()\n {\n $count = \\App\\User::count();\n $users = \\App\\User::orderBy('id', 'desc')->paginate(10);\n\n return view('webcontrol.user.list', compact('count', 'users'));\n }",
"public function index()\n {\n return view('admin/user-table/all-user');\n }",
"public function index()\n {\n // return collection of all users\n return UserIndexResource::collection(User::info()->get());\n }",
"public function listAction()\n {\n return new ViewModel([\n 'users' => $this->table->fetchAll(),\n ]);\n }",
"public function index()\n {\n return User::get();\n }",
"public function index()\n {\n $users = User::all();\n return view('users.userslist')->withUsers($users);\n }",
"public function index()\n {\n return UserTransformer::collection(User::all());\n }",
"public function index() {\n\t\t$this->accessible();\n\t\t$users = User::paginate(5);\n\n\t\treturn view('users.list', compact('users'));\n\t}",
"public function index()\n {\n $listUser=User::all();\n return view('admin.user.list',compact('listUser'));\n }",
"public function index()\n {\n //\n $users = User::all();\n return $users;\n }",
"public function index()\n {\n $users = QueryBuilder::for(User::class)\n ->allowedFilters([\n 'name',\n 'email',\n AllowedFilter::exact('is_admin'),\n ])\n ->defaultSort('name')\n ->allowedSorts(['name', 'email'])\n ->paginate(15);\n\n return new UserCollection($users);\n }",
"public function index()\n {\n return view('administration::user.index')\n ->withUsers($this->user->all());\n }",
"public function userlistAction()\n\t{\n\t\t$users = $this->userService->getUserList(array(), false);\n\n\t\t$this->view->roles = za()->getUser()->getAvailableRoles();\n\t\t$this->view->users = $users;\n\t\t$this->renderView('admin/user-list.php');\n\t}",
"public function actionIndex()\n {\n\t\t \t\t\t\tif(!PermissionUtils::checkModuleActionPermission(\"Users\",PermissionUtils::VIEW_ALL)){\n\t\t\t\tthrow new ForbiddenHttpException('You are not allowed to perform this action.');\n }\n $searchModel = new UsersSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function actionIndex()\n {\n $searchModel = new UserSearch();\n $searchModel->active = User::ACTIVE_YES;\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function index()\n\t{\n\t\treturn view('users')->with('users', User::All());\n\t}",
"public function index()\n {\n $users = User::paginate(10);\n\n return view('backend.users.index')->withUsers($users);\n }",
"public function index() {\n\n $users = User::all();\n return view('admin/user.index')\n ->with('users', $users);\n }",
"public function index()\n {\n $users = UserModel::all();\n\n return view('users.index', compact('users'));\n }",
"function managementUsersAll(){\n $Users = new \\Project\\Models\\ManagementUserManager();\n $allUser = $Users->allManagementUser();\n\n require 'app/views/back/managementUsers.php';\n }",
"public function index_get()\n {\n $response = $this->UserM->all_user();\n $this->response($response);\n }"
]
| [
"0.7549849",
"0.7482557",
"0.7446408",
"0.74223435",
"0.7370622",
"0.7370622",
"0.7370622",
"0.7370622",
"0.7370622",
"0.7370622",
"0.7370622",
"0.7370622",
"0.72438586",
"0.7215055",
"0.720281",
"0.7133092",
"0.7102238",
"0.70473415",
"0.7046108",
"0.70358056",
"0.70300734",
"0.7015171",
"0.7012218",
"0.7011417",
"0.7011417",
"0.7011417",
"0.7011417",
"0.7011417",
"0.7011417",
"0.7011417",
"0.7011417",
"0.7011417",
"0.7011417",
"0.7011417",
"0.70008606",
"0.6995211",
"0.698862",
"0.6987875",
"0.6982012",
"0.697305",
"0.6972373",
"0.6971599",
"0.69599754",
"0.69599754",
"0.6954801",
"0.69543874",
"0.69520634",
"0.6941403",
"0.69345915",
"0.69331217",
"0.6924661",
"0.6921837",
"0.6921048",
"0.6920427",
"0.69104016",
"0.69104016",
"0.69104016",
"0.6904807",
"0.69037557",
"0.68995297",
"0.68968153",
"0.6895193",
"0.6884756",
"0.6879643",
"0.6873385",
"0.6870186",
"0.6869953",
"0.6859427",
"0.6851485",
"0.68511677",
"0.68290585",
"0.6821002",
"0.6809605",
"0.680941",
"0.6802254",
"0.679773",
"0.67929715",
"0.67866683",
"0.6772769",
"0.67673886",
"0.67645353",
"0.6746893",
"0.6741695",
"0.673987",
"0.6733633",
"0.6731413",
"0.67294335",
"0.67234975",
"0.6717108",
"0.6710899",
"0.67101735",
"0.6709034",
"0.66969895",
"0.6693224",
"0.6691836",
"0.66904217",
"0.6689409",
"0.6689256",
"0.66883934",
"0.66833985",
"0.66820955"
]
| 0.0 | -1 |
Create a new controller instance. | public function __construct()
{
$this->middleware('auth');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function createController()\n {\n $this->createClass('controller');\n }",
"protected function createController()\n {\n $controller = Str::studly(class_basename($this->getNameInput()));\n\n $modelName = $this->qualifyClass('Models/'.$this->getNameInput());\n\n $this->call('make:controller', array_filter([\n 'name' => \"{$controller}Controller\",\n '--model' => $modelName,\n '--api' => true,\n ]));\n }",
"protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n $model_name = $this->qualifyClass($this->getNameInput());\n $name = Str::contains($model_name, ['\\\\']) ? Str::afterLast($model_name, '\\\\') : $model_name;\n\n $this->call('make:controller', [\n 'name' => \"{$controller}Controller\",\n '--model' => $model_name,\n ]);\n\n $path = base_path() . \"/app/Http/Controllers/{$controller}Controller.php\";\n $this->cleanupDummy($path, $name);\n }",
"private function makeInitiatedController()\n\t{\n\t\t$controller = new TestEntityCRUDController();\n\n\t\t$controller->setLoggerWrapper(Logger::create());\n\n\t\treturn $controller;\n\t}",
"protected function createController()\n {\n $controller = Str::studly(class_basename($this->argument('name')));\n\n $modelName = $this->qualifyClass($this->getNameInput());\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n ]));\n\n $this->call(ControllerMakeCommand::class, array_filter([\n 'name' => \"Api/{$controller}/{$controller}Controller\",\n '--model' => $this->option('resource') || $this->option('api') ? $modelName : null,\n '--api' => true,\n ]));\n }",
"protected function createController()\n {\n $name = str_replace(\"Service\",\"\",$this->argument('name'));\n\n $this->call('make:controller', [\n 'name' => \"{$name}Controller\"\n ]);\n }",
"protected function createController()\n {\n $params = [\n 'name' => $this->argument('name'),\n ];\n\n if ($this->option('api')) {\n $params['--api'] = true;\n }\n\n $this->call('wizard:controller', $params);\n }",
"public function generateController () {\r\n $controllerParam = \\app\\lib\\router::getPath();\r\n $controllerName = \"app\\controller\\\\\" . end($controllerParam);\r\n $this->controller = new $controllerName;\r\n }",
"public static function newController($controller)\n\t{\n\t\t$objController = \"App\\\\Controllers\\\\\".$controller;\n\t\treturn new $objController;\n\t}",
"public function createController()\n\t{\n\t\tif(class_exists($this->controller))\n\t\t{\n\t\t\t// get the parent class he extends\n\t\t\t$parents = class_parents($this->controller);\n\n\t\t\t// $parents = class_implements($this->controller); used if our Controller was just an interface not a class\n\n\t\t\t// check if the class implements our Controller Class\n\t\t\tif(in_array(\"Controller\", $parents))\n\t\t\t{\n\t\t\t\t// check if the action in the request exists in that class\n\t\t\t\tif(method_exists($this->controller, $this->action))\n\t\t\t\t{\n\t\t\t\t\treturn new $this->controller($this->action, $this->request);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\t// Action is not exist\n\t\t\t\t\techo 'Method '. $this->action .' doesn\\'t exist in '. $this->controller;\n\t\t\t\t}\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t// The controller doesn't extends our Controller Class\n\t\t\t\techo $this->controller.' doesn\\'t extends our Controller Class';\n\t\t\t}\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// Controller Doesn't exist\n\t\t\techo $this->controller.' doesn\\'t exist';\n\t\t}\n\t}",
"public function createController( ezcMvcRequest $request );",
"public function createController() {\n //check our requested controller's class file exists and require it if so\n /*if (file_exists(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\")) {\n require(__DIR__ . \"/../Controllers/\" . $this->controllerName . \".php\");\n } else {\n throw new Exception('Route does not exist');\n }*/\n\n try {\n require_once __DIR__ . '/../Controllers/' . $this->controllerName . '.php';\n } catch (Exception $e) {\n return $e;\n }\n \n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n \n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\",$parents)) { \n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->endpoint)) {\n return new $this->controllerClass($this->args, $this->endpoint, $this->domain);\n } else {\n throw new Exception('Action does not exist');\n }\n } else {\n throw new Exception('Class does not inherit correctly.');\n }\n } else {\n throw new Exception('Controller does not exist.');\n }\n }",
"public static function create()\n\t{\n\t\t//check, if a JobController instance already exists\n\t\tif(JobController::$jobController == null)\n\t\t{\n\t\t\tJobController::$jobController = new JobController();\n\t\t}\n\n\t\treturn JobController::$jobController;\n\t}",
"private function controller()\n {\n $location = $this->args[\"location\"] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n $relative_location = $this->args['application_folder'] . DIRECTORY_SEPARATOR . 'controllers' . DIRECTORY_SEPARATOR;\n\n if (!empty($this->args['subdirectories']))\n {\n $location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n $relative_location .= $this->args['subdirectories'] . DIRECTORY_SEPARATOR;\n }\n\n if (!is_dir($location))\n {\n mkdir($location, 0755, TRUE);\n }\n\n $relative_location .= $this->args['filename'];\n $filename = $location . $this->args['filename'];\n\n $args = array(\n \"class_name\" => ApplicationHelpers::camelize($this->args['name']),\n \"filename\" => $this->args['filename'],\n \"application_folder\" => $this->args['application_folder'],\n \"parent_class\" => (isset($this->args['parent'])) ? $this->args['parent'] : $this->args['parent_controller'],\n \"extra\" => $this->extra,\n 'relative_location' => $relative_location,\n 'helper_name' => strtolower($this->args['name']) . '_helper',\n );\n\n $template = new TemplateScanner(\"controller\", $args);\n $controller = $template->parse();\n\n $message = \"\\t\";\n if (file_exists($filename))\n {\n $message .= 'Controller already exists : ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'light_blue');\n }\n $message .= $relative_location;\n }\n elseif (file_put_contents($filename, $controller))\n {\n $message .= 'Created controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'green');\n }\n $message .= $relative_location;\n }\n else\n {\n $message .= 'Unable to create controller: ';\n if (php_uname(\"s\") !== \"Windows NT\")\n {\n $message = ApplicationHelpers::colorize($message, 'red');\n }\n $message .= $relative_location;\n }\n\n // The controller has been generated, output the confirmation message\n fwrite(STDOUT, $message . PHP_EOL);\n\n // Create the helper files.\n $this->helpers();\n\n $this->assets();\n\n // Create the view files.\n $this->views();\n\n return;\n }",
"public function createController( $controllerName ) {\r\n\t\t$refController \t\t= $this->instanceOfController( $controllerName );\r\n\t\t$refConstructor \t= $refController->getConstructor();\r\n\t\tif ( ! $refConstructor ) return $refController->newInstance();\r\n\t\t$initParameter \t\t= $this->setParameter( $refConstructor );\r\n\t\treturn $refController->newInstanceArgs( $initParameter ); \r\n\t}",
"public function create($controllerName) {\r\n\t\tif (!$controllerName)\r\n\t\t\t$controllerName = $this->defaultController;\r\n\r\n\t\t$controllerName = ucfirst(strtolower($controllerName)).'Controller';\r\n\t\t$controllerFilename = $this->searchDir.'/'.$controllerName.'.php';\r\n\r\n\t\tif (preg_match('/[^a-zA-Z0-9]/', $controllerName))\r\n\t\t\tthrow new Exception('Invalid controller name', 404);\r\n\r\n\t\tif (!file_exists($controllerFilename)) {\r\n\t\t\tthrow new Exception('Controller not found \"'.$controllerName.'\"', 404);\r\n\t\t}\r\n\r\n\t\trequire_once $controllerFilename;\r\n\r\n\t\tif (!class_exists($controllerName) || !is_subclass_of($controllerName, 'Controller'))\r\n\t\t\tthrow new Exception('Unknown controller \"'.$controllerName.'\"', 404);\r\n\r\n\t\t$this->controller = new $controllerName();\r\n\t\treturn $this;\r\n\t}",
"private function createController($controllerName)\n {\n $className = ucfirst($controllerName) . 'Controller';\n ${$this->lcf($controllerName) . 'Controller'} = new $className();\n return ${$this->lcf($controllerName) . 'Controller'};\n }",
"public function createControllerObject(string $controller)\n {\n $this->checkControllerExists($controller);\n $controller = $this->ctlrStrSrc.$controller;\n $controller = new $controller();\n return $controller;\n }",
"public function create_controller($controller, $action){\n\t $creado = false;\n\t\t$controllers_dir = Kumbia::$active_controllers_dir;\n\t\t$file = strtolower($controller).\"_controller.php\";\n\t\tif(file_exists(\"$controllers_dir/$file\")){\n\t\t\tFlash::error(\"Error: El controlador '$controller' ya existe\\n\");\n\t\t} else {\n\t\t\tif($this->post(\"kind\")==\"applicationcontroller\"){\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends ApplicationController {\\n\\n\\t\\tfunction $action(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tif(@file_put_contents(\"$controllers_dir/$file\", $filec)){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$filec = \"<?php\\n\t\t\t\\n\tclass \".ucfirst($controller).\"Controller extends StandardForm {\\n\\n\\t\\tpublic \\$scaffold = true;\\n\\n\\t\\tpublic function __construct(){\\n\\n\\t\\t}\\n\\n\t}\\n\t\\n?>\\n\";\n\t\t\t\tfile_put_contents(\"$controllers_dir/$file\", $filec);\n\t\t\t\tif($this->create_model($controller, $controller, \"index\")){\n\t\t\t\t $creado = true;\n\t\t\t\t}\n\t\t\t}\n\t\t\tif($creado){\n\t\t\t Flash::success(\"Se creó correctamente el controlador '$controller' en '$controllers_dir/$file'\");\n\t\t\t}else {\n\t\t\t Flash::error(\"Error: No se pudo escribir en el directorio, verifique los permisos sobre el directorio\");\n\t\t\t}\n\t\t\t\n\t\t}\n\t\t$this->route_to(\"controller: $controller\", \"action: $action\");\n\t}",
"private function instanceController( string $controller_class ): Controller {\n\t\treturn new $controller_class( $this->request, $this->site );\n\t}",
"public function makeController($controller_name)\n\t{\n\t\t$model\t= $this->_makeModel($controller_name, $this->_storage_type);\n\t\t$view\t= $this->_makeView($controller_name);\n\t\t\n\t\treturn new $controller_name($model, $view);\n\t}",
"public function create()\n {\n $output = new \\Symfony\\Component\\Console\\Output\\ConsoleOutput();\n $output->writeln(\"<info>Controller Create</info>\");\n }",
"protected function createDefaultController() {\n Octopus::requireOnce($this->app->getOption('OCTOPUS_DIR') . 'controllers/Default.php');\n return new DefaultController();\n }",
"private function createControllerDefinition()\n {\n $id = $this->getServiceId('controller');\n if (!$this->container->has($id)) {\n $definition = new Definition($this->getServiceClass('controller'));\n $definition\n ->addMethodCall('setConfiguration', [new Reference($this->getServiceId('configuration'))])\n ->addMethodCall('setContainer', [new Reference('service_container')])\n ;\n $this->container->setDefinition($id, $definition);\n }\n }",
"public function createController( $ctrlName, $action ) {\n $args['action'] = $action;\n $args['path'] = $this->path . '/modules/' . $ctrlName;\n $ctrlFile = $args['path'] . '/Controller.php';\n // $args['moduleName'] = $ctrlName;\n if ( file_exists( $ctrlFile ) ) {\n $ctrlPath = str_replace( CITRUS_PATH, '', $args['path'] );\n $ctrlPath = str_replace( '/', '\\\\', $ctrlPath ) . '\\Controller';\n try { \n $r = new \\ReflectionClass( $ctrlPath ); \n $inst = $r->newInstanceArgs( $args ? $args : array() );\n\n $this->controller = Citrus::apply( $inst, Array( \n 'name' => $ctrlName, \n ) );\n if ( $this->controller->is_protected == null ) {\n $this->controller->is_protected = $this->is_protected;\n }\n return $this->controller;\n } catch ( \\Exception $e ) {\n prr($e, true);\n }\n } else {\n return false;\n }\n }",
"protected function createTestController() {\n\t\t$controller = new CController('test');\n\n\t\t$action = $this->getMock('CAction', array('run'), array($controller, 'test'));\n\t\t$controller->action = $action;\n\n\t\tYii::app()->controller = $controller;\n\t\treturn $controller;\n\t}",
"public static function newController($controllerName, $params = [], $request = null) {\n\n\t\t$controller = \"App\\\\Controllers\\\\\".$controllerName;\n\n\t\treturn new $controller($params, $request);\n\n\t}",
"private function loadController() : void\n\t{\n\t\t$this->controller = new $this->controllerName($this->request);\n\t}",
"public function createController($pi, array $params)\n {\n $class = $pi . '_Controller_' . ucfirst($params['page']);\n\n return new $class();\n }",
"public function createController() {\n //check our requested controller's class file exists and require it if so\n \n if (file_exists(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\" ) && $this->controllerName != 'error') {\n require(\"modules/\" . $this->controllerName . \"/controllers/\" . $this->controllerName .\".php\");\n \n } else {\n \n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n\n //does the class exist?\n if (class_exists($this->controllerClass)) {\n $parents = class_parents($this->controllerClass);\n //does the class inherit from the BaseController class?\n if (in_array(\"BaseController\", $parents)) {\n //does the requested class contain the requested action as a method?\n if (method_exists($this->controllerClass, $this->action)) { \n return new $this->controllerClass($this->action, $this->urlValues);\n \n } else {\n //bad action/method error\n $this->urlValues['controller'] = \"error\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badview\", $this->urlValues);\n }\n } else {\n $this->urlValues['controller'] = \"error\";\n //bad controller error\n echo \"hjh\";\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"b\", $this->urlValues);\n }\n } else {\n \n //bad controller error\n require(\"modules/error/controllers/error.php\");\n return new ErrorController(\"badurl\", $this->urlValues);\n }\n }",
"protected static function createController($name) {\n $result = null;\n\n $name = self::$_namespace . ($name ? $name : self::$defaultController) . 'Controller';\n if(class_exists($name)) {\n $controllerClass = new \\ReflectionClass($name);\n if($controllerClass->hasMethod('run')) {\n $result = new $name();\n }\n }\n\n return $result;\n }",
"public function createController(): void\n {\n $minimum_buffer_min = 3;\n $token_ok = $this->routerService->ds_token_ok($minimum_buffer_min);\n if ($token_ok) {\n # 2. Call the worker method\n # More data validation would be a good idea here\n # Strip anything other than characters listed\n $results = $this->worker($this->args);\n\n if ($results) {\n # Redirect the user to the NDSE view\n # Don't use an iFrame!\n # State can be stored/recovered using the framework's session or a\n # query parameter on the returnUrl\n header('Location: ' . $results[\"redirect_url\"]);\n exit;\n }\n } else {\n $this->clientService->needToReAuth($this->eg);\n }\n }",
"protected function createController($controllerClass)\n {\n $cls = new ReflectionClass($controllerClass);\n return $cls->newInstance($this->environment);\n }",
"protected function createController($name)\n {\n $controllerClass = 'controller\\\\'.ucfirst($name).'Controller';\n\n if(!class_exists($controllerClass)) {\n throw new \\Exception('Controller class '.$controllerClass.' not exists!');\n }\n\n return new $controllerClass();\n }",
"protected function initController() {\n\t\tif (!isset($_GET['controller'])) {\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$controllerClass = $_GET['controller'].\"Controller\";\n\t\tif (!class_exists($controllerClass)) {\n\t\t\t//Console::error(@$_GET['controller'].\" doesn't exist\");\n\t\t\t$this->initDefaultController();\n\t\t\treturn;\n\t\t}\n\t\t$this->controller = new $controllerClass();\n\t}",
"public function makeTestController(TestController $controller)\r\n\t{\r\n\t}",
"static function factory($GET=array(), $POST=array(), $FILES=array()) {\n $type = (isset($GET['type'])) ? $GET['type'] : '';\n $objectController = $type.'_Controller';\n $addLocation = $type.'/'.$objectController.'.php';\n foreach ($_ENV['locations'] as $location) {\n if (is_file($location.$addLocation)) {\n return new $objectController($GET, $POST, $FILES);\n } \n }\n throw new Exception('The controller \"'.$type.'\" does not exist.');\n }",
"public function create()\n {\n $general = new ModeloController();\n\n return $general->create();\n }",
"public function makeController($controllerNamespace, $controllerName, Log $log, $session, Request $request, Response $response)\r\n\t{\r\n\t\t$fullControllerName = '\\\\Application\\\\Controller\\\\' . (!empty($controllerNamespace) ? $controllerNamespace . '\\\\' : '') . $controllerName;\r\n\t\t$controller = new $fullControllerName();\r\n\t\t$controller->setConfig($this->config);\r\n\t\t$controller->setRequest($request);\r\n\t\t$controller->setResponse($response);\r\n\t\t$controller->setLog($log);\r\n\t\tif (isset($session))\r\n\t\t{\r\n\t\t\t$controller->setSession($session);\r\n\t\t}\r\n\r\n\t\t// Execute additional factory method, if available (exists in \\Application\\Controller\\Factory)\r\n\t\t$method = 'make' . $controllerName;\r\n\t\tif (is_callable(array($this, $method)))\r\n\t\t{\r\n\t\t\t$this->$method($controller);\r\n\t\t}\r\n\r\n\t\t// If the controller has an init() method, call it now\r\n\t\tif (is_callable(array($controller, 'init')))\r\n\t\t{\r\n\t\t\t$controller->init();\r\n\t\t}\r\n\r\n\t\treturn $controller;\r\n\t}",
"public static function create()\n\t{\n\t\t//check, if an AccessGroupController instance already exists\n\t\tif(AccessGroupController::$accessGroupController == null)\n\t\t{\n\t\t\tAccessGroupController::$accessGroupController = new AccessGroupController();\n\t\t}\n\n\t\treturn AccessGroupController::$accessGroupController;\n\t}",
"public static function buildController()\n\t{\n\t\t$file = CONTROLLER_PATH . 'indexController.class.php';\n\n\t\tif(!file_exists($file))\n\t\t{\n\t\t\tif(\\RCPHP\\Util\\Check::isClient())\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \"Welcome RcPHP!\\n\";\n }\n}';\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\t$controller = '<?php\nclass indexController extends \\RCPHP\\Controller {\n public function index(){\n echo \\'<style type=\"text/css\">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: \"微软雅黑\"; color: #333;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px }</style><div style=\"padding: 24px 48px;\"> <h1>:)</h1><p>Welcome <b>RcPHP</b>!</p></div>\\';\n }\n}';\n\t\t\t}\n\t\t\tfile_put_contents($file, $controller);\n\t\t}\n\t}",
"public function getController( );",
"public static function getInstance() : Controller {\n if ( null === self::$instance ) {\n self::$instance = new self();\n self::$instance->options = new Options(\n self::OPTIONS_KEY\n );\n }\n\n return self::$instance;\n }",
"static function appCreateController($entityName, $prefijo = '') {\n\n $controller = ControllerBuilder::getController($entityName, $prefijo);\n $entityFile = ucfirst(str_replace($prefijo, \"\", $entityName));\n $fileController = \"../../modules/{$entityFile}/{$entityFile}Controller.class.php\";\n\n $result = array();\n $ok = self::createArchive($fileController, $controller);\n ($ok) ? array_push($result, \"Ok, {$fileController} created\") : array_push($result, \"ERROR creating {$fileController}\");\n\n return $result;\n }",
"public static function newInstance($path = \\simpleChat\\Utility\\ROOT_PATH)\n {\n $request = new Request();\n \n \n if ($request->isAjax())\n {\n return new AjaxController();\n }\n else if ($request->jsCode())\n {\n return new JsController();\n }\n else\n {\n return new StandardController($path);\n }\n }",
"private function createInstance()\n {\n $objectManager = new \\Magento\\Framework\\TestFramework\\Unit\\Helper\\ObjectManager($this);\n $this->controller = $objectManager->getObject(\n \\Magento\\NegotiableQuote\\Controller\\Adminhtml\\Quote\\RemoveFailedSku::class,\n [\n 'context' => $this->context,\n 'logger' => $this->logger,\n 'messageManager' => $this->messageManager,\n 'cart' => $this->cart,\n 'resultRawFactory' => $this->resultRawFactory\n ]\n );\n }",
"function loadController(){\n $name = ucfirst($this->request->controller).'Controller' ;\n $file = ROOT.DS.'Controller'.DS.$name.'.php' ;\n /*if(!file_exists($file)){\n $this->error(\"Le controleur \".$this->request->controller.\" n'existe pas\") ;\n }*/\n require_once $file;\n $controller = new $name($this->request);\n return $controller ;\n }",
"public function __construct(){\r\n $app = Application::getInstance();\r\n $this->_controller = $app->getController();\r\n }",
"public static function & instance()\n {\n if (self::$instance === null) {\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Include the Controller file\n require Router::$controller_path;\n\n try {\n // Start validation of the controller\n $class = new ReflectionClass(ucfirst(Router::$controller).'_Controller');\n } catch (ReflectionException $e) {\n // Controller does not exist\n Event::run('system.404');\n }\n\n if ($class->isAbstract() or (IN_PRODUCTION and $class->getConstant('ALLOW_PRODUCTION') == false)) {\n // Controller is not allowed to run in production\n Event::run('system.404');\n }\n\n // Run system.pre_controller\n Event::run('system.pre_controller');\n\n // Create a new controller instance\n $controller = $class->newInstance();\n\n // Controller constructor has been executed\n Event::run('system.post_controller_constructor');\n\n try {\n // Load the controller method\n $method = $class->getMethod(Router::$method);\n\n // Method exists\n if (Router::$method[0] === '_') {\n // Do not allow access to hidden methods\n Event::run('system.404');\n }\n\n if ($method->isProtected() or $method->isPrivate()) {\n // Do not attempt to invoke protected methods\n throw new ReflectionException('protected controller method');\n }\n\n // Default arguments\n $arguments = Router::$arguments;\n } catch (ReflectionException $e) {\n // Use __call instead\n $method = $class->getMethod('__call');\n\n // Use arguments in __call format\n $arguments = array(Router::$method, Router::$arguments);\n }\n\n // Stop the controller setup benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_setup');\n\n // Start the controller execution benchmark\n Benchmark::start(SYSTEM_BENCHMARK.'_controller_execution');\n\n // Execute the controller method\n $method->invokeArgs($controller, $arguments);\n\n // Controller method has been executed\n Event::run('system.post_controller');\n\n // Stop the controller execution benchmark\n Benchmark::stop(SYSTEM_BENCHMARK.'_controller_execution');\n }\n\n return self::$instance;\n }",
"protected function instantiateController($class)\n {\n $controller = new $class();\n\n if ($controller instanceof Controller) {\n $controller->setContainer($this->container);\n }\n\n return $controller;\n }",
"public function __construct (){\n $this->AdminController = new AdminController();\n $this->ArticleController = new ArticleController();\n $this->AuditoriaController = new AuditoriaController();\n $this->CommentController = new CommentController();\n $this->CourseController = new CourseController();\n $this->InscriptionsController = new InscriptionsController();\n $this->ModuleController = new ModuleController();\n $this->PlanController = new PlanController();\n $this->ProfileController = new ProfileController();\n $this->SpecialtyController = new SpecialtyController();\n $this->SubscriptionController = new SubscriptionController();\n $this->TeacherController = new TeacherController();\n $this->UserController = new UserController();\n $this->WebinarController = new WebinarController();\n }",
"protected function makeController($prefix)\n {\n new MakeController($this, $this->files, $prefix);\n }",
"public function createController($route)\n {\n $controller = parent::createController('gymv/' . $route);\n return $controller === false\n ? parent::createController($route)\n : $controller;\n }",
"public static function createFrontController()\n {\n return self::createInjectorWithBindings(self::extractArgs(func_get_args()))\n ->getInstance('net::stubbles::websites::stubFrontController');\n }",
"public static function controller($name)\n {\n $name = ucfirst(strtolower($name));\n \n $directory = 'controller';\n $filename = $name;\n $tracker = 'controller';\n $init = (boolean) $init;\n $namespace = 'controller';\n $class_name = $name;\n \n return self::_load($directory, $filename, $tracker, $init, $namespace, $class_name);\n }",
"protected static function instantiateMockController()\n {\n /** @var Event $oEvent */\n $oEvent = Factory::service('Event');\n\n if (!$oEvent->hasBeenTriggered(Events::SYSTEM_STARTING)) {\n\n require_once BASEPATH . 'core/Controller.php';\n\n load_class('Output', 'core');\n load_class('Security', 'core');\n load_class('Input', 'core');\n load_class('Lang', 'core');\n\n new NailsMockController();\n }\n }",
"private static function controller()\n {\n $files = ['Controller'];\n $folder = static::$root.'MVC'.'/';\n\n self::call($files, $folder);\n }",
"public function createController()\n\t{\n\t\t$originalFile = app_path('Http/Controllers/Reports/SampleReport.php');\n\t\t$newFile = dirname($originalFile) . DIRECTORY_SEPARATOR . $this->class . $this->sufix . '.php';\n\n\t\t// Read original file\n\t\tif( ! $content = file_get_contents($originalFile))\n\t\t\treturn false;\n\n\t\t// Replace class name\n\t\t$content = str_replace('SampleReport', $this->class . $this->sufix, $content);\n\n\t\t// Write new file\n\t\treturn (bool) file_put_contents($newFile, $content);\n\t}",
"public function runController() {\n // Check for a router\n if (is_null($this->getRouter())) {\n \t // Set the method to load\n \t $sController = ucwords(\"{$this->getController()}Controller\");\n } else {\n\n // Set the controller with the router\n $sController = ucwords(\"{$this->getController()}\".ucfirst($this->getRouter()).\"Controller\");\n }\n \t// Check for class\n \tif (class_exists($sController, true)) {\n \t\t// Set a new instance of Page\n \t\t$this->setPage(new Page());\n \t\t// The class exists, load it\n \t\t$oController = new $sController();\n\t\t\t\t// Now check for the proper method \n\t\t\t\t// inside of the controller class\n\t\t\t\tif (method_exists($oController, $this->loadConfigVar('systemSettings', 'controllerLoadMethod'))) {\n\t\t\t\t\t// We have a valid controller, \n\t\t\t\t\t// execute the initializer\n\t\t\t\t\t$oController->init($this);\n\t\t\t\t\t// Set the variable scope\n\t \t\t$this->setViewScope($oController);\n\t \t\t// Render the layout\n\t \t\t$this->renderLayout();\n\t\t\t\t} else {\n\t\t\t\t\t// The initializer does not exist, \n\t\t\t\t\t// which means an invalid controller, \n\t\t\t\t\t// so now we let the caller know\n\t\t\t\t\t$this->setError($this->loadConfigVar('errorMessages', 'invalidController'));\n\t\t\t\t\t// Run the error\n\t\t\t\t\t// $this->runError();\n\t\t\t\t}\n \t// The class does not exist\n \t} else {\n\t\t\t\t// Set the system error\n\t \t\t$this->setError(\n\t\t\t\t\tstr_replace(\n\t\t\t\t\t\t':controllerName', \n\t\t\t\t\t\t$sController, \n\t\t\t\t\t\t$this->loadConfigVar(\n\t\t\t\t\t\t\t'errorMessages', \n\t\t\t\t\t\t\t'controllerDoesNotExist'\n\t\t\t\t\t\t)\n\t\t\t\t\t)\n\t\t\t\t);\n \t\t// Run the error\n\t\t\t\t// $this->runError();\n \t}\n \t// Return instance\n \treturn $this;\n }",
"public function controller()\n\t{\n\t\n\t}",
"protected function buildController()\n {\n $columns = collect($this->columns)->pluck('column')->implode('|');\n\n $permissions = [\n 'create:'.$this->module->createPermission->name,\n 'edit:'.$this->module->editPermission->name,\n 'delete:'.$this->module->deletePermission->name,\n ];\n\n $this->controller = [\n 'name' => $this->class,\n '--model' => $this->class,\n '--request' => $this->class.'Request',\n '--permissions' => implode('|', $permissions),\n '--view-folder' => snake_case($this->module->name),\n '--fields' => $columns,\n '--module' => $this->module->id,\n ];\n }",
"function getController(){\n\treturn getFactory()->getBean( 'Controller' );\n}",
"protected function getController()\n {\n $uri = WingedLib::clearPath(static::$parentUri);\n if (!$uri) {\n $uri = './';\n $explodedUri = ['index', 'index'];\n } else {\n $explodedUri = explode('/', $uri);\n if (count($explodedUri) == 1) {\n $uri = './' . $explodedUri[0] . '/';\n } else {\n $uri = './' . $explodedUri[0] . '/' . $explodedUri[1] . '/';\n }\n }\n\n $indexUri = WingedLib::clearPath(\\WingedConfig::$config->INDEX_ALIAS_URI);\n if ($indexUri) {\n $indexUri = explode('/', $indexUri);\n }\n\n if ($indexUri) {\n if ($explodedUri[0] === 'index' && isset($indexUri[0])) {\n static::$controllerName = Formater::camelCaseClass($indexUri[0]) . 'Controller';\n $uri = './' . $indexUri[0] . '/';\n }\n if (isset($explodedUri[1]) && isset($indexUri[1])) {\n if ($explodedUri[1] === 'index') {\n static::$controllerAction = 'action' . Formater::camelCaseMethod($indexUri[1]);\n $uri .= $indexUri[1] . '/';\n }\n } else {\n $uri .= 'index/';\n }\n }\n\n $controllerDirectory = new Directory(static::$parent . 'controllers/', false);\n if ($controllerDirectory->exists()) {\n $controllerFile = new File($controllerDirectory->folder . static::$controllerName . '.php', false);\n if ($controllerFile->exists()) {\n include_once $controllerFile->file_path;\n if (class_exists(static::$controllerName)) {\n $controller = new static::$controllerName();\n if (method_exists($controller, static::$controllerAction)) {\n try {\n $reflectionMethod = new \\ReflectionMethod(static::$controllerName, static::$controllerAction);\n $pararms = [];\n foreach ($reflectionMethod->getParameters() as $parameter) {\n $pararms[$parameter->getName()] = $parameter->isOptional();\n }\n } catch (\\Exception $exception) {\n $pararms = [];\n }\n return [\n 'uri' => $uri,\n 'params' => $pararms,\n ];\n }\n }\n }\n }\n return false;\n }",
"public function __construct()\n {\n $this->controller = new DHTController();\n }",
"public function createController($controllers) {\n\t\tforeach($controllers as $module=>$controllers) {\n\t\t\tforeach($controllers as $key=>$controller) {\n\t\t\t\tif(!file_exists(APPLICATION_PATH.\"/modules/$module/controllers/\".ucfirst($controller).\"Controller.php\")) {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",\"Create '\".ucfirst($controller).\"' controller in $module\");\t\t\t\t\n\t\t\t\t\texec(\"zf create controller $controller index-action-included=0 $module\");\t\t\t\t\t\n\t\t\t\t}\telse {\n\t\t\t\t\tMy_Class_Maerdo_Console::display(\"3\",ucfirst($controller).\"' controller in $module already exists\");\t\n\t\t\t\t}\n\t\t\t}\t\n\t\t}\n\t}",
"protected function instantiateController($class)\n {\n return new $class($this->routesMaker);\n }",
"private function createController($table){\n\n // Filtering file name\n $fileName = $this::cleanToName($table[\"name\"]) . 'Controller.php';\n\n // Prepare the Class scheme inside the controller\n $contents = '<?php '.$fileName.' ?>';\n\n\n // Return a boolean to process completed\n return Storage::disk('controllers')->put($this->appNamePath.'/'.$fileName, $contents);\n\n }",
"public function GetController()\n\t{\n\t\t$params = $this->QueryVarArrayToParameterArray($_GET);\n\t\tif (!empty($_POST)) {\n\t\t\t$params = array_merge($params, $this->QueryVarArrayToParameterArray($_POST));\n\t\t}\n\n\t\tif (!empty($_GET['q'])) {\n\t\t\t$restparams = GitPHP_Router::ReadCleanUrl($_SERVER['REQUEST_URI']);\n\t\t\tif (count($restparams) > 0)\n\t\t\t\t$params = array_merge($params, $restparams);\n\t\t}\n\n\t\t$controller = null;\n\n\t\t$action = null;\n\t\tif (!empty($params['action']))\n\t\t\t$action = $params['action'];\n\n\t\tswitch ($action) {\n\n\n\t\t\tcase 'search':\n\t\t\t\t$controller = new GitPHP_Controller_Search();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commitdiff':\n\t\t\tcase 'commitdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Commitdiff();\n\t\t\t\tif ($action === 'commitdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blobdiff':\n\t\t\tcase 'blobdiff_plain':\n\t\t\t\t$controller = new GitPHP_Controller_Blobdiff();\n\t\t\t\tif ($action === 'blobdiff_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'history':\n\t\t\t\t$controller = new GitPHP_Controller_History();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'shortlog':\n\t\t\tcase 'log':\n\t\t\t\t$controller = new GitPHP_Controller_Log();\n\t\t\t\tif ($action === 'shortlog')\n\t\t\t\t\t$controller->SetParam('short', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'snapshot':\n\t\t\t\t$controller = new GitPHP_Controller_Snapshot();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tree':\n\t\t\tcase 'trees':\n\t\t\t\t$controller = new GitPHP_Controller_Tree();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'tags':\n\t\t\t\tif (empty($params['tag'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Tags();\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\tcase 'tag':\n\t\t\t\t$controller = new GitPHP_Controller_Tag();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'heads':\n\t\t\t\t$controller = new GitPHP_Controller_Heads();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blame':\n\t\t\t\t$controller = new GitPHP_Controller_Blame();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'blob':\n\t\t\tcase 'blobs':\n\t\t\tcase 'blob_plain':\t\n\t\t\t\t$controller = new GitPHP_Controller_Blob();\n\t\t\t\tif ($action === 'blob_plain')\n\t\t\t\t\t$controller->SetParam('output', 'plain');\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'atom':\n\t\t\tcase 'rss':\n\t\t\t\t$controller = new GitPHP_Controller_Feed();\n\t\t\t\tif ($action == 'rss')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::RssFormat);\n\t\t\t\telse if ($action == 'atom')\n\t\t\t\t\t$controller->SetParam('format', GitPHP_Controller_Feed::AtomFormat);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'commit':\n\t\t\tcase 'commits':\n\t\t\t\t$controller = new GitPHP_Controller_Commit();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'summary':\n\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'project_index':\n\t\t\tcase 'projectindex':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('txt', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'opml':\n\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t$controller->SetParam('opml', true);\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'login':\n\t\t\t\t$controller = new GitPHP_Controller_Login();\n\t\t\t\tif (!empty($_POST['username']))\n\t\t\t\t\t$controller->SetParam('username', $_POST['username']);\n\t\t\t\tif (!empty($_POST['password']))\n\t\t\t\t\t$controller->SetParam('password', $_POST['password']);\n\t\t\t\tbreak;\n\n\t\t\tcase 'logout':\n\t\t\t\t$controller = new GitPHP_Controller_Logout();\n\t\t\t\tbreak;\n\n\n\t\t\tcase 'graph':\n\t\t\tcase 'graphs':\n\t\t\t\t//$controller = new GitPHP_Controller_Graph();\n\t\t\t\t//break;\n\t\t\tcase 'graphdata':\n\t\t\t\t//$controller = new GitPHP_Controller_GraphData();\n\t\t\t\t//break;\n\t\t\tdefault:\n\t\t\t\tif (!empty($params['project'])) {\n\t\t\t\t\t$controller = new GitPHP_Controller_Project();\n\t\t\t\t} else {\n\t\t\t\t\t$controller = new GitPHP_Controller_ProjectList();\n\t\t\t\t}\n\t\t}\n\n\t\tforeach ($params as $paramname => $paramval) {\n\t\t\tif ($paramname !== 'action')\n\t\t\t\t$controller->SetParam($paramname, $paramval);\n\t\t}\n\n\t\t$controller->SetRouter($this);\n\n\t\treturn $controller;\n\t}",
"public function testCreateTheControllerClass()\n {\n $controller = new Game21Controller();\n $this->assertInstanceOf(\"\\App\\Http\\Controllers\\Game21Controller\", $controller);\n }",
"public static function createController( MShop_Context_Item_Interface $context, $name = null );",
"public function __construct()\n {\n\n $url = $this->splitURL();\n // echo $url[0];\n\n // check class file exists\n if (file_exists(\"../app/controllers/\" . strtolower($url[0]) . \".php\")) {\n $this->controller = strtolower($url[0]);\n unset($url[0]);\n }\n\n // echo $this->controller;\n\n require \"../app/controllers/\" . $this->controller . \".php\";\n\n // create Instance(object)\n $this->controller = new $this->controller(); // $this->controller is an object from now on\n if (isset($url[1])) {\n if (method_exists($this->controller, $url[1])) {\n $this->method = $url[1];\n unset($url[1]);\n }\n }\n\n // run the class and method\n $this->params = array_values($url); // array_values 값들인 인자 0 부터 다시 배치\n call_user_func_array([$this->controller, $this->method], $this->params);\n }",
"public function getController();",
"public function getController();",
"public function getController();",
"public function createController($pageType, $template)\n {\n $controller = null;\n\n // Use factories first\n if (isset($this->controllerFactories[$pageType])) {\n $callable = $this->controllerFactories[$pageType];\n $controller = $callable($this, 'templates/'.$template);\n\n if ($controller) {\n return $controller;\n }\n }\n\n // See if a default controller exists in the theme namespace\n $class = null;\n if ($pageType == 'posts') {\n $class = $this->namespace.'\\\\Controllers\\\\PostsController';\n } elseif ($pageType == 'post') {\n $class = $this->namespace.'\\\\Controllers\\\\PostController';\n } elseif ($pageType == 'page') {\n $class = $this->namespace.'\\\\Controllers\\\\PageController';\n } elseif ($pageType == 'term') {\n $class = $this->namespace.'\\\\Controllers\\\\TermController';\n }\n\n if (class_exists($class)) {\n $controller = new $class($this, 'templates/'.$template);\n\n return $controller;\n }\n\n // Create a default controller from the stem namespace\n if ($pageType == 'posts') {\n $controller = new PostsController($this, 'templates/'.$template);\n } elseif ($pageType == 'post') {\n $controller = new PostController($this, 'templates/'.$template);\n } elseif ($pageType == 'page') {\n $controller = new PageController($this, 'templates/'.$template);\n } elseif ($pageType == 'search') {\n $controller = new SearchController($this, 'templates/'.$template);\n } elseif ($pageType == 'term') {\n $controller = new TermController($this, 'templates/'.$template);\n }\n\n return $controller;\n }",
"private function loadController($controller)\r\n {\r\n $className = $controller.'Controller';\r\n \r\n $class = new $className($this);\r\n \r\n $class->init();\r\n \r\n return $class;\r\n }",
"public static function newInstance ($class)\n {\n try\n {\n // the class exists\n $object = new $class();\n\n if (!($object instanceof sfController))\n {\n // the class name is of the wrong type\n $error = 'Class \"%s\" is not of the type sfController';\n $error = sprintf($error, $class);\n\n throw new sfFactoryException($error);\n }\n\n return $object;\n }\n catch (sfException $e)\n {\n $e->printStackTrace();\n }\n }",
"public function create()\n {\n //TODO frontEndDeveloper \n //load admin.classes.create view\n\n\n return view('admin.classes.create');\n }",
"private function generateControllerClass()\n {\n $dir = $this->bundle->getPath();\n\n $parts = explode('\\\\', $this->entity);\n $entityClass = array_pop($parts);\n $entityNamespace = implode('\\\\', $parts);\n\n $target = sprintf(\n '%s/Controller/%s/%sController.php',\n $dir,\n str_replace('\\\\', '/', $entityNamespace),\n $entityClass\n );\n\n if (file_exists($target)) {\n throw new \\RuntimeException('Unable to generate the controller as it already exists.');\n }\n\n $this->renderFile($this->skeletonDir, 'controller.php', $target, array(\n 'actions' => $this->actions,\n 'route_prefix' => $this->routePrefix,\n 'route_name_prefix' => $this->routeNamePrefix,\n 'dir' => $this->skeletonDir,\n 'bundle' => $this->bundle->getName(),\n 'entity' => $this->entity,\n 'entity_class' => $entityClass,\n 'namespace' => $this->bundle->getNamespace(),\n 'entity_namespace' => $entityNamespace,\n 'format' => $this->format,\n ));\n }",
"static public function Instance()\t\t// Static so we use classname itself to create object i.e. Controller::Instance()\r\n {\r\n // Only one object of this class is required\r\n // so we only create if it hasn't already\r\n // been created.\r\n if(!isset(self::$_instance))\r\n {\r\n self::$_instance = new self();\t// Make new instance of the Controler class\r\n self::$_instance->_commandResolver = new CommandResolver();\r\n\r\n ApplicationController::LoadViewMap();\r\n }\r\n return self::$_instance;\r\n }",
"private function create_mock_controller() {\n eval('class TestController extends cyclone\\request\\SkeletonController {\n function before() {\n DispatcherTest::$beforeCalled = TRUE;\n DispatcherTest::$route = $this->_request->route;\n }\n\n function after() {\n DispatcherTest::$afterCalled = TRUE;\n }\n\n function action_act() {\n DispatcherTest::$actionCalled = TRUE;\n }\n}');\n }",
"public function AController() {\r\n\t}",
"protected function initializeController() {}",
"public function dispatch()\n { \n $controller = $this->formatController();\n $controller = new $controller($this);\n if (!$controller instanceof ControllerAbstract) {\n throw new Exception(\n 'Class ' . get_class($controller) . ' is not a valid controller instance. Controller classes must '\n . 'derive from \\Europa\\ControllerAbstract.'\n );\n }\n $controller->action();\n return $controller;\n }",
"public function controller()\n {\n $method = $_SERVER['REQUEST_METHOD'];\n if ($method == 'GET') {\n $this->getController();\n };\n if ($method == 'POST') {\n check_csrf();\n $this->createController();\n };\n }",
"private function addController($controller)\n {\n $object = new $controller($this->app);\n $this->controllers[$controller] = $object;\n }",
"function Controller($ControllerName = Web\\Application\\DefaultController) {\n return Application()->Controller($ControllerName);\n }",
"public function getController($controllerName) {\r\n\t\tif(!isset(self::$instances[$controllerName])) {\r\n\t\t $package = $this->getPackage(Nomenclature::getVendorAndPackage($controllerName));\r\n\t\t if(!$package) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t return $controller;\r\n\t\t //return false;\r\n\t\t }\r\n\r\n\t\t if(!$package || !$package->controllerExists($controllerName)) {\r\n\t\t $controller = new $controllerName();\r\n\t\t $controller->setContext($this->getContext());\r\n\t\t $package->addController($controller);\r\n\t\t } else {\r\n\t\t $controller = $package->getController($controllerName);\r\n\t\t }\r\n\t\t} else {\r\n\t\t $controller = self::$instances[$controllerName];\r\n\t\t}\r\n\t\treturn $controller;\r\n\t}",
"public function testInstantiateSessionController()\n {\n $controller = new SessionController();\n\n $this->assertInstanceOf(\"App\\Http\\Controllers\\SessionController\", $controller);\n }",
"private static function loadController($str) {\n\t\t$str = self::formatAsController($str);\n\t\t$app_controller = file_exists(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t$lib_controller = file_exists(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\n\t\tif ( $app_controller || $lib_controller ) {\n\t\t\tif ($app_controller) {\n\t\t\t\trequire_once(APP_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\t\telse {\n\t\t\t\trequire_once(LIB_DIR.'/Mvc/Controller/'.$str.'.php');\n\t\t\t}\n\t\n\t\t\t$controller = new $str();\n\t\t\t\n\t\t\tif (!$controller instanceof Controller) {\n\t\t\t\tthrow new IsNotControllerException();\n\t\t\t}\n\t\t\telse {\n\t\t\t\treturn $controller;\n\t\t\t}\n\t\t}\n\t\telse {\n\t\t\tthrow new ControllerNotExistsException($str);\n\t\t}\n\t}",
"public function __construct()\n {\n // and $url[1] is a controller method\n if ($_GET['url'] == NULL) {\n $url = explode('/', env('defaultRoute'));\n } else {\n $url = explode('/', rtrim($_GET['url'],'/'));\n }\n\n $file = 'controllers/' . $url[0] . '.php';\n if (file_exists($file)) {\n require $file;\n $controller = new $url[0];\n\n if (isset($url[1])) {\n $controller->{$url[1]}();\n }\n } else {\n echo \"404 not found\";\n }\n }",
"protected function _controllers()\n {\n $this['watchController'] = $this->factory(static function ($c) {\n return new Controller\\WatchController($c['app'], $c['searcher']);\n });\n\n $this['runController'] = $this->factory(static function ($c) {\n return new Controller\\RunController($c['app'], $c['searcher']);\n });\n\n $this['customController'] = $this->factory(static function ($c) {\n return new Controller\\CustomController($c['app'], $c['searcher']);\n });\n\n $this['waterfallController'] = $this->factory(static function ($c) {\n return new Controller\\WaterfallController($c['app'], $c['searcher']);\n });\n\n $this['importController'] = $this->factory(static function ($c) {\n return new Controller\\ImportController($c['app'], $c['saver'], $c['config']['upload.token']);\n });\n\n $this['metricsController'] = $this->factory(static function ($c) {\n return new Controller\\MetricsController($c['app'], $c['searcher']);\n });\n }",
"public function __construct() {\r\n $this->controllerLogin = new ControllerLogin();\r\n $this->controllerGame = new ControllerGame();\r\n $this->controllerRegister = new ControllerRegister();\r\n }",
"public function controller ($post = array())\n\t{\n\n\t\t$name = $post['controller_name'];\n\n\t\tif (is_file(APPPATH.'controllers/'.$name.'.php')) {\n\n\t\t\t$message = sprintf(lang('Controller_s_is_existed'), APPPATH.'controllers/'.$name.'.php');\n\n\t\t\t$this->msg[] = $message;\n\n\t\t\treturn $this->result(false, $this->msg[0]);\n\n\t\t}\n\n\t\t$extends = null;\n\n\t\tif (isset($post['crud'])) {\n\n\t\t\t$crud = true;\n\t\t\t\n\t\t}\n\t\telse{\n\n\t\t\t$crud = false;\n\n\t\t}\n\n\t\t$file = $this->_create_folders_from_name($name, 'controllers');\n\n\t\t$data = '';\n\n\t\t$data .= $this->_class_open($file['file'], __METHOD__, $extends);\n\n\t\t$crud === FALSE || $data .= $this->_crud_methods_contraller($post);\n\n\t\t$data .= $this->_class_close();\n\n\t\t$path = APPPATH . 'controllers/' . $file['path'] . strtolower($file['file']) . '.php';\n\n\t\twrite_file($path, $data);\n\n\t\t$this->msg[] = sprintf(lang('Created_controller_s'), $path);\n\n\t\t//echo $this->_messages();\n\t\treturn $this->result(true, $this->msg[0]);\n\n\t}",
"protected function getController(Request $request) {\n try {\n $controller = $this->objectFactory->create($request->getControllerName(), self::INTERFACE_CONTROLLER);\n } catch (ZiboException $exception) {\n throw new ZiboException('Could not create controller ' . $request->getControllerName(), 0, $exception);\n }\n\n return $controller;\n }",
"public function create() {}",
"public function __construct()\n {\n $this->dataController = new DataController;\n }",
"function __contrruct(){ //construdor do controller, nele é possivel carregar as librari, helpers, models que serão utilizados nesse controller\n\t\tparent::__contrruct();//Chamando o construtor da classe pai\n\t}",
"public function __construct() {\n\n // Get the URL elements.\n $url = $this->_parseUrl();\n\n // Checks if the first URL element is set / not empty, and replaces the\n // default controller class string if the given class exists.\n if (isset($url[0]) and ! empty($url[0])) {\n $controllerClass = CONTROLLER_PATH . ucfirst(strtolower($url[0]));\n unset($url[0]);\n if (class_exists($controllerClass)) {\n $this->_controllerClass = $controllerClass;\n }\n }\n\n // Replace the controller class string with a new instance of the it.\n $this->_controllerClass = new $this->_controllerClass;\n\n // Checks if the second URL element is set / not empty, and replaces the\n // default controller action string if the given action is a valid class\n // method.\n if (isset($url[1]) and ! empty($url[1])) {\n if (method_exists($this->_controllerClass, $url[1])) {\n $this->_controllerAction = $url[1];\n unset($url[1]);\n }\n }\n\n // Check if the URL has any remaining elements, setting the controller\n // parameters as a rebase of it if true or an empty array if false.\n $this->_controllerParams = $url ? array_values($url) : [];\n\n // Call the controller and action with parameters.\n call_user_func_array([$this->_controllerClass, $this->_controllerAction], $this->_controllerParams);\n }",
"private function setUpController()\n {\n $this->controller = new TestObject(new SharedControllerTestController);\n\n $this->controller->dbal = DBAL::getDBAL('testDB', $this->getDBH());\n }",
"public function create() {\n $class_name = $this->getOption('className');\n return new $class_name();\n }"
]
| [
"0.82668066",
"0.8173394",
"0.78115296",
"0.77052677",
"0.7681875",
"0.7659338",
"0.74860525",
"0.74064577",
"0.7297601",
"0.7252339",
"0.7195181",
"0.7174191",
"0.70150065",
"0.6989306",
"0.69835985",
"0.69732994",
"0.6963521",
"0.6935819",
"0.68973273",
"0.68920785",
"0.6877748",
"0.68702674",
"0.68622285",
"0.6839049",
"0.6779292",
"0.6703522",
"0.66688496",
"0.66600126",
"0.6650373",
"0.66436416",
"0.6615505",
"0.66144013",
"0.6588728",
"0.64483404",
"0.64439476",
"0.6429303",
"0.6426485",
"0.6303757",
"0.6298291",
"0.6293319",
"0.62811387",
"0.6258778",
"0.62542456",
"0.616827",
"0.6162314",
"0.61610043",
"0.6139887",
"0.613725",
"0.61334985",
"0.6132223",
"0.6128982",
"0.61092585",
"0.6094611",
"0.60889256",
"0.6074893",
"0.60660255",
"0.6059098",
"0.60565156",
"0.6044235",
"0.60288006",
"0.6024102",
"0.60225666",
"0.6018304",
"0.60134345",
"0.60124683",
"0.6010913",
"0.6009284",
"0.6001683",
"0.5997471",
"0.5997012",
"0.59942573",
"0.5985074",
"0.5985074",
"0.5985074",
"0.5967613",
"0.5952533",
"0.5949068",
"0.5942203",
"0.5925731",
"0.5914304",
"0.5914013",
"0.59119135",
"0.5910308",
"0.5910285",
"0.59013796",
"0.59003943",
"0.5897524",
"0.58964556",
"0.58952993",
"0.58918965",
"0.5888943",
"0.5875413",
"0.5869938",
"0.58627135",
"0.58594996",
"0.5853714",
"0.5839484",
"0.5832913",
"0.582425",
"0.58161044",
"0.5815566"
]
| 0.0 | -1 |
Show the application dashboard. | public function index()
{
return view('doctorservice.banco.cadastro');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function dashboard()\n {\n\n $pageData = (new DashboardService())->handleDashboardLandingPage();\n\n return view('application', $pageData);\n }",
"function dashboard() {\r\n\t\t\tTrackTheBookView::render('dashboard');\r\n\t\t}",
"public function showDashboard() { \n\t\n return View('admin.dashboard');\n\t\t\t\n }",
"public function showDashboard()\n {\n return View::make('users.dashboard', [\n 'user' => Sentry::getUser(),\n ]);\n }",
"public function dashboard()\n {\n return view('backend.dashboard.index');\n }",
"public function index() {\n return view(\"admin.dashboard\");\n }",
"public function dashboard()\n {\n return $this->renderContent(\n view('dashboard'),\n trans('sleeping_owl::lang.dashboard')\n );\n }",
"public function dashboard(){\n return view('backend.admin.index');\n }",
"public function showDashBoard()\n {\n \treturn view('Admins.AdminDashBoard');\n }",
"public function dashboard()\n {\n return view('dashboard.index');\n }",
"public function index()\n {\n return view('admin.dashboard', ['title' => 'Dashboard']);\n }",
"public function dashboard() \r\n {\r\n return view('admin.index');\r\n }",
"public function dashboard()\n\t{\n\t\t$page_title = 'organizer dashboard';\n\t\treturn View::make('organizer.dashboard',compact('page_title'));\n\t}",
"public function dashboard()\n {\n\t\t$traffic = TrafficService::getTraffic();\n\t\t$devices = TrafficService::getDevices();\n\t\t$browsers = TrafficService::getBrowsers();\n\t\t$status = OrderService::getStatus();\n\t\t$orders = OrderService::getOrder();\n\t\t$users = UserService::getTotal();\n\t\t$products = ProductService::getProducts();\n\t\t$views = ProductService::getViewed();\n\t\t$total_view = ProductService::getTotalView();\n\t\t$cashbook = CashbookService::getAccount();\n $stock = StockService::getStock();\n\n return view('backend.dashboard', compact('traffic', 'devices', 'browsers', 'status', 'orders', 'users', 'products', 'views', 'total_view', 'cashbook', 'stock'));\n }",
"public function dashboard()\n {\n\n return view('admin.dashboard');\n }",
"public function dashboard()\n {\n return view('dashboard');\n }",
"public function dashboard()\n {\n return view('dashboard');\n }",
"public function dashboard()\n {\n return view('dashboard');\n }",
"public function dashboard()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('adm.dashboard');\n }",
"public function dashboard()\n {\n $users = \\App\\User::all()->count();\n $roles = \\Spatie\\Permission\\Models\\Role::all()->count();\n $permissions = \\Spatie\\Permission\\Models\\Permission::all()->count();\n $banner = \\App\\Banner::all();\n $categoria = \\App\\Categoria::all();\n $entidadOrganizativa = \\App\\Entidadorganizativa::all();\n $evento = \\App\\Evento::all();\n $fichero = \\App\\Fichero::all();\n $recurso = \\App\\Recurso::all();\n $redsocial = \\App\\Redsocial::all();\n $subcategoria = \\App\\Subcategoria::all();\n $tag = \\App\\Tag::all();\n\n $entities = \\Amranidev\\ScaffoldInterface\\Models\\Scaffoldinterface::all();\n\n return view('scaffold-interface.dashboard.dashboard',\n compact('users', 'roles', 'permissions', 'entities',\n 'banner', 'categoria', 'entidadOrganizativa',\n 'evento', 'fichero', 'recurso', 'redsocial', 'subcategoria', 'tag')\n );\n }",
"public function show()\n {\n return view('dashboard');\n }",
"public function index()\n\t{\n\t\treturn View::make('dashboard');\n\t}",
"public function index() {\n return view('modules.home.dashboard');\n }",
"public function show()\n {\n return view('dashboard.dashboard');\n \n }",
"public function index()\n {\n return view('admin.dashboard.dashboard');\n\n }",
"public function dashboard()\n { \n return view('jobposter.dashboard');\n }",
"public function show()\n\t{\n\t\t//\n\t\t$apps = \\App\\application::all();\n\t\treturn view('applications.view', compact('apps'));\n\t}",
"public function index()\n {\n return view('pages.admin.dashboard');\n }",
"public function indexAction()\n {\n $dashboard = $this->getDashboard();\n\n return $this->render('ESNDashboardBundle::index.html.twig', array(\n 'title' => \"Dashboard\"\n ));\n }",
"public function index()\n {\n //\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('admin.dashboard.index');\n }",
"public function dashboard()\n {\n return view('pages.backsite.dashboard');\n }",
"public function index()\n {\n // return component view('dashboard.index');\n return view('layouts.admin_master');\n }",
"public function index()\n {\n\n $no_of_apps = UploadApp::count();\n $no_of_analysis_done = UploadApp::where('isAnalyzed', '1')->count();\n $no_of_visible_apps = AnalysisResult::where('isVisible', '1')->count();\n\n return view('admin.dashboard', compact('no_of_apps', 'no_of_analysis_done', 'no_of_visible_apps'));\n }",
"public function getDashboard() {\n return view('admin.dashboard');\n }",
"public function index()\n {\n return view('smartcrud.auth.dashboard');\n }",
"public function index()\n {\n if($this->isAdmin() == TRUE)\n {\n $this->loadThis();\n }\n $this->global['pageTitle'] = 'Touba : Dashboard';\n \n $this->loadViews(\"dashboard\", $this->global, NULL , NULL);\n }",
"public function dashboard() {\n $data = ['title' => 'Dashboard'];\n return view('pages.admin.dashboard', $data)->with([\n 'users' => $this->users,\n 'num_services' => Service::count(),\n 'num_products' => Product::count(),\n ]);\n }",
"public function index()\n {\n return view('board.pages.dashboard-board');\n }",
"public function index()\n {\n return view('admin::settings.development.dashboard');\n }",
"public function index()\n {\n return view('dashboard.dashboard');\n }",
"public function show()\n {\n return view('dashboard::show');\n }",
"public function adminDash()\n {\n return Inertia::render(\n 'Admin/AdminDashboard', \n [\n 'data' => ['judul' => 'Halaman Admin']\n ]\n );\n }",
"public function dashboard()\n {\n return view('Admin.dashboard');\n }",
"public function show()\n {\n return view('admins\\auth\\dashboard');\n }",
"public function index()\n {\n // Report =============\n\n return view('Admin.dashboard');\n }",
"public function index()\n {\n return view('bitaac::account.dashboard');\n }",
"public function index()\n { \n return view('admin-views.dashboard');\n }",
"public function getDashboard()\n {\n return view('dashboard');\n }",
"function showDashboard()\n { \n $logeado = $this->checkCredentials();\n if ($logeado==true)\n $this->view->ShowDashboard();\n else\n $this->view->showLogin();\n }",
"public function index()\n { \n $params['crumbs'] = 'Home';\n $params['active'] = 'home';\n \n return view('admin.dashboard.index', $params);\n }",
"public function index()\n\t{\n\t\treturn view::make('customer_panel.dashboard');\n\t}",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index()\n {\n return view('dashboard');\n }",
"public function index() {\n // return view('home');\n return view('admin-layouts.dashboard.dashboard');\n }",
"public function index()\r\n {\r\n return view('user.dashboard');\r\n }",
"public function index() {\n return view('dashboard', []);\n }",
"public function index()\n {\n //\n return view('dashboard.dashadmin', ['page' => 'mapel']);\n }",
"public function index()\n {\n return view('back-end.dashboard.index');\n //\n }",
"public function index()\n\t{\n\t\t\n\t\t$data = array(\n\t\t\t'title' => 'Administrator Apps With Laravel',\n\t\t);\n\n\t\treturn View::make('panel/index',$data);\n\t}",
"public function index() {\n return view('dashboard.index');\n }",
"public function index()\n {\n return view('page.dashboard.index');\n }",
"public function index()\n {\n\n return view('dashboard');\n }",
"public function dashboardview() {\n \n $this->load->model('Getter');\n $data['dashboard_content'] = $this->Getter->get_dash_content();\n \n $this->load->view('dashboardView', $data);\n\n }",
"public function index()\n {\n $this->authorize(DashboardPolicy::PERMISSION_STATS);\n\n $this->setTitle($title = trans('auth::dashboard.titles.statistics'));\n $this->addBreadcrumb($title);\n\n return $this->view('admin.dashboard');\n }",
"public function action_index()\r\n\t{\t\t\t\t\r\n\t\t$this->template->title = \"Dashboard\";\r\n\t\t$this->template->content = View::forge('admin/dashboard');\r\n\t}",
"public function index()\n {\n $info = SiteInfo::limit(1)->first();\n return view('backend.info.dashboard',compact('info'));\n }",
"public function display()\n\t{\n\t\t// Set a default view if none exists.\n\t\tif (!JRequest::getCmd( 'view' ) ) {\n\t\t\tJRequest::setVar( 'view', 'dashboard' );\n\t\t}\n\n\t\tparent::display();\n\t}",
"public function index()\n {\n $news = News::all();\n $posts = Post::all();\n $events = Event::all();\n $resources = Resources::all();\n $admin = Admin::orderBy('id', 'desc')->get();\n return view('Backend/dashboard', compact('admin', 'news', 'posts', 'events', 'resources'));\n }",
"public function index()\n {\n\n return view('superAdmin.adminDashboard')->with('admin',Admininfo::all());\n\n }",
"public function index()\n {\n return view('dashboard.index');\n }",
"public function index()\n {\n return view('dashboard.index');\n }",
"public function index()\n {\n $this->template->set('title', 'Dashboard');\n $this->template->load('admin', 'contents' , 'admin/dashboard/index', array());\n }",
"public function index()\n {\n return view('/dashboard');\n }",
"public function index()\n {\n \treturn view('dashboard');\n }",
"public function index()\n {\n return view('ketua.ketua-dashboard');\n }",
"public function index(){\n return View::make('admin.authenticated.dashboardview');\n }",
"public function admAmwDashboard()\n {\n return View::make('admission::amw.admission_test.dashboard');\n }",
"public function index()\n {\n return view('adminpanel.home');\n }",
"public function dashboard()\n\t{\n\t\t$this->validation_access();\n\t\t\n\t\t$this->load->view('user_dashboard/templates/header');\n\t\t$this->load->view('user_dashboard/index.php');\n\t\t$this->load->view('user_dashboard/templates/footer');\n\t}",
"public function index()\n {\n return view('dashboard.home');\n }",
"public function index()\n {\n $admins = $this->adminServ->all();\n $adminRoles = $this->adminTypeServ->all();\n return view('admin.administrators.dashboard', compact('admins', 'adminRoles'));\n }",
"public function index()\n {\n if (ajaxCall::ajax()) {return response()->json($this -> dashboard);}\n //return response()->json($this -> dashboard);\n JavaScript::put($this -> dashboard);\n return view('app')-> with('header' , $this -> dashboard['header']);\n //return view('home');\n }",
"public function index()\n {\n $userinfo=User::all();\n $gateinfo=GateEntry::all();\n $yarninfo=YarnStore::all();\n $greyinfo=GreyFabric::all();\n $finishinfo=FinishFabric::all();\n $dyesinfo=DyeChemical::all();\n return view('dashboard',compact('userinfo','gateinfo','yarninfo','greyinfo','finishinfo','dyesinfo'));\n }",
"public function actionDashboard(){\n \t$dados_dashboard = Yii::app()->user->getState('dados_dashbord_final');\n \t$this->render ( 'dashboard', $dados_dashboard);\n }",
"public function index()\n {\n $user = new User();\n $book = new Book();\n return view('admin.dashboard', compact('user', 'book'));\n }",
"public function dashboard() {\n if (!Auth::check()) { // Check is user logged in\n // redirect to dashboard\n return Redirect::to('login');\n }\n\n $user = Auth::user();\n return view('site.dashboard', compact('user'));\n }",
"public function dashboard()\n {\n $users = User::all();\n return view('/dashboard', compact('users'));\n }",
"public function index()\n {\n $lineChart = $this->getLineChart();\n $barChart = $this->getBarChart();\n $pieChart = $this->getPieChart();\n\n return view('admin.dashboard.index', compact(['lineChart', 'barChart', 'pieChart']));\n }"
]
| [
"0.77850926",
"0.7760142",
"0.7561336",
"0.75147176",
"0.74653697",
"0.7464913",
"0.73652893",
"0.7351646",
"0.7346477",
"0.73420244",
"0.7326711",
"0.7316215",
"0.73072463",
"0.7287626",
"0.72826403",
"0.727347",
"0.727347",
"0.727347",
"0.727347",
"0.7251768",
"0.7251768",
"0.7251768",
"0.7251768",
"0.7251768",
"0.7241342",
"0.7236133",
"0.7235562",
"0.7218318",
"0.71989936",
"0.7197427",
"0.71913266",
"0.71790016",
"0.71684825",
"0.71577966",
"0.7146797",
"0.7133428",
"0.7132746",
"0.71298903",
"0.71249074",
"0.71218014",
"0.71170413",
"0.7110151",
"0.7109032",
"0.7107029",
"0.70974076",
"0.708061",
"0.7075653",
"0.70751685",
"0.7064041",
"0.70550334",
"0.7053102",
"0.7051273",
"0.70484304",
"0.7043605",
"0.70393986",
"0.70197886",
"0.70185125",
"0.70139873",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.700917",
"0.6992477",
"0.6979631",
"0.69741416",
"0.69741327",
"0.6968815",
"0.6968294",
"0.69677526",
"0.69652885",
"0.69586027",
"0.6944985",
"0.69432825",
"0.69419175",
"0.6941512",
"0.6941439",
"0.6938837",
"0.6937524",
"0.6937456",
"0.6937456",
"0.69276494",
"0.6921651",
"0.69074917",
"0.69020325",
"0.6882262",
"0.6869339",
"0.6867868",
"0.68557185",
"0.68479055",
"0.684518",
"0.68408877",
"0.6838798",
"0.6833479",
"0.6832326",
"0.68309164",
"0.6826798",
"0.6812457"
]
| 0.0 | -1 |
/ Display list Team for select2 | public function throwTeam(Request $request){
$teams = Team::where('name','like','%'.$request['q'].'%')
->paginate(5);
foreach ($teams as $team) {
$result[] = ['id' => $team->id,'label' => $team->name ];
}
return response()->json($result);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionUser_team() {\n if (isset($_POST['dep_id']) != 0) {\n $output = '';\n $dep_id = $_POST['dep_id'];\n\n $UserTeam = DvUsersTeam::find()->where(['status' => 1, 'dep_id' => $dep_id])->all();\n $UTeam = ArrayHelper::map($UserTeam, 'id', 'name');\n\n if (!empty($UTeam)) {\n $output .= '<select id=\"dvusers-team\" class=\"form-control\" name=\"usermeta[team]\" required=\"required\" aria-invalid=\"false\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Select Team\">';\n $output .= '<option value=\"\">Select Team</option>';\n foreach ($UTeam as $id => $name) {\n $output .= '<option value=\"' . $id . '\">' . $name . '</option>';\n }\n\n $output .= '</select>';\n } else {\n $output .= '<select id=\"dvusers-team\" class=\"form-control\" name=\"usermeta[team]\" aria-invalid=\"false\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Select Team\">';\n $output .= '<option value=\"\">Select Team</option>';\n $output .= '</select>';\n }\n\n return $output;\n } else {\n return $this->redirect(['dv-users/index']);\n }\n }",
"function fantacalcio_admin_teams_list() {\n $out = l(\"Aggiungi squadra\", \"admin/fantacalcio/teams/add\", array(\n \"attributes\" => array(\"class\" => \"btn btn-info\"))) . \"<br/><br/>\";\n \n $teams = Team::all();\n \n if ($teams) {\n \n $header = array(\"Nome\", \"Utente\", \"Gironi\", \"Attiva\");\n \n foreach ($teams as $t_id => $team) {\n \n $account = User::get($team->user);\n \n $groups_team = \"\";\n foreach ($team->getCompetitions() as $competition) {\n $groups_team .= $competition . \"<br>\";\n }\n $rows[] = array(\n l($team->name, \"admin/fantacalcio/teams/\" . $t_id), \n $account != null ? $account->name : \"\", \n $groups_team, \n fantacalcio_check_value($team->active));\n }\n $out .= theme(\"table\", array(\n \"header\" => $header, \n \"rows\" => $rows, \n \"attributes\" => array(\"class\" => array(\"table table-responsive\")), \n \"sticky\" => TRUE, \n \"empty\" => t(\"Nessuna squadra\")));\n }\n \n return $out;\n}",
"function fantacalcio_admin_real_teams_list() {\n \n $out = \"\";\n \n $out .= l(\"Aggiungi Squadra\", \"admin/fantacalcio/realteams/add\", array(\n \"attributes\" => array(\"class\" => \"btn btn-info\"))) . \"<br/><br/>\";\n\n $out .= l(\"Importa squadre\", \"admin/fantacalcio/realteams/import\", array(\n \"attributes\" => array(\"class\" => \"btn btn-warning\"))) . \"<br/><br/>\";\n \n $real_teams = RealTeam::all();\n if ($real_teams) {\n $header = array(\n t(\"Nome\"));\n\n foreach ($real_teams as $rt_id => $real_team) {\n $rows[] = array(\n l($real_team->name, \"admin/fantacalcio/realteams/\" . $rt_id));\n }\n\n $out .= theme(\"table\", (array(\n \"header\" => $header, \n \"rows\" => $rows, \n \"attributes\" => array(\"class\" => array(\"table\", \"table-responsive\")), \n \"sticky\" => \"\", \n \"empty\" => t(\"Nessuna squadra\"))));\n }\n return $out;\n}",
"function team_list()\n {\n }",
"public function biuldTeamsOptions() {// Connection data (server_address, database, name, poassword)\r\n \r\n $sql = \"select Team_Id,Team_Name from teams \";\r\n $html=\"\";\r\n $result=array();\r\n try {\r\n $result= $this->query($sql);\r\n }\r\n \r\n catch (PDOException $e) {\r\n \r\n return($e->getMessage());\r\n }\r\n \r\n\r\n \r\n \r\n \r\n $html = '<option value=\"0\"></option>';\r\n foreach ($result as $row) {\r\n\r\n $html.='<option value=\"'.$row['Team_Id'].'\">'.$row['Team_Name'].'</option>';\r\n\r\n\r\n \r\n }\r\n \r\n\r\n \r\n \r\n $html.='';\r\n\r\n return $html;\r\n \r\n }",
"public function getTeamList() {\n\t\treturn $this->getData('/team/list');\n\t}",
"public function teamList()\n {\n $teams = Team::all();\n $countTC = 0;\n $countBranch = 0;\n foreach ($teams as $t) {\n if($t->respo->branch == \"TC\" && $t->respo->level < 4){\n $countTC ++;\n }\n else\n $countBranch++;\n }\n //info(\"Nombre de team de TC : \" . $countTC . \" Nombre de team de Branche : \" . $countBranch);\n\n return View::make('dashboard.ce.teamlist', [\n 'teams' => Team::all(),\n 'teamLeftTC' => Config::get('services.ce.maxTeamTc') - $countTC,\n 'teamLeftBranch' => Config::get('services.ce.maxTeamBranch') - $countBranch,\n ]);\n }",
"function teams(){\n\t\t$this->autoRender = false;\n\t\t$this->response->type('json');\n\t\ttry {\n\t\t\t$teams = $this->Team->find('all');\n\t\t}catch (Exception $e){\n\t\t\techo $this->dbError;\n\t\t}\n\t\tif (!empty($teams)){\n\t\t\techo json_encode($teams);\n\t\t}else{\n\t\t\techo $this->noResult;\n\t\t}\n\t}",
"public function actionListmyteam() {\n return array('status' => 0, 'status_msg' => 'ok');\n }",
"function listTeams($con, $def_teamID)\n\t{ \n\t # Default value for the team dropdown\n\t $sql_teams = \"SELECT teamID, teamName FROM journeyteams\";\n\t\t$result_teams = $con->query($sql_teams) or die(mysqli_error($con));\n\t\n\t\t$list_teams = \"\";\n\t\twhile($rowt = mysqli_fetch_array($result_teams))\n\t\t{\n\t\t\t$teamID = htmlspecialchars($rowt['teamID']);\n\t\t\t$teamName = htmlspecialchars($rowt['teamName']);\n\t\n\t\t\tif($teamID == $def_teamID) { $selected = \"selected='true'\"; } else { $selected = \"\"; }\n\t\n\t\t\t$list_teams .= \"<option value='$teamID' $selected>$teamName</option>\";\n\t\t}\n\n\t\treturn $list_teams;\n\t}",
"public function team(){\n\tif ($this->session->userdata('logged_in')){\n\t\t$data['title'] = 'Team';\n\t\t$data['teamsList'] = $this->common_model->get_all('fr_team', '');\n\t\t$this->set_layout('team/team_list',$data);\n\t}else{\n\t\t$this->load->view('site/login');\n\t}\n}",
"public function getTeams();",
"public function view_team($team_id)\n {\n $tm = $this->CreateTeamModel->view_team_details($team_id);\n $this->data['tm'] = $tm;\n \n $name = array(\n\t\t'name' \t=> 'name',\n\t\t'id' \t=> 'name',\n\t\t'type' \t=> 'text',\n\t\t'style'\t\t=> 'width:300px;',\n\t\t'value' \t=> $this->form_validation->set_value('name', $tm['name'])\n );\n \n $project_id = $this->CreateTeamModel->get_project($team_id);\n \n $this->data['project'] = array(\n 'name' \t=> 'project',\n\t\t'id' \t=> 'project',\n\t\t'type' \t=> 'select',\n\t\t'style'\t\t=> 'width:300px;',\n\t\t'value' \t=> $this->form_validation->set_value('project', $project_id['project_id'])\n ); \n \n $member = $this->CreateTeamModel->view_team_details($team_id);\n $team_member = $this->CreateTeamModel->view_team_members($team_id);\n $team= $this->CreateTeamModel->load_team_members($team_id);\n $developer= $this->CreateTeamModel->get_developers();\n $project = $this->CreateTeamModel->load_projects($team_id);\n $this->load->view('add_members_view',compact(\"member\",\"team_member\",\"team\",\"developer\",\"project\",\"project_id\",\"name\"));\n }",
"public function actionUsers_by_dep2() {\n if (isset($_POST['depid']) != 0) {\n $output = '';\n $depid = $_POST['depid'];\n $output = '';\n $output .= '<select id=\"dvusers-team\" class=\"form-control\" name=\"usermeta[team]\" aria-invalid=\"false\" data-toggle=\"tooltip\" data-placement=\"top\" title=\"\" data-original-title=\"Select Manager\">';\n $output .= '<option value=\"\"> ---- </option>';\n\n $dv_users = Yii::$app->db->createCommand(\"SELECT id, first_name, last_name FROM assist_users WHERE department = '$depid' AND status = 1 \")->queryAll();\n\n foreach ($dv_users as $dvusers){ \n $userrole = $this->checkUserRole($dvusers['id']); \n if ($userrole == 1) {\n $output .= '<option value=\"' . $dvusers['id'] . '\">' . $dvusers['first_name'] . ' ' . $dvusers['last_name'] . '</option>';\n }\n }\n $output .= '</select>';\n $output .= '<style>.dvuserteam{display:block;}</style>';\n return $output;\n }\n }",
"private function _get_team_members_dropdown() {\n $team_members = $this->Users_model->get_all_where(array(\"deleted\" => 0, \"user_type\" => \"staff\"), 0, 0, \"first_name\")->result();\n if ($this->login_user->is_admin) { //darini 18-2 \n $members_dropdown = array(array(\"id\" => \"\", \"text\" => \"- \" . lang(\"member\") . \" -\"));\n foreach ($team_members as $team_member) { \n $members_dropdown[] = array(\"id\" => $team_member->id, \"text\" => $team_member->first_name . \" \" . $team_member->last_name); \n }\n }else{\n $members_dropdown = array(array(\"id\" =>$this->login_user->id, \"text\" =>$this->login_user->first_name.\" \".$this->login_user->last_name));\n } //end\n return json_encode($members_dropdown);\n }",
"public function index()\n {\n $teams = Teams::get();\n $teams = $this->subSqlStr($teams);\n return view('admin.team',compact('teams'));\n }",
"function index()\n\t{\n\t\t$teams = $this->teams->retrieve_with_field();\n\n\t\t$data = array(\n\t\t\t'title' => 'Teams',\n\t\t\t'teams' => $teams,\n\t\t\t'js' => array(''),\n\t\t\t'css' => array('/styles/admin.css'),\n\t\t\t'sidenav' => self::$user_links\n\t\t);\n\n\t\t$this->load->view('admin/show_all_teams.php', $data);\n\t}",
"public function team()\n {\n return $this->render('main/team.html.twig', [\n 'title'=>'Notre équipe',\n ]);\n }",
"public function actionTeam_name() {\n if (isset($_POST['search']) != 0) {\n $output = '';\n $teamname = $_POST['search'];\n $department = $_POST['department'];\n $managers = $_POST['managers'];\n $response = array();\n $modules = Yii::$app->db->createCommand(\"SELECT distinct assist_users.id, assist_users.email FROM assist_users JOIN assist_user_meta ON assist_user_meta.uid = assist_users.id WHERE email LIKE '%$teamname%' AND department = '$department' AND assist_user_meta.meta_value = '' AND assist_user_meta.meta_key = 'team' AND assist_users.status = 1 \")->queryAll();\n foreach ($modules as $key => $val) {\n $get_userrole = $this->getUserRole($val['id']); /* get the current user's role */\n\n $userrole = $this->checkUserRole($val['id']); // check the current user is not manager\n if ($userrole != 1) {\n\n $userteam = $this->checkUserTeam($val['id'], $managers); // exclude existing users\n if ($userteam != 1) {\n if (!empty($get_userrole)) {\n if ($get_userrole[0]['meta_value'] != 7) {\n $response[] = array(\"value\" => $val['email']);\n }\n } else {\n $response[] = array(\"value\" => $val['email']);\n }\n }\n }\n }\n $output = json_encode($response);\n return $output;\n } else {\n return $this->redirect(['dv-users/index']);\n }\n }",
"public function list_team($id)\n {\n $con['selection'] = 'hr_users.*, hr_users.id as user_id, hr_designations.name as designation, hr_roles.name as role, hr_departments.name as department';\n $con['conditions'] = array(\n 'hr_users.department_id' => $id,\n 'hr_users.status' => 1\n );\n $con['innerJoin'] = array(array(\n 'table' => 'hr_designations',\n 'condition' =>'hr_users.designation_id = hr_designations.id',\n 'joinType' => 'left'\n ),array(\n 'table' => 'hr_roles',\n 'condition' =>'hr_users.role_id = hr_roles.id',\n 'joinType' => 'left'\n ),array(\n 'table' => 'hr_departments',\n 'condition' =>'hr_users.department_id = hr_departments.id',\n 'joinType' => 'left'\n ));\n $data['users'] = $this->get_users($con);\n $data['heading'] = 'Employees';\n $this->load->view('users/users', $data);\n }",
"public function getTeam();",
"function listTeams() {\n global $oDbHelper;\n\n $sQuery = \"SELECT * FROM team WHERE competition_id = \" . COMPETITION_ID;\n $oResult = $oDbHelper->executeQuery($sQuery);\n $oDbHelper->printDbResult($oResult);\n}",
"public function rolesAsSelect2()\r\n {\r\n $data['roles'] = $this->AdminRoleModel->getAll();\r\n echo $this->load->view('admin/users/roles-bulk-assign', $data, TRUE);\r\n }",
"public function indexAction(){\n $user = $this->getUser();\n\n if($user->getRole()->getRole() === 'ROLE_EMPLOYEE'){\n $teams = $user->getTeams();\n }else if($user->getRole()->getRole() === 'ROLE_MANAGER'){\n $teams = $user->getManagedTeams();\n }else if($user->getRole()->getRole() === 'ROLE_ADMIN'){\n $em = $this->getDoctrine()->getManager();\n $teams = $em->getRepository('UserBundle:Team')->findAll();\n }else{\n $teams = null;\n }\n\n return $this->render('UserBundle:Team:table.html.twig', [\n 'teams' => $teams,\n ]);\n }",
"public function index()\n {\n $this->groups = Team::all();\n return view('admin.teams.index', $this->data);\n }",
"public function our_team()\n {\n $data['our_teams'] = OurTeam::where('status',1)\n ->orderBy('sort', 'asc')->get();\n $data['title'] = 'Our Team';\n $data['menu'] = 'our_team';\n $data['seo'] = Seo::where('menu_name', 'our_team')->first();\n return view('our_team', $data);\n }",
"public function index()\n {\n $teams = Team::all();\n return view('admin.team.index',compact('teams'));\n }",
"public function teams()\n {\n return $this->request('get', '/api/teams');\n }",
"public function display()\n {\n return view('dashboard.team');\n }",
"public function actionDisplay() {\r\n global $mainframe, $user; \r\n $tourID = Request::getVar('tourID',0);\r\n $model = Tournament::getInstance();\r\n $tour_detail = $model->getItem($tourID);\r\n $lists = $model->getLists($tourID, $tour_detail); \r\n \r\n $this->addBarTitle(\"Tournament: <small>$tour_detail->name</small>\", \"tournaments\"); \r\n $this->addIconToolbar(\"Apply\", Router::buildLink(\"gamesport\", array(\"view\"=>\"tournament\", \"layout\" => \"save\",\"tourID\"=>$tourID)), \"apply\");\r\n addSubMenuGameSportTour('tournament');\r\n \r\n $this->render('teamjoined', array('tour_detail'=> $tour_detail,'lists' => $lists));\r\n }",
"public function actionTeamview() {\n\n /* redirect a user if not super admin */\n if (!Yii::$app->CustomComponents->check_permission('team_registration')) {\n return $this->redirect(['site/index']);\n }\n\n $user = Yii::$app->user->identity;\n $user_team_data = DvUserMeta::find()->where(['meta_value' => $user->id, 'meta_key' => 'team'])->all();\n\n $user_id = array();\n $managers = Yii::$app->db->createCommand(\"SELECT assist_users.id FROM assist_users \n join assist_user_meta ON assist_users.id = assist_user_meta.uid WHERE assist_users.department = 1 and \n assist_user_meta.meta_key = 'team' and assist_user_meta.meta_value = '' AND assist_users.status=1\")->queryAll();\n if (!empty($managers)) {\n foreach ($managers as $manager) {\n $manager_id = $manager['id'];\n if ($user->id != $manager_id) {\n $user_id[] = $manager_id;\n }\n $executives = Yii::$app->db->createCommand(\"SELECT assist_user_meta.uid FROM assist_user_meta \n join assist_users ON assist_users.id = assist_user_meta.uid \n WHERE meta_key = 'team' AND meta_value = $manager_id AND assist_users.status=1\")->queryAll();\n if (!empty($executives)) {\n foreach ($executives as $executive) {\n $executive_id = $executive['uid'];\n if ($user->id != $executive_id) {\n $user_id[] = $executive_id;\n }\n }\n }\n }\n }\n\n $query = DvRegistration::find()->where(['in', 'sales_user_id', $user_id]);\n $count = $query->count();\n $pagination = new Pagination(['totalCount' => $count, 'pageSize' => 10]);\n $models = $query->offset($pagination->offset)->limit($pagination->limit)->all();\n $offset = $pagination->offset + 1;\n\n $all_models = DvRegistration::find()->where(['in', 'sales_user_id', $user_id])->all();\n\n return $this->render('team_register', ['all_participant_users'=>$all_models, 'participant_users' => $models, 'pages' => $pagination, 'count' => $offset]);\n }",
"public function getTeamSelect($project_id)\n\t{\n//\t\tif (!self::$_project_id) {\n//\t\t\treturn false;\n//\t\t}\n//\t\t$options = array(JHTML::_('select.option', 0, JText::_($this->getParam('text_teams_dropdown'))));\n\t\t$res = $this->getTeamsOptions($project_id);\n\t\tif ($res) \n\t\t{\n\t\t$options = array(JHTML::_('select.option', 0, JText::_($this->getParam('text_teams_dropdown'))));\n\t\t\t$options = array_merge($options, $res);\n\t\t}\n//\t\treturn JHTML::_('select.genericlist', $options, 'tid', 'class=\"jlnav-team\"', 'value', 'text', $this->getTeamId());\n return $options;\t\t\n\t}",
"public function index()\n {\n $user = $this->userContract->findWith(request()->user()->id, ['profile']);\n $select = [null => 'Please Select'] + $this->teamCategoryContract->getTeamCategorySelect();\n $categories = $this->teamCategoryContract->getCategoriesWithTeams();\n $categoryId = null;\n $teamId = null;\n\n return view('backend.teams.index', compact('user', 'categories', 'select', 'categoryId', 'teamId'));\n }",
"public function index()\n {\n //\n $teams =Team::paginate(2);\n return view('team/lists')->withTeams($teams);\n }",
"public function actionTeams()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('teams');\n\t}",
"public function show(Team $team)\n {\n //\n }",
"public function show(Team $team)\n {\n //\n }",
"public function show(Team $team)\n {\n //\n }",
"public function show(Team $team)\n {\n //\n }",
"public function show(Team $team)\n {\n //\n }",
"public function show(Team $team)\n {\n //\n }",
"public function getTeam()\n {\n $admins = User::whereHas('role', function($query) {\n $query->where('name', '=', 'Sub Admin');\n });\n\n return Datatables::of($admins)\n ->editColumn('id', function($admin) {\n return '<a href=\"' . url('admin/team/' . $admin->id . '/edit') . '\">' . $admin->id . '</a>';\n })\n ->addColumn('status', function($admin) {\n return $admin->archived ? '<span style=\"color: red;\">Inactive</span>' : '<span style=\"color: green;\">Active</span>';\n })\n ->addColumn('action', function($admin) {\n return $admin->archived ? '<a href=\"' . url('admin/team/' . $admin->id . '/activate') . '\"><i class=\"fa fa-check\" aria-hidden=\"true\" style=\"color: green;\"></i></a>' :\n '<a href=\"' . url('admin/team/' . $admin->id . '/deactivate') . '\"><i class=\"fa fa-times\" aria-hidden=\"true\" style=\"color: red;\"></i></a>';\n })\n ->make(true);\n }",
"public function sycTeams(){\n //Get all team\n $url = \"http://db.basketball.nl/db/json/team.pl?clb_ID=81\";\n\n //Get json file for api\n\n //TODO set to api\n $teams = file_get_contents($url);\n $teams = json_decode($teams);\n\n\n //TODO filter if there is dubbel comp_id\n\n //TODO create team categorys for menu\n foreach ($teams->teams as $team){\n\n //Create new team entity\n $teamEntities = $this->Teams->newEntity();\n $teamEntities->name = $team->naam;\n\n //Create slug\n $teamEntities->slug = strtolower(Text::slug(trim($team->naam)));\n $teamEntities->nbb_id = $team->id;\n $teamEntities->comp_id = $team->comp_id;\n\n //Save team\n $this->Teams->save($teamEntities);\n }\n\n }",
"public function index()\n {\n //\n\n return view('admin.team.index')->withEntries(Team::orderByDesc('id')->get());\n }",
"public function addTeams(){\n $sports = Sports::all();\n return view('admin.add_teams')->with('sports', $sports);\n }",
"public function index()\n {\n //\n\n $teams = Team::all();\n\n return view('admin.teams.index', compact('teams'));\n }",
"function new_team()\n\t{\n\t\t// Grab the list of fields for the dropdown.\n\t\t$fields = $this->fields->retrieve_id_name();\n\n\t\t// If there were no fields, then error out.\n\t\tif (!$fields)\n\t\t{\n\t\t\tshow_error('You must add a field before adding a team.');\n\t\t}\n\n\t\t$data = array(\n\t\t\t'form_action' => 'action_create_team',\n\t\t\t'title' => 'Create a New Team',\n\t\t\t'js' => array('/js/admin/admin.js'),\n\t\t\t'css' => array('/styles/admin.css'),\n\t\t\t'fields' => $fields,\n\t\t\t'name' => '',\n\t\t\t'homeid' => '',\n\t\t\t'city' => '',\n\t\t\t'region' => '',\n\t\t\t'msg' => 'Please enter the information regarding the new team.',\n\t\t\t'submit_message' => 'Add Team',\n\t\t\t'sidenav' => self::$user_links\n\t\t);\n\n\t\t$this->load->helper(array('form'));\n\n\t\t$this->load->view('admin/team_edit.php', $data);\n\t}",
"function teams($contest_id = null) {\n $this->auth(COMP_ADM_LEVEL);\n if($contest_id == null){\n $contest_id = $this->uri->segment(3);\n }\n $data['competition_data'] = $this->m_key->getTeamDataByContestId($contest_id);\n $data['teams'] = $this->m_team->getAllByContestId($contest_id);\n $this->load->view('admin/company_admin/v_teams', $data);\n }",
"public function index()\n {\n $team = Team::all();\n return view('admin.team.index')->with('team',$team);\n }",
"public function teamlist_get()\n\t{\n\n\t\tif($_SERVER['REQUEST_METHOD'] != \"GET\")\n\t\t{\n\t\t $this->response('Not Acceptable',406);\n\t\t}\n\t\t$sport_id = $this->input->get('sport_id');\n\t\t$search_text = $this->input->get('search_text');\n\t\t$offset = $this->input->get('offset');\n\t\t$limit = $this->input->get('limit');\n\t\t\n\t\t$this->load->model('User_model');\n\t\t\n\t\t$team_list_count = $this->User_model->GetTeamCount($sport_id, $search_text);\n\t\tif($limit >0 ) {\n\t\t\t$remianest = $team_list_count - $limit;\n\t\t}\n\t\telse {\n\t\t\t$remianest = $team_list_count;\n\t\t}\n\t\t\n\t\t$team_list_arr=$this->User_model->GetTeam($sport_id, $search_text, $offset, $limit);\n\t\tif(count($team_list_arr)>0)\n\t\t{\n\t\t\t$this->response(array('status'=>'success','remaincount' => $remianest, 'team'=>$team_list_arr), 200);\n\t\t}\n\t\telse\n\t\t\t$this->response(array('status'=>'failed','message'=>'No records in database'),200);\n\t\n\t\n\t}",
"public function getTeams()\n {\n $em = $this->getEntityManager();\n $query = $em->createQuery(\n 'SELECT p\n FROM Vlreleases\\UserBundle\\Entity\\Team p\n ORDER BY p.tname ASC'\n );\n $result = $query->getResult();\n \n return $result;\n }",
"public function getTeams() {\n return $this->teams;\n }",
"public function addGetInfos(){\n return view('/backoffice/teams_add');\n }",
"public function team();",
"public function teams_view()\n {\n $user = \\Auth::user();\n $is_referee = \\App\\Referee::where('user_id', $user->id)->first();\n $is_admin = \\App\\Admin::where('user_id', $user->id)->first();\n\n $venue = false;\n $teams = false;\n \n if($is_referee)\n {\n $venue = \\App\\Venue::find($is_referee->venue_id);\n } else if($is_admin) {\n $venue = \\App\\Venue::find($is_admin->venue_id);\n }\n\n if($venue and $is_admin)\n {\n $teams = \\App\\Team::where('venue_id', $is_admin->venue_id)->orderBy('name')->paginate(15);\n } else if($venue and $is_referee) {\n $teams = \\App\\Team::where('venue_id', $is_referee->venue_id)->orderBy('name')->paginate(15);\n } else {\n return abort(404);\n }\n\n return view('admin_users.teams_view', ['teams' => $teams]);\n }",
"public function actionTeam()\n\t{\n\t\t// renders the view file 'protected/views/site/index.php'\n\t\t// using the default layout 'protected/views/layouts/main.php'\n\t\t$this->render('team');\n\t}",
"public function getTeam() {\n\t\t\treturn \"<p>\".$this->team.\"</p>\";\n\t\t}",
"public function generateDropdown(){\n $this->load->model('profilelist');\n $this->load->model('Player');\n $playerresult = $this->Player->all();\n foreach($playerresult as $row){\n $this1 = array(\n 'playername' => $row->Player,\n \n );\n $lists[] = $this1; \n }\n $this->data['playerdropdown'] = $lists;\n }",
"public function index()\n {\n $teams = Team::orderBy('id','asc')->get();\n\n return view('player.teams.index', [\n 'teams' => $teams,\n ]);\n }",
"function viewTeam() {\n global $user;\n $UID = $user->uid;\n\n $params = drupal_get_query_parameters();\n $array = array();\n \n // checks to see if the user has a team\n if (isset($params['TID'])) {\n $TID = $params['TID'];\n } else {\n drupal_set_message(\"No team selected.\", 'error');\n drupal_goto($_SERVER['HTTP_REFERER']);\n }\n\n // checks to see if the user is on the team (keeping in mind that team owners can\n // see their team application\n if (dbGetTeamOwner($TID) != $UID && (!isMyTeam($TID) || teamIsIneligible($TID))) {\n drupal_set_message('You do not have permission to access this page.', 'error');\n return;\n }\n \n $team = dbGetTeam($TID);\n\n $markup = '';\n $markup .= '<div style=\"float:left; width:38%\">';\n // create team header and table\n $markup .= '<table style=\"margin:0px 0px 10px 0px;\"><tr>';\n \n $markup .= '<td style=\"padding:0px 14px 10px 14px;\"><div align=\"left\"><h2 style=\"margin:0px 0px 7px 0px;\"><b>';\n\n // if the team has a type\n if ($team['type'] != \"Other\"){\n $markup .= \"{$team['type']} {$team['number']} - {$team['name']}\";\n } else{\n $markup .= \"Team {$team['number']} - {$team['name']}\";\n }\n \n $markup .= '</b></h2></div></td></tr></table>';\n \n // create table\n $markup .= '<table id=\"photoAndEdit\"><tr><td style=\"padding:0px;\">'; \n\n // if the user can edit team picture\n if (hasPermissionForTeam('editTeam', $TID)){\n $markup .= '<div align=\"right\">';\n $markup .= '<a href= \"?q=editThumbnail';\n $markup .= '&TID='. $TID . '&FID=' . $team['FID'] . '\">';\n $markup .= '<span title=\"Edit Photo\"><button><img class=\"editIcon\" src=\"/images/icons/editThumbnailWhite.png\"></button></span></a>';\n $markup .='</div>';\n } else {\n // otherwise show just a disabled button\n $markup .= '<div align=\"right\">';\n $markup .= '<span title=\"Edit Photo\"><button type=\"button\" disabled><img class=\"editIcon\" src=\"/images/icons/editThumbnailWhite.png\"></button></span>';\n $markup .='</div>';\n }\n\n $markup .= '</td></tr><tr><td style=\"padding:0px;\">';\n\n // if the team has a picture then display\n if (!empty($team['FID'])) {\n $url = generateURL($team['FID']);\n $markup .= '<div align=\"center\"><img src=\"' .$url .'\" style=\"max-width:150px; width:auto; height:auto; padding: 5px 0px 5px 0px\">';\n // default team picture\n } else {\n $markup .= '<div align=\"center\"><img src= \"/images/defaultPics/team.png\" style=\"max-width:200px; width:auto; height:auto; padding: 15px 0px 15px 0px\">';\n }\n\n $markup .= '</div></td></tr></table></div>';\n\n $teams = dbGetTeamsForUser($UID);\n\n $markup .= '<div align=\"right\">';\n\n // if the user can permission to manage outreach\n if (!teamIsIneligible($TID) &&\n hasPermissionForTeam('manageOutreachTags', $TID)) {\n $markup .= '<a href=\"?q=teamModeratorPage\">';\n $markup .= '<div class=\"help tooltip4\">';\n $markup .= '<button>Moderators</button>';\n $markup .= '<span id=\"helptext\"; class=\"helptext tooltiptext4\">';\n $markup .= 'Click here to view ideas, write-ups, and hours awaiting approval.';\n $markup .= '</span></div></a>';\n } else {\n $markup .= '<div class=\"help tooltip4\">';\n $markup .= '<button type=\"button\" disabled>Moderators</button>';\n $markup .= '<span id=\"helptext\"; class=\"helptext tooltiptext4\">';\n $markup .= 'Click here to view ideas, write-ups, and hours awaiting approval.';\n $markup .= '</span></div>';\n\n }\n\n // if the user can manage the outreach settings (currently only tags)\n if (!teamIsIneligible($TID) && hasPermissionForTeam('manageOutreachTags', $TID)){\n $markup .= '<a href=\"?q=teamOutreachSettings\">';\n $markup .= '<button>Settings</button></a>';\n } else {\n $markup .= '<button type=\"button\" disabled>Settings</button>';\n }\n\n // if the user has permission to manage hours\n if (!teamIsIneligible($TID) && hasPermissionForTeam('editAnyHours', $TID)){\n $markup .= '<a href= \"?q=offsetHours';\n $markup .= '&TID=' . $team['TID'] . '\">';\n $markup .= '<div class=\"help tooltip4\">';\n $markup .= '<button type=\"button\"><img class=\"hoursIcon\" src=\"/images/icons/clockWhite.png\"></button>';\n $markup .= '<span id=\"helptext\"; class=\"helptext tooltiptext4\">';\n $markup .= 'Click here to enter old team hours from previous years.';\n $markup .= '</span></div></a>';\n } else {\n $markup .= '<div class=\"help tooltip4\">';\n $markup .= '<button type=\"button\" disabled><img class=\"hoursIcon\" src=\"/images/icons/clockWhite.png\"></button>';\n $markup .= '<span id=\"helptext\"; class=\"helptext tooltiptext4\">';\n $markup .= 'Click here to enter old team hours from previous years.';\n $markup .= '</span></div>';\n }\n \n // if the user can edit the team\n if (hasPermissionForTeam('editTeam',$TID)){\n $markup .= '<a href= \"?q=teamForm&url=viewTeam';\n $markup .= '&TID=' . $team['TID'] . '\">';\n $markup .= '<button type=\"button\"><img class=\"editIcon\" src=\"/images/icons/editWhite.png\"></button></a>';\n } else{\n $markup .= '<button type=\"button\" disabled><img class=\"editIcon\" src=\"/images/icons/editWhite.png\"></button></a>';\n }\n\n // if the user can delete the team\n if (hasPermissionForTeam('deleteTeam', $TID)){ \n $markup .= '<a href= \"?q=deleteTeamPage';\n $markup .= '&TID=' . $team['TID'] . '\">';\n $markup .= '<button type=\"button\"><img class=\"trashIcon\" src=\"/images/icons/trashWhite.png\"></button></a>';\n } else {\n $markup .= '<button type=\"button\" disabled><img class=\"trashIcon\" src=\"/images/icons/trashWhite.png\"></button></a>';\n }\n \n $markup .= '</div>';\n\n // begin displaying info\n\n $markup .= '<div style=\"width:60%; float:right; padding-left:10px\">';\n\n $teams = dbGetTeamsForUser($UID);\n $numOutreaches = dbGetNumOutreachForTeam($TID);\n \n // create table\n $markup .= '<table id=\"miniViewTeam\" style=\"margin:16px 0px 0px 0px\"><tr><td><b>';\n\n if ($numOutreaches != 0){\n $markup .= '<a href=\"?q=outreach&allTeamOutreach\">Outreaches: </a></b>';\n } else {\n $markup .= 'Outreaches: </b>';\n }\n\n $markup .= $numOutreaches . '</td>';\n\n $markup .= '<td><b>Total Number of Hours: </b>' . dbGetHoursForTeam($TID) . '</td></tr>';\n\n $markup .= '<tr><td><b><a href=\"?q=showUsersForTeam';\n $numStudents = dbGetNumStudentsForTeam($team['TID']);\n $numMentors = dbGetNumMentorsForTeam($team['TID']);\n $markup .= '&TID='.$team['TID'].'&type=student\">Students: </a></b>'.dbGetNumStudentsForTeam($team['TID']).'</td>';\n $markup .= '<td><b><a href=\"?q=showUsersForTeam';\n $markup .= '&TID='.$team['TID'].'&type=mentor\">Mentors: </a></b>'.dbGetNumMentorsForTeam($team['TID']).'</td></tr>';\n\n $markup .= '<tr><td><b>City: </b>' . $team['city'] . '</td>';\n $markup .= '<td><b>State: </b>' . $team['state'] . '</td></tr>';\n\n $markup .= '<tr><td><b>Country: </b>' . $team['country'] . '</td>';\n $markup .= '<td><b>Rookie Year: </b>' . $team['rookieYear'] . '</td></tr>';\n\n if ($team['rookieYear'] == NULL){\n $team['rookieYear'] = '[none]';\n }\n\n $markup .= '</table></div>';\n\n return array('#markup' => $markup);\n}",
"public function getTeamList() {\n if ($this->cached['Team']) return array_values($this->cache['Team']);\n return XPClass::forName('de.uska.db.Team')\n ->getMethod('getPeer')\n ->invoke()\n ->doSelect(new Criteria(\n array('team_id', $this->getTeam_id(), EQUAL)\n ));\n }",
"public function index()\n {\n Gate::authorize('teams');\n\n $teams = Team::paginate();\n return view('admin.teams.index',[\n 'teams' => $teams,\n ]);\n }",
"public function show(team_members $team_members)\n {\n //\n }",
"public function getAll()\n {\n return Team::all();\n }",
"public function index()\n {\n $teams = Team::latest()->paginate(20);\n return view('system.teams.index',compact(['teams']));\n }",
"public function our_team() {\r\n $this->load->view('admin/our_team');\r\n }",
"public function index()\n {\n $teams = \\App\\Team::all();\n return view('team.index', compact('teams'));\n }",
"public function index()\n {\n $years = Year::with('teams')->orderBy('name', 'desc')->get();\n\n return view('admin.teams.index', compact('years'));\n }",
"public function getOurTeam()\n {\n $data = HomeController::getPage('our-team');\n return view('our_team')->with(['data' => $data]);\n }",
"public function sportTeams()\n { \n\n $finalTeams = array();\n $technicalTeams = DB::table('teams')->where('domain', '=', 'SPORT')->get();\n $user_id = Auth::user()->id;\n foreach ($technicalTeams as $team) {\n if($team->id != $user_id)\n array_push($finalTeams, $team);\n }\n \n return view('technicalTeams')->with('sportTeams',$finalTeams);\n }",
"public function index()\n {\n return view('teams.index', ['teams' => HelpdeskTeam::all()]);\n }",
"public function Team() {\r\n\t\t$this->id = -1;\r\n\t\t$this->name = \"\";\r\n\t}",
"public function index()\n {\n $teams = Team::paginate(6);\n return view('admin.about.team.index',compact('teams'));\n }",
"function add_team() {\n\t\t\tif(function_exists('vc_map')) {\n\t\t\t\t/*\n\t\t\t\t\tparent element\n\t\t\t\t*/\n\t\t\t\tvc_map(\n\t\t\t\t\tarray(\n\t\t\t\t\t \"name\"\t\t\t\t\t\t=>\t__(\"Team\", \"hgrextender\"),\n\t\t\t\t\t \"base\"\t\t\t\t\t\t=>\t\"hgr_team\",\n\t\t\t\t\t \"class\"\t\t\t\t\t\t=>\t\"\",\n\t\t\t\t\t \"icon\"\t\t\t\t\t\t=>\t\"hgr_team\",\n\t\t\t\t\t \"category\"\t\t\t\t\t=>\t__(\"HighGrade Extender\", \"hgrextender\"),\n\t\t\t\t\t \"as_parent\"\t\t\t\t\t=>\tarray( \"only\" => \"hgr_team_member\" ),\n\t\t\t\t\t \"description\"\t\t\t\t=>\t__(\"Team block\", \"hgrextender\"),\n\t\t\t\t\t \"content_element\"\t\t\t=>\ttrue,\n\t\t\t\t\t \"show_settings_on_create\"\t=>\ttrue,\n\t\t\t\t\t \"deprecated\"\t\t\t\t\t=>\t'4.5',\n\t\t\t\t\t \"params\"\t\t\t\t\t\t=>\tarray(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t\t=>\t\"colorpicker\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t\t=>\t__(\"Team nav bar color:\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t\t=>\t\"team_nav_color\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t\t=>\t\"#e2e1dc\",\n\t\t\t\t\t\t\t\t\"dependency\"\t\t=>\tarray( \n\t\t\t\t\t\t\t\t\t\t\"not_empty\"=>\ttrue \n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t\t=>\t\"colorpicker\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t\t=>\t__(\"Team dominant color:\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t\t=>\t\"team_dominant_color\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t\t=>\t\"#80c8ac\",\n\t\t\t\t\t\t\t\t\"dependency\"\t\t=>\tarray(\n\t\t\t\t\t\t\t\t\t\t\"not_empty\"=>\ttrue\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t\t=>\t\"textfield\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t\t=>\t__(\"Social icons size size (pixels)\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t\t=>\t\"hgr_team_iconsize\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t\t=>\t\"24\",\n\t\t\t\t\t\t\t\t\"save_always\" \t\t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t\t=>\t\"checkbox\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t\t=>\t__(\"Contained team\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t\t=>\t\"hgr_team_contained\",\n\t\t\t\t\t\t\t\t\"description\"\t\t=>\t__(\"If checked, team members will be contained, else, will be full page width. This does not apply to nav bar holding members names.\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"value\"\t\t\t\t=>\tarray( esc_html__(\"Yes, please\", \"hgrextender\") => \"yes\" ),\n\t\t\t\t\t\t\t\t\"save_always\" \t\t=>\ttrue,\n\t\t\t\t\t\t ),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t\t=>\t\"textfield\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t\t=>\t__(\"Extra class\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t\t=>\t\"extra_class\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"description\"\t\t=>\t__(\"Optional extra CSS class\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"save_always\" \t\t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t\t=>\t\"heading\",\n\t\t\t\t\t\t\t\t\"sub_heading\"\t\t=>\t\"This is a global setting page for the whole \\\"Team\\\" block. Add some \\\"Team Members\\\" in the container row to make it complete.\",\n\t\t\t\t\t\t\t\t\"param_name\"\t\t=>\t\"notification\",\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t'type' => 'css_editor',\n\t\t\t\t\t\t\t\t'heading' => __( 'Css', 'hgrextender' ),\n\t\t\t\t\t\t\t\t'param_name' => 'css',\n\t\t\t\t\t\t\t\t'group' => __( 'Design options', 'hgrextender' ),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t),\n\t\t\t\t\t\"js_view\"\t=>\t\"VcColumnView\"\n\t\t\t\t));\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t/*\n\t\t\t\t\tChild element\n\t\t\t\t*/\n\t\t\t\tvc_map(\n\t\t\t\t\tarray(\n\t\t\t\t\t \"name\"\t\t\t\t=>\t__(\"Team Member\", \"hgrextender\"),\n\t\t\t\t\t \"holder\"\t\t\t=>\t\"div\",\n\t\t\t\t\t \"base\"\t\t\t\t=>\t\"hgr_team_member\",\n\t\t\t\t\t \"class\"\t\t\t\t=>\t\"\",\n\t\t\t\t\t \"icon\"\t\t\t\t=>\t\"\",\n\t\t\t\t\t \"content_element\"\t=>\ttrue,\n\t\t\t\t\t \"as_child\"\t\t\t=>\tarray( \"only\" => \"hgr_team\" ),\n\t\t\t\t\t \"params\"\t\t\t=>\tarray(\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"textfield\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Member name\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"member_name\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"description\"\t=>\t__(\"Provide a team member name.\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"textfield\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Member position\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"member_position\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"description\"\t=>\t__(\"Member position in company\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"attach_image\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Member image:\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"member_image\",\n\t\t\t\t\t\t\t\t\"admin_label\"\t=>\ttrue,\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"description\"\t=>\t__(\"Upload member photo.\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"dropdown\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Image style\",\"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"image_style\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\tarray(\n\t\t\t\t\t\t\t\t\t\t\"Full image\"\t\t=>\t\"img-full\",\n\t\t\t\t\t\t\t\t\t\t\"Circle image\"\t\t=>\t\"img-circle\",\n\t\t\t\t\t\t\t\t\t\t\"Rounded image\"\t=>\t\"img-rounded\",\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\"description\"\t=>\t__(\"For Circle or Rounded image we reccomend a square image of 265 pixels.\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"textarea_html\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Member intro text\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"content\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"description\"\t=>\t__(\"Description about this member\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"textfield\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Member skills\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"member_skills\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"description\"\t=>\t__( \"photoshop,80|wordpress,95|php,99\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"textfield\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Dribbble\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"member_dribbble\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"textfield\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Twitter\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"member_twitter\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"textfield\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Facebook\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"member_facebook\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"textfield\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Skype\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"member_skype\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t \"\",\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"textfield\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"LinkedIN\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"member_linkedin\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"textfield\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Vimeo\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"member_vimeo\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"textfield\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Yahoo\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"member_yahoo\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"textfield\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Youtube\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"member_youtube\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"textfield\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Picasa\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"member_picasa\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"textfield\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"DeviantArt\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"member_deviantart\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"textfield\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Pinterest\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"member_pinterest\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"textfield\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"SoundCloud\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"member_soundcloud\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"textfield\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Behance\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"member_behance\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"textfield\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Instagram\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"member_instagram\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t\t\"type\"\t\t\t=>\t\"textfield\",\n\t\t\t\t\t\t\t\t\"class\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"heading\"\t\t=>\t__(\"Google Plus\", \"hgrextender\"),\n\t\t\t\t\t\t\t\t\"param_name\"\t=>\t\"member_googleplus\",\n\t\t\t\t\t\t\t\t\"value\"\t\t\t=>\t\"\",\n\t\t\t\t\t\t\t\t\"save_always\" \t=>\ttrue,\n\t\t\t\t\t\t\t),\n\t\t\t\t\t )\n\t\t\t\t\t) \n\t\t\t\t);\n\t\t\t}\n\t\t}",
"public function index()\n\t{\n $teams = Team::all();\n return view('teams.index', compact('teams'));\n\t}",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('SkokiOrlikBundle:Matches')->findAll();\n $teams = $em->getRepository('SkokiOrlikBundle:Teams')->findAll();\n $tt = array();\n foreach($teams as $t) {\n $tt[$t->getId()] = $t;\n }\n //var_dump($tt,$entities);die();\n\n return $this->render('SkokiOrlikBundle:Matches:index.html.twig', array(\n 'entities' => $entities,\n 'teams' => $tt\n ));\n }",
"function getBlogList(){\n global $wpdb;\n \n $sql = \"SELECT * FROM wp_aw_blog_sites\";\n $results = $wpdb->get_results( $sql, OBJECT );\n\n $html = ''; \n $html .= \"<select name='siteTemplate' multiple id='directories' class='select_list'>\";\n foreach ( $results as $directory ) {\n $html .= \"<option value='\".$directory->site_name.\"'>\".$directory->site_name.\"</option>\";\n }\n $html .= \"</select>\";\n\n $html .= \"<script>jQuery('#directories').select2({placeholder: 'Please select blog(s)', allowClear: true});</script>\";\n\n return $html;\n }",
"public function actionUsers_by_dep() {\n if (isset($_POST['depid']) != 0) {\n $output = '';\n $depid = $_POST['depid'];\n $output = '';\n $output .= '<select id=\"managers\" class=\"form-control\" name=\"team_manager\" required=\"required\">';\n\n $dv_users = Yii::$app->db->createCommand(\"SELECT id, first_name, last_name FROM assist_users WHERE department = '$depid' AND status = 1 \")->queryAll();\n\n foreach ($dv_users as $dvusers){ \n $userrole = $this->checkUserRole($dvusers['id']); \n if ($userrole == 1) {\n $output .= '<option value=\"' . $dvusers['id'] . '\">' . $dvusers['first_name'] . ' ' . $dvusers['last_name'] . '</option>';\n }\n }\n $output .= '</select>';\n return $output;\n }\n }",
"public function index()\n {\n $team = Team::all();\n return $team;\n }",
"public function index()\n\t{\n $this->data['pagebody'] = 'homepage'; // this is the view we want shown\n $teams = $this->team->all();\n $list = array();\n\n\t foreach ($teams as $team) {\n\t $list[$team[\"code\"]] = $team[\"name\"];\n\t }\n\n\t $this->data['selection'] = form_dropdown('teams', $list, '', 'id=\"teams\"');\n\n\t\t\t$this->data['additionalJs'] = '<script src=\"/assets/js/prediction.js\"></script>';\n $this->render();\n\t}",
"public function showSpecificTeamAction(Team $team)\n {\n $activeTeamMemberships = $this->getDoctrine()->getRepository(TeamMembership::class)->findActiveTeamMembershipsByTeam($team);\n $inActiveTeamMemberships = $this->getDoctrine()->getRepository(TeamMembership::class)->findInactiveTeamMembershipsByTeam($team);\n usort($activeTeamMemberships, array( $this, 'sortTeamMembershipsByEndDate' ));\n usort($inActiveTeamMemberships, array( $this, 'sortTeamMembershipsByEndDate' ));\n\n $user = $this->getUser();\n $currentUserTeamMembership = $this->getDoctrine()->getRepository(TeamMembership::class)->findActiveTeamMembershipsByUser($user);\n $isUserInTeam = false;\n foreach ($currentUserTeamMembership as $wh) {\n if (in_array($wh, $activeTeamMemberships)) {\n $isUserInTeam = true;\n }\n }\n\n // Return the view with suitable variables\n return $this->render('team_admin/specific_team.html.twig', array(\n 'team' => $team,\n 'activeTeamMemberships' => $activeTeamMemberships,\n 'inActiveTeamMemberships' => $inActiveTeamMemberships,\n 'isUserInTeam' => $isUserInTeam,\n ));\n }",
"public function index()\n {\n \n try {\n\n // fetching team members\n $team_members = TeamMembers::select('id', 'first_name', 'last_name', 'image','designation', 'designation', 'status','created_at')->get();\n \n return view('admin.team.list-team-member')->with('team_members',$team_members->toArray());\n\n } catch (\\Exception $e) {\n print_r($e->getMessage());\n }\n\n }",
"public function index()\n {\n return view('pages.teams.teams');\n }",
"public function Show_On_Project_Resource()\n {\n $project_code = $this->input->post('id', true);\n $type_icode = $this->input->post('Type', true);\n\n if ($type_icode == '1') {\n $resource_name = $this->technical_user_model->Select_Project_Resource($project_code);\n $output = null;\n foreach ($resource_name as $row) {\n //here we build a dropdown item line for each\n // query result\n $output .= \"<option value='\" . $row['User_Icode'] . \"'>\" . $row['User_Name'] . \"</option>\";\n }\n } else {\n $resource_name = $this->technical_user_model->Select_Work_Order_Resource($project_code);\n $output = null;\n foreach ($resource_name as $row) {\n //here we build a dropdown item line for each\n // query result\n $output .= \"<option value='\" . $row['User_Icode'] . \"'>\" . $row['User_Name'] . \"</option>\";\n }\n }\n\n\n echo $output;\n }",
"function teamedit($team_id = null) {\n $this->auth(COMP_ADM_LEVEL);\n if($team_id == null){\n $team_id = $this->uri->segment(3);\n }\n $data['team'] = $this->m_team->getById($team_id);\n $data['users'] = $this->m_key->getUsersByTeamId($team_id);\n $this->load->view('admin/company_admin/v_teams_edit', $data);\n }",
"public function index()\n {\n $page_title = \"Manage Team\";\n $team = Team::all();\n return view('admin.team.index', compact('page_title', 'team'));\n }",
"protected function getTeamsOptions($project_id)\n\t{\n\t $app = JFactory::getApplication();\n $db = sportsmanagementHelper::getDBConnection(); \n $query = $db->getQuery(true);\n \n\t\tif (empty($this->_teamoptions))\n\t\t{\n\n\t\t\t$query->select('t.id AS value, t.name AS text');\n $query->from('#__sportsmanagement_project_team AS pt');\n $query->join('INNER','#__sportsmanagement_season_team_id as st ON st.id = pt.team_id ');\n $query->join('INNER','#__sportsmanagement_team AS t ON t.id = st.team_id');\n \n $query->where('pt.project_id = '.intval($project_id));\n $query->order('t.name ASC');\n \n\t\t\t$db->setQuery($query);\n \n //$app->enqueueMessage(JText::_(__METHOD__.' '.__LINE__.' <br><pre>'.print_r($query->dump(),true).'</pre>'),'Notice');\n \n\t\t\t$res = $db->loadObjectList();\n\t\t\t\n\t\t\tif (!$res) \n {\n\t\t\t\tJerror::raiseWarning(0, $db->getErrorMsg());\n\t\t\t}\n\t\t\t$this->_teamoptions = $res;\t\t\t\n\t\t}\n\t\treturn $this->_teamoptions;\n\t}",
"public function admin_index() {\n\t\t$this->Team->recursive = 0;\n\t\t$teams = $this->Team->find('all', array(\n\t\t\t'conditions' => array(\n\t\t\t\t'Team.id >=' => 1,\n\t\t\t\t//'Team.status' => array(StatusOfTeam::Active)\n\t\t\t)\n\t\t));\n\t\t$this->set('teams', $teams);\n\t}",
"public function production_team()\n {\n $prodTeams = ProductionTeam::where('status', 'active')->orderBy('idx')->get();\n return view('setup.production_team.index', compact('prodTeams'));\n }",
"public function index()\n {\n return view('backend.team.index');\n }",
"public function index()\n {\n return view('backend.team.index');\n }",
"public function index()\n {\n $teams = Team::all();\n $choice = Choice::first();\n return view(\"pages.admin.home.team.index\", compact(\"teams\", \"choice\"));\n }",
"function get_driver_team($idTeam)\n{\n $list_driver = get_driver_team_db($idTeam);\n return $list_driver;\n}",
"public function index()\n {\n $teams = Team::all();\n \n return view('teams.index', compact('teams'));\n }",
"public function teamSelectorBrowse(Event $event)\n\n {\n $identity = $this->getUser();\n $user_id = $identity->getId();\n $view = $event->getTarget();\n $vars = $view->vars();\n\n if (is_array($vars->resources) && count($vars->resources) > 0){\n $resource_type = $vars->resources[0]->getControllerName() . 's';\n }elseif (is_array($vars->sites) && count($vars->sites)){\n $resource_type ='sites';\n }else{\n $resource_type= null;\n }\n\n $entityManager = $this->getServiceLocator()->get('Omeka\\EntityManager');\n $team_user = $entityManager->getRepository('Teams\\Entity\\TeamUser');\n $user_teams = $team_user->findBy(['user'=>$user_id]);\n $current_team = $team_user->findOneBy(['user'=>$user_id,'is_current'=>true]);\n if ($current_team){\n $current_team = $current_team->getTeam()->getName();\n } elseif ($user_teams){\n $current_team = $team_user->findOneBy(['user'=>$user_id]);\n $current_team->setCurrent(true);\n $entityManager->flush();\n $current_team = $current_team->getTeam()->getName();\n }else $current_team = null;\n\n echo $event->getTarget()->partial(\n 'teams/partial/team-selector',\n ['user_teams'=>$user_teams, 'current_team' => $current_team, 'resource_type' => $resource_type]\n );\n }",
"public function index()\n {\n $teams = Team::all();\n return view('teams.index', ['teams' => $teams]);\n }",
"function dev_tickets_dropdown( $args = array(), $status = '' ) {\n\n\t$defaults = array(\n\t\t'name' => 'dev_tickets',\n\t\t'id' => '',\n\t\t'class' => '',\n\t\t'exclude' => array(),\n\t\t'selected' => '',\n\t\t'select2' => true,\n\t\t'please_select' => false\n\t);\n\n\t/* List all tickets */\n\t$tickets = dev_get_tickets( $status );\n\t$options = '';\n\n\tforeach ( $tickets as $ticket ) {\n\t\t$options .= \"<option value='$ticket->ID'>$ticket->post_title</option>\";\n\t}\n\n\techo dev_dropdown( wp_parse_args( $args, $defaults ), $options );\n\n}",
"public function index()\n {\n $teams = DB::table('team_user')\n ->where('user_id', Auth::user()->id)\n ->get();\n \n return TeamUserResource::collection($teams, 200); \n }",
"protected function createUserAndGroupListForSelectOptions() {}",
"public function index()\n {\n return view('employees::teams.index');\n }",
"public function create()\n {\n return view('admin.teams.create', $this->data);\n }"
]
| [
"0.71787494",
"0.69422895",
"0.68115306",
"0.67134774",
"0.66639173",
"0.65838796",
"0.6485242",
"0.64750344",
"0.64450794",
"0.6437156",
"0.6397265",
"0.6393043",
"0.63838696",
"0.636108",
"0.63186044",
"0.62915576",
"0.62880164",
"0.62595636",
"0.62562054",
"0.6173969",
"0.61576575",
"0.6150064",
"0.6145658",
"0.6139756",
"0.61104864",
"0.60626435",
"0.6054732",
"0.6048812",
"0.60120267",
"0.5991555",
"0.59844947",
"0.59844357",
"0.5971823",
"0.59678453",
"0.59578353",
"0.5955019",
"0.5955019",
"0.5955019",
"0.5955019",
"0.5955019",
"0.5955019",
"0.5941197",
"0.5933938",
"0.59338844",
"0.5921126",
"0.5915762",
"0.59074897",
"0.5903611",
"0.5872864",
"0.5863564",
"0.5862442",
"0.58615315",
"0.5844805",
"0.58265597",
"0.58210665",
"0.5800006",
"0.57666767",
"0.5765135",
"0.576055",
"0.57572544",
"0.57366",
"0.57202876",
"0.57122207",
"0.57098734",
"0.5704033",
"0.56939167",
"0.5689506",
"0.56866753",
"0.5674412",
"0.56737024",
"0.56636673",
"0.5661346",
"0.56605643",
"0.56587785",
"0.5634562",
"0.5630674",
"0.56044817",
"0.5600888",
"0.55974776",
"0.5594228",
"0.5592812",
"0.5590912",
"0.5588581",
"0.5586479",
"0.5585058",
"0.5575126",
"0.5570458",
"0.5567075",
"0.5566619",
"0.55659777",
"0.55659777",
"0.5556651",
"0.5553913",
"0.55516356",
"0.55501896",
"0.55476326",
"0.55456716",
"0.5531553",
"0.55300736",
"0.5529726",
"0.55171955"
]
| 0.0 | -1 |
Display a listing of the resource. | public function index()
{
$task = Team::orderBy('created_at', 'desc')->paginate(15);
/*foreach ($task as $tasks) {
echo $tasks->towers->name;
}*/
return view('team.index')->with('data',$task );
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function indexAction()\n {\n $limit = $this->Request()->getParam('limit', 1000);\n $offset = $this->Request()->getParam('start', 0);\n $sort = $this->Request()->getParam('sort', array());\n $filter = $this->Request()->getParam('filter', array());\n\n $result = $this->resource->getList($offset, $limit, $filter, $sort);\n\n $this->View()->assign($result);\n $this->View()->assign('success', true);\n }",
"public function listing();",
"function index() {\n\t\t$this->show_list();\n\t}",
"public function actionList() {\n $this->_getList();\n }",
"public function listAction()\n {\n $model = $this->_getPhotoModel();\n $entries = $model->fetchEntries($this->_getParam('page', 1));\n\n $this->view->url = 'http://' . $this->_request->getHttpHost() . $this->_request->getBaseUrl(); \n $this->view->paginator = $entries;\n }",
"public function index()\n {\n $items = Item::all();\n return ItemForShowResource::collection($items);\n }",
"public function index()\n {\n return Resource::collection(($this->getModel())::paginate(10));\n }",
"function index()\n\t{\n\t\t$this->_list();\n\t\t$this->display();\n\t}",
"public function listingAction(){\n if (!LoginHelper::isAdmin()){\n Router::redirect('home', '<p class=\"alert alert-danger\">Unauthorized</p>');\n }\n $this->view->render('patient/list', Patient::all());\n }",
"public function index()\n {\n //\n $list = $this->obj->all();\n\n return $this->render('index', compact('list'));\n }",
"public function action_index()\n\t{\n\t\t$this->template->title = 'Resources';\n\t\t$this->view = View::factory('admin/resource/index');\n\t\t$this->template->scripts[] = 'media/js/jquery.tablesorter.min.js';\n\t\t$this->template->scripts[] = 'media/js/admin/resource.js';\n\t\t\n\t\t$resources = Sprig::factory('resource')->load(NULL, FALSE);\n\t\tif (!empty($resources))\n\t\t{\n\t\t\t$this->view->resources = $resources->as_array();\n\t\t}\n\t}",
"function listing()\n\t\t{\n\t\t// en $this->_view->_listado para poder acceder a el desde la vista.\n\t\t\t$this->_view->_listado = $listado = $this->_instrumentoModel->getInstrumento();\n\t\t\t$this->_view->render('listing', '', '',$this->_sidebar_menu);\n\t\t}",
"public function listAction()\n {\n $em = $this->getDoctrine()->getManager();\n \n $todos = $em->getRepository(Todo::class)->findAll();\n \n return $this->render('todo/index.html.twig', array(\n 'todos' => $todos,\n ));\n }",
"public function index()\n\t{\n $this->authorize('list', Instance::class);\n\n\t\treturn $this->ok($this->repo->paginate($this->request->all()));\n\t}",
"public function listing()\n\t{\n\t\t$hospitalID = $this->request->getSession()->read(\"hospital_id\") ? $this->request->getSession()->read(\"hospital_id\") : \"\";\n\t\t\n\t\t$patientMonitored = 1;\n\t\t$patientActive = 1;\n\t\t\n\t\t//GET ALL PATIENTS\n\t\t$patientsData = $this->Patients->allPatients($hospitalID,$patientMonitored,$patientActive);\n\t\t//GET ALL PATIENTS\n\t\t\n\t\t//echo \"<pre>\"; print_r($patientsData);die;\n\t\t$this->set(compact(\"patientsData\"));\n\t}",
"public function actionRestList() {\n\t $this->doRestList();\n\t}",
"public function listAction()\n {\n $htmlpage = '<!DOCTYPE html>\n<html>\n <head>\n <meta charset=\"UTF-8\">\n <title>todos list!</title>\n </head>\n <body>\n <h1>todos list</h1>\n <p>Here are all your todos:</p>\n <ul>';\n \n $em = $this->getDoctrine()->getManager();\n $todos = $em->getRepository(Todo::class)->findAll();\n foreach($todos as $todo) {\n $htmlpage .= '<li>\n <a href=\"/todo/'.$todo->getid().'\">'.$todo->getTitle().'</a></li>';\n }\n $htmlpage .= '</ul>';\n\n $htmlpage .= '</body></html>';\n \n return new Response(\n $htmlpage,\n Response::HTTP_OK,\n array('content-type' => 'text/html')\n );\n }",
"public function index()\n {\n // Get Persons\n $person = Person::paginate(10);\n\n //Return collection of person as a resource\n return PersonResource::collection($person);\n }",
"public function listAction() {\n\t\t$this->view->title = $this->translator->translate(\"Invoice list\");\n\t\t$this->view->description = $this->translator->translate(\"Here you can see all the invoices.\");\n\t\t$this->view->buttons = array(array(\"url\" => \"/admin/invoices/new/\", \"label\" => $this->translator->translate('New'), \"params\" => array('css' => null)));\r\n\t\t$this->datagrid->setConfig ( Invoices::grid() )->datagrid ();\n\t}",
"public function listAll()\n\t{\n\t\t$this->render(self::PATH_VIEWS . '/list', [\n\t\t\t'pages' => $this->pagesDb->findAll('id', 'DESC'),\n\t\t]);\n\t}",
"public function list()\n {\n // récupérer les données : toutes les catégories enregistrées\n $productList = Product::findAll();\n\n $this->show('product/list', [\n 'productList' => $productList\n ]);\n }",
"public function index()\n {\n // CRUD -> Retrieve --> List\n // BREAD -> Browse Read Edit Add Delete\n // return Item::all();\n return view('list_items',compact('items'));\n }",
"public function index()\n {\n // Get manufacturers\n $manufacturers = Manufacturer::orderBy('created_at', 'desc')->paginate(15);\n\n // Return collection of manufacturers as a resource\n return ManufacturerResource::collection($manufacturers);\n }",
"public function index()\n {\n return ArtistResource::collection(Artist::orderBy('created_at', 'desc')->get());\n }",
"public function indexAction() {\n\t\t$page = intval($this->getInput('page'));\n\t\t$perpage = $this->perpage;\n\t\t\n\t\tlist(,$files) = Lock_Service_FileType::getAllFileType();\n\t\t$data = array();\n\t\tforeach ($files as $key=>$value) {\n\t\t\t$data[$key]['id'] = $value['id'];\n\t\t\t$data[$key]['title'] = $value['name'];\n\t\t}\n\t\tlist($total, $filetype) = Lock_Service_FileType::getList($page, $perpage);\n\t\t$this->assign('filetype', $filetype);\n\t\t$this->assign('pager', Common::getPages($total, $page, $perpage, $this->actions['listUrl'].'/?'));\n\t\t$this->assign('data', json_encode($data));\n\t}",
"public function listAction()\n {\n $qb = $this->getRepository()->queryAll();\n\n $view = new ImportListView;\n $view->imports = $qb->getQuery()->execute();\n\n return $this->templating->renderResponse('InfiniteImportBundle:Import:list.html.twig', array(\n 'data' => $view\n ));\n }",
"public function index()\n\t{\n\t\t//Return model all()\n\t\t$instances = $this->decorator->getListingModels();\n\n\t\treturn View::make($this->listingView, array(\n\t\t\t'instances' => $instances,\n\t\t\t'controller' => get_class($this), \n\t\t\t'modelName' => class_basename(get_class($this->decorator->getModel())),\n\t\t\t'columns' => $this->getColumnsForInstances($instances),\n\t\t\t'editable' => $this->editable\n\t\t));\n\t}",
"public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }",
"public function listAction()\n\t {\n\t\t\t$this->_forward('index');\n \n\t\t}",
"public function index()\n {\n $this->list_view();\n }",
"public function index()\n {\n $this->list_view();\n }",
"public function index()\n {\n $this->list_view();\n }",
"public function listAction()\n {\n $defaults = array(\n 'page' => null,\n 'order' => null,\n 'limit' => null,\n 'offset' => null,\n 'filter' => array(),\n );\n $body = $this->getRequest()->getBody();\n $options = $body + $defaults;\n\n // Process the options\n if (is_string($options['order'])) {\n $options['order'] = array_map('trim', explode(',', $options['order']));\n }\n if (is_string($options['page'])) {\n $options['page'] = (int)$options['page'];\n }\n if (is_string($options['limit'])) {\n $options['limit'] = (int)$options['limit'];\n }\n if (is_string($options['offset'])) {\n $options['offset'] = (int)$options['offset'];\n }\n $filter = $options['filter'];\n unset($options['filter']);\n\n $options = array_filter($options);\n\n return $this->getBinding()->find($filter, $options);\n }",
"public function index()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the resources from the model */\n $resources = $this->resourcesList($this->model);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.index\")) {\n $view = \"admin.{$this->name}.index\";\n } else {\n $view = 'admin.includes.actions.index';\n }\n\n /* Display a listing of the resources */\n return view($view)\n ->with('resources', $resources)\n ->with('module', $this->module);\n }",
"public function index()\n\t{\n\t\t$data['lists'] = $this->mdl_student->get_all();\n\t\t$this->template->set('title', 'Student Hostel List');\n\t\t$this->template->load('template', 'contents', 'student_hostel/student_hostel_list', $data);\n\t}",
"public function index()\n {\n $modules = Module::all();\n return Resource::collection($modules);\n }",
"public function index()\n {\n // List all resources from user entity\n $users = User::all();\n\n return $this->showAll($users);\n }",
"public function index()\n {\n // Get todos\n $todos = Todo::orderBy('created_at', 'desc')->paginate(3);\n\n // Return collection of articles as a resource\n return TodoResource::collection($todos);\n }",
"public function index()\n {\n return CourseListResource::collection(\n Course::query()->withoutGlobalScope('publish')\n ->latest()->paginate()\n );\n }",
"public function index()\n {\n return Resources::collection(Checking::paginate());\n }",
"public function index()\n {\n $cars = Car::paginate(15);\n return CarResource::collection($cars);\n }",
"public function index()\n {\n // Get articles\n $articles = Article::orderBy('created_at', 'desc')->paginate(5);\n\n // Return collection of articles as a resource\n return ArticleResource::collection($articles);\n }",
"public function index()\n {\n $authors = Author::paginate(10);\n\n return AuthorResource::collection($authors);\n }",
"public function index()\n {\n //Get Books\n $books = Book::paginate(10);\n \n if ($books) {\n return (BookResource::collection($books))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n } else {\n return (BookResource::collection([]))->additional([\n 'status_code' => 200,\n 'status' => 'success',\n ]);\n }\n return view('index')->with('data', $books);\n }",
"public function index()\n {\n $books = Book::latest()\n ->paginate(20);\n\n return BookResource::collection($books);\n }",
"public function view(){\n\t\t$this->buildListing();\n\t}",
"public function index()\n {\n $listing = Listing::orderBy('id', 'desc')->paginate(10);\n return view('listings.index')->withListings($listing);\n }",
"public function listAction()\n {\n $this->_getSession()->setFormData([]);\n\n $this->_title($this->__('Training Cms'))\n ->_title($this->__('Pages'));\n\n $this->loadLayout();\n\n $this->_setActiveMenu('training_cms');\n $this->_addBreadcrumb($this->__('Training Cms'), $this->__('Training Cms'));\n $this->_addBreadcrumb($this->__('Pages'), $this->__('Pages'));\n\n $this->renderLayout();\n }",
"public function index()\n {\n $services = $this->serviceRepository->paginate();\n\n return ServiceResource::collection($services);\n }",
"public function index()\n {\n $resources = ResourceManagement::paginate(5);\n $users = User::get();\n\n return view('resources-mgmt/index', ['resources' => $resources, 'users' => $users]);\n }",
"public function index()\n {\n $catalogs = Catalog::where('status', '=', Catalog::PUBLICADO)\n ->orderBy('id', 'DESC')->get();\n \n $data = CatalogResource::collection($catalogs);\n\n return [\n 'items' => $data,\n 'mensaje' => ''\n ];\n }",
"public function listAction(){\n // In a controller this can be:\n // $this->request->getQuery('page', 'int'); // GET\n $currentPage = $this->request->getPost('pageindex', 'int'); // POST\n $pageNum = ($currentPage == null) ? 1 : $currentPage;\n\n // The data set to paginate\n $message = new Notice();\n $results = $message->getMsg4Admin();\n\n // Create a Model paginator, show 10 rows by page starting from $currentPage\n $paginator = new PaginatorArray(\n array(\n \"data\" => $results,\n \"limit\" => 10,\n \"page\" => $pageNum\n )\n );\n\n // Get the paginated results\n $page = $paginator->getPaginate();\n\n return $this->response->setJsonContent($page);\n\n }",
"public function list()\n {\n try {\n return $this->success($this->service->list());\n } catch (\\Exception $exception) {\n return $this->error($exception->getMessage());\n }\n }",
"public function index()\n {\n return $this->sendResponse(CrisisResource::collection(Crisis::paginate(10)), 'Data fetched successfully');\n }",
"public function index()\n\t{\n\t\t$%Alias = new %Model();\n\t\t$params = array();\n\t\t\n\t\t$Paginator = new Paginator( $%Alias->findSize( $params ), $this->getLimit(), $this->getPage() );\n\t\t$this->getView()->set( '%Aliass', $%Alias->findList( $params, 'Id desc', $this->getOffset(), $this->getLimit() ) );\n\t\t$this->getView()->set( 'Paginator', $Paginator );\n\t\treturn $this->getView()->render();\n\t}",
"public function listAction() {}",
"public function index()\n {\n\n return RecipeResource::collection(Recipe::all());\n }",
"public function index()\n {\n $this->indexPage('list-product', 'List Product');\n }",
"public function listAction()\n {\t\n\t\t$this->removeSession();\n\t\t$this->verifySessionRights();\n\t\t$this->setActivity(\"List view\");\n $em = $this->getDoctrine()->getManager();\n $oRepClient = $em->getRepository('BoAdminBundle:Client');\n\t\t$nb_tc = $oRepClient->getTotal();\n\t\t//get page\n\t\t$page = $this->get('session')->get('page');\n\t\tif($page==null){\n\t\t\t$page=1;\n\t\t\t$this->get('session')->set('page',1);\n\t\t}\n\t\t//get number line per page\n\t\t$nb_cpp = $em->getRepository('BoAdminBundle:Param')->getParam(\"display_list_page_number\",1);\n\t\t$nb_pages = ceil($nb_tc/$nb_cpp);\n\t\t$offset = $page>0?($page-1) * $nb_cpp:0;\n\t\t$clients = $em->getRepository('BoAdminBundle:Client')->findBy(array(),array('id' => 'desc'),$nb_cpp,$offset);\n $form = $this->createForm('Bo\\AdminBundle\\Form\\ClientType', new Client());\n return $this->render('client/index.html.twig', array(\n 'clients' => $clients,\n\t\t\t'page' => $page, // forward current page to view,\n\t\t\t'nb_pages' => $nb_pages, //total number page,\n 'form' => $form->createView(),\n\t\t\t'total'=>$nb_tc, // record number.\n\t\t\t'nb_cpp' => $nb_cpp,// line's number to display\n\t\t\t'pm'=>\"contracts\",\n\t\t\t'sm'=>\"client\",\n ));\n }",
"public function index()\n {\n return AcResource::collection(Ac::latest()->paginate()); //\n }",
"public function executeList()\n {\n $this->setTemplate('list');\n }",
"public function indexAction()\n {\n $books = Book::getAll();\n\n View::renderTemplate('Books/index.html', [\n 'books' => $books\n ]);\n }",
"function listing() {\r\n\r\n }",
"public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }",
"public function index()\n {\n return BookResource::collection(Book::orderby('id')->get());\n }",
"public function index()\n {\n $client = Client::paginate();\n return ClientResource::collection($client);\n }",
"public function doRestList()\n {\n $this->outputHelper( \n 'Records Retrieved Successfully', \n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->orderBy($this->restSort)->limit($this->restLimit)->offset($this->restOffset)->findAll(),\n $this->getModel()->with($this->nestedRelations)->filter($this->restFilter)->count()\n );\n\t}",
"public function index()\n {\n return TagResource::collection(\n Tag::orderBy('name', 'ASC')->paginate(request('per_page', 10))\n );\n }",
"public function index()\n\t{\n\t\t$data['lists'] = $this->gallery_mdl->get_all();\n\t\t$this->template->set('title', 'Gallery');\n\t\t$this->template->render('template', 'list', $data);\n\t}",
"public function _index(){\n\t $this->_list();\n\t}",
"public function index()\n {\n $this->booklist();\n }",
"function drush_restapi_list() {\n\n $resources = restapi_get_resources();\n $last_module = NULL;\n $rows = [\n [dt('Module'), dt('Path'), dt('Class')],\n ];\n\n foreach($resources as $resource) {\n if ($last_module != $resource->getModule()) {\n $module = $last_module = $resource->getModule();\n }\n else {\n $module = '';\n }\n $rows[] = [$module, $resource->getPath(), $resource->getClass()];\n }\n\n drush_print_table($rows, TRUE);\n drush_log(dt('Displaying !count total resources', [\n '!count' => count($resources),\n ]), 'ok');\n\n}",
"public function index()\n {\n $items = Item::all();\n return view('items::list_items',compact('items'));\n }",
"public function index()\n {\n //\n $accounts = accounts::paginate(15);\n\n //return the collection of employees as a resource\n return accountResource::collection($accounts);\n\n\n }",
"public function index()\n {\n // Get houses\n $houses = House::orderBy('created_at', 'desc')->paginate(self::PAGINATE);\n \n // Return collection of houses\n \n return HouseResource::collection($houses);\n }",
"public function index()\n {\n $products = Product::paginate(6);\n return ProductResource::collection($products);\n }",
"public function index() {\n $this->template->allFoundItems = Found::showAll();\n $this->template->display( 'index.html.php' );\n }",
"public function indexAction() {\n $this->_forward('list');\n }",
"public function index()\n {\n $data = Productcategory::paginate(10);\n\t\treturn ProductcategoryResource::Collection($data);\n }",
"public function index()\n {\n return SongResource::collection(\\App\\Song::orderBy('created_at', 'desc')->get());\n }",
"public function ListView()\n\t{\n\t\t\n\t\t// Requer permissão de acesso\n\t\t$this->RequirePermission(Usuario::$P_ADMIN,\n\t\t\t\t'SecureExample.LoginForm',\n\t\t\t\t'Autentique-se para acessar esta página',\n\t\t\t\t'Você não possui permissão para acessar essa página ou sua sessão expirou');\n\t\t\n\t\t//$usuario = Controller::GetCurrentUser();\n\t\t//$this->Assign('usuario',$usuario);\n\t\t$this->Render();\n\t}",
"public function index () {\n permiss ( 'role.list' );\n\n $data = $this->entity\n ->orderBy('created_at', 'desc')->get();\n\n return new ModelResource($data);\n }",
"public function index()\n {\n //get articless\n $articles = Article::paginate(15);\n\n //Return collection of article has a resource\n return ArticleResource::collection($articles);\n\n }",
"public function showResources()\n {\n $resources = Resource::get();\n return view('resources', compact('resources'));\n }",
"public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }",
"public function list()\n {\n return $this->http->request(HttpMethods::GET, $this->endpoint);\n }",
"public function indexAction(){\n $data = array(\n 'collection' => $this->model->getCollection(),\n \n ); \t\n return $this->getView($data);\n }",
"public function actionIndex()\n {\n $dataProvider = new ActiveDataProvider([\n 'query' => Slaves::find(),\n ]);\n\n return $this->render('index', [\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function indexAction()\n {\n $em = $this->getDoctrine()->getManager();\n\n $entities = $em->getRepository('DiverPriceLisrBundle:Items')->findAll();\n\n return $this->render('DiverPriceLisrBundle:Items:index.html.twig', array(\n 'entities' => $entities,\n ));\n }",
"public function listAction() {\n\t\t// Recogemos el repositorio\n\t\t$repository = $this->getDoctrine() ->getRepository('AppBundle:Product');\n\t\n\t\t// Recuperamos todos los productos.\n\t\t$products = $repository->findAll();\n\t\t// Pasamos a la plantilla el aray products\n\t\treturn $this->render('product/listActionProduct.html.twig', array( 'products' => $products));\n\t\n\t}",
"public function actionList()\n {\n // get model\n $model = new $this->_model('search');\n $model->unsetAttributes();\n\n // set filter\n if (isset($_GET[$this->_model])) {\n $model->attributes = $_GET[$this->_model];\n }\n $model->u_cms_album_id = $_GET['album'];\n\n // search\n $dataProvider = $model->search(Yii::app()->language);\n // sort\n $sort = $dataProvider->getSort();\n // route\n $sort->route = $this->id . '/list';\n\n // pagination parameters\n $pagination = $dataProvider->getPagination();\n $pagination->route = $this->id . '/list';\n $pagination->pageSize = UInterfaceSetting::model()->getSettings($this->id . ':' . $this->module->id, Yii::app()->user->id)->page_size;\n $pagination->itemCount = $dataProvider->totalItemCount;\n\n // datas\n $datas = $dataProvider->getData();\n\n // related datas\n $relatedDatas = $this->_loadRelatedData();\n\n // template\n $template = isset($_REQUEST['partial']) ? 'list/_table' : 'list/main';\n\n $jsonParams = array();\n if (Yii::app()->request->isAjaxRequest) {\n // filters\n $filtersDatas = array();\n if (isset($_GET[$this->_model])) {\n $filtersDatas[$this->_model] = $_GET[$this->_model];\n }\n if (isset($_GET[$sort->sortVar])) {\n $filtersDatas[$sort->sortVar] = $_GET[$sort->sortVar];\n }\n\n $jsonParams = array(\n 'filters' => http_build_query($filtersDatas)\n );\n }\n\n $this->dynamicRender(\n $template,\n array(\n 'dataView' => new $this->crudComponents['listDataView'](\n $datas, $relatedDatas, $model, $sort, $pagination, $this\n )\n ),\n $jsonParams\n );\n }",
"public function listAction()\n\t {\n\t\t$model = $this->_getModel();\n\t\t$result = $model->getLayouts();\t\n\t\t$page = (int)($this->_request->getParam('page')); \n\t\tif(count($result) > 0)\n\t\t{ \n\t\t\tGlobals::doPaging($result, $page, $this->view);\n\t\t}\n\t\t\t\t\n\t\t$this->view->page = $page;\n\t }",
"public function index()\n {\n return view('listings.index')->with('listings', Listing::all());\n }",
"public function get_index()\n\t{\n\t\t$pages = Page::recent_available()->paginate(30);\n\t\t$table = Cello\\Presenter\\Page::table($pages);\n\t\t$data = array(\n\t\t\t'eloquent' => $pages,\n\t\t\t'table' => $table,\n\t\t);\n\n\t\tSite::set('title', __('cello::title.pages.list'));\n\n\t\treturn View::make('cello::api.resources.index', $data);\n\t}",
"public function index()\n {\n $category = GalleryCategory::paginate(15);\n\n // return collection of category as a resource.\n return Resource::collection($category);\n }",
"public function index()\n {\n return ProductResource::collection(Product::latest()->paginate(10));\n }",
"public function index()\n {\n //\n $news = News::latest()->paginate(18);\n\n return NewsResource::collection($news);\n }",
"public function indexAction() {\n\t\t$list_info = Zend_Registry::get('list_info');\n if (!Engine_Api::_()->core()->hasSubject('list_listing')) {\n return $this->setNoRender();\n }\n \n $this->view->expiry_setting = Engine_Api::_()->list()->expirySettings();\n\n //GET SUBJECT\n $this->view->list = $list = Engine_Api::_()->core()->getSubject('list_listing');\n\n\t\t//GET CATEGORY TABLE\n\t\t$this->view->tableCategory = Engine_Api::_()->getDbTable('categories', 'list');\n\n //GET CATEGORIES NAME\n\t\t$this->view->category_name = $this->view->subcategory_name = $this->view->subsubcategory_name = '';\n\n\t\tif(!empty($list->category_id)) {\n\t\t\tif($this->view->tableCategory->getCategory($list->category_id))\n\t\t\t$this->view->category_name = $this->view->tableCategory->getCategory($list->category_id)->category_name;\n\n\t\t\tif(!empty($list->subcategory_id)) {\n\t\t\t\tif($this->view->tableCategory->getCategory($list->subcategory_id))\n\t\t\t\t$this->view->subcategory_name = $this->view->tableCategory->getCategory($list->subcategory_id)->category_name;\n\n\t\t\t\tif(!empty($list->subsubcategory_id)) {\n\t\t\t\t\tif($this->view->tableCategory->getCategory($list->subsubcategory_id))\n\t\t\t\t\t$this->view->subsubcategory_name = $this->view->tableCategory->getCategory($list->subsubcategory_id)->category_name;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n //GET LISTING TAGS\n $this->view->listTags = $list->tags()->getTagMaps();\n\n\t\t//GET OTHER DETAILS\n\t\t$this->view->list_description = Zend_Registry::get('list_descriptions');\n $this->view->addHelperPath(APPLICATION_PATH . '/application/modules/Fields/View/Helper', 'Fields_View_Helper');\n $this->view->fieldStructure = Engine_Api::_()->fields()->getFieldsStructurePartial($list);\n\t\tif(empty($list_info)){ return $this->setNoRender(); }\n }",
"public function index()\n {\n return $this->service->fetchResources(Author::class, 'authors');\n }",
"public function index()\n {\n return view('admin.resources.index');\n }",
"public function doRestList() {\n\t\t$this->outputHelper ( 'Collections Retrieved Successfully', $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->orderBy ( $this->restSort )->limit ( $this->restLimit )->offset ( $this->restOffset )->findAll (), $this->getModel ()->with ( $this->nestedRelations )->filter ( $this->restFilter )->count () );\n\t}"
]
| [
"0.7447426",
"0.73628515",
"0.73007894",
"0.7249563",
"0.7164474",
"0.7148467",
"0.71320325",
"0.7104678",
"0.7103152",
"0.7100512",
"0.7048493",
"0.6994995",
"0.69899315",
"0.6935843",
"0.6899995",
"0.68999326",
"0.6892163",
"0.6887924",
"0.6867505",
"0.6851258",
"0.6831236",
"0.68033123",
"0.6797587",
"0.6795274",
"0.67868614",
"0.67610204",
"0.67426085",
"0.67303514",
"0.6727031",
"0.67257243",
"0.67257243",
"0.67257243",
"0.67195046",
"0.67067856",
"0.67063624",
"0.67045796",
"0.66655326",
"0.666383",
"0.66611767",
"0.66604036",
"0.66582054",
"0.6654805",
"0.6649084",
"0.6620993",
"0.66197145",
"0.6616024",
"0.66077465",
"0.6602853",
"0.6601494",
"0.6593894",
"0.65878326",
"0.6586189",
"0.6584675",
"0.65813804",
"0.65766823",
"0.65754175",
"0.657203",
"0.657202",
"0.65713936",
"0.65642136",
"0.6563951",
"0.6553249",
"0.6552584",
"0.6546312",
"0.6536654",
"0.6534106",
"0.6532539",
"0.6527516",
"0.6526785",
"0.6526042",
"0.65191233",
"0.6518727",
"0.6517732",
"0.6517689",
"0.65155584",
"0.6507816",
"0.65048593",
"0.6503226",
"0.6495243",
"0.6492096",
"0.6486592",
"0.64862204",
"0.6485348",
"0.6483991",
"0.64789015",
"0.6478804",
"0.64708763",
"0.6470304",
"0.64699143",
"0.6467142",
"0.646402",
"0.6463102",
"0.6460929",
"0.6458856",
"0.6454334",
"0.6453653",
"0.645357",
"0.6450551",
"0.64498454",
"0.64480853",
"0.64453584"
]
| 0.0 | -1 |
Show the form for creating a new resource. | public function create()
{
//
return view('team.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 return view('rests.create');\n }",
"public function create()\n {\n //\n return view('form');\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 {\n // Show the page\n return view('admin.producer.create_edit');\n }",
"public function create(){\n return view('form.create');\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 $breadcrumb='car.create';\n return view('admin.partials.cars.form', compact('breadcrumb'));\n }",
"public function create()\n {\n $title = trans('entry_mode.new');\n return view('layouts.create', compact('title'));\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 create()\n {\n $page_title = \"Add New\";\n return view($this->path.'create', compact('page_title'));\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\t\t$title = 'Create | Show';\n\n\t\treturn view('admin.show.create', compact('title'));\n\t}",
"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}",
"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 {\n return view('student::students.student.create');\n }"
]
| [
"0.7593198",
"0.7593198",
"0.75881755",
"0.75787884",
"0.7570936",
"0.74992913",
"0.7436037",
"0.7431172",
"0.7386512",
"0.7351077",
"0.7337819",
"0.73100585",
"0.7295612",
"0.72803086",
"0.7272473",
"0.72422874",
"0.7229479",
"0.7224403",
"0.7184453",
"0.7177193",
"0.7173551",
"0.71482",
"0.71424824",
"0.7141885",
"0.7135663",
"0.7126202",
"0.7121413",
"0.7113729",
"0.7113729",
"0.7113729",
"0.7110717",
"0.7092118",
"0.7083616",
"0.7080794",
"0.7078082",
"0.70561296",
"0.70561296",
"0.7054459",
"0.703925",
"0.70373696",
"0.70346737",
"0.70324355",
"0.70287114",
"0.7025425",
"0.7025232",
"0.7018496",
"0.7016745",
"0.7002774",
"0.70019513",
"0.69991785",
"0.69942427",
"0.69936013",
"0.69929653",
"0.6988009",
"0.69856364",
"0.6965122",
"0.6964889",
"0.6955187",
"0.69511235",
"0.69497",
"0.6947041",
"0.69432163",
"0.6940678",
"0.6939846",
"0.6936846",
"0.6936846",
"0.6936506",
"0.6933589",
"0.69309",
"0.69273484",
"0.6925485",
"0.6921386",
"0.6917649",
"0.6913987",
"0.6910826",
"0.6909406",
"0.69085246",
"0.6907409",
"0.69021183",
"0.6900961",
"0.68997645",
"0.68991655",
"0.6894049",
"0.68920606",
"0.6892033",
"0.6891114",
"0.6890811",
"0.6890811",
"0.6887868",
"0.6887327",
"0.68854356",
"0.688366",
"0.68805534",
"0.68766564",
"0.68753666",
"0.6872474",
"0.68717086",
"0.6869974",
"0.6869806",
"0.6868809",
"0.68685615"
]
| 0.0 | -1 |
Store a newly created resource in storage. | public function store(Request $request)
{
//
$input = $request->all();
$table = new Team;
$table->fill($input);
$table->save();
$table->attachUsers($input['member']);
Log::info('Create Team #.'.$table->id.' Stack trace:',[
//'from'=>$temp->toArray(),
'to'=>$table->toArray()
]);
return redirect('team/create')
->withSuccess("Success Create New Team");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function store($data, Resource $resource);",
"public function store()\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n if (method_exists($this, 'storeValidations')) {\n $this->request->validate($this->storeValidations());\n }\n\n /* Create a new resource */\n $resource = $this->model::create(Input::all());\n\n /* Redirect to newly created resource page */\n return redirect()\n ->route($this->name . '.edit', $resource->id)\n ->with(\n 'success',\n Lang::has($this->name . '.resource-created') ?\n $this->name . '.resource-created' :\n 'messages.alert.resource-created'\n );\n }",
"public function store(CreateStorageRequest $request)\n {\n $this->storage->create($request->all());\n\n return redirect()->route('admin.product.storage.index')\n ->withSuccess(trans('core::core.messages.resource created', ['name' => trans('product::storages.title.storages')]));\n }",
"public function createStorage();",
"public function store(StoreStorage $request)\n {\n $storage = Storage::create($request->all());\n $request->session()->flash('alert-success', 'Запись успешно добавлена!');\n return redirect()->route('storage.index');\n }",
"public function saveShopifyResource() {\n if (is_null($this->getShopifyId())) { // if there is no id...\n $this->createShopifyResource(); // create a new resource\n } else { // if there is an id...\n $this->updateShopifyResource(); // update the resource\n }\n }",
"public function store(Request $request, NebulaResource $resource): RedirectResponse\n {\n $this->authorize('create', $resource->model());\n\n $validated = $request->validate($resource->rules(\n $resource->createFields()\n ));\n\n $resource->storeQuery($resource->model(), $validated);\n\n $this->toast(__(':Resource created', [\n 'resource' => $resource->singularName(),\n ]));\n\n return redirect()->back();\n }",
"function storeAndNew() {\n $this->store();\n }",
"public function store(Request $request)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $validator = Validator::make($request->all(), [\n 'content' => 'required|string',\n 'image_link' => 'sometimes|url',\n ]);\n\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), [], 400);\n }\n\n $resource = new Resource;\n $resource->user_id = $currentUser['id'];\n $resource->title = $request->get('title');\n $resource->content = $request->get('content');\n $resource->image_link = $request->get('imageLink');\n $resource->video_link = $request->get('videoLink');\n $resource->file_link = $request->get('fileLink');\n $resource->audio_link = $request->get('audioLink');\n $resource->tags = collect($request->get('tags'))->implode('text', ',');\n $resource->is_public = 0;\n $resource->save();\n $data['resource'] = $resource;\n\n if ($request->get('programId')) {\n $this->addToProgram($resource, $request->programId);\n // event(new NewLearningPathResourcePublished($resource, $invitee));\n }\n\n User::find($currentUser['id'])->increment('points', 2);\n\n return APIHandler::response(1, \"New resource has been created\", $data, 201);\n }",
"public function store()\n {\n if (!$this->id) { // Insert\n $this->insertObject();\n } else { // Update\n $this->updateObject();\n }\n }",
"public function store()\n\t{\n\t\t\n\t\t//\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\r\n\t{\r\n\t\t//\r\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}",
"public function store()\n\t{\n\t\t//\n\t}"
]
| [
"0.72865677",
"0.7145327",
"0.71325725",
"0.6640912",
"0.66209733",
"0.65685713",
"0.652643",
"0.65095705",
"0.64490104",
"0.637569",
"0.63736665",
"0.63657933",
"0.63657933",
"0.63657933",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437",
"0.6342437"
]
| 0.0 | -1 |
Display the specified resource. | public function show($id)
{
//
$team = Team::with('user')->find($id);
return view('team.view')->with('data',$team);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function show(Resource $resource)\n {\n // not available for now\n }",
"public function show(Resource $resource)\n {\n //\n }",
"function Display($resource_name, $cache_id = null, $compile_id = null)\n {\n $this->_smarty->display($resource_name, $cache_id, $compile_id);\n }",
"private function showResourceable($resourceable)\n {\n save_resource_url();\n\n return $this->view('resources.create_edit')\n ->with('resource', $resourceable)\n ->with('photos', $resourceable->photos)\n ->with('videos', $resourceable->videos)\n ->with('documents', $resourceable->documents);\n }",
"function display($resource_name, $cache_id = null, $compile_id = null) {\n\t\t$this->_getResourceInfo($resource_name); // Saves resource info to a Smarty class var for debugging\n\t\t$_t3_fetch_result = $this->fetch($resource_name, tx_smarty_div::getCacheID($cache_id), $compile_id);\n if ($this->debugging) { // Debugging will have been evaluated in fetch\n require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');\n $_t3_fetch_result .= smarty_core_display_debug_console(array(), $this);\n }\n\t\treturn $_t3_fetch_result;\n\t}",
"public function show(ResourceSubject $resourceSubject)\n {\n //\n }",
"public function show(ResourceManagement $resourcesManagement)\n {\n //\n }",
"public function viewEditResources()\n {\n $database = new Database();\n $id = $this->_params['id'];\n\n $resource = $database->getResourceById($id);\n\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n $this->_f3->set('Resource', $availableResource);\n\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/edit-resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function retrieve(Resource $resource);",
"public function showResource($resouceable, $id)\n {\n $model_name = str_replace('-', ' ',ucwords($resouceable));\n $model_name = str_replace(' ', '',ucwords($model_name));\n\n $resource_type = 'App\\Models\\\\'.$model_name;\n $model = app($resource_type);\n $model = $model->find($id);\n\n return $this->showResourceable($model);\n }",
"public function showAction(Ressource $ressource)\n {\n $deleteForm = $this->createDeleteForm($ressource);\n\n return $this->render('ressource/show.html.twig', array(\n 'ressource' => $ressource,\n 'delete_form' => $deleteForm->createView(),\n ));\n }",
"public function show(Dispenser $dispenser)\n {\n //\n }",
"public function show($id)\n {\n $resource = Resource::find($id);\n dd($resource);\n }",
"public function displayAction() {\n\t\tif(is_numeric($this->req_id)) {\n\t\t\tAPI::DEBUG(\"[DefaultController::displayAction()] Getting \" . $this->req_id, 1);\n\t\t\t$this->_view->data['info'] = $this->_model->get($this->req_id);\n\t\t\t$this->_view->data['action'] = 'edit';\n\n\t\t} else {\n\t\t\t$this->_view->data['action'] = 'new';\n\t\t}\n\t\t// auto call the hooks for this module/action\n\t\terror_log(\"Should Call: \" . $this->module .\"/\".$this->action.\"/\".\"controller.php\");\n\t\tAPI::callHooks($this->module, $this->action, 'controller', $this);\n\n\t\t$this->addModuleTemplate($this->module, 'display');\n\n\t}",
"public function show(NebulaResource $resource, $item): View\n {\n $this->authorize('view', $item);\n\n return view('nebula::resources.show', [\n 'resource' => $resource,\n 'item' => $item,\n ]);\n }",
"public function resource(string $resource, string $controller): void\n {\n $base = $this->plural($resource);\n $entity = '/{'.$resource.'}';\n\n $this->app->get($base, $controller.'@index');\n $this->app->post($base, $controller.'@store');\n $this->app->get($base.$entity, $controller.'@show');\n $this->app->patch($base.$entity, $controller.'@update');\n $this->app->delete($base.$entity, $controller.'@destroy');\n }",
"function displayCustom($resource_name, $cache_id = null, $compile_id = null)\n\t{\n\t return $this->display(DotbAutoLoader::existingCustomOne($resource_name), $cache_id, $compile_id);\n\t}",
"public function show($id)\n {\n /* Check if logged in user is authorized to make this request */\n $this->authorizeAction();\n\n /* Get the specified resource */\n $resource = $this->model::findOrFail($id);\n\n /* Sets the view */\n if (view()->exists(\"admin.{$this->name}.show\")) {\n $view = \"admin.{$this->name}.show\";\n } else {\n $view = 'admin.includes.actions.show';\n }\n\n /* Displays the specified resource page */\n return view($view)\n ->with('resource', $resource)\n ->with('name', $this->name);\n }",
"public function show($id)\n {\n $currentUser = JWTAuth::parseToken()->authenticate();\n $rules = [\n 'id' => 'required|integer'\n ];\n\n $validator = Validator::make(['id' => $id], $rules);\n if ($validator->fails()) {\n return APIHandler::response(0, $validator->errors(), 400);\n }\n $resource = $this->resourceRepository->fetchResource($id);\n $this->resourceRepository->storeView($id, $currentUser['id']);\n\n $data = [\n 'resource' => $resource,\n 'related_resources' => $this->resourceRepository->getResourcesRelatedTo($resource->id, $resource->mentoring_area_id)\n ];\n\n return APIHandler::response(1, \"Show Resource\", $data);\n }",
"public function get(Resource $resource);",
"public function showAction()\n {\n $model = $this->_getPhotoModel();\n $photo = $model->fetchEntry($this->getRequest()->getParam('id'));\n\n if (null === $photo) {\n return $this->_forward('notfound', 'error');\n }\n\n $this->view->auth = Zend_Auth::getInstance();\n $this->view->title = $photo->title;\n $this->view->photo = $photo;\n }",
"public function show($id)\n {\n //\n $data=Resource::find($id);\n return view('resourceDetails',compact('data'));\n }",
"function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}",
"public function show(ShowResourceRequest $request, $id)\n {\n // TODO: Implement show() method.\n }",
"function show( $resource ){\n\n $where = \"reservation_status <> 'Pending' AND id = {$resource}\";\n $reservation = where( 'reservations', $where );\n $reservation = $reservation[0];\n\n return view('admin/reservation/preview_reservation', compact( 'reservation' ));\n}",
"public function show()\n {\n if ($this->twig !== false) {\n $this->twigDefaultContext();\n if ($this->controller) {\n $this->controller->display($this->data);\n }\n echo $this->twig->render($this->twig_template, $this->data);\n } else {\n $filename = $this->findTemplatePath($this->template);\n require($filename);\n }\n }",
"public function edit(Resource $resource)\n {\n //\n }",
"public function show(rc $rc)\n {\n //\n }",
"public function show(Resolucion $resolucion)\n {\n //\n }",
"public function showAction(furTexture $furTexture)\n {\n\n return $this->render('furtexture/show.html.twig', array(\n 'furTexture' => $furTexture,\n ));\n }",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show()\n\t{\n\t\t//\n\t}",
"public function show(Resena $resena)\n {\n }",
"public function edit(Resource $resource)\n {\n return view('admin.resources.edit', compact('resource'));\n }",
"public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }",
"public function action_display()\r\n\t{\r\n\t\t$event = ORM::factory('event', array('id' => $this->request->param('id')));\r\n\t\r\n\t\tif ( ! $event->loaded())\r\n\t\t{\r\n\t\t\tNotices::error('event.view.not_found');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Can user view this event?\r\n\t\tif ( ! $this->user->can('event_view', array('event' => $event)))\r\n\t\t{\r\n\t\t\t// Error notification\r\n\t\t\tNotices::error('event.view.not_allowed');\r\n\t\t\t$this->request->redirect(Route::url('event'));\r\n\t\t}\r\n\t\t\r\n\t\t// Pass event data to the view class\r\n\t\t$this->view->event_data = $event;\r\n\t\t$this->view->user = $this->user;\r\n\t}",
"public function execute()\n {\n // HTTP Request Get\n if ($this->type == \"resource\") {\n $action = $this->getResourceAction();\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n } else {\n $action = $this->Request->action;\n switch ($action) {\n case \"show\":\n $this->show();\n break;\n case \"create\":\n $this->create();\n break;\n case \"edit\":\n $this->edit();\n break;\n case \"destroy\":\n $this->destroy();\n break;\n default:\n echo $this->render();\n break;\n }\n }\n }",
"public function show(Resident $resident)\n {\n $this->authorize('admin.resident.show', $resident);\n\n // TODO your code goes here\n }",
"public function display()\n {\n echo $this->getDisplay();\n $this->isDisplayed(true);\n }",
"public function display()\n\t{\n\t\tparent::display();\n\t}",
"public function get_resource();",
"public function show()\n\t{\n\t\t\n\t}",
"function display() {\n\n\t\t// Check authorization, abort if negative\n\t\t$this->isAuthorized() or $this->abortUnauthorized();\n\n\t\t// Get the view\n\t\t$view = $this->getDefaultView();\n\n\t\tif ($view == NULL) {\n\t\t\tthrow new Exception('Display task called, but there is no view assigned to that controller. Check method getDefaultView.');\n\t\t}\n\n\t\t$view->listing = true;\n\n\t\t// Wrap the output of the views depending on the way the stuff should be shown\n\t\t$this->wrapViewAndDisplay($view);\n\n\t}",
"public function viewResources()\n {\n $database = new Database();\n\n $resources = $database->getAllActiveResourcesNoLimit();\n\n\n $resourceArray = array();\n $i = 1;\n\n foreach ($resources as $resource) {\n $availableResource = new Resource($resource['ResourceID'], $resource['ResourceName'], $resource['Description']\n , $resource['ContactName'] , $resource['ContactEmail'] , $resource['ContactPhone'] ,\n $resource['Link'], $resource['active']);\n array_push($resourceArray, $availableResource);\n $i += 1;\n }\n $resourceSize = sizeof($resourceArray);\n $this->_f3->set('resourcesByActive', $resourceArray);\n $this->_f3->set('resourcesSize', $resourceSize);\n echo Template::instance()->render('view/include/head.php');\n echo Template::instance()->render('view/include/top-nav.php');\n echo Template::instance()->render('view/resources.php');\n echo Template::instance()->render('view/include/footer.php');\n }",
"public function show($id)\n {\n $this->title .= ' show';\n $this->one($id);\n }",
"public function display($title = null)\n {\n echo $this->fetch($title);\n }",
"public function display(){}",
"public function show($id)\n\t{\n\t\t//\n\t\t//\n\t\n\t}",
"public function viewAction()\n\t{\n\t\t//get Id param from request\n\t\tif (!$id = $this->_getParam('id')) {\n\t\t\t$this->getFlashMessenger()->addMessage('Product ID was not specified');\n\t\t\t$this->getRedirector()->gotoSimple('list');\n\t\t}\n\n\t\t//fetch requested ProductID from DB\n\t\tif (!$this->_model->fetch($id)) {\n\t\t\t$this->render('not-found');\n\t\t} else {\n\t\t\t$this->view->model = $this->_model;\n\t\t}\n\t}",
"public function show($id)\n {\n // Get single person\n $person = Person::findOrFail($id);\n\n // Return single person as a resource\n return '<h1>Person Number '.$id.'</h1><br>'.json_encode(new PersonResource($person));\n }",
"#[TODO] use self object?\n\tprotected function GET(ResourceObject $resource) {\n#[TODO]\t\tif ($resource->getMTime())\n#[TODO]\t\t\t$this->response->headers->set('Last-modified', gmdate('D, d M Y H:i:s ', $resource->getMTime()) . 'GMT');\n#[TODO]\t\tif ($resource->getCTime())\n#[TODO]\t\t\t$this->response->headers->set('Date', gmdate('D, d M Y H:i:s ', $resource->getCTime()) . 'GMT');\n\n\n#[TODO] handle file streams\n\t\t// get ranges\n#\t\t$ranges = WebDAV::getRanges($this->request, $this->response);\n\n\t\t// set the content of the response\n\t\tif ($resource instanceof ResourceDocument) {\n\t\t\t$this->response->content->set($resource->getContents());\n\t\t\t$this->response->content->setType($resource->getMIMEType());\n\t\t\t$this->response->content->encodeOnSubmit(true);\n\t\t}\n\t}",
"public function display() {\n echo $this->render();\n }",
"public function show($id)\n\t{\n\t//\n\t}",
"public function show($id)\n\t{\n\t//\n\t}",
"function Fetch($resource_name, $cache_id = null, $compile_id = null, $display = false)\n {\n return $this->_smarty->fetch($resource_name, $cache_id, $compile_id, $display);\n }",
"public function show($id)\n {\n //\n $this->_show($id);\n }",
"public function show()\n\t{\n\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {\n\t\t//\n\t}",
"public function show($id) {}",
"static public function showCallback(O_Dao_Renderer_Show_Params $params) {\r\n\t\t/* @var $r R_Mdl_Resource */\r\n\t\t$r = $params->record();\r\n\t\t// Setting layout title\r\n\t\t$params->layout()->setTitle($r->getPageTitle());\r\n\r\n?><h1><?=$r->title?></h1><div id=\"resource\"><?\r\n\t\tif($r->getContent()) {\r\n\t\t\t// page has its own content -- show it\r\n\t\t\t$r->getContent()->show($params->layout(), \"content\");\r\n\t\t} else {\r\n\t\t\t// It is a post unit, show all childs\r\n\t\t\tif($r->is_unit == 1) {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"content\");\r\n\r\n\t\t\t// It is a folder with several units, show paginator\r\n\t\t\t} elseif($r->show_def == \"last-units\") {\r\n\t\t\t\tlist($type, $perpage) = explode(\":\", $r->show_def_params);\r\n\t\t\t\t/* @var $p O_Dao_Paginator */\r\n\t\t\t\t$p = $r->addQueryAccessChecks($r->getChilds())->test(\"is_unit\", 1)->getPaginator(array($r, \"getPageUrl\"), $perpage);\r\n\t\t\t\t$p->show($params->layout(), $type);\r\n\t\t\t// It is a folder with subfolders, boxes, contents. Show one childs level\r\n\t\t\t} else {\r\n\t\t\t\t$r->addQueryAccessChecks($r->getChilds(1))->show($params->layout(), \"on-parent-page\");\r\n\t\t\t}\r\n\r\n\t\t}\r\n?></div><?\r\n\t}",
"public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}",
"public function show($resourceId, $eventId)\n {\n $routes = $this->routes;\n\n $eventable = $this->getEventableRepository()->model()->findOrFail($resourceId);\n\n if (method_exists($eventable, 'events')) {\n $event = $eventable->events()->find($eventId);\n\n if ($event) {\n $apiObject = $this->event->findApiObject($event->api_id);\n\n return view('events.eventables.show', compact('routes', 'eventable', 'event', 'apiObject'));\n }\n }\n\n abort(404);\n }",
"public abstract function display();",
"abstract public function resource($resource);",
"public function show($id)\r\r\n\t{\r\r\n\t\t//\r\r\n\t}",
"public function show( $id ) {\n\t\t//\n\t}",
"public function show( $id ) {\n\t\t//\n\t}",
"public function show(Response $response)\n {\n //\n }",
"public function show()\n {\n return auth()->user()->getResource();\n }",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}",
"public function show($id)\n\t{\n\t\t//\n\t}"
]
| [
"0.8233718",
"0.8190437",
"0.6828712",
"0.64986944",
"0.6495974",
"0.6469629",
"0.6462615",
"0.6363665",
"0.6311607",
"0.62817234",
"0.6218966",
"0.6189695",
"0.61804265",
"0.6171014",
"0.61371076",
"0.61207956",
"0.61067593",
"0.6105954",
"0.6094066",
"0.6082806",
"0.6045245",
"0.60389996",
"0.6016584",
"0.598783",
"0.5961788",
"0.59606946",
"0.5954321",
"0.59295714",
"0.59182066",
"0.5904556",
"0.59036547",
"0.59036547",
"0.59036547",
"0.5891874",
"0.58688277",
"0.5868107",
"0.58676815",
"0.5851883",
"0.58144855",
"0.58124036",
"0.58112013",
"0.5803467",
"0.58012545",
"0.5791527",
"0.57901084",
"0.5781528",
"0.5779676",
"0.5757105",
"0.5756208",
"0.57561266",
"0.57453394",
"0.57435393",
"0.57422745",
"0.5736634",
"0.5736634",
"0.5730559",
"0.57259274",
"0.5724891",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5722562",
"0.5718969",
"0.5713412",
"0.57091093",
"0.5706405",
"0.57057405",
"0.5704541",
"0.5704152",
"0.57026845",
"0.57026845",
"0.56981397",
"0.5693083",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962",
"0.5684962"
]
| 0.0 | -1 |
Show the form for editing the specified resource. | public function edit($id)
{
//
$team = Team::with('user')->find($id);
return view('team.edit')->with('data',$team);
} | {
"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, $id)
{
//
$team = Team::findOrFail($id);
$input = $request->all();
//dd($input['member']);
$temp = $team;
$team->fill($input)->save();
$team->syncUser($input['member']);
Log::info('Update Team #.'.$team->id.' Stack trace:',[
'from'=>$temp->toArray(),
'to'=>$team->toArray()
]);
return redirect()->back()->withSuccess("Success Edit Team");
} | {
"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 updateStream($path, $resource, Config $config)\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 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 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 putResponse($request)\n {\n $idSearched = $this->searcher->searchResourceIndex(\n $request, \n $this->db[$request['resource']]\n );\n if ($idSearched) {\n $resource = $this->db[$request['resource']][$idSearched];\n $bodyInput = json_decode($this->standardInput, true);\n $resource = BodyRequest::canApplyBody($bodyInput);\n $resource['id'] = (int)$request['param'];\n foreach($resource as $key => $value) {\n $this->db[$request['resource']][$idSearched][$key] = $value;\n }\n file_put_contents(DB_PATH, json_encode($this->db));\n }\n }",
"public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'title' => 'required',\n 'description' => 'required|string',\n 'price' => 'required|numeric',\n 'reference'=>'required'\n ]);\n \n $product = Product::find($id);\n $product->update($request->all());\n \n $im = $request->file('picture');\n \n if (!empty($im)) {\n \n $link = $request->file('picture')->store('images');\n \n \n $product->update([\n 'url_image' => $link,\n ]);\n } \n //dump($request->all());\n return redirect()->route('product.index')->with('message', 'Article modifié avec succès');\n }",
"public function update(Storedataset $request, dataset $dataset){\n $dataset->title = $request->input('title');\n $dataset->caption = $request->input('caption');\n $dataset->file_url = $request->input('file_url');\n $dataset->type = $request->input('type');\n $dataset->status = $request->input('status');\n $dataset->publication_id = $request->input('publication_id');\n\n $dataset->save();\n\n return redirect()->route('datasets.show', ['dataset' => $dataset]);\n }",
"public function update(StoreOrUpdateAsset $request, Asset $asset)\n {\n if (Storage::exists($asset->path) && !Storage::delete($asset->path)) {\n abort(500);\n }\n\n $file = $request->file('file');\n $path = $file->store('assets');\n\n if (!$path) {\n abort(500);\n }\n\n // We wonder if we should delete the old file or not...\n\n $asset->name = $file->getClientOriginalName();\n $asset->size = $file->getSize();\n $asset->type = $file->getMimeType();\n $asset->path = $path;\n\n if ($asset->save()) {\n flash('The asset has been saved.')->success();\n } else {\n abort(500);\n }\n\n return redirect('/admin/assets');\n }",
"public function update(FoodRecipeRequest $request, $id)\n {\n $foodRecipe = FoodRecipe::with('ingredients','cookingProcesses')->findOrFail($id);\n if ($request->input('name')!= null)\n $foodRecipe->name = $request->input('name');\n if ($request->input('detail')!= null)\n $foodRecipe->detail = $request->input('detail');\n if($request->file('photo') != null) {\n $old_file = $foodRecipe->photo;\n if($old_file != null){\n $path = public_path().'/storage/'.$old_file;\n File::delete($path);\n }\n $file = $request->file('photo');\n $name = '/foodRecipe/' . Carbon::now()->format(\"dnY-Hisu\") . \".\" . $file->extension();\n $file->storePubliclyAs('public', $name);\n $foodRecipe->photo = $name;\n }\n $foodRecipe->save();\n return new FoodRecipeResource($foodRecipe);\n }",
"public function update(StorageTypeRequest $request, $id)\n {\n try {\n $this->service->updateStorageType($request, $id);\n return $this->NoContent();\n } catch (EntityNotFoundException $e) {\n \\Log::error($e->getMessage());\n return $this->NotFound($e->getMessage());\n } catch(\\QueryException $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n } catch(Exception $e) {\n \\Log::error($e->getMessage());\n return $this->ServerError();\n }\n }",
"public function update(Request $request, $id)\n {\n //validation\n $this->validate(request(),[\n 'image' => 'image'\n ]);\n\n $slider = HomeSliders::find($id);\n \n $slider->link = request('link');\n\n //get old image to delete if updated\n $oldImage = request('oldImage');\n //get the new image\n $NewImage=$request->file('image');\n\n if($NewImage)\n {\n $filenameToStore= helpers::updatePhoto('image','homeSliders',$request);\n $slider->image=$filenameToStore;\n\n Storage::delete('public/Images/homeSliders/'.$oldImage);\n }\n\n $slider->save();\n\n Alert::success(config('app.name'), trans('messages.Updated Successfully') );\n return redirect()->route('admin.homeSlider',$slider->type);\n }",
"public function update(Qstore $request, $id)\n {\n //\n }",
"public function update($request, $id);",
"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 }",
"function put($resource, $data = null) {\r\n\t\t\r\n\t\tif(isset($data)) {\r\n\t\t\t$this->request_body = $data;\r\n\t\t}\r\n\r\n\t\t// make the call chief\r\n\t\t$this->exec ( \"PUT\", '/' . $resource );\r\n\r\n\t\t// check the request status\r\n\t\tif($this->status_code != 200){\r\n\t\t\t$this->Logger->error(\r\n\t\t\t\tsprintf(\r\n\t\t\t\t\t'GET Call for resource \\'%s\\' Failed.\r\n\t\t\t\t\tStatus: %d,\r\n\t\t\t\t\tRequest: %s\r\n\t\t\t\t\tAPI Error Message: \r\n\t\t\t\t\t%s',\r\n\t\t\t\t\t$resource,\r\n\t\t\t\t\t$this->status_code,\r\n\t\t\t\t\t$this->request_body_raw,\r\n\t\t\t\t\t$this->response_body\r\n\t\t\t\t)\r\n\t\t\t);\r\n\t\t\tthrow new Exception($this->response_body);\r\n\t\t} else {\r\n\t\t\treturn $this->response_parsed;\r\n\t\t}\r\n\t}",
"public function updateEntities($resource)\n {\n $json = [\n 'resource' => $resource,\n ];\n $request = $this->createRequest('PUT', '/entities', ['json' => $json]);\n $response = $this->send($request);\n return $response;\n }",
"public function updateStream($path, $resource, Config $config)\n {\n return $this->writeStream($path, $resource, $config);\n }",
"protected function handleUpdate()\n {\n $resource = $this->argument('resource');\n $action = $this->option('action');\n $startPage = (int)$this->option('startPage');\n $perPage = (int)$this->option('perPage');\n\n try {\n $harvest = Harvest::where('resource', $resource)->where('action', $action)->firstOrFail();\n } catch (\\Exception $e) {\n $this->info('There is no existing action for updating ' . ucwords($action) . ' ' . ucwords($resource) . '.');\n exit('Nothing was updated.');\n }\n\n $options = [\n 'startPage' => $startPage,\n 'perPage' => $perPage,\n 'lastRun' => $harvest->last_run_at\n ];\n\n // If a lastRun was given use that\n // OR if this has never been run before use 2001-01-01\n if (!empty($this->option('lastRun'))) {\n $options['lastRun'] = new Carbon($this->option('lastRun'));\n } elseif (is_null($options['lastRun'])) {\n $options['lastRun'] = new Carbon('2001-01-01');\n }\n\n $job = new UpdateResourceJob(\n $harvest,\n $options\n );\n\n $message = 'Updating ' . $action . ' ' . $resource . ' ' . $perPage . ' at a time';\n if (isset($lastRun)) {\n $message .= ' with entries updated since ' . $lastRun->format('r');\n }\n $this->info($message);\n $this->dispatch($job);\n }",
"public function update(Request $request, $id)\n {\n\n $product = Product::findOrFail($id);\n $product->name = $request['name'];\n $product->price = $request['price'];\n $product->stock = $request['stock'];\n $product->description = $request['description'];\n\n $file = $request->file('image');\n $fileName = $file->getClientOriginalName();\n if($fileName != $product->image){\n $request->file('image')->move('images/',$fileName);\n $product->image = $fileName;\n }\n\n $product->save();\n\n return redirect()->route('products.show',\n $product->id)->with('flash_message',\n 'Article, '. $product->name.' updated');\n }",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"public function update($id, $data);",
"abstract public function put($data);",
"public function update(Request $request, $id)\n {\n $storageplace = Storageplace::findOrFail($id);\n $storageplace->update($request->only(['storageplace']));\n return $storageplace;\n }",
"public function testUpdateSupplierUsingPUT()\n {\n }",
"public function updateStream($path, $resource, Config $config = null)\n {\n $contents = stream_get_contents($resource);\n\n return $this->write($path, $contents, $config);\n }",
"public function update(Request $request, $id)\n {\n $skill = Skill::findOrFail($id);\n\n $skill->skill = $request->skill;\n\n if ($request->hasFile('image')) {\n \\Cloudder::upload($request->file('image'));\n $c=\\Cloudder::getResult();\n // $image = $request->file('image');\n // $filename = time() . '.' . $image->getClientOriginalExtension();\n // $location = public_path('images/' . $filename);\n // Image::make($image)->save($location);\n\n $skill->image = $c['url'];\n }\n\n $skill->save();\n\n Session::flash('success', 'Successsfully updated your skill!');\n return redirect()->route('skills.index');\n }",
"public function updateRelatedImage(Request $request, $id)\n {\n // Delete display image in Storage\n Validator::make($request->all(), ['photos' => \"required|file|image|mimes:jpg,png,jpeg|max:5000\"])->validate();\n\n\n if ($request->hasFile(\"photos\")) {\n\n $photo = ProductsPhoto::find($id);\n $imageName = $photo->photos;\n $exists = Storage::disk('local')->exists(\"public/product_images/\" . $photo->photos);\n\n //delete old image\n if ($exists) {\n Storage::delete('public/product_images/' . $imageName);\n }\n\n //upload new image\n $ext = $request->file('photos')->getClientOriginalExtension(); //jpg\n\n $request->photos->storeAs(\"public/product_images/\", $imageName);\n\n $arrayToUpdate = array('photos' => $imageName);\n DB::table('products_photos')->where('id', $id)->update($arrayToUpdate);\n\n return redirect()->route(\"adminDisplayRelatedImageForm\", ['id' => $photo->product_id]);\n } else {\n\n $error = \"NO Image was Selected\";\n return $error;\n }\n }",
"public static function update($id, $file)\n {\n Image::delete($id);\n\n Image::save($file);\n }",
"public abstract function update($object);",
"public function update(Request $request, $id)\n {\n $product = Product::find($id);\n $image = $product->image;\n if($request->hasFile('image')){\n $image = $request->file('image')->store('files');\n \\Storage::delete($product->image);\n } \n $product->name = $request->get('name');\n $product->price = $request->get('price');\n $product->description = $request->get('description');\n $product->additional_info = $request->get('additional_info');\n $product->category_id = $request->get('category');\n $product->subcategory_id = $request->get('subcategory');\n $product->image = $image;\n $product->save();\n return redirect()->back();\n }",
"public function update(Request $request, $id)\n {\n $sli=Slider::find($id);\n $sli->sort_order=$request->input('sort_order');\n $image = $request->file('slider');\n if($image == ''){\n $image = $sli->slider;\n }else{\n $image = base64_encode(file_get_contents($request->file('slider')));\n }\n $sli->slider = $image;\n $sli->save();\n return redirect()->back();\n }",
"public function update(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(ProductRequest $request, $id)\n {\n $input = Product::find($id);\n $data = $request->all();\n if ($file = $request->file('product_photo')){\n $name = time().$file->getClientOriginalName();\n $file->move('product_image',$name);\n $data['product_photo']=$name;\n// $input->update($data);\n }\n $input->update($data);\n return redirect('admin/products/');\n }",
"public function update(Request $request, $id)\n {\n $product = ProductModel::find($id);\n $product->name = $request->name;\n $product->description = $request->description;\n $product->price = $request->price;\n $product->stock = $request->stock;\n\n if($request->image!=null){\n $imageName = time().'.'.$request->image->extension();\n $request->image->move(public_path('images'), $imageName);\n $product->image = \"/images/\".$imageName;\n }\n $product->save();\n return redirect(\"/products/index\")->with('success','Product has been updated');\n }",
"public function update()\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($id, $input);",
"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(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 {/* 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 $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 {\n $data = $request->all();\n extract($data);\n\n $productVarient = new ProductVariant();\n $productVarient = $productVarient->find($id);\n $productVarient->vendor_id = auth()->user()->id;\n $productVarient->description = $prod_desc;\n $productVarient->price = $price;\n\n if(request()->hasFile('photo')){\n $image = request()->file('photo')->getClientOriginalName();\n $imageNewName = auth()->user()->id.'-'.$image;\n $file = request()->file('photo');\n $file->storeAs('images/product',$imageNewName, ['disk' => 'public']);\n $productVarient->image = $imageNewName;\n }\n \n $productVarient->save();\n\n return back()->withStatus(__('Product successfully updated.'));\n }",
"public function update(Request $request, $id)\n {\n //if upload new image, delete old image\n $myfile=$request->old_photo;\n if($request->hasfile('photo'))\n {\n $imageName=time().'.'.$request->photo->extension();\n $name=$request->old_photo;\n\n if(file_exists(public_path($name))){\n unlink(public_path($name));\n $request->photo->move(public_path('backendtemplate/truefalseimg'),$imageName);\n $myfile='backendtemplate/truefalseimg/'.$imageName;\n }\n }\n //Update Data\n $truefalsequestion=TrueFalseQuestion::find($id);\n $truefalsequestion->name=$request->name;\n $truefalsequestion->photo=$myfile;\n $truefalsequestion->answer = $request->answer;\n $truefalsequestion->question_id = $request->question;\n $truefalsequestion->save();\n\n //Redirect\n return redirect()->route('truefalsequestions.index'); \n }",
"public function update($id);",
"public function update($id);",
"public function 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 }",
"private function update()\n {\n $this->data = $this->updateData($this->data, $this->actions);\n $this->actions = [];\n }",
"public function update(Entity $entity);",
"public function update(Request $request, $id)\n {\n $icon = SliderIcon::find($id);\n $data = $request->all();\n $data['active'] = $request->has('active') ? 1 : 0;\n if ($request->hasFile('img')) {\n if (Storage::disk('public')->exists(str_replace('storage', '', $icon->img))){\n Storage::disk('public')->delete(str_replace('storage', '', $icon->img));\n }\n $image = $request->file('img');\n $fileName = time().'_'.Str::lower(Str::random(5)).'.'.$image->getClientOriginalExtension();\n $path_to = '/upload/images/'.getfolderName();\n $image->storeAs('public'.$path_to, $fileName);\n $data['img'] = 'storage'.$path_to.'/'.$fileName;\n }\n $icon->update($data);\n return redirect()->route('slider_icons.index')->with('success', 'Данные преимущества обнавлены');\n }",
"public function update(Request $request, $id)\n {\n //validate incoming request\n $request->validate([\n 'name' => 'string|max:100|nullable',\n 'picture' => 'max:2000|mimes:jpeg,jpg,png,svg|nullable', //max size 2mb,\n 'total' => 'integer|min:0|nullable', //value must be > 0\n 'selling_price' => 'numeric|min:0|nullable',\n 'cost_price' => 'numeric|min:0|nullable',\n 'category_id' => 'integer|nullable'\n ]);\n\n try {\n $product = Auth::user()->store->product()->findorFail($id);\n } catch (ModelNotFoundException $e) {\n return response()->json([\n \"message\" => \"Forbidden\"\n ], 403);\n }\n\n //if category id isnt null\n if ($category_id = $request->category_id) {\n if (!$this->isCategoryIdValid($category_id))\n return response()->json([\n \"message\" => \"Category Id is not valid\"\n ], 422);\n else\n $product->category_id = $request->category_id;\n }\n\n //if uploaded file exist\n if ($picture = $request->file(\"picture\")) {\n //if product already has logo\n if ($product->picture)\n Storage::delete(Product::$PICTURE_PATH . \"/\" . $product->picture);\n\n $picture_path = $picture->store(Product::$PICTURE_PATH);\n //remove folder name from path\n $product->picture = str_replace(Product::$PICTURE_PATH . \"/\", '', $picture_path);\n }\n\n $this->renewProduct($product, $request);\n $product->save();\n return response()->json(new ProductResource($product), 200);\n }",
"public function update() {\n\t $this->layout = false;\n\t \n\t //set default response\n\t $response = array('status'=>'failed', 'message'=>'HTTP method not allowed');\n\t \n\t //check if HTTP method is PUT\n\t if($this->request->is('put')){\n\t //get data from request object\n\t $data = $this->request->input('json_decode', true);\n\t if (empty($data)) {\n\t $data = $this->request->data;\n\t }\n\t \n\t //check if product ID was provided\n\t if (!empty($data['id'])) {\n\t \n\t //set the product ID to update\n\t $this->Player->id = $data['id'];\n\t if ($this->Player->save($data)) {\n\t $response = array('status'=>'success','message'=>'Product successfully updated');\n\t } else {\n\t $response['message'] = \"Failed to update product\";\n\t }\n\t } else {\n\t $response['message'] = 'Please provide product ID';\n\t }\n\t }\n\t \n\t $this->response->type('application/json');\n\t $this->response->body(json_encode($response));\n\n\t return $this->response->send();\n\t}",
"public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required | min:3 | string',\n 'type' => 'required',\n 'producer' => 'required',\n 'image' => 'image | mimes:png,jpg,jpeg',\n 'price_input' => 'required | numeric | min:0 | max:300000000',\n 'promotion_price' => 'required | numeric | max:300000000',\n 'description' => 'required | string',\n\n ]);\n $product = Product::withTrashed()->findOrfail($id);\n $product->name = $request->name;\n $product->id_type = $request->type;\n $product->id_producer = $request->producer;\n\n $product->amount = $request->amount;\n if (request('image')) {\n $product->image = base64_encode(file_get_contents($request->file('image')->getRealPath()));\n }\n\n $product->price_input = $request->price_input;\n\n if ( $request->promotion_price >= 0 && $request->promotion_price < $product->price_input) {\n $product->promotion_price = $request->promotion_price;\n }else{\n return back()->with('error', '\n Do not enter a negative number');\n }\n $product->new = $request->new;\n\n $product->description = $request->description;\n\n $product->save();\n $product->size()->sync(request('size'));\n\n return redirect()->route('product.index')->with('success', 'Product Updated successfully');\n }",
"public 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.74238616",
"0.7062842",
"0.7057816",
"0.6897868",
"0.65820867",
"0.64505464",
"0.6347915",
"0.62114644",
"0.6145006",
"0.61231726",
"0.6115922",
"0.6100021",
"0.6089019",
"0.60542375",
"0.60187906",
"0.6008231",
"0.5974106",
"0.5944986",
"0.59397626",
"0.59393746",
"0.58937186",
"0.58607864",
"0.5853811",
"0.5853811",
"0.58521867",
"0.5815276",
"0.58061725",
"0.57518756",
"0.57518756",
"0.5736318",
"0.57246256",
"0.5715636",
"0.5696208",
"0.5691033",
"0.5687788",
"0.56692934",
"0.56556624",
"0.5652178",
"0.56494987",
"0.5636202",
"0.56355816",
"0.5632871",
"0.563206",
"0.56291884",
"0.5621382",
"0.56087434",
"0.5602465",
"0.55928403",
"0.55825645",
"0.55821884",
"0.5581833",
"0.5576869",
"0.55712104",
"0.5568173",
"0.55648434",
"0.5562885",
"0.5560537",
"0.5560537",
"0.5560537",
"0.5560537",
"0.5560537",
"0.55592597",
"0.5556131",
"0.5555849",
"0.5555397",
"0.5553912",
"0.55530137",
"0.5543831",
"0.55430055",
"0.5540152",
"0.5539437",
"0.55359006",
"0.5535772",
"0.5534487",
"0.552458",
"0.5518245",
"0.5515452",
"0.55145514",
"0.5509227",
"0.55079365",
"0.55065364",
"0.55039924",
"0.5501616",
"0.5500345",
"0.5499738",
"0.54980725",
"0.5496017",
"0.5496017",
"0.5494488",
"0.5494334",
"0.54936594",
"0.54934716",
"0.5491019",
"0.54835314",
"0.54795796",
"0.5479442",
"0.5478275",
"0.54646415",
"0.54637444",
"0.5461914",
"0.54562414"
]
| 0.0 | -1 |
Remove the specified resource from storage. | public function destroy($id)
{
//
$team = Team::findOrFail($id);
$team->delete();
$ticket = Ticket::where('assign_type','team')
->where('assign_id',$id)
->delete();
Log::info('Delete Team #.'.$team->id.' Stack trace:',[
//'from'=>$temp->toArray(),
'to'=>$team->toArray()
]);
return redirect()->route('team::index')->withSuccess("Success Delete Task");
} | {
"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 |
Returns all valid ID's | public function validIdsArray ()
{
return array (
LegalDocumentType::TYPE_SSS,
LegalDocumentType::TYPE_PAG_IBIG,
LegalDocumentType::TYPE_POSTAL,
LegalDocumentType::TYPE_PASSPORT,
LegalDocumentType::TYPE_DRIVERS_LICENSE,
LegalDocumentType::TYPE_PRC,
LegalDocumentType::TYPE_VOTERS_ID,
LegalDocumentType::TYPE_SCHOOL_ID,
LegalDocumentType::TYPE_TIN
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllIds();",
"public function getAllIds(): array;",
"public function getValidIdAttributes(): array\n {\n return [\n 'Starts with _' => [\n 'attribute_id_0001.xsd', '_foo', \n ], \n 'Starts with letter' => [\n 'attribute_id_0002.xsd', 'f', \n ], \n 'Contains letter' => [\n 'attribute_id_0003.xsd', 'foo', \n ], \n 'Contains digit' => [\n 'attribute_id_0004.xsd', 'f00', \n ], \n 'Contains .' => [\n 'attribute_id_0005.xsd', 'f.bar', \n ], \n 'Contains -' => [\n 'attribute_id_0006.xsd', 'f-bar', \n ], \n 'Contains _' => [\n 'attribute_id_0007.xsd', 'f_bar', \n ], \n 'Surrounded by whitespaces' => [\n 'attribute_id_0008.xsd', 'foo_bar', \n ], \n ];\n }",
"public function getValidIdAttributes(): array\n {\n return [\n 'Starts with _' => [\n 'extension_id_0001.xsd', '_foo', \n ], \n 'Starts with letter' => [\n 'extension_id_0002.xsd', 'f', \n ], \n 'Contains letter' => [\n 'extension_id_0003.xsd', 'foo', \n ], \n 'Contains digit' => [\n 'extension_id_0004.xsd', 'f00', \n ], \n 'Contains .' => [\n 'extension_id_0005.xsd', 'f.bar', \n ], \n 'Contains -' => [\n 'extension_id_0006.xsd', 'f-bar', \n ], \n 'Contains _' => [\n 'extension_id_0007.xsd', 'f_bar', \n ], \n 'Surrounded by whitespaces' => [\n 'extension_id_0008.xsd', 'foo_bar', \n ], \n ];\n }",
"public function getAllIdentifiers() {}",
"public function getIds();",
"public function getIds();",
"public abstract function get_ids();",
"public function get_ids()\n {\n }",
"public function get_ids()\n {\n }",
"public function get_ids()\n {\n }",
"public function get_ids()\n {\n }",
"public function get_ids()\n {\n }",
"public function get_ids()\n {\n }",
"public function get_ids()\n {\n }",
"public function get_ids()\n {\n }",
"public function getIds() {\n $sources = array();\n \n $sources[] = $this->id;\n \n foreach ($this->points as &$g) {\n $sources[] = $g->id;\n }\n foreach ($this->lines as &$g) {\n $sources[] = $g->id;\n }\n foreach ($this->polygons as &$g) {\n $sources[] = $g->id;\n }\n if ( !empty($this->address) ) {\n $sources[] = $this->address->id;\n }\n foreach ($this->relationships as &$r) {\n $sources[] = $r->id;\n }\n \n return array_filter($sources);\n }",
"public static function validateXmlId()\n\t{\n\t\treturn array(\n\t\t\tnew Main\\Entity\\Validator\\Length(null, 255),\n\t\t);\n\t}",
"function getUserIds() {\n\t\t$charIds = $this->getCharIds();\n\t\t$idsToReturn = array();\n\t\tforeach ($charIds as $id) {\n\t\t\n\t\t\t$idsToReturn[] = getOneThing(\"playedby\", \"gamestate_characters\", \"id=$id and gameid=$this->gameId\");\n\t\t\n\t\t}\n\t\tdbug(\"getUserIds is about to return \".implode(\", \", $idsToReturn));\n\t\treturn $idsToReturn;\n\t}",
"public function getIds()\n {\n\n }",
"public function selectAllConstellationID()\n {\n $selectSQL = \"select distinct(ic_id) from nrd\";\n $result = $this->sdb->query($selectSQL, array());\n $all = array();\n while ($row = $this->sdb->fetchrow($result)) {\n array_push($all, $row['ic_id']);\n }\n return $all;\n }",
"public static function getAllIds(): array\n {\n return ArrayHelper::getColumn(static::find()->select('id')->asArray()->all(), 'id');\n }",
"public static function getIdsInUse() {\n global $wpdb;\n $products = Cart66Common::getTableName('products');\n $sql = \"SELECT gravity_form_id as gfid from $products where gravity_form_id > 0\";\n $ids = $wpdb->get_col($sql);\n return $ids;\n }",
"public function provideEqualButNotIdenticalIds()\n {\n return array(\n array('123', 123),\n array('123', 123.0),\n array('', 0),\n array('0', 0),\n );\n }",
"function getCharIds() {\n\t\n\t\t$r = getResult(\"SELECT id FROM gamestate_characters WHERE gameid=$this->gameId\");\n\t\t$idsToReturn = array();\n\t\twhile ($row = $r->fetchRow(MDB2_FETCHMODE_ASSOC)) {\n\t\t\n\t\t\t$idsToReturn[] = $row['id'];\n\t\t\n\t\t}\n\t\n\t\tdbug(\"getCharIds is about to return \".implode(\", \", $idsToReturn));\n\t\treturn $idsToReturn;\n\t}",
"public static function validateXmlId()\n {\n return array(\n new Main\\Entity\\Validator\\Length(null, 255),\n );\n }",
"public function getDefinedObjectIds() {}",
"public function getDefinedObjectIds() {}",
"public function getDefinedObjectIds() {}",
"function taminoGetIds() {\n $rval = $this->tamino->xquery($this->xquery);\n if ($rval) { // tamino Error\n print \"<p>LinkCollection Error: failed to retrieve linkRecord id list.<br>\";\n print \"(Tamino error code $rval)</p>\";\n } else { \n // convert xml ids into a php array \n $this->ids = array();\n $this->xml_result = $this->tamino->xml->getBranches(\"ino:response/xq:result\");\n if ($this->xml_result) {\n\t// Cycle through all of the branches \n\tforeach ($this->xml_result as $branch) {\n\t if ($att = $branch->getTagAttribute(\"id\", \"xq:attribute\")) {\n\t array_push($this->ids, $att);\n\t }\n\t} /* end foreach */\n } \n }\n\n }",
"public function getIds() {\n\t\treturn array_keys($this->registered);\n\t}",
"public function getAllIds(){\n\n\t\t$qry=$this->db->select('id');\n\t\t$this->db->from('customers');\n\t\t$qry=$this->db->get();\n\t\t$count=$qry->num_rows();\n\t\t$result= $qry->result_array();\n\t\tfor($i=0;$i<$count;$i++){\n\t\t\t\t$values[$result[$i]['id']]=$result[$i]['id'];\n\t\t\t\t}\n\t\n\t\treturn $values;\n\t\n\t}",
"public static function validateDialogId()\n\t{\n\t\treturn array(\n\t\t\tnew Main\\Entity\\Validator\\Length(null, 50),\n\t\t);\n\t}",
"public function getIdentifiers();",
"public function hasIds() {\n return $this->_has(1);\n }",
"public function dataProviderParseIdList(): array\n {\n return [\n 'empty' => [\n '',\n [],\n ],\n 'single simple ID' => [\n '223',\n [['223']],\n ],\n 'single ID with delimiters' => [\n '\"223,3425\"',\n [['223,3425']],\n ],\n 'multiple IDs' => [\n '1, 2 ,33,777,4',\n [['1'], ['2'], ['33'], ['777'], ['4']],\n ],\n 'multiple with multiple columns' => [\n '1:foo,235:bar, 543:\"x:o\"',\n [['1', 'foo'], ['235', 'bar'], ['543', 'x:o']],\n ],\n ];\n }",
"public function getExcludedIds();",
"public static function getAllIds(): array\n {\n $dao = Dao::getInstance();\n\n $query = \"\n SELECT\n id\n FROM\n help\n ORDER BY id\n \";\n\n $stmt = $dao->prepare($query);\n\n $stmt->execute();\n\n $rows = [];\n while ($row = $stmt->fetch()) {\n $rows[] = $row['id'];\n }\n return $rows;\n }",
"public function ids() {\n\t\t$q = $this->query();\n\t\t$q->select(Salesperson::aliasproperty('id'));\n\t\treturn $q->find()->toArray();\n\t}",
"public function getAllId(){\n $query = 'SELECT id '.\n 'WHERE current_date >= eff_begin AND current_date <= eff_end';\n return DB::select($query);\n }",
"function getAllUserIDs() \n {\n //This returns all userids that have rating>0\n $query = \"SELECT users.id FROM users WHERE users.rating > 0\";\n //$query = \"SELECT ratings.model_id FROM ratings WHERE ratings.model='User'\";\n $results = $this->query($query); \n $userIDs = Set::extract($results, '{n}.users.id');\n return $userIDs;\n }",
"public function retrieveAllIds()\n {\n try\n {\n $result = $this->db->fetchCol('SELECT FROM '.ZipCode::TABLENAME);\n }\n catch(Exception $e)\n {\n throw new Exception(\"No se pudieron obtener los ids\\n\" . $e->getMessage());\n }\n return $result;\n }",
"public function testIdentities()\n {\n $sql = \"SELECT id, identity, logged_in\n\t\t\t\tFROM dlayer_identity\n\t\t\t\tORDER BY id ASC\";\n $stmt = $this->_db->prepare($sql);\n $stmt->execute();\n\n return $stmt->fetchAll();\n }",
"public static function readAllId() {\n try {\n $database = SModel::getInstance();\n $query = \"select id from producteur\";\n $statement = $database->prepare($query);\n $statement->execute();\n $results = array();\n while ($tuple = $statement->fetch()) {\n $results[] = $tuple[0];\n }\n return $results;\n } catch (PDOException $e) {\n printf(\"%s - %s<p/>\\n\", $e->getCode(), $e->getMessage());\n return NULL;\n }\n }",
"public function getAllID()\n {\n $queryBuilder = $this->db->createQueryBuilder();\n $queryBuilder\n ->select('u.id')\n ->from('gamers', 'u');\n $statement = $queryBuilder->execute();\n $gamersID = $statement->fetchAll();\n foreach ($gamersID as $gamerID) {\n var_dump($gamerID);\n }\n return $gamersID; \n }",
"public function listId()\n {\n return $this->contractor->all()->pluck('id')->all();\n }",
"public static function validateLid()\n\t{\n\t\treturn array(\n\t\t\tnew Main\\Entity\\Validator\\Length(null, 2),\n\t\t);\n\t}",
"function get_all_ids() {\n\t\t$cloudprofile_list = array();\n\t\t$query = \"select pr_id from \".$this->_db_table;\n\t\t$db=htvcenter_get_db_connection();\n\t\t$rs = $db->Execute($query);\n\t\tif (!$rs)\n\t\t\t$this->_event->log(\"get_all_ids\", $_SERVER['REQUEST_TIME'], 2, \"cloudprofile.class.php\", $db->ErrorMsg(), \"\", \"\", 0, 0, 0);\n\t\telse\n\t\twhile (!$rs->EOF) {\n\t\t\t$cloudprofile_list[] = $rs->fields;\n\t\t\t$rs->MoveNext();\n\t\t}\n\t\treturn $cloudprofile_list;\n\n\t}",
"public static function getIDProperties()\n {\n return static::$ids;\n }",
"public function selectAllPrivilegeIDs()\n {\n $result = $this->sdb->query(\"select id from privilege order by label\", array());\n $all = array();\n while($row = $this->sdb->fetchrow($result))\n {\n array_push($all, $row['id']);\n }\n return $all;\n }",
"public function getIdsList() {\n return $this->_get(1);\n }",
"public static function getAllSchoolIds(){\n $schoolIds = array();\n $result = mysql_query(\"SELECT id FROM school\") or die(mysql_error());\n while($row = mysql_fetch_array($result)){\n array_push($schoolIds, $row['id']);\n }\n return $schoolIds;\n }",
"public function getConsortialIDs()\n {\n return $this->getFieldArray('035', 'a', true);\n }",
"function getIds( array $Objects );",
"public function getAll()\n {\n return $this->_identifiers;\n }",
"public abstract static function getListID();",
"function checkIDList($table, $fixedQuery, &$IDList)\n{\n\tglobal $sitePosition;\n\n\t$IDs = array();\n\t$rs = query('Select `ID` from `' . $sitePosition . '.' . $table . '` where ' . ($fixedQuery != '' ? ('(' . $fixedQuery . ') and ') : '') . '`ID` in (' . $IDList . ')', false);\n\twhile(true)\n\t{\n\t\t$rsInfo = fetchRow($rs);\n\t\tif($rsInfo === null) break;\n\t\t$IDs[] = $rsInfo[0];\n\t}\n\tfreeResult($rs);\n\t$IDList = implode(',', $IDs);\n}",
"public function containsDummyIds(): bool {\n foreach ($this->getId() as $id) {\n if (self::isDummyId($id)) {\n return true;\n }\n }\n return false;\n }",
"public function getUuids();",
"public function provideValidReplacementIds()\n {\n return [\n [FakerReplacer::PREFIX.'firstname'], // original faker property\n [FakerReplacer::PREFIX.'lastname'], // original faker property\n ];\n }",
"public function listId() {\n\t\treturn $this->academic_session->all()->pluck('id')->all();\n\t}",
"public function getIds()\n {\n return $this->restrictedCountryIds;\n }",
"public function getIds(): array\n {\n return $this->ids;\n }",
"public function getGeneratedIds() {}",
"public function listId() {\n\t\treturn $this->employee->get()->pluck('id')->all();\n\t}",
"protected function valid_studentids() {\n if ($this->studentids === null) {\n if ($this->studentids = get_users_by_capability($this->context, 'mod/data:viewentry', 'u.id,u.username')) {\n $this->studentids = array_keys($this->studentids);\n $this->studentids = array_diff($this->studentids, $this->valid_teacherids());\n } else {\n $this->studentids = array();\n }\n }\n return $this->studentids;\n }",
"public function getIdentifiers()\n {\n return $this->init()->_identifiers;\n }",
"public function model_id_list()\r\n {\r\n $this->set_error(\"MBE-\".$this->model_code.\"-MIL-1\", \r\n \"Internal error, please contact admin\", \r\n \"Missing model_id_list API for this model \".$this->model_name);\r\n $model_id_list = array();\r\n /*\r\n $model_id_list = array (\r\n array(\r\n \"table\" => \"dummy_table\", \r\n \"editable\" => false,\r\n \"id_column\" => \"dummy_id\",\r\n \"data_column\" => array(\r\n array(\"data\" => \"dummy_name\", \"column\" => \"dummy_column\"),\r\n ),\r\n ),\r\n );\r\n */\r\n return $model_id_list;\r\n }",
"function getObjectIDs() {\n\t\t$tmp = array();\n\t\tif ( $this->getCount() > 0 ) {\n\t\t\tforeach ( $this as $oObject ) {\n\t\t\t\t$tmp[] = $oObject->getID();\n\t\t\t}\n\t\t}\n\t\treturn $tmp;\n\t}",
"public function getIdentities()\n {\n }",
"public function selectAllUsersIds(){\r\n $stmt = self::$con->prepare(\"SELECT id,name,email FROM users\");\r\n $stmt->execute();\r\n $results = $stmt->fetchAll(PDO::FETCH_ASSOC);\r\n return $results;\r\n }",
"public function scopeFetchIds()\n {\n return $this->pluck(\"id\");\n }",
"public function getIds()\n\t{\n\t\treturn $this->ids;\n\t}",
"public function ids()\n {\n return $this->_ids;\n }",
"public function getIdentities() {\n\treturn [self::CACHE_TAG . '_' . $this->getId()];\n }",
"public static function validateLid()\n {\n return array(\n new Main\\Entity\\Validator\\Length(null, 2),\n );\n }",
"public static function validateLid()\n {\n return array(\n new Main\\Entity\\Validator\\Length(null, 2),\n );\n }",
"function getIDlist() {\n return array_keys($this->varList);\n }",
"public function getAllIds()\n {\n if (is_null($this->_itemIds)) {\n $this->_itemIds = parent::getAllIds();\n }\n return $this->_itemIds;\n }",
"function validateGids( $gids ) {\n $gidArray = explode( ',', $gids );\n $allowedGids = array();\n foreach( $gidArray as $gid ) {\n if ( is_numeric( $gid ) ) {\n array_push( $allowedGids, $gid );\n }\n }\n $allowedGidList = implode( ',', $allowedGids );\n return $allowedGidList;\n}",
"public static function\tIdentifiers()\n {\n $accesses = array(self::TypePublic);\n\n if (Cache::Exist(\"user\") == false)\n\treturn $accesses;\n\n $user = Cache::Get(\"user\");\n\n $accesses[] = $user->id;\n\n foreach (self::$entities as $entity)\n\t{\n\t // XXX[we could perform theses operations in parallel to speed up the process]\n\t $access = call_user_func($entity . \"::Access\", $user->id);\n\n\t if (empty($access) == true)\n\t continue;\n\n\t foreach ($access as $object)\n\t $accesses[] = $object[\"id\"];\n\t}\n\n return $accesses;\n }",
"public function getIds()\n {\n return $this->ids;\n }",
"public function getIds()\n {\n return $this->ids;\n }",
"public function getIdentities()\n {\n return [self::CACHE_TAG.'_'.$this->getId()];\n }",
"public function findAllRetainedIds()\n\t{\n\t\t$qb = $this->createQueryBuilder('s');\n\n\t\t$qb->select('s.id')\n\t\t ->where('s.level NOT LIKE :syn')\n\t\t ->setParameter('syn', '%syn%')\n ->orderBy('s.id', 'ASC')\n\t\t;\n\n\t\treturn $qb->getQuery()->getResult();\n\t}",
"public static function validateSiteId()\n\t{\n\t\treturn array(\n\t\t\tnew Main\\Entity\\Validator\\Length(null, 2),\n\t\t);\n\t}",
"function getEventIDs() {\n\t\t$return = array();\n\n\t\tif ( $this->getCount() > 0 ) {\n\t\t\tforeach ( $this as $oObject ) {\n\t\t\t\t$return[] = $oObject->getID();\n\t\t\t}\n\t\t}\n\n\t\treturn $return;\n\t}",
"public function ids() {\n $ids = array_keys($this->models);\n\n # Reorder environments to put dev/test/live first\n $default_ids = array('dev', 'test', 'live');\n $multidev_ids = array_diff($ids, $default_ids);\n $ids = array_merge($default_ids, $multidev_ids);\n\n return $ids;\n }",
"function get_all_category_ids()\n {\n }",
"function GetAll()\n {\n $ids = array();\n $sql = \"SELECT id FROM client_os ORDER BY name\";\n $query = pdo_query($sql);\n while($query_array = pdo_fetch_array($query))\n {\n $ids[] = $query_array['id'];\n }\n return $ids; \n }",
"private function parse_ids() {\n\t\t// Trim empty spaces in ids\n\t\t$ids = trim($_POST['ids']);\n\t\t$id_pattern = array(\n\t\t\t'/ *[\\r\\n]+/',\t\t// Checks for one or more line breaks\n\t\t\t'/(\\w)\\s+(\\w)/',\t// Checks for words separated by one or more spaces\n\t\t\t'/,\\s*/',\t\t\t// Checks for words separated by comma, but with variable spaces\n\t\t\t'/,\\s*,/'\t\t\t// Checks for empty strings (i.e. no words between two commas)\n\t\t\t);\n\t\t$id_replace = array(\n\t\t\t',',\n\t\t\t'$1, $2',\n\t\t\t',',\n\t\t\t',',\n\t\t\t''\n\t\t\t);\n\n\t\t// Remove isoforms for dataset using gene IDs\n\t\tif($_POST['idtype'] == 'geneid') {\n\t\t\t$id_pattern[] = '/\\.\\d+/';\n\t\t\t$id_replace[] = '';\n\t\t}\n\n\t\t// Replace IDs by regex\n\t\t$ids = preg_replace($id_pattern, $id_replace, $ids);\n\n\t\t// Write to internal data\n\t\t$this->_expat['ids'] = array_values(array_unique(array_filter(explode(\",\", $ids))));\n\t}",
"public function get_all_exclude_id(){\n $data = get_object_vars($this);\n unset($data[\"id\"]);\n return $data;\n }",
"public function groupIds();",
"public function get_reserved_ids() {\n\t\t/**\n\t\t * Filters the array of reserved IDs considered when auto-generating IDs for\n\t\t * ToC sections.\n\t\t *\n\t\t * This is mostly for specifying markup IDs that may appear on the same page\n\t\t * as the ToC for which any ToC-generated IDs would conflict. In such\n\t\t * cases, the first instance of the ID on the page would be the target of\n\t\t * the ToC section permalink which is likely not the ToC section itself.\n\t\t *\n\t\t * By specifying these reserved IDs, any potential use of the IDs by the theme\n\t\t * can be accounted for by incrementing the auto-generated ID to avoid conflict.\n\t\t *\n\t\t * E.g. if the theme has `<div id=\"main\">`, a ToC with a section titled \"Main\"\n\t\t * would have a permalink that links to the div and not the ToC section.\n\t\t *\n\t\t * @param array $ids Array of IDs.\n\t\t */\n\t\treturn (array) apply_filters(\n\t\t\t'handbooks_reserved_ids',\n\t\t\t[\n\t\t\t\t'main', 'masthead', 'menu-header', 'page', 'primary', 'secondary', 'secondary-content', 'site-navigation',\n\t\t\t\t'wordpress-org', 'wp-toolbar', 'wpadminbar', 'wporg-footer', 'wporg-header'\n\t\t\t]\n\t\t);\n\t}",
"public function getEpisodeIds(){\n $result = array();\n $progam = null;\n $con = $this->mysqli->prepare(\n \"SELECT EpNum FROM episode where programName=? and callsign=?\");\n $con->bind_param('ss',$this->name,$this->callsign);\n $con->bind_result($progam);\n if($con->execute()){\n while($con->fetch()){\n array_push($result, $progam);\n }\n return $result;\n }\n else{return false;}\n }",
"public function getIdTokens()\n {\n return $this->idtokens;\n }",
"public function checkAlternativeIdMethods() {}",
"public function idTypes();",
"function getIdsByValidHandles($handles, $includeBlocked = FALSE) {\n $handleCondition = $this->databaseGetSQLCondition('surfer_handle', $handles);\n $blockedClause = ($includeBlocked === FALSE) ? ' AND surfer_valid != 4' : '';\n // Build query\n $sql = \"SELECT surfer_id, surfer_handle\n FROM %s\n WHERE $handleCondition $blockedClause\";\n $sqlData = array($this->tableSurfer);\n // Create result array\n $ids = array();\n // Execute query\n if ($res = $this->databaseQueryFmt($sql, $sqlData)) {\n // Get results and store them in array\n while ($row = $res->fetchRow(DB_FETCHMODE_ASSOC)) {\n $ids[] = $row['surfer_id'];\n }\n }\n return $ids;\n }",
"function email_get_ids($ids) {\n\t$identities = array();\n\n\tif ( $ids ) {\n\t\tforeach ($ids as $id) {\n\t\t\t$identities[] = $id->id;\n\t\t}\n\t}\n\n\t// Character alfanumeric, becase optional_param clean anothers tags.\n\t$strids = implode('a', $identities);\n\n\treturn $strids;\n}"
]
| [
"0.7085894",
"0.6982596",
"0.67747545",
"0.674034",
"0.66507316",
"0.65629053",
"0.65629053",
"0.64448303",
"0.6397352",
"0.6397352",
"0.6397352",
"0.6397352",
"0.6397352",
"0.6397352",
"0.6397352",
"0.6397352",
"0.6358527",
"0.63098687",
"0.6293713",
"0.62914705",
"0.62749326",
"0.62635416",
"0.6256797",
"0.6250304",
"0.62086815",
"0.6204016",
"0.61805785",
"0.61805785",
"0.6180514",
"0.6134298",
"0.610248",
"0.6076698",
"0.6061721",
"0.6053224",
"0.60520214",
"0.6036707",
"0.59931594",
"0.5980159",
"0.59674764",
"0.59589314",
"0.5956697",
"0.5953218",
"0.595081",
"0.59399086",
"0.5938979",
"0.5936513",
"0.5921422",
"0.5900971",
"0.58926785",
"0.5887302",
"0.5881473",
"0.5879141",
"0.5859461",
"0.5848241",
"0.58423567",
"0.5834644",
"0.5833681",
"0.5830265",
"0.5812688",
"0.5812478",
"0.58064014",
"0.5780708",
"0.5766391",
"0.5761944",
"0.5757796",
"0.57507205",
"0.57407534",
"0.5736619",
"0.57350594",
"0.5728616",
"0.57019186",
"0.56988496",
"0.5697879",
"0.5693542",
"0.5688405",
"0.56731135",
"0.56731135",
"0.56690735",
"0.5668809",
"0.5645129",
"0.5643748",
"0.56368893",
"0.56368893",
"0.5627323",
"0.5623112",
"0.56205857",
"0.56188494",
"0.5617268",
"0.5610013",
"0.5606908",
"0.56061196",
"0.56052005",
"0.56028533",
"0.5601043",
"0.5601004",
"0.5593359",
"0.55882895",
"0.55878615",
"0.5585903",
"0.5583474"
]
| 0.6831999 | 2 |
Create or Update Legal Document | public function submitLegalDocument (
AccreditationApplication $accreditationApplication,
$legalDocumentType,
$name
)
{
$legalDocumentTypeReference = $this->em->getReference('YilinkerCoreBundle:LegalDocumentType', $legalDocumentType);
$legalDocument = $this->em->getRepository('YilinkerCoreBundle:LegalDocument')
->findOneBy(
array(
'accreditationApplication' => $accreditationApplication->getAccreditationApplicationId(),
'legalDocumentType' => $legalDocumentTypeReference->getLegalDocumentTypeId()
)
);
if (!$legalDocument || (int) $legalDocumentType === LegalDocumentType::TYPE_OTHERS) {
$legalDocument = new LegalDocument();
}
else {
$this->updateLegalDocumentIfEditable($legalDocument, 0);
}
$legalDocument->setAccreditationApplication($accreditationApplication);
$legalDocument->setLegalDocumentType($legalDocumentTypeReference);
$legalDocument->setName($name);
$legalDocument->setDateAdded(Carbon::now());
$legalDocument->setDateLastModified(Carbon::now());
$this->em->persist($legalDocument);
$this->em->flush();
return $legalDocument;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function _updateDocmanDocument($sessionKey, $group_id, $item_id, $title, $description, $status, $obsolescence_date, $type, $permissions, $metadata, $owner, $create_date, $update_date, $extraParams = array()) {\n if ($obsolescence_date !== null) {\n $extraParams['item']['obsolescence_date'] = $obsolescence_date;\n }\n return _updateDocmanItem($sessionKey, $group_id, $item_id, $title, $description, $status, $type, $permissions, $metadata, $owner, $create_date, $update_date, $extraParams);\n}",
"public function update(Request $request, Document $document)\n {\n try{\n $document->approved = true;\n $document->save();\n\n if ($document) {\n return redirect()->back()->with('message', 'Dokumen Telah Disetujui!')\n ->with('status','Data Successfully Saved!')\n ->with('type','success');\n }\n\n }catch (\\Exception $e){\n return redirect()->back()->with('message', $e->getMessage())\n ->with('status','Failed to Save Data!')\n ->with('type','error')\n ->withInput();\n }\n }",
"public function SaveDocumentosFase() {\n\t\t\ttry {\n\t\t\t\t// Update any fields for controls that have been created\n\t\t\t\tif ($this->lstDOCUMENTOIdDOCUMENTOObject) $this->objDocumentosFase->DOCUMENTOIdDOCUMENTO = $this->lstDOCUMENTOIdDOCUMENTOObject->SelectedValue;\n\t\t\t\tif ($this->lstFASEIdFASEObject) $this->objDocumentosFase->FASEIdFASE = $this->lstFASEIdFASEObject->SelectedValue;\n\n\t\t\t\t// Update any UniqueReverseReferences (if any) for controls that have been created for it\n\n\t\t\t\t// Save the DocumentosFase object\n\t\t\t\t$this->objDocumentosFase->Save();\n\n\t\t\t\t// Finally, update any ManyToManyReferences (if any)\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\t\t}",
"function legal_document_content_type_edit_form_submit($form, &$form_state) {\n $form_state['conf']['document'] = $form_state['values']['document'];\n $form_state['conf']['agree'] = $form_state['values']['agree'];\n $form_state['conf']['admin_title'] = $form_state['values']['admin_title'];\n}",
"public function edit(Document $document)\n {\n //\n }",
"public function edit(Document $document)\n {\n //\n }",
"public function edit(Document $document)\n {\n //\n }",
"public function edit(Document $document)\n {\n //\n }",
"public function edit(Document $document)\n {\n //\n }",
"public function createDocu() {\n $data = Input::all();\n if ($data[\"path\"] == \"\") {\n $validator = Validator::make($data, ['name' => 'required|max:255']);\n } else {\n $validator = Validator::make($data, ['name' => 'required|max:255', 'path' => 'required|max:255|unique:documents',]);\n }\n if ($validator->fails()) {\n return redirect('/document/new/')->withErrors($validator)->withInput();\n }\n\n $data[\"path\"] = \"/var/www/sphinx/\" . count(document::all()) . \"_\" . $data[\"name\"];\n\n $document = new document;\n\n $document->name = $data[\"name\"];\n $document->path = $data[\"path\"];\n $document->layout = $data[\"layout\"];\n $document->user_id = \\Auth::user()->id;\n $document->save();\n\n $this->createSphinxDoc($document->path, $document->name, \\Auth::user()->username);\n $this->changeRechte();\n $this->changeValueInConf(\"default\", $document->layout, $document->path);\n $this->changeValueInConf(\"#language = None\", \"language =\\\"de\\\"\", $document->path);\n $this->makeHTML($document->path);\n\n $this->addNewNews($document->id, 0, 1, \"Neues Dokument angelegt mit dem namen\" . $document->name);\n return redirect('/document/private/' . $document->id);\n }",
"public function updateDocument(string $documentType, array $document);",
"public function addDocument()\n\t{\n\t\t$id = $this->getId();\n\t\t$moduleName = $this->getModuleName();\n\n\t\tif (!$this->isNew) {\n\t\t\t$commessaPrec = $this->getPreviousValue('doccommessa');\n\t\t\tif($commessaPrec !== false) {\n\t\t\t\tunset($this->changes['doccommessa']);\n\t\t\t}\n\t\t}\n\t\tif (isset($_FILES['docfilename'])) {\n\t\t\t$file = $_FILES['docfilename'];\n\n\t\t\tif (empty($file['tmp_name'])) {\n\t\t\t\tunset($this->changes['docfilename']);\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\t$fileInstance = \\App\\Fields\\File::loadFromRequest($file);\n\t\t\tif (!$fileInstance->validate()) {\n\t\t\t\tunset($this->changes['docfilename']);\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\t$commessaId = $this->get('doccommessa');\n\t\t\tif (!empty($commessaId)) {\n\t\t\t\t$commessa = Vtiger_Record_Model::getInstanceById($commessaId, 'Commesse');\n\t\t\t\t$commessaPath = $commessa->get('nome');\n\t\t\t} else {\n\t\t\t\t$commessaPath = 'Condivisa';\n\t\t\t}\n\t\t\t$configDocPath = !empty(AppConfig::module($moduleName, 'DOC_PATH')) ? AppConfig::module($moduleName, 'DOC_PATH') : 'storage/Documenti';\n\t\t\t$uploadFilePath = ROOT_DIRECTORY . DIRECTORY_SEPARATOR . $configDocPath. DIRECTORY_SEPARATOR . $commessaPath;\n\t\t\tif (!is_dir($uploadFilePath)) { //create new folder\n\t\t\t\tif(!mkdir($uploadFilePath, 0744, true)) {\n\t\t\t\t\tunset($this->changes['docfilename']);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t//Verifico se esiste gia` un documento allegato\n\t\t\t$fileName = !empty($this->get('docfilename')) ? $this->get('docfilename') : false;\n\n\t\t\tif (empty($fileName)) {\n\t\t\t\t$fileName = trim(App\\Purifier::purify($fileInstance->name));\n\t\t\t\t$fileNameWithoutExt = trim(App\\Purifier::purify($fileInstance->getNameWithoutExtension()));\n\t\t\t\t$extension = pathinfo($fileName, PATHINFO_EXTENSION);\n\t\t\t\t$count = 0;\n\t\t\t\twhile (file_exists($uploadFilePath . DIRECTORY_SEPARATOR. $fileName)) {\n\t\t\t\t $count = $count + 1;\n\t\t\t\t $fileName = \"{$fileNameWithoutExt}_{$count}.{$extension}\";\n\t\t\t\t}\n\t\t\t\tif ($fileInstance->moveFile($uploadFilePath . DIRECTORY_SEPARATOR. $fileName)) {\n\t\t\t\t\t$this->set('docnome', $fileNameWithoutExt);\n\t\t\t\t\t$this->set('docfilename', $fileName);\n\t\t\t\t\t$this->set('doctype', $file['type']);\n\t\t\t\t\t$this->set('docpath', $uploadFilePath);\n\t\t\t\t\t$this->set('docsize', $file['size']);\n\t\t\t\t\t$this->set('docinuso', 0);\n\t\t\t\t\t$version = $this->get('docversione');\n\t\t\t\t\t$version +=1;\n\t\t\t\t\t$this->set('docversione',$version);\n\t\t\t\t} else {\n\t\t\t\t\t\\App\\Log::error('Error on the save attachment process.');\n\t\t\t\t\tunset($this->changes['docfilename']);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif(!$this->validateUploadedFileName($fileName)) {\n\t\t\t\t\tunset($this->changes['docfilename']);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t\tif ($fileInstance->moveFile($uploadFilePath . DIRECTORY_SEPARATOR. $fileName)) {\n\t\t\t\t\t$this->set('doctype', $file['type']);\n\t\t\t\t\t$this->set('docsize', $file['size']);\n\t\t\t\t\t$this->set('docinuso', 0);\n\t\t\t\t\t$version = $this->get('docversione');\n\t\t\t\t\t$version +=1;\n\t\t\t\t\t$this->set('docversione',$version);\n\t\t\t\t} else {\n\t\t\t\t\t\\App\\Log::error('Error on the save attachment process.');\n\t\t\t\t\tunset($this->changes['docfilename']);\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn true;\n\t\t} else {\n\t\t\tunset($this->changes['docfilename']);\n\t\t\treturn false;\n\t\t}\n\n\t}",
"function _createDocmanDocument($sessionKey, $group_id, $parent_id, $title, $description, $ordering, $status, $obsolescence_date, $type, $permissions, $metadata, $owner, $create_date, $update_date, $extraParams = array()) {\n if ($obsolescence_date !== null) $extraParams['item']['obsolescence_date'] = $obsolescence_date;\n return _createDocmanItem($sessionKey, $group_id, $parent_id, $title, $description, $ordering, $status, $type, $permissions, $metadata, $owner, $create_date, $update_date, $extraParams);\n}",
"public function testUpdateDocument()\n {\n echo \"\\nTesting dcoument update...\";\n\n $id = \"0\";\n //echo \"\\n-----Is string:\".gettype ($id);\n $input = file_get_contents('doc_update.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/documents/\".$id.\"?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/documents/\".$id.\"?owner=wawong\";\n\n //echo \"\\nURL:\".$url;\n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_put($url,$data);\n \n $json = json_decode($response);\n $this->assertTrue(!$json->success);\n \n }",
"function editDocumentInfo($documentInfo, $docID)\n {\n try{\n $this->db->trans_start();\n \n $this->db->where('id', $docID);\n $this->db->update('tbl_document_manager', $documentInfo);\n $resp = $this->db->affected_rows();\n \n $this->db->trans_complete();\n \n $resp = TRUE;\n }\n catch(PDOException $e){\n $resp = $e->getMessage();\n }\n \n return $resp;\n }",
"public function testCreateForm() {\n $test_label = $this->randomMachineName();\n $test_id = $this->randomMachineName();\n\n $this->drupalLogin($this->adminUser);\n $this->drupalPostForm('admin/structure/legal/add', [\n 'label' => $test_label,\n 'id' => $test_id,\n 'settings[new_users][require]' => 1,\n 'settings[new_users][require_method]' => 'form_inline',\n 'settings[existing_users][require]' => 1,\n 'settings[existing_users][require_method]' => 'redirect',\n ], 'Save');\n\n // Load a reset version of the entity.\n /** @var \\Drupal\\entity_legal\\EntityLegalDocumentInterface $created_document */\n $created_document = $this->getUncachedEntity(ENTITY_LEGAL_DOCUMENT_ENTITY_NAME, $test_id);\n\n $this->assertTrue(!empty($created_document), 'Document was successfully created');\n\n if ($created_document) {\n $this->assertEqual($test_label, $created_document->label(), 'Label was saved correctly');\n $this->assertEqual($test_id, $created_document->id(), 'ID was saved correctly');\n $this->assertEqual(1, $created_document->get('require_signup'), 'Signup requirement was saved correctly');\n $this->assertEqual(1, $created_document->get('require_existing'), 'Existing user requirement was saved correctly');\n $this->assertEqual('form_inline', $created_document->get('settings')['new_users']['require_method'], 'Existing user requirement was saved correctly');\n $this->assertEqual('redirect', $created_document->get('settings')['existing_users']['require_method'], 'Existing user requirement was saved correctly');\n }\n }",
"public function UpdateDocente() {\n\t\t\ttry {\n\t\t\t\t// Update any fields for controls that have been created\n\t\t\t\tif ($this->lstDocente) $this->objDocente->DocenteId = $this->lstDocente->SelectedValue;\n\n\t\t\t\tif ($this->txtCreateby) $this->objDocente->Createby = $this->txtCreateby->Text;\n\n\t\t\t\tif ($this->calCreated) $this->objDocente->Created = $this->calCreated->DateTime;\n\n\t\t\t\tif ($this->txtUpdateby) $this->objDocente->Updateby = $this->txtUpdateby->Text;\n\n\t\t\t\tif ($this->calUpdated) $this->objDocente->Updated = $this->calUpdated->DateTime;\n\n\t\t\t\tif ($this->txtActive) $this->objDocente->Active = $this->txtActive->Text;\n\n\n\t\t\t\t// Update any UniqueReverseReferences for controls that have been created for it\n\n\t\t\t} catch (QCallerException $objExc) {\n\t\t\t\t$objExc->IncrementOffset();\n\t\t\t\tthrow $objExc;\n\t\t\t}\n\t\t}",
"public function documents_post()\n {\n if(!$this->canWrite())\n {\n $array = $this->getErrorArray2(\"permission\", \"This user does not have the write permission\");\n $this->response($array);\n return;\n }\n \n $sutil = new CILServiceUtil();\n $jutil = new JSONUtil();\n $input = file_get_contents('php://input', 'r');\n \n if(is_null($input))\n {\n $mainA = array();\n $mainA['error_message'] =\"No input parameter\";\n $this->response($mainA);\n\n\n }\n $owner = $this->input->get('owner', TRUE);\n if(is_null($owner))\n $owner = \"unknown\";\n $params = json_decode($input);\n $jutil->setStatus($params,$owner);\n $doc = json_encode($params);\n if(is_null($params))\n {\n $mainA = array();\n $mainA['error_message'] =\"Invalid input parameter:\".$input;\n $this->response($mainA);\n\n }\n $result = $sutil->addDocument($doc);\n \n $this->response($result);\n \n }",
"public function store(Request $request)\n {\n $confirmed = false;\n $comment = $request->comment;\n $approval = $request->approval;\n $documentId = $request->documentId;\n $id = Auth::id();\n $date = date(\"Y-m-d H:i:s\");\n if($approval === 'on'){\n $confirmed = true;\n }\n\n if($comment == null){\n $comment = \"\";\n }\n\n $review = Review::create(['user_id'=>$id, 'document_id'=>$documentId, \n 'comment'=>$comment, 'date'=>$date, 'confirmed'=>$confirmed]);\n //Find the people that already validated this document.\n $confirmedReviews = Review::where('document_id', $documentId)->where(\n function($query){$query->where('confirmed', true);})->get();\n //Find people that should validate this document.\n $userdoc = DocumentUser::where('doc_id', $documentId)->get();\n $doc = Document::findOrfail($documentId);\n if($confirmedReviews->count() === $userdoc->count()){\n $doc->status = \"REVIEWED\";\n }else{\n $doc->status = \"NOT_REVIEWED\";\n }\n $doc->save();\n\n $msg = \"\";\n if($confirmed){\n $msg = Auth::user()->name.\" has approved your document\";\n }else{\n $msg = Auth::user()->name.\" mentioned some changes he want you to include on this document\";\n }\n $note = Notification::create(['sender'=>Auth::id(), 'recipient'=>$doc->owner_id, \n 'doc_id'=>$doc->id, 'version'=>$doc->version, 'is_read'=>false,\n 'datetime'=>date('Y-m-d H:i:s'), \n 'message'=>$msg]);\n\n if($confirmed){\n return redirect()->action('DocumentController@index');\n }\n\n return redirect()->action('DocumentController@show', ['id'=>$doc->id]);\n }",
"public function testEditForm() {\n $document = $this->createDocument(TRUE, TRUE, [\n 'new_users' => [\n 'require_method' => 'form_inline',\n ],\n 'existing_users' => [\n 'require_method' => 'redirect',\n ],\n ]);\n\n $this->drupalLogin($this->adminUser);\n $this->drupalGet('admin/structure/legal/manage/' . $document->id());\n\n // Test field default values.\n $this->assertFieldByName('label', $document->label(), 'Label is set correctly for document');\n $this->assertFieldByName('settings[new_users][require]', 1, 'Require new users set correctly');\n $this->assertFieldByName('settings[new_users][require_method]', 'form_inline', 'Require existing users set correctly');\n $this->assertFieldByName('settings[existing_users][require]', 1, 'Require existing users set correctly');\n $this->assertFieldByName('settings[existing_users][require_method]', 'redirect', 'Require existing users set correctly');\n\n // Test that changing values saves correctly.\n $new_label = $this->randomMachineName();\n $this->drupalPostForm('admin/structure/legal/manage/' . $document->id(), [\n 'label' => $new_label,\n 'settings[new_users][require]' => FALSE,\n 'settings[new_users][require_method]' => 'form_link',\n 'settings[existing_users][require]' => FALSE,\n 'settings[existing_users][require_method]' => 'popup',\n ], 'Save');\n\n /** @var \\Drupal\\entity_legal\\EntityLegalDocumentInterface $document */\n $document = $this->getUncachedEntity(ENTITY_LEGAL_DOCUMENT_ENTITY_NAME, $document->id());\n\n $this->assertEqual($new_label, $document->label(), 'Label was saved correctly');\n $this->assertEqual(0, $document->get('require_signup'), 'Signup requirement was saved correctly');\n $this->assertEqual(0, $document->get('require_existing'), 'Existing user requirement was saved correctly');\n $this->assertEqual('form_link', $document->get('settings')['new_users']['require_method'], 'Form link method was saved correctly');\n $this->assertEqual('popup', $document->get('settings')['existing_users']['require_method'], 'Popup require method was saved correctly');\n }",
"public function testUpdateDocumentMetadata()\n {\n }",
"public function create()\n\t{\n\t\t$this->authorize('manage', Document::class);\n\n\t\treturn view('docs.create');\n\t}",
"public function editAction($Id) {\n\n $document = $this->_em->find(\"CommercialCommercialDocument\", $Id);\n\n if($this->request->IsPost()) {\n\n // Create the new commercial document\n $parser = new \\IgestisFormParser();\n $document = $parser->FillEntityFromForm($document, $_POST);\n $document->setCountryCode($this->_em->getRepository(\"CoreCountries\")->find($this->request->getPost(\"countryCode\")));\n //\\Igestis\\Utils\\Dump::show($document); exit;\n try {\n $timeCredit = $this->_em->getRepository(\"CommercialTimeCredit\")->getLinkedTimeCredit($document);\n\n $document->setCreditTime($timeCredit);\n $timeCredit->setCreditMinutes($this->request->getPost(\"creditTime\"));\n $this->context->entityManager->persist($timeCredit);\n $this->context->entityManager->persist($document);\n $this->context->entityManager->flush();\n // Show wizz to article the document update\n new \\wizz(_(\"The document has been successfully updated\"), \\WIZZ::$WIZZ_SUCCESS);\n $this->redirect(\\ConfigControllers::createUrl(\"commercial_selling_document_edit\", array(\"Id\" => $document->getId())));\n\n } catch (\\Exception $e) {\n \\IgestisErrors::createWizz($e, \\IgestisErrors::TYPE_ANY, \\Igestis\\I18n\\Translate::_(\"An error has occurred during the selling document update\"));\n $this->redirect(\\ConfigControllers::createUrl(\"commercial_selling_document_edit\", array(\"Id\" => $document->getId())));\n }\n }\n\n\n $companyConfig = $this->_em->getRepository(\"CommercialCompanyConfig\")->getCompanyConfig();\n $estimationValidUntil = new \\DateTime;\n $estimationValidUntil->add(new \\DateInterval('P' . $companyConfig->getEstimateExpirationDays() . \"D\"));\n $invoiceValidUntil = new \\DateTime;\n $invoiceValidUntil->add(new \\DateInterval('P' . $companyConfig->getInvoicePaymentLimit() . \"D\"));\n\n $this->context->render(\"Commercial/pages/sellingDocumentsEdit.twig\", array(\n \"sellingDocument\" => $document,\n \"taxeRatesList\" => $this->_em->getRepository(\"CommercialTaxeRate\")->findAll(),\n \"sellingAccount\" => $this->_em->getRepository(\"CommercialSellingAccount\")->findAll(),\n \"countriesList\" => $this->_em->getRepository(\"CoreCountries\")->findAll(),\n \"soldTypeList\" => $this->_em->getRepository(\"CommercialSoldType\")->findAll(),\n \"today\" => new \\DateTime,\n \"companyConfig\" => $companyConfig,\n \"estimationValidUntil\" => $estimationValidUntil,\n \"invoiceValidUntil\" => $invoiceValidUntil\n ));\n }",
"public function create_doc_req()\r\n\t{\r\n\t\t$data['doc_req']=$this->input->post('doc_req');\r\n\t $data['created_on'] = date('Y-m-d H:i:s');\r\n\t $data['created_by'] = $_SESSION['admindata']['user_id'];\r\n\r\n\t $result = $this->Document_Req_model->create_doc_req($data);\r\n\t if($result)\r\n\t {\r\n\t \t$this->session->set_flashdata('qstage_success', 'Document Required has been added successfully.');\r\n \t\tredirect('/Document_Req');\r\n\t }\r\n\t else\r\n\t {\r\n\t \t$this->session->set_flashdata('qstage_err', 'Something Went Wrong.');\r\n \t\tredirect('/Document_Req');\r\n\t }\r\n\t}",
"public function createOrUpdateDocument(AgentProfileDocumentInterface $document);",
"public function save() {\n\t\tif (!$this->preSave()) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$this->requireDatabase();\n\t\t$this->requireId();\n\n\t\tif (empty($this->document->type)) {\n\t\t\t$this->document->type = get_class($this);\n\t\t}\n\n\t\ttry {\n\t\t\t$request = new HttpRequest();\n\t\t\t$request->setUrl($this->databaseHost . \"/\" . rawurlencode($this->databaseName) . \"/\" . rawurlencode($this->document->_id));\n\t\t\t$request->setMethod(\"put\");\n\t\t\t$request->setData(json_encode($this->document));\n\t\t\t$request->send();\n\n\t\t\t$request->response = json_decode($request->response);\n\t\t} catch (Exception $exception) {\n\t\t\tthrow new DocumentException(\"HTTP request failed.\", DocumentException::HTTP_REQUEST_FAILED, $exception);\n\t\t}\n\n\t\tif ($request->status === 201) {\n\t\t\t$this->document->_id = $request->response->id;\n\t\t\t$this->document->_rev = $request->response->rev;\n\n\t\t\treturn $this->postSave();\n\t\t} else {\n\t\t\tthrow new DocumentException(self::describeError($request->response));\n\t\t}\n\t}",
"public function addOrReplaceOne($id,$document) {}",
"public function update_document(Request $request, $doc_id)\n {\n try\n {\n // $user = array(\n // 'userid' => Auth::user()->id,\n // 'role' => Auth::user()->role\n // );\n // $user = (object) $user;\n // $post = new Resource_Post(); // You create a new resource Post instance\n // if (Gate::forUser($user)->denies('allow_admin', [$post,false])) { \n // $result = array('code'=>403, \"description\"=>\"Access denies\");\n // return response()->json($result, 403);\n // } \n // else {\n $doc_user_id = Auth::user()->id;\n $doc_status = $request['doc_status'];\n \n $information = array(\n \"doc_status\" => $doc_status\n );\n\n $rules = [\n 'doc_status' => 'required'\n ];\n $validator = Validator::make($information, $rules);\n if ($validator->fails()) \n {\n return $result = response()->json([\"data\" => $validator->messages()],400);\n }\n else\n {\n $query = DB::table('documents')\n ->where('doc_id', '=', $doc_id)\n ->update(['doc_status' => $doc_status, 'doc_user_id' => $doc_user_id]);\n if(count($query) < 1)\n {\n $result = array('code'=>400, \"description\"=>\"No records found\");\n return response()->json($result, 400);\n }\n else\n {\n $result = array('data'=>$query,'code'=>200);\n return response()->json($result, 200);\n }\n }\n // }\n }\n catch(Exception $e)\n {\n return response()->json(['error' => 'Something is wrong'], 500);\n }\n }",
"public function update(Request $request, Document $document)\n {\n //\n }",
"public function update(Request $request, Document $document)\n {\n //\n }",
"public function update(Request $request, Document $document)\n {\n //\n }",
"public function update(Request $request, Document $document)\n {\n //\n }",
"public function updateDocument($document_id, Request $request) {\n\t\t$user = $this->auth->user();\n\n\t\tif(!$user) {\n\t\t\treturn CustomResponsesHandler::response([\n\t\t\t\t\"code\" => 401,\n\t\t\t\t\"message\" => \"Permisos denegados para el cliente\",\n\t\t\t\t\"response\" => null\n\t\t\t]);\n\t\t} else {\n\t\t\t$validator = Validator::make($request->all(), $this->getRules(\"rules\"), $this->getRules(\"errors\"));\n\n\t\t\tif($validator->fails()) {\n\t\t\t\treturn CustomResponsesHandler::response([\n\t\t\t\t\t\"code\" => 400,\n\t\t\t\t\t\"message\" => \"Error en los parametros: \" . implode(\", \", $validator->errors()->all()),\n\t\t\t\t\t\"response\" => null\n\t\t\t\t]);\n\t\t\t} else {\n\t\t\t\t$document = Documents::where(\"id_user\", $user->id)->where(\"id\", $document_id)->first();\n\n\t\t\t\tif($document) {\n\t\t\t\t\t$document->location = $request->get(\"location\");\n\t\t\t\t\t$document->alias = $request->get(\"alias\");\n\t\t\t\t\t$document->expedition = $request->get(\"expedition\");\n\t\t\t\t\t$document->expiration = $request->get(\"expiration\");\n\t\t\t\t\t$document->notes = $request->get(\"notes\");\n\t\t\t\t\t$document->type = $request->get(\"type\");\n\t\t\t\t\t$document->subtype = $request->get(\"subtype\");\n\n\t\t\t\t\t$document->save();\n\n\t\t\t\t\treturn CustomResponsesHandler::response([\n\t\t\t\t\t\t\"code\" => 200,\n\t\t\t\t\t\t\"message\" => \"Documento actualizado exitosamente\",\n\t\t\t\t\t\t\"response\" => array(\"document\" => $document)\n\t\t\t\t\t]);\n\t\t\t\t} else {\n\t\t\t\t\treturn CustomResponsesHandler::response([\n\t\t\t\t\t\t\"code\" => 400,\n\t\t\t\t\t\t\"message\" => \"El documento que intenta actualizar no existe\",\n\t\t\t\t\t\t\"response\" => null\n\t\t\t\t\t]);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"protected function setDocument()\n\t{\n\t\t$isNew = ($this->item->id < 1);\n\t\t$document = Factory::getDocument();\n\t\t$document->setTitle($isNew ? \\JText::_('COM_BOOKINGMANAGER_CUSTOMEREDITOR_CREATING') :\n\t\t\t\\JText::_('COM_BOOKINGMANAGER_CUSTOMEREDITOR_EDITING'));\n\t}",
"public function update(Request $request, $doc)\n\t{\n\t\t$doc = Document::findBySlug($doc);\n\n\t\tif (!$doc) {\n\t\t\treturn response(view('docs.404'), 404);\n\t\t}\n\n\t\t$this->authorize('manage', $doc);\n\n\t\t$this->validate($request, [\n\t\t\t'name' => ['required', 'max:255'],\n\t\t\t\t'slug' => [\n\t\t\t\t'required',\n\t\t\t\t'max:255',\n\t\t\t\t'alpha_dash',\n\t\t\t\t'unique:docs,slug,'.$doc->slug.',slug',\n\t\t\t\t'not_in:create,destroy,edit,prune'\n\t\t\t],\n\t\t\t'content' => ['required'],\n\n\t\t\t'metadata' => ['array'],\n\t\t\t'metadata.*' => ['distinct'],\n\n\t\t\t'attachments' => ['array'],\n\t\t\t'uploads' => ['array'],\n\n\t\t\t'clients' => ['array'],\n\t\t\t'clients.*' => ['exists:clients,id', 'distinct'],\n\n\t\t\t'tags' => ['array'],\n\t\t\t'tags.*' => ['exists:tags,id'],\n\t\t]);\n\n\t\t$doc->name = $request->input('name');\n\t\t$doc->slug = $request->input('slug');\n\t\t$doc->content = $request->input('content');\n\n\t\tif ($metadata = $request->input('metadata')) {\n\t\t\t$doc->metadata = $metadata;\n\t\t}\n\n\t\t$attachments = $request->input('attachments', []);\n\n\t\tif ($request->hasFile('uploads')) {\n\t\t\t$uploads = $request->file('uploads');\n\t\t\t$attachments = array_merge($attachments, $uploads);\n\t\t}\n\n\t\t$doc->attachments = $attachments;\n\n\t\t$doc->updatedBy()->associate($request->user());\n\n\t\t$doc->save();\n\n\t\t$doc->clients()->sync($request->input('clients', []));\n\t\t$doc->tags()->sync($request->input('tags', []));\n\n\t\treturn redirect()->route('docs.show', $doc->url)\n\t\t\t->with('alert-success', 'Document updated!');\n\t}",
"public function update(Request $request, $id)\n {\n if(Gate::denies('update')) {\n return abort('401');\n } \n\n $data = $request->except('_token');\n\n $request->validate([\n 'name' => 'required',\n 'document_type_id' => 'required|exists:document_types,id'\n ]);\n\n $slug = \\Str::slug($request->name);\n\n $data['file'] = ''; \n \n $document = Document::with('document_type')->find($id);\n\n if(!$document){\n return redirect()->back();\n }\n \n $property = $document->property()->with('proprty_type')->first(); \n\n $document_type = DocumentType::find($request->document_type_id);\n\n $propperty_slug = \\Str::slug($property->property_name);\n\n $proprty_type = @$property->proprty_type;\n\n $proprty_type_slug = @$proprty_type->slug; \n\n $document_type_slug = $document_type->slug;\n\n $old_document_type = $document->document_type()->first();\n\n $public_path = public_path().'/';\n\n $folderPath = Document::PROPERTY.\"/\";\n\n $proprty_type_slug = ($proprty_type_slug) ? $proprty_type_slug : Document::ARCHIEVED;\n\n $folderPath .= $proprty_type_slug.'/'.$propperty_slug.'/'.$document_type_slug;\n \n if(($old_document_type->id != $request->document_type_id)){\n \n $oldFolderPath = Document::PROPERTY.'/'.$proprty_type_slug.'/'.$propperty_slug.'/'.$old_document_type->slug; \n\n \\File::copyDirectory($public_path.$oldFolderPath,$public_path.$folderPath); \n \\File::deleteDirectory($public_path.$oldFolderPath);\n }\n\n $document->update($data);\n\n if($request->hasFile('file')){\n $filesArr = [];\n $files = $request->file('file');\n $dnames = $request->dname;\n $date = @$request->date ?? 0;\n $month = @$request->month ?? 0;\n $year = @$request->year ?? 0;\n\n foreach ($files as $key => $file) {\n $dname = (!$dnames[$key]) ? $request->name : $dnames[$key];\n $fileName = \\Str::slug($dname).'-'.time().$key.'.'. $file->getClientOriginalExtension();\n $file->storeAs($folderPath, $fileName, 'doc_upload');\n $filesArr[] = ['file' => $fileName,'name' => $dname, \n 'date' => $date,'month' => $month,\n 'year' => $year];\n }\n $document->files()->createMany($filesArr);\n }\n\n\n return redirect(\"properties/$property->id\")->with('message', 'Document Updated Successfully!');\n }",
"public function add($document) {}",
"public static function addDocumentToBinder($docId)\n {\n $document = Documents::model()->findByPk($docId);\n if ($document) {\n $year = substr($document->Created, 0, 4);\n Storages::createProjectStorages($document->Project_ID, $year);\n $subsectionId = 0;\n if ($document->Document_Type == Documents::PM) {\n $payment = Payments::model()->findByAttributes(array(\n 'Document_ID' => $docId,\n ));\n $year = substr($payment->Payment_Check_Date, 0, 4);\n $subsectionId = Sections::createLogBinder($document->Project_ID, $document->Document_Type, $year);\n } elseif ($document->Document_Type == Documents::PO) {\n $po = Pos::model()->findByAttributes(array(\n 'Document_ID' => $docId,\n ));\n $year = substr($po->PO_Date, 0, 4);\n $subsectionId = Sections::createLogBinder($document->Project_ID, $document->Document_Type, $year);\n if ($po->PO_Backup_Document_ID != 0) {\n $bu = LibraryDocs::model()->findByAttributes(array(\n 'Document_ID' => $po->PO_Backup_Document_ID,\n 'Subsection_ID' => $subsectionId,\n ));\n if (!$bu) {\n $libDoc = new LibraryDocs();\n $libDoc->Document_ID = $po->PO_Backup_Document_ID;\n $libDoc->Subsection_ID = $subsectionId;\n $libDoc->Access_Type = Storages::HAS_ACCESS;\n $libDoc->Sort_Numb = 0;\n if ($libDoc->validate()) {\n $libDoc->save();\n }\n }\n }\n }\n\n $libDoc = LibraryDocs::model()->findByAttributes(array(\n 'Document_ID' => $docId,\n 'Subsection_ID' => $subsectionId,\n ));\n\n if (!$libDoc) {\n $libDoc = new LibraryDocs();\n $libDoc->Document_ID = $docId;\n $libDoc->Subsection_ID = $subsectionId;\n $libDoc->Access_Type = Storages::HAS_ACCESS;\n $libDoc->Sort_Numb = 0;\n if ($libDoc->validate()) {\n $libDoc->save();\n }\n }\n\n LibraryDocs::sortDocumentsInSubsection($subsectionId);\n }\n }",
"public function createOrReplaceDocument(AgentProfileDocumentInterface $document);",
"private function createDocument()\n {\n $input = file_get_contents('doc.json');\n //echo $input;\n //$url = TestServiceAsReadOnly::$elasticsearchHost . \"/CIL_RS/index.php/rest/documents?owner=wawong\";\n $url = TestServiceAsReadOnly::$elasticsearchHost .$this->context.\"/documents?owner=wawong\";\n \n $params = json_decode($input);\n $data = json_encode($params); \n $response = $this->curl_post($url,$data);\n \n \n $result = json_decode($response);\n $id = $result->_id;\n \n return $id;\n }",
"public function update(Request $request, $id)\n {\n $validator = Validator::make($request->all(), [\n \"document_name\" => [\"required\", \"string\", \"max:191\"],\n \"requirements.*\" => [\"required\", \"string\", \"max:191\"]\n ]);\n\n if ($validator->fails())\n return redirect()->back()->withErrors($validator->errors()->first());\n\n $document = Document::with('requirements')->where('id', $id)->first();\n $document->name = $request->document_name;\n $document->save();\n\n foreach ($document->requirements as $requirement){\n $requirement->delete();\n }\n\n $requirements = [];\n foreach ($request->requirement as $requirement){\n array_push($requirements, [\n \"document_id\" => $document->id,\n \"name\" => $requirement\n ]);\n }\n\n Requirement::insert($requirements);\n\n return redirect(route('document.index'))->with([\"success\" => \"Success Add Document\"]);\n }",
"function xh_createDocument()\r\n\t{\r\n\t}",
"public function update(Request $request, \\App\\Models\\Document $document)\n {\n $Parsedown = new Parsedown;\n $document->title = $request->input('title');\n $document->slug = str_slug($document->title);\n $document->markdown = $request->input('markdown');\n $document->html = $Parsedown->text($document->markdown);\n $document->save();\n\n return redirect()->route('administration.documentation', $document->version)->with('success', ['The Documentation titled: \"'. $document->title .'\" for version: \"'. $document->version->tag .'\" was updated succesfully.']);\n }",
"public function save(){\n\t\t// yei bata feri \"index.php\" ma falne jun chai profile ma jancha\n\t\t$req = new Requirement();\n\n\t\tif(isset($_POST['title'])){\n\t\t$req->setTitle($_POST['title']);\n\t\t}else{\n\t\t\t$req->setTitle(\"\");\n\t\t}\n\t\tif(isset($_POST['date'])){\n\n\t\t$req->setDate($_POST['date']);\n\t\t}else{\n\t\t\t$req->setDate(\"01-01-2001\");\n\t\t}\n\t\tif(isset($_POST['details'])){\n\t\t$req->setDescription($_POST['details']);\n\t\t}else{\n\t\t\t$req->setDescription(\"\");\n\t\t}\n\t\t$req->setStatus(1);\n\t\t$req->setOrgname(\"\");\n\t\t$this->requirement_repository->insert($req);\n\n\t}",
"private function createDocument() {\n $this->createObjectProperties();\n $this->createRelationships();\n $this->createIngestFileDatastreams();\n $this->createPolicy();\n $this->createDocumentDatastream();\n $this->createDublinCoreDatastream();\n $this->createCollectionPolicy();\n $this->createWorkflowStream();\n }",
"public function create()\n {\n $this->authorize('create documents', Document::class);\n return view('admin.document.create');\n }",
"public function save() {\n\t\tif(!$this->hasPermission(\\OCP\\PERMISSION_UPDATE)) {\n\t\t\tthrow new Exception(self::$l10n->t('You don\\'t have permissions to update the address book.'), 403);\n\t\t}\n\t}",
"public function anular_doc(){\n\t\t$id=$this->input->post('id');\n\t\t$estado=$this->input->post('estado');\n\t\t$datos = array(\n\t\t\t'estado' => $estado\n\t\t);\n\t\t$this->Facturar_model->actualizar_documento($id,$datos);\n\t}",
"public function store(Request $request)\n {\n $docent = Docent::create($request->all());\n $docent->user()->create(['password' => Hash::make($request->password)] + $request->all());\n return redirect(route('docent.index'));\n }",
"public function saveAction()\n {\n if ($data = $this->getRequest()->getPost('curriculumdoc')) {\n try {\n $data = $this->_filterDates($data, array('cdoc_date'));\n $curriculumdoc = $this->_initCurriculumdoc();\n $curriculumdoc->addData($data);\n $cdocFileName = $this->_uploadAndGetName(\n 'cdoc_file',\n Mage::helper('bs_curriculumdoc/curriculumdoc')->getFileBaseDir(),\n $data\n );\n $curriculumId = null;\n\n if(isset($data['hidden_curriculum_id']) && $data['hidden_curriculum_id'] > 0) {\n $curriculumId = $data['hidden_curriculum_id'];\n }elseif($this->getRequest()->getParam('curriculum_id')){\n $curriculumId = $this->getRequest()->getParam('curriculum_id');\n }\n $curriculumdoc->setData('cdoc_file', $cdocFileName);\n $curriculums = $this->getRequest()->getPost('curriculums', -1);\n if ($curriculums != -1) {\n $curriculumdoc->setCurriculumsData(Mage::helper('adminhtml/js')->decodeGridSerializedInput($curriculums));\n }else {\n if(isset($data['hidden_curriculum_id']) && $data['hidden_curriculum_id'] > 0){\n $curriculumId = $data['hidden_curriculum_id'];\n $curriculumdoc->setCurriculumsData(\n array(\n $data['hidden_curriculum_id'] => array(\n 'position' => \"\"\n )\n )\n );\n }\n }\n\n $curriculumdoc->save();\n\n $add = '';//traininglist_curriculum/edit/id/1/back/edit/tab/curriculum_info_tabs_curriculumdocs/\n $backUrl = $this->getUrl('*/traininglist_curriculum/edit/', array('back'=>'edit','id' => $curriculumId, 'tab'=>'curriculum_info_tabs_curriculumdocs'));\n if($this->getRequest()->getParam('popup')){\n $add = '<script>window.opener.location.href=\\''.$backUrl.'\\'; window.close()</script>';//window.opener.location.reload()\n }\n\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('bs_curriculumdoc')->__('Curriculum Document was successfully saved %s', $add)\n );\n Mage::getSingleton('adminhtml/session')->setFormData(false);\n if ($this->getRequest()->getParam('back')) {\n $this->_redirect('*/*/edit', array('id' => $curriculumdoc->getId()));\n return;\n }\n $this->_redirect('*/*/');\n return;\n } catch (Mage_Core_Exception $e) {\n if (isset($data['cdoc_file']['value'])) {\n $data['cdoc_file'] = $data['cdoc_file']['value'];\n }\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n Mage::getSingleton('adminhtml/session')->setCurriculumdocData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n } catch (Exception $e) {\n Mage::logException($e);\n if (isset($data['cdoc_file']['value'])) {\n $data['cdoc_file'] = $data['cdoc_file']['value'];\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_curriculumdoc')->__('There was a problem saving the curriculum doc.')\n );\n Mage::getSingleton('adminhtml/session')->setCurriculumdocData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n }\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_curriculumdoc')->__('Unable to find curriculum doc to save.')\n );\n $this->_redirect('*/*/');\n }",
"public function update($uavmDocument);",
"private function create_document1($args)\n {\n return <<< heredoc\n <!DOCTYPE html>\n <html>\n <head>\n <meta charset=\"UTF-8\">\n </head>\n <body style=\"font-family:sans-serif;margin-left:2em;\">\n <h1 style=\"font-family: 'Trebuchet MS', Helvetica, sans-serif;\ncolor: darkblue;margin-bottom: 0;\">World Wide Corp</h1>\n <h2 style=\"font-family: 'Trebuchet MS', Helvetica, sans-serif;\nmargin-top: 0px;margin-bottom: 3.5em;font-size: 1em;\ncolor: darkblue;\">Order Processing Division</h2>\n <h4>Ordered by {$args['signer_name']}</h4>\n <p style=\"margin-top:0em; margin-bottom:0em;\">Email: {$args['signer_email']}</p>\n <p style=\"margin-top:0em; margin-bottom:0em;\">Copy to: {$args['cc_name']}, {$args['cc_email']}</p>\n <p style=\"margin-top:3em;\">\n Candy bonbon pastry jujubes lollipop wafer biscuit biscuit. Topping brownie sesame snaps sweet roll pie. Croissant danish biscuit soufflé caramels jujubes jelly. Dragée danish caramels lemon drops dragée. Gummi bears cupcake biscuit tiramisu sugar plum pastry. Dragée gummies applicake pudding liquorice. Donut jujubes oat cake jelly-o. Dessert bear claw chocolate cake gummies lollipop sugar plum ice cream gummies cheesecake.\n </p>\n <!-- Note the anchor tag for the signature field is in white. -->\n <h3 style=\"margin-top:3em;\">Agreed: <span style=\"color:white;\">**signature_1**/</span></h3>\n </body>\n </html>\nheredoc;\n }",
"public function mtii_signed_doc_approval()\n {\n $tasks_performer = new TasksPerformer;\n $this->mtii_verify_ajax_nonce($_REQUEST['approval_nonce'], \"doc-upload-approval-nonce\");\n $this->check_if_user_is_admin();\n if (isset($_REQUEST[\"reg_catg\"]) && ($_REQUEST[\"reg_catg\"]==\"Cooperative\" || $_REQUEST[\"reg_catg\"]==\"ngoAndCbo\")) {\n $this->confirm_approval_right(true);\n $invoice_info_from_db = $tasks_performer->get_invoice_details_from_db($_REQUEST[\"doc_title\"]);\n $invoice_info_from_cp = $tasks_performer->get_invoice_as_cpt($_REQUEST[\"doc_title\"]);\n $inv_sub_catg_from_cp = get_post_meta($invoice_info_from_cp->ID, 'invoice_sub_category', true);\n $invoice_sub_catg_db = isset($invoice_info_from_db->invoice_sub_category) ?\n $invoice_info_from_db->invoice_sub_category : null;\n if ($invoice_info_from_db && $invoice_info_from_cp\n && (($inv_sub_catg_from_cp===\"replacement\" && $invoice_sub_catg_db===\"replacement\")\n || ($inv_sub_catg_from_cp===\"used-replacement\" && $invoice_sub_catg_db===\"used-replacement\"))\n ) {\n $update_info = $this->mtii_approve_cert_replacement($_REQUEST[\"doc_title\"]);\n } else if ($invoice_info_from_db && $invoice_info_from_cp\n && (($inv_sub_catg_from_cp===\"legal-search\" && $invoice_sub_catg_db===\"legal-search\")\n || ($inv_sub_catg_from_cp===\"used-legal-search\" && $invoice_sub_catg_db===\"used-legal-search\"))\n ) {\n $update_info = $this->mtii_approve_legal_search($_REQUEST[\"doc_title\"]);\n } else {\n $update_info = $this->mtii_approve_uploaded_doc($_REQUEST[\"doc_title\"], $_REQUEST[\"doc_id\"], $_REQUEST[\"reg_catg\"]);\n }\n } else if (isset($_REQUEST[\"reg_catg\"]) && $_REQUEST[\"reg_catg\"]==\"Business Premise\") {\n $this->confirm_approval_right(false, true);\n $update_info = $this->mtii_biz_premises_approval($_REQUEST[\"doc_title\"], $_REQUEST[\"doc_id\"]);\n }\n $this->prepare_to_send_response($update_info);\n }",
"public function update(Request $request, Document $document)\n {\n\n if ($document === null) {\n return GeneralHelper::sendNotification(NotificationTypes::ERROR, \"Dieses Dokument existiert nicht.\");\n }\n\n $document->name = $request->input(\"name\");\n $document->save();\n\n return GeneralHelper::sendNotification(NotificationTypes::SUCCESS, \"Das Dokument \\\"\" . $document->name . \"\\\" wurde erfolgreich umbenannt!\");\n }",
"function updateDocmanEmbeddedFile($sessionKey, $group_id, $item_id, $title, $description, $status, $obsolescence_date, $permissions, $metadata, $owner, $create_date, $update_date) {\n return _updateDocmanDocument($sessionKey, $group_id, $item_id, $title, $description, $status, $obsolescence_date, PLUGIN_DOCMAN_ITEM_TYPE_EMBEDDEDFILE, $permissions, $metadata, $owner, $create_date, $update_date);\n}",
"public function documents_put($id=\"0\")\n {\n if(!$this->canWrite())\n {\n $array = $this->getErrorArray2(\"permission\", \"This user does not have the write permission\");\n $this->response($array);\n return;\n }\n\n $sutil = new CILServiceUtil();\n $jutil = new JSONUtil();\n $input = file_get_contents('php://input', 'r');\n \n \n if(strcmp($id,\"0\")==0)\n {\n $array = array();\n $array['Error'] = 'Empty ID!';\n $this->response($array);\n }\n \n \n if(is_null($input))\n {\n $mainA = array();\n $mainA['error_message'] =\"No input parameter\";\n $this->response($mainA);\n\n }\n $owner = $this->input->get('owner', TRUE);\n if(is_null($owner))\n $owner = \"unknown\";\n $params = json_decode($input);\n \n if(is_null($params))\n {\n $array = array();\n $array['Error'] = 'Empty document!';\n $this->response($array);\n }\n \n $jutil->setStatus($params,$owner);\n $doc = json_encode($params);\n if(is_null($params))\n {\n $mainA = array();\n $mainA['error_message'] =\"Invalid input parameter:\".$input;\n $this->response($mainA);\n\n }\n \n $result = $sutil->updateDocument($id,$doc);\n $this->response($result);\n }",
"public function doc_gen_and_storage($documentid, $template_data, $doc_prefix, $doc_postfix, $customer_id, $KT_location, $direct, $pdf = FALSE, $claim_id=NULL)\n\t{\n\t\t// Set file name formats\n\t\t$pre_extension_file_name = $doc_prefix.$doc_postfix;\n\t\t$final_pdf = $pre_extension_file_name.'.pdf';\n\t\t$final_docx = $pre_extension_file_name.'.docx';\n\n\t\t$path = self::get_destination_path();\n\n\t\t// Acquire the settings for KT login and API URL\n\t\tLog::instance(Log::NOTICE, \"Dummy Connect to Knowledgetree.\");\n\t\t$knowledgetree_data = Kohana::$config->load('config')->get('KnowledgeTree');\n\n\t\ttry\n\t\t{\n\t\t\t// Create KT connection\n\t\t\t$kt_connection = New KTClient($knowledgetree_data['url']);\n\t\t\t$kt_connection->initSession($knowledgetree_data['username'], $knowledgetree_data['password']);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tLog::instance()->add(Log::ERROR, $e->getMessage().$e->getTraceAsString());\n\t\t\tif ($this->external_error_handing)\n\t\t\t{\n\t\t\t\tthrow new Exception($e);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn $e->getMessage();\n\t\t\t}\n\n\t\t}\n\t\tLog::instance(Log::NOTICE, \"Connected.\");\n\n\t\t// Generate Document - Load template from KT\n\n\t\t$template_location = Kohana::$cache_dir . '/' . Settings::instance()->get(\"doc_template_path\");\n\t\tif (!file_exists($template_location)) {\n\t\t\tmkdir($template_location, 0777, true);\n\t\t}\n\t\t$temporary_folder = Kohana::$cache_dir . '/' . Settings::instance()->get(\"doc_temporary_path\");\n\t\tif (!file_exists($temporary_folder)) {\n\t\t\tmkdir($temporary_folder, 0777, true);\n\t\t}\n\n\t\t$doc_config = Kohana::$config->load('config')->get('doc_config');\n\t\t$script_location = $template_location.$doc_config['script'];\n\n\t\tLog::instance(Log::NOTICE, \"Download document to folder.\");\n\t\ttry\n\t\t{\n\t\t\t$template_file = $kt_connection->downloadDocumentToFolder($documentid, $template_location);\n\t\t}\n\t\tcatch (Exception $e)\n\t\t{\n\t\t\tLog::instance()->add(Log::ERROR, $e->getMessage().$e->getTraceAsString());\n\t\t\tif ($this->external_error_handing)\n\t\t\t{\n\t\t\t\tthrow new Exception($e);\n\t\t\t}\n\t\t\telse\n\t\t\t{\n\t\t\t\treturn $e->getMessage();\n\t\t\t}\n\t\t}\n\n\t\tLog::instance(Log::NOTICE, \"Document downloaded.\");\n\t\tLog::instance(Log::NOTICE, \"Create .doc file.\");\n // Create document generator object - provide document generation base\n\t\t$docx = New Docgenerator($template_location, $script_location, $temporary_folder);\n $docx->add_template($template_file);\n $docx->initalise_document_template($template_data);\n $feedback = $docx->create($pre_extension_file_name);\n\n\n if ($feedback === TRUE)\n\t\t{\n\t\t\tself::set_activity($documentid, 'generate-docx');\n\n\t\t}\n\t\telse\n\t\t{\n\t\t\tLog::instance()->add(Log::ERROR, 'Error doc generation');\n\t\t}\n\n\t\tif ($pdf)\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\t//Generate the PDF\n\t\t\t\t$input_file = $template_location.$final_docx;\n\t\t\t\t$output_file = $template_location.$final_pdf;\n\n\t\t\t\tif (Settings::instance()->get(\"word2pdf_active\") == 1)\n\t\t\t\t{\n\n\t\t\t\t\t// convert DOCX to PDF\n\t\t\t\t\tself::doc_convert_to_pdf($input_file, $output_file);\n\n\t\t\t\t\t// save pdf to files?\n\t\t\t\t\t$pdf_save = Settings::instance()->get(\"word2pdf_savepdf\");\n\n\t\t\t\t\tif (($pdf_save == 1) AND ($direct == 0))\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->initialise_directory_structure($kt_connection, $customer_id);\n\t\t\t\t\t\t$kt_connection->addDocument($final_pdf, $template_location.$final_pdf, $path.'/contacts/'.$customer_id.$KT_location);\n\t\t\t\t\t\t$this->lastFileId = $kt_connection->lastFileId;\n if($claim_id && $this->lastFileId){\n Model_ContextualLinking::addObjectLinking($claim_id, Model_ContextualLinking::getTableId(\"pinsurance_claim\"), $this->lastFileId, Model_ContextualLinking::getTableId(\"plugin_files_file\"));\n }\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\tLog::instance()->add(Log::ERROR, 'PDF is not enabled in your APP Settings');\n\t\t\t\t}\n\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\tif ($this->external_error_handing)\n\t\t\t\t{\n\t\t\t\t\tthrow new Exception($e);\n\t\t\t\t}\n\t\t\t\telse\n\t\t\t\t{\n\t\t\t\t\treturn $e->getMessage();\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t// was direct option selected to download to desktop?\n\t\tif ($direct == 0)\n\t\t{\n\t\t\t// save docx to files?\n\t\t\t$save_docx = Settings::instance()->get(\"doc_save\");\n\t\t\tif (($save_docx == 1) AND ($direct == 0))\n\t\t\t{\n\t\t\t\t$this->initialise_directory_structure($kt_connection, $customer_id);\n\t\t\t\t$kt_connection->addDocument($final_docx, $template_location.$final_docx, $path.'/contacts/'.$customer_id.$KT_location);\n\t\t\t\t$this->lastFileId = $kt_connection->lastFileId;\n\t\t\t\tif($claim_id && $this->lastFileId){\n Model_ContextualLinking::addObjectLinking($claim_id, Model_ContextualLinking::getTableId(\"pinsurance_claim\"), $this->lastFileId, Model_ContextualLinking::getTableId(\"plugin_files_file\"));\n }\n\n\t\t\t}\n\n\t\t}\n\t\telse //direct download was chosen\n\t\t{\n\t\t\t$this->generated_documents['file'] = $final_docx;\n\t\t\t$this->generated_documents['url_docx'] = $template_location.$final_docx;\n\t\t\t$this->generated_documents['url_pdf'] = $template_location.$final_pdf;\n\t\t}\n\n\t\t// ***** SEND EMAIL IF MAIL IS SET *****/\n\t\tforeach ($this->mails as $mail)\n\t\t{\n\n\t\t\t$attached_doc[0] = $template_location.$final_pdf;\n\t\t\t$this->multi_attach_mail($mail['to'], $attached_doc, $mail['sender'], $mail['subject'], $mail['message']);\n\t\t}\n\n\t\t// ***** CLEAN UP PROCESS **** //\n\t\tLog::instance(Log::NOTICE, \"Deleting temporary files.\");\n\t\tsystem('rm '.$docx->temporary_folder.$template_file);\n\n\t\t//if we dont want to download cleanup otherwise leave for controller to pickup to download\n\t\tif ($direct == 0)\n\t\t{\n\t\t\tsystem('rm '.$template_location.$final_docx);\n\t\t\tsystem('rm '.$template_location.$final_pdf);\n\t\t}\n\n\t}",
"public function store(Request $request)\n {\n $validator = Validator::make($request->all(), [\n \"document_name\" => [\"required\", \"string\", \"max:191\"],\n \"requirements.*\" => [\"required\", \"string\", \"max:191\"]\n ]);\n\n if ($validator->fails())\n return redirect()->back()->withErrors($validator->errors()->first());\n\n $document = new Document();\n $document->name = $request->document_name;\n $document->save();\n\n $requirements = [];\n foreach ($request->requirement as $requirement){\n array_push($requirements, [\n \"document_id\" => $document->id,\n \"name\" => $requirement\n ]);\n }\n\n Requirement::insert($requirements);\n\n return redirect(route('document.index'))->with([\"success\" => \"Success Add Document\"]);\n }",
"public function store(Request $request)\n\t{\n\t\t$this->authorize('manage', Document::class);\n\n\t\t$this->validate($request, [\n\t\t\t'name' => ['required', 'max:255'],\n\t\t\t'slug' => [\n\t\t\t\t'required',\n\t\t\t\t'max:255',\n\t\t\t\t'alpha_dash',\n\t\t\t\t'unique:docs,slug',\n\t\t\t\t'not_in:create,destroy,edit,prune'\n\t\t\t],\n\t\t\t'content' => ['required'],\n\n\t\t\t'metadata' => ['array'],\n\t\t\t'metadata.*' => ['distinct'],\n\n\t\t\t'attachments' => ['array'],\n\t\t\t'uploads' => ['array'],\n\n\t\t\t'clients' => ['array'],\n\t\t\t'clients.*' => ['exists:clients,id', 'distinct'],\n\n\t\t\t'tags' => ['array'],\n\t\t\t'tags.*' => ['exists:tags,id'],\n\t\t]);\n\n\t\t$doc = new Document([\n\t\t\t'name' => $request->input('name'),\n\t\t\t'slug' => $request->input('slug'),\n\t\t\t'content' => $request->input('content'),\n\t\t\t'metadata' => $request->input('metadata', []),\n\t\t]);\n\n\t\tif ($request->hasFile('uploads')) {\n\t\t\t$doc->attachments = $request->file('uploads');\n\t\t}\n\n\t\t$doc->createdBy()->associate($request->user());\n\n\t\t$doc->save();\n\n\t\t$doc->clients()->sync($request->input('clients', []));\n\t\t$doc->tags()->sync($request->input('tags', []));\n\n\t\treturn redirect()->route('docs.index')\n\t\t\t->with('alert-success', 'Document created!');\n\t}",
"protected function setDocument() \n\t{\n\t\t$isNew = $this->item->id == 0;\n\t\t$document = JFactory::getDocument();\n\t\t$document->setTitle($isNew ? JText::_('COM_HELLOWORLD_HELLOWORLD_CREATING') : JText::_('COM_HELLOWORLD_HELLOWORLD_EDITING'));\n\t\t$document->addScript(JURI::root() . $this->script);\n\t\t$document->addScript(JURI::root() . \"/administrator/components/com_sportsmanagement/views/sportsmanagement/submitbutton.js\");\n\t\tJText::script('COM_HELLOWORLD_HELLOWORLD_ERROR_UNACCEPTABLE');\n\t}",
"public function update(Request $request, $id)\n {\n $request->validate([\n 'id_category' => 'required|integer',\n 'name' => 'required',\n 'description' => 'required',\n 'body' => 'required',\n 'status' => 'required|in:BORRADOR,COMPLETADO,PROCESO',\n 'file' => 'file|mimes:pdf',\n ]);\n\n //CREAMOS UN NUEVO DOCUMENTO\n $document = Documents::find($id);\n $document->id_category = $request->id_category;\n $document->id_user = $request->user_id;\n $document->name = $request->name;\n $document->slug = Str::slug($request->name, '-');\n $document->description = $request->description;\n $document->body = $request->body;\n $document->status = $request->status;\n $document->save();\n\n\n\n $ruta_archivo = \"vacio\";\n //OBTENEMOS EL NOMBRE QUE LLEVARA LOS ARCHIVOS EN BASE AL TITULO DE la foto PERO SIN ESPACIOS\n $nombreArchivos = Str::slug($request->name, '-');\n if ($request->file('file')) {\n $this->deletePdf($document->id);\n $archivo = $request->file('file');\n $nombre_archivo = $nombreArchivos . \"-\" . time() . '.' . $archivo->getClientOriginalExtension();\n $r2 = Storage::disk('documents')->put(utf8_decode($nombre_archivo), \\File::get($archivo));\n $ruta_archivo = \"storage/documents/\" . $nombre_archivo;\n $document->file = $ruta_archivo;\n $document->save();\n }\n\n\n return redirect()->route('documents.index')->with('info', 'Entrada actualizada con éxito');\n }",
"public function UploadFile() {\n\t\tif (!$this->parameter_check) { $this->Errors(\"Parameter check failed\"); return False; }\n\t\t/* SEE IF THERE IS ALREADY A DOCUMENT BY THIS NAME */\n\t\t$this->document_id=GetColumnValue(\"document_id\",\"document_files\",\"filename\",$this->filename,\"AND category_id='\".$this->category_id.\"' ORDER BY version_number DESC LIMIT 1\");\n\t\tif (!EMPTY($this->document_id)) {\n\t\t\t$di=new DocumentID;\n\t\t\t$result=$di->SetParameters($this->document_id);\n\t\t\tif (!$result) {\n\t\t\t\t//echo \"Failed\";\n\t\t\t\t//echo $di->ShowErrors();\n\t\t\t\t$this->Errors(\"Unable to open document\");\n\t\t\t\treturn False;\n\t\t\t}\n\t\t}\n\n\t\t/*\n\t\t\tALLOW IF:\n\t\t\t1. THIS IS THE FIRST VERSION OF THE DOCUMENT - NO DOCUMENT ID FROM ABOVE\n\t\t\t2. THE DOCUMENT EXISTS AND IT HAS BEEN CHECKED OUT AND THIS IS THE USER WHO CHECKED IT OUT\n\t\t\t3. THE FILE IS NOT LOCKED\n\t\t*/\n\t\t$upload_file=True;\n\t\tif (EMPTY($this->document_id)) {\n\t\t\t$this->version_number=1;\n\t\t}\n\t\telse {\n\t\t\t/* GET THE NEXT VERSION NUMBER */\n\t\t\t$this->version_number=($di->GetColVal(\"version_number\")+1);\n\n\t\t\t/* ALL DOCUMENTS MUST BE CHECKED OUT */\n\t\t\tif ($di->GetColVal(\"checked_out\") == \"n\") { $this->Errors(\"Not checked out\"); return False; }\n\t\t\t/* THE FILE MUST NOT BE LOCKED */\n\t\t\tif ($di->GetColVal(\"locked\") == \"y\") { $this->Errors(\"File locked\"); return False; }\n\t\t\t/* THIS MUST BE THE PERSON WHO CHECKED OUT THE DOCUMENT */\n\t\t\tif ($di->GetColVal(\"user_id_checked_out\") != $_SESSION['user_id']) { $this->Errors(\"Not your file\"); return False; }\n\t\t}\n\t\t$result=$this->SaveToDatabase();\n\t\tif ($result) {\n\t\t\t//echo \"ok\";\n\t\t\treturn True;\n\t\t}\n\t\telse {\n\t\t\t//echo \"err\";\n\t\t\treturn False;\n\t\t}\n\t}",
"public function update(Request $request, $id)\n {\n \n $this->validate($request, [\n 'company_id' => 'required',\n 'name' => 'required',\n ]);\n\n\n $form_data = array(\n 'company_id' => $request->company_id,\n 'name' => $request->name,\n );\n\n Document::whereId($id)->update($form_data);\n return redirect('/crm/document')->with('success', trans('backend.successupdate'));\n }",
"function updateDocmanFile($sessionKey, $group_id, $item_id, $title, $description, $status, $obsolescence_date, $permissions, $metadata, $owner, $create_date, $update_date) {\n return _updateDocmanDocument($sessionKey, $group_id, $item_id, $title, $description, $status, $obsolescence_date, PLUGIN_DOCMAN_ITEM_TYPE_FILE, $permissions, $metadata, $owner, $create_date, $update_date);\n}",
"public function saveToStore() {\r\n $this->context->dbDriver->store(RestoDatabaseDriver::LICENSE, array(\r\n 'license' => array(\r\n 'licenseId' => $this->licenseId,\r\n 'grantedCountries' => isset($this->description['grantedCountries']) ? $this->description['grantedCountries'] : null,\r\n 'grantedOrganizationCountries' => isset($this->description['grantedOrganizationCountries']) ? $this->description['grantedOrganizationCountries'] : null,\r\n 'grantedFlags' => isset($this->description['grantedFlags']) ? $this->description['grantedFlags'] : null,\r\n 'viewService' => isset($this->description['viewService']) ? $this->description['viewService'] : null,\r\n 'hasToBeSigned' => isset($this->description['hasToBeSigned']) ? $this->description['hasToBeSigned'] : null,\r\n 'signatureQuota' => isset($this->description['signatureQuota']) ? $this->description['signatureQuota'] : -1,\r\n 'description' => isset($this->description['description']) ? $this->description['description'] : null\r\n ))\r\n );\r\n }",
"public function create()\n {\n return view('admin.document.create');\n }",
"public function store(Request $request, $id)\n {\n if(Gate::denies('add')) {\n return abort('401');\n } \n\n $data = $request->except('_token');\n\n $request->validate([\n 'name' => [\n 'required',\n Rule::unique('documents')->where(function ($query) use($id) {\n return $query->where('property_id', $id);\n }),\n ],\n 'document_type_id' => 'required|exists:document_types,id',\n // 'file' => 'nullable|sometimes|mimes:pdf,doc,docx,jpeg,jpg,png,csv,xlsx,xls'\n ]);\n\n $slug = \\Str::slug($request->name);\n\n $data['file'] = ''; \n \n $property = Property::with('proprty_type')->find($id);\n\n if(!$property){\n return redirect()->back();\n }\n \n $document_type = DocumentType::find($request->document_type_id);\n\n $propperty_slug = \\Str::slug($property->property_name);\n\n $proprty_type = @$property->proprty_type;\n\n $proprty_type_slug = @$proprty_type->slug; \n\n $document_type_slug = $document_type->slug;\n\n $public_path = public_path().'/';\n\n $folderPath = Document::PROPERTY.\"/\";\n\n $proprty_type_slug = ($proprty_type_slug) ? $proprty_type_slug : Document::ARCHIEVED;\n\n $folderPath .= $proprty_type_slug.'/'.$propperty_slug.'/'.$document_type_slug;\n\n\n \\File::makeDirectory($public_path.$folderPath, $mode = 0777, true, true);\n\n $data['slug'] = $slug;\n \n $document = $property->documents()->create($data);\n\n if($request->hasFile('file')){\n $filesArr = [];\n $files = $request->file('file');\n $name = $request->name;\n $date = $request->filled('date') ? ( $request->date) : 0;\n $month = $request->filled('month') ? $request->month : 0;\n $year = $request->filled('year') ? $request->year : date('Y');\n\n foreach ($files as $key => $file) {\n $fileName = \\Str::slug($name).'-'.time().$key.'.'. $file->getClientOriginalExtension();\n $file->storeAs($folderPath, $fileName, 'doc_upload');\n $filesArr[] = ['file' => $fileName,'name' => $name,\n 'date' => $date,'month' => $month,\n 'year' => $year\n ];\n }\n $document->files()->createMany($filesArr);\n }\n\n return redirect(route('properties.show',['property' => $id]))->with('message', 'Document Created Successfully!');\n }",
"public function update(Request $request, Documentos $documentos)\n {\n //\n }",
"protected function givenNewDocumentIsCreated()\n {\n }",
"public static function addDocumentToFolder($docId, $vendorID = null)\n {\n $document = Documents::model()->findByPk($docId);\n if ($document) {\n $year = substr($document->Created, 0, 4);\n Storages::createProjectStorages($document->Project_ID, $year);\n $subsectionId = 0;\n if ($document->Document_Type == Documents::PM) {\n $payment = Payments::model()->findByAttributes(array(\n 'Document_ID' => $docId,\n ));\n\n $year = substr($payment->Payment_Check_Date, 0, 4);\n\n $subsectionId = Sections::createVendorFolder($document->Project_ID, $payment->Vendor_ID, $year);\n } elseif ($document->Document_Type == Documents::AP) {\n $ap = Aps::model()->findByAttributes(array(\n 'Document_ID' => $docId,\n ));\n\n $year = substr($ap->Invoice_Date, 0, 4);\n\n $subsectionId = Sections::createVendorFolder($document->Project_ID, $ap->Vendor_ID, $year);\n if ($ap->AP_Backup_Document_ID != 0) {\n $bu = LibraryDocs::model()->findByAttributes(array(\n 'Document_ID' => $ap->AP_Backup_Document_ID,\n 'Subsection_ID' => $subsectionId,\n ));\n\n if (!$bu) {\n $libDoc = new LibraryDocs();\n $libDoc->Document_ID = $ap->AP_Backup_Document_ID;\n $libDoc->Subsection_ID = $subsectionId;\n $libDoc->Access_Type = Storages::HAS_ACCESS;\n $libDoc->Sort_Numb = 0;\n if ($libDoc->validate()) {\n $libDoc->save();\n }\n }\n }\n } elseif ($document->Document_Type == Documents::PO) {\n $po = Pos::model()->findByAttributes(array(\n 'Document_ID' => $docId,\n ));\n\n $year = substr($po->PO_Date, 0, 4);\n\n $subsectionId = Sections::createVendorFolder($document->Project_ID, $po->Vendor_ID, $year);\n if ($po->PO_Backup_Document_ID != 0) {\n $bu = LibraryDocs::model()->findByAttributes(array(\n 'Document_ID' => $po->PO_Backup_Document_ID,\n 'Subsection_ID' => $subsectionId,\n ));\n\n if (!$bu) {\n $libDoc = new LibraryDocs();\n $libDoc->Document_ID = $po->PO_Backup_Document_ID;\n $libDoc->Subsection_ID = $subsectionId;\n $libDoc->Access_Type = Storages::HAS_ACCESS;\n $libDoc->Sort_Numb = 0;\n if ($libDoc->validate()) {\n $libDoc->save();\n }\n }\n }\n } elseif ($document->Document_Type == Documents::BU) {\n //get po or ap date\n $ap = Aps::model()->findByAttributes(array(\n 'AP_Backup_Document_ID' => $docId,\n ));\n if ($ap) {\n $year = substr($ap->Invoice_Date, 0, 4);\n } else {\n $po = Pos::model()->findByAttributes(array(\n 'PO_Backup_Document_ID' => $docId,\n ));\n if ($po) {\n $year = substr($po->PO_Date, 0, 4);\n }\n }\n $subsectionId = Sections::createVendorFolder($document->Project_ID, $vendorID, $year);\n } elseif ($document->Document_Type == Documents::PR) {\n $payroll = Payrolls::model()->findByAttributes(array(\n 'Document_ID' => $document->Document_ID,\n ));\n\n $year = substr($payroll->Week_Ending, 0, 4);\n\n $subsectionId = Sections::createPayrollFolder($document->Project_ID, $year, $payroll->Week_Ending);\n } elseif ($document->Document_Type == Documents::JE) {\n $je = Journals::model()->findByAttributes(array(\n 'Document_ID' => $document->Document_ID,\n ));\n\n $subsectionId = Sections::createJournalEntryFolder($document->Project_ID, $je->JE_Date);\n } elseif ($document->Document_Type == Documents::PC) {\n $pc = Pcs::model()->findByAttributes(array(\n 'Document_ID' => $document->Document_ID,\n ));\n\n $year = substr($pc->Envelope_Date, 0, 4);\n\n $subsectionId = Sections::createPettyCashFolder($document->Project_ID, $year, $pc->Employee_Name);\n } elseif ($document->Document_Type == Documents::AR) {\n $ar = Ars::model()->findByAttributes(array(\n 'Document_ID' => $document->Document_ID,\n ));\n\n $year = substr($ar->Invoice_Date, 0, 4);\n\n $subsectionId = Sections::createAccountsReceivableFolder($document->Project_ID, $year, $ar->Invoice_Date);\n }\n\n $libDoc = LibraryDocs::model()->findByAttributes(array(\n 'Document_ID' => $docId,\n 'Subsection_ID' => $subsectionId,\n ));\n\n if (!$libDoc) {\n $libDoc = new LibraryDocs();\n $libDoc->Document_ID = $docId;\n $libDoc->Subsection_ID = $subsectionId;\n $libDoc->Access_Type = Storages::HAS_ACCESS;\n $libDoc->Sort_Numb = 0;\n if ($libDoc->validate()) {\n $libDoc->save();\n }\n }\n\n LibraryDocs::sortDocumentsInSubsection($subsectionId);\n }\n }",
"public function update(Document $document, Request $request)\n {\n $user = Auth::user();\n\n if(($document->situation == 'Pendente de Envio' or $document->situation == 'Devolvida') and $document->user_id == $user->id){\n $form = \\FormBuilder::create(RegisterFinishForm::class, [\n 'data' => ['id' => $document->id]\n ]);\n\n\n if(!$form->isValid()){\n return redirect()\n ->back()\n ->withErrors($form->getErrors())\n ->withInput();\n }\n\n $data = $form->getFieldValues();\n\n\n\n if($data['role']=='Nacional'){\n $data['state_id'] = null;\n $data['county_id'] = null;\n }\n\n if($data['role']=='Estadual'){\n $data['county_id'] = null;\n if($data['state_id'] == null){\n $request->session()->flash('error', 'Selecione um Estado!');\n return redirect()->back()->withInput();\n }\n }\n\n if($data['role']=='Municipal'){\n if($data['state_id'] == null){\n $request->session()->flash('error', 'Selecione um Estado!');\n return redirect()->back()->withInput();\n }else{\n if($data['county_id'] == null){\n $request->session()->flash('error', 'Selecione um Município!');\n return redirect()->back();\n }\n }\n }\n\n\n // Define o valor default para a variável que contém o nome da imagem\n $nameordinance = null;\n $namedeclaration = null;\n\n // Verifica se informou o arquivo e se é válido\n if ($request->hasFile('ordinance') && $request->file('ordinance')->isValid()) {\n\n // Define um aleatório para o arquivo baseado no timestamps atual\n $name = uniqid(date('HisYmd'));;\n\n // Recupera a extensão do arquivo\n $extension = $request->ordinance->extension();\n\n // Define finalmente o nome\n $nameordinance = \"{$name}.{$extension}\";\n\n // Faz o upload:\n $upload = $request->ordinance->storeAs('ordinance', $nameordinance);\n // Se tiver funcionado o arquivo foi armazenado em storage/app/public/categories/nomedinamicoarquivo.extensao\n\n // Verifica se NÃO deu certo o upload (Redireciona de volta)\n if ( !$upload ){\n return redirect()\n ->back()\n ->with('error', 'Falha ao fazer upload')\n ->withInput();\n }\n\n $data['ordinance'] = $nameordinance;\n }\n\n if ($request->hasFile('declaration') && $request->file('declaration')->isValid()) {\n\n // Define um aleatório para o arquivo baseado no timestamps atual\n $name1 = uniqid(date('HisYmd'));;\n\n // Recupera a extensão do arquivo\n $extension1 = $request->declaration->extension();\n\n // Define finalmente o nome\n $namedeclaration = \"{$name1}.{$extension1}\";\n\n // Faz o upload:\n $upload1 = $request->declaration->storeAs('declaration', $namedeclaration);\n\n // Verifica se NÃO deu certo o upload (Redireciona de volta)\n if ( !$upload1 ){\n return redirect()\n ->back()\n ->with('error', 'Falha ao fazer upload')\n ->withInput();\n }\n\n $data['declaration'] = $namedeclaration;\n }\n\n\n $user = Auth::user();\n $data['user_id'] = $user->id;\n $data['situation'] = 'Pendente de Envio';\n\n \\Storage::delete('ordinance/'.$document->ordinance);\n \\Storage::delete('declaration/'.$document->declaration);\n\n $document->update($data);\n session()->flash('message','Solicitação editada com sucesso');\n\n return redirect()->route('documents.show', [ 'document' => $document->id ]);\n }\n\n return redirect()\n ->back()\n ->with('error', 'Essa solicitação não pode ser alterada!')\n ->withInput();\n\n }",
"public function create($document){\n $doc = new CouchDocument($this, $document);\n $doc->create();\n return $doc;\n \n }",
"public function createDocument(array $data);",
"function document_set ($id_document, $c=false) {\n\n\t// champs normaux\n\t$champs = array();\n\tforeach (array(\n\t\t'titre', 'descriptif', 'date', 'taille', 'largeur','hauteur','mode','credits',\n\t\t'fichier','distant','extension', 'id_vignette',\n\t ) as $champ)\n\t\tif (($a = _request($champ,$c)) !== null)\n\t\t\t$champs[$champ] = $a;\n\n\t// Si le document est publie, invalider les caches et demander sa reindexation\n\t$t = sql_getfetsel(\"statut\", \"spip_documents\", 'id_document='.intval($id_document));\n\tif ($t == 'publie') {\n\t\t$invalideur = \"id='id_document/$id_document'\";\n\t\t$indexation = true;\n\t}\n\t\n\t$ancien_fichier = \"\";\n\t// si le fichier est modifie, noter le nom de l'ancien pour faire le menage\n\tif (isset($champs['fichier'])){\n\t\t$ancien_fichier = sql_getfetsel('fichier','spip_documents','id_document='.intval($id_document));\n\t}\n\n\tinclude_spip('inc/modifier');\n\tmodifier_contenu('document', $id_document,\n\t\tarray(\n\t\t\t'invalideur' => $invalideur,\n\t\t\t'indexation' => $indexation\n\t\t),\n\t\t$champs);\n\n\t// nettoyer l'ancien fichier si necessaire\n\tif ($champs['fichier'] // un plugin a pu interdire la modif du fichier en virant le champ\n\t AND $ancien_fichier // on avait bien note le nom du fichier avant la modif\n\t AND $ancien_fichier!==$champs['fichier'] // et il a ete modifie\n\t AND @file_exists($f = get_spip_doc($ancien_fichier)))\n\t \tspip_unlink($f);\n\n\t// Changer le statut du document ?\n\t// le statut n'est jamais fixe manuellement mais decoule de celui des objets lies\n\tif(instituer_document($id_document,array('parents'=>_request('parents',$c),'ajout_parents'=>_request('ajout_parents',$c)))) {\n\n\t\t//\n\t\t// Post-modifications\n\t\t//\n\t\n\t\t// Invalider les caches\n\t\tinclude_spip('inc/invalideur');\n\t\tsuivre_invalideur(\"id='id_document/$id_document'\");\t\n\t}\n\n}",
"function updateDocuments() {\n try {\n if(DB::executeFirstCell(\"SELECT COUNT(*) AS count FROM \" . TABLE_PREFIX . \"modules WHERE name='documents'\")) {\n $documents_table = TABLE_PREFIX . 'documents';\n $document_categories_table = TABLE_PREFIX . 'document_categories';\n\n try {\n DB::execute(\"ALTER TABLE $documents_table CHANGE category_id category_id int(11) unsigned null default null\");\n DB::execute(\"ALTER TABLE $documents_table ADD size INT UNSIGNED NULL DEFAULT NULL AFTER body\");\n DB::execute(\"ALTER TABLE $documents_table CHANGE mime_type mime_type VARCHAR(255) NULL DEFAULT NULL\");\n DB::execute(\"ALTER TABLE $documents_table ADD location VARCHAR(50) NULL DEFAULT NULL AFTER mime_type\");\n DB::execute(\"ALTER TABLE $documents_table ADD md5 VARCHAR(32) NULL DEFAULT NULL AFTER location\");\n DB::execute(\"ALTER TABLE $documents_table ADD state tinyint unsigned not null default '0' after md5\");\n DB::execute(\"ALTER TABLE $documents_table ADD original_state tinyint(3) unsigned null default null after state\");\n DB::execute(\"ALTER TABLE $documents_table ADD original_visibility tinyint unsigned null default null after visibility\");\n DB::execute(\"ALTER TABLE $documents_table CHANGE created_on created_on DATETIME NULL DEFAULT NULL\");\n\n // Update data\n DB::beginWork('Updating documents @ ' . __CLASS__);\n\n DB::execute(\"UPDATE $documents_table SET state = ?\", 3); // Set state to visible for existing documents\n DB::execute(\"UPDATE $documents_table SET location = body, body = '' WHERE type = 'file'\"); // Move file location to location column\n\n $categories = DB::execute(\"SELECT id, name FROM $document_categories_table\");\n if(is_foreachable($categories)) {\n list($admin_user_id, $admin_display_name, $admin_email_address) = $this->getFirstAdministrator();\n\n foreach($categories as $category) {\n DB::execute(\"INSERT INTO \" . TABLE_PREFIX . \"categories (type, name, created_on, created_by_id, created_by_name, created_by_email) VALUES (?, ?, UTC_TIMESTAMP(), ?, ?, ?)\", 'DocumentCategory', $category['name'], $admin_user_id, $admin_display_name, $admin_email_address);\n DB::execute(\"UPDATE $documents_table SET category_id = ? WHERE category_id = ?\", DB::lastInsertId(), $category['id']);\n } // foreach\n } // if\n\n DB::commit('Documents updated @ ' . __CLASS__);\n\n DB::execute(\"DROP TABLE $document_categories_table\");\n } catch (Exception $e) {\n DB::rollback('Failed to update documents @ ' . __CLASS__);\n return $e->getMessage();\n } // try\n } // if\n } catch (Exception $e) {\n return $e->getMessage();\n } // try\n\n return true;\n }",
"public function create()\n {\n if(Gate::denies('add')) {\n return abort('401');\n } \n\n $id = request()->id;\n\n $documentsTypes = DocumentType::all(); \n\n $propery = Property::find($id);\n\n $tenants = $propery->tenants()->get();\n $vendors = $propery->vendors()->get();\n\n return view('properties.documents-create',compact('documentsTypes','tenants',\n 'vendors'));\n }",
"public function update(Request $request, $id)\n {\n $document = Document::find($id);\n $this->validate($request,[\n 'name' => 'required|max:255',\n 'link' => 'required',\n 'document_type_id' => 'required',\n 'class_id' => 'sometimes'\n ]);\n\n $document->name = $request->name;\n $document->link = $request->link;\n $document->document_type_id = $request->document_type_id;\n $document->class_id = $request->class_id;\n\n $document->save();\n\n\n Session::flash('success',' Document successfully updated!');\n return redirect()->route('documents.index');\n }",
"public function update(Request $request, Docent $docent)\n {\n $docent->update($request->all());\n $docent->user->update($request->all());\n return redirect(route('docent.index'));\n }",
"public function saveAction()\n {\n if ($data = $this->getRequest()->getPost('coursedoc')) {\n\n try {\n $data = $this->_filterDates($data, array('doc_date'));\n $coursedoc = $this->_initCoursedoc();\n $coursedoc->addData($data);\n $courseDocFileName = $this->_uploadAndGetName(\n 'course_doc_file',\n Mage::helper('bs_coursedoc/coursedoc')->getFileBaseDir(),\n $data\n );\n\n $coursedoc->setData('course_doc_file', $courseDocFileName);\n $products = $this->getRequest()->getPost('products', -1);\n if ($products != -1) {\n $coursedoc->setProductsData(Mage::helper('adminhtml/js')->decodeGridSerializedInput($products));\n }else {\n if(isset($data['hidden_course_id']) && $data['hidden_course_id'] > 0){\n $coursedoc->setProductsData(\n array(\n $data['hidden_course_id'] => array(\n 'position' => \"\"\n )\n )\n );\n\n\n }\n }\n $coursedoc->save();\n\n $add = '';\n if($this->getRequest()->getParam('popup')){\n $add = '<script>window.opener.document.location.href = \\''.$this->getUrl('*/catalog_product/edit', array('id'=>$data['hidden_course_id'], 'back'=>'edit', 'tab'=>'product_info_tabs_coursedocs')).'\\'; window.close()</script>';\n }\n\n Mage::getSingleton('adminhtml/session')->addSuccess(\n Mage::helper('bs_coursedoc')->__('Course Document was successfully saved %s', $add)\n );\n Mage::getSingleton('adminhtml/session')->setFormData(false);\n if ($this->getRequest()->getParam('back')) {\n if($add != ''){\n $this->_redirect('*/*/edit', array('id' => $coursedoc->getId(), 'tab' => 'product_info_tabs_coursedocs'));\n }else {\n $this->_redirect('*/*/edit', array('id' => $coursedoc->getId()));\n }\n\n return;\n }\n $this->_redirect('*/*/');\n return;\n } catch (Mage_Core_Exception $e) {\n if (isset($data['course_doc_file']['value'])) {\n $data['course_doc_file'] = $data['course_doc_file']['value'];\n }\n Mage::getSingleton('adminhtml/session')->addError($e->getMessage());\n Mage::getSingleton('adminhtml/session')->setCoursedocData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n } catch (Exception $e) {\n Mage::logException($e);\n if (isset($data['course_doc_file']['value'])) {\n $data['course_doc_file'] = $data['course_doc_file']['value'];\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_coursedoc')->__('There was a problem saving the course doc.')\n );\n Mage::getSingleton('adminhtml/session')->setCoursedocData($data);\n $this->_redirect('*/*/edit', array('id' => $this->getRequest()->getParam('id')));\n return;\n }\n }\n Mage::getSingleton('adminhtml/session')->addError(\n Mage::helper('bs_coursedoc')->__('Unable to find course doc to save.')\n );\n $this->_redirect('*/*/');\n }",
"private function mtii_approve_uploaded_doc($invoice_number_from_doc_title, $doc_id, $reg_catg)\n {\n $result = array();\n $doc_info = $reg_catg==\"Cooperative\" ?\n get_page_by_title($invoice_number_from_doc_title, OBJECT, 'mtii_signed_uploads') :\n get_page_by_title($invoice_number_from_doc_title, OBJECT, 'mtii_ngo_lists');\n\n if ($doc_info->ID == $doc_id) {\n $already_approved = $reg_catg==\"Cooperative\" ? get_post_meta($doc_id, 'admin_approved', true) :\n get_post_meta($doc_id, 'is_admin_approved', true);\n\n if ($already_approved==\"true\" || $already_approved==\"Approved\") {\n $result['status'] = \"Already Approved\";\n } else {\n global $mtii_db_coop_main_form;\n global $mtii_ngo_cbo_db_table;\n $reg_catg_info = $reg_catg=='Cooperative' ?\n $mtii_db_coop_main_form->get_by('invoice_number_filled_against', $invoice_number_from_doc_title)\n : $mtii_ngo_cbo_db_table->get_by('invoice_number_filled_against', $invoice_number_from_doc_title);\n $reg_catg_info = (array) $reg_catg_info;\n if ($reg_catg==\"Cooperative\") {\n $reg_catg_info[\"admin_approved\"] = \"Approved\";\n $reg_catg_info[\"approved_to_exist\"] = true;\n $doc_id_from_db = $reg_catg_info[\"application_form_id\"];\n $reg_catg_info[\"name_of_approved_society\"] = $reg_catg_info[\"name_of_proposed_society\"];\n $updated_coop_premise = $mtii_db_coop_main_form->update($doc_id_from_db, $reg_catg_info);\n if ($updated_coop_premise && !$wpdb->last_error) {\n $meta_update = update_post_meta($doc_id, 'admin_approved', 'true');\n } else {\n $result['status'] = \"error\";\n $result['approved'] = false;\n $result['others'] = array('0'=>$reg_catg_info, '1'=>$invoice_number_from_doc_title, '2'=>'doc_id', 'id'=>$doc_id_from_db);\n }\n } else {\n $reg_catg_info[\"is_admin_approved\"] = \"Approved\";\n $reg_catg_info[\"approved_to_exist\"] = true;\n $doc_id_from_db = $reg_catg_info[\"application_form_id\"];\n $reg_catg_info[\"name_of_approved_organization\"] = $reg_catg_info[\"name_of_proposed_organization\"];\n $updated_ngo = $mtii_ngo_cbo_db_table->update($doc_id_from_db, $reg_catg_info);\n if ($updated_ngo && !$wpdb->last_error) {\n $meta_update = update_post_meta($doc_id, 'is_admin_approved', 'Approved');\n } else {\n $result['status'] = \"error\";\n $result['approved'] = false;\n $result['others'] = array('0'=>$reg_catg_info, '1'=>$invoice_number_from_doc_title, '2'=>'doc_id', 'id'=>$doc_id_from_db);\n }\n }\n delete_post_meta($doc_id, 'approval_status');\n delete_post_meta($doc_id, 'date_approved');\n $meta_update = update_post_meta($doc_id, 'approval_status', 'Approval Active');\n date_default_timezone_set(\"Africa/Lagos\");\n $date_approved = date(\"r\");\n update_post_meta($doc_id, 'date_approved', $date_approved);\n if ($meta_update == false) {\n $result['status'] = \"error\";\n } else {\n $tasks_performer = new TasksPerformer;\n $doc_author = get_post_meta($doc_id, 'user_id', single);\n $auth = get_user_by('id', $doc_author);\n $auth_id = $auth->data->ID;\n $auth_email = $auth->data->user_email;\n $f_name = get_the_author_meta('first_name', $auth_id);\n $l_name = get_the_author_meta('last_name', $auth_id);\n $full_name = $f_name.\" \".$l_name;\n $created_image_info = $this->create_dummy_cert_and_save_as_file($invoice_number_from_doc_title, $reg_catg);\n if ($created_image_info && $created_image_info!=null && is_array($created_image_info)) {\n if ($created_image_info[\"success\"]) {\n if ($reg_catg=='Cooperative') {\n $society_name = $reg_catg_info[\"name_of_approved_society\"];\n $tasks_performer->add_organization_to_db_list(strtoupper($society_name));\n } else {\n $society_name = $reg_catg_info[\"name_of_approved_organization\"];\n $tasks_performer->add_organization_to_db_list(strtoupper($society_name), true);\n }\n $author_message = 'Congratulations '.$full_name.',<br /><br />'.\n 'Your uploaded signed documents for the invoice number <strong>'.\n $invoice_number_from_doc_title.'</strong> has just been approved by the site Administrator.<br /><br />'.\n 'Attached to this email is your dummy Certificate. You should download and bring your dummy certificate '.\n 'to MTII, Nasarawa office to get your original certificate.<br /><br />'.\n 'Thank you!';\n $mail_content = $tasks_performer->create_email_from_template('Your Upload has been Approved!', $author_message);\n $headers = array('Content-Type: text/html; charset=UTF-8');\n wp_mail($auth_email, 'MTII Upload Approval', $mail_content, $headers, $created_image_info[\"dpath\"]);\n $result['status'] = \"success and certificate sent\";\n $result['approved'] = true;\n $result['mainother'] = $created_image_info[\"dpath\"];\n } else {\n $author_message = 'Congratulations '.$full_name.',<br /><br />'.\n 'Your uploaded signed documents for the invoice number <strong>'.\n $invoice_number_from_doc_title.'</strong> has just been approved by the site Administrator.<br /><br />'.\n 'You are supposed to have your dummy certificate in this email but we had a problem creating and sending '.\n 'your dummy certificate. Please login to <a href=\"'.site_url().'\">Our Website</a> to print you dummy '.\n 'certificate and then bring it to MTII, Nasarawa office to get the original certificate.<br /><br />'.\n 'Thank you!';\n $mail_content = $tasks_performer->create_email_from_template('Your Upload has been Approved!', $author_message);\n $headers = array('Content-Type: text/html; charset=UTF-8');\n wp_mail($auth_email, 'MTII Upload Approval but No Dummy Certificate', $mail_content, $headers);\n $result['status'] = \"success but certificate not done\";\n $result['approved'] = true;\n }\n unlink($created_image_info[\"dpath\"]);\n } else {\n $author_message = 'Congratulations '.$full_name.',<br /><br />'.\n 'Your uploaded signed documents for the invoice number <strong>'.\n $invoice_number_from_doc_title.'</strong> has just been approved by the site Administrator.<br /><br />'.\n 'You are supposed to have your dummy certificate in this email but we had a problem creating and sending '.\n 'your dummy certificate. Please login to <a href=\"'.site_url().'\">Our Website</a> to print you dummy '.\n 'certificate and then bring it to MTII, Nasarawa office to get the original certificate.<br /><br />'.\n 'Thank you!';\n $mail_content = $tasks_performer->create_email_from_template('Your Upload has been Approved!', $author_message);\n $headers = array('Content-Type: text/html; charset=UTF-8');\n wp_mail($auth_email, 'MTII Upload Approval. No Dummy Certificate', $mail_content, $headers);\n $result['status'] = \"success but certificate not done\";\n $result['approved'] = true;\n }\n }\n }\n }\n return $result;\n }",
"public function update(StoreBasicDocument $request, BasicDocument $basic_document)\n {\n $basic_document->fill($request->all())->save();\n $request->session()->flash('alert-success', 'Запись успешно обновлена!');\n return redirect()->route('basic_document.index');\n }",
"public function store()\n\t{\n $documento = new Documento;\n\t\t\n $manager = new DocumentoManager($documento, Input::all());\n\n $manager->save();\n\t\t\n\t\tif (Input::hasFile('file_path')) {\n\t\t\tif ( ! $documento->Doc_File_Nbr) {\n\t\t\t\t$documento->Doc_File_Nbr = Input::file('file_path')->getClientOriginalName();\n\t\t\t \n\t\t\t \\DB::table('documentos')\n\t\t\t ->where('Emp_Id', \\Auth::user()->Emp_Id)\n\t\t \t->where('Doc_Id', $documento->Doc_Id)\n\t\t\t ->update(['Doc_File_Nbr' => Input::file('file_path')->getClientOriginalName()]);\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\tInput::file('file_path')->move( $documento->Emp_Doc_Dir, $documento->Doc_File_Nbr);\n\t\t}\n\n \treturn Redirect::route('documentos.list', $documento->Obj_Id . '-' . $documento->Doc_Oper_Id);\n\t}",
"public function editAction()\n {\n $coursedocId = $this->getRequest()->getParam('id');\n $coursedoc = $this->_initCoursedoc();\n if ($coursedocId && !$coursedoc->getId()) {\n $this->_getSession()->addError(\n Mage::helper('bs_coursedoc')->__('This course doc no longer exists.')\n );\n $this->_redirect('*/*/');\n return;\n }\n $data = Mage::getSingleton('adminhtml/session')->getCoursedocData(true);\n if (!empty($data)) {\n $coursedoc->setData($data);\n }\n Mage::register('coursedoc_data', $coursedoc);\n $this->loadLayout();\n $this->_title(Mage::helper('bs_coursedoc')->__('Course Document'))\n ->_title(Mage::helper('bs_coursedoc')->__('Course Documents'));\n if ($coursedoc->getId()) {\n $this->_title($coursedoc->getCourseDocName());\n } else {\n $this->_title(Mage::helper('bs_coursedoc')->__('Add course doc'));\n }\n if (Mage::getSingleton('cms/wysiwyg_config')->isEnabled()) {\n $this->getLayout()->getBlock('head')->setCanLoadTinyMce(true);\n }\n $this->renderLayout();\n }",
"public function update(Request $request, Documents $document)\n {\n $document->update($request->all());\n\n if ($request->file('file')) {\n $file=$request->file('file');\n $filename=$file->getClientOriginalName();\n $request->file->move('storage/', $filename);\n $document->file= $filename;\n \n $document->save();\n }\n \n return redirect('/files/create')->with('sukses','Document berhasil diupdate');\n }",
"public function store()\n\t{\n\t\t$inputs = Input::all();\n\t\t$inputs['license'] = \"<<<LICENSER\".sha1(mt_rand(10000,99999).time().$inputs['name']).\n\t\t\tsha1($inputs['name'].time().mt_rand(10000,99999)).\n\t\t\tsha1($inputs['name'].mt_rand(10000,99999).time()).\n\t\t\tsha1($inputs['name'].time().uniqid()).\n\t\t\tsha1(uniqid().$inputs['name'].time()).\"LICENSER>>>\";\n\n\t\t$inputs['user_id'] = Auth::user()->id;\n\n\t\t$license = new License($inputs);\n\t\tif ($license->save())\n\t\t{\n\t\t\treturn Redirect::to('/licenses')->with('alert', ['type' => 'success', 'message' => 'La licencia ha sido generada con exito.']);;\n\t\t}\n\t\treturn Redirect::to('/licenses')->with('alert', ['type' => 'danger', 'message' => 'Ocurrio un error, intenta mas tarde.']);;\n\n\t}",
"public function create(Request $request)\n {\n $id = $request->query();\n $affectations = DB::table('employes')\n ->join('unites','unites.id_unite','employes.unite_emp')\n ->join('affectations', 'affectations.id_emp', '=', 'employes.id_emp')\n ->where('affectations.id_affect',$id)\n ->get();\n //return $affectations;\n\n //This is the main document in Template.docx file.\n $fileName = \"template_decharge.docx\";\n $filePath = storage_path('app/public/decharges/' . $fileName);\n\n $phpword = new \\PhpOffice\\PhpWord\\TemplateProcessor($filePath);\n\n foreach ($affectations as $affectation) {\n $nom = $affectation->nom_emp;\n $fonction = $affectation->fonction_emp;\n $section = $affectation->nom_unite;\n $email = $affectation->email;\n $date_affect = $affectation->created_at;\n \n $desc_lap = $affectation->desc_laptop;\n $nom_lap = $affectation->nom_laptop;\n $serial_lap = $affectation->serial_laptop;\n $inv_lap = $affectation->inv_laptop;\n \n $desc_vhf = $affectation->desc_radio;\n $callsign = $affectation->call_radio;\n $serial_vhf = $affectation->serial_radio;\n $inv_vhf = $affectation->inv_radio;\n \n $desc_thuraya = $affectation->desc_thuraya;\n $num_thuraya = $affectation->numero_thuraya;\n $serial_thuraya = $affectation->serial_thuraya;\n $inv_thuraya = $affectation->inv_thuraya;\n }\n \n /* $nom = $request->input('nom_emp');\n $fonction = $request->input('fonction_emp');\n $section = $request->input('nom_unite');\n $email = $request->input('v_email_emp');\n $date_affect = $request->input('created_at'); */\n //return $email;\n $phpword->setValue('nom_emp', $nom);\n $phpword->setValue('fonction', $fonction);\n $phpword->setValue('section', $section);\n $phpword->setValue('date_affect', $date_affect);\n\n // Laptop\n $phpword->setValue('desc_lap',$desc_lap);\n $phpword->setValue('nom_lap',$nom_lap);\n $phpword->setValue('serial_lap',$serial_lap);\n $phpword->setValue('inv_lap',$inv_lap);\n\n // Radio\n $phpword->setValue('desc_vhf',$desc_vhf);\n $phpword->setValue('callsign',$callsign);\n $phpword->setValue('serial_vhf',$serial_vhf);\n $phpword->setValue('inv_vhf',$inv_vhf);\n\n // Radio\n $phpword->setValue('desc_thuraya',$desc_thuraya);\n $phpword->setValue('num_thuraya',$num_thuraya);\n $phpword->setValue('serial_thuraya',$serial_thuraya);\n $phpword->setValue('inv_thuraya',$inv_thuraya);\n\n //return $nom;\n $outputFile = storage_path('app/public/decharges/Decharge_' .$nom. '.docx');\n\n try{\n $phpword->saveAs($outputFile);\n }catch (Exception $e){\n //handle exception\n }\n return response()->download($outputFile);\n }",
"public function store(DocRequest $request){\n\n /* echo($request->user()->User_id);\n echo($request->input('nom'));*/\n /* $doc = new Doc;\n $doc->nom = $request->input('nom');\n // $doc->cree_par = $request->user()->User_id;\n $doc->save();*/\n\n Doc::create([\n 'nom' => $request->nom,\n 'cree_par' => $request->user()->User_id,\n ]);\n return redirect('document');\n }",
"public function edit(Documentos $documentos)\n {\n //\n }",
"public function storeDocument($file);",
"public function updateInvestmentDoc(Request $request)\n \t{\n\t \ttry\n\t \t{\n\t \t\tif($request->doctype==1)\n\t \t\t{\n\t \t\t\t$doclist = $request->doclist;\n\t \t\t}\n\t \t\telse\n\t \t\t{\n\t \t\t\t$doclist = $request->vidlisthide;\n\t \t\t}\n\n\t \t\t$pId = $request->pId;\n\n\t \t\tif($request->doctype==1)//validate documents\n\t \t\t{\n\t \t\t\t$validation = Validator::make($request->all(), [\n\t\t 'documents.*' => 'required|mimes:jpeg,jpg,png,doc,pdf,docx',\n\t\t ]);\n\t \t\t}\n\t \t\telse if($request->doctype==2)//validate videos\n\t \t\t{\n\t \t\t\t$validation = Validator::make($request->all(), [\n\t\t 'videos.*' => 'required|mimes:mp4,ogx,oga,ogv,ogg,webm',\n\t \t\t]);\n\t \t\t}\n\n\n\t\t \tif($validation->passes())\n\t\t \t{\n\t\t \t\t$docToSave = explode(',',$doclist[0]);\n\n\t\t \t\t//get id of logged in user\n\t \t\t\t$userId = Auth::id();\n\n\t\t\t\t//upload documents\n\n\t\t\t\tif($request->hasFile('documents'))\n\t\t\t\t{\n\t\t\t\t\t$files = $request->file('documents');\n\t\t\t\t\t//upload docs\n\t\t\t\t\t$this->uploadDocs($files,$docToSave,$request->doctype,$pId);\n\t\t\t\t}\n\n\t\t\t\t//upload videos\n\t\t\t\tif($request->hasFile('videos'))\n\t\t\t\t{\n\t\t\t\t\t$files = $request->file('videos');\n\t\t\t\t //upload videos\n\t\t\t\t\t$this->uploadDocs($files,$docToSave,$request->doctype,$pId);\n\t\t\t\t}\n\n\t\t\t\treturn response()->json([\n\t\t 'message' => 'Updations Done Successfully',\n\t\t 'status' => 1,\n\t\t 'class_name' => 'alert-success'\n\t \t]);\n\t\t \t}\n\t\t \telse\n\t\t \t{\n\t\t \t\treturn response()->json([\n\t\t 'message' => $validation->errors()->all(),\n\t\t 'status' => 0,\n\t\t 'class_name' => 'alert-danger'\n\t \t]);\n\t\t \t}\n\t\t}\n\t\tcatch(Exception $e){\n\n\t\t\treturn response()->json([\n\t 'message' => $e->getMessage(),\n\t 'status' => 0,\n\t 'class_name' => 'alert-danger'\n \t]);\n\n\t\t}\n \t}",
"public function store(CreateRequest $request)\n {\n $file = $request->file('file');\n $name = $file->getClientOriginalName();\n \\Storage::disk('local')->put($name, \\File::get($file));\n $request = $request->all();\n $request['file'] = $name;\n $document = $this->document->create($request);\n $document->documentTypes()->sync($request['documentType']);\n Session::flash('message-success',' Document '. $name.' '.trans('messages.created'));\n\n }",
"public function addDocument(string $documentType, array $document);",
"public function update($id)\n\t{\n\t\t// validate\n // read more on validation at http://laravel.com/docs/validation\n \t\t$rules = array(\n 'documentToUpload' => 'required | formats | max: 10485760' //10mb as max \n );\n\n $messages = array(\n 'documentToUpload.formats'=>'The file extension is not allowed!',\n );\n\n //var_dump(Input::all());die;\n $validator = Validator::make(Input::all(), $rules, $messages);\n\n $validator = Validator::make(Input::all(), $rules);\n\t\t\t\n // process the login\n if ($validator->fails()) {\n return Redirect::to('document/' . $id . '/edit')->withErrors($validator); //->withInput(Input::except('documentToUpload'));\n } else {\n\n \t$document = Document::find($id);\n \t$file = Input::file('documentToUpload');\n\n \tif(empty($file)){\n \t\t$filename = $document->getNameFile();\n\n\n \t\tif(Input::get('documentType_id') != $document->getDocumentType_id){\n\t\t\t\t\t//if there weren't changes on file but we DO change the documentType_id, we need to move the current file to another location\n\t\t\t\t\t// depending the documentType_id, and we also upload the normal data in database,\n \t\t\t$path = $document->getUrlByType(Input::get('documentType_id'));\n\n \t\t\tif ( !File::move($document->getCompleteFileRoute(), $path.$filename))\n\t\t\t\t\t{\n\t\t\t\t\t Session::flash('message', 'ERROR Moving File!');\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$document->description \t= Input::get('description');\n\t\t\t\t\t\t$document->pathFile \t= $path;\n\t\t\t $document->nameFile \t= $filename;\n\t\t\t $document->documentType_id \t= Input::get('documentType_id');\n\t\t\t $document->solution_id \t= Input::get('solution_id');\n\t\t\t $document->save();\n\t\t\t Session::flash('message', 'The document was updated Successfully!');\n\t\t\t\t\t}\n \t\t}else{\n \t\t\t//if there weren't changes on file nor the documentType_id, we just skip those fields when updating\n \t\t\t//we just upload the normal data in database\n \t\t\t$document->description \t= Input::get('description');\n\t\t $document->solution_id \t= Input::get('solution_id');\n\t\t $document->save();\n\t\t Session::flash('message', 'The document was updated Successfully!');\n \t\t}\n\t\t\t}else{\n\t\t\t\t//if we are uploading a new file, we need first delete the current file and upload the new one\n\t\t\t\t// and also update the info in database.\n\n\t\t\t\t$filename = value(function() use ($file){\n\t\t\t $filename = str_random(10) . '.' . $file->getClientOriginalExtension();\n\t\t\t return strtolower($filename);\n\t\t\t });\n\n\t\t\t\t\n\t\t\t\tif (!File::delete($document->getCompleteFileRoute()))\n\t\t \t{\n\t\t\t \tSession::flash('message', 'ERROR deleted the File!');\n\t\t\t }else{\t\t\n\t\t\t\t\t$path = $document->getUrlByType(Input::get('documentType_id'));\n\t\t\t\t\t\n\t\t\t\t\tif($file->move($path, $filename)){\n\t\t\t\t\t\t$document->description \t= Input::get('description');\n\t\t\t\t\t\t$document->pathFile \t= $path;\n\t\t\t\t\t\t$document->name \t\t= $file->getClientOriginalName();\t \n\t\t\t $document->nameFile \t= $filename;\n\t\t\t $document->documentType_id \t= Input::get('documentType_id');\n\t\t\t $document->solution_id \t= Input::get('solution_id');\n\t\t\t $document->save();\n\t\t\t Session::flash('message', 'The document was updated Successfully!');\n\t\t\t\t\t}else{\n\t\t\t\t\t\tSession::flash('message', 'There was an error uploading the selected file!');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\t\n\t\t\t// redirect\n return Redirect::to('document/index/'.$document->solution_id);\n }\n\t}",
"public function updateStudyAgreement()\n {\n $tenant = Tenant::where('idPerson', '=', \\Auth::user()->idPerson)->first();\n if (\\Input::file('picture')) {\n\n $image = \\Input::file('picture');\n $filename = \\Auth::user()->idPerson . '.' . $image->getClientOriginalExtension();\n $path = public_path(\"StudyAgreement/\" . $filename);\n Image::make($image->getRealPath())->save($path);\n $tenant->study_agreement = $filename;\n $tenant->save();\n }\n return \\Redirect::to('tenant');\n }",
"public function testPutDocument()\n {\n }",
"public function update_agreement(Request $request,$id)\n {\n $physical_agreement = $request->physical_agreement;\n $term_condition = $request->term_condition;\n\n if($physical_agreement=='') {}\n else\n {\n if ($files = $request->file('physical_agreement')) {\n $name = $files->getClientOriginalName();\n $files->move('images/shop_agreements', $name); $content = '';\n Store_Master::find($id)->update([\n 'physical_agreement' => $name,\n 'content_issue_comments' => $content,\n ]);\n }\n }\n\n if($term_condition=='') {}\n else\n {\n if ($files = $request->file('term_condition')) {\n $name = $files->getClientOriginalName();\n $files->move('images/shop_TnCs', $name); $content = '';\n Store_Master::find($id)->update([\n 'term_condition' => $name,\n 'content_issue_comments' => $content,\n ]);\n }\n }\n\n $data = Store_Master::find($id); echo $data;\n $physicl_agreement = $data['physical_agreement'];\n $term_condition = $data['term_condition'];\n\n if($physicl_agreement=='' || $term_condition=='')\n {\n if($physicl_agreement=='')\n { echo 'Agreement FIELD IS EMPTY.'; }\n if($term_condition=='')\n { echo 'Terms n Conditions FIELD IS EMPTY.'; }\n }\n else\n {\n $is_approve = 1; $current_time = now();\n Store_Master::find($id)->update([\n 'is_content_uploaded' => $is_approve,\n 'content_uploaded_on' => $current_time,\n ]);\n }\n\n return redirect('/verify-shops');\n }",
"function vw_hospital_bn_appointdesig_saveDoc( $post_id ) {\n\tif( isset( $_POST[ 'meta-area' ] ) ) {\n\t update_post_meta( $post_id, 'meta-area', $_POST[ 'meta-area' ] );\n\t}\n\tif( isset( $_POST[ 'meta-Time' ] ) ) {\n\t update_post_meta( $post_id, 'meta-Time', $_POST[ 'meta-Time' ] );\n\t}\n\tif( isset( $_POST[ 'meta-pname' ] ) ) {\n\t update_post_meta( $post_id, 'meta-pname', $_POST[ 'meta-pname' ] );\n\t}\n\tif( isset( $_POST[ 'meta-pemail' ] ) ) {\n\t update_post_meta( $post_id, 'meta-pemail', $_POST[ 'meta-pemail' ] );\n\t}\t\n}",
"public function update(Request $request, $id)\n {\n $this->validate($request, [\n 'document_code' => 'required',\n 'section' => 'required|max:255',\n 'effectivity_date' => 'required',\n 'subject' => 'required',\n 'revision_number' => 'required|numeric',\n 'page_number' => 'required|numeric',\n 'quality_manual_doc' => 'nullable|mimes:pdf|max:5000'\n ], $this->custom_messages);\n \n $old_doc = QualityManualDocumentation::find($id);\n $log = new Log;\n $log->name = Auth::user()->name;\n $log->action = 'EDIT';\n $log->module = 'QMSD';\n $log->description = 'Updated QMSD Document Code: ' . $old_doc->document_code . ' Section: ' . $old_doc->section. ' Subject: ' . $old_doc->subject;\n $log->save();\n\n $quality_manual_doc = $old_doc->quality_manual_doc;\n $this->save_file($request, $quality_manual_doc);\n\n QualityManualDocumentation::where('id',$id)->update(array(\n 'document_code' => $request->document_code,\n 'effectivity_date' => $request->effectivity_date,\n 'subject' => $request->subject,\n 'revision_number' => $request->revision_number,\n 'page_number' => $request->page_number,\n 'section' => $request->section,\n 'quality_manual_doc' => $quality_manual_doc\n \n ));\n\n \n\n return redirect('/qmsd');\n }",
"public function agregar_docente(){\r\n $conectar=parent::conexion();\r\n parent::set_names();\r\n\r\n\r\n if(empty($_POST[\"nombre\"]) or empty($_POST[\"apellido\"]) or empty($_POST[\"num_identidad\"])){\r\n header(\"Location:\".Conectar::ruta().\"admin/profesores/crear.php?m=1\");\r\n exit();\r\n }\r\n $esta='activo';\r\n $conectar=parent::conexion();\r\n $sql=\"insert into docente values(null,?,?,?,?,now());\";\r\n $sql=$conectar->prepare($sql);\r\n $sql->bindValue(1, $_POST[\"nombre\"]);\r\n $sql->bindValue(2, $_POST[\"apellido\"]);\r\n $sql->bindValue(3, $_POST[\"num_identidad\"]);\r\n $sql->bindValue(4, $esta);\r\n $sql->execute();\r\n $resultado=$sql->fetch(PDO::FETCH_ASSOC);\r\n header(\"Location:\".Conectar::ruta().\"admin/profesores/index.php?m=2\");\r\n \r\n }",
"public function update(Request $request, $id)\n {\n \n $file_size=0;\n $file_path='';\n $document=document::where('title', '=', $request->title)->first();\n if($document!=null && $document->id!=$id){\n if($request->ajax())\n return ['error', 'Title already exists. Please try another title.'];\n return back();\n }\n\n $this->validate($request, [\n 'title'=>'required',\n 'category'=>'required',\n ]);\n\n\n //Upload file\n if($request->hasFile('file')){\n $file = $request->file('file');\n $filename = time().'-'.$file->getClientOriginalName();\n $storage_path = storage_path().'/app/public/uploads/';\n $file->move($storage_path, $filename);\n $file_path=$storage_path.$filename;\n $file_size = File::size($file_path);//Storage::size($file_path);\n //convert to KB\n $file_size=$file_size/1024;\n }\n\n $author=author::find($request->authorId);\n if($author==null)\n $author=new author;\n $author->firstName=$request->firstName;\n $author->middleName=$request->middleName;\n $author->lastName=$request->lastName;\n $author->email=$request->author_email;\n $author->phoneNumber=$request->author_phoneNumber;\n $author->updatedByUserId=Auth::guard('web')->user()->id;\n if($request->authorId==null){\n $author->createdByUserId=Auth::guard('web')->user()->id;\n }else{\n $author->updatedByUserId=Auth::guard('web')->user()->id;\n }\n $author->save();\n\n $publisher=publisher::find($request->publisherId);\n if($publisher==null)\n $publisher=new publisher;\n $publisher->name=$request->name;\n $publisher->yearOfEstablishment=$request->yearOfEstablishment;\n $publisher->email=$request->publisher_email;\n $publisher->phoneNumber=$request->publisher_phoneNumber;\n $publisher->updatedByUserId=Auth::guard('web')->user()->id;\n if($request->publisherId==null){\n $publisher->createdByUserId=Auth::guard('web')->user()->id;\n }\n else{\n $publisher->updatedByUserId=Auth::guard('web')->user()->id; \n }\n $publisher->save();\n\n $document=document::find($id);\n $document->title=$request->title;\n $document->category=$request->category;\n $document->subCategory=$request->subCategory;\n $document->summery=$request->summery;\n $document->location=$request->location;\n $document->uploadedDateTime=(new \\App\\Date_class)->getCurrentDate();\n $document->authorId=$request->authorId!=null? $request->authorId: $author->id;\n $document->updatedByUserId=Auth::guard('web')->user()->id;\n $document->save();\n\n\n $document_edition=$document->editions->first();\n if($document_edition!=null){\n $document_edition->documentId=$document->id;\n $document_edition->edition=$request->edition;\n if($file_path!=''){\n $document_edition->path=$file_path;\n $document_edition->sizeInBytes=$file_size;\n $document_edition->uploadedDateTime=(new \\App\\Date_class)->getCurrentDate();\n }\n $document_edition->publisherId=$request->publisherId!=null? $request->publisherId: $publisher->id;\n $document_edition->yearOfPublishment=$request->yearOfPublishment;\n $document_edition->description=$request->description;\n $document_edition->updatedByUserId=Auth::guard('web')->user()->id;\n $document_edition->save(); \n }\n\n \\App\\Global_var::logAction($request, 'Updated document ID: '.$document->id.' Title: '.$document->title.'. Size: '.$file_size.' KBytes');\n\n return redirect()->route(\"documents.show\", $id);\n }"
]
| [
"0.6014221",
"0.57558495",
"0.5753775",
"0.57431275",
"0.57214874",
"0.57214874",
"0.57214874",
"0.57214874",
"0.57214874",
"0.5716789",
"0.57143843",
"0.569839",
"0.56849796",
"0.568033",
"0.5660725",
"0.56546044",
"0.56504464",
"0.56470436",
"0.5646788",
"0.56451064",
"0.560834",
"0.5593823",
"0.55713755",
"0.5555452",
"0.5548755",
"0.55417144",
"0.55038846",
"0.5502742",
"0.5501892",
"0.5501892",
"0.5501892",
"0.5501892",
"0.5496518",
"0.5473908",
"0.5464422",
"0.54598975",
"0.5452281",
"0.5433745",
"0.5415585",
"0.54120445",
"0.5407721",
"0.5406206",
"0.53866696",
"0.5380448",
"0.5375245",
"0.5357375",
"0.53462917",
"0.534392",
"0.53239024",
"0.5311686",
"0.530219",
"0.5289548",
"0.528735",
"0.5280951",
"0.5272139",
"0.5258863",
"0.52483165",
"0.52475846",
"0.5244935",
"0.5238126",
"0.5234939",
"0.5232407",
"0.5231079",
"0.52123666",
"0.5206807",
"0.51939297",
"0.51889765",
"0.51831305",
"0.5176965",
"0.5174266",
"0.5174056",
"0.51519054",
"0.51471025",
"0.51464915",
"0.5142843",
"0.5133755",
"0.5133583",
"0.51299495",
"0.51283914",
"0.5125466",
"0.51223296",
"0.51109445",
"0.51092505",
"0.5105337",
"0.51043546",
"0.50845045",
"0.50792557",
"0.5073816",
"0.5073683",
"0.5069019",
"0.5059406",
"0.50576603",
"0.50373363",
"0.50371474",
"0.5036909",
"0.5033707",
"0.50327015",
"0.5030243",
"0.5029772",
"0.502198"
]
| 0.5576805 | 22 |
Add Tax Identification Number | public function updateUserTin (User $user, $tin)
{
$user->setTin($tin);
$this->em->flush();
return $user;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function taxpayerIdentificationNumber()\n {\n $firstEightDigits = static::numerify(static::randomElement(static::$firstEightDigitsFormat));\n $lastDigit = static::dvCalcMod11($firstEightDigits);\n\n return $firstEightDigits.$lastDigit;\n }",
"public function setTaxNo($taxno);",
"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 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 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 get_tax_number()\n {\n if (!empty($this->business_center_id)) {\n $tax_number = $this->db->query_field(DISTRIBUTOR_TAX_NUMBER_SQL, array($this->business_center_id));\n if (!empty($tax_number)) {\n return $tax_number;\n }\n }\n return false;\n }",
"public function getTaxOrIdentityNumber() :string\n {\n return $this->taxOrIdentityNumber;\n }",
"public function taxpayerIdentificationNumber($separator = '')\n {\n return static::randomElement(['J', 'G', 'V', 'E', 'P', 'C']) . $separator . static::numerify('########') . $separator . static::numerify('#');\n }",
"public function getIdTax()\n {\n return $this->id_tax;\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 getTaxAmount();",
"public function formattedTax(): string;",
"public function getTaxClassId();",
"public function addTax(){\n $data['title'] = \"Add Tax\";\n $this->admin_load('taxes/add_tax',$data); \n }",
"public function tax()\n {\n return 0;\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 }",
"private function __construct(private readonly string $taxIndentificationNumber)\n {\n // ..\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 createTax($data) \n {\n return $this->insert($this->table,$data);\n }",
"public function getTotalTaxAmount();",
"function NewTaxAmount($amount ,$tax=0.06)\n{\n $amount += $amount * $tax;\n echo \"Total amount: $amount\";\n}",
"public function getBaseTaxAmount();",
"abstract public function getTaxType();",
"public function getTaxInvoiced();",
"public function setTaxAmount($amount);",
"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 generateAndSetInvoiceNumber();",
"public function getTaxcode()\n {\n return $this->taxcode;\n }",
"public function hasNcbiTaxonId(){\n return $this->_has(4);\n }",
"public function getTaxIdAttribute()\n {\n return $this->exists ? $this->attributes['tax_id'] : Tax::getDefaultTaxId();\n }",
"public function hasNcbiTaxonId(){\n return $this->_has(7);\n }",
"public function getTaxDocumentNumber()\n\t{\n\t\treturn $this->getIfSet('number', $this->data->taxDocument);\n\t}",
"public function setIdTax($v)\n {\n if ($v !== null) {\n $v = (string) $v;\n }\n\n if ($this->id_tax !== $v) {\n $this->id_tax = $v;\n $this->modifiedColumns[AliMemberTableMap::COL_ID_TAX] = true;\n }\n\n return $this;\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 getFormattedTaxAttribute(): string;",
"public function taxLedgerEntry($notes)\n {\n $items = $this->getItems();\n $totalPrice = 0;\n $tax_types = array ();\n $ledgerEntryIds = array ();\n $taxTypeModel = new Core_Model_Tax_Type;\n \n for($i = 0; $i <= sizeof($items)-1; $i += 1) {\n if($items[$i]['tax_type_id'] != null) {\n $taxName = \n $taxTypeModel->getTaxNameFromId($items[$i]['tax_type_id']);\n if (!(in_array($taxName, $tax_types))) { \n array_push($tax_types, $taxName);\n }\n }\n }\n \n for ($tax = 0; $tax <= sizeof($tax_types)-1; $tax += 1) {\n $totalTaxAmount = 0;\n for($i = 0; $i <= sizeof($items)-1; $i += 1) {\n $taxName = $taxTypeModel->getTaxNameFromId(\n $items[$i]['tax_type_id']);\n if ($taxName == $tax_types[$tax]) {\n $price = $items[$i]['unit_price'] * $items[$i]['quantity'];\n $taxPercentage = $taxTypeModel->getTaxPercentageFromId(\n $items[$i]['tax_type_id']);\n $taxAmount = ($price * $taxPercentage) / 100 ;\n $totalTaxAmount = $totalTaxAmount + $taxAmount; \n }\n }\n $financeLedger = new Core_Model_Finance_Ledger;\n $salesLedgerRecord = $financeLedger->fetchByName($tax_types[$tax]);\n $dataToInsert['debit'] = $totalTaxAmount;\n $dataToInsert['credit']= \"0\"; \n $dataToInsert['notes'] = $notes;\n $dataToInsert['transaction_timestamp'] = $this->_transactionTime;\n $dataToInsert['fa_ledger_id'] = $salesLedgerRecord['fa_ledger_id'];\n $ledgerEntryModel = new Core_Model_Finance_Ledger_Entry;\n $ledgerEntryId = $ledgerEntryModel->create($dataToInsert);\n array_push($ledgerEntryIds, $ledgerEntryId);\n }\n return $ledgerEntryIds;\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 getBaseTaxInvoiced();",
"public function add_number($attributes)\n {\n return $this->numbers()->create($attributes);\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 getSubtotalInclTax();",
"function tax()\n {\n if (($data['logedUser'] = $this->_admin_pages()))\n { \n \n $manufacturer['content'] = Modules::run('tax/_index'); \n \n $data['header'] = '';\n $data['titelHeader'] = $this->lang->line('tax');\n $data['content'] = Modules::run('ajaxme/ajaxmeAdmintax',$manufacturer);\n \n \n $this->load->view('general',$data);\n \n }\n }",
"public function tax(): float;",
"public function getCidTax()\n {\n return $this->cid_tax;\n }",
"public function getExternalTaxRate();",
"function wp_ajax_inline_save_tax()\n {\n }",
"public function getTaxTypeId()\n {\n return $this->getProduct()->getTaxTypeId();\n }",
"public function create_invoice_number()\n\t{\n\t\t//select product code\n\t\t$this->db->from('invoice');\n\t\t$this->db->where(\"invoice_number LIKE 'IOD-INV-\".date('y').\"-%'\");\n\t\t$this->db->select('MAX(invoice_number) AS number');\n\t\t$query = $this->db->get();\n\t\t$preffix = \"IODk/\";\n\t\t\n\t\tif($query->num_rows() > 0)\n\t\t{\n\t\t\t$result = $query->result();\n\t\t\t$number = $result[0]->number;\n\t\t\t$real_number = str_replace($preffix, \"\", $number);\n\t\t\t$real_number++;//go to the next number\n\t\t\t$number = $preffix.sprintf('%04d', $real_number);\n\t\t}\n\t\telse{//start generating receipt numbers\n\t\t\t$number = $preffix.sprintf('%04d', 1);\n\t\t}\n\t\t\n\t\treturn $number.'/'.date('Y');\n\t}",
"public function generatePurRefNo($outlet_id) {\n $transfer_count = $this->db->query(\"SELECT count(id) as transfer_count\n FROM tbl_transfer where outlet_id=$outlet_id\")->row('transfer_count');\n $ingredient_code = str_pad($transfer_count + 1, 6, '0', STR_PAD_LEFT);\n return $ingredient_code;\n }",
"public function setBaseTaxAmount($amount);",
"private function add_taxon($taxon_name)\n {\n $taxon = new \\eol_schema\\Taxon();\n $taxon->taxonID = md5($taxon_name);\n $taxon->scientificName = $taxon_name;\n if(!isset($this->taxon_ids[$taxon->taxonID])) {\n $this->archive_builder->write_object_to_file($taxon);\n $this->taxon_ids[$taxon->taxonID] = '';\n }\n return $taxon;\n }",
"public function getCustomerTaxvat();",
"public function collectTaxIds()\n {\n $this->collectTaxIds = true;\n\n return $this;\n }",
"function insertTaxInformation($tablename, $module)\n\t{\n\t\tglobal $adb, $log;\n\t\t$log->debug(\"Entering into insertTaxInformation($tablename, $module) method ...\");\n\t\t$tax_details = getAllTaxes();\n\n\t\t$tax_per = '';\n\t\t//Save the Product - tax relationship if corresponding tax check box is enabled\n\t\t//Delete the existing tax if any\n\t\tif($this->mode == 'edit')\n\t\t{\n\t\t\tfor($i=0;$i<count($tax_details);$i++)\n\t\t\t{\n\t\t\t\t$taxid = getTaxId($tax_details[$i]['taxname']);\n\t\t\t\t$sql = \"delete from ec_producttaxrel where productid=$this->id and taxid=$taxid\";\n\t\t\t\t$adb->query($sql);\n\t\t\t}\n\t\t}\n\t\tfor($i=0;$i<count($tax_details);$i++)\n\t\t{\n\t\t\t$tax_name = $tax_details[$i]['taxname'];\n\t\t\t$tax_checkname = $tax_details[$i]['taxname'].\"_check\";\n\t\t\tif($_REQUEST[$tax_checkname] == 'on' || $_REQUEST[$tax_checkname] == 1)\n\t\t\t{\n\t\t\t\t$taxid = getTaxId($tax_name);\n\t\t\t\t$tax_per = $_REQUEST[$tax_name];\n\t\t\t\tif($tax_per == '')\n\t\t\t\t{\n\t\t\t\t\t$log->debug(\"Tax selected but value not given so default value will be saved.\");\n\t\t\t\t\t$tax_per = getTaxPercentage($tax_name);\n\t\t\t\t}\n\n\t\t\t\t$log->debug(\"Going to save the Product - $tax_name tax relationship\");\n\n\t\t\t\t$query = \"insert into ec_producttaxrel values($this->id,$taxid,$tax_per)\";\n\t\t\t\t$adb->query($query);\n\t\t\t}\n\t\t}\n\n\t\t$log->debug(\"Exiting from insertTaxInformation($tablename, $module) method ...\");\n\t}",
"public function getTaxRate();",
"public function getLineTax()\n\t{\n\t\treturn $this->getKeyValue('line_tax'); \n\n\t}",
"public function getAlias()\n {\n return 'tax';\n }",
"public function setTaxAmount($amount) {\r\n $this->taxAmount = NumberDataTypeHelper::truncate(floatval($amount), 2);\r\n }",
"public function getDocumentProductTaxCod()\n {\n return (string) $this->document_product_tax_cod;\n }",
"public function getTaxRateKey();",
"function add_invoice_number_field() {\n\t\tif ( get_the_title() == \"Invoice\" ) {\n\t\t\techo '<p<label for=\"invoice_number\">Invoice Number:</label> <input type=\"text\" name=\"invoice_number\" id=\"invoice_number\" value=\"\" /></p>';\n\t\t}\n\t}",
"public function getTax()\n\t{\n\t\treturn $this->getKeyValue('Tax'); \n\n\t}",
"function getTaxPercenTax($id)\n\t{\n\n\n\t\t$query3=\"SELECT (ps.cgst+ps.sgst) as gst FROM `product` as p INNER JOIN product_variant as pv on pv.`ptdvar_id` = p.ptdvar_id INNER JOIN product_sub_category as ps on ps.pr_sub_id = pv.ptd_sub_catgry_id where p.product_id ='$id'\";\n\t $data3=$this->get_results( $query3 );\n\t\treturn $data3;\n\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 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 getBaseTaxRefunded();",
"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 }",
"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 getShippingTaxAmount();",
"public function getTaxCategoryId();",
"public function regenerateOrderNumber()\n {\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 calculate_tax($sub){\n\t//echo $sub;\n\treturn $sub * 0.12;\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}",
"function taxNumber($number, $dashes = false)\n {\n $dash = $dashes ? \"-\" : \"\";\n if (!preg_match(\"/^\\d{8}\".$dash.\"\\d\".$dash.\"\\d{2}$/\", $number)) {\n return false;\n }\n return Validate_HU::_checkCDV(substr($number, 0, 8));\n }",
"public function getTaxRefunded();",
"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 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 }",
"function tep_display_tax_value($value, $padding = TAX_DECIMAL_PLACES) {\n if (strpos($value, '.')) {\n $loop = true;\n while ($loop) {\n if (substr($value, -1) == '0') {\n $value = substr($value, 0, -1);\n } else {\n $loop = false;\n if (substr($value, -1) == '.') {\n $value = substr($value, 0, -1);\n }\n }\n }\n }\n\n if ($padding > 0) {\n if ($decimal_pos = strpos($value, '.')) {\n $decimals = strlen(substr($value, ($decimal_pos+1)));\n for ($i=$decimals; $i<$padding; $i++) {\n $value .= '0';\n }\n } else {\n $value .= '.';\n for ($i=0; $i<$padding; $i++) {\n $value .= '0';\n }\n }\n }\n\n return $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 setTaxClassId($taxClassId);",
"public function addTipid( $value){\n return $this->_add(3, $value);\n }",
"public function setTaxesAmount($newPurchase_taxesAmount)\n {\n if(!is_numeric($newPurchase_taxesAmount))\n {\n return \"The taxes amount has to be numeric\";\n }\n else\n {\n //Checking if taxes is empty\n if($newPurchase_taxesAmount == \"\")\n {\n return \"Please enter the taxes amount. It can not be empty.\";\n }\n else\n {\n //Checking if taxes amount is a positive number\n if($newPurchase_taxesAmount < PRICE_MIN)\n {\n return \"The taxes amount has to be a positive number\";\n }\n else\n {\n //Successful passed the validation\n \n $this->purchase_taxesAmount = number_format($newPurchase_taxesAmount, PRICE_PRECISION); \n return \"\";\n\n \n }\n }\n } \n }",
"function save_invoice_number_field( $cart_item_data, $product_id ) {\n\t\tif ( isset( $_REQUEST['invoice_number'] ) ) {\n\t\t\t$cart_item_data['invoice_number'] = $_REQUEST['invoice_number'];\n\t\t\t/* below statement make sure every add to cart action as unique line item */\n\t\t\t$cart_item_data['unique_key'] = md5( microtime() . rand() );\n\t\t}\n\n\t\treturn $cart_item_data;\n\t}",
"public function getBaseShippingTaxAmount();",
"function TaxInclusivePrice(){\n\t\tuser_error(\"to be completed\");\n\t}",
"public function getInvoiceNumber(): string\n {\n return sprintf('R-%1$02d%2$03d', $this->getInvoiceYear(), $this->id);\n }",
"public function getTaxAttribute(): float;",
"public function addTaxrate($taxrate)\n {\n if ((is_numeric($taxrate)) && ($taxrate > 0) && ($taxrate < 1)) {\n $this->_taxrate = $taxrate;\n }\n }",
"function taxCode18Plus($BillNo) {\n $CoID = $this->session->userdata('CoID') ;\n $WorkYear = $this->session->userdata('WorkYear');\n $sql = \"\n Select sum(TaxAmt) as TaxAmt,TaxCode,BillNo,sum(CGSTAmt) as CGST,sum(SGSTAmt) as SGST,sum(IGSTAmt) as IGST\n from SaleDetails\n where TaxCode not in ('G5','G12','G18')\n and BillNo = '$BillNo' \n and CoID = '$CoID'\n and WorkYear = '$WorkYear'\t\n group by TaxCode; \n \";\n $query = $this->db->query($sql);\n $result= $query->result();\n return $result;\n }",
"function generate_receipt_no()\n {\n return m_setting('evaluation.receipt_prefix') . date('dmyHis');\n }",
"public function addTax(AdjustmentDataInterface $tax)\n {\n $this->taxes[] = $tax;\n }",
"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 }",
"public function getBaseSubtotalInclTax();",
"public function tax()\n {\n return $this->hasOne('fooCart\\src\\Tax', 'tax_id', 'tax_id');\n }",
"function commission_taxes($order_id) {\n\n\tif ($order_id != null) {\n\t $this->order_id = $order_id;\n\t $parameters = array($this->order_id);\n\t} else {\n\t $parameters = null;\n\t}\n\n\tparent::collection(COMMISSION_TAXES_SQL_LOAD, $parameters, \"commission_tax\", \"order_tax_type_id\");\n }",
"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 getInvoiceNumber();",
"public function setBaseShippingTaxAmount($amount);",
"public function setTaxOrIdentityNumber(string $taxOrIdentityNumber)\n {\n $this->taxOrIdentityNumber = $taxOrIdentityNumber;\n\n return $this;\n }",
"public function getDiscountTaxCompensationAmount();"
]
| [
"0.6368742",
"0.63006693",
"0.62317514",
"0.60356444",
"0.6018563",
"0.5860802",
"0.5854007",
"0.57831675",
"0.57811046",
"0.57552147",
"0.5740884",
"0.56936586",
"0.56672853",
"0.56629574",
"0.5638237",
"0.56075764",
"0.5607098",
"0.55492336",
"0.5513666",
"0.55042285",
"0.55003464",
"0.5487154",
"0.5475282",
"0.54666543",
"0.54665816",
"0.5461061",
"0.54587275",
"0.5379378",
"0.5377823",
"0.5356312",
"0.5348861",
"0.5313213",
"0.5300901",
"0.52954143",
"0.52822787",
"0.5271498",
"0.52678365",
"0.5264041",
"0.52610993",
"0.5246345",
"0.5240729",
"0.52325857",
"0.52296996",
"0.5220239",
"0.51979584",
"0.51893",
"0.5186516",
"0.5177966",
"0.51744384",
"0.5164231",
"0.5146292",
"0.51369256",
"0.5135447",
"0.51346695",
"0.5119262",
"0.5110147",
"0.5107069",
"0.51010823",
"0.50877273",
"0.5076905",
"0.5073037",
"0.5072058",
"0.5057904",
"0.50507915",
"0.5043191",
"0.50303847",
"0.50281304",
"0.5017869",
"0.5017813",
"0.5005675",
"0.5000838",
"0.4997585",
"0.4995519",
"0.49916154",
"0.49827218",
"0.49710992",
"0.49644953",
"0.49627662",
"0.49607736",
"0.49550512",
"0.49520007",
"0.4950747",
"0.4941067",
"0.49366713",
"0.49208328",
"0.49107105",
"0.49101964",
"0.4904929",
"0.49006096",
"0.48958686",
"0.48945564",
"0.48813856",
"0.4877388",
"0.4875047",
"0.48690438",
"0.48592585",
"0.48556492",
"0.48513734",
"0.48476937",
"0.48471257",
"0.48436055"
]
| 0.0 | -1 |
Get Application Details By Seller | public function getApplicationDetailsBySeller (User $userEntity)
{
$bankData = array();
$accreditationApplication = $this->em->getRepository('YilinkerCoreBundle:AccreditationApplication')->findOneByUser($userEntity);
$bankAccounts = $this->em->getRepository("YilinkerCoreBundle:BankAccount")
->getEnabledBankAccounts($userEntity);
$accreditationApplicationStatus = 'Unaccredited';
if ($bankAccounts) {
foreach ($bankAccounts as $bankAccount) {
array_push($bankData, array (
"bankAccountId" => $bankAccount->getBankAccountId(),
"bankId" => $bankAccount->getBank()->getBankId(),
"bankName" => $bankAccount->getBank()->getBankName(),
"accountTitle" => $bankAccount->getAccountTitle(),
"accountName" => $bankAccount->getAccountName(),
"accountNumber" => $bankAccount->getAccountNumber(),
"isDefault" => $bankAccount->getIsDefault(),
));
}
}
$legalDocuments = array();
$legalDocumentEntity = null;
$remarks = null;
if ($accreditationApplication) {
$legalDocumentEntity = $this->em->getRepository('YilinkerCoreBundle:LegalDocument')
->findByAccreditationApplication($accreditationApplication->getAccreditationApplicationId());
if ($accreditationApplication->getAccreditationApplicationId() !== null && $accreditationApplication->getAccreditationLevel() !== null) {
$accreditationApplicationStatus = 'Accredited';
}
else if ($accreditationApplication->getAccreditationApplicationId() !== null && $accreditationApplication->getAccreditationLevel() === null) {
$accreditationApplicationStatus = 'Waiting for accreditation';
}
}
if ($legalDocumentEntity) {
foreach($legalDocumentEntity as $legalDocument) {
$remarkType = 0;
$legalDocumentType = (int) $legalDocument->getLegalDocumentType()->getLegalDocumentTypeId();
if ($legalDocumentType == LegalDocumentType::TYPE_BIR_PERMIT ) {
$remarkType = ApplicationRemarkType::TYPE_FILE_BIR_PERMIT;
}
else if ($legalDocumentType == LegalDocumentType::TYPE_MAYORS_PERMIT ) {
$remarkType = ApplicationRemarkType::TYPE_FILE_MAYORS_PERMIT;
}
else if ($legalDocumentType == LegalDocumentType::TYPE_DTI_SEC_PERMIT ) {
$remarkType = ApplicationRemarkType::TYPE_FILE_DTI_SEC_PERMIT;
}
else if ($legalDocumentType == LegalDocumentType::TYPE_FORM_M11501 ) {
$remarkType = ApplicationRemarkType::TYPE_FILE_FORM;
}
else if ($legalDocumentType == LegalDocumentType::TYPE_OTHERS ) {
$remarkType = ApplicationRemarkType::TYPE_FILE_OTHER;
}
else if ($legalDocumentType == LegalDocumentType::TYPE_SSS ) {
$remarkType = ApplicationRemarkType::TYPE_FILE_SSS;
}
else if ($legalDocumentType == LegalDocumentType::TYPE_PAG_IBIG ) {
$remarkType = ApplicationRemarkType::TYPE_FILE_PAG_IBIG;
}
else if ($legalDocumentType == LegalDocumentType::TYPE_POSTAL ) {
$remarkType = ApplicationRemarkType::TYPE_FILE_POSTAL;
}
else if ($legalDocumentType == LegalDocumentType::TYPE_PASSPORT ) {
$remarkType = ApplicationRemarkType::TYPE_FILE_PASSPORT;
}
else if ($legalDocumentType == LegalDocumentType::TYPE_DRIVERS_LICENSE ) {
$remarkType = ApplicationRemarkType::TYPE_FILE_DRIVERS_LICENSE;
}
else if ($legalDocumentType == LegalDocumentType::TYPE_PRC ) {
$remarkType = ApplicationRemarkType::TYPE_FILE_PRC;
}
else if ($legalDocumentType == LegalDocumentType::TYPE_VOTERS_ID ) {
$remarkType = ApplicationRemarkType::TYPE_FILE_VOTERS_ID;
}
else if ($legalDocumentType == LegalDocumentType::TYPE_SCHOOL_ID ) {
$remarkType = ApplicationRemarkType::TYPE_FILE_SCHOOL_ID;
}
else if ($legalDocumentType == LegalDocumentType::TYPE_TIN ) {
$remarkType = ApplicationRemarkType::TYPE_FILE_TIN;
}
else if ($legalDocumentType == LegalDocumentType::TYPE_VALID_ID) {
$remarkType = ApplicationRemarkType::TYPE_VALID_ID;
}
$legalDocuments[] = array(
'entity' => $legalDocument,
'remarkTypeId' => $remarkType
);
}
}
$socialMediaAccounts = $this->em->getRepository('YilinkerCoreBundle:UserSocialMediaAccount')->getUserSocialMediaAccounts($userEntity);
$storeEntity = $this->em->getRepository('YilinkerCoreBundle:Store')->findOneByUser($userEntity);
$userAddresses = $this->addressService->getUserAddresses($userEntity);
$remarkArray = array();
if ($accreditationApplication) {
$remarks = $this->em->getRepository('YilinkerCoreBundle:ApplicationRemark')->findByAccreditationApplication($accreditationApplication);
if (sizeof($remarks) > 0) {
foreach ($remarks as $remark) {
$remarkType = $remark->getApplicationRemarkType()->getApplicationRemarkTypeId();
$remarkArray[$remarkType][] = $remark;
}
}
}
$progress = $this->getApplicationCompletionPercentage($accreditationApplication, $legalDocumentEntity);
$editableApplication = $this->getEditableApplication($accreditationApplication, $legalDocumentEntity);
$isLegalDocsEditable = $this->isLegalDocumentEditable($legalDocumentEntity);
$userOccupation = $this->em->getRepository('YilinkerCoreBundle:UserOccupation')->findOneByUser($userEntity);
$storeCategory = $this->storeCategoryService->getCategoryWithSelectedStoreCategory($storeEntity);
return compact (
'bankData',
'legalDocuments',
'socialMediaAccounts',
'storeEntity',
'accreditationApplication',
'userEntity',
'userAddresses',
'remarks',
'remarkArray',
'progress',
'editableApplication',
'isLegalDocsEditable',
'accreditationApplicationStatus',
'userOccupation',
'storeCategory'
);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function getSeller($params = array()){\n\t\tMpApi::sleep(); \n\t\treturn json_decode($this->callCurl(MpApi::GET , '/multivendor/seller/id/'.(int)$params['id'].'.json'),true);\n\t}",
"public function index()\n {\n return SellerApplication::all();\n }",
"function getApplicationDetails($appId) {\n $query = \"SELECT UPPER(pnf.name) as fname, UPPER(pns.name) as sname,a.date_of_birth as dob,s.app_ref_no from applications a\n inner join sectionx s ON a.application_id = s.application_id\n inner join app_person_name apnf on a.application_id = apnf.application_id\n inner join person_names pnf on apnf.name_id = pnf.name_id and pnf.name_type_id = 4\n inner join app_person_name apns on a.application_id = apns.application_id\n inner join person_names pns on apns.name_id = pns.name_id and pns.name_type_id = 3 \n WHERE a.application_id = '$appId'\";\n $res = $this->getDBRecords($query);\n\n $arrRes['fname'] = $res[0][\"fname\"];\n $arrRes['sname'] = $res[0][\"sname\"];\n $arrRes['dob'] = $this->getFormatedDate($res[0][\"dob\"], $format = 3);\n $arrRes['app_ref_no'] = $res[0][\"app_ref_no\"];\n\n return $arrRes;\n }",
"function getAppDetails($procode) {\n $strQuery = \"select * from `irb-application` where ApplicationID = $procode\";\n\n return $this->query($strQuery);\n }",
"public function getSellerOffers($sellerId);",
"public function show(seller $seller)\n {\n //\n }",
"public function GeteBayDetails() {\r\n $verb = 'GeteBayDetails';\r\n $requestxml = '<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n\t\t\t<GeteBayDetailsRequest xmlns=\"urn:ebay:apis:eBLBaseComponents\">\r\n\t\t <RequesterCredentials>\r\n <eBayAuthToken>' . $this->token . '</eBayAuthToken> \r\n </RequesterCredentials>\r\n\t\t\t</GeteBayDetailsRequest>';\r\n $session = new eBaySession('', $this->devID, $this->appID, $this->certID, $this->serverUrl, $this->compatabilityLevel, $this->siteID, $verb);\r\n $responseXml = $session->sendHttpRequest($requestxml);\r\n return XML_unserialize($responseXml);\r\n }",
"public function getAnApplicant($application_id);",
"public function index()\n {\n $sellers = Seller::all();\n\n return $this->showAll($sellers);\n }",
"public function getSeller()\n {\n return $this->seller;\n }",
"public function getSellerId()\n {\n return $this->driver->seller_id;\n }",
"public function show(Seller $seller)\n {\n return $seller;\n }",
"public function fetchSellerProfileBySellerId()\r\n {\r\n if (isset($_GET['sellerID'])) {\r\n $sellerID = $_GET['sellerID'];\r\n } else {\r\n WebservicesellersController::echoError(\"bad_parameter\");\r\n return;\r\n }\r\n\r\n $sellerProfile = WebservicesellersModel::fetch_sellerProfile_by_userAccountSellerId($sellerID);\r\n\r\n $downloadIp = null;\r\n $downloadFolderSellerImage = null;\r\n $settings = WebservicesellersModel::fetchs_settings();\r\n for ($i = 0; $i < count($settings); $i++) {\r\n if ($settings[$i]['Name_Sig'] == 'Download_Ip') {\r\n $downloadIp = $settings[$i]['Value_Sig'];\r\n } else if ($settings[$i]['Name_Sig'] == 'Download_Folder_Seller') {\r\n $downloadFolderSellerImage = $settings[$i]['Value_Sig'];\r\n }\r\n }\r\n\r\n $arrayData['sellerProfile'] = $sellerProfile;\r\n $arrayData['imgSellerImageUrl'] = $downloadIp . $downloadFolderSellerImage;\r\n\r\n if ($sellerProfile != null) {\r\n $arraySend['Status'] = \"100\";\r\n $arraySend['Status_Str'] = \"OK\";\r\n $arraySend['Data'] = $arrayData;\r\n $arraySend['MSG'] = \"OK\";\r\n } else {\r\n $arraySend['Status'] = \"101\";\r\n $arraySend['Status_Str'] = \"No\";\r\n $arraySend['MSG'] = \"There is no seller with this ID.\";\r\n }\r\n\r\n echo json_encode($arraySend);\r\n }",
"public function show(Seller $seller/*$id*/)\n {\n /*$vendedore = Seller::has('products')->findOrFail($id);\n\n return response()->json(['data'=>$vendedore], 200);*/\n\n return $this->showOne($seller);\n }",
"public function show(Seller $seller)\n {\n return $this->showOne($seller);\n\n }",
"function getSellerProducts($params = array()){\n\t\tMpApi::sleep(); \n\t\treturn json_decode($this->callCurl(MpApi::GET , '/multivendor/seller/'.(int)$params['seller_id'].'/product.json',$params),true);\n\t}",
"public function getSellerId()\n {\n return $this->seller_id;\n }",
"public function getSellerId()\n {\n return $this->_fields['SellerId']['FieldValue'];\n }",
"public function getSellerName()\n {\n return $this->seller_name;\n }",
"public function index(Seller $seller)\n {\n $product = $seller->products;\n return $this->showAll($product);\n }",
"public static function getSellerItems(Request $request)\n {\n $seller=Auth::user();\n $items=Product::where('seller_id',$seller->id)->get();\n if($items){\n return response(['error'=>false,'items'=>$items],200);\n }\n else{\n return response(['error'=>true,'message'=>'no item found'],200);\n }\n }",
"public function getSellerProfile() {\n return $this->scopeConfig->getValue ( static::XML_SELLER_PROFILE, ScopeInterface::SCOPE_STORE );\n }",
"public function index(Seller $seller)\n {\n //\n $products=$seller->products;\n return $this->showAll($products);\n\n }",
"public function actionIndex() {\n $searchModel = new SellerSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function getApplication();",
"public function getApplication();",
"public function getApplication();",
"public function getApplication();",
"public function getApplication();",
"public function getSellerID()\n {\n return $this->sellerID;\n }",
"public function getOffer($productId, $sellerId);",
"public function getOfferSellerId()\n {\n return $this->offer_seller_id;\n }",
"public function retrieveApplication($applicationId = NULL)\n {\n return $this->start()->uri(\"/api/application\")\n ->urlSegment($applicationId)\n ->get()\n ->go();\n }",
"public function getSeller()\n {\n return Seller::createFromConfiguration($this->paymentAdapter->getConfiguration());\n }",
"function getSellerOrders($params = array()){\n\t\tMpApi::sleep(); \n\t\treturn json_decode($this->callCurl(MpApi::GET , '/multivendor/seller/'.(int)$params['seller_id'].'/orders.json',$params),true);\n\t}",
"public function getstudentInfoByApplicationId($id) {\n $this->db->select('stu.*,stu_info.*,p.*');\n $this->db->from('studentinfo stu_info');\n $this->db->join('student stu', 'stu.applicationId=stu_info.applicationId');\n $this->db->join('programoffer p', 'p.programOfferId=stu.programOfferId');\n $this->db->where('stu_info.applicationId', $id);\n\n $query = $this->db->get();\n $result = $query->row_array();\n if (!empty($result)) {\n return $result;\n }\n }",
"public function getApplication( $id )\n\t{\t\n\t}",
"public function viewapplicantInfo($applicationid) {\n\n $this->db->select('apd.*,stu_info.*,p.*');\n $this->db->from('studentinfo stu_info');\n $this->db->join('admissionapplicant apd', 'stu_info.applicationId=apd.applicationId');\n $this->db->join('programoffer p', 'p.programOfferId=apd.programOfferId');\n $this->db->where('stu_info.applicationId', $applicationid);\n\n $query = $this->db->get();\n $result = $query->row_array();\n if (!empty($result)) {\n return $result;\n }\n }",
"public function sellers(){\n\t\t\t$sql = \"SELECT\t`user`\t\t\t\t\t\t\t\tAS 'seller',\n\t\t\t\t\t\t\tCONCAT(`name`, ' ', `lastName`)\t\tAS 'seller'\n\t\t\t\t\tFROM `_users`\n\t\t\t\t\tORDER BY `name`\";\n\t\t\treturn $this->asHash( $sql );\n\t\t}",
"public function index()\n {\n $sellers = Seller::all();\n return view(\"sellers.index\", compact('sellers'));\n }",
"public function getSellerInfo($productId) {\n $sellerInfo = array ();\n $i = 0;\n $collection = $this->getComparePrice ( $productId );\n \n foreach ( $collection as $_collection ) {\n $sellerId = $_collection->getSellerId ();\n if ($sellerId > 0) {\n $sellerInfo [$i] = Mage::getModel ( static::LOGIN_FUNCTIONS )->sellerdisplay ( $sellerId, '0', $storeId, $_collection->getId () );\n }\n $i ++;\n if ($i == count ( $collection )) {\n continue;\n }\n }\n return $sellerInfo;\n }",
"public function index()\n {\n\n $sellers = Seller::all();\n\n return view('sellers.index', compact('sellers'));\n }",
"public function isSeller() {\n $response = array (\n 'is_seller' => 1,\n 'msg' => '',\n 'redirect' => '' \n );\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance ();\n $customerSession = $objectManager->get ( 'Magento\\Customer\\Model\\Session' );\n if (! $customerSession->isLoggedIn ()) {\n $response = array (\n 'is_seller' => 0,\n 'msg' => 'You must have a Seller Account to access this page',\n 'redirect' => 'marketplace/seller/login' \n );\n } else {\n $customerGroupSession = $objectManager->get ( 'Magento\\Customer\\Model\\Group' );\n $customerGroupData = $customerGroupSession->load ( 'Marketplace Seller', 'customer_group_code' );\n $sellerGroupId = $customerGroupData->getId ();\n \n $currentCustomerGroupId = $customerSession->getCustomerGroupId ();\n \n if ($currentCustomerGroupId != $sellerGroupId) {\n $response = array (\n 'is_seller' => 0,\n 'msg' => 'Admin Approval is required. Please wait until admin confirms your Seller Account',\n 'redirect' => 'marketplace/seller/changebuyer' \n );\n }\n }\n return $response;\n }",
"function getApplication();",
"public abstract function getApplication();",
"function get_purchase_details($iApplicationId)\n\t{\n\t\t$this->db->select('*');\n\t\t$this->db->from('r_appinformation');\n $this->db->where('iApplicationId',$iApplicationId);\n $query = $this->db->get();\n return $query->row_array();\n\t}",
"public function getSellerResource()\n {\n return new SellerResource($this->paymentAdapter->getConfiguration(), new Curl());\n }",
"public function getApp();",
"public function getAppId();",
"public function getSource()\n {\n return 'seller';\n }",
"public function getOwnerApp();",
"function viewAppDetails($username)\n\t {\n\t $data=array();\n\t\t$this->db->from('appraisal');\n\t\t$this->db->where('cons_name',$username);\n\t\t$Q = $this->db->get();\n\t\t if ($Q->num_rows() > 0){\n\t foreach ($Q->result_array() as $row)\n\t\t {\n\t $data=$row;\n\t }\n\t }\n\t $Q->free_result(); \n\t return $data; \n\t\t }",
"public function getsellerprofile($sellerid) {\n if(empty($sellerid) || !isset($sellerid) || $sellerid == \"\"){\n\t\t throw new InputException(__('Id required'));\n\t\t}\n\t\telse{\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$tableName = $resource->getTableName('employee'); //gives table name with prefix\n\t\t\n\t\t$result['code']=1;\n\t\treturn $result; \n\t\t \n }\n\t }",
"public function getAppInfo($what)\n {\n $shop = $this->getShop();\n $context = Shopware()->Container()->get('shopware_storefront.context_service')->getShopContext();\n $shopData = $this->get('shopware.benchmark_bundle.providers.shopware')->getBenchmarkData($context);\n\n $data = array();\n $data['version'] = $this->apiVersion;\n $data['type'] = $what;\n $data['application'] = [];\n $data['application']['type'] = \"shopware\";\n $shopEmail = Shopware()->Db()->fetchOne(\"SELECT cv.value\n FROM `s_core_config_elements` ce LEFT JOIN `s_core_config_values` cv\n ON ce.id=cv.element_id\n WHERE ce.label LIKE '%Shopbetreiber%'\n AND ce.`name` = 'mail'\");\n $data['application']['contact'] = unserialize($shopEmail);\n $select = Shopware()->Db()->select()->from(\n 's_core_shops',\n ['id', 'title', 'name', 'host', 'secure']\n )->where(\"id=?\", $shop->getId());\n $row = Shopware()->Db()->fetchRow($select);\n $data['application']['name'] = $row['title'] != '' ? $row['title'] : $row['name'];\n $data['application']['edition'] = $shopData['licence'];\n $data['application']['version'] = str_replace('-', '', $shopData['version']);\n $data['application']['build'] = $shopData['revision'];\n $proto = $row['secure'] ? \"https://\" : \"http://\";\n $data['application']['url'] = $proto . $row['host'];\n\n $data['infrastructure'] = [];\n $data['infrastructure']['platform'] = 'PHP ' . phpversion();\n // $data['infrastructure']['platform_info'] = $this->phpinfo2array();\n $data['infrastructure']['os'] = $shopData['os'] . \" \" . $shopData['arch'] . \" \" . $shopData['dist'] . \" \";\n $data['infrastructure']['db'] = \"MySQL \" . $shopData['mysqlVersion'];\n $data['infrastructure']['web'] = $shopData['serverSoftware'];\n\n return $data;\n }",
"public function getAccountDetails(){\n\t\t$url = \"/account/details/\";\n\t\t$method='get';\n\t\treturn $this->request($url , $method);\n\t}",
"public function retrieveApplications()\n {\n return $this->start()->uri(\"/api/application\")\n ->get()\n ->go();\n }",
"function getSellerCount($params = array()){\n\t\tMpApi::sleep(); \n\t\treturn json_decode($this->callCurl(MpApi::GET , '/multivendor/seller/count.json' , $params ),true);\n\t}",
"function getAppDetails($id)\n\t {\n\t $data=array();\n\t\t$this->db->from('appraisal');\n\t\t$this->db->where('id',$id);\n\t\t$Q = $this->db->get();\n\t\t if ($Q->num_rows() > 0){\n\t foreach ($Q->result_array() as $row)\n\t\t {\n\t $data=$row;\n\t }\n\t }\n\t $Q->free_result(); \n\t return $data; \n\t\t }",
"public function getProductSeller()\n {\n $product = $this->coreRegistry->registry('product');\n $productId = $product->getId();\n $sellerId = $this->helper->getSellerIdByProductId($productId);\n return $sellerId;\n }",
"function getSellerName($sellerId){\n\t\t//$row = mysql_fetch_array($result);\n\t\treturn \"\";\n\t}",
"public function getApplicationIdByprogramofferId($id) {\n $this->db->select('ad_app.*,stu_info.*,prg.*');\n $this->db->from('admissionapplicant ad_app');\n $this->db->join('programoffer prg', 'prg.programOfferId=ad_app.programOfferId');\n $this->db->join('studentinfo stu_info', 'stu_info.applicationId=ad_app.applicationId');\n $this->db->where('ad_app.programOfferId', $id);\n $this->db->order_by('stu_info.applicationId', 'ASC');\n $query = $this->db->get();\n $result = $query->result_array();\n if (!empty($result)) {\n return $result;\n }\n }",
"public function getSellerApproval() {\n return $this->scopeConfig->getValue ( static::XML_SELLER_APPROVAL, ScopeInterface::SCOPE_STORE );\n }",
"function getAllApplications()\r\n {\r\n //Connect to the DB, build query\r\n $db = db_connect();\r\n $sql = \"SELECT * FROM account WHERE role = :role: ORDER BY accountID DESC\";\r\n\r\n //Send query then store the results\r\n $results = $db->query($sql, [\r\n 'role' => 0\r\n ]);\r\n return $results;\r\n }",
"function getshop($shopname) {\n\t\n\t$url = 'https://openapi.etsy.com/v2/shops/?shop_name='.$shopname .'&api_key=' . $apikey;\n\t\n\treturn execCurl ($url);\n\t//num_favorers\n\t\n}",
"public function get_top_sellers2()\n\t{\n\t\t$this->db->select('vendor.vendor_id, vendor.vendor_store_name')->from('vendor')->where(\"vendor.vendor_status = 1\")->order_by(\"vendor_store_name\", 'ASC');\n\t\t$query = $this->db->get('',10);\n\t\t\n\t\treturn $query;\n\t}",
"public function buyer_get(): void\n {\n $vendor = $this->vendorAuthentication();\n\n if (is_null($vendor)) return;\n\n $email = $this->input->get('email', true);\n\n if (empty($email)) {\n $response = Connections_helper::getFailedResponse(Error_messages_helper::$ERR_BUYER_EMAIL_NOT_SET);\n $this->response($response, 200);\n return;\n }\n\n if (!Validate_data_helper::validateEmail($email)) {\n $response = Connections_helper::getFailedResponse(Error_messages_helper::$INVALID_BUYER_EMAIL);\n $this->response($response, 200);\n return;\n }\n\n $this\n ->user_model\n ->setUniqueValue($email)\n ->setWhereCondtition()\n ->setUser();\n\n if (is_null($this->user_model->id)) {\n $response = Connections_helper::getFailedResponse(Error_messages_helper::$BUYER_NOT_EXISTS);\n $this->response($response, 200);\n return;\n }\n\n $response = [\n 'status' => Connections_helper::$SUCCESS_STATUS,\n 'data' => [\n 'buyer' => [\n 'email' => $this->user_model->email,\n 'firstName' => $this->user_model->first_name,\n 'secondName' => $this->user_model->second_name,\n 'mobile' => $this->user_model->mobile,\n 'address' => $this->user_model->address,\n 'addressAdditionalLine' => $this->user_model->addressa,\n 'zipcode' => $this->user_model->zipcode,\n 'city' => $this->user_model->city,\n 'country' => $this->user_model->country,\n 'requireNewsletter' => $this->user_model->newsletter,\n 'apiIdentifier' => $this->user_model->getApiIdentifier(),\n ]\n ]\n ];\n\n // get user extended\n $user = $this->userex_model->setProperty('userId', $this->user_model->id)->getUserEx();\n if ($user) {\n unset($user['id']);\n unset($user['userId']);\n $response['data']['buyer']['buyerExtended'] = $user;\n }\n\n $this->response($response, 200);\n return;\n }",
"public function getOfferByShop(Request $request){\n // check params \n if(!$this->requiredParams($request, ['key','shop_id'])){\n return response()->json(['status' => 'error' , 'message' => 'missing params' ] , 400);\n }\n\n $key = $this->checkParam($request->key);\n if ($key !== self::KEY) {\n return response()->json(['status' => 'error' , 'message' => 'invalid request' ] , 400);\n }\n\n $shop_id = $this->checkParam($request->shop_id);\n\n $offers = Offer::where('shop_id',$shop_id)->where('active','1')->orderBy('created_at', 'DESC')->get();\n\n return response()->json(['status' => 'success' , 'message' => 'OK', 'data' => $offers] , 200);\n\n }",
"public function getSaleInfoForApp($sale){\n $saleInfo = array(\n 'saleId'=>$sale->saleId,\n 'name'=>$sale->name,\n 'rebate'=>0,\n 'thumbnail'=>CyImgUtil::getImgUrl($sale->thumbnailKey),\n 'startTime'=>$sale->startTime,\n 'endTime'=>$sale->endTime,\n );\n $saleInfo['isNeedLogin'] = false;\n $assistSale = $this->getAssistSale($sale->saleId);\n if(empty($assistSale)){\n $saleInfo['img'] = null;\n }else{\n $saleInfo['img'] = CyImgUtil::getImgUrl($assistSale->thumbImg);\n }\n $summarys = SaleService::getInstance()->getSaleSummary($sale->saleId);\n $saleInfo['summary'] = $summarys[array_rand($summarys)]['summary'];\n $saleInfo['type'] = '组团活动';\n return $saleInfo; \n }",
"public function bestSeller()\n {\n return $this->db->get('game', 3)->result();\n }",
"public function get_orders_user($seller)\n\t{\n\t\t$conn = $this->inv_conn();\n\t\t$qry_all = \"SELECT `ord_id`,`ord_ref_item`,`ord_quant`,`buyer_nm`,`buyer_add`, `buyer_apt`, `ord_city`, `ord_zip`, `ord_state`,`ord_country`,`ord_date`,`ord_observ`,`seller`,`ord_track`\n\t\t\t\t\tFROM `order` WHERE `seller` = '$seller'\";\n\t\t$result = mysqli_query($conn, $qry_all);\n\t\tmysqli_close($conn);\n\t\treturn $result;\n\n\t}",
"public function findApplicationModel($appId) {\n\t\t$applicationModelFinder = CActiveRecord::model($this->getApplicationModelClassName());\n\n\t\treturn $applicationModelFinder->findByPk($appId, $this->getApplicationFindCondition());\n\t}",
"public function getTopRatedSeller()\n {\n return $this->topRatedSeller;\n }",
"function get_appwise_listcatalogue($iCatalogueMainId,$iApplicationId,$iAppTabId){\n $this->db->select('');\n $this->db->from('r_app_catalogue_details');\n $this->db->where('iCatalogueMainId',$iCatalogueMainId);\n $this->db->where('iApplicationId',$iApplicationId);\n $this->db->where('iAppTabId',$iAppTabId);\n $this->db->where('eStatus','Active');\n $this->db->order_by('iCatalogueMainId', 'DESC');\n $query = $this->db->get();\n return $query->result_array(); \n }",
"public function index(Seller $seller)\n {\n $products = $seller->products;\n\n return $this->showAll($products);\n }",
"public function index(Seller $seller)\n {\n $products = $seller->products;\n\n return $this->showAll($products);\n }",
"public function show(Application $application)\n {\n // return new ApplicationResource($application);\n $rel = ['general','loan_detail', 'employment','previous_employment','financial', 'coapplicant', 'previous_address', 'home_own', 'files', 'about_equipment'];\n // return new ApplicationDetailsResource($application);\n return new ApplicationResource($application);\n }",
"public function getSellerContact()\n {\n return $this->sellerContact;\n }",
"function fetchManufacturer($Hersteller)\r\n\t{\r\n\t\t$sql = $GLOBALS['db']->Query(\"SELECT Name FROM \" . PREFIX . \"_modul_shop_hersteller WHERE Id = '$Hersteller' LIMIT 1\");\r\n\t\t$row = $sql->fetchrow();\r\n\t\t$sql->close();\r\n\t\treturn @$row->Name;\r\n\t}",
"public function getSellerQuicklink()\n {\n return $this->seller_quicklink;\n }",
"public function getApplication(string $application, array $response = []): array\n {\n $uri = 'applications/{application}';\n $uriArguments = [\n 'application' => $application,\n ];\n\n return $this->client->get($this->buildUrl($uri, $uriArguments), $response);\n }",
"function sellerproduct($sellerid) {\n $sellerproduct = Mage::getModel ( static::CAT_PRO )->getCollection ()->addFieldToFilter ( static::SELLER_ID, $sellerid );\n return $sellerproduct->getData ();\n }",
"public function getOGApplicationID();",
"public function getAppId()\n {\n }",
"public function merchant()\n {\n $this->setHeader(self::HEADER_TYPE_BEARER);\n $link = Rakuten::BASE_API_URL.'/'.self::API_NAME_ADVERTISER_SEARCH.'/'.self::API_VERSION;\n\n\n $curl = new Curl;\n $response = $curl->get($link, '', $this->getHeader());\n\n $xmlData = new SimpleXMLElement(XMLHelper::tidy($response));\n\n return $xmlData;\n }",
"public function getSellerSupplierParty()\n {\n return $this->sellerSupplierParty;\n }",
"public function seller()\n {\n return $this->belongsTo(SellerProxy::modelClass(), 'seller_id');\n }",
"public function getDistriSellerName()\n {\n return $this->distri_seller_name;\n }",
"public function getPayerInfo()\n {\n return $this->payer_info;\n }",
"function createSeller($params = array()){\n\t\t\n\t\t//echo json_encode($params['data']); die();\n\t\tMpApi::sleep(); \n\t\treturn json_decode($this->callCurl(MpApi::POST , '/multivendor/seller/seller.json' , false, $params['data'] ),true);\n\t}",
"public function getApplication($applicationId)\n {\n return $this->request(array('apps', $applicationId));\n }",
"public function get_seller_info($get_banks = 1) {\r\n $data = array(\r\n 'business' => '[email protected]',\r\n );\r\n $call_API = $this->call_restfull->call_API(\"GET\", $data, $this->api_seller_info, $this->getConfigData);\r\n if (is_array($call_API)) {\r\n if (isset($call_API['error'])) {\r\n return \"<strong style='color:red'>call_API\" . json_encode($call_API['error']) . \"- code:\" . $call_API['status'] . \"</strong> - \" . \"System error. Please contact to administrator\";\r\n }\r\n }\r\n\r\n $seller_info = json_decode($call_API, true);\r\n if (!empty($seller_info['error'])) {\r\n return \"<strong style='color:red'>seller_info\" . json_encode($seller_info['error']) . \"</strong> - \" . \"System error. Please contact to administrator\";\r\n }\r\n\r\n if ($get_banks == 1) {\r\n return $seller_info['bank_payment_methods'];\r\n } else {\r\n return $seller_info;\r\n }\r\n\r\n }",
"public function getSellerSKU() \n {\n return $this->_fields['SellerSKU']['FieldValue'];\n }",
"public function index()\n {\n return ApplicationResource::collection(auth()->user()->applications);\n }",
"public function get_name_application(){\n\t\treturn $this->search_application;\n\t}",
"public function getSellerField()\n {\n $sellerId = $this->getProductSeller();\n return [\n 'arguments' => [\n 'data' => [\n 'config' => [\n 'label' => __('Select Seller'),\n 'componentType' => Field::NAME,\n 'formElement' => Select::NAME,\n 'dataScope' => 'seller_id',\n 'dataType' => Text::NAME,\n 'sortOrder' => 10,\n 'options' => $this->helper->getSellerList(),\n 'value' => $sellerId,\n 'disabled' => $sellerId ? true : false\n ],\n ],\n ],\n ];\n }",
"public function getReseller(): string {\n return $this->context->reseller;\n }",
"public function getApplicantInfoById($id) {\n $this->db->select('*');\n $this->db->where('stuinfo_id', $id);\n $qu = $this->db->get($this->_studentinfo);\n $result = $qu->row_array();\n return $result;\n }",
"public function getAppId(): string;",
"public function retrieveOfferData() {\n\t\t\tif (!$this->availableOffers) {\n\t\t\t\t// affiliate has to be logged in\n\t\t\t\tif ($this->affiliateID) {\n\t\t\t\t\t### IMPLEMENT AFFILIATE EXCLUSIVE OFFERS ###\n\t\t\t\t\t$result = $this->dbh->query(\"SELECT * \n\t\t\t\t\t\t\t\t\t\t\t\t\tFROM `offers` \n\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE `availability` IN ('affiliate', 'all') \n\t\t\t\t\t\t\t\t\t\t\t\t\tAND `startDate` <= NOW() \n\t\t\t\t\t\t\t\t\t\t\t\t\tAND `endDate` > NOW()\");\n\t\t\t\t\tif ($result->rowCount) {\n\t\t\t\t\t\t$this->availableOffers = array();\n\t\t\t\t\t\twhile ($row = $result->fetchAssoc()) {\n\t\t\t\t\t\t\t$this->availableOffers[] = $row;\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}",
"public function getApplicationKey(){\n\n $store = Mage::app()->getStore();\n\n $accessKey = $this->getStoreAccessKey($store->getId());\n return $accessKey;\n }"
]
| [
"0.6527388",
"0.64844626",
"0.607165",
"0.60164547",
"0.6014531",
"0.6002973",
"0.587345",
"0.58339006",
"0.581403",
"0.58088577",
"0.57961994",
"0.578939",
"0.5737721",
"0.5696109",
"0.56603",
"0.5610015",
"0.560216",
"0.55972004",
"0.5586915",
"0.55266213",
"0.55155265",
"0.5512779",
"0.55026174",
"0.5492273",
"0.5492191",
"0.5492191",
"0.5492191",
"0.5492191",
"0.5492191",
"0.54746866",
"0.5466702",
"0.5445606",
"0.544076",
"0.5429944",
"0.53932226",
"0.53590316",
"0.5345697",
"0.5340886",
"0.5320945",
"0.53030604",
"0.5291974",
"0.52750885",
"0.52723575",
"0.5267522",
"0.52406365",
"0.52266395",
"0.522385",
"0.5214775",
"0.5208685",
"0.52031624",
"0.5199699",
"0.5199351",
"0.51851445",
"0.5183935",
"0.5178979",
"0.51653993",
"0.51579654",
"0.5152547",
"0.51512617",
"0.5143188",
"0.5137445",
"0.5136105",
"0.512689",
"0.51158404",
"0.51147854",
"0.5113827",
"0.51070046",
"0.51047796",
"0.5101458",
"0.5101229",
"0.5096273",
"0.50958514",
"0.50861186",
"0.5084008",
"0.5084008",
"0.5081083",
"0.50804144",
"0.50788105",
"0.50743556",
"0.5072031",
"0.5067731",
"0.506293",
"0.5056853",
"0.5043079",
"0.5041903",
"0.50354826",
"0.50347984",
"0.5034478",
"0.50296545",
"0.5027441",
"0.5025962",
"0.5011262",
"0.5010839",
"0.5010125",
"0.499948",
"0.49990198",
"0.4986057",
"0.4985669",
"0.49810892",
"0.49735188"
]
| 0.6076234 | 2 |
Get Legal Document Type By RemarkTypeId | public function getLegalDocumentTypeByRemarkId ($remarkTypeId)
{
$legalDocumentType = 0;
if ($remarkTypeId == ApplicationRemarkType::TYPE_FILE_BIR_PERMIT ) {
$legalDocumentType = LegalDocumentType::TYPE_BIR_PERMIT;
}
else if ($remarkTypeId == ApplicationRemarkType::TYPE_FILE_MAYORS_PERMIT ) {
$legalDocumentType = LegalDocumentType::TYPE_MAYORS_PERMIT;
}
else if ($remarkTypeId == ApplicationRemarkType::TYPE_FILE_DTI_SEC_PERMIT) {
$legalDocumentType = LegalDocumentType::TYPE_DTI_SEC_PERMIT;
}
else if ($remarkTypeId == ApplicationRemarkType::TYPE_FILE_FORM) {
$legalDocumentType = LegalDocumentType::TYPE_FORM_M11501;
}
else if ($remarkTypeId == ApplicationRemarkType::TYPE_FILE_SSS) {
$legalDocumentType = LegalDocumentType::TYPE_SSS;
}
else if ($remarkTypeId == ApplicationRemarkType::TYPE_FILE_PAG_IBIG) {
$legalDocumentType = LegalDocumentType::TYPE_PAG_IBIG;
}
else if ($remarkTypeId == ApplicationRemarkType::TYPE_FILE_POSTAL) {
$legalDocumentType = LegalDocumentType::TYPE_POSTAL;
}
else if ($remarkTypeId == ApplicationRemarkType::TYPE_FILE_PASSPORT) {
$legalDocumentType = LegalDocumentType::TYPE_PASSPORT;
}
else if ($remarkTypeId == ApplicationRemarkType::TYPE_FILE_DRIVERS_LICENSE) {
$legalDocumentType = LegalDocumentType::TYPE_DRIVERS_LICENSE;
}
else if ($remarkTypeId == ApplicationRemarkType::TYPE_FILE_PRC) {
$legalDocumentType = LegalDocumentType::TYPE_PRC;
}
else if ($remarkTypeId == ApplicationRemarkType::TYPE_FILE_VOTERS_ID) {
$legalDocumentType = LegalDocumentType::TYPE_VOTERS_ID;
}
else if ($remarkTypeId == ApplicationRemarkType::TYPE_FILE_SCHOOL_ID) {
$legalDocumentType = LegalDocumentType::TYPE_SCHOOL_ID;
}
else if ($remarkTypeId == ApplicationRemarkType::TYPE_FILE_TIN) {
$legalDocumentType = LegalDocumentType::TYPE_TIN;
}
else if ($remarkTypeId == ApplicationRemarkType::TYPE_VALID_ID) {
$legalDocumentType = LegalDocumentType::TYPE_VALID_ID;
}
return $legalDocumentType;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getDocType();",
"function readDocumentType($id){\n $obj = new DocumentType($id);\n if($obj->isNew()) return false; else return $obj;\n }",
"public function setDocType($docType);",
"public function getDocumentType() {\n\t\tif($this->document_type == 'DOCUMENT' && $this->document_id)\n\t\t\treturn Yii::t('store', $this->document->document_type);\n\t\telse\n\t\t\treturn Yii::t('store', $this->document_type);\n\t}",
"public function getDocumentType()\n {\n return $this->document_type;\n }",
"public function recurrenceTypeId(): RecurrenceTypeId;",
"public function getDocumentType() {\n return $this->document['type'];\n }",
"public function document_type() {\r\n\t\t$class = __CLASS__;\r\n\t\treturn (isset($class::_object()->document_type)) ? $class::_object()->document_type:null;\r\n }",
"public function fetchDocumentByTypeAndId(string $type, string $docId, $prototype = null);",
"public function setIdType(string $idType): static;",
"function get_request_type($id_request_type){\n $this->db->where('id', $id_request_type);\n $query = $this->db->get('type_request');\n return($query->result());\n }",
"public function get_type(): string;",
"public function getDocumentType()\n {\n return $this->_documentType;\n }",
"public function getCustomTypeId();",
"public function get($typeId);",
"public function get_type();",
"public function getCompanyTypeDoc()\n {\n return $this->hasOne(CompanyTypeDocument::className(), ['id' => 'company_type_doc_id']);\n }",
"private static final function getDocumentType () {\r\n // Do return ...\r\n return self::$objDocumentType;\r\n }",
"public function getDocumentType()\n {\n $value = $this->get(self::DOCUMENTTYPE);\n return $value === null ? (integer)$value : $value;\n }",
"public function pageType($typeOrId);",
"public static function getType($recordId)\n\t{\n\t\t$metadata = Functions::getCRMRecordMetadata($recordId);\n\t\treturn $metadata ? $metadata['setype'] : null;\n\t}",
"public function getTaxDocumentType()\n\t{\n\t\treturn $this->getIfSet('type', $this->data->taxDocument);\n\t}",
"public function getTypeId()\n {\n return $this->get(self::_TYPE_ID);\n }",
"function docTypeBelongsToField($iDocTypeID) {\n\t\tglobal $default;\n\t\treturn lookupField(\"$default->document_type_fields_table\", \"field_id\", \"document_type_id\", $iDocTypeID );\n\t}",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function setDocumentType($docType)\n {\n $this->_documentType = $docType;\n return $this;\n }",
"public function getTypeId()\n {\n return $this->type_id;\n }",
"public function getTypeId()\n {\n return $this->type_id;\n }",
"public function getTypeId()\n {\n return $this->type_id;\n }",
"function getType(): string;",
"function getType(): string;",
"public function type($entry)\n\t{\n\t\t//return subtype document\n\t\t$description = $entry->get_abstract();\n\t\treturn $description;\n\t}",
"public function type()\n {\n return $this->belongsTo('App\\Models\\DocField');\n }",
"public function getTypeId()\n {\n return $this->typeId;\n }",
"function get_type($material_type){\n switch ($material_type) {\n case \"ARTIGO DE JORNAL\":\n return \"article-newspaper\";\n break;\n case \"ARTIGO DE PERIODICO\":\n return \"article-journal\";\n break;\n case \"PARTE DE MONOGRAFIA/LIVRO\":\n return \"chapter\";\n break;\n case \"APRESENTACAO SONORA/CENICA/ENTREVISTA\":\n return \"interview\";\n break;\n case \"TRABALHO DE EVENTO-RESUMO\":\n return \"paper-conference\";\n break;\n case \"TRABALHO DE EVENTO\":\n return \"paper-conference\";\n break; \n case \"TESE\":\n return \"thesis\";\n break; \n case \"TEXTO NA WEB\":\n return \"post-weblog\";\n break;\n }\n}",
"function get_by_type( $type_id )\n {\n $this->db->where('type_id', $type_id);\n $this->db->limit(1);\n return $this->db->get('card_types')->row();\n }",
"function getDocumentTypeID() {\n\t\treturn $this->iDocumentTypeID;\n\t}",
"public function getType() : string;",
"public function getTypeIdentifier();",
"public function get_type()\n {\n return self::$_id;\n }",
"public function checkBookType($type = null){\n $result = $this->find()\n ->where(['alias'=> $type]) ->first();;\n return $result;\n }",
"public function getTypeId()\n {\n return $this->_getData('type_id');\n }",
"abstract protected function get_typeid();",
"public function getTypeId()\n\t{\n\t\tif( isset( $this->values[$this->prefix . 'typeid'] ) ) {\n\t\t\treturn (string) $this->values[$this->prefix . 'typeid'];\n\t\t}\n\t}",
"function getType() ;",
"function getType() ;",
"function getType() ;",
"public function getFkImobiliarioTipoLicencaDocumentos()\n {\n return $this->fkImobiliarioTipoLicencaDocumentos;\n }",
"private function get_type() {\n\n\t}",
"public function type($type);",
"function getResourceTypeId($name){\n return sqlSelectOne(\"SELECT * FROM types WHERE type_name='$name'\", 'type_id');\n}",
"public function getIssueTypeById($issueTypeId)\n { \n $this->uri = \"/rest/api/\".$this->getApiVersion().\"/issuetype/\".$issueTypeId;\n $this->method = \"GET\";\n }",
"function getType();",
"function getType();",
"function getType();",
"function getType();",
"function getType();",
"function convertToORCIDWorkType($type)\n{\n\tglobal $ioi;\t\t\n\t\n\t$type = getValues($ioi, \"SELECT `orcidField` FROM `mappings` WHERE `source` = 'dspace' AND sourceField = '$type' AND `entryType` = 'workType'\", array('orcidField'), 'singleValue');\n\t\n\tif(empty($type))\n\t{\n\t\t$type = 'other';\n\t}\n\t\n\treturn $type;\n}",
"function issuu_document_types() {\n return array(\n '000000' => 'Unknown',\n '001000' => 'Article or Essay',\n '002000' => 'Book',\n '003000' => 'Catalog',\n '004000' => 'Journal',\n '005000' => 'Magazine',\n '006000' => 'Manual or Resource',\n '007000' => 'Newspaper',\n '008000' => 'Paper',\n '009000' => 'Photo album',\n '010000' => 'Portfolio',\n '011000' => 'Presentation',\n '012000' => 'Report',\n '013000' => 'Other',\n );\n}",
"function getResourceTypeName($id){\n return sqlSelectOne(\"SELECT * FROM types WHERE type_id='$id'\", 'type_name');\n}",
"function get_comment_type($comment_id = 0)\n {\n }",
"abstract protected function get_typestring();",
"function obtener_tipo_recorrido($iddoc)\n{\n $resultado = 'Matutino';\n\n $query = Model::getQueryBuilder();\n $planilla = $query\n ->select('tipo_recorrido')\n ->from('ft_despacho_ingresados')\n ->where('documento_iddocumento = :iddoc')\n ->setParameter(':iddoc', $iddoc, \\Doctrine\\DBAL\\Types\\Type::INTEGER)\n ->execute()->fetchAll();\n\n if ($planilla[0]['tipo_recorrido'] == 2) {\n $resultado = 'Vespertino';\n }\n return $resultado;\n}",
"public function getTypeDefinition($typeId, $options = array ()) { // Nice to have\n\t\t$varmap = $options;\n\t\t$varmap[\"id\"] = $typeId;\n\t\t$myURL = $this->processTemplate($this->workspace->uritemplates['typebyid'], $varmap);\n\t\t$ret = $this->doGet($myURL);\n\t\t$obj = $this->extractTypeDef($ret->body);\n\t\t$this->cacheTypeInfo($obj);\n\t\treturn $obj;\n\t}",
"function GetSaleType($saleTypeId)\n\t{\n\t\t$result = $this->sendRequest(\"GetSaleType\", array(\"SaleTypeId\"=>$saleTypeId));\t\n\t\treturn $this->getResultFromResponse($result);\n\t}",
"public static function getTipoDoc($item) {\n $qr = montaQueryFirst(\"prestador_tipo_doc\", \"*\", \"prestador_tipo_doc_id = {$item}\");\n return $qr;\n }",
"public function getType(): string\n {\n if (0 === strncmp($this->resourceId, '/schema/analysis/stopwords', \\strlen('/schema/analysis/stopwords'))) {\n return self::TYPE_STOPWORDS;\n } elseif (0 === strncmp($this->resourceId, '/schema/analysis/synonyms', \\strlen('/schema/analysis/synonyms'))) {\n return self::TYPE_SYNONYMS;\n }\n\n return '';\n }",
"public function findCollectionTypeById($id);",
"static function _get_first_type_match_for_doc($doc, $types, $doc_type = \"wp\") {\r\n\t\t$check = $doc_type . \"_document_is_this_type\";\r\n\t\t$sorted_types = self::array_sort($types, \"order\");\r\n\r\n\t\tforeach ($sorted_types as $type) {\r\n\t\t\tif ($type[\"type\"]->$check($doc)) {\r\n\t\t\t\treturn $type[\"type\"];\r\n\t\t\t}\r\n\t\t}\r\n\t\t\t\r\n\t\treturn null;\r\n\t}",
"public function getType_id()\n {\n return $this->type_id;\n }",
"function project_type($id)\n{\n\t$name=mysql_fetch_array(mysql_query(\"select type_name from manage_property_type where ptype='$id'\"));\n\treturn $name['type_name'];\n\t}",
"abstract protected function getType();",
"public function GetDocumentType(GetDocumentType $parameters)\n {\n return $this->__soapCall('GetDocumentType', array($parameters));\n }",
"public function getTypeID() {\n\t\treturn $this->_type_id;\n\t}",
"protected abstract function getType();",
"public function type($id)\n {\n return $this->where('user_type_id', $id);\n }",
"public abstract function getType();",
"function get_type_name_by_id_custom1($type,$type_id='',$field='name')\n \t{ $type1='surgery'; //table field name\n \t return $this->db->get_where($type,array($type1.'_id'=>$type_id))->row()->$field; \n \t}",
"public function getRealestateType()\n {\n return $this->hasOne(RealEstateType::className(), ['id' => 'realestate_type_id']);\n }",
"public function type(): string;",
"public function getType()\n {\n return $this->type()->getID();\n }",
"public function getType();",
"public function getType();",
"public function getType();",
"public function getType();",
"public function getType();",
"public function getType();",
"public function getType();",
"public function getType();"
]
| [
"0.6941356",
"0.6457717",
"0.61338395",
"0.60111564",
"0.5937266",
"0.5935095",
"0.59086734",
"0.5865947",
"0.5862416",
"0.5848411",
"0.5792302",
"0.57666224",
"0.57645994",
"0.5755874",
"0.57437575",
"0.56948435",
"0.56588215",
"0.5648785",
"0.56168324",
"0.5576396",
"0.55717546",
"0.55303925",
"0.5527857",
"0.551614",
"0.55158067",
"0.55158067",
"0.55158067",
"0.55158067",
"0.55158067",
"0.55158067",
"0.55158067",
"0.55158067",
"0.55158067",
"0.55158067",
"0.55158067",
"0.55158067",
"0.551388",
"0.5510365",
"0.5510365",
"0.5510365",
"0.55004215",
"0.55004215",
"0.5478407",
"0.54729813",
"0.54499984",
"0.54414386",
"0.54273677",
"0.5420009",
"0.5417304",
"0.541488",
"0.54135036",
"0.53993785",
"0.5398849",
"0.53822213",
"0.53725773",
"0.5355834",
"0.53551763",
"0.5354589",
"0.5353725",
"0.53406227",
"0.533108",
"0.5326198",
"0.5325227",
"0.5313167",
"0.5313167",
"0.5313167",
"0.5313167",
"0.5313167",
"0.53032404",
"0.53007406",
"0.52935463",
"0.5293195",
"0.52890104",
"0.5288915",
"0.52888733",
"0.52877676",
"0.5280857",
"0.5279092",
"0.5273629",
"0.5269986",
"0.52457637",
"0.5245724",
"0.5239866",
"0.5238199",
"0.5235444",
"0.52266425",
"0.52217656",
"0.5221727",
"0.520037",
"0.51980394",
"0.51926124",
"0.51866597",
"0.51803625",
"0.51803625",
"0.51803625",
"0.51803625",
"0.51803625",
"0.51803625",
"0.51803625",
"0.51803625"
]
| 0.7972749 | 0 |
Update Accreditation Application Type | public function updateApplicationType (AccreditationApplication $accreditationApplication, $accreditationApplicationTypeId, Store $store)
{
$accreditationReference = $this->em->getReference('YilinkerCoreBundle:AccreditationLevel', $accreditationApplicationTypeId);
if(!is_null($accreditationReference)){
$store->setIsEditable(false);
}
$store->setAccreditationLevel($accreditationReference);
$accreditationApplication->setAccreditationLevel($accreditationReference);
$this->qrCodeGenerator->generateStoreQrCode($store, $store->getStoreSlug());
if(!is_null($accreditationReference)){
$this->elasticaObjectPersister->insertOne($store);
}
$this->em->flush();
return $accreditationApplication;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setApplicationIdentityType(?TeamworkApplicationIdentityType $value): void {\n $this->getBackingStore()->set('applicationIdentityType', $value);\n }",
"function editApp($appid, $usertype, $date, $projtitle, $princinvest, $coprincinvest1, $princinvestdept, $princinvestphone, $email, $deadline, $grant, $exemption, $numA, $numB, $numC, $numD, $numF, $numG\n , $risks, $conA, $conB, $conC1, $conC2, $conC3, $desc, $benf, $reas, $ids) {\n $strQuery = \"update `irb-application` set Status='$usertype',DateSubmitted='$date', TitleOfProject='$projtitle',\n\t\t\t\t\t\tPrincipalInvestigator='$princinvest',CoPrincipalInvestigator='$coprincinvest1',\n PIDepartment='$princinvestdept',PIPhoneNo='$princinvestphone',Email='$email',\n GrantSource='$grant',GrantDeadline='$deadline',Exemption='$exemption',\n NumCharOfSubjects='$numA',SpecialClasses='$numB',HowRecruited='$numC',\n HowResProc='$numD',ReseachMethodClass='$numF',DataSources='$numG',\n ReseachIndepthProcedure='$risks',ExtentOfConf='$conA',PorcForHandlingData='$conB',\n HowDisseminated='$conC1',HowInformed='$conC2',HowConfProtected='$conC3',\n WillSubjectReward='$desc',WhatIntrinsicBenefits='$benf',FailedAppReason='$reas',CheckBoxArray='$ids'\" . \" where ApplicationID=$appid\";\n echo \"$strQuery\";\n return $this->query($strQuery);\n }",
"private function update_type($new_type) { \n\n\t\tif ($this->_update_item('type',$new_type,'50')) { \n\t\t\t$this->type = $new_type;\n\t\t}\n\n\t}",
"private function replaceDocumentTypeToAccessibleType(): void\n\t{\n\t\t$replaces = [\n\t\t\tStoreDocumentTable::TYPE_ARRIVAL => StoreDocumentTable::TYPE_STORE_ADJUSTMENT,\n\t\t\tStoreDocumentTable::TYPE_STORE_ADJUSTMENT => StoreDocumentTable::TYPE_ARRIVAL,\n\t\t];\n\n\t\tforeach ($replaces as $baseType => $anotherType)\n\t\t{\n\t\t\t$can = $this->accessController->checkByValue(ActionDictionary::ACTION_STORE_DOCUMENT_MODIFY, $baseType);\n\t\t\tif (!$can)\n\t\t\t{\n\t\t\t\t$this->canSelectDocumentType = false;\n\n\t\t\t\t// change current type\n\t\t\t\tif ($this->documentType === $baseType)\n\t\t\t\t{\n\t\t\t\t\t$can = $this->accessController->checkByValue(ActionDictionary::ACTION_STORE_DOCUMENT_MODIFY, $anotherType);\n\t\t\t\t\tif ($can)\n\t\t\t\t\t{\n\t\t\t\t\t\t$this->documentType = $anotherType;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}",
"public function update(Request $request, Type $type)\n {\n //\n $request -> validate([\n 'name' => 'required'\n ]);\n\n Type::update($request->all());\n\n return redirect()->route('type')\n ->with('success','แก้ไขหมวดหมู่อัลบั้มสำเร็จ');\n }",
"public function update(Request $request, Application $app)\n {\n if ($request->category_id==2||$request->category_id==3||$request->category_id==10||$request->category_id==1) {\n $type = ['application_type_id'=>1];\n } else if($request->category_id==4||$request->category_id==5||$request->category_id==7||$request->category_id==8||$request->category_id==9||$request->category_id==11||$request->category_id==12||$request->category_id==13) {\n $type = ['application_type_id'=>4];\n }else{\n $type = ['application_type_id'=>2];\n }\n\n for ($i=1; $i < 7; $i++) {\n Productivity::create([\n 'app_id' => $app->id,\n 'category_id' => $app->category_id,\n 'role_id'=>$i\n ]);\n }\n $data = array_merge($type,$request->all());\n Application::find($app->id)->update($data);\n return back()->with('success','Update berhasil!');\n }",
"public function mf_application_type() {\n\n\t\t$args = array(\n\t\t\t'posts_per_page' => 2000,\n\t\t\t'post_type' => 'mf_form',\n\t\t\t'post_status' => 'any',\n\n\t\t\t// Prevent new posts from affecting the order\n\t\t\t'orderby' => 'ID',\n\t\t\t'order' => 'ASC',\n\n\t\t\t// Speed this up\n\t\t\t'no_found_rows' => true,\n\t\t\t'update_post_meta_cache' => false,\n\t\t\t'update_post_term_cache' => false,\n\t\t);\n\n\t\t// Get the first set of posts\n\t\t$query = new WP_Query( $args );\n\n\t\twhile ( $query->have_posts() ) : $query->the_post();\n\t\tglobal $post;\n\t\t\tsetup_postdata($post);\n\t\t\t//WP_CLI::line( get_the_title() );\n\t\t\t$json = json_decode( str_replace( array(\"\\'\", \"u03a9\", \"u2019\"), array(\"'\", 'Ω', '’'), get_the_content() ) );\n\t\t\t//WP_CLI::line( $json->form_type );\n\t\t\t$type = wp_set_object_terms( get_the_ID(), $json->form_type, 'type' );\n\t\t\tif ( is_array( $type ) ) {\n\t\t\t\tWP_CLI::success( 'Updated ' . get_the_title() );\n\t\t\t} elseif (is_wp_error( $type )) {\n\t\t\t\tWP_CLI::warning( 'Wasn\\'t able to update ' . get_the_title() );\n\t\t\t}\n\t\tendwhile;\n\t\tWP_CLI::success( \"Boom!\" );\n\t\t\n\t}",
"public function update(Request $request, Type $type)\n {\n //\n }",
"public function update(Request $request, Type $type)\n {\n //\n }",
"function updateRegistrationType(&$registrationType) {\n\t\t$expiryDate = $registrationType->getExpiryDate();\n\t\t$returner = $this->update(\n\t\t\tsprintf('UPDATE registration_types\n\t\t\t\tSET\n\t\t\t\t\tsched_conf_id = ?,\n\t\t\t\t\tcost = ?,\n\t\t\t\t\tcurrency_code_alpha = ?,\n\t\t\t\t\topening_date = %s,\n\t\t\t\t\tclosing_date = %s,\n\t\t\t\t\texpiry_date = %s,\n\t\t\t\t\taccess = ?,\n\t\t\t\t\tinstitutional = ?,\n\t\t\t\t\tmembership = ?,\n\t\t\t\t\tpub = ?,\n\t\t\t\t\tseq = ?,\n\t\t\t\t\tcode = ?\n\t\t\t\tWHERE type_id = ?',\n\t\t\t\t$this->dateToDB($registrationType->getOpeningDate()),\n\t\t\t\t$this->datetimeToDB($registrationType->getClosingDate()),\n\t\t\t\t$expiryDate === null?'null':$this->datetimeToDB($expiryDate)\n\t\t\t), array(\n\t\t\t\t(int) $registrationType->getSchedConfId(),\n\t\t\t\t(float) $registrationType->getCost(),\n\t\t\t\t$registrationType->getCurrencyCodeAlpha(),\n\t\t\t\t(int) $registrationType->getAccess(),\n\t\t\t\t(int) $registrationType->getInstitutional(),\n\t\t\t\t(int) $registrationType->getMembership(),\n\t\t\t\t(int) $registrationType->getPublic(),\n\t\t\t\t(float) $registrationType->getSequence(),\n\t\t\t\t$registrationType->getCode(),\n\t\t\t\t(int) $registrationType->getTypeId()\n\t\t\t)\n\t\t);\n\t\t$this->updateLocaleFields($registrationType);\n\t\treturn $returner;\n\t}",
"public function update(Request $request, Ctype $ctype)\n {\n //\n }",
"public function updateExpenseTypes()\n {\n $this->validate([\n 'name' => ['required', Rule::unique('expense_types')->ignore($this->expenseType->id)],\n 'description' => 'nullable',\n ]);\n\n $this->expenseType->update([\n 'name' => mb_strtolower($this->name),\n 'description' => mb_strtolower($this->description),\n ]);\n\n session()->flash('success', 'You have successfully updated an expenseType.');\n\n return redirect(route('breed-types.index'));\n }",
"public function setConfigurationAccountType(?SecureAssessmentAccountType $value): void {\n $this->getBackingStore()->set('configurationAccountType', $value);\n }",
"function InfUpdateAffCode($inf_aff_id, $inf_aff_code) {\n\n\t$affiliate = new Infusionsoft_Affiliate();\n\t$affiliate->Id = $inf_aff_id;\n\t$affiliate->AffCode = $inf_aff_code;\n\t$affiliate->save(); // Update affiliate in Infusionsoft\n}",
"public function update(Request $request, Access_Code $access_Code)\n {\n //\n }",
"public function saveAccreditationAction()\n {\n $site_id = $this->_getParam(\"site_id\");\n $site = \\Fisdap\\EntityUtils::getEntity(\"SiteLegacy\", $site_id);\n $form_data = $this->_getParam(\"form_data\");\n \n $form = new Account_Form_Accreditation($site);\n \n $process_result = $form->process($form_data);\n \n if ($process_result['success'] === true) {\n $success = \"true\";\n $html_res = \"<div class='success'>Your accreditation info has been saved.</div>\";\n } else {\n $errors = $this->formatFormErrors($process_result);\n $success = \"false\";\n $html_res = $errors['html'];\n }\n \n $this->_helper->json(array(\"success\" => $success, \"result\" => $html_res, \"form_elements_with_errors\" => $errors['elements']));\n }",
"public function update($id, TypeRequest $request)\n {\n\n $updatedType = $this->typeRepo->update($id, $request->all());\n\n if ($updatedType) {\n\n \\Session::flash('success', 'Apprasial order Type was successfully updated!');\n\n return redirect()->route('admin.appraisal.appr-types.index');\n \n } else {\n\n \\Session::flash('error', 'Something was wrong!');\n\n return redirect()->route('admin.appraisal.appr-types.index');\n }\n }",
"public function update(Request $request, PermitType $permit_type)\n {\n $data = $request->validate([\n 'abbreviation' => 'string|required',\n 'name' => 'string'\n ]);\n\n $permit_type->Abbreviation = $data['abbreviation'];\n\n if ($request->has('name'))\n $permit_type->Name = $data['name'];\n\n $permit_type->save();\n\n return response()->json([\n 'message' => lang('update_successful')\n ], 200);\n }",
"function update_card_type($CardTypeID,$params)\n {\n $this->db->where('CardTypeID',$CardTypeID);\n return $this->db->update('card_types',$params);\n }",
"public function update(Request $request, $type, Ckp $ckp)\n {\n if ($request->issend == \"1\") {\n $request->validate([\n 'activityname.*' => 'required',\n 'activityunit.*' => 'required',\n 'activitytarget.*' => 'required|numeric|min:0',\n 'activityreal.*' => 'required|numeric|min:0',\n ]);\n\n $ckp->status_id = '3';\n $ckp->save();\n\n $submittedckp = new SubmittedCkp;\n //$submittedckp->assessor_id = User::where('department_id', $ckp->user->department->parent->id)->first()->id;\n $submittedckp->assessor_id = $ckp->user->assessor->id;\n $submittedckp->ckp_id = $ckp->id;\n $submittedckp->status_id = '3';\n $submittedckp->save();\n } else {\n $ckp->status_id = '2';\n $ckp->save();\n }\n\n if ($request->removedactivity) {\n ActivityCkp::whereIn('id', $request->removedactivity)->delete();\n }\n\n for ($i = 0; $i < count($request->activityname); $i++) {\n $activity = new ActivityCkp;\n if ($request->activityid[$i]) {\n $activity = ActivityCkp::find($request->activityid[$i]);\n }\n $activity->type = $request->activitytype[$i];\n $activity->name = $request->activityname[$i];\n $activity->unit = $request->activityunit[$i];\n $activity->target = $request->activitytarget[$i];\n $activity->creditcode = $request->activitycreditcode[$i];\n $activity->credit = $request->activitycredit[$i];\n if ($type == 'ckpr') {\n $activity->real = $request->activityreal[$i];\n $activity->quality = '100';\n }\n $activity->note = $request->activitynote[$i];\n $activity->ckp_id = $ckp->id;\n $activity->save();\n }\n\n if ($request->issend == \"1\") {\n return redirect('/ckps')->with('success-send', 'CKP sudah dikirim dan sedang dalam proses penilaian!');\n } else {\n if ($type == 'ckpt') {\n return redirect('/ckps/ckpt/' . $ckp->id . '/edit')->with('success-save', 'CKP sudah disimpan!');\n } else if ($type == 'ckpr') {\n return redirect('/ckps/ckpr/' . $ckp->id . '/edit')->with('success-save', 'CKP sudah disimpan!');\n } else {\n abort(404);\n }\n }\n }",
"public function update(TypeStoreRequest $request, types $type)\n {\n $type->update([\n 'type_id' => $request->type_id,\n 'type_name' => $request->type_name,\n // 'password' => Hash::make($request->password),\n ]);\n return redirect()->route('types.index')->with('message','Type updated Successfully');\n }",
"public function editAction()\r\n {\r\n $this->logger->log('editAction page invoked', Zend_Log::DEBUG);\r\n\r\n $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/pagination.ini', APPLICATION_ENV);\r\n $maxElements = $config->list->attribute->size;\r\n\r\n $typeId = $this->_getParam('citypeId');\r\n $this->elementId = $typeId;\r\n $citypeServiceUpdate = new Service_Citype_Update($this->translator, $this->logger, parent::getUserInformation()->getThemeId());\r\n $attributes = $citypeServiceUpdate->getAttributes();\r\n $relations = $citypeServiceUpdate->getRelations();\r\n\r\n $citypeServiceGet = new Service_Citype_Get($this->translator, $this->logger, parent::getUserInformation()->getThemeId());\r\n $this->logger->log('getCiTypeData:' . $typeId, Zend_Log::DEBUG);\r\n $dbData = $citypeServiceGet->getCiTypeData($typeId);\r\n $this->elementId = $dbData[Db_CiType::NAME];\r\n\r\n\r\n $form = $citypeServiceUpdate->getUpdateCiTypeForm($typeId, $attributes, $relations, $dbData['defaultProject'], $maxElements);\r\n\r\n if ($this->_request->isPost()) {\r\n $newFormData = $this->_request->getPost();\r\n $newFormData['icon'] = $form->getValue('icon');\r\n if ($form->isValid($newFormData)) {\r\n $this->logger->log('Form is valid', Zend_Log::DEBUG);\r\n\r\n $notification = array();\r\n try {\r\n $check = $citypeServiceUpdate->updateCiType($typeId, $newFormData, $dbData);\r\n parent::clearNavigationCache();\r\n if ($check) $notification['success'] = $this->translator->translate('ciTypeUpdateSuccess');\r\n } catch (Exception_Citype_Unknown $e) {\r\n $this->logger->log('User \"' . parent::getUserInformation()->getId() . '\" encountered an unknownen error while updating CiType \"' . $attributeGroupId . '\" ', Zend_Log::ERR);\r\n $notification['error'] = $this->translator->translate('ciTypeUpdateFailed');\r\n } catch (Exception_Citype_UpdateFailed $e) {\r\n $this->logger->log('User \"' . parent::getUserInformation()->getId() . '\" failed to update CiType \"' . $attributeGroupId . '\" ', Zend_Log::ERR);\r\n $notification['error'] = $this->translator->translate('ciTypeUpdateFailed');\r\n } catch (Exception_Citype_WrongIconType $e) {\r\n $this->logger->log('User \"' . parent::getUserInformation()->getId() . '\" failed to update CiType \"' . $attributeGroupId . '\", icon file type wrong!', Zend_Log::ERR);\r\n $notification['error'] = $this->translator->translate('citypeWrongIconType');\r\n } catch (Exception_Citype_UpdateItemNotFound $e) {\r\n $this->logger->log('User \"' . parent::getUserInformation()->getId() . '\" failed to update CiType \"' . $attributeGroupId . '\". No items where updated!', Zend_Log::ERR);\r\n $notification['error'] = $this->translator->translate('ciTypeUpdateFailed');\r\n }\r\n\r\n $this->_helper->FlashMessenger($notification);\r\n $this->_redirect('citype/index');\r\n } else {\r\n $form->populate($newFormData);\r\n }\r\n } else {\r\n\r\n $form->populate($dbData);\r\n }\r\n\r\n $c = 0;\r\n\r\n $this->view->parent = $dbData['parentCiType'];\r\n\r\n if (isset($dbData['addAttribute_20']))\r\n $c = 1;\r\n if (isset($dbData['addAttribute_40']))\r\n $c = 2;\r\n\r\n $this->view->storedIcon = $dbData['icon'];\r\n $this->view->maxElements = $maxElements;\r\n $this->view->c = $c;\r\n $this->view->attributes = $attributes;\r\n $this->view->relations = $relations;\r\n $this->view->form = $form;\r\n }",
"function affwp_admin_update_affiliate_program( $affiliate, $updated ) {\n\n\tif ( $updated ) {\n\n\t\t$affiliate_id = $affiliate->affiliate_id;\n\n\t\tif ( ! empty( $_POST['program'] ) ) {\n\n\t\t\t$program = sanitize_text_field( $_POST['program'] );\n\n\t\t\taffwp_update_affiliate_meta( $affiliate_id, 'program', $program );\n\n\t\t} else {\n\n\t\t\taffwp_delete_affiliate_meta( $affiliate_id, 'program' );\n\n\t\t}\n\t}\n\n}",
"public function getAccType()\n {\n return $this->acc_type;\n }",
"public function actionUpdate()\r\n {\r\n $model=Settings::findOne(1);\r\n\r\n \r\n if ($model->load(Yii::$app->request->post())) \r\n {\r\n $model->code=strtolower($model->code);\r\n if($model->save())\r\n {\r\n Yii::$app->session->setFlash('success','Account Updated');\r\n return $this->redirect(['/site/index']);\r\n }\r\n else\r\n {\r\n print_r($model->errors); exit;\r\n }\r\n } \r\n else \r\n {\r\n Yii::$app->view->title=\"Update Account Info\";\r\n return $this->render('update', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n \r\n\r\n }",
"public function update(Request $request, ExamType $examType)\n {\n $request->validate([\n \"name\" => \"required|string|max:255\",\n \"slug\" => \"required|string|max:255|unique:exam_types,slug,\" . $examType->id,\n ]);\n $data = [\n \"name\" => $request->name,\n \"slug\" => $request->slug\n ];\n if ($examType->update($data)) {\n Toastr::success('Successfully Exam Type Updated', \"Success\");\n } else {\n Toastr::error('Something Went Wrong!', \"Error\");\n }\n return back();\n }",
"public function edit(Type $type)\n {\n //\n }",
"public function edit(Type $type)\n {\n //\n }",
"public function edit(Type $type)\n {\n //\n }",
"public function getAccidentType()\n {\n return $this->accidentType;\n }",
"public function getAccidentType()\n {\n return $this->accidentType;\n }",
"public function update($data, $type = '')\n {\n }",
"public function setAccidentType(array $accidentType)\n {\n $this->accidentType = $accidentType;\n return $this;\n }",
"public function update(Request $request, Type $type)\n {\n Gate::authorize('edit-type', $type);\n $validationData = $request->validate([\n 'name' => 'required|min:2',\n ]);\n\n $type->update([\n 'name' => $validationData['name'],\n 'slug' => Str::slug($validationData['name']),\n 'user_id' => Auth::id()\n ]);\n return redirect()->route('admin.types.show', ['type' => $type->id])->with(\"success\", \"{$type->name} has been updated successfully\");\n }",
"public function test_mod_lti_update_tool_type() {\n $type = mod_lti_external::create_tool_type($this->getExternalTestFileUrl('/ims_cartridge_basic_lti_link.xml'), '', '');\n $type = mod_lti_external::update_tool_type($type['id'], 'New name', 'New description', LTI_TOOL_STATE_PENDING);\n $this->assertEquals('New name', $type['name']);\n $this->assertEquals('New description', $type['description']);\n $this->assertEquals('Pending', $type['state']['text']);\n }",
"public function changeType(Request $request){\n $page = Page::find($request->page_id);\n \n if($request->type == 'Yes'){\n \n $page->isForm = true;\n $page->save();\n }else{\n $page->isForm = false;\n $page->save();\n }\n return back();\n }",
"public function canAddFieldsToTCATypeAndReplaceExistingOnes() {}",
"public function edit(accreditation $accreditation)\n {\n //\n }",
"public function updateAdType($type_id, $type_name, $is_available)\n {\n $query = \"UPDATE adv_type SET name = $type_name, is_available=$is_available WHERE id = $type_id\";\n return $this->getQueryResult($query, $this->getConnection());\n }",
"function update_id_type($id_type_id = '')\n\t{\n\t\t$data['name']\t\t\t\t\t=\t$this->input->post('name');\n\t\t$data['timestamp']\t\t\t\t= \ttime();\n\t\t$data['updated_by']\t\t\t\t= \t$this->session->userdata('user_id');\n\n\t\t$this->db->where('id_type_id', $id_type_id);\n\t\t$this->db->update('id_type', $data);\n\n\t\t$this->session->set_flashdata('success', 'ID type has been updated successfully.');\n\n\t\tredirect(base_url() . 'id_type_settings', 'refresh');\n\t}",
"public function transactionTypeput($transaction_type_id)\r\n {\r\n\r\n $input = Request::all();\r\n $transaction_type = TransactionType::findOrFail($transaction_type_id)\r\n ->update([\r\n \"name\" => $input['name'],\r\n \"effect\" => $input['effect']\r\n ]);\r\n if($transaction_type){\r\n return response()->json(['msg' => 'Updated transaction type'], 201);\r\n }else{\r\n return response()->json(['msg' => 'Could not update record'], 405);\r\n }\r\n }",
"public function updateAction(Request $request, $codeetab, $codetypeetab)\n {\n $em = $this->getDoctrine()->getManager();\n $session = $request->getSession();\n $user= $this->get('security.context')->getToken()->getUser();\n $search = $this->container->get('form.factory')->createBuilder(new SearchType($session, $em, $user))->getForm();\n $annescol = $session->get('AnneScol');\n $coderece = $session->get('CodeRece');\n $url = $this->generateUrl('infrastructuretypecategorieespace_edit');\n $pathUpdate = $this->generateUrl('infrastructuretypecategorieespace_update', array('codeetab' => $codeetab, 'codetypeetab' => $codetypeetab));\n $entities = $em->getRepository('SiseCoreBundle:InfrastructureTypecategorieespace')->getInfrastructureTypes($codeetab, $codetypeetab, $annescol, $coderece);\n if ($codeetab && $codetypeetab && $request->isMethod('POST')) {\n for ($i = 0; $i < count($entities); $i++) {\n $items = array_combine(explode(\"|\", $request->request->get('key_' . $i)), explode(\"|\", $request->request->get('val_' . $i)));\n $item = $em->getRepository('SiseCoreBundle:InfrastructureTypecategorieespace')->findOneBy($items);\n\n\n $nombespautil = $request->request->get('nombespautil' . $i);\n $capaaccuespautil = $request->request->get('capaaccuespautil' . $i);\n $nombespanonutil = $request->request->get('nombespanonutil' . $i);\n $capaaccuespanonutil = $request->request->get('capaaccuespanonutil' . $i);\n $nombespaencoamen = $request->request->get('nombespaencoamen' . $i);\n $capaaccuespaencoamen = $request->request->get('capaaccuespaencoamen' . $i);\n $nombespaencocons = $request->request->get('nombespaencocons' . $i);\n $capaaccuespaencocons = $request->request->get('capaaccuespaencocons' . $i);\n $obse = $request->request->get('obse' . $i);\n\n $item->setNombespautil($nombespautil);\n $item->setCapaaccuespautil($capaaccuespautil);\n $item->setNombespanonutil($nombespanonutil);\n $item->setCapaaccuespanonutil($capaaccuespanonutil);\n $item->setNombespaencoamen($nombespaencoamen);\n $item->setCapaaccuespaencoamen($capaaccuespaencoamen);\n $item->setNombespaencocons($nombespaencocons);\n $item->setCapaaccuespaencocons($capaaccuespaencocons);\n $item->setObse($obse);\n $em->persist($item);\n $em->flush();\n }\n return $this->redirect($this->generateUrl('infrastructuretypecategorieespace_edit'));\n }\n $nameclass = $em->getRepository('SiseCoreBundle:NomenclatureQuestionnaire')->findOneByNameclass('infrastructure_typecategorieespace');\n return $this->render('SiseCoreBundle:Infrastructure:edit.infrastructure_typecategorieespace.html.twig', array(\n 'entities' => @$entities,\n 'search' => $search->createView(),\n 'pathfilter' => $url,\n 'pathUpdate' => @$pathUpdate,\n 'nameclass' => $nameclass\n ));\n }",
"public function save_adaptive(Request $request)\n {\n // User authorization required\n $model = $this->User->GetByID(auth()->user()->id);\n\n // Validated Request\n $data = $request->input('read_type');\n $model->read_type = $data;\n $model->save();\n\n return redirect(\"/admin/dashboard\")->with(['success' => auth()->user()->name .' read type has been updated to '. $data .'!']);\n }",
"public function update(Request $request, HouseType $type)\n {\n $request->validate(['type_name' => 'required|string']);\n\n $type->update(['type_name' => title_case($request->type_name)]);\n\n alert()->success('Updated Successfully');\n\n return redirect()->route('types.index');\n }",
"public function edit(Access_Code $access_Code)\n {\n //\n }",
"public function addCalendarType ($type)\n\t{\n\t\t$Statement = $this->Database->prepare(\"UPDATE users SET hp_calendar_type = ? WHERE id = ?\");\n\t\t$Statement->execute(array($type, $this->id));\n\t}",
"public function change_payment_mode_update() {\n $args = array();\n $args['tenant_id'] = $this->tenant_id; \n $args['trainee_user_id'] = $this->input->post('trainee_user_id');\n $args['payment_due_id'] = $this->input->post('payment_due_id');\n $args['payment_mode'] = $this->input->post('payment_mode');\n $args['course_id'] = $this->input->post('course_id');\n $args['class_id'] = $this->input->post('class_id');\n $args['company_id'] = $this->input->post('company_id'); \n $res = $this->classtraineemodel->get_class_enrol_data($args['course_id'], $args['class_id'],$args['trainee_user_id'],$args['company_id']);\n if(empty($args['company_id'])) {\n $status = $this->classtraineemodel->change_payment_mode_individual($args);\n $account_type = '1';// 1 = individual\n $act_on = $args['trainee_user_id'];\n } else {\n $status = $this->classtraineemodel->change_payment_mode_company($args);\n $account_type = '2';// 2 = company\n $act_on = $args['company_id'];\n } \n if($status) {\n $course_id = $this->input->post('course_id');\n $class_id = $this->input->post('class_id');\n $company_id = $this->input->post('company_id');\n $trainee_id = $this->input->post('trainee_user_id');\n \n if($this->input->post('payment_mode') == 'NOTPAID')\n {\n $payment_mode = 'Payment required';\n }else{ \n $payment_mode = 'Payment not required';\n }\n $course_name = $this->activitylog->get_course_name($course_id); \n $class_name = $this->activitylog->class_name($class_id);\n $company_name = $this->activitylog->company_name($company_id);\n $trainee_name = $this->activitylog->trainee_name($trainee_id);\n $data = array( \n 'course_id' => $course_id,\n 'course_name' => $course_name->crse_name,\n 'class_id' => $class_id,\n 'class_name' => $class_name->class_name,\n 'company_id' => $company_id,\n 'company_name' => $company_name->company_name,\n 'trainee_id' => $trainee_id,\n 'trainee_name' => $trainee_name->first_name,\n 'payment_mode' => $payment_mode,\n 'details' => $res\n );\n \n $previous_data = json_encode($data);\n user_activity(10,$act_on,$previous_data,$account_type);\n $this->session->set_flashdata(\"success\", \"Enrollment mode has been updated successfully.\");\n } else {\n $this->session->set_flashdata(\"error\", \"We have not been able to change the enrollment mode.Please try again later or get in touch with your Administrator.\");\n }\n redirect(\"class_trainee/change_payment_mode\");\n }",
"public function changetypeAction()\n {\n \t// disable view rendering\n \t//$this->_helper->viewRenderer->setNoRender();\n \t// check for lead type and lead id\n\t\t$this->leadType = $this->_request->getParam('type',null);\n\t\t$this->leadId = $this->_request->getParam('id',null);\n\n\t\tif (!$this->leadType) {\n\t\t\t$this->_redirect('error/show/?NO_LEAD_TYPE');\n\t\t}\n\t\tif (!$this->leadId) {\n\t\t\t$this->_redirect('error/show/?NO_LEAD_ID');\n\t\t}\n\n\t\t$db = Zend_Registry::get('db');\n\n\t\t// if we have post, we need to change lead\n\t\tif ($this->_request->isPost()) {\n\t\t\tif ($this->leadType == 'leads') {\n\t\t\t\t$leadData = $db->fetchRow('SELECT * FROM leads WHERE id = '.$this->leadId);\n\t\t\t\tif (!$leadData) {\n\t\t\t\t\t$this->_redirect('profile/?type='.$this->leadType.'&id='.$this->leadId.'&error=CHANGE_TYPE_FAIL');\n\t\t\t\t}\n\n\t\t\t\t//$leadData['total_amount'] = $this->_request->getParam('total_amount','');\n\t\t\t\t$leadData['ev_day_cname'] = $this->_request->getParam('ev_day_cname','');\n\t\t\t\t$leadData['ev_day_cno'] = $this->_request->getParam('ev_day_cno','');\n\t\t\t\t$leadData['event_date'] = $this->_request->getParam('event_date','');\n\t\t\t\t$leadData['approval'] = 'change';\n\t\t\t\tunset($leadData['id']);\n\t\t\t\tunset($leadData['next_followup']);\n\n\t\t\t\t// move the lead to enrollments table\n\t\t\t\tif (!$db->insert('booked',$leadData)) {\n\t\t\t\t\t$this->_redirect('profile/?type='.$this->leadType.'&id='.$this->leadId.'&error=CHANGE_TYPE_FAIL');\n\t\t\t\t}\n\t\t\t\t$newLeadId = $db->lastInsertId();\n\t\t\t\t// delete the lead from leads table\n\t\t\t\t$db->delete('leads','id = '.$this->leadId);\n\n\t\t\t\t// update data in the communication table\n\t\t\t\t$db->update('communication',array('user_id' => $newLeadId, 'user_type' => 'booked'),'user_id = '.$this->leadId.' AND user_type = \\'leads\\'');\n\t\t\t\t// update data in the payments table\n\t\t\t\t$db->update('payments',array('user_id' => $newLeadId, 'user_type' => 'booked'),'user_id = '.$this->leadId.' AND user_type = \\'leads\\'');\n\t\t\t\t// update data in the quotes table\n\t\t\t\t$db->update('quotes',array('user_id' => $newLeadId, 'user_type' => 'booked'),'user_id = '.$this->leadId.' AND user_type = \\'leads\\'');\n\n\t\t\t\t$this->_redirect('booked?message=CHANGE_STATUS');\n\t\t\t}\n\t\t}\n\n\t\t// cancel cold or dead lead\n \tif ($this->_request->__isset('nocold')) {\n \t\tif (!$db->update($this->leadType,array('cold_lead' => '0'),'id = '.$this->leadId))\n \t\t\t$this->_redirect('profile/?type='.$this->leadType.'&id='.$this->leadId.'&error=CHANGE_TYPE_FAIL');\n \t\telse\n \t\t\t$this->_redirect('profile/?type='.$this->leadType.'&id='.$this->leadId.'&message=CHANGE_TYPE_SUCC');\n \t}\n\n\t\t// mark as cold lead\n \tif ($this->_request->__isset('tocold')) {\n \t\tif (!$db->update($this->leadType,array('cold_lead' => '1'),'id = '.$this->leadId))\n \t\t\t$this->_redirect('profile/?type='.$this->leadType.'&id='.$this->leadId.'&error=TO_COLDLEAD_FAIL');\n \t\telse\n \t\t\t$this->_redirect('profile/?type='.$this->leadType.'&id='.$this->leadId.'&message=TO_COLDLEAD_SUCC');\n \t}\n\n \t// mark as dead lead\n \tif ($this->_request->__isset('todead')) {\n \t\tif (!$db->update($this->leadType,array('cold_lead' => '2'),'id = '.$this->leadId))\n \t\t\t$this->_redirect('profile/?type='.$this->leadType.'&id='.$this->leadId.'&error=TO_DEADLEAD_FAIL');\n \t\telse\n \t\t\t$this->_redirect('profile/?type='.$this->leadType.'&id='.$this->leadId.'&message=TO_DEADLEAD_SUCC');\n \t}\n\n \t// display a form for type change\n \t$this->view->leadType = $this->leadType;\n \t$this->view->leadId = $this->leadId;\n\n \t// get the event date\n \t// fetch event date if quote exists\n \t$evDate = $db->fetchOne('SELECT event_date FROM quotes WHERE user_id = ' . $this->leadId . ' LIMIT 1');\n \t$this->view->formData = array();\n \t$this->view->formData['event_date'] = !empty($evDate) ? $evDate : '';\n }",
"function set_action_type($action_type='customer')\n\t{\n\t\t$this->action_type = (strtolower($action_type)=='customer') ? 'ACTION_BY_CUSTOMER' : 'ACTION_BY_CONTACT';\n\t}",
"public function setAccidentType(FHIRCoding $accidentType = null)\n {\n $this->accidentType = $accidentType;\n return $this;\n }",
"protected function apptype()\n {\n \n $app_types=Model\\Apptype::all();\n //return view('home.index')->with('career_with_type', $career_with_type);\n return view('clientadmin.app_type')->with('app_types',$app_types);\n }",
"public function update(Request $request, UserType $userType)\n {\n //\n }",
"public function changeTypeDrink($request);",
"public function update(Request $request, $id,$type)\n {\n if($type == 1){\n $q = QandA::findOrFail($id);\n $q->qa_state = !$q->qa_state;\n $q->save();\n return redirect()->back()->withSuccess('Done');\n }else{\n $data = $request->validate([\n 'question' => 'required|min:10',\n 'answer' => 'required|min:10',\n ]);\n $q = QandA::findOrFail($id);\n $q->qa_q = $request->question;\n $q->qa_a = $request->answer;\n $q->qa_state = isset($request->state) ? 1 : 0;\n $q->save();\n return redirect()->back()->withSuccess('Done');\n }\n }",
"public function update(Request $request, Complainttype $complainttype)\n {\n //\n\n\n\n $complainttype_update = $complainttype->update($request->toArray());\n if ( $complainttype_update) {\n\n if (isset($request->complainttype_status) and $request->complainttype_status == '0') {\n Session::flash('toasttype', 'success');\n Session::flash('toasttitle', 'Deleted');\n Session::flash('toastcontent', 'complainttype Deleted Successfully');\n } else {\n\n Session::flash('toasttype', 'success');\n Session::flash('toasttitle', 'Success');\n Session::flash('toastcontent', 'complainttype updated Successfully');\n }\n } else {\n Session::flash('toasttype', 'error');\n Session::flash('toasttitle', 'Error');\n Session::flash('toastcontent', 'complainttype Not Updated');\n }\n\n return redirect()->route('complainttype.index');\n }",
"public function update($UUID,$UserID,$Type,$Application,$AdminName) {\n try {\n $this->validateAccountParams($UserID, $Type, $Application, $UUID);\n $this->accountGateway->update($UUID,$UserID, $Type, $Application, $AdminName);\n } catch (ValidationException $exc) {\n throw $exc;\n } catch (PDOException $e){\n throw $e;\n }\n }",
"public function update(Request $request, type_of_user $type_of_user)\n {\n //\n }",
"function change_course_type_activity($course_type_ids)\r\n {\r\n if ($course_type_ids)\r\n {\r\n if (! is_array($course_type_ids))\r\n {\r\n $course_type_ids = array($course_type_ids);\r\n }\r\n\r\n $success = true;\r\n\r\n foreach ($course_type_ids as $course_type_id)\r\n {\r\n $course_type = $this->retrieve_course_type($course_type_id);\r\n if (Request :: get('extra'))\r\n {\r\n $course_type->set_active(Request :: get('extra') == 'enable' ? 1 : 0);\r\n }\r\n else\r\n $course_type->set_active(! $course_type->get_active());\r\n\r\n if (! $course_type->update())\r\n $success = false;\r\n }\r\n\r\n $this->redirect(Translation :: get($success ? 'CourseTypeUpdated' : 'CourseTypeNotUpdated'), ($success ? false : true), array(Application :: PARAM_ACTION => WeblcmsManager :: ACTION_ADMIN_COURSE_TYPE_BROWSER));\r\n }\r\n }",
"public function update(Request $request, $type)\n {\n if ('profile' == $type) {\n $this->updateProfile($request);\n } else {\n $this->updatePassword($request);\n }\n\n return redirect()->action('Backend\\Admin\\ProfileController@index');\n }",
"public function update(Request $request, $id)\n {\n $request->validate([\n 'name' => 'required',\n /*'code' => 'required',*/\n 'is_active' => 'required',\n ]);\n $update = ['name' => $request->name, 'old_code' => $request->old_code, 'is_active'=>$request->is_active];\n N_prefcontrtype::where('id',$id)->update($update);\n\n //return redirect()->route('admin.nom.prefcontrtypes.index');\n\t\t\t\t\treturn redirect()->route('nom.prefcontrtypes.index');;\n }",
"function affwp_affiliate_dashboard_update_program( $data ) {\n\n\t$affiliate_id = absint( $data['affiliate_id'] );\n\n\tif ( ! empty( $data['program'] ) ) {\n\n\t\t$program = sanitize_text_field( $data['program'] );\n\n\t\taffwp_update_affiliate_meta( $affiliate_id, 'program', $program );\n\n\t} else {\n\n\t\taffwp_delete_affiliate_meta( $affiliate_id, 'program' );\n\n\t}\n\n}",
"function payment_gateway_activation($type='' , $value=''){\n if($type!=='') {\n $data = ($value == 'true' ? 'ok' : 'no');\n $this->db->where('type', $type);\n $this->db->update('business_settings', array(\n 'value' => $data\n ));\n }\n }",
"public function getAppType();",
"function editTypeOfRent($data) {\n\t\t\t$conn = $this->connect();\n\t\t\t$tOFr = $this->modify(mysqli_real_escape_string($conn, $data['tOFr']));\n\t\t\t$uid = $_SESSION['userid'];\n\t\t\t$pid = $_SESSION['pid'];\n\t\t\tif(empty($tOFr)) {\n\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Empty\");\n\t\t\t} else {\n\t\t\t\tif(preg_match(\"/^[a-z ]+$/i\", $tOFr)) {\n\t\t\t\t\tif($this->length($tOFr, 25, 3)) {\n\t\t\t\t\t\t$result = $this->changepost('newpost', 'post_type_of_Rent', $tOFr, $uid , $pid);\n\t\t\t\t\t\tif($result == true) {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Successfully_Changed\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Failed!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&length=tooBigOrSmall\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&invalid=type\");\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function massCdocTypeAction()\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 ->setCdocType($this->getRequest()->getParam('flag_cdoc_type'))\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 }",
"function lb_subscription_set_payment_type($account, $subscription, $payment_type) {\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['payment_type'] != $payment_type) {\n $entity->field_subscription[LANGUAGE_NONE][$account_subscription_data['delta']]['field_payment_type'] = array(\n LANGUAGE_NONE => array(\n 0 => array(\n 'value' => $payment_type,\n ),\n ),\n );\n entity_save('user', $entity);\n }\n }\n}",
"public function updateType($objectType) {\n\t\tthrow new CmisNotImplementedException(\"updateType\");\t\t\n\t}",
"public function edit(Application $application)\n {\n //\n }",
"public function edit(Application $application)\n {\n //\n }",
"public function edit(Application $application)\n {\n //\n }",
"public function edit(Application $application)\n {\n //\n }",
"public function edit(Application $application)\n {\n //\n }",
"protected function updateExtensionAction() {}",
"function editTypeOfArea($data) {\n\t\t\t$conn = $this->connect();\n\t\t\t$pType = $this->modify(mysqli_real_escape_string($conn, $data['pType']));\n\t\t\t$uid = $_SESSION['userid'];\n\t\t\t$pid = $_SESSION['pid'];\n\t\t\tif(empty($pType)) {\n\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Empty\");\n\t\t\t} else {\n\t\t\t\tif(preg_match(\"/^[a-z ]+$/i\", $pType)) {\n\t\t\t\t\tif($this->length($pType, 25, 3)) {\n\t\t\t\t\t\t$result = $this->changepost('newpost', 'post_p_type', $pType, $uid , $pid);\n\t\t\t\t\t\tif($result == true) {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Successfully_Changed\");\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&Failed!\");\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&length=tooBigOrSmall\");\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t$this->re_direct(\"mypost_details\", \"post_id=\".$pid.\"&invalid=type\");\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"function setType($a_type)\n\t{\n\t\t$this->il_type = $a_type;\n\t}",
"public function updateType(Request $request, $id)\n {\n $type = ExpenseType::find($id);\n $type->name = $request->name;\n $type->save();\n Flash::success(trans('general.successfully_saved'));\n return redirect('expense/type/data');\n }",
"private function updAppTable(){\n \n $app = App::find($this->id);\n $app->public = (($this->app[\"active\"]) ? 1 : 0);\n $app->security = (($this->app[\"security\"][\"active\"]) ? 1 : 0);\n $app->token = $this->app[\"security\"][\"token\"];\n $app->structure = json_encode($this->json);\n\n $result = $app->save();\n\n return $result;\n }",
"public function update(ClaimTypeRequest $request, ClaimType $claim_type)\n {\n $claim_type->update($request->all());\n return new ClaimTypeResource($claim_type); \n }",
"public function setAccountCode($value);",
"public function update($medAccount);",
"private function upd(array $config) {\r\n switch ($config['type']) {\r\n case 'cart':\r\n case 'address':\r\n case 'cartConfig':\r\n case 'pwd':\r\n case 'config':\r\n case 'status_order':\r\n parent::update(\r\n ['type' => $config['type']],\r\n $config['data']\r\n );\r\n break;\r\n }\r\n }",
"public function updateEditActivityType(\n $options\n ) {\n //check or get oauth token\n OAuthManager::getInstance()->checkAuthorization();\n\n //prepare query string for API call\n $_queryBuilder = '/activityTypes/{id}';\n\n //process optional query parameters\n $_queryBuilder = APIHelper::appendUrlWithTemplateParameters($_queryBuilder, array (\n 'id' => $this->val($options, 'id'),\n ));\n\n //validate and preprocess url\n $_queryUrl = APIHelper::cleanUrl(Configuration::getBaseUri() . $_queryBuilder);\n\n //prepare headers\n $_headers = array (\n 'user-agent' => BaseController::USER_AGENT,\n 'Authorization' => sprintf('Bearer %1$s', Configuration::$oAuthToken->accessToken)\n );\n\n //prepare parameters\n $_parameters = array (\n 'name' => $this->val($options, 'name'),\n 'icon_key' => APIHelper::prepareFormFields($this->val($options, 'iconKey')),\n 'color' => $this->val($options, 'color'),\n 'order_nr' => $this->val($options, 'orderNr')\n );\n\n //call on-before Http callback\n $_httpRequest = new HttpRequest(HttpMethod::PUT, $_headers, $_queryUrl, $_parameters);\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnBeforeRequest($_httpRequest);\n }\n\n //and invoke the API call request to fetch the response\n $response = Request::put($_queryUrl, $_headers, Request\\Body::Form($_parameters));\n\n $_httpResponse = new HttpResponse($response->code, $response->headers, $response->raw_body);\n $_httpContext = new HttpContext($_httpRequest, $_httpResponse);\n\n //call on-after Http callback\n if ($this->getHttpCallBack() != null) {\n $this->getHttpCallBack()->callOnAfterRequest($_httpContext);\n }\n\n //handle errors defined at the API level\n $this->validateResponse($_httpResponse, $_httpContext);\n\n return CamelCaseHelper::keysToCamelCase($response->body);\n }",
"public function update(Request $request, AppExpenseType $expenseType,$id)\n {\n $validator = Validator::make($request->all(), [\n 'name' => 'required|unique:expense_types,name,'.$id.',id,deleted_at,NULL',\n 'type' => 'required',\n ])->validate();\n\n $expense_type = AppExpenseType::find($id);\n $expense_type->name = $request->name;\n $expense_type->type = $request->type;\n $expense_type->remark = $request->remark;\n $expense_type->created_by = 0;\n $expense_type->updated_by = 0;\n if ($expense_type->save()) {\n return Redirect::back()->with('success', 'Updated Successfully');\n } else {\n return Redirect::back()->with('failure', 'Something Went Wrong..!');\n }\n }",
"function setAppMode($value)\n {\n $this->_props['AppMode'] = $value;\n // setting the URL for the API\n // recording to the AppMode selected\n switch ($value) {\n case 0:\n $this->_setProp('ApiUrl', 'https://api.ebay.com/wsapi');\n $this->_setProp('AppId', $this->_keys['prod'][0]);\n $this->_setProp('DevId', $this->_keys['prod'][1]);\n $this->_setProp('CertId', $this->_keys['prod'][2]);\n break;\n case 1:\n $this->_setProp('ApiUrl', 'https://api.sandbox.ebay.com/wsapi');\n $this->_setProp('AppId', $this->_keys['test'][0]);\n $this->_setProp('DevId', $this->_keys['test'][1]);\n $this->_setProp('CertId', $this->_keys['test'][2]);\n break;\n case 2:\n $this->_setProp('ApiUrl', 'https://api.ebay.com/wsapi');\n $this->_setProp('AppId', $this->_keys['test'][0]);\n $this->_setProp('DevId', $this->_keys['test'][1]);\n $this->_setProp('CertId', $this->_keys['test'][2]);\n break;\n }\n }",
"public function editAllowance() {\n $id = Request::Segment(3);\n $allowance = $this->db2->table('hr_allowances')->select('id', 'fkcoa_id', 'allowance', 'default_amount')->where('id', $id)->first();\n $postData = Input::all();\n if (!empty($postData)) {\n $name = trim(Input::get('allowance'));\n $defamount = str_replace(\",\", \"\", trim(Input::get('default_amount')));\n $default_amount = trim(str_replace('$', '', $defamount));\n if ($default_amount != 0) {\n $allowance_type = 1;\n } else {\n $allowance_type = 2;\n }\n // /$coa = Input::get('coa_id');\n $currentDate = date('Y-m-d H:i:s', strtotime('now'));\n $checkStatus = 0;\n $allowance = $this->db2->table('hr_allowances')->select('id', 'fkcoa_id', 'allowance', 'default_amount')->where('id', '!=', $id)->where('allowance', '=', $name)->first();\n //$checkStatus = $this->db2->select($this->db2->raw('select count(id) as count from il_accounting_coa_level4 where id!='.$coa.' AND level4_name=\"'.$name.'\"'));\n if (!$allowance) {\n //$updateCoa = $this->db2->table('il_accounting_coa_level4')->where('id',$coa)->update(array('level4_name' => $name,'date_modified' => $currentDate));\n $update = $this->db2->table('hr_allowances')->where('id', $id)->update(array('allowance' => $name, 'default_amount' => $default_amount, 'allowance_type' => $allowance_type, 'date_modified' => $currentDate));\n if ($update)\n return Redirect::to('config/allowance')->with(array('successalert' => 'Allowance updated Successfully'));\n else\n return Redirect::to('config/allowance')->with(array('erroralert' => 'Server problem Try again'));\n } else {\n return Redirect::to('config/edit-allowance/' . $id)->with(array('erroralert' => 'Allowance name already exists'));\n }\n }\n return View::make('settings/allowance.editAllowance')->with(array('view' => $allowance, 'id' => $id));\n }",
"public function update(TypeRequest $request, Type $type)\n {\n $type->name = $request->name;\n\n if(!$type->isDirty())\n {\n return response()->json([\"error\" => 'se debe especificar al menos un valor diferente para actualizar', \"code\" => 422],422);\n }\n\n $type->save();\n\n return $this->showOne($type, 'type actulizado correctamente');\n }",
"public function enrolment_type_change($opType) {\n $args = array(); \n $args['tenant_id'] = $this->tenant_id;\n $args['logged_in_user_id'] = $this->user->user_id;\n $args['individual_user_id'] = $this->input->post('individual_user_id');\n $args['individual_payment_due_id'] = $this->input->post('pymnt_due_id');\n $args['subsidy_amount'] = $this->input->post('subsidy_amount');\n $args['unit_fees'] = $this->input->post('unit_fees');\n $args['comp_invoice_id'] = $this->input->post('comp_invoice_id');\n $args['comp_payment_due_id'] = $this->input->post('comp_pymnt_due_id');\n $args['company_id'] = $this->input->post('company_id');\n $args['comp_gst_rate'] = $this->input->post('comp_gst_rate');\n $args['comp_gst_rule'] = $this->input->post('comp_gst_rule');\n $args['course_id'] = $this->input->post('course_id');\n $args['class_id'] = $this->input->post('class_id');\n ///addded by shubhranshu since the subsidy is not coming during form post to apply the subsidy during invoice cretion\n $subsidy = $this->classtraineemodel->get_individual_enrol_trainees_subsidy($args['tenant_id'],$args['individual_payment_due_id'],$args['individual_user_id']);\n $args['subsidy_amount'] = $subsidy[0]->subsidy_amount;\n ////end --------\n if ($opType == 'mergeInvoice') {\n $status = $this->classtraineemodel->merge_invoice($args);\n if ($status == FALSE) {\n $this->session->set_flashdata(\"error\", \"Unable to move Individual Enrollment to the selected Company Invoice. Please try again later.\");\n } else {\n $this->session->set_flashdata(\"success\", \"Successfully merged Individual Enrollment to the selected Company Invoice.\");\n }\n }\n if ($opType == 'newInvoice') {\n $status = $this->classtraineemodel->new_invoice($args);\n if ($status == FALSE) {\n $this->session->set_flashdata(\"error\", \"Unable to create a new Invoice for the company. Please try again later.\");\n } else {\n $this->session->set_flashdata(\"success\", \"Successfully created a new invoice for the Company.\");\n }\n }\n redirect(\"class_trainee\");\n }",
"public function update(){\r\n\t\t$p = $this->input->post();\r\n\t\t$arr = array(\r\n\t\t\t'name' => $p['name'],\r\n\t\t\t'description' => $p['description'],\r\n\t\t\t'order' => $p['order'],\r\n\t\t\t'is_active' => isset($p['is_active']) ? 1 : 0,\r\n\t\t\t'type' => $p['type']\r\n\t\t);\r\n\r\n\t\t/**\r\n\t\t * app file name\r\n\t\t */\r\n\t\t $file_details = explode('~!~', $p['appfilepath']);\r\n\t\t $arr['appfilepath'] = $file_details[0];\r\n\t\t $arr['classname'] = $file_details[1];\r\n\t\t /**\r\n\t\t * icon file path\r\n\t\t */\r\n\t\t$arr['appiconfilepath'] = $p['appiconfilepath'];\r\n\t\t// + get the old icon file\r\n\t\t$this->db->where('id', $p['app_id']);\r\n\t\t$app_details = $this->db->get('apps');\r\n\t\tif($app_details->num_rows()){\r\n\t\t\t$row = $app_details->row_array();\r\n\t\t\tif($row['appiconfilepath'] !== $arr['appiconfilepath']){\r\n\t\t\t\t@unlink('upload/appicon/'.$row['appiconfilepath']);\r\n\t\t\t}\r\n\t\t\tif($row['appfilepath'] !== $arr['appfilepath']){\r\n\t\t\t\t@unlink('application/app/'.$row['appfilepath']);\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->db->where('id', $p['app_id']);\r\n\t\t$this->db->update('apps', $arr);\r\n\r\n\t }",
"public function addToAccidentType($accidentType)\n {\n $this->accidentType[] = $accidentType;\n return $this;\n }",
"public function edit(type_of_user $type_of_user)\n {\n //\n }",
"public function add_custom_fields(&$application) {\n $student_type = $this->CI->Users_model->get_student_type($this->CI->session->userdata('uid'));\n\n // Record the recruit type as student type for use in export\n $recruit_type = $student_type;\n\n if($student_type == 'TRAD') {\n $app_type = 'TRAD'; // Passed on through export to be used\n $key_to_match_by = 'trad_id';\n } else {\n $app_type = 'ONLINE'; // Passed on through export to be used\n $key_to_match_by = 'program_id';\n }\n\n // Find the correct program data with extra map values\n if ($student_type == 'TRAD') {\n $programs = $this->CI->Programs_model->get_resource('majors');\n }else{\n $programs = $this->CI->Programs_model->get_stp_programs(7325, $student_type);\n }\n foreach($programs as $program) {\n if($program[$key_to_match_by] == $application['ddlProgram']) {\n $correct_program = $program;\n }\n }\n\n // Find the correct minor data with extra map values\n $minors = $this->CI->Programs_model->get_resource('minors');\n foreach($minors as $minor) {\n if($minor[$key_to_match_by] == $application['ddlMinor']) {\n $correct_minor = $minor;\n }\n }\n\n // Trad app maps these in based on term\n if($app_type == 'TRAD') {\n switch($application['ddlStatus']) {\n case 'freshman':\n $recruit_type = 'NF';\n $correct_program['student_type'] = 'F';\n $correct_program['level'] = 'UG';\n break;\n case 'transfer':\n $recruit_type = 'NT';\n $correct_program['student_type'] = 'T';\n $correct_program['level'] = 'UG';\n break;\n case 'postbacc':\n $recruit_type = 'NP';\n\n // Student Types\n if($correct_program['college'] == 'ED') {\n $correct_program['student_type'] = 'P';\n } else {\n $correct_program['student_type'] = 'Q';\n }\n\n // Levels\n switch($correct_program['major']) {\n case 'DC':\n $correct_program['level'] = 'GR';\n break;\n case 'DO':\n $correct_program['level'] = 'GR';\n break;\n case 'LCT':\n $correct_program['level'] = 'UG';\n break;\n default:\n $correct_program['level'] = 'UG';\n break;\n }\n break;\n\n case 'pseo':\n $recruit_type = ''; // Left blank\n $correct_program['student_type'] = 'H';\n $correct_program['level'] = 'UG';\n break;\n default:\n break;\n } \n }\n\n // Merge in various program data\n $application = array_merge($application, array('AppType'=> $app_type));\n $application = array_merge($application, array('RecruitType'=> $recruit_type));\n $application = array_merge($application, array('StuType' => $correct_program['student_type']));\n $application = array_merge($application, array('College' => $correct_program['college']));\n $application = array_merge($application, array('Degree' => $correct_program['degree']));\n $application = array_merge($application, array('Concentration' => $correct_program['concentration'])); \n $application = array_merge($application, array('Level' => $correct_program['level']));\n $application = array_merge($application, array('Interest1' => $correct_program['interest']));\n $application = array_merge($application, array('Recruiter' => \"\"));\n $application = array_merge($application, array('JobTitle' => \"\"));\n\n // The app should reflect the Major/Minor Code, not Grail Program ID\n $application['ddlProgram'] = $correct_program['major'];\n $application['ddlMinor'] = $correct_minor['minor'];\n $application['Interest4'] = $correct_minor['interest'];\n\n // Lastly strip out all commas, they break the comma-delimited export\n foreach($application as &$app_value) {\n $app_value = str_replace(\",\",\" \", $app_value);\n }\n return;\n }",
"public function update(Request $request, TypesConges $typesConges)\n {\n //\n }",
"public function update(Request $request, PrizeType $prizeType)\n {\n //\n }",
"public function actionUpdate($id,$type)\n {\n $model=$this->findModel($id);\n $vehicleid=$model->vehicleid;\n $mods=$this->findModel($id);\n $mods->dept=Gongchu::getDeptNameById($model->dept);\n $mods->v_user=Gongchu::getUserNamesByIds($model->v_user);\n $mods->apply_ren=Gongchu::getUserNamesByIds($model->apply_ren);\n $mods->v_license=Vehicle::findOne($vehicleid)->v_license;\n if($model->dept_audit==0){//审批中 状态 不加审批时间 驳回理由\n $mods->dept_leader=Gongchu::getUserNamesByIds($model->dept_leader).'('.Gongchu::getStatusById($model->dept_audit).')';\n }else{\n $mods->dept_leader=Gongchu::getUserNamesByIds($model->dept_leader).'('.Gongchu::getStatusById($model->dept_audit).') '.$model->dept_reason.' '.substr($model->dept_audit_time,0,-3);\n }\n if($model->dept_audit==2){//如果科室领导驳回,则院领导直接显示名字即可\n $mods->branch_leader=Gongchu::getUserNamesByIds($model->branch_leader);\n }else{\n if($model->branch_audit==0){//审批中 状态 不加审批时间 驳回理由\n $mods->branch_leader=Gongchu::getUserNamesByIds($model->branch_leader).'('.Gongchu::getStatusById($model->branch_audit).')';\n }else{\n $mods->branch_leader=Gongchu::getUserNamesByIds($model->branch_leader).'('.Gongchu::getStatusById($model->branch_audit).') '.$model->branch_reason.' '.substr($model->branch_audit_time,0,-3);\n }\n }\n if($model->dept_leader==0){\n $mods->dept_leader=0;\n }\n if($_POST){\n $auditStatus=$_POST['VehicleApply']['branch_audit'];\n if($type=='dept'){\n if($auditStatus==1){\n $model->dept_audit=1;//部门审批同意\n Message::sendMsg('审批同意',Yii::$app->user->identity->username.'同意了一个车辆申请',$model->branch_leader,['vehicle/audit/update','id'=>$model->id,'type'=>'branch','api_url' => \"index.php/vehicle/view?id=\".$model->id]);\n }elseif($auditStatus==2){\n $model->dept_audit=2;//部门审批驳回,驳回更新车辆状态\n $model->dept_reason=$_POST['VehicleApply']['branch_reason'];\n $model->audit_status=2;//申请驳回,审核状态为驳回\n Message::sendMsg('审批驳回',Yii::$app->user->identity->username.'驳回了一个车辆申请',$model->apply_ren,['vehicle/vehicleapply/view','id'=>$model->id,'api_url' => \"index.php/vehicle/view?id=\".$model->id]);\n $vm=Vehicle::findOne($vehicleid);\n $vm->setAttributes(['count'=>1,'isreturn'=>1,'return_time'=>NULL]);\n $vm->save(false);\n }\n $model->dept_audit_time=date('Y-m-d H:i:s',time());\n }else{\n if($auditStatus==1){\n $model->branch_audit=1;//分管审批同意\n $model->audit_status=1;//申请同意,审核状态为同意\n Message::sendMsg('审批同意',Yii::$app->user->identity->username.'同意了一个车辆申请',$model->apply_ren,['vehicle/vehicleapply/view','id'=>$model->id,'api_url' => \"index.php/vehicle/view?id=\".$model->id]);\n }elseif($auditStatus==2){\n $model->branch_audit=2;//院审批驳回,更新车辆状态\n $model->branch_reason=$_POST['VehicleApply']['branch_reason'];\n $model->audit_status=2;//申请驳回,审核状态为驳回\n Message::sendMsg('审批驳回',Yii::$app->user->identity->username.'驳回了一个车辆申请',$model->apply_ren,['vehicle/vehicleapply/view','id'=>$model->id,'api_url' => \"index.php/vehicle/view?id=\".$model->id]);\n $vm=Vehicle::findOne($vehicleid);\n $vm->setAttributes(['count'=>1,'isreturn'=>1,'return_time'=>NULL]);\n $vm->save(false);\n }\n $model->branch_audit_time=date('Y-m-d H:i:s',time());\n }\n if($model->save(false)){\n return $this->redirect(['index']);\n }else{\n functions::alert('审核失败');\n }\n }else{\n return $this->render('update', [\n 'model' => $mods,\n ]);\n }\n }",
"public function update(CreateLoanTypeRequest $request, LoanType $type)\n {\n try {\n $this->dispatch(new UpdateLoanTypeJob($request, $type));\n } catch (ConflictWithExistingRecord $exception) {\n logger()->error('Error updating loan type', [\n 'error' => $exception->getMessage()\n ]);\n\n flash()->error(\"Another loan type with the same name exists!\");\n\n return back();\n\n }\n flash()->success(\"Loan type was updated successfully\");\n\n return redirect()->route('loan_products.types.index');\n }",
"public function edit(Ctype $ctype)\n {\n //\n }",
"function editItemType() {\n\t\tglobal $page;\n\t\tglobal $HTML;\n\t\t$HTML->details(1);\n\n\t\t$_ = '';\n\t\t$_ .= '<div class=\"c init:form form:action:'.$page->url.'\" id=\"container:itemtype\">';\n\t\t\t$_ .= $this->getTypeObject()->editItem();\n\t\t$_ .= '</div>';\n\n\t\treturn $_;\n\t}",
"public function update(Request $request, ItemType $type)\n {\n $type->update($request->validate([\n 'manufacturer' => 'nullable|min:2',\n 'model' => 'nullable|min:2',\n 'stock_type' => ['nullable', Rule::in(ItemStockType::getValues())],\n ]));\n\n return response($type);\n }",
"public function create_update_permit_type_information_section()\n {\n $postdata = $this->input->post();\n $this->form_validation->set_rules('permit_type', 'permittype Code', 'required');\n $this->form_validation->set_rules('permit_status', 'Status', 'required');\n\n if ($this->form_validation->run() == FALSE) {\n $validation = $this->form_validation->error_array();\n $field = array();\n foreach ($validation as $key => $value) {\n array_push($field, $key);\n }\n $res = array(\n 'status' => \"form_error\",\n 'field' => $field,\n 'validation' => $validation,\n 'message' => 'Submission failed due to validation error.'\n );\n echo json_encode($res);\n die;\n } else {\n\n $insert_data = array(\n \"permit_type\" => $postdata['permit_type'],\n \"permit_status\" => $postdata['permit_status'],\n );\n\n if (!empty($postdata['permit_id'])) {\n\n $where = array(\"permit_id\" => $postdata['permit_id']);\n $insert_data['permit_updated'] = date(\"Y-m-d h:i:s\");\n $res = $this->Customer_model->update_data_where($insert_data, $where, $this->table);\n $msg = 'Permit type Updated successfully';\n } else {\n $check_already_exist=validate($this->table,array(\"permit_type\"=>$postdata['permit_type']));\n if($check_already_exist){\n echo json_encode(array('status' => false, 'message' => '<div class=\"alert alert-danger\">This permit type already exist ,Please use different permit type</div>'));\n die; \n }\n $insert_data['permit_created'] = date(\"Y-m-d h:i:s\");\n $res = $this->db->insert($this->table, $insert_data);\n $msg = 'Permit type Created successfully';\n }\n if ($res) {\n echo json_encode(array('status' => true, 'message' => '<div class=\"alert alert-success\">' . $msg . '</div>'));\n die;\n } else {\n echo json_encode(array('status' => false, 'message' => '<div class=\"alert alert-danger\">Somthing went wrong ,Please try again</div>'));\n die;\n }\n }\n }",
"public function update($type, $id = null);"
]
| [
"0.5755849",
"0.56772304",
"0.565952",
"0.5540196",
"0.5482525",
"0.5469314",
"0.5304715",
"0.53039974",
"0.53039974",
"0.5302946",
"0.52719194",
"0.5254388",
"0.52502245",
"0.52392447",
"0.5219835",
"0.521965",
"0.5203743",
"0.51803476",
"0.51655036",
"0.51630604",
"0.5161146",
"0.51611304",
"0.51556957",
"0.5143421",
"0.5133631",
"0.5130508",
"0.5126644",
"0.5126644",
"0.5126644",
"0.51260674",
"0.51260674",
"0.5121798",
"0.5113779",
"0.5112022",
"0.5102496",
"0.5096336",
"0.5079522",
"0.507876",
"0.5075556",
"0.5065885",
"0.5059809",
"0.5055226",
"0.5047044",
"0.50411004",
"0.50383073",
"0.5036691",
"0.5016642",
"0.5010836",
"0.49948215",
"0.49921235",
"0.49890327",
"0.49770707",
"0.4976587",
"0.49704725",
"0.49677926",
"0.49512804",
"0.4945581",
"0.49235123",
"0.49218166",
"0.49186176",
"0.49183288",
"0.49162182",
"0.49077302",
"0.48992074",
"0.48966268",
"0.48864624",
"0.48832402",
"0.48794347",
"0.48794347",
"0.48794347",
"0.48794347",
"0.48794347",
"0.48767543",
"0.48598042",
"0.48591232",
"0.4852305",
"0.48450828",
"0.48443592",
"0.48440948",
"0.48411956",
"0.48328826",
"0.48266914",
"0.4825145",
"0.4820449",
"0.4812763",
"0.48102474",
"0.48082265",
"0.480572",
"0.47975588",
"0.4795389",
"0.47882417",
"0.47877973",
"0.47867927",
"0.4778758",
"0.4773647",
"0.47627836",
"0.4757852",
"0.47524247",
"0.47516343",
"0.4749605"
]
| 0.71197236 | 0 |
Get Application Completion Percentage | public function getApplicationCompletionPercentage (AccreditationApplication $accreditationApplication = null, $legalDocuments = null)
{
$progress = 0;
if ($accreditationApplication !== null) {
if ((bool)$accreditationApplication->getIsBusinessApproved() === true) {
$progress = AccreditationApplication::BUSINESS_INFORMATION_PERCENTAGE;
}
if ((bool)$accreditationApplication->getIsBankApproved() === true) {
$progress += AccreditationApplication::BANK_INFORMATION_PERCENTAGE;
}
if ($legalDocuments !== null && sizeof($legalDocuments) > 0) {
foreach ($legalDocuments as $legalDocument) {
$legalDocumentTypeId = $legalDocument->getLegalDocumentType()->getLegalDocumentTypeId();
$isApproved = (bool)$legalDocument->getIsApproved();
if ( (int) $legalDocumentTypeId === LegalDocumentType::TYPE_DTI_SEC_PERMIT && $isApproved) {
$progress += AccreditationApplication::DTI_FILE_PERCENTAGE;
}
else if ( (int) $legalDocumentTypeId === LegalDocumentType::TYPE_MAYORS_PERMIT && $isApproved === true) {
$progress += AccreditationApplication::MAYORS_FILE_PERCENTAGE;
}
else if ( (int) $legalDocumentTypeId === LegalDocumentType::TYPE_BIR_PERMIT && $isApproved === true) {
$progress += AccreditationApplication::BIR_FILE_PERCENTAGE;
}
else if ( (int) $legalDocumentTypeId === LegalDocumentType::TYPE_FORM_M11501 && $isApproved === true) {
$progress += AccreditationApplication::FORM_FILE_PERCENTAGE;
}
else if ( (int) $legalDocumentTypeId === LegalDocumentType::TYPE_SSS && $isApproved === true) {
$progress += AccreditationApplication::SSS_PERCENTAGE;
}
else if ( (int) $legalDocumentTypeId === LegalDocumentType::TYPE_PAG_IBIG && $isApproved === true) {
$progress += AccreditationApplication::PAGIBIG_PERCENTAGE;
}
else if ( (int) $legalDocumentTypeId === LegalDocumentType::TYPE_POSTAL&& $isApproved === true) {
$progress += AccreditationApplication::POSTAL_PERCENTAGE;
}
else if ( (int) $legalDocumentTypeId === LegalDocumentType::TYPE_PASSPORT && $isApproved === true) {
$progress += AccreditationApplication::PASSPORT_PERCENTAGE;
}
else if ( (int) $legalDocumentTypeId === LegalDocumentType::TYPE_DRIVERS_LICENSE && $isApproved === true) {
$progress += AccreditationApplication::DRIVERS_PERCENTAGE;
}
else if ( (int) $legalDocumentTypeId === LegalDocumentType::TYPE_PRC && $isApproved === true) {
$progress += AccreditationApplication::PRC_PERCENTAGE;
}
else if ( (int) $legalDocumentTypeId === LegalDocumentType::TYPE_VOTERS_ID && $isApproved === true) {
$progress += AccreditationApplication::VOTERS_PERCENTAGE;
}
else if ( (int) $legalDocumentTypeId === LegalDocumentType::TYPE_SCHOOL_ID && $isApproved === true) {
$progress += AccreditationApplication::SCHOOL_PERCENTAGE;
}
}
}
}
return $progress;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function completions() {\n\t\t$completions_calc = $this->_completions/$this->_attempts;\n\t\t// Other NFL QBR specific manipulations\n\t\t$completions_calc -= .3;\n\t\tif ($completions_calc * 5 < 0) {\n\t\t\t$completions_calc = 0;\n\t\t} elseif ($completions_calc * 5 > 2.375) {\n\t\t\t$completions_calc = 2.375;\n\t\t} else {\n\t\t\t$completions_calc *= 5;\n\t\t}\n\t\treturn $completions_calc;\n\t}",
"public function get_percentage_complete() {\n\t\t$percentage = affwp_calculate_percentage( $this->get_current_count(), $this->get_total_count() );\n\n\t\tif ( $percentage > 100 ) {\n\t\t\t$percentage = 100;\n\t\t}\n\n\t\treturn $percentage;\n\t}",
"public function get_percentage_complete() {\n\t\t$args = $this->get_donation_argument( array( 'number' => - 1, 'output' => '' ) );\n\t\tif ( isset( $args['page'] ) ) {\n\t\t\tunset( $args['page'] );\n\t\t}\n\t\t$query = give_get_payments( $args );\n\t\t$total = count( $query );\n\t\t$percentage = 100;\n\t\tif ( $total > 0 ) {\n\t\t\t$percentage = ( ( 30 * $this->step ) / $total ) * 100;\n\t\t}\n\t\tif ( $percentage > 100 ) {\n\t\t\t$percentage = 100;\n\t\t}\n\n\t\treturn $percentage;\n\t}",
"public function getPercentOfCompletedProfile(){\n $pendingCount = $this->getPendingNotificationCount();\n $notificationCount = $this->getNotificationCount();\n $completedCount = $notificationCount - $pendingCount;\n return round(($completedCount * 100.0) / $notificationCount);\n }",
"public function getPercentCompleted()\n {\n return $this->percent_completed;\n }",
"public function getPercentComplete()\n {\n if (array_key_exists(\"percentComplete\", $this->_propDict)) {\n return $this->_propDict[\"percentComplete\"];\n } else {\n return null;\n }\n }",
"function getGoalPercent(){\n $goal = $GLOBALS['GOAL_STEPS'];\n $cursteps = getCurrentSteps();\n $percent = ( $cursteps[0]['steps'] / $goal ) * 100;\n return round($percent);\n}",
"public function getPercentageComplete()\n {\n if (array_key_exists(\"percentageComplete\", $this->_propDict)) {\n return $this->_propDict[\"percentageComplete\"];\n } else {\n return null;\n }\n }",
"public function getAchievementsPercentage() {\n return $this->getAchievementsDone() / sizeof($this->achievements);\n }",
"public function getIptPercent();",
"function usp_ews_get_progess_percentage($events, $attempts) {\n $attemptcount = 0;\n\n\t$count_events = count($events);\n foreach($events as $event) {\n if($attempts[$event['type'].$event['id']] == 1) {\n $attemptcount++;\n }\n }\n\t$progressvalue = ($attemptcount==0 || $count_events==0) ? 0 : $attemptcount / $count_events;\n\n return (int)($progressvalue * 100);\n}",
"public function getPercent()\n {\n return $this->helper->getPercent();\n }",
"function usp_ews_find_color_percentage($mycompletion){\n\t\t\n\t\tif($mycompletion <= EWS_DEFAULT_UNSATISFACTORY_INDEX){\n\t\t\t$color = get_string('notAttempted_colour', 'block_usp_ews');\n\t\t}else if($mycompletion > EWS_DEFAULT_SATISFACTORY_INDEX){\n\t\t\t$color = get_string('attempted_colour', 'block_usp_ews');\n\t\t}else{\n\t\t\t$color = get_string('amber_colour', 'block_usp_ews');\n\t\t}\n\t\treturn $color;\n\n}",
"function getGameProgression()\n {\n // With the mini game number we divide the game in 3 thirds (0-33,\n // 33-66, 66-100%), and looking at the player discs we can further\n // divide each third: each disc on an agentarea counts as a 1/9th\n // solved case; each disc on a locslot as a 1/3rd solve case. We\n // average that over the player count, and thus get the in-minigame\n // progress.\n $base = (self::getGameStateValue(\"minigame\") - 1) * (100 / $this->constants['MINIGAMES']);\n $base = max(0, $base);\n $discs_on_agentarea = count($this->tokens->getTokensOfTypeInLocation('disc_%', 'agentarea_%'));\n $discs_on_locslot = count($this->tokens->getTokensOfTypeInLocation('disc_%', 'locslot_%'));\n $perc_cases_solved = 0;\n $perc_cases_solved += $discs_on_agentarea * (1/9);\n $perc_cases_solved += $discs_on_locslot * (1/3);\n $minigame_progress = $perc_cases_solved / self::getPlayersNumber();\n $progress = $base + ($minigame_progress * 33);\n return floor($progress);\n }",
"public function getUsagePercentage()\n {\n return $this->usagePercentage;\n }",
"public function getUsagePercent() : float\n\t{\n\t\treturn $this->usagePercent;\n\t}",
"public function calculate_coupon_background_progress() {\n\t\t\t$progress = array();\n\n\t\t\t$start_time = get_site_option( 'start_time_woo_sc', false );\n\t\t\t$current_time = get_site_option( 'current_time_woo_sc', false );\n\t\t\t$all_tasks_count = get_site_option( 'all_tasks_count_woo_sc', false );\n\t\t\t$remaining_tasks_count = get_site_option( 'remaining_tasks_count_woo_sc', false );\n\n\t\t\t$percent_completion = floatval( 0 );\n\t\t\tif ( false !== $all_tasks_count && false !== $remaining_tasks_count ) {\n\t\t\t\t$percent_completion = ( ( intval( $all_tasks_count ) - intval( $remaining_tasks_count ) ) * 100 ) / intval( $all_tasks_count );\n\t\t\t\t$progress['percent_completion'] = floatval( $percent_completion );\n\t\t\t}\n\n\t\t\tif ( $percent_completion > 0 && false !== $start_time && false !== $current_time ) {\n\t\t\t\t$time_taken_in_seconds = $current_time - $start_time;\n\t\t\t\t$time_remaining_in_seconds = ( $time_taken_in_seconds / $percent_completion ) * ( 100 - $percent_completion );\n\t\t\t\t$progress['remaining_seconds'] = ceil( $time_remaining_in_seconds );\n\t\t\t}\n\n\t\t\treturn $progress;\n\t\t}",
"public function getPercent()\n {\n return $this->percent;\n }",
"public function getPercent() {\n return $this->percent;\n }",
"public function calculatePercentage() {\n $questionCountAnswered = $this->questionAnalytics->getCountAnswered();\n if ($questionCountAnswered === 0) { //prevent division by 0 error\n $this->percentSelected = 0;\n }\n else {\n $percentSelected = $this->countAnswered / $questionCountAnswered * 100;\n $this->percentSelected = round($percentSelected, 0);\n }\n }",
"public function progress()\n {\n return $this->totalsportevents > 0 ? round(($this->processedsportevents() / $this->totalsportevents) * 100) : 0;\n }",
"public function getPercentage()\n {\n return $this->percentage;\n }",
"public static function percent($suiteResults) {\n $sum = $suiteResults['pass'] + $suiteResults['fail'];\n return round($suiteResults['pass'] * 100 / max($sum, 1), 2);\n }",
"public function test_course_progress_percentage_with_just_activities() {\n global $DB;\n\n // Add a course that supports completion.\n $course = $this->getDataGenerator()->create_course(array('enablecompletion' => 1));\n\n // Enrol a user in the course.\n $user = $this->getDataGenerator()->create_user();\n $studentrole = $DB->get_record('role', array('shortname' => 'student'));\n $this->getDataGenerator()->enrol_user($user->id, $course->id, $studentrole->id);\n\n // Add four activities that use completion.\n $assign = $this->getDataGenerator()->create_module('assign', array('course' => $course->id),\n array('completion' => 1));\n $data = $this->getDataGenerator()->create_module('data', array('course' => $course->id),\n array('completion' => 1));\n $this->getDataGenerator()->create_module('forum', array('course' => $course->id),\n array('completion' => 1));\n $this->getDataGenerator()->create_module('forum', array('course' => $course->id),\n array('completion' => 1));\n\n // Add an activity that does *not* use completion.\n $this->getDataGenerator()->create_module('assign', array('course' => $course->id));\n\n // Mark two of them as completed for a user.\n $cmassign = get_coursemodule_from_id('assign', $assign->cmid);\n $cmdata = get_coursemodule_from_id('data', $data->cmid);\n $completion = new completion_info($course);\n $completion->update_state($cmassign, COMPLETION_COMPLETE, $user->id);\n $completion->update_state($cmdata, COMPLETION_COMPLETE, $user->id);\n\n // Check we have received valid data.\n // Note - only 4 out of the 5 activities support completion, and the user has completed 2 of those.\n $this->assertEquals('50', \\core_completion\\progress::get_course_progress_percentage($course, $user->id));\n }",
"public function getProgress()\n\t{\n\t\treturn 0;\n\t}",
"public function profile_completion() {\n\n $count_empty = '';\n return $count_empty;\n }",
"public function getProcessFeesPercent()\r\n {\r\n return $this->process_fees_percent;\r\n }",
"public function getPercentLevel()\n { \n $experience_level = $this->getExperienceShortMax();\n\n $experience_current_level = $this->getExperienceShort();\n\n $percent = ($experience_current_level * 100)/$experience_level;\n\n return $percent;\n }",
"protected function getProgressAttribute()\n {\n $startdate = Carbon::parse($this->listed_at);\n $enddate = Carbon::parse($this->expired_at);\n $now = Carbon::now();\n\n if($now >= $enddate) {\n return 100;\n }\n\n return number_format(($startdate->diffInDays($now) / $startdate->diffInDays($enddate)) * 100, 0);\n }",
"public function percentageParticipation()\n {\n $expectedPartipant = $this->getExpectedParticipants();\n if (count($expectedPartipant) == 0) {\n return 0;\n }\n $actualParticipant = $this->users()\n ->where('users.role_id', Role::findBySlug('PART')->id)\n ->orWhere('users.role_id', Role::findBySlug('GEST')->id)\n ->get()->unique();\n return round((count($actualParticipant) / count($expectedPartipant)) * 100);\n }",
"private function getProgressForDQCombinations()\n {\n /* Get basic progress statistics (no multiple assessments considered yet) */\n // different DQCombinations\n $total_assessments = $this->dq_repo->findTotalAssessments();\n // number of different DQCombinations\n $total_assessments = (float)$total_assessments[0]['total_assessments'];\n // DQCombinations with at least 1 assessment\n $finished_assessments = $this->dq_repo->findFinishedAssessments();\n // number of DQCombinations with at least 1 assessment\n $finished_assessments = (float)$finished_assessments[0]['finished_assessments'];\n // calculate proportion\n $total_assessments > 0\n ? $assessment_prop = round(($finished_assessments / $total_assessments) * 100, 1)\n : $assessment_prop = 0;\n\n return array('total' => $total_assessments, 'finished' => $finished_assessments, 'proportion' => $assessment_prop);\n }",
"public function getPercentageConversion()\n {\n $percent = 0;\n\n $numberSent = $this->getSumNbReminderSent();\n if ($numberSent > 0) {\n $nbConvertedCarts = $this->getSumNbConvertedCarts();\n $percent = $nbConvertedCarts / $numberSent * 100;\n }\n\n return $percent;\n }",
"function calculate_student_progress($completed_hours, $total_hours, $pace) {\n\n\t// Get the default progress percentage:\n\t$progress = $completed_hours/$total_hours;\n\t// echo number_format($progress, 2);\n\n\tif ($_POST['pace'] == 16) {\n\t\t// Return the formatted progress as a percentage:\n\t\treturn number_format($progress, 2) * 100;\n\t} else {\n\t\t// Get adjusted progress for this pace:\n\t\t$adjusted_progress = $progress / 1.5;\n\n\t\t// Return the formatted progress as a percentage:\n\t\treturn number_format($adjusted_progress, 2) * 100;\n\t\t}\n}",
"public function profileCompleteness() {\n $noFields = 5;\n\n $count = 0;\n\n if($this->fullName() != \"\") {\n $count += 1;\n }\n\n if($this->experience != null) {\n $count += 1;\n }\n\n if($this->currentLocation != \"\") {\n $count += 1;\n }\n\n if($this->preferredLocation != \"\") {\n $count += 1;\n }\n\n if(sizeof($this->skills) > 0) {\n $count += 1;\n }\n\n return (float)$count * 100.0 / (float)$noFields;\n }",
"public function moduleProgress() {\n\n\t\t// Gather database data\n\t\t$sections = Section::all();\n\t\t$secProg = SectionProgress::where('user_id', $this->id)->get();\n\n\t\t// init array with correct number of sections\n\t\t// progress array is an array of arrays:\n\t\t// [{Total Number of sections in Mod1, # sections completed in Mod1},\n\t\t// {Total number of sections in Mod2, # sections completed in Mod2, ... }]\n\t\t$progArray = array();\n\t\tforeach($sections as $section) {\n\n\t\t\t// check if module already exists, if not add it\n\t\t\tif (!array_key_exists($section->module_id,$progArray)) {\n\t\t\t\t$progArray[$section->module_id] = array(0, 0, 0);\n\t\t\t}\n\n\t\t\t// increment section count\n\t\t\t$progArray[$section->module_id][0]++;\n\t\t}\n\n\t\t// add section values to array\n\t\tforeach($secProg as $prog) {\n\n\t\t\t// get module progress belongs to\n\t\t\t$parent_module = 0;\n\t\t\tforeach($sections as $section) {\n\t\t\t\tif ($section->id == $prog->section_id) {\n\t\t\t\t\t$parent_module = $section->module_id;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// increment the counter representing a completed section\n\t\t\tif ($prog->status > 0) {\n\t\t\t\t$progArray[$parent_module][1] += $prog->correct;\n\t\t\t\t$progArray[$parent_module][2]++;\n\t\t\t}\n\t\t}\n\n\t\t// iterate through progress array, calculate % complete\n\t\t$modulePercent = array();\n\t\t$modulePercent[0] = ''; // null first value, so indexing for mod progress starts at 1\n\t\tforeach($progArray as $mod) {\n\t\t\t$modulePercent[] = array(($mod[1]) / ($mod[0]), ($mod[2]) / ($mod[0]));\n\t\t}\n\n\t\treturn $modulePercent;\n\t}",
"public function getProgress();",
"public function getTargetServicePercent()\n {\n return $this->targetServicePercent;\n }",
"public function getPercentual()\n {\n return $this->percentual;\n }",
"function getProfitPercentage()\n\t{\n\t\t$firstTrade = $this->data->getFirstCompletedTrade();\n\n\t\tif ($firstTrade)\n\t\t\t$start = $this->data->getT(Time::fromDateTime($firstTrade->getProcessedAt()), \"amount\");\n\n\t\t$start = $firstTrade ? $firstTrade->getSellAmount() : 0;\n\n\t\tif (!$start)\n\t\t\treturn 0;\n\n\t\t$current = $this->getTotalHoldings();\n\n\t\t$percentage = round((($current / $start) - 1) * 10000)/100;\n\n\t\treturn $percentage;\n\t}",
"function i4_lms_percent_course_completed($course_id, $modules, $user_id) {\n global $wpcwdb, $wpdb;\n $wpdb->show_errors();\n\n $num_units = 0;\n $num_units_completed = 0;\n\n //Get the number of completed units for the course by the user\n $num_units_completed = $this->i4_get_num_completed_units($course_id, $user_id);\n\n\n if ($modules) {\n foreach ($modules as $module) {\n\n //Get the units for the module\n $units = WPCW_units_getListOfUnits($module->module_id);\n\n foreach ($units as $unit) {\n $num_units++;\n }\n }\n }\n\n //Do some Math here to get the percentage of the course completion.\n $percent_completed = ($num_units_completed / $num_units) * 100;\n\n //Let's keep the percentage to 2 decimal points.\n $percent_completed = number_format($percent_completed, 2, '.', '');\n\n return $percent_completed;\n }",
"public function getPercentual() {\n return $this->nPercentual;\n }",
"function computeProgress($docno, $_ACT_FROM_UM, $_ACT_FROM_READER, $_ACT_FROM_OLDREADER){\n \n $confidence = 0.0;\n $totalhits = 0;\n $coverage = 0.0;\n $clicks = 0;\n $annotations = 0;\n $distinct = 0;\n $npages = 1;\n \n if (isset($_ACT_FROM_UM[$docno])) {\n $totalhits += intval($_ACT_FROM_UM[$docno][\"hits\"]);\n $npages = intval($_ACT_FROM_UM[$docno][\"npages\"]);\n $distinct = 1;\n }\n if (isset($_ACT_FROM_READER[$docno])) {\n $totalhits += $_ACT_FROM_READER[$docno][\"pageloads\"];\n $distinct = $_ACT_FROM_READER[$docno][\"distinctpages\"];\n $npages = $_ACT_FROM_READER[$docno][\"npages\"];\n $clicks = $_ACT_FROM_READER[$docno][\"clicks\"];\n $annotations = $_ACT_FROM_READER[$docno][\"annotations\"];\n \n }\n \n if (isset($_ACT_FROM_OLDREADER[$docno])) {\n $npages = $_ACT_FROM_OLDREADER[$docno][\"npages\"];\n $clicks += $_ACT_FROM_OLDREADER[$docno][\"clicks\"];\n $annotations += $_ACT_FROM_OLDREADER[$docno][\"annotations\"]; \n } \n \n $coverage = 1.0 * $distinct / $npages;//modified by jbarriapineda in 11-28\n \n $loadrate = $totalhits / $npages;\n $actionrate = ($clicks + $annotations) / $npages;\n \n $loadconf = 0.0;\n $actionconf = 0.0;\n \n if ($loadrate > 0) $loadconf = 0.1;\n if ($loadrate > 0.5) $loadconf = 0.25;\n if ($loadrate > 1) $loadconf = 0.5;\n if ($loadrate > 2) $loadconf = 1;\n\n if ($actionrate > 0) $actionconf = 0.1;\n if ($actionrate > 0.5) $actionconf = 0.25;\n if ($actionrate > 1) $actionconf = 0.5;\n if ($actionrate > 2) $actionconf = 1;\n \n $confidence = ($loadconf + $actionconf) / 2;\n if ($coverage>1.0) $coverage = 1.0;\n $coverage=$coverage-0.25;//added by jbarraipineda in 11-28\n if($coverage<0.0) $coverage=0.0;//added by jbarraipineda in 11-28\n return array($coverage,$confidence);\n\n}",
"public function get_progress_percentage( WP_User $user ): int {\n\t\t// TODO: Memoize, tests, hook.\n\n\t\t// TODO: Implement it.\n\t\treturn 0;\n\t}",
"public function positivePercent(){\n\t\treturn round($this->positive*100/($this->positive+$this->negative+$this->indeterminate), 2);\n\t}",
"function getProgress() ;",
"function progress_percentage($events, $attempts) {\n $attemptcount = 0;\n foreach ($events as $event) {\n if(array_key_exists($event['type'].$event['id'], $attempts)) {\n if ($attempts[$event['type'].$event['id']] == 1) {\n $attemptcount++;\n }\n } else {\n }\n }\n $progressvalue = $attemptcount == 0 ? 0 : $attemptcount / count($events);\n return (int)round($progressvalue * 100);\n}",
"private function computeProfileCompletionScore()\n {\n if(0 === count($this->m_arrProfiles))\n {\n if($this->m_bDebugInfo)\n $this->logSection('DebugInfo: ', 'No Profile exists');\n return ;\n }\n \n $itr = count($this->m_arrProfiles);\n \n foreach($this->m_arrProfiles as $key=>$profileInfo)\n {\n try{\n $iProfileId = intval($profileInfo['PROFILEID']);\n $completionObj = ProfileCompletionFactory::getInstance(\"API\",null,$iProfileId);\n $score = $completionObj->updateProfileCompletionScore();\n if($this->m_bDebugInfo)\n {\n $debugInfo = 'DebugInfo : ProfileId -> '.$iProfileId.' and Score -> '.$score;\n $this->logSection($debugInfo);\n }\n unset($completionObj); \n } catch (Exception $ex) {\n if($this->m_bDebugInfo)\n {\n $this->logSection('DebugInfo: ', 'Exception occurred');\n var_dump($ex);\n }\n unset($completionObj); \n }\n }\n \n }",
"public function calculateTotalPercentage()\n {\n return round((($this->totalcovered + $this->totalmaybe) / $this->totallines) * 100, 2);\n }",
"public function getTotalPercentageConversion()\n {\n $percent = 0;\n\n $numberSent = $this->getTotalSumNbReminderSent();\n if ($numberSent > 0) {\n $nbConvertedCarts = $this->getTotalSumNbConvertedCarts();\n $percent = $nbConvertedCarts / $numberSent * 100;\n }\n\n return $percent;\n }",
"public function getCompletionResults()\n {\n return $this->completion_results;\n }",
"private function _calculateCompletePercent(&$subProjectTasks)\n {\n $totalHours = 0;\n $cumulativeDone = 0;\n //update cumulative calculation - mimics gantt calculation\n foreach ($subProjectTasks as $key => &$value)\n {\n if ($value['duration'] == \"\")\n {\n $value['duration'] = 0;\n }\n\n if ($value['percent_complete'] == \"\")\n {\n $value['percent_complete'] = 0;\n }\n\n if ($value['duration_unit'] == \"Hours\")\n {\n $totalHours += $value['duration'];\n $cumulativeDone += $value['duration'] * ($value['percent_complete'] / 100);\n }\n else\n {\n $totalHours += ($value['duration'] * 8);\n $cumulativeDone += ($value['duration'] * 8) * ($value['percent_complete'] / 100);\n }\n }\n\n $cumulativePercentage = 0;\n if ($totalHours != 0)\n {\n $cumulativePercentage = round(($cumulativeDone/$totalHours) * 100);\n }\n return $cumulativePercentage;\n }",
"function get_achievement_percentage($completed, $total, $boolean = false) \n\t{\n\t\t$percentage = 0;\n\t\tif($completed != 0) \n\t\t\t$percentage = ($completed / $total) * 100;\n\t\tif($boolean == true)\n\t\t\treturn number_format($completed, 0) . \" of \" . number_format($total, 0) . \" (\" . number_format($percentage, 0) . \"%)\";\n\t\telse \n\t\t\treturn $percentage;\n\t}",
"public function getProgress()\n {\n return $this->get(self::_PROGRESS);\n }",
"public function getProgress()\n {\n return $this->get(self::_PROGRESS);\n }",
"function getGameProgression()\n { \n // Start or end of game\n $current_state = $this->gamestate->state();\n switch($current_state['name']) {\n case 'gameSetup':\n case 'turn0':\n return 0;\n case 'whoBegins':\n return 1;\n case 'justBeforeGameEnd':\n case 'gameEnd':\n return 100;\n }\n // For other states (all included in player action)\n $players = self::loadPlayersBasicInfos();\n \n // The total progression is a mix of:\n // -the progression of the decreasing number of cards in deck (end of game by score)\n // -the progression of each player in terms of the achievements they get\n \n // Progression in cards\n // Hypothesis: a card of age 9 is drawn three times quicker than a card of age 1. Cards of age 10 are worth six times a card of age 1 because if there are none left it is the end of the game\n $weight = 0;\n $total_weight = 0;\n \n $number_of_cards_in_decks = self::countCardsInLocation(0, 'deck', true);\n for($age=1; $age<=10; $age++) {\n $n = $number_of_cards_in_decks[$age];\n switch($age) {\n case 1:\n $n_max = 14 - 2 * count($players); // number of cards in the deck at the beginning: 14 (15 minus one taken for achievement) minus the cards dealt to the players at the beginning\n $w = 1; // weight for cards of age 1: 1\n break;\n case 10:\n $n++; // one more \"virtual\" card because the game is not over where the tenth age 10 card is drawn (but quite...)\n $n_max = 11; // number of cards in the deck at the beginning: 10, +1 one more \"virtual\" card because the game is not over when the last is drawn\n $w = 6; // weight for cards of age 10: 6\n break;\n default:\n $n_max = 9; // number of cards in the deck at the beginning: 9 (10 minus one taken for achievement)\n $w = ($age-1) / 4 + 1; // weight between 1.25 (for age 2) and 3 (for age 9)\n break;\n };\n $weight += ($n_max - $n) * $w; // What is really important are the cards already drawn\n $total_weight += $n_max * $w;\n }\n $progression_in_cards = $weight/$total_weight;\n \n // Progression of players\n // This is the ratio between the number of achievements the player have got so far and the number of achievements needed to win the game\n $progression_of_players = array();\n $n_max = self::getGameStateValue('number_of_achievements_needed_to_win');\n foreach($players as $player_id=>$player) {\n $n = self::getPlayerNumberOfAchievements($player_id);\n $progression_of_players[] = $n/$n_max;\n }\n \n // If any of the above progression was 100%, the game would be over. So, 100% is a kind of \"absorbing\" element. So,the method is to multiply the complements of the progression.\n // A complement is defined as 100% - progression\n $complement = 1 - $progression_in_cards;\n foreach($progression_of_players as $progression) {\n $complement *= 1 - $progression;\n }\n $final_progression = 1 - $complement;\n \n // Convert the final result in percentage\n $percentage = intval(100 * $final_progression);\n $percentage = min(max(1, $percentage), 99); // Set that progression between 1% and 99%\n return $percentage;\n }",
"public function progress(): int\n {\n return $this->pluck('progress');\n }",
"public function test_course_progress_percentage_with_activities_and_course() {\n global $DB;\n\n // Add a course that supports completion.\n $course = $this->getDataGenerator()->create_course(array('enablecompletion' => 1));\n\n // Enrol a user in the course.\n $user = $this->getDataGenerator()->create_user();\n $studentrole = $DB->get_record('role', array('shortname' => 'student'));\n $this->getDataGenerator()->enrol_user($user->id, $course->id, $studentrole->id);\n\n // Add four activities that use completion.\n $assign = $this->getDataGenerator()->create_module('assign', array('course' => $course->id),\n array('completion' => 1));\n $data = $this->getDataGenerator()->create_module('data', array('course' => $course->id),\n array('completion' => 1));\n $this->getDataGenerator()->create_module('forum', array('course' => $course->id),\n array('completion' => 1));\n $this->getDataGenerator()->create_module('forum', array('course' => $course->id),\n array('completion' => 1));\n\n // Add an activity that does *not* use completion.\n $this->getDataGenerator()->create_module('assign', array('course' => $course->id));\n\n // Mark two of them as completed for a user.\n $cmassign = get_coursemodule_from_id('assign', $assign->cmid);\n $cmdata = get_coursemodule_from_id('data', $data->cmid);\n $completion = new completion_info($course);\n $completion->update_state($cmassign, COMPLETION_COMPLETE, $user->id);\n $completion->update_state($cmdata, COMPLETION_COMPLETE, $user->id);\n\n // Now, mark the course as completed.\n $ccompletion = new completion_completion(array('course' => $course->id, 'userid' => $user->id));\n $ccompletion->mark_complete();\n\n // Check we have received valid data.\n // The course completion takes priority, so should return 100.\n $this->assertEquals('100', \\core_completion\\progress::get_course_progress_percentage($course, $user->id));\n }",
"public static function get_course_progress_percentage($course, $userid = 0) {\n global $USER;\n\n // Make sure we continue with a valid userid.\n if (empty($userid)) {\n $userid = $USER->id;\n }\n\n $completion = new \\completion_info($course);\n\n // First, let's make sure completion is enabled.\n if (!$completion->is_enabled()) {\n return null;\n }\n\n if (!$completion->is_tracked_user($userid)) {\n return null;\n }\n\n // Before we check how many modules have been completed see if the course has.\n if ($completion->is_course_complete($userid)) {\n return 100;\n }\n\n // Get the number of modules that support completion.\n $modules = $completion->get_activities();\n $count = count($modules);\n if (!$count) {\n return null;\n }\n\n // Get the number of modules that have been completed.\n $completed = 0;\n foreach ($modules as $module) {\n $data = $completion->get_data($module, true, $userid);\n $completed += $data->completionstate == COMPLETION_INCOMPLETE ? 0 : 1;\n }\n\n return ($completed / $count) * 100;\n }",
"public function getCompletedAttribute(){\n if ($this->accepter->profile->progress >= 100){\n return 1;\n }\n else{\n return 0;\n } \n }",
"public function getPercent()\n {\n return $this->readOneof(2);\n }",
"public function getBeautyProGlobalPercent() {\n try {\n if (RequestFacade::ajax()) {\n $response = UserServiceProvider::getBeautyProGlobalPercent();\n return $response;\n }\n abort(404);\n\n } catch (Exception $e) {\n Log::error(__CLASS__ . \"::\" . __METHOD__ . ' ' . $e->getFile() . $e->getLine() . $e->getMessage());\n return Redirect::back();\n }\n }",
"public function setPercentageComplete($val)\n {\n $this->_propDict[\"percentageComplete\"] = intval($val);\n return $this;\n }",
"public function getTranslationPercent() {\n\n return !empty($this->result->headers['x-onelinktxpercent']) ?\n $this->result->headers['x-onelinktxpercent'] :\n 0;\n }",
"public function outputProgressPercentage($percentage) {\n\n if($job = $this->getAsyncJob()) {\n $job->setCompletionPercentage($percentage);\n $job->save();\n }\n echo(\"[PROGRESS: \".floor($percentage).\"%]\\n\");\n }",
"public function setPercentComplete($val)\n {\n $this->_propDict[\"percentComplete\"] = $val;\n return $this;\n }",
"private function computeProgressPercent($progress)\n {\n $needsADay = $this->requiredMoney / 20; // ~number of working days\n\n return $progress / $needsADay;\n }",
"public function getMatchedPercent(){\n return $this->percentage;\n }",
"public function getItemsPercentages()\n {\n \treturn StatisticsService::getItemsByTypes();\n }",
"public function user_participation() {\n return (float) number_format($this->usercount / $this->everyoneelsecount, 2);\n }",
"public function getPercentaje() {\n return $percentaje;\n }",
"public function specpercentage() {\n\t\t\tif ($this->linesofcode === NULL || $this->linesofspec === NULL) {\n\t\t\t\treturn NULL;\n\t\t\t} else {\n\t\t\t\treturn round(($this->linesofspec / $this->linesofcode) * 100, 2);\n\t\t\t}\n\t\t}",
"public function test_course_progress_no_activities_using_completion() {\n // Create a course that does support completion.\n $course = $this->getDataGenerator()->create_course(array('enablecompletion' => 1));\n\n // Add an activity that does *not* support completion.\n $this->getDataGenerator()->create_module('assign', array('course' => $course->id));\n\n // Check that the result was null.\n $this->assertNull(\\core_completion\\progress::get_course_progress_percentage($course));\n }",
"public function getPermitApplicationScore()\n {\n $interJourneysDecValue = self::INTERNATIONAL_JOURNEYS_DECIMAL_MAP[$this->internationalJourneys->getId()];\n return $this->getPermitIntensityOfUse() * $interJourneysDecValue;\n }",
"function get_storage_fill_percentage($used, $capacity)\n{\n // Format gigabytes to bytes\n $total = intval(Metric::gigabytes($capacity)->numberOfBytes());\n\n // Count progress\n $progress = ($used * 100) / $total;\n\n // Return in 2 decimal\n return number_format((float)$progress, 2, '.', '');\n}",
"public function getFreeInPercent()\n {\n return $this->getPercentageOfMemory($this->getFreeInMb());\n }",
"public function getProgressAttribute(){\n return $this->accepter->profile->progress;\n }",
"function getUtilisation(){\n\n $total = $this-> getTotalWeight() ;\n \n return round(($total / $this->capacity) * 100, 2);\n\n }",
"private function getBasicAssessmentStatistics()\n {\n // get active runs, users, document groups, and rating options from database\n DatabaseUtils::setEntityManager($this->em);\n $active_run_names = DatabaseUtils::getActiveRuns()['run_names'];\n $active_user_names = DatabaseUtils::getActiveUsers()['active_user_names_without_admins'];\n $active_user_groups = DatabaseUtils::getActiveUsers()['active_user_groups_without_admins'];\n $active_doc_groups = DatabaseUtils::getDocumentGroups()['document_groups'];\n $active_doc_groups_short = DatabaseUtils::getDocumentGroups()['document_groups_short'];\n $rating_levels = DatabaseUtils::getRatingOptions();\n\n // calculate progress for users\n Progress::setEntityManager($this->em);\n $user_progress = $this->getProgressForUsers($active_user_names, $active_user_groups);\n\n // calculate number of total and finished DQCombinations (without multiple assessments)\n $progress_dq = $this->getProgressForDQCombinations();\n $total_assessments = $progress_dq['total'];\n $finished_assessments = $progress_dq['finished'];\n $assessment_prop = $progress_dq['proportion'];\n\n // calculate number of skipped documents\n $skipped = (float)$this->g_repo->assessmentByRating(Constants::SKIPPED)[0][\"col_\" . Constants::SKIPPED];\n\n // calculate progress for all document groups\n $progress_groups = $this->getProgressForDocGroups($active_doc_groups_short);\n $nr_evaluations = $progress_groups['nr_evaluations'];\n $doc_groups_assessments_total = $progress_groups['doc_groups_assessments_total'];\n $doc_groups_assessments = $progress_groups['doc_groups_assessments'];\n $doc_groups_assessments_complete = $progress_groups['doc_groups_assessments_complete'];\n\n // calculate progress for multiple assessments\n $mltple = $this->getProgressForMultipleAssessments(\n $active_doc_groups_short,\n $finished_assessments,\n $doc_groups_assessments_total,\n $doc_groups_assessments_complete\n );\n $total_incl_multiple = $mltple['total_incl_multiple'];\n $finished_incl_multiple = $mltple['finished_incl_multiple'];\n $finished_incl_multiple_prop = $mltple['finished_incl_multiple_prop'];\n\n // get ratings for all runs\n $run_ratings = $this->countRatingsForRuns(\n $this->g_repo,\n $rating_levels,\n $active_run_names\n );\n $run_data = $this->getNumbersForRuns($this->g_repo, $active_run_names);\n $run_nr_assessed = $run_data['assessed'];\n $run_nr_total = $run_data['total'];\n\n // calculate progress for different rating options in all runs\n /** @var $rel_lev RatingOption */\n $rating_for_different_levels = array();\n if ($rating_levels != null) {\n foreach ($rating_levels as $rel_lev) {\n $rating_for_different_levels[$rel_lev->getName()] =\n (float)$this->g_repo->assessmentByRating(\n $rel_lev->getName(),\n $rel_lev->getShortName()\n )[0][\"col_\" . $rel_lev->getShortName()];\n }\n }\n\n return array(\n 'run_names' => $active_run_names,\n 'user_names' => $active_user_names,\n 'doc_groups_names' => $active_doc_groups,\n 'doc_groups' => $active_doc_groups_short,\n 'user_progress' => $user_progress,\n 'total_assessments' => $total_assessments,\n 'finished_assessments' => $finished_assessments,\n 'assessment_prop' => $assessment_prop,\n 'skipped' => $skipped,\n 'nr_evaluations' => $nr_evaluations,\n 'doc_groups_assessments_total' => $doc_groups_assessments_total,\n 'doc_groups_assessments' => $doc_groups_assessments,\n 'doc_groups_assessments_complete' => $doc_groups_assessments_complete,\n 'total_incl_multiple' => $total_incl_multiple,\n 'finished_incl_multiple' => $finished_incl_multiple,\n 'finished_incl_multiple_prop' => $finished_incl_multiple_prop,\n 'rating_levels_in_runs' => $run_ratings,\n 'run_number_assessed' => $run_nr_assessed,\n 'run_number_total' => $run_nr_total,\n 'rating_for_different_levels' => $rating_for_different_levels\n );\n }",
"public function getProgressWait(): int\n {\n return $this->progress_wait;\n }",
"public function getUsage()\n {\n return isset($this->usage) ? $this->usage : 0.0;\n }",
"public function setPercentComplete($value)\n {\n $this->setItemValue('percent_complete', (string)$value);\n }",
"public function getWastedInPercent()\n {\n return $this->getPercentageOfMemory($this->getWastedInMb());\n }",
"public function averageRatingAsPercentage() : float\n {\n $range = config('rateable.minimum') > 0 ? config('rateable.maximum') - config('rateable.minimum') : config('rateable.maximum');\n return ($this->ratings()->count() * $range) != 0 ? $this->sumRating() / ($this->ratings()->count() * $range) * 100 : 0;\n }",
"public function getProcessorCoreCountCheckFailedPercentage()\n {\n if (array_key_exists(\"processorCoreCountCheckFailedPercentage\", $this->_propDict)) {\n return $this->_propDict[\"processorCoreCountCheckFailedPercentage\"];\n } else {\n return null;\n }\n }",
"public function getPercentCssClass() {\n if ($this->percent > 80) {\n return 'success';\n }\n if ($this->percent > 65) {\n return 'warning';\n }\n if ($this->percent >= 0) {\n return 'danger';\n }\n return 'info';\n }",
"public static function getRAPHPFrameworkAverageLoading ();",
"public function setPercentCompleted($var)\n {\n GPBUtil::checkUint32($var);\n $this->percent_completed = $var;\n\n return $this;\n }",
"public function getProgress()\n {\n return $this->progress;\n }",
"public function getPerfection(): float\n {\n return round($this->getTotal() / 45, 3) * 100;\n }",
"public function getPermitIntensityOfUse()\n {\n return $this->permitsRequired > 0 ? $this->trips / $this->permitsRequired : 0;\n }",
"public function getPercentageFirstConversion()\n {\n $percent = 0;\n $nbSent = $this->getNbFirstReminderSent();\n if ($nbSent) {\n $nbConverted = $this->getNbFirstReminderConverted();\n $percent = $nbConverted / $nbSent * 100;\n }\n\n return $percent;\n }",
"public function getOsCheckFailedPercentage()\n {\n if (array_key_exists(\"osCheckFailedPercentage\", $this->_propDict)) {\n return $this->_propDict[\"osCheckFailedPercentage\"];\n } else {\n return null;\n }\n }",
"private function calcDiscountPercent()\n\t{\n\t if( $this->db->table_exists($this->c_table)) $record = $this->db->query(\"select * from {$this->c_table} where products_count<=? and order_amount<=? order by discount_percent desc\",array($this->products_count,$this->order_amount))->row_array();\n\t if(!@$record) return 0;\n\t return $record['discount_percent'];\n\t}",
"public function compression_percentage ()\n {\n if (isset ($this->compressed_size))\n {\n if ($this->size <= $this->compressed_size)\n {\n return 0;\n }\n\n return 100 * round (($this->size - $this->compressed_size) / $this->size, 2);\n }\n\n return 0;\n }",
"private function getSkillPercent($level){\t\n\t\t//echo sprintf('Level %s: %s | ', $level, $value);\t\n\t\treturn 1 + ((5 * $level) / 100);\t\n\t}",
"public function getSeekersPercentage() : int {\r\n\r\n return (int) $this->getMain()->getDatabase()->get(\"seekers_percentage\", [\"table\" => \"Games\", \"name\" => $this->getName()])->fetchArray()[0];\r\n\r\n }",
"public function getResultForAudit( Audit $audit )\n {\n if ( null !== $auditform = $audit->getForm() )\n {\n $sections = $auditform->getSections();\n $count = count( $sections );\n if ( 0 == $count ) return 100;\n $totalPercent = 0;\n $divisor = 0;\n $audit->setFlag( FALSE );\n $index = $audit->getFormIndexes();\n foreach ( $sections as $section )\n {\n if( FALSE === in_array( $section->getId(), $index['sections']) ) continue;\n $percent = $this->getResultForSection( $audit, $section );\n $weight = $this->getWeightForSection( $audit, $section );\n $sectionFlag = $this->getFlagForSection( $audit, $section );\n\n if ( $sectionFlag ) $audit->setFlag( TRUE );\n $divisor += $weight;\n if( $divisor > 0 )\n {\n $totalPercent = $totalPercent * ( $divisor - $weight ) / $divisor + $percent * $weight / $divisor;\n }\n }\n\n return number_format( $totalPercent, 2, '.', '' );\n }\n else\n return 0;\n }",
"public function form_footer_progress_status_percentage_html() {\n\n\t\t?>\n\t\t<div class=\"wpforms-conversational-form-footer-progress-status-percentage\">\n\t\t\t<?php\n\t\t\tprintf(\n\t\t\t\t/* translators: %s - Percentage of fields completed. */\n\t\t\t\t\\esc_html__(\n\t\t\t\t\t'%s%% completed',\n\t\t\t\t\t'wpforms-conversational-forms'\n\t\t\t\t),\n\t\t\t\t'<span class=\"completed\">100</span>'\n\t\t\t);\n\t\t\t?>\n\t\t</div>\n\t\t<?php\n\t}",
"public function getUsedInPercent()\n {\n return $this->getPercentageOfMemory($this->getUsedInMb());\n }",
"public function setPercentComplete(?int $value): void {\n $this->getBackingStore()->set('percentComplete', $value);\n }"
]
| [
"0.6884999",
"0.67731214",
"0.6702122",
"0.6677123",
"0.6529506",
"0.6520701",
"0.6495131",
"0.6405681",
"0.6253002",
"0.6239268",
"0.6070016",
"0.6059016",
"0.60315907",
"0.5914786",
"0.59082884",
"0.5845962",
"0.58259296",
"0.5804386",
"0.57900715",
"0.5783191",
"0.5777193",
"0.57496566",
"0.5718898",
"0.5689251",
"0.5677458",
"0.5668826",
"0.5653384",
"0.56264246",
"0.56027806",
"0.55714023",
"0.5546877",
"0.5542326",
"0.55196095",
"0.5517155",
"0.55136555",
"0.550362",
"0.547991",
"0.54781204",
"0.547155",
"0.5463819",
"0.5452802",
"0.54486036",
"0.5446829",
"0.5440358",
"0.5436208",
"0.54351765",
"0.54341215",
"0.5431862",
"0.54311126",
"0.5421349",
"0.54187936",
"0.541824",
"0.54162705",
"0.54162705",
"0.54132044",
"0.54066783",
"0.53957856",
"0.53795964",
"0.5372528",
"0.53594387",
"0.5308938",
"0.5305538",
"0.52991027",
"0.5287815",
"0.5278787",
"0.52705604",
"0.5251932",
"0.5244574",
"0.52360874",
"0.5225715",
"0.52248436",
"0.5223495",
"0.52222395",
"0.52154785",
"0.5208898",
"0.51949763",
"0.51623714",
"0.51619935",
"0.51487696",
"0.5127224",
"0.51243514",
"0.5115963",
"0.51127887",
"0.5111678",
"0.5109235",
"0.510732",
"0.51007575",
"0.50951517",
"0.5093875",
"0.50932264",
"0.5091021",
"0.50903815",
"0.5076802",
"0.507196",
"0.50707835",
"0.5065913",
"0.50555307",
"0.5035898",
"0.50232",
"0.5011494"
]
| 0.71300673 | 0 |
Checks if legal document file is Editable | public function isLegalDocumentEditable ($legalDocuments = array())
{
$isEditable = false;
if (sizeof($legalDocuments) > 0) {
foreach ($legalDocuments as $legalDocument) {
if ( (bool) $legalDocument->getIsEditable() === true) {
$isEditable = true;
break;
}
}
}
return $isEditable;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function canEdit() {}",
"public function isEditOnlyMode();",
"function canEdit() {\n\t\t\treturn true;\n\t\t}",
"public function canEdit()\n {\n return true;\n }",
"public function isEditable() {}",
"public function isEditable();",
"public function isEditable();",
"protected function is_editable($file_model) {\n $allowed_types = array_map('strtolower', $this->config['security']['editRestrictions']);\n return in_array(strtolower($file_model['attributes']['extension']), $allowed_types);\n }",
"public function can_edit() {\n return true;\n }",
"public function canEdit()\n {\n return $this->is_locked == 0;\n }",
"function validate_file_to_edit($file, $allowed_files = array())\n {\n }",
"public function isEditor()\n {\n $int;\n foreach ( $this->u_r_id as $int )\n {\n if($int==2)\n return true;\n }\n return false;\n }",
"public function isEditable()\n\t{\n\t\tif (($this->getName() === 'publicid') || ($this->getName() === 'posturl')) {\n\t\t\treturn false;\n\t\t}\n\t\treturn true;\n\t}",
"public function isSwitchToEditEnabled();",
"public function is_editable() {\n\t\treturn false;\n\t}",
"public function is_allowed_to_edit_content_object()\n {\n return $this->is_allowed(WeblcmsRights::EDIT_RIGHT, $this->publication) &&\n $this->publication->get_allow_collaboration();\n }",
"public function canEdit() {\n\t\treturn $this->_perms->checkModuleItem ( $this->_tbl_module, 'edit' );\n\t}",
"public function canBeEdited() {}",
"public function checkPermissions() {\r\n\t\treturn $this->modx->hasPermission('edit_document');\r\n\t}",
"function canEdit() {\r\n\t\t$user\t=& JFactory::getUser();\r\n\r\n\t\tif (!JAccess::check($user->id, 'core.admin', 'root.1')) {\r\n\t\t\t\t$permission = FlexicontentHelperPerm::getPerm();\r\n\t\t\t\t$id = $this->getState($this->getName().'.id');\r\n\t\t\t\tif ($id) {\r\n\t\t\t\t\t$rights \t= FlexicontentHelperPerm::checkAllItemAccess($uid, 'item', $id);\r\n\t\t\t\t\t$canEdit \t= in_array('flexicontent.editall', $rights) || $permission->CanEdit;\r\n\t\t\t\t\t$canEditOwn\t= (in_array('flexicontent.editown', $rights) && ($item->created_by == $user->id));\r\n\t\t\t\t\tif ($canEdit || $canEditOwn) return true;\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t}\r\n\t\t}\r\n\t\treturn true;\r\n\t}",
"function caldol_can_edit_file($authorID){\n\tglobal $current_user;\n\n\t\n\t//echo $current_user->ID. \", \" . $post->post_author;\n\tif($current_user->ID == $authorID || current_user_can('edit_others_posts')){\n\t\treturn true;\n\t}\n\treturn false;\n}",
"public function is_editing() {\n\n\t\tif ( 'edit' !== Param::get( 'action' ) ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn Param::get( 'redirection', false, FILTER_VALIDATE_INT );\n\t}",
"public function user_can_edit() {\n if (has_capability('mod/swipe:manage', $this->context)) {\n return true;\n }\n }",
"public function isEditable()\n {\n return $this->_editable;\n }",
"public function isEditor(){\n\t\tif($_SESSION['waf_user']['editor']==1)return true;\n\t\telse return false;\n\t}",
"public function canBeEdited()\n {\n return false;\n }",
"public function can_edit() {\n\t\t$can_edit = false;\n\t\t\n\t\t// is the user the owner of the package and the package is in edit mode?\n\t\tif ( ($this->get_user_id() == get_current_user_id()) && ($this->status == 1) ) {\n\t\t\t$can_edit = true;\n\t\t} else {\n\t\t\t// is the user an admin (has the right to edit all packages)\n\t\t\tif ( current_user_can( 'pvm_edit_other_packages' ) ) {\n\t\t\t\t$can_edit = true;\n\t\t\t}\n\t\t}\n\t\t\n\t\treturn $can_edit;\n\t}",
"abstract function allowEditAction();",
"public function enabledInEditMode()\n\t{\n\t\treturn false;\n\t}",
"public function isEditAction() {}",
"public static function getEditMode(): bool\n\t{\n\t\treturn self::$editMode;\n\t}",
"function CheckEditorAccess () {\n global $zOLDAPPLE, $zLOCALUSER; \n\n // Check if user has ownership access to this page.\n if ($this->userAuth_uID != $zLOCALUSER->uID) {\n // Error out if user does not have access privileges.\n if ($zLOCALUSER->userAccess->e == FALSE) {\n return (FALSE);\n } // if\n } // if\n\n return (TRUE);\n }",
"public function canEdit(File $file)\n {\n return $this->checkFrontendUserPermissionsFile('userGroupAllowEditFiles', $file);\n }",
"private function isEditor() : bool\n {\n return $this->role('editor');\n }",
"protected function isPageEditable()\n {\n if ($this->getBackendUser()->isAdmin()) {\n return true;\n }\n return !$this->pageinfo['editlock'] && $this->getBackendUser()->doesUserHaveAccess($this->pageinfo, Permission::PAGE_EDIT);\n }",
"public function editable()\n {\n if ($this->getMode() == \"only_external\") {\n return false;\n }\n if ($this->hasScript()) {\n // can't edit calculated fields\n return false;\n }\n if (!isset($this->data[\"editable\"])) {\n return true;\n }\n return (true == $this->data[\"editable\"]);\n }",
"abstract public function canEdit($user_guid = 0);",
"public function adminViewFileEdits()\r\n\t{\r\n\t\treturn false;\r\n\t}",
"public function isEditable($id)\n\t{\n\t\t// TODO: Implement isEditable() method.\n\t}",
"protected function is_edit_page() {\n\t\treturn false;\n\t}",
"protected function allowEdit($data = array(), $key = 'a_id')\n\t{\n\t\treturn true;\n\t}",
"function isFile() {\n\t\treturn $this->repoObj->lobSubType == 'document';\n\t}",
"function rich_edit_exists()\n {\n }",
"public function isEditable($operation = OperationTypes::OP_UPDATE, $ignore_op = FALSE);",
"public function canEdit()\n {\n if(!Auth::check())\n {\n return false;\n }\n //If the user is active/logged in, return true so that we can display user's specific objects\n if(Auth::user()->id===$this->user_id)\n {\n return true;\n }\n //By default\n return false;\n }",
"public function canSetFileable();",
"public function getEditMode()\n {\n $page = $this->getPage();\n\n if (!$page->canEdit()) {\n $this->endEditing();\n return false;\n }\n\n $stage = Versioned::get_stage();\n if ($stage != Versioned::DRAFT) {\n return false;\n }\n\n // one-off preview that does _not_ stop edit mode\n if ($this->getRequest()->getVar('preview')) {\n return false;\n }\n\n return true;\n }",
"private function editFile()\n {\n $payload = json_decode(file_get_contents('php://input'));\n if (!isset($payload)) {\n $this->info = 'No input data';\n return false;\n }\n $fileName = strtolower($payload->path) . CONTENT_EXT;\n if (!file_exists(CONTENT_DIR . $fileName)) {\n $this->info = 'File not exist';\n return false;\n }\n if (\n strlen($fileName) > strlen(CONTENT_EXT) &&\n file_put_contents(CONTENT_DIR . $fileName, $payload->content)\n ) {\n return true;\n }\n return false;\n }",
"protected function isCurrentPageContentModelEditable() {\n\t\t$contentHandler = $this->getContentHandler();\n\n\t\treturn $contentHandler->supportsDirectEditing()\n\t\t\t&& $contentHandler->supportsDirectApiEditing();\n\t}",
"protected function allowEdit($data = array(), $key = 'id')\n {\n return true;\n }",
"public function isEditable()\n\t{\n\t\tif(Auth::check())\n\t\t{\n\t\t\tif(Auth::user()->id == $this->author_id)\n\t\t\t{\n\t\t\t\tif ($this->created_at->diffInMinutes(Carbon::now()) < 30)\n\t\t\t\t{\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tif(Auth::user()->hasRole(['moderator', 'administrator', 'super user'])) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"protected function check_edit_permission($comment)\n {\n }",
"public function canEdit()\n {\n if (!$this->site) {\n return false;\n }\n\n if (!$this->current_user) {\n return false;\n }\n\n if ($this->site->userIsVerified($this->current_user)) {\n return true;\n }\n\n return false;\n }",
"function eman_post_editable( $post )\n{\n\tif ( is_numeric($post) ) $post = get_post($post);\n\tif ( ! is_object($post) ) return false;\n\n\t// Settings area always editable\n\tif ( emanager_post::is_settings($post) ) return true;\n\n\t$status = emanager_post::status($post, 'slug');\n\n\t// If no status yet or is in draft or revise, it is editable\n\tif ( 'draft' == $status || 'revise' == $status ) return true;\n\n\treturn false;\n}",
"private function is_editor() {\n\t\tif ( is_user_logged_in() ) {\n\t\t\t// A global admin can edit content or change options anywhere.\n\t\t\tif ( is_super_admin() ) {\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\t$user = wp_get_current_user();\n\n\t\t\t// On the WSUWP Platform, a network admin can edit content or change options\n\t\t\t// anywhere on an individual network and may not have a role assigned.\n\t\t\tif ( function_exists( 'wsuwp_is_network_admin' ) ) {\n\t\t\t\tif ( wsuwp_is_network_admin( $user->user_login ) ) {\n\t\t\t\t\treturn true;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Authors and above have (at least) the ability to publish content or delete\n\t\t\t// published content at some level.\n\t\t\t$allowed_roles = array( 'editor', 'administrator', 'author' );\n\t\t\tif ( array_intersect( $allowed_roles, $user->roles ) ) {\n\t\t\t\treturn true;\n\t\t\t}\n\t\t}\n\n\t\treturn false;\n\t}",
"private function isEditMode(){\n\t\tif(isset($this->AddRecordInsertData) and count($this->AddRecordInsertData) > 0 )\n\t\t\treturn true;\n\t\treturn false;\n\t}",
"function field_edit($name)\r\n {\r\n if (right::superuser()) return (true);\r\n \r\n $rightArray = right::get_field($name);\r\n $userRight = right::get(\"rights\");\r\n\r\n if ($rightArray[edit]) return($userRight & $rightArray[edit]);\r\n else return(false); // default no edit\r\n }",
"protected function allowEdit($data = array(), $key = 'id')\n\t{\n\t\treturn JFactory::getUser()->authorise('core.manage', $this->option);\n\t}",
"static function has_edit_screen(): bool { return true; }",
"public function isEditable()\n {\n // Need to be able to save the DataObject if this is being called during PublishTargetJob.\n if ($this->owner->getIsPublishJobRunning()) {\n return true;\n }\n\n // Need to be able to save the DataObject if this is being called during UnPublishTargetJob.\n if ($this->owner->getIsUnPublishJobRunning()) {\n return true;\n }\n\n if ($this->owner->config()->get('allow_embargoed_editing')) {\n return true;\n }\n\n if ($this->owner->getIsPublishScheduled()) {\n return false;\n }\n\n $embargoRecordIsEditable = $this->owner->invokeWithExtensions('embargoRecordIsEditable');\n if (in_array(false, $embargoRecordIsEditable)) {\n return false;\n }\n\n return true;\n }",
"function canEdit() {\r\n\t\tif($this->owner->ID == Member::currentUserID())\r\n\t\t\treturn true;\r\n\r\n\t\t$member = Member::currentUser();\r\n\t\tif($member)\r\n\t\t\treturn $member->isAdmin();\r\n\r\n\t\treturn false;\r\n\t}",
"public function can_manage_files() {\n return true;\n }",
"function canEditPage(Page $page) {\n return ($this->isAdmin() || ($this->id == $page->getCreatorId()));\n }",
"public function getUserCanEditAttribute()\n {\n return AccessControl::check($this, 'edit_post', false);\n }",
"public static function isEditable($extension)\n\t{\n\t\t$extension = mb_strtolower($extension);\n\t\t$editableExtensions = static::listEditableExtensions();\n\n\t\treturn\n\t\t\tin_array($extension, $editableExtensions, true)\n\t\t\t|| in_array(ltrim($extension, '.'), $editableExtensions, true)\n\t\t;\n\t}",
"public function isEditorial()\n {\n return $this->getData('isEditorial', false) === true;\n }",
"public function isEditor()\n {\n return $this->role()->where('id', $this->roles['EDITOR'])->exists();\n }",
"public function isFileOperationAllowed() {}",
"public function getCanEditAttribute()\n {\n // Are you the owner if the note?\n return Auth::id() == $this->user_id;\n }",
"private function is_elementor_editor()\n {\n if ((isset($_REQUEST['action']) && 'elementor' == $_REQUEST['action']) ||\n isset($_REQUEST['elementor-preview'])\n ) {\n return true;\n }\n\n return false;\n }",
"function get_real_file_to_edit($file)\n {\n }",
"public function isDoc($ext=null){\n global $VALID_DOCS;\n if (!$ext)\n $ext = $this->ext; \n return (in_array( $ext, $VALID_DOCS )); \n }",
"public function is_allowed_to_edit_content_object(ComplexContentObjectPathNode $node);",
"public function contentIsNotLockedForEditors()\n {\n return $this->getBackendUser()->isAdmin() || ($this->CALC_PERMS & Permission::CONTENT_EDIT) === Permission::CONTENT_EDIT && !$this->pageinfo['editlock'];\n }",
"function is_editor($shared)\n{\n\n return $shared->permission === 'editor';\n}",
"public function testAllowEditing()\n {\n $this->assertFalse(LogEntry::create()->canEdit());\n }",
"protected function allowEdit($data = array(), $key = 'id')\n {\n $id = isset( $data[ $key ] ) ? $data[ $key ] : 0;\n if( !empty( $id ) )\n {\n return JFactory::getUser()->authorise( \"core.edit\", \"com_mkarta.analysis.\" . $id );\n }\n }",
"protected function isCurrentPageEditableByUser() {\n\n\t\t$title = $this->getTitle();\n\t\t$user = $this->getUser();\n\t\treturn $title->quickUserCan( 'edit', $user )\n\t\t\t&& ( $title->exists() || $title->quickUserCan( 'create', $user ) );\n\t}",
"protected function allowEdit($data = array(), $key = 'id')\r\n\t{\n\t\t// Check specific edit permission then general edit permission.\n\t\t$user = JFactory::getUser();\n\n\t\treturn $user->authorise('meeting.edit', 'com_bigbluebutton.meeting.'. ((int) isset($data[$key]) ? $data[$key] : 0)) or $user->authorise('meeting.edit', 'com_bigbluebutton');\r\n\t}",
"public function isFrontendEditingActive() {}",
"public function isEditor(): bool\n {\n return $this->getClaimSafe(SharedClaimsInterface::CLAIM_USER_ROLE) === self::$userRoleEditor;\n }",
"function is_elementor_editor() {\n\t\treturn is_admin() && ( isset( $_GET['action'] ) && sanitize_text_field( $_GET['action'] ) === 'elementor' );\n\t}",
"protected function allowEdit($data = array(), $key = 'id')\n\t\t{\n\t\t\t\t// Check specific edit permission then general edit permission.\n\t\t\t\treturn JFactory::getUser()->authorise('core.edit', 'com_helloworld.message.' . ((int) isset($data[$key]) ? $data[$key] : 0)) or parent::allowEdit($data, $key);\n\t\t}",
"public function isValidEditingStatus()\n {\n return ($this->ID == 0 || $this->Status == self::STATUS_NEW || $this->Status == self::STATUS_FAILED);\n }",
"function wp_is_file_mod_allowed($context)\n {\n }",
"public function is_edit_page() {\n\t\t\tglobal $current_screen;\n\n\t\t\treturn in_array( $current_screen->id, (array) $this->_meta_box['pages'] );\n\t\t}",
"protected function is_course_editor() {\n if (!$this->getSession()->getPage()->findLink(get_string('turneditingoff')) &&\n !$this->getSession()->getPage()->findLink(get_string('turneditingon'))) {\n return false;\n }\n\n return true;\n }",
"public function isOrderEditable()\n {\n return !\\XLite::isFreeLicense();\n }",
"public function canEdit(ConclusionInterface $conclusion);",
"protected function canEdit(Model $model)\n {\n return true;\n }",
"public function canEdit()\n\t{\n\t\tif ( $this->deleteOrMoveQueued() === TRUE )\n\t\t{\n\t\t\treturn FALSE;\n\t\t}\n\t\t\n\t\tif( static::restrictionCheck( 'edit' ) )\n\t\t{\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tif( isset( static::$ownerTypes['member'] ) and static::$ownerTypes['member'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['member'];\n\n\t\t\tif( $this->$column and $this->$column == \\IPS\\Member::loggedIn()->member_id )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\n\t\tif( isset( static::$ownerTypes['group'] ) and static::$ownerTypes['group'] !== NULL )\n\t\t{\n\t\t\t$column\t= static::$ownerTypes['group']['ids'];\n\t\t\n\t\t\t$value = $this->$column;\n\t\t\tif( count( array_intersect( explode( \",\", $value ), \\IPS\\Member::loggedIn()->groups ) ) )\n\t\t\t{\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\n\t\treturn FALSE;\n\t}",
"protected function allowedToEdit($table, array $dataArray, array $conf, $checkEditAccessInternals = true)\n {\n // Unless permissions specifically allow it, editing is not allowed.\n $mayEdit = false;\n\n // Basic check if use is allowed to edit a record of this kind (based on TCA configuration)\n if ($checkEditAccessInternals) {\n $editAccessInternals = $GLOBALS['BE_USER']->recordEditAccessInternals($table, $dataArray, false, false);\n } else {\n $editAccessInternals = true;\n }\n\n\n if ($editAccessInternals) {\n if ($table === 'pages') {\n // 2 = permission to edit the page\n if ($GLOBALS['BE_USER']->isAdmin() || $GLOBALS['BE_USER']->doesUserHaveAccess($dataArray, 2)) {\n $mayEdit = true;\n }\n } elseif ($table === 'tt_content') {\n // 16 = permission to edit content on the page\n if ($GLOBALS['BE_USER']->isAdmin() || $GLOBALS['BE_USER']->doesUserHaveAccess(\n \\TYPO3\\CMS\\Backend\\Utility\\BackendUtility::getRecord('pages', $dataArray['pid']),\n 16\n )) {\n $mayEdit = true;\n }\n } else {\n $mayEdit = true;\n // neither page nor content\n }\n\n // Permissions\n if (!$conf['onlyCurrentPid'] || ($dataArray['pid'] == $GLOBALS['TSFE']->id)) {\n $types = \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::trimExplode(\n ',',\n \\TYPO3\\CMS\\Core\\Utility\\GeneralUtility::strtolower($conf['allow']),\n 1\n );\n $allow = array_flip($types);\n\n $perms = $GLOBALS['BE_USER']->calcPerms($GLOBALS['TSFE']->page);\n\n if ($table === 'pages') {\n $allow = $this->getAllowedEditActions($table, $conf, $dataArray['pid'], $allow);\n\n // Can only display editbox if there are options in the menu\n if (count($allow)) {\n $mayEdit = true;\n }\n } else {\n if ($table === 'tt_content') {\n // user may edit the content if he has an allowed edit action and if the permission\n // for the content is odd and not 1 explanation of permissions:\n // show=1,edit=2,delete=4,new=8,editcontent=16\n // assuming that show must be set to have content editable,\n // each permission is odd, but show itself isn't sufficient\n $mayEdit = count($allow) && ($perms & 1 && $perms !== 1) ? true : false;\n } else {\n // user may edit the content if he has an allowed edit action and\n // if the permission for the content is odd and not 1\n // explanation of permissions: show=1,edit=2,delete=4,new=8,editcontent=16\n // assuming that show must be set to have content editable,\n // each permission is odd, but show itself isn't sufficient\n $mayEdit = ($perms & 1 && $perms !== 1);\n }\n }\n }\n }\n\n return $mayEdit;\n }",
"function userCanEditPage()\n\t{\n\t\t// use Yawp::authUsername() instead of $this->username because\n\t\t// we need to know if the user is authenticated or not.\n\t\treturn $this->acl->pageEdit(Yawp::authUsername(), $this->area, \n\t\t\t$this->page);\n\t}",
"public function isReadableFile(): bool {\n return is_readable($this) && is_file($this);\n }",
"function fusion_should_add_fe_edit_link() {\n\tif ( 0 === fusion_library()->get_page_id() || false === fusion_library()->get_page_id() || '0-archive' === fusion_library()->get_page_id() || is_preview_only() ) {\n\t\treturn false;\n\t}\n\n\treturn true;\n}",
"public function isEditable($softwareid)\n\t\t{\n\n\t\t\t$data = $this->getSoftwareData($softwareid);\n\n\t\t\tif (empty($data))\n\t\t\t{\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif (isset($data['editable']) == false)\n\t\t\t{\n\n\t\t\t\treturn true;\n\t\t\t}\n\n\t\t\tif ($data['editable'] == false)\n\t\t\t{\n\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\treturn true;\n\t\t}",
"public function isReadOnlyReal(): bool\n {\n return ($this->getFlags() & ast\\flags\\MODIFIER_READONLY) !== 0;\n }",
"public function isEditable() {\n\t\tif ($this->isVariable()) {\n\t\t\t$editables = $this->parent->editables();\n\t\t\tif (empty($editables)) {\n\t\t\t\treturn $this->isValueEditable;\n\t\t\t}\n\t\t\treturn ((in_array($this->parsedVarName, $editables) !== false) && $this->isValueEditable);\n\t\t}\n\t\treturn false;\n\t}",
"public function canBeEdited()\n {\n return true; ///< Every client sees only it's own information\n }",
"public function canEdit($member = null) {\n\t\treturn false;\n\t}"
]
| [
"0.7266309",
"0.7257195",
"0.7204004",
"0.7085816",
"0.7047957",
"0.6992864",
"0.6992864",
"0.69790864",
"0.6937631",
"0.67781246",
"0.6770697",
"0.66754687",
"0.66665685",
"0.6637125",
"0.6614065",
"0.6588619",
"0.6576899",
"0.65677744",
"0.65570724",
"0.65534115",
"0.6531711",
"0.63816756",
"0.6369372",
"0.6355685",
"0.6341372",
"0.6340011",
"0.63353366",
"0.6320245",
"0.6302557",
"0.6270122",
"0.6258593",
"0.62464267",
"0.6218319",
"0.6209001",
"0.61701745",
"0.61468226",
"0.61218476",
"0.608875",
"0.60816246",
"0.608091",
"0.60764945",
"0.6069979",
"0.6062466",
"0.606185",
"0.6057833",
"0.6057811",
"0.6034534",
"0.60329014",
"0.6022002",
"0.5997012",
"0.5983585",
"0.59822583",
"0.5981815",
"0.5981768",
"0.59719896",
"0.59667367",
"0.5948547",
"0.59359705",
"0.59321743",
"0.59312886",
"0.5926202",
"0.59249926",
"0.59222555",
"0.5905691",
"0.5883632",
"0.5857445",
"0.58506036",
"0.58413446",
"0.5833874",
"0.5831349",
"0.5830741",
"0.580286",
"0.5801532",
"0.5793345",
"0.5790279",
"0.5788603",
"0.5788409",
"0.5767416",
"0.57651424",
"0.5759956",
"0.57525814",
"0.57515365",
"0.57504404",
"0.5748661",
"0.57373935",
"0.57253057",
"0.57228994",
"0.57180685",
"0.5701443",
"0.5700029",
"0.5695405",
"0.56884855",
"0.5674467",
"0.56626487",
"0.56618613",
"0.56506723",
"0.56456",
"0.56433797",
"0.56361043",
"0.56270057"
]
| 0.6518872 | 21 |
Manage Create or Update of User Occupation | public function submitOccupation (User $user, $company, $job)
{
$userOccupation = $this->em->getRepository('YilinkerCoreBundle:UserOccupation')->findOneByUser($user);
if ($userOccupation instanceof UserOccupation) {
$this->updateOccupation($userOccupation, $company, $job);
}
else {
$this->createOccupation ($user, $company, $job);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function create()\n\t{\n\t\t$data = ['user_role_id' => USER_ROLE_ADMINISTRATOR];\n\t\tif ($id = $this->users_model->save($data)) {\n\n\t\t\t//if user has not access to update\n\t\t\t$this->session->set_userdata(['new_item' => ['module' => 'administrators', 'id' => $id]]);\n\n\t\t\tredirect(\"/admin/users/update/$id\");\n\t\t}\n\t\telse {\n\t\t\t$this->pls_alert_lib->set_flash_messages('error', lang('admin_create_failed'));\n\t\t\tredirect(\"/admin/administrators\");\n\t\t}\n\t}",
"public function testUpdateUser()\n {\n }",
"function createUsers(){\n\n\t\t\n\t\t\n\t\t$this->copyFrom('POST');\n\t\t$this->save(); // execute\n\t}",
"public function actionCreate() {\n $this->actionUpdate();\n }",
"function admin_insert_new_user(){\r\n\t\tif(isset($_POST['doctor_create_user'])){\r\n\t\t\t$result['insert_new_user_data'] = $this->model->insert_new_user();\r\n\t\t\tredirect('Doctor_control/admin_create_new_user'); \r\n\t\t}\r\n\t\tif(isset($_POST['doctor_update_user'])){\r\n\t\t\tif($this->model->update_new_user_record()){\r\n\t\t\t\tredirect('Doctor_control/admin_create_new_user'); \r\n\t\t\t} \r\n\t\t} \r\n\t}",
"public function actionCreate()\n\t{\n $this->actionUpdate();\n\t}",
"public function create()\n {\n $data['id'] = $this->db->order_by('id', 'desc')->get($this->User->table)->row()->id + 1;\n \n $this->Helper->view('user/create', $data);\n }",
"public function create()\n {\n $this->resetFields();\n //DAN MEMBUKA AREA\n $this->openUser();\n }",
"public function AutomaticCreateBasedAdmin(){\n $resp = employees::find(1);\n if(!$resp){\n employees::create([\n 'emp_name'=>'admin',\n 'emp_password'=>'test',\n 'emp_address'=>'abc',\n 'emp_phone'=>'0000000000',\n 'emp_dob'=> new DateTime(),\n 'pos_id'=>1,\n ]);\n }else{\n $resp->pos_id = 1;\n $resp->save();\n }\n }",
"public function formUserCreate(){\n // Access-controlled resource\n if (!$this->_app->user->checkAccess('create_account')){\n $this->_app->notFound();\n }\n \n $get = $this->_app->request->get();\n \n if (isset($get['render']))\n $render = $get['render'];\n else\n $render = \"modal\";\n \n // Get a list of all groups\n $groups = GroupLoader::fetchAll();\n \n // Get a list of all locales\n $locale_list = $this->_app->site->getLocales();\n \n // Get default primary group (is_default = GROUP_DEFAULT_PRIMARY)\n $primary_group = GroupLoader::fetch(GROUP_DEFAULT_PRIMARY, \"is_default\");\n \n // Get the default groups\n $default_groups = GroupLoader::fetchAll(GROUP_DEFAULT, \"is_default\");\n \n // Set default groups, including default primary group\n foreach ($groups as $group_id => $group){\n $group_list[$group_id] = $group->export();\n if (isset($default_groups[$group_id]) || $group_id == $primary_group->id)\n $group_list[$group_id]['member'] = true;\n else\n $group_list[$group_id]['member'] = false;\n }\n \n $data['primary_group_id'] = $primary_group->id;\n // Set default title for new users\n $data['title'] = $primary_group->new_user_title;\n // Set default locale\n $data['locale'] = $this->_app->site->default_locale;\n \n // Create a dummy user to prepopulate fields\n $target_user = new User($data); \n \n if ($render == \"modal\")\n $template = \"components/user-info-modal.html\";\n else\n $template = \"components/user-info-panel.html\";\n \n // Determine authorized fields for those that have default values. Don't hide any fields\n $fields = ['title', 'locale', 'groups', 'primary_group_id'];\n $show_fields = [];\n $disabled_fields = [];\n $hidden_fields = [];\n foreach ($fields as $field){\n if ($this->_app->user->checkAccess(\"update_account_setting\", [\"user\" => $target_user, \"property\" => $field]))\n $show_fields[] = $field;\n else\n $disabled_fields[] = $field;\n } \n \n // Load validator rules\n $schema = new \\Fortress\\RequestSchema($this->_app->config('schema.path') . \"/forms/user-create.json\");\n $validators = new \\Fortress\\ClientSideValidator($schema, $this->_app->translator); \n \n $this->_app->render($template, [\n \"box_id\" => $get['box_id'],\n \"box_title\" => \"Create User\",\n \"submit_button\" => \"Create user\",\n \"form_action\" => $this->_app->site->uri['public'] . \"/users\",\n \"target_user\" => $target_user,\n \"groups\" => $group_list,\n \"locales\" => $locale_list,\n \"fields\" => [\n \"disabled\" => $disabled_fields,\n \"hidden\" => $hidden_fields\n ],\n \"buttons\" => [\n \"hidden\" => [\n \"edit\", \"enable\", \"delete\", \"activate\"\n ]\n ],\n \"validators\" => $validators->formValidationRulesJson()\n ]); \n }",
"public function doCreate() {\n if(\n isset($_POST['email']) &&\n isset($_POST['password']) &&\n isset($_POST['lastName']) &&\n isset($_POST['firstName']) &&\n isset($_POST['address']) &&\n isset($_POST['postalCode']) &&\n isset($_POST['city'])\n ) {\n $alreadyExist = $this->userManager->findByEmail($_POST['email']);\n\n if(!$alreadyExist) {\n $newUser = new User($_POST);\n $this->userManager->create($newUser);\n $page = 'login';\n }\n else {\n $error = \"ERROR : This email (\".$_POST['email'].\") is used by another user\";\n $page = 'create';\n }\n }\n\n require('./View/default.php');\n }",
"private static function create()\n {\n getDb()->putUser(1, self::getDefaultAttributes());\n }",
"public function actionCreate()\n {\n if (!Yii::$app->user->isGuest) {\n\n if (Yii::$app->user->can('createUser')) {\n\n $model = new Employees();\n $user = new User();\n\n $model->created_by = Yii::$app->user->identity->getId();\n $model->created_at = date('Y-m-d H:i');\n $model->status = Employees::ACTIVE;\n\n\n if ($model->load(Yii::$app->request->post()) && $user->load(Yii::$app->request->post())) {\n\n if($model->save()){\n\n $model->employee_image = UploadedFile::getInstance($model, 'employee_image');\n\n if ($model->employee_image != null) {\n $model->employee_image->saveAs('uploads/employee/' . $model->employee_image . '.' . $model->employee_image->extension);\n $model->image = $model->employee_image . '.' . $model->employee_image->extension;\n }\n\n $user->employee_id = $model->id;\n $user->\tcreated_at = date('Y-m-d H:i');\n $user->\tupdated_at = date('Y-m-d H:i');\n try {\n\n if ($user->save()) {\n\n Yii::$app->authManager->assign(Yii::$app->authManager->getRole($user->role), $user->id);\n\n Yii::$app->session->setFlash('', [\n 'type' => 'success',\n 'duration' => 5000,\n 'icon' => 'fa fa-check',\n 'title' => 'Notification',\n 'message' => 'Registration successfully registered',\n 'positonY' => 'top',\n 'positonX' => 'right'\n ]);\n return $this->redirect(['view', 'id' => $model->id]);\n\n } else {\n\n Yii::$app->session->setFlash('', [\n 'type' => 'danger',\n 'duration' => 10000,\n 'icon' => 'fa fa-warning',\n 'title' => 'Notification',\n 'message' => 'User registration not successfully,username have already used',\n 'positonY' => 'top',\n 'positonX' => 'right'\n ]);\n\n // Audit::setActivity('Duplicates user ID in User table ' . '(' . $model->id . ')', 'Wafanyakazi', 'Create', '', '');\n Employees::deleteAll(['id' => $model->id]);\n return $this->render('create', [\n 'model' => $model, 'user' => $user\n ]);\n }\n } catch (\\Exception $e) {\n\n Yii::$app->session->setFlash('', [\n 'type' => 'danger',\n 'duration' => 5000,\n 'icon' => 'fa fa-warning',\n 'message' => 'User registration not successfully',\n 'positonY' => 'top',\n 'positonX' => 'right'\n ]);\n // Audit::setActivity('Duplicates user ID in User table ' . '(' . $model->id . ')', 'Wafanyakazi', 'Create', '', '');\n Employees::deleteAll(['id' => $model->id]);\n return $this->render('create', [\n 'model' => $model, 'user' => $user\n ]);\n\n }\n }\n\n return $this->redirect(['view', 'id' => $model->id]);\n\n } else {\n return $this->render('create', [\n 'model' => $model, 'user' => $user\n ]);\n }\n\n\n } else {\n Yii::$app->session->setFlash('', [\n 'type' => 'danger',\n 'duration' => 8000,\n 'icon' => 'fa fa-warning',\n 'title' => 'Notification',\n 'message' => 'You dont have a permission',\n 'positonY' => 'top',\n 'positonX' => 'right'\n ]);\n return $this->redirect(['index']);\n }\n\n } else {\n $model = new LoginForm();\n return $this->redirect(['site/login',\n 'model' => $model,\n ]);\n }\n\n\n }",
"public function saveAction(){\n\t\t$request = $this->_request->getParams();\n\t\t$oValidationHelper = new Helpers_Usermanagement_Validate();\n\t\t\n\t\t$error = false;\n\t\tif(!$oValidationHelper->ifEmailAvailable($request['user_email'],$this->_auth->user_id)){\n\t\t\t$error = true;\n\t\t\t$this->_messages->setMessage('User with such email already exists','error','user_email');\n\t\t}\n\n\t\tif(!$oValidationHelper->ifUsernameAvailable($request['user_login'],$this->_auth->user_id)){\n\t\t\t$this->_messages->setMessage('User with such username already exists','error','user_login');\n\t\t\t$error = true;\n\t\t}\n\t\t\t\t\n\t\tif($this->_validator->validate('registration_form',$request) && !$error){\n\t\t\t\n\t\t\tif($request['user_email']!=$this->_auth->user_email){\n\t\t\t\t$request['user_confirmation_code'] = md5(time()+rand(10000,99999));\n\t\t\t\t$request['user_active'] = 0;\n\t\t\t\t$this->_sendConfirmationEmail($request['user_email'],$request['user_login'],$request['user_confirmation_code']);\n\t\t\t\t$this->_messages->setMessage('WARNING!!! Your email has been changed and your account has been disabled. Instructions on how to activate account were sent to you','error');\n\t\t\t}\n\t\t\t\n\t\t\t$request['user_id'] = $this->_auth->user_id;\n\t\t\t$oUsers = new Models_Usermanagement_Users();\n\t\t\t$oUsers->updateEntry($request);\t\t\t\n\t\t\t\n\t\t\t$this->_messages->setMessage('Account has been updated');\n\t\t\t$this->_redirect('/usermanagement/profile/generaldataform/');\n\t\t}else{\n\t\t\tforeach ( $this->_validator->getErrors () as $field=>$error ) {\n\t\t\t\t$this->_messages->setMessage ( $error, 'error' , $field);\n\t\t\t}\n\t\t\t$this->_redirect('/usermanagement/profile/generaldataform/?error=1');\n\t\t}\n\t}",
"public function actionCreate()\n {\n $this->_model->status = User::ACTIVE;\n return $this->save($this->_model);\n }",
"public function actionCreate(){ \n // function to create User.\n //redirect a user if not super admin\n\n $site_url = Yii::$app->params['yii_url'];\n $upload_url = \"\";\n if($site_url == \"http://dev.digitalvidya.com/assist\") {\n $upload_url - $site_url.\"/uploads/user_image/\";\n } else {\n $upload_url = $site_url . \"/uploads/\";\n }\n if (!Yii::$app->CustomComponents->check_permission('create_user')) {\n return $this->redirect(['site/index']);\n }\n\n $model = new DvUsers();\n if (!empty($model->course)) {\n $model->course = explode(',', $model->course);\n }\n\n\n if ($model->load(Yii::$app->request->post())) {\n if (!empty($model->course)) {\n $model->course = implode(\",\", $_POST['DvUsers']['course']);\n }\n\n if (isset($_POST['usermeta']['day_avail'])) {\n $day_avail = $_POST['usermeta']['day_avail'];\n }\n\n if (!empty($day_avail)) {\n $day_avail = implode(\",\", $_POST['usermeta']['day_avail']);\n }\n\n $userdata = Yii::$app->request->post();\n\t\t\t//echo \"<pre>\";\n\t\t\t//print_r($userdata); die;\n\t\t\tif($userdata['usermeta']['role'] == 4 || $userdata['usermeta']['role'] == 5){\n\t\t\t\t$email = $userdata['DvUsers']['email'];\n\t\t\t\t$phone = $userdata['usermeta']['phone'];\n\t\t\t\t$fname = $userdata['DvUsers']['first_name'];\n\t\t\t\t$lname = $userdata['DvUsers']['last_name'];\n\t\t\t\t$fb_link = $userdata['usermeta']['fb_link'];\n\t\t\t\t$linkedin_link = $userdata['usermeta']['linkedin_link'];\n\t\t\t\t$twitter_link = $userdata['usermeta']['twitter_link'];\n\t\t\t\t\n\t\t\t\tif(isset($userdata['usermeta']['description'])){\n\t\t\t\t\t$desc = $userdata['usermeta']['description'];\n\t\t\t\t}else{\n\t\t\t\t\t$desc = \"\";\n\t\t\t\t}\n\n\t\t\t\n\t\t\t \n\t\t\t}\n\t\t\t\n $model->save();\n\n $uid = Yii::$app->db->getLastInsertID();\n\t\t\tif($userdata['usermeta']['role'] == 4){\n\t\t\t\t$usre_role = 1;\n\t\t\t\t$profile_visibility = $userdata['usermeta']['profile_visibility'];\n\t\t\t}else{\n\t\t\t\t$usre_role = 2;\n\t\t\t\t$profile_visibility = 1;\n\t\t\t}\n\n if($userdata['usermeta']['role'] == 4 || $userdata['usermeta']['role'] == 5){\n // ***************** Start of curl ************************\n \n $curl = curl_init();\n // Set some options - we are passing in a useragent too here\n curl_setopt_array($curl, [\n CURLOPT_RETURNTRANSFER => 1,\n CURLOPT_URL => 'http://dev.digitalvidya.com/training/wp-json/check_ta_email/v1/ld/',\n CURLOPT_USERAGENT => 'Get course data',\n CURLOPT_POST => 1,\n CURLOPT_POSTFIELDS => [\n \n 'ta_email' => $email,\n 'tm_fname' => $fname,\n 'tm_lname' => $lname,\n 'tm_phone' => $phone,\n 'tm_facebook' => $fb_link,\n 'tm_linkedin' => $linkedin_link,\n 'tm_twitter' => $twitter_link,\n 'tm_description' => $desc,\n 'tm_image_url' => $upload_url.'img_'.$uid.'.jpg',\n 'tm_image_name' => 'img_'.$uid.'.jpg',\n 'profile_visibility' => $profile_visibility,\n\t\t\t\t\t\t'user_role' => $usre_role\n\n ]\n ]);\n // Send the request & save response to $resp\n $resp = curl_exec($curl);\n // Close request to clear up some resources\n $resulst = json_decode($resp,true);\n curl_close($curl);\n\t\t\t\t//echo \"<pre>\";print_r($resulst);die;\n // ************* End of the curl ************************\n }\n\n $model->picture = UploadedFile::getInstance($model, 'picture');\n if (!empty($model->picture->baseName)) {\n $model->picture->saveAs('uploads/user_image/img_' . $uid . '.' . $model->picture->extension);\n $user_image = 'img_' . $uid . '.' . $model->picture->extension;\n Yii::$app->db->createCommand(\"UPDATE assist_users SET picture = '$user_image' WHERE id = '$uid' AND status = 1 \")->execute();\n }\n\n $usermeta = $_POST['usermeta'];\n unset($usermeta['day_avail']);\n\t\t\tif(isset($resulst['user_id'])){\n\t\t\t\t$usermeta['wp_user_id'] = $resulst['user_id'];\n\t\t\t\t\n\t\t\t}\n\t\t\tif(isset($resulst['post_id'])){\n\t\t\t\t\n\t\t\t\t$usermeta['wp_post_id'] = $resulst['post_id'];\n\t\t\t\t$usermeta['trainer_profile_url'] = $_SERVER['SERVER_NAME'].\"/?p=\".$resulst['post_id'];\n\t\t\t}\n\n\n foreach ($usermeta as $key => $val) {\n Yii::$app->db->createCommand()->insert('assist_user_meta', [ 'uid' => $uid, 'meta_key' => $key, 'meta_value' => $val])->execute();\n }\n\n if (!empty($day_avail)) {\n Yii::$app->db->createCommand()->insert('assist_user_meta', [ 'uid' => $uid, 'meta_key' => 'day_avail', 'meta_value' => $day_avail])->execute();\n }\n\n $user_password = $_POST['DvUsers']['password']; \n\n // send email\n if ($usermeta['notify'] == 1) {\n $subject = Yii::$app->params['site_name'].\" New Account Invitation\";\n $body = \" <h3>Welcome to \". Yii::$app->params['site_name'].\"</h3>\n <p>Hi $model->first_name,</p>\n <p>Your login details are:</p>\n <p>Site URL: \". Yii::$app->params['yii_url'].\"</p>\n <p>Username: $model->username</p>\n <p>Password: $user_password</p>\n <br>\n <br>\n <p>Thanks and Regards</p>\n <p>Digital Vidya Team</p>\n \";\n\n $is_sent = Yii::$app->mailer->compose()\n ->setFrom('[email protected]')\n //->setTo('[email protected]')\n ->setTo($model->email)\n ->setBcc ('[email protected]')\n ->setSubject($subject)\n ->setHtmlBody($body)\n ->send();\n \n }\n\n return $this->redirect(['view', 'id' => $uid]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreate() {\n $model = new Companyusers;\n $model->scenario = 'create';\n $timezone = Yii::$app->db->createCommand(\"select * from timezone\")->queryAll();\n\n $timezone = ArrayHelper::map($timezone, \"id\", \"name\");\n //$statusList=[\"1\"=>\"Active\",\"0\"=>\"In-active\"];\n $statusList=\\Yii::$app->params['statusList'];\n \n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n if ($model->save()) {\n $id = $model->id;\n $user = new User;\n $user->username = $model->user_name;\n $user->password = md5($model->password);\n $user->email = $model->email;\n $user->status = $model->status;\n $user->is_admin = 2;\n if ($user->save()) {\n $user_id = $user->id;\n $up_model = $this->findModel($id);\n //$up_model->user_id = $user_id;\n $up_model->updateAll([\"user_id\" => $user_id], [\"id\" => $id]);\n }\n } else {\n print_r($model->getError());\n }\n return $this->redirect(['index']);\n } else {\n return $this->render('create', [\n 'model' => $model,\n 'timezone' => $timezone,\n 'status' => $statusList,\n ]);\n }\n }",
"public function actionCreate() {\n $admin = &Yii::app()->settings;\n $userCount = Yii::app()->db->createCommand(\n \"SELECT COUNT(*) FROM x2_users;\"\n )->queryAll();\n $userCountParsed = $userCount[0][\"COUNT(*)\"];\n if ($userCountParsed >= 200) {\n $this->render('userLimit',array());\n }\n \n $model=new User;\n $groups=array();\n foreach(Groups::model()->findAll() as $group){\n $groups[$group->id]=CHtml::encode($group->name);\n }\n $roles=array();\n foreach(Roles::model()->findAll() as $role){\n $roles[$role->id]=CHtml::encode($role->name);\n }\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n $unhashedPassword = '';\n if(isset($_POST['User'])) {\n $model->attributes=$_POST['User'];\n //Temporarily maintain unhashed in case of validation error\n $unhashedPassword = $model->password;\n \n if ($model->validate (array('password')))\n \n $model->password = PasswordUtil::createHash($model->password);\n $model->userKey=substr(str_shuffle(str_repeat(\n 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789', 32)), 0, 32);\n $profile=new Profile;\n $profile->fullName=$model->firstName.\" \".$model->lastName;\n $profile->username=$model->username;\n $profile->allowPost=1;\n $profile->emailAddress=$model->emailAddress;\n $profile->status=$model->status;\n\n \n // set a default theme if there is one\n $admin = Yii::app()->settings;\n if ($admin->defaultTheme) {\n $profile->theme = $profile->getDefaultTheme ();\n }\n \n\n if($model->save()){\n $calendar = new X2Calendar();\n $calendar->createdBy = $model->username;\n $calendar->updatedBy = $model->username;\n $calendar->createDate = time();\n $calendar->lastUpdated = time();\n $calendar->name = $profile->fullName.\"'s Calendar\";\n $calendar->save();\n $profile->id=$model->id;\n $profile->defaultCalendar = $calendar->id;\n $profile->save();\n if(isset($_POST['roles'])){\n $roles=$_POST['roles'];\n foreach($roles as $role){\n $link=new RoleToUser;\n $link->roleId=$role;\n $link->userId=$model->id;\n $link->type=\"user\";\n $link->save();\n }\n }\n if(isset($_POST['groups'])){\n $groups=$_POST['groups'];\n foreach($groups as $group){\n $link=new GroupToUser;\n $link->groupId=$group;\n $link->userId=$model->id;\n $link->username=$model->username;\n $link->save();\n }\n }\n $this->redirect(array('view','id'=>$model->id));\n }\n }\n $model->password = $unhashedPassword;\n\n $this->render('create',array(\n 'model'=>$model,\n 'groups'=>$groups,\n 'roles'=>$roles,\n 'selectedGroups'=>array(),\n 'selectedRoles'=>array(),\n ));\n }",
"public function createUser()\r\n {\r\n // use sign up in AuthController\r\n }",
"public function createUser()\r\n {\r\n // use sign up in AuthController\r\n }",
"public function actionCreate()\n {\n $model = new User();\n if(null !== (Yii::$app->request->post()))\n {\n if($this->saveUser($model))\n {\n Yii::$app->session->setFlash('userUpdated');\n $this->redirect(['update', 'id' => $model->getId()]);\n return;\n }\n\n }\n\n return $this->render('@icalab/auth/views/user/create', ['model' => $model]);\n }",
"public function createUserAction() {\n $this->authService->createUser();\n die();\n }",
"public function createUser();",
"public function createUser();",
"public function createUser();",
"public function createUser();",
"private function create()\n {\n return $this->db->putUser($this->getDefaultAttributes());\n }",
"function autoregister_create_new_user($itemId)\n {\n $item = Item::newInstance()->findByPrimaryKey($itemId['pk_i_id']);\n // if not exist user\n if( $item['fk_i_user_id'] == NULL ) {\n // create new user + send email\n $name = $item['s_contact_name'];\n $email = $item['s_contact_email'];\n // prepare data for register user\n $aux_password = osc_genRandomPassword();\n // clear params ....\n $input = array();\n $input['s_name'] = Params::getParam('s_name') ;\n Params::setParam('s_name', $name ); // from inserted item\n $input['s_email'] = Params::getParam('s_email') ;\n Params::setParam('s_email', $email ); // from inserted item\n $input['s_password'] = Params::getParam('s_password') ;\n Params::setParam('s_password', $aux_password ); // generated\n $input['s_password2'] = Params::getParam('s_password2') ;\n Params::setParam('s_password2', $aux_password ); // generated\n $input['s_website'] = Params::getParam('s_website') ;\n Params::setParam('s_website', '');\n $input['s_phone_land'] = Params::getParam('s_phone_land') ;\n Params::setParam('s_phone_land', '');\n $input['s_phone_mobile'] = Params::getParam('s_phone_mobile') ;\n Params::setParam('s_phone_mobile', '');\n $input['countryId'] = Params::getParam('countryId');\n Params::setParam('countryId', '');\n $input['regionId'] = Params::getParam('regionId');\n Params::setParam('regionId', '');\n $input['cityId'] = Params::getParam('cityId');\n Params::setParam('cityId', '');\n $input['cityArea'] = Params::getParam('cityArea') ;\n Params::setParam('cityArea', '');\n $input['address'] = Params::getParam('address') ;\n Params::setParam('address', '');\n $input['b_company'] = (Params::getParam('b_company') != '' && Params::getParam('b_company') != 0) ? 1 : 0 ;\n Params::setParam('b_company', '0');\n\n require_once LIB_PATH . 'osclass/UserActions.php' ;\n $userActions = new UserActions(false) ;\n $success = $userActions->add() ;\n\n switch($success) {\n case 1: osc_add_flash_ok_message( _m('The user has been created. An activation email has been sent')) ;\n $success = true;\n break;\n case 2: osc_add_flash_ok_message( _m('Your account has been created successfully')) ;\n $success = true;\n break;\n case 3: osc_add_flash_warning_message( _m('The specified e-mail is already in use')) ;\n $success = false;\n break;\n case 4: osc_add_flash_error_message( _m('The reCAPTCHA was not entered correctly')) ;\n $success = false;\n break;\n case 5: osc_add_flash_warning_message( _m('The email is not valid')) ;\n $success = false;\n break;\n case 6: osc_add_flash_warning_message( _m('The password cannot be empty')) ;\n $success = false;\n break;\n case 7: osc_add_flash_warning_message( _m(\"Passwords don't match\")) ;\n $success = false;\n break;\n }\n\n if($success) {\n Log::newInstance()->insertLog('plugin_autoregister', 'autoregister', '', $email.' '.$_SERVER['REMOTE_ADDR'], 'autoregister', osc_logged_admin_id()) ;\n // update user of item\n $user = User::newInstance()->findByEmail($email);\n Item::newInstance()->update(array('fk_i_user_id' => $user['pk_i_id'] ), array('pk_i_id' => $itemId ) );\n $item = Item::newInstance()->findByPrimaryKey($itemId);\n\n autoregister_sendMail($email, $user, $aux_password);\n\n // not activated\n if( $item['b_active'] != 1 ) {\n osc_run_hook('hook_email_item_validation', $item);\n }\n }\n\n // set params again\n Params::setParam('s_name', $input['s_name']);\n Params::setParam('s_email', $input['s_email']);\n Params::getParam('s_password', $input['s_password']) ;\n Params::getParam('s_password2', $input['s_password2']) ;\n Params::setParam('s_website', $input['s_website']);\n Params::setParam('s_phone_land', $input['s_phone_land']);\n Params::setParam('s_phone_mobile', $input['s_phone_mobile']);\n Params::setParam('countryId', $input['countryId']);\n Params::setParam('regionId', $input['regionId']);\n Params::setParam('cityId', $input['cityId']);\n Params::setParam('cityArea', $input['cityArea'] );\n Params::setParam('address', $input['address']);\n Params::setParam('b_company', $input['b_company']);\n // end\n }\n }",
"public function create()\n {\n\t $role = Auth::user()->rols()->first();\n\t $roles = $this->role_repository->allowedCrudRoles($role);\n\t $country = $this->country_repository->findOneBy(old('country_id',null));\n\t $state = $this->state_repository->findOneBy(old('state_id',null));\n\t $city = $this->city_repository->findOneBy(old('city_id',null));\n\t\t$offices = $this->office_repository->offices(Auth::user());\n\n\t $viewData = compact('roles','offices');\n\t if($country){\n\t\t $viewData['country']=$country;\n\t }\n\n\t if($state){\n\t\t $viewData['state']=$state;\n\t }\n\n\t if($city){\n\t\t $viewData['city']=$city;\n\t }\n\n\t return view('web.supplier.user.create')->with($viewData);\n }",
"public function createUser()\n {\n }",
"public function create()\n {\n $input = $request->all();\n $input['created_by'] = auth()->id();\n $input['updated_by'] = auth()->id();\n if ($this->userDetailModel->create($input)) {\n Session\n ::flash('flash_message', 'User details created successfully.');\n return redirect()->route('users.index');\n }\n return redirect()->back();\n }",
"public function action_create()\n {\n $this->action_edit(FALSE);\n }",
"public function creating(User $user)\n {\n\n $user->user_creator_id = \\Auth::id();\n //$user->user_updater_id = \\Auth::id();\n }",
"function create(){\n\t\t\t//getting default circle\n\t\t\t$def_circle = $this->circle_model->get_Circle(\"cursos\");\n\t\t\t$id = new MongoID($def_circle['_id']);\n\t\t\t\n\t\t\t$document = array(\n\t\t\t\t'name' => $this->input->post('name'),\n\t\t\t\t'password' => $this->input->post('password'),\n\t\t\t\t'email' => $this->input->post('email'),\n\t\t\t\t'acl' => array(\n\t\t\t\t//asignamos el circulo cursos por default\n\t\t\t\t0 => array('circle' => $id)\n\t\t\t\t)\n\t\t\t);\t\t\n\t\t\t$this->user_model->add_User($document);\n\t\t}",
"public static function addUser()\n {\n // ADD NEW DATA TO A TABLE\n // MAKE SURE TO SEND USERS TO THE /users page when a user is added\n }",
"public function postUserupdate(){\n \n $uid = Input::get('user_id');\n $user = User::find($uid);\n if($user != ''){\n $user->email = Input::get('useremail');\n $user->fullname = Input::get('fullname');\n $user->category = Input::get('category');\n $user->language = Input::get('language');\n $user->enable = Input::get('enable');\n $user->save();\n return Redirect::to('admin/edituser/'.$uid)\n ->with('message', 'User data updated!');\n }else{\n return Redirect::to('admin/edituser/'.$uid)\n ->with('message', 'No such user!');\n }\n\n }",
"function register(){ \t\n\t\t$table = 'users';\n\t\t$capability =$sessionrole='';\t\t\n\t\t$type = $this->input->post('type');\n\t\t$redirect__url = base_url();\n\t\tif( $type == 'client' ):\n\t\t\t$role = 'client';\n\t\t\t$redirect__url = base_url('Interact/add_client');\n\t\telse:\n\t\t\t$role = $this->input->post('role');\n\t\t\t$redirect__url = base_url('Interact/add_user');\n\t\tendif; \n\t\t$attorney_id = $this->input->post('attorney_id');\n\t\t$user_name = $this->input->post('personInput');\n\t\t$current_url = $this->input->post('current_url');\n\t\t$companyName = $this->input->post('nameInput');\n\t\t$email = $this->input->post('emailInput');\n\t\t$password = $this->input->post('passInput');\n\t\t$confirm_password = $this->input->post('confirmPassInput');\n\t\t$phoneInput = $this->input->post('phoneInput');\n\t\t$screen_name = $this->input->post('screen_name');\t\t\n\t\tif( $role == 'admin' ):\t\t\t\n\t\t\t$customer_address = $this->input->post('customer_address');\n\t\t\t$street_number = $this->input->post('street_number');\n\t\t\t$city = $this->input->post('city');\n\t\t\t$state = $this->input->post('state');\n\t\t\t$postal_code = $this->input->post('postal_code');\n\t\tendif;\n\t\t$check_data = array('user_email' => $email);\n\t\t$check_user_availability = $this->InteractModal->check_user_availability( $check_data, $table );\n\t\tif(!empty($check_user_availability )):\n\t\t\t$this->session->set_flashdata('msg', 'User already exist with similar email!');\n\t\t\tif(!empty($current_url)){\n\t\t\tredirect( $current_url );\n\t\t\t}else{\n\t\t\tredirect( $redirect__url );\n\t\t\t}\n\t\telse:\n\t\t\t$data = array('user_email' => $email ,\n\t\t\t\t\t 'password' => md5( $password ),\n\t\t\t\t\t 'role' => $role,\n\t\t\t\t\t 'status' => 1,\n\t\t\t\t\t 'create_date' => date('Y-m-d h:i:s')\n\t\t\t);\t\t\t\n\t\t\t$response = $this->InteractModal->register_user($data, $table);\t\t\t\n\t\t\tif( array_key_exists('id', $response )): // update user meta in database \n\t\t\t\t$user_id = $response['id'];\t\n\t\t\t\t\t\n\t\t\t\t$this->InteractModal->add_user_meta( $user_id, 'concerned_person' , $user_name );\n\t\t\t\t$this->InteractModal->add_user_meta( $user_id, 'company_name' , $companyName );\n\t\t\t\t$this->InteractModal->add_user_meta( $user_id, 'phone_number' , $phoneInput );\t\t\t\t\n\t\t\t\tif( $role == 'admin' ):\n\t\t\t\t\tif(!empty($attorney_id)){\n\t\t\t\t\t$this->InteractModal->add_user_meta( $user_id, 'atterney_id' , $attorney_id );\n\t\t\t\t\t}\n\t\t\t\t\t$this->InteractModal->add_user_meta( $user_id, 'customer_address' , $customer_address );\n\t\t\t\t\t$this->InteractModal->add_user_meta( $user_id, 'street_number' , $street_number );\n\t\t\t\t\t//$this->InteractModal->add_user_meta( $user_id, 'route' , $route );\n\t\t\t\t\t$this->InteractModal->add_user_meta( $user_id, 'city' , $city );\n\t\t\t\t\t$this->InteractModal->add_user_meta( $user_id, 'state' , $state );\n\t\t\t\t\t$this->InteractModal->add_user_meta( $user_id, 'postal_code' , $postal_code );\n\t\t\t\t\t//$this->InteractModal->add_user_meta( $user_id, 'country' , $country );\t\t\t\t\t\n\t\t\t\tendif;\t\t\t\t\n\t\t\t\tif( $role =='client' ):\n\t\t\t\t\t$company_id = $this->input->post('company_id');\n\t\t\t\t\t$this->InteractModal->add_user_meta( $user_id, 'company_id' , $company_id );\n\t\t\t\t\t$this->InteractModal->add_user_meta( $user_id, 'screen_name' , $screen_name );\n\t\t\t\tendif;\n\t\t\t\t$company = preg_replace('/\\s+/', '+', $companyName);\n\t\t\t\t//$login_url = base_url('Interact/userlogin/'.$company.'&'.$user_id);\n\t\t\t\t$login_url = base_url();\n\t\t\t\t$this->InteractModal->add_user_meta( $user_id, 'login_url' , $login_url );\t\n\t\t\t\t$login_deatil = 'Your credentials for login in interactACM account is: <br /> username: '. $email .'<br /> Password: '. $password .'<br /> Login Url: '. $login_url. ' ';\n\t\t///get auto email content data \n\t\t\tif($role==\"client\"){\n\t\t\t\t$status_template = $this->InteractModal->get_user_meta( $company_id, 'status_template_id_1' );\n\t\t\t\tif(($status_template ==1) ){\n\t\t\t\t\t$subject = $this->InteractModal->get_user_meta( $company_id, 'subject_template_id_1' );\n\t\t\t\t\t$content = $this->InteractModal->get_user_meta( $company_id, 'content_template_id_1' );\n\t\t\t\t\t$logo_content = '<img src=\"'.base_url().'/assets/img/profiles/logo_(2).png\" height=\"auto\" width=\"100\" alt=\"Logo\">'; \n\t\t\t\t\t$content=nl2br($content);\n\t\t\t\t\t$content = str_replace(\"_NAME_\",$user_name,$content);\n\t\t\t\t\t$content = str_replace(\"_DATE_\",date('d-F-Y'),$content);\n\t\t\t\t\t$content = str_replace(\"_LOGO_\",$logo_content,$content);\n\t\t\t\t\t$content = str_replace(\"_EMAIL_\",$email,$content);\n\t\t\t\t\t$content = str_replace(\"_PHONE_\",$phoneInput,$content); \n\t\t\t\t\tif (strpos($content, '_LOGIN_DETAILS_') !== false) {\n\t\t\t\t\t\t $content = str_replace(\"_LOGIN_DETAILS_\",$login_deatil,$content); \n\t\t\t\t\t}else{\n\t\t\t\t\t\t $content = $content.'<br>'.$login_deatil;\n\t\t\t\t\t}\n\t\t\t\t}else{\n\t\t\t\t\t$template_list = $this->InteractModal->get_email_template(1);\n\t\t\t\t\tforeach( $template_list as $template_lists ):\n\t\t\t\t\t\t$subject = $template_lists['subject']; \n\t\t\t\t\t\t$content = $login_deatil;\n\t\t\t\t\tendforeach;\t\t\t\t\n\t\t\t\t}\t\t\t\n\t\t\t\t///get auto email content data \t\t\t\t\n\t\t\t\t\t$email_data = array('email' => $email,\n\t\t\t\t\t\t\t\t\t\t'content' => $content,\n\t\t\t\t\t\t\t\t\t\t'subject' => $subject\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t$this->send_email($email_data );\n\t\t\t}else{\n\t\t\t\t$email_content = 'Welcome to interactACM. Your credentials for login in interactACM account is: <br /> username: '. $email .'<br /> Password: '. $password .'<br /> Login Url: '. $login_url. ' ';\t\t\t\t\n\t\t\t\t$email_data = array('email' => $email,\n\t\t\t\t\t\t\t\t\t'content' => $email_content,\n\t\t\t\t\t\t\t\t\t'subject' => 'Welcome to interactACM'\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t$this->send_email( $email_data ); \n\t\t\t\t/*====Email send super admin =======*/\n\t\t\t\t$content_superadmin='Hi interactACM<br/> A new broker is register with us. The details of which are following<br>Broker Name: '.$user_name.'<br> Contact Number: '.$phoneInput.'<br> Contact Email: '.$email; \n\t\t\t\t\t$email_data1 = array('email' => '[email protected]', \n\t\t\t\t\t\t\t\t\t\t'content' => $content_superadmin, \n\t\t\t\t\t\t\t\t\t\t'subject' => 'New Broker Registration'\n\t\t\t\t\t\t\t\t\t\t); \t\t\t\t\t\n\t\t\t\t\t$this->send_email($email_data1);\n\t\t\t\t/*======Email send super admin========*/\n\t\t\t\tif(!empty($current_url)):\n $this->session->set_flashdata('msg', 'Thank you for registering with us. Your login credentials has been sent in registered email. Please check your mailbox.');\n\t\t\t redirect( $current_url ); \n\t\t\t\tendif;\n\t\t\t}\n\t\t\t\t$regex = \"/^(\\(?\\d{3}\\)?)?[- .]?(\\d{3})[- .]?(\\d{4})$/\"; \n\t\t\t\t$mobile = preg_replace($regex, \"\\\\1\\\\2\\\\3\", $phoneInput); \n\t\t\t\t//$this->send_text_message($mobile,$email);\t\t\t\t\n\t\t\t\tif( $role =='client' ):\n\t\t\t\t\tredirect( base_url('Interact/afterAddClient/'.urlencode(base64_encode($user_id )))); \n\t\t\t\telse:\n\t\t\t\t redirect( base_url( 'Interact/all_users/'.$role ) );\n\t\t\t\tendif;\n\t\t\t\t\n\t\t\telse:\n\t\t\t\techo $response['error'];\n\t\t\tendif; //==== error or id check ends\n\t\t\t//echo $response;\n\t\tendif;\t//==== user not exist proceed ends\n\t}",
"function createUser()\n{\n $userCheck = UsersQuery::create()->findOneByUsername($_POST['username']);\n if ($userCheck == \"\") {\n // next add user to db\n $user = new Users();\n $user->setUsername($_POST['username']);\n $user->setPassword($_POST['password']);\n $user->setName($_POST['name']);\n $user->setEmail($_POST['email']);\n $user->setStatus(\"active\");\n $user->setPicture(\"none\");\n $user->setCreated(time());\n $user->setModified(time());\n\n $user->save();\n\n if ($user != null) {\n echo \"user added successfully\";\n }\n } else {\n echo \"user already registered\";\n }\n}",
"public function create_user()\n\t{\n\t\tif (!$this->ion_auth->logged_in())\n\t\t{\n\t\t\t// redirect them to the login page\n\t\t\tredirect('/admin/login', 'refresh');\n\t\t}\n\t\t$this->data['title'] = $this->lang->line('create_user_heading');\n\n\t\t//See the ion_auth config to check if allow_user_registration is TRUE\n\t\tif( ! $this->config->item('allow_user_registration', 'ion_auth')){\n\n\t\t\tif (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin())\n\t\t\t{\n\t\t\t\tredirect('/admin', 'refresh');\n\t\t\t}\n\n\t\t}\n\n\n\t\t$tables = $this->config->item('tables', 'ion_auth');\n\t\t$identity_column = $this->config->item('identity', 'ion_auth');\n\t\t$this->data['identity_column'] = $identity_column;\n\n\t\t// validate form input\n\t\t$this->form_validation->set_rules('first_name', $this->lang->line('create_user_validation_fname_label'), 'trim|required');\n\t\t$this->form_validation->set_rules('last_name', $this->lang->line('create_user_validation_lname_label'), 'trim|required');\n\t\tif ($identity_column !== 'email')\n\t\t{\n\t\t\t$this->form_validation->set_rules('identity', $this->lang->line('create_user_validation_identity_label'), 'trim|required|is_unique[' . $tables['users'] . '.' . $identity_column . ']');\n\t\t\t$this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'trim|required|valid_email');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'trim|required|valid_email|is_unique[' . $tables['users'] . '.email]');\n\t\t}\n\t\t$this->form_validation->set_rules('phone', $this->lang->line('create_user_validation_phone_label'), 'trim');\n\t\t$this->form_validation->set_rules('company', $this->lang->line('create_user_validation_company_label'), 'trim');\n\t\t$this->form_validation->set_rules('password', $this->lang->line('create_user_validation_password_label'), 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[password_confirm]');\n\t\t$this->form_validation->set_rules('password_confirm', $this->lang->line('create_user_validation_password_confirm_label'), 'required');\n\n\t\tif ($this->form_validation->run() === TRUE)\n\t\t{\n\t\t\t$email = strtolower($this->input->post('email'));\n\t\t\t$identity = ($identity_column === 'email') ? $email : $this->input->post('identity');\n\t\t\t$password = $this->input->post('password');\n\n\t\t\t$additional_data = array(\n\t\t\t\t'first_name' => $this->input->post('first_name'),\n\t\t\t\t'last_name' => $this->input->post('last_name'),\n\t\t\t\t'company' => $this->input->post('company'),\n\t\t\t\t'phone' => $this->input->post('phone'),\n\t\t\t);\n\t\t}\n\t\tif ($this->form_validation->run() === TRUE && $this->ion_auth->register($identity, $password, $email, $additional_data))\n\t\t{\n\t\t\t// check to see if we are creating the user\n\t\t\t// redirect them back to the admin page\n\t\t\t$this->session->set_flashdata('message', $this->ion_auth->messages());\n\t\t\tredirect(\"auth\", 'refresh');\n\t\t}\n\t\telse\n\t\t{\n\t\t\t// display the create user form\n\t\t\t// set the flash data error message if there is one\n\t\t\t$this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\n\n\t\t\t$this->data['first_name'] = array(\n\t\t\t\t'name' => 'first_name',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'first_name',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('first_name'),\n\t\t\t);\n\t\t\t$this->data['last_name'] = array(\n\t\t\t\t'name' => 'last_name',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'last_name',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('last_name'),\n\t\t\t);\n\t\t\t$this->data['identity'] = array(\n\t\t\t\t'name' => 'identity',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'identity',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('identity'),\n\t\t\t);\n\t\t\t$this->data['email'] = array(\n\t\t\t\t'name' => 'email',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'email',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('email'),\n\t\t\t);\n\t\t\t$this->data['company'] = array(\n\t\t\t\t'name' => 'company',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'company',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('company'),\n\t\t\t);\n\t\t\t$this->data['phone'] = array(\n\t\t\t\t'name' => 'phone',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'phone',\n\t\t\t\t'type' => 'text',\n\t\t\t\t'value' => $this->form_validation->set_value('phone'),\n\t\t\t);\n\t\t\t$this->data['password'] = array(\n\t\t\t\t'name' => 'password',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'password',\n\t\t\t\t'type' => 'password',\n\t\t\t\t'value' => $this->form_validation->set_value('password'),\n\t\t\t);\n\t\t\t$this->data['password_confirm'] = array(\n\t\t\t\t'name' => 'password_confirm',\n\t\t\t\t'class' => 'form-control',\n\t\t\t\t'id' => 'password_confirm',\n\t\t\t\t'type' => 'password',\n\t\t\t\t'value' => $this->form_validation->set_value('password_confirm'),\n\t\t\t);\n\n\n\t\t\t$this->load->view('templates/header',$this->data);\n\t\t\t$this->load->view('/admin/create_user');\n\t\t\t$this->load->view('templates/footer');\n\t\t}\n\t}",
"public function createAction(Request $request) {\r\n $entity = new User();\r\n $form = $this->createForm(new UserType(), $entity);\r\n $form->bind($request);\r\n $data = $form->getData();\r\n \r\n $em = $this->getDoctrine()->getManager();\r\n if ($data->getType() == 1) {\r\n $idEntity = $em->getRepository('AlbatrossUserBundle:Identity')->findOneByParameters('client');\r\n $positionEntity = $em->getRepository('AlbatrossUserBundle:Position')->findOneByParameters('client');\r\n $entity->setIdentity($idEntity);\r\n $entity->setPosition($positionEntity);\r\n }\r\n if ($form->isValid()) {\r\n $entity->setStatus('active');\r\n $em->persist($entity);\r\n $em->flush();\r\n \r\n return $this->redirect($this->generateUrl('user'));\r\n } else {\r\n var_dump($form->getErrorsAsString());\r\n exit();\r\n }\r\n $menu_bar = 'admin';\r\n return $this->render('AlbatrossUserBundle:User:new.html.twig', array(\r\n 'entity' => $entity,\r\n 'form' => $form->createView(),\r\n 'menu_bar' => $menu_bar,\r\n 'menu_cal_cur' => 'user',\r\n ));\r\n }",
"function admin_create_new_user(){ \r\n\t\t\t$id = $this->uri->segment(3);\r\n\t\t\tif($id){\r\n\t\t\t\t$result['update_user_value'] = $this->model->get_edit_record();\r\n\t\t\t}\t \r\n\t\t\t$result['new_user_data'] = $this->model->select_new_user();\r\n\t\t\t$this->load->view('admin-worldsclinicalguide/admin_create_new_user',$result); \r\n\t}",
"public function actionCreate() {\n\n $this->pagename = \"Register \" . $this->pagename;\n $model = new Users('createUser');\n $transaction = $model->getDbConnection()->beginTransaction();\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Users'])) {\n $model->attributes = $_POST['Users'];\n $oldpassword = $model->password;\n $user = Users::model()->find('email=:email and status=0', array(':email' => $model->email));\n if ($user)\n $model = $user;\n $model->password=$oldpassword;\n $model->password_repeat=$oldpassword;\n $model->status = 1;\n $model->password = md5(trim($model->password));\n $model->key = $model->password;\n $model->password_repeat = $model->password;\n //try {\n if ($model->save()) {\n if (!$user) {\n $authmodel = new AuthAssignment();\n $authmodel->itemname = 'manager';\n $authmodel->userid = $model->id;\n }\n if ($user || $authmodel->save()) {\n $transaction->commit();\n $identity = new UserIdentity($model->email, $model->password);\n $identity->authenticate();\n Yii::app()->user->login($identity, 0);\n if (Yii::app()->user->IsGuest) {\n $this->redirect(Yii::app()->baseUrl . '/site/login');\n }\n $this->redirect(Yii::app()->baseUrl . '/appointments/index');\n //$this->redirect(array('view', 'id' => $model->id));\n } else {\n $transaction->rollback();\n $model->password = $oldpassword;\n $model->password_repeat = $oldpassword;\n }\n }\n// } catch (Exception $e) {\n// $transaction->rollback();\n// $model->password=$oldpassword;\n// $model->password_repeat=$oldpassword;\n// }\n //}\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }",
"public function saveUser()\n {\n $connection = \\Yii::$app->db;\n $command = $connection->createCommand()\n ->update('users', [\n 'name' => $this->name,\n 'email' => $this->email,\n ], 'id='.$this->id);\n $command->execute();\n }",
"public function userupdatesuccessAction()\n {\n }",
"public function store(Request $request)\n\t{\n\t\t$privileges = Privileges::all();\n\t\t$privilegesArray = [];\n\n\t\t$this->validate($request, [\n\t\t 'name' => 'required|max:255',\n\t\t 'surname' => 'required|max:255',\n/*\t\t 'email' => 'required|email|unique:users|max:255',*/\n\t\t 'email' => 'required|email|max:255',\n\t\t 'user_type_id' => 'required|exists:user_types,id',\t\t\t\n\t\t 'phone' => 'numeric|digits_between:10,11',\n\t\t 'login' => 'required|unique:users'\n\t\t]);\n\t\t$input = $request->all();\n\n//\t\t$input['login'] = strtolower($input['name'].'.'.$input['surname']);\n\t\t$input['login'] = strtolower($input['login']);\n $input['status'] = 1;\n\t\t$input['password'] = Hash::make(strtolower($input['login']));\n\t\t// last_pass_change\n\t\t$input['last_pass_change'] = \\Carbon\\Carbon::now()->toDateTimeString();\n\t\t// last_pass_change\n\t\t$newUser = User::create($input);\n\t\tswitch ($input['user_type_id']) {\n\t\t\tcase 1: /* Admin */\n\t\t\t\tforeach ($privileges as $privilege) {\n\t\t\t\t\t$privilegesArray[] = $privilege->id;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 2: /* HR Manager*/\n\t\t\t\tforeach ($privileges as $privilege) {\n \tif(in_array($privilege->privilege,['Users']) && $privilege->type !='u' && $privilege->type !='d'){\n $privilegesArray[] = $privilege->id;\n\n\t\t\t\t\t} elseif (in_array($privilege->privilege, ['Assignments', 'Jobs'])) {\n\t\t\t\t\t\t$privilegesArray[] = $privilege->id;\n \t } elseif (in_array($privilege->privilege,['Categories'])){\n $privilegesArray[] = $privilege->id;\n \t }\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 3: /* HR Officer */\n foreach ($privileges as $privilege){\n \tif(in_array($privilege->privilege,['Users']) && $privilege->type !='u' && $privilege->type !='d'){\n $privilegesArray[] = $privilege->id;\n// \t} elseif(in_array($privilege->privilege,['Jobs']) && $privilege->type != 'u'){\n// $privilegesArray[] = $privilege->id;\n \t} elseif (in_array($privilege->privilege,['Assignments']) && $privilege->type !='u'){\n $privilegesArray[] = $privilege->id;\n \t }\n }\n\t\t\t\tbreak;\n\t\t\tcase 4: /* Tehnic */\n\t\t\t\tforeach ($privileges as $privilege) {\n\t\t\t\t\tif(in_array($privilege->privilege, ['Questions', 'Quizzes'])) {\n\t\t\t\t\t\t$privilegesArray[] = $privilege->id;\n\t\t\t\t\t} elseif(in_array($privilege->privilege,['Assignments']) && $privilege->type == 'r') {\n\t\t\t\t\t\t$privilegesArray[] = $privilege->id;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 4: /* Intern */\n\t\t\t\t# code...\n\t\t\t\tbreak;\n\t\t\tcase 5: /* Candidate */\n\t\t\t\t# code...\n\t\t\t\tbreak;\n\t\t\tcase 7: /* Candidate */\n\t\t\t\tforeach ($privileges as $privilege) {\n\t\t\t\t\t$privilegesArray[] = $privilege->id;\n\t\t\t\t}\n\t\t\t\tbreak;\n\t\t\tcase 8: /* HR TEAM LEADER */\n foreach ($privileges as $privilege){\n \tif(in_array($privilege->privilege,['Users']) && $privilege->type !='u' && $privilege->type !='d'){\n $privilegesArray[] = $privilege->id;\n \t} elseif(in_array($privilege->privilege,['Jobs'])){\n $privilegesArray[] = $privilege->id;\n \t} elseif (in_array($privilege->privilege,['Assignments']) && $privilege->type !='u'){\n $privilegesArray[] = $privilege->id;\n \t } elseif (in_array($privilege->privilege,['Categories'])){\n $privilegesArray[] = $privilege->id;\n \t }\n }\n\t\t\tbreak;\n\n\t\t}\n\t\t$newUser->privileges()->attach($privilegesArray);\n\t\tif(isset($input['categories'])) {\n\t\t\t$newUser->categories()->attach($input['categories']);\n\t\t}\n\n\t\tif($input['user_type_id'] != 6){\n $userEmail = ['userEmail'=>$input['email']];\n \\Mail::send('emails.new_user', compact('newUser', 'userEmail'), function($message) use ($newUser, $userEmail)\n {\n $message->to($userEmail['userEmail'])->subject(\\Lang::get('messages.new_user'));\n });\n }\n\t\treturn redirect('users');\t\t\n\t}",
"public function createAction()\n {\n echo (new View('userCreate'))->render();\n }",
"public function post_add_users() {\n\t}",
"public static function setNewUser($request){\r\n \t//Post vars\r\n\t \t$postVars = $request->getPostVars();\r\n\t\t$nome = $postVars['nome'] ?? '';\r\n\t\t$email = $postVars['email'] ?? '';\r\n\t\t$senha = $postVars['senha'] ?? '';\r\n\r\n\t\t//Valida email\r\n\t\t$obUser = EntityUser::getUserByEmail($email);\r\n\t\tif($obUser instanceof EntityUser){\r\n\r\n\t\t\t$request->getRouter()->redirect('/admin/users/new?status=duplicated');\r\n\t\t}\r\n\r\n\t\t//NOVA INSTANCIA DE FEEDBACK\r\n\t\t$obUser = new EntityUser;\r\n\t\t$obUser->nome = $nome;\r\n\t\t$obUser->email = $email;\r\n\t\t$obUser->senha = password_hash($senha,PASSWORD_DEFAULT);\r\n\t\t$obUser->cadastrar();\r\n\r\n\t\t//REDIRECIONA O USUARIO\r\n\t\t$request->getRouter()->redirect('/admin/users/'.$obUser->id.'/edit?status=created');\r\n\r\n\t}",
"public function updatePoinsUserAction()\n {\n \t$this->pointServices->updatePointUser($this->getUser());\n \t\n \treturn new Response(\"OK\");\n }",
"public function actionCreate()\n {\n $model = new UserForm();\n $model->setScenario('create');\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n }\n if (Yii::$app->request->isGet) {\n $model->status = User::STATUS_ACTIVE;\n $model->roles = User::ROLE_USER;\n }\n\n return $this->render('create', [\n 'model' => $model,\n 'roles' => ArrayHelper::map(Yii::$app->authManager->getRoles(), 'name', 'name')\n ]);\n }",
"public function ocenture_insert() {\r\n\r\n Logger::log(\"inserting user manually into ocenture\");\r\n require_once( OCENTURE_PLUGIN_DIR . 'lib/Ocenture.php' );\r\n\r\n $ocenture = new Ocenture_Client($this->clientId);\r\n\r\n $params = [\r\n 'args' => [\r\n 'ProductCode' => 'YP83815',\r\n 'ClientMemberID' => 'R26107633',\r\n 'FirstName' => 'Francoise ',\r\n 'LastName' => 'Rannis Arjaans',\r\n 'Address' => '801 W Whittier Blvd',\r\n 'City' => 'La Habra',\r\n 'State' => 'CA',\r\n 'Zipcode' => '90631-3742',\r\n 'Phone' => '(562) 883-3000',\r\n 'Email' => '[email protected]',\r\n 'Gender' => 'Female',\r\n 'RepID' => '101269477',\r\n ]\r\n ];\r\n \r\n Logger::log($params);\r\n $result = $ocenture->createAccount($params);\r\n //if ($result->Status == 'Account Created') \r\n {\r\n $params['args']['ocenture'] = $result;\r\n $this->addUser($params['args']); \r\n }\r\n Logger::log($result);\r\n \r\n }",
"public function creating(User $user)\n {\n\n }",
"public function actionAdd() {\n\t\treturn $this->txSave ( \"app\\models\\User\" );\n\t}",
"public function addUser(){\n\t}",
"public function addUser(){}",
"public function create()\n\t{\n\t\tif (!isset($_POST) || empty($_POST))\n\t\t{\n\t\t\theader(\"Location: /myrecipe/users/registry\");\n\t\t\texit;\n\t\t}\n\t\t// TODO need to validate data\n\t\t$data = array('username' => $_POST['username'], 'password' => $_POST['password'], 'cpassword' => $_POST['cpassword'], 'email' => $_POST['email']);\n\t\t// validate the input data\n\t\t$errorArray = User::validates($data);\n\t\tif (count($errorArray))\n\t\t{\n\t\t\t// store errors in session and redirect\n\t\t\t$_SESSION['user'] = $data;\n\t\t\t$_SESSION['user']['errors'] = $errorArray;\n\t\t\theader(\"Location: /myrecipe/users/registry\");\n\t\t\texit;\n\t\t}\n\t\t// create a new user, assume all new users are not staff\n\t\t$values = array('username'=>$_POST['username'],'password'=>$_POST['password'],'email'=>$_POST['email'],'user_type'=>'1');\n\t\t$id = User::createUser($values);\n\t\t// log the user in\n\t\t$_SESSION['user']['id'] = $id;\n\t\t$_SESSION['user']['name'] = $_POST['username'];\n\t\t$_SESSION['user']['type'] = '1';\n\t\techo \"id = \" . $id;\n\t\theader(\"Location: /myrecipe/users/\" . $id);\n\t\texit;\n\t}",
"protected function save() {\n $factory = I2CE_FormFactory::instance();\n if ($this->creatingNewUser()) {\n if ( !$this->hasPermission('task(users_can_edit)')) {\n return false;\n }\n if (!$this->userObj instanceof I2CE_User_Form || !($username = $this->userObj->username) ) {\n return false;\n }\n $accessMech = I2CE::getUserAccess();\n if ($accessMech->userExists($username,false)) {\n I2CE::raiseError(\"Trying to recreate existing user : \" .$username);\n return false;\n }\n if (I2CE_User::hasDetail('creator')) {\n $this->userObj->creator = $this->user->username;\n }\n }\n\n $username = $this->userObj->username;\n $password = $this->userObj->password;\n $parent = $this->userMapObj->getField(\"parent\")->getValue();\n $personObj = $factory->createContainer($parent);\n $personObj->populate();\n $emails = LBBoards_Module_Qualify::getPersonEmail($parent);\n $emails = implode(\",\", $emails);\n $fname = $personObj->getField(\"firstname\")->getValue();\n $body = \"Hi $fname<br> We have created your account on the License Board online system, your username is $username and your password is $password. Please change your password after first login\";\n $subject = \"Account For License Board Online System\";\n LBBoards_Module_Qualify::sendEmail($emails, $subject, $body);\n return parent::save();\n }",
"public function createEnterpriseUser($input);",
"public function actionCreate()\n\t{\n\t\t$model=new User;\n\t\t$guide = new Guide;\n\t\t\n\t\t$model->setScenario('common');\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['User']))\n\t\t{\n\t\t\t$model->attributes=$_POST['User'];\n\t\t\t$model->created_on = date('Y-m-d H:i:s');\n\t\t\t\n\t\t\tif(isset($_POST['User']['social_identifier']) && trim($_POST['User']['social_identifier']) != '')\n\t\t\t$model->setScenario('social');\n\t\t\telse\n\t\t\t$model->setScenario('normal');\n\t\t\tif($model->validate()){\n\t\t\t \n\t\t\t if($model->save()){\n\t\t\t\t\t if($model->role == '3')\n\t\t\t\t\t $this->redirect(array('guidedetails','id'=>$model->user_id));\n\t\t\t\t\t else if($model->role == '4')\n\t\t\t\t\t $this->redirect(array('iyerdetails','id'=>$model->user_id));\n\t\t\t\t\t else if($model->role == '2'){\n\t\t\t\t\t\t\t $this->redirect(array('regsuccesss','id'=>$model->user_id));\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$this->render('create',array(\n\t\t\t'model'=>$model,\n\t\t\t'guide'=>$guide,\n\t\t));\n\t}",
"public function actionCreate() {\n $id_user = Yii::app()->user->getId();\n $model = User::model()->findByPk($id_user);\n $tipo = $model->id_tipoUser;\n if ($tipo == \"1\") {\n $model = new Consultor;\n $modelUser = new User;\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Consultor'])) {\n $model->attributes = $_POST['Consultor'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n \n \n \n $senha = uniqid(\"\", true);\n $modelUser->password = $senha;\n $modelUser->username = $_POST['username'];\n $modelUser->email = trim($model->email);\n $modelUser->attributes = $modelUser;\n $modelUser->id_tipoUser = 4;\n $modelUser->senha = '0';\n\n if ($modelUser->save()) {\n\n $model->id_user = $modelUser->id;\n if ($model->save()) {\n $this->redirect(array('EnviaEmail', 'nomedestinatario' => $model->nome, \"emaildestinatario\" => $model->email, \"nomedeusuario\" => $modelUser->username, \"senha\" => $modelUser->password));\n }\n }\n \n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n \n }else {\n $this->redirect(array('User/ChecaTipo'));\n }\n }",
"public function create() {\n // TODO: Admin Policy\n return view('auth.user_add');\n }",
"public function create() {\n\t\t$this->accessible();\n\n\t\treturn view('users.modify');\n\t}",
"private function _create() {\n\n $this->db->insert(XCMS_Tables::TABLE_USERS, $this->getArray());\n $this->set(\"id\", $this->db->insert_id());\n\n }",
"public function processUser(){\n \n $this->setCurrentUser();\n $this->setUsersAttributes();\n }",
"public function create()\n {\n return $this->edit(new User);\n }",
"public function create()\n { \n $role = Role::all();\n $masterOpd = MasterOpd::all();\n return view('user.user-create',compact('role','masterOpd') );\n }",
"public function run()\n {\n $user = User::find(2); //expert\n $user->expert()->create([\n 'mobile' => '01199493929',\n 'is_active' => true,\n 'status' => 'approved',\n 'slug' => str_slug($user->name, '-'),\n 'profile_picture_url' => 'images/expert.jpg',\n 'cost_per_minute' => 10,\n 'bio' => 'This is a short bio',\n 'current_occupation' => 'Engineer',\n ]);\n\n }",
"protected function _createUser()\n {\n $data = [\n 'email' => '[email protected]',\n 'password' => 'test',\n ];\n\n $user = $this->Users->newEntity($data);\n\n $user->set('active', true);\n $user->set('role_id', 1);\n\n $this->Users->save($user);\n }",
"public function actionCreate() {\n $model = new USUARIO;\n $tienda = new TIENDA;\n //$dataCliente = new ARTICULOTIENDA;\n //$this->titleWindows = Yii::t('COMPANIA', 'Create User');\n $cli_Id=Yii::app()->getSession()->get('CliID', FALSE);\n $this->render('create', array(\n 'model' => $model,\n 'genero' => $this->genero(),\n 'estado' => $this->estado(),\n \n ));\n }",
"public function create()\n {\n $user= new User;\n $this->authorize('create', $user);\n\n $employees=Employee::all();\n $branchOffices=BranchOffice::all();\n $roles=Role::with('permissions')->get();\n $permissions=Permission::pluck('name','id');\n return view('admin.users.create', compact('user','roles', 'permissions','employees','branchOffices'));\n }",
"public function create() {\n /*$id = json_decode($_POST['id']);\n $name = json_decode($_POST['name']);\n $usr = User();\n $usr->id = $id;\n $usr->name = $name;\n $usr->save();*/\n }",
"public function creating(User $user): void\n {\n \n }",
"public function createAction()\r\n {\r\n $user = new User($_POST);\r\n\r\n if ($user->save()) {\r\n\t\t\t\r\n\t\t\tsession_regenerate_id(true);\r\n\r\n\t\t\t$_SESSION['user_id'] = User::getIdSavedUser($_POST['email']);\r\n\t\t\t\r\n\t\t\tIncome::saveDefaultIncomes($_SESSION['user_id']);\r\n\t\t\tExpense::saveDefaultExpenses($_SESSION['user_id']);\r\n\t\t\tPaymentMethod::saveDefaultPaymentMethods($_SESSION['user_id']);\r\n\t\t\t\r\n\t\t\t$user->sendActivationEmail();\r\n\r\n $this->redirect('/signup/success');\r\n\r\n } else {\r\n\r\n View::renderTemplate('Signup/new.html', [\r\n 'user' => $user\r\n ]);\r\n\r\n }\r\n }",
"public function insert($p_fields) {\n\t\t// echo \"table_workoutdb_user->create fields:\"; print_r($p_fields);\n\t\t$fields = (object) $p_fields;\n\t\t// --------------------------------------------------------------------------------------------------------------\n\t\t// initialize the response\n\t\t// --------------------------------------------------------------------------------------------------------------\n\t\t$response = new stdClass();\n\t\t$response->id = null;\n\t\t$response->action = null;\n\t\t// --------------------------------------------------------------------------------------------------------------\n\t\t// mandatory fields for the logic in this model\n\t\t// --------------------------------------------------------------------------------------------------------------\n\t\tif ( !property_exists($fields,'email') || is_null($fields->email) || empty($fields->email) || !is_string($fields->email) ) {\n\t\t\treturn $this->return_handler->results(400,\"Email must be provided\",$response);\n\t\t}\n\t\t// --------------------------------------------------------------------------------------------------------------\n\t\t// check to see if the client_user exists and if so has it been logically deleted\n\t\t// --------------------------------------------------------------------------------------------------------------\n\t\t$keys = array();\n\t\t$keys['email'] = $fields->email;\n\t\t$return = $this->getForAndKeys($keys);\n\t\t// echo \"getUser by Email:\"; print_r($return); echo \"<br />\";\n\t\tif ( $return['status'] > 200 ) {\n\t\t\t// --------------------------------------------------------------------------------------------------------------\n\t\t\t// Insert the entry\n\t\t\t// --------------------------------------------------------------------------------------------------------------\n\t\t\t// create entry\n\t\t\t$return = $this->insertTableFields($fields);\n\t\t\t$return['response']->action = \"insert\";\n\t\t\treturn $return;\n\t\t} else {\n\t\t\t$user = clone $return['response'][0];\n\t\t\t$response->id = $user->id;\n\t\t\tif ( !is_null($user->deleted) ) {\n\t\t\t\t// --------------------------------------------------------------------------------------------------------------\n\t\t\t\t// restart the existing deleted user entry\n\t\t\t\t// --------------------------------------------------------------------------------------------------------------\n\t\t\t\t$response->action = \"reactivate\";\n\t\t\t\t// create the update object\n\t\t\t\t$fields = (object) $p_fields;\n\t\t\t\t$fields->id = $p_user_id;\n\t\t\t\t// update the client user to restart them\n\t\t\t\t$return = $this->reactivate($fields);\n\t\t\t\treturn $this->return_handler->results($return['status'],$return['message'],$response);\n\t\t\t} else {\n\t\t\t\t// --------------------------------------------------------------------------------------------------------------\n\t\t\t\t// the user entry already exists and is active, so update it\n\t\t\t\t// --------------------------------------------------------------------------------------------------------------\n\t\t\t\t$response->action = \"update\";\n\t\t\t\t// create the update object\n\t\t\t\t$fields = clone $p_fields;\n\t\t\t\t$fields->id = $user->id;\n\t\t\t\t// update the user\n\t\t\t\t$return = $this->update($fields);\n\t\t\t\treturn $this->return_handler->results($return['status'],$return['message'],$response);\n\t\t\t}\n\t\t}\n\t}",
"public function actionUpdate()\n\t{\n\t if (!Yii::app()->user->checkAccess('admin')){\n\t\t\treturn $this->actionView();\n\t }\n\t\t$this->model = DrcUser::loadModel();\n\t\tif($this->model===null)\n\t\t\tthrow new CHttpException(404,'The requested user does not exist.');\n\t\t$this->renderView(array(\n\t\t\t'contentView' => '../drcUser/_edit',\n\t\t\t'contentTitle' => 'Update User Data',\n\t\t\t'createNew'=>false,\n\t\t\t'titleNavRight' => '<a href=\"' . $this->createUrl('base/user/create') . '\"><i class=\"icon-plus\"></i> Add User </a>',\n\t\t\t'action'=>Yii::app()->createUrl(\"user/save\", array('username'=>$this->model->username)),\n\t\t));\n\t}",
"public function actionCreate()\n {\n $model = new Users();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->uid]);\n } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function updateUser($data) {\n\t\t\n\t}",
"public function saveAction() {\n $logger = $this->get('logger');\n if (!$this->get('request')->isXmlHttpRequest()) { // Is the request an ajax one?\n return new Response(\"<b>Not an ajax call!!!\" . \"</b>\");\n }\n\n try {\n //Get parameters\n $request = $this->get('request');\n $id = $request->get('id');\n $name = $request->get('name');\n $lastname = $request->get('lastname');\n $username = $request->get('username');\n $email = $request->get('email');\n $cellPhone = $request->get('cellPhone');\n $isActive = $request->get('isActive');\n $isCreating = false;\n\n $translator = $this->get(\"translator\");\n\n if( isset($id) && isset($name) && trim($name) != \"\"\n && isset($lastname) && trim($lastname) != \"\"\n && isset($username) && trim($username) != \"\") {\n $em = $this->getDoctrine()->getManager();\n $entity = new User();\n if($id != 0) { //It's updating, find the user\n $entity = $em->getRepository('TecnotekAsiloBundle:User')->find($id);\n }\n if( isset($entity) ) {\n $entity->setName($name);\n $entity->setLastname($lastname);\n $entity->setUsername($username);\n $entity->setCellPhone($cellPhone);\n $entity->setEmail($email);\n $entity->setIsActive( ($isActive==\"true\")? 1:0);\n $rawPassword = $this->generateStrongPassword();\n if($id == 0) { // If it's new must generates a new password\n $encoder = $this->container->get('security.encoder_factory')->getEncoder($entity);\n $entity->setPassword($encoder->encodePassword($rawPassword, $entity->getSalt()));\n $isCreating = true;\n }\n\n if($em->getRepository(\"TecnotekAsiloBundle:User\")\n ->checkUniqueUsernameAndEmail($username, $email, $id) ) {\n\n $em->persist($entity);\n $em->flush();\n if($isCreating) { // If it's new must email the new account email including the password\n $roleEmployee = $em->getRepository('TecnotekAsiloBundle:Role')->findOneByRole(\"ROLE_EMPLOYEE\");\n $entity->getUserRoles()->add($roleEmployee);\n $em->persist($entity);\n $em->flush();\n $logger->info(\"Send Email for new Account with password: \" . $rawPassword);\n $this->sendEmailForNewAccount($entity, $rawPassword);\n }\n return new Response(json_encode(array(\n 'error' => false,\n 'msg' => $translator->trans('catalog.save.success'))));\n } else {\n return new Response(json_encode(array(\n 'error' => true,\n 'msg' => $translator->trans('user.username.and.email.must.be.uniques'))));\n }\n } else {\n return new Response(json_encode(array('error' => true, 'msg' => \"Missing Parameters 2\")));\n }\n } else {\n return new Response(json_encode(array('error' => true, 'msg' => \"Missing Parameters 1\")));\n }\n } catch (Exception $e) {\n $info = toString($e);\n $logger->err('User::saveAction [' . $info . \"]\");\n return new Response(json_encode(array('error' => true, 'msg' => $info)));\n }\n }",
"public function createUser(){\n $post = $this->_app->request->post();\n \n // Load the request schema\n $requestSchema = new \\Fortress\\RequestSchema($this->_app->config('schema.path') . \"/forms/user-create.json\");\n \n // Get the alert message stream\n $ms = $this->_app->alerts; \n \n // Access-controlled resource\n if (!$this->_app->user->checkAccess('create_account')){\n $ms->addMessageTranslated(\"danger\", \"ACCESS_DENIED\");\n $this->_app->halt(403);\n }\n\n // Set up Fortress to process the request\n $rf = new \\Fortress\\HTTPRequestFortress($ms, $requestSchema, $post); \n \n // Sanitize data\n $rf->sanitize();\n \n // Validate, and halt on validation errors.\n $error = !$rf->validate(true);\n \n // Get the filtered data\n $data = $rf->data(); \n \n // Remove csrf_token, password confirmation from object data\n $rf->removeFields(['csrf_token, passwordc']);\n \n // Perform desired data transformations on required fields. Is this a feature we could add to Fortress?\n $data['user_name'] = strtolower(trim($data['user_name']));\n $data['display_name'] = trim($data['display_name']);\n $data['email'] = strtolower(trim($data['email']));\n $data['active'] = 1;\n \n // Check if username or email already exists\n if (UserLoader::exists($data['user_name'], 'user_name')){\n $ms->addMessageTranslated(\"danger\", \"ACCOUNT_USERNAME_IN_USE\", $data);\n $error = true;\n }\n\n if (UserLoader::exists($data['email'], 'email')){\n $ms->addMessageTranslated(\"danger\", \"ACCOUNT_EMAIL_IN_USE\", $data);\n $error = true;\n }\n \n // Halt on any validation errors\n if ($error) {\n $this->_app->halt(400);\n }\n \n // Get default primary group (is_default = GROUP_DEFAULT_PRIMARY)\n $primaryGroup = GroupLoader::fetch(GROUP_DEFAULT_PRIMARY, \"is_default\");\n \n // Set default values if not specified or not authorized\n if (!isset($data['locale']) || !$this->_app->user->checkAccess(\"update_account_setting\", [\"property\" => \"locale\"]))\n $data['locale'] = $this->_app->site->default_locale;\n \n if (!isset($data['title']) || !$this->_app->user->checkAccess(\"update_account_setting\", [\"property\" => \"title\"])) {\n // Set default title for new users\n $data['title'] = $primaryGroup->new_user_title;\n }\n \n if (!isset($data['primary_group_id']) || !$this->_app->user->checkAccess(\"update_account_setting\", [\"property\" => \"primary_group_id\"])) {\n $data['primary_group_id'] = $primaryGroup->id;\n }\n \n // Set groups to default groups if not specified or not authorized to set groups\n if (!isset($data['groups']) || !$this->_app->user->checkAccess(\"update_account_setting\", [\"property\" => \"groups\"])) {\n $default_groups = GroupLoader::fetchAll(GROUP_DEFAULT, \"is_default\");\n $data['groups'] = [];\n foreach ($default_groups as $group_id => $group){\n $data['groups'][$group_id] = \"1\";\n }\n }\n \n // Hash password\n $data['password'] = Authentication::hashPassword($data['password']);\n \n // Create the user\n $user = new User($data);\n\n // Add user to groups, including selected primary group\n $user->addGroup($data['primary_group_id']);\n foreach ($data['groups'] as $group_id => $is_member) {\n if ($is_member == \"1\"){ \n $user->addGroup($group_id); \n }\n }\n \n // Store new user to database\n $user->store(); \n \n // Success message\n $ms->addMessageTranslated(\"success\", \"ACCOUNT_CREATION_COMPLETE\", $data);\n }",
"public function save_user()\n\t{\n $user= new Users();\n $user->setNom($_POST['nom']);\n $user->setPrenom($_POST['prenom']);\n $user->setDate_naissance($_POST['date_naiss']);\n $user->setEmail($_POST['mail']);\n $user->setPassword($_POST['pwd']); \n\n $user->Create_user();\n\t}",
"public function actionCreate()\n {\n $model = new \\backend\\modules\\application\\models\\User();\n $model->scenario = 'add_staffs';\n if ($model->load(Yii::$app->request->post()) && $model->validate()){\n\t $model->username=$model->email_address;\t\t\n $password=$model->password; \n $model->password_hash=Yii::$app->security->generatePasswordHash($password);\n $model->auth_key = Yii::$app->security->generateRandomString();\n $model->status=10;\n $model->login_type=5;\n\t\t//$model->created_by =Yii::$app->user->identity->user_id;\n\t\t$model->created_at =strtotime(date(\"Y-m-d\"));\n\t\t$model->updated_at =strtotime(date(\"Y-m-d\"));\n\t\t$model->last_login_date =date(\"Y-m-d H:i:s\");\n\t\t$model->date_password_changed=date(\"Y-m-d\");\n $model->created_by=Yii::$app->user->identity->user_id;\t\t\n if($model->save()) {\n #################create staff role #########\n $date=strtotime(date(\"Y-m-d\"));\n\t\t\t\t\t\t\t\t\tif($model->staffLevel==2){\n Yii::$app->db->createCommand(\"INSERT INTO auth_assignment(item_name,user_id,created_at) VALUES('Help Desk',$model->user_id,$date)\")->execute();\n\t\t\t\t\t\t\t\t\t}else if($model->staffLevel==1){\n\t Yii::$app->db->createCommand(\"INSERT INTO auth_assignment(item_name,user_id,created_at) VALUES('super user',$model->user_id,$date)\")->execute();\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t}\n //end\n\t\t\t\t\n\t\t\t\t// here for logs\n $old_data=\\yii\\helpers\\Json::encode($model->attributes);\t\t\t\t\t\t\n\t\t\t\t\t\t$new_data=\\yii\\helpers\\Json::encode($model->attributes);\n\t\t\t\t\t\t$model_logs=\\common\\models\\base\\Logs::CreateLogall($model->user_id,$old_data,$new_data,\"user\",\"CREATE\",1);\n\t\t\t\t//end for logs\n\t\t\t\t\n\t\t $sms=\"<p>Information successful added</p>\";\n Yii::$app->getSession()->setFlash('success', $sms);\n return $this->redirect(['add-user']);\n }\n\t\t} else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function create(){\n \n $data = array();\n $data['login'] = $_POST['login'];\n $data['password'] = Hash::create('sha256', $_POST['password'], HASH_KEY);\n $data['role'] = $_POST['role'];\n \n //Do the Error checking\n \n $this->model->RunCreate($data);\n /*\n * After we Post the user info to create, the header is refereshed so that the data appears dynamically \n * below in the users list\n */\n header('location: ' . URL . 'users');\n }",
"public function create()\n {\n //return view ('admin.user-table.new-user-form');\n }",
"public function actionCreate()\n {\n $model = new User();\n \n if ($model->load(Yii::$app->request->post())) {\n $model->password_hash=Yii::$app->security->generatePasswordHash($model->password_hash);\n if($model->save()){\n Yii::$app->getSession()->setFlash('alert', [\n 'type' => 'success',\n 'duration' => 5000,\n 'icon' => 'fa fa-users',\n 'message' => 'สำเร็จ',\n 'title' => 'บันทึกข้อมูล',\n 'positonY' => 'top',\n 'positonX' => 'right'\n ]);\n //สร้างตามสิทธิ์การใช้งาน\n $id=$model->id;\n $time=Yii::$app->formatter->asTimestamp(date('Y-d-m h:i:s'));\n if($model->type==1){\n $auth_assignment = Yii::$app->db->createCommand(\"INSERT INTO auth_assignment VALUES ('Boss','$id','$time')\")\n ->execute();\n }\n if($model->type==2){\n $auth_assignment = Yii::$app->db->createCommand(\"INSERT INTO auth_assignment VALUES ('Nurse','$id','$time')\")\n ->execute();\n }\n if($model->type==3){\n $auth_assignment = Yii::$app->db->createCommand(\"INSERT INTO auth_assignment VALUES ('Medicalrecords','$id','$time')\")\n ->execute();\n }\n return $this->redirect(['view', 'id' => $model->id]);\n } } else {\n return $this->render('create', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionCreateUser()\n {\n $model = new MstAccount();\n\t\t$date = date('Y-m-d H:i:s'); // @TODO Use Yii dateformatter\n\n\t\t// set defaults\n\t\t// @TODO: transfer updating of status/created/updated details to model\n\t\t// set status, created and updated details\n\t\t$model->status\t\t\t= Yii::$app->params['STATUS_ACTIVE'];\n\t\t$model->creator_id\t\t= Yii::$app->user->id;\n\t\t$model->created_date \t= $date;\n\t\t$model->updater_id\t\t= Yii::$app->user->id;\n\t\t$model->updated_date\t= $date;\n\n\t\t// get plant list\n\t\t$plant_location_list = Yii::$app->modelFinder->getPlantList(null, ['status' => Yii::$app->params['STATUS_ACTIVE']], 'plant_location');\n\t\t$assignment_list = ArrayHelper::map($plant_location_list, 'plant_location', 'plant_location');\n\n if ($model->load(Yii::$app->request->post())) {\n \t$model->password = md5($model->password);\n\n\t\t\t// convert to correct date format\n\t\t\t$model->start_date = Yii::$app->dateFormatter->convert($model->start_date);\n\t\t\t$model->end_date = Yii::$app->dateFormatter->convert($model->end_date);\n\n\t\t\tif ($model->save()) {\n\t\t\t\treturn $this->redirect(['view-user', 'id' => $model->id]);\n\t\t\t} else {\n\t\t\t\treturn $this->render('create-user', [\n\t 'model' => $model,\n\t 'assignment_list' => $assignment_list,\n\t ]);\n\t\t\t}\n } else {\n return $this->render('create-user', [\n 'model' => $model,\n 'assignment_list' => $assignment_list,\n ]);\n }\n }",
"public function create()\n {\n return view('webcontrol.user.add');\n }",
"public function create_user()\n {\n $this->data['title'] = $this->lang->line('create_user_heading');\n\n if (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin())\n {\n redirect('auth', 'refresh');\n }\n\n $tables = $this->config->item('tables','ion_auth');\n $identity_column = $this->config->item('identity','ion_auth');\n $this->data['identity_column'] = $identity_column;\n\n // validate form input\n $this->form_validation->set_rules('first_name', $this->lang->line('create_user_validation_fname_label'), 'required');\n $this->form_validation->set_rules('last_name', $this->lang->line('create_user_validation_lname_label'), 'required');\n if($identity_column!=='email')\n {\n $this->form_validation->set_rules('identity',$this->lang->line('create_user_validation_identity_label'),'required|is_unique['.$tables['users'].'.'.$identity_column.']');\n $this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'required|valid_email');\n }\n else\n {\n $this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'required|valid_email|is_unique[' . $tables['users'] . '.email]');\n }\n $this->form_validation->set_rules('phone', $this->lang->line('create_user_validation_phone_label'), 'trim');\n $this->form_validation->set_rules('company', $this->lang->line('create_user_validation_company_label'), 'trim');\n $this->form_validation->set_rules('password', $this->lang->line('create_user_validation_password_label'), 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[password_confirm]');\n $this->form_validation->set_rules('password_confirm', $this->lang->line('create_user_validation_password_confirm_label'), 'required');\n\n if ($this->form_validation->run() == true)\n {\n $email = strtolower($this->input->post('email'));\n $identity = ($identity_column==='email') ? $email : $this->input->post('identity');\n $password = $this->input->post('password');\n\n $additional_data = array(\n 'first_name' => $this->input->post('first_name'),\n 'last_name' => $this->input->post('last_name'),\n 'company' => $this->input->post('company'),\n 'phone' => $this->input->post('phone'),\n );\n }\n if ($this->form_validation->run() == true && $this->ion_auth->register($identity, $password, $email, $additional_data))\n {\n // check to see if we are creating the user\n $this->emailNotification($identity, $email, $password);\n // redirect them back to the admin page\n $this->session->set_flashdata('message', $this->ion_auth->messages());\n redirect(\"auth\", 'refresh');\n }\n else\n {\n\t\t\t\n\t\t\t//var_dump($ss);exit;\n // display the create user form\n // set the flash data error message if there is one\n $this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\n\n $this->data['first_name'] = array(\n 'name' => 'first_name',\n 'id' => 'first_name',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('first_name'),\n );\n $this->data['last_name'] = array(\n 'name' => 'last_name',\n 'id' => 'last_name',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('last_name'),\n );\n $this->data['identity'] = array(\n 'name' => 'identity',\n 'id' => 'identity',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('identity'),\n );\n $this->data['email'] = array(\n 'name' => 'email',\n 'id' => 'email',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('email'),\n );\n $this->data['organisation'] = array(\n 'name' => 'company',\n 'id' => 'organisation',\n 'type' => 'select',\n 'options' => $this->get_options(),\n );\n $this->data['company'] = array(\n 'name' => 'company',\n 'id' => 'company',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('company'),\n );\n $this->data['phone'] = array(\n 'name' => 'phone',\n 'id' => 'phone',\n 'type' => 'text',\n 'value' => $this->form_validation->set_value('phone'),\n );\n $this->data['password'] = array(\n 'name' => 'password',\n 'id' => 'password',\n 'type' => 'password',\n 'value' => $this->form_validation->set_value('password'),\n );\n $this->data['password_confirm'] = array(\n 'name' => 'password_confirm',\n 'id' => 'password_confirm',\n 'type' => 'password',\n 'value' => $this->form_validation->set_value('password_confirm'),\n );\n\n $this->_render_page('auth/create_user', $this->data);\n }\n }",
"public function create()\n {\n return view('sys_user.create');\n }",
"public function getCreate()\n {\n //添加用户\n return view('admin.houtai.user.add',['title'=>'添加用户']);\n }",
"function admin_add() {\n\n\t\tif (!empty($this->data)) {\n\n\t\t\t$this->User->create();\n\n\t\t\t/**\n\t\t\t * Save new user.\n\t\t\t */\n\t\t\tif ($this->User->save($this->data)) {\n\n\t\t\t\t/**\n\t\t\t\t * If the new user is saved, a success message is displayed.\n\t\t\t\t * Redirect to the index page.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('core', 'The user has been saved.', true));\n\t\t\t\t$this->redirect(array('action' => 'index'));\n\n\t\t\t} else {\n\t\t\t\t/**\n\t\t\t\t * If the user is not saved, an error message is displayed.\n\t\t\t\t */\n\t\t\t\t$this->Session->setFlash(__d('core', 'The user has not been saved.', true), 'default', array('class' => 'error'));\n\t\t\t}\n\t\t}\n\n\t\t/**\n\t\t * Select all profiles (Administrator or Member).\n\t\t * @var array\n\t\t */\n\t\t$profiles = $this->User->Profile->find('list');\n\n\t\t/**\n\t\t * Select all offers enabled.\n\t\t * @var array\n\t\t */\n\t\t$offers = $this->User->Offer->find('list');\n\n\t\t/**\n\t\t * Put all profiles in \"profiles\" and offers in \"offers\".\n\t\t * $profiles and $offers will be available in the view.\n\t\t */\n\t\t$this->set(compact('profiles', 'offers'));\n\n\t}",
"public function create() {\n $user=$this->auth->user();\n if($user->cant('create',$user)){\n return redirect()->back()->withErrors(['rpErrorCreate'=>'done']);\n }\n return view('admin.users.create');\n }",
"public function actionCreate()\n {\n $model = new User();\n\n if (isset($_POST['User']))\n {\n\n $transaction = Yii::app()->db->beginTransaction();\n\n try\n {\n $model->setAttributes($_POST['User']);\n $model->salt = Registration::model()->generateSalt();\n $model->password = Registration::model()->hashPassword($model->password, $model->salt);\n $model->registrationIp = Yii::app()->request->userHostAddress;\n\n if ($model->save())\n {\n $profile = new Profile();\n $profile->user_id = $model->id;\n if ($profile->save())\n {\n $transaction->commit();\n Yii::app()->user->setFlash(YFlashMessages::NOTICE_MESSAGE, Yii::t('user', 'Новый пользователь добавлен!'));\n $this->redirect(array('view', 'id' => $model->id));\n }\n else\n {\n throw new CDbException(Yii::t('user', 'При создании пользователя произошла ошибка! Подробности в журнале исполнения.'));\n }\n }\n\n }\n catch (CDbException $e)\n {\n $transaction->rollback();\n Yii::log($e->getMessage(), CLogger::LEVEL_ERROR, UserModule::$logCategory);\n Yii::app()->user->setFlash(YFlashMessages::ERROR_MESSAGE, $e->getMessage());\n $this->redirect(array('create'));\n }\n }\n\n $this->render('create', array(\n 'model' => $model,\n ));\n }",
"public function createUser(){\n \n $password = DbrLib::rand_string(8);\n \n /**\n * create username \n */\n $firstName = strtolower(self::translitStringToAscii($this->pprs_first_name));\n $secondName = strtolower(self::translitStringToAscii($this->pprs_second_name));\n $username = $firstName . substr($secondName, 0, 1);\n $i = 1;\n while(User::model()->findByAttributes(['username'=>$username])){\n $i ++;\n if($i> strlen($secondName)){\n $username = $firstName . DbrLib::rand_string(2);\n }\n $username = $firstName . substr($secondName, 0, $i); \n }\n \n /**\n * get email from person contacts\n */\n $contacts = $this->ppcnPersonContacts;\n $email = '';\n foreach($contacts as $contact){\n if($contact->ppcn_pcnt_type == PcntContactType::TYPE_EMAIL ){\n $email = trim($contact->ppcn_value);\n }\n }\n \n /**\n * create user record\n */\n $user = new User();\n $user->username = $username;\n $user->password = $password;\n $user->email = $email;\n $user->status = User::STATUS_ACTIVE;\n \n if(!$user->validate()){\n return CHtml::errorSummary($user);\n }\n \n $user->save();\n \n /**\n * create profile record\n */\n $profile=new Profile;\n $profile->user_id=$user->id;\n $profile->first_name = $this->pprs_first_name;\n $profile->last_name = $this->pprs_second_name;\n $profile->sys_ccmp_id = Yii::app()->sysCompany->getActiveCompany();\n $profile->person_id=$this->primaryKey;\n\t\t$profile->save(); \n \n return true;\n \n \n }",
"public function actionCreate()\n {\n $model = new User();\n\n if ($model->load(Yii::$app->request->post())) {\n\n $foto = UploadedFile::getInstance($model,'use_foto');\n\n if ($foto == ''){\n $model->use_foto = 'usuario_anonimo.jpg';\n }else{\n\n $modelFoto = User::find()->count();\n\n $foto->saveAs('img/user/'. $foto->baseName . '_'.$model->use_nombre.$model->use_apellido.'_'.($modelFoto+1) .'.' . $foto->extension);\n $model->use_foto = $foto->baseName . '_'.$model->use_nombre.$model->use_apellido.'_'.($modelFoto+1) .'.' . $foto->extension;\n }\n\n /*\n * 1. usuario Administrador\n * 2. usuario Investigador\n * 3. usuario Registrado\n */\n\n /* if($model->rol_id != 2){\n $model ->use_estado = 1;\n //Aqui va codigo borrar el perfil del investigador\n }*/\n\n $model -> use_estadoAudit = 'N';\n $model -> use_fechaCreacion = date('y-m-d H:i:s');\n $model -> use_fechaAudit = date('y-m-d H:i:s');\n $model -> use_accion = 'N';\n\n\n if($model->signup()){\n Yii::$app->session->setFlash('msg', '\n <div class=\"alert alert-success alert-dismissable\">\n <button aria-hidden=\"true\" data-dismiss=\"alert\" class=\"close\" type=\"button\">X</button>\n <h4><i class=\"bx bx-check\"></i>Registro agregado!</h4>\n El registro se agregó correctamente.\n </div>\n ');\n return $this->redirect(['view', 'id' => $model->id]);\n }\n }\n\n return $this->render('create', [\n 'model' => $model,\n ]);\n }",
"protected function create(array $data)\n {\n $status = 'pending';\n if(Auth::user()){\n if(Auth::user()->type == 'super_admin' || Auth::user()->type == 'admin' ){\n $status = 'approved';\n }\n }\n $user = new User();\n $user->name = $data['name']; \n $user->email = $data['email'];\n $user->phone = $data['phone'];\n $user->type = $data['type'];\n $user->password = Hash::make($data['password']);\n $user->save();\n\n if($data['type'] == 'client')\n {\n $client = new Client();\n $client->user_id = $user->id;\n $client->address = $data['address'];\n $client->status = 'approved';\n $client->save();\n }\n elseif($data['type'] == 'driver')\n {\n $driver = new Driver();\n $driver->user_id = $user->id;\n $driver->address = $data['address'];\n $driver->status = $status;\n $driver->save();\n }\n elseif($data['type'] == 'finance')\n {\n $finance = new Finance();\n $finance->user_id = $user->id;\n $finance->address = $data['address'];\n $finance->status = $status;\n $finance->save();\n }\n elseif($data['type'] == 'dispatcher')\n {\n $dispatcher = new Dispatcher();\n $dispatcher->user_id = $user->id;\n $dispatcher->address = $data['address'];\n $dispatcher->status = $status;\n $dispatcher->save();\n }\n elseif($data['type'] == 'monitor')\n {\n $monitor = new Monitor();\n $monitor->user_id = $user->id;\n $monitor->address = $data['address'];\n $monitor->status = $status;\n $monitor->save();\n }\n elseif($data['type'] == 'pickup')\n {\n $monitor = new Pickedup();\n $monitor->user_id = $user->id;\n $monitor->address = $data['address'];\n $monitor->status = $status;\n $monitor->save();\n }\n }",
"private function recordUser($action) {\n $data = array(\n 'class_name' => $this->getClassName(),\n 'object_id' => $this->id,\n 'user_id' => Auth::user()->id,\n 'action' => $action\n );\n $this->user_counters()->updateOrCreate($data, $data);\n }",
"public function createUser()\n {\n $result = 1;\n \n $this->registrationDate = date('Y-m-d');\n $this->validation = uniqid();\n \n $transaction = $this->dbConnection->beginTransaction();\n \n try\n { \n if($this->save()){\n //Get the idUser of the new User and specify it in the table verifIdentity\n $idUser = Yii::app()->db->getLastInsertId();\n $verifIdentity = VerifIdentity::model()->findByPk($this->serialNumber);\n $verifIdentity->idUser = $idUser;\n if(!$verifIdentity->save())\n throw new CDbException(null); \n\n //Upload of Profile Picture\n if($this->profilePicture !== \"default\")\n {\n $result = $this->addPicture($this->profilePicture, $this->profilePictureExtension);\n if($result !== 1)\n {\n $this->addError('pictureUploader',$result);\n throw new CException(null); \n }\n }\n\n $transaction->commit();\n }\n else $result = 0;\n }\n catch(Exception $e)\n {\n if($e !== null)\n $this->addError('pictureUploader',\"Problem during create process\");\n $transaction->rollBack();\n $result = 0;\n } \n\n return $result;\n }",
"public function create_user()\r\n {\r\n $this->data['title'] = $this->lang->line('create_user_heading');\r\n\r\n if (!$this->ion_auth->logged_in() || !$this->ion_auth->is_admin())\r\n {\r\n //redirect('auth', 'refresh');\r\n }\r\n\r\n $tables = $this->config->item('tables','ion_auth');\r\n $identity_column = $this->config->item('identity','ion_auth');\r\n $this->data['identity_column'] = $identity_column;\r\n\r\n // validate form input\r\n $this->form_validation->set_rules('first_name', $this->lang->line('create_user_validation_fname_label'), 'required');\r\n $this->form_validation->set_rules('last_name', $this->lang->line('create_user_validation_lname_label'), 'required');\r\n if($identity_column!=='email')\r\n {\r\n $this->form_validation->set_rules('identity',$this->lang->line('create_user_validation_identity_label'),'required|is_unique['.$tables['users'].'.'.$identity_column.']');\r\n $this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'required|valid_email');\r\n }\r\n else\r\n {\r\n $this->form_validation->set_rules('email', $this->lang->line('create_user_validation_email_label'), 'required|valid_email|is_unique[' . $tables['users'] . '.email]');\r\n }\r\n $this->form_validation->set_rules('phone', $this->lang->line('create_user_validation_phone_label'), 'trim');\r\n $this->form_validation->set_rules('company', $this->lang->line('create_user_validation_company_label'), 'trim');\r\n $this->form_validation->set_rules('password', $this->lang->line('create_user_validation_password_label'), 'required|min_length[' . $this->config->item('min_password_length', 'ion_auth') . ']|max_length[' . $this->config->item('max_password_length', 'ion_auth') . ']|matches[password_confirm]');\r\n $this->form_validation->set_rules('password_confirm', $this->lang->line('create_user_validation_password_confirm_label'), 'required');\r\n\r\n if ($this->form_validation->run() == true)\r\n {\r\n $email = strtolower($this->input->post('email'));\r\n $identity = ($identity_column==='email') ? $email : $this->input->post('identity');\r\n $password = $this->input->post('password');\r\n\r\n $additional_data = array(\r\n 'first_name' => $this->input->post('first_name'),\r\n 'last_name' => $this->input->post('last_name'),\r\n 'company' => $this->input->post('company'),\r\n 'phone' => $this->input->post('phone'),\r\n );\r\n }\r\n if ($this->form_validation->run() == true && $this->ion_auth->register($identity, $password, $email, $additional_data))\r\n {\r\n // check to see if we are creating the user\r\n // redirect them back to the admin page\r\n $this->session->set_flashdata('message', $this->ion_auth->messages());\r\n redirect(\"auth\", 'refresh');\r\n }\r\n else\r\n {\r\n // display the create user form\r\n // set the flash data error message if there is one\r\n $this->data['message'] = (validation_errors() ? validation_errors() : ($this->ion_auth->errors() ? $this->ion_auth->errors() : $this->session->flashdata('message')));\r\n\r\n $this->data['first_name'] = array(\r\n 'name' => 'first_name',\r\n 'id' => 'first_name',\r\n 'type' => 'text',\r\n 'value' => $this->form_validation->set_value('first_name'),\r\n );\r\n $this->data['last_name'] = array(\r\n 'name' => 'last_name',\r\n 'id' => 'last_name',\r\n 'type' => 'text',\r\n 'value' => $this->form_validation->set_value('last_name'),\r\n );\r\n $this->data['identity'] = array(\r\n 'name' => 'identity',\r\n 'id' => 'identity',\r\n 'type' => 'text',\r\n 'value' => $this->form_validation->set_value('identity'),\r\n );\r\n $this->data['email'] = array(\r\n 'name' => 'email',\r\n 'id' => 'email',\r\n 'type' => 'text',\r\n 'value' => $this->form_validation->set_value('email'),\r\n );\r\n $this->data['company'] = array(\r\n 'name' => 'company',\r\n 'id' => 'company',\r\n 'type' => 'text',\r\n 'value' => $this->form_validation->set_value('company'),\r\n );\r\n $this->data['phone'] = array(\r\n 'name' => 'phone',\r\n 'id' => 'phone',\r\n 'type' => 'text',\r\n 'value' => $this->form_validation->set_value('phone'),\r\n );\r\n $this->data['password'] = array(\r\n 'name' => 'password',\r\n 'id' => 'password',\r\n 'type' => 'password',\r\n 'value' => $this->form_validation->set_value('password'),\r\n );\r\n $this->data['password_confirm'] = array(\r\n 'name' => 'password_confirm',\r\n 'id' => 'password_confirm',\r\n 'type' => 'password',\r\n 'value' => $this->form_validation->set_value('password_confirm'),\r\n );\r\n\t\t\t\r\n\t\t\t$this->_render_page('auth/create_user', $this->data);\r\n }\r\n }",
"public function actionCreate()\r\n {\r\n if (!Yii::app()->user->isGuest) {\r\n /* @var $model User */\r\n $model = new User;\r\n\r\n // Loads user model if signed in.\r\n if (isset(Yii::app()->session['uid'])) {\r\n $model = User::model()->findByPk(Yii::app()->session['uid']);\r\n }\r\n\r\n // Uncomment the following line if AJAX validation is needed\r\n $this->performAjaxValidation($model);\r\n\r\n if (isset($_POST['User'])) {\r\n // Set attributes from 'POST'\r\n $model->attributes = $_POST['User'];\r\n\r\n // Saves model and then labs and techniques are saved.\r\n if ($model->save()) {\r\n // Delete old labs and save new ones\r\n if (!empty($model->selectedLabs)) {\r\n $labs = LabUser::model()->findAllByAttributes(array('userId' => Yii::app()->session['uid']));\r\n foreach ($labs as $lab) {\r\n $lab->delete();\r\n }\r\n foreach ($model->selectedLabs as $lab) {\r\n $labUser = new LabUser();\r\n $labUser->userId = Yii::app()->session['uid'];\r\n $labUser->labId = $lab;\r\n $labUser->save();\r\n }\r\n }\r\n\r\n // Delete old other lab name and save the new one\r\n if (!empty($model->otherLabName)) {\r\n /* @var $otherLabs LabUserOther */\r\n $otherLabs = LabUserOther::model()->findAllByAttributes(array('userId' => Yii::app()->session['uid']));\r\n if (!empty($otherLabs)) foreach ($otherLabs as $otherLab) $otherLab->delete();\r\n $otherLab = new LabUserOther();\r\n $otherLab->userId = Yii::app()->session['uid'];\r\n $otherLab->name = $model->otherLabName;\r\n $otherLab->save();\r\n }\r\n\r\n // Delete older techniques and save new ones\r\n if (!empty($model->selectedTechs)) {\r\n $techs = TechUser::model()->findAllByAttributes(array('userId' => Yii::app()->session['uid']));\r\n foreach ($techs as $tech) {\r\n $tech->delete();\r\n }\r\n foreach ($model->selectedTechs as $tech) {\r\n $techUser = new TechUser();\r\n $techUser->userId = Yii::app()->session['uid'];\r\n $techUser->techId = $tech;\r\n $techUser->save();\r\n }\r\n }\r\n\r\n // Delete old other technique and save new one\r\n if (!empty($model->otherTechName)) {\r\n /* @var $otherTechs TechUserOther */\r\n $otherTechs = TechUserOther::model()->findAllByAttributes(array('userId' => Yii::app()->session['uid']));\r\n if (!empty($otherTechs)) foreach ($otherTechs as $otherTech) $otherTech->delete();\r\n $otherTech = new TechUserOther();\r\n $otherTech->userId = Yii::app()->session['uid'];\r\n $otherTech->name = $model->otherTechName;\r\n $otherTech->save();\r\n }\r\n\r\n // Delete older user positions and save new ones\r\n if (!empty($model->selectedPositions)) {\r\n $positions = UserPosition::model()->findAllByAttributes(array('userId' => Yii::app()->session['uid']));\r\n foreach ($positions as $position) {\r\n $position->delete();\r\n }\r\n foreach ($model->selectedPositions as $position) {\r\n $userPosition = new UserPosition();\r\n $userPosition->userId = Yii::app()->session['uid'];\r\n $userPosition->positionId = $position;\r\n $userPosition->save();\r\n }\r\n }\r\n\r\n// $this->redirect(array('create', 'id' => $model->id));\r\n // sets success flash named 'update'\r\n Yii::app()->user->setFlash('update', Yii::app()->params['SUCCESS']);\r\n } else {\r\n // sets failure flash named 'update'\r\n Yii::app()->user->setFlash('update', Yii::app()->params['FAILURE']);\r\n }\r\n }\r\n $this->render('create', array(\r\n 'model' => $model,\r\n 'readonly' => false,\r\n ));\r\n } else {\r\n $this->redirect(array('site/index'));\r\n }\r\n }",
"public function update(Request $request, User $user)\n {\n $this->authorize('haveaccess','misdatos');\n\n\n $user->update($request->all());\n\n $nombre='Su ubicación actual es: '.$request->nombremp;\n\n if($request->sucursal==\"2\"){\n DB::table('role_user')->where('user_id', $user->id)\n ->update(['role_id' => $request->role_id]);\n\n return redirect()->route('user.edit',$user->id)\n ->with('status_success', $nombre );\n } else {\n\n $asignado = DB::table('empresa_users')->where('user_id', $user->id)\n ->where('empresa_id', $user->empresa)\n ->select('role_id')\n ->first();\n\n if(empty($asignado)){\n\n $rolactual = DB::table('empresa_users')->where('user_id', $user->id)\n ->where('empresa_id', $request->empresactual)\n ->select('role_id')\n ->first();\n\n DB::table('empresa_users')->insert([\n 'user_id' => $user->id,\n 'empresa_id' => $user->empresa,\n 'role_id' => $rolactual->role_id,\n 'name' => $user->name,\n 'sucursal_id' => $request->sucurid,\n 'sucursal' => $request->sucurnom,\n 'area_id' => $request->areaid,\n 'area' => $request->areanom\n\n ]);\n }\n\n\n\n return redirect()->route('sucursal')\n ->with('status_success',$nombre);\n }\n\n\n }",
"public function assignuserAction()\n {\n $id = $this->request->getPost('id', 'int');\n $npfOffice = NpfOffices::findFirstById($id);\n if (!$npfOffice) {\n $this->flash->error(\"Office Type was not found\");\n return $this->dispatcher->forward(array('action' => 'index'));\n }\n\n if ($this->request->isPost()) {\n //todo: check first if the user is already assigned to the office\n\n $npfUserOffice = new NpfOfficeUsers();\n $npfUserOffice->assign(array(\n 'user_id' => $this->request->getPost('user_id', 'striptags'),\n 'office_id' => $id,\n ));\n\n if (!$npfUserOffice->save()) {\n $this->flash->error($npfOffice->getMessages());\n } else {\n\n $this->flash->success(\"Office User was updated successfully\");\n return $this->response->redirect('offices/edit/'.$id);\n }\n\n }\n $this->view->office = $npfOffice;\n $this->view->form = new NpfOfficesForm($npfOffice, array('edit' => true));\n }"
]
| [
"0.66547537",
"0.65458035",
"0.6519732",
"0.6471781",
"0.64702564",
"0.646316",
"0.637926",
"0.6377438",
"0.63547117",
"0.63268435",
"0.6314956",
"0.6306965",
"0.6251617",
"0.62152976",
"0.62027377",
"0.6202638",
"0.61700296",
"0.6143403",
"0.6134979",
"0.6134979",
"0.6133856",
"0.61283517",
"0.6116911",
"0.6116911",
"0.6116911",
"0.6116911",
"0.6114144",
"0.6113294",
"0.6104942",
"0.60988504",
"0.6086235",
"0.60841465",
"0.6083979",
"0.6083881",
"0.6068",
"0.60660267",
"0.6055463",
"0.604766",
"0.60466486",
"0.60396236",
"0.6030046",
"0.6021234",
"0.6019116",
"0.6016014",
"0.6009298",
"0.6001608",
"0.5998967",
"0.599278",
"0.59910357",
"0.598871",
"0.5975408",
"0.596133",
"0.59590757",
"0.59587675",
"0.5949656",
"0.59461516",
"0.5943591",
"0.5942394",
"0.5934794",
"0.5934012",
"0.5932732",
"0.5931868",
"0.5916523",
"0.59157306",
"0.5912791",
"0.5907087",
"0.5902529",
"0.58976203",
"0.58962214",
"0.5895485",
"0.58944553",
"0.58923423",
"0.5891547",
"0.5890198",
"0.58838433",
"0.5882314",
"0.58804923",
"0.5877466",
"0.5875734",
"0.5870471",
"0.58703667",
"0.5860925",
"0.5860487",
"0.5855374",
"0.5854373",
"0.58543575",
"0.5848259",
"0.58469635",
"0.58464724",
"0.58410543",
"0.5839149",
"0.5837856",
"0.583693",
"0.58289534",
"0.5824517",
"0.58234787",
"0.5818043",
"0.5816683",
"0.581288",
"0.5806218",
"0.5793714"
]
| 0.0 | -1 |
Get Application Type by store type | public function getApplicationTypeByStoreType ($storeType)
{
if ( (int) $storeType === AccreditationApplication::SELLER_TYPE_RESELLER) {
$storeType = AccreditationApplication::SELLER_TYPE_RESELLER;
}
else {
$storeType = AccreditationApplication::SELLER_TYPE_MERCHANT;
}
return $storeType;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAppType();",
"public function getApplicationType()\n {\n return $this->applicationType;\n }",
"protected function getAppUuid($type, $store)\n {\n $url = \"\";\n if ($type ==\"sketch\") {\n $url = $this->_codesHelper->getSketchUrl($store);\n }\n if ($type ==\"photo\") {\n $url = $this->_codesHelper->getImpreseeUuid($store);\n }\n return $this->_codesHelper->getCode($url);\n }",
"final public function getType() {\n\t\treturn 'app';\n\t}",
"public static function getRunType()\n {\n return 'store';\n }",
"public function getStoreByCode($store)\n {\n if (is_null($this->_stores)) {\n $this->_stores = Mage::app()->getStores(true, true);\n }\n if (isset($this->_stores[$store])) {\n return $this->_stores[$store];\n }\n return false;\n }",
"private function type($type) {\n\t\t$t = $this->api_map[$type];\n\t\t$t[\"url\"] = $this->get(\"store_url\") . $t[\"url\"] . \"?api_key=\".$this->get(\"api_key\");\n\t\treturn $t;\n\t}",
"public function getProductType();",
"public function get_type();",
"public static function getTypeName($type = ''): string\n {\n switch ($type) {\n case '':\n $type = 'app_id';\n break;\n case 'app':\n $type = 'appid';\n break;\n default:\n $type = $type.'_id';\n }\n\n return $type;\n }",
"private function getThemeConfigKey($type = '') {\n if (strcasecmp($type, 'desktop') === 0) {\n $type = '';\n }\n $r = 'Garden.'.ucfirst($type).'Theme';\n return $r;\n }",
"public function getThemeKey($type = '') {\n if ($type === 'mobile') {\n $r = $this->config->get('Garden.MobileTheme', AddonManager::DEFAULT_MOBILE_THEME);\n } else {\n $r = $this->config->get('Garden.Theme', AddonManager::DEFAULT_DESKTOP_THEME);\n }\n return $r;\n }",
"public function get_type(): string;",
"final public function getBackendByType($type) {\n\t\t$type = mb_strtolower($type);\n\t\tif (!array_key_exists($type, $this->map))\n\t\t\treturn NULL;\n\t\treturn $this->map[$type];\n\t}",
"public function getDatabaseType();",
"public function getDatabaseType();",
"public function getCheckoutType($store = null)\n {\n return $this->getVersionConfig($store)->getType();\n }",
"function get_type() {\n\t\treturn $this->get_data( 'type' );\n\t}",
"public function getType(){\n return ucfirst(array_search($this->type, self::userTypes()));\n }",
"public function checkBookType($type = null){\n $result = $this->find()\n ->where(['alias'=> $type]) ->first();;\n return $result;\n }",
"public function mf_application_type() {\n\n\t\t$args = array(\n\t\t\t'posts_per_page' => 2000,\n\t\t\t'post_type' => 'mf_form',\n\t\t\t'post_status' => 'any',\n\n\t\t\t// Prevent new posts from affecting the order\n\t\t\t'orderby' => 'ID',\n\t\t\t'order' => 'ASC',\n\n\t\t\t// Speed this up\n\t\t\t'no_found_rows' => true,\n\t\t\t'update_post_meta_cache' => false,\n\t\t\t'update_post_term_cache' => false,\n\t\t);\n\n\t\t// Get the first set of posts\n\t\t$query = new WP_Query( $args );\n\n\t\twhile ( $query->have_posts() ) : $query->the_post();\n\t\tglobal $post;\n\t\t\tsetup_postdata($post);\n\t\t\t//WP_CLI::line( get_the_title() );\n\t\t\t$json = json_decode( str_replace( array(\"\\'\", \"u03a9\", \"u2019\"), array(\"'\", 'Ω', '’'), get_the_content() ) );\n\t\t\t//WP_CLI::line( $json->form_type );\n\t\t\t$type = wp_set_object_terms( get_the_ID(), $json->form_type, 'type' );\n\t\t\tif ( is_array( $type ) ) {\n\t\t\t\tWP_CLI::success( 'Updated ' . get_the_title() );\n\t\t\t} elseif (is_wp_error( $type )) {\n\t\t\t\tWP_CLI::warning( 'Wasn\\'t able to update ' . get_the_title() );\n\t\t\t}\n\t\tendwhile;\n\t\tWP_CLI::success( \"Boom!\" );\n\t\t\n\t}",
"public function get_type() {\n\t\treturn 'catalog';\n\t}",
"public function phpunit_get_store_class() {\n return get_class($this->get_store());\n }",
"public function phpunit_get_store_class() {\n return get_class($this->get_store());\n }",
"public function phpunit_get_store_class() {\n return get_class($this->get_store());\n }",
"function getType(): string;",
"function getType(): string;",
"protected function _getShopSystemType()\n {\n switch ($this->_getEdition()) {\n case self::TYPE_COMMUNITY:\n $type = 76;\n break;\n case self::TYPE_ENTERPRISE:\n $type = 228;\n break;\n case self::TYPE_GO:\n $type = 229;\n break;\n default:\n $type = null;\n }\n\n return $type;\n }",
"public function get_item_type() {\n $query = $this->db->get('item_type');\n if ($query->num_rows() > 0) {\n return $query->result();\n } else {\n return false;\n }\n }",
"public function get(string $type): mixed\n {\n if (array_key_exists($type, $this->store)) {\n return $this->store[$type];\n }\n\n return $this->getBinding($type)\n ->getInstance();\n }",
"public function get_type() { return substr( strrchr( get_called_class(), '\\\\' ), 1 ); }",
"protected function getType($type) {\n\t\tif (isset($this->typeAlias[$type])) {\n\t\t\treturn $this->typeAlias[$type];\n\t\t}\n\t\treturn $type;\n\t}",
"public function getAppVersionType() : string {\n return $this->configVars['version-info']['version-type'];\n }",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function getType(): string;",
"public function get_engine_code(/* ... */)\n {\n return $this->_type;\n }",
"public function getType()\n {\n $explode = explode('.', $this->name);\n return $type = array_first($explode);\n }",
"private function get_type() {\n\n\t}",
"public function get_current_page_type() {\n\n\t\tglobal $pagenow;\n\n\t\t$type = '';\n\n\t\tswitch ( $pagenow ) {\n\n\t\t\tcase 'post-new.php':\n\t\t\tcase 'post.php':\n\n\t\t\t\tif ( isset( $_GET['action'] ) && $_GET['action'] === 'elementor' ) {\n\n\t\t\t\t\t$type = 'widgets';\n\n\t\t\t\t} else {\n\n\t\t\t\t\t$type = 'metabox';\n\t\t\t\t}\n\n\t\t\t\tbreak;\n\n\t\t\tcase 'term.php':\n\t\t\tcase 'edit-tags.php':\n\t\t\t\t$type = 'taxonomy';\n\t\t\t\tbreak;\n\n\t\t\tcase 'widgets.php':\n\t\t\t\t$type = 'widgets';\n\t\t\t\tbreak;\n\n\t\t\tcase 'nav-menus.php':\n\t\t\t\t$type = 'menus';\n\t\t\t\tbreak;\n\n\t\t\tcase 'profile.php':\n\t\t\tcase 'user-new.php':\n\t\t\tcase 'user-edit.php':\n\t\t\t\t$type = 'users';\n\t\t\t\tbreak;\n\n\t\t\tcase 'index.php':\n\t\t\t\t$type = 'dashboard';\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\tif ( isset( $_GET['page'] ) && ( preg_match( '/^better-studio-/', $_GET['page'] ) || preg_match( '/^better-studio\\//', $_GET['page'] ) ) ) {\n\t\t\t\t\t$type = 'panel';\n\t\t\t\t}\n\n\t\t}\n\n\t\treturn $type;\n\t}",
"protected function getDefaultStoreCode()\n {\n $store = $this->getVar('defaultStore', 'default');\n $stores = array_keys($this->getStores());\n if (in_array($store, $stores)) {\n return $store;\n } else {\n return array_shift($stores);\n }\n }",
"public function getStore()\n {\n $store = Mage::app()->getStore();\n if ($this->getCategory() && $this->getCategory()->getStoreId()) {\n $storeId = $this->getCategory()->getStoreId();\n $store = Mage::app()->getStore($storeId);\n }\n if ($this->getData('store')) {\n $store = $this->getData('store');\n }\n if ($this->getData('store_id')) {\n $storeId = $this->getData('store_id');\n $store = Mage::app()->getStore($storeId);\n }\n return $store;\n }",
"public function getType($type)\n {\n $array = self::getTypeOptions();\n return $array[$type];\n }",
"function owa_get_page_type() {\t\r\n\t\r\n\tif (is_home()):\r\n\t\t$type = \"Home\";\r\n\telseif (is_attachment()):\r\n\t\t$type = \"Attachment\";\r\n\telseif (is_page()):\r\n\t\t$type = \"Page\";\r\n\t// general page catch, should be after more specific post types\t\r\n\telseif (is_single()):\r\n\t\t$type = \"Post\";\r\n\telseif (is_feed()):\r\n\t\t$type = \"Feed\";\r\n\telseif (is_author()):\r\n\t\t$type = \"Author\";\r\n\telseif (is_category()):\r\n\t\t$type = \"Category\";\r\n\telseif (is_search()):\r\n\t\t$type = \"Search Results\";\r\n\telseif (is_month()):\r\n\t\t$type = \"Month\";\r\n\telseif (is_day()):\r\n\t\t$type = \"Day\";\r\n\telseif (is_year()):\r\n\t\t$type = \"Year\";\r\n\telseif (is_time()):\r\n\t\t$type = \"Time\";\r\n\telseif (is_tag()):\r\n\t\t$type = \"Tag\";\r\n\telseif (is_tax()):\r\n\t\t$type = \"Taxonomy\";\r\n\t// general archive catch, should be after specific archive types\t\r\n\telseif (is_archive()):\r\n\t\t$type = \"Archive\";\r\n\telse:\r\n\t\t$type = '(not set)';\r\n\tendif;\r\n\t\r\n\treturn $type;\r\n}",
"protected function get_meta_type() {\n\t\tif ( $current_filter = current_filter() ) {\n\t\t\treturn papi_get_meta_type( explode( '_', $current_filter )[1] );\n\t\t}\n\n\t\treturn papi_get_meta_type();\n\t}",
"public function getComponentApp($type, $page = 0) {\n $typeId = Level::$level_categories[$type];\n if ($typeId) {\n $component = Component::getComponentApp($typeId, $page);\n return \\Response::json($component);\n }\n return '';\n }",
"public function getProduct_type () {\n\t$preValue = $this->preGetValue(\"product_type\"); \n\tif($preValue !== null && !\\Pimcore::inAdmin()) { \n\t\treturn $preValue;\n\t}\n\t$data = $this->product_type;\n\treturn $data;\n}",
"public function getType()\n {\n return PackageType::byValue($this->lang);\n }",
"function _get_type() {\n\t\treturn $this->type();\n\n\t}",
"private function GetType()\n\t\t{\n\t\t\t$type = get_called_class();\n\t\t\t$type = explode(\"\\\\\",$type);\n\t\t\t$type = $type[(count($type)-1)];\n\t\t\t\n\t\t\treturn $type;\n\t\t}",
"function subscriptionType($sType) {\n $aSubscriptionType = array(\"DocumentSubscription\" => 1,\n \"FolderSubscription\" => 2);\n return $aSubscriptionType[$sType];\n\n }",
"public function getEntityType();",
"public function getModuleTypeAttribute()\n {\n if(!empty(Config::get('core_modules')))\n {\n $core_modules = Config::get('core_modules');\n }\n else\n {\n $core_modules = collect(Module_core::allEnabled())->keys();\n $core_modules = $core_modules->map(function($item, $key){\n return \\Str::slug($item); \n });\n\n Config::set(['core_modules' => $core_modules]);\n }\n\n if(in_array($this->slug, $core_modules->toArray()))\n {\n return 'Embed';\n }\n\n return 'Database';\n }",
"public function get($key, $type = 'App') \n {\n // Lowercase the type\n $type = strtolower($type);\n \n // Check if the variable exists\n if(isset($this->data[$type][$key])) \n {\n return $this->data[$type][$key];\n }\n return NULL;\n }",
"protected function _type() {\r\n\r\n $urlParts = explode('/', $this->url);\r\n\r\n $type = array_pop($urlParts);\r\n\r\n return $type;\r\n\r\n }",
"public function getUserType();",
"public function getUserType();",
"public function typeId()\n {\n return config('entities.ids.' . $this->type);\n }",
"public function type()\n {\n return self::model();\n }",
"public function getApplicationIdentityType(): ?TeamworkApplicationIdentityType {\n $val = $this->getBackingStore()->get('applicationIdentityType');\n if (is_null($val) || $val instanceof TeamworkApplicationIdentityType) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'applicationIdentityType'\");\n }",
"public function getDeviceType(){\n if($this->_deviceType === null){\n $this->_setApplicationTypeByDevice();\n }\n\n return $this->_deviceType;\n }",
"public function getType(): string\n {\n return $this->config->get('type');\n }",
"public function type($type);",
"public static function get_meta_type();",
"public function show($type)\n\t{\n\t\tif(Auth::user()->type=='admin'){\n\t\t\t$store=Store::where('type',$type)->firstOrFail();\n\t\t}\t\t\n\t\telse\n\t\t\tabort('404');\n\t}",
"public function getStoreName();",
"public function getType()\n\t{\n\t\t$types = $this->getValidTypes();\n\n\t\treturn $types[$this->type];\n\t}",
"public function getType()\n\t{\n\t\treturn $this->get('type');\n\t}",
"public function getApp(): ?MobileApp {\n $val = $this->getBackingStore()->get('app');\n if (is_null($val) || $val instanceof MobileApp) {\n return $val;\n }\n throw new \\UnexpectedValueException(\"Invalid type found in backing store for 'app'\");\n }",
"public function getType()\n {\n return $this->i18n_singular_name();\n }",
"public function retrouve_Type($type) {\n\t\t$this->onDebug ( __METHOD__, 1 );\n\t\tif (is_numeric ( $type )) {\n\t\t\treturn $type;\n\t\t}\n\t\tswitch (strtolower ( $type )) {\n\t\t\tcase \"zabbix admin\" :\n\t\t\t\treturn 2;\n\t\t\t\tbreak;\n\t\t\tcase \"zabbix super admin\" :\n\t\t\t\treturn 3;\n\t\t\t\tbreak;\n\t\t\tcase \"zabbix user\" :\n\t\t\tdefault :\n\t\t}\n\t\t\n\t\treturn 1;\n\t}",
"public function getByStoreCodeAndActiveEnvironment(string $code): StoreIntegrationInterface;",
"abstract function getStore(string $storeKey);",
"function getWorkingType($type){\n\n if(isset(self::$workingTypes[$type])){\n return self::$workingTypes[$type];\n }\n\n if(Engine_Api::_()->hasItemType($type)){\n return self::$workingTypes[$type] = $type;\n }\n\n $parts = explode('_', $type,2);\n if(count($parts) > 1){\n $module = $parts[0];\n $track = $parts[1];\n }else{\n $module = $type;\n $track = $type;\n }\n\n $module = $this->getWorkingModule($module);\n return self::$workingTypes[$type] = $module .'_'. $track;\n }",
"private function get_db_type() {\n global $CFG;\n return $CFG->dbtype;\n }",
"private function getStore()\n {\n return $this->storeManager->getStore($this->retrieveSharedCatalogStoreId());\n }",
"public function getDocumentType() {\n\t\tif($this->document_type == 'DOCUMENT' && $this->document_id)\n\t\t\treturn Yii::t('store', $this->document->document_type);\n\t\telse\n\t\t\treturn Yii::t('store', $this->document_type);\n\t}",
"public function type(): string\n {\n return $this->item['type'];\n }",
"private function getModuleType()\n {\n $moduleType=$this->choice('Select Your Module Type',['WEB','API']);\n return $moduleType;\n }",
"public static function get_store($store_name = 'default')\n {\n }",
"public function get($type);",
"public function getLicenseType()\n {\n if (array_key_exists(\"licenseType\", $this->_propDict)) {\n if (is_a($this->_propDict[\"licenseType\"], \"\\Microsoft\\Graph\\Model\\MicrosoftStoreForBusinessLicenseType\") || is_null($this->_propDict[\"licenseType\"])) {\n return $this->_propDict[\"licenseType\"];\n } else {\n $this->_propDict[\"licenseType\"] = new MicrosoftStoreForBusinessLicenseType($this->_propDict[\"licenseType\"]);\n return $this->_propDict[\"licenseType\"];\n }\n }\n return null;\n }",
"public function findSiteByType($type) {\n $type = (int) $type;\n return \\Functional\\first($this->_getSiteList(), function (CM_Site_Abstract $site) use ($type) {\n return $site->getType() === $type;\n });\n }",
"public function get_type() {\n\t\treturn isset( $this->item['type'] ) ? esc_attr( $this->item['type'] ) : false;\n\t}",
"public function get_embed_type() {\n\n\t\t$embed_url = $this->get_embed_url();\n\t\tif ( ! $embed_url ) {\n\t\t\treturn false;\n\t\t}\n\t\t$domain = parse_url( $embed_url, PHP_URL_HOST );\n\n\t\t$types = array(\n\t\t\t'twitter.com' => 'twitter',\n\t\t\t'instagram.com' => 'instagram',\n\t\t\t'instagr.am' => 'instagram',\n\t\t\t);\n\t\tif ( isset( $types[ $domain ] ) ) {\n\t\t\treturn $types[ $domain ];\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\n\t}",
"private function getSetting($type) {\n\t\tforeach (self::$SETTINGS as $setting) {\n\t\t\tif (strcasecmp($setting->getName(), $type) == 0) {\n\t\t\t\treturn $setting;\n\t\t\t}\n\t\t}\n\t\treturn false;\n\t}",
"public static function get_store($store_name)\n {\n }",
"public function type(): string;",
"public function getApp();",
"public function getType()\n { return $this->get('type'); }",
"protected function type($type)\n {\n return $this->builder->where('type', $type);\n }"
]
| [
"0.7872113",
"0.6817175",
"0.6235384",
"0.60161245",
"0.5928851",
"0.5903828",
"0.5883104",
"0.5837614",
"0.5820838",
"0.58197296",
"0.5815476",
"0.577914",
"0.57312566",
"0.5672414",
"0.5671038",
"0.5671038",
"0.5614743",
"0.5598212",
"0.5597602",
"0.5563028",
"0.5542724",
"0.5519884",
"0.5516678",
"0.5516678",
"0.5516678",
"0.5502335",
"0.5502335",
"0.5499164",
"0.54984003",
"0.54958093",
"0.54607755",
"0.5432113",
"0.54291755",
"0.5423866",
"0.5423866",
"0.5423866",
"0.5423866",
"0.5423866",
"0.5423866",
"0.5423866",
"0.5423866",
"0.5423866",
"0.5423866",
"0.5423866",
"0.5423866",
"0.5411767",
"0.54050654",
"0.538589",
"0.5380595",
"0.53591454",
"0.5353725",
"0.5350163",
"0.5341718",
"0.5339343",
"0.5336384",
"0.5335334",
"0.5314985",
"0.5312792",
"0.5310559",
"0.53066385",
"0.5305889",
"0.53043914",
"0.52999765",
"0.5296289",
"0.52910924",
"0.52910924",
"0.5290152",
"0.5288814",
"0.52746195",
"0.5269837",
"0.52679706",
"0.5262279",
"0.5261832",
"0.5252212",
"0.52503294",
"0.52388483",
"0.5237958",
"0.5234478",
"0.52335614",
"0.52332824",
"0.5229949",
"0.5227806",
"0.52274173",
"0.52254444",
"0.5225383",
"0.5221807",
"0.5219894",
"0.52128315",
"0.5210344",
"0.5206945",
"0.519899",
"0.51986843",
"0.519384",
"0.51856595",
"0.51812804",
"0.5172797",
"0.5169989",
"0.5168071",
"0.51680195",
"0.5165071"
]
| 0.7433134 | 1 |
Process affiliate accreditation application | public function processAffiliateAccreditationApplication (
User $userEntity,
$firstName,
$lastName,
$tinId,
$storeName,
$storeSlug,
$storeDesc
)
{
$storeEntity = $userEntity->getStore();
$accreditationApplication = $this->em->getRepository('YilinkerCoreBundle:AccreditationApplication')
->findOneByUser($userEntity);
$userEntity->setFirstName($firstName);
$userEntity->setLastName($lastName);
$isStorenameEmpty = is_null($storeEntity->getStoreName()) || $storeEntity->getStoreName() == '';
$isStoreSlugEmpty = is_null($storeEntity->getStoreSlug()) || $storeEntity->getStoreSlug() == '';
if ($storeEntity->getIsEditable() || ($isStorenameEmpty && $isStoreSlugEmpty)) {
$storeEntity->setStoreName($storeName);
$storeEntity->setStoreSlug($storeSlug);
$storeEntity->setIsEditable(false);
}
$storeEntity->setStoreDescription($storeDesc);
if ($accreditationApplication instanceof AccreditationApplication) {
if (
!is_null($tinId) &&
(
$userEntity->getTin() == '' ||
(int) $userEntity->getTin() == 0 ||
$accreditationApplication->getIsBusinessEditable()
)
) {
$userEntity->setTin($tinId);
}
$accreditationApplication->setIsBusinessEditable(false);
}
$this->em->flush();
return $accreditationApplication;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function aff()\n {\n $invoice_order = App\\Invoice\\Model\\InvoiceOrderModel::find(1);\n $invoice_order_aff = new \\App\\Invoice\\InvoiceService\\Affiliate();\n $invoice_order_aff->active($invoice_order);\n }",
"function wp_aff_check_clickbank_transaction() {\n if (WP_AFFILIATE_ENABLE_CLICKBANK_INTEGRATION == '1') {\n if (isset($_REQUEST['cname']) && isset($_REQUEST['cprice'])) {\n $aff_id = wp_affiliate_get_referrer();\n if (!empty($aff_id)) {\n $sale_amt = strip_tags($_REQUEST['cprice']);\n $txn_id = strip_tags($_REQUEST['cbreceipt']);\n $item_id = strip_tags($_REQUEST['item']);\n $buyer_email = strip_tags($_REQUEST['cemail']);\n $debug_data = \"Commission tracking debug data from ClickBank transaction:\" . $aff_id . \"|\" . $sale_amt . \"|\" . $buyer_email . \"|\" . $txn_id . \"|\" . $item_id;\n wp_affiliate_log_debug($debug_data, true);\n wp_aff_award_commission_unique($aff_id, $sale_amt, $txn_id, $item_id, $buyer_email);\n }\n }\n }\n}",
"public function execute() {\n ///////////////////////////////////RAAS Linking Interface////////////////////////////////////////\n /** @var \\Magento\\Framework\\App\\ObjectManager $om */\n $objectManager = \\Magento\\Framework\\App\\ObjectManager::getInstance();\n /** @var \\Magento\\Framework\\App\\Http\\Context $context */\n $context = $objectManager->get('Magento\\Framework\\App\\Http\\Context');\n /** @var bool $isLoggedIn */\n $isLoggedIn = $context->getValue(\\Magento\\Customer\\Model\\Context::CONTEXT_AUTH);\n $customerSession = $objectManager->get('Magento\\Customer\\Model\\Session');\n\n $redirectPage = 'customer/account';\n if ($isLoggedIn) {\n $providerid = isset($_REQUEST['providerid']) && !empty($_REQUEST['providerid']) ? trim($_REQUEST['providerid']) : '';\n $provider = isset($_REQUEST['provider']) && !empty($_REQUEST['provider']) ? trim($_REQUEST['provider']) : '';\n $redirectPage = '';\n if (!empty($providerid) && !empty($provider)) {\n $this->_helperActivation = $this->_objectManager->get('LoginRadius\\Activation\\Model\\Helper\\Data');\n $customerRegistrationHelper = $this->_objectManager->get('LoginRadius\\CustomerRegistration\\Model\\Helper\\Data');\n if ($customerRegistrationHelper->enableRaas() == '1') {\n $accountAPI = new \\LoginRadiusSDK\\CustomerRegistration\\AccountAPI($this->_helperActivation->siteApiKey(), $this->_helperActivation->siteApiSecret(), array('authentication' => true, 'output_format' => 'json'));\n try {\n $accountUnlink = $accountAPI->accountUnlink($customerSession->getLoginRadiusUid(), $providerid, $provider);\n } catch (\\LoginRadiusSDK\\LoginRadiusException $e) {\n //$this->_eventManager->dispatch('lr_logout_sso', array('exception' => $e));\n }\n }else{\n $linkedAccounts = $customerRegistrationHelper->selectSocialLinkingData($customerSession->getId());\n if (is_array($linkedAccounts) && count($linkedAccounts) > 0) {\n foreach ($linkedAccounts as $linkedAccount) {\n if(($linkedAccount['sociallogin_id'] == $providerid) && ($linkedAccount['provider'] == $provider)){\n $accountUnlink = new \\stdClass();\n $accountUnlink->isPosted = true;\n }\n }\n } \n }\n $this->_messageManager = $this->_objectManager->get('Magento\\Framework\\Message\\ManagerInterface');\n if (isset($accountUnlink) && $accountUnlink->isPosted == true) {\n $this->removeSocialLinkingData($providerid);\n $customerSession->setLoginRadiusStatus('Success');\n $customerSession->setLoginRadiusMessage('Your Account has been Removed successfully.');\n } else { \n $customerSession->setLoginRadiusStatus('Error');\n $customerSession->setLoginRadiusMessage('You can not remove this account.');\n }\n $redirectPage = 'customerregistration/accounts/linking';\n }\n if (empty($redirectPage)) {\n $resultPage = $this->_resultPageFactory->create();\n $resultPage->getConfig()->getTitle()->set('');\n \n $block = $resultPage->getLayout()->getBlock('accountlinking');\n if ($block) {\n $block->setRefererUrl($this->_redirect->getRefererUrl());\n }\n }\n }\n if (!empty($redirectPage)) {\n $resultPage = $this->resultFactory->create(ResultFactory::TYPE_REDIRECT);\n $resultPage->setPath($redirectPage);\n }\n return $resultPage;\n }",
"public function postProcess()\n {\n $aps_params = Tools::getAllValues();\n if (isset($aps_params['action'])) {\n if ($aps_params['action'] == 'checkout') {\n $this->postApsPayment();\n } elseif ($aps_params['action'] == 'offline_response') {\n $this->responseOffline();\n } elseif ($aps_params['action'] == 'responseOnline') {\n $this->responseOnline();\n } elseif ($aps_params['action'] == 'merchantPageResponse') {\n $this->merchantPageResponse();\n } elseif ($aps_params['action'] == 'merchantPageCancel') {\n $this->merchantPageCancel();\n } elseif ($aps_params['action'] == 'getInstallmentPlans') {\n $this->getInstallmentPlans();\n } elseif ($aps_params['action'] == 'valu_customer_verify') {\n $this->valuCustomerVerify();\n } elseif ($aps_params['action'] == 'valu_generate_otp') {\n $this->valuGenerateOtp();\n } elseif ($aps_params['action'] == 'valu_otp_verify') {\n $this->valuOtpVerify();\n } elseif ($aps_params['action'] == 'validate_apple_url') {\n $this->validateAppleUrl();\n } elseif ($aps_params['action'] == 'send_apple_payment_aps') {\n $this->sendApplePaymentToAps();\n } elseif ($aps_params['action'] == 'create_cart_order') {\n $this->createCartOrder();\n } elseif ($aps_params['action'] == 'get_apple_pay_cart_data') {\n $this->getApplePayCartValues();\n } elseif ($aps_params['action'] == 'validate_apple_pay_shipping_address') {\n $this->validateApplePayShippingAddress();\n } elseif ($aps_params['action'] == 'displayError') {\n $this->displayError();\n }\n }\n }",
"public function processPayment();",
"public function saveAccreditationAction()\n {\n $site_id = $this->_getParam(\"site_id\");\n $site = \\Fisdap\\EntityUtils::getEntity(\"SiteLegacy\", $site_id);\n $form_data = $this->_getParam(\"form_data\");\n \n $form = new Account_Form_Accreditation($site);\n \n $process_result = $form->process($form_data);\n \n if ($process_result['success'] === true) {\n $success = \"true\";\n $html_res = \"<div class='success'>Your accreditation info has been saved.</div>\";\n } else {\n $errors = $this->formatFormErrors($process_result);\n $success = \"false\";\n $html_res = $errors['html'];\n }\n \n $this->_helper->json(array(\"success\" => $success, \"result\" => $html_res, \"form_elements_with_errors\" => $errors['elements']));\n }",
"function wp_aff_wlmem_paypal_ipn_response_handler() {\n wp_affiliate_log_debug(\"WishList Member - paypal_ipn_response. Custom var value: \" . $_POST['custom'], true);\n if (isset($_POST['custom'])) {//Check if affilite ID exists\n $custom_array = wp_parse_args($_POST['custom']);\n if (isset($custom_array['ap_id'])) {\n wp_affiliate_log_debug(\"WishList Member - paypal_ipn_response. Affiliate commission need to be tracked. Affiliate ID: \" . $custom_array['ap_id'], true);\n $referrer = $custom_array['ap_id'];\n $clientip = $custom_array['ip'];\n $item_id = $_POST['item_number'];\n $txn_id = $_POST['txn_id'];\n $sale_amt = $_POST['mc_gross'];\n $buyer_email = $_POST['payer_email'];\n $buyer_name = $_POST['first_name'] . \" \" . $_POST['last_name'];\n $aff_details_debug = \"Referrer: \" . $referrer . \" Sale Amt: \" . $sale_amt . \" Buyer Email: \" . $buyer_email . \" Txn ID: \" . $txn_id;\n wp_affiliate_log_debug(\"WishList Member - paypal_ipn_response. Extra debug data: \" . $aff_details_debug, true);\n wp_aff_award_commission_unique($referrer, $sale_amt, $txn_id, $item_id, $buyer_email, $clientip, '', $buyer_name);\n } else {\n wp_affiliate_log_debug(\"WishList Member - paypal_ipn_response. Not an affiliate referral. Commission tracking not needed.\", true);\n }\n }\n}",
"function Add_Manual_ACH($application_id, $request)\n{\n\t$log = get_log(\"scheduling\");\n\t$holidays = Fetch_Holiday_List();\n\t$pd_calc = new Pay_Date_Calc_3($holidays);\n\t$payment_amt = round($request->amount, 2);\n\n\t$comment = \"Manual ACH Request - \" . $request->payment_description;\n\n\tif ($request->edate == 'select')\n\t{\n\t\t$due_date = $request->scheduled_date?date(\"Y-m-d\", strtotime($request->scheduled_date)):NULL;\n\t}\n\telse\n\t{\n\t\t$due_date = date('Y-m-d', strtotime($request->edate));\n\t}\n\n\tif(!$due_date)\n\t{\n\t\t$_SESSION['error_message'] = \"No date was selected for Manual ACH\";\n\t\treturn false;\n\t}\n\n\t$action_date = $pd_calc->Get_Business_Days_Backward($due_date, 1);\n\n\t//It's possible that this will put the action date in the past, which is bad.\n\t//If that happens, use the scheduled date as the action date instead. [jeffd][IMPACT #13616]\n\tif(strtotime($action_date) < strtotime(date('Y-m-d')))\n\t{\n\t\t$action_date = $due_date;\n\t\t$due_date = $pd_calc->Get_Business_Days_Forward($due_date, 1);\n\t}\n\n\t$amounts = array();\n\t//pay down amounts other than principal first [#27768]\n\t$log->Write(\"[Agent:{$_SESSION['agent_id']}][AppID:{$application_id}] Adding Manual ACH of {$payment_amt} for {$application_id} on date {$due_date}\");\n\n\t//[#46151] Adjust balance info, accounting for scheduled payments\n\t//between now and the manual ACH due date\n\t$schedule = Fetch_Schedule($application_id);\n\t$balance_info = Fetch_Balance_Information($application_id);\n\tforeach($schedule as $e)\n\t{\n\t\tif($e->status == 'scheduled' && strtotime($e->date_effective) < strtotime($due_date))\n\t\t{\n\t\t\tforeach($e->amounts as $ea)\n\t\t\t{\n\t\t\t\t$balance_info->{$ea->event_amount_type . '_balance'} += $ea->amount;\n\t\t\t}\n\t\t}\n\t}\n\n\t$balance = array(\n\t\t'principal' => $balance_info->principal_balance,\n\t\t'service_charge' => $balance_info->service_charge_balance,\n\t\t'fee' => $balance_info->fee_balance,\n\t\t);\n\n\t$amounts = AmountAllocationCalculator::generateAmountsFromBalance($payment_amt, $balance);\n\n\t$payment = Schedule_Event::MakeEvent($action_date, $due_date, $amounts, 'manual_ach', $comment,'scheduled','manual');\n\tRecord_Event($application_id, $payment);\n\n\treturn true;\n}",
"public function process()\n {\n //If they don't order 7 days after sign up, the points disappear\n //send sms before 1-2days if not order placed\n $orderTable = $this->getServiceLocator()->get('Api\\Table\\LoyaltyPointTable');\n $accounts = $orderTable->getAccountsForCreditExpiry();\n if (!$accounts) {\n echo $msg = 'CreditsExpiryController: Not orders available, skipping '. $this->orderId .\"\\n\";\n $this->logger->debug($msg);\n return;\n }\n \n foreach ($accounts['list'] as $account) {\n if ($account['no_order_days_since_signup'] == 5) {\n $this->sendSms($account['contact_no']);\n } else if ($account['no_order_days_since_signup'] >= 7) {\n $this->removeCredits($account['account_id'], $account['points']);\n } \n }\n }",
"public function processPaypal(){\r\n\t// and redirect to thransaction details page\r\n\t}",
"function bc_affiliation_uninstall() {\n}",
"protected static function accruePartnerCommission(BalanceOperations $operation)\n {\n // Checking for requirements\n if ($operation->type_id !== BalanceOperations::BALANCE_OPERATION_TYPE_TOP_UP_BY_USER) {\n return true;\n }\n\n $aff = $operation->affiliate;\n\n if (!$aff) {\n return true;\n }\n\n if (!$aff->affiliateAccount) {\n return true;\n }\n\n $aff_balance = Balance::findOne($aff->affiliateAccount->id);\n\n if(!$aff_balance || $operation->currency !== $aff_balance->currency){\n return true;\n }\n\n // Calculate earning and write stat\n $percent = $aff->affiliateAccount->getPercent();\n $earned = round($operation->amount * $percent / 100);\n $aff->total_affiliate_earned += $earned;\n\n if($aff->hit){\n $aff->hit->incrementTotalEarned($earned);\n }\n\n $aff->affiliateAccount->total_earned += $earned;\n $aff->save();\n $aff->affiliateAccount->save();\n\n // Accrue\n $model = new BalanceOperations();\n $model->balance_id = $aff->affiliateAccount->id;\n $model->is_accrual = 1;\n $model->type_id = BalanceOperations::BALANCE_OPERATION_TYPE_PARTNER_COMMISSION;\n $model->amount = $earned;\n $model->currency = $operation->currency;\n\n if ($operation->currency == 'RUR') {\n $model->comment = 'Начисление партнерской коммиссии в размере ' . $percent . '% от суммы пополнения счета приведенным вами пользователем. Операция пополнения №' . $operation->id . ' сумма пополнения: ' . $operation->amount . ' р.';\n } else {\n $model->comment = 'Accrue affiliate commission ' . $percent . '% of your attracted user payment. Payment ID - ' . $operation->id . ' amount: $' . $operation->amount;\n }\n\n $model->created_at = time();\n\n if (!$model->save()) {\n throw new Exception('Cant write aff commission balance operation: ' . strip_tags(Html::errorSummary($model)));\n }\n\n return Balance::up($model);\n }",
"private function hydrate_affiliate_code() {\n\t\tif ( Options::get_affiliate_code() ) {\n\t\t\treturn;\n\t\t}\n\n\t\tif ( FileSystem::file_exists( $file_name ) ) {\n\t\t\t$affiliate_code = trim( FileSystem::get_content( $file_name ) );\n\t\t\tadd_option( 'hubspot_affiliate_code', $affiliate_code );\n\t\t}\n\t}",
"function updateAffiliateBannerFrontEnd($oAffiliate)\n\t\t{\n\t\t\t$query= \"update tbl_affiliate set banner ='\".$oAffiliate->organisation_banner.\"' \n\t\t\t where affiliate_id = $oAffiliate->member_id\";\n\t\t\t\n\t\t\t$rs = $this->Execute($query);\n\t\t\treturn $rs;\n\t\t}",
"function affwp_save_affiliate_program( $affiliate_id, $status, $args ) {\n\n\t$program = sanitize_text_field( $_POST['affwp_program'] );\n\n\tif ( ! empty( $program ) ) {\n\t\taffwp_add_affiliate_meta( $affiliate_id, 'program', $program );\n\t}\n\n}",
"function fatherly_fcr_process_admin_page()\n{\n include_once(__DIR__ . '/inc/classes/ContentRecirculation.php');\n $pageData = FCR\\ContentRecirculation::init()->getAdminPageData();\n include(__DIR__ . '/inc/pages/feed-content-recirculation.php');\n}",
"abstract protected function handlePayment();",
"function InfUpdateAffCode($inf_aff_id, $inf_aff_code) {\n\n\t$affiliate = new Infusionsoft_Affiliate();\n\t$affiliate->Id = $inf_aff_id;\n\t$affiliate->AffCode = $inf_aff_code;\n\t$affiliate->save(); // Update affiliate in Infusionsoft\n}",
"public function executeAccueil()\n\t{\n\t\t// on récupère la liste des articles\n\t\t$db = PDOFactory::getMysqlConnexion();\n\t\t$objetArticle = new ArticlesManager($db);\n\t\t$listeArticles = $objetArticle->getListArticles();\t\t\n\n\t\t// On require la vue \n\t\t$this->render('accueil', compact('listeArticles'));\n\t}",
"public function process()\n\t{ \n //DROPBOX\n \n //Request Unlink Dropbox Acount\n if ($this->request()->get('unlink')) {\n Phpfox::getService('backuprestore.dropboxfront')->unlink_account();\n $this->isAccess = null;\n $page = $_SERVER['HTTP_REFERER'];\n $sec = \"0\";\n header(\"Refresh: $sec; url=$page\");\n }\n \n $canCall = false;\n if (!$this->request()->get('db_authorize')) {\n $this->dropbox = PhpFox::getService('backuprestore.dropboxfront');\n $canCall = true;\n }\n\n $dbauthorize = array();\n if ($canCall) {\n $dbauthorize['Url'] = $this->dropbox->get_authorize_url();\n if ($this->dropbox->is_authorized()) {\n //User Dropbox info\n $dbaccount_info = $this->dropbox->get_account_info();\n $dbaccount_details = array(\n 'account_owner' => $dbaccount_info->display_name,\n 'used_space' => round(($dbaccount_info->quota_info->quota - ($dbaccount_info->quota_info->normal + $dbaccount_info->quota_info->shared)) / 1073741824, 1),\n 'quota' => round($dbaccount_info->quota_info->quota / 1073741824, 1),\n );\n $dbaccount_details['used_percent'] = round(($dbaccount_details['used_space'] / $dbaccount_details['quota']) * 100, 0);\n $this->authorized['dropbox'] = 1;\n } else {\n if ($this->request()->get('continue')) {\n if (!$this->dropbox->is_authorized()) {\n $dbauthorize['error_not_authorized'] = 'yes';\n }\n $dbauthorize['submitbutton'] = 'Authorize';\n }\n }\n }\n \n //Request Authorize Dropbox Account\n if ($this->request()->get('db_authorize')) {\n $dbauthorize['submitbutton'] = 'Continue';\n }\n\n $this->template()->assign(array(\n 'dbauthorize'=>$dbauthorize,\n 'DBADetails' =>(!empty($dbaccount_details) ? $dbaccount_details : null),\n 'authorized' => $this->authorized\n )\n );\t\t\n\t}",
"function chargeCreditCard($peram){\n\t global $wpdb;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\tif(!empty($peram[4])) {\n\t\t$namarr = explode(\" \",$peram[4]);\n\t\t$fname = $namarr[0];\n\t\t$lname = $namarr[1];\n\t} else {\n\t\t$fname = \"\";\n\t\t$lname = \"\";\n\t\t}\n\t$current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\n\t//--------------------------------------------\n\t// Common setup for API credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n // Create the payment data for a credit card\n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($peram[1]); //////--- card no e.g. 4111111111111111\n $creditCard->setExpirationDate($peram[2]); //////////////--- expiry 1220\n $creditCard->setCardCode($peram[3]);//////////////////////--- card code 123\n $paymentOne = new AnetAPI\\PaymentType();\n $paymentOne->setCreditCard($creditCard);\n\n $order = new AnetAPI\\OrderType();\n $order->setDescription(\"Monthly Payment\");\n\n // Set the customer's Bill To address\n $customerAddress = new AnetAPI\\CustomerAddressType();\n $customerAddress->setFirstName($fname);\n $customerAddress->setLastName($lname);\n $customerAddress->setCompany(\"\");\n $customerAddress->setAddress(\"\");\n $customerAddress->setCity(\"\");\n $customerAddress->setState(\"\");\n $customerAddress->setZip(\"\");\n $customerAddress->setCountry(\"\");\n\n // Set the customer's identifying information\n $customerData = new AnetAPI\\CustomerDataType();\n $customerData->setType(\"individual\");\n $customerData->setId(\"\"); // Customer ID \n $customerData->setEmail(\"\");\n\n //Add values for transaction settings\n $duplicateWindowSetting = new AnetAPI\\SettingType();\n $duplicateWindowSetting->setSettingName(\"duplicateWindow\");\n $duplicateWindowSetting->setSettingValue(\"600\");\n\n // Create a TransactionRequestType object\n $transactionRequestType = new AnetAPI\\TransactionRequestType();\n $transactionRequestType->setTransactionType( \"authCaptureTransaction\"); \n $transactionRequestType->setAmount($peram[0]);\n $transactionRequestType->setOrder($order);\n $transactionRequestType->setPayment($paymentOne);\n $transactionRequestType->setBillTo($customerAddress);\n $transactionRequestType->setCustomer($customerData);\n $transactionRequestType->addToTransactionSettings($duplicateWindowSetting);\n\n $request = new AnetAPI\\CreateTransactionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId( $refId);\n $request->setTransactionRequest( $transactionRequestType);\n\n $controller = new AnetController\\CreateTransactionController($request);\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n \n\n if ($response != null)\n {\n if($response->getMessages()->getResultCode() == 'Ok')\n {\n $tresponse = $response->getTransactionResponse();\n \n if ($tresponse != null && $tresponse->getMessages() != null) \n {\n\t\t\t$res_code = $tresponse->getResponseCode();\n\t\t\t$auth_code = $tresponse->getAuthCode();\n\t\t\t$trans_code = $tresponse->getTransId();\n\t\t\t$gcode = $tresponse->getMessages()[0]->getCode();\n\t\t\t$res_des = $tresponse->getMessages()[0]->getDescription();\n \n\t\t /* echo \" Transaction Response Code : \" . $res_code . \"\\n\";\n echo \" Successfully created an authCapture transaction with Auth Code : \" . $auth_code . \"\\n\";\n echo \" Transaction ID : \" . $trans_code . \"\\n\";\n echo \" Code : \" . $ccode . \"\\n\"; \n echo \" Description : \" . $res_des . \"\\n\";*/\n\t\t \n\t\techo '<h2 style=\"color:#7066ce\">Thank you! Your payment has been processed</h2>';\n\t\t$oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500;\n\t\techo '<p>Your credit card has been charged <span style=\"color:#6dcd62; font-size:28px\">$'.$oncepaid.'</span></p>';\n\t\techo '<p>you have been hired your perfect cNanny successfully.</p>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\n\n\t\t //---------------------------------------------------\n\t\t\n\t\t\t$table_name = $wpdb->prefix . 'payment';\t\n\t\t\t$wpdb->insert($table_name, array(\n\t\t\t'fname' => $fname,\n\t\t\t'lname' => $lname,\n\t\t\t'user_id' => $user_id,\n\t\t\t'amount' => $peram[0],\n\t\t\t'card' => base64_encode($peram[1]),\n\t\t\t'expiry' => $peram[2],\n\t\t\t'code' => base64_encode($peram[3]),\n\t\t\t'date_created' => current_time('mysql', 1),\n\t\t\t'status' => 'Active',\n\t\t\t'subscribe' => '-',\n\t\t\t'res_code' => $res_code,\n\t\t\t'auth_code' => $auth_code,\n\t\t\t'trans_code' => $trans_code,\n\t\t\t'gcode' => $gcode,\n\t\t\t'res_des' => $res_des,\n\t\t));\t\n\t\t\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\n\t\t //------------------------------------------------------\n\t\t \n }\n else\n {\n echo \"Transaction Failed \\n\";\n if($tresponse->getErrors() != null)\n {\n echo \" Error code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n echo \" Error message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\"; \n }\n }\n }\n else\n {\n echo \"Transaction Failed \\n\";\n $tresponse = $response->getTransactionResponse();\n \n if($tresponse != null && $tresponse->getErrors() != null)\n {\n echo \" Error code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n echo \" Error message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\"; \n }\n else\n {\n echo \" Error code : \" . $response->getMessages()->getMessage()[0]->getCode() . \"\\n\";\n echo \" Error message : \" . $response->getMessages()->getMessage()[0]->getText() . \"\\n\";\n }\n } \n }\n else\n {\n echo \"No response returned \\n\";\n }\n\n return $response;\n }",
"static function populate_affiliates_options($affiliate='amazon'){\n\t \t\tif(empty(self::$affiliates_options)){\n\t \t\t\tinclude self::get_script_location('affiliates_form_parameters.php');\n\t\t\t\t\n\t\t\t\t/**\n\t\t\t\t * use this filter to add affilates\n\t\t\t\t */\n\t\t\t\tself::$affiliates_options = apply_filters('link_rewrite_affiliates', $parameters);\n\t \t\t}\t\t\t\t\t\t\n\t }",
"public function on_start() {\n $mode = Config::get('community_store_affirm.mode');\n $script = ($mode ? 'https://cdn1-sandbox.affirm.com' : 'https://api.affirm.com');\n $html = Core::make('helper/html');\n $view = View::getInstance();\n $view->addHeaderItem('<!-- Affirm -->\n<script>\n _affirm_config = {\n public_api_key: \"' . Config::get('community_store_affirm.publicApiKey') . '\",\n script: \"' . $script . '/js/v2/affirm.js\"\n //session_id: \"YOUR_VISITOR_SESSION_ID\"\n };\n (function(l,g,m,e,a,f,b){var d,c=l[m]||{},h=document.createElement(f),n=document.getElementsByTagName(f)[0],k=function(a,b,c){return function(){a[b]._.push([c,arguments])}};c[e]=k(c,e,\"set\");d=c[e];c[a]={};c[a]._=[];d._=[];c[a][b]=k(c,a,b);a=0;for(b=\"set add save post open empty reset on off trigger ready setProduct\".split(\" \");a<b.length;a++)d[b[a]]=k(c,e,b[a]);a=0;for(b=[\"get\",\"token\",\"url\",\"items\"];a<b.length;a++)d[b[a]]=function(){};h.async=!0;h.src=g[f];n.parentNode.insertBefore(h,n);delete g[f];d(g);l[m]=c})(window,_affirm_config,\"affirm\",\"checkout\",\"ui\",\"script\",\"ready\");\n// Use your live public API Key and https://cdn1.affirm.com/js/v2/affirm.js script to point to Affirm production environment.\n</script>\n<!-- End Affirm -->');\n \n // enable checkout route after affirm payment\n Route::register('/checkout/affirmresponse','\\Concrete\\Package\\CommunityStoreAffirm\\Src\\CommunityStore\\Payment\\Methods\\CommunityStoreAffirm\\CommunityStoreAffirmPaymentMethod::validateCompletion');\n }",
"function charge_credit_card() {\n\nif ( is_user_logged_in() ) {\n\t\n\t require 'vendor/autoload.php';\n\n define(\"AUTHORIZENET_LOG_FILE\", \"phplog\");\n \n ///////////////////////------- FUNCTION CANCEL SUBSCRIPTION --------////////////////////////////\n \n function cancelSubscription($subscriptionId) {\n\t // require 'vendor/autoload.php';\n // define(\"AUTHORIZENET_LOG_FILE\", \"phplog\");\n\t global $wpdb;\n\t \n\t $current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\n // Common Set Up for API Credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n $request = new AnetAPI\\ARBCancelSubscriptionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setSubscriptionId($subscriptionId);\n\n $controller = new AnetController\\ARBCancelSubscriptionController($request);\n\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n\n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\"))\n {\n $successMessages = $response->getMessages()->getMessage();\n //echo \"SUCCESS : \" . $successMessages[0]->getCode() . \" \" .$successMessages[0]->getText() . \"\\n\";\n\t\techo '<h2 style=\"color:#7066ce\">Thank you! Your request has been processed</h2>';\n\t\techo '<p>You have been unsubscribe successfully</p>';\n\t\t$monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t\techo '<p>Your credit card will not be automatically debited $'.$monthpaid.' a month.</p>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\t\t\n\t\t$table_name = $wpdb->prefix . 'payment';\n\t\t$wpdb->update( \n\t\t\t\t$table_name, \n\t\t\t\tarray( \n\t\t\t\t\t'status' => 'Inactive',\t// string\n\t\t\t\t), \n\t\t\t\tarray( 'subscribe' => $subscriptionId ), \n\t\t\t\tarray( \n\t\t\t\t\t'%s',\t// value1\n\t\t\t\t), \n\t\t\t\tarray( '%d' ) \n\t\t\t);\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\t\n \n }\n else\n {\n echo \"ERROR : Invalid response\\n\";\n $errorMessages = $response->getMessages()->getMessage();\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"\\n\";\n \n }\n\n return $response;\n\n }\n \n///////////////////------------- SUBSCRIPTION USERS -----------------/////////////////////\n function createSubscription($peram){\n\t global $wpdb;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\tif(!empty($peram[4])) {\n\t\t$namarr = explode(\" \",$peram[4]);\n\t\t$fname = $namarr[0];\n\t\t$lname = $namarr[1];\n\t} else {\n\t\t$fname = \"\";\n\t\t$lname = \"\";\n\t\t}\n\t$intervalLength = $peram[0];\n\t//------------------------------------\n\t$current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\t\n\t//--------------------------------------------\n\t// Common setup for API credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n // Subscription Type Info\n $subscription = new AnetAPI\\ARBSubscriptionType();\n $subscription->setName(\"Cnanny Monthly Subscription\");\n\n $interval = new AnetAPI\\PaymentScheduleType\\IntervalAType();\n $interval->setLength($intervalLength);\n $interval->setUnit(\"days\");\n\n $paymentSchedule = new AnetAPI\\PaymentScheduleType();\n $paymentSchedule->setInterval($interval);\n $paymentSchedule->setStartDate(new DateTime(date('Y-m-d')));\n $paymentSchedule->setTotalOccurrences(\"12\");\n $paymentSchedule->setTrialOccurrences(\"10\");\n\n $subscription->setPaymentSchedule($paymentSchedule);\n $subscription->setAmount($peram[0]);\n $subscription->setTrialAmount(\"0.00\");\n \n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($peram[1]); //////--- card no e.g. 4111111111111111\n $creditCard->setExpirationDate($peram[2]); //////////////--- expiry 1220\n\n $payment = new AnetAPI\\PaymentType();\n $payment->setCreditCard($creditCard);\n $subscription->setPayment($payment);\n\n $order = new AnetAPI\\OrderType();\n $order->setInvoiceNumber(\"1234354\"); \n $order->setDescription(\"Cnanny Monthly Subscription\"); \n $subscription->setOrder($order); \n \n $billTo = new AnetAPI\\NameAndAddressType();\n $billTo->setFirstName($fname);\n $billTo->setLastName($lname);\n\n $subscription->setBillTo($billTo);\n\n $request = new AnetAPI\\ARBCreateSubscriptionRequest();\n $request->setmerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setSubscription($subscription);\n $controller = new AnetController\\ARBCreateSubscriptionController($request);\n\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n \n if (($response != null) && ($response->getMessages()->getResultCode() == \"Ok\") )\n {\n\t\t//$response->getSubscriptionId()\n\t\techo '<h2 class=\"page-heading\">Thank you! Your payment has been processed</h2>';\n\t\t$monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t\techo '<div class=\"clearfix charged\"><span>Your credit card has been charged <span class=\"text-green\">$'.$monthpaid.'</span></span><br />';\n\t\t\n\t\t$oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500;\n\t\techo '<div class=\"clearfix charged\">\n\t\t\t\t\t\t\t<p>Your credit card will be automatically debited $'.$monthpaid.' a month until you hire a cNanny or <a href=\"'.site_url().'/subscription-cancellation\" class=\"text-black text-underline\">cancel your subscription</a>.</p>\n\t\t\t\t\t\t\t<p>\n\t\t\t\t\t\t\t\tWhen you hire your perfect cNanny, you will be charged a one-time placement fee of $'.$oncepaid.' only after she accepts the offer.\n\t\t\t\t\t\t\t\tYour monthly subscription will then be automatically cancelled.\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</div>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\t\t\n\t\t$subscrId = $response->getSubscriptionId();\n\t\t\n\t\t$table_name = $wpdb->prefix . 'payment';\t\n\t\t\t$ins = $wpdb->insert($table_name, array(\n\t\t\t'fname' => $fname,\n\t\t\t'lname' => $lname,\n\t\t\t'user_id' => $user_id,\n\t\t\t'amount' => $peram[0],\n\t\t\t'card' => base64_encode($peram[1]),\n\t\t\t'expiry' => $peram[2],\n\t\t\t'code' => '',\n\t\t\t'date_created' => current_time('mysql', 1),\n\t\t\t'status' => 'Active',\n\t\t\t'subscribe' => $subscrId,\n\t\t\t'res_code' => '-',\n\t\t\t'auth_code' => '-',\n\t\t\t'trans_code' => '-',\n\t\t\t'gcode' => '-',\n\t\t\t'res_des' => 'Success',\n\t\t));\t\n\t\t$paymentsuccess = 1;\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\n }\n else\n {\n echo \"ERROR : Invalid response\\n\";\n $errorMessages = $response->getMessages()->getMessage();\n echo \"Response : \" . $errorMessages[0]->getCode() . \" \" .$errorMessages[0]->getText() . \"\\n\";\n\t\t$paymentsuccess = 1;\n }\n\n return $paymentsuccess;\n }\n ///////////////////------------- ONCE PAID USERS -----------------/////////////////////\n function chargeCreditCard($peram){\n\t global $wpdb;\n // get ID and trans key from db\n\t//--------------------------------------------\n\t$authorize_login_id = get_option('authorize_login_id');\n\t$authorize_transaction_key = get_option('authorize_transaction_key');\n\tif(!empty($peram[4])) {\n\t\t$namarr = explode(\" \",$peram[4]);\n\t\t$fname = $namarr[0];\n\t\t$lname = $namarr[1];\n\t} else {\n\t\t$fname = \"\";\n\t\t$lname = \"\";\n\t\t}\n\t$current_user = wp_get_current_user();\n $username = $current_user->user_login;\n\t$user_email = $current_user->user_email;\n\t$user_firstname = $current_user->user_firstname;\n\t$user_lastname = $current_user->user_lastname;\n\t$user_id = $current_user->ID;\n\t//--------------------------------------------\n\t// Common setup for API credentials\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName($authorize_login_id);/////////////////------ MERCHANT_LOGIN_ID 7RFn23t2BJ6\n $merchantAuthentication->setTransactionKey($authorize_transaction_key);//------ MERCHANT_TRANSACTION_KEY 8p429Y7Cq4h9sQBS\n $refId = 'ref' . time();\n\n // Create the payment data for a credit card\n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($peram[1]); //////--- card no e.g. 4111111111111111\n $creditCard->setExpirationDate($peram[2]); //////////////--- expiry 1220\n $creditCard->setCardCode($peram[3]);//////////////////////--- card code 123\n $paymentOne = new AnetAPI\\PaymentType();\n $paymentOne->setCreditCard($creditCard);\n\n $order = new AnetAPI\\OrderType();\n $order->setDescription(\"Monthly Payment\");\n\n // Set the customer's Bill To address\n $customerAddress = new AnetAPI\\CustomerAddressType();\n $customerAddress->setFirstName($fname);\n $customerAddress->setLastName($lname);\n $customerAddress->setCompany(\"\");\n $customerAddress->setAddress(\"\");\n $customerAddress->setCity(\"\");\n $customerAddress->setState(\"\");\n $customerAddress->setZip(\"\");\n $customerAddress->setCountry(\"\");\n\n // Set the customer's identifying information\n $customerData = new AnetAPI\\CustomerDataType();\n $customerData->setType(\"individual\");\n $customerData->setId(\"\"); // Customer ID \n $customerData->setEmail(\"\");\n\n //Add values for transaction settings\n $duplicateWindowSetting = new AnetAPI\\SettingType();\n $duplicateWindowSetting->setSettingName(\"duplicateWindow\");\n $duplicateWindowSetting->setSettingValue(\"600\");\n\n // Create a TransactionRequestType object\n $transactionRequestType = new AnetAPI\\TransactionRequestType();\n $transactionRequestType->setTransactionType( \"authCaptureTransaction\"); \n $transactionRequestType->setAmount($peram[0]);\n $transactionRequestType->setOrder($order);\n $transactionRequestType->setPayment($paymentOne);\n $transactionRequestType->setBillTo($customerAddress);\n $transactionRequestType->setCustomer($customerData);\n $transactionRequestType->addToTransactionSettings($duplicateWindowSetting);\n\n $request = new AnetAPI\\CreateTransactionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId( $refId);\n $request->setTransactionRequest( $transactionRequestType);\n\n $controller = new AnetController\\CreateTransactionController($request);\n $response = $controller->executeWithApiResponse( \\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n \n\n if ($response != null)\n {\n if($response->getMessages()->getResultCode() == 'Ok')\n {\n $tresponse = $response->getTransactionResponse();\n \n if ($tresponse != null && $tresponse->getMessages() != null) \n {\n\t\t\t$res_code = $tresponse->getResponseCode();\n\t\t\t$auth_code = $tresponse->getAuthCode();\n\t\t\t$trans_code = $tresponse->getTransId();\n\t\t\t$gcode = $tresponse->getMessages()[0]->getCode();\n\t\t\t$res_des = $tresponse->getMessages()[0]->getDescription();\n \n\t\t /* echo \" Transaction Response Code : \" . $res_code . \"\\n\";\n echo \" Successfully created an authCapture transaction with Auth Code : \" . $auth_code . \"\\n\";\n echo \" Transaction ID : \" . $trans_code . \"\\n\";\n echo \" Code : \" . $ccode . \"\\n\"; \n echo \" Description : \" . $res_des . \"\\n\";*/\n\t\t \n\t\techo '<h2 style=\"color:#7066ce\">Thank you! Your payment has been processed</h2>';\n\t\t$oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500;\n\t\techo '<p>Your credit card has been charged <span style=\"color:#6dcd62; font-size:28px\">$'.$oncepaid.'</span></p>';\n\t\techo '<p>you have been hired your perfect cNanny successfully.</p>';\n\t\techo '<br /><br /><p><a href=\"'.site_url().'/dashboard\">Click here</a> to go to your dashboard</p>';\n\n\n\t\t //---------------------------------------------------\n\t\t\n\t\t\t$table_name = $wpdb->prefix . 'payment';\t\n\t\t\t$wpdb->insert($table_name, array(\n\t\t\t'fname' => $fname,\n\t\t\t'lname' => $lname,\n\t\t\t'user_id' => $user_id,\n\t\t\t'amount' => $peram[0],\n\t\t\t'card' => base64_encode($peram[1]),\n\t\t\t'expiry' => $peram[2],\n\t\t\t'code' => base64_encode($peram[3]),\n\t\t\t'date_created' => current_time('mysql', 1),\n\t\t\t'status' => 'Active',\n\t\t\t'subscribe' => '-',\n\t\t\t'res_code' => $res_code,\n\t\t\t'auth_code' => $auth_code,\n\t\t\t'trans_code' => $trans_code,\n\t\t\t'gcode' => $gcode,\n\t\t\t'res_des' => $res_des,\n\t\t));\t\n\t\t\n\t\techo '<script>function hideFrm() { document.getElementById(\"jkfrm\").style.display=\"none\"; }</script>';\n\t\t //------------------------------------------------------\n\t\t \n }\n else\n {\n echo \"Transaction Failed \\n\";\n if($tresponse->getErrors() != null)\n {\n echo \" Error code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n echo \" Error message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\"; \n }\n }\n }\n else\n {\n echo \"Transaction Failed \\n\";\n $tresponse = $response->getTransactionResponse();\n \n if($tresponse != null && $tresponse->getErrors() != null)\n {\n echo \" Error code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n echo \" Error message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\"; \n }\n else\n {\n echo \" Error code : \" . $response->getMessages()->getMessage()[0]->getCode() . \"\\n\";\n echo \" Error message : \" . $response->getMessages()->getMessage()[0]->getText() . \"\\n\";\n }\n } \n }\n else\n {\n echo \"No response returned \\n\";\n }\n\n return $response;\n }\n \n ///////////////////////////////--------- FUNCTION END -----------/////////////////////////////////// \nif(!empty($_POST['amount'])) {\n $payment_type = $_POST['payment_type'];\n $card = $_POST['card'];\n $mn = $_POST['mn'];\n $yr = $_POST['yr'];\n $exp = $mn.''.$yr;\n $code = $_POST['code'];\n $fullname = $_POST['fullname'];\n $interval = 30; // 30 days interval\n // monthly subscription $75 (run on authorize live mode only)\n if(isset($payment_type) && $payment_type == \"monthly\") {\n\t $monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t \t $amount = $monthpaid;\n \t\t$peramaters = array($amount,$card,$exp,$code,$fullname,$interval);\n \t$ret = createSubscription($peramaters);\n\t\t\n\t\t//print_r($ret); exit(0);\n \t } \n else { \n // cancel monthly subscription first\n global $wpdb;\n \t$current_user = wp_get_current_user();\n\t$user_id = $current_user->ID;\n \t$table_name = $wpdb->prefix . 'payment'; \n\t$subscribe = $wpdb->get_var( \"SELECT subscribe FROM $table_name where user_id = \".$user_id.\" and status = 'Active' and subscribe != '-' order by id desc\" );\n\t\tif($subscribe > 0)\n\t\tcancelSubscription($subscribe);\n // pay once $1500 (run on both authorize live and test mode)\n $oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500;\n \t\t$amount = $oncepaid;\n\t \t$peramaters = array($amount,$card,$exp,$code,$fullname);\n \t\tchargeCreditCard($peramaters);\n \t\t}\n\n}\n/////////////////////////////////////////////////////////////////////////\n\nif(isset($_GET['subid']) && $_GET['subid'] > 0) { \n \n\t$subid = $_GET['subid'];\n\tcancelSubscription($subid); \n}\n\n\n\n\n/* global $wpdb;\n $table_name = $wpdb->prefix . 'payment';\n $sql = \"DROP TABLE IF EXISTS $table_name\";\n $wpdb->query($sql);\t*/\n\t\n$current_user = wp_get_current_user();\n$username = $current_user->user_login;\n$user_email = $current_user->user_email;\n$user_firstname = $current_user->user_firstname;\n$user_lastname = $current_user->user_lastname;\n$user_id = $current_user->ID;\n$thefullname = $user_firstname?$user_firstname.' '.$user_lastname:'';\t\n ?>\n <style>\n\t #sjkfrm input[type=text] {\n\t\t border:solid 1px #666666;\n\t\tborder-radius: 15px;\n\t\tborder: 2px solid #666666;\n\t\tpadding: 5px; \n\t\theight: 50px; \n\t\t }\n\t.form-control{\n\t\tborder: 2px solid #999 !important;\n\t\tborder-radius: 8px;\n\t\theight:40px !important;\n\t\twidth: 70%;\n\t\t}\n\t.thimg{\n\t\twidth: 70%;\n\t\t}\t\n\t@media only screen and (max-width: 700px) {\n\t\t.form-control{\n\t\t\twidth: 100%;\n\t\t}\n\t\t.thimg{\n\t\twidth: 100%;\n\t\t}\n\t\t}\t\n\t.selbx{\n\t\tborder: 2px solid #999 !important;\n\t\theight:40px !important;\n\t\t}\t \n\t.sbmt{\n\t\tbackground-color:#6dcd62;\n\t\tcolor:#FFF;\n\t\tpadding:12px 35px;\n\t\tborder-radius: 8px;\n\t\tborder: none 0px;\n\t\tmargin-bottom: 20px;\n\t\t}\n\t.sbmt:hover{\n\t\tbackground-color:#090;\n\t\t}\t\n </style>\n <?php \n /* global $wpdb;\n $table_name = $wpdb->prefix . 'payment';\n $oncePaid = $wpdb->get_var( \"SELECT amount FROM $table_name where user_id = \".$user_id.\" and status = 'Active' and subscribe == '-' order by id desc\" );\n echo $oncePaid; exit(0);\n if($oncePaid == 1000) {\n\t ?>\n <h2 style=\"color:#7066ce\">You have already paid $1500 for perfect cNanny</h2><br />\n <p>You have already paid $1500 for perfect cNanny. so you need not to be subscribed again</p>\n <?php\n\t $disp = 'style=\"display:none\"';\n\t } else {\n\t$disp = 'style=\"display:block\"';\t \n\t}*/\n ?> \n<form action=\"\" id=\"jkfrm\" method=\"post\" enctype=\"multipart/form-data\" name=\"payment\" autocomplete=\"off\" onsubmit=\"check_exp()\" <?php //echo $disp; ?>>\n\t<style type=\"text/css\">\n #checkout_card_number {\n background-image: url('<?php echo WP_PLUGIN_URL; ?>/authorizejk/cards.png');\n background-position: 3px 3px;\n background-size: 40px 252px; /* 89 x 560 */\n background-repeat: no-repeat;\n padding-left: 48px !important;\n }\n\tlabel span {\n\t\tfont-size:12px;\n\t\tfont-weight:600 !important;\n\t\tcolor:#666 !important;\n\t\t}\n\t/*input.pw {\n -webkit-text-security: disc;\n\t}*/\n\t\n\t\n\t\n\n\n#username,\n#pw {\n display: inline-block;\n width: 150px;\n background: #FFF;\n \tborder: 2px solid #999 !important;\n border-radius: 8px;\n height: 40px !important;\n\tline-height: 40px;\n padding: 0px 5px;\n letter-spacing: 2px;\n\toverflow:hidden;\n}\n#pw {\n -webkit-text-security: disc;\n\t\n}\n\n\n </style>\n <?php\n\t global $wpdb;\n $table_name = $wpdb->prefix . 'payment'; \n\t$subscribe = $wpdb->get_var( \"SELECT subscribe FROM $table_name where user_id = \".$user_id.\" and status = 'Active' and subscribe != '-' order by id desc\" );\n\t?>\n <!--<h2 style=\"color:#6dcd62; font-weight:bold;\">$75/month</h2><br />-->\n <?php if(!empty($subscribe)) { \n\tif(empty($ret)) {\n\t\twp_redirect(site_url().'/already-subscribe'); exit(0);\n\t}\n\t?>\n\n <small>Don't worry, you can <a href=\"?subid=<?php echo $subscribe; ?>\" onclick=\"return confirm('Are you sure that you want to cancel monthly subscription from Cnanny?')\">cancel</a> at any time</small><br />\n \n <?php $oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500; ?>\n <input type=\"radio\" name=\"payment_type\" value=\"yearly\" checked=\"checked\" style=\"clear:both\" /> <label style=\"margin-top:20px;\"> Pay Once $<?php echo $oncepaid; ?> for hiring perfect cNanny</label>\n <?php } else { ?>\n <?php $monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75; ?>\n <br />\n <input type=\"radio\" name=\"payment_type\" value=\"monthly\" checked=\"checked\" /> <label> Monthly Subscribe $<?php echo $monthpaid; ?></label>\n <?php } ?>\n <br /><br />\n <img src=\"<?php echo WP_PLUGIN_URL; ?>/authorizejk/cclogos.gif\" class=\"thimg\" /><br /><br />\n <label style=\"\">Full Name <span>(as it appears on your card)</span></label> <input type=\"text\" name=\"fullname\" maxlength=\"80\" required=\"required\" class=\"input-text form-control validate-alpha required\" placeholder=\"\" autocomplete=\"off\" value=\"<?php echo $thefullname; ?>\" />\n <input type=\"hidden\" name=\"amount\" value=\"<?php echo $monthpaid; ?>\" /><br />\n <label>Card Number <span>(no dashes or spaces)</span></label><input id=\"checkout_card_number\" name=\"card\" required=\"required\" class=\"input-text form-control validate-creditcard required\" type=\"text\" maxlength=\"16\" data-stripe=\"number\" placeholder=\"\" autocomplete=\"off\"><br />\n <script type=\"text/javascript\">\n\t$ = jQuery.noConflict();\n var $cardinput = $('#checkout_card_number');\n $('#checkout_card_number').validateCreditCard(function(result)\n {\t\t\n //console.log(result);\n if (result.card_type != null)\n {\t\t\t\t\n switch (result.card_type.name)\n {\n case \"visa\":\n $cardinput.css('background-position', '3px -34px');\n $cardinput.addClass('card_visa');\n break;\n \n case \"visa_electron\":\n $cardinput.css('background-position', '3px -72px');\n $cardinput.addClass('card_visa_electron');\n break;\n \n case \"mastercard\":\n $cardinput.css('background-position', '3px -110px');\n $cardinput.addClass('card_mastercard');\n break;\n \n case \"maestro\":\n $cardinput.css('background-position', '3px -148px');\n $cardinput.addClass('card_maestro');\n break;\n \n case \"discover\":\n $cardinput.css('background-position', '3px -186px');\n $cardinput.addClass('card_discover');\n break;\n \n case \"amex\":\n $cardinput.css('background-position', '3px -223px');\n $cardinput.addClass('card_amex');\n break;\n \n default:\n $cardinput.css('background-position', '3px 3px');\n break;\t\t\t\t\t\n }\n } else {\n $cardinput.css('background-position', '3px 3px');\n }\n \n // Check for valid card numbere - only show validation checks for invalid Luhn when length is correct so as not to confuse user as they type.\n if (result.length_valid || $cardinput.val().length > 16)\n {\n if (result.luhn_valid) {\n $cardinput.parent().removeClass('has-error').addClass('has-success');\n } else {\n $cardinput.parent().removeClass('has-success').addClass('has-error');\n }\n } else {\n $cardinput.parent().removeClass('has-success').removeClass('has-error');\n }\n });\n\t//------------------------------------------------------\n\tfunction check_exp() {\n\tvar yr = document.getElementById(\"yrt\").value;\t\n\tvar currentTime = new Date();\n\tvar curr_month = currentTime.getMonth() + 1;\n\tvar theyear = <?php echo date('y'); ?>;\n\tif(yr == theyear) {\n\t\tvar mnt = document.getElementById(\"mnt\").value;\n\t\tif(mnt < curr_month) {\n\t\t\talert('Please select a valid Expiry Date');\n\t\t\t}\n\t}\n\t\n}\n\nfunction set_type() { //\n\tvar pw = $('#pw').text();\n\tdocument.getElementById(\"code\").value = pw;\n\t//alert(pw);\n\t}\n \n </script>\n \n <label>Expiry Date</label><br />\n <select name=\"mn\" class=\"selbx required\" id=\"mnt\" required>\n <option value=\"\">Select Month</option>\n <option value=\"01\">January</option>\n <option value=\"02\">February</option>\n <option value=\"03\">March</option>\n <option value=\"04\">April</option>\n <option value=\"05\">May</option>\n <option value=\"06\">June</option>\n <option value=\"07\">July</option>\n <option value=\"08\">August</option>\n <option value=\"09\">September</option>\n <option value=\"10\">October</option>\n <option value=\"11\">November</option>\n <option value=\"12\">December</option>\n </select>\n <select name=\"yr\" class=\"selbx required\" id=\"yrt\" required onchange=\"check_exp()\">\n <option value=\"\">Select Year</option>\n \n\n <?php \n $y = date('y');\n for($i=1;$i<=12;$i++) {\n ?>\n <option value=\"<?php echo $y; ?>\"><?php echo '20'.$y; ?></option>\n <?php $y++; } ?>\n </select>\n <br />\n <input type=\"text\" name=\"card_number\" value=\"0000 0000 0000 0000\" style=\"display:none\" /><br />\n \n <?php\n if (strlen(strstr($_SERVER['HTTP_USER_AGENT'], 'Firefox')) > 0) { // Firefox\n ?>\n\t <label>Security Code <span>(3 digits on the back / Amex - 4 digits on the front)</span></label> <input type=\"password\" id=\"codeff\" name=\"code\" maxlength=\"4\" class=\"pw input-text form-control validate-digits required\" placeholder=\"\" required=\"required\" value=\"\" style=\"width:150px;\" autocomplete=\"off\" /><br />\n\t<?php\n} else { // other browsers\n ?>\n <label>Security Code <span>(3 digits on the back / Amex - 4 digits on the front)</span></label> <input type=\"hidden\" id=\"code\" name=\"code\" maxlength=\"4\" class=\"pw input-text form-control validate-digits required\" placeholder=\"\" required=\"required\" value=\"\" style=\"width:150px;\" autocomplete=\"off\" /> <br /><div contenteditable id=\"pw\"></div><br /><br />\n <?php\n}\n ?> \n\n\n \n\n \n \n <?php if(!empty($subscribe)) { \n\t\n\t $oncepaid = !empty(get_option('authorize_once_paid')) ? get_option('authorize_once_paid') : 1500; ?>\n <strong id=\"st\">You will be charged $<?php echo $oncepaid; ?> for hiring perfect cNanny</strong><br /><br />\n <?php } else { \n\t$monthpaid = !empty(get_option('authorize_monthly_paid')) ? get_option('authorize_monthly_paid') : 75;\n\t?>\n <strong id=\"st\">You will be charged $<?php echo $monthpaid; ?> every month</strong><br /><br />\n <?php } ?>\n \n <!-- prevent auto save in browser-->\n <div style=\"display:none\">\n <input type=\"text\" name=\"cardinfo\" id=\"txtUserName\" value=\"0000 0000 0000 0000\"/>\n\t<input type=\"text\" name=\"txtPass\" id=\"txtPass\" value=\"9999999999\"/>\n </div>\n \n \n <input type=\"submit\" class=\"sbmt\" value=\"Pay Now\" onclick=\"set_type();\" /><br />\n <strong>Don't want to pay right now?</strong> <a href=\"<?php echo site_url(); ?>/parent-search\">Continue browsing</a><br />\n <strong>Questions?</strong> <a href=\"<?php echo site_url(); ?>/contact-us\">Contact us</a>\n <script>document.addEventListener('contextmenu', event => event.preventDefault());\n payment.setAttribute( \"autocomplete\", \"off\" ); payment.code.setAttribute( \"autocomplete\", \"off\" );\n\thideFrm(); //hide form and show success massage\n </script>\n</form><br />\n<script>\nhideFrm(); //hide form and show success massage\n</script>\n <?php\n\t} else {\n\t\twp_redirect('login');\n\t\t}\n}",
"public function process_enrollment() {\n\t\t$member_id \t= $_POST['member_id'];\n\t\t$program_id = $_POST['program_id'];\n\t\t$program_price_id = $_POST['program_price_id'];\n\t\t$old_member_date_started = $_POST['date_started'];\n\t\t$program_price = $this->Program_Model->get_program_price_by_id($program_price_id);\n\n\t\tif ($program_price) {\n\t\t\t$duration = '+' . $program_price[0]->duration;\n\n\t\t\t$daily = ['Daily', 'daily'];\n\n\t\t\tif (in_array($program_price[0]->duration, $daily)) {\n\t\t\t\t$duration = \"now\";\n\t\t\t}\n\t\t\t\n\t\t\tif ($old_member_date_started) {\n\t\t\t\t$date_started = date(MYSQL_DATE_FORMAT, strtotime($old_member_date_started));\n\t\t\t\t$date_expired = date(MYSQL_DATE_FORMAT, strtotime($duration, strtotime($old_member_date_started)));\n\t\t\t} else {\n\t\t\t\t$date_started = date(MYSQL_DATE_FORMAT, strtotime(\"now\"));\n\t\t\t\t$date_expired = date(MYSQL_DATE_FORMAT, strtotime($duration));\n\t\t\t}\n\n\t\t\t$data = [\n\t\t\t\t'member_id' => $member_id,\n\t\t\t\t'program_id' => $program_id,\n\t\t\t\t'date_started' => $date_started,\n\t\t\t\t'date_expired' => $date_expired,\n\t\t\t\t'status' => 'Active'\n\t\t\t];\n\n\t\t\t$result = $this->Member_Model->insert($data, 'membership');\n\t\t\tif ($result) {\n\t\t\t\t$current_date_time = date(MYSQL_DATE_TIME_FORMAT, strtotime(\"now\"));\n\t\t\t\t$data = array(\n\t\t\t\t\t'payment_date_time' => $current_date_time,\n\t\t\t\t\t'membership_id' => $result,\n\t\t\t\t\t'program_price_id' => $program_price_id\n\t\t\t\t);\n\n\t\t\t\t$result = $this->Member_Model->insert($data, 'membership_payment');\n\n\t\t\t\tif ($result) {\n\t\t\t\t\t$response = [\n\t\t\t\t\t\t'status' => true,\n\t\t\t\t\t\t'message' => 'Member successfully enrolled..'\n\t\t\t\t\t];\n\t\t\t\t} else {\n\t\t\t\t\t$response = [\n\t\t\t\t\t\t'status' => false,\n\t\t\t\t\t\t'message' => 'Member enrollment error! Contact admin now!'\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\t$response = [\n\t\t\t\t\t'status' => false,\n\t\t\t\t\t'message' => 'Member enrollment error! Contact admin now!'\n\t\t\t\t];\n\t\t\t}\n\t\t} else {\n\t\t\t$response = [\n\t\t\t\t'status' => false,\n\t\t\t\t'message' => 'Error getting price list from server! Contact admin now!'\n\t\t\t];\n\t\t}\n\t\techo json_encode($response);\n\t}",
"function as_process($cfg, $app_url = NULL, $remote_organization = NULL, $home_organization = NULL, $forced_logon = FALSE) {\n\t$result = NULL;\n\tif (!array_key_exists('aselect_credentials', $_GET)) {\n\t\tas_authenticate($cfg, $app_url, $remote_organization, $home_organization, $forced_logon);\n\t} else {\n\t\t$result = as_authenticate_return($cfg);\n\t}\n\treturn $result;\n}",
"public function process_interac_response()\n\t{\n\t\t$idebit_merchantdata = strtolower(ee()->input->get_post('IDEBIT_MERCHDATA'));\n\t\tif($idebit_merchantdata)\n\t\t{\n\t\t\t$transaction = ee()->db->select('store_notify_url')->from('store_beanstream_interac')->where('interac_merchant_data', $idebit_merchantdata)->get();\n\t\t\tif($transaction->num_rows() == 1)\n\t\t\t{\n\t\t\t\t$_POST['funded'] = $_GET['funded'];\n\t\t\t\t$url = $transaction->row('store_notify_url').'&'.http_build_query($_POST);\n\t\t\t\tee()->functions->redirect($url);\n\t\t\t}\n\t\t}\n\t}",
"public function advertizeAction() {\n\t\t// Init variables\n\t\t$result = '';\n\t\t$yaml = new sfYamlParser();\n\n\t\t// Get settings\n\t\t$settings = $this->configurationManager->getConfiguration('Settings');\n\n\t\t$listOfUids = explode(',', $settings['listOfUid']);\n\t\tforeach ($listOfUids as $uid) {\n\t\t\t$feed = $this->feedRepository->findByUid($uid);\n\n\t\t\t$configuration = $yaml->parse($feed['configuration']);\n\t\t\t$this->checkConfiguration($configuration);\n\n\t\t\t$feedUrl = $configuration['baseURL'];\n\n\t\t\t/** @var $contentObject tslib_cObj */\n\t\t\t$config['returnLast'] = 'url';\n\t\t\t$config['parameter.']['data'] = 'leveluid:0';\n\t\t\t$config['additionalParams'] = '&type=9090&uid=' . $uid;\n\t\t\t$contentObject = $this->configurationManager->getcontentObject();\n\t\t\t$feedUrl =\n\n\t\t\t$result .= '<link rel=\"alternate\"\n\t\t\t\ttype=\"application/atom+xml\"\n\t\t\t\ttitle=\"' . $feed['title'] . '\"\n\t\t\t\thref=\"' . $contentObject->typolink('', $config) . '\" />' . chr(10);\n\t\t}\n\n\t\treturn $result;\n\t}",
"public function process()\n {\n Phpfox::isUser(true);\n /**\n * LOCK this feature\n *\n if($iId = $this->request()->get('id'))\n {\n $aInvite = Phpfox::getService('customprofiles')->getInviteAnonymousMessage($iId);\n if(isset($aInvite['invite_id']) && Phpfox::getUserId() == $aInvite['invite_user_id'])\n {\n if (Phpfox::isModule('notification'))\n {\n $type_id = 'customprofiles_anonymousconfirm';\n Phpfox::getService('customprofiles.process')->addNotification($type_id, $aInvite['feed_id'], $aInvite['invite_user_id'],$aInvite['user_id']); \n Phpfox::getService('customprofiles.process')->removeInviteAnonymousMessage($iId); \n }\n }\n } \n **/\n \n $this->url()->send('');\n }",
"private function approve() {\n\n }",
"private function execInsertionAlgoritm(){\r\n\t\t$sqlr_result=$this->loadData();\r\n\t\twhile ($array_User=mysql_fetch_array($sqlr_result)) {\r\n\t\t\tif ($this->isAffiliated($array_User)){\r\n\t\t\t\t//echo \"\";\t\t\t\r\n\t\t\t}\r\n\t\t\telse {\r\n\t\t\t\t$this->insertNewUser($array_User);\r\n\t\t\t}\r\n\t\t}\r\n\t}",
"public function doApology()\n {\n\n // Check for a token authority.\n // Check for a list authority.\n $this->getApologies();\n\n // Calculate the expiry of the authority.\n\n // Check if the authority has expired. Is in the past.\n\n if ($this->agent_input == null) {\n $array = ['No apology found.'];\n $k = array_rand($array);\n $v = $array[$k];\n\n $response = \"APOLOGY | \" . $v;\n\n $this->message = $response; // mewsage?\n } else {\n $this->message = $this->agent_input;\n }\n }",
"public function processAnime()\n\t{\n\t\tif ($this->site->lookupanidb === '1') {\n\t\t\t$anidb = new AniDB($this->echooutput);\n\t\t\t$anidb->animetitlesUpdate();\n\t\t\t$anidb->processAnimeReleases();\n\t\t}\n\t}",
"public function processAction() {\n\n if (!$this->validateRequest()) {\n $this->_helper->viewRenderer->setNoRender(true);\n $this->_helper->layout()->disableLayout();\n return;\n }\n\n $request = $this->getRequest();\n\n // Check if we have a POST request, otherwise, redirect\n if (!$request->isPost()) {\n return $this->_helper->redirector('index');\n }\n //Retrieving the form\n $form = $this->getForm();\n if (!$form->isValid($request->getPost())) {// Invalid entries\n $this->view->message = 'process-authorize';\n $this->view->form = $form;\n return $this->render('index'); // re-render the login form\n }\n\n if ($form->getValue('yes')) {//Resource Owner says yes\n $this->processApprove($form->getValues());\n } else if ($form->getValue(\"no\")) {//Resource Owner says no\n $this->processDeny($form->getValues());\n } else {//unrecognized value\n $this->view->message = 'process-authorize';\n $this->view->form = $form;\n return $this->render('index'); // re-render the login form\n }\n }",
"public function process()\n {\n $iPageId = -1;\n $iActive = 0;\n $sEmail = '';\n $sContent = '';\n $sTermOfService = '';\n $sSubject = '';\n $aDonation = Phpfox::getService('donation')->getDonationConfig($iPageId, 1);\n if ($aDonation)\n {\n $iActive = $aDonation['is_active'];\n $sEmail = $aDonation['email'];\n $sContent = $aDonation['content'];\n $sTermOfService = $aDonation['term_of_service'];\n $sSubject = $aDonation['subject'];\n }\n $aForms['email_content'] = isset($aDonation['email_content']) ? $aDonation['email_content'] : '';\n $this->template()\n ->assign(array(\n 'iPageId' => $iPageId,\n 'sEmail' => $sEmail,\n 'iActive' => $iActive,\n 'content' => $sContent,\n 'sTermOfService' => $sTermOfService,\n 'sSubject' => $sSubject,\n 'aForms' => $aForms\n ))\n ->setHeader(array(\n 'donation.js' => 'module_donation'\n ))\n ->setTitle(Phpfox::getPhrase('donation.manage_donation'))\n ->setBreadcrumb(Phpfox::getPhrase('donation.manage_donation'), $this->url()->makeUrl('admincp.donation'))\n ->setEditor();\n }",
"function doEdit() {\n\t\t\n\t\t// Require a validated association \n\t\tProfileAssociationValidRequired::check();\r\n\t\n\t\t// Get the annonce\r\n\t\t$this->fetchAnnonce();\n\t\t\n\t\t// We should have write access to this annonce\r\n\t\t$this->checkWriteAccess();\n\t\t\n\t\t// Delete old version\n\t\t$this->annonce->delete();\r\n\t\n\t\t// Populate from request\n\t\t$this->populateAnnonce();\n\t\t\n\t\t// Publish new one\n\t\t$this->annonce->publish();\n\t\t\n\t\t// Success\n\t\t$this->setSuccess(_(\"Annonce mise à jour\"));\n\t\t\r\n\t\t// Redirect to the details\r\n\t\t$this->details();\r\n\t}",
"public function main() {\n\t\t// Access check!\n\t\t// The page will show only if there is a valid page and if this page may be viewed by the user\n\t\t$this->pageinfo = t3lib_BEfunc::readPageAccess($this->id, $this->perms_clause);\n\t\t$access = is_array($this->pageinfo) ? 1 : 0;\n\t\tif (($this->id && $access) || (tx_laterpay_helper_user::isAdmin() && !$this->id)) {\n\t\t\t$this->doc->backPath = $GLOBALS['BACK_PATH'];\n\n\t\t\t// load LaterPay-specific CSS\n\t\t\t$this->doc->addStyleSheet('laterpay-backend', t3lib_extMgm::extRelPath('laterpay') . 'res/css/laterpay-backend.css');\n\t\t\t$this->doc->addStyleSheet('fonts.googleapis.com', 'http://fonts.googleapis.com/css?family=Open+Sans:300italic,400italic,600italic,300,400,600&subset=latin,latin-ext');\n\t\t\t// load LaterPay-specific JS\n\t\t\t$this->doc->loadJavascriptLib(t3lib_extMgm::extRelPath('laterpay') . 'res/js/vendor/jquery-1.11.2.min.js');\n\t\t\t$this->doc->loadJavascriptLib(t3lib_extMgm::extRelPath('laterpay') . 'res/js/laterpay-backend.js');\n\n\t\t\t$pageContent = $this->getModuleContent();\n\n\t\t\t// Draw the header.\n\t\t\t// JavaScript\n\t\t\t$this->doc->JScode = '\n\t\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\t\tscript_ended = 0;\n\t\t\t\t\tfunction jumpToUrl(URL)\t{\n\t\t\t\t\t\tdocument.location = URL;\n\t\t\t\t\t}\n\t\t\t\t</script>\n\t\t\t';\n\t\t\t$this->doc->postCode = '\n\t\t\t\t<script language=\"javascript\" type=\"text/javascript\">\n\t\t\t\t\tscript_ended = 1;\n\t\t\t\t\tif (top.fsMod) top.fsMod.recentIds[\"web\"] = 0;\n\t\t\t\t</script>\n\t\t\t';\n\n\t\t\t$headerSection = $this->doc->getHeader('pages', $this->pageinfo, $this->pageinfo['_thePath']) . '<br />' .\n\t\t\t\t$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xml:labels.path') .\n\t\t\t\t': ' . t3lib_div::fixed_lgd_cs($this->pageinfo['_thePath'], -50);\n\n\t\t\t$this->content .= $this->doc->startPage(tx_laterpay_helper_string::tr('title'));\n\t\t\t$this->content .= $this->doc->header(tx_laterpay_helper_string::tr('title'));\n\t\t\t$this->content .= $this->doc->spacer(5);\n\t\t\t$this->content .= $this->doc->section(\n\t\t\t\t\t'', $this->doc->funcMenu($headerSection, t3lib_BEfunc::getFuncMenu($this->id, 'SET[function]',\n\t\t\t\t\t$this->MOD_SETTINGS['function'], $this->MOD_MENU['function']))\n\t\t\t);\n\t\t\t$this->content .= $this->doc->divider(5);\n\t\t\t\t// Render content:\n\t\t\t$this->content .= $pageContent;\n\t\t\t\t// Shortcut\n\t\t\tif ($GLOBALS['BE_USER']->mayMakeShortcut()) {\n\t\t\t\t$this->content .= $this->doc->spacer(20) . $this->doc->section('', $this->doc->makeShortcutIcon('id', implode(',', array_keys($this->MOD_MENU)), $this->MCONF['name']));\n\t\t\t}\n\n\t\t\t$this->content .= $this->doc->spacer(10);\n\t\t} else {\n\t\t\t\t// If no access or if ID == zero\n\n\t\t\t$this->doc->backPath = $GLOBALS['BACK_PATH'];\n\n\t\t\t$this->content .= $this->doc->startPage(tx_laterpay_helper_string::tr('title'));\n\t\t\t$this->content .= $this->doc->header(tx_laterpay_helper_string::tr('title'));\n\t\t\t$this->content .= $this->doc->spacer(5);\n\t\t\t$this->content .= $this->doc->spacer(10);\n\t\t}\n\t}",
"function affwp_admin_update_affiliate_program( $affiliate, $updated ) {\n\n\tif ( $updated ) {\n\n\t\t$affiliate_id = $affiliate->affiliate_id;\n\n\t\tif ( ! empty( $_POST['program'] ) ) {\n\n\t\t\t$program = sanitize_text_field( $_POST['program'] );\n\n\t\t\taffwp_update_affiliate_meta( $affiliate_id, 'program', $program );\n\n\t\t} else {\n\n\t\t\taffwp_delete_affiliate_meta( $affiliate_id, 'program' );\n\n\t\t}\n\t}\n\n}",
"function eralha_crowdfunding_account(){\n\t\t\t\n\t\t}",
"function wp_aff_view2_signup_form_processing_code() {\n unset($_SESSION['wp_aff_signup_success_msg']);\n if (isset($_POST['wpAffDoRegister'])) {\n global $wpdb;\n $wp_aff_platform_config = WP_Affiliate_Platform_Config::getInstance();\n $affiliates_table_name = WP_AFF_AFFILIATES_TBL_NAME;\n\n //Sanitize the POST data\n $post_data = $_POST;\n $_POST = array_map('strip_tags', $post_data); //$_POST = filter_var_array($_POST, FILTER_SANITIZE_STRING);\n\n $login_url = wp_aff_view_get_url_with_separator(\"login\");\n if (get_option('wp_aff_use_recaptcha')) {\n //Recaptcha was shown to the user to lets check the response\n include_once(WP_AFF_PLATFORM_PATH . 'lib/recaptchalib.php');\n $secret = get_option('wp_aff_captcha_private_key'); //Secret\n\n $reCaptcha = new WPAP_ReCaptcha($secret);\n $resp = $reCaptcha->verifyResponse($_SERVER[\"REMOTE_ADDR\"], $_REQUEST[\"g-recaptcha-response\"]);\n if ($resp != null && $resp->success) {\n //Valid reCAPTCHA response. Go ahead with the registration\n } else {\n //Invalid response. Stop going forward. Set the error msg so the form shows it to the user.\n $recaptcha_error = AFF_IMAGE_VERIFICATION_FAILED;\n $_GET['aff_signup_error_msg'] = AFF_IMAGE_VERIFICATION_FAILED;\n return;\n }\n }\n\n //=================\n include_once(ABSPATH . WPINC . '/class-phpass.php');\n $wp_hasher = new PasswordHash(8, TRUE);\n $password = $wp_hasher->HashPassword($_POST['wp_aff_pwd']);\n\n $user_ip = wp_aff_get_user_ip();\n $host = $_SERVER['HTTP_HOST'];\n $host_upper = strtoupper($host);\n $path = rtrim(dirname($_SERVER['PHP_SELF']), '/\\\\');\n $activ_code = rand(1000, 9999);\n $aemail = esc_sql($_POST['aemail']);\n $user_name = esc_sql($_POST['user_name']);\n //============\n\n $userid = esc_sql($_POST['user_name']);\n\n $result = $wpdb->get_results(\"SELECT refid FROM $affiliates_table_name where refid='$userid'\", OBJECT);\n if ($result) {\n $_GET['aff_signup_error_msg'] = AFF_SI_USEREXISTS;\n return;\n }\n // check if referred by another affiliate\n $referrer = \"\";\n if (!empty($_SESSION['ap_id'])) {\n $referrer = $_SESSION['ap_id'];\n } else if (isset($_COOKIE['ap_id'])) {\n $referrer = $_COOKIE['ap_id'];\n }\n\n $commission_level = get_option('wp_aff_commission_level');\n $date = (date(\"Y-m-d\"));\n $account_details = \"\";\n $sec_tier_commissionlevel = \"\";\n if (!isset($_POST['apayable']))\n $_POST['apayable'] = \"\";\n\n $account_status = 'approved';\n if ($wp_aff_platform_config->getValue('wp_aff_enable_manual_signup_approval') == '1') {\n wp_affiliate_log_debug(\"Manual affiliate registration option is enabled. So the account status will be set to pending.\", true);\n $account_status = 'pending';\n }\n\n $updatedb = \"INSERT INTO $affiliates_table_name (refid,pass,company,firstname,lastname,website,email,payableto,street,town,state,postcode,country,phone,date,paypalemail,commissionlevel,referrer,tax_id,account_details,sec_tier_commissionlevel,account_status) VALUES ('\" . $_POST['user_name'] . \"', '\" . $password . \"', '\" . $_POST['acompany'] . \"', '\" . $_POST['afirstname'] . \"', '\" . $_POST['alastname'] . \"', '\" . $_POST['awebsite'] . \"', '\" . $_POST['aemail'] . \"', '\" . $_POST['apayable'] . \"', '\" . $_POST['astreet'] . \"', '\" . $_POST['atown'] . \"', '\" . $_POST['astate'] . \"', '\" . $_POST['apostcode'] . \"', '\" . $_POST['acountry'] . \"', '\" . $_POST['aphone'] . \"', '$date','\" . $_POST['paypal_email'] . \"','\" . $commission_level . \"','\" . $referrer . \"', '\" . $_POST['tax_id'] . \"','$account_details','$sec_tier_commissionlevel','$account_status')\";\n $results = $wpdb->query($updatedb);\n\n $affiliate_login_url = get_option('wp_aff_login_url');\n\n $email_subj = get_option('wp_aff_signup_email_subject');\n $body_sign_up = get_option('wp_aff_signup_email_body');\n $from_email_address = get_option('wp_aff_senders_email_address');\n $headers = 'From: ' . $from_email_address . \"\\r\\n\";\n\n $additional_params = array();\n $additional_params['password'] = $_POST['wp_aff_pwd'];\n $aemailbody = wp_aff_dynamically_replace_affiliate_details_in_message($user_name, $body_sign_up, $additional_params);\n $additional_params['password'] = \"********\";\n $admin_email_body = wp_aff_dynamically_replace_affiliate_details_in_message($user_name, $body_sign_up, $additional_params);\n $admin_email_body = \"The following email was sent to the affiliate: \\n\" .\n \"-----------------------------------------\\n\" . $admin_email_body;\n\n if (get_option('wp_aff_admin_notification')) {\n $admin_email_subj = \"New affiliate sign up notification\";\n $admin_contact_email = get_option('wp_aff_contact_email');\n if (empty($admin_contact_email)) {\n $admin_contact_email = $from_email_address;\n }\n wp_mail($admin_contact_email, $admin_email_subj, $admin_email_body, $headers);\n wp_affiliate_log_debug(\"Affiliate signup notification email successfully sent to the admin: \" . $admin_contact_email, true);\n }\n wp_mail($_POST['aemail'], $email_subj, $aemailbody, $headers);\n wp_affiliate_log_debug(\"Welcome email successfully sent to the affiliate: \" . $_POST['aemail'], true);\n\n //Check and give registration bonus\n wp_aff_check_and_give_registration_bonus($userid);\n\n //Check and do autoresponder signup\n include_once('wp_aff_auto_responder_handler.php');\n wp_aff_global_autoresponder_signup($_POST['afirstname'], $_POST['alastname'], $_POST['aemail']);\n\n //$redirect_page = wp_aff_view_get_url_with_separator(\"thankyou\");\n //echo '<meta http-equiv=\"refresh\" content=\"0;url='.$redirect_page.'\" />';\n //exit();\n $_SESSION['wp_aff_signup_success_msg'] = \"\";\n $_SESSION['wp_aff_signup_success_msg'] .= \"<h2 class='wp_aff_title'>\" . AFF_THANK_YOU . \"</h2><p class='message'>\" . AFF_REGO_COMPLETE . \"</p>\";\n $_SESSION['wp_aff_signup_success_msg'] .= '<a href=\"' . $login_url . '\">' . AFF_LOGIN_HERE . '</a>';\n $additional_success_msg = apply_filters('wpap_below_registration_success_message', '');\n if (!empty($additional_success_msg)) {\n $_SESSION['wp_aff_signup_success_msg'] .= $additional_success_msg;\n }\n \n do_action('wp_aff_registration_complete');//registration complete hook\n }\n}",
"private function insertNewAffiliate() {\n\t\t\t$queryVals = array(\n\t\t\t\t'~company' => prepDB($this->registrationForm['company']),\n\t\t\t\t'~first' => prepDB($this->registrationForm['first']),\n\t\t\t\t'~last' => prepDB($this->registrationForm['last']),\n\t\t\t\t'~phone' => prepDB($this->registrationForm['phone']),\n\t\t\t\t'~fax' => prepDB($this->registrationForm['fax']),\n\t\t\t\t'~email' => prepDB($this->registrationForm['email']),\n\t\t\t\t'~website' => prepDB($this->registrationForm['website']),\n\t\t\t\t'~password' => prepDB($this->registrationForm['password']),\n\t\t\t\t'~address1' => prepDB($this->registrationForm['address1']),\n\t\t\t\t'~address2' => prepDB($this->registrationForm['address2']),\n\t\t\t\t'~city' => prepDB($this->registrationForm['city']),\n\t\t\t\t'~state' => prepDB($this->registrationForm['state']),\n\t\t\t\t'~postal' => prepDB($this->registrationForm['postal']),\n\t\t\t\t'~country' => prepDB($this->registrationForm['country']),\n\t\t\t\t'agreeTerms' => prepDB($this->registrationForm['agreeTerms']),\n\t\t\t\t'agreePolicy' => prepDB($this->registrationForm['agreePolicy']),\n\t\t\t\t'isOverAge' => prepDB($this->registrationForm['isOverAge']),\n\t\t\t\t'entryDate' => 'NOW()'\n\t\t\t\t\n\t\t\t);\n\t\t\t$this->dbh->perform('affiliates', $queryVals);\n\t\t}",
"function wp_aff_gf_save_ap_id($entry, $form) { \n $aff_id = wp_affiliate_get_referrer();\n wp_affiliate_log_debug(\"GF integration... adding ap_id meta data to entry (\".$entry['id'].\") with value: \" . $aff_id, true);\n gform_update_meta($entry['id'], 'ap_id', $aff_id);\n}",
"public function joinPaymentInfo();",
"function addAffiliateMain($oAffiliate)\n\t\t{\n\t\t\t$query = \"insert into tbl_member set \n\t\t\tfirst_name='\".$oAffiliate->first_name.\"'\n\t\t\t,last_name='\".$oAffiliate->last_name.\"'\n\t\t\t,user_name='\".$oAffiliate->username.\"'\n\t\t\t,email='\".$oAffiliate->email.\"'\n\t\t\t,isActive='n'\n\t\t\t,password=md5('\".$oAffiliate->password.\"')\n\t\t\t,member_type='affiliate'\n\t\t\t,reg_date=now()\";\n\t\t\t\n\t\t\t$rs = $this->Execute($query);\n\t\t\t$newid= mysql_insert_id();\n\t\t\t\n\t\t\t$oAffiliate->affiliate_code = $oAffiliate->affiliate_code.$newid;\n\t\t\t\n\t\t\t$query_affiliate = \"insert into tbl_affiliate set \n\t\t\taffiliate_id = '\".$newid.\"'\n\t\t\t,organisation_name = '\".$oAffiliate->organisation_name.\"'\n\t\t\t,affiliate_code = '\".$oAffiliate->affiliate_code.\"'\n\t\t\t,description = '\".$oAffiliate->description.\"'\t\t\t\n\t\t\t,organisation_website ='\".$oAffiliate->organisation_website.\"'\n\t\t\t,street_address = '\".$oAffiliate->address.\"'\n\t\t\t,city = '\".$oAffiliate->city.\"'\n\t\t\t,state = '\".$oAffiliate->state.\"'\n\t\t\t,zip_code = '\".$oAffiliate->postal_code.\"'\";\n\t\t\t\n\t\t\t$rs_affiliate = $this->Execute($query_affiliate);\n\t\t\t\n\t\t\treturn $newid;\n\t\t}",
"public function action_account_transaction() {\n $package = Model::factory('package');\n $invoice_id = explode('/', $_SERVER['REQUEST_URI']);\n $transaction_info = $package->account_transaction($invoice_id[3]);\n $this->template->title = CLOUD_SITENAME . ' | Account';\n $this->template->page_title = __('account_transaction_details');\n $this->meta_description = \"\";\n $this->template->content = View::factory(\"admin/package_plan/account_transaction\")\n ->bind('transaction_info', $transaction_info);\n }",
"public function processUser(){\n \n $this->setCurrentUser();\n $this->setUsersAttributes();\n }",
"function before_process() {\r\n global $order_total_modules;\r\n if (isset($_GET['referer']) && $_GET['referer'] == 'nochex_apc') {\r\n $this->notify('NOTIFY_PAYMENT_NOCHEX_RETURN_TO_STORE');\r\n if (MODULE_PAYMENT_NOCHEX_TESTING == 'Harness') {\r\n // simulate call to ipn_handler.php here\r\n nochex_simulate_apc_handler((int)$_GET['count']);\r\n }\r\n $_SESSION['cart']->reset(true);\r\n unset($_SESSION['sendto']);\r\n unset($_SESSION['billto']);\r\n unset($_SESSION['shipping']);\r\n unset($_SESSION['payment']);\r\n unset($_SESSION['comments']);\r\n unset($_SESSION['cot_gv']);\r\n $order_total_modules->clear_posts();//ICW ADDED FOR CREDIT CLASS SYSTEM\r\n zen_redirect(zen_href_link(FILENAME_CHECKOUT_SUCCESS, '', 'SSL'));\r\n } else {\r\n $this->notify('NOTIFY_PAYMENT_NOCHEX_CANCELLED_DURING_CHECKOUT');\r\n zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL'));\r\n }\r\n }",
"function mystery_process_account_creation() {\n\t// error messages, etc.\n\n\tglobal $_MYSTERY;\n\n}",
"private function findAccount() {\n\t\t\tassertArray($this->errorMsgs);\n\t\t\t// find existing email/login\n\t\t\t$result = $this->dbh->query(\"SELECT `affiliateID`, `email`, `password` FROM `affiliates` WHERE `email` = '\".prepDB($this->registrationForm['email']).\"'\");\n\t\t\tif (isset($_REQUEST['affiliateLogin'])) {\n\t\t\t\t// login\n\t\t\t\tif ($this->affiliateID) {\n\t\t\t\t\t// already logged in\n\t\t\t\t\t$this->errorMsgs[] = 'You are already logged in, please log out first';\n\t\t\t\t} elseif ($result->rowCount) {\n\t\t\t\t\t$row = $result->fetchAssoc();\n\t\t\t\t\tif ($row['password'] != $this->registrationForm['password']) {\n\t\t\t\t\t\t// login, incorrect password\n\t\t\t\t\t\t$this->errorMsgs[] = 'Incorrect password for '.$this->registrationForm['email'];\n\t\t\t\t\t\taddErrorField('password');\n\t\t\t\t\t} elseif (!$this->affiliateID) {\n\t\t\t\t\t\t// affiliate id is the logged in flag\n\t\t\t\t\t\t// the only way affiliate id can be set is if user successfully creates a new account or logs in\n\t\t\t\t\t\t$this->affiliateID = $row['affiliateID'];\n\t\t\t\t\t\t// update login count\n\t\t\t\t\t\t$this->dbh->query(\"UPDATE `affiliates` SET `totalLogins` = `totalLogins` + 1 WHERE `affiliateID` = '\".prepDB($this->affiliateID).\"'\");\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->errorMsgs[] = 'You are already logged in, please log out first';\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\t// no email found\n\t\t\t\t\t$this->errorMsgs[] = 'Email not found';\n\t\t\t\t}\n\t\t\t} elseif ($this->affiliateID) {\n\t\t\t\t// affiliate changing account info\n\t\t\t\tif ($result->rowCount) {\n\t\t\t\t\t$row = $result->fetchAssoc();\n\t\t\t\t\tif ($row['affiliateID'] != $this->affiliateID) {\n\t\t\t\t\t\t// user entered an existing address/login that belongs to another account\n\t\t\t\t\t\t$this->errorMsgs[] = $this->registrationForm['email'].' has an existing account, please enter a different email address';\n\t\t\t\t\t\taddErrorField('email');\n\t\t\t\t\t} else {\n\t\t\t\t\t\t$this->errorMsgs[] = 'You are currently using this email address';\n\t\t\t\t\t\taddErrorField('email');\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} elseif ($result->rowCount) {\n\t\t\t\t// new account\n\t\t\t\t$row = $result=>fetchAssoc();\n\t\t\t\tif ($row['email'] == prepDB($this->registrationForm['email'])) {\n\t\t\t\t\t$this->errorMsgs[] = $this->registrationForm['email'].' has an existing account, please log in or enter a different email address';\n\t\t\t\t\taddErrorField('email');\n\t\t\t\t}\n\t\t\t}\n\t\t}",
"public function invokeAdvertisements()\r\n {\r\n if (!isset($_GET['adverisements'])) {\r\n\r\n $advertisements = $this->model->getAdvertisements();\r\n include 'view/advertisements.php';\r\n }\r\n }",
"function ap2av_exec(&$r){\n global $av_stat;\n\n // Fill AV from AP\n $av_data = array();\n foreach(bForm_jam_Applicant::$ap2av as $t=>$f){\n foreach(array($f, str_replace('_ap_','ap_',$f)) as $from){\n $v = trim(@$r[$from]);\n if (!empty($v)) $av_data[$t] = $v;\n }\n }\n \n if (!empty($av_data['av_email'])) $av = bForm_Avatar::hook(array('av_email'=>$av_data['av_email']));\n elseif (!empty($av_data['ap_email'])) $av = bForm_Avatar::hook(array('av_email'=>$av_data['ap_email']));\n else $av = 0;\n @$av_stat[(is_object($av) \n\t ? 'ap2av - AV is already known to zzz_avatars' \n\t : 'ap2av - AV is created' )]++;\n \n foreach($av_data as $k=>$v){\n switch($k){\n case 'av_pwd2':\n if(is_object($av)) $av_pwd2 = @$av->formDB[$k]; \n else $av_pwd2 = '';\n $a = array_unique(array_merge(explode(',',trim($r['ap_pwd'])),\n\t\t\t\t explode(',',trim($r['ap_pwd_spurious'])),\n\t\t\t\t explode(',',trim($av_pwd2))));\n sort($a);\n $av_data[$k] = join(',',$a);\n $av_data[$k] = preg_replace('/(^,|,$)/','',str_replace(',,',',',$av_data[$k]));\n if(is_object($av)){\n\tif($av_data[$k] == $av->formDB[$k]) unset($av_data[$k]);\n\telse unset($av->formDB[$k]);\n }\n break;\n case 'av_id2':\n if(is_object($av)) $av_id2 = @$av->formDB[$k]; \n else $av_id2 = '';\n $a = array_unique(array_merge(explode(',',trim($r['ap_id'])),\n\t\t\t\t explode(',',trim($r['ap_id_spurious'])),\n\t\t\t\t explode(',',trim($av_id2))));\n sort($a);\n $av_data[$k] = join(',',$a);\n $av_data[$k] = preg_replace('/(^,|,$)/','',str_replace(',,',',',$av_data[$k]));\n if(is_object($av)){\n\tif($av_data[$k] == $av->formDB[$k]) unset($av_data[$k]);\n\telse unset($av->formDB[$k]);\n }\n break;\n \n case 'av_birthdate':\n case 'av_ms_year':\n case 'av_phd_year':\n \n $vo = $av_data[$k];\n if((is_object($av) && !empty($av->formDB[$k])) || (is_numeric($vo) && (int)$vo == 0)){\t \n\tif (is_object($av))\t$v = $av->formDB[$k];\n\tunset($av_data[$k]);\n }elseif(preg_match(';(\\d\\d)/(\\d\\d)/(\\d\\d\\d\\d);',$vo,$m)){\n\t$av_data[$k] = b_time::txt2unix(\"$m[3]-$m[2]-$m[1]\");\n }elseif(preg_match(';\\b([12]\\d\\d\\d)\\b;',$vo,$m)){\n\tif ($m[1] > 1900 && $m[1] < CONST_eternity_year)\t$av_data[$k] = b_time::y2d($m[1]);\n }else{\n\t$year = (int)$vo;\n\tif ($year > 1900 && $year < CONST_eternity_year){\n\t $av_data[$k] = b_time::y2d($year);\n\t}else{\n\t $av_data[$k] = 0; \t // \"0\" means \"not set\", TBD to the SQL \"null\"\n\t $av_data[$k] = 'NULL'; \n\t MSG::DEBUG(\"TBD $k: $vo (now is set to '\".$av_data[$k].\"')\");\n\t}\n }\n break;\n \n default:\n if(is_object($av) && !empty($av->formDB[$k]))\t unset($av_data[$k]);\n }\n }\n \n if (is_object($av)){\n printf(\"Known ============================== %s\\n\",b_fmt::unEscape($av->name()));\n foreach($av_data as $k=>$v){\n if (($av_1=@$av->getValue($k,1)) != ($av_2=@$av_data[$k])){\n\tprintf(\" %+20s in DB = '%s', but here ='%s' \\n\",$k,$av_1,$av_2);\n }\n $av->updateDB($av_data);\n }\n }else{\n $av = bForm_Avatar::hook($av_data,$doNotCreate=False);\n if (is_object($av)){\n printf(\"Create ++++++++++++++++++++++++++++++ %s\\n\",b_fmt::unEscape($av->name()));\n }else{\n b_debug::print_r($r,\"Not AV ??????????????????????????????\");\n b_debug::print_r($av_data,'av_data');\n }\n // if (@$GLOBALS['sdsdsd']++ < 10) b_debug::print_r($av_data,'unknown');\n }\n return $av;\n}",
"function account_activation($account_act_code='') {\n\n\t\tif( $this->authentication->is_user_logged_in() ) {\n\n\t\t\tredirect('home');\n\t\t}\n\n\t\t$this->mcontents['title']\t\t\t= 'Account Activation';\n\t\t$this->mcontents['page_heading']\t= 'Account Activation';\n\n\t\tif( !$account_act_code ) {\n\n\t\t\tredirect('home');\n\t\t}\n\n\t\t$this->load->model('common_model');\n\t\t$aResult = $this->common_model->isValidToken($account_act_code, 'account_activation');\n\t\t$aTokenStatus = c('token_status');\n\n\t\tif( $aResult['status'] != $aTokenStatus['valid'] ) {\n\n\t\t\t//find the reason why this token is not valid\n\t\t\tif( $aResult['status'] == $aTokenStatus['invalid'] ) {\n\n\t\t\t\tsf('error_message', 'Invalid Link. Please contact out support team');\n\t\t\t} elseif($aResult['status'] == $aTokenStatus['expired']) {\n\n\t\t\t\tsf('error_message', 'This link has expired. Click <a class=\"highlight1\" href=\"'.c('base_url').'user/resend_account_activation/'.$account_act_code.'\">here</a> to get another confirmation email');\n\t\t\t}\n\n\t\t\tredirect('home');\n\n\t\t} else {\n\n\t\t\t//activate the account\n\t\t\tif(true === $this->account_model->activateAccount($aResult['oToken']->user_id)){\n\n\t\t\t\t//delete the token\n\t\t\t\t$this->common_model->deleteToken($aResult['oToken']->id);\n\n\n\t\t\t\tif(!$this->authentication->makeLogin($aResult['oToken']->user_id)){\n\n\t\t\t\t\tsf('error_message', 'You could not be logged in. Please contact out admin');\n\t\t\t\t} else {\n\n\t\t\t\t\t// Send welcome message\n\t\t\t\t\t$this->load->model('maintenance_model');\n\t\t\t\t\t$this->maintenance_model->getSingleSetting('db_welcome_msg');\n\t\t\t\t\t$aWelcomeEmail['receiver_name'] = s('FULL_NAME');\n\t\t\t\t\t$aWelcomeEmail['welcome_text'] \t= $this->maintenance_model->getSingleSetting('db_signup_welcome_msg');\n\n\t\t\t\t\t$aSettings = array(\n\t\t\t\t\t\t'to' \t\t\t\t=> array(s('EMAIL') => s('FULL_NAME')), // email_id => name pairs\n\t\t\t\t\t\t'from_email' \t\t=> c('accounts_email_id'),\n\t\t\t\t\t\t'from_name'\t\t\t=> c('accounts_email_from'),\n\t\t\t\t\t\t'reply_to' \t\t\t=> array(c('accounts_email_id') => c('accounts_email_from')), // email_id => name pairs\n\t\t\t\t\t\t'email_contents' \t=> $aWelcomeEmail, // placeholder keywords to be replaced with this data\n\t\t\t\t\t\t'template_name' \t=> 'welcome', //name of template to be used\n\t\t\t\t\t\t//'preview'\t\t\t=> true\n\t\t\t\t\t);\n\n\t\t\t\t\t$this->load->helper('custom_mail');\n\t\t\t\t\tsendMail_PHPMailer($aSettings);\n\n\t\t\t\t\tsf('success_message', 'Account has been activated. Welcome to '.$this->mcontents['c_website_title']);\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\tsf('error_message', 'Could not activate!!');\n\t\t\t}\n\n\n\t\t\tredirect('home');\n\t\t}\n\t}",
"function process_cc() {\n\t\t$paymentType =urlencode( $_POST['paymentType']);\n\t\t$firstName =urlencode($this->info['post']['firstName']);\n\t\t$lastName =urlencode($this->info['post']['lastName']);\n\t\t$creditCardType =urlencode($this->info['post']['creditCardType']);\n\t\t$creditCardNumber = urlencode($this->info['post']['creditCardNumber']);\n\t\t$expDateMonth =urlencode($this->info['post']['expDateMonth']);\n\n\t\t// Month must be padded with leading zero\n\t\t$padDateMonth = str_pad($expDateMonth, 2, '0', STR_PAD_LEFT);\n\n\t\t$expDateYear =urlencode($this->info['post']['expDateYear']);\n\t\t$cvv2Number = urlencode($this->info['post']['cvv2Number']);\n\t\t$address1 = urlencode($this->info['post']['address1']);\n\t\t$address2 = urlencode($this->info['post']['address2']);\n\t\t$city = urlencode($this->info['post']['city']);\n\t\t$state =urlencode($this->info['post']['state']);\n\t\t$zip = urlencode($this->info['post']['zip']);\n\t\t$amount = urlencode($this->info['post']['amount']);\n\t\t// $currencyCode=urlencode($_POST['currency']);\n\t\t$currencyCode=\"USD\";\n\t\t// Hardcoding sale. Other possible variables are Authorization and Sale.\n\t\t// $paymentType=urlencode($_POST['paymentType']);\n\t\t$paymentType=\"sale\";\n\n\t\t/* Construct the request string that will be sent to PayPal.\n\t\t The variable $nvpstr contains all the variables and is a\n\t\t name value pair string with & as a delimiter */\n\t\t$nvpstr=\"&PAYMENTACTION=$paymentType&AMT=$amount&CREDITCARDTYPE=$creditCardType&ACCT=$creditCardNumber&EXPDATE=\". $padDateMonth.$expDateYear.\"&CVV2=$cvv2Number&FIRSTNAME=$firstName&LASTNAME=$lastName&STREET=$address1&CITY=$city&STATE=$state\".\n\t\t\"&ZIP=$zip&COUNTRYCODE=US&CURRENCYCODE=$currencyCode\";\n\n\n\n\t\t/* Make the API call to PayPal, using API signature.\n\t\t The API response is stored in an associative array called $resArray */\n\t\t$resArray=$this->hash_call(\"doDirectPayment\",$nvpstr);\n\n\t\t/* Display the API response back to the browser.\n\t\t If the response from PayPal was a success, display the response parameters'\n\t\t If the response was an error, display the errors received using APIError.php.\n\t\t */\n\t\t$ack = strtoupper($resArray[\"ACK\"]);\n\n\t\tif($ack!=\"SUCCESS\") {\n\t\t\t$_SESSION['reshash']=$resArray;\n\t\t\t$this->APIerror();\n\t\t\t//$location = \"APIError.php\";\n\t\t\t\t //header(\"Location: $location\");\n\t\t\t\t return false;\n\t\t }\n\n\t\treturn true;\n\t}",
"public function index(){\t\n\t\tif ($this->checkLogin('A') == ''){\n\t\t\tredirect(ADMIN_ENC_URL);\n\t\t} else {\n\t\t\tredirect(ADMIN_ENC_URL.'/promocode/display_promocode');\n\t\t}\n\t}",
"function cilien_autoriser(){}",
"function chargeCreditCard()\n{\n\t \n\t$insert_id = $this->session->userdata('recent_reg_id');\n\t$current_login_user = $this->common_front_model->get_session_data();\n\t$inputData=$this->input->post();\n\n\t//print_r($current_login_user);\n\n\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName(\"9zyp7U9TTQ\");\n $merchantAuthentication->setTransactionKey(\"8hFVee23p993GVVa\");\n \n // Set the transaction's refId\n $refId = $current_login_user['matri_id'].'-' . time();\n\n // Create the payment data for a credit card\n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber($inputData['card_number']);\n $creditCard->setExpirationDate($inputData['year'].\"-\".$inputData['month']);\n $creditCard->setCardCode($inputData['cvv']);\n\n // Add the payment data to a paymentType object\n $paymentOne = new AnetAPI\\PaymentType();\n $paymentOne->setCreditCard($creditCard);\n\n // Create order information\n $order = new AnetAPI\\OrderType();\n $order->setInvoiceNumber($refId);\n $order->setDescription(\"Membership Renewal-\".$inputData['plan_name']);\n\n // Set the customer's Bill To address\n $customerAddress = new AnetAPI\\CustomerAddressType();\n $customerAddress->setFirstName($inputData['name_on_card']);\n // $customerAddress->setLastName($current_login_user['lastname']);\n // $customerAddress->setCompany($current_login_user['username']);\n //$customerAddress->setAddress(\"14 Main Street\");\n // $customerAddress->setCity(\"Pecan Springs\");\n //$customerAddress->setState(\"TX\");\n // $customerAddress->setZip(\"44628\");\n // $customerAddress->setCountry(\"USA\");\n\n // Set the customer's identifying information\n $customerData = new AnetAPI\\CustomerDataType();\n $customerData->setType(\"individual\");\n $customerData->setId($current_login_user['matri_id']);\n $customerData->setEmail($current_login_user['email']);\n\n // Add values for transaction settings\n $duplicateWindowSetting = new AnetAPI\\SettingType();\n $duplicateWindowSetting->setSettingName(\"duplicateWindow\");\n $duplicateWindowSetting->setSettingValue(\"60\");\n\n // Add some merchant defined fields. These fields won't be stored with the transaction,\n // but will be echoed back in the response.\n $merchantDefinedField1 = new AnetAPI\\UserFieldType();\n $merchantDefinedField1->setName(\"customerLoyaltyNum\");\n $merchantDefinedField1->setValue(\"1128836273\");\n\n $merchantDefinedField2 = new AnetAPI\\UserFieldType();\n $merchantDefinedField2->setName(\"favoriteColor\");\n $merchantDefinedField2->setValue(\"blue\");\n\n // Create a TransactionRequestType object and add the previous objects to it\n $transactionRequestType = new AnetAPI\\TransactionRequestType();\n $transactionRequestType->setTransactionType(\"authCaptureTransaction\");\n $transactionRequestType->setAmount($inputData['plan_amount']);\n $transactionRequestType->setOrder($order);\n $transactionRequestType->setPayment($paymentOne);\n $transactionRequestType->setBillTo($customerAddress);\n $transactionRequestType->setCustomer($customerData);\n $transactionRequestType->addToTransactionSettings($duplicateWindowSetting);\n $transactionRequestType->addToUserFields($merchantDefinedField1);\n $transactionRequestType->addToUserFields($merchantDefinedField2);\n\n // Assemble the complete transaction request\n $request = new AnetAPI\\CreateTransactionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setTransactionRequest($transactionRequestType);\n\t//print_r($request);\n // Create the controller and get the response\n $controller = new AnetController\\CreateTransactionController($request);\n $response = $controller->executeWithApiResponse(\\net\\authorize\\api\\constants\\ANetEnvironment::PRODUCTION);\n \n\n if ($response != null) {\n // Check to see if the API request was successfully received and acted upon\n if ($response->getMessages()->getResultCode() == \"Ok\") {\n // Since the API request was successful, look for a transaction response\n // and parse it to display the results of authorizing the card\n $tresponse = $response->getTransactionResponse();\n \n if ($tresponse != null && $tresponse->getMessages() != null) {\n //echo \" Successfully created transaction with Transaction ID: \" . $tresponse->getTransId() . \"\\n\";\n // echo \" Transaction Response Code: \" . $tresponse->getResponseCode() . \"\\n\";\n // echo \" Message Code: \" . $tresponse->getMessages()[0]->getCode() . \"\\n\";\n // echo \" Auth Code: \" . $tresponse->getAuthCode() . \"\\n\";\n\t\t\t\t//echo \" Description: \" . $tresponse->getMessages()[0]->getDescription() . \"\\n\";\n\t\t\t\t//$this->data['status']=\"Successfully created transaction with Transaction ID: \" . $tresponse->getTransId() . \"\\n\";\n\t\t\t\t//$status=\"success\";\n\t\t\t\t$this->payment_status(\"authorize\");\n\t\t\t\treturn true;\n\t\t\t\t\n } else {\n //echo \"Transaction Failed \\n\";\n if ($tresponse->getErrors() != null) {\n // echo \" Error Code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n\t\t\t\t\t//echo \" Error Message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\";\n\t\t\t\t\t\n\t\t\t\t\t$this->data['status']=\" Error Message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\";\n\t\t\t\t\t$status=\"fail\";\n }\n }\n // Or, print errors if the API request wasn't successful\n } else {\n // echo \"Transaction Failed \\n\";\n $tresponse = $response->getTransactionResponse();\n \n if ($tresponse != null && $tresponse->getErrors() != null) {\n // echo \" Error Code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n\t\t\t\t//echo \" Error Message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\";\n\t\t\t\t\n\t\t\t\t $this->data['status']=\" Error Message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\";\n\t\t\t\t\t$status=\"fail\";\n\n } else {\n // echo \" Error Code : \" . $response->getMessages()->getMessage()[0]->getCode() . \"\\n\";\n\t\t\t//\techo \" Error Message : \" . $response->getMessages()->getMessage()[0]->getText() . \"\\n\";\n\t\t\t\t\n\t\t\t\t $this->data['status']=\" Error Message : \" . $response->getMessages()->getMessage()[0]->getText() . \"\\n\";\n\t\t\t\t\t$status=\"fail\";\n }\n }\n } else {\n echo \"No response returned \\n\";\n }\n\n\t//return $response;\n\t\n\t\t\t\t$this->common_model->front_load_header('Payment Success');\n\t\t\t\tif($status=='success'){\n\t\t\t\t\t$this->load->view('front_end/payment_success',$this->data);\n\t\t\t\t}\n\t\t\t\telse{\n\t\t\t\t\t$this->load->view('front_end/payment_fail',$this->data);\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t$this->common_model->front_load_footer();\n}",
"public function process ()\n {\n $this->processInAppNotifications();\n }",
"public function action_handler() {\n\t\tif ( !isset( $_REQUEST['ucc_ucn_acn'] ) )\n\t\t\treturn;\n\n\t\t// Define local variables\n\t\t$user_id = $post_id = 0;\n\t\t$action = '';\n\t\t$errors = array();\n\n\t\t/** User Details **********************************************/\n\t\t// Is logged in\n\t\tif ( is_user_logged_in() ) {\n\t\t\t$current_user = wp_get_current_user();\n\t\t\t$user_id = get_current_user_id(); \n\n\t\t// Not allowed \n\t\t} else {\n\t\t\t$errors[] = __( 'You do not have permission to do that.', 'unified-comment-notifications' );\n\t\t}\n\n\t\t/** Post ID ***************************************************/\n\n\t\tif ( isset( $_REQUEST['ucc_ucn_pid'] ) ) {\n\t\t\t$post_id = (int) $_REQUEST['ucc_ucn_pid'];\n\t\t}\n\n\t\t/** Action ****************************************************/\n\n\t\tif ( isset( $_REQUEST['ucc_ucn_acn'] ) ) {\n\n\t\t\tif ( !in_array( $_REQUEST['ucc_ucn_acn'], array(\n\t\t\t\t'subscribe', // AJAX/link subscribe\n\t\t\t\t'unsubscribe', // AJAX/link unsubscribe\n\t\t\t\t'unsubscribe_all' // AJAX/link unsubscribe all\n\t\t\t) ) )\n\t\t\t\t$errors[] = __( 'Invalid action specified.', 'unified-comment-notifications' ); \n\t\t\telse\n\t\t\t\t$action = $_REQUEST['ucc_ucn_acn'];\n\n\t\t// Required\n\t\t} else {\n\t\t\t$errors[] = __( 'No action specified.', 'unified-comment-notifications' );\n\t\t}\n\n\t\t/** Key *******************************************************/\n/*\n\t\tif ( isset( $_REQUEST['ucc_ucn_key'] ) ) {\n\t\t\t$key = $_REQUEST['ucc_ucn_key'];\n\n\t\t\tif ( !$this->check_key( $user_id, $key ) )\n\t\t\t\t$errors[] = __( 'Invalid key.', 'unified-comment-notifications' );\n\t\t} else {\n\t\t\t$errors[] = __( 'No key specified.', 'unified-comment-notifications' );\n\t\t}\n*/\n\t\t/** Required **************************************************/\n\n\t\tif ( 'unsubscribe_all' != $action && empty( $post_id ) )\n\t\t\t$errors[] = __( 'No post id specified.', 'unified-comment-notifications' );\n\n\t\t/** No Errors *************************************************/\n\n\t\tif ( empty( $errors ) ) {\n\n\t\t\t// Process action\n\t\t\tswitch( $action ) {\n\t\t\t\tcase 'subscribe':\n\t\t\t\t\t$this->subscribe( $user_id, $post_id );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'unsubscribe':\n\t\t\t\t\t$this->unsubscribe( $user_id, $post_id );\n\t\t\t\t\tbreak;\n\n\t\t\t\tcase 'unsubscribe_all':\n\t\t\t\t\t$this->unsubscribe_all( $user_id );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}",
"function onProcess () {\r\n \t\r\n \tswitch (parent::getAction()) {\r\n \t\tcase \"search\":\r\n \t\t\t// log the search\r\n \t\t\t\r\n \t\t\t// if the result is a pinboard, note go to it\r\n \t\t\t// user\r\n \t\t\t// \r\n \t\t\t\r\n \t\t\tbreak;\r\n \t\tcase \"autoComplete\":\r\n \t\t\t\r\n \t\t\t/*\r\n \t\t\t// search location\r\n \t\t\tLocationModel::search();\r\n \t\t\t\r\n \t\t\t// note\r\n \t\t\tpinboardModule::search();\r\n \t\t\t\r\n \t\t\t// user\r\n \t\t\tUsersModel::search(\"\");\r\n \t\t\t*/\r\n \t\t\t\r\n \t\t\t\r\n \t\t\t\r\n \t\t\t\r\n \t\t\t\r\n \t\t\tbreak;\r\n \t\tcase \"viewPinboard\":\r\n \t\t\tparent::redirect(\"pinboard\",array(\"pinboardId\"=>parent::get(\"pinboardId\")));\r\n \t\t\tbreak;\r\n \t\tcase \"viewLocation\":\r\n \t\t\tparent::redirect(\"pinboardMap\",array(\"pinboardId\"=>parent::get(\"pinboardId\")));\r\n \t\t\tbreak;\r\n \t\tcase \"viewUser\":\r\n \t\t\tbreak;\r\n \t}\r\n }",
"public function exec () {\r\n\t\t$a = isset($_GET['action']) ? $_GET['action'] : 'capa';\r\n\t\tswitch ($a) {\r\n\t\t\tcase 'capa':\r\n\t\t\t\t$this->capa();\r\n\t\t\tbreak;\r\n\t\t\tcase 'adicionar':\r\n\t\t\t\t$this->adicionar();\r\n\t\t\tbreak;\r\n\t\t\tcase 'alterar':\r\n\t\t\t\t$this->alterar();\r\n\t\t\tbreak;\r\n\t\t\tcase 'detalhar':\r\n\t\t\t\t$this->detalhar();\r\n\t\t\tbreak;\r\n\t\t\tcase 'excluir':\r\n\t\t\t\t$this->excluir();\r\n\t\t\tbreak;\r\n\t\t\tcase 'sair':\r\n\t\t\t\t$this->sair();\r\n\t\t\tbreak;\r\n\t\t} \r\n\t}",
"public function bp_account_tab_action() {\n\t\techo $this->get_instance( \\MyVideoRoomExtrasParking\\Library\\SectionTemplates::class )->account_control_centre_alternate_dashboard();\n\t}",
"function before_process() {\r\n global $response, $db, $order, $messageStack;\r\n\r\n $order->info['cc_owner'] = zen_db_prepare_input($_POST['bank_acct_name']);\r\n $order->info['cc_type'] = 'eCheck';\r\n $order->info['cc_number'] = zen_db_prepare_input($_POST['bank_aba_code'] . '-' . str_pad(substr($_POST['bank_acct_num'], -4), strlen($_POST['bank_acct_num']), \"X\", STR_PAD_LEFT));\r\n $sessID = zen_session_id();\r\n\r\n // DATA PREPARATION SECTION\r\n unset($submit_data); // Cleans out any previous data stored in the variable\r\n\r\n // Create a string that contains a listing of products ordered for the description field\r\n $description = '';\r\n for ($i=0; $i<sizeof($order->products); $i++) {\r\n $description .= $order->products[$i]['name'] . ' (qty: ' . $order->products[$i]['qty'] . ') + ';\r\n }\r\n // Remove the last \"\\n\" from the string\r\n $description = substr($description, 0, -2);\r\n\r\n // Create a variable that holds the order time\r\n $order_time = date(\"F j, Y, g:i a\");\r\n\r\n // Calculate the next expected order id\r\n $last_order_id = $db->Execute(\"select * from \" . TABLE_ORDERS . \" order by orders_id desc limit 1\");\r\n $new_order_id = $last_order_id->fields['orders_id'];\r\n $new_order_id = ($new_order_id + 1);\r\n $new_order_id = (string)$new_order_id . '-' . zen_create_random_value(6);\r\n\r\n // Populate an array that contains all of the data to be sent to Authorize.net\r\n $submit_data = array(\r\n 'x_login' => trim(MODULE_PAYMENT_AUTHORIZENET_ECHECK_LOGIN),\r\n 'x_tran_key' => trim(MODULE_PAYMENT_AUTHORIZENET_ECHECK_TXNKEY), \r\n 'x_relay_response' => 'FALSE', // AIM uses direct response, not relay response\r\n 'x_delim_data' => 'TRUE',\r\n 'x_delim_char' => $this->delimiter, // The default delimiter is a comma\r\n 'x_encap_char' => $this->encapChar, // The divider to encapsulate response fields\r\n 'x_version' => '3.1', // 3.1 is required to use CVV codes\r\n 'x_type' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_AUTHORIZATION_TYPE == 'Authorize' ? 'AUTH_ONLY': 'AUTH_CAPTURE',\r\n 'x_amount' => number_format($order->info['total'], 2),\r\n 'x_currency_code' => $order->info['currency'],\r\n 'x_method' => 'ECHECK',\r\n 'x_bank_aba_code' => $_POST['bank_aba_code'],\r\n 'x_bank_acct_num' => $_POST['bank_acct_num'],\r\n 'x_bank_acct_type' => $_POST['bank_acct_type'],\r\n 'x_bank_name' => $_POST['bank_name'],\r\n 'x_bank_acct_name' => $_POST['bank_acct_name'],\r\n 'x_echeck_type' => 'WEB',\r\n 'x_recurring_billing' => 'NO',\r\n 'x_email_customer' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_EMAIL_CUSTOMER == 'True' ? 'TRUE': 'FALSE',\r\n 'x_email_merchant' => MODULE_PAYMENT_AUTHORIZENET_ECHECK_EMAIL_MERCHANT == 'True' ? 'TRUE': 'FALSE',\r\n 'x_cust_id' => $_SESSION['customer_id'],\r\n 'x_invoice_num' => (MODULE_PAYMENT_AUTHORIZENET_ECHECK_TESTMODE == 'Test' ? 'TEST-' : '') . $new_order_id,\r\n 'x_first_name' => $order->billing['firstname'],\r\n 'x_last_name' => $order->billing['lastname'],\r\n 'x_company' => $order->billing['company'],\r\n 'x_address' => $order->billing['street_address'],\r\n 'x_city' => $order->billing['city'],\r\n 'x_state' => $order->billing['state'],\r\n 'x_zip' => $order->billing['postcode'],\r\n 'x_country' => $order->billing['country']['title'],\r\n 'x_phone' => $order->customer['telephone'],\r\n 'x_email' => $order->customer['email_address'],\r\n 'x_ship_to_first_name' => $order->delivery['firstname'],\r\n 'x_ship_to_last_name' => $order->delivery['lastname'],\r\n 'x_ship_to_address' => $order->delivery['street_address'],\r\n 'x_ship_to_city' => $order->delivery['city'],\r\n 'x_ship_to_state' => $order->delivery['state'],\r\n 'x_ship_to_zip' => $order->delivery['postcode'],\r\n 'x_ship_to_country' => $order->delivery['country']['title'],\r\n 'x_description' => $description,\r\n 'x_customer_ip' => zen_get_ip_address(),\r\n 'x_po_num' => date('M-d-Y h:i:s'), //$order->info['po_number'],\r\n 'x_freight' => number_format((float)$order->info['shipping_cost'],2),\r\n 'x_tax_exempt' => 'FALSE', /* 'TRUE' or 'FALSE' */\r\n 'x_tax' => number_format((float)$order->info['tax'],2),\r\n 'x_duty' => '0',\r\n\r\n // Additional Merchant-defined variables go here\r\n 'Date' => $order_time,\r\n 'IP' => zen_get_ip_address(),\r\n 'Session' => $sessID );\r\n // process Wells-Fargo-SecureSource-specific parameters\r\n if (MODULE_PAYMENT_AUTHORIZENET_ECHECK_WFSS_ENABLED == 'True') {\r\n $submit_data['x_customer_organization_type'] = zen_db_prepare_input($_POST['echeck_customer_type']);\r\n if (zen_db_prepare_input($_POST['echeck_customer_tax_id']) != '') {\r\n $submit_data['x_customer_tax_id'] = zen_db_prepare_input($_POST['echeck_customer_tax_id']);\r\n } else {\r\n $submit_data = array_merge($submit_data, \r\n array('x_drivers_license_num' => zen_db_prepare_input($_POST['echeck_dl_num']),\r\n 'x_drivers_license_state' => zen_db_prepare_input($_POST['echeck_dl_state']),\r\n 'x_drivers_license_dob' => zen_db_prepare_input($_POST['echeck_dl_dob']) ));\r\n }\r\n }\r\n unset($response);\r\n $response = $this->_sendRequest($submit_data);\r\n $response_code = $response[0];\r\n $response_text = $response[3];\r\n $this->auth_code = $response[4];\r\n $this->transaction_id = $response[6];\r\n $response_msg_to_customer = $response_text . ($this->commError == '' ? '' : ' Communications Error - Please notify webmaster.');\r\n\r\n $response['Expected-MD5-Hash'] = $this->calc_md5_response($response[6], $response[9]);\r\n $response['HashMatchStatus'] = ($response[37] == $response['Expected-MD5-Hash']) ? 'PASS' : 'FAIL';\r\n\r\n $this->_debugActions($response, $order_time, $sessID);\r\n\r\n // If the MD5 hash doesn't match, then this transaction's authenticity cannot be verified.\r\n // Thus, order will be placed in Pending status\r\n if ($response['HashMatchStatus'] != 'PASS') {\r\n $this->order_status = 1;\r\n $messageStack->add_session('header', MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_AUTHENTICITY_WARNING, 'caution');\r\n }\r\n\r\n // If the response code is not 1 (approved) then redirect back to the payment page with the appropriate error message\r\n if ($response_code != '1') {\r\n $messageStack->add_session('checkout_payment', $response_msg_to_customer . ' - ' . MODULE_PAYMENT_AUTHORIZENET_ECHECK_TEXT_DECLINED_MESSAGE, 'error');\r\n zen_redirect(zen_href_link(FILENAME_CHECKOUT_PAYMENT, '', 'SSL', true, false));\r\n }\r\n }",
"public function process_activation() {\n\n\t\t\tif ( ! get_transient( '_smart_coupons_process_activation' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tdelete_transient( '_smart_coupons_process_activation' );\n\n\t\t\tinclude_once 'class-wc-sc-act-deact.php';\n\n\t\t\tWC_SC_Act_Deact::process_activation();\n\n\t\t}",
"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 }",
"function affwp_admin_edit_affiliate_show_program( $affiliate ) {\n\n\t$program = affwp_get_affiliate_meta( $affiliate->affiliate_id, 'program', true );\n\t?>\n\n\t<tr class=\"form-row form-required\">\n\n\t\t<th scope=\"row\">\n\t\t\t<label for=\"payment_email\">Program</label>\n\t\t</th>\n\n\t\t<td>\n\t\t\t<input class=\"regular-text\" type=\"text\" name=\"program\" id=\"program\" value=\"<?php echo esc_attr( $program ); ?>\" />\n\t\t\t<p class=\"description\">The affiliate's program</p>\n\t\t</td>\n\n\t</tr>\n\n\t<?php\n}",
"function ciniki_poma_accountApplyCredit(&$ciniki, $tnid, $args) {\n\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectAdd');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'core', 'private', 'objectUpdate');\n ciniki_core_loadMethod($ciniki, 'ciniki', 'poma', 'private', 'orderUpdateStatusBalance');\n\n //\n // Load tenant settings\n //\n ciniki_core_loadMethod($ciniki, 'ciniki', 'tenants', 'private', 'intlSettings');\n $rc = ciniki_tenants_intlSettings($ciniki, $tnid);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $intl_timezone = $rc['settings']['intl-default-timezone'];\n\n //\n // Load the last entry in the customer ledger\n //\n $strsql = \"SELECT id, balance \"\n . \"FROM ciniki_poma_customer_ledgers \"\n . \"WHERE customer_id = '\" . ciniki_core_dbQuote($ciniki, $args['customer_id']) . \"' \"\n . \"AND tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"ORDER BY transaction_date DESC \"\n . \"LIMIT 1 \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.poma', 'entry');\n if( $rc['stat'] != 'ok') {\n return $rc;\n }\n if( !isset($rc['entry']) ) {\n $balance = 0;\n } else {\n $balance = $rc['entry']['balance'];\n }\n\n //\n // Apply the credit to the balance\n //\n $new_balance = bcadd($balance, $args['customer_amount'], 6);\n $credit_balance = $args['customer_amount'];\n\n //\n // Load any unpaid invoices\n //\n $strsql = \"SELECT ciniki_poma_orders.id, \"\n . \"ciniki_poma_orders.total_amount, \"\n . \"ciniki_poma_orders.balance_amount \"\n . \"FROM ciniki_poma_orders \"\n . \"WHERE ciniki_poma_orders.customer_id = '\" . ciniki_core_dbQuote($ciniki, $args['customer_id']) . \"' \"\n . \"AND ciniki_poma_orders.payment_status > 0 \"\n . \"AND ciniki_poma_orders.payment_status < 50 \"\n . \"AND ciniki_poma_orders.tnid = '\" . ciniki_core_dbQuote($ciniki, $tnid) . \"' \"\n . \"\";\n $rc = ciniki_core_dbHashQuery($ciniki, $strsql, 'ciniki.poma', 'invoice');\n if( $rc['stat'] != 'ok') {\n return $rc;\n }\n if( isset($rc['rows']) ) {\n $unpaid_orders = $rc['rows'];\n //\n // Check if orders will get payment amounts\n //\n foreach($unpaid_orders as $oid => $order) {\n //\n // Skip any orders that might be screwed up with a negative balance\n //\n if( $order['balance_amount'] < 0 ) { \n continue;\n }\n if( $order['balance_amount'] < $credit_balance ) {\n $unpaid_orders[$oid]['payment_amount'] = $order['balance_amount'];\n $credit_balance = bcsub($credit_balance, $order['balance_amount'], 6);\n } else {\n $unpaid_orders[$oid]['payment_amount'] = $credit_balance;\n $credit_balance = 0;\n }\n if( $credit_balance <= 0 ) {\n break;\n }\n }\n }\n\n //\n // Add the ledger entry\n //\n $args['balance'] = $new_balance;\n $rc = ciniki_core_objectAdd($ciniki, $tnid, 'ciniki.poma.customerledger', $args, 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $entry_id = $rc['id'];\n\n //\n // Apply credit to invoice if open unpaid invoices\n //\n if( isset($unpaid_orders) ) {\n foreach($unpaid_orders as $order) {\n if( isset($order['payment_amount']) && $order['payment_amount'] > 0 ) {\n $rc = ciniki_core_objectAdd($ciniki, $tnid, 'ciniki.poma.orderpayment', array(\n 'order_id'=>$order['id'],\n 'ledger_id'=>$entry_id,\n 'payment_type'=>$args['transaction_type'],\n 'amount'=>$order['payment_amount'],\n ), 0x04);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n $rc = ciniki_poma_orderUpdateStatusBalance($ciniki, $tnid, $order['id']);\n if( $rc['stat'] != 'ok' ) {\n return $rc;\n }\n }\n }\n }\n \n return array('stat'=>'ok', 'id'=>$entry_id);\n}",
"public function PaymentCredit()\n {\n\n $condition = array('id' => $this->checkLogin('U'));\n $userDetails = $this->checkout_model->get_all_details(USERS, $condition);\n $currency_code = $this->input->post('currencycode');\n\t\t\t$user_currencycode = $this->input->post('user_currencycode');\n if ($this->input->post('creditvalue') == 'authorize') {\n $Auth_Details = unserialize(API_LOGINID);\n $Auth_Setting_Details = unserialize($Auth_Details['settings']);\n error_reporting(-1);\n define(\"AUTHORIZENET_API_LOGIN_ID\", $Auth_Setting_Details['merchantcode']);\n define(\"AUTHORIZENET_TRANSACTION_KEY\", $Auth_Setting_Details['merchantkey']);\n define(\"API_MODE\", $Auth_Setting_Details['mode']);\n if (API_MODE == 'sandbox') {\n define(\"AUTHORIZENET_SANDBOX\", true);\n } else {\n define(\"AUTHORIZENET_SANDBOX\", false);\n }\n \n define(\"TEST_REQUEST\", \"FALSE\");\n require_once './authorize/autoload.php';\n\n $transaction = new AuthorizeNetAIM;\n $transaction->setSandbox(AUTHORIZENET_SANDBOX);\n\n\t\t\t\t$payable_amount = currency_conversion($this->input->post('user_currencycode'), 'USD', $this->input->post('total_price'),$this->input->post('currency_cron_id'));\n //echo $payable_amount;exit();\n $transaction->setFields(array('amount' => $payable_amount, 'card_num' => $this->input->post('cardNumber'), 'exp_date' => $this->input->post('CCExpMonth') . '/' . $this->input->post('CCExpYear'), 'first_name' => $userDetails->row()->firstname, 'last_name' => $userDetails->row()->lastname, 'address' => $this->input->post('address'), 'city' => $this->input->post('city'), 'state' => $this->input->post('state'), 'country' => $userDetails->row()->country, 'phone' => $userDetails->row()->phone_no, 'email' => $userDetails->row()->email, 'card_code' => $this->input->post('creditCardIdentifier'),));\n\n $response = $transaction->authorizeAndCapture();\n //print_r($response);exit();\n\n // echo $this->input->post('total_price');exit();\n if ($response->approved != '') {\n $product_id = $this->input->post('booking_rental_id');\n $product = $this->checkout_model->get_all_details(PRODUCT, array('id' => $product_id));\n $totalAmnt = $this->input->post('total_price');\n $enquiryid = $this->input->post('enquiryid');\n $loginUserId = $this->checkLogin('U');\n // echo $totalAmnt;exit();\n if ($this->session->userdata('randomNo') != '') {\n $delete = 'delete from ' . PAYMENT . ' where dealCodeNumber = \"' . $this->session->userdata('randomNo') . '\" and user_id = \"' . $loginUserId . '\" ';\n $this->checkout_model->ExecuteQuery($delete, 'delete');\n $dealCodeNumber = $this->session->userdata('randomNo');\n } else {\n $dealCodeNumber = mt_rand();\t\n }\n $insertIds = array();\n $now = date(\"Y-m-d H:i:s\");\n $paymentArr = array('product_id' => $product_id, 'sell_id' => $product->row()->user_id, 'price' => $totalAmnt, 'indtotal' => $product->row()->price, 'sumtotal' => $totalAmnt, 'user_id' => $loginUserId, 'created' => $now, 'dealCodeNumber' => $dealCodeNumber, 'status' => 'Paid', 'shipping_status' => 'Pending', 'total' => $totalAmnt, 'EnquiryId' => $enquiryid, 'inserttime' => NOW(), 'currency_code' => $user_currencycode);\n /* referal user commission payment starts */\n $referred_user = $this->checkout_model->get_all_details(USERS, array('id' => $loginUserId));\n $refered_user = $referred_user->row()->referId;\n $user_booked = $this->checkout_model->get_all_details(PAYMENT, array('user_id' => $loginUserId, 'status' => 'Paid'));\n if ($user_booked->num_rows() == 0) {\n $totalAmount = $totalAmnt;\n $currencyCode = $currency_code;\n $book_commission_query = 'SELECT * FROM ' . INVITE . ' WHERE email = \"'.$userDetails->row()->email.'\"';\n $book_commission = $this->checkout_model->ExecuteQuery($book_commission_query);\n if ($book_commission->num_rows() > 0) {\n // if ($book_commission->row()->promotion_type == 'flat') {\n // $referal_commission = round($totalAmount - $book_commission->row()->commission_percentage, 2);\n // } else {\n // $commission = round(($book_commission->row()->commission_percentage / 100), 2);\n // $referal_commission = ($totalAmount * $commission);\n // }\n $commission = round(($book_commission->row()->commission_persent / 100), 2);\n $referal_commission = ($totalAmount * $commission);\n if ($currencyCode != 'USD') {\n // ,$this->input->post('currency_cron_id')\n $referal_commission = convertCurrency($currencyCode, 'USD', $referal_commission);\n }\n $referred_userData = $this->checkout_model->get_all_details(USERS, array('id' => $refered_user));\n $existAmount = $referred_userData->row()->referalAmount;\n $exit_totalReferalAmount = $referred_userData->row()->totalReferalAmount;\n $existAmountCurrenctCode = $referred_userData->row()->referalAmount_currency;\n if ($existAmountCurrenctCode != 'USD') {\n $existAmount = convertCurrency($existAmountCurrenctCode, 'USD', $existAmount);\n $exit_totalReferalAmount = convertCurrency($existAmountCurrenctCode, 'USD', $exit_totalReferalAmount);\n }\n $tot_commission = $existAmount + $referal_commission;\n $new_totalReferalAmount = $exit_totalReferalAmount + $referal_commission;\n $inputArr_ref = array('totalReferalAmount' => $new_totalReferalAmount, 'referalAmount' => $tot_commission, 'referalAmount_currency' => 'USD');\n $this->checkout_model->update_details(USERS, $inputArr_ref, array('id' => $refered_user));\n }\n }\n $this->checkout_model->simple_insert(PAYMENT, $paymentArr);\n $insertIds[] = $this->db->insert_id();\n $paymtdata = array('randomNo' => $dealCodeNumber, 'randomIds' => $insertIds);\n $this->session->set_userdata($paymtdata, $currency_code);\n $this->product_model->edit_rentalbooking(array('booking_status' => 'Booked'), array('id' => $enquiryid));\n $lastFeatureInsertId = $this->session->userdata('randomNo');\n\t\t\t\t\t\n redirect('order/success/' . $loginUserId . '/' . $lastFeatureInsertId . '/' . $response->transaction_id);\n } else {\n // echo $this->input->post('total_price');exit();\n $this->session->set_userdata('payment_error', $response->response_reason_text);\n redirect('order/failure');\n }\n }\n }",
"public function process()\n {\n $oService = Phpfox::getService('opensocialconnect');\n\n if ($aVals = $this->request()->get('val'))\n {\n if ($this->request()->get('synchronize') == Phpfox::getPhrase('opensocialconnect.synchronize'))\n {\n $sService = $aVals['service'];\n\n if (!isset($_SESSION['quick_signup'][$sService]))\n {\n $this->url()->send('');\n }\n else\n {\n $aData = $oService->getSignupSessionData($sService);\n }\n\n $aService = Phpfox::getService('opensocialconnect.providers')->getProvider($sService);\n\n $aVals['service_id'] = $aService['service_id'];\n\n $iId = $aVals['user_id'];\n\n Phpfox::getService('opensocialconnect')->addAgent($iId, $aVals);\n Phpfox::getService('opensocialconnect.providers')->updateStatistics($sService, 'sync');\n\n $aExistUser = $oService->getUserByIdentityAndService($aVals['identity'], $sService, $aVals['service_id']);\n\n $bLogin = false;\n\n if (isset($aExistUser['email']) && $aExistUser['email'] != \"\")\n {\n list($bLogin, $aUser) = $oService->loginByEmail($aExistUser['email']);\n\n if (Phpfox::isModule('socialbridge'))\n {\n if (($sService == 'facebook'))\n {\n $aToken = Phpfox::getService('socialbridge.libs')->getFBAccessToken();\n $aExtra = $_SESSION['quick_signup'][$sService]['user'];\n Phpfox::getService('socialbridge.agents')->addToken($iId, $sService, $aToken, $aExtra);\n Phpfox::getService('opensocialconnect')->updateBridgeToken($iId, $sService);\n }\n\n if ($sService == 'linkedin' || $sService == 'twitter')\n {\n list($aToken, $aExtra) = Phpfox::getService('socialbridge.provider.twitter')->getTokenData();\n Phpfox::getService('socialbridge.agents')->addToken($iId, $sService, $aToken, $aExtra);\n Phpfox::getService('opensocialconnect')->updateBridgeToken($iId, $sService);\n }\n }\n }\n\n Phpfox::getService('opensocialconnect')->clearSignupSessionData();\n\n if ($bLogin)\n {\n if (is_array($iId))\n {\n (($sPlugin = Phpfox_Plugin::get('user.component_controller_register_3')) ? eval($sPlugin) : false);\n $this->url()->forward($iId[0]);\n }\n else\n {\n $sRedirect = Phpfox::getParam('user.redirect_after_signup');\n if (!empty($sRedirect))\n {\n (($sPlugin = Phpfox_Plugin::get('user.component_controller_register_4')) ? eval($sPlugin) : false);\n $this->url()->send($sRedirect);\n }\n if (Phpfox::getParam('user.multi_step_registration_form') && is_array(Phpfox::getParam('user.registration_steps')) && count(Phpfox::getParam('user.registration_steps')))\n {\n $aUrls = Phpfox::getParam('user.registration_steps');\n\n (($sPlugin = Phpfox_Plugin::get('user.component_controller_register_5')) ? eval($sPlugin) : false);\n $this->url()->send($aUrls[0], 'register');\n }\n else\n {\n (($sPlugin = Phpfox_Plugin::get('user.component_controller_register_6')) ? eval($sPlugin) : false);\n $this->url()->send('');\n }\n }\n }\n }\n if ($this->request()->get('cancel') == Phpfox::getPhrase('core.no'))\n {\n $sUrlRedirect = $this->url()->makeUrl('opensocialconnect.quicksignup', array('service' => $aVals['service'], 'syns' => 'no'));\n $this->url()->send($sUrlRedirect);\n }\n }\n }",
"function do_personal()\r\n\t{\r\n\r\n\t\t$this->lib->do_profile();\r\n\r\n\t}",
"function OnProcess() {\n\n $this->login = $this->Request->ToString(\"login\", \"\", 1, 32);\n $this->password = $this->Request->ToString(\"password\", \"\", 1, 32);\n $this->packagefrom = $this->Request->ToString(\"frompackage\", \"\");\n $this->former_query = $this->Request->ToString(\"query\", \"\");\n\n $UsersTable = new UsersTable($this->Kernel->Connection, $this->Kernel->Settings->GetItem(\"Authorization\", \"AuthorizeTable\"));\n //die(pr($UsersTable));\n $data = $UsersTable->GetByFields(array($this->Kernel->Settings->GetItem(\"Authorization\", \"FLD_login\") => $this->login));\n\n if (!count($data) || $data[\"active\"]==0) {\n $this->AddErrorMessage(\"UserLogonPage\", \"INVALID_LOGIN\");\n return;\n }\n\n $_pass = $data[$this->Kernel->Settings->GetItem(\"Authorization\", \"FLD_password\")];\n if($this->Kernel->Settings->GetItem(\"Authorization\", \"FLG_MD5_PASSWORD\")) {\n $this->password = md5($this->password);\n }\n\n if($_pass != $this->password){\n $this->AddErrorMessage(\"UserLogonPage\", \"INVALID_PASSWORD\");\n return;\n }\n\n if(!$this->Kernel->Settings->GetItem(\"Authorization\", \"FLG_MD5_PASSWORD\")) {\n $this->password = md5($this->password);\n }\n\n $this->Session = new ControlSession($this, $CookieName);\n session_start();\n $login_var = $this->Kernel->Settings->GetItem(\"Authorization\", \"SESSION_Var_Login\");\n $password_var = $this->Kernel->Settings->GetItem(\"Authorization\", \"SESSION_Var_Password\");\n\n $GLOBALS[$login_var] = $this->login;\n $GLOBALS[$password_var] = $this->password;\n\n $this->Session->Set($this->Kernel->Settings->GetItem(\"Authorization\", \"SESSION_Var_Login\"), $this->login);\n $this->Session->Set($this->Kernel->Settings->GetItem(\"Authorization\", \"SESSION_Var_Password\"), $this->password);\n $this->Session->Set($this->Kernel->Settings->GetItem(\"Authorization\", \"SESSION_Var_UserId\"), $data[$this->Kernel->Settings->GetItem(\"Authorization\", \"FLD_user_id\")]);\n\n if (strlen($this->camefrom)) {\n $this->Response->Redirect($this->Kernel->Settings->GetItem(\"MODULE\",\"SiteURL\").$this->camefrom);\n } else {\n $this->Auth->DefaultRedirect(\"Frontend\");\n }\n }",
"public function principal()\n\t {\n\t\t require_once('../../site_media/html/asignar_cursos/ac_Admin.php');\n\t }",
"public function parseResults($affiliates)\n {\n\n }",
"public function addAC($data){\n $advisory = new Advisory_Council;\n $advisory->fname = $data['fname'];\n\t \t$advisory->lname = $data['lname'];\n\t \t$advisory->mname = $data['mname'];\n\t \t$advisory->qualifier = $data['qname'];\n\t \t$advisory->gender = $data['gender'];\n\t \t$advisory->contactno = $data['mobile'];\n\t \t$advisory->landline = $data['landline'];\n\t \t$advisory->officename = $data['officename'];\n $advisory->officeaddress = $data['officeadd'];\n\t \t$advisory->email = $data['email'];\n\n\t \tif($data['durstart'] != \"\") {\n\t \t\t$advisory->startdate = $data['durstart'];\n\n\t \t}//if\n\t\tif($data['bdate'] != \"\") {\n\t \t\t$advisory->birthdate = $data['bdate'];\n\n\t \t}//if\n\n\t \t$advisory->fbuser = $data['facebook'];\n\t \t$advisory->twitteruser = $data['twitter'];\n\t \t$advisory->iguser = $data['instagram'];\n\n\t \t\n\n\t \t$advisory->street = $data['street'];\n\t \t$advisory->city = $data['city'];\n\t \t$advisory->province = $data['province'];\n\t \t$advisory->barangay = $data['barangay'];\n\n\n\t \tif($data['upphoto'] != \"\") {\n\t \t\t$advisory->imagepath = $this->loadphoto($data['upphoto']);\n\n\t \t}//if\n\n $advisory->advisory_position_id = $data['acposition'];\n $advisory->ac_sector_id = $data['acsector'];\n\n \t$advisory->second_id = $data['secondary'];\n\n\t if($data['tertiary'] != 'disitem') {\n\t \t$advisory->tertiary_id = $data['tertiary'];\n\t }//if\n\n\t if($data['quaternary'] != 'disitem') {\n\t \t$advisory->quaternary_id = $data['quaternary'];\n\t }//if\n\n $advisory->save();\n }",
"public function IngresarAplicacion(){}",
"public function execute()\r\n {\r\n $helper = $this->_objectManager->create('Lof\\Affiliate\\Helper\\Data');\r\n if($helper->getConfig('general_settings/enable')) {\r\n $trackcode_route = $helper->getTrackingCodeRoute();\r\n if($this->getRequest()->getParam($trackcode_route)){\r\n $customerSession = $this->_objectManager->get('\\Magento\\Catalog\\Model\\Session');\r\n $customerSession->setTrackingCode($this->getRequest()->getParam($trackcode_route)); \r\n } \r\n }\r\n \r\n return parent::execute();\r\n }",
"public function processRegistrationForm() {\n\t\t\tprocessForm($this->registrationForm);\n\t\t\t$this->validateRegistrationForm();\n\t\t\tif (empty($this->errorMsgs)) {\n\t\t\t\t$this->insertNewAffiliate();\n\t\t\t}\n\t\t}",
"protected function processPayment() {\n\t\t$this->renderResponse( $this->adapter->doPayment() );\n\t}",
"protected function processPayment() {\n\t\t$this->renderResponse( $this->adapter->doPayment() );\n\t}",
"function updateAffiliateBanner($oAffiliate)\n\t\t{\n\t\t\t$query= \"update tbl_affiliate set banner ='\".$oAffiliate->organisation_banner.\"' \n\t\t\t where affiliate_id = $oAffiliate->affiliate_id\";\n\t\t\t\n\t\t\t$rs = $this->Execute($query);\n\t\t\treturn $rs;\n\t\t}",
"function sixscan_installation_account_setup_required_notice() {\r\n\tif ( ( sixscan_common_is_oracle_verified() == FALSE ) && ( $_GET[ 'page' ] != SIXSCAN_COMMON_DASHBOARD_URL ) ){\t\t\t\r\n\t\t\techo '<div class=\"updated\" style=\"text-align: center;\"><p><p>6Scan: In order to enable protection, please <a href=\"admin.php?page=' . \r\n\t\t\tSIXSCAN_COMMON_DASHBOARD_URL . '&account_setup=1\">create your account</a> now.</p></p></div>';\t\t\r\n\t\t}\r\n}",
"function affwp_show_program_in_affiliate_dashboard( $affiliate_id, $affiliate_user_id ) {\n\n\t$program = affwp_get_affiliate_meta( $affiliate_id, 'program', true );\n\n\t?>\n\n\t<div class=\"affwp-wrap affwp-program-wrap\">\n\t\t<label for=\"affwp-program\"><?php _e( 'Affiliate Program Type', 'affiliate-wp' ); ?></label>\n\t\t<input id=\"affwp-program\" type=\"text\" name=\"program\" value=\"<?php echo esc_attr( $program ); ?>\" />\n\t</div>\n\n\t<?php\n\n}",
"function can_process() {\t\n\n\tif ($_POST['expd_percentage_amt'] == \"\"){\n\t\tdisplay_error(trans(\"You need to provide the maximum monthly pay limit percentage for employee loan.\"));\n\t\tset_focus('expd_percentage_amt');\n\t\treturn false;\n\t} \n\tif (!check_num('expd_percentage_amt'))\t{\n\t\tdisplay_error(trans(\"Maximum EMI Limit should be a positive number\"));\n\t\tset_focus('login_tout');\n\t\treturn false;\n\t}\n\tif (!check_num('ot_factor'))\t{\n\t\tdisplay_error(trans(\"OT Multiplication Factor should be a positive number\"));\n\t\tset_focus('ot_factor');\n\t\treturn false;\n\t}\n\tif($_POST['monthly_choice'] == 1 && ( $_POST['BeginDay'] != 1 || $_POST['EndDay'] != 31 )) {\n\t\tdisplay_error(trans(\"For Current Month the Begin Date should be 1 and end date should be 31.\"));\n\t\tset_focus('BeginDay');\n\t\tset_focus('EndDay');\n\t\treturn false;\n\t}\n\t\t\n\tif (strlen($_POST['salary_account']) > 0 || strlen($_POST['paid_from_account']) > 0) {\n\t\tif (strlen($_POST['salary_account']) == 0 && strlen($_POST['paid_from_account']) > 0) {\n\t\t\tdisplay_error(trans(\"The Net Pay Debit Code cannot be empty.\"));\n\t\t\tset_focus('salary_account');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (strlen($_POST['salary_account']) > 0 && strlen($_POST['paid_from_account']) == 0 ) {\n\t\t\tdisplay_error(trans(\"The Net Pay Credit Code cannot be empty.\"));\n\t\t\tset_focus('paid_from_account');\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\tif (strlen($_POST['travel_debit']) > 0 || strlen($_POST['travel_credit']) > 0) {\n\t\tif (strlen($_POST['travel_debit']) == 0 && strlen($_POST['travel_credit']) > 0) {\n\t\t\tdisplay_error(trans(\"The Travel Debit Code cannot be empty.\"));\n\t\t\tset_focus('travel_debit');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (strlen($_POST['travel_debit']) > 0 && strlen($_POST['travel_credit']) == 0 ) {\n\t\t\tdisplay_error(trans(\"The Travel Credit Code cannot be empty.\"));\n\t\t\tset_focus('travel_credit');\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\tif (strlen($_POST['petrol_debit']) > 0 || strlen($_POST['petrol_credit']) > 0) {\n\t\tif (strlen($_POST['petrol_debit']) == 0 && strlen($_POST['petrol_credit']) > 0) {\n\t\t\tdisplay_error(trans(\"The Petrol Debit Code cannot be empty.\"));\n\t\t\tset_focus('petrol_debit');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (strlen($_POST['petrol_debit']) > 0 && strlen($_POST['petrol_credit']) == 0 ) {\n\t\t\tdisplay_error(trans(\"The Petrol Credit Code cannot be empty.\"));\n\t\t\tset_focus('petrol_credit');\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\tif (strlen($_POST['debit_encashment']) > 0 || strlen($_POST['credit_encashment']) > 0) {\n\t\tif (strlen($_POST['debit_encashment']) == 0 && strlen($_POST['credit_encashment']) > 0) {\n\t\t\tdisplay_error(trans(\"The Encashment Debit Code cannot be empty.\"));\n\t\t\tset_focus('debit_encashment');\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\tif (strlen($_POST['debit_encashment']) > 0 && strlen($_POST['credit_encashment']) == 0 ) {\n\t\t\tdisplay_error(trans(\"The Encashment Credit Code cannot be empty.\"));\n\t\t\tset_focus('credit_encashment');\n\t\t\treturn false;\n\t\t}\n\t}\n\t\n\treturn true;\t\n}",
"public function job_app_process()\n\t{\n\t\t// Because the loads a page we dont need to return anything\n\t\t$this->EE->job_applications->job_app_process();\n\t}",
"function Eternizer_user_main($args) {\n $tpl = FormUtil::getPassedValue('tpl', $args['tpl'], 'G');\n if (!SecurityUtil::checkPermission('Eternizer::', '::', ACCESS_READ)) {\n return LogUtil::registerPermissionError();\n }\n\n $dom = ZLanguage::getModuleDomain('Eternizer');\n\n $startnum = FormUtil::getPassedValue('startnum', $args['startnum'], 'G');\n $perpage = FormUtil::getPassedValue('perpage', $args['perpage'], 'G');\n\n $config = pnModGetVar('Eternizer');\n if (!empty($perpage))\n $config['perpage'] = $perpage;\n\n $entries = pnModAPIFunc('Eternizer', 'user', 'GetEntries', array('startnum' => $startnum-1, 'perpage' => $perpage));\n\n $pnRender = pnRender::getInstance('Eternizer', false, null, true);\n\n $count = pnModAPIFunc('Eternizer', 'user', 'CountEntries');\n\n $pnRender->assign('startnum', $startnum);\n $pnRender->assign('count', $count);\n $pnRender->assign('config', $config);\n\n $entryhtml = array();\n foreach (array_keys($entries) as $k) {\n $act =& $entries[$k];\n $act = DataUtil::formatForDisplayHTML($act);\n $act['text'] = Eternizer_WWAction($act['text']);\n $act['text'] = nl2br($act['text']);\n $act['comment'] = nl2br($act['comment']);\n list($act['text']) = pnModCallHooks('item', 'transform', '', array($act['text']));\n list($act['comment']) = pnModCallHooks('item', 'transform', '', array($act['comment']));\n\n $act['right_moderate'] = SecurityUtil::checkPermission('Eternizer::', $act['id'] . '::', ACCESS_MODERATE);\n $act['right_edit'] = SecurityUtil::checkPermission('Eternizer::', $act['id'] . '::', ACCESS_EDIT);\n $act['right_delete'] = SecurityUtil::checkPermission('Eternizer::', $act['id'] . '::', ACCESS_DELETE);\n\n $profile = array();\n foreach (array_keys($config['profile']) as $pk) {\n $profile[$pk] = $act['profile'][$pk];\n }\n\n $act['profile'] = $profile;\n $act['avatarpath'] = pnModGetVar('Users', 'avatarpath');\n\n $pnRender->assign($act);\n if (!empty($tpl) && $pnRender->template_exists('Eternizer_user_'. DataUtil::formatForOS($tpl) .'_entry.tpl')) {\n $entryhtml[] = $pnRender->fetch('Eternizer_user_'. DataUtil::formatForOS($tpl) . '_entry.tpl');\n }\n else {\n $entryhtml[] = $pnRender->fetch('Eternizer_user_entry.tpl');\n }\n }\n\n $pnRender->assign('entries', $entryhtml);\n $pnRender->assign('entryarray', $entries);\n\n $form = pnModFunc('Eternizer', 'user', 'new', array( 'inline' => true));\n $pnRender->assign('form', $form===false?'':$form );\n\n if (!empty($tpl) && $pnRender->template_exists('Eternizer_user_'. DataUtil::formatForOS($tpl) .'_main.tpl')) {\n return $pnRender->fetch('Eternizer_user_'. DataUtil::formatForOS($tpl).'_main.tpl');\n }\n else {\n return $pnRender->fetch('Eternizer_user_main.tpl');\n }\n}",
"public function Execute()\n {\n # ====================================================================================\n # <> YES - just execute the free credits form on that wh_id\n # <> NO - display form asking admin to identify person\n # ====================================================================================\n if ($this->Wh_Id == 0) {\n $this->ShowCustomerSelect();\n } else {\n \n # determine if record is inactive\n # =================================================================================\n $OBJ_CONTACTS = new Profile_CustomerProfileContacts();\n $record = $OBJ_CONTACTS->ListRecordSpecial($this->Wh_Id, true);\n if (!$record) {\n echo '<h3>NOTE: This account has been de-activated so you cannot give free credits.';\n } else {\n $code = GenerateCode(6);\n $this->Default_Values = array(\n 'wh_id' => $this->Wh_Id,\n 'type' => 'Free',\n 'order_id' => 'F-666',\n 'admin_wh_id' => $_SESSION['USER_LOGIN']['LOGIN_RECORD']['wh_id'],\n 'email_contents' => 'You have been given free credits.',\n 'email_send' => 1,\n );\n $this->AddRecord();\n }\n }\n }",
"public function show(accreditation $accreditation)\n {\n //\n }",
"function process($action)\r\n{\r\n\r\n\tif ($action == \"actualizar\")\r\n\t{\r\n\t\t//arreglo para captura de datos\r\n\t\t$cap = array();\r\n\t\t\r\n\t\t//arreglo para validaciones\r\n\t\t$val = array();\r\n\t\t\r\n\t\t$val[0] = validarChar(trim($cap[0] = trim($_POST['txtCorreo']))); //Correo\r\n\t\t$val[1] = validarChar(trim($cap[1] = strtoupper($_POST['txtNombre']))); //Nombre\r\n\t\t$val[2] = validarChar(trim($cap[2] = strtoupper($_POST['txtPaterno']))); //Apellido Paterno\r\n\t\t$val[3] = validarChar(trim($cap[3] = strtoupper($_POST['txtMaterno']))); //Apellido Materno \r\n\t\t$val[4] = validarChar(trim($cap[4] = strtoupper($_POST['txtTelefono'])));\t//Telefono\r\n\t\t$val[5] = validarChar(trim($cap[5] = (trim(strtoupper($_POST['txtCalle'])) . \",\" . trim(strtoupper($_POST['txtColonia'])) . \",\" . trim(strtoupper($_POST['txtCiudad']))))); //Direccion\r\n\t\t\r\n\t\tif(validacionGeneral($val) == FALSE)\r\n\t\t{\r\n\t\t\tif(validarCorreo($cap[0]) == TRUE)\r\n\t\t\t{\r\n\t\t\t\tif(actionUpdateUser($cap) > 0)\r\n\t\t\t\t\tmessage(\"Datos actualizados correctamente\", \"../control/redirect.php\");\r\n\t\t\t\telse \r\n\t\t\t\t\tmessage(\"Sus datos no se pudieron actualizar\", \"../control/redirect.php\");\r\n\t\t\t}\r\n\t\t\telse \r\n\t\t\t\tmessage(\"El correo NO es Valido\", \"../control/redirect.php\");\r\n\t\t}\r\n\t\telse \r\n\t\t\tmessage(\"Datos Corruptos\", \"../control/redirect.php\");\r\n\t}\r\n\telse \r\n\t{\r\n\t\tif ($action == \"registroCita\")\r\n\t\t\tmessage(\"\", \"../acount/appointmentRecord.php\");\r\n\t\telse\r\n\t\t{\r\n\t\t\tif ($action == \"consultaCita\")\r\n\t\t\t{\r\n\t\t\t\tmessage(\"\", \"../acount/consultAppointment.php\");\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif($action == \"cambioContrasena\")\r\n\t\t\t\t{\r\n\t\t\t\t\tmessage(\"\", \"../acount/changePass.php\");\r\n\t\t\t\t}\r\n\t\t\t\telse \r\n\t\t\t\t\tmessage('Accion Desconocida Intente de nuevo\\\\nSi el problema persiste Intentelo mas tarde', '../control/redirect.php');\r\n\t\t\t}\r\n\t\t}\r\n\t}\t\r\n}",
"function adrotate_advertiser() {\n\tglobal $wpdb, $adrotate_config, $adrotate_debug;\n\t\t\n\t$current_user = wp_get_current_user();\n\n\t$status = $view = $ad_edit_id = $filename = $request = $request_id = '';\n\tif(isset($_GET['status'])) $status = esc_attr($_GET['status']);\n\tif(isset($_GET['view'])) $view = esc_attr($_GET['view']);\n\tif(isset($_GET['ad'])) $ad_edit_id = esc_attr($_GET['ad']);\n\tif(isset($_GET['file'])) $filename = esc_attr($_GET['file']);\n\tif(isset($_GET['request'])) $request = esc_attr($_GET['request']);\n\tif(isset($_GET['id'])) $request_id = esc_attr($_GET['id']);\n\n\t$now \t\t\t= adrotate_now();\n\t$today \t\t\t= adrotate_date_start('day');\n\t$in2days \t\t= $now + 172800;\n\t$in7days \t\t= $now + 604800;\n\t$in84days \t\t= $now + 7257600;\n\n\tif(isset($_GET['month']) AND isset($_GET['year'])) {\n\t\t$month = esc_attr($_GET['month']);\n\t\t$year = esc_attr($_GET['year']);\n\t} else {\n\t\t$month = date(\"m\");\n\t\t$year = date(\"Y\");\n\t}\n\t$monthstart = mktime(0, 0, 0, $month, 1, $year);\n\t$monthend = mktime(0, 0, 0, $month+1, 0, $year);\t\n\t?>\n\t<div class=\"wrap\">\n\t \t<h1><?php _e('Advertiser', 'adrotate-pro'); ?></h1>\n\n\t\t<?php if($status > 0) adrotate_status($status, array('file' => $filename)); ?>\n\n\t\t<div class=\"tablenav\">\n\t\t\t<div class=\"alignleft actions\">\n\t\t\t\t<a class=\"row-title\" href=\"<?php echo admin_url('/admin.php?page=adrotate-advertiser');?>\"><?php _e('Manage', 'adrotate-pro'); ?></a>\n\t\t\t\t<?php if($adrotate_config['enable_editing'] == 'Y') { ?>\n\t\t\t\t | <a class=\"row-title\" href=\"<?php echo admin_url('/admin.php?page=adrotate-advertiser&view=addnew');?>\"><?php _e('Add New', 'adrotate-pro'); ?></a> \n\t\t\t\t<?php } ?>\n\t\t\t</div>\n\t\t</div>\n\n\t\t<?php \n\t\tif($view == \"\") {\n\n\t\t\t$ads = $wpdb->get_results($wpdb->prepare(\"SELECT `ad` FROM `{$wpdb->prefix}adrotate_linkmeta` WHERE `group` = 0 AND `user` = '%d' ORDER BY `ad` ASC;\", $current_user->ID));\n\n\t\t\tif($ads) {\n\t\t\t\t$activebanners = $queuebanners = $disabledbanners = false;\n\t\t\t\tforeach($ads as $ad) {\n\t\t\t\t\t$banner = $wpdb->get_row(\"SELECT `id`, `title`, `type`, `desktop`, `mobile`, `tablet`, `budget`, `crate`, `irate` FROM `{$wpdb->prefix}adrotate` WHERE (`type` = 'active' OR `type` = '2days' OR `type` = '7days' OR `type` = 'disabled' OR `type` = 'error' OR `type` = 'a_error' OR `type` = 'expired' OR `type` = 'queue' OR `type` = 'reject') AND `id` = '{$ad->ad}';\");\n\n\t\t\t\t\t// Skip if no ad\n\t\t\t\t\tif(!$banner) continue;\n\t\t\t\t\t\n\t\t\t\t\t$starttime = $stoptime = 0;\n\t\t\t\t\t$starttime = $wpdb->get_var(\"SELECT `starttime` FROM `{$wpdb->prefix}adrotate_schedule`, `{$wpdb->prefix}adrotate_linkmeta` WHERE `ad` = '{$banner->id}' AND `schedule` = `{$wpdb->prefix}adrotate_schedule`.`id` ORDER BY `starttime` ASC LIMIT 1;\");\n\t\t\t\t\t$stoptime = $wpdb->get_var(\"SELECT `stoptime` FROM `{$wpdb->prefix}adrotate_schedule`, `{$wpdb->prefix}adrotate_linkmeta` WHERE `ad` = '{$banner->id}' AND `schedule` = `{$wpdb->prefix}adrotate_schedule`.`id` ORDER BY `stoptime` DESC LIMIT 1;\");\n\t\n\t\t\t\t\t$type = $banner->type;\n\t\t\t\t\tif($type == 'active' AND $stoptime <= $now) $type = 'expired'; \n\t\t\t\t\tif($type == 'active' AND $stoptime <= $in2days) $type = '2days';\n\t\t\t\t\tif($type == 'active' AND $stoptime <= $in7days) $type = '7days';\n\n\t\t\t\t\tif($type == 'active' OR $type == '2days' OR $type == '7days' OR $type == 'expired') {\n\t\t\t\t\t\t$activebanners[$banner->id] = array(\n\t\t\t\t\t\t\t'id' => $banner->id,\n\t\t\t\t\t\t\t'title' => $banner->title,\n\t\t\t\t\t\t\t'type' => $type,\n\t\t\t\t\t\t\t'desktop' => $banner->desktop,\n\t\t\t\t\t\t\t'mobile' => $banner->mobile,\n\t\t\t\t\t\t\t'tablet' => $banner->tablet,\n\t\t\t\t\t\t\t'firstactive' => $starttime,\n\t\t\t\t\t\t\t'lastactive' => $stoptime,\n\t\t\t\t\t\t\t'budget' => $banner->budget,\n\t\t\t\t\t\t\t'crate' => $banner->crate,\n\t\t\t\t\t\t\t'irate' => $banner->irate\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\n\t\t\t\t\tif($type == 'disabled') {\n\t\t\t\t\t\t$disabledbanners[$banner->id] = array(\n\t\t\t\t\t\t\t'id' => $banner->id,\n\t\t\t\t\t\t\t'title' => $banner->title,\n\t\t\t\t\t\t\t'type' => $type\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\n\t\t\t\t\tif($type == 'queue' OR $type == 'reject' OR $type == 'error' OR $type == 'a_error') {\n\t\t\t\t\t\t$queuebanners[$banner->id] = array(\n\t\t\t\t\t\t\t'id' => $banner->id,\n\t\t\t\t\t\t\t'title' => $banner->title,\n\t\t\t\t\t\t\t'type' => $type,\n\t\t\t\t\t\t\t'desktop' => $banner->desktop,\n\t\t\t\t\t\t\t'mobile' => $banner->mobile,\n\t\t\t\t\t\t\t'tablet' => $banner->tablet,\n\t\t\t\t\t\t\t'budget' => $banner->budget,\n\t\t\t\t\t\t\t'crate' => $banner->crate,\n\t\t\t\t\t\t\t'irate' => $banner->irate\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// Show active ads, if any\n\t\t\t\tif($activebanners) {\n\t\t\t\t\tinclude(\"dashboard/advertiser/main.php\");\n\t\t\t\t}\n\n\t\t\t\t// Show disabled ads, if any\n\t\t\t\tif($disabledbanners) {\n\t\t\t\t\tinclude(\"dashboard/advertiser/main-disabled.php\");\n\t\t\t\t}\n\n\t\t\t\t// Show queued ads, if any\n\t\t\t\tif($queuebanners) {\n\t\t\t\t\tinclude(\"dashboard/advertiser/main-queue.php\");\n\t\t\t\t}\n\n\t\t\t\tif($adrotate_config['stats'] == 1) {\n\t\t\t\t\t// Gather data for summary report\n\t\t\t\t\t$stats = adrotate_prepare_advertiser_report($current_user->ID, $activebanners);\n\t\t\t\t\t$stats_graph_month = $wpdb->get_results($wpdb->prepare(\"SELECT SUM(`clicks`) as `clicks`, SUM(`impressions`) as `impressions` FROM `{$wpdb->prefix}adrotate_stats`, `{$wpdb->prefix}adrotate_linkmeta` WHERE `{$wpdb->prefix}adrotate_stats`.`ad` = `{$wpdb->prefix}adrotate_linkmeta`.`ad` AND `{$wpdb->prefix}adrotate_linkmeta`.`user` = '%d' AND `{$wpdb->prefix}adrotate_stats`.`thetime` >= '%d' AND `{$wpdb->prefix}adrotate_stats`.`thetime` <= '%d' GROUP BY `thetime` ASC;\", $current_user->ID, $monthstart, $monthend), ARRAY_A);\n\t\t\n\t\t\t\t\t// Prevent gaps in display\n\t\t\t\t\tif(empty($stats['ad_amount'])) $stats['ad_amount'] = 0;\n\t\t\t\t\tif(empty($stats['thebest'])) $stats['thebest'] = 0;\n\t\t\t\t\tif(empty($stats['theworst'])) $stats['theworst'] = 0;\n\t\t\t\t\tif(empty($stats['total_impressions'])) $stats['total_impressions'] = 0;\n\t\t\t\t\tif(empty($stats['total_clicks'])) $stats['total_clicks'] = 0;\n\t\t\t\t\tif(empty($stats_graph_month['impressions'])) $stats_graph_month['impressions'] = 0;\n\t\t\t\t\tif(empty($stats_graph_month['clicks'])) $stats_graph_month['clicks'] = 0;\n\n\t\t\t\t\t// Get Click Through Rate\n\t\t\t\t\t$ctr = adrotate_ctr($stats['total_clicks'], $stats['total_impressions']);\n\t\t\t\t\t$ctr_graph_month = adrotate_ctr($stats_graph_month['clicks'], $stats_graph_month['impressions']);\n\t\t\n\t\t\t\t\tinclude(\"dashboard/advertiser/main-summary.php\");\n\t\t\t\t}\n\n\t\t\t} else {\n\t\t\t\t?>\n\t\t\t\t<table class=\"widefat\" style=\"margin-top: .5em\">\n\t\t\t\t\t<thead>\n\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t<th><?php _e('Notice', 'adrotate-pro'); ?></th>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</thead>\n\t\t\t\t\t<tbody>\n\t\t\t\t\t <tr>\n\t\t\t\t\t\t\t<td><?php _e('No ads for user.', 'adrotate-pro'); ?></td>\n\t\t\t\t\t\t</tr>\n\t\t\t\t\t</tbody>\n\t\t\t\t</table>\n\t\t\t\t<?php\n\t\t\t}\n\t\t} else if($view == \"addnew\" OR $view == \"edit\") { \n\n\t\t\tinclude(\"dashboard/advertiser/edit.php\");\n\n\t\t} else if($view == \"report\") { \n\n\t\t\tinclude(\"dashboard/advertiser/report.php\");\n\n\t\t} else if($view == \"message\") {\n\n\t\t\tif(wp_verify_nonce($_REQUEST['_wpnonce'], 'adrotate_email_advertiser')) {\n\t\t\t\tinclude(\"dashboard/advertiser/message.php\");\n\t\t\t} else {\n\t\t\t\tadrotate_nonce_error();\n\t\t\t\texit;\n\t\t\t}\n\n\t\t}\n\t\t?>\n\t\t<br class=\"clear\" />\n\n\t\t<?php adrotate_user_notice(); ?>\n\n\t</div>\n<?php \n}",
"public function pro_ad_click_action()\n\t{\n\t\tglobal $wpdb, $pro_ads_main, $pro_ads_browser, $pro_ads_statistics;\n\t\t\n\t\tif( isset( $_GET['pasID'] ) && !empty( $_GET['pasID'] ) )\n\t\t{\n\t\t\t$banner_id = base64_decode($_GET['pasID']);\n\t\t\t$adzone_id = isset($_GET['pasZONE']) && !empty($_GET['pasZONE']) ? base64_decode($_GET['pasZONE']) : '';\n\t\t\t\n\t\t\t$banner_link = get_post_meta( $banner_id, 'banner_link', true );\n\t\t\t\n\t\t\t$pro_ads_statistics->save_clicks( $banner_id, $adzone_id );\n\t\t\t\n\t\t\theader('Location: '. $banner_link);\n\t\t\texit;\n\t\t}\n\t}",
"function authorizeCreditCard($amount,$fname,$lname,$email,$shipping_address,$city,$province)\n{\n $merchantAuthentication = new AnetAPI\\MerchantAuthenticationType();\n $merchantAuthentication->setName(\\SampleCodeConstants::MERCHANT_LOGIN_ID);\n $merchantAuthentication->setTransactionKey(\\SampleCodeConstants::MERCHANT_TRANSACTION_KEY);\n\n // Set the transaction's refId\n $refId = 'ref' . time();\n\n // Create the payment data for a credit card\n $creditCard = new AnetAPI\\CreditCardType();\n $creditCard->setCardNumber(\"4111111111111111\");\n $creditCard->setExpirationDate(\"2038-12\");\n $creditCard->setCardCode(\"123\");\n\n // Add the payment data to a paymentType object\n $paymentOne = new AnetAPI\\PaymentType();\n $paymentOne->setCreditCard($creditCard);\n\n // Create order information\n $order = new AnetAPI\\OrderType();\n $order->setInvoiceNumber(\"10101\");\n $order->setDescription(\"Golf Shirts\");\n\n // Set the customer's Bill To address\n $customerAddress = new AnetAPI\\CustomerAddressType();\n $customerAddress->setFirstName($fname);\n $customerAddress->setLastName($lname);\n $customerAddress->setCompany($email);\n $customerAddress->setAddress($shipping_address);\n $customerAddress->setCity($city);\n $customerAddress->setState($province);\n $customerAddress->setZip(\"72000\");\n $customerAddress->setCountry(\"Pakistan\");\n\n // Set the customer's identifying information\n $customerData = new AnetAPI\\CustomerDataType();\n $customerData->setType(\"individual\");\n $customerData->setId(\"99999456654\");\n $customerData->setEmail($email);\n\n // Add values for transaction settings\n $duplicateWindowSetting = new AnetAPI\\SettingType();\n $duplicateWindowSetting->setSettingName(\"duplicateWindow\");\n $duplicateWindowSetting->setSettingValue(\"60\");\n\n // Add some merchant defined fields. These fields won't be stored with the transaction,\n // but will be echoed back in the response.\n $merchantDefinedField1 = new AnetAPI\\UserFieldType();\n $merchantDefinedField1->setName(\"customerLoyaltyNum\");\n $merchantDefinedField1->setValue(\"1128836273\");\n\n $merchantDefinedField2 = new AnetAPI\\UserFieldType();\n $merchantDefinedField2->setName(\"favoriteColor\");\n $merchantDefinedField2->setValue(\"blue\");\n\n // Create a TransactionRequestType object and add the previous objects to it\n $transactionRequestType = new AnetAPI\\TransactionRequestType();\n $transactionRequestType->setTransactionType(\"authOnlyTransaction\");\n $transactionRequestType->setAmount($amount);\n $transactionRequestType->setOrder($order);\n $transactionRequestType->setPayment($paymentOne);\n $transactionRequestType->setBillTo($customerAddress);\n $transactionRequestType->setCustomer($customerData);\n $transactionRequestType->addToTransactionSettings($duplicateWindowSetting);\n $transactionRequestType->addToUserFields($merchantDefinedField1);\n $transactionRequestType->addToUserFields($merchantDefinedField2);\n\n // Assemble the complete transaction request\n $request = new AnetAPI\\CreateTransactionRequest();\n $request->setMerchantAuthentication($merchantAuthentication);\n $request->setRefId($refId);\n $request->setTransactionRequest($transactionRequestType);\n\n // Create the controller and get the response\n $controller = new AnetController\\CreateTransactionController($request);\n $response = $controller->executeWithApiResponse(\\net\\authorize\\api\\constants\\ANetEnvironment::SANDBOX);\n\n\n if ($response != null) {\n // Check to see if the API request was successfully received and acted upon\n if ($response->getMessages()->getResultCode() == \"Ok\") {\n // Since the API request was successful, look for a transaction response\n // and parse it to display the results of authorizing the card\n $tresponse = $response->getTransactionResponse();\n\n if ($tresponse != null && $tresponse->getMessages() != null) {\n echo \" Successfully created transaction with Transaction ID: \" . $tresponse->getTransId() . \"\\n\";\n echo \" Transaction Response Code: \" . $tresponse->getResponseCode() . \"\\n\";\n echo \" Message Code: \" . $tresponse->getMessages()[0]->getCode() . \"\\n\";\n echo \" Auth Code: \" . $tresponse->getAuthCode() . \"\\n\";\n echo \" Description: \" . $tresponse->getMessages()[0]->getDescription() . \"\\n\";\n } else {\n echo \"Transaction Failed \\n\";\n if ($tresponse->getErrors() != null) {\n echo \" Error Code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n echo \" Error Message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\";\n }\n }\n // Or, print errors if the API request wasn't successful\n } else {\n echo \"Transaction Failed \\n\";\n $tresponse = $response->getTransactionResponse();\n\n if ($tresponse != null && $tresponse->getErrors() != null) {\n echo \" Error Code : \" . $tresponse->getErrors()[0]->getErrorCode() . \"\\n\";\n echo \" Error Message : \" . $tresponse->getErrors()[0]->getErrorText() . \"\\n\";\n } else {\n echo \" Error Code : \" . $response->getMessages()->getMessage()[0]->getCode() . \"\\n\";\n echo \" Error Message : \" . $response->getMessages()->getMessage()[0]->getText() . \"\\n\";\n }\n }\n } else {\n echo \"No response returned \\n\";\n }\n\n return $response;\n}",
"public function indexApUpdate(){\n //This will be used to display in the Wizard of available Realms in the Create screens of Vouchers; Permanent Users; and Devices\n $user = $this->Aa->user_for_token($this);\n if(!$user){ //If not a valid user\n return;\n }\n $this->_doApListFor($user,'update'); \n }",
"function get_process_applicants($internshipID)\r\n\t{\r\n\t\t\r\n\t\tinclude(\"mysql_connect.inc.php\");\r\n\t\t$sql = \"SELECT * FROM `application` WHERE `InternshipID`= '$internshipID' ORDER BY `match` DESC \";\r\n $result = mysqli_query($link, $sql);\r\n\t\t\r\n\t\treturn $result;\r\n\t}",
"public function run()\n {\n $userRole = Role::where('name', RoleEnum::USER)->first();\n $users = $userRole->users;\n \n $bca = PaymentProvider\n ::where('name', PaymentProvider::PAYMENT_PROVIDER_BCA)\n ->first();\n\n foreach ($users as $user) {\n PaymentProviderAccount::create([\n 'user_id' => $user->id,\n 'payment_provider_id' => $bca->id,\n 'type' => PaymentProviderAccount::TYPE_USER_ACCOUNT,\n 'status' => PaymentProviderAccount::STATUS_APPROVED,\n 'account_name' => 'lorem ipsum',\n 'account_number' => '123456789'\n ]);\n }\n }",
"public function process() {\n\t\t$this->log('Process accessed', 'paypal');\n\t\tif ($this->request->is('post')) {\n\t\t\t$this->log('POST ' . print_r($_POST, true), 'paypal');\n\t\t}\n\t\tif ($this->InstantPaymentNotification->isValid($_POST)) {\n\t\t\t$this->log('POST Valid', 'paypal');\n\t\t\t$notification = $this->InstantPaymentNotification->buildAssociationsFromIPN($_POST);\n\n\t\t\t$existingIPNId = $this->InstantPaymentNotification->searchIPNId($notification);\n\t\t\tif ($existingIPNId !== false) {\n\t\t\t\t$notification['InstantPaymentNotification']['id'] = $existingIPNId;\n\t\t\t}\n\n\t\t\t$this->InstantPaymentNotification->saveAll($notification);\n\t\t\t$this->__processTransaction($this->InstantPaymentNotification->id);\n\t\t} else {\n\t\t\t$this->log('POST Not Validated', 'paypal');\n\t\t}\n\t\treturn $this->redirect('/');\n\t}",
"function theme_profile_advertise($profile_pid) {\n\n\tglobal $current_user;\n\t$site_url = get_site_url();\n\t$profile_author = get_user_by('slug', $profile_pid);\n\n\tif ( ( ( is_user_logged_in() ) && ( $current_user->ID == $profile_author->ID ) ) || get_user_role( array('administrator') ) ) {} else {return;}\n\t\t\n\t# if user IS and advertiser\n\tif ($profile_author->reg_advertiser == true) {\n\t\t\n\t\t$product_id = $profile_author->product_id;\n\t\n\t\t$product_name = get_product_name($product_id);\n\t\t\n\t\tswitch ($profile_author->budget_status) {\n \t\tcase 'active': //Active client with budget remaining\n \t\t\t?><h3>You are on the <?php echo $product_name; ?></h3><?php\n \t\t\n \t\techo '<p>You still have some budget left this week</p>\n\t\t\t\t<p>Want more clicks? There\\'s no limit on how many posts you can make, so go for it! <br />\n\t\t\t\tCreate another post now.</p>\n\t\t\t\t<a href=\"'. $site_url .'/forms/create-product-post-subscriber/\"><input type=\"button\" value=\"Create Another Product Post\"></a>\n\t\t\t\t<div class=\"clear\"></div><br /><br />';\n\t\t\t\t\n\t\t\t\techo '<h3>My Product Posts</h3>';\n\t\t\t\t\n\t\t\t\tlist_posts_advertiser($profile_pid);\n \t\tbreak;\n \t\t\n \t\tcase 'used_up': //Active client with budget used up for the week\n \t\t\t?><h3>You are on the <?php echo $product_name; ?></h3><?php\n \t\t\n \t\techo '<p>Wow, you\\'re posts are so popular that your weekly budget is already used up!<br /> \n \t\tThis means that your product posts will not show again until your next billing cycle commences.</p>\n \t\t\n \t\t<p>Want more clicks? Upgrade your weekly budget now.</p>';\n\t\t\t\n\t\t\t\techo '<form action=\"'. $site_url .'/chargify-upgrade-downgrade-handler/\" method=\"post\">\n \t\t '. upgrade_dropdown($product_id) . '\n \t\t \t <input type=\"submit\" value=\"Save plan\">\n \t\t </form>\n \t\t\t <div class=\"clear\"></div>';\n\t\t\t\t\n\t\t\t\techo '<h3>My Product Posts</h3>';\n\t\t\t\tlist_posts_advertiser($profile_pid);\n \t\tbreak;\n \t\t\n \t\tcase 'cancelled': //Previous active client who has cancelled\n \t\t\t?><h3>You were on the <?php echo $product_name; ?></h3>\n \t\t\t<p>Reactivate your account now</p><br /><?php\n \t\t\techo '<h3>My Product Posts</h3>';\n \t\tbreak;\n\t\t}\t\n\t\n\t} else { \n\t\t# if user IS NOT an adverters and never has been\n\t\t# Set form urls for creating ad posts for regular monthly subscription advertisers and non regular advertisers\n\t\t$post_my_product_form = ($profile_author->reg_advertiser == 1) ? '/forms/create-product-post-subscriber/' : '/advertisers/';\n \t$template_url = get_bloginfo('template_url');\n \n \n\t\techo \"\n\t\t<div id=\\\"my-advertise\\\">\n\t\t\t<div id=\\\"email\\\">\n\t\t\t\t<span><a href=\\\"\" . $site_url . \"/advertisers\\\" ><input type=\\\"button\\\" value=\\\"Create Your First Product Promotion!\\\" /></a></span>\n\t\t\t\t<div class=\\\"clear\\\"></div>\n\t\t\t\t<br />\n\t\t\t\t\n\t\t\t\t<p> Greenpages offers an extremely effective kind of online advertising: You get to create your own editorials!</p>\n\t\t\t\t<p>You create the editorial post, then we send it out to the Greenpages members. You only pay for the clicks you receive in \n\t\t\t\tcost-per-click model. No click, no payment! You can upgrade, downgrade or pause your advertiser plan at any time.</p>\n\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t<span><a href=\\\"\" . $site_url . \"/advertisers\\\" target=\\\"_blank\\\">Learn more</a></span>\n\t\t\t</div>\n\t\t</div>\n\t\t<div class=\\\"clear\\\"></div>\n\t\t\";\n\t}\n}",
"public function index()\n {\n $this->cpAuthorize();\n }",
"public function massCreditmemoAction()\n {\n $this->_ratepayMassEvent('creditmemo');\n \n $this->_redirect('*/*/index');\n }",
"public function corporateMyBookingsAction() {\n $commonCode = $this->commonCode();\n $countItem = $commonCode['countItem'];\n $pg_start_page = 0;\n $page = 1;\n $pg_limit_records = $commonCode['pg_limit_records'];\n $count = $commonCode['count'];\n $class=$commonCode['class'];\n $pagination= '';\n $modules = $commonCode['modules'];\n $accountId = $commonCode['accountId'];\n $userId = $commonCode['userId'];\n $parameters['accountId'] = $accountId;\n $parameters['userId'] = $userId;\n $status = $commonCode['status'];\n $this->data['preferredAccountCurrency'] = $commonCode['preferredAccountCurrency'];\n $this->data['hotelModuleId'] = $commonCode['hotelModuleId'];\n $this->data['flightModuleId'] = $commonCode['flightModuleId'];\n $this->data['dealModuleId'] = $commonCode['dealModuleId'];\n $this->data['approvedStatus'] = $commonCode['approvedStatus'];\n $this->data['accountId'] = $commonCode['accountId'];\n $this->data['modules'] = $modules;\n $params = array(\n 'accountId' => $accountId,\n 'userId' => $userId,\n 'status' => $status,\n 'start' => $pg_start_page,\n 'limit' => $pg_limit_records\n );\n $userObj = $this->get('UserServices')->getUserDetails(array('id' => $userId));\n if($userObj[0]['cu_cmsUserGroupId'] == $this->container->getParameter('ROLE_SYSTEM')){\n $this->data['role'] = $this->container->getParameter('ROLE_SYSTEM');\n }\n $allApprovalFlowList = $this->get('CorpoApprovalFlowServices')->getAllApprovalFlowList($params);\n\n $params['count']= 1;\n $countApprovalFlowList = $this->get('CorpoApprovalFlowServices')->getAllApprovalFlowList($params);\n if($countApprovalFlowList){\n $countItem = $countApprovalFlowList;\n $pagination = $this->getRelatedDiscoverPagination($countItem, $pg_limit_records, $page,$count ,$class );\n } \n $this->data['pagination'] = $pagination;\n $this->data['allApprovalFlowList'] = $allApprovalFlowList;\n \n return $this->render('@Corporate/corporate/corporate-my-bookings.twig', $this->data);\n }",
"public function AuthorizeAll()\n {\n //\n if (Auth::user()->can('authorize')){\n\n $assessments=PostCashAssessment::where('auth_status', '=', 'pending')\n ->update([\n 'auth_status' => 'authorized',\n 'auth_by' => Auth::user()->username,\n 'auth_date' => date('Y-m-d H:i')\n ]);\n\n //Audit trail\n AuditRegister(\"PostCashMonitoringController\",\"AuthorizeAll\",$assessments);\n\n }else{\n return null;\n }\n\n }",
"function processFacsPaymentFile(){\r\n\t\r\n\t$counter = 0;\r\n\t$strCount = 0;\r\n\t$paymentData = [];\r\n\t$paymentDataLen = strlen($this->fileData[0]);\r\n\r\n\tfor ($counter = 0; $strCount < $paymentDataLen; $counter++) {\r\n\t\t$paymentData[$counter] = substr($this->fileData[0], $strCount, 250);\r\n\t\t$strCount += 250;\r\n\t}\r\n\r\n\tforeach($paymentData as $k=>$v){\r\n\t\t$valid = $this->checkfor_valid_Facs_payment_line($v);\r\n\t\tif($valid == 1){\r\n\t\t\t$this->readFacsPaymentFile($k, $v);\r\n\t\t}\r\n\t}\r\n\t$this->writeFacsPaymentFileAPI();\r\n}"
]
| [
"0.5972165",
"0.5930522",
"0.58804965",
"0.5648572",
"0.56298155",
"0.5583333",
"0.54946035",
"0.54074234",
"0.5395817",
"0.53014994",
"0.52896714",
"0.52612495",
"0.5233849",
"0.5223623",
"0.5216836",
"0.5212728",
"0.5201155",
"0.51933885",
"0.5165512",
"0.5162027",
"0.5149801",
"0.5141987",
"0.5130754",
"0.51241916",
"0.5123364",
"0.5121392",
"0.51110214",
"0.5100749",
"0.50792104",
"0.50743246",
"0.5073474",
"0.5071203",
"0.5064233",
"0.506365",
"0.5051664",
"0.5051533",
"0.50469536",
"0.5045528",
"0.5031779",
"0.5027803",
"0.50270444",
"0.5026258",
"0.5025754",
"0.5023156",
"0.50228906",
"0.50211364",
"0.5019448",
"0.5018814",
"0.50019693",
"0.4995443",
"0.49875703",
"0.49859303",
"0.4981077",
"0.49772125",
"0.49680033",
"0.4966951",
"0.49569857",
"0.49513492",
"0.49510482",
"0.49452594",
"0.49451914",
"0.49334085",
"0.4924933",
"0.49054152",
"0.4898965",
"0.48961166",
"0.48961073",
"0.48825255",
"0.4881745",
"0.48713902",
"0.48711696",
"0.48555127",
"0.48551357",
"0.4851526",
"0.4851177",
"0.48487473",
"0.48478344",
"0.48478344",
"0.4847179",
"0.48466298",
"0.48420933",
"0.48275807",
"0.48255357",
"0.48247558",
"0.48235005",
"0.48204887",
"0.4818209",
"0.48151422",
"0.48125494",
"0.4807179",
"0.48059922",
"0.47983295",
"0.4798191",
"0.47949287",
"0.4792156",
"0.47916132",
"0.4791235",
"0.47879198",
"0.47868788",
"0.4767374"
]
| 0.48602527 | 71 |
Revert accreditation level to `Waiting for accreditation` | public function revertAccreditationLevel(User $user)
{
$user->getAccreditationApplication()->setAccreditationLevel(null);
$user->getStore()->setAccreditationLevel(null);
$this->em->flush();
return $user;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function payment_status_canceled_reversal()\n {\n do_action(\n 'wc_paypal_plus__ipn_payment_update',\n 'canceled_reversal',\n $this->settingRepository\n );\n }",
"protected function amount_transition_status() {\n\t\t$amount_transition_status = $this->amount_transition_status ;\n\n\t\t// Reset status transition variable.\n\t\t$this->amount_transition_status = false ;\n\n\t\tif ( ! $amount_transition_status ) {\n\t\t\treturn ;\n\t\t}\n\n\t\tdo_action( 'wc_cs_admin_funds_txn_amount_status_' . $amount_transition_status, $this ) ;\n\t}",
"public function desactivar()\n {\n $this->estatus = 0;\n $this->save();\n }",
"public function changeStatus()\n {\n $trackVisits = Piwik_Common::getRequestVar('trackVisits', false);\n $nonce = Piwik_Common::getRequestVar('nonce');\n\n if (Piwik_Nonce::verifyNonce('Piwik_OptOut', $nonce)) {\n\t\t\tPiwik_Tracker_Cookie::setIgnoreCookie();\n } else {\n throw new Exception(Piwik_Translate('OptOut_WrongNonce'));\n }\n Piwik::redirectToModule('OptOut', 'index');\n }",
"public function undoFinalDeny()\n {\n $this->finalDeny = null;\n $this->decisionViewed = null;\n $this->decisionLetter = null;\n }",
"public function resetOriginalStatus() {\n $this->orig_status = $this->getStatus();\n }",
"public function quiet()\n {\n $this->activated = false;\n }",
"function disableAccount($accountId)\n\t\t{\n\t\t\tmysql_query(\"UPDATE argus_accounts SET status = 'DISABLED' WHERE account_id = '\".$accountId.\"' AND status = 'ENABLED'\") or die(mysql_error());\n\t\t\t\n\t\t\treturn;\n\t\t}",
"function threadratinglog_deactivate()\n{\n\tchange_admin_permission('tools', 'ratinglog', -1);\n}",
"public function suspend()\n {\n if ($this->getState()->getMode() == View\\StateInterface::MODE_ENABLED) {\n $state = $this->getState();\n $state->setVersionId($this->getChangelog()->getVersion());\n $state->setStatus(View\\StateInterface::STATUS_SUSPENDED);\n $state->save();\n }\n }",
"function TogglePlanStatus()\n\t{\n\t\t// Check user authorization and permissions\n\t\tAuthenticatedUser()->CheckAuth();\n\t\tAuthenticatedUser()->PermissionOrDie(PERMISSION_RATE_MANAGEMENT | PERMISSION_ADMIN);\n\n\t\t$bolGOD\t= AuthenticatedUser()->UserHasPerm(PERMISSION_GOD);\n\n\t\tif (!DBO()->RatePlan->Load())\n\t\t{\n\t\t\tAjax()->AddCommand(\"Alert\", \"ERROR: Could not find RatePlan with Id: \". DBO()->RatePlan->Id->Value);\n\t\t\treturn TRUE;\n\t\t}\n\n\t\tTransactionStart();\n\n\n\t\t// The status of a RatePlan is stored in the Archived property of the RatePlan table\n\t\tswitch (DBO()->RatePlan->Archived->Value)\n\t\t{\n\t\t\tcase RATE_STATUS_ACTIVE:\n\t\t\t\tDBO()->RatePlan->Archived = RATE_STATUS_ARCHIVED;\n\n\t\t\t\t// Deactivate the Plan Brochure & Auth Script\n\t\t\t\tbreak;\n\n\t\t\tcase RATE_STATUS_ARCHIVED:\n\t\t\t\tDBO()->RatePlan->Archived = RATE_STATUS_ACTIVE;\n\n\t\t\t\t// Reactivate the Plan Brochure & Auth Script\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\t\t\t\t// Cannot toggle from whatever the status currently is\n\t\t\t\tTransactionRollback();\n\t\t\t\tAjax()->AddCommand(\"Alert\", \"ERROR: The RatePlan's status cannot be changed\");\n\t\t\t\treturn TRUE;\n\t\t}\n\n\t\ttry\n\t\t{\n\t\t\t// Re/Activate the Plan Brochure & Auth Script\n\t\t\tif (DBO()->RatePlan->brochure_document_id->Value)\n\t\t\t{\n\t\t\t\t$objBrochure\t= new Document(array('id'=>DBO()->RatePlan->brochure_document_id->Value), true);\n\t\t\t\tif ($objBrochure->status_id !== STATUS_ACTIVE)\n\t\t\t\t{\n\t\t\t\t\t$objBrochure->setStatus(STATUS_ACTIVE);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (DBO()->RatePlan->auth_script_document_id->Value)\n\t\t\t{\n\t\t\t\t$objAuthScript\t= new Document(array('id'=>DBO()->RatePlan->auth_script_document_id->Value), true);\n\t\t\t\tif ($objAuthScript->status_id !== STATUS_ACTIVE)\n\t\t\t\t{\n\t\t\t\t\t$objAuthScript->setStatus(STATUS_ACTIVE);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tcatch (Exception $eException)\n\t\t{\n\t\t\tTransactionRollback();\n\t\t\tAjax()->AddCommand(\"Alert\", \"ERROR: Unable to modify the Plan's Brochure and Auth Script\".($bolGOD ? \"\\n\".$eException->__toString() : ''));\n\t\t\treturn TRUE;\n\t\t}\n\n\t\t// Check that the plan isn't one of the default plans for the Customer Group\n\t\tDBL()->default_rate_plan->rate_plan = DBO()->RatePlan->Id->Value;\n\t\tDBL()->default_rate_plan->Load();\n\t\tif (DBL()->default_rate_plan->RecordCount() > 0)\n\t\t{\n\t\t\tTransactionRollback();\n\t\t\tAjax()->AddCommand(\"Alert\", \"ERROR: This Plan is being used as a default rate plan and cannot have its status changed\");\n\t\t\treturn TRUE;\n\t\t}\n\n\t\t// Save the changes\n\t\tif (!DBO()->RatePlan->Save())\n\t\t{\n\t\t\tTransactionRollback();\n\t\t\tAjax()->AddCommand(\"Alert\", \"ERROR: Saving the status change failed, unexpectedly. Please notify your system administrator\");\n\t\t\treturn TRUE;\n\t\t}\n\n\t\t$strSuccessMsg = \"Status change was successful\";\n\n\t\tif (DBO()->AlternateRatePlan->Id->Value && DBO()->RatePlan->Archived->Value == RATE_STATUS_ARCHIVED)\n\t\t{\n\t\t\t// Associate the Alternate RatePlan with all the dealers that are associated with the rate plan which was just archived\n\t\t\t$intArchivedPlanId\t= DBO()->RatePlan->Id->Value;\n\t\t\t$intAlternatePlanId\t= DBO()->AlternateRatePlan->Id->Value;\n\n\t\t\t$objQuery = new Query();\n\n\t\t\t$strQuery = \"\tINSERT INTO dealer_rate_plan (dealer_id, rate_plan_id)\n\t\t\t\t\t\t\tSELECT DISTINCT drp.dealer_id, $intAlternatePlanId\n\t\t\t\t\t\t\tFROM (\tSELECT dealer_id\n\t\t\t\t\t\t\t\t\tFROM dealer_rate_plan\n\t\t\t\t\t\t\t\t\tWHERE dealer_id IN (SELECT dealer_id FROM dealer_rate_plan WHERE rate_plan_id = $intArchivedPlanId)\n\t\t\t\t\t\t\t\t\tAND dealer_id NOT IN (SELECT dealer_id FROM dealer_rate_plan WHERE rate_plan_id = $intAlternatePlanId)\n\t\t\t\t\t\t\t\t) AS drp;\n\t\t\t\t\t\t\t\";\n\t\t\tif ($objQuery->Execute($strQuery) === FALSE)\n\t\t\t{\n\t\t\t\tTransactionRollback();\n\t\t\t\tAjax()->AddCommand(\"Alert\", \"ERROR: Could not add records to the dealer_rate_plan table to associate the alternate plan\");\n\t\t\t\treturn TRUE;\n\t\t\t}\n\t\t}\n\n\t\tTransactionCommit();\n\n\t\t// Update the status of the RatePlan in the Sales database, if there is one\n\t\tif (Flex_Module::isActive(FLEX_MODULE_SALES_PORTAL))\n\t\t{\n\t\t\ttry\n\t\t\t{\n\t\t\t\tCli_App_Sales::pushAll();\n\t\t\t}\n\t\t\tcatch (Exception $e)\n\t\t\t{\n\t\t\t\t// Pushing the data failed\n\t\t\t\t$strSuccessMsg .= \"<br /><span class='warning'>WARNING: Pushing the data from Flex to the Sales database, failed. Contact your system administrators to have them manually trigger the data push.<br />Error message: \". htmlspecialchars($e->getMessage()) .\"</span>\";\n\t\t\t}\n\t\t}\n\n\t\t// Everything worked\n\t\tAjax()->AddCommand(\"AlertReload\", $strSuccessMsg);\n\n\t\treturn TRUE;\n\t}",
"public function resetStatus() {\n // Do not change the status of an already-idle migration\n db_update('migrate_status')\n ->fields(array('status' => MigrationBase::STATUS_IDLE))\n ->condition('machine_name', $this->machineName)\n ->condition('status', MigrationBase::STATUS_IDLE, '<>')\n ->execute();\n }",
"function desactivar(){\n\t\t// $rs = $this->ejecuta($sql);\n\t\t// if($this->como_va()){\n\t\t// \treturn false;\n\t\t// }else{\n\t\t \t$sql = \"UPDATE proveedor SET status='0' WHERE id_prov='$this->cod_prov'\";\n\t\t\t$this->ejecuta($sql);\n\t}",
"function cancelCommit()\n{\n global $user;\n $UID = $user->uid;\n $params = drupal_get_query_parameters();\n $OID = $params['OID'];\n\n // removing user's commitment from the outreach completely\n dbRemoveUserFromOutreach($UID,$OID);\n drupal_set_message(\"Your commitment to outreach event: \" . dbGetOutreachname($OID) . \" has been removed!\"); //letting them know and redirecting user to the previous page they were on\n drupal_goto($_SERVER['HTTP_REFERER']);\n}",
"public function reactivate()\n {\n $project = $this->getProject();\n $recovery_plan_id = $this->request->getIntegerParam('recovery_plan_id', 0);\n\n\n $this->response->html($this->template->render('status:recoveryPlanDetail/makeActive', array(\n 'title' => t('Reactivate recovery plan'),\n 'project_id' => $project['id'],\n 'values' => array('id' => $recovery_plan_id)\n )));\n }",
"public function markUnapproved()\n {\n $this->Moderated = false;\n $this->write();\n $this->extend('afterMarkUnapproved');\n }",
"public function actionDecline()\n {\n $this->render('decline');\n }",
"function update_decision_status() {\n\t\tif ( check_ajax_referer( 'ht-dms', 'nonce' ) ) {\n\t\t\t$dID = pods_v_sanitized( 'dID', $_REQUEST );\n\t\t\tif ( $dID ) {\n\t\t\t\twp_die( ucwords( ht_dms_decision_class()->status( $dID ) ) );\n\n\t\t\t}\n\n\t\t}\n\t}",
"public function updateStatusFinish()\n {\n $this->resetStatuses();\n }",
"public static function reInstateQuotaExceeded()\n {\n //$noticeControl = Notices::getInstance();\n //$notice = $noticeControl->getNoticeByID(self::MSG_QUOTA_REACHED);\n Notices::removeNoticeByID(self::MSG_QUOTA_REACHED);\n //$notice->unDismiss();\n //$noticeControl->update();\n }",
"public function payment_status_reversed()\n {\n $this->order->update_status(\n OrderStatuses::ORDER_STATUS_ON_HOLD,\n sprintf(\n esc_html__('Payment %s via IPN.', 'woo-paypalplus'),\n $this->request->get(Request::KEY_PAYMENT_STATUS, FILTER_SANITIZE_STRING)\n )\n );\n\n do_action('wc_paypal_plus__ipn_payment_update', 'reversed', $this->settingRepository);\n }",
"function decline() {\n $this->setStatus(UserpointsTransaction::STATUS_DECLINED);\n return $this;\n }",
"public function turnOffWaitingChecks()\n {\n $this->isModal = true;\n return;\n }",
"function cancel_transaction()\n{\n\tglobal $transaction_level;\n\n\tif ($transaction_level) {\n\t\tdb_query(\"ROLLBACK\", \"could not cancel a transaction\");\t\n\t}\n}",
"public function disapprove()\n {\n return $this->approve(false);\n }",
"public function reject()\n {\n if ($this->withdrawal->status == Withdrawal::STATUS_CREATED) {\n // update withdrawal model\n $this->withdrawal->status = Withdrawal::STATUS_REJECTED;\n $this->withdrawal->save();\n // create a credit transaction on user account to return funds\n $accountService = new AccountService($this->withdrawal->account);\n $accountService->transaction($this->withdrawal, $this->withdrawal->amount);\n }\n }",
"public static function deactivate() {\n\t\tif (Plus_admin::gs('resetsettings_status')){\n\t\t\tdelete_option('cs_plusadmin_settings');\n\t\t\tdelete_option('cs_plus_admin_lpm_settings');\n\t\t\tdelete_option('cs_plus_admin_amm_settings');\n\t\t\tdelete_option('cs_plusadmin_adminmenu');\n\t\t\tdelete_option('cs_plusadmin_adminsubmenu');\n\t\t\tdelete_option('cs_plusadmin_status');\n\t\t}\n\t}",
"public function deactivate()\n {\n $project = $this->getProject();\n $recovery_plan_id = $this->request->getIntegerParam('recovery_plan_id', 0);\n\n\n $this->response->html($this->template->render('status:recoveryPlanDetail/makeInactive', array(\n 'title' => t('Remove recovery plan'),\n 'project_id' => $project['id'],\n 'values' => array('id' => $recovery_plan_id)\n )));\n }",
"function unblock_process($blocker) {\n set_field('block_courseprefs_config', 'value', 'DONE', 'name', $blocker);\n}",
"public function revert()\n {\n $this->curlSender->post(\n $this->uninstallRequest->getUrl(),\n $this->uninstallRequest->getParams()\n );\n }",
"function cancelsettings()\r\n {\r\n $this->setRedirect('index.php?option=com_jfusionconnect&view=cpanel', $msg, $msgType);\r\n }",
"function logger_firmware_upgrade_disapprove($device) {\n\n logger_remove_firmware_upgrade_request($device);\n\n drupal_set_message('The firmware upgrade has been rejected.', 'warning');\n\n drupal_goto(\"energy\");\n}",
"protected static function set_status()\n {\n }",
"public function undoFinalAdmit()\n {\n if (!is_null($this->acceptOffer) and !is_null($this->declineOffer)) {\n throw new \\Jazzee\\Exception('Cannot undo admit for an applicant with a offer response.');\n }\n $this->finalAdmit = null;\n $this->decisionViewed = null;\n $this->decisionLetter = null;\n }",
"function unblock(Request $request)\n {\n DB::table('users')\n ->where('id', $request->id)\n ->update([\n 'active' => '1',\n ]);\n\n //insert into auditrail\n AuditTrail::create(['user_id' => Auth::user()->id,\n 'username' => Auth::user()->username,\n 'form_name' => 'Account',\n 'activity' => 'Unlocked ' . 'Account ' . $request->username, \n ]);\n\n return redirect()->back();\n }",
"function cfdb7_on_deactivate() {\n global $wp_roles;\n foreach( array_keys( $wp_roles->roles ) as $role ) {\n $wp_roles->remove_cap( $role, 'cfdb7workflow_access' );\n }\n}",
"public function markAsUnpaid() {\n $this->status = parent::STATUS_APPROVED_BY_USER;\n\n //no reason to keep this (cause we will save to history)\n $this->decline_reason = null;\n $this->comment = null;\n\n return $this->save(false);\n }",
"function desactivar(){\n\t\t// $rs = $this->ejecuta($sql);\n\t\t// if($this->como_va()){\n\t\t// \treturn false;\n\t\t// }else{\n\t\t\t$sql=\"UPDATE motivo_movimiento SET status='0' WHERE id_motivo_mov='$this->id_motivo'\";\n\t\t\t$this->ejecuta($sql);\n\t\t//}\n\t}",
"public function restore_settings_feedback() {\n\t\t\trequire( ABSPATH . 'wp-admin/options-head.php' );\n\t\t}",
"private function updateBalance()\n {\n if (!auth()->user()->hasRole('admin')) {\n auth()->user()->update([\n 'credit' => auth()->user()->credit - $this->totalCost()\n ]);\n }\n }",
"final static public function restoreDisplayOptions( ){\n\t\t\t\tstatic::$_displayOptions = self::ERRALL & ~self::ERRTRC;\n\t\t\t\treturn;\n\t\t\t}",
"public function maybe_update_unlimited_access() {\n $current_version = get_option( 'laterpay_version' );\n if ( version_compare( $current_version, '0.9.11', '<' ) ) {\n return;\n }\n\n if ( $unlimited_role = get_option( 'laterpay_unlimited_access_to_paid_content' ) ) {\n add_option( 'laterpay_unlimited_access', array( $unlimited_role => array( 'all' ) ) );\n delete_option( 'laterpay_unlimited_access_to_paid_content' );\n }\n }",
"public function turnOff(){\n\t\treturn \"Turn Off executed\";\n\t}",
"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 }",
"function statusMessagesOff()\n\t{\n\t\t$this->bStatusMessages = false;\n\t}",
"function resubmitFailures() {\n\tglobal $gStatusTable, $gErrBase;\n\t$cmd = \"update $gStatusTable set status=0, wptid='', wptRetCode='', medianRun=0 where status >= $gErrBase;\";\n\tdoSimpleCommand($cmd);\n}",
"public function rejectAction()\n\t{\trequire_once( 'form.inc' );\n\n\t\tif( $this->_getParam('user') && $this->_getParam('user_reason') )\n\t\t{\t// TODO: validate and write entry to database\n\t\t\t// TODO: add success message to view\n\t\t\tif( $this->db->rejectRefund( $this->_getParam('user'), $this->_getParam('user_reason') ) )\n\t\t\t{\n\t\t\t}else\n\t\t\t{\n\t\t\t}\n\t\t}\n\n\t\t// TODO: If the refunds period has closed, parse request logs against refund list, update rejected users\n\t\t$this->view->user_options = $this->db->getRefunds('REQUESTED');\n\t}",
"private function eliminarCita(){\n $query = \"UPDATE \" . $this->table . \" SET estado = 'Inactivo' WHERE CitaId = '\" . $this->idcita . \"'\";\n $resp = parent::nonQuery($query);\n if($resp >= 1 ){\n return $resp;\n }else{\n return 0;\n }\n }",
"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}",
"public function switchStatus()\n {\n if ($this->status == 1) {\n return $this->status = '0';\n }\n $this->status = 1;\n }",
"function _custom_request_node_disable_msg($form, &$form_state) {\r\n //...\r\n // clear status messages\r\n //drupal_get_messages('status');\r\n}",
"function dprv_deactivate()\r\n\t{\r\n\t\t$log = new DPLog(); \r\n\t\t$log->lwrite(\"VERSION \" . DPRV_VERSION . \" DEACTIVATED\"); \r\n\t}",
"public function refundTransaction() {\n //not implemented\n }",
"public function revoke_access() {\r\n // Nothing to do!\r\n }",
"public function actionAjaxWhyStatusDeactivate()\n {\n\t $id=$_REQUEST['id'];\n\t $rec=WhyUsHome::model()->findByPk(array('id'=>$id));\n\t $status=$rec->status;\n\t if($status==1)\n\t {\n\t \t $rec->status=0;\n\t \t $rec->save();\n\t }\n\t else\n\t { \n\t $rec->status=1;\n\t \t $rec->save(); \n\n\t \t \n\t }\t\n }",
"public function completeIssueFee($status)\n {\n $this->status = $status;\n }",
"public function abortDuel(){\n $this->plugin->getScheduler()->cancelTask($this->countdownTaskHandler->getTaskId());\n }",
"static function momentDisconect()\r\n {\r\n $user = self::getCurrentUser();\r\n\r\n if ($user !== NULL)\r\n {\r\n $user->setOffline(1);\r\n self::updateUser($user);\r\n }\r\n }",
"public function refund();",
"public function decline(Request $request){\n $trnsId=\t$request->transId;\n if(!empty($trnsId)){\n $irrigation_payment = IrrigationPayment::where('transaction_no', $trnsId)->first();\n if ($irrigation_payment && $irrigation_payment->status == 1) {\n $irrigation_payment->status = 2;\n $irrigation_payment->update();\n return response([\n 'success' => true,\n 'message' => 'Payment failed.'\n ]);\n } else {\n return response([\n 'success' => false,\n 'message' => 'Invalid Transaction Number.'\n ]);\n }\n }\n }",
"public function rejected()\n {\n $this->setStatus(self::STATUS_REJECTED);\n }",
"public function unconfirmed_account() {\n \n // Check if the current user is admin and if session exists\n $this->check_session();\n \n if ( $this->user_status == 1 ) {\n \n redirect('/user/app/dashboard');\n \n }\n \n // Show unconfirmed account page\n $this->load->view('user/unconfirmed-account');\n \n }",
"public function disable()\n {\n $user = User::where('idPerson', '=', \\Auth::user()->idPerson)->first();\n $user->status = 2;\n $user->confirmation_code = NULL;\n $user->save();\n return Redirect::to('logout');\n }",
"public static function suspend_enrol_returns() {\n return new external_value(PARAM_BOOL, 'A return status');\n }",
"function trans_off()\r\n\t{\r\n\t\t$this->db->trans_enabled = FALSE;\r\n\t}",
"public function unsetStatus(): void\n {\n $this->status = [];\n }",
"function clear_divide_denial_flag($acc_number)\n\t{\n\t $data['divide_denial'] = '0';\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 suspend(): void\n {\n $this->tonClient->request(\n 'net.suspend'\n )->wait();\n }",
"public function cancel_membership() {\n \t$membership_id = $this->uri->segment(3);\n\n \t$data = [\n \t\t'id' => $membership_id,\n \t\t'status' => 'Cancelled'\n \t];\n\n \t$this->Member_Model->update_membership($data);\n\n \tredirect('members/list/active');\n }",
"public function tick(){\n\t\tif($this->status !== self::NORMAL){\n\t\t\t$this->remaining_turns--;\n\t\t\tif($this->remaining_turns <= 0){\n\t\t\t\t$this->status = self::NORMAL;\n\t\t\t}\n\t\t}\n\t}",
"public function license_status_msg() {\r\n\t\r\n\t$status_msg = '';\r\n\r\n\t$license_key = $this->get_license_option('license_key');\r\n\t$license_status = $this->get_license_option('license_status');\r\n\t$lps = $this->get_license_option('lps');\r\n\t\t\r\n\tif( 'valid' === $license_status && !empty( $license_key ) ) {\r\n\t\t\r\n\t\t$status_msg .= '<p style=\"color:green;\"> ' . __( 'Your license is valid', 'affiliatewp-multi-level-affiliates' ) . '. <br><br></p>';\t\r\n\t\t\r\n\t\t//$href = add_query_arg( $this->plugin_config['plugin_prefix'].'_license_change', 'deactivate', $_SERVER['REQUEST_URI'] );\r\n\t\t//$href_text = 'Deactivate License';\r\n\t\t//$status_msg .= '<a target=\"_self\" class=\"button-primary\" href=\"'.$href.'\">'.$href_text.'</a>';\r\n\t\r\n\t// If invalid and not activated = invalid license\t\t\t\t\t\r\n\t} elseif( 'invalid' === $license_status && !empty( $license_key ) && $lps != '1') {\t\r\n\t\r\n\t\t$error_code = $this->get_license_option('activation_error_code');\r\n\t\tif( !empty($error_code) ) $error_code = ' (error code: '.$error_code.')';\r\n\t\t$status_msg .= '<p style=\"color:red;\"> ' . __( 'Your license is invalid'.$error_code, 'affiliatewp-multi-level-affiliates' ) . '</p>';\t\r\n\t\r\n\t// If invalid but activated = expired\t\t\t\r\n\t}elseif( 'expired' === $license_status && !empty( $license_key ) && $lps == '1') {\r\n\t\t\r\n\t\t$status_msg .= '<p style=\"color:red;\">' . __( 'Your license has expired. Plugin features remain enabled but auto updates are disabled<br><a href=\"https://www.clickstudio.com.au/checkout/?edd_license_key='.$license_key.'&download_id='.$this->plugin_config['plugin_item_id'].'\" target=\"blank\">Renew your license - click here</a><br><br>', 'affiliatewp-multi-level-affiliates' ) . '</p>';\t\r\n\t\t\r\n\t\t//$href = add_query_arg( $this->plugin_config['plugin_prefix'].'_license_change', 'deactivate', $_SERVER['REQUEST_URI'] );\r\n\t\t//$href_text = 'Deactivate License';\r\n\t\t//$status_msg .= '<a target=\"_self\" class=\"button-primary\" href=\"'.$href.'\">'.$href_text.'</a>';\r\n\t\t\r\n\t}else{\r\n\t\t\r\n\t\t$status_msg .= '<p style=\"\"> ' . __( 'Enter your license key and save the settings to activate.', 'affiliatewp-multi-level-affiliates' ) . '</p>';\r\n\t\t\r\n\t}\r\n\t\r\n\tif( !empty($lps) && $lps == '2' ) {\r\n\t\t\r\n\t\t$status_msg .= '<p style=\"color:red;\"> ' . __( 'A licence was previously deactivated for this site. License activation is now required to restore functionality.', 'affiliatewp-multi-level-affiliates' ) . '</p>';\r\n\t\r\n\t}elseif( !empty($lps) && $lps == '1' ) {\r\n\t\t\r\n\t\t$href = add_query_arg( $this->plugin_config['plugin_prefix'].'_license_change', 'deactivate', $_SERVER['REQUEST_URI'] );\r\n\t\t$href_text = 'Deactivate License';\r\n\t\t$status_msg .= '<a target=\"_self\" class=\"button-primary\" href=\"'.$href.'\">'.$href_text.'</a>';\r\n\t\t\r\n\t\t$status_msg .= '<p>'. __( 'Deactivating your license on this site will disable all plugin features. Be careful!', 'affiliatewp-multi-level-affiliates' ).'</p>';\r\n\r\n\t}else{\r\n\r\n\t\t$status_msg .= '<p>'. __( 'An activated license is required to enable plugin features.', 'affiliatewp-multi-level-affiliates' ).'</p>';\r\n\r\n\t}\r\n\t\t\r\n\treturn $status_msg;\r\n}",
"function getStatus(){\n $this->status = 'Unknown';\n if($this->finAid == 1 && $this->totalOwed != 0){\n if($this->finaidQuestion[1] == ''){\n $this->status = 'Waiting for finaid application';\n return;\n }else{\n $this->status = 'Waiting for finaid decision';\n return;\n }\n }\n if($this->schoolFeeOwed != 0){\n $this->status = 'Waiting for school fee payment';\n return;\n }\n if($this->countryId[1] == 0){\n $this->status = 'Waiting for country preferences';\n return;\n }\n if($this->countryId[1] != 0 && $this->countryConfirm != 1){\n $this->status = 'Waiting for country assignments';\n return;\n }\n if($this->delegateFeeOwed != 0){\n $this->status = 'Waiting for delegate fee payment';\n return;\n }\n if(sizeof($this->attendees) == 0){\n $this->status = 'Waiting for attendee info';\n return;\n }\n if($this->totalOwed < 0){\n $this->status = 'Need Refund';\n return;\n }\n if(sizeof($this->attendees) == $this->totalAttendees && $this->totalOwed == 0){\n $this->status = 'Ready';\n return;\n }\n }",
"public function restored(Credit $credit)\n {\n //\n }",
"function virustotalscan_deactivate()\r\n{\r\n global $db;\r\n // se sterg setarile din baza de date\r\n $db->query(\"DELETE FROM \".TABLE_PREFIX.\"settinggroups WHERE name = 'virustotalscan_group'\");\r\n \t$db->query(\"DELETE FROM \".TABLE_PREFIX.\"settings WHERE name LIKE 'virustotalscan_setting_%'\");\r\n // se actualizeaza toate setarile\r\n\trebuild_settings();\r\n // daca tabela \"virustotalscan_log\" exista in baza de date atunci se sterge!\r\n\tif ($db->table_exists('virustotalscan_log'))\r\n $db->drop_table('virustotalscan_log');\r\n // se sterge din baza de date stil-urile adaugate\r\n $db->delete_query('templates', 'title = \"virustotalscan_url_css\"'); \r\n}",
"public function unauthorize () {\n\t\t$this->_plugin->setting(self::token_setting, NULL);\n\t}",
"function desactivar_authuser($id)\n\t{\n\t\t$query = \"UPDATE authuser set status=0 WHERE id = $id'\";\n\t\t$result=mysql_query($query);\n\t\treturn $result;\n\t}",
"static function vimm_accessibility_deactivate() {\n\n\t}",
"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}",
"function stop_members_from_renewing($okay)\n{\n global $current_user;\n // If something else isn't okay, stop from running this code further.\n if (!$okay) {\n return $okay;\n }\n // If the user doesn't have a membership level carry on with checkout.\n if (!pmpro_hasMembershipLevel()) {\n return true;\n }\n // Check if the user's current membership level is the same for checking out.\n if (pmpro_hasMembershipLevel($_REQUEST['level'])) { // Change level ID to a different level.\n pmpro_setMessage('This is your current membership level. Please select a different membership level.', 'pmpro_error');\n return false;\n }\n if (PMPro_Alveoles::has_commitment_level()) {\n $user_id = $current_user->ID;\n $membership_levels = pmpro_getMembershipLevelsForUser( $user_id );\n /** @var PMPro_Membership_Level $level */\n foreach ($membership_levels as $l) {\n if (PMPro_Alveoles::is_with_commitment($l->ID)) {\n if ($date = PMPro_Alveoles::contracted($l->ID)) { //still engaged\n pmpro_setMessage(PMPro_Alveoles::getContractedMessage($date,$l->ID), 'pmpro_error');\n return false;\n }\n }\n }\n }\n return true;\n}",
"public function declinePayment() {\n return array('#markup' => iish_t('Unfortunately, your payment has been declined. Please try to finish your final registration ' .\n 'at a later moment or try a different payment method.'));\n }",
"public function refund()\n\t{\n\t\trequirePermission(\"canRefund\");\n\n\t\t$id = intval($this->input->get(\"id\"));\n\t\t$costDp = intval($this->input->get(\"costDp\"));\n\t\t$accountId = intval($this->input->get(\"accountId\"));\n\t\t\n\t\tif(!$id || !is_numeric($id))\n\t\t{\n\t\t\tdie();\n\t\t}\n\n\t\tif ($costDp != \"Free\") {\n\t\t\tif(!$costDp || !is_numeric($costDp))\n\t\t\t{\n\t\t\t\tdie();\n\t\t\t}\n\t\t}\n\n\t\tif(!$accountId || !is_numeric($accountId))\n\t\t{\n\t\t\tdie();\n\t\t}\n\n\t\tif ($costDp != \"Free\") {\n\t\t\tif ($costDp > 0) {\n\t\t\t\t$userDp = intval($this->recup_model->getDp($accountId));\n\t\t\t\tif(!$userDp || !is_numeric($userDp))\n\t\t\t\t{\n\t\t\t\t\tdie(\"Problème lors de l'acquisition des users dps.\");\n\t\t\t\t}\n\t\t\t\t$this->internal_user_model->setDp($accountId, $userDp+$costDp);\n\t\t\t}\n\t\t}\n\t\t$this->recup_model->editEtat($this->realms->getRealm(1)->getCharacters()->getConnection(), $id, 8);\n\t}",
"function changeStatus($status){\n return false;\n}",
"public function payment_status_refunded()\n {\n if ($this->validator->is_valid_refund()) {\n $this->order->update_status(\n OrderStatuses::ORDER_STATUS_REFUNDED,\n sprintf(\n esc_html__('Payment %s via IPN.', 'woo-paypalplus'),\n $this->request->get(Request::KEY_PAYMENT_STATUS, FILTER_SANITIZE_STRING)\n )\n );\n do_action(\n 'wc_paypal_plus__ipn_payment_update',\n OrderStatuses::ORDER_STATUS_REFUNDED,\n $this->settingRepository\n );\n }\n }",
"public function deactivateaccount() {\n\n // Fetch the request data in JSON format and convert it into object\n $request_data = $this->request->input('json_decode');\n switch (true) {\n // When request is not made using POST method\n case!$this->request->isPost() :\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Wrong request method.';\n break;\n // Request is valid and phone no and name are present\n case!empty($request_data) && !empty($request_data->phone_no) && !empty($request_data->user_token) && !empty($request_data->reason_type) && !empty($request_data->password): // && !empty($request_data->other_reason) && !empty($request_data->email_opt_out):\n // Check if phone no exists\n $data = $this->User->findUser($request_data->phone_no);\n\n // Check if record exists\n if (count($data) != 0) {\n // Check uuid entered is valid\n if ($data[0]['User']['verified'] === false) {\n $success = false;\n $status = UNAUTHORISED;\n $message = 'User not verified';\n } elseif ($request_data->user_token != $data[0]['User']['user_token']) { // User Token is not valid\n $success = false;\n $status = UNAUTHORISED;\n $message = 'User Token is invalid';\n } elseif (md5($request_data->password) != $data[0]['User']['password']) { // User password is matching or not.\n $success = false;\n $status = UNAUTHORISED;\n $message = 'Password did not match';\n } else {\n\n $dataArray = array();\n $dataArray['User']['_id'] = $data[0]['User']['_id'];\n $dataArray['User']['reason_type'] = $request_data->reason_type;\n $dataArray['User']['is_active'] = 'no';\n $dataArray['User']['other_reason'] = !empty($request_data->other_reason) ? trim($request_data->other_reason) : '';\n $flag = $this->User->save($dataArray);\n\n if ($flag) {\n // send email to user's email address..\n if (!empty($request_data->email_opt_out) && $request_data->email_opt_out == 'yes') {\n App::uses('CakeEmail', 'Network/Email');\n $Email = new CakeEmail('default');\n $Email->from(array(SUPPORT_SENDER_EMAIL => SUPPORT_SENDER_EMAIL_NAME));\n $Email->to(strtolower(trim($data[0]['User']['email'])));\n $Email->subject('Clickin | Account Deactivation');\n $Email->emailFormat('html');\n $messageEmail = '';\n $messageEmail .= \"Hi \" . trim($data[0]['User']['name']) . ',<br><br> You have deactivated clickin account. You can reactivate your account\n by signing in again.<br><br>Regards,<br>Clickin\\' Team';\n $Email->send($messageEmail);\n }\n\n $success = true;\n $status = SUCCESS;\n $message = 'Your account has been deactivated.';\n } else {\n $success = false;\n $status = ERROR;\n $message = 'There was a problem in processing your request';\n }\n }\n }\n // Return false if record not found\n else {\n $success = false;\n $status = UNAUTHORISED;\n $message = 'Phone no. not registered.';\n }\n break;\n // User Token blank in request\n case!empty($request_data) && empty($request_data->user_token):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'User Token cannot be blank.';\n break;\n // Phone no. blank in request\n case!empty($request_data) && empty($request_data->phone_no):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Phone no. cannot be blank.';\n break;\n // Reason type blank in request\n case!empty($request_data) && empty($request_data->reason_type):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Reason type cannot be blank.';\n break;\n // Password blank in request\n case!empty($request_data) && empty($request_data->password):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Password cannot be blank.';\n break;\n // Parameters not found in request\n case empty($request_data):\n $success = false;\n $status = BAD_REQUEST;\n $message = 'Request cannot be empty.';\n break;\n }\n\n $out = array(\n \"success\" => $success,\n \"message\" => $message\n );\n\n return new CakeResponse(array('status' => $status, 'body' => json_encode($out), 'type' => 'json'));\n }",
"Public Function clearPerformanceConnectorExpLevel()\n\t{\n\t\t$this->_db->delete('bevomedia_user_performanceconnector_explevel', 'user__Id = ' . $this->id);\n\t}",
"public static function resetCompatNotice()\n {\n Notices::removeNoticeByID(self::MSG_COMPAT);\n }",
"public function resetReportStatuses()\n {\n foreach ($this->options as $op => $junk) {\n if (preg_match('#ReportProcessingStatusList#', $op)) {\n unset($this->options[$op]);\n }\n }\n }",
"public function setNextStatus()\n {\n if (!self::checkRole($this->currentUser->role_id, $this->roles)) {\n throw new StatusException('У вас недостаточно прав');\n }\n\n if ($this->task->status_id === $this->nextStatus) {\n throw new StatusException('Статус задания уже обновлен');\n }\n\n if (!self::checkAccessStatus($this->getCurrentStatus(), $this->accessStatuses)) {\n throw new StatusException('Ошибка смены статуса');\n } else {\n $this->task->status_id = $this->nextStatus;\n }\n }",
"public function disable() {\n\t\t$this->update(TRUE);\n\t}",
"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 payment_status_denied()\n {\n return $this->payment_status_failed();\n }",
"function cancel_account() {\n\t\tif ($this->dx_auth->is_logged_in()) {\t\t\t\n\t\t\t$val = $this->form_validation;\n\t\t\t\n\t\t\t// Set form validation rules\n\t\t\t$val->set_rules('password', 'Password', \"trim|required\");\n\t\t\t\n\t\t\t// Validate rules and change password\n\t\t\tif ($val->run() AND $this->dx_auth->cancel_account($val->set_value('password'))) {\n\t\t\t\t// Redirect to homepage\n\t\t\t\tredirect('', 'location');\n\t\t\t} else {\n\t\t\t\t$this->load->view($this->dx_auth->cancel_account_view);\n\t\t\t}\n\t\t} else {\n\t\t\t// Redirect to login page\n\t\t\t$this->dx_auth->deny_access('login');\n\t\t}\n\t}",
"public static function restore_enrol_returns() {\n return new external_value(PARAM_BOOL, 'Operation status');\n }",
"public function importStatus()\n\t{\n\t\t$option = get_option('social_curator_import_status');\n\t\tif ( !$option ) return 'pending';\n\t\treturn $option;\n\t}",
"public function checkBalance()\n {\n if ($this->_client) {\n $balance = $this->_client->checkBalance();\n\n if ($balance['balance'] <= env('SMS_CREDIT_THRESHOLD')) {\n // Send warning email\n $subject = 'SMS service balance running low';\n $vars = ['balance'=>$balance];\n \\Mail::send(['text'=>'errors.sms_balance'], $vars, function($message) use ($subject)\n {\n $message->to(env('DEVELOPER_EMAIL'))->subject($subject);\n });\n }\n }\n }",
"public function eliminate_trade_period($acc_number)\n\t{\n\n\t $data['timeline'] = 'closed';\n\t $data['timeline1'] = 'closed';\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 disable()\n {\n try {\n $sql = \"UPDATE s_core_paymentmeans SET active = '0' WHERE name = 'vrpay_cc'\";\n Shopware()->Db()->query($sql);\n $sql = \"UPDATE s_core_paymentmeans SET active = '0' WHERE name = 'vrpay_ccsaved'\";\n Shopware()->Db()->query($sql);\n $sql = \"UPDATE s_core_paymentmeans SET active = '0' WHERE name = 'vrpay_dd'\";\n Shopware()->Db()->query($sql);\n $sql = \"UPDATE s_core_paymentmeans SET active = '0' WHERE name = 'vrpay_ddsaved'\";\n Shopware()->Db()->query($sql);\n $sql = \"UPDATE s_core_paymentmeans SET active = '0' WHERE name = 'vrpay_giropay'\";\n Shopware()->Db()->query($sql);\n $sql = \"UPDATE s_core_paymentmeans SET active = '0' WHERE name = 'vrpay_klarnapaylater'\";\n Shopware()->Db()->query($sql);\n $sql = \"UPDATE s_core_paymentmeans SET active = '0' WHERE name = 'vrpay_klarnasliceit'\";\n Shopware()->Db()->query($sql);\n $sql = \"UPDATE s_core_paymentmeans SET active = '0' WHERE name = 'vrpay_paypal'\";\n Shopware()->Db()->query($sql);\n $sql = \"UPDATE s_core_paymentmeans SET active = '0' WHERE name = 'vrpay_paypalsaved'\";\n Shopware()->Db()->query($sql);\n $sql = \"UPDATE s_core_paymentmeans SET active = '0' WHERE name = 'vrpay_paydirekt'\";\n Shopware()->Db()->query($sql);\n $sql = \"UPDATE s_core_paymentmeans SET active = '0' WHERE name = 'vrpay_klarnaobt'\";\n Shopware()->Db()->query($sql);\n $sql = \"UPDATE s_core_paymentmeans SET active = '0' WHERE name = 'vrpay_easycredit'\";\n Shopware()->Db()->query($sql);\n return $result['success'] = true;\n } catch (Exception $e) {\n return $result['success'] = false;\n }\n }",
"public function cancel()\n {\n $this->confirmationArchived = false;\n }",
"protected function DecreaseLevel()\n {\n $level = $this->GetLevel();\n $prevLevel = $this->GetPrevLevel();\n $languageID = $this->GetLanguage()->GetId();\n \n $this->RecordLvlQAs();\n \n $nextLevel = $level - 1;\n \n if (LevelExists($languageID, $nextLevel))\n {\n $this->SetLevel($nextLevel);\n \n if ($prevLevel != $nextLevel)\n {\n $this->GetNewLvlQAs();\n }\n \n $this->SetPrevLevel($level);\n }\n }",
"function _cancel($info)\n\t{\n\t // Gan trang thai xac thuc\n\t $data = array();\n\t $data['status'] = mod('order')->status('canceled');\n\t\n\t // Cap nhat du lieu vao data\n\t model('user_bank')->update($info->id, $data);\n\t // Gui thong bao\n\t set_message(lang('notice_update_success'));\n\t return TRUE;\n\t}"
]
| [
"0.5592619",
"0.55083555",
"0.545465",
"0.5388921",
"0.537416",
"0.5373532",
"0.53614116",
"0.53355336",
"0.5323493",
"0.52330184",
"0.5220662",
"0.52162033",
"0.5183248",
"0.5176714",
"0.51657194",
"0.51603955",
"0.5147516",
"0.509922",
"0.5057416",
"0.50400716",
"0.5029536",
"0.50294083",
"0.5024618",
"0.5021185",
"0.50181794",
"0.50124794",
"0.5010621",
"0.50058025",
"0.50009215",
"0.49968818",
"0.49959043",
"0.49773312",
"0.49697915",
"0.49631104",
"0.4936307",
"0.49281377",
"0.49271768",
"0.492507",
"0.49170738",
"0.49087825",
"0.4908691",
"0.49086234",
"0.49085894",
"0.49025127",
"0.4891706",
"0.48859558",
"0.48766425",
"0.48653305",
"0.48649868",
"0.48635286",
"0.48603284",
"0.48594326",
"0.48500663",
"0.4848794",
"0.4845664",
"0.48456514",
"0.48379648",
"0.4830638",
"0.48270914",
"0.48254415",
"0.48226523",
"0.48219657",
"0.48196468",
"0.4817015",
"0.47965494",
"0.47927943",
"0.47765547",
"0.47697258",
"0.47689947",
"0.47636345",
"0.47608182",
"0.47583494",
"0.47577772",
"0.47576308",
"0.4756916",
"0.47541177",
"0.47495946",
"0.47484797",
"0.47411156",
"0.47397062",
"0.47375268",
"0.4736559",
"0.47348142",
"0.4726659",
"0.4723218",
"0.472134",
"0.4713921",
"0.4700173",
"0.46859416",
"0.46815866",
"0.46776226",
"0.4676762",
"0.46724012",
"0.46715817",
"0.4668326",
"0.46634206",
"0.4663209",
"0.46517587",
"0.46512803",
"0.46490648"
]
| 0.53406006 | 7 |
Show settings main page. | public function index()
{
$process = new Process ('tail -n 100 '.storage_path('logs/laravel.log'));
$process->run();
$applogs = $process->isSuccessful() ? $process->getOutput() : "Error while parsing application logs.";
$process = new Process ('tail -n 100 /var/log/syslog');
$process->run();
$syslogs = $process->isSuccessful() ? $process->getOutput() : "Error while parsing system logs.";
$process = new Process ('dmesg');
$process->run();
$dmesg = $process->isSuccessful() ? $process->getOutput() : "Error while parsing dmesg logs.";
$process = new Process ('ifconfig eth0 | grep -o -E \'([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}\'');
$process->run();
$mac_address = $process->isSuccessful() ? $process->getOutput() : "";
return response()->view('administrator.settings', ['syslogs' => $syslogs, 'applogs' => $applogs, 'dmesg' => $dmesg, 'mac_address' => $mac_address]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function settingsPage()\n\t{\n\t\t$this->setForms();\n\t\tinclude( \\GFormProtected\\Helpers::view('settings/settings') );\n\t}",
"public function settings_page() { ?>\n\n <div class=\"wrap\">\n <?php $this->settings_api->settings_html(); ?>\n </div><?php\n }",
"public function setting_page() {\n\n\t\techo '<div class=\"wrap\">';\n\t\tsettings_errors();\n\n\t\t$this->setting->show_navigation();\n\t\t$this->setting->show_forms();\n\n\t\techo '</div>';\n\t}",
"public function show_settings_page() : void {\n\t\t\t$categories = self::get_categories();\n\n\t\t\tSFWD_LMS::get_view(\n\t\t\t\t'support/help',\n\t\t\t\tarray(\n\t\t\t\t\t'categories' => $categories,\n\t\t\t\t),\n\t\t\t\ttrue\n\t\t\t);\n\t\t}",
"public function settings_page() {\n\t\t// Current tab.\n\t\t$tab = Template::current_tab();\n\n\t\t// Render settings header.\n\t\t$this->view( 'settings/common/header' );\n\n\t\t// Render settings page.\n\t\t$this->view( 'settings/settings', [\n\t\t\t'title' => Template::tabs()[ $tab ],\n\t\t\t'tab' => $tab,\n\t\t\t'form_url' => Template::settings_page(\n\t\t\t\t$tab,\n\t\t\t\t$this->is_network()\n\t\t\t),\n\t\t] );\n\n\t\t// Render settings footer.\n\t\t$this->view( 'settings/common/footer' );\n\t}",
"public function settings_page() {\n\t\tinclude_once( dirname( __FILE__ ) . '/class-vendor-admin-settings.php' );\n\t\tVendor_Admin_Settings::output();\n\t}",
"public function settings_page(){\n\t\t$page_base = $this->page_url();\n\t\tob_start();\n\t\t?>\n\t\t<div class=\"wp_lms settings\">\n\t\t\t<h1><?= $this::$name; ?> Settings Page</h1>\n\t\t\t\n\t\t</div>\n\t\t<?\n\t\tob_end_flush();\n\t}",
"public function settingsPage()\n {\n include 'views/admin.php';\n }",
"public function showSettingsPage()\n {\n\n $configFilePath = dirname(__DIR__) . '/../../../build/configs/pirrot_default.conf';\n if (file_exists('/etc/pirrot.conf')) {\n $configFilePath = '/etc/pirrot.conf';\n }\n\n // Get setting values from the configuration file.\n $config = new ConfManagerService($configFilePath);\n $configValues = $config->read();\n\n // Regex out the setting values and comments to provide a list of settings that we can render out.\n foreach ($this->fieldGroups as $field => $group) {\n\n if (!key_exists($field, $this->labelOverrides)) {\n $label = ucwords(str_replace('_', ' ', $field));\n } else {\n $label = $this->labelOverrides[$field];\n }\n\n // Get the value from the settings file...\n $value = $configValues[$field];\n\n $inputType = Setting::TYPE_TEXT;\n if (in_array($field, $this->booleanFields)) {\n $inputType = Setting::TYPE_BOOL;\n }\n\n $inputComments = null;\n if (key_exists($field, $this->fieldComments)) {\n $inputComments = $this->fieldComments[$field];\n }\n\n $panelInputs[$group][] = new Setting($field, $label, $group, $value, $inputType, $inputComments);\n }\n\n\n return view('_pages.settings')->with('panels', $panelInputs);\n }",
"public function render_settings_page()\n {\n }",
"public function render_settings_page() {\n\t\tinclude( get_inc_dir() . '/templates/admin-settings.php' );\n\t}",
"public function display_page() {\n include_once JPID_PLUGIN_DIR . 'includes/admin/pages/views/html-jpid-admin-settings-page.php';\n }",
"public function options_page() {\n\t\t$this->render_settings();\n\t}",
"public function settings(){\n\t\t$this->verify();\n\t\t$data['title']=\"Settings\";\n\t\t$this->load->view('parts/head', $data);\n\t\t$this->load->view('settings', $data);\n\t\t$this->load->view('parts/javascript', $data);\n\t}",
"function settings_page() {\n global $wpdb, $wp_properties;\n\n include_once( __DIR__ . '/ui/settings-section.php' );\n\n }",
"public function settingsview() {\r\n $this->logger->info(\"Action Settings View \");\r\n $this->template->display('listsettings', $this->combovalue, 'settings', '');\r\n }",
"public function index()\n\t{\n\t\t$this->set_page_title(_l('web_setup'));\n\t\t$data['settings'] = get_settings();\n\t\t$data['content'] = $this->load->view('admin/settings/index', $data, TRUE);\n\t\t$this->load->view('admin/layouts/index', $data);\n\t}",
"public function index()\n\t{\n\t\treturn view('pages.admin.settings', [\n\t\t\t'settings' => \\App\\Settings::first()\n\t\t]);\n\t}",
"public function mySettingsPage()\n {\n return view('frontEnd.usersPanel.settings');\n }",
"public function index()\n\t{\t\n\t\t$settings = Settings::all();\n\t\t$langs = Language::get();\n\t\t$this->layout = View::make('blogfolio::settings.index-settings', compact('settings', 'templates', 'langs'));\n $this->layout->title = trans('blogfolio::settings.settings');\n $this->layout->breadcrumb = Config::get('syntara::breadcrumbs.settings');\n\t}",
"public function general_settings_page() {\n include __DIR__ . \"/views/general_settings.php\";\n }",
"public function settings_page() {\n\n\t\t?>\n\n\t\t<div class=\"wrap schedule-a-visit-to-sherpa-settings\">\n\t\t\t\n\t\t\t<form id=\"schedule-a-visit-to-sherpa-form\" method=\"post\" action=\"options.php\">\n\t\t\t\t\n\t\t\t\t<?php echo wp_nonce_field( 'schedule_a_visit_to_sherpa_data', 'schedule_a_visit_to_sherpa_nonce' ); ?>\n\n\t\t\t\t<?php settings_fields( 'schedule_a_visit_to_sherpa_settings_section' ); ?>\n\n\t\t\t\t<?php do_settings_sections( 'schedule-a-visit-to-sherpa' ); ?>\n\t\t\t\t\n\t\t\t\t<?php submit_button(); ?>\n\n\t\t\t</form>\n\n </div>\n\n\t\t<?php\n\n\t}",
"public function showSettings()\n\t{\n\n\t\treturn $this->showDefaultSettings();\n\t}",
"function settings_page() { include($this->plugin_basename . '/core/admin/settings.php'); }",
"public function index()\n {\n $this->view->title = 'Settings';\n return $this->view('settings.index');\n }",
"public function settings_view()\n {\n $this->register_handler('plugin.settingsform', array($this, 'settings_form'));\n $this->register_handler('plugin.settingslist', array($this, 'settings_list'));\n $this->register_handler('plugin.factoradder', array($this, 'settings_factoradder'));\n $this->register_handler('plugin.highsecuritydialog', array($this, 'settings_highsecuritydialog'));\n\n $this->include_script('kolab2fa.js');\n $this->include_stylesheet($this->local_skin_path() . '/kolab2fa.css');\n\n if ($this->check_secure_mode()) {\n $this->api->output->set_env('session_secured', $_SESSION['kolab_2fa_secure_mode']);\n }\n\n $this->api->output->add_label('save','cancel');\n $this->api->output->set_pagetitle($this->gettext('settingstitle'));\n $this->api->output->send('kolab_2fa.config');\n }",
"public function plugin_settings_page() {\r\n\t\t\tif ( ! current_user_can( 'manage_options' ) ) {\r\n\t\t\t\twp_die( esc_html( 'You do not have sufficient permissions to access this page.' ) );\r\n\t\t\t}\r\n\r\n\t\t\t// Render the settings template.\r\n\t\t\tinclude( sprintf( '%s/templates/settings.php', dirname( __FILE__ ) ) );\r\n\t\t}",
"public function show(Settings $settings)\n {\n //\n }",
"public function settingsPage() {\n require_once 'form.phtml';\n }",
"public function index()\n {\n $data = $this->sensitive->first();\n return view('admin.pages.settings', compact('data'));\n }",
"public function main_options_page(){\n\t\t$page_base = $this->page_url();\n\t\tob_start();\n\t\t?>\n\t\t<div class=\"wp_lms settings\">\n\t\t\t<h1>GrandPubbah</h1>\n\n\t\t</div>\n\t\t<?\n\t\tob_end_flush();\n\t}",
"public function index()\n\t{\n\t\t$settings = Settings::first();\n\t\treturn view('admin.settings' , compact('settings')) ;\n\t}",
"public function getSettings()\n {\n $this->view('user.settings');\n }",
"public static function settings_page() {\r\n\t\treturn '';\r\n\t}",
"public function show_settings() {\n\n\t\twoocommerce_admin_fields( $this->get_settings() );\n\t}",
"function settings_page() {\n\t\textract( $this->group, EXTR_OVERWRITE ); ?>\n\n\t<div class=\"wrap\">\n\t\t<?php screen_icon(); ?>\n\t\t<h2><?php echo esc_html( $page_title ) ?></h2>\n\t\t<?php do_action( \"{$prefix}_kc_settings_page_before\", $this->group ) ?>\n\t\t<form action=\"options.php\" method=\"post\" id=\"kc-settings-form\">\n\t\t\t<?php\n\t\t\t\t# The hidden fields\n\t\t\t\tsettings_fields( \"{$prefix}_settings\" );\n\n\t\t\t\tswitch ( $this->group['display'] ) {\n\t\t\t\t\tcase 'metabox' :\n\t\t\t\t\t\t$this->metabox->display();\n\t\t\t\t\tbreak;\n\t\t\t\t\tcase 'plain' :\n\t\t\t\t\t\tforeach ( $this->group['options'] as $section ) :\n\t\t\t\t\t\t?>\n\t\t\t\t\t\t<h3><?php echo esc_html( $section['title'] ) ?></h3>\n\t\t\t\t\t\t<?php\n\t\t\t\t\t\t\t$this->settings_section( $section );\n\t\t\t\t\t\tendforeach;\n\t\t\t\t\t\tsubmit_button( __( 'Save Changes' ) );\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\t\t\t?>\n\t\t</form>\n\t\t<?php do_action( \"{$prefix}_kc_settings_page_after\", $this->group ) ?>\n\t</div>\n\t<?php }",
"public function settings()\n\t{\n\n $this->load->view('back/lib/header');\n\t\t$this->load->view('back/settings');\n\t\t$this->load->view('back/lib/footer');\n\t\t\n\t}",
"function showGeneralPageEditorSettingsObject()\n\t{\n\t\tglobal $tpl, $ilTabs;\n\n\t\t$this->addPageEditorSettingsSubTabs();\n\t\t$ilTabs->activateTab(\"adve_page_editor_settings\");\n\t\t\n\t\t$form = $this->initGeneralPageSettingsForm();\n\t\t$tpl->setContent($form->getHTML());\n\t}",
"public function adminPluginOptionsPage()\n {\n echo $this->_loadView('admin-settings-page');\n }",
"function DisplaySettings()\n {\n $this->DisplayBreadcrumb();\n PrintPluginSettings($this->pluginid, array('form_wizard_settings','form_export_settings'), $this->_page);\n }",
"public function settings_page()\n {\n\n // Build page HTML\n $html = '<div class=\"wrap\" id=\"' . $this->parent->_token . '_settings\">' . \"\\n\";\n $html .= '<h2>' . __('SUAPI Settings', 'wp-suapi') . '</h2>' . \"\\n\";\n\n $tab = '';\n if (isset($_GET['tab']) && $_GET['tab']) {\n $tab .= $_GET['tab'];\n }\n\n // Show page tabs\n if (is_array($this->settings) && 1 < count($this->settings)) {\n\n $html .= '<h2 class=\"nav-tab-wrapper\">' . \"\\n\";\n\n $c = 0;\n foreach ($this->settings as $section => $data) {\n\n // Set tab class\n $class = 'nav-tab';\n if (!isset($_GET['tab'])) {\n if (0 == $c) {\n $class .= ' nav-tab-active';\n }\n } else {\n if (isset($_GET['tab']) && $section == $_GET['tab']) {\n $class .= ' nav-tab-active';\n }\n }\n\n // Set tab link\n $tab_link = add_query_arg(array('tab' => $section));\n if (isset($_GET['settings-updated'])) {\n $tab_link = remove_query_arg('settings-updated', $tab_link);\n }\n\n // Output tab\n $html .= '<a href=\"' . $tab_link . '\" class=\"' . esc_attr($class) . '\">' . esc_html($data['title']) . '</a>' . \"\\n\";\n\n ++$c;\n }\n\n $html .= '</h2>' . \"\\n\";\n }\n\n $html .= '<form method=\"post\" action=\"options.php\" enctype=\"multipart/form-data\">' . \"\\n\";\n\n // Get settings fields\n ob_start();\n settings_fields($this->parent->_token . '_settings');\n do_settings_sections($this->parent->_token . '_settings');\n $html .= ob_get_clean();\n\n $html .= '<p class=\"submit\">' . \"\\n\";\n $html .= '<input type=\"hidden\" name=\"tab\" value=\"' . esc_attr($tab) . '\" />' . \"\\n\";\n $html .= '<input name=\"Submit\" type=\"submit\" class=\"button-primary\" value=\"' . esc_attr(__('Save Settings', 'wp-suapi')) . '\" />' . \"\\n\";\n $html .= '</p>' . \"\\n\";\n $html .= '</form>' . \"\\n\";\n $html .= '</div>' . \"\\n\";\n\n echo $html;\n }",
"function hoopsai_wp_settings_do_page() {\n ?>\n <div id=\"hoopsai_wp_settings\"></div>\n <?php\n }",
"public function settings()\n {\n $this->authCheck();\n\n $settings = DB::table('site_settings')\n ->get();\n \n $settings=view('admin.settings')\n ->with('settings',$settings);\n\n return view('admin.master')\n ->with('main_content',$settings);\n }",
"public function settings_page() {\r\n\t\tif ( ! isset( $this->hook_suffix ) )\r\n\t\t\treturn;\r\n\r\n\t\tadd_action( 'inf_member_settings_after_header_' . $this->hook_suffix, array( 'Inf_Member_App_Settings', 'after_header' ) );\r\n\r\n Inf_Member_Settings::settings_page_template( $this->hook_suffix, __( 'Inf Member Settings', 'inf-member' ) );\r\n\t}",
"public function settings_page() {\n do_action( 'rewardpoint_settings_start' );\n $current_tab = empty( $_GET['tab'] ) ? 'behavior' : sanitize_title( $_GET['tab'] );\n $current_section = empty( $_REQUEST['section'] ) ? '' : sanitize_title( $_REQUEST['section'] );\n $tabs = apply_filters( 'woocommerce_settings_tabs_array', array(\n 'behavior' => 'Behaviors',\n 'purchase' => 'Purchases',\n 'referral' => 'Referrals',\n 'invite' => 'Invite and Share',\n 'user-point' => 'Use Reward Points',\n ) );\n include 'views/html-admin-page.php';\n\t}",
"public function managesettingsview() {\r\n $this->logger->info(\"Action Manage Settings View \");\r\n $this->template->display('displaylistsettings', $this->combovalue, 'settings', '', '');\r\n }",
"public function index()\n\t{\n\t\t$settings = Setting::first();\n\t\treturn view('admin.settings.index')\n\t\t\t->with('settings', $settings);\n\t}",
"public function show()\n {\n $settings = Settings::getAllSettings();\n\n return view('settings')->with('settings', $settings);\n }",
"public function settings()\n {\n\n $this->data['page'] = 'settings';\n $this->data['user'] = $this->user;\n\n // get privacy settings\n\n $my_privacy = explode(',',$this->user['privacy_settings']);\n\n $this->data['settings'] = $my_privacy;\n\n $this->load->view('/dash/header',$this->data);\n $this->load->view('/dash/settings',$this->data);\n $this->load->view('/dash/footer',$this->data);\n\n }",
"public function viewSettings(array $settings = array());",
"public function settings_page() {\n\t\tTheme_My_Login_Admin::settings_page( array(\n\t\t\t'title' => __( 'Theme My Login reCAPTCHA Settings', 'theme-my-login' ),\n\t\t\t'options_key' => $this->options_key\n\t\t) );\n\t}",
"public function index()\n {\n return view('admin.setting.settings')->with('settings',Setting::first());\n }",
"public function display_plugin_admin_page() {\n\t\t\tinclude_once( 'views/settings-page.php' );\n\t\t}",
"public function settings_page () {\n\n // Build page HTML\n $html = '<div class=\"wrap\" id=\"' . $this->_token . '_settings\">' . \"\\n\";\n $html .= '<h2>' . __( 'Plugin Settings' , 'listeo_core' ) . '</h2>' . \"\\n\";\n\n $tab = '';\n if ( isset( $_GET['tab'] ) && $_GET['tab'] ) {\n $tab .= $_GET['tab'];\n }\n\n // Show page tabs\n if ( is_array( $this->settings ) && 1 < count( $this->settings ) ) {\n\n $html .= '<h2 class=\"nav-tab-wrapper\">' . \"\\n\";\n\n $c = 0;\n foreach ( $this->settings as $section => $data ) {\n\n // Set tab class\n $class = 'nav-tab';\n if ( ! isset( $_GET['tab'] ) ) {\n if ( 0 == $c ) {\n $class .= ' nav-tab-active';\n }\n } else {\n if ( isset( $_GET['tab'] ) && $section == $_GET['tab'] ) {\n $class .= ' nav-tab-active';\n }\n }\n\n // Set tab link\n $tab_link = add_query_arg( array( 'tab' => $section ) );\n if ( isset( $_GET['settings-updated'] ) ) {\n $tab_link = remove_query_arg( 'settings-updated', $tab_link );\n }\n\n // Output tab\n $html .= '<a href=\"' . $tab_link . '\" class=\"' . esc_attr( $class ) . '\">' . esc_html( $data['title'] ) . '</a>' . \"\\n\";\n\n ++$c;\n }\n\n $html .= '</h2>' . \"\\n\";\n }\n\n $html .= '<form method=\"post\" action=\"options.php\" enctype=\"multipart/form-data\">' . \"\\n\";\n\n // Get settings fields\n ob_start();\n settings_fields( $this->_token . '_settings' );\n do_settings_sections( $this->_token . '_settings' );\n $html .= ob_get_clean();\n\n $html .= '<p class=\"submit\">' . \"\\n\";\n $html .= '<input type=\"hidden\" name=\"tab\" value=\"' . esc_attr( $tab ) . '\" />' . \"\\n\";\n $html .= '<input name=\"Submit\" type=\"submit\" class=\"button-primary\" value=\"' . esc_attr( __( 'Save Settings' , 'listeo_core' ) ) . '\" />' . \"\\n\";\n $html .= '</p>' . \"\\n\";\n $html .= '</form>' . \"\\n\";\n $html .= '</div>' . \"\\n\";\n\n echo $html;\n }",
"public function index() {\n $results = $this->settingsRepository->getValue();\n $settings = $results->isNotEmpty() ? $results->all() : [];\n return view('admin.settings', [\n 'settings' => $settings,\n ]);\n }",
"function showSettings() {\n global $objTemplate,$_ARRAYLANG;\n $template = new \\Cx\\Core\\Html\\Sigma();\n $objTemplate->addBlockfile('ADMIN_CONTENT', 'settings_system', 'settings.html');\n $templateObj = new \\Cx\\Core\\Html\\Sigma(ASCMS_CORE_PATH . '/Config/View/Template/Backend');\n $templateObj->loadTemplateFile('development_tools.html');\n $templateObj->setVariable(array(\n 'TXT_TITLE_SET5' => $_ARRAYLANG['TXT_SETTINGS_TITLE_DEVELOPMENT'],\n 'TXT_DEBUGGING_STATUS' => $_ARRAYLANG['TXT_DEBUGGING_STATUS'],\n 'TXT_DEBUGGING_FLAGS' => $_ARRAYLANG['TXT_DEBUGGING_FLAGS'],\n 'TXT_SETTINGS_DEBUGGING_FLAG_LOG' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_LOG'],\n 'TXT_SETTINGS_DEBUGGING_FLAG_PHP' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_PHP'],\n 'TXT_SETTINGS_DEBUGGING_FLAG_DB' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_DB'],\n 'TXT_SETTINGS_DEBUGGING_FLAG_DB_TRACE' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_DB_TRACE'],\n 'TXT_SETTINGS_DEBUGGING_FLAG_DB_CHANGE' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_DB_CHANGE'],\n 'TXT_SETTINGS_DEBUGGING_FLAG_DB_ERROR' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_DB_ERROR'],\n 'TXT_SETTINGS_DEBUGGING_FLAG_LOG_FILE' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_LOG_FILE'],\n 'TXT_SETTINGS_DEBUGGING_FLAG_LOG_FIREPHP' => $_ARRAYLANG['TXT_SETTINGS_DEBUGGING_FLAG_LOG_FIREPHP'],\n 'TXT_DEBUGGING_EXPLANATION' => $_ARRAYLANG['TXT_DEBUGGING_EXPLANATION'],\n 'TXT_SAVE_CHANGES' => $_ARRAYLANG['TXT_SAVE'],\n 'TXT_RADIO_ON' => $_ARRAYLANG['TXT_ACTIVATED'],\n 'TXT_RADIO_OFF' => $_ARRAYLANG['TXT_DEACTIVATED']\n ));\n if (in_array('SystemInfo', \\Env::get('cx')->getLicense()->getLegalComponentsList())) {\n if (isset($_POST['debugging'])) {\n $this->updateDebugSettings($_POST['debugging']);\n }\n $this->setDebuggingVariables($templateObj);\n }\n \\Cx\\Core\\Setting\\Controller\\Setting::init('Config', null, 'Yaml', null, \\Cx\\Core\\Setting\\Controller\\Setting::REPOPULATE);\n \\Cx\\Core\\Setting\\Controller\\Setting::storeFromPost();\n \n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'site');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n $_ARRAYLANG['TXT_CORE_CONFIG_SITE'],\n $_ARRAYLANG['TXT_CORE_CONFIG_SITE'],\n 'TXT_CORE_CONFIG_',\n !$this->isWritable()\n );\n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'contactInformation');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n $_ARRAYLANG['TXT_CORE_CONFIG_CONTACTINFORMATION'],\n $_ARRAYLANG['TXT_CORE_CONFIG_CONTACTINFORMATION'],\n 'TXT_CORE_CONFIG_',\n !$this->isWritable()\n );\n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'administrationArea');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n $_ARRAYLANG['TXT_CORE_CONFIG_ADMINISTRATIONAREA'], \n $_ARRAYLANG['TXT_CORE_CONFIG_ADMINISTRATIONAREA'], \n 'TXT_CORE_CONFIG_',\n !$this->isWritable()\n );\n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'security');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n $_ARRAYLANG['TXT_CORE_CONFIG_SECURITY'],\n $_ARRAYLANG['TXT_CORE_CONFIG_SECURITY'],\n 'TXT_CORE_CONFIG_',\n !$this->isWritable()\n );\n if (in_array('SystemInfo', \\Env::get('cx')->getLicense()->getLegalComponentsList())) {\n \\Cx\\Core\\Setting\\Controller\\Setting::show_external(\n $template,\n $_ARRAYLANG['TXT_SETTINGS_TITLE_DEVELOPMENT'],\n $templateObj->get()\n );\n }\n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'otherConfigurations');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n $_ARRAYLANG['TXT_CORE_CONFIG_OTHERCONFIGURATIONS'],\n $_ARRAYLANG['TXT_CORE_CONFIG_OTHERCONFIGURATIONS'],\n 'TXT_CORE_CONFIG_',\n !$this->isWritable()\n );\n\n\n // show also hidden settins\n if ( in_array('SystemInfo', \\Env::get('cx')->getLicense()->getLegalComponentsList())\n && \\Permission::hasAllAccess()\n && isset($_GET['all'])\n ) {\n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'core');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n 'CORE',\n 'CORE', \n 'TXT_CORE_CONFIG_',\n true\n );\n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'release');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n 'RELEASE',\n 'RELEASE',\n 'TXT_CORE_CONFIG_',\n true\n );\n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'component');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n 'COMPONENT',\n 'COMPONENT',\n 'TXT_CORE_CONFIG_',\n !$this->isWritable()\n );\n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'license');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n 'LICENSE', \n 'LICENSE', \n 'TXT_CORE_CONFIG_',\n true\n );\n \\Cx\\Core\\Setting\\Controller\\Setting::setEngineType('Config', 'Yaml', 'cache');\n \\Cx\\Core\\Setting\\Controller\\Setting::show(\n $template,\n 'index.php?cmd=Config',\n 'CACHE', \n 'CACHE', \n 'TXT_CORE_CONFIG_',\n true\n );\n }\n $this->checkFtpAccess();\n $objTemplate->setVariable('SETTINGS_TABLE', $template->get());\n $objTemplate->parse('settings_system');\n }",
"public function index()\n {\n if (!Gate::allows(Abilities::VIEW)) {\n abort(401);\n }\n $settings = $this->settingsService->index();\n return view('admin.settings')->with('settings',$settings);\n }",
"public function index()\n {\n abort_unless(Gate::allows('setting_access') || Auth::user()->is_superadmin, 403);\n\n $settings = Setting::all();\n\n return view('admin.settings.index', compact('settings'));\n }",
"public function index()\n {\n $data['settingsMenu'] = 1;\n $data['settings'] = Setting::all();\n\n return view('settings.index', $data);\n }",
"public function index()\n {\n return view('pages.settings.settings.index');\n }",
"public function settings() \n {\n if (!isset($_SESSION)) { \n session_start(); \n }\n $title = 'User Settings';\n require('../src/View/UserSettingsView.php');\n }",
"public function index()\n {\n return view('predictionio::admin.settings');\n }",
"public function index()\n {\n $this->checkPermission('settings-manage');\n $this->setPageTitle('Settings');\n\n // Get application version\n $version = trim(file_get_contents(base_path('version')));\n\n return view('settings/index', ['version' => $version]);\n }",
"public function settings_screen() {\n\t\tglobal ${class_name};\n\t\tdo_action( ${class_name}->token . '_before_settings' );\n\t\tdo_action( $this->token . '_before_settings' );\n\t\tsettings_fields( $this->token );\n\t\tdo_settings_sections( $this->token );\n\t\tdo_action( $this->token . '_after_settings' );\n\t\tdo_action( ${class_name}->token . '_after_settings' );\n\t\tsubmit_button();\n\t}",
"public function settings_page()\r\n {\r\n add_submenu_page('giga',\r\n __('Notifications', 'giga-messenger-bots'),\r\n __('Notifications', 'giga-messenger-bots'),\r\n 'manage_options',\r\n 'notifications',\r\n [$this, 'render']\r\n );\r\n }",
"public function get_settings()\n {\n $data['menu_active'] = 'settings';\n $data['title'] = \"General Settings\";\n $data['settings'] = Settings::get();\n return view('admin.settings.index', $data);\n }",
"public function index()\n {\n $app_data = AppSettings::first();\n return view('Backend.Settings.settings', ['app_data' => $app_data]);\n }",
"public function initialize_settings_page()\n {\n }",
"public function index()\n {\n $settings = Setting::all();\n\n return view('backend.settings.edit', [\n 'about' => Setting::get('about'),\n 'twitter' => Setting::get('twitter'),\n 'facebook' => Setting::get('facebook'),\n 'about_image_url' => Setting::get('app_avatar'),\n 'app_contact_email' => Setting::get('app_contact_email'),\n 'google_analytics_code' => Setting::get('google_analytics_code')\n ]);\n }",
"public function actionSettings(){\n $user = Users::findOne(\\Yii::$app->user->getId());\n return $this->render('settings', ['user'=>$user]);\n }",
"private function settings()\n\t{\n\t\tif($_POST)\n\t\t{\n\t\t\t// Available Vews\n config::set('s7n.views', $this->input->post('views'));\n\n\t\t\t// Default Sidebar Title\n config::set('s7n.default_sidebar_title', $this->input->post('default_sidebar_title'));\n\n\t\t\t// Default Sidebar Content\n config::set('s7n.default_sidebar_content', $this->input->post('default_sidebar_content'));\n\n\t\t\tmessage::info(__('Page Settings edited successfully'), 'admin/page/settings');\n\t\t}\n\n\t\t$this->head->title->append(__('Settings'));\n\n\t\t$this->template->title .= __('Settings');\n\t\t$this->template->content = View::factory('page/settings', array(\n\t\t\t'views' => config::get('s7n.page_views'),\n\t\t\t'default_sidebar_title' => config::get('s7n.default_sidebar_title'),\n\t\t\t'default_sidebar_content' => config::get('s7n.default_sidebar_content')\n\t\t));\n\t}",
"public function index()\n\t{\n\t\t$settings = Setting::all();\n\t\t\n\t\treturn view('admin.settings.index',compact('settings'));\n\t}",
"public function create_plugin_settings_page()\n {\n require_once 'views/settings.phtml';\n }",
"function thirty8_simple_map_settings_page()\n\t\t\t{\n\t\t\t\t//include('admin/settings.php');\n\t\t\t}",
"public function plugin_page() {\n\t\t$this->setting_api->show_forms();\n\t}",
"public function show_settings_page() : void {\n\t\t\t$stripe_connect_connected = Stripe_Connect::is_stripe_connected();\n\t\t\t$stripe_connect_activated = LearnDash_Settings_Section::get_section_setting( 'LearnDash_Settings_Section_Stripe_Connect', 'enabled' ) === 'yes';\n\t\t\t$stripe_connect_needs_activation = $stripe_connect_connected && ! $stripe_connect_activated;\n\t\t\t$stripe_connect_completed = $stripe_connect_connected && $stripe_connect_activated;\n\t\t\t$stripe_activation_url = add_query_arg(\n\t\t\t\tarray(\n\t\t\t\t\t'page' => self::SETUP_SLUG,\n\t\t\t\t\t'action' => self::ACTIVATION_URL_SLUG,\n\t\t\t\t\t'nonce' => wp_create_nonce( self::ACTIVATION_URL_SLUG ),\n\t\t\t\t),\n\t\t\t\tadmin_url( 'admin.php' )\n\t\t\t);\n\n\t\t\t/**\n\t\t\t * Filters steps shown on setup page.\n\t\t\t *\n\t\t\t * @since 4.4.0\n\t\t\t *\n\t\t\t * @param array $steps List of steps with arguments.\n\t\t\t */\n\t\t\t$steps = apply_filters(\n\t\t\t\t'learndash_setup_steps',\n\t\t\t\tarray(\n\t\t\t\t\t'site_setup' => array(\n\t\t\t\t\t\t'class' => 'setup',\n\t\t\t\t\t\t'completed' => 'completed' === get_option( 'learndash_setup_wizard_status' ),\n\t\t\t\t\t\t'time_in_minutes' => 5,\n\t\t\t\t\t\t'url' => admin_url( 'admin.php?page=learndash-setup-wizard' ),\n\t\t\t\t\t\t'title' => __( 'Set up your site', 'learndash' ),\n\t\t\t\t\t\t'description' => __( 'This is where the fun begins.', 'learndash' ),\n\t\t\t\t\t\t'action_label' => __( 'Site & Course Details', 'learndash' ),\n\t\t\t\t\t\t'action_description' => __( 'Tell us a little bit about your site.', 'learndash' ),\n\t\t\t\t\t\t'icon_url' => LEARNDASH_LMS_PLUGIN_URL . '/assets/images/setup.png',\n\t\t\t\t\t\t'button_type' => 'arrow',\n\t\t\t\t\t\t'button_class' => '',\n\t\t\t\t\t\t'button_text' => '',\n\t\t\t\t\t),\n\t\t\t\t\t'design_setup' => array(\n\t\t\t\t\t\t'class' => 'design',\n\t\t\t\t\t\t'completed' => 'completed' === get_option( 'learndash_design_wizard_status' ),\n\t\t\t\t\t\t'time_in_minutes' => 5,\n\t\t\t\t\t\t'url' => admin_url( 'admin.php?page=learndash-design-wizard' ),\n\t\t\t\t\t\t'title' => __( 'Design your site', 'learndash' ),\n\t\t\t\t\t\t'description' => __( 'It\\'s all about appearances.', 'learndash' ),\n\t\t\t\t\t\t'action_label' => __( 'Select A Starter Template', 'learndash' ),\n\t\t\t\t\t\t'action_description' => __( 'Choose a design to start with and customize. This will overwrite your current theme, may add additional content and change settings on your site.', 'learndash' ),\n\t\t\t\t\t\t'icon_url' => LEARNDASH_LMS_PLUGIN_URL . '/assets/images/design.png',\n\t\t\t\t\t\t'button_type' => 'arrow',\n\t\t\t\t\t\t'button_class' => '',\n\t\t\t\t\t\t'button_text' => '',\n\t\t\t\t\t),\n\t\t\t\t\t'payment_setup' => array(\n\t\t\t\t\t\t'class' => 'payment',\n\t\t\t\t\t\t'completed' => $stripe_connect_completed,\n\t\t\t\t\t\t'time_in_minutes' => $stripe_connect_needs_activation ? null : 5,\n\t\t\t\t\t\t'url' => $stripe_connect_needs_activation ? $stripe_activation_url : Stripe_Connect::generate_connect_url(),\n\t\t\t\t\t\t'title' => __( 'Configure payment', 'learndash' ),\n\t\t\t\t\t\t'description' => __( 'Don\\'t leave money on the table.', 'learndash' ),\n\t\t\t\t\t\t'action_label' => __( 'Set Up Stripe', 'learndash' ),\n\t\t\t\t\t\t'action_description' => __( 'Charge credit cards and pay low merchant fees.', 'learndash' ),\n\t\t\t\t\t\t'icon_url' => LEARNDASH_LMS_PLUGIN_URL . '/assets/images/payment.png',\n\t\t\t\t\t\t'button_type' => 'button',\n\t\t\t\t\t\t'button_class' => 'button-stripe',\n\t\t\t\t\t\t'button_text' => $stripe_connect_needs_activation ? __( 'Activate', 'learndash' ) : __( 'Connect Stripe', 'learndash' ),\n\t\t\t\t\t),\n\t\t\t\t\t'documentation' => array(\n\t\t\t\t\t\t'class' => 'courses',\n\t\t\t\t\t\t'completed' => null,\n\t\t\t\t\t\t'time_in_minutes' => null,\n\t\t\t\t\t\t'url' => null,\n\t\t\t\t\t\t'title' => __( 'Manage your courses', 'learndash' ),\n\t\t\t\t\t\t'description' => __( 'Get your coursework set up for success.', 'learndash' ),\n\t\t\t\t\t\t'action_label' => null,\n\t\t\t\t\t\t'action_description' => null,\n\t\t\t\t\t\t'icon_url' => null,\n\t\t\t\t\t\t'button_type' => null,\n\t\t\t\t\t\t'button_class' => null,\n\t\t\t\t\t\t'button_text' => null,\n\t\t\t\t\t\t'content_path' => 'setup/components/content-documentation',\n\t\t\t\t\t),\n\t\t\t\t)\n\t\t\t);\n\n\t\t\tSFWD_LMS::get_view(\n\t\t\t\t'setup/setup',\n\t\t\t\tarray(\n\t\t\t\t\t'steps' => $steps,\n\t\t\t\t\t'setup_wizard' => $this,\n\t\t\t\t\t'overview_video' => Help_Page::get_articles( 'overview_video' )[0],\n\t\t\t\t\t'overview_article' => Help_Page::get_articles( 'overview_article' )[0],\n\t\t\t\t),\n\t\t\t\ttrue\n\t\t\t);\n\t\t}",
"public function settings()\n {\n if ($_SESSION['role'] == 1)\n { \n $this->view('AdminDashboard/settings', ['viewName' => 'Dashboard - Settings']);\n }\n else\n {\n header('location: '.URL.'Login');\n }\n }",
"public function display_options_page() {\n\t\t?>\n\t\t<div class=\"wrap ee-breakouts-admin\">\n\t\t\t<div id=\"icon-options-general\" class=\"icon32\"></div>\n\t\t\t<h2><?php _e('EE Breakouts Settings', 'event_espresso'); ?></h2>\n\t\t\t<div id=\"poststuff\">\n\t\t\t\t<div id=\"post-body-content\">\n\t\t\t\t\t<div class=\"form-wrap\">\n\t\t\t\t\t\t<form action=\"options.php\" method=\"post\">\n\t\t\t\t\t\t\t<?php settings_fields('ee_breakout_options'); ?>\n\t\t\t\t\t\t\t<?php do_settings_sections('ee_breakouts_admin'); ?>\n\t\t\t\t\t\t\t<span class=\"submit\">\n\t\t\t\t\t\t\t\t<input type=\"submit\" class=\"button primary-button\" name=\"update_ee_breakout_options\" value=\"Save Options\" />\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</form>\n\t\t\t\t\t</div> <!-- end .form-wrap -->\n\t\t\t\t</div> <!-- end #post-body-content -->\n\t\t\t</div> <!-- end #poststuff -->\n\t\t</div> <!-- end .wrap -->\n\t\t<?php\n\t}",
"public function settings() {\n $user = Auth::user();\n return view('site.settings', compact('user'));\n }",
"public function define_settings_page() {\n\t\t$this->hook_suffix = add_options_page(\n\t\t\t__( 'Top Story Options', 'top-story' ),\n\t\t\t__( 'Top Story', 'top-story' ),\n\t\t\t'manage_options',\n\t\t\t$this->menu_slug,\n\t\t\tarray( $this, 'option_page' )\n\t\t);\n\t}",
"public function settings_screen () {\n \n $this->ui->get_header();\n\n $screen = $this->ui->get_current_screen();\n\n switch ( $screen ) {\n //** Products screen. */\n case 'more_products':\n $this->more_products = $this->get_more_products();\n require_once( $this->screens_path . 'screen-more.php' );\n break;\n //** Licenses screen. */\n case 'licenses':\n default:\n $this->ensure_keys_are_actually_active();\n $this->installed_products = $this->get_detected_products();\n $this->pending_products = $this->get_pending_products();\n require_once( $this->screens_path . 'screen-manage-' . $this->type . '.php' );\n break;\n }\n\n $this->ui->get_footer();\n }",
"public function index()\n {\n $settings = Setting::find(1);\n $airtables = Airtables::all();\n\n return view('backEnd.pages.settings', compact('settings', 'airtables'));\n }",
"public function pluginReadSettingsPage()\n {\n $this->getOptions();\n global $rundizable_wp_features_optname;\n\n $output['rundizable_wp_features_optname'] = $rundizable_wp_features_optname;\n\n $Loader = new \\RundizableWpFeatures\\App\\Libraries\\Loader();\n $Loader->loadView('admin/readsettings_v', $output);\n unset($Loader, $output);\n }",
"function settings()\r\n\t\t{\r\n\t\t\tJRequest::setVar( 'view', 'qrcode' );\r\n\t\t\tJRequest::setVar( 'layout', 'settings' );\r\n\t\t\tJRequest::setVar( 'hidemainmenu', 0 );\r\n\t\t\tparent::display();\r\n\t\t}",
"public function index()\n {\n $site = $this->cart->getSite();\n \n return $this->view('site.settings.content', compact('site')); \n }",
"public function settings()\n {\n $result = $this->dtbs->list('site_settings');\n $data['info'] = $result;\n $this->load->view('back/settings/anasehife',$data);\n }",
"public function index()\n {\n\n $settings = Setting::all();\n\n\n return View('admin.settings.index', compact('settings'));\n }",
"public function init_settings_page()\n\t\t{\n\n\t\t\t$this->template_header();\n\t\t\t$this->template_body();\n\t\t\t$this->template_footer();\n\n\t\t}",
"public function settings_view() {\n?>\n\t\t<div class=\"wrap\">\n\t\t\t<h2><?php _e('Google Analytics Options', 'wp-google-analytics') ?></h2>\n\t\t\t<form action=\"options.php\" method=\"post\" id=\"wp_google_analytics\">\n\t\t\t\t<?php\n\t\t\t\t\tsettings_fields( 'wga' );\n\t\t\t\t\tdo_settings_sections( 'wga' );\n\t\t\t\t\tsubmit_button( __( 'Update Options', 'wp-google-analytics' ) );\n\t\t\t\t?>\n\t\t\t</form>\n\t\t</div>\n<?php\n\t}",
"public function index()\n {\n //\n\n $settings = Setting::all();\n\n return view('admin.settings.index', compact('settings'));\n }",
"public function index()\n {\n $settings = Setting::all();\n return view('admin.settings.index', compact('settings'));\n }",
"public function optionsdemo_settings_content() { ?>\n\t\t\t<div class=\"wrap\">\t\t\t\t\n\t\t\t\t<form method=\"POST\" action=\"options.php\">\n\t\t\t\t\t<?php\n\t\t\t\t\tsettings_fields( 'optionsdemo' );\n\t\t\t\t\tdo_settings_sections( 'optionsdemo' );\n\t\t\t\t\tsubmit_button();\n\t\t\t\t\t?>\n\t\t\t\t</form>\n\t\t\t</div> <?php\n\t\t}",
"public function page(){\n\t\t$pageLoader = $this->plugin->library('Page');\n\t\t$pageLoader->load('admin/settings');\n\t}",
"public function maz_hspm_settings_content() {\n ?>\n <div class=\"wrap\">\n <h2>Halve Spacers On Mobile Settings</h2>\n <form method=\"post\" action=\"options.php\">\n <br>\n <hr>\n <br>Breakpoint configures the screen width in pixels when the spacers change size.\n <br>Ratio defines the amount of change. For example, 0.5 will halve the size, 2 will double it.\n <br>\n\n <?php\n # Places all the fields defined above and the submit button in the markup\n settings_fields( 'maz_hspm_fields' );\n do_settings_sections( 'maz_hspm_fields' );\n submit_button();\n ?>\n </form>\n <div class=\"\">\n A Plugin by Moritz Zimmer, 2020\n </div>\n </div>\n <?php\n }",
"public function settings() {\n\n\t\tdo_settings_sections( 'wpbgdc' );\n\n\t\tsubmit_button();\n\n\t\techo '<div class=\"clear\"></div>';\n\n\t}",
"public function index()\n {\n $setting_web = setting('setting_web');\n $about_us = setting('about_us');\n $social_media = setting('social_media');\n return view('admin.setting.index',compact('setting_web','about_us', 'social_media'));\n }",
"function show_settings_tab(){\n woocommerce_admin_fields($this->get_settings());\n }",
"public function index()\n {\n return view('settings.setting');\n }",
"public function index()\n {\n $settings = Setting::paginate(10);\n\n \n return view('admin.settings.index',compact('settings'));\n }",
"public function settings()\n\t{\n\t\tif(defined(\"CMS_BACKEND\"))\n\t\t{\n\t\t\tAuthUser::load();\n\t\t\tif ( ! AuthUser::isLoggedIn()) {\n\t\t\t\tredirect(get_url('login'));\n\t\t\t}\n\t\t\t\n\t\t\tif(isset($_POST['save']) && $_POST['save'] == 'Save Settings')\n\t\t\t{\n\t\t\t\tPlugin::setAllSettings($_POST['setting'], 'mbblog');\n\t\t\t\tFlash::setNow('success', __('Settings have been saved!'));\t\t \t\n\t\t\t}\n\t\t\t\t\t\t\n\t\t\t$this->display('mbblog/views/admin/settings', array('settings' => Plugin::getAllSettings('mbblog')));\n\t\t} else\n\t\t{\n\t\t\tFlash::set('error', __('You do not have permission to access the requested page!'));\n\t\t\tredirect(get_url());\n\t\t}\n\t}",
"public function optionsPage()\r\n {\r\n $this->updateOptions();\r\n include_once($this->path . '/views/options.php');\r\n }"
]
| [
"0.8616268",
"0.8399608",
"0.83757913",
"0.83578944",
"0.8343814",
"0.82510084",
"0.8249055",
"0.816037",
"0.81501496",
"0.80073977",
"0.7958966",
"0.79086417",
"0.7787049",
"0.7770685",
"0.77183056",
"0.7669339",
"0.76484",
"0.76397234",
"0.7637485",
"0.7633475",
"0.76108205",
"0.76098067",
"0.7577768",
"0.7576528",
"0.7566987",
"0.7565326",
"0.7561359",
"0.75428754",
"0.7524138",
"0.75236505",
"0.75128675",
"0.7504475",
"0.7486653",
"0.7445683",
"0.74415326",
"0.74361855",
"0.7425918",
"0.7412873",
"0.74016696",
"0.73692065",
"0.73600304",
"0.7358636",
"0.7337926",
"0.7337483",
"0.73356265",
"0.73316956",
"0.73255515",
"0.73252296",
"0.7299889",
"0.72719276",
"0.7270629",
"0.72694504",
"0.72599036",
"0.7258119",
"0.72481555",
"0.72398794",
"0.72385913",
"0.72177345",
"0.72158",
"0.7192003",
"0.71842027",
"0.71834445",
"0.7160869",
"0.715615",
"0.7153982",
"0.7150823",
"0.7130558",
"0.71262276",
"0.7123221",
"0.7121734",
"0.7120574",
"0.7105345",
"0.70949805",
"0.7092739",
"0.70874095",
"0.7079328",
"0.7078761",
"0.7059868",
"0.7050476",
"0.7048856",
"0.70487934",
"0.704643",
"0.70310885",
"0.7030383",
"0.7028985",
"0.70265293",
"0.7021029",
"0.70178497",
"0.7011775",
"0.7010764",
"0.7009795",
"0.6987375",
"0.69870126",
"0.69713825",
"0.69674015",
"0.6963042",
"0.69599026",
"0.6953203",
"0.6945866",
"0.6945273",
"0.6941522"
]
| 0.0 | -1 |
Reset device to factory setting (not implemented) | public function reset()
{
return redirect()->back()->with('system-error', ['message' => trans('app.not-implemented-yet')]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function set_device(){\n\t\n\t}",
"public function reset()\n {\n $this->values[self::system] = null;\n $this->values[self::platform] = null;\n $this->values[self::channel] = null;\n $this->values[self::version] = null;\n }",
"private function reset()\n {\n $this->human->reset();\n $this->machine->reset();\n $this->memory->reset();\n }",
"public function resetDevice($deviceUid){\n\t\t$device = Device::find($deviceUid);\n\t\t$device->random_link_ucode = '';\n\t\t$device->status = \"UNCONNECTED\";\n\t\tif ($device->save()) {\n\t\t\treturn $device;\n\t\t}\n\t\treturn \"FAIL\";\n\t}",
"public static function reset(): void\n {\n self::$defined = null;\n self::$isChannel = false;\n }",
"protected function reset(): void\n {\n $this->bot = null;\n $this->client = null;\n $this->device = null;\n $this->os = null;\n $this->brand = '';\n $this->model = '';\n $this->parsed = false;\n }",
"public function reset()\n {\n $this->values[self::PHONE] = null;\n $this->values[self::PIN] = null;\n }",
"public function reset()\n {\n parent::reset();\n $this->_relayer->reset();\n $this->_forcedFaxNegotiator->reset();\n if ( isset( $this->_faxToneDetector ) ) {\n $this->_faxToneDetector->reset();\n }\n if ( isset( $this->_timer ) ) {\n $this->_timer->reset();\n }\n $this->_waitUpdateConfirmation = false;\n $this->_faxToneDetected = false;\n $this->_audioReinviteTimedOut = false;\n $this->_faxPages = array();\n $this->_stateManager->setState( self::STATE_READY );\n }",
"public function resetDeviceDetect(){\n\n //\n // STANDARD DETECTION RESET\n self::$oCRNRSTN_ENV->oSESSION_MGR->set_session_param('isMobile', false);\n self::$oCRNRSTN_ENV->oSESSION_MGR->set_session_param('isTablet', false);\n\n //\n // CUSTOM DETECTION RESET\n self::$oCRNRSTN_ENV->oSESSION_MGR->set_session_param('CUSTOM_DEVICE', '');\n\n return true;\n\n }",
"public function simulationReset()\n\t{\n\t\tif ($this->getSettings()->getType() == self::SETTING_TYPE_SIMULATION)\n\t\t{\n\t\t\t$this->data->directSet(\"resetNeeded\", 1);\n\t\t}\n\t}",
"public function reset()\n {\n $this->values[self::PORTLIST] = null;\n $this->values[self::TIMEOUTLIST] = null;\n $this->values[self::MIMNOOPINTERVAL] = null;\n $this->values[self::MAXNOOPINTERVAL] = null;\n $this->values[self::TYPINGINTERVAL] = null;\n $this->values[self::NOOPINTERVALTIME] = null;\n }",
"public function reset()\n {\n $this->values[self::PHONE] = null;\n $this->values[self::PASSWORD] = null;\n $this->values[self::EQUIPMENT] = null;\n $this->values[self::LOGIN_TYPE] = null;\n }",
"public function reset()\n {\n $this->values[self::ip] = null;\n $this->values[self::port] = null;\n $this->values[self::module] = null;\n }",
"public function reset()\n {\n $this->values[self::services] = array();\n $this->values[self::mapping] = array();\n $this->values[self::short_tcp] = self::$fields[self::short_tcp]['default'];\n }",
"public function reset();",
"public function reset();",
"public function reset();",
"public function reset();",
"public function reset();",
"public function reset();",
"public function reset();",
"public function reset();",
"public function reset();",
"public function reset();",
"public function reset();",
"public function reset();",
"public function reset(){}",
"public function reset()\n {\n $this->values[self::_UID] = null;\n $this->values[self::_DPS] = null;\n }",
"abstract public function reset();",
"abstract public function reset();",
"abstract public function reset();",
"public function resetState() {}",
"public function reset()\n {\n $this->values[self::_SERIAL_ID] = null;\n $this->values[self::_CHARGE_ID] = null;\n }",
"public function reset()\n {\n $this->values[self::_BASE] = null;\n $this->values[self::_DYNA] = null;\n }",
"public function reset()\n {\n $this->values[self::_BASE] = null;\n $this->values[self::_DYNA] = null;\n }",
"public function reset()\n {\n $this->values[self::_BASE] = null;\n $this->values[self::_DYNA] = null;\n }",
"public static function resetConfiguration()\n {\n static::$config = null;\n Registry::clear();\n }",
"public function reset() {\n\t\t$this->registered = array();\n\t}",
"public function reset()\n {\n $this->values[self::APP_NAME] = null;\n $this->values[self::SVR_NAME] = null;\n $this->values[self::SVR_POOL] = null;\n $this->values[self::TASK_CMD] = null;\n $this->values[self::TASK_ID] = null;\n $this->values[self::SUBTASK_ID] = null;\n $this->values[self::CMD_ID] = null;\n }",
"public function reset(): void;",
"public function reset()\n {\n $this->values[self::_ID] = null;\n $this->values[self::_FREQUENCY] = null;\n $this->values[self::_LAST_CHANGE] = null;\n }",
"public function reset() {}",
"public function reset() {}",
"public function reset() {}",
"public function reset() {}",
"public function reset() {}",
"public function reset() {}",
"public function reset() {}",
"public function reset() {}",
"public function reset() {}",
"public function reset() {}",
"public static function reset()\n {\n self::$config = null;\n self::$configLoaded = false;\n }",
"public function reset()\n {\n $this->values[self::_INSTANCE_INFO] = null;\n $this->values[self::_RSEED] = null;\n $this->values[self::_LOOTS] = array();\n $this->values[self::_HP_DROP] = array();\n }",
"public function resetCharacteristics() {\n\t\t$characteristics = array_combine(array(\n\t\t\t'contains_model', 'contains_datasource', 'contains_behavior', 'contains_controller',\n\t\t\t'contains_component', 'contains_view', 'contains_helper', 'contains_theme', 'contains_vendor',\n\t\t\t'contains_shell', 'contains_test', 'contains_lib', 'contains_resource', 'contains_config'\n\t\t), array(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0));\n\n\t\t$this->out(__('Resetting all characteristics'));\n\t\t$this->Package->updateAll($characteristics);\n\n\t\t$this->out(__('* Successfully reset all characteristics'));\n\t\t$this->_stop();\n\t}",
"public function restart(Device $device)\n {\n\n }",
"protected function reset() {}",
"protected function reset() {}",
"protected function reset() {}",
"protected function reset(): void\n {\n }",
"public function reset()\n {\n $this->setValue($this->generate());\n }",
"public function reset()\n {\n }",
"public function reset()\n {\n }",
"public function reset()\n {\n $this->values[self::_SYSTEM_SETTING_ITEM] = array();\n }",
"public static function reset()\n\t{\n\t\t// nothing by default\n\t}",
"private function reset()\n {\n $this->senderId = $this->factory->uuid;\n $this->amount = $this->factory->numberBetween(1, 10000);\n $this->recipientId = $this->factory->uuid;\n }",
"public function reset()\n {\n $this->values[self::_LAST_RESET_TIME] = null;\n $this->values[self::_TODAY_FREE_SWEEP_TIMES] = null;\n }",
"public function reset()\r\n {\r\n }",
"public function forceReset() {\r\n if (GEAR_DEV && GearSection::truncate() && GearOption::truncate()){\r\n return self::resetInit();\r\n }\r\n }",
"public function reset()\n {\n $this->values[self::RET] = null;\n $this->values[self::CMDLIST] = null;\n $this->values[self::CONTINUEFLAG] = null;\n $this->values[self::SYNC_KEY] = null;\n $this->values[self::STATUS] = null;\n $this->values[self::ONLINEVERSION] = null;\n $this->values[self::SVRTIME] = null;\n }",
"public function reset()\n {\n $this->values[self::_INFO] = null;\n $this->values[self::_ADDR] = null;\n }",
"public function Reset();",
"public function resetFlags();",
"public function reset()\n {\n $this->values[self::_STATUS] = null;\n $this->values[self::_FREQUENCY] = null;\n $this->values[self::_LAST_LOGIN_DATE] = null;\n }",
"public static function reset()\n {\n self::$id = 0;\n }",
"public static function reset() {\n\t\t\tself::$instance = null;\n\t\t}",
"public static function reset() {\n\t\t\tself::$instance = null;\n\t\t}",
"public function resetModelMocks()\n {\n $this->_registeredModelMocks = array();\n }",
"function camReset($cam) {\n\tsendPiCam($cam, 'INIT');\n}",
"public function reset()\n {\n $this->values[self::_RSEED] = null;\n $this->values[self::_LOOTS] = array();\n }",
"public function reset()\n {\n $this->values[self::_ACQUIRE] = array();\n }",
"public function reset()\n {\n $this->setValue($this->getDefaultValue());\n }",
"protected static function reset()\n {\n self::$dbm = null;\n }",
"public function reset()\n {\n $this->socketStream = null;\n }",
"public function selectNewDevice(){\n\t\t$db = Db::getInstance();\n\n\t\t$req = $db->prepare('SELECT DeviceID FROM Devices ORDER BY RAND() LIMIT 1');\n\t\t$req->execute();\n\t\t$deviceIDNum = $req->fetch();\n\n\t\t$deviceID = $deviceID['DeviceID'];\n\n\t\t//Set all off first\n\t\t$req = $db->prepare(' UPDATE Devices SET ActiveControl = 0');\n\t\t$req->execute(array(':deviceID' => $deviceIDNum));\n\t\t$deviceID = $req->fetch();\n\n\t\t//Switch the selected one on:\n\t\t$req = $db->prepare(' UPDATE Devices SET ActiveControl = 1 WHERE DeviceID = :deviceID');\n\t\t$req->execute(array(':deviceID' => $deviceIDNum));\n\t\t$deviceID = $req->fetch();\n\n\t}",
"function resetDpNpc()\n {\n }",
"public function reset()\n {\n $this->values[self::_DPS] = null;\n $this->values[self::_DPS_USER] = null;\n $this->values[self::_ARRAY] = null;\n }",
"public function reset()\n {\n $payload = '';\n\n $this->sendRequest(self::FUNCTION_RESET, $payload);\n }",
"public function reset()\n {\n $payload = '';\n\n $this->sendRequest(self::FUNCTION_RESET, $payload);\n }",
"final function resetDpLiving()\n {\n $this->resetDpNpc();\n }",
"public function reset() {\r\n $this->state = BaseConverter::ConvertFromBinary($this->initv, '0123456789');\r\n $this->state = ltrim($this->state, '0');\r\n }",
"public function reset()\n {\n $this->values[self::_HERO_ID] = null;\n $this->values[self::_DYNA] = null;\n }",
"function reset()\n {\n }",
"public function reset()\n {\n $this->values[self::_TID] = null;\n $this->values[self::_DYNA] = null;\n }",
"public function resetData();",
"public function reset() {\n $this->_property = false;\n $this->_interface = false;\n $this->_variable = false;\n }",
"public function reset() {\n $this->_property = false;\n $this->_interface = false;\n $this->_variable = false;\n }",
"public function setDevice(Device $device);",
"public function reset()\n\t{\n\t\t$this->get(1);\n\t}",
"public function reset() {\n $this->values[self::IS_SUPPORTED] = null;\n $this->values[self::URL] = null;\n }",
"public function reset()\n {\n $this->id = null;\n $this->attributes = array();\n }",
"public function reset()\n {\n $this->values[self::IP] = null;\n $this->values[self::STATE] = null;\n $this->values[self::VERSION] = null;\n $this->values[self::CONNECTED_IP] = null;\n $this->values[self::REPORTED_IP] = null;\n $this->values[self::HOSTNAME] = null;\n }"
]
| [
"0.6710053",
"0.6293201",
"0.59882736",
"0.5911143",
"0.58967274",
"0.5821863",
"0.58056784",
"0.5749772",
"0.5744971",
"0.5743362",
"0.5729166",
"0.5727246",
"0.5725481",
"0.5711929",
"0.5702939",
"0.5702939",
"0.5702939",
"0.5702939",
"0.5702939",
"0.5702939",
"0.5702939",
"0.5702939",
"0.5702939",
"0.5702939",
"0.5702939",
"0.5702939",
"0.5694208",
"0.56925046",
"0.56886744",
"0.56886744",
"0.56886744",
"0.56576294",
"0.5654001",
"0.5652969",
"0.5652969",
"0.5652969",
"0.5635571",
"0.56182647",
"0.5602879",
"0.5600744",
"0.5594986",
"0.55941087",
"0.55941087",
"0.55941087",
"0.559308",
"0.559308",
"0.559308",
"0.559308",
"0.559308",
"0.559308",
"0.559308",
"0.5577596",
"0.5576049",
"0.55686414",
"0.5564398",
"0.5531145",
"0.55307156",
"0.5529561",
"0.5524939",
"0.55223054",
"0.5500319",
"0.5488037",
"0.5481582",
"0.54789835",
"0.5476604",
"0.5466073",
"0.54655087",
"0.5463075",
"0.54597586",
"0.54553014",
"0.5451721",
"0.54422307",
"0.54252636",
"0.5412057",
"0.54118603",
"0.54118603",
"0.5404953",
"0.53980553",
"0.537721",
"0.5376327",
"0.53720456",
"0.53716856",
"0.53714",
"0.53452736",
"0.534073",
"0.5331247",
"0.5324742",
"0.5324742",
"0.5319559",
"0.5314195",
"0.531282",
"0.53076434",
"0.5306763",
"0.5303075",
"0.5300384",
"0.5300384",
"0.5297011",
"0.5285087",
"0.52814174",
"0.52724457",
"0.52657855"
]
| 0.0 | -1 |
/ / Constructor / | public function __construct(string $fileName = "config.cfg")
{
if (empty($fileName)) {
$this->fileName = defined("CONFIG") ? CONFIG : $fileName;
} else {
if (file_exists($fileName)) {
$this->fileName = $fileName;
}
}
if (file_exists($this->fileName)) {
$this->vars = parse_ini_file($this->fileName, true);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"private function __construct()\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()\r\n\t{\r\n\t\r\n\t}",
"function _construct() {\n \t\n\t\t\n\t}",
"private function __construct() {\r\n\t\r\n\t}",
"private function __construct( )\n {\n\t}",
"final private function __construct() {\n\t\t\t}",
"final private function __construct()\n\t{\n\t}",
"private function __construct()\n\t{\n\t\t\n\t}",
"final private function __construct() {}",
"final private function __construct() {}",
"private function __construct() {\r\n\t\t\r\n\t}",
"final private function __construct(){\r\r\n\t}",
"private function __construct()\r\n\t{\r\n\t}",
"private function __construct () {}",
"final private function __construct() { }",
"final private function __construct() { }",
"final private function __construct() { }",
"private function __construct() { \n\t\t\n\n\t}",
"private function __construct()\r\r\n\t{\r\r\n\t}",
"private function __construct () \n\t{\n\t}",
"function _construct(){ }",
"function __construct() ;",
"private function __construct()\n\t{\n\n\t}",
"private function __construct()\r\n {}",
"function __construct (){\n\t\t}",
"function __construct() { }",
"function __construct() { }",
"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() {}"
]
| [
"0.8739282",
"0.85019356",
"0.85019356",
"0.85019356",
"0.85019356",
"0.85019356",
"0.85019356",
"0.85019356",
"0.85019356",
"0.85019356",
"0.85019356",
"0.85019356",
"0.85019356",
"0.85019356",
"0.85019356",
"0.85019356",
"0.85019356",
"0.85019356",
"0.8495107",
"0.84891915",
"0.8485563",
"0.84669715",
"0.8463926",
"0.84379536",
"0.84377915",
"0.84221536",
"0.84221536",
"0.83860683",
"0.83757436",
"0.83741796",
"0.8371745",
"0.83667123",
"0.83667123",
"0.83667123",
"0.83656174",
"0.83647484",
"0.8356634",
"0.8346012",
"0.8342382",
"0.8338768",
"0.83300436",
"0.8327381",
"0.8326807",
"0.8326807",
"0.8326807",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394",
"0.8316394"
]
| 0.0 | -1 |
/ / Destructor / | public function __destruct()
{
unset($this->vars);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function __destruct()\r\n\t\t{\t\t\t\r\n\t\t}",
"private function __destruct() {}",
"public function __destruct()\n {\n }",
"public function __destruct()\n {\n }",
"public function __destruct () {\n \n }",
"public function __destruct() {\t\n\n }",
"public function __destruct() {\n\t\t\n\t}",
"public function __destruct()\r\n {\r\n }",
"public function __destruct()\r\n {\r\n }",
"public function __destruct ()\n\t{\n\t}",
"public function __destruct() {\n\n\t\t}",
"public function __destruct() {\r\n }",
"public function __destruct() {\r\n\t}",
"public function __destruct(){}",
"public function __destruct(){}",
"public function __destruct(){}",
"public function __destruct() { }",
"public function __destruct() { }",
"public function __destruct() { }",
"protected function __del__() { }",
"public function __destruct ()\n\t\t{\n\t\t\t/*---- Blank -----*/\n\t\t}",
"public function __destruct() {\n\n\t}",
"public function __destruct()\n {\n }",
"public function __destruct()\n {\n }",
"public function __destruct()\n {\n }",
"public function __destruct()\n {\n }",
"public function __destruct()\n {\n }",
"public function __destruct()\n {\n // Vacio por el momento.\n }",
"public function __destruct(){\n }",
"public function __destruct(){\n }",
"function __destruct()\n {\n }",
"function __destruct()\n {\n }",
"function __destruct()\n {\n }",
"function __destruct()\n\t\t{\n\t\t\tparent::__destruct();\n\t\t}",
"protected function __destruct() \r\n {\r\n parent::__destruct();\r\n }",
"public function __destruct()\n\t{\n\t}",
"public function __destruct()\r\n\r\n {}",
"public function __destruct()\n {\n }",
"public function __destruct()\n {\n }",
"public function __destruct()\n {\n }",
"public function __destruct() {}",
"public function __destruct() {}",
"public function __destruct() {}",
"public function __destruct() {}",
"public function __destruct() {}",
"public function __destruct() {}",
"public function __destruct() {}",
"public function __destruct() {}",
"public function __destruct() {}",
"public function __destruct() {}",
"public function __destruct() {}",
"public function __destruct() {}",
"public function __destruct() {}",
"public function __destruct() {}",
"public function __destruct() {}",
"public function __destruct() {}",
"public function __destruct() {}",
"protected function __destruct() \n {\n parent::__destruct();\n }",
"function __destruct() {\r\n parent::__destruct();\r\n }",
"public function __destruct() {\n\t}",
"public function __destruct() {\n\t}",
"public function __destruct(){ }",
"public function __destruct()\n {\n parent::__destruct();\n }",
"public function __destruct()\r\n {\r\n // Perform any clean-up here\r\n }",
"public function __destruct();",
"public function __destruct();",
"function __destruct()\r\n\t{\r\n\t\tparent::__destruct();\r\n\t}",
"function __destruct()\r\n\t{\r\n\t\tparent::__destruct();\r\n\t}",
"function __destruct() {\t\n\t\tparent::__destruct(); \n }",
"function __destruct() {\t\n\t\tparent::__destruct(); \n }",
"function __destruct() {\t\n\t\tparent::__destruct(); \n }",
"function __destruct() {\t\n\t\tparent::__destruct(); \n }",
"public function __destruct() {\n }",
"public function __destruct() {\n }",
"public function __destruct()\n {\n\n }",
"function __destruct()\n\t{\n\t\t\n\t\t\n\t}",
"function __destruct()\n {\n parent::__destruct();\n }",
"public function __destruct(){\n\t}",
"public function __destruct(){\n\t}",
"public function __destruct(){\n\t}",
"public function __destruct() {\n\t\tparent::__destruct();\n\t}",
"public function __destruct(){unset($this);}",
"public function __destruct()\n {}",
"public function __destruct()\n {}",
"public function __destruct()\n {}",
"function __destruct()\r\t{\r\t}",
"public function __destruct() {\r\n ;\r\n }",
"public function __destruct() \r\n {\r\n //..\r\n }",
"public function __destruct() \r\n {\r\n //..\r\n }",
"function __destruct(){\n\n }",
"function __destruct() {\n\t\tparent::__destruct();\n\t}",
"public function __destruct()\n {\n parent::__destruct();\n }",
"protected function __destruct() {\n\n parent::__destruct();\n }",
"function __destruct() {\n //$this->mem->quit();\n }",
"public function __destruct()\n {\n $this->clear();\n }",
"public function __destruct()\n {\n $this->clear();\n }",
"function __destruct(){\n\t\tparent::__destruct();\n\t}",
"function __destruct()\n {\n //析构函数\n\n }",
"function __destruct() \n\t{\n\t\t;\n }",
"abstract public function __destruct();",
"public function __destruct(){\n }"
]
| [
"0.792145",
"0.7906962",
"0.7869925",
"0.7869672",
"0.78682303",
"0.7801797",
"0.7770816",
"0.7764839",
"0.7755972",
"0.77476716",
"0.77310014",
"0.77295804",
"0.76912326",
"0.7667961",
"0.7667961",
"0.7667961",
"0.7661624",
"0.7661624",
"0.7661624",
"0.76589346",
"0.7656776",
"0.76552814",
"0.76550555",
"0.76550555",
"0.76550555",
"0.76550555",
"0.76550555",
"0.76526856",
"0.7647379",
"0.7647379",
"0.76460534",
"0.76460534",
"0.76460534",
"0.76452243",
"0.76412225",
"0.76273906",
"0.76181805",
"0.7613073",
"0.7613073",
"0.7613073",
"0.76076096",
"0.76076096",
"0.76071084",
"0.76071084",
"0.76071084",
"0.76071084",
"0.76071084",
"0.76071084",
"0.76071084",
"0.76071084",
"0.76071084",
"0.76071084",
"0.76071084",
"0.76071084",
"0.76071084",
"0.76071084",
"0.76064974",
"0.7597703",
"0.7585069",
"0.75841546",
"0.75841546",
"0.7582211",
"0.75821275",
"0.75760174",
"0.7570154",
"0.7570154",
"0.75455624",
"0.75455624",
"0.7537391",
"0.7537391",
"0.7537391",
"0.7537391",
"0.7536002",
"0.7536002",
"0.75339705",
"0.75277275",
"0.7518959",
"0.7503588",
"0.7503588",
"0.7503588",
"0.7498683",
"0.74986315",
"0.7492262",
"0.7492262",
"0.7492262",
"0.7480339",
"0.7479966",
"0.74676347",
"0.74676347",
"0.7451415",
"0.74476475",
"0.7445377",
"0.74401474",
"0.7434301",
"0.7419864",
"0.7419864",
"0.7386894",
"0.73707926",
"0.7363125",
"0.7358638",
"0.7332637"
]
| 0.0 | -1 |
/ / Get value / | public function Get($section, $key, $default = null, $replaces = null)
{
$result = $this->GetRaw($section, $key, $default);
$result = $this->HandleVariables($result, $replaces);
return Util::Get($result, $default) ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function &getValue();",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"abstract protected function getValue();",
"public function get_value()\n {\n }",
"public function get_value()\n {\n }",
"function get_value() {return $this->get();}",
"abstract public function getValue();",
"abstract public function getValue();",
"abstract public function getValue();",
"public function getValue(){ }",
"public function getValue(){\n \treturn $this->value;\n }",
"function getValue(){\r\n\t\treturn $this->value;\r\n\t}",
"public function value();",
"public function value();",
"public function value();",
"public function getValue(): mixed;",
"public function getValue(): mixed;",
"public function getValue()\n {\n\treturn $this->value;\n }",
"public abstract function getValue($value);",
"function getValue()\n\t{\n\t\treturn $this->value;\n\t}",
"function getValue()\n\t{\n\t\treturn $this->value;\n\t}",
"public function getValue(){\n return $this->_value;\n }",
"function getValue() {\n return $this->value;\n }",
"public function getValue(){\n return $this->value;\n }",
"public function getValue(){\n return $this->value;\n }",
"public function getValue() {\n\n }",
"public function getValue()\n {\n\t\treturn $this->value;\n\t}",
"public function value() { return $this->_m_value; }",
"public function getValue() {\n\t\treturn $this->data[\"value\"];\n\t}",
"public function get_value()\n\t{\n\t\treturn $this->value;\n\t}",
"public function getValue()\n {\n return $this->get(self::_VALUE);\n }",
"public function getValue()\n {\n return $this->get(self::_VALUE);\n }",
"public function get_value()\n {\n return $this->value;\n }",
"abstract public function get() ;",
"public function getValue()\r\n {\r\n return $this->value;\r\n }",
"public function GetValue() {\n\t\treturn $this->_value;\n\t}",
"public function getValue() {\n return $this->value;\n }",
"public function getValue() {\n return $this->value;\n }",
"public function getValue() {\n return $this->value;\n }",
"public function getValue()\n\t{\n\t\treturn $this->data['value'];\n\t}",
"public function __get($value);",
"public function getValue()\n\t{\n\t\treturn $this->_value;\n\t}",
"public function getValue()\n\t{\n\t\treturn $this->_value;\n\t}",
"protected function getValue() {\r\n return $this->_value;\r\n }",
"public function getValue()\r\n\t{\r\n\t\treturn $this->value;\r\n\t}",
"public function getValue() {\n\t\treturn $this -> value;\n\t}",
"public function get_value() {\n return $this->value;\n }",
"public function getValue() {\n\t\treturn $this->value;\n\t}",
"public function getValue() {\n\t\treturn $this->value;\n\t}",
"public function getValue() {\n\t\treturn $this->value;\n\t}",
"public function getValue() {\n\t\treturn $this->value;\n\t}",
"public function getValue() {\n\t\treturn $this->value;\n\t}",
"public function getValue() {\n\t\treturn $this->value;\n\t}",
"public function getValue()\n {\n return $this->get(self::VALUE);\n }",
"public function getValue()\n {\n return $this->get(self::VALUE);\n }",
"public function get()\n {\n \n return $this->value;\n \n }",
"public function get_value() {\n\t\treturn $this->_value;\n\t}",
"public function getValue()\n {\n return $this->_value;\n }",
"public function getValue()\n {\n return $this->_value;\n }",
"public function getValue()\n {\n return $this->_value;\n }",
"public function get()\n\t{\n\t\treturn $this->_value;\n\t}",
"function &getValue () {\n\t\treturn $this->_value;\n\t}"
]
| [
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.84838665",
"0.844387",
"0.844387",
"0.844387",
"0.844387",
"0.844387",
"0.844387",
"0.844387",
"0.844387",
"0.844387",
"0.844387",
"0.844387",
"0.844387",
"0.844387",
"0.844387",
"0.84435976",
"0.84435976",
"0.84435976",
"0.84435976",
"0.84435976",
"0.8292444",
"0.8280842",
"0.8280842",
"0.8254008",
"0.81847155",
"0.81847155",
"0.81831396",
"0.8036947",
"0.8020655",
"0.80170316",
"0.7962761",
"0.7962761",
"0.7962761",
"0.7943043",
"0.7943043",
"0.7817756",
"0.78092676",
"0.7761008",
"0.7761008",
"0.7718722",
"0.7711681",
"0.76941735",
"0.76941735",
"0.76770306",
"0.76693726",
"0.7666121",
"0.7641477",
"0.76076853",
"0.7606567",
"0.7606567",
"0.7600905",
"0.75857484",
"0.7579951",
"0.75626814",
"0.7558937",
"0.7558937",
"0.7558937",
"0.7552317",
"0.75318784",
"0.75190365",
"0.75190365",
"0.7515539",
"0.7511459",
"0.7507957",
"0.74835724",
"0.7482128",
"0.7482128",
"0.7482128",
"0.7482128",
"0.7482128",
"0.7482128",
"0.7472496",
"0.7472496",
"0.74626225",
"0.7462389",
"0.74605095",
"0.74605095",
"0.74605095",
"0.74253964",
"0.74116904"
]
| 0.0 | -1 |
/ / Get value / | public function GetRaw($section, $key, $default = null)
{
$result = null;
if (array_key_exists($section, $this->vars)) {
if (array_key_exists($key, $this->vars[ $section ])) {
$result = $this->vars[ $section ][ $key ];
}
}
return Util::Get($result, $default) ;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function getValue();",
"public function &getValue();",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"public function getValue() {}",
"abstract protected function getValue();",
"public function get_value()\n {\n }",
"public function get_value()\n {\n }",
"function get_value() {return $this->get();}",
"abstract public function getValue();",
"abstract public function getValue();",
"abstract public function getValue();",
"public function getValue(){ }",
"public function getValue(){\n \treturn $this->value;\n }",
"function getValue(){\r\n\t\treturn $this->value;\r\n\t}",
"public function value();",
"public function value();",
"public function value();",
"public function getValue(): mixed;",
"public function getValue(): mixed;",
"public function getValue()\n {\n\treturn $this->value;\n }",
"public abstract function getValue($value);",
"function getValue()\n\t{\n\t\treturn $this->value;\n\t}",
"function getValue()\n\t{\n\t\treturn $this->value;\n\t}",
"public function getValue(){\n return $this->_value;\n }",
"function getValue() {\n return $this->value;\n }",
"public function getValue(){\n return $this->value;\n }",
"public function getValue(){\n return $this->value;\n }",
"public function getValue() {\n\n }",
"public function getValue()\n {\n\t\treturn $this->value;\n\t}",
"public function value() { return $this->_m_value; }",
"public function getValue() {\n\t\treturn $this->data[\"value\"];\n\t}",
"public function get_value()\n\t{\n\t\treturn $this->value;\n\t}",
"public function getValue()\n {\n return $this->get(self::_VALUE);\n }",
"public function getValue()\n {\n return $this->get(self::_VALUE);\n }",
"public function get_value()\n {\n return $this->value;\n }",
"abstract public function get() ;",
"public function getValue()\r\n {\r\n return $this->value;\r\n }",
"public function GetValue() {\n\t\treturn $this->_value;\n\t}",
"public function getValue() {\n return $this->value;\n }",
"public function getValue() {\n return $this->value;\n }",
"public function getValue() {\n return $this->value;\n }",
"public function getValue()\n\t{\n\t\treturn $this->data['value'];\n\t}",
"public function __get($value);",
"public function getValue()\n\t{\n\t\treturn $this->_value;\n\t}",
"public function getValue()\n\t{\n\t\treturn $this->_value;\n\t}",
"protected function getValue() {\r\n return $this->_value;\r\n }",
"public function getValue()\r\n\t{\r\n\t\treturn $this->value;\r\n\t}",
"public function getValue() {\n\t\treturn $this -> value;\n\t}",
"public function get_value() {\n return $this->value;\n }",
"public function getValue() {\n\t\treturn $this->value;\n\t}",
"public function getValue() {\n\t\treturn $this->value;\n\t}",
"public function getValue() {\n\t\treturn $this->value;\n\t}",
"public function getValue() {\n\t\treturn $this->value;\n\t}",
"public function getValue() {\n\t\treturn $this->value;\n\t}",
"public function getValue() {\n\t\treturn $this->value;\n\t}",
"public function getValue()\n {\n return $this->get(self::VALUE);\n }",
"public function getValue()\n {\n return $this->get(self::VALUE);\n }",
"public function get()\n {\n \n return $this->value;\n \n }",
"public function get_value() {\n\t\treturn $this->_value;\n\t}",
"public function getValue()\n {\n return $this->_value;\n }",
"public function getValue()\n {\n return $this->_value;\n }",
"public function getValue()\n {\n return $this->_value;\n }",
"public function get()\n\t{\n\t\treturn $this->_value;\n\t}",
"function &getValue () {\n\t\treturn $this->_value;\n\t}"
]
| [
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.85413927",
"0.84838665",
"0.844387",
"0.844387",
"0.844387",
"0.844387",
"0.844387",
"0.844387",
"0.844387",
"0.844387",
"0.844387",
"0.844387",
"0.844387",
"0.844387",
"0.844387",
"0.844387",
"0.84435976",
"0.84435976",
"0.84435976",
"0.84435976",
"0.84435976",
"0.8292444",
"0.8280842",
"0.8280842",
"0.8254008",
"0.81847155",
"0.81847155",
"0.81831396",
"0.8036947",
"0.8020655",
"0.80170316",
"0.7962761",
"0.7962761",
"0.7962761",
"0.7943043",
"0.7943043",
"0.7817756",
"0.78092676",
"0.7761008",
"0.7761008",
"0.7718722",
"0.7711681",
"0.76941735",
"0.76941735",
"0.76770306",
"0.76693726",
"0.7666121",
"0.7641477",
"0.76076853",
"0.7606567",
"0.7606567",
"0.7600905",
"0.75857484",
"0.7579951",
"0.75626814",
"0.7558937",
"0.7558937",
"0.7558937",
"0.7552317",
"0.75318784",
"0.75190365",
"0.75190365",
"0.7515539",
"0.7511459",
"0.7507957",
"0.74835724",
"0.7482128",
"0.7482128",
"0.7482128",
"0.7482128",
"0.7482128",
"0.7482128",
"0.7472496",
"0.7472496",
"0.74626225",
"0.7462389",
"0.74605095",
"0.74605095",
"0.74605095",
"0.74253964",
"0.74116904"
]
| 0.0 | -1 |
/ / Set value / | public function Set($section, $key, $value)
{
$this->vars[ $section ][ $key ] = $value;
$this->Save();
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value) {}",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"public function setValue($value);",
"abstract public function setValue($value);",
"function setValue($value){\r\n\t\t$this->value = $value;\r\n\t}",
"function set_value($value)\n\t{\n\t\t$this->value = $value;\n\t}",
"function setValue ($value) {\n\t\t$this->_value = $value;\n\t}",
"function setValue($value) {\n $this->value = $value;\n }",
"public function setValue($value){\n $this->_value = $value;\n }",
"function value( $value )\n\t{\n\t\t$this->value = $value;\n\t}",
"public function setValue($value) {\n $this->value = $value->value;\n }",
"public function SetValue($value)\n\t{\n\t\t$this->value = $value;\n\t}",
"public function setValue( $value )\r\n\t{\r\n\t\t$this->value = $value;\r\n\t}",
"public function set_value( $value ) {\n $this->value = $value;\n }",
"public function setValue( $value ) { \n $this->inputValue = $value; \n $this->value = $value;\n }",
"public function setValue($v){\n $this->value = $v;\n }",
"public function setValue($value) {\n $this->value = $value;\n }",
"public function setValue($value) {\n $this->value = $value;\n }",
"public function setValue($value) {\n $this->value = $value;\n }",
"public function setValue($value) {\n $this->value = $value;\n }",
"protected function doSet($value)\n {\n }",
"public function setValue($value)\n {\n $this->value = $value;\n }",
"public function setValue($value)\n {\n $this->value = $value;\n }",
"public function setValue($value)\n {\n $this->value = $value;\n }",
"public function setValue($value)\n {\n $this->value = $value;\n }",
"public function set($value = null);",
"public function setValue($value, $load = false);",
"public function set_value($value) {\n\t\t$this->_value = $value + 0;\n\t}",
"protected function _setValue($name, $value) {}",
"public function set($name, $value){}",
"final function set($value){\n if(is_object($value) and get_class($value)===get_class($this)){\n $this->value = $value->get();\n $this->isset = TRUE;\n return $this->_ok();\n }\n\n // use accept for type-check\n $this->isset = FALSE;\n $typ = $this->get_type($value,FALSE,FALSE);\n if($this->accept($value,$typ)!==TRUE) \n return $this->_err(array(3,strval($value)),FALSE);\n\n // get method responisble for this type\n $mth = 'set_' . (method_exists($this,'set_' . $typ)?$typ:'default');\n $res = $this->$mth($value);\n $this->isset = $this->isok();\n return $res;\n }",
"public function setValue($value)\n {\n $this->_value = new Zend_Memory_Value($value, $this);\n }",
"public function set_value( $value ){\n\t\t$this->value_set( $value );\n\t\treturn $this->value;\n\n\t}",
"public function setValue($val) : self {return $this->setNewValue($this->value, $val);}",
"public function setVal($val){\n\t\t\t$this->_val = $val;\n\t\t}",
"public function set($name, $value);",
"public function set($name, $value);",
"public function set($name, $value);",
"public function set($variable, $value);",
"public function setValue( $value ) {\n $this->value = $value;\n return $this;\n }",
"public function setValue($value = true)\n {\n $this->value = $value;\n }",
"public function setValue( $value )\n\t{\n\t\t$this->setAttribute( \"value\", $value );\n\t}",
"public function setValue($value)\n {\n $value = arr::get($value, 'value', NULL);\n\n if ($value !== NULL)\n {\n //pokud prisla prazdna hodnota, tak do modelu ukladam NULL\n if (empty($value))\n {\n $value = NULL;\n }\n\n parent::setValue($value);\n }\n }",
"public function setValue($key, $value);",
"public function setValue($key, $value);",
"public function set( $name, $value = NULL );",
"public function setValue($fieldname, $value);",
"function __set($name, $value) {\r\n if ($name == 'mr') {\r\n $this->max_rating = intval($value);\r\n } else if ($name == 'st') {\r\n $this->step = intval($value);\r\n } else if ($name == 'vis') {\r\n $this->visible = $value == '1';\r\n } else if ($name == 'seq') {\r\n $this->sequence = intval($value);\r\n } else if ($name == 'cr') {\r\n $this->created = DateTime::createFromFormat('Y-m-d H:i:s', $value);\r\n } else if ($name == 'upd') {\r\n $this->updated = DateTime::createFromFormat('Y-m-d H:i:s', $value);\r\n } else if ($name == 'num') {\r\n $this->num_ratings = intval($value);\r\n } else if ($name == 'total') {\r\n $this->tot_ratings = floatval($value);\r\n }\r\n\r\n }",
"function set($name,$value) \n {\n return $this->instance->set($name,$value);\n }",
"public function set($id, $value);",
"public function set($id, $value);",
"public function set( $option, $value );",
"public function __set($name, $value);",
"public function __set($name, $value);",
"public function set(int $value): void {}",
"public function setValue($value)\n\t{\n\t\t$this->setViewState('Value',$value,'');\n\t}",
"public function setValue($value){\n $this->value = $value;\n return $this;\n }",
"public function set($parameter, $value);",
"public function __set($param, $value);",
"public function setValue($value)\n {\n $this->value = (string) $value;\n }",
"public function set($field, $value);",
"public function set($field, $value);",
"public function __set($_name, $_value);",
"public function set( $key, $value );",
"public function set( $key, $value );",
"abstract public function set();",
"protected function value_set( $value ){\n\t\tif( is_array( $value ) ){\n\t\t\t$this->value = $value;\n\t\t}elseif( is_serialized( $value ) ){\n\t\t\t$this->value = unserialize( $value );\n\t\t}elseif( 0 === strpos( $value, '{' ) && is_object( $_value = json_decode( $value ) ) ){\n\t\t\t$this->value = (array) $_value;\n\t\t}else{\n\t\t\t$this->value = $value;\n\t\t}\n\t}",
"function setValue(int $field, $value) : void;",
"public function set($name, $value)\n {\n }",
"public function setValue(mixed $value): static;",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);",
"public function set($key, $value);"
]
| [
"0.8569953",
"0.8569953",
"0.8569953",
"0.8569953",
"0.8569953",
"0.8569953",
"0.8569953",
"0.8569953",
"0.8569953",
"0.8569953",
"0.8569953",
"0.85690284",
"0.85690284",
"0.8568363",
"0.8568363",
"0.8568363",
"0.8568363",
"0.8568363",
"0.8568363",
"0.8568363",
"0.8568363",
"0.8568363",
"0.8568363",
"0.84287125",
"0.8267631",
"0.81724536",
"0.8163586",
"0.81420755",
"0.8130015",
"0.8129846",
"0.79211056",
"0.79173577",
"0.78980386",
"0.78878486",
"0.77839506",
"0.778126",
"0.7730013",
"0.7730013",
"0.7730013",
"0.7730013",
"0.7725383",
"0.76888937",
"0.76888937",
"0.76888937",
"0.76888937",
"0.7653382",
"0.7585303",
"0.7518022",
"0.7469904",
"0.74483037",
"0.7434549",
"0.7409476",
"0.7404256",
"0.7387336",
"0.73362505",
"0.7317424",
"0.7317424",
"0.7317424",
"0.7265741",
"0.725992",
"0.72575676",
"0.7222633",
"0.72164184",
"0.7205664",
"0.7205664",
"0.72037894",
"0.720268",
"0.7178562",
"0.71755576",
"0.7159519",
"0.7159519",
"0.7157875",
"0.71130735",
"0.71130735",
"0.7097413",
"0.7096424",
"0.70902866",
"0.7062913",
"0.7062762",
"0.7062368",
"0.70594347",
"0.70594347",
"0.7044803",
"0.7039547",
"0.7039547",
"0.7033636",
"0.7031351",
"0.7030535",
"0.70293087",
"0.7016972",
"0.6978137",
"0.6978137",
"0.6978137",
"0.6978137",
"0.6978137",
"0.6978137",
"0.6978137",
"0.6978137",
"0.6978137",
"0.6978137",
"0.6978137"
]
| 0.0 | -1 |
/ / Save config content / | public function Save()
{
$content = "";
foreach ($this->vars as $key => $elem) {
$content .= "[".$key."]\n";
foreach ($elem as $key2 => $elem2) {
$content .= $key2." = \"".$elem2."\"\n";
}
$content .= "\n";
}
if (!$handle = @fopen($this->fileName, 'w')) {
error_log("Config::Save() - Could not open file('".$this->fileName."') for writing, error.");
}
if (!fwrite($handle, $content)) {
error_log("Config::Save() - Could not write to open file('" . $this->fileName ."'), error.");
}
fclose($handle);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function save()\n {\n $config_content = file_get_contents($this->config_path);\n\n foreach ($this->fields as $configuration => $value) {\n $config_content = str_replace(str_replace('\\\\', '\\\\\\\\', $value['default']), str_replace('\\\\', '\\\\\\\\', $this->configurations[$configuration]), $config_content);\n config([$value['config'] => str_replace('\\\\', '\\\\\\\\', $this->configurations[$configuration])]); //Reset the config value\n }\n\n file_put_contents($this->config_path, $config_content);\n }",
"public function save()\n\t{\n\t\t$json = json_encode($this->config, JSON_PRETTY_PRINT);\n\n\t\tif (!$h = fopen(self::$configPath, 'w'))\n\t\t{\n\t\t\tdie('Could not open file ' . self::$configPath);\n\t\t}\n\n\t\tif (!fwrite($h, $json))\n\t\t{\n\t\t\tdie('Could not write file ' . self::$configPath);\n\t\t}\n\n\t\tfclose($h);\n\t}",
"public function save()\n\t{\n\t\t$h = fopen(WEBDEV_CONFIG_FILE, 'w');\n\t\tfwrite($h, \"<?php\\n return \" .var_export($this->config->all(), true) .';');\n\t\tfclose($h);\n\t}",
"private function saveConfig() {\n \tself::$_configInstance = (object)$this->_data; \n file_put_contents($this->_data['cache_config_file'],serialize(self::$_configInstance)); \n }",
"public function config_save() {\n }",
"public function saveConfig() {\r\n\t$configObj = new \\config(PROFILE_PATH . '/' . $this->name . '/config.php', TRUE);\r\n\t$config = array();\r\n\tinclude($this->name . '/config.php');\r\n\t$config = array_intersect_key(\\app::$config, $config);\r\n\treturn $configObj->saveConfig($config);\r\n }",
"public function save()\n\t{\n\t\t$this->componentConfig->save();\n\t}",
"public function saveConfigOptions() {}",
"public function saveSettingAction(){\n $configKey = array('api_key', 'api_secret','include_folders','resize_auto',\n 'resize_image','min_size','max_size','compression_type_pdf','compression_type_png','compression_type_jpg','compression_type_gif', 'saving_auto', 'compress_auto', 'cron_periodicity', 'reindex_init');\n $coreConfig = Mage::getConfig();\n $post = $this->getRequest()->getPost();\n foreach ($configKey as $key) { \n if (isset($post[$key])) { \n $coreConfig->saveConfig(\"mageio_\".$key, Mage::helper('core')->escapeHtml($post[$key]))->cleanCache();\n }\n }\n\t\t$installed_time = Mage::getStoreConfig('mageio_installed_time');\n if(empty($installed_time)) {\n $installed_time = time();\n $coreConfig = Mage::getConfig();\n $coreConfig->saveConfig('mageio_installed_time', Mage::helper('core')->escapeHtml($installed_time))->cleanCache();\n }\n\t\t//Remove error message if set\n\t\t$coreConfig->saveConfig(\"mageio_errormessage\", Mage::helper('core')->escapeHtml(null))->cleanCache();\n\t\t\n\t\t$this->_redirect('imagerecycle/index/index');\n\t}",
"public function saveSettings()\n {\n return $this->config->saveFile();\n }",
"public function save()\n {\n $values = array('company_name', 'website_name', 'website_description');\n foreach ($values as $value) \n ConfigHelper::save($value, Input::get($value));\n ConfigHelper::save_file('favicon');\n ConfigHelper::save_file('logo');\n ConfigHelper::save_file('login-logo');\n\n return Redirect::route('view_config')->with('message_title', 'Successful!')->with('message', 'Successfully updated the config!');\n }",
"function saveConfig(Config_Lite $inConfig) {\r\n\t\ttry {\r\n $inConfig->save();\r\n\t\t} catch (Config_Lite_Exception $e) {\r\n\t\t\techo \"\\n\" . 'Exception Message: ' . $e->getMessage();\r\n\t\t\twrite_log('Error saving configuration.','ERROR');\r\n\t\t}\r\n\t\t$configFile = dirname(__FILE__) . '/config.ini.php';\r\n\t\t$cache_new = \"'; <?php die('Access denied'); ?>\"; // Adds this to the top of the config so that PHP kills the execution if someone tries to request the config-file remotely.\r\n\t\t$cache_new .= file_get_contents($configFile);\r\n\t\tfile_put_contents($configFile,$cache_new);\r\n\t\t\r\n\t}",
"function config_save($cfg) {\n\t\t$h = fopen(CONFIG_PATH,\"w+\");\n\t\tforeach ($cfg as $cam) {\n\t\t\t$cam_info = $cam[\"name\"].\" : \".$cam[\"hw\"].\"\\t\".$cam[\"width\"].\"x\".$cam[\"height\"].\"\\n\";\n\t\t\tfwrite($h, $cam_info);\n\t\t\tforeach ($cam[\"gates\"] as $gate) {\n\t\t\t\t$gate_info = \"\\t\".$gate[\"name\"].\"\\t(\".$gate[\"x1\"].\",\".$gate[\"y1\"].\")\\t(\".$gate[\"x2\"].\",\".$gate[\"y2\"].\")\\n\";\n\t\t\t\tfwrite($h, $gate_info);\n\t\t\t}\n\t\t}\n\t\tfclose($h);\n\t}",
"public function writeConfig() {\n $mergedTemplate = $this->mergeTemplate();\n file_put_contents(\"{$this->settings['paths']['hostConfigDir']}/{$this->params['name']}.cfg\", $mergedTemplate);\n file_put_contents(\"{$this->settings['paths']['hostTrackDir']}/{$this->params['type']}.inf\", \"{$this->params['name']}:{$this->params['instanceId']}\" . PHP_EOL, FILE_APPEND);\n $this->logChange();\n }",
"public function save() {\n $configdata = $this->get('configdata');\n if (!array_key_exists('defaultvalue_editor', $configdata)) {\n $this->field->save();\n return;\n }\n\n if (!$this->get('id')) {\n $this->field->save();\n }\n\n // Store files.\n $textoptions = $this->value_editor_options();\n $tempvalue = (object) ['defaultvalue_editor' => $configdata['defaultvalue_editor']];\n $tempvalue = file_postupdate_standard_editor($tempvalue, 'defaultvalue', $textoptions, $textoptions['context'],\n 'customfield_textarea', 'defaultvalue', $this->get('id'));\n\n $configdata['defaultvalue'] = $tempvalue->defaultvalue;\n $configdata['defaultvalueformat'] = $tempvalue->defaultvalueformat;\n unset($configdata['defaultvalue_editor']);\n $this->field->set('configdata', json_encode($configdata));\n $this->field->save();\n }",
"public function save()\n\t{\n\t\tglobal $tpl, $lng, $ilCtrl;\n\t\n\t\t$pl = $this->getPluginObject();\n\t\t\n\t\t$form = $this->initConfigurationForm();\n\t\tif ($form->checkInput())\n\t\t{\n\t\t\t$set1 = $form->getInput(\"setting_1\");\n\t\t\t$set2 = $form->getInput(\"setting_2\");\n\t\n\t\t\t// @todo: implement saving to db\n\t\t\t\n\t\t\tilUtil::sendSuccess($pl->txt(\"saving_invoked\"), true);\n\t\t\t$ilCtrl->redirect($this, \"configure\");\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$form->setValuesByPost();\n\t\t\t$tpl->setContent($form->getHtml());\n\t\t}\n\t}",
"private function save() {\n global $config;\n\n //Save Config\n file_put_contents($config[\"usersFile\"],json_encode($this->users,JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT));\n }",
"public static function save()\n\t{\n\t\tConfigManager::save('discord', self::load(), 'config');\n\t}",
"public function save() {\n\t\t$vars = $this->vars;\n\t\t$this->copyFromTemplateIfNeeded();\n\t\t$lines = file($this->filePath);\n\t\tforeach ($lines as $key => $line) {\n\t\t\tif (preg_match(\"/^(.+)vars\\[('|\\\")(.+)('|\\\")](.*)=(.*)\\\"(.*)\\\";(.*)$/si\", $line, $arr)) {\n\t\t\t\t$lines[$key] = \"$arr[1]vars['$arr[3]']$arr[5]=$arr[6]\\\"{$vars[$arr[3]]}\\\";$arr[8]\";\n\t\t\t\tunset($vars[$arr[3]]);\n\t\t\t} elseif (preg_match(\"/^(.+)vars\\[('|\\\")(.+)('|\\\")](.*)=([ \t]+)([0-9]+);(.*)$/si\", $line, $arr)) {\n\t\t\t\t$lines[$key] = \"$arr[1]vars['$arr[3]']$arr[5]=$arr[6]{$vars[$arr[3]]};$arr[8]\";\n\t\t\t\tunset($vars[$arr[3]]);\n\t\t\t}\n\t\t}\n\n\t\tunset($vars['module_load_paths']); // hacky\n\n\t\t// if there are additional vars which were not present in the config\n\t\t// file or in template file then add them at end of the config file\n\t\tif (!empty($vars)) {\n\t\t\t$lines []= \"<?php\\n\";\n\t\t\tforeach ($vars as $name => $value) {\n\t\t\t\tif (is_string($value)) {\n\t\t\t\t\t$lines []= \"\\$vars['$name'] = \\\"$value\\\";\\n\";\n\t\t\t\t} else {\n\t\t\t\t\t$lines []= \"\\$vars['$name'] = $value;\\n\";\n\t\t\t\t}\n\t\t\t}\n\t\t\t$lines []= \"\\n\";\n\t\t}\n\n\t\tfile_put_contents($this->filePath, $lines);\n\t}",
"protected function saveConfig() {\n return $this->updateConfigValues(array(\n 'PAYNETEASY_END_POINT',\n 'PAYNETEASY_LOGIN',\n 'PAYNETEASY_SIGNING_KEY',\n 'PAYNETEASY_SANDBOX_GATEWAY',\n 'PAYNETEASY_PRODUCTION_GATEWAY',\n 'PAYNETEASY_GATEWAY_MODE'\n ));\n }",
"public function configSave()\n\t{\n\t\t$section = Mage::app()->getRequest()->getParam('section');\n\t\tif ($section == 'mtghost_design')\n\t\t{\n\t\t\t$websiteCode = Mage::app()->getRequest()->getParam('website');\n\t\t\t$storeCode = Mage::app()->getRequest()->getParam('store');\n\t\t\t\n\t\t\tMage::getSingleton('mtghost/cssgen_generator')->generateCss('design', $websiteCode, $storeCode);\n\t\t}else if($section == 'mtghost'){\n $websiteCode = Mage::app()->getRequest()->getParam('website');\n $storeCode = Mage::app()->getRequest()->getParam('store');\n\n Mage::getSingleton('mtghost/cssgen_generator')->generateCss('layout', $websiteCode, $storeCode);\n }\n\t}",
"private function writeConfigFile()\n {\n if (!$this->configFile) {\n $confDir = $this->scratchSpace . DIRECTORY_SEPARATOR . 'config';\n mkdir($confDir);\n $this->configFile = $confDir . DIRECTORY_SEPARATOR . 'config.yml';\n }\n file_put_contents($this->configFile, $this->configYaml);\n $this->container->setParameter('config.filename', $this->configFile);\n }",
"private function saveConfig(){\n\t\tif(!isset($_POST['services_ipsec_settings_enabled'])){\n\t\t\t$this->data['enable'] = 'false';\n\t\t}\n\t\telseif($_POST['services_ipsec_settings_enabled'] == 'true'){\n\t\t\t$this->data['enable'] = 'true';\n\t\t}\n\t\t\n\t\t$this->config->saveConfig();\n\t\t$this->returnConfig();\n\t}",
"public function save()\n\t{\n\t\t// -> means the file was never loaded because no setting was changed\n\t\t// -> means no need to save\n\t\tif ($this->settings === null) return;\n\t\t\n\t\t$yaml = Spyc::YAMLDump($this->settings);\n\t}",
"function Save()\n\t{\n\n\t\trequire_once(SENDSTUDIO_BASE_DIRECTORY . DIRECTORY_SEPARATOR . 'addons' . DIRECTORY_SEPARATOR . 'interspire_addons.php');\n\n\t\tif (!is_writable($this->ConfigFile)) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$tmpfname = tempnam(TEMP_DIRECTORY, 'SS_');\n\t\tif (!$handle = fopen($tmpfname, 'w')) {\n\t\t\treturn false;\n\t\t}\n\n\t\t$copy = true;\n\t\tif (is_file(TEMP_DIRECTORY . '/config.prev.php')) {\n\t\t\tif (!@unlink(TEMP_DIRECTORY . '/config.prev.php')) {\n\t\t\t\t$copy = false;\n\t\t\t}\n\t\t}\n\n\t\tif ($copy) {\n\t\t\t@copy($this->ConfigFile, TEMP_DIRECTORY . '/config.prev.php');\n\t\t}\n\n\t\t// the old config backups were in the includes folder so try to clean them up as part of this process.\n\t\t$config_prev = SENDSTUDIO_INCLUDES_DIRECTORY . '/config.prev.php';\n\t\tif (is_file($config_prev)) {\n\t\t\t@unlink($config_prev);\n\t\t}\n\n\t\t$contents = \"<?php\\n\\n\";\n\n\t\tgmt($this);\n\n\t\t$areas = $this->Areas;\n\n\n\t\tforeach ($areas['config'] as $area) {\n\t\t\t// See self::LoadSettings() on UTF8PATCH settings\n\t\t\tif ($area == 'DATABASE_UTF8PATCH') {\n\t\t\t\tif (!defined('SENDSTUDIO_DATABASE_UTF8PATCH')) {\n\t\t\t\t\tdefine('SENDSTUDIO_DATABASE_UTF8PATCH', 1);\n\t\t\t\t}\n\t\t\t\t$contents .= \"define('SENDSTUDIO_DATABASE_UTF8PATCH', '\" . SENDSTUDIO_DATABASE_UTF8PATCH . \"');\\n\";\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\t$string = 'define(\\'SENDSTUDIO_' . $area . '\\', \\'' . addslashes($this->Settings[$area]) . '\\');' . \"\\n\";\n\t\t\t$contents .= $string;\n\t\t}\n\n\t\t$contents .= 'define(\\'SENDSTUDIO_IS_SETUP\\', 1);' . \"\\n\";\n\n\t\t$contents .= \"\\n\\n\";\n\n\t\tfputs($handle, $contents, strlen($contents));\n\t\tfclose($handle);\n\t\tchmod($tmpfname, 0644);\n\n\t\tif (!copy($tmpfname, $this->ConfigFile)) {\n\t\t\treturn false;\n\t\t}\n\t\tunlink($tmpfname);\n\n\t\t$copy = true;\n\t\tif (is_file(TEMP_DIRECTORY . '/config.bkp.php')) {\n\t\t\tif (!@unlink(TEMP_DIRECTORY . '/config.bkp.php')) {\n\t\t\t\t$copy = false;\n\t\t\t}\n\t\t}\n\n\t\tif ($copy) {\n\t\t\t@copy($this->ConfigFile, TEMP_DIRECTORY . '/config.bkp.php');\n\t\t}\n\n\t\t// the old config backups were in the includes folder so try to clean them up as part of this process.\n\t\t$config_bkp = SENDSTUDIO_INCLUDES_DIRECTORY . '/config.bkp.php';\n\t\tif (is_file($config_bkp)) {\n\t\t\t@unlink($config_bkp);\n\t\t}\n\n\t\tunset($areas['config']);\n\n\t\tif (defined('APPLICATION_SHOW_WHITELABEL_MENU') && constant('APPLICATION_SHOW_WHITELABEL_MENU')) {\n\t\t\t$query = \"DELETE FROM \" . SENDSTUDIO_TABLEPREFIX . \"whitelabel_settings\";\n\t\t\t$result = $this->Db->Query($query);\n\t\t\tforeach ($areas['whitelabel'] as $area) {\n\t\t\t\t// If settings are not set, do not continue\n\t\t\t\tif (!isset($this->Settings[$area])) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t$value = $this->Settings[$area];\n\n\t\t\t\tif (strtolower($area) == 'update_check_enabled') {\n\t\t\t\t\t$subAction = 'uninstall';\n\t\t\t\t\tif ($value == '1') {\n\t\t\t\t\t\t$subAction = 'install';\n\t\t\t\t\t}\n\t\t\t\t\t$result = Interspire_Addons::Process('updatecheck', $subAction, array());\n\t\t\t\t\tcontinue;\n\t\t\t\t} elseif (strtolower($area) == 'lng_accountupgrademessage') {\n\t\t\t\t\t$agencyId = get_agency_license_variables();\n\t\t\t\t\tif(empty($agencyId['agencyid'])) {\n\t\t\t\t\t\tcontinue;\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tif (is_bool($value)) {\n\t\t\t\t\t$value = (int)$value;\n\t\t\t\t}\n\n\t\t\t\t$query = \"INSERT INTO \" . SENDSTUDIO_TABLEPREFIX . \"whitelabel_settings(name, value) VALUES ('\" . $this->Db->Quote($area) . \"', '\" . $this->Db->Quote($value) . \"')\";\n\t\t\t\t$result = $this->Db->Query($query);\n\t\t\t}\n\t\t\tif ($this->WhiteLabelCache->exists('IEM_SETTINGS_WHITELABEL')) {\n\t\t\t\t$this->WhiteLabelCache->remove('IEM_SETTINGS_WHITELABEL');\n\t\t\t}\n\t\t}\n\n\t\tif (isset($areas['whitelabel'])) {\n\t\t\tunset($areas['whitelabel']);\n\t\t}\n\n\t\t$stash = IEM_InterspireStash::getInstance();\n\t\tif ($stash->exists('IEM_SYSTEM_SETTINGS')) {\n\t\t\t$stash->remove('IEM_SYSTEM_SETTINGS');\n\t\t}\n\n\t\t$query = \"DELETE FROM \" . SENDSTUDIO_TABLEPREFIX . \"config_settings\";\n\t\t$result = $this->Db->Query($query);\n\n\n\t\tforeach ($areas as $area) {\n\t\t\t$value = isset($this->Settings[$area]) ? $this->Settings[$area] : '';\n\n\n\n\t\t\tif ($area == 'SYSTEM_DATABASE_VERSION') {\n\t\t\t\t$value = $this->Db->FetchOne(\"SELECT version() AS version\");\n\t\t\t}\n\t\t\tif (is_bool($value)) {\n\t\t\t\t$value = (int)$value;\n\t\t\t}\n\n\t\t\t$query = \"INSERT INTO \" . SENDSTUDIO_TABLEPREFIX . \"config_settings(area, areavalue) VALUES ('\" . $this->Db->Quote($area) . \"', '\" . $this->Db->Quote($value) . \"')\";\n\t\t\t$result = $this->Db->Query($query);\n\t\t}\n\n\n\t\treturn true;\n\t}",
"public function saveConfig($data, $values);",
"public function save()\n\t{\n\t\tFile::disk()->put($this->configPath, YAML::dump($this->configData));\n\n\t\tArtisan::call(sprintf('favicon:generate --site=%s', $this->handle));\n\t}",
"private function save_config()\n\t{\n\t\tif (($this->request->server['REQUEST_METHOD'] == 'POST') && $this->validate())\n\t\t{\n\t\t\t$this->model_setting_setting->editSetting('payment_compropago', $this->request->post);\n\t\t\t$this->model_setting_setting->editSetting('payment_compropago_spei', $this->request->post);\n\t\t\t$this->session->data['success'] = $this->language->get('text_success');\n\n\t\t\t$this->register_webhook(\n\t\t\t\t$this->request->post['payment_compropago_publickey'],\n\t\t\t\t$this->request->post['payment_compropago_privatekey'],\n\t\t\t\t$this->request->post['payment_compropago_mode'] === '1'\n\t\t\t);\n\n\t\t\t$linkParams = 'user_token=' . $this->session->data['user_token'] . '&type=payment';\n\t\t\t$this->response->redirect($this->url->link('marketplace/extension', $linkParams, true));\n\t\t}\n\t}",
"public function saveAction()\n {\n $pageCode = $this->getRequest()->getParam('page_code');\n\n $config = $this->initConfig($pageCode);\n\n\n $session = Mage::getSingleton('adminhtml/session');\n\n try {\n\n $section = $config->getData('codes/section');\n $website = $this->getRequest()->getParam('website');\n $store = $this->getRequest()->getParam('store');\n $groups = $this->getRequest()->getPost('groups');\n $configData = Mage::getModel('adminhtml/config_data');\n $configData->setSection($section)\n ->setWebsite($website)\n ->setStore($store)\n ->setGroups($groups)\n ->save();\n\n $session->addSuccess(Mage::helper('novalnet_payment')->__('The configuration has been saved.'));\n } catch (Mage_Core_Exception $e) {\n foreach (explode(\"\\n\", $e->getMessage()) as $message) {\n $session->addError($message);\n }\n } catch (Exception $e) {\n $msg = Mage::helper('novalnet_payment')->__('An error occurred while saving:') . ' ' . $e->getMessage();\n $session->addException($e, $msg);\n }\n\n $this->_redirectByPageConfig();\n }",
"function saveConfigurationSettings() {\n\t$dbhost=$_POST['db_host'];\n\t$dbname=$_POST['db_name'];\n\t$dbuser=$_POST['db_user'];\n\t$dbpasswd=$_POST['db_passwd'];\n\t\n\t\n\t$dbprefix=($_POST['db_prefix']!=\"\"?$_POST['db_prefix']:\"V0_\");\n\t\n\tglobal $cmsFolder;\n\t$configFileText = '';\n\trequire_once('config-prototype.inc.php');\n\t$writeHandle = @fopen(\"../config.inc.php\", 'w');\n\tif (!$writeHandle)\n\t{\n\t\tdisplayError('Could not write to config.inc.php. Please make sure that the file is writable.');\n\t\treturn false;\n\t}\n\tfwrite($writeHandle, $configFileText);\n\tfclose($writeHandle);\n\tdisplayInfo(\"Configuration Successfully Saved!\");\n\n\tdefine(\"MYSQL_SERVER\",$dbhost);\n\tdefine(\"MYSQL_DATABASE\",$dbname);\n\tdefine(\"MYSQL_USERNAME\",$dbuser);\n\tdefine(\"MYSQL_PASSWORD\",$dbpasswd);\n\tdefine(\"MYSQL_DATABASE_PREFIX\",$dbprefix);\n\t\n\t\n\treturn true;\n}",
"private static function doSaveConfigFile() {\n\t\tglobal $conf;\n\t\twgLang::addModuleDefaultFile('configuration');\n\t\t$file = wgPaths::getAdminPath().'config/config.php';\n\t\twgIo::backup($file);\n\t\t$data = NULL;\n\t\t$var = &$_SESSION['data'];\n\t\t$var = array();\n\t\t$fnc = &$_SESSION['func'];\n\t\t$fnc = array();\n\t\t$a = wgPost::getValue('conf');\n\t\t$b['db'] = $conf['db'];\n\t\t$c = array_merge($b, $a);\n\t\t$i = wgPost::getValue('info');\n\t\t$longestlen = 0;\n\t\t$longestfnc = 0;\n\t\tforeach ($c as $gid=>$g) {\n\t\t\tforeach ($g as $k=>$v) {\n\t\t\t\t$var[$gid.$k] = $v;\n\t\t\t\t$fnc[$gid.$k] = \"\\$conf['$gid']['$k']\";\n\t\t\t\tif ($longestlen < strlen($v)) $longestlen = strlen($v);\n\t\t\t\tif ($longestfnc < strlen($fnc[$gid.$k])) $longestfnc = strlen($fnc[$gid.$k]);\n\t\t\t}\n\t\t}\n\t\t$longestlen += 6;\n\t\t$longestfnc += 3;\n\t\tforeach ($c as $gid=>$g) {\n\t\t\t$data .= \"\\r\\n\\r\\n// \".wgLang::get('cnf'.$gid).\"\\r\\n\";\n\t\t\tforeach ($g as $k=>$v) {\n\t\t\t\tif (is_numeric($v)) $data .= self::setFunc($gid.$k, $longestfnc).' = '.self::setInt($gid.$k, $i[$gid][$k], $longestlen).'\n'; \n\t\t\t\telse $data .= self::setFunc($gid.$k, $longestfnc).' = '.self::setString($gid.$k, $i[$gid][$k], $longestlen).'\n';\n\t\t\t}\n\t\t}\n\t\t//return true;\n\t\t$data = '<?php\n/**\n * WebGuru3 configuration file\n *\n * @package WebGuru3\n * @author Ondrej Rafaj\n * @author WebGuruCMS3 Configuration module\n * @version Generated automaticaly\n */\n\n'.$data.'\n?>';\n\t\treturn wgIo::writeFile($file, $data);\n\t}",
"function saveSettings() {\n\tglobal $settings;\n\n\tfile_put_contents(\"settings.json\",json_encode($settings));\n}",
"public function saveSettings()\n {\n $this->store->save($this->data);\n }",
"public function saveSettings()\n {\n if (empty($this->settings)) {\n $this->loadSettings();\n }\n \n $this->saveJSON($this->settings);\n }",
"private static function writeConfig($config)\n {\n self::init();\n\n return file_put_contents(self::$configFile, json_encode((object) $config, JSON_PRETTY_PRINT));\n }",
"abstract protected function saveConfiguration($name, $value);",
"public function save($name) \n {\n // Lowercase the $name\n $name = strtolower($name);\n \n // Check to see if we need to put this in an array\n $ckey = $this->files[$name]['config_key'];\n if($ckey != FALSE)\n {\n $Old_Data = $this->data[$name];\n $this->data[$name] = array(\"$ckey\" => $this->data[$name]);\n }\n\n // Create our new file content\n $cfg = \"<?php\\n\";\n\n // Loop through each var and write it\n foreach( $this->data[$name] as $key => $val )\n {\n switch( gettype($val) )\n {\n case \"boolean\":\n $val = ($val == true) ? 'true' : 'false';\n // donot break\n case \"integer\":\n case \"double\":\n case \"float\":\n $cfg .= \"\\$$key = \" . $val . \";\\n\";\n break;\n case \"array\":\n $val = var_export($val, TRUE);\n $cfg .= \"\\$$key = \" . $val . \";\\n\";\n break;\n case \"NULL\":\n $cfg .= \"\\$$key = null;\\n\";\n break;\n case \"string\":\n $cfg .= (is_numeric($val)) ? \"\\$$key = \" . $val . \";\\n\" : \"\\$$key = '\" . addslashes( $val ) . \"';\\n\";\n break;\n default: break;\n }\n }\n\n // Close the php tag\n $cfg .= \"?>\";\n \n // Add the back to non array if we did put it in one\n if($ckey != FALSE)\n {\n $this->data[$name] = $Old_Data;\n }\n \n // Copy the current config file for backup, \n // and write the new config values to the new config\n copy($this->files[$name]['file_path'], $this->files[$name]['file_path'].'.bak');\n if(file_put_contents( $this->files[$name]['file_path'], $cfg )) \n {\n return TRUE;\n } \n else \n {\n return FALSE;\n }\n }",
"public function save_settings()\n\t{\n\t\t// Create settings array.\n\t\t$settings = array();\n\n\t\t// Loop through default settings and check for saved values.\n\t\tforeach (ee()->simple_cloner_settings->_default_settings as $key => $value)\n\t\t{\n\t\t\tif(($settings[$key] = ee()->input->post($key)) == FALSE)\n\t\t\t{\n\t\t\t\t$settings[$key] = $value;\n\t\t\t}\n\t\t}\n\n\t\t// Serialize settings array and update the extensions table.\n\t\tee()->db->where('class', $this->class_name.'_ext');\n\t\tee()->db->update('extensions', array('settings' => serialize($settings)));\n\n\t\t// Create alert when settings are saved and redirect back to settings page.\n\t\tee('CP/Alert')->makeInline('simple-cloner-save')\n\t\t\t->asSuccess()\n\t\t\t->withTitle(lang('message_success'))\n\t\t\t->addToBody(lang('preferences_updated'))\n\t\t\t->defer();\n\n\t\tee()->functions->redirect(ee('CP/URL')->make('addons/settings/simple_cloner'));\n\t}",
"function configWriter($configs){\n\t\t\t\tglobal $scope_id;\n\t\t\t\t$appearanceSwitch = new Mage_Core_Model_Config();\n\t\t\t\tforeach($configs as $section => $value){\n\t\t\t\t\tif($scope_id){\n\t\t\t\t\t\t$appearanceSwitch->saveConfig($section, $value, 'stores', $scope_id);\n\t\t\t\t\t}else{\n\t\t\t\t\t\t$appearanceSwitch->saveConfig($section, $value, 'default', 0);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}",
"public function save()\n {\n\n // Create config folder if it does not exist.\n $fs = new Filesystem();\n $dumper = new Dumper();\n\n if (!$fs->exists(getenv('HOME').'/.talos')) {\n try {\n $fs->mkdir(getenv('HOME').'/.talos/apps');\n } catch (IOExceptionInterface $e) {\n return false;\n }\n }\n\n try {\n $fs->dumpFile(getenv('HOME').'/.talos/talos.yml', $dumper->dump($this->config, 10));\n\n return true;\n } catch (IOExceptionInterface $e) {\n return false;\n }\n }",
"function saveConfiguration() {\r\n foreach($_POST as $configuration_key=>$configuration_value){\r\n\t\t\t\tif(stripos($configuration_key, \"haendlerbund\")!==false) {\r\n\t\t\t\t\t$sql = xtc_db_query(\"SELECT * FROM configuration WHERE configuration_key='\".$configuration_key.\"' LIMIT 1\");\r\n\t\t\t\t\tif(xtc_db_num_rows($sql)) {\r\n\t\t\t\t\t\txtc_db_query(\"UPDATE configuration SET configuration_value='\".$configuration_value.\"' WHERE configuration_key='\".$configuration_key.\"' LIMIT 1\");\r\n\t\t\t\t\t}\r\n\t\t\t\t} \r\n\t\t\t}\r\n\t\t}",
"public static function save($config)\n {\n $content = \"<\" . \"?php return \";\n $content .= var_export($config, true);\n $content .= \"; ?\" . \">\";\n\n $configFile = self::getConfigFilePath();\n file_put_contents($configFile, $content);\n\n if (function_exists('opcache_invalidate')) {\n opcache_reset();\n opcache_invalidate($configFile);\n }\n\n if (function_exists('apc_compile_file')) {\n apc_compile_file($configFile);\n }\n }",
"function saveConfig($data) {\n\t$isValid = false;\n\tif(strip_tags($data) == $data) {\n\t\t$isValid = true;\n\t}\n\n\tif ($isValid) {\n\t\treturn file_put_contents(\"config.yml\", stripslashes($data));\n\t}\n\t{\n\t\treturn false;\n\t}\n}",
"public function sys_configAction()\n {\n // Check authonitcation\n $this->setAdminTab('developer');\n\n $this->page_title = 'System Configuration';\n $message = \"\";\n $file_path = CONFIG_PATH . DS . \"config.xml\";\n $definition = array();\n $dom = new DOMDocument();\n\n $dom->load($file_path);\n\n if (isset($this->post['Button']['button_save'])) {\n if (is_writeable($file_path)) {\n\n $this->data['sconfig'] = isset($this->data['sconfig'])\n ? $this->data['sconfig'] : array();\n\n $options = $dom->getElementsByTagName('option');\n\n foreach ($options as $option) {\n $name = $option->getAttribute('name');\n $option->getElementsByTagName('value')->item(0)->nodeValue = '';\n\n if (\n in_array($name,\n array_keys($this->data['sconfig'])\n )\n ) {\n $cdataNode = $dom->createCDATASection($this->data['sconfig'][$name]);\n $option->getElementsByTagName('flag')->item(0)->nodeValue = 0;\n }\n else {\n $cdataNode = $dom->createCDATASection(\n $option->getElementsByTagName('default')\n ->item(0)\n ->nodeValue\n );\n\n $option->getElementsByTagName('flag')->item(0)->nodeValue = 1;\n }\n\n $option->getElementsByTagName('value')->item(0)->appendChild($cdataNode);\n\n }\n\n App::Module('Notification')->Push($this->__(\"Configuration updated successfully.\"));\n\n /* Save Configuration */\n $dom->save($file_path);\n }\n else {\n App::Module('Notification')\n ->Push(\n $this->__(\"Your configuration file is not writeable($file_path).\"),\n 'Error'\n );\n }\n $this->redirect(\"/developer/sys-config\");\n exit;\n }\n $this->set('sysconf', $dom);\n }",
"public function ovpnWriteConfig($path)\n {\n //unset($path);\n $myfile = fopen($path, \"w\") or die(\"Unable to open file!\");\n fclose($myfile);\n $myfile = fopen($path, \"a\") or die(\"Unable to open file!\");\n foreach ($this as $key=>$value) {\n if ($key == \"keys\") {\n $key = \"key\";\n }\n if ($key == \"maxclients\") {\n $key = \"max-clients\";\n }\n if ($value == \"\" or $value === null) {\n continue;\n }\n if (strpos($key, '_') !== false) {\n $key = str_replace(\"_\", \"-\", $key);\n }\n if ($key == \"compression\" or $key == \"srvConfigPath\") {\n continue;\n }\n if ($key == \"client-to-client\") {\n fwrite($myfile, \"$value\\n\");\n continue;\n }\n if ($key == \"push-routes\" or $key == \"push-dns\") {\n $quo = '\"';\n $key = \"push\";\n $value = \"$quo$value$quo\\n\";\n }\n if ($key == \"push-gateway\") {\n fwrite($myfile, \"push $quo$value$quo\\n\");\n continue;\n }\n fwrite($myfile, \"$key $value\\n\");\n }\n fclose($myfile);\n //Done setting config, lets save the new object of items in a file for later processing\n $myfile = fopen(\"./vpn/urgent.conf\", \"w\") or die(\"Unable to open file!\");\n fwrite($myfile, serialize($this));\n fclose($myfile);\n }",
"protected function save()\n {\n $css = setcooki_path('plugin') . '/var/app.min.css';\n $json = setcooki_path('plugin'). '/var/options.json';\n $options = Option::get('wunderlist_todo_options', array());\n\n if(is_file($css))\n {\n @unlink($css);\n }\n if(is_file($json))\n {\n @chmod($json, 0755);\n }\n @file_put_contents($json, json_encode($options));\n }",
"private function __saveConfiguration()\n {\n //Check is submit the form\n if (Tools::isSubmit(BECOPAY_PREFIX . 'submit')) {\n\n //clear errors messages\n $this->_errors = array();\n\n //validate is set configuration field\n foreach ($this->config['configuration'] as $config) {\n if ($config['isRequired'] && Tools::getValue(BECOPAY_PREFIX . $config['name']) == NULL)\n $this->_errors[] = $this->l($config['title'] . ' is require');\n }\n\n //if has no errors check with PaymentGateway Constructor validation\n if (empty($this->_errors)) {\n try {\n new PaymentGateway(\n Tools::getValue(BECOPAY_PREFIX . 'apiBaseUrl'),\n Tools::getValue(BECOPAY_PREFIX . 'apiKey'),\n Tools::getValue(BECOPAY_PREFIX . 'mobile')\n );\n } catch (\\Exception $e) {\n $this->_errors[] = $e->getMessage();\n }\n }\n\n //Display error messages if has error\n if (!empty($this->_errors)) {\n $this->_html = $this->displayError(implode('<br>', $this->_errors));\n } else {\n\n //save configuration form fields\n foreach ($this->config['configuration'] as $config)\n if (Tools::getValue(BECOPAY_PREFIX . $config['name']) != NULL)\n Configuration::updateValue(BECOPAY_PREFIX . $config['name'], trim(Tools::getValue(BECOPAY_PREFIX . $config['name'])));\n\n\n //display confirmation message\n $this->_html = $this->displayConfirmation($this->l('Settings updated'));\n }\n }\n }",
"function saveConfiguration() {\n//\t\t$field_value = DevblocksPlatform::importGPC($_POST['field_value']);\n//\t\t$this->params['field_name'] = $field_value;\n\t}",
"function save_settings() {\n\t\t$this->update_option( static::SETTINGS_KEY, $this->settings );\n\t}",
"private function saveType()\n\t{\n\t\t// Build config file\n\t\t$config = \"<?php \\n\\n\";\n\t\t$config.= \"// This config file is auto generated on boot.\\n\\n\";\n\t\t$config.= 'define(\"INSTANCE_TYPE\", \"'.$this->instanceType.'\");'.\"\\n\";\n\t\t$config.= 'define(\"INSTANCE_NAME\", \"'.$this->instanceName.'\");'.\"\\n\";\n\t\t$config.= 'define(\"BRANCH\", \"'.$this->branch.'\");'.\"\\n\";\n\n\t\t// If bootstrapping the development server\n\t\tif($this->instanceDev)\n\t\t{\n\t\t\t$config.= 'define(\"DEV\", TRUE);'.\"\\n\";\n\t\t}\t\n\n\t\t// Write config file to config folder\n\t\tfile_put_contents(\"config/instance.config.php\", $config);\n\t}",
"public function saveConfVars()\n {\n if ($this->getEditObjectId() === 'findologic_module') {\n $this->_saveConfVars();\n } else {\n parent::saveConfVars();\n }\n }",
"public function yandexYml()\r\n {\r\n if ($this->app->jbrequest->isPost()) {\r\n $this->_config->setGroup('config.yml', $this->app->jbrequest->getAdminForm());\r\n $this->setRedirect($this->app->jbrouter->admin(), JText::_('JBZOO_CONFIG_SAVED'));\r\n }\r\n\r\n $this->configData = $this->_config->getGroup('config.yml', $this->app->jbconfig->getList());\r\n\r\n $this->renderView();\r\n }",
"function write_config($data) {\n\n\t\t// Config path\n\t\t$template_path \t= 'config-sample.php';\n\t\t$output_path \t= 'config.php';\n\n\t\t// Open the file\n\t\t$database_file = file_get_contents($template_path);\n\n\t\t$new = str_replace(\"%DB_HOST%\",$data['db_host'],$database_file);\n\t\t$new = str_replace(\"%DB_USERNAME%\",$data['db_username'],$new);\n\t\t$new = str_replace(\"%DB_PASSWORD%\",$data['db_password'],$new);\n\t\t$new = str_replace(\"%DB_NAME%\",$data['db_name'],$new);\n\t\t$new = str_replace(\"%SITE_URL%\",$data['site_url'],$new);\n\n\t\t// Write the new database.php file\n\t\t$handle = fopen($output_path,'w+');\n\n\t\t// Chmod the file, in case the user forgot\n\t\t@chmod($output_path,0777);\n\n\t\t// Verify file permissions\n\t\tif(is_writable($output_path)) {\n\n\t\t\t// Write the file\n\t\t\tif(fwrite($handle,$new)) {\n\t\t\t\treturn true;\n\t\t\t} else {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t} else {\n\t\t\treturn false;\n\t\t}\n\t}",
"function config_save($data) {\n $module = 'project/lpr';\n\n foreach ($data as $name => $value) {\n set_config($name, $value, $module);\n }\n\n return true;\n }",
"protected function setConfigValue($data){\t\n\t\tMage::getModel('core/config_data')->load($data['path'],'path')->setData($data)->save();\n\t}",
"private function write_config_data()\n\t{\n\t\t$captcha_url = '{base_url}images/captchas/';\n\n\t\tforeach (array('avatar_path', 'photo_path', 'signature_img_path', 'pm_path', 'captcha_path', 'theme_folder_path') as $path)\n\t\t{\n\t\t\t$prefix = ($path != 'theme_folder_path') ? $this->root_theme_path : '';\n\t\t\t$this->userdata[$path] = rtrim(realpath($prefix.$this->userdata[$path]), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR;\n\t\t\t$this->userdata[$path] = str_replace($this->base_path, '{base_path}', $this->userdata[$path]);\n\t\t}\n\n\t\t$config = array(\n\t\t\t'db_port' => $this->userdata['db_port'],\n\t\t\t'db_hostname' => $this->userdata['db_hostname'],\n\t\t\t'db_username' => $this->userdata['db_username'],\n\t\t\t'db_password' => $this->userdata['db_password'],\n\t\t\t'db_database' => $this->userdata['db_name'],\n\t\t\t'db_dbprefix' => $this->getDbPrefix(),\n\t\t\t'db_char_set' => $this->userdata['db_char_set'],\n\t\t\t'db_collat' => $this->userdata['db_collat'],\n\t\t\t'app_version' => $this->userdata['app_version'],\n\t\t\t'debug' => '1',\n\t\t\t'site_index' => $this->userdata['site_index'],\n\t\t\t'site_label' => $this->userdata['site_label'],\n\t\t\t'base_path' => $this->base_path,\n\t\t\t'base_url' => $this->userdata['site_url'],\n\t\t\t'cp_url' => str_replace($this->userdata['site_url'], '{base_url}', $this->userdata['cp_url']),\n\t\t\t'site_url' => '{base_url}',\n\t\t\t'theme_folder_url' => '{base_url}themes/',\n\t\t\t'webmaster_email' => $this->userdata['email_address'],\n\t\t\t'webmaster_name' => '',\n\t\t\t'channel_nomenclature' => 'channel',\n\t\t\t'max_caches' => '150',\n\t\t\t'cache_driver' => 'file',\n\t\t\t'captcha_url' => $captcha_url,\n\t\t\t'captcha_path' => $this->userdata['captcha_path'],\n\t\t\t'captcha_font' => 'y',\n\t\t\t'captcha_rand' => 'y',\n\t\t\t'captcha_require_members' => 'n',\n\t\t\t'require_captcha' => 'n',\n\t\t\t'enable_sql_caching' => 'n',\n\t\t\t'force_query_string' => 'n',\n\t\t\t'show_profiler' => 'n',\n\t\t\t'include_seconds' => 'n',\n\t\t\t'cookie_domain' => '',\n\t\t\t'cookie_path' => '/',\n\t\t\t'cookie_prefix' => '',\n\t\t\t'website_session_type' => 'c',\n\t\t\t'cp_session_type' => 'c',\n\t\t\t'cookie_httponly' => 'y',\n\t\t\t'allow_username_change' => 'y',\n\t\t\t'allow_multi_logins' => 'y',\n\t\t\t'password_lockout' => 'y',\n\t\t\t'password_lockout_interval' => '1',\n\t\t\t'require_ip_for_login' => 'y',\n\t\t\t'require_ip_for_posting' => 'y',\n\t\t\t'require_secure_passwords' => 'n',\n\t\t\t'allow_dictionary_pw' => 'y',\n\t\t\t'name_of_dictionary_file' => '',\n\t\t\t'xss_clean_uploads' => 'y',\n\t\t\t'redirect_method' => $this->userdata['redirect_method'],\n\t\t\t'deft_lang' => $this->userdata['deft_lang'],\n\t\t\t'xml_lang' => 'en',\n\t\t\t'send_headers' => 'y',\n\t\t\t'gzip_output' => 'n',\n\t\t\t'is_system_on' => 'y',\n\t\t\t'allow_extensions' => 'y',\n\t\t\t'date_format' => '%n/%j/%Y',\n\t\t\t'time_format' => '12',\n\t\t\t'include_seconds' => 'n',\n\t\t\t'server_offset' => '',\n\t\t\t'default_site_timezone' => date_default_timezone_get(),\n\t\t\t'mail_protocol' => 'mail',\n\t\t\t'email_newline' => '\\n', // single-quoted for portability\n\t\t\t'smtp_server' => '',\n\t\t\t'smtp_username' => '',\n\t\t\t'smtp_password' => '',\n\t\t\t'email_smtp_crypto' => 'ssl',\n\t\t\t'email_debug' => 'n',\n\t\t\t'email_charset' => 'utf-8',\n\t\t\t'email_batchmode' => 'n',\n\t\t\t'email_batch_size' => '',\n\t\t\t'mail_format' => 'plain',\n\t\t\t'word_wrap' => 'y',\n\t\t\t'email_console_timelock' => '5',\n\t\t\t'log_email_console_msgs' => 'y',\n\t\t\t'log_search_terms' => 'y',\n\t\t\t'un_min_len' => '4',\n\t\t\t'pw_min_len' => '5',\n\t\t\t'allow_member_registration' => 'n',\n\t\t\t'allow_member_localization' => 'y',\n\t\t\t'req_mbr_activation' => 'email',\n\t\t\t'new_member_notification' => 'n',\n\t\t\t'mbr_notification_emails' => '',\n\t\t\t'require_terms_of_service' => 'y',\n\t\t\t'default_member_group' => '5',\n\t\t\t'profile_trigger' => 'member',\n\t\t\t'member_theme' => 'default',\n\t\t\t'enable_avatars' => 'y',\n\t\t\t'allow_avatar_uploads' => 'n',\n\t\t\t'avatar_url' => '{base_url}'.$this->userdata['avatar_url'],\n\t\t\t'avatar_path' => $this->userdata['avatar_path'],\n\t\t\t'avatar_max_width' => '100',\n\t\t\t'avatar_max_height' => '100',\n\t\t\t'avatar_max_kb' => '50',\n\t\t\t'enable_photos' => 'n',\n\t\t\t'photo_url' => '{base_url}'.$this->userdata['photo_url'],\n\t\t\t'photo_path' => $this->userdata['photo_path'],\n\t\t\t'photo_max_width' => '100',\n\t\t\t'photo_max_height' => '100',\n\t\t\t'photo_max_kb' => '50',\n\t\t\t'allow_signatures' => 'y',\n\t\t\t'sig_maxlength' => '500',\n\t\t\t'sig_allow_img_hotlink' => 'n',\n\t\t\t'sig_allow_img_upload' => 'n',\n\t\t\t'sig_img_url' => '{base_url}'.$this->userdata['signature_img_url'],\n\t\t\t'sig_img_path' => $this->userdata['signature_img_path'],\n\t\t\t'sig_img_max_width' => '480',\n\t\t\t'sig_img_max_height' => '80',\n\t\t\t'sig_img_max_kb' => '30',\n\t\t\t'prv_msg_enabled' => 'y',\n\t\t\t'prv_msg_allow_attachments' => 'y',\n\t\t\t'prv_msg_upload_path' => $this->userdata['pm_path'],\n\t\t\t'prv_msg_max_attachments' => '3',\n\t\t\t'prv_msg_attach_maxsize' => '250',\n\t\t\t'prv_msg_attach_total' => '100',\n\t\t\t'prv_msg_html_format' => 'safe',\n\t\t\t'prv_msg_auto_links' => 'y',\n\t\t\t'prv_msg_max_chars' => '6000',\n\t\t\t'enable_template_routes' => 'y',\n\t\t\t'strict_urls' => 'y',\n\t\t\t'site_404' => '',\n\t\t\t'save_tmpl_revisions' => 'n',\n\t\t\t'max_tmpl_revisions' => '5',\n\t\t\t'save_tmpl_files' => 'y',\n\t\t\t'deny_duplicate_data' => 'y',\n\t\t\t'redirect_submitted_links' => 'n',\n\t\t\t'enable_censoring' => 'n',\n\t\t\t'censored_words' => '',\n\t\t\t'censor_replacement' => '',\n\t\t\t'banned_ips' => '',\n\t\t\t'banned_emails' => '',\n\t\t\t'banned_usernames' => '',\n\t\t\t'banned_screen_names' => '',\n\t\t\t'ban_action' => 'restrict',\n\t\t\t'ban_message' => 'This site is currently unavailable',\n\t\t\t'ban_destination' => 'http://www.yahoo.com/',\n\t\t\t'enable_emoticons' => 'y',\n\t\t\t'emoticon_url' => '{base_url}'.'images/smileys/',\n\t\t\t'recount_batch_total' => '1000',\n\t\t\t'image_resize_protocol' => 'gd2',\n\t\t\t'image_library_path' => '',\n\t\t\t'thumbnail_prefix' => 'thumb',\n\t\t\t'word_separator' => 'dash',\n\t\t\t'use_category_name' => 'n',\n\t\t\t'reserved_category_word' => 'category',\n\t\t\t'auto_convert_high_ascii' => 'n',\n\t\t\t'new_posts_clear_caches' => 'y',\n\t\t\t'auto_assign_cat_parents' => 'y',\n\t\t\t'new_version_check' => 'y',\n\t\t\t'enable_throttling' => 'n',\n\t\t\t'banish_masked_ips' => 'y',\n\t\t\t'max_page_loads' => '10',\n\t\t\t'time_interval' => '8',\n\t\t\t'lockout_time' => '30',\n\t\t\t'banishment_type' => 'message',\n\t\t\t'banishment_url' => '',\n\t\t\t'banishment_message' => 'You have exceeded the allowed page load frequency.',\n\t\t\t'enable_search_log' => 'y',\n\t\t\t'max_logged_searches' => '500',\n\t\t\t'memberlist_order_by' => \"member_id\",\n\t\t\t'memberlist_sort_order' => \"desc\",\n\t\t\t'memberlist_row_limit' => \"20\",\n\t\t\t'is_site_on' => 'y',\n\t\t\t'theme_folder_path' => $this->userdata['theme_folder_path'],\n\t\t);\n\n\t\t// Default Administration Prefs\n\t\t$admin_default = array(\n\t\t\t'site_index',\n\t\t\t'base_url',\n\t\t\t'base_path',\n\t\t\t'cp_url',\n\t\t\t'site_url',\n\t\t\t'theme_folder_url',\n\t\t\t'webmaster_email',\n\t\t\t'webmaster_name',\n\t\t\t'channel_nomenclature',\n\t\t\t'max_caches',\n\t\t\t'captcha_url',\n\t\t\t'captcha_path',\n\t\t\t'captcha_font',\n\t\t\t'captcha_rand',\n\t\t\t'captcha_require_members',\n\t\t\t'require_captcha',\n\t\t\t'enable_sql_caching',\n\t\t\t'force_query_string',\n\t\t\t'show_profiler',\n\t\t\t'include_seconds',\n\t\t\t'cookie_domain',\n\t\t\t'cookie_path',\n\t\t\t'website_session_type',\n\t\t\t'cp_session_type',\n\t\t\t'allow_username_change',\n\t\t\t'allow_multi_logins',\n\t\t\t'password_lockout',\n\t\t\t'password_lockout_interval',\n\t\t\t'require_ip_for_login',\n\t\t\t'require_ip_for_posting',\n\t\t\t'require_secure_passwords',\n\t\t\t'allow_dictionary_pw',\n\t\t\t'name_of_dictionary_file',\n\t\t\t'xss_clean_uploads',\n\t\t\t'redirect_method',\n\t\t\t'deft_lang',\n\t\t\t'xml_lang',\n\t\t\t'send_headers',\n\t\t\t'gzip_output',\n\t\t\t'date_format',\n\t\t\t'time_format',\n\t\t\t'include_seconds',\n\t\t\t'server_offset',\n\t\t\t'default_site_timezone',\n\t\t\t'mail_protocol',\n\t\t\t'email_newline',\n\t\t\t'smtp_server',\n\t\t\t'smtp_username',\n\t\t\t'smtp_password',\n\t\t\t'email_smtp_crypto',\n\t\t\t'email_debug',\n\t\t\t'email_charset',\n\t\t\t'email_batchmode',\n\t\t\t'email_batch_size',\n\t\t\t'mail_format',\n\t\t\t'word_wrap',\n\t\t\t'email_console_timelock',\n\t\t\t'log_email_console_msgs',\n\t\t\t'log_search_terms',\n\t\t\t'deny_duplicate_data',\n\t\t\t'redirect_submitted_links',\n\t\t\t'enable_censoring',\n\t\t\t'censored_words',\n\t\t\t'censor_replacement',\n\t\t\t'banned_ips',\n\t\t\t'banned_emails',\n\t\t\t'banned_usernames',\n\t\t\t'banned_screen_names',\n\t\t\t'ban_action',\n\t\t\t'ban_message',\n\t\t\t'ban_destination',\n\t\t\t'enable_emoticons',\n\t\t\t'emoticon_url',\n\t\t\t'recount_batch_total',\n\t\t\t'new_version_check',\n\t\t\t'enable_throttling',\n\t\t\t'banish_masked_ips',\n\t\t\t'max_page_loads',\n\t\t\t'time_interval',\n\t\t\t'lockout_time',\n\t\t\t'banishment_type',\n\t\t\t'banishment_url',\n\t\t\t'banishment_message',\n\t\t\t'enable_search_log',\n\t\t\t'max_logged_searches',\n\t\t\t'theme_folder_path',\n\t\t\t'is_site_on'\n\t\t);\n\n\t\t$site_prefs = array();\n\n\t\tforeach($admin_default as $value)\n\t\t{\n\t\t\t$site_prefs[$value] = $config[$value];\n\t\t}\n\n\t\tee()->db->where('site_id', 1);\n\t\tee()->db->update('sites', array('site_system_preferences' => base64_encode(serialize($site_prefs))));\n\n\t\t// Default Members Prefs\n\t\t$member_default = array(\n\t\t\t'un_min_len',\n\t\t\t'pw_min_len',\n\t\t\t'allow_member_registration',\n\t\t\t'allow_member_localization',\n\t\t\t'req_mbr_activation',\n\t\t\t'new_member_notification',\n\t\t\t'mbr_notification_emails',\n\t\t\t'require_terms_of_service',\n\t\t\t'default_member_group',\n\t\t\t'profile_trigger',\n\t\t\t'member_theme',\n\t\t\t'enable_avatars',\n\t\t\t'allow_avatar_uploads',\n\t\t\t'avatar_url',\n\t\t\t'avatar_path',\n\t\t\t'avatar_max_width',\n\t\t\t'avatar_max_height',\n\t\t\t'avatar_max_kb',\n\t\t\t'enable_photos',\n\t\t\t'photo_url',\n\t\t\t'photo_path',\n\t\t\t'photo_max_width',\n\t\t\t'photo_max_height',\n\t\t\t'photo_max_kb',\n\t\t\t'allow_signatures',\n\t\t\t'sig_maxlength',\n\t\t\t'sig_allow_img_hotlink',\n\t\t\t'sig_allow_img_upload',\n\t\t\t'sig_img_url',\n\t\t\t'sig_img_path',\n\t\t\t'sig_img_max_width',\n\t\t\t'sig_img_max_height',\n\t\t\t'sig_img_max_kb',\n\t\t\t'prv_msg_enabled',\n\t\t\t'prv_msg_allow_attachments',\n\t\t\t'prv_msg_upload_path',\n\t\t\t'prv_msg_max_attachments',\n\t\t\t'prv_msg_attach_maxsize',\n\t\t\t'prv_msg_attach_total',\n\t\t\t'prv_msg_html_format',\n\t\t\t'prv_msg_auto_links',\n\t\t\t'prv_msg_max_chars',\n\t\t\t'memberlist_order_by',\n\t\t\t'memberlist_sort_order',\n\t\t\t'memberlist_row_limit'\n\t\t);\n\n\t\t$site_prefs = array();\n\n\t\tforeach($member_default as $value)\n\t\t{\n\t\t\t$site_prefs[$value] = $config[$value];\n\t\t}\n\n\t\tee()->db->where('site_id', 1);\n\t\tee()->db->update('sites', array('site_member_preferences' => base64_encode(serialize($site_prefs))));\n\n\t\t// Default Templates Prefs\n\t\t$template_default = array(\n\t\t\t'enable_template_routes',\n\t\t\t'strict_urls',\n\t\t\t'site_404',\n\t\t\t'save_tmpl_revisions',\n\t\t\t'max_tmpl_revisions',\n\t\t);\n\t\t$site_prefs = array();\n\n\t\tforeach($template_default as $value)\n\t\t{\n\t\t\t$site_prefs[$value] = $config[$value];\n\t\t}\n\n\t\tee()->db->where('site_id', 1);\n\t\tee()->db->update('sites', array('site_template_preferences' => base64_encode(serialize($site_prefs))));\n\n\t\t// Default Channels Prefs\n\t\t$channel_default = array(\n\t\t\t'image_resize_protocol',\n\t\t\t'image_library_path',\n\t\t\t'thumbnail_prefix',\n\t\t\t'word_separator',\n\t\t\t'use_category_name',\n\t\t\t'reserved_category_word',\n\t\t\t'auto_convert_high_ascii',\n\t\t\t'new_posts_clear_caches',\n\t\t\t'auto_assign_cat_parents',\n\t\t\t'enable_comments',\n\t\t\t'comment_word_censoring',\n\t\t\t'comment_moderation_override',\n\t\t\t'comment_edit_time_limit'\n\t\t);\n\n\t\t$site_prefs = array();\n\n\t\tforeach($channel_default as $value)\n\t\t{\n\t\t\tif (isset($config[$value]))\n\t\t\t{\n\t\t\t\t$site_prefs[$value] = $config[$value];\n\t\t\t}\n\t\t}\n\n\t\tee()->db->where('site_id', 1);\n\t\tee()->db->update('sites', array('site_channel_preferences' => base64_encode(serialize($site_prefs))));\n\n\t\t// Remove Site Prefs from Config\n\t\tforeach(array_merge($admin_default, $member_default, $template_default, $channel_default) as $value)\n\t\t{\n\t\t\tunset($config[$value]);\n\t\t}\n\n\t\t// Write the config file data\n\t\t$this->write_config_from_template($config);\n\n\t\treturn TRUE;\n\t}",
"public function saveConfig() {\n\t\tif(!$this->_configTitle) throw new Exception(lang('error_4'));\n\t\tif(!$this->_configDatabase) throw new Exception(lang('error_4'));\n\t\tif(!$this->_configTable) throw new Exception(lang('error_4'));\n\t\tif(!$this->_configCreditsCol) throw new Exception(lang('error_4'));\n\t\tif(!$this->_configUserCol) throw new Exception(lang('error_4'));\n\t\tif(!$this->_configUserColId) throw new Exception(lang('error_4'));\n\t\t\n\t\t$data = array(\n\t\t\t'title' => $this->_configTitle,\n\t\t\t'database' => $this->_configDatabase,\n\t\t\t'table' => $this->_configTable,\n\t\t\t'creditscol' => $this->_configCreditsCol,\n\t\t\t'usercol' => $this->_configUserCol,\n\t\t\t'usercolid' => $this->_configUserColId,\n\t\t\t'checkonline' => $this->_configCheckOnline,\n\t\t\t'display' => $this->_configDisplay,\n\t\t\t'phrase' => $this->_configPhrase\n\t\t);\n\t\t\n\t\t$query = \"INSERT INTO \"._WE_CREDITSYS_.\" \"\n\t\t\t. \"(config_title, config_database, config_table, config_credits_col, config_user_col, config_user_col_id, config_checkonline, config_display, config_phrase) \"\n\t\t\t. \"VALUES \"\n\t\t\t. \"(:title, :database, :table, :creditscol, :usercol, :usercolid, :checkonline, :display, :phrase)\";\n\t\t\n\t\t$saveConfig = $this->db->query($query, $data);\n\t\tif(!$saveConfig) throw new Exception(lang('error_140'));\n\t}",
"public static function config_save($key, $value, $create = true) {\n\t\t//get original value\n $original_value = Kohana::config($key);\n if (is_numeric($value)) {\n $value = $value . '';\n }\n\t\t// Get the group name from the key\n\t\t$keys = explode('.', $key, 2); // $keys[0] is the config filename, $keys[1] is the parameter name\n $config_file = APPPATH . 'config/' . $keys[0] . '.php';\n\n if (!file_exists($config_file) && $create) {\n $config_files = Kohana::find_file('config', $keys[0]);\n self::$config_data[$keys[0]] = file_get_contents(array_pop($config_files));\n $handle = fopen($config_file, 'w+b');\n fclose($handle);\n }\n\n if (empty(self::$config_data[$keys[0]])) {\n self::$config_data[$keys[0]] = file_get_contents($config_file);\n }\n\n /*\n check if is array to array or string to string\n */\n $value = var_export($value, true);\n self::$config_data[$keys[0]] = preg_replace('#(\\$config\\[\\'' . $keys[1] . '\\'\\] = )(.*?)([\\)\\']{1})(;\\s+)#s', '$1' . $value . '$4', self::$config_data[$keys[0]]);\n\n file_put_contents($config_file, self::$config_data[$keys[0]]);\n return true;\n }",
"public function createBookConfig()\n {\n $bookConfig = $this->twig->render('config.yml.twig', [\n 'title' => $this->config->title,\n 'author' => $this->config->author,\n 'entries' => $this->entries\n ]);\n file_put_contents($this->docPath.DIRECTORY_SEPARATOR.'config.yml', $bookConfig);\n }",
"private function save() \n {\n $content = \"<?php\\n\\nreturn\\n[\\n\";\n\n foreach ($this->arrayLang as $this->key => $this->value) \n {\n $content .= \"\\t'\".$this->key.\"' => '\".$this->value.\"',\\n\";\n }\n\n $content .= \"];\";\n\n file_put_contents($this->path, $content);\n\n }",
"public function save_config()\n {\n $i = 0;\n $rows = list_to_map('id', $GLOBALS['SITE_DB']->query_select('pstore_customs', array('*')));\n while (array_key_exists('custom_' . strval($i), $_POST)) {\n $id = post_param_integer('custom_' . strval($i));\n $title = post_param_string('custom_title_' . strval($i));\n $description = post_param_string('custom_description_' . strval($i));\n $enabled = post_param_integer('custom_enabled_' . strval($i), 0);\n $cost = post_param_integer('custom_cost_' . strval($i));\n $one_per_member = post_param_integer('custom_one_per_member_' . strval($i), 0);\n $mail_subject = post_param_string('custom_mail_subject_' . strval($i));\n $mail_body = post_param_string('custom_mail_body_' . strval($i));\n\n $delete = post_param_integer('delete_custom_' . strval($i), 0);\n\n $_title = $rows[$id]['c_title'];\n $_description = $rows[$id]['c_description'];\n $_mail_subject = $rows[$id]['c_mail_subject'];\n $_mail_body = $rows[$id]['c_mail_body'];\n\n if ($delete == 1) {\n delete_lang($_title);\n delete_lang($_description);\n delete_lang($_mail_subject);\n delete_lang($_mail_body);\n $GLOBALS['SITE_DB']->query_delete('pstore_customs', array('id' => $id), '', 1);\n } else {\n $map = array(\n 'c_enabled' => $enabled,\n 'c_cost' => $cost,\n 'c_one_per_member' => $one_per_member,\n );\n $map += lang_remap('c_title', $_title, $title);\n $map += lang_remap_comcode('c_description', $_description, $description);\n $map += lang_remap('c_mail_subject', $_mail_subject, $mail_subject);\n $map += lang_remap('c_mail_body', $_mail_body, $mail_body);\n $GLOBALS['SITE_DB']->query_update('pstore_customs', $map, array('id' => $id), '', 1);\n }\n $i++;\n }\n $title = post_param_string('custom_title', null);\n if (!is_null($title)) {\n $description = post_param_string('custom_description');\n $enabled = post_param_integer('custom_enabled', 0);\n $cost = post_param_integer('custom_cost');\n $one_per_member = post_param_integer('custom_one_per_member', 0);\n $mail_subject = post_param_string('custom_mail_subject');\n $mail_body = post_param_string('custom_mail_body');\n\n $map = array(\n 'c_enabled' => $enabled,\n 'c_cost' => $cost,\n 'c_one_per_member' => $one_per_member,\n );\n $map += insert_lang('c_title', $title, 2);\n $map += insert_lang_comcode('c_description', $description, 2);\n $map += insert_lang('c_mail_subject', $mail_subject, 2);\n $map += insert_lang('c_mail_body', $mail_body, 2);\n $GLOBALS['SITE_DB']->query_insert('pstore_customs', $map);\n }\n\n log_it('POINTSTORE_AMEND_CUSTOM_PRODUCTS');\n }",
"function notification_user_settings_save() {\n\tglobal $CONFIG;\n\t//@todo Wha??\n\tinclude($CONFIG->path . \"actions/notifications/settings/usersettings/save.php\");\n}",
"function save_config()\n\t{\n\t\t$i=0;\n\t\t$rows=list_to_map('id',$GLOBALS['SITE_DB']->query_select('pstore_customs',array('*')));\n\t\twhile (array_key_exists('custom_'.strval($i),$_POST))\n\t\t{\n\t\t\t$id=post_param_integer('custom_'.strval($i));\n\t\t\t$title=post_param('custom_title_'.strval($i));\n\t\t\t$description=post_param('custom_description_'.strval($i));\n\t\t\t$enabled=post_param_integer('custom_enabled_'.strval($i),0);\n\t\t\t$cost=post_param_integer('custom_cost_'.strval($i));\n\t\t\t$one_per_member=post_param_integer('custom_one_per_member_'.strval($i),0);\n\t\t\t$delete=post_param_integer('delete_custom_'.strval($i),0);\n\t\t\t$_title=$rows[$id]['c_title'];\n\t\t\t$_description=$rows[$id]['c_description'];\n\t\t\tif ($delete==1)\n\t\t\t{\n\t\t\t\tdelete_lang($_title);\n\t\t\t\tdelete_lang($_description);\n\t\t\t\t$GLOBALS['SITE_DB']->query_delete('pstore_customs',array('id'=>$id),'',1);\n\t\t\t} else\n\t\t\t{\n\t\t\t\t$GLOBALS['SITE_DB']->query_update('pstore_customs',array(\n\t\t\t\t\t'c_title'=>lang_remap($_title,$title),\n\t\t\t\t\t'c_description'=>lang_remap($_description,$description),\n\t\t\t\t\t'c_enabled'=>$enabled,\n\t\t\t\t\t'c_cost'=>$cost,\n\t\t\t\t\t'c_one_per_member'=>$one_per_member,\n\t\t\t\t),array('id'=>$id),'',1);\n\t\t\t}\n\t\t\t$i++;\n\t\t}\n\t\t$title=post_param('custom_title',NULL);\n\t\tif (!is_null($title))\n\t\t{\n\t\t\t$description=post_param('custom_description');\n\t\t\t$enabled=post_param_integer('custom_enabled',0);\n\t\t\t$cost=post_param_integer('custom_cost');\n\t\t\t$one_per_member=post_param_integer('custom_one_per_member',0);\n\n\t\t\t$GLOBALS['SITE_DB']->query_insert('pstore_customs',array(\n\t\t\t\t'c_title'=>insert_lang($title,2),\n\t\t\t\t'c_description'=>insert_lang($description,2),\n\t\t\t\t'c_enabled'=>$enabled,\n\t\t\t\t'c_cost'=>$cost,\n\t\t\t\t'c_one_per_member'=>$one_per_member,\n\t\t\t));\n\t\t}\n\t}",
"function save_config()\n\t{\n\t\t$pop3=post_param_integer('pop3',-1);\n\t\tif ($pop3!=-1)\n\t\t{\n\t\t\t$dpop3=post_param('dpop3');\n\t\t\t$GLOBALS['SITE_DB']->query_insert('prices',array('name'=>'pop3_'.$dpop3,'price'=>$pop3));\n\t\t\tlog_it('POINTSTORE_ADD_MAIL_POP3',$dpop3);\n\t\t}\n\t\t$this->_do_price_mail();\n\t}",
"private function save_configuration_bundle() {\n\t\t$this->configuration_bundle = array();\n\t\t// Some items must always be saved + restored; others only on a migration\n\t\t// Remember, if modifying this, that a restoration can include restoring a destroyed site from a backup onto a fresh WP install on the same URL. So, it is not necessarily desirable to retain the current settings and drop the ones in the backup.\n\t\t$keys_to_save = array('updraft_remotesites', 'updraft_migrator_localkeys', 'updraft_central_localkeys', 'updraft_restore_in_progress');\n\n\t\tif ($this->old_siteurl != $this->our_siteurl || (defined('UPDRAFTPLUS_RESTORE_ALL_SETTINGS') && UPDRAFTPLUS_RESTORE_ALL_SETTINGS)) {\n\t\t\tglobal $updraftplus;\n\t\t\t$keys_to_save = array_merge($keys_to_save, $updraftplus->get_settings_keys());\n\t\t\t$keys_to_save[] = 'updraft_backup_history';\n\t\t}\n\n\t\tforeach ($keys_to_save as $key) {\n\t\t\t$this->configuration_bundle[$key] = UpdraftPlus_Options::get_updraft_option($key);\n\t\t}\n\t}",
"function testSaveConfigFile(){\n\t\t\techo \"testing magratheaConfig saving a config file... <br/>\";\n\t\t\t$confs = array(\"config_test\" => \"ok\", \n\t\t\t\t\"config_test2\" => \"another_ok\" );\n\t\t\t$this->magConfig->setConfig($confs);\n\t\t\t$this->magConfig->Save(false);\n\t\t\t$this->assertTrue(file_exists($this->configPath.\"test_conf.conf\"));\n\t\t}",
"public function save()\n {\n parent::save();\n\n $myConfig = $this->getConfig();\n $soxId = $this->getEditObjectId();\n\n $aParams = oxRegistry::getConfig()->getRequestParameter(\"editval\");\n\n\n // #918 S\n // checkbox handling\n $aParams['oxshops__oxactive'] = (isset($aParams['oxshops__oxactive']) && $aParams['oxshops__oxactive'] == true) ? 1 : 0;\n $aParams['oxshops__oxproductive'] = (isset($aParams['oxshops__oxproductive']) && $aParams['oxshops__oxproductive'] == true) ? 1 : 0;\n\n $isubjlang = oxRegistry::getConfig()->getRequestParameter(\"subjlang\");\n $iLang = ($isubjlang && $isubjlang > 0) ? $isubjlang : 0;\n\n /** @var oxShop $oShop */\n $oShop = oxNew(\"oxshop\");\n if ($soxId != \"-1\") {\n $oShop->loadInLang($iLang, $soxId);\n } else {\n $aParams['oxshops__oxid'] = null;\n }\n\n if ($aParams['oxshops__oxsmtp']) {\n $aParams['oxshops__oxsmtp'] = trim($aParams['oxshops__oxsmtp']);\n }\n\n $oShop->setLanguage(0);\n $oShop->assign($aParams);\n $oShop->setLanguage($iLang);\n\n if (($sNewSMPTPass = oxRegistry::getConfig()->getRequestParameter(\"oxsmtppwd\"))) {\n $oShop->oxshops__oxsmtppwd->setValue($sNewSMPTPass == '-' ? \"\" : $sNewSMPTPass);\n }\n\n\n try {\n $oShop->save();\n } catch (oxException $e) {\n\n return;\n }\n\n $this->_aViewData[\"updatelist\"] = \"1\";\n\n\n oxRegistry::getSession()->setVariable(\"actshop\", $soxId);\n }",
"function testSaveConfigFile(){\n\t\tTestsHelper::Print(\"testing magratheaConfig saving a config file...\");\n\t\t$confs = array(\"config_test\" => \"ok\", \n\t\t\t\"config_test2\" => \"another_ok\" );\n\t\t$this->magConfig->setConfig($confs);\n\t\t$this->magConfig->Save(false);\n\t\t$this->assertTrue(file_exists($this->configPath.\"/\".$this->fileName));\n\t}",
"function saveSettings()\n\t\t{\n\t\t\t$this->Init();\n\n\t\t\t$this->saveExternalSettings();\n\t\t\t\n\t\t\t$settings = serialize(array(\"settings\"=>$this->settings));\n\t\n\t\n\t\t\t$stream = mapi_openpropertytostream($this->store, PR_EC_WEBACCESS_SETTINGS, MAPI_CREATE | MAPI_MODIFY);\n\t\t\tmapi_stream_setsize($stream, strlen($settings));\n\t\t\tmapi_stream_seek($stream, 0, STREAM_SEEK_SET);\n\t\t\tmapi_stream_write($stream, $settings);\n\t\t\tmapi_stream_commit($stream);\n\t\n\t\t\tmapi_savechanges($this->store);\n\t\n\t\t\t// reload settings from store...\n\t\t\t$this->retrieveSettings();\n\t\t}",
"private function _saveConfVars()\n {\n $config = $this->getConfig();\n\n $this->resetContentCache();\n\n $this->_sModuleId = $this->getEditObjectId();\n $shopId = $config->getShopId();\n\n $moduleId = $this->_getModuleForConfigVars();\n\n foreach ($this->_aConfParams as $type => $param) {\n $confVars = $config->getRequestParameter($param);\n\n if (is_array($confVars)) {\n foreach ($confVars as $name => $value) {\n if (preg_match('/^[A-Z0-9]{32}$/', $value) || empty($value)) {\n $dbType = $this->_getDbConfigTypeName($type);\n $config->saveShopConfVar(\n $dbType,\n $name,\n $this->_serializeConfVar($dbType, $name, $value),\n $shopId,\n $moduleId\n );\n } else {\n return false;\n }\n }\n }\n }\n\n return true;\n }",
"function write() {\n\t\t$this->readychk();\n\t\tif (!is_dir($this->dir_path)) { mkdir($this->dir_path); }\n\t\tif (!is_dir($this->asset_path)) { mkdir($this->asset_path); }\n\n\t\t$cstr = json_encode($this->export(TRUE, TRUE));\n\t\tif (\n\t\t\t$cstr === FALSE &&\n\t\t\tjson_last_error() !== JSON_ERROR_NONE\n\t\t) { throw new IntException(\"Slide config encoding failed.\"); }\n\t\tfile_lock_and_put($this->conf_path, $cstr);\n\t}",
"public function writeConfigFile($config)\n {\n $mysite = $this->directory . '/mysite';\n $file = $mysite . '/_config.php';\n\n if(!is_dir($mysite)) {\n $this->io->text('create ' . $mysite);\n mkdir($mysite);\n }\n\n $this->io->text('create ' . $file);\n touch($file);\n\n $this->io->text('writing mysite/_config.php');\n\n $content = \"<?php\\n\\n\";\n $content .= \"global \\$project;\\n\";\n $content .= \"\\$project = 'mysite';\\n\\n\";\n $content .= \"global \\$database;\\n\";\n $content .= \"\\$database = '{$config['database']['database']}';\\n\\n\";\n $content .= \"require_once('conf/ConfigureFromEnv.php');\\n\\n\";\n $content .= \"// Set the site locale\\n\";\n $content .= \"i18n::set_locale('{$config['locale']['locale']}');\\n\";\n\n if(isset($config['timezone'])) {\n $content .= \"date_default_timezone_set('{$config['timezone']['timezone']}');\\n\";\n }\n\n file_put_contents($file, $content);\n }",
"function instance_config_save($data, $nolongerused = false) {\n\n //If the is_form_submission or config_is_form_submission property is set in the object,\n //then this is a valid form submission that will be saved to the config\n if (isset($data->is_form_submission) || isset($data->config_is_form_submission)) {\n \n //process form data submission into a data string\n $data_string = dd_content_process_settings_form($data);\n\n $config_data = new stdClass();//create a config object\n $config_data->data = $data_string;//set the data to be our processed string\n \n //add any non-submission fields back into config based on existing config\n //ex: orientation\n dd_content_add_non_standard_form_data($this, $config_data);\n parent::instance_config_save($config_data);\n } else {//In the case its not set, then we are updating the configuration\n //in specialization its unserialized - needs to be re-serialized before savint\n $data->data = dd_content_serialize($data->data);\n parent::instance_config_save($data);\n }\n }",
"public function save_smtp_settings() {\n if ($this->checkLogin('A') == '') {\n redirect(ADMIN_ENC_URL);\n } else {\n if ($this->checkPrivileges('admin', '2') == TRUE) {\n $condition = array('admin_id' => '1');\n $this->admin_model->commonInsertUpdate(ADMIN, 'update', array(), array(), $condition);\n $smtp_settings_val = $this->input->post(\"smtp\");\n $config = '<?php ';\n foreach ($smtp_settings_val as $key => $val) {\n $value = addslashes($val);\n $config .= \"\\n\\$config['$key'] = '$value'; \";\n }\n $config .= \"\\n ?>\";\n $file = 'commonsettings/dectar_smtp_settings.php';\n\t\t\t\t file_put_contents($file, $config);\n $this->setErrorMessage('success', 'SMTP settings updated successfully','admin_adminlogin_smtp_settings_updated');\n redirect(ADMIN_ENC_URL.'/adminlogin/admin_smtp_settings');\n } else {\n redirect(ADMIN_ENC_URL);\n }\n }\n }",
"function saveConfig($aConfigs)\r\n\t{\r\n\t\tglobal $gXpAdmin;\r\n\r\n\t\t$configs = $this->mergeConfig($aConfigs);\r\n\r\n\t\t/** now build string that will be written to config file **/\r\n\t\t$out_config = \"<?php\\n\";\r\n\t\tforeach($configs as $key => $value)\r\n\t\t{\r\n\t\t\t/** writes to database **/\r\n\t\t\t$gXpAdmin->setParameterByName($key, addslashes($value));\r\n\r\n\t\t\t$out_config .= '$gXpConfig[\\''.$key.\"'] = '\".addslashes($value).\"';\\n\";\r\n\t\t}\r\n\t\t$out_config .= \"?>\";\r\n\t\t\r\n\t\t/** write configuration to a file **/\r\n\t\t$f = fopen($this->config_file, 'w');\r\n\t\tif(!$f)\r\n\t\t\treturn false;\r\n\t\tif (0 != get_magic_quotes_gpc())\r\n\t\t{\r\n\t\t\t$out_config = $out_config;\r\n\t\t}\r\n\t\tfwrite($f, $out_config);\r\n\t\tfclose($f);\r\n\r\n\t\treturn true;\r\n\t}",
"function saveParams($params)\r\n{\r\n\t$config = \"<?php\\n\";\r\n\t$config .= \"\\$appsConfig = \".var_export($params, true).\";\\n\";\r\n\t$config .= \"?>\";\r\n\r\n\tfile_put_contents(__DIR__.\"/config.php\", $config);\r\n\r\n\treturn true;\r\n}",
"function saveParams($params)\n{\n\t$config = \"<?php\\n\";\n\t$config .= \"\\$appsConfig = \".var_export($params, true).\";\\n\";\n\t$config .= \"?>\";\n\n\tfile_put_contents(__DIR__.\"/config.php\", $config);\n\n\treturn true;\n}",
"public function createNewConfig() { \n\n\t\t/** \n\t\t * Start by creating the top of the php file\n\t\t *\n\t\t */\n\t\t$this->newFileStr = \"<?php\\n\\n\";\n\n\t\t/** \n\t\t * We want to loop through the new config variables\n\t\t * and concatenate the variable\n\t\t *\n\t\t * @var string stores new variables.\n\t\t */\n\n\t\tforeach ($this->fileSettings as $name => $val) {\n\n\t\t/** \n\t\t * Output our config variables comment\n\t\t * and concatenate the variable\n\t\t *\n\t\t * @var string stores new config comment\n\t\t */\n\n\t\t$this->newFileStr .= \"\\n\\n//\" . $val['1'] . \"\\n\";\n\t\t\n\n\t\t/** \n\t\t *\n\t\t * Using var_export() allows you to set complex values \n\t\t * such as arrays and also ensures types will be correct\n\t\t *\n\t\t * @var string stores new config setting\n\t\t */\n\t\t\n\t\t$this->newFileStr .= \"$\".$name.\" = \".var_export($val['0'], TRUE).\";\\n\";\n\n\n\t\t} // end of foreach\n\n\t\t/** \n\t\t *\n\t\t * End our php file\n\t\t *\n\t\t */\n\n\t\t$this->newFileStr .= \"\\n?>\";\n\n\t\t/** \n\t\t *\n\t\t * Create out new config\n\t\t *\n\t\t */\n\t\tfile_put_contents($this->filePath, $this->newFileStr, LOCK_EX);\n\n\t}",
"function instance_config_save($data, $nolongerused = false) {\n global $COURSE;\n\n $config = clone($data);\n $fileoptions = array('subdirs'=>false,\n 'maxfiles'=>1,\n 'maxbytes'=>$COURSE->maxbytes,\n 'accepted_types'=>'web_image',\n 'return_types'=>FILE_INTERNAL);\n file_save_draft_area_files($config->imagespot, $this->context->id, 'block_informationspot', 'image', 0, $fileoptions);\n\n parent::instance_config_save($config, $nolongerused);\n }",
"public function writewebconfig()\n {\n //<add fileExtension=\"supersake\" allowed=\"false\"/>\n }",
"protected function addToConfig()\n {\n $path = $this->getConfigPath();\n $config = require($path);\n if (isset($config[$this->moduleId])) {\n if (\\Yii::$app->controller->confirm('Rewrite exist config?')) {\n $config[$this->moduleId] = $this->getConfigArray();\n echo 'Module config was rewrote' . PHP_EOL;\n }\n } else {\n $config[$this->moduleId] = $this->getConfigArray();\n }\n\n\n $this->writeArrayToFile($this->getConfigPath(), $config);\n }",
"function write_config()\n\t{\n\t\t$charmap \t= $this->paths['tempdir'].'/'.$this->paths['config'];\n\t\t$handle \t= @fopen( $charmap, 'w' );\n\t\t\n\t if ($handle)\n\t {\n\t fwrite( $handle, '<?php $chars = array();');\n\t \n\t foreach($this->svg_config[$this->font_name] as $unicode)\n\t {\n\t \tif(!empty($unicode))\n\t \t{\n\t \t\t$delimiter = \"'\";\n\t \t\tif(strpos($unicode, \"'\") !== false) $delimiter = '\"';\n\t \t\tfwrite( $handle, \"\\r\\n\".'$chars[\\''.$this->font_name.'\\']['.$delimiter.$unicode.$delimiter.'] = '.$delimiter.$unicode.$delimiter.';' );\n\t \t}\n\t } \t \n\t \n\t fclose( $handle );\n\t }\n\t else\n\t {\n\t \t$this->delete_folder($this->paths['tempdir']);\n\t\t\texit('Was not able to write a config file');\n\t }\n\t\t\n\t\t\n\t}",
"function save_config($new)\r\n\t{\r\n\t\tglobal $IN, $INFO, $SKIN, $ADMIN, $std, $MEMBER, $GROUP;\r\n\t\t$ibforums = Ibf::app();\r\n\r\n\t\t$master = array();\r\n\r\n\t\tif (is_array($new))\r\n\t\t{\r\n\t\t\tif (count($new) > 0)\r\n\t\t\t{\r\n\t\t\t\tforeach ($new as $field)\r\n\t\t\t\t{\r\n\r\n\t\t\t\t\t// Handle special..\r\n\r\n\t\t\t\t\tif ($field == 'img_ext' or $field == 'avatar_ext' or $field == 'photo_ext')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$_POST[$field] = preg_replace(\"/[\\.\\s]/\", \"\", $_POST[$field]);\r\n\t\t\t\t\t\t$_POST[$field] = str_replace('|', \"|\", $_POST[$field]);\r\n\t\t\t\t\t\t$_POST[$field] = preg_replace(\"/,/\", '|', $_POST[$field]);\r\n\t\t\t\t\t} else\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif ($field == 'coppa_address')\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$_POST_VARS[$field] = nl2br($_POST[$field]);\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\tif ($field == 'gd_font' OR $field == 'html_dir' OR $field == 'upload_dir')\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$_POST[$field] = preg_replace(\"/'/\", \"'\", $_POST[$field]);\r\n\t\t\t\t\t} else\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$_POST[$field] = preg_replace(\"/'/\", \"'\", stripslashes($_POST[$field]));\r\n\t\t\t\t\t}\r\n\r\n\t\t\t\t\t$master[$field] = stripslashes($_POST[$field]);\r\n\t\t\t\t}\r\n\r\n\t\t\t\t$ADMIN->rebuild_config($master);\r\n\t\t\t}\r\n\t\t}\r\n\r\n\t\t$ADMIN->save_log(\"Board Settings Updated, Back Up Written\");\r\n\r\n\t\t$ADMIN->done_screen(\"Forum Configurations updated\", \"Administration CP Home\", \"act=index\");\r\n\r\n\t}",
"public function save()\n {\n file_put_contents(\"address.json\", json_encode($this->content));\n }",
"protected function saveConfiguration($name, $value)\n {\n // TODO: Implement saveConfiguration() method.\n }",
"private function putConfig(): void\n {\n /** @var array<string, array<string, string>> $alertOutputsFromConfig */\n $alertOutputsFromConfig = config('alert.output', []);\n\n foreach ($alertOutputsFromConfig as $plugin => $map) {\n if ($this->desiredOutput !== null && $this->desiredOutput != $plugin) {\n $this->session->remove(\"alert.$plugin\");\n continue;\n }\n\n $output = [];\n foreach ($map as $from => $to) {\n $output[$from] = $this->fields[$to] ?? '';\n }\n\n $this->session->put(\"alert.$plugin\", json_encode($output));\n }\n }",
"private function _saveDefault() {\r\n\r\n // get current configuration object\r\n $sefConfig = & Sh404sefFactory::getConfig();\r\n\r\n //clear config arrays, unless POST is empty, meaning this is first attempt to save config\r\n if (!empty($_POST)) {\r\n $sefConfig->skip = array();\r\n $sefConfig->nocache = array();\r\n $sefConfig->notTranslateURLList = array();\r\n $sefConfig->notInsertIsoCodeList = array();\r\n $sefConfig->shDoNotOverrideOwnSef = array();\r\n $sefConfig->useJoomsefRouter = array();\r\n $sefConfig->useAcesefRouter = array();\r\n $sefConfig->shLangTranslateList = array();\r\n $sefConfig->shLangInsertCodeList = array();\r\n $sefConfig->compEnablePageId = array();\r\n $sefConfig->defaultComponentStringList = array();\r\n $sefConfig->useJoomlaRouter = array();\r\n }\r\n if (empty($_POST['debugToLogFile'])) {\r\n $sefConfig->debugStartedAt = 0;\r\n } else {\r\n $sefConfig->debugStartedAt = empty($sefConfig->debugStartedAt) ? time() : $sefConfig->debugStartedAt;\r\n }\r\n\r\n }",
"public function save()\n\t\t{\n#DS_Database_Archive::_log(__METHOD__.'()');\n\t\t\tif ( $this->_dirty ) {\n#DS_Database_Archive::_log(__METHOD__.'() data is dirty');\n\t\t\t\tif ( NULL !== $this->option_name ) {\n\t\t\t\t\tset_option( $this->option_name, $this->_options );\n\t\t\t\t} else if ( NULL !== $this->filename ) {\n\t\t\t\t\t// save to filesystem\n#DS_Database_Archive::_log(__METHOD__.'() saving to file ' . $this->filename);\n\t\t\t\t\t$output = json_encode( $this->_options, JSON_PRETTY_PRINT );\n#DS_Database_Archive::_log(__METHOD__.'() contents: ' . $output);\n\t\t\t\t\tfile_put_contents( $this->filename, $output );\n\t\t\t\t}\n\t\t\t\t$this->_dirty = FALSE;\n\t\t\t}\n\t\t}",
"public function save_settings()\n {\n if(isset($_POST) && isset($_POST['api_settings'])) {\n $data = $_POST['api_settings'];\n update_option('api_settings', json_encode($data));\n }\n }",
"function _write_config_file($values){\n $db_server = $values['db_server'] ?: \"\";\n $db_name = $values['db_name'] ?: \"\";\n $db_user = $values['db_user'] ?: \"\";\n $db_password = $values['db_password'] ?: \"\";\n $mynautique_enabled = (isset($values['mynautique_enabled']) && $values['mynautique_enabled'] == TRUE) ? \"TRUE\" : \"FALSE\";\n $mynautique_user = isset($values['mynautique_user']) && $mynautique_enabled == \"TRUE\" ? $values['mynautique_user'] : \"\";\n $mynautique_password = isset($values['mynautique_password']) && $mynautique_enabled == \"TRUE\" ? $values['mynautique_password'] : \"\";\n\n // write configuration file (only after schema is applied)// build the configuration for the configuration file\n $config_string = '<?php'.\"\\n\";\n $config_string .= '// Database Configuration'.\"\\n\";\n $config_string .= '//==================================================='.\"\\n\";\n $config_string .= '// database server'.\"\\n\";\n $config_string .= '$config[\\'db_server\\'] = \"'. $db_server .'\";'.\"\\n\";\n $config_string .= '// database'.\"\\n\";\n $config_string .= '$config[\\'db_name\\'] = \"'. $db_name .'\";'.\"\\n\";\n $config_string .= '// database user'.\"\\n\";\n $config_string .= '$config[\\'db_user\\'] = \"'. $db_user .'\";'.\"\\n\";\n $config_string .= '// database user password'.\"\\n\";\n $config_string .= '$config[\\'db_password\\'] = \"'. $db_password .'\";'.\"\\n\";\n $config_string .= \"\\n\";\n\n if ( isset($values['mynautique_enabled'])) {\n $config_string .= '// MyNautique Configuration'.\"\\n\";\n $config_string .= '//==================================================='.\"\\n\";\n $config_string .= '// myNautique enabled'.\"\\n\";\n $config_string .= '$config[\\'mynautique_enabled\\'] = '.$mynautique_enabled .';'.\"\\n\";\n $config_string .= '// myNautique user'.\"\\n\";\n $config_string .= '$config[\\'mynautique_user\\'] = \"'. $mynautique_user .'\";'.\"\\n\";\n $config_string .= '// myNautique password'.\"\\n\";\n $config_string .= '$config[\\'mynautique_password\\'] = \"'. $mynautique_password .'\";'.\"\\n\";\n }\n\n $config_string .= '?>'.\"\\n\";\n\n $bytes_written = file_put_contents (\"../config/config.php\", $config_string);\n\n if($bytes_written == FALSE) {\n return $bytes_written;\n }\n return TRUE;\n }",
"private function saveTranslateConfig(){\r\n\t\t// Check for request forgeries\r\n\t\tJRequest::checkToken() or die( 'Invalid Token' );\r\n\r\n\t\t$lang_id \t= JRequest::getInt( 'lang_id',0 );\r\n\t\t$model = $this->getModel('languages');\r\n\t\t$language = $model->getTable('JFLanguage');\t\t\r\n\t\t$language->load($lang_id);\r\n\r\n\t\tif (is_null($lang_id) || !isset($language->id) || $language->id<=0){\r\n\t\t\tdie( 'Invalid Language Id' );\r\n\t\t}\r\n\t\t\r\n\t\t$data = array();\r\n\t\tforeach ($_REQUEST as $key=>$val) {\r\n\t\t\tif (strpos($key,\"trans_\")===0){\r\n\t\t\t\t$key = str_replace(\"trans_\",\"\",$key);\r\n\t\t\t\tif (ini_get('magic_quotes_gpc')) {\r\n \t\t $val = stripslashes($val);\r\n \t\t} \r\n \t\t$data[$key]=$val;\r\n\t\t\t}\r\n\t\t}\r\n\t\t$registry = new JRegistry();\r\n\t\t$registry->loadArray($data);\r\n\t\t$language->params = $registry->toString();\r\n\r\n\t\t$language->store();\r\n\t\tJFactory::getApplication()->redirect(\"index.php?option=com_joomfish&task=languages.show\",JText::_( 'LANGUAGES_SAVED' ));\r\n\t}",
"private function _saveSec() {\r\n\r\n // get current configuration object\r\n $sefConfig = & Sh404sefFactory::getConfig();\r\n\r\n //set skip and nocache arrays, unless POST is empty, meaning this is first attempt to save config\r\n if (!empty($_POST)) {\r\n $sefConfig->shSecOnlyNumVars = array();\r\n $sefConfig->shSecAlphaNumVars = array();\r\n $sefConfig->shSecNoProtocolVars = array();\r\n $sefConfig->ipWhiteList = array();\r\n $sefConfig->ipBlackList = array();\r\n $sefConfig->uAgentWhiteList = array();\r\n $sefConfig->uAgentBlackList = array();\r\n }\r\n\r\n }",
"function iniwrite() {\n\t global $setini;\n\t\n\t $ini = $this->gtk_path . \"webos.ini\"; \t//echo $ini; \n\t \n if ($fp = fopen ($ini , \"wb\")) {\n\t\t\n\t\t\t\t $tow = serialize($setini) . \"<@>\";\t \n\t\t\t\t\t \n fwrite ($fp, $tow);\n fclose ($fp);\n\t\t\t\t \n\t\t $this->set_console_message(\"Writing ini settings successfully.\");\t\t\t\t \n\t\t\t\t return (true);\n\t }\n\t else {\n\t\t $this->set_console_message(\"Ini setting NOT saved !!!\");\t\t\n\t\t\t\t return (false);\n\t\t}\t\t\n\t}",
"public static function saveEntry() {\r\n $result = array();\r\n $saved = lC_Configuration_Admin::save($_GET['configuration']);\r\n if ($saved) {\r\n $result['rpcStatus'] = RPC_STATUS_SUCCESS;\r\n }\r\n\r\n echo json_encode($result);\r\n }",
"public function saveSystemConfig($observer)\n {\n Mage::getSingleton('adminhtml/session')->setMessages(Mage::getModel('core/message_collection'));\n\n Mage::getModel('core/config_data')\n ->load(self::CRON_STRING_PATH, 'path')\n ->setValue($this->_getSchedule())\n ->setPath(self::CRON_STRING_PATH)\n ->save();\n\n Mage::app()->cleanCache();\n\n $this->configCheck();\n\n // If there are errors in config, do not progress further as it may be testing old data\n $currentMessages = Mage::getSingleton('adminhtml/session')->getMessages();\n foreach ($currentMessages->getItems() as $msg) {\n if ($msg->getType() != 'success') {\n return;\n }\n }\n\n $messages = array();\n\n // Close connection to avoid mysql gone away errors\n $res = Mage::getSingleton('core/resource');\n $res->getConnection('core_write')->closeConnection();\n\n // Test connection\n $storeId = Mage::app()->getStore();\n $usernameWs = Mage::getStoreConfig('emailchef_newsletter/emailchef/username_ws');\n $passwordWs = Mage::getStoreConfig('emailchef_newsletter/emailchef/password_ws');\n $retConn = Mage::helper('emailchef')->testConnection($usernameWs, $passwordWs, $storeId);\n $messages = array_merge($messages, $retConn);\n\n // Config tests\n $retConfig = Mage::helper('emailchef')->testConfig();\n $messages = array_merge($messages, $retConfig);\n\n // Re-open connection to avoid mysql gone away errors\n $res->getConnection('core_write')->getConnection();\n\n // Add messages from test\n if (count($messages) > 0) {\n foreach ($messages as $msg) {\n $msgObj = Mage::getSingleton('core/message')->$msg['type']($msg['message']);\n Mage::getSingleton('adminhtml/session')->addMessage($msgObj);\n }\n }\n }",
"public function writeConfig($config) {\n if(!is_array($config)) {\n trigger_error(\"writeConfig must be called with an array\");\n return FALSE;\n }\n \n if(!$this->_connected) {\n trigger_error(\"Can't write config when not connected\");\n return FALSE;\n }\n \n $toWrite = \"; Config written at \" . date('m-d-Y h:i:s') . \"\\n\";\n $toWrite .= \"; PDU writer version \" . VERSION . \"\\n\";\n $toWrite .= \"; 2011 Kevin O'Connor - [email protected]\\n\";\n \n foreach($config as $directive => $values) {\n $toWrite .= '[' . $directive . \"]\\n\";\n \n foreach($values as $configName => $configValue) {\n $toWrite .= $configName . \"=\" . $configValue . \"\\n\";\n }\n }\n \n if(!file_put_contents('configs/' . $this->_ip . '.ini_updated', $toWrite)) {\n trigger_error(\"Couldn't write temporary config\");\n return FALSE;\n }\n \n if(!ftp_put($this->_ftpConnection, 'config.ini', 'configs/' . $this->_ip . '.ini_updated', FTP_ASCII)) {\n trigger_error(\"Couldn't ftp_put\");\n return FALSE;\n }\n\t\n\tunlink('configs/' . $this->_ip . '.ini_updated');\n\tunlink('configs/' . $this->_ip . '.ini');\n \n return TRUE;\n }",
"public function save()\n\t{\n\t\treturn file_put_contents(self::filepath($this->name), $this->content);\n\t}",
"public function save()\n\t{\n\t\tif($this->beforeSave())\n\t\t{\n\t\t\t$dest = $this->getStorageFile();\n\t\t\t\n\t\t\tif(file_exists($dest) and is_writable($dest)===false)\n\t\t\t{\n\t\t\t\t@chmod($dest,0777);\n\t\t\t}\n\t\t\t\n\t\t\t$fp = fopen($dest,$this->mode);\n\t\t\tfwrite($fp,$this->data);\n\t\t\tfclose($fp);\n\t\t\t$this->afterSave();\n\t\t}\n\t}",
"public static function Save()\r\n {\r\n return update_option(self::OPT_SETTINGS, self::$Data);\r\n }",
"public function saveConfigs($conf)\n {\n foreach($conf as $key=>$value)\n {\n $q = mysql_safequery(\"insert into StormBilling_customconfig (config_name,config_value)\n \t\t\t\t\t\tvalues ('$key', '$value')\n\t\t\t\t\t\t\t\t\t\tON DUPLICATE KEY UPDATE config_value='$value'\");\n }\n $this->loadCustomConfig();\n return $this->configs;\n }"
]
| [
"0.84910387",
"0.82480985",
"0.78970397",
"0.7626374",
"0.7625461",
"0.7353204",
"0.73048675",
"0.72579587",
"0.72035784",
"0.7192871",
"0.7160313",
"0.7137148",
"0.7074274",
"0.7043677",
"0.70341754",
"0.69980925",
"0.69640166",
"0.69339895",
"0.69333285",
"0.6916909",
"0.69089013",
"0.69009393",
"0.687503",
"0.6811314",
"0.6798466",
"0.67691725",
"0.67672443",
"0.6766789",
"0.6733699",
"0.67284286",
"0.66973275",
"0.6677568",
"0.6671648",
"0.66649175",
"0.66484267",
"0.66355735",
"0.6621997",
"0.661426",
"0.65883887",
"0.6584415",
"0.6570292",
"0.6564313",
"0.65626067",
"0.6508533",
"0.6479358",
"0.6465385",
"0.6445615",
"0.6432913",
"0.64239615",
"0.64213306",
"0.64134884",
"0.6411223",
"0.6405876",
"0.6401767",
"0.6389359",
"0.6359165",
"0.63577986",
"0.6348747",
"0.6344927",
"0.63412154",
"0.6337494",
"0.6335609",
"0.63323987",
"0.63077945",
"0.6304387",
"0.62635624",
"0.6262477",
"0.62301844",
"0.62195677",
"0.6216709",
"0.6215618",
"0.62086564",
"0.61943585",
"0.6189694",
"0.61834365",
"0.617155",
"0.61701244",
"0.61647624",
"0.6162945",
"0.6141072",
"0.6126705",
"0.61063075",
"0.61044633",
"0.61009854",
"0.6094976",
"0.6089817",
"0.6079478",
"0.60689104",
"0.60589397",
"0.6044553",
"0.60371995",
"0.6028359",
"0.6015587",
"0.60052735",
"0.59879464",
"0.59802985",
"0.597126",
"0.5959493",
"0.59365875",
"0.5934147"
]
| 0.7840454 | 3 |
/ / Enum all sections / | public function GetSections()
{
return array_keys($this->vars);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function getAllSections();",
"public function getSections(): iterable;",
"public function sections()\n {\n }",
"public function define_sections() {\r\n\t\t$this->options->sections = $this->to_array();\n\t}",
"function sections()\n\t{\n\t\t$this->ipsclass->input['step']++;\n\t\t$uninstall = ( $this->ipsclass->input['un'] == 1 ) ? \"&un=1\" : \"\";\n\t\t\n\t\t$object = ( $this->tasks['sections'] == 1 ) ? 'Settings Group' : 'Settings Groups';\n\t\t$operation = ( $this->ipsclass->input['un'] ) ? 'removed' : 'created';\n\t\t$sectionkeys = array();\n\t\t$group = \"\";\n\t\t$groups = array();\n\t\t\n\t\tforeach ( $this->xml_array['sections_group']['section'] as $k => $v )\n\t\t{\n\t\t\t$sectionkeys[] = \"'{$v['conf_title_keyword']['VALUE']}'\";\n\t\t}\n\t\t\n\t\t$this->ipsclass->DB->do_delete( 'conf_settings_titles', \"conf_title_keyword IN (\".implode( \",\", $sectionkeys ).\")\" );\n\t\t\n\t\tif ( !$this->ipsclass->input['un'] )\n\t\t{\n\t\t\tforeach ( $this->xml_array['sections_group']['section'] as $k => $v )\n\t\t\t{\n\t\t\t\t$groups[] = $this->_add_section( $v );\n\t\t\t}\n\t\t\t\n\t\t\t$group = \"&group=\".implode( \"|\", $groups );\n\t\t}\n\t\t\n\t\t$this->ipsclass->admin->redirect( \"{$this->ipsclass->form_code}&code=work&mod={$this->ipsclass->input['mod']}&step={$this->ipsclass->input['step']}{$uninstall}{$group}&st={$this->ipsclass->input['st']}\", \"{$this->xml_array['mod_info']['title']['VALUE']}<br />{$this->tasks['sections']} {$object} {$operation}....\" );\n\t}",
"public function getEventClassSections();",
"public function uses_sections() {\n\n return true;\n\n }",
"public function uses_sections() {\n return true;\n }",
"public function uses_sections() {\n return true;\n }",
"public function getSections(): array {\n\t\t\n\t\tif (isset($this->sections)) {\n\t\t\treturn $this->sections;\n\t\t}\n\t\t\n\t\t$this->sections = [];\n\t\t\n\t\t$sections = elgg_extract('sections', $this->config, []);\n\t\tforeach ($sections as $section) {\n\t\t\t$this->sections[] = new Section($section);\n\t\t}\n\t\t\n\t\treturn $this->sections;\n\t}",
"public function add_sections()\n {\n }",
"function spr_get_sections() {\n\tglobal $spr_sql_fields;\n\n\t$sql_tables = safe_pfx('txp_section');\n\t$rs = safe_query(\"SELECT \".$spr_sql_fields.\" FROM \".$sql_tables.\" WHERE name != 'default' ORDER BY name\");\n\twhile ($a = nextRow($rs)) {\n\t\textract($a); // set 'name','title','parent' etc in $a\n\t\t$out[$name] = $a;\n\t}\n\treturn $out;\n}",
"public function setSections() {\n\t\t\t$schedules\t=\tarray();\n \t$wp_get_schedules\t=\tfunction_exists( 'wp_get_schedules' ) ? wp_get_schedules() : null;\n \tif( is_array( $wp_get_schedules ) && !empty( $wp_get_schedules ) ){\n \t\tforeach ($wp_get_schedules as $key=>$value) {\n \t\t\t$schedules[ $key ]\t=\t$value['display'];\n \t\t}\n \t}\n\n\t\t\t$this->sections[] \t=\tarray(\n\t\t\t\t'title'\t=>\t__('General','neat'),\n\t\t\t\t'icon'\t=>\t'el-icon-cogs',\n\t\t\t\t'desc'\t=>\tnull,\n\t\t\t\t'fields'\t=>\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'homepage',\n\t\t\t\t\t\t'type' => 'callback',\n\t\t\t\t\t\t'title' => __('Homepage', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('Setup the Homepage.', 'neat'),\n\t\t\t\t\t\t'callback' => 'neat_homepage_callback'\n\t\t\t\t\t),\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'logo',\n\t\t\t\t\t\t'type' => 'callback',\n\t\t\t\t\t\t'title' => __('Logo', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('Upload your logo.', 'neat'),\n\t\t\t\t\t\t'callback' => 'neat_logo_callback'\n\t\t\t\t\t),\t\t\t\t\t\t\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id'\t=>\t'favicon',\n\t\t\t\t\t\t'type'\t=>\t'media',\n\t\t\t\t\t\t'url' => true,\n 'subtitle' => __('Upload any media using the WordPress native uploader', 'neat'),\t\t\t\t\n\t\t\t\t\t\t'title'\t=>\t__('Favicon','neat')\n\t\t\t\t\t),\n array(\n 'id' => 'custom_css',\n 'type' => 'ace_editor',\n 'title' => __('Custom CSS', 'neat'),\n 'subtitle' => __('Paste your CSS code here, no style tag.', 'neat'),\n 'mode' => 'css',\n 'theme' => 'monokai'\n ),\t\n array(\n 'id' => 'custom_js',\n 'type' => 'ace_editor',\n 'title' => __('Custom JS', 'neat'),\n 'subtitle' => __('Paste your JS code here, no script tag, eg: alert(\\'hello world\\');', 'neat'),\n 'mode' => 'javascript',\n 'theme' => 'chrome'\n )\n\t\t\t\t)\n\t\t\t);\n\t\t\t\n\t\t\t$this->sections[] \t=\tarray(\n\t\t\t\t'title'\t=>\t__('Blog','neat'),\n\t\t\t\t'icon'\t=>\t'el-icon-cogs',\n\t\t\t\t'desc'\t=>\tnull,\n\t\t\t\t'fields'\t=>\tarray(\n\t\t\t\t\t\t/**\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'blogpage',\n\t\t\t\t\t\t\t'type' => 'callback',\n\t\t\t\t\t\t\t'title' => __('Blog page', 'neat'),\n\t\t\t\t\t\t\t'subtitle' => __('Setup the blog page.', 'neat'),\n\t\t\t\t\t\t\t'callback' => 'neat_blogpage_callback'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t**/\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'bloglayout',\n\t\t\t\t\t\t\t'type' => 'image_select',\n\t\t\t\t\t\t\t'compiler' => true,\n\t\t\t\t\t\t\t'title' => __('Blog Layout', 'neat'),\n\t\t\t\t\t\t\t'subtitle'\t=>\t__('Choose the Blog page layout.','neat'),\n\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t\t'r_sidebar' => array('alt' => __('Right Sidebar','neat'), 'img' => ReduxFramework::$_url . 'assets/img/2cr.png'),\n\t\t\t\t\t\t\t\t\t'l_sidebar' => array('alt' => __('Left Sidebar','neat'), 'img' => ReduxFramework::$_url . 'assets/img/2cl.png'),\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'default' => 'r_sidebar'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'exclude_page_search',\n\t\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t\t'title' => __('Excluding Page Search', 'neat'),\n\t\t\t\t\t\t\t'subtitle' => __('Do not display the Page in search result page.', 'neat'),\n\t\t\t\t\t\t\t'default' => '1'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'include_video_homepage',\n\t\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t\t'title' => __('Including Video Format in Homepage', 'neat'),\n\t\t\t\t\t\t\t'subtitle'\t=>\t__('I only want to retrieve the Videos Post Format in Homepage.','neat'),\n\t\t\t\t\t\t\t'default' => '0'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'exclude_video_blogpage',\n\t\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t\t'title' => __('Excluding Video Format in Blog Page', 'neat'),\n\t\t\t\t\t\t\t'subtitle'\t=>\t__('Do not retrieve the the Videos Post Format in Blog page.','neat'),\n\t\t\t\t\t\t\t'default' => '0'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'appid',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('AppID', 'neat'),\n\t\t\t\t\t\t\t'subtitle' => 'Facebook AppID',\n\t\t\t\t\t\t\t'description'\t=> sprintf( __('Get a key %s.', 'neat'), '<a target=\"_blank\" href=\"https://developers.facebook.com\">HERE</a>')\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'comment',\n\t\t\t\t\t\t\t'type' => 'button_set',\n\t\t\t\t\t\t\t'title'\t=>\t__('Comment','neat'),\n\t\t\t\t\t\t\t'subtitle'\t=>\t__('Choose the Comment System.','neat'),\n\t\t\t\t\t\t\t'description'\t=>\t__('If you use the Comment plugin (Disqus, facebook ... etc), You have to choose \"Default\".','neat'),\n\t\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t\t'default'\t\t=>\t\t__('Default','neat'),\n\t\t\t\t\t\t\t\t'facebook'\t\t=>\t\t__('Facebook','neat'),\n\t\t\t\t\t\t\t\t'both'\t\t\t=>\t\t__('Both','neat')\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'default' => 'default'\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'info-warning-both',\n\t\t\t\t\t\t\t'type' => 'info',\n\t\t\t\t\t\t\t'style' => 'warning',\n\t\t\t\t\t\t\t//'title' => __('Warning.', 'neat'),\n\t\t\t\t\t\t\t'desc' => __('The total comment number = default + facebook numner.','neat'),\n\t\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t\t'required' => array('comment', \"=\", 'both'),\n\t\t\t\t\t\t),\t\t\t\t\t\t\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'info-warning',\n\t\t\t\t\t\t\t'type' => 'info',\n\t\t\t\t\t\t\t'style' => 'warning',\n\t\t\t\t\t\t\t//'title' => __('Warning.', 'neat'),\n\t\t\t\t\t\t\t'desc' => sprintf( __('If you use the Facebook Comment system, You have to setup the %s in one time, If you change the Permalink, All the exists comments will be lost.','neat') , '<a href=\"'.admin_url( 'options-permalink.php' ).'\">Permalink</a>' ),\n\t\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t\t'required' => array('comment', \"!=\", 'default'),\t\t\t\n\t\t\t\t\t\t),\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'data-colorscheme',\n\t\t\t\t\t\t\t'type' => 'button_set',\n\t\t\t\t\t\t\t'title' => __('Comment Style', 'neat'),\n\t\t\t\t\t\t\t'description'\t=>\t__('The color scheme used by the plugin. Can be \"light\" or \"dark\".','neat'),\n\t\t\t\t\t\t\t'options'\t=>\tarray(\n\t\t\t\t\t\t\t\t'light'\t=>\t__('Light','neat'),\n\t\t\t\t\t\t\t\t'dark'\t=>\t__('Dark','neat')\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'default' => 'light',\n\t\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t\t'required' => array('comment', \"!=\", 'default'),\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\tarray(\n\t\t\t\t\t\t\t'id' => 'data-numposts',\n\t\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t\t'title' => __('Number of Posts', 'neat'),\n\t\t\t\t\t\t\t'description'\t=>\t__('The number of comments to show by default. The minimum value is 1.','neat'),\n\t\t\t\t\t\t\t'default'\t=>\t10,\n\t\t\t\t\t\t\t'validate' => 'comma_numeric',\n\t\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t\t'required' => array('comment', \"!=\", 'default'),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'data-orderby',\n\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t'title' => __('Order by', 'neat'),\n\t\t\t\t\t\t\t'description'\t=>\tsprintf( __('The order to use when displaying comments. Can be \"social\", \"reverse_time\", or \"time\". The different order types are explained %s','neat') , '<a target=\"_blank\" href=\"https://developers.facebook.com/docs/plugins/comments#faqorder\">in the FAQ</a>' ),\n\t\t\t\t\t\t\t'options'\t=>\tarray(\n\t\t\t\t\t\t\t\t'social'\t\t=>\t__('Social','neat'),\n\t\t\t\t\t\t\t\t'reverse_time'\t=>\t__('Reverse Time','neat'),\n\t\t\t\t\t\t\t\t'time'\t\t\t=>\t__('Time','neat')\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'default'\t=>\t'social',\n\t\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t\t'required' => array('comment', \"!=\", 'default'),\n\t\t\t\t\t\t),\t\t\t\t\t\t\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'facebooklang',\n\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t'title' => __('Language', 'neat'),\n\t\t\t\t\t\t\t'options'\t=>\tarray(\n\t\t\t\t\t\t\t\t'af_ZA'\t\t\t=>\t\t'Afrikaans',\n\t\t\t\t\t\t\t\t'ar_AR'\t\t\t=>\t\t'Arabic',\n\t\t\t\t\t\t\t\t'az_AZ'\t\t\t=>\t\t'Azerbaijani',\n\t\t\t\t\t\t\t\t'be_BY'\t\t\t=>\t\t'Belarusian',\n\t\t\t\t\t\t\t\t'bg_BG'\t\t\t=>\t\t'Bulgarian',\n\t\t\t\t\t\t\t\t'bn_IN'\t\t\t=>\t\t'Bengali',\n\t\t\t\t\t\t\t\t'bs_BA'\t\t\t=>\t\t'Bosnian',\n\t\t\t\t\t\t\t\t'ca_ES'\t\t\t=>\t\t'Catalan',\n\t\t\t\t\t\t\t\t'cs_CZ'\t\t\t=>\t\t'Czech',\n\t\t\t\t\t\t\t\t'cy_GB'\t\t\t=>\t\t'Welsh',\n\t\t\t\t\t\t\t\t'da_DK'\t\t\t=>\t\t'Danish',\n\t\t\t\t\t\t\t\t'de_DE'\t\t\t=>\t\t'German',\n\t\t\t\t\t\t\t\t'el_GR'\t\t\t=>\t\t'Greek',\n\t\t\t\t\t\t\t\t'en_GB'\t\t\t=>\t\t'English (UK)',\t\n\t\t\t\t\t\t\t\t'en_PI'\t\t\t=>\t\t'English (Pirate)',\n\t\t\t\t\t\t\t\t'en_UD'\t\t\t=>\t\t'English (Upside Down)',\n\t\t\t\t\t\t\t\t'en_US'\t\t\t=>\t\t'English (US)',\n\t\t\t\t\t\t\t\t'eo_EO'\t\t\t=>\t\t'Esperanto',\n\t\t\t\t\t\t\t\t'es_ES'\t\t\t=>\t\t'Spanish (Spain)',\n\t\t\t\t\t\t\t\t'es_LA'\t\t\t=>\t\t'Spanish',\n\t\t\t\t\t\t\t\t'et_EE'\t\t\t=>\t\t'Estonian',\n\t\t\t\t\t\t\t\t'eu_ES'\t\t\t=>\t\t'Basque',\n\t\t\t\t\t\t\t\t'fa_IR'\t\t\t=>\t\t'Persian',\n\t\t\t\t\t\t\t\t'fb_LT'\t\t\t=>\t\t'Leet Speak',\n\t\t\t\t\t\t\t\t'fi_FI'\t\t\t=>\t\t'Finnish',\n\t\t\t\t\t\t\t\t'fo_FO'\t\t\t=>\t\t'Faroese',\n\t\t\t\t\t\t\t\t'fr_CA'\t\t\t=>\t\t'French (Canada)',\n\t\t\t\t\t\t\t\t'fr_FR'\t\t\t=>\t\t'French (France)',\n\t\t\t\t\t\t\t\t'fy_NL'\t\t\t=>\t\t'Frisian',\n\t\t\t\t\t\t\t\t'ga_IE'\t\t\t=>\t\t'Irish',\n\t\t\t\t\t\t\t\t'gl_ES'\t\t\t=>\t\t'Galician',\n\t\t\t\t\t\t\t\t'he_IL'\t\t\t=>\t\t'Hebrew',\n\t\t\t\t\t\t\t\t'hi_IN'\t\t\t=>\t\t'Hindi',\n\t\t\t\t\t\t\t\t'hr_HR'\t\t\t=>\t\t'Croatian',\n\t\t\t\t\t\t\t\t'hu_HU'\t\t\t=>\t\t'Hungarian',\n\t\t\t\t\t\t\t\t'hy_AM'\t\t\t=>\t\t'Armenian',\n\t\t\t\t\t\t\t\t'id_ID'\t\t\t=>\t\t'Indonesian',\n\t\t\t\t\t\t\t\t'is_IS'\t\t\t=>\t\t'Icelandic',\n\t\t\t\t\t\t\t\t'it_IT'\t\t\t=>\t\t'Italian',\n\t\t\t\t\t\t\t\t'ja_JP'\t\t\t=>\t\t'Japanese',\n\t\t\t\t\t\t\t\t'ka_GE'\t\t\t=>\t\t'Georgian',\n\t\t\t\t\t\t\t\t'km_KH'\t\t\t=>\t\t'Khmer',\n\t\t\t\t\t\t\t\t'ko_KR'\t\t\t=>\t\t'Korean',\n\t\t\t\t\t\t\t\t'ku_TR'\t\t\t=>\t\t'Kurdish',\n\t\t\t\t\t\t\t\t'la_VA'\t\t\t=>\t\t'Latin',\n\t\t\t\t\t\t\t\t'lt_LT'\t\t\t=>\t\t'Lithuanian',\n\t\t\t\t\t\t\t\t'lv_LV'\t\t\t=>\t\t'Latvian',\n\t\t\t\t\t\t\t\t'mk_MK'\t\t\t=>\t\t'Macedonian',\n\t\t\t\t\t\t\t\t'ml_IN'\t\t\t=>\t\t'Malayalam',\n\t\t\t\t\t\t\t\t'ms_MY'\t\t\t=>\t\t'Malay',\n\t\t\t\t\t\t\t\t'nb_NO'\t\t\t=>\t\t'Norwegian (bokmal)',\n\t\t\t\t\t\t\t\t'ne_NP'\t\t\t=>\t\t'Nepali',\n\t\t\t\t\t\t\t\t'nl_NL'\t\t\t=>\t\t'Dutch',\n\t\t\t\t\t\t\t\t'nn_NO'\t\t\t=>\t\t'Norwegian (nynorsk)',\n\t\t\t\t\t\t\t\t'pa_IN'\t\t\t=>\t\t'Punjabi',\n\t\t\t\t\t\t\t\t'pl_PL'\t\t\t=>\t\t'Polish',\n\t\t\t\t\t\t\t\t'ps_AF'\t\t\t=>\t\t'Pashto',\n\t\t\t\t\t\t\t\t'pt_BR'\t\t\t=>\t\t'Portuguese (Brazil)',\n\t\t\t\t\t\t\t\t'pt_PT'\t\t\t=>\t\t'Portuguese (Portugal)',\n\t\t\t\t\t\t\t\t'ro_RO'\t\t\t=>\t\t'Romanian',\n\t\t\t\t\t\t\t\t'ru_RU'\t\t\t=>\t\t'Russian',\n\t\t\t\t\t\t\t\t'sk_SK'\t\t\t=>\t\t'Slovak',\n\t\t\t\t\t\t\t\t'sl_SI'\t\t\t=>\t\t'Slovenian',\n\t\t\t\t\t\t\t\t'sq_AL'\t\t\t=>\t\t'Albanian',\n\t\t\t\t\t\t\t\t'sr_RS'\t\t\t=>\t\t'Serbian',\n\t\t\t\t\t\t\t\t'sv_SE'\t\t\t=>\t\t'Swedish',\n\t\t\t\t\t\t\t\t'sw_KE'\t\t\t=>\t\t'Swahili',\n\t\t\t\t\t\t\t\t'ta_IN'\t\t\t=>\t\t'Tamil',\n\t\t\t\t\t\t\t\t'te_IN'\t\t\t=>\t\t'Telugu',\n\t\t\t\t\t\t\t\t'th_TH'\t\t\t=>\t\t'Thai',\n\t\t\t\t\t\t\t\t'tl_PH'\t\t\t=>\t\t'Filipino',\n\t\t\t\t\t\t\t\t'tr_TR'\t\t\t=>\t\t'Turkish',\n\t\t\t\t\t\t\t\t'uk_UA'\t\t\t=>\t\t'Ukrainian',\n\t\t\t\t\t\t\t\t'vi_VN'\t\t\t=>\t\t'Vietnamese',\n\t\t\t\t\t\t\t\t'zh_CN'\t\t\t=>\t\t'Simplified Chinese (China)',\n\t\t\t\t\t\t\t\t'zh_HK'\t\t\t=>\t\t'Traditional Chinese (Hong Kong)',\n\t\t\t\t\t\t\t\t'zh_TW'\t\t\t=>\t\t'Traditional Chinese (Taiwan)'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t'default'\t=>\t'en_US',\n\t\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t\t'required' => array('comment', \"!=\", 'default'),\n\t\t\t\t\t\t),\n\t\t\t\t\t\tarray(\n\t\t\t\t\t\t\t'id' => 'counter_up_interval',\n\t\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t\t'title' => __('Scheduling Intervals', 'neat'),\n\t\t\t\t\t\t\t'subtitle'\t=>\t__('Scheduling the updating Counter intervals.','neat'),\n\t\t\t\t\t\t\t'description'\t=>\t__('Leave blank for real time.','neat'),\n\t\t\t\t\t\t\t'options'\t\t=>\t$schedules,\n\t\t\t\t\t\t\t'default'\t=>\t'15m'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t\n\t\t\t$this->sections[]\t=\tarray(\n\t\t\t\t'title'\t=>\t__('Submit','neat'),\n\t\t\t\t'icon' => 'el-icon-upload',\n\t\t\t\t'desc' => __('<p class=\"description\">Neat support the post submission at Fronend through Contact Form 7 Form.</p>', 'neat'),\n\t\t\t\t'fields'\t=>\tarray(\t\t\t\t\t\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'cf7id',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'title' => __('Contact Form 7 ID', 'neat'),\n\t\t\t\t\t\t'description'\t=>\tsprintf( __('Enter the form ID for Post Submission, %s','neat'), '<a href=\"'.admin_url( 'admin.php?page=wpcf7' ).'\">Where is it?</a>' ),\n\t\t\t\t\t\t'validate' => 'comma_numeric'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'post_status',\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'title' => __('Post Status', 'neat'),\n\t\t\t\t\t\t'description'\t=>\t__('Set the post status for the post, which is submitted through the Contact Form 7 at Frontend.','neat'),\n\t\t\t\t\t\t'options'\t=>\tarray(\n\t\t\t\t\t\t\t'pending'\t=>\t__('Pending','neat'),\n\t\t\t\t\t\t\t'publish'\t=>\t__('publish','neat')\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default'\t=>\t'pending'\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'id' => 'user_roles',\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'title' => __('Who can submit the post?', 'neat'),\n\t\t\t\t\t\t'data' => 'roles',\n\t\t\t\t\t\t'description'\t=>\t__('Choose the User roles, all users of this roles can submit the post through Frontend, Leave blank for Guest (all posts is submitted by guest will be assigned to Admin).','neat'),\n\t\t\t\t\t\t'multi' => true,\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'limit_posts_amount',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'title' => __('Posts amount/day', 'neat'),\n\t\t\t\t\t\t'description'\t=>\t__( 'Limit the posts per day for the User (This function won\\'t work if Guest post is activated), 0 is un-limit.','neat' ),\n\t\t\t\t\t\t'validate' => 'comma_numeric',\n\t\t\t\t\t\t'default'\t=>\t5\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'role_not_limit',\n\t\t\t\t\t\t'type' => 'select',\n\t\t\t\t\t\t'title' => __('Roles is not limited', 'neat'),\n\t\t\t\t\t\t'data' => 'roles',\n\t\t\t\t\t\t'description'\t=>\t__('Don\\'t apply the limit post for this roles.','neat'),\n\t\t\t\t\t\t'multi' => true,\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'id' => 'response',\n\t\t\t\t\t\t'type' => 'checkbox',\n\t\t\t\t\t\t'title' => __('Auto Response', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('Send the message through email to the User after submitted.', 'neat'),\n\t\t\t\t\t\t'default' => 0\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'response_name',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'title' => __('Sender\\'s name', 'neat'),\n\t\t\t\t\t\t'default'\t=>\tget_bloginfo( 'name' ),\n\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t'required' => array('response', \"=\", 1),\n\t\t\t\t\t),\t\t\t\t\t\t\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'response_email',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'title' => __('Sender\\'s email', 'neat'),\n\t\t\t\t\t\t'default'\t=>\tget_bloginfo( 'admin_email' ),\n\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t'required' => array('response', \"=\", 1),\n\t\t\t\t\t),\t\t\t\t\t\t\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'response_subject',\n\t\t\t\t\t\t'type' => 'text',\n\t\t\t\t\t\t'title' => __('Response Subject', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('The subject of the email', 'neat'),\n\t\t\t\t\t\t'description'\t=>\tsprintf( __('<strong>Tags support:</strong><br/><code>[user]</code>: Username/Display Name of User.<br/><code>[sitename]</code>: Your site name (%s)<br/><code>[site_desc]</code>: Your Site description (%s)','neat'), get_bloginfo('name'), get_bloginfo('description') ),\n\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t'required' => array('response', \"=\", 1),\t\t\t\t\t\t\t\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'response_content',\n\t\t\t\t\t\t'type' => 'textarea',\n\t\t\t\t\t\t'title' => __('Response Content', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('The Content of the email', 'neat'),\n\t\t\t\t\t\t'description'\t=>\tsprintf( __('<strong>Tags support:</strong><br/><code>[user]</code>: Username/Display Name of User.<br/><code>[sitename]</code>: Your site name (%s)<br/><code>[site_desc]</code>: Your Site description (%s)<br/><code>[post_link]</code>: The post link (working for the Publish post).','neat'), get_bloginfo('name'), get_bloginfo('description') ),\n\t\t\t\t\t\t'indent' => false,\n\t\t\t\t\t\t'required' => array('response', \"=\", 1)\t\t\t\t\n\t\t\t\t\t),\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t)\n\t\t\t);\t\t\t\n\t\t\t\n\t\t\t$this->sections[]\t=\tarray(\n\t\t\t\t'title'\t=>\t__('Styling','neat'),\n\t\t\t\t'icon' => 'el-icon-website',\n\t\t\t\t'fields'\t=>\tarray(\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'main-style',\n\t\t\t\t\t\t'type' => 'image_select',\n\t\t\t\t\t\t'compiler' => true,\n\t\t\t\t\t\t'title' => __('Main Style', 'neat'),\n\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\t'main' => array('alt' => __('Default','neat') , 'img' => NEAT_THEME_URI . '/assets/img/default.png' ),\n\t\t\t\t\t\t\t'main-blue' => array('alt' => __('Blue style','neat') , 'img' => NEAT_THEME_URI . '/assets/img/blue.png' ),\n\t\t\t\t\t\t\t'main-red' => array('alt' => __('Red style','neat') , 'img' => NEAT_THEME_URI . '/assets/img/red.png' ),\n\t\t\t\t\t\t\t'main-dark' => array('alt' => __('Dark style','neat') , 'img' => NEAT_THEME_URI . '/assets/img/dark.png' ),\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'default' => 'main'\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'background',\n\t\t\t\t\t\t'type' => 'background',\n\t\t\t\t\t\t'output' => array('body'),\n\t\t\t\t\t\t'title' => __('Body Background', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('Body background with image, color, etc.', 'neat'),\n\t\t\t\t\t\t'default' => '#FFFFFF',\n\t\t\t\t\t),\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'header-background',\n\t\t\t\t\t\t'type' => 'color',\n\t\t\t\t\t\t'title' => __('Header Background Color', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('Pick a background color for the Header (default: #ffffff).', 'neat'),\n\t\t\t\t\t\t'default' => '#ffffff',\n\t\t\t\t\t\t'validate' => 'color',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'menu-color',\n\t\t\t\t\t\t'type' => 'color',\n\t\t\t\t\t\t'title' => __('Menu Color', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('Pick a color for the Menu (default: #b3b3b3).', 'neat'),\n\t\t\t\t\t\t'default' => '#b3b3b3',\n\t\t\t\t\t\t'validate' => 'color',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'menu-hover-color',\n\t\t\t\t\t\t'type' => 'color',\n\t\t\t\t\t\t'title' => __('Menu Hover Color', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('Pick a color for the Menu Hover (default: #2ecc71).', 'neat'),\n\t\t\t\t\t\t'default' => '#2ecc71',\n\t\t\t\t\t\t'validate' => 'color',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'footer-background',\n\t\t\t\t\t\t'type' => 'color',\n\t\t\t\t\t\t'title' => __('Footer Background', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('Pick a background color for the Footer (default: #ffffff).', 'neat'),\n\t\t\t\t\t\t'default' => '#ffffff',\n\t\t\t\t\t\t'validate' => 'color',\n\t\t\t\t\t),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t'id' => 'footer-color',\n\t\t\t\t\t\t'type' => 'color',\n\t\t\t\t\t\t'title' => __('Footer Color', 'neat'),\n\t\t\t\t\t\t'subtitle' => __('Pick a color for the Footer Text (default: #bfbfbf).', 'neat'),\n\t\t\t\t\t\t'default' => '#bfbfbf',\n\t\t\t\t\t\t'validate' => 'color',\n\t\t\t\t\t),\t\t\t\t\t\t\n\t\t\t\t)\n\t\t\t);\t\t\t\n\t\t\t\n\t\t\t//footer\n\t\t\t$footer_field = array();\n\t\t\t$footer_field[] = array(\n\t\t\t\t'id'\t=>\t'footer_text',\n\t\t\t\t'title'\t=>\t__('Copyright Text','neat'),\n\t\t\t\t'type'\t=>\t'textarea',\n\t\t\t\t'default'\t=>\tsprintf( __('Copyright © 2014 <a href=\"%s\">Neat</a> - All Rights Reserved.','neat'), home_url() ),\n\t\t\t\t'desc'\t=>\t__('HTML is allowed in here.','neat')\n\t\t\t);\n\t\t\t$socials = neat_option_socials();\n\t\t\tif( is_array( $socials ) ){\n\t\t\t\tforeach ( $socials as $key=>$value) {\n\t\t\t\t\t$footer_field[] = array(\n\t\t\t\t\t\t'id'\t=>\t'footer_social_' . $key,\n\t\t\t\t\t\t'title'\t=>\t$value['name'],\n\t\t\t\t\t\t'type'\t=>\t'text',\n\t\t\t\t\t\t'placeholder'\t=>\t'http://',\n\t\t\t\t\t\t'desc'\t=>\tsprintf( __('Put the %s profile/page link here.','neat') , $value['name'] )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$this->sections[]\t=\tarray(\n\t\t\t\t'title'\t=>\t__('Footer','neat'),\n\t\t\t\t'icon'\t=>\t'el-icon-cogs',\n\t\t\t\t'fields'\t=>\t$footer_field\n\t\t\t);\n\t\t\t\t\t\t\t\n }",
"public function __allSections()\n\t{\n\t\t//current user course\n\t\t$userCourse = $this->Session->read('UserData.usersCourses');\n\t\t$user_course_section = $userCourse[0];\n\t\t//get Course and section name\n\t\t$course_info = $this->getCourseNameOfUser($user_course_section);\n\t\t$course_name = $course_info->course_name;\n\t\t$course_section = $course_info->section_name;\n\t\t$sectionList = array();\n\t\t//getting the course in section/all section setting(changed on 16 April, 2014)\n\t $setting = $this->__getDbSetting($user_course_section);\n\t\tif ($setting == 2) {\n\t\t\t$sections = $this->PleSetting->find('all',array('conditions'=>array('PleSetting.course'=>$course_name,'PleSetting.setting_value'=>2),'fields'=>array('section')));\n\t\t\tforeach ($sections as $section) {\n\t\t\t\t$sectionList[] = trim($section['PleSetting']['section']);\n\t\t\t}\n\t\t\t$sectionList[] = $course_section;\n\t } else {\n\t\t\t//add current user login section\n\t\t\t$sectionList[] = $course_section;\n\t }\n\t\t$tz = array_unique($sectionList);\n\t\treturn $tz;\n\t}",
"public function getSections(): array\n {\n return $this->sections;\n }",
"public function register_sections() {\n\t\t\t// Use default\n\t\t\tif ( !is_array( $this->_sections ) ) {\n\t\t\t\t$this->register_fields( $this->default_section, 0 );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t$i = 1;\n\t\t\tforeach ( $this->_sections as $key => $section ) {\n\t\t\t\t$page = $this->default_group;\n\n\t\t\t\tadd_settings_section(\n\t\t\t\t\t$section['id'],\t\t\t\t\t\n\t\t\t\t\t$section['title'],\n\t\t\t\t\tarray( &$this, $section['callback']),\n\t\t\t\t\t$this->default_group\n\t\t\t\t);\n\t\t\t\t$this->register_fields( $section['id'], $key );\n\t\t\t\t$i++;\n\t\t\t}\n\t\t}",
"function _getSectionTypes()\n {\n return array(\n ST_NORMAL => \"Běžná sekce\",\n ST_TASKS => \"Úkoly (česky)\",\n ST_TASKS_EN => \"Úkoly (anglicky)\",\n ST_URLS => \"Odkazy\",\n ST_DOWNLOAD => \"Download\",\n ST_EXCLIST => \"Seznam cvičení\",\n ST_PHYLAB => \"Laboratorní cvičení\"\n );\n }",
"public function getSections(){\n\t\treturn $this->sections;\n\t}",
"public function getSections()\n {\n return $this->sections;\n }",
"public function init_sections() {\n\t\t// Override this function in your class and assign the array of sections to $this->sections.\n\t\t_e( 'Override init_sections() in your class.', '{plugin_jump_starter_textdomain}' );\n\t}",
"public function listAllSections(): array {\n\t\t$sections = [];\n\t\t$q = $this->pdo->query(\"SELECT `ArticleSection` from `articles` GROUP BY `ArticleSection`\");\n\t\tforeach($q->fetchAll(PDO::FETCH_ASSOC) as $a){\n\t\t\t$section = json_decode($a[\"ArticleSection\"], true);\n\t\t\tforeach($section as $s){\n\t\t\t\t/* @var $s string */\n\t\t\t\tif(!in_array(mb_strtolower($s), $sections, true)){\n\t\t\t\t\t$sections[] = mb_strtolower($s);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tsort($sections);\n\t\treturn $sections;\n\t}",
"public function getSections(){\n return $this->getSite()->getSections();\n }",
"public function gen_section(){\n $data = array(\n \"txtinicio\"=>\"Inicio\",\n \"rutainicio\" => \"/admin/inicio\",\n \"txtmodulo\" => \"CONTABILIDAD\",\n \"section\" => \"Contabilidad\",\n \"rutamodulo\" => \"/admin/tipocuenta\",\n \"ventana\" => \"Niveles\"\n );\n\n return $data;\n }",
"protected function getAllAvailableSectionsOptions() {}",
"private function getSections() {\n\t\t$sections = array();\n\t\tforeach (Craft::$app->getSections()->getEditableSections() as $section) {\n\t\t\t$sections[$section->id] =['value'=>$section->handle, 'label' =>Craft::t('site',$section->name)];\n\t\t}\n\t\treturn $sections;\n\t}",
"function get_all_page_sections($obj = '')\n{\n\t$section_result = $obj->db->query($obj->Query_reader->get_query_by_code('get_all_page_sections'));\n\t\n\treturn $section_result->result_array();\n}",
"private function retrieveSections() {\n\t\t$this->sections = array();\n\n\t\t$dbResult = $GLOBALS['TYPO3_DB']->exec_SELECTquery(\n\t\t\t'*',\n\t\t\tself::TABLE_SECTIONS,\n\t\t\t'content_uid = ' . $this->getContentUid() .\n\t\t\t\ttx_oelib_db::enableFields(self::TABLE_SECTIONS),\n\t\t\t'',\n\t\t\t'sorting'\n\t\t);\n\t\tif (!$dbResult) {\n\t\t\tthrow new Exception(DATABASE_QUERY_ERROR);\n\t\t}\n\n\t\twhile ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($dbResult)) {\n\t\t\t$GLOBALS['TSFE']->sys_page->versionOL(self::TABLE_SECTIONS, $row);\n\t\t\t$GLOBALS['TSFE']->sys_page->fixVersioningPid(\n\t\t\t\tself::TABLE_SECTIONS, $row\n\t\t\t);\n\t\t\tif ($GLOBALS['TSFE']->sys_language_content > 0) {\n\t\t\t\t$row = $GLOBALS['TSFE']->sys_page->getRecordOverlay(\n\t\t\t\t\tself::TABLE_SECTIONS,\n\t\t\t\t\t$row,\n\t\t\t\t\t$GLOBALS['TSFE']->sys_language_content,\n\t\t\t\t\t$GLOBALS['TSFE']->sys_language_contentOL\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t$this->sections[] = $row;\n\t\t}\n\t}",
"public function getSections()\n {\n /** @var WebApplication|ConsoleApplication $this */\n return $this->get('sections');\n }",
"protected function loadThemeSections(){\n $listSection = Section::lists('fileName');\n\n foreach ($listSection as $sec) {\n $section = Section::find($sec);\n\n if(!$section)\n continue;\n\n $this->themeSections[$section->code] = (object) [\n 'name' => $section->title,\n 'picture' => Url::to('themes/'.$this->theme->getDirName().$section->preview),\n 'code' => $section->code,\n 'configForm' => isset($section->attr)?true:false\n ];\n }\n }",
"public function renderSections()\n {\n return $this->render(function () {\n return $this->factory->getSections();\n });\n }",
"public static function special_sections() {\n if ( get_post_type() != 'property' ) {\n return;\n }\n\n $price_comparison = self::get_price_comparison();\n if ( count( $price_comparison ) ) {\n echo Inventor_Template_Loader::load( 'price-comparison', $price_comparison, INVENTOR_PROPERTIES_DIR );\n }\n echo Inventor_Template_Loader::load( 'amenities', array(), INVENTOR_PROPERTIES_DIR );\n echo Inventor_Template_Loader::load( 'floor-plans', array(), INVENTOR_PROPERTIES_DIR );\n echo Inventor_Template_Loader::load( 'valuation', array(), INVENTOR_PROPERTIES_DIR );\n echo Inventor_Template_Loader::load( 'public-facilities', array(), INVENTOR_PROPERTIES_DIR );\n }",
"function do_settings_sections($page)\n {\n }",
"public function render_section() {\n \n }",
"public function create_sections() {\n\t\tif ( count( $this->sections ) > 0 ) {\n\t\t\tforeach ( $this->sections as $k => $v ) {\n\t\t\t\tadd_settings_section( $k, $v['name'], array( $this, 'section_description' ), $this->token );\n\t\t\t}\n\t\t}\n\t}",
"public function getSections()\r\n {\r\n $sql=\"SELECT * FROM sections\";\r\n $query=$this->db->query($sql);\r\n return $query->result_array();\r\n }",
"static function get_section_info_all($modinfo) {\n global $DB;\n\n if (method_exists($modinfo, 'get_section_info_all')) {\n // Moodle >= 2.3\n return $modinfo->get_section_info_all();\n }\n\n // Moodle <= 2.2\n $info = array();\n $params = array('course' => $modinfo->get_course_id());\n if ($sections = $DB->get_records('course_sections', $params, 'section')) {\n foreach ($sections as $section) {\n $sectionnum = $section->section;\n $info[$sectionnum] = $section;\n }\n }\n return $info;\n }",
"public function sectionBegin() {}",
"public function sectionBegin() {}",
"public function getSection() {\n try {\n $client = new SoapClient($this->SECTION_WSDL);\n $res = $client->findAllActiveSection();\n return $res;\n //print_r($res);\n } catch (Zend_Exception $e) {\n var_dump($e);\n }\n }",
"function admin_get_settings_sections() {\n $sections = array(\n \n array(\n 'id' => 'wcsales_general_tabs',\n 'title' => esc_html__( 'General', 'wc-sales-notification-pro' )\n ),\n\n array(\n 'id' => 'wcsales_settings_tabs',\n 'title' => esc_html__( 'Settings', 'wc-sales-notification-pro' )\n ),\n\n array(\n 'id' => 'wcsales_fakes_data_tabs',\n 'title' => esc_html__( 'Fake Data', 'wc-sales-notification-pro' )\n ),\n\n array(\n 'id' => 'wcsales_plugins_tabs',\n 'title' => esc_html__( 'Our Plugins', 'wc-sales-notification-pro' )\n ),\n\n );\n return $sections;\n }",
"public function mapSections() {\n\t\t$request = new FetchAdXmlRequest(self::ENG_URL);\n\t\t$this->enArray = $request->send()->getResponseArray();\n\t\tforeach($this->responseArray['section'] as $index => $section) {\n\t\t\t$enName = $this->validateElement($this->enArray['section'][$index]['name']);\n\t\t\t$enDescription = $this->validateElement($this->enArray['section'][$index]['description']);\n\t\t\t$estName = $this->validateElement($section['name']);\n\t\t\t$estDescription = $this->validateElement($section['description']);\n\n\t\t\t$section['eventival_id'] = $this->validateElement($section['id']);\n\n\t\t\t$section['Translation'] = array('et' => array('name' => $estName,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'description' => $estDescription),\n\t\t\t\t\t\t\t\t\t\t 'en' => array('name' => $enName,\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t 'description' => $enDescription)\n\t\t\t\t\t\t\t\t\t );\n\t\t\t$section['title'] = $estName;\n\t\t\tunset($section['id']);\n\t\t\tunset($section['name']);\n\t\t\tunset($section['description']);\n\n\t\t\t$id = $this->checkData($this->tableType, $section['eventival_id']);\n\t\t\tif (!$id) {\n\t\t\t\t$this->createData($this->tableType, $section);\n\t\t\t} else {\n\t\t\t\t$this->updateData($this->tableType, $section, $id);\n\t\t\t}\n\t\t}\n\t}",
"public function run()\n {\n $sections=[\n //sections\n [\n 'name_section' => 'Resumen general',\n 'code_section' => 'SECCION I',\n 'order' => 2,\n 'route' => 'section2',\n 'icon' => 'detail',\n 'created_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n ],\n [\n 'name_section' => 'Informacion del paciente',\n 'code_section' => 'SECCION II',\n 'order' => 3,\n 'route' => 'section3',\n 'icon' => 'people',\n 'created_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n ],\n [\n 'name_section' => 'Examen clinico',\n 'code_section' => 'SECCION III',\n 'order' => 4,\n 'route' => 'section4',\n 'icon' => 'medical',\n 'created_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n ],\n [\n 'name_section' => 'Estudio de modelos',\n 'code_section' => 'SECCION IV',\n 'order' => 5,\n 'route' => 'section5',\n 'icon' => 'people',\n 'created_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n ],\n [\n 'name_section' => 'Diagnostico',\n 'code_section' => 'SECCION VII',\n 'order' => 6,\n 'route' => 'section6',\n 'icon' => 'medical',\n 'created_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n ],\n [\n 'name_section' => 'Plan de tratamiento',\n 'code_section' => 'SECCION VIII',\n 'order' => 7,\n 'route' => 'section7',\n 'icon' => 'detail',\n 'created_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n ],\n [\n 'name_section' => 'Registro paciente',\n 'code_section' => 'SECCION 0',\n 'order' => 1,\n 'route' => 'section1',\n 'icon' => 'people',\n 'created_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n ],\n\n //subsection 1\n [\n 'name_section' => 'Resumen Diagnostico',\n 'section_id' => 1,\n 'code_section' => 'I-a',\n 'created_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n ],\n [\n 'name_section' => 'Resumen plan de tratamiento',\n 'section_id' => 1,\n 'code_section' => 'I-b',\n 'created_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n ],\n [\n 'name_section' => 'Fecha de inicio',\n 'section_id' => 1,\n 'code_section' => 'I-c',\n 'printable' => false,\n 'created_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n ],\n [\n 'name_section' => 'Fecha de finalizacion',\n 'section_id' => 1,\n 'code_section' => 'I-d',\n 'printable' => false,\n 'created_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n ],\n //subsection 2\n [\n 'name_section' => 'Historia Medica',\n 'section_id' => 2,\n 'code_section' => 'II-a',\n 'created_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n ],\n [\n 'name_section' => 'Historia Dental',\n 'section_id' => 2,\n 'code_section' => 'II-b',\n 'created_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n ],\n [\n 'name_section' => 'Historia ortodoncica',\n 'section_id' => 2,\n 'code_section' => 'II-c',\n 'created_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n ],\n //subsection 3\n [\n 'name_section' => 'Examen extra-bucal',\n 'section_id' => 3,\n 'code_section' => 'III-a',\n 'created_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n ],\n [\n 'name_section' => 'Examen intrabucal',\n 'section_id' => 3,\n 'code_section' => 'III-b',\n 'created_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n ],\n [\n 'name_section' => 'Piezas presentes en boca',\n 'section_id' => 3,\n 'code_section' => 'III-c',\n 'enable' => false,\n 'created_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n ],\n [\n 'name_section' => 'Oclusion',\n 'section_id' => 3,\n 'code_section' => 'III-d',\n 'enable' => false,\n 'created_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n ],\n //subsection 4\n [\n 'name_section' => 'Discrepancia dentaria',\n 'section_id' => 4,\n 'code_section' => 'IV-a',\n 'created_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n ],\n [\n 'name_section' => 'Indices',\n 'section_id' => 4,\n 'code_section' => 'IV-b',\n 'created_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n ],\n [\n 'name_section' => 'Montaje en articular',\n 'section_id' => 4,\n 'code_section' => 'IV-c',\n 'printable' => false,\n 'enable' => false,\n 'created_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n ],\n //subsection 5\n [\n 'name_section' => 'Diagnostico',\n 'section_id' => 5,\n 'code_section' => 'VII-a',\n 'created_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n ],\n //subsection 6\n [\n 'name_section' => 'Plan de tratamiento',\n 'section_id' => 6,\n 'code_section' => 'VIII-a',\n 'created_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n 'updated_at' => \\Carbon\\Carbon::now()->toDateTimeString(),\n ],\n ];\n foreach ($sections as $section)\n DB::table('sections')->insert($section);\n }",
"private function get_registered_settings_sections() {\n\t\t\tglobal ${$this->func . '_sections'};\n\n\t\t\tif ( !empty( $sections ) ) {\n\t\t\t\treturn $sections;\n\t\t\t}\n\n\t\t\t$sections = apply_filters( $this->func . '_registered_settings_sections', array() );\n\n\t\t\treturn $sections;\n\t\t}",
"private function renderSections() {\n\t\t$result = '';\n\n\t\tforeach ($this->sections as $key => $section) {\n\t\t\t$columns = $this->retrieveColumns($section['uid']);\n\n\t\t\tswitch (count($columns)) {\n\t\t\t\tcase 0:\n\t\t\t\t\t$renderedColumns = '';\n\t\t\t\t\tbreak;\n\t\t\t\tcase 1:\n\t\t\t\t\t$renderedColumns = $this->renderOneColumn($columns[0]);\n\t\t\t\t\tbreak;\n\t\t\t\tdefault:\n\t\t\t\t\t$renderedColumns = $this->renderTwoColumns($columns);\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t$class = ($key == 0) ? 'tx-explanationbox-pi1-active' : 'tx-explanationbox-pi1-inactive';\n\n\t\t\t$this->setMarker('class_section', $class);\n\t\t\t$this->setMarker('section_number', $key);\n\t\t\t$this->setMarker('section_columns', $renderedColumns);\n\n\t\t\t$result .= $this->getSubpart('SECTION_BODY');\n\t\t}\n\n\t\t$this->setSubpart('SECTION_BODY', $result);\n\t}",
"public function display_section() {\n\t\t// do nothing - @todo Possibly add description here later if we have more options to add.\n\t}",
"function obj_cx_events_list_section( $events, $bottom_banner, $pagination, $event_list_deets = null, $section_classes = null, $bg_shapes = null ) {\n\n\t$sec_meta = decide_section_meta( 'event-list-section', $section_classes, $event_list_deets, $bg_shapes );\n\n\tif ( ! empty( $event_list_deets ) ) {\n\t\tdo_section_top( $sec_meta );\n\t\tobj_cx_events_list_inner( $events, $bottom_banner, $pagination, $event_list_deets );\n\t\tdo_section_bottom( $sec_meta );\n\t}\n}",
"public function defaultableSections(&$sections, $section = NULL) { }",
"function cww_df_options_page_sections() { \n $sections = array(); \n // $sections[$id] = __($title, 'wptuts_textdomain'); \n $sections['cww_df_authorizenet_setting_section'] = __('Authorize.net', 'cww');\n return apply_filters('cww_df_options_page_sections', $sections);\n}",
"private function sections()\n {\n $menu = [];\n\n foreach (config('menu') as $section) {\n if (!isset($section['name'])) {\n $menu = array_merge($menu, $section['menu']);\n } else if (Auth::user()->hasRole($section['name'])) {\n array_push($menu, ['section' => $section['name']]);\n $menu = array_merge($menu, $section['menu']);\n }\n }\n\n return $menu;\n }",
"public function isSection()\n {\n return false;\n }",
"public function init_sections () {\r\n\t\t$sections = array();\r\n\t\t\r\n\t\t$sections['general'] = array(\r\n\t\t\t'name' \t\t\t=> __( 'General Settings', 'woodojo-maintenance-mode' ), \r\n\t\t\t'description'\t=> sprintf( __( 'The default option is to use a native error message on the front end of your website. You can customize this by entering a title and note below. To customize your own maintenance mode theme, you can add a %s file to your current theme (child theme, if you\\'re using one).', 'woodojo-maintenance-mode' ), '<code>503.php</code>' )\r\n\t\t);\r\n\t\t\r\n\t\t$this->sections = $sections;\r\n\t}",
"private function renderSectionHeadings() {\n\t\t$headings = array();\n\t\t$separator = $this->getSubpart('HEADING_SEPARATOR');\n\n\t\tforeach ($this->sections as $key => $section) {\n\t\t\t$class = ($key == 0) ? 'tx-explanationbox-pi1-active' : 'tx-explanationbox-pi1-inactive';\n\n\t\t\t$this->setMarker('class_heading', $class);\n\t\t\t$this->setMarker('heading_number', $key);\n\t\t\t$this->setMarker('heading', htmlspecialchars($section['title']));\n\t\t\t$headings[] = $this->getSubpart('SINGLE_HEADING');\n\t\t}\n\n\t\tif (count($this->sections) > 1) {\n\t\t\t$this->setMarker('class_rightarrow', 'tx-explanationbox-pi1-active');\n\t\t} else {\n\t\t\t$this->setMarker('class_rightarrow', 'tx-explanationbox-pi1-inactive');\n\t\t}\n\n\t\t$this->setMarker('number_of_sections', count($this->sections));\n\t\t$this->setSubpart('SECTION_HEADINGS', implode($separator, $headings));\n\t}",
"public function render_section_templates()\n {\n }",
"function defaultable_sections($section = NULL) {\r\n if (in_array($section, array('row_options', 'row_plugin', 'items_per_page'))) {\r\n return FALSE;\r\n }\r\n return parent::defaultable_sections($section);\r\n }",
"function gw214_get_section_definitions() {\n\treturn GW214_Section_Definitions::instance();\n}",
"public function index()\n {\n $sections = Section::all();\n return $this->showAll($sections);\n }",
"public function index()\n\t{\n\t\t//\n\t\t$us = Auth::user();\n\t\tif( ! $us->hasPermission(51))\n\t\t\treturn Redirect::to('portal')\n\t\t\t\t->with('type', 'alert')\n\t\t\t\t->with('message', 'Not enough permissions');\n\n\t\t$sec = Section::all();\n\t\t$us = Auth::user();\n\t\t$actions = 0;\n\t\t$this->layout->content = View::make('layouts.index', \n\t\t\tarray(\n\t\t\t\t'class'\t\t=> 'sections',\n\t\t\t\t'table_title'\t=> 'Sections',\n\t\t\t\t'table_header'\t=> array( 'ID', 'Name', 'enabled'),\n\t\t\t\t'table_content' => $sec,\n\t\t\t\t'table_columns' => array( 'id', 'name', 'enabled'),\n\t\t\t\t'perm_cre'\t=> $us->hasPermission(50),\n\t\t\t\t'perm_upd'\t=> $us->hasPermission(52) AND ++$actions,\n\t\t\t\t'perm_del'\t=> $us->hasPermission(53) AND ++$actions,\n\t\t\t\t'actions'\t=> $actions\n\t\t\t));\t\n\t}",
"protected function getSpeakingSectionNames() {}",
"public function index()\n {\n \n $sections = Section::get();\n return view('admin.section.sections')\n ->with('sections' , $sections);\n }",
"public function read($section);",
"public function get_sections( $offset = 0, $limit = NULL )\n\t{\n\t\t$sections = get_option( NHS_SECTIONS, array() );\n\t\treturn array_slice( $sections, $offset, $limit );\n\t}",
"public function get_all_sections() {\n\t\t$sql = \"SELECT section_id FROM peducator_sections \n\t\tWHERE peducator_id='$this->peducator_id'\";\n\t\t$result = mysqli_query($this->connect_to_db, $sql);\n\n\t\t$arr = [];\n\t\twhile ($row = mysqli_fetch_array($result)) {\n\t\t\tarray_push($arr, get_section($row['section_id']));\n\t\t}\n\n\t\treturn $arr;\t\n\t}",
"function do_accordion_sections($screen, $context, $data_object)\n {\n }",
"public function get_sections() {\n\n $sections = [];\n\n foreach( $this->options as $key => $value ){\n\n if( isset($value['sections']) ) {\n foreach( $value['sections'] as $section ) {\n\n if( isset($section['fields']) ) {\n $sections[] = $section;\n }\n\n }\n }else {\n if( isset( $value['fields'] ) ) {\n $sections[] = $value;\n }\n }\n\n }\n\n return $sections;\n\n }",
"public function sections()\n {\n return $this->hasMany(Section::class)->ordered();\n }",
"public function index()\n {\n $sections = Section::all();\n\n return $this->showAll($sections);\n }",
"public function sections(Event $event)\n {\n return [\n /**\n * These could be grouped together, but this allows a little more flexibility\n * should anything need to be changed.\n */\n 'signups' => !$event->started,\n 'grids' => !$event->started,\n // Can't start until we've generated the grids!\n 'start-heats' => $event->races->count() && !$event->started,\n 'races' => $event->races->count(),\n // Show heat standings once we're up and running\n 'heat-standings' => $event->started,\n 'start-finals' => $this->canStartFinals($event),\n 'run-next-session' => (\n $event->started\n && $this->shouldSessionBeRun($event, $this->getNextSession($event))\n && !$this->canStartFinals($event)\n ),\n ];\n }",
"public static function returnValidPublicSectionTypeArray(){\n $refl = new ReflectionClass('enum_SectionType');\n $myArray = $refl->getConstants();\n\n unset($myArray['All']);\n\n return $myArray;\n }",
"public function sections( $manager ) {\n\n\t\tif ( class_exists( 'Hestia_Customizer_Theme_Info_Main' ) ) {\n\t\t\t// Register custom section types.\n\t\t\t$manager->register_section_type( 'Hestia_Customizer_Theme_Info_Main' );\n\n\t\t\t// Main Documentation Link In Customizer Root.\n\t\t\t$manager->add_section(\n\t\t\t\tnew Hestia_Customizer_Theme_Info_Main(\n\t\t\t\t\t$manager, 'hestia-theme-info', array(\n\t\t\t\t\t\t'theme_info_title' => esc_html__( 'Hestia', 'hestia-pro' ),\n\t\t\t\t\t\t'label_url' => esc_url( 'http://docs.themeisle.com/article/569-hestia-documentation' ),\n\t\t\t\t\t\t'label_text' => esc_html__( 'Documentation', 'hestia-pro' ),\n\t\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\tif ( class_exists( 'Hestia_Customizer_Theme_Info_Section' ) ) {\n\t\t\t// Register custom section types.\n\t\t\t$manager->register_section_type( 'Hestia_Customizer_Theme_Info_Section' );\n\n\t\t\t// Frontpage Sections Upsell.\n\t\t\t$manager->add_section(\n\t\t\t\tnew Hestia_Customizer_Theme_Info_Section(\n\t\t\t\t\t$manager, 'hestia-theme-info-section', array(\n\t\t\t\t\t\t'panel' => 'hestia_frontpage_sections',\n\t\t\t\t\t\t'priority' => 500,\n\t\t\t\t\t\t'options' => array(\n\t\t\t\t\t\t\tesc_html__( 'Jetpack Portfolio', 'hestia-pro' ),\n\t\t\t\t\t\t\tesc_html__( 'Pricing Plans Section', 'hestia-pro' ),\n\t\t\t\t\t\t\tesc_html__( 'Section Reordering', 'hestia-pro' ),\n\t\t\t\t\t\t),\n\n\t\t\t\t\t\t'button_url' => esc_url( 'https://www.themeisle.com/themes/hestia-pro/' ),\n\t\t\t\t\t\t'button_text' => esc_html__( 'Get the PRO version!', 'hestia-pro' ),\n\t\t\t\t\t\t'explained_features' => array(\n\t\t\t\t\t\t\tesc_html__( 'Portfolio section with two possible layouts.', 'hestia-pro' ),\n\t\t\t\t\t\t\tesc_html__( 'A fully customizable pricing plans section.', 'hestia-pro' ),\n\t\t\t\t\t\t\tesc_html__( 'The ability to reorganize your Frontpage sections more easily and quickly.', 'hestia-pro' ),\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}",
"public function sections()\n {\n return $this->hasMany(Section::class);\n }",
"public function print_elements_section_info()\n {\n }",
"public function testAllOneSection() {\n $practices = Practice::getTrainings($this->section, $this->user);\n\n $this->assertEquals($practices[0]->section_id, $this->section->id);\n $this->assertEquals($practices[1]->section_id, $this->section->id);\n $this->assertEquals($practices[2]->section_id, $this->section->id);\n $this->assertEquals($practices[3]->section_id, $this->section->id);\n $this->assertEquals($practices[4]->section_id, $this->section->id);\n }",
"public function print_multiple_section_page($course, $sections, $mods, $modnames, $modnamesused) {\n global $PAGE;\n\n $modinfo = get_fast_modinfo($course);\n $course = course_get_format($course)->get_course();\n\n $context = context_course::instance($course->id);\n // Title with completion help icon.\n $completioninfo = new completion_info($course);\n echo $completioninfo->display_help_icon();\n echo $this->output->heading($this->page_title(), 2, 'accesshide');\n\n // Copy activity clipboard..\n echo $this->course_activity_clipboard($course, 0);\n\n // Now the list of sections..\n echo $this->start_section_list();\n\n foreach ($modinfo->get_section_info_all() as $section => $thissection) {\n if ($section == 0) {\n // 0-section is displayed a little different then the others\n if ($thissection->summary or !empty($modinfo->sections[0]) or $PAGE->user_is_editing()) {\n echo $this->section_header($thissection, $course, false, 0);\n echo $this->courserenderer->course_section_cm_list($course, $thissection, 0);\n echo $this->courserenderer->course_section_add_cm_control($course, 0, 0);\n echo $this->section_footer();\n }\n continue;\n }\n if ($section > $course->numsections) {\n // activities inside this section are 'orphaned', this section will be printed as 'stealth' below\n continue;\n }\n // Show the section if the user is permitted to access it, OR if it's not available\n // but there is some available info text which explains the reason & should display.\n $showsection = $thissection->uservisible ||\n ($thissection->visible && !$thissection->available &&\n !empty($thissection->availableinfo));\n if (!$showsection) {\n // If the hiddensections option is set to 'show hidden sections in collapsed\n // form', then display the hidden section message - UNLESS the section is\n // hidden by the availability system, which is set to hide the reason.\n if (!$course->hiddensections && $thissection->available) {\n echo $this->section_hidden($section, $course->id);\n }\n\n continue;\n }\n\n if (!$PAGE->user_is_editing() && $course->coursedisplay == COURSE_DISPLAY_MULTIPAGE) {\n // Display section summary only.\n echo $this->section_summary($thissection, $course, null);\n } else {\n echo $this->section_header($thissection, $course, false, 0);\n if ($thissection->uservisible) {\n echo $this->courserenderer->course_section_cm_list($course, $thissection, 0);\n echo $this->courserenderer->course_section_add_cm_control($course, $section, 0);\n }\n echo $this->section_footer();\n }\n }\n\n if ($PAGE->user_is_editing() and has_capability('moodle/course:update', $context)) {\n // Print stealth sections if present.\n foreach ($modinfo->get_section_info_all() as $section => $thissection) {\n if ($section <= $course->numsections or empty($modinfo->sections[$section])) {\n // this is not stealth section or it is empty\n continue;\n }\n echo $this->stealth_section_header($section);\n echo $this->courserenderer->course_section_cm_list($course, $thissection, 0);\n echo $this->stealth_section_footer();\n }\n\n echo $this->end_section_list();\n\n echo html_writer::start_tag('div', array('id' => 'changenumsections', 'class' => 'mdl-right'));\n\n // Increase number of sections.\n $straddsection = get_string('increasesections', 'moodle');\n $url = new moodle_url('/course/changenumsections.php',\n array('courseid' => $course->id,\n 'increase' => true,\n 'sesskey' => sesskey()));\n $icon = $this->output->pix_icon('t/switch_plus', $straddsection);\n echo html_writer::link($url, $icon.get_accesshide($straddsection), array('class' => 'increase-sections'));\n\n if ($course->numsections > 0) {\n // Reduce number of sections sections.\n $strremovesection = get_string('reducesections', 'moodle');\n $url = new moodle_url('/course/changenumsections.php',\n array('courseid' => $course->id,\n 'increase' => false,\n 'sesskey' => sesskey()));\n $icon = $this->output->pix_icon('t/switch_minus', $strremovesection);\n echo html_writer::link($url, $icon.get_accesshide($strremovesection), array('class' => 'reduce-sections'));\n }\n\n echo html_writer::end_tag('div');\n } else {\n echo $this->end_section_list();\n }\n\n }",
"function add_sections_and_fields(): void {}",
"public function inSection( array $params = null )\n {\n $this->searchEntities($params, 'section');\n }",
"function set_sections() {\n\t\t\n\t\t$this->sections[] = '<script type=\"text/javascript\" charset=\"utf-8\">$(\"#accessoryTabs a.'.$this->id.'\").parent().remove();</script>';\n\n\t\tif($this->EE->input->get('C') == 'admin_content' && $this->EE->input->get('M') == 'category_edit' ) {\n\n\t\t\t// help!\n\t\t\trequire_once(PATH_THIRD.'dm_eeck/includes/eeck_helper.php');\n\t\t\t$this->helper = new eeck_helper();\n\n\t\t\t// we'll need the settings from the Editor field type\n\t\t\t$this->eeck_settings = $this->helper->load_editor_settings();\n\n\t\t\t$this->helper->include_editor_js($this->eeck_settings['eeck_ckepath'], $this->eeck_settings['eeck_ckfpath']);\n\t\t\t\n\t\t\t// get our settings for this field\n\t\t\t$myConf = $this->eeck_settings['eeck_config_settings'];\n\t\t\t\n\t\t\t// load out config file\n\t\t\t$conf = $this->load_config_file($myConf);\n\t\t\tif($conf != '') $conf .= ',';\n\n\t\t\t// add on integration for CK finder\n\t\t\t$conf .= $this->integrate_ckfinder($this->eeck_settings['eeck_ckfpath'],'Images','Files','Flash');\n\n\t\t\t$str = 'CKEDITOR.replace( \"cat_description\",{'.$conf.'});';\n\t\t\t$this->sections[] = '<script type=\"text/javascript\" charset=\"utf-8\">'.$str.'</script>';\n\t\t}\n\t}",
"public function sections( $manager ) {\n\n\t\t// Load custom sections.\n\t\trequire_once( trailingslashit( get_template_directory() ) . 'inc/customize-pro/class-llorix-one-lite-customize-upsell-frontpage-sections.php' );\n\t\trequire_once( trailingslashit( get_template_directory() ) . 'inc/customize-pro/class-llorix-one-lite-customize-theme-info-main.php' );\n\t\trequire_once( trailingslashit( get_template_directory() ) . 'inc/customize-pro/class-llorix-one-lite-customize-theme-info-section.php' );\n\n\t\t// Register custom section types.\n\t\t$manager->register_section_type( 'Llorix_One_Lite_Customizer_Upsell_Frontpage_Sections' );\n\t\t$manager->register_section_type( 'Llorix_One_Lite_Customizer_Theme_Info_Main' );\n\t\t$manager->register_section_type( 'Llorix_One_Lite_Customizer_Theme_Info_Section' );\n\n\t\tif ( 'posts' === get_option( 'show_on_front' ) ) {\n\t\t\t$manager->add_section(\n\t\t\t\tnew Llorix_One_Lite_Customizer_Upsell_Frontpage_Sections(\n\t\t\t\t$manager, 'llorix-one-lite-frontpage-instructions',\n\t\t\t\tarray(\n\t\t\t\t\t'upsell_text' => __( 'To customize the Frontpage sections please create a page and select the template \"Frontpage\" for that page. After that, go to Appearance -> Customize -> Static Front Page and under \"Static Front Page\" select \"A static page\". Finally, for \"Front page\" choose the page you previously created.', 'llorix-one-lite' ) . '<br><br>' . __( 'Need further informations? Check this', 'llorix-one-lite' ) . ' <a href=\"http://docs.themeisle.com/article/236-how-to-set-up-the-home-page-for-llorix-one\">' . __( 'doc', 'llorix-one-lite' ) . '</a>',\n\t\t\t\t\t'panel' => 'llorix_one_lite_front_page_sections',\n\t\t\t\t\t'priority' => 1,\n\t\t\t\t\t'active_callback' => 'llorix_one_lite_show_on_front',\n\t\t\t\t)\n\t\t\t\t)\n\t\t\t);\n\t\t}\n\n\t\t// Main Documentation Link In Customizer Root.\n\t\t$manager->add_section(\n\t\t\tnew Llorix_One_Lite_Customizer_Theme_Info_Main(\n\t\t\t\t$manager, 'llorix-one-lite-theme-info', array(\n\t\t\t\t\t'theme_info_title' => __( 'Llorix One Lite', 'llorix-one-lite' ),\n\t\t\t\t\t'label_url' => esc_url( 'http://docs.themeisle.com/article/186-llorix-one-documentation' ),\n\t\t\t\t\t'label_text' => __( 'Documentation', 'llorix-one-lite' ),\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\n\t\t// Frontpage Sections Upsell.\n\t\t$manager->add_section(\n\t\t\tnew Llorix_One_Lite_Customizer_Theme_Info_Section(\n\t\t\t\t$manager, 'llorix-one-lite-theme-info-section', array(\n\t\t\t\t\t'active_callback' => 'llorix_one_lite_show_on_front',\n\t\t\t\t\t'panel' => 'llorix_one_lite_front_page_sections',\n\t\t\t\t\t'priority' => 500,\n\t\t\t\t\t'options' => array(\n\t\t\t\t\t\tesc_html__( 'Shop Section', 'llorix-one-lite' ),\n\t\t\t\t\t\tesc_html__( 'Portfolio Section', 'llorix-one-lite' ),\n\t\t\t\t\t\tesc_html__( 'Shortcodes Section', 'llorix-one-lite' ),\n\t\t\t\t\t\tesc_html__( 'Section Reordering', 'llorix-one-lite' ),\n\t\t\t\t\t),\n\t\t\t\t\t'button_url' => esc_url( 'https://themeisle.com/plugins/llorix-one-plus/' ),\n\t\t\t\t\t'button_text' => esc_html__( 'View PRO version', 'llorix-one-lite' ),\n\t\t\t\t)\n\t\t\t)\n\t\t);\n\t}",
"protected function create_section_data() {\n\t\t$this->enable();\n\t\t$this->post_types();\n\t\t$this->headings();\n\t\t$this->min_headings_num();\n\t\t$this->exclude_keywords();\n\t\t$this->title_to_id();\n\t\t$this->id_prefix();\n\t\t$this->in_widget();\n\t\t$this->customize_css();\n\t\t$this->shotcut();\n\t\t$this->fixed_menu_selector();\n\t\t$this->scroll_offset();\n\t}",
"public function get_section()\n\t\t{\n\t\t\t$retArr = null;\n\n\t\t\t// Scaffolding Code For Array:\n\t\t\t$objs = $this->obj->find_all();\n\t\t\tforeach($objs as $obj)\n\t\t\t{\n\t\t\t\t$retArr[] = $obj->getBasics();\n\t\t\t}\n\n\t\t\treturn $retArr;\n\t\t}",
"function self_get_page_sections(){\n\tif( have_rows('content_blocks') ):\n\n\t // loop through the rows of data\n\t while ( have_rows('content_blocks') ) : the_row();\n\n\t \t\t\t$cur_sect = get_row_layout();\n\t \t\t\t$filepath = TEMPLATEPATH . '/partials/' . $cur_sect . '.php';\n\n\t \t\t\tif(file_exists( $filepath )){\n\n\t\t\t\t\t\t// the partial\n\t\t \t\t\tinclude($filepath);\n\n\t \t\t\t}\n\n\t endwhile;\n\n\telse :\n\n\t // no layouts found\n\n\tendif;\n\n}",
"function browse_sections($db,$section=0, $section_index = '')\r\n\t{\r\n\t\tif (PHP5_DIR) \r\n\t\t\t$menu_loader = geoAdmin::getInstance();\r\n\t\telse \r\n\t\t\t$menu_loader =& geoAdmin::getInstance();\r\n\t\t$this->body .= $menu_loader->getUserMessages();\r\n\t\t\r\n\t\t$this->body .= \"<fieldset id='Page Management'><legend>Pages Management</legend><table cellpadding=2 cellspacing=1 border=0 width=100%>\\n\";\r\n\t\t//browse the listings in this category that are open\r\n\r\n\t\tif ($section)\r\n\t\t{\r\n\t\t\t$sql = \"select * from \".$this->pages_sections_table.\" where section_id = \".$section;\r\n\t\t\tif(!geoMaster::is('classifieds') && geoMaster::is('auctions'))\r\n\t\t\t{\r\n\t\t\t\tif(geoMaster::is('auctions'))\r\n\t\t\t\t\t$sql .= \" and (applies_to = 0 or applies_to = 2)\";\r\n\t\t\t\telse\r\n\t\t\t\t\t$sql .= \" and (applies_to = 0 or applies_to = 1)\";\r\n\t\t\t}\r\n\t\t\t$section_result = $this->db->Execute($sql);\r\n\t\t\t//echo $sql.\" is the query<br>\\n\";\r\n\t\t\tif (!$section_result){\r\n\t\t\t\treturn false;\r\n\t\t\t}elseif ($section_result->RecordCount() == 1){\r\n\t\t\t\t$show_section_data = $section_result->FetchRow();\r\n\t\t\t\t$section_name = $show_section_data[\"name\"];\r\n\t\t\t\t$section_description = $show_section_data[\"description\"];\r\n\t\t\t\t$parent_section = $show_section_data[\"parent_section\"];\r\n\t\t\t}else{\r\n\t\t\t\t//category does not exist\r\n\t\t\t\t$this->error_message = \"Category Does Not Exist\";\r\n\t\t\t\t//echo $sql . \"<br>\";\r\n\t\t\t\t//echo \"<pre>\" . printf(var_dump($section_result->FetchRow()));\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t$section_name = \"Pages Home\";\r\n\t\t\t$section_description = \"\";\r\n\t\t\t$parent_section = 0;\r\n\t\t}\r\n\r\n\t\t$sql = \"select * from \".$this->pages_sections_table.\" where parent_section = \".$section;\r\n\t\tif(geoMaster::is('auctions')&& !geoMaster::is('classifieds'))\r\n\t\t\t$sql .= \" and (applies_to = 0 or applies_to = 2)\";\r\n\t\telseif(geoMaster::is('classifieds') && !geoMaster::is('auctions'))\r\n\t\t\t$sql .= \" and (applies_to = 0 or applies_to = 1)\";\r\n\t\t$sql .= \" order by display_order\";\r\n\t\t\r\n\t\t$sub_section_result = $this->db->Execute($sql);\r\n\t\t//echo $sql.\" is the query<br>\\n\";\r\n\t\tif (!$sub_section_result)\r\n\t\t{\r\n\t\t\t//echo $sql.\" is the query<br>\\n\";\r\n\t\t\t$this->error_message = $this->messages[5501];\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\tif ($parent_section)\r\n\t\t\t{\r\n\t\t\t\t$parent_section_data = $this->get_section($db,$parent_section);\r\n\t\t\t\t$this->body .= \"<tr>\\n\\t<td class=col_hdr_top colspan=4>\\n\\t\r\n\t\t\t\t\tback to: <a href=index.php?mc=pages_sections&page=sections{$section_index}_show&b=\".$parent_section.\" class=col_hdr_top>\".$parent_section_data[\"name\"].\"</a>\\n\\t</td>\\n</tr>\\n\";\r\n\t\t\t}\r\n\t\t\telseif ($section != 0)\r\n\t\t\t{\r\n\t\t\t\t$this->body .= \"<tr>\\n\\t<td class=col_hdr_top colspan=4>\\n\\t\r\n\t\t\t\t\tback to: <a href=index.php?mc=pages_sections&page=sections_home class=col_hdr_top>Pages Home</a>\\n\\t</td>\\n</tr>\\n\";\r\n\t\t\t}\r\n\t\t\tif ($sub_section_result->RecordCount() > 0)\r\n\t\t\t{\r\n\t\t\t\t//display subsections to this section\r\n\t\t\t\t$this->body .= \"<tr>\\n\\t<td colspan=4 class=group_price_hdr align=center>\\n\\t <b>Subsections of: \".$section_name.\"</b> </a>\\n\\t</td>\\n</tr>\\n\";\r\n\t\t\t\t$this->body .= \"<tr>\\n\\t<td align=center width=45% class=col_hdr_left><b>Section Name and Description</b>\\n\\t</td>\\n\\t\";\r\n\t\t\t\t$this->body .= \"<td align=center width=25% class=col_hdr>\\n\\t<b>Subsections</b>\\n\\t</td>\\n\\t\";\r\n\t\t\t\t$this->body .= \"<td align=center width=25% class=col_hdr>\\n\\t<b>Pages</b>\\n\\t</td>\\n\";\r\n\t\t\t\t$this->body .= \"<td align=center width=5% class=col_hdr>\\n\\t \\n\\t</td>\\n</tr>\";\r\n\t\t\t\t$this->row_count = 0;\r\n\t\t\t\twhile ($show_sub_sections = $sub_section_result->FetchRow())\r\n\t\t\t\t{\r\n\t\t\t\t\t$this->body .= \"<tr class=\".$this->get_row_color().\">\\n\\t<td valign=top>\\n\\t<a href=index.php?mc=pages_sections\".$section_index.\"&page=sections\".$section_index.\"_show&b=\".$show_sub_sections[\"section_id\"].\"><span class=medium_font><font color=000000>\".$show_sub_sections[\"name\"].\"</font></span></a><br><span class=small_font>\";\r\n\t\t\t\t\t//$this->body .= $show_sub_sections[\"description\"];\r\n\t\t\t\t\t$this->body .= \"</span></td>\\n\\t\";\r\n\t\t\t\t\t$this->body .= \"<td align=center valign=top class=small_font>\\n\\t\";\r\n\r\n\t\t\t\t\t$sql = \"select * from \".$this->pages_sections_table.\" where parent_section = \".$show_sub_sections[\"section_id\"];\r\n\t\t\t\t\tif(!geoMaster::is('classifieds') && geoMaster::is('auctions'))\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\tif(geoMaster::is('auctions'))\r\n\t\t\t\t\t\t\t$sql .= \" and (applies_to = 0 or applies_to = 2)\";\r\n\t\t\t\t\t\telse\r\n\t\t\t\t\t\t\t$sql .= \" and (applies_to = 0 or applies_to = 1)\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$sql .= \" order by display_order\";\r\n\t\t\t\t\t$sub_section_sections_result = $this->db->Execute($sql);\r\n\t\t\t\t\t//echo $sql.\" is the query<br>\\n\";\r\n\t\t\t\t\tif (!$sub_section_sections_result)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t//echo $sql.\" is the query<br>\\n\";\r\n\t\t\t\t\t\t$this->error_message = $this->messages[5501];\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telseif ($sub_section_sections_result->RecordCount() > 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\twhile ($show_this_sub_section = $sub_section_sections_result->FetchRow())\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this->body .= $show_this_sub_section[\"name\"].\"<br>\\n\";\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->body .= \"none\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->body .= \" \\n\\t</td>\\n\\t\";\r\n\r\n\t\t\t\t\t$this->body .= \"<td align=center valign=top class=small_font>\\n\\t\";\r\n\t\t\t\t\t//$sql = \"select * from \".$this->pages_table.\" where section_id = \".$show_sub_sections[\"section_id\"].\" order by display_order\";\r\n\t\t\t\t\t$sql = \"select * from \".$this->pages_table.\" where section_id = \".$show_sub_sections[\"section_id\"].\" and module = 0\";\r\n\t\t\t\t\t$sql .= \" and (applies_to = 0\";\r\n\t\t\t\t\tif(geoMaster::is('auctions'))\r\n\t\t\t\t\t\t$sql .= \" or applies_to = 2\";\r\n\t\t\t\t\tif(geoMaster::is('classifieds'))\r\n\t\t\t\t\t\t$sql .= \" or applies_to = 1\";\r\n\t\t\t\t\tif (geoMaster::is('classifieds') && geoMaster::is('auctions'))\r\n\t\t\t\t\t\t$sql .= \" or applies_to = 4\";\r\n\t\t\t\t\t$sql .= \") order by page_id\";\r\n\t\t\t\t\t$sub_pages_result = $this->db->Execute($sql);\r\n\t\t\t\t\t//echo $sql.\" is the query<br>\\n\";\r\n\t\t\t\t\tif (!$sub_pages_result)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t//echo $sql.\" is the query<br>\\n\";\r\n\t\t\t\t\t\t$this->error_message = $this->messages[5501];\r\n\t\t\t\t\t\treturn false;\r\n\t\t\t\t\t}\r\n\t\t\t\t\telseif ($sub_pages_result->RecordCount() > 0)\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\twhile ($show_sub_pages = $sub_pages_result->FetchRow())\r\n\t\t\t\t\t\t{\r\n\t\t\t\t\t\t\t$this->body .= (($this->isPageEditable($show_sub_pages['page_id']))? $show_sub_pages[\"name\"].\"<br>\\n\": '');\r\n\t\t\t\t\t\t}\r\n\t\t\t\t\t}\r\n\t\t\t\t\telse\r\n\t\t\t\t\t{\r\n\t\t\t\t\t\t$this->body .= \"none\";\r\n\t\t\t\t\t}\r\n\t\t\t\t\t$this->body .= \" \\n\\t</td>\\n\\t\";\r\n\t\t\t\t\t$enter_button = geoHTML::addButton('Enter','index.php?mc=pages_sections'.$section_index.'&page=sections'.$section_index.'_show&b='.$show_sub_sections[\"section_id\"]);\r\n\t\t\t\t\t$this->body .= \"<td align=center valign=top>\".$enter_button.\"</td>\\n\\t\";\r\n\t\t\t\t\t$this->body .= \"</tr>\\n\";\r\n\t\t\t\t\t$this->row_count++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\r\n\t\t\t$sql = \"select * from \".$this->pages_table.\" where section_id = \".$section.\" and module = 0\";\r\n\t\t\tif(!geoPC::is_ent()) {\r\n\t\t\t\t$sql .= ' and page_id not in (62, 63)';\r\n\t\t\t}\r\n\t\t\tif(!geoMaster::is('classifieds') && geoMaster::is('auctions'))\r\n\t\t\t{\r\n\t\t\t\tif(geoMaster::is('auctions'))\r\n\t\t\t\t\t$sql .= \" and (applies_to = 0 or applies_to = 2)\";\r\n\t\t\t\telse\r\n\t\t\t\t\t$sql .= \" and (applies_to = 0 or applies_to = 1)\";\r\n\t\t\t}\r\n\t\t\t$sql .= \" order by page_id, name\";\r\n\t\t\t$sub_pages_result = $this->db->Execute($sql);\r\n\t\t\tif (!$sub_pages_result)\r\n\t\t\t{\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telseif ($sub_pages_result->RecordCount() > 0)\r\n\t\t\t{\r\n\t\t\t\t//display subpages to this section\r\n\t\t\t\t$this->body .= \"\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td colspan=\\\"100%\\\">\r\n\t\t\t\t\t\t\t<table width=\\\"100%\\\">\r\n\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t<td align=left class=col_hdr_left>\r\n\t\t\t\t\t\t\t\t\t\tPage Name\r\n\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t<td align=left width=50% class=col_hdr_left>\r\n\t\t\t\t\t\t\t\t\t\tAdmin Note\r\n\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t<td width=\\\"20%\\\" class=col_hdr_left> </td>\r\n\t\t\t\t\t\t\t\t</tr>\";\r\n\t\t\t\t$this->row_count = 0;\r\n\t\t\t\twhile ($show_sub_pages = $sub_pages_result->FetchRow())\r\n\t\t\t\t{\r\n\t\t\t\t\tif (!$this->isPageEditable($show_sub_pages[\"page_id\"])){ continue; }\r\n\t\t\t\t\t$edit_button = geoHTML::addButton('Edit','index.php?mc=pages_sections&page=sections'.$section_index.'_page&b='.$show_sub_pages[\"page_id\"]);\r\n\t\t\t\t\t$this->body .= \"\r\n\t\t\t\t\t\t\t\t<tr class=\".$this->get_row_color().\">\r\n\t\t\t\t\t\t\t\t\t<td valign=top>\r\n\t\t\t\t\t\t\t\t\t\t<a href=index.php?mc=pages_sections&page=sections\".$section_index.\"_page&b=\".$show_sub_pages[\"page_id\"].\">\r\n\t\t\t\t\t\t\t\t\t\t\t<span class=medium_font>\r\n\t\t\t\t\t\t\t\t\t\t\t\t<font color=000000>\".$show_sub_pages['name'].\"</font>\r\n\t\t\t\t\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t\t\t\t\t</a>\r\n\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t<td class=medium_font align=left>\r\n\t\t\t\t\t\t\t\t\t\t\".$show_sub_pages['admin_label'].\"<br>\r\n\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t<td align=center valign=top>\".$edit_button.\"\r\n\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t</tr>\\n\";\r\n\t\t\t\t\t$this->row_count++;\r\n\t\t\t\t}\r\n\t\t\t\t$this->body .= \"\r\n\t\t\t\t\t\t\t</table>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\";\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->body .= \"</table>\r\n</fieldset>\r\n\";\r\n\t\t\r\n\t\treturn true;\r\n\t}",
"function main_section() {\n\t\t\t\t// GNDN\n\t\t}",
"public function get_settings_sections() {\n\t\t$sections = array(\n\t\t\tarray(\n\t\t\t\t'id' => 'test_1',\n\t\t\t\t'title' => __( 'Easy Setting Test', 'sharaz-settings' ),\n\t\t\t\t'desc' => 'section description',\n\t\t\t\t'page' => 'ss_page',\n\t\t\t\t'priority' => '10',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'id' => 'test_2',\n\t\t\t\t'title' => __( 'Easy Setting Test2', 'sharaz_settings' ),\n\t\t\t\t'page' => 'ss_page1',\n\t\t\t\t'priority' => '15',\n\t\t\t),\n\n\t\t);\n\n\t\t// use to filter the section any point\n\t\t$setting_section = apply_filters( 'ss_section', $sections );\n\n\n\t\t// sort the array parity wise\n\n\t\tusort( $setting_section, array( $this, 'sort_array' ) );\n\n\n\t\treturn $sections;\n\t}",
"protected function getReportSections() {\n return array(\n 'iops-linear-time' => 'WSAT IOPS (Linear) vs Time (Linear)',\n 'iops-log-time' => 'WSAT IOPS (LOG) vs Time (Linear)',\n 'iops-linear-tgbw' => 'WSAT IOPS (Linear) vs TGBW (Linear)',\n 'iops-log-tgbw' => 'WSAT IOPS (Log) vs TGBW (Linear)'\n );\n }",
"public function getList(){\n $sections = $this->Section->find('list', array('fields'=>array('id','NOM'),'order'=>array('NOM'=>'asc'),'recursive'=>-1));\n return $sections;\n }",
"function GetSections($strRole='V',$intDomain=-1,$intReject=-1,$strExtra='')\n{\n if ( !is_string($strRole) ) die('GetSectionTitles: Argument #1 must be a string');\n if ( !is_integer($intDomain) ) die('GetSectionTitles: Argument #2 must be an integer');\n\n global $oDB;\n\n if ( $intDomain>=0 ) { $strWhere = 'domainid='.$intDomain; } else { $strWhere = 'domainid>=0'; }\n if ( $strRole=='V' || $strRole=='U' ) $strWhere .= ' AND type<>\"1\"';\n if ( !empty($strExtra) ) $strWhere .= ' AND '.$strExtra;\n\n $arr = array();\n $oDB->Query( 'SELECT * FROM '.TABSECTION.' WHERE '.$strWhere.' ORDER BY titleorder' );\n while ( $row = $oDB->Getrow() )\n {\n $arr[intval($row['id'])] = $row;\n }\n\n if ( count($arr)>0 )\n {\n // search translation\n $arrL = cLang::GetName('sec',$_SESSION[QT]['lang_iso'],'*');\n if ( count($arrL)>0)\n {\n foreach ($arr as $id => $str)\n {\n if ( array_key_exists('s'.$id,$arrL) )\n {\n if ( !empty($arr['s'.$id]) ) $arr[$id]['title']=$arrL['s'.$id];\n }\n }\n }\n // reject\n if ( $intReject>=0 ) unset($arr[$intReject]);\n }\n return $arr;\n}",
"function mace_admin_get_settings_sections() {\n\t$sections = array();\n\n\t$settings_pages = mace_get_settings_pages();\n\n\tforeach( $settings_pages as $page_id => $page_config ) {\n\t\t$sections[ $page_id ] = array(\n\t\t\t'title' => $page_config['page_title'],\n\t\t\t'callback' => $page_config['page_description_callback'],\n\t\t\t'page' => $page_id,\n\t\t);\n\t}\n\n\treturn (array) apply_filters( 'mace_admin_get_settings_sections', $sections );\n}",
"public function slice_and_dice(){\n\n // Are we inside a section?\n $in_section = false;\n\n // The current Section name\n $section_name = '';\n\n // Output, as Layout file modified\n $output = '';\n\n // The canonical name of the Layout\n $layout_canonical_name = (string) new \\file_basename_for($this->layout_name);\n\n // The full path filename for the layout\n $filename = (string)new Theme_Root(getcwd(), $this->theme_name) . \"/$this->layout_name\";\n\n // Get model for saving sections in DB\n $page_model = (new Model('website_page'))\n\n ->find(\"name='$layout_canonical_name'\");\n\n // Have we substituted the sections for the directive yet?\n $is_replaced = false;\n\n // if we can open the file for reading...\n if ( ( $handle = fopen($filename,'r'))){\n\n while ( ($line = fgets($handle))!== false ){\n\n // Report for first file\n if ( self::$is_first_file && $this->verbose ) echo \"\\tLine: $line\";\n\n if ( preg_match('/<section/',$line,$hits)){\n\n if ( $this->verbose ) echo \"\\tFound an HTML <section> on line $line in Layout $layout_canonical_name\\r\\n\";\n\n\n $section_name = (string) new Section_Name($line,$layout_canonical_name);\n\n // Initialize content\n $this->sections[$section_name] = '';\n\n $in_section = true;\n\n if ( ! $is_replaced){\n\n $output .= file_get_contents(new Code_Alchemy_Root_Path().\"/templates/fragments/foreach-model-template.php\").\"\\r\\n\";\n\n $is_replaced = true;\n }\n }\n\n if ( $in_section )\n\n $this->sections[$section_name] .= $line;\n\n else\n\n $output .= $line;\n\n if ( preg_match('<\\/section>',$line) )\n\n $in_section = false;\n\n }\n\n // No longer the first file\n self::$is_first_file = false;\n\n\n if ( $output )\n\n file_put_contents($filename,$output);\n\n\n fclose($handle);\n\n // Write sections to database\n foreach ( $this->sections as $name => $section_data ) {\n\n // If DB Model for Page was found...\n if ( $page_model->exists){\n\n $section_model = (new Model('page_section'));\n\n if ( ! $section_model\n\n ->create_from(array(\n\n 'website_page_id' => $page_model->id,\n\n 'name' => $name,\n\n 'handlebars_template' => (string)\n\n new String_Values_Replacer($section_data,array(\n\n '/<\\?\\=\\$theme_root\\?\\>/' => '{{theme_root}}'\n ))\n\n )))\n\n echo \"\\t\".$section_model->error();\n\n else\n\n {\n\n if ( $this->verbose ) echo \"\\t$name: Section successfully extracted and added to database\\r\\n\";\n }\n\n\n\n }\n\n\n }\n\n\n }\n\n if ( $this->verbose ) echo \"\\t\". get_called_class().\" Sliced out \".count( $this->sections).\" from Layout $layout_canonical_name\\r\\n\";\n\n }",
"function browse_module_sections($db,$section=0)\r\n\t{\r\n\t\tif(!$this->isSectionEditable($section)) {\r\n\t\t\treturn false;\r\n\t\t}\r\n\t\t\r\n\t\t//$this->title = \"Page Modules\";\r\n\t\t$this->description = \"Page Modules allow you to display each module's feature / functionality on the pages that you specify. Each module has its own distinct \\\"tag\\\" which you insert within your Templates. Wherever you insert the\r\n\t\ttag into the html of your template is where that Module's functionality will be displayed. So, to use a module, determine that module's \\\"tag name\\\", insert that tag into your template, refresh that template through the Pages\r\n\t\tManagement section (to ensure the system \\\"attaches\\\" the module to the page) and then edit the module's properties to display as you wish. Each module has it's own distinct display properties.\";\r\n\t\tif ($section)\r\n\t\t\t$this->body .= \"\r\n\t\t\t\t<table cellpadding=4 cellspacing=0 border=0 width=100%>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td colspan=\\\"100%\\\" class=pages_manage_nav>back to \r\n\t\t\t\t\t\t\t<a href=index.php?mc=view_modules&page=modules_home class=pages_manage_nav>Modules Home</a>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t</table>\";\r\n\t\t$this->body .= \"<fieldset id='AvailableModules'><legend>Available Modules</legend><table cellpadding=2 cellspacing=1 border=0 width=100%>\\n\";\r\n\t\tif (!$section)\r\n\t\t{\r\n\t\t\t$this->function_name = \"browse_module_sections\";\r\n\r\n\t\t\t$sql = \"select * from \".$this->pages_modules_sections_table.\" where parent_section = 0\";\r\n\t\t\t//echo $sql. \"is the query<br>\";\r\n\t\t\t$section_result = $this->db->Execute($sql);\r\n\t\t\t//if($this->configuration_data[\"debug_admin\"])\r\n\t\t\t//{\r\n\t\t\t//\t$this->debug_display($db, $this->filename, $this->function_name, \"pages_sections_modules_table\", \"get page sections data\");\r\n\t\t\t//}\r\n\t\t\tif (!$section_result)\r\n\t\t\t{\r\n\t\t\t\t//echo $sql.\" is the query<br>\\n\";\r\n\t\t\t\t//$this->error_message = $this->messages[5501];\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t\telseif ($section_result->RecordCount() > 0)\r\n\t\t\t{\r\n\t\t\t\t$this->row_count = 0;\r\n\t\t\t\twhile ($show_sections = $section_result->FetchRow())\r\n\t\t\t\t{\r\n\t\t\t\t\tif (!$this->isSectionEditable($show_sections['section_id'])) continue;\r\n\t\t\t\t\t$this->body .= \"<tr class=\".$this->get_row_color().\">\\n\\t<td valign=top>\\n\\t<a href=index.php?mc=view_modules&page=modules_show&b=\".$show_sections[\"section_id\"].\"><span class=medium_font><font color=000000>\".$show_sections[\"name\"].\"</font></span></a><span class=small_font>\";\r\n\t\t\t\t\t//$this->body .= $show_sections[\"description\"];\r\n\t\t\t\t\t$this->body .= \"</span></td>\\n\\t\";\r\n\t\t\t\t\t$enter_button = geoHTML::addButton('Enter','index.php?mc=view_modules&page=modules_show&b='.$show_sections[\"section_id\"]);\r\n\t\t\t\t\t$this->body .= \"<td align=center valign=top width=100>\".$enter_button.\"</td>\\n\\t\";\r\n\t\t\t\t\t$this->body .= \"</tr>\\n\";\r\n\t\t\t\t\t$this->row_count++;\r\n\t\t\t\t}\r\n\t\t\t\t$this->body .= \"<tr class=\".$this->get_row_color().\">\\n\\t<td colspan='2' style='text-align: center;'>\r\n\t\t\t\t\t<a href='index.php?page=modules_page' class='mini_button'>View All Modules</a>\r\n\t\t\t\t</td></tr>\";\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t//category does not exist\r\n\t\t\t\t$this->error_message = $this->messages[\"5500\"];\r\n\t\t\t\treturn false;\r\n\t\t\t}\r\n\t\t}\r\n\t\telse\r\n\t\t{\r\n\t\t\t//does this section have subsections\r\n\t\t\t$sql = \"select * from \".$this->pages_modules_sections_table.\" where parent_section = \".$section;\r\n\t\t\t\r\n\t\t\t//echo $sql. \"is the query<br>\";\r\n\t\t\t$parent_section_result = $this->db->Execute($sql);\r\n\t\t\tif (!$parent_section_result)\r\n\t\t\t{\r\n\t\t\t\ttrigger_error('ERROR SQL: '.$this->db->ErrorMsg());\r\n\t\t\t\t$this->error_message = $this->messages[5501];\r\n\t\t\t//\treturn false;\r\n\t\t\t}\r\n\r\n\t\t\t//if it does display these sections in a list like above\r\n\r\n\t\t\telseif ($parent_section_result->RecordCount() > 0)\r\n\t\t\t{\r\n\t\t\t\t$this->row_count = 0;\r\n\t\t\t\twhile ($show_sections = $parent_section_result->FetchRow())\r\n\t\t\t\t{\t\r\n\t\t\t\t\tif (!$this->isSectionEditable($show_sections['section_id'])) continue;\r\n\t\t\t\t\t\t$enter_button = geoHTML::addButton('Enter','index.php?mc=view_modules&page=modules_show&b='.$show_sections[\"section_id\"]);\r\n\t\t\t\t\t\t$this->body .= \"\r\n\t\t\t\t\t\t\t<tr class=\".$this->get_row_color().\">\r\n\t\t\t\t\t\t\t\t<td valign=top>\r\n\t\t\t\t\t\t\t\t\t<a href=index.php?mc=view_modules&page=modules_show&b=\".$show_sections[\"section_id\"].\">\r\n\t\t\t\t\t\t\t\t\t\t<span class=medium_font><font color=000000>\".$show_sections[\"name\"].\"</font></span></a>\r\n\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t<td align=center valign=top>\".$enter_button.\"</td>\r\n\t\t\t\t\t\t\t</tr>\";\r\n\t\t\t\t\t\t$this->row_count++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\t// it it does not have subsections then call the module list function\r\n\t\t\t\t//and pass it the subsection to display modules specific to that section\r\n\r\n\t\t\t\t$sql = \"SELECT name,admin_label,page_id,module_replace_tag FROM \".$this->pages_table.\"\r\n\t\t\t\t\tWHERE module = 1 AND module_type=\".$section;\r\n\t\t\t\tif(9 == $section && !geoPC::is_ent()) {\r\n\t\t\t\t\t$sql .= ' and page_id = 100';\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\tif (!$this->isSectionEditable($section)) return false;\r\n\t\t\t\r\n\t\t\t\t$parent_section_result = $this->db->Execute($sql);\r\n\t\t\t\tif (!$parent_section_result)\r\n\t\t\t\t\treturn false;\r\n\t\t\t\t$unsorted_modules = array();\r\n\t\t\t\twhile ($show_module = $parent_section_result->FetchRow()){\r\n\t\t\t\t\tif ($this->isPageEditable($show_module['page_id'])) array_push($unsorted_modules,$show_module);\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\t//leave the other types of modules alone\r\n\t\t\t\t$modules = $unsorted_modules;\r\n\t\t\t\t$this->body .= \"\r\n\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t<td colspan=\\\"100%\\\">\r\n\t\t\t\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t\t\t\t<td class=col_hdr_left>\r\n\t\t\t\t\t\t\t\t\t\tModule Name\r\n\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t<td width=50% class=col_hdr_left>\r\n\t\t\t\t\t\t\t\t\t\tAdmin Note\r\n\t\t\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t\t\t<td width=\\\"20%\\\" class=col_hdr_left> </td>\r\n\t\t\t\t\t\t\t\t</tr>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t</tr>\";\r\n\t\t\t\t$this->row_count = 0;\r\n\t\t\t\tforeach ($modules as $module)\r\n\t\t\t\t{\r\n\t\t\t\t\t$tag = \"{module tag='{$module['module_replace_tag']}'}\";\r\n\t\t\t\t\t$edit_button = geoHTML::addButton('Edit','index.php?mc=view_modules&page=modules_page&b='.$module['page_id']);\r\n\t\t\t\t\t$this->body .= \"\r\n\t\t\t\t\t\t<tr class=\".$this->get_row_color().\">\r\n\t\t\t\t\t\t\t<td valign=top>\r\n\t\t\t\t\t\t\t\t<a href=index.php?mc=view_modules&page=modules_page&b=\".$module['page_id'].\">\r\n\t\t\t\t\t\t\t\t\t<span class=medium_font>\r\n\t\t\t\t\t\t\t\t\t\t<font color=000000>\".$module['name'].\"</font>\r\n\t\t\t\t\t\t\t\t\t</span>\r\n\t\t\t\t\t\t\t\t</a><br>\r\n\t\t\t\t\t\t\t\t<span class=small_font>$tag</span>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t<td class=medium_font align=left>\r\n\t\t\t\t\t\t\t\t\".$module['admin_label'].\"<br>\r\n\t\t\t\t\t\t\t</td>\r\n\t\t\t\t\t\t\t<td align=center valign=top>\".$edit_button.\"</td>\r\n\t\t\t\t\t\t</tr>\\n\";\r\n\t\t\t\t\t$this->row_count++;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\t$this->body .= \"</table></fieldset>\\n\";\r\n\t\treturn true;\r\n\t}",
"protected function start_section_list() {\n\n $html = html_writer::start_tag('div', array('id' => 'turforlag_wrapper'));\n $html .= html_writer::start_tag('div', array('id' => 'tabs', 'class' => 'turforlag'));\n return $html;\n }",
"private static function _printSectionsContent(array $settings)\n {\n $sections = Util::getArrayIndex($settings, 'sections', array());\n $class = $settings['widget']['type'];\n\n foreach ($sections as $section) {\n // Title of the section.\n echo '<div class=\"'.$class.'-section-title\">';\n echo $section['label'];\n echo '</div>';\n\n // Items for this section.\n $items = Util::getArrayIndex($section, 'items', array());\n GUIScreenSettings::printItems($items, $settings);\n }\n\n }",
"function wpex_portfolio_single_meta_sections() {\n\n\t// Default sections\n\t$sections = array( 'date', 'author', 'categories', 'comments' );\n\n\t// Apply filters for easy modification\n\t$sections = apply_filters( 'wpex_portfolio_single_meta_sections', $sections );\n\n\t// Turn into array if string\n\tif ( $sections && ! is_array( $sections ) ) {\n\t\t$sections = explode( ',', $sections );\n\t}\n\n\t// Return sections\n\treturn $sections;\n\n}",
"public function init ()\n {\n $section_general = array (\n array (\n 'section_id_list',\n __ ('List of section ids', DOMAIN),\n sprintf (\n __ ('List of section ids (space-separated). Eg.: %s', DOMAIN),\n 'mss mss_internal capit_ldf capit_ldf_internal'\n ),\n ns ('cap_sanitize_key_list'),\n ),\n array (\n 'xml_root_uri',\n __ ('XML Root URI', DOMAIN),\n sprintf (\n __ ('Root URI from where to download XML files, eg.: %s', DOMAIN),\n 'https://capitularia.uni-koeln.de/downloads'\n ),\n ns ('cap_sanitize_path'),\n ),\n );\n $section_transform = array (\n array (\n 'section_caption',\n __ ('Section name', DOMAIN),\n __ ('The name of this section', DOMAIN),\n ns ('cap_sanitize_caption'),\n ),\n array (\n 'shortcode',\n __ ('Shortcode', DOMAIN),\n __ ('The text to insert on all new pages. Use {slug} to insert the page slug.', DOMAIN),\n ns ('cap_sanitize_nothing'),\n ),\n array (\n 'xml_dir',\n __ ('XML files directory', DOMAIN),\n sprintf (\n __ (\n 'The path to the XML files, relative to the FS Root. eg.: %s. ' .\n 'The FS root is currently configured as<br>%s',\n DOMAIN\n ),\n 'publ/mss',\n lib\\get_opt ('afs')\n ),\n ns ('cap_sanitize_path'),\n ),\n array (\n 'slug_path',\n __ ('Slug path', DOMAIN),\n sprintf (\n __ ('The URL path to the page, eg.: %s', DOMAIN),\n 'capit/ldf'\n ),\n ns ('cap_sanitize_path'),\n ),\n array (\n 'slug_prefix',\n __ ('Slug prefix', DOMAIN),\n sprintf (\n __ ('The slug prefix for the pages, eg.: %s', DOMAIN),\n 'capit-ldf-'\n ),\n ns ('cap_sanitize_key'),\n ),\n array (\n 'page_status_list',\n __ ('Page statuses list', DOMAIN),\n sprintf (\n __ ('The allowed page statuses (space-separated list). Eg.: %s', DOMAIN),\n 'publish private'\n ),\n ns ('cap_sanitize_caption'),\n ),\n array (\n 'sidebars',\n __ ('Sidebars', DOMAIN),\n sprintf (\n __ ('The sidebars (space-separated list). Eg.: %s', DOMAIN),\n 'transcription'\n ),\n ns ('cap_sanitize_caption'),\n ),\n );\n\n $this->sections = array ();\n $this->sections[] = array ('general', $section_general);\n\n $sections = explode (' ', $this->get_opt ('general', 'section_id_list'));\n foreach ($sections as $section_id) {\n $this->sections[] = array ($section_id, $section_transform);\n }\n }",
"public function showSections() {\n\t\t$sql = $this->conn->query(\"SELECT * FROM section\");\n\t\t$result = $sql->fetchAll();\n\t\t$option = '';\n\t\tforeach ($result as $row) {\n\t\t\t$option .= '<option value=\"'.$row['sec_id'].'\">Grade '.$row['grade_lvl'].' - '.$row['sec_name'].'</option>';\n\t\t}\n\t\techo $option;\n\t}",
"public function sections()\n {\n $this->authCheck();\n\n $sections = DB::table('sections')\n ->get();\n \n $sections=view('admin.sections')\n ->with('sections',$sections);\n\n return view('admin.master')\n ->with('main_content',$sections);\n }",
"public function section()\n {\n /*if ($this->section != '') {\n return $this->section;\n }\n else {*/\n // Kill trailing period\n $pattern = \"/\\.$/\"; // remove last \".\"\n $cleaned = $this->section_comment();\n $cleaned = trim($cleaned);\n $cleaned = preg_replace($pattern, '', $cleaned);\n\n $pattern = \"/Styleguide (.+)/\";\n preg_match_all($pattern, $cleaned, $sections);\n //$this->section = $sections[1][0];\n //return $this->section;\n return $sections[1][0];\n //}\n }",
"public function index()\n {\n $sections = Section::orderBy('id','asc')->paginate(10);;\n return view('admin.pages.section.index',compact('sections'));\n }",
"function blogslog_sortable_sections() {\n $sections = array(\n 'banner' => esc_html__( 'Banner', 'blogslog' ),\n 'about' => esc_html__( 'About', 'blogslog' ),\n 'list_articles' => esc_html__( 'List Articles', 'blogslog' ),\n 'blog' => esc_html__( 'Blog', 'blogslog' ),\n );\n return apply_filters( 'blogslog_sortable_sections', $sections );\n }",
"public function section_header() {\r\n\t\techo '<p>Other menu options will only show when there is a connection to the API.</p>';\r\n\t}",
"public function sections_get() {\n $response = array();\n $auth_token = $_GET['auth_token'];\n $course_id = $_GET['course_id'];\n $logged_in_user_details = json_decode($this->token_data_get($auth_token), true);\n\n if ($logged_in_user_details['user_id'] > 0) {\n $response = $this->api_model->sections_get($course_id, $logged_in_user_details['user_id']);\n }else{\n }\n return $this->set_response($response, REST_Controller::HTTP_OK);\n }"
]
| [
"0.74850273",
"0.74440444",
"0.7429233",
"0.674967",
"0.6661697",
"0.6493795",
"0.6414462",
"0.6414088",
"0.6414088",
"0.63803905",
"0.63558173",
"0.6348644",
"0.63285357",
"0.6326808",
"0.6306373",
"0.62590796",
"0.620617",
"0.6188569",
"0.6178856",
"0.61766475",
"0.6172373",
"0.61614394",
"0.61567783",
"0.60925555",
"0.6045191",
"0.6025113",
"0.5995003",
"0.5901171",
"0.5873439",
"0.5866189",
"0.5856078",
"0.5849577",
"0.5840526",
"0.58258903",
"0.5821474",
"0.5795745",
"0.5755824",
"0.5755824",
"0.57272846",
"0.57171863",
"0.5701653",
"0.56771255",
"0.56648415",
"0.5661442",
"0.565473",
"0.56532234",
"0.56308526",
"0.5603995",
"0.5597477",
"0.55965716",
"0.55890006",
"0.55815357",
"0.5572559",
"0.557006",
"0.5564863",
"0.55537647",
"0.55469257",
"0.5527295",
"0.5524225",
"0.5507324",
"0.5504248",
"0.5496524",
"0.54847974",
"0.5482273",
"0.5478502",
"0.5458977",
"0.5445726",
"0.5439472",
"0.54194736",
"0.54185957",
"0.54118246",
"0.5400267",
"0.5374449",
"0.5373544",
"0.53693897",
"0.53635496",
"0.53633565",
"0.53565305",
"0.53543377",
"0.53532284",
"0.53233236",
"0.53157526",
"0.53150606",
"0.5309228",
"0.5307705",
"0.5297221",
"0.528731",
"0.52800155",
"0.5277527",
"0.527417",
"0.52652097",
"0.52606565",
"0.5254201",
"0.5250107",
"0.5247575",
"0.5243465",
"0.52338594",
"0.5233231",
"0.52302784",
"0.52273226"
]
| 0.54420906 | 67 |
/ / Enum all vars in the section / | public function GetKeys($section)
{
$result = [];
$tmpArray = Util::GetAttribute($this->vars, $section, []);
foreach ($tmpArray as $key => $value) {
$newValue = $this->Get($section, $key, "");
$result[ $key ] = $newValue;
}
return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function loadVars(){\n\t\tif(!self::$vars){\n\t\t\tself::$vars = self::getDefaultVars();\n\t\t}\n\t\tforeach(func_get_args() as $arg){\n\t\t\tforeach($arg as $key=> $value){\n\t\t\t\tself::$vars[$key] = self::fillTokens($value);\n\t\t\t}\n\t\t}\n\t\treturn self::$vars;\n\t}",
"public function GetSections()\n {\n return array_keys($this->vars);\n }",
"static function getLangVars()\n\t{\n\t\treturn array(\"pc_vacc\", \"pc_hacc\");\n\t}",
"private function loadSesionVars() {\r\n\r\n $this->VARS = array(); \r\n\r\n $this->updateSessionExpireTime();\r\n\r\n $dati = $this->selectSessionVars();\r\n\r\n foreach($dati as $infos) { \r\n $this->VARS[$infos[\"name\"]]=unserialize($infos[\"value\"]);\r\n }\r\n\r\n }",
"public function variables(): array;",
"public function variables(): array;",
"protected function initVars() {\n\n\t\t}",
"public function exportedVars(): iterable;",
"function dumpInfo() {\n global $_dOp;\n $op = \"SECTION: $this->sectionName<br />\";\n $_dOp = '';\n foreach ($this->varList as $secID => $vars) {\n $op .= \" -- section ID: $secID<br />\";\n foreach ($vars as $varKey => $varTag) {\n if (is_array($varTag)) {\n foreach ($varTag as $varObj) {\n $op .= \" .... VAR: $varKey<br />\\n\";\n $aList = $varObj->getAttrList();\n foreach ($aList as $attr) {\n if ($attr == 'NAME')\n continue;\n $v = $varObj->getAttr($attr);\n if ($v === false)\n $v = 'false';\n if ($v === true)\n $v = 'true';\n if ($v === NULL)\n $v = '[not set]';\n \n $op .= \"........ $attr => \".$v.\"<br />\\n\";\n }\n }\n }\n else {\n $op .= \" .... VAR: $varKey<br />\\n\";\n $aList = $varTag->getAttrList();\n foreach ($aList as $attr) {\n if ($attr == 'NAME')\n continue;\n $v = $varTag->getAttr($attr);\n if ($v === false)\n $v = 'false';\n if ($v === true)\n $v = 'true';\n if ($v === NULL)\n $v = '[not set]';\n $op .= \"........ $attr => \".$v.\"<br />\\n\";\n }\n }\n }\n }\n return $op;\n }",
"public function GetAll()\n {\n $result = [];\n foreach ($this->vars as $key => $section) {\n $result[ $key ] = $this->GetKeys($key);\n }\n return $result;\n }",
"public function vars()\n {\n return array_merge(parent::vars(), [\n 'user' => (string) $this->key->sysuser ? $this->key->sysuser->name : 'sitepilot',\n 'key' => (string) $this->key->key\n ]);\n }",
"function values( $vars ) {\n foreach($vars as $k=>$v) {\n $this->_vars[\"$k\"] = $v;\n }\n }",
"public function getVariables()\n {\n \treturn isset($this->all['variables']) ? $this->all['variables'] : array();\n }",
"public function type_vars( ){\n\t\t\n\t\tglobal $disabled_settings;\n\t\t$alt = false;\n\t\tif ( is_array( $disabled_settings ) )\n\t\t\tif( !empty( $disabled_settings['typography'] ) )\n\t\t\t\t$alt = true;\n\t\t\n\t\t$vars = array(\n\t\t\t'plBaseFont'\t\t=> ($alt) ? '\"Helvetica\" Arial, serif' : pl_type_el('type_primary', 'stack'), \n\t\t\t'plBaseWeight'\t\t=> pl_type_el('type_primary', 'weight'), \n\t\t\t'plAltFont'\t\t\t=> ($alt) ? '\"Helvetica\" Arial, serif' : pl_type_el('type_secondary', 'stack'), \n\t\t\t'plAltWeight'\t\t=> pl_type_el('type_secondary', 'weight'), \n\t\t\t'plHeaderFont'\t\t=> ($alt) ? '\"Helvetica\" Arial, serif' : pl_type_el('type_headers', 'stack'), \n\t\t\t'plHeaderWeight'\t=> pl_type_el('type_headers', 'weight'),\n\t\t);\n\t\treturn $vars;\n\t}",
"function import_record_vars() {\r\n while (list($key, $val) = each($this->Record))\r\n if (ereg(\"[A-Za-z][A-Za-z0-9_]*\", $key)) {\r\n $field_name = strtoupper($key); \r\n\t global $$field_name;\r\n\t $$field_name=$val;\r\n }; \r\n }",
"protected function init()\n {\n $arVariablesExtend = Event::fire(self::EVENT_EXTEND_VARIABLES, []);\n\n foreach ($arVariablesExtend as $iIndex => $arExtend)\n {\n foreach ($arExtend as $sKey => $arVariable) {\n if (in_array($sKey, $this->arVariables)) {\n continue;\n }\n\n // Add to variables\n $this->arVariables[$sKey] = $arVariable;\n }\n }\n }",
"public function getVariables(): Mailcode_Variables_Collection_Regular;",
"public function getVars() {\r\n return $this->VARS;\r\n }",
"public function get_vars()\n\t{\n\t\treturn array(\"TsvOneFile\");\n\t}",
"public function config_vars()\n\t{\n\t\tglobal $txt;\n\n\t\t$return_data = array();\n\n\t\t$core_features = $this->settings();\n\n\t\t// Convert this to a format that admin search will understand\n\t\tforeach ($core_features as $id => $data)\n\t\t{\n\t\t\t$return_data[] = array('switch', $data['title'] ?? $txt['core_settings_item_' . $id]);\n\t\t}\n\n\t\treturn $return_data;\n\t}",
"public function getHeaderFooterVariables() {\n\t\t$vars = $this->request->getVars();\n\n\t\tunset(\n\t\t\t$vars['url'],\n\t\t\t$vars['flushtoken'],\n\t\t\t$vars['flush']\n\t\t);\n\n\t\tif (isset($vars['page']) && strpos($vars['page'], '§ion=') !== false) {\n\t\t\t$parts = explode('§', $vars['page']);\n\t\t\t$vars['page'] = $parts[0];\n\t\t\t$vars['section'] = str_replace('ion=', '', $parts[1]);\n\t\t}\n\n\t\t$string = '';\n\n\t\tforeach ($vars as $key => $value) {\n\t\t\t$string .= '<strong style=\"color: red;\">$' . $key . '</strong> => ' . $value . '<br>';\n\t\t}\n\n\t\t$htmlString = DBHTMLText::create();\n\t\t$htmlString->setValue($string);\n\n\t\t$vars['all_variables'] = $htmlString;\n\n\t\treturn $vars;\n\t}",
"public function initVarfromDefs() {\n foreach ($this->extconfigs->getextConfig('sccpDefaults') as $key => $value) {\n if (empty($this->sccpvalues[$key])) {\n $this->sccpvalues[$key] = array('keyword' => $key, 'data' => $value, 'type' => '0', 'seq' => '0');\n }\n }\n }",
"function getVariableContainer() ;",
"public function __getVars(){\r\n $vars = isset($this->vars)? $this->vars:array();\r\n return $vars;\r\n }",
"public function getGetVariables();",
"function asp_parse_options() {\r\r\n foreach ( wd_asp()->o as $def_k => $o ) {\r\r\n if ( preg_match(\"/\\_def$/\", $def_k) ) {\r\r\n $ok = preg_replace(\"/\\_def$/\", '', $def_k);\r\r\n\r\r\n // Dang, I messed up this elegant solution..\r\r\n if ( $ok == \"asp_it\")\r\r\n $ok = \"asp_it_options\";\r\r\n\r\r\n wd_asp()->o[$ok] = asp_decode_params( get_option($ok, wd_asp()->o[$def_k]) );\r\r\n wd_asp()->o[$ok] = array_merge(wd_asp()->o[$def_k], wd_asp()->o[$ok]);\r\r\n }\r\r\n }\r\r\n // Long previous version compatibility\r\r\n if ( wd_asp()->o['asp_caching'] === false )\r\r\n wd_asp()->o['asp_caching'] = wd_asp()->o['asp_caching_def'];\r\r\n\r\r\n // The globals are a sitewide options\r\r\n wd_asp()->o['asp_glob'] = get_site_option('asp_glob', wd_asp()->o['asp_glob_d']);\r\r\n wd_asp()->o['asp_glob'] = array_merge(wd_asp()->o['asp_glob_d'], wd_asp()->o['asp_glob']);\r\r\n}",
"public static function variables(): array\n {\n return [\n Variable::make('sorts', __('Array of available sorting')),\n\n Variable::make('directions', __('Array of sort directions')),\n\n Variable::make('items', __('HTML generated of blog items')),\n\n Variable::make('pagination', __('HTML generated of pagination links')),\n ];\n }",
"protected function GetDescriptionVariables()\n {\n return array();\n }",
"function _phptemplate_variables($hook, $vars) {\n if ($hook == 'page') {\n\n if ($secondary = menu_secondary_local_tasks()) {\n $output = '<span class=\"clear\"></span>';\n $output .= \"<ul class=\\\"tabs secondary\\\">\\n\". $secondary .\"</ul>\\n\";\n $vars['tabs2'] = $output;\n }\n\n // Hook into color.module\n if (module_exists('color')) {\n _color_page_alter($vars);\n }\n return $vars;\n }\n return array();\n}",
"public function getSetVariables() {}",
"public function getGetVariables() {}",
"protected function get_variables_for_view()\n\t{\n\t\t$ary = array();\n\t\tforeach (get_object_vars ($this->set) as $k => $v)\n\t\t\t$ary[$k] = $v;\n\t\treturn $ary;\n\t}",
"protected function parseVariable(): void\n {\n $sBaseUrl = $this->sBaseUrl;\n\n /**\n * $getCurrentTplName is used in \"variables.inc.php\" file\n */\n $getCurrentTplName = static function () use ($sBaseUrl) {\n $aDirs = explode('/', $sBaseUrl);\n return !empty($aDirs[2]) ? $aDirs[2] : PH7_DEFAULT_THEME;\n };\n\n $this->setVariables(include('variables.inc.php'));\n }",
"public function getVars() {\n return array();\n }",
"static function getLangVars()\n\t{\n\t\treturn array(\"pc_mob\");\n\t}",
"public function getVariables ()\n {\n /**\n * Specification:\n * - itemkey used to identify variable in your other functions\n * - type text, textarea, yesno, password, hidden (type hidden are variables used by CE and are required)\n * - description description of the variable, displayed in ClientExec\n * - encryptable used to indicate the variable's value must be encrypted in the database\n */\n $variables = array(\n lang('Name') => array(\n 'type' => 'hidden',\n 'description' => lang('Used by ClientExec to display plugin. It must match the action function name(s).'),\n 'value' => 'InterWorx-CP'\n ),\n lang('Description') => array (\n 'type' => 'hidden',\n 'description' => lang('Description viewable by admin in server settings'),\n 'value' => lang('InterWorx-CP integration.')\n ),\n lang('Access Key') => array (\n 'type' => 'textarea',\n 'description' => lang('Access key used to authenticate to server.'),\n 'value' => '',\n 'encryptable' => true\n ),\n lang('Actions') => array (\n 'type' => 'hidden',\n 'description' => lang('Actions currently available for this plugin.'),\n 'value' => 'Create,Delete,Suspend,UnSuspend'\n )\n );\n\n return $variables;\n }",
"private function load_variables() : void {\n\t\t$this->today = new \\DateTime( 'NOW' );\n\t\t$this->start_date = new \\DateTime( FTW_START_DATE );\n\t\t$this->completion_date = new \\DateTime( FTW_COMPLETION_DATE );\n\t}",
"public function tracking_vars( $vars ) {\n\n\t\t$vars['itsec_away_mode'] = array(\n\t\t\t'enabled' => '0:b',\n\t\t\t'type' => '0:b',\n\t\t);\n\n\t\treturn $vars;\n\n\t}",
"function processGetVars()\n {\n //assignGetIfExists ( $fullList, NULL, 'full' );\n //$this->fullList = (bool) $fullList;\n self::dumpThis();\n }",
"public function vars()\n\t{\n\t\treturn $this->vars;\n\t}",
"public function defineConstants ()\n {\n foreach ($this->data as $key => $value) {\n define(strtoupper($key), $value);\n }\n }",
"function yy_r4(){\n $this->add_section_vars($this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + 0]->minor);\n $this->_retvalue = null;\n }",
"public function setSectionVars($sectionVars) {\n $this->sectionVars = $sectionVars;\n }",
"private function _add_vars()\n\t{\n\t\t// --------------------------------------\n\t\t// Only continue if request is a page\n\t\t// and we have segments to check\n\t\t// --------------------------------------\n\n\t\tif (empty(ee()->uri->segments) && $this->settings['set_all_segments'] == 'n') return;\n\n\t\t// --------------------------------------\n\t\t// Initiate uri instance\n\t\t// --------------------------------------\n\n\t\t$this->uri = new EE_URI;\n\t\t$this->uri->_fetch_uri_string();\n\n\t\tif ($this->settings['ignore_pagination'] == 'y')\n\t\t{\n\t\t\t// Get rid of possible pagination segment at the end\n\t\t\t$this->uri->uri_string = preg_replace('#/[PC]\\d+$#', '', $this->uri->uri_string);\n\t\t}\n\n\t\t$this->uri->_explode_segments();\n\t\t$this->uri->_reindex_segments();\n\n\t\t// --------------------------------------\n\t\t// Suggestion by Leevi Graham:\n\t\t// check for pattern before continuing\n\t\t// --------------------------------------\n\n\t\tif ( ! empty($this->settings['uri_pattern']) && ! preg_match($this->settings['uri_pattern'], $this->uri->uri_string)) return;\n\n\t\t// --------------------------------------\n\t\t// Initiate some vars\n\t\t// $data is used to add to global vars\n\t\t// $cats is used to keep track of all category ids found\n\t\t// --------------------------------------\n\n\t\t$data = $cats = array();\n\n\t\t// Also initiate this single var to an empty string\n\t\t$data['segment_category_ids'] = '';\n\t\t$data['segment_category_ids_piped'] = '';\n\n\t\t// --------------------------------------\n\t\t// Number of segments to register - 9 is hardcoded maximum\n\t\t// --------------------------------------\n\n\t\t$num_segs = ($this->settings['set_all_segments'] == 'y') ? 9 : $this->uri->total_segments();\n\n\t\t// --------------------------------------\n\t\t// loop through segments and set data array thus: segment_1_category_id etc\n\t\t// --------------------------------------\n\n\t\tfor ($nr = 1; $nr <= $num_segs; $nr++)\n\t\t{\n\t\t\tforeach ($this->fields AS $field)\n\t\t\t{\n\t\t\t\t$data[\"segment_{$nr}_{$field}\"] = '';\n\t\t\t}\n\t\t}\n\n\t\t// Initiate last segment vars\n\t\tforeach ($this->fields AS $field)\n\t\t{\n\t\t\t$data[\"last_segment_{$field}\"] = '';\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Force lowercase segment array\n\t\t// --------------------------------------\n\n\t\t$segment_array = array_map('strtolower', $this->uri->segment_array());\n\n\t\t// --------------------------------------\n\t\t// Execute the rest only if there are segments to check\n\t\t// --------------------------------------\n\n\t\tif ($segment_array)\n\t\t{\n\t\t\t// --------------------------------------\n\t\t\t// Query database for these segments\n\t\t\t// Use lowercase for case insensitive comparison,\n\t\t\t// for when DB collation is case sensitive\n\t\t\t// --------------------------------------\n\n\t\t\tee()->db->select('cat_url_title, '. implode(', ', array_keys($this->fields)))\n\t\t\t ->from('categories')\n\t\t\t ->where('site_id', $this->site_id)\n\t\t\t ->where_in('cat_url_title', $segment_array);\n\n\t\t\t// --------------------------------------\n\t\t\t// Filter by category groups set in settings\n\t\t\t// --------------------------------------\n\n\t\t\tif (isset($this->settings['category_groups']))\n\t\t\t{\n\t\t\t\tif ($groups = array_filter($this->settings['category_groups']))\n\t\t\t\t{\n\t\t\t\t\tee()->db->where_in('group_id', $groups);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// --------------------------------------\n\t\t\t// Execute query and get results\n\t\t\t// --------------------------------------\n\n\t\t\t$query = ee()->db->get();\n\n\t\t\t// --------------------------------------\n\t\t\t// If we have matching categories, continue...\n\t\t\t// --------------------------------------\n\n\t\t\tif ($query->num_rows())\n\t\t\t{\n\t\t\t\t// --------------------------------------\n\t\t\t\t// Associate the results\n\t\t\t\t// --------------------------------------\n\n\t\t\t\t$rows = $this->_associate_results($query->result_array(), 'cat_url_title');\n\n\t\t\t\t// --------------------------------------\n\t\t\t\t// Load typography if private var is set\n\t\t\t\t// --------------------------------------\n\n\t\t\t\tif ($this->format || $this->settings['parse_file_paths'] == 'y')\n\t\t\t\t{\n\t\t\t\t\tee()->load->library('typography');\n\t\t\t\t}\n\n\t\t\t\t// --------------------------------------\n\t\t\t\t// loop through segments\n\t\t\t\t// --------------------------------------\n\n\t\t\t\tforeach ($segment_array as $n => $seg)\n\t\t\t\t{\n\t\t\t\t\t// Skip non-matching segments\n\t\t\t\t\tif ( ! isset($rows[$seg])) continue;\n\n\t\t\t\t\t// Get the category row\n\t\t\t\t\t$row = $rows[$seg];\n\n\t\t\t\t\t// Overwrite values in data array\n\t\t\t\t\tforeach ($this->fields AS $name => $field)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Format category name if private var is set\n\t\t\t\t\t\tif ($name == 'cat_name' && $this->format)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$row[$name] = ee()->typography->format_characters($row[$name]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Parse file paths\n\t\t\t\t\t\tif ($name == 'cat_image' && $this->settings['parse_file_paths'] == 'y')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$row[$name] = ee()->typography->parse_file_paths($row[$name]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Set value in for segment_x_yyy\n\t\t\t\t\t\t$data[\"segment_{$n}_{$field}\"] = $row[$name];\n\t\t\t\t\t}\n\n\t\t\t\t\t// Add found id to cats array\n\t\t\t\t\t$cats[] = $row['cat_id'];\n\t\t\t\t}\n\n\t\t\t\t// --------------------------------------\n\t\t\t\t// Set last_segment_category_x vars\n\t\t\t\t// --------------------------------------\n\n\t\t\t\t$last = $this->uri->total_segments();\n\n\t\t\t\tforeach ($this->fields AS $name => $field)\n\t\t\t\t{\n\t\t\t\t\t$data['last_segment_'.$field] = $data['segment_'.$last.'_'.$field];\n\t\t\t\t}\n\n\t\t\t\t// --------------------------------------\n\t\t\t\t// Create inclusive stack of all category ids present in segments\n\t\t\t\t// --------------------------------------\n\n\t\t\t\t$data['segment_category_ids'] = implode('&',$cats);\n\t\t\t\t$data['segment_category_ids_piped'] = implode('|',$cats);\n\t\t\t}\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Finally, add data to global vars\n\t\t// Swapping $data and existing global vars makes a difference in EE2.4+\n\t\t// --------------------------------------\n\n\t\tee()->config->_global_vars = array_merge(ee()->config->_global_vars, $data);\n\t\t//ee()->config->_global_vars = array_merge($data, ee()->config->_global_vars);\n\t}",
"public function getScssVariables() {\n\t\treturn [\n\t\t\t'color-primary' => '#745bca'\n\t\t];\n\t}",
"public function getAvailableVariables() :array\n {\n return [];\n }",
"public function addVariables($tvs = array());",
"function fill_general_variables()\n\t\t{\n\t\t\t//collect error messages before\n\t\t\t$this->message[] = $this->process_monitor->get_error(false, _DEBUG);\n\t\t\t$this->fill_form_variables();\n\t\t\t$this->t->set_var(array(\n\t\t\t\t'monitor_stats'\t\t\t=> $this->fill_monitor_stats($this->stats),\n\t\t\t));\n\t\t}",
"public function getAll(): array\n {\n return $this->variables;\n }",
"public static function variables(): array\n {\n return [\n Variable::make('id', __('Article Id')),\n\n Variable::make('name', __('Article Name')),\n\n Variable::make('summary', __('Article Summary')),\n\n Variable::make('url', __('Article URL')),\n\n Variable::make('hits', __('Article Hits')),\n\n Variable::make('creation_date', __('Article Creation Date')),\n\n Variable::make('last_update', __('Article Update Date')),\n\n Variable::make('author', __('Article Author')),\n\n Variable::make('image.templateName', __(\n 'Image with the required template (example: image.common-main)'\n )),\n ];\n }",
"function repeatVars(){\n\n\t\treturn FALSE;\n\t\n}",
"public function gen_section(){\n $data = array(\n \"txtinicio\"=>\"Inicio\",\n \"rutainicio\" => \"/admin/inicio\",\n \"txtmodulo\" => \"CONTABILIDAD\",\n \"section\" => \"Contabilidad\",\n \"rutamodulo\" => \"/admin/tipocuenta\",\n \"ventana\" => \"Niveles\"\n );\n\n return $data;\n }",
"function register_globals() {\n\t\t$GLOBALS['weekday'] = $this->weekday;\n\t\t$GLOBALS['weekday_initial'] = $this->weekday_initial;\n\t\t$GLOBALS['weekday_abbrev'] = $this->weekday_abbrev;\n\t\t$GLOBALS['month'] = $this->month;\n\t\t$GLOBALS['month_abbrev'] = $this->month_abbrev;\n\t}",
"public function getGlobals()\n {\n return [\n 'cache' => $this->flextype['cache'],\n ];\n }",
"public function read($section) {\n $values = parent::read($section);\n\n switch ($section) {\n case 'smarty':\n if (!array_key_exists('compile', $values)) {\n $values['compile'] = array();\n }\n\n $values['compile']['directory'] = Module::getTempDirectory('smarty')->getPath();\n\n break;\n case 'system':\n if (!array_key_exists('session', $values)) {\n $values['session'] = array();\n }\n\n $values['session']['path'] = Module::getTempDirectory('session')->getPath();\n\n break;\n }\n\n return $values;\n }",
"public function define_sections() {\r\n\t\t$this->options->sections = $this->to_array();\n\t}",
"public static function addVars($arr){\n self::$vars = array_merge(self::$vars, $arr);\n }",
"protected static function initializeGlobalVariables() {}",
"public function getCookieVariables();",
"public static function varint() {}",
"function get_less_variables($instance){\n\t\t$less_vars = array();\n\t\tif(isset($instance[\"background_color\"])) $less_vars[\"background_color\"] = $instance[\"background_color\"];\n\t\treturn $less_vars;\n\t}",
"public function updateVaribles(){\n foreach( $this->globalVars as $key=>$val ){\n $this->template = str_replace( '%'. $key .'%', $val, $this->template );\n }\n }",
"public function vars()\n {\n return $this->vars;\n }",
"public function getGlobals();",
"public function getGlobals();",
"function associateVariablesWithBlocks() {\n $varRefNo = 0;\n $activeBlockNo = 0;\n $nextBlockNo = 1;\n while ($varRefNo < $this->varRefTabCnt) {\n $vrtr =& $this->varRefTab[$varRefNo];\n $varRefTPos = $vrtr['tPosBegin'];\n $varNo = $vrtr['varNo'];\n if ($varRefTPos >= $this->blockTab[$activeBlockNo]['tPosEnd']) {\n $activeBlockNo = $this->blockTab[$activeBlockNo]['parentBlockNo'];\n continue; }\n if ($nextBlockNo < $this->blockTabCnt) {\n if ($varRefTPos >= $this->blockTab[$nextBlockNo]['tPosBegin']) {\n $activeBlockNo = $nextBlockNo;\n $nextBlockNo += 1;\n continue; }}\n $btr =& $this->blockTab[$activeBlockNo];\n if ($varRefTPos < $btr['tPosBegin'])\n $this->programLogicError(1);\n $blockVarNo = $btr['blockVarCnt']++;\n $btr['blockVarNoToVarNoMap'][$blockVarNo] = $varNo;\n if ($btr['firstVarRefNo'] == -1)\n $btr['firstVarRefNo'] = $varRefNo;\n $vrtr['blockNo'] = $activeBlockNo;\n $vrtr['blockVarNo'] = $blockVarNo;\n $varRefNo += 1; }}",
"function setup_vars() {\r\n\t\t$this->post_type = get_current_screen()->post_type;\r\n\t\t$this->taxonomies = array_diff(get_object_taxonomies($this->post_type), get_taxonomies(array('show_admin_column' => 'false')));\r\n\t}",
"public function get_var() {\r\n\t\treturn $this->header_vars;\r\n\t}",
"public function getVariablesList() {\n return $this->_get(4);\n }",
"function settings_section() {\n\t\t}",
"function get_vars($id,$showLimit,$rperm,$cperm,$tzone,$uname){\n\t\t$this->id = $id;\n\t\t$this->showLimit = $showLimit;\n\t\t$this->rperm = $rperm;\n\t\t$this->cperm = $cperm;\n\t\t$this->tzone = $tzone;\n\t\t$this->uname = $uname;\n\t}",
"public function getVars(){\n return $this->getClassVars()->getValues();\n }",
"private function initVars()\n {\n // template array variables\n $this->tplVar['art_pubdate'] = array();\n $this->tplVar['art_modifydate'] = array();\n }",
"public function parse($global_vars = array())\n {}",
"public function testListTaskVariables()\n {\n }",
"public function getVariablesList() {\n return $this->_get(2);\n }",
"function parse_vars($match)\r\n\t{\r\n\t\t$tvar = $match[1];\r\n\t\tglobal $$tvar;\r\n\t\tif (key_exists($tvar, $this->vars)) return $this->vars[$tvar];\r\n\t\telse if (isset($$tvar)) return $$tvar;\r\n\t\telse if (defined($tvar)) return constant($tvar);\r\n\t\telse if ($this->use_getvar) return GetVar($tvar);\r\n\t\treturn $match[0];\r\n\t}",
"public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n\n $this->vars['model'] = $this->model;\n $this->vars['category'] = Kategory::where(\"is_active\", \"1\")->lists('name', 'id');\n if (!empty($this->getLoadValue())) {\n $a= $this->vars['value'] = $this->getLoadValue();\n } else {\n $a= $this->vars['value'] = [];\n }\n }",
"function repeatVars(){\n\n\n\n\treturn FALSE;\n\n}",
"public function register_globals() {\n\t\t$GLOBALS['weekday'] = $this->weekday;\n\t\t$GLOBALS['weekday_initial'] = $this->weekday_initial;\n\t\t$GLOBALS['weekday_abbrev'] = $this->weekday_abbrev;\n\t\t$GLOBALS['month'] = $this->month;\n\t\t$GLOBALS['month_abbrev'] = $this->month_abbrev;\n\t}",
"function haira_setup_scss_vars ($contents, $custom_vars) {\n $linenum = 0;\n foreach($contents as $key=>$line)\n {\n if (preg_match('/[ ]*([\\/]{2})?[ ]*(.*?):(.*?);/is', $line, $matches))\n { \n $varName = trim(substr($matches[2], 1));\n $varValue = $matches[3];\n \n if ( isset ( $custom_vars[$varName] ) && $custom_vars[$varName] != '' ) {\n $contents[ $key ] = '$' . $varName . ': ' . $custom_vars[ $varName ] . \";\\n\";\n }\n \n }\n }\n\n return implode($contents);\n\n}",
"function getVars() {\n return $this->vars;\n }",
"public function getVariableHarmonizationsList() {\n return $this->_get(4);\n }",
"public static function variables(): array\n {\n return [ \n Variable::make('method', __('Login form method')), \n Variable::make('action', __('Login form action')), \n Variable::make('token_field', __('Name of the csrf_token field')), \n Variable::make('token_value', __('The csrf_token field value')), \n Variable::make('widget_field', __('Name of the widget field')), \n Variable::make('widget_value', __('The widget field value')), \n\n Variable::make('username_field', __('Name of the username/email field')), \n Variable::make('username_error', __('The username/email field error')), \n Variable::make('username_value', __('The username/email field old value')), \n\n Variable::make('password_field', __('Name of the password field')), \n Variable::make('password_error', __('The password field error')), \n\n Variable::make('remember_field', __('Name of the remember field')), \n Variable::make('remember_checked', __('The remember field checked status')), \n Variable::make('registration_page', __('The registration page url')), \n ];\n }",
"public function get_vb_data ($vars = array());",
"public function get_macros () {\n\t\treturn array(\n\t\t\t'site_name' => get_bloginfo('name', 'display'),\n\t\t\t'site_description' => get_bloginfo('description', 'display'),\n\t\t);\n\t}",
"public function _js_vars()\n {\n }",
"private function getGood()\n {\n return [\n SectionType::FIELD_SECTION_TYPE => 'Llamas',\n SectionType::FIELD_SECTION_TYPE_CODE => 'l',\n ];\n }",
"public function getVars(Horde_Variables &$vars)\n {\n $vars->set('search_pattern', $this->_search);\n $vars->set('search_tags', implode(',', $this->_tags));\n $vars->set('search_completed', $this->_completed);\n $vars->set('due_within', $this->_due[0]);\n $vars->set('due_of', $this->_due[1]);\n\n $mask = array();\n if ($this->_mask & self::MASK_NAME) {\n $mask[] = 'search_name';\n }\n if ($this->_mask & self::MASK_DESC) {\n $mask[] = 'search_desc';\n }\n if (!empty($mask)) {\n $vars->set('search_in', $mask);\n }\n }",
"public static function defines()\n {\n define('STRUCTURE_DATA' , self::data());\n define('CURRENT_COPEN_PAGE' , STRUCTURE_DATA['openFunction']);\n define('CURRENT_CFPARAMETERS', STRUCTURE_DATA['parameters']);\n define('CURRENT_CFILE' , STRUCTURE_DATA['file']);\n define('CURRENT_CFUNCTION' , STRUCTURE_DATA['function']);\n define('CURRENT_CPAGE' , ($page = STRUCTURE_DATA['page']) . '.php');\n define('CURRENT_CONTROLLER' , $page);\n define('CURRENT_CNAMESPACE' , $namespace = STRUCTURE_DATA['namespace'] );\n define('CURRENT_CCLASS' , $namespace . CURRENT_CONTROLLER);\n define('CURRENT_CFPATH' , str_replace\n (\n CONTROLLERS_DIR, '', CURRENT_CONTROLLER) . '/' . CURRENT_CFUNCTION\n );\n define('CURRENT_CFURI' , strtolower(CURRENT_CFPATH));\n define('CURRENT_CFURL' , Request::getSiteURL() . CURRENT_CFPATH);\n }",
"public function getVars()\n\t{\n\t\treturn $this->vars;\n\t}",
"function reset_vars() {\n $this->page[\"Name\"] = \"\";\n $this->page[\"Bio\"] = \"\";\n\n // \"Name\" page:\n $this->main_photo = \"\";\n $this->fullname = \"\";\n $this->birthday = array();\n $this->actorsfilms = array();\n $this->producersfilms = array();\n $this->soundtrackfilms = array();\n $this->directorsfilms = array();\n $this->crewsfilms = array();\n $this->thanxfilms = array();\n $this->selffilms = array();\n $this->archivefilms = array();\n\n // \"Bio\" page:\n $this->birth_name = \"\";\n $this->nick_name = array();\n $this->bodyheight = array();\n $this->bio_bio = array();\n $this->bio_trivia = array();\n $this->bio_tm = array();\n $this->bio_salary = array();\n }",
"public function outputCssVariablesInline(): void\n\t{\n\t\techo Components::outputCssVariablesInline(); // phpcs:ignore\n\t}",
"function css_variables(/*group, value, value, value = array()*/)\n{\n\t$CI = &get_instance();\n\t// get args\n\t$args = func_get_args();\n\tif(count($args) == 1)\n\t{\n\t\t$args = $args[0];\n\t}\n\t// assign args to class\n\t$CI->css->variables($args);\n}",
"public function GetRawAll()\n {\n $result = [];\n foreach ($this->vars as $key => $section) {\n $result[ $key ] = $this->GetRawKeys($key);\n }\n return $result;\n }",
"function varInfo(...$vars)\n {\n return (new VarDump(...$vars))->toString();\n }",
"public function getVars()\n {\n return $this->vars;\n }",
"public function itsec_tracking_vars( $vars ) {\n\n\t\t$vars['itsec_online_files'] = array(\n\t\t\t'enabled' => '0:b',\n\t\t);\n\n\t\treturn $vars;\n\n\t}",
"function _getSectionTypes()\n {\n return array(\n ST_NORMAL => \"Běžná sekce\",\n ST_TASKS => \"Úkoly (česky)\",\n ST_TASKS_EN => \"Úkoly (anglicky)\",\n ST_URLS => \"Odkazy\",\n ST_DOWNLOAD => \"Download\",\n ST_EXCLIST => \"Seznam cvičení\",\n ST_PHYLAB => \"Laboratorní cvičení\"\n );\n }",
"public function tracking_vars( $vars ) {\n\n\t\t$vars['content_directory'] = array(\n\t\t\t'enabled' => '0:b',\n\t\t);\n\n\t\treturn $vars;\n\n\t}",
"protected function _initInternVariables ()\n {\n parent::_initInternVariables();\n \n $this->levels = array ();\n $this->sep = $this->_element->getSeparator();\n $this->display_tag = $this->_element->getTagdisplay();\n $this->tag_label = $this->_element->getTaglabel();\n }"
]
| [
"0.60431087",
"0.6006659",
"0.5930524",
"0.58230215",
"0.57793856",
"0.57793856",
"0.56728745",
"0.564239",
"0.56279534",
"0.5559322",
"0.55454344",
"0.55443263",
"0.54524994",
"0.5447305",
"0.5445486",
"0.5407771",
"0.53315496",
"0.53306854",
"0.5322643",
"0.530611",
"0.5280094",
"0.52526337",
"0.52487814",
"0.522029",
"0.5218332",
"0.5216409",
"0.5211873",
"0.5208554",
"0.5204766",
"0.5202993",
"0.5201355",
"0.5196693",
"0.51925874",
"0.5189625",
"0.51786447",
"0.517587",
"0.51316804",
"0.51310676",
"0.5129722",
"0.5094451",
"0.5092925",
"0.50876886",
"0.50843155",
"0.50696045",
"0.50648534",
"0.5053267",
"0.503012",
"0.5029389",
"0.500084",
"0.49856195",
"0.49790576",
"0.49707013",
"0.4966899",
"0.4964105",
"0.4960021",
"0.49536365",
"0.49530244",
"0.4941941",
"0.4933448",
"0.49327096",
"0.4931788",
"0.49288717",
"0.49281716",
"0.4927085",
"0.4927085",
"0.49254525",
"0.4923311",
"0.49205303",
"0.49201983",
"0.49124113",
"0.49122515",
"0.49079245",
"0.4903485",
"0.4891186",
"0.48813614",
"0.48763165",
"0.48756868",
"0.48750418",
"0.4874751",
"0.48718005",
"0.48535204",
"0.48532596",
"0.48409706",
"0.48389506",
"0.48343638",
"0.48319826",
"0.4827083",
"0.48265606",
"0.48251307",
"0.48226583",
"0.48205543",
"0.4816553",
"0.481542",
"0.481146",
"0.48063284",
"0.48043972",
"0.47938278",
"0.4788256",
"0.47778165",
"0.47751093",
"0.47732398"
]
| 0.0 | -1 |
/ / Enum all vars in the section / | public function GetRawKeys($section)
{
$result = [];
$tmpArray = Util::GetAttribute($this->vars, $section, []);
foreach ($tmpArray as $key => $value) {
$newValue = $this->GetRaw($section, $key, "");
$result[ $key ] = $newValue;
}
return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function loadVars(){\n\t\tif(!self::$vars){\n\t\t\tself::$vars = self::getDefaultVars();\n\t\t}\n\t\tforeach(func_get_args() as $arg){\n\t\t\tforeach($arg as $key=> $value){\n\t\t\t\tself::$vars[$key] = self::fillTokens($value);\n\t\t\t}\n\t\t}\n\t\treturn self::$vars;\n\t}",
"public function GetSections()\n {\n return array_keys($this->vars);\n }",
"static function getLangVars()\n\t{\n\t\treturn array(\"pc_vacc\", \"pc_hacc\");\n\t}",
"private function loadSesionVars() {\r\n\r\n $this->VARS = array(); \r\n\r\n $this->updateSessionExpireTime();\r\n\r\n $dati = $this->selectSessionVars();\r\n\r\n foreach($dati as $infos) { \r\n $this->VARS[$infos[\"name\"]]=unserialize($infos[\"value\"]);\r\n }\r\n\r\n }",
"public function variables(): array;",
"public function variables(): array;",
"protected function initVars() {\n\n\t\t}",
"public function exportedVars(): iterable;",
"function dumpInfo() {\n global $_dOp;\n $op = \"SECTION: $this->sectionName<br />\";\n $_dOp = '';\n foreach ($this->varList as $secID => $vars) {\n $op .= \" -- section ID: $secID<br />\";\n foreach ($vars as $varKey => $varTag) {\n if (is_array($varTag)) {\n foreach ($varTag as $varObj) {\n $op .= \" .... VAR: $varKey<br />\\n\";\n $aList = $varObj->getAttrList();\n foreach ($aList as $attr) {\n if ($attr == 'NAME')\n continue;\n $v = $varObj->getAttr($attr);\n if ($v === false)\n $v = 'false';\n if ($v === true)\n $v = 'true';\n if ($v === NULL)\n $v = '[not set]';\n \n $op .= \"........ $attr => \".$v.\"<br />\\n\";\n }\n }\n }\n else {\n $op .= \" .... VAR: $varKey<br />\\n\";\n $aList = $varTag->getAttrList();\n foreach ($aList as $attr) {\n if ($attr == 'NAME')\n continue;\n $v = $varTag->getAttr($attr);\n if ($v === false)\n $v = 'false';\n if ($v === true)\n $v = 'true';\n if ($v === NULL)\n $v = '[not set]';\n $op .= \"........ $attr => \".$v.\"<br />\\n\";\n }\n }\n }\n }\n return $op;\n }",
"public function GetAll()\n {\n $result = [];\n foreach ($this->vars as $key => $section) {\n $result[ $key ] = $this->GetKeys($key);\n }\n return $result;\n }",
"function values( $vars ) {\n foreach($vars as $k=>$v) {\n $this->_vars[\"$k\"] = $v;\n }\n }",
"public function vars()\n {\n return array_merge(parent::vars(), [\n 'user' => (string) $this->key->sysuser ? $this->key->sysuser->name : 'sitepilot',\n 'key' => (string) $this->key->key\n ]);\n }",
"public function getVariables()\n {\n \treturn isset($this->all['variables']) ? $this->all['variables'] : array();\n }",
"function import_record_vars() {\r\n while (list($key, $val) = each($this->Record))\r\n if (ereg(\"[A-Za-z][A-Za-z0-9_]*\", $key)) {\r\n $field_name = strtoupper($key); \r\n\t global $$field_name;\r\n\t $$field_name=$val;\r\n }; \r\n }",
"public function type_vars( ){\n\t\t\n\t\tglobal $disabled_settings;\n\t\t$alt = false;\n\t\tif ( is_array( $disabled_settings ) )\n\t\t\tif( !empty( $disabled_settings['typography'] ) )\n\t\t\t\t$alt = true;\n\t\t\n\t\t$vars = array(\n\t\t\t'plBaseFont'\t\t=> ($alt) ? '\"Helvetica\" Arial, serif' : pl_type_el('type_primary', 'stack'), \n\t\t\t'plBaseWeight'\t\t=> pl_type_el('type_primary', 'weight'), \n\t\t\t'plAltFont'\t\t\t=> ($alt) ? '\"Helvetica\" Arial, serif' : pl_type_el('type_secondary', 'stack'), \n\t\t\t'plAltWeight'\t\t=> pl_type_el('type_secondary', 'weight'), \n\t\t\t'plHeaderFont'\t\t=> ($alt) ? '\"Helvetica\" Arial, serif' : pl_type_el('type_headers', 'stack'), \n\t\t\t'plHeaderWeight'\t=> pl_type_el('type_headers', 'weight'),\n\t\t);\n\t\treturn $vars;\n\t}",
"protected function init()\n {\n $arVariablesExtend = Event::fire(self::EVENT_EXTEND_VARIABLES, []);\n\n foreach ($arVariablesExtend as $iIndex => $arExtend)\n {\n foreach ($arExtend as $sKey => $arVariable) {\n if (in_array($sKey, $this->arVariables)) {\n continue;\n }\n\n // Add to variables\n $this->arVariables[$sKey] = $arVariable;\n }\n }\n }",
"public function getVariables(): Mailcode_Variables_Collection_Regular;",
"public function getVars() {\r\n return $this->VARS;\r\n }",
"public function get_vars()\n\t{\n\t\treturn array(\"TsvOneFile\");\n\t}",
"public function config_vars()\n\t{\n\t\tglobal $txt;\n\n\t\t$return_data = array();\n\n\t\t$core_features = $this->settings();\n\n\t\t// Convert this to a format that admin search will understand\n\t\tforeach ($core_features as $id => $data)\n\t\t{\n\t\t\t$return_data[] = array('switch', $data['title'] ?? $txt['core_settings_item_' . $id]);\n\t\t}\n\n\t\treturn $return_data;\n\t}",
"public function getHeaderFooterVariables() {\n\t\t$vars = $this->request->getVars();\n\n\t\tunset(\n\t\t\t$vars['url'],\n\t\t\t$vars['flushtoken'],\n\t\t\t$vars['flush']\n\t\t);\n\n\t\tif (isset($vars['page']) && strpos($vars['page'], '§ion=') !== false) {\n\t\t\t$parts = explode('§', $vars['page']);\n\t\t\t$vars['page'] = $parts[0];\n\t\t\t$vars['section'] = str_replace('ion=', '', $parts[1]);\n\t\t}\n\n\t\t$string = '';\n\n\t\tforeach ($vars as $key => $value) {\n\t\t\t$string .= '<strong style=\"color: red;\">$' . $key . '</strong> => ' . $value . '<br>';\n\t\t}\n\n\t\t$htmlString = DBHTMLText::create();\n\t\t$htmlString->setValue($string);\n\n\t\t$vars['all_variables'] = $htmlString;\n\n\t\treturn $vars;\n\t}",
"public function initVarfromDefs() {\n foreach ($this->extconfigs->getextConfig('sccpDefaults') as $key => $value) {\n if (empty($this->sccpvalues[$key])) {\n $this->sccpvalues[$key] = array('keyword' => $key, 'data' => $value, 'type' => '0', 'seq' => '0');\n }\n }\n }",
"function getVariableContainer() ;",
"public function __getVars(){\r\n $vars = isset($this->vars)? $this->vars:array();\r\n return $vars;\r\n }",
"public function getGetVariables();",
"function asp_parse_options() {\r\r\n foreach ( wd_asp()->o as $def_k => $o ) {\r\r\n if ( preg_match(\"/\\_def$/\", $def_k) ) {\r\r\n $ok = preg_replace(\"/\\_def$/\", '', $def_k);\r\r\n\r\r\n // Dang, I messed up this elegant solution..\r\r\n if ( $ok == \"asp_it\")\r\r\n $ok = \"asp_it_options\";\r\r\n\r\r\n wd_asp()->o[$ok] = asp_decode_params( get_option($ok, wd_asp()->o[$def_k]) );\r\r\n wd_asp()->o[$ok] = array_merge(wd_asp()->o[$def_k], wd_asp()->o[$ok]);\r\r\n }\r\r\n }\r\r\n // Long previous version compatibility\r\r\n if ( wd_asp()->o['asp_caching'] === false )\r\r\n wd_asp()->o['asp_caching'] = wd_asp()->o['asp_caching_def'];\r\r\n\r\r\n // The globals are a sitewide options\r\r\n wd_asp()->o['asp_glob'] = get_site_option('asp_glob', wd_asp()->o['asp_glob_d']);\r\r\n wd_asp()->o['asp_glob'] = array_merge(wd_asp()->o['asp_glob_d'], wd_asp()->o['asp_glob']);\r\r\n}",
"public static function variables(): array\n {\n return [\n Variable::make('sorts', __('Array of available sorting')),\n\n Variable::make('directions', __('Array of sort directions')),\n\n Variable::make('items', __('HTML generated of blog items')),\n\n Variable::make('pagination', __('HTML generated of pagination links')),\n ];\n }",
"protected function GetDescriptionVariables()\n {\n return array();\n }",
"public function getSetVariables() {}",
"function _phptemplate_variables($hook, $vars) {\n if ($hook == 'page') {\n\n if ($secondary = menu_secondary_local_tasks()) {\n $output = '<span class=\"clear\"></span>';\n $output .= \"<ul class=\\\"tabs secondary\\\">\\n\". $secondary .\"</ul>\\n\";\n $vars['tabs2'] = $output;\n }\n\n // Hook into color.module\n if (module_exists('color')) {\n _color_page_alter($vars);\n }\n return $vars;\n }\n return array();\n}",
"public function getGetVariables() {}",
"protected function get_variables_for_view()\n\t{\n\t\t$ary = array();\n\t\tforeach (get_object_vars ($this->set) as $k => $v)\n\t\t\t$ary[$k] = $v;\n\t\treturn $ary;\n\t}",
"protected function parseVariable(): void\n {\n $sBaseUrl = $this->sBaseUrl;\n\n /**\n * $getCurrentTplName is used in \"variables.inc.php\" file\n */\n $getCurrentTplName = static function () use ($sBaseUrl) {\n $aDirs = explode('/', $sBaseUrl);\n return !empty($aDirs[2]) ? $aDirs[2] : PH7_DEFAULT_THEME;\n };\n\n $this->setVariables(include('variables.inc.php'));\n }",
"public function getVars() {\n return array();\n }",
"static function getLangVars()\n\t{\n\t\treturn array(\"pc_mob\");\n\t}",
"public function getVariables ()\n {\n /**\n * Specification:\n * - itemkey used to identify variable in your other functions\n * - type text, textarea, yesno, password, hidden (type hidden are variables used by CE and are required)\n * - description description of the variable, displayed in ClientExec\n * - encryptable used to indicate the variable's value must be encrypted in the database\n */\n $variables = array(\n lang('Name') => array(\n 'type' => 'hidden',\n 'description' => lang('Used by ClientExec to display plugin. It must match the action function name(s).'),\n 'value' => 'InterWorx-CP'\n ),\n lang('Description') => array (\n 'type' => 'hidden',\n 'description' => lang('Description viewable by admin in server settings'),\n 'value' => lang('InterWorx-CP integration.')\n ),\n lang('Access Key') => array (\n 'type' => 'textarea',\n 'description' => lang('Access key used to authenticate to server.'),\n 'value' => '',\n 'encryptable' => true\n ),\n lang('Actions') => array (\n 'type' => 'hidden',\n 'description' => lang('Actions currently available for this plugin.'),\n 'value' => 'Create,Delete,Suspend,UnSuspend'\n )\n );\n\n return $variables;\n }",
"function processGetVars()\n {\n //assignGetIfExists ( $fullList, NULL, 'full' );\n //$this->fullList = (bool) $fullList;\n self::dumpThis();\n }",
"public function tracking_vars( $vars ) {\n\n\t\t$vars['itsec_away_mode'] = array(\n\t\t\t'enabled' => '0:b',\n\t\t\t'type' => '0:b',\n\t\t);\n\n\t\treturn $vars;\n\n\t}",
"private function load_variables() : void {\n\t\t$this->today = new \\DateTime( 'NOW' );\n\t\t$this->start_date = new \\DateTime( FTW_START_DATE );\n\t\t$this->completion_date = new \\DateTime( FTW_COMPLETION_DATE );\n\t}",
"public function vars()\n\t{\n\t\treturn $this->vars;\n\t}",
"public function defineConstants ()\n {\n foreach ($this->data as $key => $value) {\n define(strtoupper($key), $value);\n }\n }",
"function yy_r4(){\n $this->add_section_vars($this->yystack[$this->yyidx + -3]->minor, $this->yystack[$this->yyidx + 0]->minor);\n $this->_retvalue = null;\n }",
"public function setSectionVars($sectionVars) {\n $this->sectionVars = $sectionVars;\n }",
"private function _add_vars()\n\t{\n\t\t// --------------------------------------\n\t\t// Only continue if request is a page\n\t\t// and we have segments to check\n\t\t// --------------------------------------\n\n\t\tif (empty(ee()->uri->segments) && $this->settings['set_all_segments'] == 'n') return;\n\n\t\t// --------------------------------------\n\t\t// Initiate uri instance\n\t\t// --------------------------------------\n\n\t\t$this->uri = new EE_URI;\n\t\t$this->uri->_fetch_uri_string();\n\n\t\tif ($this->settings['ignore_pagination'] == 'y')\n\t\t{\n\t\t\t// Get rid of possible pagination segment at the end\n\t\t\t$this->uri->uri_string = preg_replace('#/[PC]\\d+$#', '', $this->uri->uri_string);\n\t\t}\n\n\t\t$this->uri->_explode_segments();\n\t\t$this->uri->_reindex_segments();\n\n\t\t// --------------------------------------\n\t\t// Suggestion by Leevi Graham:\n\t\t// check for pattern before continuing\n\t\t// --------------------------------------\n\n\t\tif ( ! empty($this->settings['uri_pattern']) && ! preg_match($this->settings['uri_pattern'], $this->uri->uri_string)) return;\n\n\t\t// --------------------------------------\n\t\t// Initiate some vars\n\t\t// $data is used to add to global vars\n\t\t// $cats is used to keep track of all category ids found\n\t\t// --------------------------------------\n\n\t\t$data = $cats = array();\n\n\t\t// Also initiate this single var to an empty string\n\t\t$data['segment_category_ids'] = '';\n\t\t$data['segment_category_ids_piped'] = '';\n\n\t\t// --------------------------------------\n\t\t// Number of segments to register - 9 is hardcoded maximum\n\t\t// --------------------------------------\n\n\t\t$num_segs = ($this->settings['set_all_segments'] == 'y') ? 9 : $this->uri->total_segments();\n\n\t\t// --------------------------------------\n\t\t// loop through segments and set data array thus: segment_1_category_id etc\n\t\t// --------------------------------------\n\n\t\tfor ($nr = 1; $nr <= $num_segs; $nr++)\n\t\t{\n\t\t\tforeach ($this->fields AS $field)\n\t\t\t{\n\t\t\t\t$data[\"segment_{$nr}_{$field}\"] = '';\n\t\t\t}\n\t\t}\n\n\t\t// Initiate last segment vars\n\t\tforeach ($this->fields AS $field)\n\t\t{\n\t\t\t$data[\"last_segment_{$field}\"] = '';\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Force lowercase segment array\n\t\t// --------------------------------------\n\n\t\t$segment_array = array_map('strtolower', $this->uri->segment_array());\n\n\t\t// --------------------------------------\n\t\t// Execute the rest only if there are segments to check\n\t\t// --------------------------------------\n\n\t\tif ($segment_array)\n\t\t{\n\t\t\t// --------------------------------------\n\t\t\t// Query database for these segments\n\t\t\t// Use lowercase for case insensitive comparison,\n\t\t\t// for when DB collation is case sensitive\n\t\t\t// --------------------------------------\n\n\t\t\tee()->db->select('cat_url_title, '. implode(', ', array_keys($this->fields)))\n\t\t\t ->from('categories')\n\t\t\t ->where('site_id', $this->site_id)\n\t\t\t ->where_in('cat_url_title', $segment_array);\n\n\t\t\t// --------------------------------------\n\t\t\t// Filter by category groups set in settings\n\t\t\t// --------------------------------------\n\n\t\t\tif (isset($this->settings['category_groups']))\n\t\t\t{\n\t\t\t\tif ($groups = array_filter($this->settings['category_groups']))\n\t\t\t\t{\n\t\t\t\t\tee()->db->where_in('group_id', $groups);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// --------------------------------------\n\t\t\t// Execute query and get results\n\t\t\t// --------------------------------------\n\n\t\t\t$query = ee()->db->get();\n\n\t\t\t// --------------------------------------\n\t\t\t// If we have matching categories, continue...\n\t\t\t// --------------------------------------\n\n\t\t\tif ($query->num_rows())\n\t\t\t{\n\t\t\t\t// --------------------------------------\n\t\t\t\t// Associate the results\n\t\t\t\t// --------------------------------------\n\n\t\t\t\t$rows = $this->_associate_results($query->result_array(), 'cat_url_title');\n\n\t\t\t\t// --------------------------------------\n\t\t\t\t// Load typography if private var is set\n\t\t\t\t// --------------------------------------\n\n\t\t\t\tif ($this->format || $this->settings['parse_file_paths'] == 'y')\n\t\t\t\t{\n\t\t\t\t\tee()->load->library('typography');\n\t\t\t\t}\n\n\t\t\t\t// --------------------------------------\n\t\t\t\t// loop through segments\n\t\t\t\t// --------------------------------------\n\n\t\t\t\tforeach ($segment_array as $n => $seg)\n\t\t\t\t{\n\t\t\t\t\t// Skip non-matching segments\n\t\t\t\t\tif ( ! isset($rows[$seg])) continue;\n\n\t\t\t\t\t// Get the category row\n\t\t\t\t\t$row = $rows[$seg];\n\n\t\t\t\t\t// Overwrite values in data array\n\t\t\t\t\tforeach ($this->fields AS $name => $field)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Format category name if private var is set\n\t\t\t\t\t\tif ($name == 'cat_name' && $this->format)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$row[$name] = ee()->typography->format_characters($row[$name]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Parse file paths\n\t\t\t\t\t\tif ($name == 'cat_image' && $this->settings['parse_file_paths'] == 'y')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$row[$name] = ee()->typography->parse_file_paths($row[$name]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Set value in for segment_x_yyy\n\t\t\t\t\t\t$data[\"segment_{$n}_{$field}\"] = $row[$name];\n\t\t\t\t\t}\n\n\t\t\t\t\t// Add found id to cats array\n\t\t\t\t\t$cats[] = $row['cat_id'];\n\t\t\t\t}\n\n\t\t\t\t// --------------------------------------\n\t\t\t\t// Set last_segment_category_x vars\n\t\t\t\t// --------------------------------------\n\n\t\t\t\t$last = $this->uri->total_segments();\n\n\t\t\t\tforeach ($this->fields AS $name => $field)\n\t\t\t\t{\n\t\t\t\t\t$data['last_segment_'.$field] = $data['segment_'.$last.'_'.$field];\n\t\t\t\t}\n\n\t\t\t\t// --------------------------------------\n\t\t\t\t// Create inclusive stack of all category ids present in segments\n\t\t\t\t// --------------------------------------\n\n\t\t\t\t$data['segment_category_ids'] = implode('&',$cats);\n\t\t\t\t$data['segment_category_ids_piped'] = implode('|',$cats);\n\t\t\t}\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Finally, add data to global vars\n\t\t// Swapping $data and existing global vars makes a difference in EE2.4+\n\t\t// --------------------------------------\n\n\t\tee()->config->_global_vars = array_merge(ee()->config->_global_vars, $data);\n\t\t//ee()->config->_global_vars = array_merge($data, ee()->config->_global_vars);\n\t}",
"public function getScssVariables() {\n\t\treturn [\n\t\t\t'color-primary' => '#745bca'\n\t\t];\n\t}",
"public function getAvailableVariables() :array\n {\n return [];\n }",
"public function addVariables($tvs = array());",
"function fill_general_variables()\n\t\t{\n\t\t\t//collect error messages before\n\t\t\t$this->message[] = $this->process_monitor->get_error(false, _DEBUG);\n\t\t\t$this->fill_form_variables();\n\t\t\t$this->t->set_var(array(\n\t\t\t\t'monitor_stats'\t\t\t=> $this->fill_monitor_stats($this->stats),\n\t\t\t));\n\t\t}",
"public function getAll(): array\n {\n return $this->variables;\n }",
"public static function variables(): array\n {\n return [\n Variable::make('id', __('Article Id')),\n\n Variable::make('name', __('Article Name')),\n\n Variable::make('summary', __('Article Summary')),\n\n Variable::make('url', __('Article URL')),\n\n Variable::make('hits', __('Article Hits')),\n\n Variable::make('creation_date', __('Article Creation Date')),\n\n Variable::make('last_update', __('Article Update Date')),\n\n Variable::make('author', __('Article Author')),\n\n Variable::make('image.templateName', __(\n 'Image with the required template (example: image.common-main)'\n )),\n ];\n }",
"function repeatVars(){\n\n\t\treturn FALSE;\n\t\n}",
"function register_globals() {\n\t\t$GLOBALS['weekday'] = $this->weekday;\n\t\t$GLOBALS['weekday_initial'] = $this->weekday_initial;\n\t\t$GLOBALS['weekday_abbrev'] = $this->weekday_abbrev;\n\t\t$GLOBALS['month'] = $this->month;\n\t\t$GLOBALS['month_abbrev'] = $this->month_abbrev;\n\t}",
"public function gen_section(){\n $data = array(\n \"txtinicio\"=>\"Inicio\",\n \"rutainicio\" => \"/admin/inicio\",\n \"txtmodulo\" => \"CONTABILIDAD\",\n \"section\" => \"Contabilidad\",\n \"rutamodulo\" => \"/admin/tipocuenta\",\n \"ventana\" => \"Niveles\"\n );\n\n return $data;\n }",
"public function getGlobals()\n {\n return [\n 'cache' => $this->flextype['cache'],\n ];\n }",
"public function read($section) {\n $values = parent::read($section);\n\n switch ($section) {\n case 'smarty':\n if (!array_key_exists('compile', $values)) {\n $values['compile'] = array();\n }\n\n $values['compile']['directory'] = Module::getTempDirectory('smarty')->getPath();\n\n break;\n case 'system':\n if (!array_key_exists('session', $values)) {\n $values['session'] = array();\n }\n\n $values['session']['path'] = Module::getTempDirectory('session')->getPath();\n\n break;\n }\n\n return $values;\n }",
"public static function addVars($arr){\n self::$vars = array_merge(self::$vars, $arr);\n }",
"public function define_sections() {\r\n\t\t$this->options->sections = $this->to_array();\n\t}",
"protected static function initializeGlobalVariables() {}",
"public static function varint() {}",
"public function getCookieVariables();",
"function get_less_variables($instance){\n\t\t$less_vars = array();\n\t\tif(isset($instance[\"background_color\"])) $less_vars[\"background_color\"] = $instance[\"background_color\"];\n\t\treturn $less_vars;\n\t}",
"public function updateVaribles(){\n foreach( $this->globalVars as $key=>$val ){\n $this->template = str_replace( '%'. $key .'%', $val, $this->template );\n }\n }",
"public function vars()\n {\n return $this->vars;\n }",
"public function getGlobals();",
"public function getGlobals();",
"function associateVariablesWithBlocks() {\n $varRefNo = 0;\n $activeBlockNo = 0;\n $nextBlockNo = 1;\n while ($varRefNo < $this->varRefTabCnt) {\n $vrtr =& $this->varRefTab[$varRefNo];\n $varRefTPos = $vrtr['tPosBegin'];\n $varNo = $vrtr['varNo'];\n if ($varRefTPos >= $this->blockTab[$activeBlockNo]['tPosEnd']) {\n $activeBlockNo = $this->blockTab[$activeBlockNo]['parentBlockNo'];\n continue; }\n if ($nextBlockNo < $this->blockTabCnt) {\n if ($varRefTPos >= $this->blockTab[$nextBlockNo]['tPosBegin']) {\n $activeBlockNo = $nextBlockNo;\n $nextBlockNo += 1;\n continue; }}\n $btr =& $this->blockTab[$activeBlockNo];\n if ($varRefTPos < $btr['tPosBegin'])\n $this->programLogicError(1);\n $blockVarNo = $btr['blockVarCnt']++;\n $btr['blockVarNoToVarNoMap'][$blockVarNo] = $varNo;\n if ($btr['firstVarRefNo'] == -1)\n $btr['firstVarRefNo'] = $varRefNo;\n $vrtr['blockNo'] = $activeBlockNo;\n $vrtr['blockVarNo'] = $blockVarNo;\n $varRefNo += 1; }}",
"function setup_vars() {\r\n\t\t$this->post_type = get_current_screen()->post_type;\r\n\t\t$this->taxonomies = array_diff(get_object_taxonomies($this->post_type), get_taxonomies(array('show_admin_column' => 'false')));\r\n\t}",
"public function get_var() {\r\n\t\treturn $this->header_vars;\r\n\t}",
"public function getVariablesList() {\n return $this->_get(4);\n }",
"function get_vars($id,$showLimit,$rperm,$cperm,$tzone,$uname){\n\t\t$this->id = $id;\n\t\t$this->showLimit = $showLimit;\n\t\t$this->rperm = $rperm;\n\t\t$this->cperm = $cperm;\n\t\t$this->tzone = $tzone;\n\t\t$this->uname = $uname;\n\t}",
"public function getVars(){\n return $this->getClassVars()->getValues();\n }",
"function settings_section() {\n\t\t}",
"private function initVars()\n {\n // template array variables\n $this->tplVar['art_pubdate'] = array();\n $this->tplVar['art_modifydate'] = array();\n }",
"public function parse($global_vars = array())\n {}",
"public function testListTaskVariables()\n {\n }",
"function parse_vars($match)\r\n\t{\r\n\t\t$tvar = $match[1];\r\n\t\tglobal $$tvar;\r\n\t\tif (key_exists($tvar, $this->vars)) return $this->vars[$tvar];\r\n\t\telse if (isset($$tvar)) return $$tvar;\r\n\t\telse if (defined($tvar)) return constant($tvar);\r\n\t\telse if ($this->use_getvar) return GetVar($tvar);\r\n\t\treturn $match[0];\r\n\t}",
"public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n\n $this->vars['model'] = $this->model;\n $this->vars['category'] = Kategory::where(\"is_active\", \"1\")->lists('name', 'id');\n if (!empty($this->getLoadValue())) {\n $a= $this->vars['value'] = $this->getLoadValue();\n } else {\n $a= $this->vars['value'] = [];\n }\n }",
"public function getVariablesList() {\n return $this->_get(2);\n }",
"function repeatVars(){\n\n\n\n\treturn FALSE;\n\n}",
"public function register_globals() {\n\t\t$GLOBALS['weekday'] = $this->weekday;\n\t\t$GLOBALS['weekday_initial'] = $this->weekday_initial;\n\t\t$GLOBALS['weekday_abbrev'] = $this->weekday_abbrev;\n\t\t$GLOBALS['month'] = $this->month;\n\t\t$GLOBALS['month_abbrev'] = $this->month_abbrev;\n\t}",
"function getVars() {\n return $this->vars;\n }",
"function haira_setup_scss_vars ($contents, $custom_vars) {\n $linenum = 0;\n foreach($contents as $key=>$line)\n {\n if (preg_match('/[ ]*([\\/]{2})?[ ]*(.*?):(.*?);/is', $line, $matches))\n { \n $varName = trim(substr($matches[2], 1));\n $varValue = $matches[3];\n \n if ( isset ( $custom_vars[$varName] ) && $custom_vars[$varName] != '' ) {\n $contents[ $key ] = '$' . $varName . ': ' . $custom_vars[ $varName ] . \";\\n\";\n }\n \n }\n }\n\n return implode($contents);\n\n}",
"public function getVariableHarmonizationsList() {\n return $this->_get(4);\n }",
"public static function variables(): array\n {\n return [ \n Variable::make('method', __('Login form method')), \n Variable::make('action', __('Login form action')), \n Variable::make('token_field', __('Name of the csrf_token field')), \n Variable::make('token_value', __('The csrf_token field value')), \n Variable::make('widget_field', __('Name of the widget field')), \n Variable::make('widget_value', __('The widget field value')), \n\n Variable::make('username_field', __('Name of the username/email field')), \n Variable::make('username_error', __('The username/email field error')), \n Variable::make('username_value', __('The username/email field old value')), \n\n Variable::make('password_field', __('Name of the password field')), \n Variable::make('password_error', __('The password field error')), \n\n Variable::make('remember_field', __('Name of the remember field')), \n Variable::make('remember_checked', __('The remember field checked status')), \n Variable::make('registration_page', __('The registration page url')), \n ];\n }",
"public function get_vb_data ($vars = array());",
"public function get_macros () {\n\t\treturn array(\n\t\t\t'site_name' => get_bloginfo('name', 'display'),\n\t\t\t'site_description' => get_bloginfo('description', 'display'),\n\t\t);\n\t}",
"public function _js_vars()\n {\n }",
"public function getVars(Horde_Variables &$vars)\n {\n $vars->set('search_pattern', $this->_search);\n $vars->set('search_tags', implode(',', $this->_tags));\n $vars->set('search_completed', $this->_completed);\n $vars->set('due_within', $this->_due[0]);\n $vars->set('due_of', $this->_due[1]);\n\n $mask = array();\n if ($this->_mask & self::MASK_NAME) {\n $mask[] = 'search_name';\n }\n if ($this->_mask & self::MASK_DESC) {\n $mask[] = 'search_desc';\n }\n if (!empty($mask)) {\n $vars->set('search_in', $mask);\n }\n }",
"private function getGood()\n {\n return [\n SectionType::FIELD_SECTION_TYPE => 'Llamas',\n SectionType::FIELD_SECTION_TYPE_CODE => 'l',\n ];\n }",
"public static function defines()\n {\n define('STRUCTURE_DATA' , self::data());\n define('CURRENT_COPEN_PAGE' , STRUCTURE_DATA['openFunction']);\n define('CURRENT_CFPARAMETERS', STRUCTURE_DATA['parameters']);\n define('CURRENT_CFILE' , STRUCTURE_DATA['file']);\n define('CURRENT_CFUNCTION' , STRUCTURE_DATA['function']);\n define('CURRENT_CPAGE' , ($page = STRUCTURE_DATA['page']) . '.php');\n define('CURRENT_CONTROLLER' , $page);\n define('CURRENT_CNAMESPACE' , $namespace = STRUCTURE_DATA['namespace'] );\n define('CURRENT_CCLASS' , $namespace . CURRENT_CONTROLLER);\n define('CURRENT_CFPATH' , str_replace\n (\n CONTROLLERS_DIR, '', CURRENT_CONTROLLER) . '/' . CURRENT_CFUNCTION\n );\n define('CURRENT_CFURI' , strtolower(CURRENT_CFPATH));\n define('CURRENT_CFURL' , Request::getSiteURL() . CURRENT_CFPATH);\n }",
"public function getVars()\n\t{\n\t\treturn $this->vars;\n\t}",
"function reset_vars() {\n $this->page[\"Name\"] = \"\";\n $this->page[\"Bio\"] = \"\";\n\n // \"Name\" page:\n $this->main_photo = \"\";\n $this->fullname = \"\";\n $this->birthday = array();\n $this->actorsfilms = array();\n $this->producersfilms = array();\n $this->soundtrackfilms = array();\n $this->directorsfilms = array();\n $this->crewsfilms = array();\n $this->thanxfilms = array();\n $this->selffilms = array();\n $this->archivefilms = array();\n\n // \"Bio\" page:\n $this->birth_name = \"\";\n $this->nick_name = array();\n $this->bodyheight = array();\n $this->bio_bio = array();\n $this->bio_trivia = array();\n $this->bio_tm = array();\n $this->bio_salary = array();\n }",
"public function outputCssVariablesInline(): void\n\t{\n\t\techo Components::outputCssVariablesInline(); // phpcs:ignore\n\t}",
"function css_variables(/*group, value, value, value = array()*/)\n{\n\t$CI = &get_instance();\n\t// get args\n\t$args = func_get_args();\n\tif(count($args) == 1)\n\t{\n\t\t$args = $args[0];\n\t}\n\t// assign args to class\n\t$CI->css->variables($args);\n}",
"function varInfo(...$vars)\n {\n return (new VarDump(...$vars))->toString();\n }",
"public function GetRawAll()\n {\n $result = [];\n foreach ($this->vars as $key => $section) {\n $result[ $key ] = $this->GetRawKeys($key);\n }\n return $result;\n }",
"public function getVars()\n {\n return $this->vars;\n }",
"public function itsec_tracking_vars( $vars ) {\n\n\t\t$vars['itsec_online_files'] = array(\n\t\t\t'enabled' => '0:b',\n\t\t);\n\n\t\treturn $vars;\n\n\t}",
"function _getSectionTypes()\n {\n return array(\n ST_NORMAL => \"Běžná sekce\",\n ST_TASKS => \"Úkoly (česky)\",\n ST_TASKS_EN => \"Úkoly (anglicky)\",\n ST_URLS => \"Odkazy\",\n ST_DOWNLOAD => \"Download\",\n ST_EXCLIST => \"Seznam cvičení\",\n ST_PHYLAB => \"Laboratorní cvičení\"\n );\n }",
"public function tracking_vars( $vars ) {\n\n\t\t$vars['content_directory'] = array(\n\t\t\t'enabled' => '0:b',\n\t\t);\n\n\t\treturn $vars;\n\n\t}",
"protected function _initInternVariables ()\n {\n parent::_initInternVariables();\n \n $this->levels = array ();\n $this->sep = $this->_element->getSeparator();\n $this->display_tag = $this->_element->getTagdisplay();\n $this->tag_label = $this->_element->getTaglabel();\n }"
]
| [
"0.6044713",
"0.6003792",
"0.5931401",
"0.5824718",
"0.57806873",
"0.57806873",
"0.5673822",
"0.5644499",
"0.56262136",
"0.5557047",
"0.5545553",
"0.5545416",
"0.54537445",
"0.54476744",
"0.5446832",
"0.5408887",
"0.5331929",
"0.5331624",
"0.53221023",
"0.5303402",
"0.52802795",
"0.525204",
"0.52516615",
"0.52217084",
"0.5219667",
"0.52159005",
"0.52108413",
"0.52071553",
"0.5204699",
"0.52028865",
"0.52023596",
"0.51980656",
"0.5192314",
"0.5190947",
"0.51792514",
"0.51764494",
"0.513212",
"0.5131887",
"0.51317525",
"0.5095201",
"0.50930244",
"0.5086186",
"0.50826555",
"0.50684613",
"0.5064388",
"0.5054604",
"0.50317746",
"0.5031328",
"0.50012606",
"0.49847022",
"0.49814162",
"0.49683645",
"0.49669665",
"0.4964576",
"0.49582952",
"0.49552444",
"0.49482232",
"0.49424493",
"0.49352634",
"0.49338588",
"0.49333143",
"0.49300194",
"0.49286336",
"0.49281827",
"0.49281827",
"0.492575",
"0.49237585",
"0.492119",
"0.49206206",
"0.49139673",
"0.4909808",
"0.49085766",
"0.49021333",
"0.48910373",
"0.4882158",
"0.48776504",
"0.48773792",
"0.48768064",
"0.4876781",
"0.48732844",
"0.48540312",
"0.4851923",
"0.48403206",
"0.48391145",
"0.48334414",
"0.48286217",
"0.48277745",
"0.4826021",
"0.4824212",
"0.48216432",
"0.48214868",
"0.48170856",
"0.48157862",
"0.48127455",
"0.48069182",
"0.48052967",
"0.4794614",
"0.47875655",
"0.47745854",
"0.4773773",
"0.47720537"
]
| 0.0 | -1 |
/ / Enum all vars in all sections / | public function GetAll()
{
$result = [];
foreach ($this->vars as $key => $section) {
$result[ $key ] = $this->GetKeys($key);
}
return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function GetSections()\n {\n return array_keys($this->vars);\n }",
"public static function loadVars(){\n\t\tif(!self::$vars){\n\t\t\tself::$vars = self::getDefaultVars();\n\t\t}\n\t\tforeach(func_get_args() as $arg){\n\t\t\tforeach($arg as $key=> $value){\n\t\t\t\tself::$vars[$key] = self::fillTokens($value);\n\t\t\t}\n\t\t}\n\t\treturn self::$vars;\n\t}",
"public function exportedVars(): iterable;",
"static function getLangVars()\n\t{\n\t\treturn array(\"pc_vacc\", \"pc_hacc\");\n\t}",
"public function variables(): array;",
"public function variables(): array;",
"private function loadSesionVars() {\r\n\r\n $this->VARS = array(); \r\n\r\n $this->updateSessionExpireTime();\r\n\r\n $dati = $this->selectSessionVars();\r\n\r\n foreach($dati as $infos) { \r\n $this->VARS[$infos[\"name\"]]=unserialize($infos[\"value\"]);\r\n }\r\n\r\n }",
"protected function initVars() {\n\n\t\t}",
"public function getVariables()\n {\n \treturn isset($this->all['variables']) ? $this->all['variables'] : array();\n }",
"protected function get_variables_for_view()\n\t{\n\t\t$ary = array();\n\t\tforeach (get_object_vars ($this->set) as $k => $v)\n\t\t\t$ary[$k] = $v;\n\t\treturn $ary;\n\t}",
"protected function init()\n {\n $arVariablesExtend = Event::fire(self::EVENT_EXTEND_VARIABLES, []);\n\n foreach ($arVariablesExtend as $iIndex => $arExtend)\n {\n foreach ($arExtend as $sKey => $arVariable) {\n if (in_array($sKey, $this->arVariables)) {\n continue;\n }\n\n // Add to variables\n $this->arVariables[$sKey] = $arVariable;\n }\n }\n }",
"public static function variables(): array\n {\n return [\n Variable::make('sorts', __('Array of available sorting')),\n\n Variable::make('directions', __('Array of sort directions')),\n\n Variable::make('items', __('HTML generated of blog items')),\n\n Variable::make('pagination', __('HTML generated of pagination links')),\n ];\n }",
"public function config_vars()\n\t{\n\t\tglobal $txt;\n\n\t\t$return_data = array();\n\n\t\t$core_features = $this->settings();\n\n\t\t// Convert this to a format that admin search will understand\n\t\tforeach ($core_features as $id => $data)\n\t\t{\n\t\t\t$return_data[] = array('switch', $data['title'] ?? $txt['core_settings_item_' . $id]);\n\t\t}\n\n\t\treturn $return_data;\n\t}",
"public function type_vars( ){\n\t\t\n\t\tglobal $disabled_settings;\n\t\t$alt = false;\n\t\tif ( is_array( $disabled_settings ) )\n\t\t\tif( !empty( $disabled_settings['typography'] ) )\n\t\t\t\t$alt = true;\n\t\t\n\t\t$vars = array(\n\t\t\t'plBaseFont'\t\t=> ($alt) ? '\"Helvetica\" Arial, serif' : pl_type_el('type_primary', 'stack'), \n\t\t\t'plBaseWeight'\t\t=> pl_type_el('type_primary', 'weight'), \n\t\t\t'plAltFont'\t\t\t=> ($alt) ? '\"Helvetica\" Arial, serif' : pl_type_el('type_secondary', 'stack'), \n\t\t\t'plAltWeight'\t\t=> pl_type_el('type_secondary', 'weight'), \n\t\t\t'plHeaderFont'\t\t=> ($alt) ? '\"Helvetica\" Arial, serif' : pl_type_el('type_headers', 'stack'), \n\t\t\t'plHeaderWeight'\t=> pl_type_el('type_headers', 'weight'),\n\t\t);\n\t\treturn $vars;\n\t}",
"public function vars()\n {\n return array_merge(parent::vars(), [\n 'user' => (string) $this->key->sysuser ? $this->key->sysuser->name : 'sitepilot',\n 'key' => (string) $this->key->key\n ]);\n }",
"public function getVars() {\r\n return $this->VARS;\r\n }",
"public function getAll(): array\n {\n return $this->variables;\n }",
"public function getVariables(): Mailcode_Variables_Collection_Regular;",
"public function getVars() {\n return array();\n }",
"public function getHeaderFooterVariables() {\n\t\t$vars = $this->request->getVars();\n\n\t\tunset(\n\t\t\t$vars['url'],\n\t\t\t$vars['flushtoken'],\n\t\t\t$vars['flush']\n\t\t);\n\n\t\tif (isset($vars['page']) && strpos($vars['page'], '§ion=') !== false) {\n\t\t\t$parts = explode('§', $vars['page']);\n\t\t\t$vars['page'] = $parts[0];\n\t\t\t$vars['section'] = str_replace('ion=', '', $parts[1]);\n\t\t}\n\n\t\t$string = '';\n\n\t\tforeach ($vars as $key => $value) {\n\t\t\t$string .= '<strong style=\"color: red;\">$' . $key . '</strong> => ' . $value . '<br>';\n\t\t}\n\n\t\t$htmlString = DBHTMLText::create();\n\t\t$htmlString->setValue($string);\n\n\t\t$vars['all_variables'] = $htmlString;\n\n\t\treturn $vars;\n\t}",
"function dumpInfo() {\n global $_dOp;\n $op = \"SECTION: $this->sectionName<br />\";\n $_dOp = '';\n foreach ($this->varList as $secID => $vars) {\n $op .= \" -- section ID: $secID<br />\";\n foreach ($vars as $varKey => $varTag) {\n if (is_array($varTag)) {\n foreach ($varTag as $varObj) {\n $op .= \" .... VAR: $varKey<br />\\n\";\n $aList = $varObj->getAttrList();\n foreach ($aList as $attr) {\n if ($attr == 'NAME')\n continue;\n $v = $varObj->getAttr($attr);\n if ($v === false)\n $v = 'false';\n if ($v === true)\n $v = 'true';\n if ($v === NULL)\n $v = '[not set]';\n \n $op .= \"........ $attr => \".$v.\"<br />\\n\";\n }\n }\n }\n else {\n $op .= \" .... VAR: $varKey<br />\\n\";\n $aList = $varTag->getAttrList();\n foreach ($aList as $attr) {\n if ($attr == 'NAME')\n continue;\n $v = $varTag->getAttr($attr);\n if ($v === false)\n $v = 'false';\n if ($v === true)\n $v = 'true';\n if ($v === NULL)\n $v = '[not set]';\n $op .= \"........ $attr => \".$v.\"<br />\\n\";\n }\n }\n }\n }\n return $op;\n }",
"public function getGlobals();",
"public function getGlobals();",
"public function __getVars(){\r\n $vars = isset($this->vars)? $this->vars:array();\r\n return $vars;\r\n }",
"function values( $vars ) {\n foreach($vars as $k=>$v) {\n $this->_vars[\"$k\"] = $v;\n }\n }",
"public function getGetVariables();",
"public function get_vars()\n\t{\n\t\treturn array(\"TsvOneFile\");\n\t}",
"public function getSetVariables() {}",
"public function getGlobals()\n {\n return [\n 'cache' => $this->flextype['cache'],\n ];\n }",
"protected static function initializeGlobalVariables() {}",
"function getVariableContainer() ;",
"public function getVariables ()\n {\n /**\n * Specification:\n * - itemkey used to identify variable in your other functions\n * - type text, textarea, yesno, password, hidden (type hidden are variables used by CE and are required)\n * - description description of the variable, displayed in ClientExec\n * - encryptable used to indicate the variable's value must be encrypted in the database\n */\n $variables = array(\n lang('Name') => array(\n 'type' => 'hidden',\n 'description' => lang('Used by ClientExec to display plugin. It must match the action function name(s).'),\n 'value' => 'InterWorx-CP'\n ),\n lang('Description') => array (\n 'type' => 'hidden',\n 'description' => lang('Description viewable by admin in server settings'),\n 'value' => lang('InterWorx-CP integration.')\n ),\n lang('Access Key') => array (\n 'type' => 'textarea',\n 'description' => lang('Access key used to authenticate to server.'),\n 'value' => '',\n 'encryptable' => true\n ),\n lang('Actions') => array (\n 'type' => 'hidden',\n 'description' => lang('Actions currently available for this plugin.'),\n 'value' => 'Create,Delete,Suspend,UnSuspend'\n )\n );\n\n return $variables;\n }",
"public static function variables(): array\n {\n return [\n Variable::make('id', __('Article Id')),\n\n Variable::make('name', __('Article Name')),\n\n Variable::make('summary', __('Article Summary')),\n\n Variable::make('url', __('Article URL')),\n\n Variable::make('hits', __('Article Hits')),\n\n Variable::make('creation_date', __('Article Creation Date')),\n\n Variable::make('last_update', __('Article Update Date')),\n\n Variable::make('author', __('Article Author')),\n\n Variable::make('image.templateName', __(\n 'Image with the required template (example: image.common-main)'\n )),\n ];\n }",
"function fill_general_variables()\n\t\t{\n\t\t\t//collect error messages before\n\t\t\t$this->message[] = $this->process_monitor->get_error(false, _DEBUG);\n\t\t\t$this->fill_form_variables();\n\t\t\t$this->t->set_var(array(\n\t\t\t\t'monitor_stats'\t\t\t=> $this->fill_monitor_stats($this->stats),\n\t\t\t));\n\t\t}",
"public function getGetVariables() {}",
"public function vars()\n\t{\n\t\treturn $this->vars;\n\t}",
"private function load_variables() : void {\n\t\t$this->today = new \\DateTime( 'NOW' );\n\t\t$this->start_date = new \\DateTime( FTW_START_DATE );\n\t\t$this->completion_date = new \\DateTime( FTW_COMPLETION_DATE );\n\t}",
"function register_globals() {\n\t\t$GLOBALS['weekday'] = $this->weekday;\n\t\t$GLOBALS['weekday_initial'] = $this->weekday_initial;\n\t\t$GLOBALS['weekday_abbrev'] = $this->weekday_abbrev;\n\t\t$GLOBALS['month'] = $this->month;\n\t\t$GLOBALS['month_abbrev'] = $this->month_abbrev;\n\t}",
"protected function GetDescriptionVariables()\n {\n return array();\n }",
"public function getGlobals()\n {\n }",
"public function getAvailableVariables() :array\n {\n return [];\n }",
"function _phptemplate_variables($hook, $vars) {\n if ($hook == 'page') {\n\n if ($secondary = menu_secondary_local_tasks()) {\n $output = '<span class=\"clear\"></span>';\n $output .= \"<ul class=\\\"tabs secondary\\\">\\n\". $secondary .\"</ul>\\n\";\n $vars['tabs2'] = $output;\n }\n\n // Hook into color.module\n if (module_exists('color')) {\n _color_page_alter($vars);\n }\n return $vars;\n }\n return array();\n}",
"static function getLangVars()\n\t{\n\t\treturn array(\"pc_mob\");\n\t}",
"public function GetRawAll()\n {\n $result = [];\n foreach ($this->vars as $key => $section) {\n $result[ $key ] = $this->GetRawKeys($key);\n }\n return $result;\n }",
"public function initVarfromDefs() {\n foreach ($this->extconfigs->getextConfig('sccpDefaults') as $key => $value) {\n if (empty($this->sccpvalues[$key])) {\n $this->sccpvalues[$key] = array('keyword' => $key, 'data' => $value, 'type' => '0', 'seq' => '0');\n }\n }\n }",
"function reset_vars() {\n $this->page[\"Name\"] = \"\";\n $this->page[\"Bio\"] = \"\";\n\n // \"Name\" page:\n $this->main_photo = \"\";\n $this->fullname = \"\";\n $this->birthday = array();\n $this->actorsfilms = array();\n $this->producersfilms = array();\n $this->soundtrackfilms = array();\n $this->directorsfilms = array();\n $this->crewsfilms = array();\n $this->thanxfilms = array();\n $this->selffilms = array();\n $this->archivefilms = array();\n\n // \"Bio\" page:\n $this->birth_name = \"\";\n $this->nick_name = array();\n $this->bodyheight = array();\n $this->bio_bio = array();\n $this->bio_trivia = array();\n $this->bio_tm = array();\n $this->bio_salary = array();\n }",
"public function register_globals() {\n\t\t$GLOBALS['weekday'] = $this->weekday;\n\t\t$GLOBALS['weekday_initial'] = $this->weekday_initial;\n\t\t$GLOBALS['weekday_abbrev'] = $this->weekday_abbrev;\n\t\t$GLOBALS['month'] = $this->month;\n\t\t$GLOBALS['month_abbrev'] = $this->month_abbrev;\n\t}",
"public function getGlobals()\n {\n return [\n 'snippets' => new SnippetsTwig($this->flextype)\n ];\n }",
"protected function getVars()\n {\n if (!$this->vars) {\n $this->loadVarsByObjectType();\n }\n\n return $this->vars;\n }",
"public function define_sections() {\r\n\t\t$this->options->sections = $this->to_array();\n\t}",
"public function vars()\n {\n return $this->vars;\n }",
"private function initVars()\n {\n // template array variables\n $this->tplVar['art_pubdate'] = array();\n $this->tplVar['art_modifydate'] = array();\n }",
"public function parse($global_vars = array())\n {}",
"protected function parseVariable(): void\n {\n $sBaseUrl = $this->sBaseUrl;\n\n /**\n * $getCurrentTplName is used in \"variables.inc.php\" file\n */\n $getCurrentTplName = static function () use ($sBaseUrl) {\n $aDirs = explode('/', $sBaseUrl);\n return !empty($aDirs[2]) ? $aDirs[2] : PH7_DEFAULT_THEME;\n };\n\n $this->setVariables(include('variables.inc.php'));\n }",
"public function getScssVariables() {\n\t\treturn [\n\t\t\t'color-primary' => '#745bca'\n\t\t];\n\t}",
"public function getVariablesList() {\n return $this->_get(4);\n }",
"public function updateVaribles(){\n foreach( $this->globalVars as $key=>$val ){\n $this->template = str_replace( '%'. $key .'%', $val, $this->template );\n }\n }",
"function repeatVars(){\n\n\t\treturn FALSE;\n\t\n}",
"function spr_get_sections() {\n\tglobal $spr_sql_fields;\n\n\t$sql_tables = safe_pfx('txp_section');\n\t$rs = safe_query(\"SELECT \".$spr_sql_fields.\" FROM \".$sql_tables.\" WHERE name != 'default' ORDER BY name\");\n\twhile ($a = nextRow($rs)) {\n\t\textract($a); // set 'name','title','parent' etc in $a\n\t\t$out[$name] = $a;\n\t}\n\treturn $out;\n}",
"public function addVariables($tvs = array());",
"private function globals() {\n global $pagesArray;\n \n $xml = XML2Array::createArray(file_get_contents(GSDATAOTHERPATH.'website.xml'));\n \n // turn PRETTYURLS into boolean\n if ($xml['item']['PRETTYURLS']=='') $xml['item']['PRETTYURLS'] = false;\n else $xml['item']['PRETTYURLS'] = true;\n \n // globals array\n $globals = array(\n 'sitename' => $xml['item']['SITENAME']['@cdata'],\n 'siteurl' => $xml['item']['SITEURL']['@cdata'],\n 'template' => $xml['item']['TEMPLATE']['@cdata'],\n 'pages' => $pagesArray,\n 'permalink' => $xml['item']['PERMALINK'],\n 'prettyurls' => $xml['item']['PRETTYURLS'],\n );\n return $globals;\n }",
"public function loadAllVars()\n {\n $this->vars = $this->getEntityService()->findAll(EntityConstants::ITEM_VAR);\n return $this;\n }",
"public function getVariablesList() {\n return $this->_get(2);\n }",
"public function defineConstants ()\n {\n foreach ($this->data as $key => $value) {\n define(strtoupper($key), $value);\n }\n }",
"function getVars() {\n return $this->vars;\n }",
"private function _add_vars()\n\t{\n\t\t// --------------------------------------\n\t\t// Only continue if request is a page\n\t\t// and we have segments to check\n\t\t// --------------------------------------\n\n\t\tif (empty(ee()->uri->segments) && $this->settings['set_all_segments'] == 'n') return;\n\n\t\t// --------------------------------------\n\t\t// Initiate uri instance\n\t\t// --------------------------------------\n\n\t\t$this->uri = new EE_URI;\n\t\t$this->uri->_fetch_uri_string();\n\n\t\tif ($this->settings['ignore_pagination'] == 'y')\n\t\t{\n\t\t\t// Get rid of possible pagination segment at the end\n\t\t\t$this->uri->uri_string = preg_replace('#/[PC]\\d+$#', '', $this->uri->uri_string);\n\t\t}\n\n\t\t$this->uri->_explode_segments();\n\t\t$this->uri->_reindex_segments();\n\n\t\t// --------------------------------------\n\t\t// Suggestion by Leevi Graham:\n\t\t// check for pattern before continuing\n\t\t// --------------------------------------\n\n\t\tif ( ! empty($this->settings['uri_pattern']) && ! preg_match($this->settings['uri_pattern'], $this->uri->uri_string)) return;\n\n\t\t// --------------------------------------\n\t\t// Initiate some vars\n\t\t// $data is used to add to global vars\n\t\t// $cats is used to keep track of all category ids found\n\t\t// --------------------------------------\n\n\t\t$data = $cats = array();\n\n\t\t// Also initiate this single var to an empty string\n\t\t$data['segment_category_ids'] = '';\n\t\t$data['segment_category_ids_piped'] = '';\n\n\t\t// --------------------------------------\n\t\t// Number of segments to register - 9 is hardcoded maximum\n\t\t// --------------------------------------\n\n\t\t$num_segs = ($this->settings['set_all_segments'] == 'y') ? 9 : $this->uri->total_segments();\n\n\t\t// --------------------------------------\n\t\t// loop through segments and set data array thus: segment_1_category_id etc\n\t\t// --------------------------------------\n\n\t\tfor ($nr = 1; $nr <= $num_segs; $nr++)\n\t\t{\n\t\t\tforeach ($this->fields AS $field)\n\t\t\t{\n\t\t\t\t$data[\"segment_{$nr}_{$field}\"] = '';\n\t\t\t}\n\t\t}\n\n\t\t// Initiate last segment vars\n\t\tforeach ($this->fields AS $field)\n\t\t{\n\t\t\t$data[\"last_segment_{$field}\"] = '';\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Force lowercase segment array\n\t\t// --------------------------------------\n\n\t\t$segment_array = array_map('strtolower', $this->uri->segment_array());\n\n\t\t// --------------------------------------\n\t\t// Execute the rest only if there are segments to check\n\t\t// --------------------------------------\n\n\t\tif ($segment_array)\n\t\t{\n\t\t\t// --------------------------------------\n\t\t\t// Query database for these segments\n\t\t\t// Use lowercase for case insensitive comparison,\n\t\t\t// for when DB collation is case sensitive\n\t\t\t// --------------------------------------\n\n\t\t\tee()->db->select('cat_url_title, '. implode(', ', array_keys($this->fields)))\n\t\t\t ->from('categories')\n\t\t\t ->where('site_id', $this->site_id)\n\t\t\t ->where_in('cat_url_title', $segment_array);\n\n\t\t\t// --------------------------------------\n\t\t\t// Filter by category groups set in settings\n\t\t\t// --------------------------------------\n\n\t\t\tif (isset($this->settings['category_groups']))\n\t\t\t{\n\t\t\t\tif ($groups = array_filter($this->settings['category_groups']))\n\t\t\t\t{\n\t\t\t\t\tee()->db->where_in('group_id', $groups);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// --------------------------------------\n\t\t\t// Execute query and get results\n\t\t\t// --------------------------------------\n\n\t\t\t$query = ee()->db->get();\n\n\t\t\t// --------------------------------------\n\t\t\t// If we have matching categories, continue...\n\t\t\t// --------------------------------------\n\n\t\t\tif ($query->num_rows())\n\t\t\t{\n\t\t\t\t// --------------------------------------\n\t\t\t\t// Associate the results\n\t\t\t\t// --------------------------------------\n\n\t\t\t\t$rows = $this->_associate_results($query->result_array(), 'cat_url_title');\n\n\t\t\t\t// --------------------------------------\n\t\t\t\t// Load typography if private var is set\n\t\t\t\t// --------------------------------------\n\n\t\t\t\tif ($this->format || $this->settings['parse_file_paths'] == 'y')\n\t\t\t\t{\n\t\t\t\t\tee()->load->library('typography');\n\t\t\t\t}\n\n\t\t\t\t// --------------------------------------\n\t\t\t\t// loop through segments\n\t\t\t\t// --------------------------------------\n\n\t\t\t\tforeach ($segment_array as $n => $seg)\n\t\t\t\t{\n\t\t\t\t\t// Skip non-matching segments\n\t\t\t\t\tif ( ! isset($rows[$seg])) continue;\n\n\t\t\t\t\t// Get the category row\n\t\t\t\t\t$row = $rows[$seg];\n\n\t\t\t\t\t// Overwrite values in data array\n\t\t\t\t\tforeach ($this->fields AS $name => $field)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Format category name if private var is set\n\t\t\t\t\t\tif ($name == 'cat_name' && $this->format)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$row[$name] = ee()->typography->format_characters($row[$name]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Parse file paths\n\t\t\t\t\t\tif ($name == 'cat_image' && $this->settings['parse_file_paths'] == 'y')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$row[$name] = ee()->typography->parse_file_paths($row[$name]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Set value in for segment_x_yyy\n\t\t\t\t\t\t$data[\"segment_{$n}_{$field}\"] = $row[$name];\n\t\t\t\t\t}\n\n\t\t\t\t\t// Add found id to cats array\n\t\t\t\t\t$cats[] = $row['cat_id'];\n\t\t\t\t}\n\n\t\t\t\t// --------------------------------------\n\t\t\t\t// Set last_segment_category_x vars\n\t\t\t\t// --------------------------------------\n\n\t\t\t\t$last = $this->uri->total_segments();\n\n\t\t\t\tforeach ($this->fields AS $name => $field)\n\t\t\t\t{\n\t\t\t\t\t$data['last_segment_'.$field] = $data['segment_'.$last.'_'.$field];\n\t\t\t\t}\n\n\t\t\t\t// --------------------------------------\n\t\t\t\t// Create inclusive stack of all category ids present in segments\n\t\t\t\t// --------------------------------------\n\n\t\t\t\t$data['segment_category_ids'] = implode('&',$cats);\n\t\t\t\t$data['segment_category_ids_piped'] = implode('|',$cats);\n\t\t\t}\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Finally, add data to global vars\n\t\t// Swapping $data and existing global vars makes a difference in EE2.4+\n\t\t// --------------------------------------\n\n\t\tee()->config->_global_vars = array_merge(ee()->config->_global_vars, $data);\n\t\t//ee()->config->_global_vars = array_merge($data, ee()->config->_global_vars);\n\t}",
"public function get_macros () {\n\t\treturn array(\n\t\t\t'site_name' => get_bloginfo('name', 'display'),\n\t\t\t'site_description' => get_bloginfo('description', 'display'),\n\t\t);\n\t}",
"public function tracking_vars( $vars ) {\n\n\t\t$vars['itsec_away_mode'] = array(\n\t\t\t'enabled' => '0:b',\n\t\t\t'type' => '0:b',\n\t\t);\n\n\t\treturn $vars;\n\n\t}",
"function setup_vars() {\r\n\t\t$this->post_type = get_current_screen()->post_type;\r\n\t\t$this->taxonomies = array_diff(get_object_taxonomies($this->post_type), get_taxonomies(array('show_admin_column' => 'false')));\r\n\t}",
"public static function variables(): array\n {\n return [ \n Variable::make('method', __('Login form method')), \n Variable::make('action', __('Login form action')), \n Variable::make('token_field', __('Name of the csrf_token field')), \n Variable::make('token_value', __('The csrf_token field value')), \n Variable::make('widget_field', __('Name of the widget field')), \n Variable::make('widget_value', __('The widget field value')), \n\n Variable::make('username_field', __('Name of the username/email field')), \n Variable::make('username_error', __('The username/email field error')), \n Variable::make('username_value', __('The username/email field old value')), \n\n Variable::make('password_field', __('Name of the password field')), \n Variable::make('password_error', __('The password field error')), \n\n Variable::make('remember_field', __('Name of the remember field')), \n Variable::make('remember_checked', __('The remember field checked status')), \n Variable::make('registration_page', __('The registration page url')), \n ];\n }",
"public function gen_section(){\n $data = array(\n \"txtinicio\"=>\"Inicio\",\n \"rutainicio\" => \"/admin/inicio\",\n \"txtmodulo\" => \"CONTABILIDAD\",\n \"section\" => \"Contabilidad\",\n \"rutamodulo\" => \"/admin/tipocuenta\",\n \"ventana\" => \"Niveles\"\n );\n\n return $data;\n }",
"function getTemplateVars() {\n return array();\n }",
"public function setSectionVars($sectionVars) {\n $this->sectionVars = $sectionVars;\n }",
"private static function printAll() {\r\n\t\tforeach (self::$global as $type) {\r\n\t\t\t$type->dump();\r\n\t\t}\r\n\t}",
"public static function fromGlobals() {}",
"public function getVars()\n\t{\n\t\treturn $this->vars;\n\t}",
"public function getGlobals()\n {\n return array();\n }",
"public function getGlobals()\n {\n return array();\n }",
"function processGetVars()\n {\n //assignGetIfExists ( $fullList, NULL, 'full' );\n //$this->fullList = (bool) $fullList;\n self::dumpThis();\n }",
"protected function variables()\n {\n $this->variables['grid'] = $this;\n\n return $this->variables;\n }",
"public function clearVars() {\n\t\t$this->_engine->clearAllAssign();\n\t}",
"function asp_parse_options() {\r\r\n foreach ( wd_asp()->o as $def_k => $o ) {\r\r\n if ( preg_match(\"/\\_def$/\", $def_k) ) {\r\r\n $ok = preg_replace(\"/\\_def$/\", '', $def_k);\r\r\n\r\r\n // Dang, I messed up this elegant solution..\r\r\n if ( $ok == \"asp_it\")\r\r\n $ok = \"asp_it_options\";\r\r\n\r\r\n wd_asp()->o[$ok] = asp_decode_params( get_option($ok, wd_asp()->o[$def_k]) );\r\r\n wd_asp()->o[$ok] = array_merge(wd_asp()->o[$def_k], wd_asp()->o[$ok]);\r\r\n }\r\r\n }\r\r\n // Long previous version compatibility\r\r\n if ( wd_asp()->o['asp_caching'] === false )\r\r\n wd_asp()->o['asp_caching'] = wd_asp()->o['asp_caching_def'];\r\r\n\r\r\n // The globals are a sitewide options\r\r\n wd_asp()->o['asp_glob'] = get_site_option('asp_glob', wd_asp()->o['asp_glob_d']);\r\r\n wd_asp()->o['asp_glob'] = array_merge(wd_asp()->o['asp_glob_d'], wd_asp()->o['asp_glob']);\r\r\n}",
"public function getCookieVariables();",
"static function get_all() {\r\n\t\t\treturn array(\r\n\t\t\t\tself::PAGES_POSTS => array(__('Access List of Posts','seo-pressor'),__('Access to the list of Posts and Pages with SEOPressor information','seo-pressor'))\r\n\t\t\t\t, self::SEO_EDIT_BOX => array(__('Access Score Box','seo-pressor'),__('Access to SEOPressor Box in Post add and edit page','seo-pressor'))\r\n\t\t\t\t, self::ADMIN => array(__('Full Access','seo-pressor'),__('Full Access, including administrative options','seo-pressor'))\r\n\t\t\t\t, self::SET_MIN_SCORE => array(__('Access Settings and set Minimum Score','seo-pressor'),__('Permission to access to global Settings including the access to set the Minimum Score on Advanced Settings tab','seo-pressor'))\r\n\t\t\t\t, self::SET_NOT_MIN_SCORE => array(__('Access Settings without access to set Minimum Score','seo-pressor'),__('Permission to access to global Settings without permission to set the Minimum Score on Advanced Settings tab','seo-pressor'))\r\n\t\t\t\t, self::SETTINGS_TAB => array(__('Access SEOPressor Menu','seo-pressor'),__('Permission to access SEOPressor menu in backend','seo-pressor'))\r\n\t\t\t);\r\n\t\t}",
"public function getVars()\n {\n return $this->vars;\n }",
"public function sections()\n {\n }",
"function runkit_superglobals()\n{\n}",
"public function provideVariables()\n {\n return [\n 'first test' => [\n 'variables' => [\n 'var1' => 'val1',\n 'var2' => 'val2',\n 'var3' => 'val3',\n ],\n ]\n ];\n }",
"public function getAssignedVars()\n {\n return $this->_vars;\n }",
"function import_record_vars() {\r\n while (list($key, $val) = each($this->Record))\r\n if (ereg(\"[A-Za-z][A-Za-z0-9_]*\", $key)) {\r\n $field_name = strtoupper($key); \r\n\t global $$field_name;\r\n\t $$field_name=$val;\r\n }; \r\n }",
"public function getTemplateVariables(): array;",
"public function _js_vars()\n {\n }",
"function get_assigned_variables() {\n\n $assigns = array();\n $protected = get_class_vars(get_class($this));\n\n foreach (get_object_vars($this) as $var => $value) {\n if (!array_key_exists($var, $protected)) {\n $assigns[$var] =& $this->$var;\n }\n }\n\n $assigns['controller'] = $this;\n\n return $assigns;\n }",
"public function getVars(){\n return $this->getClassVars()->getValues();\n }",
"function repeatVars(){\n\n\n\n\treturn FALSE;\n\n}",
"public function __allSections()\n\t{\n\t\t//current user course\n\t\t$userCourse = $this->Session->read('UserData.usersCourses');\n\t\t$user_course_section = $userCourse[0];\n\t\t//get Course and section name\n\t\t$course_info = $this->getCourseNameOfUser($user_course_section);\n\t\t$course_name = $course_info->course_name;\n\t\t$course_section = $course_info->section_name;\n\t\t$sectionList = array();\n\t\t//getting the course in section/all section setting(changed on 16 April, 2014)\n\t $setting = $this->__getDbSetting($user_course_section);\n\t\tif ($setting == 2) {\n\t\t\t$sections = $this->PleSetting->find('all',array('conditions'=>array('PleSetting.course'=>$course_name,'PleSetting.setting_value'=>2),'fields'=>array('section')));\n\t\t\tforeach ($sections as $section) {\n\t\t\t\t$sectionList[] = trim($section['PleSetting']['section']);\n\t\t\t}\n\t\t\t$sectionList[] = $course_section;\n\t } else {\n\t\t\t//add current user login section\n\t\t\t$sectionList[] = $course_section;\n\t }\n\t\t$tz = array_unique($sectionList);\n\t\treturn $tz;\n\t}",
"function _getSectionTypes()\n {\n return array(\n ST_NORMAL => \"Běžná sekce\",\n ST_TASKS => \"Úkoly (česky)\",\n ST_TASKS_EN => \"Úkoly (anglicky)\",\n ST_URLS => \"Odkazy\",\n ST_DOWNLOAD => \"Download\",\n ST_EXCLIST => \"Seznam cvičení\",\n ST_PHYLAB => \"Laboratorní cvičení\"\n );\n }",
"public function getVariables()\n {\n $variables = $this->getVariablesForPart($this->tempDocumentMainPart);\n\n foreach ($this->tempDocumentHeaders as $headerXML) {\n $variables = array_merge($variables, $this->getVariablesForPart($headerXML));\n }\n\n foreach ($this->tempDocumentFooters as $footerXML) {\n $variables = array_merge($variables, $this->getVariablesForPart($footerXML));\n }\n\n return array_unique($variables);\n }",
"public function read($section) {\n $values = parent::read($section);\n\n switch ($section) {\n case 'smarty':\n if (!array_key_exists('compile', $values)) {\n $values['compile'] = array();\n }\n\n $values['compile']['directory'] = Module::getTempDirectory('smarty')->getPath();\n\n break;\n case 'system':\n if (!array_key_exists('session', $values)) {\n $values['session'] = array();\n }\n\n $values['session']['path'] = Module::getTempDirectory('session')->getPath();\n\n break;\n }\n\n return $values;\n }",
"protected function getVars()\n {\n return array_merge(parent::getVars(),get_object_vars($this));\n }"
]
| [
"0.64037246",
"0.6156868",
"0.5944303",
"0.5928813",
"0.58267266",
"0.58267266",
"0.5817624",
"0.57504004",
"0.5694989",
"0.55645",
"0.5540699",
"0.5513652",
"0.5509266",
"0.550325",
"0.5500928",
"0.54632753",
"0.54389477",
"0.54296577",
"0.53964216",
"0.53936875",
"0.5366915",
"0.5366555",
"0.5366555",
"0.5358691",
"0.53551257",
"0.5321449",
"0.53213847",
"0.5303938",
"0.52876174",
"0.5284769",
"0.52816415",
"0.5267964",
"0.5253172",
"0.52447003",
"0.5242797",
"0.52396274",
"0.5233487",
"0.52266014",
"0.52090997",
"0.5195678",
"0.5187363",
"0.51859856",
"0.5183369",
"0.5172209",
"0.51720095",
"0.51610816",
"0.51562506",
"0.51464975",
"0.51286453",
"0.5116065",
"0.5104122",
"0.50932634",
"0.50874263",
"0.5083408",
"0.50817114",
"0.50780463",
"0.50533867",
"0.50529164",
"0.50492424",
"0.5043212",
"0.5042407",
"0.50421363",
"0.50413865",
"0.5036074",
"0.5026501",
"0.5020956",
"0.5014705",
"0.5006277",
"0.5005187",
"0.50010836",
"0.50007",
"0.49974295",
"0.49941602",
"0.49938887",
"0.49931702",
"0.49917036",
"0.49789575",
"0.49789575",
"0.49772137",
"0.49705186",
"0.49647614",
"0.49595475",
"0.49574375",
"0.49502695",
"0.49492034",
"0.49487722",
"0.49468905",
"0.4946509",
"0.49458086",
"0.4944851",
"0.49316704",
"0.49303427",
"0.49271354",
"0.492325",
"0.49197155",
"0.4910938",
"0.4906985",
"0.48985836",
"0.48945552",
"0.48938435"
]
| 0.6054236 | 2 |
/ / Enum all vars in all sections / | public function GetRawAll()
{
$result = [];
foreach ($this->vars as $key => $section) {
$result[ $key ] = $this->GetRawKeys($key);
}
return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function GetSections()\n {\n return array_keys($this->vars);\n }",
"public static function loadVars(){\n\t\tif(!self::$vars){\n\t\t\tself::$vars = self::getDefaultVars();\n\t\t}\n\t\tforeach(func_get_args() as $arg){\n\t\t\tforeach($arg as $key=> $value){\n\t\t\t\tself::$vars[$key] = self::fillTokens($value);\n\t\t\t}\n\t\t}\n\t\treturn self::$vars;\n\t}",
"public function GetAll()\n {\n $result = [];\n foreach ($this->vars as $key => $section) {\n $result[ $key ] = $this->GetKeys($key);\n }\n return $result;\n }",
"public function exportedVars(): iterable;",
"static function getLangVars()\n\t{\n\t\treturn array(\"pc_vacc\", \"pc_hacc\");\n\t}",
"public function variables(): array;",
"public function variables(): array;",
"private function loadSesionVars() {\r\n\r\n $this->VARS = array(); \r\n\r\n $this->updateSessionExpireTime();\r\n\r\n $dati = $this->selectSessionVars();\r\n\r\n foreach($dati as $infos) { \r\n $this->VARS[$infos[\"name\"]]=unserialize($infos[\"value\"]);\r\n }\r\n\r\n }",
"protected function initVars() {\n\n\t\t}",
"public function getVariables()\n {\n \treturn isset($this->all['variables']) ? $this->all['variables'] : array();\n }",
"protected function get_variables_for_view()\n\t{\n\t\t$ary = array();\n\t\tforeach (get_object_vars ($this->set) as $k => $v)\n\t\t\t$ary[$k] = $v;\n\t\treturn $ary;\n\t}",
"protected function init()\n {\n $arVariablesExtend = Event::fire(self::EVENT_EXTEND_VARIABLES, []);\n\n foreach ($arVariablesExtend as $iIndex => $arExtend)\n {\n foreach ($arExtend as $sKey => $arVariable) {\n if (in_array($sKey, $this->arVariables)) {\n continue;\n }\n\n // Add to variables\n $this->arVariables[$sKey] = $arVariable;\n }\n }\n }",
"public static function variables(): array\n {\n return [\n Variable::make('sorts', __('Array of available sorting')),\n\n Variable::make('directions', __('Array of sort directions')),\n\n Variable::make('items', __('HTML generated of blog items')),\n\n Variable::make('pagination', __('HTML generated of pagination links')),\n ];\n }",
"public function config_vars()\n\t{\n\t\tglobal $txt;\n\n\t\t$return_data = array();\n\n\t\t$core_features = $this->settings();\n\n\t\t// Convert this to a format that admin search will understand\n\t\tforeach ($core_features as $id => $data)\n\t\t{\n\t\t\t$return_data[] = array('switch', $data['title'] ?? $txt['core_settings_item_' . $id]);\n\t\t}\n\n\t\treturn $return_data;\n\t}",
"public function type_vars( ){\n\t\t\n\t\tglobal $disabled_settings;\n\t\t$alt = false;\n\t\tif ( is_array( $disabled_settings ) )\n\t\t\tif( !empty( $disabled_settings['typography'] ) )\n\t\t\t\t$alt = true;\n\t\t\n\t\t$vars = array(\n\t\t\t'plBaseFont'\t\t=> ($alt) ? '\"Helvetica\" Arial, serif' : pl_type_el('type_primary', 'stack'), \n\t\t\t'plBaseWeight'\t\t=> pl_type_el('type_primary', 'weight'), \n\t\t\t'plAltFont'\t\t\t=> ($alt) ? '\"Helvetica\" Arial, serif' : pl_type_el('type_secondary', 'stack'), \n\t\t\t'plAltWeight'\t\t=> pl_type_el('type_secondary', 'weight'), \n\t\t\t'plHeaderFont'\t\t=> ($alt) ? '\"Helvetica\" Arial, serif' : pl_type_el('type_headers', 'stack'), \n\t\t\t'plHeaderWeight'\t=> pl_type_el('type_headers', 'weight'),\n\t\t);\n\t\treturn $vars;\n\t}",
"public function vars()\n {\n return array_merge(parent::vars(), [\n 'user' => (string) $this->key->sysuser ? $this->key->sysuser->name : 'sitepilot',\n 'key' => (string) $this->key->key\n ]);\n }",
"public function getVars() {\r\n return $this->VARS;\r\n }",
"public function getAll(): array\n {\n return $this->variables;\n }",
"public function getVariables(): Mailcode_Variables_Collection_Regular;",
"public function getVars() {\n return array();\n }",
"public function getHeaderFooterVariables() {\n\t\t$vars = $this->request->getVars();\n\n\t\tunset(\n\t\t\t$vars['url'],\n\t\t\t$vars['flushtoken'],\n\t\t\t$vars['flush']\n\t\t);\n\n\t\tif (isset($vars['page']) && strpos($vars['page'], '§ion=') !== false) {\n\t\t\t$parts = explode('§', $vars['page']);\n\t\t\t$vars['page'] = $parts[0];\n\t\t\t$vars['section'] = str_replace('ion=', '', $parts[1]);\n\t\t}\n\n\t\t$string = '';\n\n\t\tforeach ($vars as $key => $value) {\n\t\t\t$string .= '<strong style=\"color: red;\">$' . $key . '</strong> => ' . $value . '<br>';\n\t\t}\n\n\t\t$htmlString = DBHTMLText::create();\n\t\t$htmlString->setValue($string);\n\n\t\t$vars['all_variables'] = $htmlString;\n\n\t\treturn $vars;\n\t}",
"function dumpInfo() {\n global $_dOp;\n $op = \"SECTION: $this->sectionName<br />\";\n $_dOp = '';\n foreach ($this->varList as $secID => $vars) {\n $op .= \" -- section ID: $secID<br />\";\n foreach ($vars as $varKey => $varTag) {\n if (is_array($varTag)) {\n foreach ($varTag as $varObj) {\n $op .= \" .... VAR: $varKey<br />\\n\";\n $aList = $varObj->getAttrList();\n foreach ($aList as $attr) {\n if ($attr == 'NAME')\n continue;\n $v = $varObj->getAttr($attr);\n if ($v === false)\n $v = 'false';\n if ($v === true)\n $v = 'true';\n if ($v === NULL)\n $v = '[not set]';\n \n $op .= \"........ $attr => \".$v.\"<br />\\n\";\n }\n }\n }\n else {\n $op .= \" .... VAR: $varKey<br />\\n\";\n $aList = $varTag->getAttrList();\n foreach ($aList as $attr) {\n if ($attr == 'NAME')\n continue;\n $v = $varTag->getAttr($attr);\n if ($v === false)\n $v = 'false';\n if ($v === true)\n $v = 'true';\n if ($v === NULL)\n $v = '[not set]';\n $op .= \"........ $attr => \".$v.\"<br />\\n\";\n }\n }\n }\n }\n return $op;\n }",
"public function getGlobals();",
"public function getGlobals();",
"public function __getVars(){\r\n $vars = isset($this->vars)? $this->vars:array();\r\n return $vars;\r\n }",
"function values( $vars ) {\n foreach($vars as $k=>$v) {\n $this->_vars[\"$k\"] = $v;\n }\n }",
"public function getGetVariables();",
"public function get_vars()\n\t{\n\t\treturn array(\"TsvOneFile\");\n\t}",
"public function getSetVariables() {}",
"public function getGlobals()\n {\n return [\n 'cache' => $this->flextype['cache'],\n ];\n }",
"protected static function initializeGlobalVariables() {}",
"function getVariableContainer() ;",
"public function getVariables ()\n {\n /**\n * Specification:\n * - itemkey used to identify variable in your other functions\n * - type text, textarea, yesno, password, hidden (type hidden are variables used by CE and are required)\n * - description description of the variable, displayed in ClientExec\n * - encryptable used to indicate the variable's value must be encrypted in the database\n */\n $variables = array(\n lang('Name') => array(\n 'type' => 'hidden',\n 'description' => lang('Used by ClientExec to display plugin. It must match the action function name(s).'),\n 'value' => 'InterWorx-CP'\n ),\n lang('Description') => array (\n 'type' => 'hidden',\n 'description' => lang('Description viewable by admin in server settings'),\n 'value' => lang('InterWorx-CP integration.')\n ),\n lang('Access Key') => array (\n 'type' => 'textarea',\n 'description' => lang('Access key used to authenticate to server.'),\n 'value' => '',\n 'encryptable' => true\n ),\n lang('Actions') => array (\n 'type' => 'hidden',\n 'description' => lang('Actions currently available for this plugin.'),\n 'value' => 'Create,Delete,Suspend,UnSuspend'\n )\n );\n\n return $variables;\n }",
"public static function variables(): array\n {\n return [\n Variable::make('id', __('Article Id')),\n\n Variable::make('name', __('Article Name')),\n\n Variable::make('summary', __('Article Summary')),\n\n Variable::make('url', __('Article URL')),\n\n Variable::make('hits', __('Article Hits')),\n\n Variable::make('creation_date', __('Article Creation Date')),\n\n Variable::make('last_update', __('Article Update Date')),\n\n Variable::make('author', __('Article Author')),\n\n Variable::make('image.templateName', __(\n 'Image with the required template (example: image.common-main)'\n )),\n ];\n }",
"function fill_general_variables()\n\t\t{\n\t\t\t//collect error messages before\n\t\t\t$this->message[] = $this->process_monitor->get_error(false, _DEBUG);\n\t\t\t$this->fill_form_variables();\n\t\t\t$this->t->set_var(array(\n\t\t\t\t'monitor_stats'\t\t\t=> $this->fill_monitor_stats($this->stats),\n\t\t\t));\n\t\t}",
"public function getGetVariables() {}",
"public function vars()\n\t{\n\t\treturn $this->vars;\n\t}",
"private function load_variables() : void {\n\t\t$this->today = new \\DateTime( 'NOW' );\n\t\t$this->start_date = new \\DateTime( FTW_START_DATE );\n\t\t$this->completion_date = new \\DateTime( FTW_COMPLETION_DATE );\n\t}",
"function register_globals() {\n\t\t$GLOBALS['weekday'] = $this->weekday;\n\t\t$GLOBALS['weekday_initial'] = $this->weekday_initial;\n\t\t$GLOBALS['weekday_abbrev'] = $this->weekday_abbrev;\n\t\t$GLOBALS['month'] = $this->month;\n\t\t$GLOBALS['month_abbrev'] = $this->month_abbrev;\n\t}",
"protected function GetDescriptionVariables()\n {\n return array();\n }",
"public function getGlobals()\n {\n }",
"public function getAvailableVariables() :array\n {\n return [];\n }",
"function _phptemplate_variables($hook, $vars) {\n if ($hook == 'page') {\n\n if ($secondary = menu_secondary_local_tasks()) {\n $output = '<span class=\"clear\"></span>';\n $output .= \"<ul class=\\\"tabs secondary\\\">\\n\". $secondary .\"</ul>\\n\";\n $vars['tabs2'] = $output;\n }\n\n // Hook into color.module\n if (module_exists('color')) {\n _color_page_alter($vars);\n }\n return $vars;\n }\n return array();\n}",
"static function getLangVars()\n\t{\n\t\treturn array(\"pc_mob\");\n\t}",
"public function initVarfromDefs() {\n foreach ($this->extconfigs->getextConfig('sccpDefaults') as $key => $value) {\n if (empty($this->sccpvalues[$key])) {\n $this->sccpvalues[$key] = array('keyword' => $key, 'data' => $value, 'type' => '0', 'seq' => '0');\n }\n }\n }",
"function reset_vars() {\n $this->page[\"Name\"] = \"\";\n $this->page[\"Bio\"] = \"\";\n\n // \"Name\" page:\n $this->main_photo = \"\";\n $this->fullname = \"\";\n $this->birthday = array();\n $this->actorsfilms = array();\n $this->producersfilms = array();\n $this->soundtrackfilms = array();\n $this->directorsfilms = array();\n $this->crewsfilms = array();\n $this->thanxfilms = array();\n $this->selffilms = array();\n $this->archivefilms = array();\n\n // \"Bio\" page:\n $this->birth_name = \"\";\n $this->nick_name = array();\n $this->bodyheight = array();\n $this->bio_bio = array();\n $this->bio_trivia = array();\n $this->bio_tm = array();\n $this->bio_salary = array();\n }",
"public function register_globals() {\n\t\t$GLOBALS['weekday'] = $this->weekday;\n\t\t$GLOBALS['weekday_initial'] = $this->weekday_initial;\n\t\t$GLOBALS['weekday_abbrev'] = $this->weekday_abbrev;\n\t\t$GLOBALS['month'] = $this->month;\n\t\t$GLOBALS['month_abbrev'] = $this->month_abbrev;\n\t}",
"public function getGlobals()\n {\n return [\n 'snippets' => new SnippetsTwig($this->flextype)\n ];\n }",
"protected function getVars()\n {\n if (!$this->vars) {\n $this->loadVarsByObjectType();\n }\n\n return $this->vars;\n }",
"public function define_sections() {\r\n\t\t$this->options->sections = $this->to_array();\n\t}",
"public function vars()\n {\n return $this->vars;\n }",
"private function initVars()\n {\n // template array variables\n $this->tplVar['art_pubdate'] = array();\n $this->tplVar['art_modifydate'] = array();\n }",
"public function parse($global_vars = array())\n {}",
"protected function parseVariable(): void\n {\n $sBaseUrl = $this->sBaseUrl;\n\n /**\n * $getCurrentTplName is used in \"variables.inc.php\" file\n */\n $getCurrentTplName = static function () use ($sBaseUrl) {\n $aDirs = explode('/', $sBaseUrl);\n return !empty($aDirs[2]) ? $aDirs[2] : PH7_DEFAULT_THEME;\n };\n\n $this->setVariables(include('variables.inc.php'));\n }",
"public function getScssVariables() {\n\t\treturn [\n\t\t\t'color-primary' => '#745bca'\n\t\t];\n\t}",
"public function getVariablesList() {\n return $this->_get(4);\n }",
"public function updateVaribles(){\n foreach( $this->globalVars as $key=>$val ){\n $this->template = str_replace( '%'. $key .'%', $val, $this->template );\n }\n }",
"function repeatVars(){\n\n\t\treturn FALSE;\n\t\n}",
"function spr_get_sections() {\n\tglobal $spr_sql_fields;\n\n\t$sql_tables = safe_pfx('txp_section');\n\t$rs = safe_query(\"SELECT \".$spr_sql_fields.\" FROM \".$sql_tables.\" WHERE name != 'default' ORDER BY name\");\n\twhile ($a = nextRow($rs)) {\n\t\textract($a); // set 'name','title','parent' etc in $a\n\t\t$out[$name] = $a;\n\t}\n\treturn $out;\n}",
"public function addVariables($tvs = array());",
"private function globals() {\n global $pagesArray;\n \n $xml = XML2Array::createArray(file_get_contents(GSDATAOTHERPATH.'website.xml'));\n \n // turn PRETTYURLS into boolean\n if ($xml['item']['PRETTYURLS']=='') $xml['item']['PRETTYURLS'] = false;\n else $xml['item']['PRETTYURLS'] = true;\n \n // globals array\n $globals = array(\n 'sitename' => $xml['item']['SITENAME']['@cdata'],\n 'siteurl' => $xml['item']['SITEURL']['@cdata'],\n 'template' => $xml['item']['TEMPLATE']['@cdata'],\n 'pages' => $pagesArray,\n 'permalink' => $xml['item']['PERMALINK'],\n 'prettyurls' => $xml['item']['PRETTYURLS'],\n );\n return $globals;\n }",
"public function loadAllVars()\n {\n $this->vars = $this->getEntityService()->findAll(EntityConstants::ITEM_VAR);\n return $this;\n }",
"public function getVariablesList() {\n return $this->_get(2);\n }",
"public function defineConstants ()\n {\n foreach ($this->data as $key => $value) {\n define(strtoupper($key), $value);\n }\n }",
"function getVars() {\n return $this->vars;\n }",
"private function _add_vars()\n\t{\n\t\t// --------------------------------------\n\t\t// Only continue if request is a page\n\t\t// and we have segments to check\n\t\t// --------------------------------------\n\n\t\tif (empty(ee()->uri->segments) && $this->settings['set_all_segments'] == 'n') return;\n\n\t\t// --------------------------------------\n\t\t// Initiate uri instance\n\t\t// --------------------------------------\n\n\t\t$this->uri = new EE_URI;\n\t\t$this->uri->_fetch_uri_string();\n\n\t\tif ($this->settings['ignore_pagination'] == 'y')\n\t\t{\n\t\t\t// Get rid of possible pagination segment at the end\n\t\t\t$this->uri->uri_string = preg_replace('#/[PC]\\d+$#', '', $this->uri->uri_string);\n\t\t}\n\n\t\t$this->uri->_explode_segments();\n\t\t$this->uri->_reindex_segments();\n\n\t\t// --------------------------------------\n\t\t// Suggestion by Leevi Graham:\n\t\t// check for pattern before continuing\n\t\t// --------------------------------------\n\n\t\tif ( ! empty($this->settings['uri_pattern']) && ! preg_match($this->settings['uri_pattern'], $this->uri->uri_string)) return;\n\n\t\t// --------------------------------------\n\t\t// Initiate some vars\n\t\t// $data is used to add to global vars\n\t\t// $cats is used to keep track of all category ids found\n\t\t// --------------------------------------\n\n\t\t$data = $cats = array();\n\n\t\t// Also initiate this single var to an empty string\n\t\t$data['segment_category_ids'] = '';\n\t\t$data['segment_category_ids_piped'] = '';\n\n\t\t// --------------------------------------\n\t\t// Number of segments to register - 9 is hardcoded maximum\n\t\t// --------------------------------------\n\n\t\t$num_segs = ($this->settings['set_all_segments'] == 'y') ? 9 : $this->uri->total_segments();\n\n\t\t// --------------------------------------\n\t\t// loop through segments and set data array thus: segment_1_category_id etc\n\t\t// --------------------------------------\n\n\t\tfor ($nr = 1; $nr <= $num_segs; $nr++)\n\t\t{\n\t\t\tforeach ($this->fields AS $field)\n\t\t\t{\n\t\t\t\t$data[\"segment_{$nr}_{$field}\"] = '';\n\t\t\t}\n\t\t}\n\n\t\t// Initiate last segment vars\n\t\tforeach ($this->fields AS $field)\n\t\t{\n\t\t\t$data[\"last_segment_{$field}\"] = '';\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Force lowercase segment array\n\t\t// --------------------------------------\n\n\t\t$segment_array = array_map('strtolower', $this->uri->segment_array());\n\n\t\t// --------------------------------------\n\t\t// Execute the rest only if there are segments to check\n\t\t// --------------------------------------\n\n\t\tif ($segment_array)\n\t\t{\n\t\t\t// --------------------------------------\n\t\t\t// Query database for these segments\n\t\t\t// Use lowercase for case insensitive comparison,\n\t\t\t// for when DB collation is case sensitive\n\t\t\t// --------------------------------------\n\n\t\t\tee()->db->select('cat_url_title, '. implode(', ', array_keys($this->fields)))\n\t\t\t ->from('categories')\n\t\t\t ->where('site_id', $this->site_id)\n\t\t\t ->where_in('cat_url_title', $segment_array);\n\n\t\t\t// --------------------------------------\n\t\t\t// Filter by category groups set in settings\n\t\t\t// --------------------------------------\n\n\t\t\tif (isset($this->settings['category_groups']))\n\t\t\t{\n\t\t\t\tif ($groups = array_filter($this->settings['category_groups']))\n\t\t\t\t{\n\t\t\t\t\tee()->db->where_in('group_id', $groups);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// --------------------------------------\n\t\t\t// Execute query and get results\n\t\t\t// --------------------------------------\n\n\t\t\t$query = ee()->db->get();\n\n\t\t\t// --------------------------------------\n\t\t\t// If we have matching categories, continue...\n\t\t\t// --------------------------------------\n\n\t\t\tif ($query->num_rows())\n\t\t\t{\n\t\t\t\t// --------------------------------------\n\t\t\t\t// Associate the results\n\t\t\t\t// --------------------------------------\n\n\t\t\t\t$rows = $this->_associate_results($query->result_array(), 'cat_url_title');\n\n\t\t\t\t// --------------------------------------\n\t\t\t\t// Load typography if private var is set\n\t\t\t\t// --------------------------------------\n\n\t\t\t\tif ($this->format || $this->settings['parse_file_paths'] == 'y')\n\t\t\t\t{\n\t\t\t\t\tee()->load->library('typography');\n\t\t\t\t}\n\n\t\t\t\t// --------------------------------------\n\t\t\t\t// loop through segments\n\t\t\t\t// --------------------------------------\n\n\t\t\t\tforeach ($segment_array as $n => $seg)\n\t\t\t\t{\n\t\t\t\t\t// Skip non-matching segments\n\t\t\t\t\tif ( ! isset($rows[$seg])) continue;\n\n\t\t\t\t\t// Get the category row\n\t\t\t\t\t$row = $rows[$seg];\n\n\t\t\t\t\t// Overwrite values in data array\n\t\t\t\t\tforeach ($this->fields AS $name => $field)\n\t\t\t\t\t{\n\t\t\t\t\t\t// Format category name if private var is set\n\t\t\t\t\t\tif ($name == 'cat_name' && $this->format)\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$row[$name] = ee()->typography->format_characters($row[$name]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Parse file paths\n\t\t\t\t\t\tif ($name == 'cat_image' && $this->settings['parse_file_paths'] == 'y')\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t$row[$name] = ee()->typography->parse_file_paths($row[$name]);\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t// Set value in for segment_x_yyy\n\t\t\t\t\t\t$data[\"segment_{$n}_{$field}\"] = $row[$name];\n\t\t\t\t\t}\n\n\t\t\t\t\t// Add found id to cats array\n\t\t\t\t\t$cats[] = $row['cat_id'];\n\t\t\t\t}\n\n\t\t\t\t// --------------------------------------\n\t\t\t\t// Set last_segment_category_x vars\n\t\t\t\t// --------------------------------------\n\n\t\t\t\t$last = $this->uri->total_segments();\n\n\t\t\t\tforeach ($this->fields AS $name => $field)\n\t\t\t\t{\n\t\t\t\t\t$data['last_segment_'.$field] = $data['segment_'.$last.'_'.$field];\n\t\t\t\t}\n\n\t\t\t\t// --------------------------------------\n\t\t\t\t// Create inclusive stack of all category ids present in segments\n\t\t\t\t// --------------------------------------\n\n\t\t\t\t$data['segment_category_ids'] = implode('&',$cats);\n\t\t\t\t$data['segment_category_ids_piped'] = implode('|',$cats);\n\t\t\t}\n\t\t}\n\n\t\t// --------------------------------------\n\t\t// Finally, add data to global vars\n\t\t// Swapping $data and existing global vars makes a difference in EE2.4+\n\t\t// --------------------------------------\n\n\t\tee()->config->_global_vars = array_merge(ee()->config->_global_vars, $data);\n\t\t//ee()->config->_global_vars = array_merge($data, ee()->config->_global_vars);\n\t}",
"public function get_macros () {\n\t\treturn array(\n\t\t\t'site_name' => get_bloginfo('name', 'display'),\n\t\t\t'site_description' => get_bloginfo('description', 'display'),\n\t\t);\n\t}",
"public function tracking_vars( $vars ) {\n\n\t\t$vars['itsec_away_mode'] = array(\n\t\t\t'enabled' => '0:b',\n\t\t\t'type' => '0:b',\n\t\t);\n\n\t\treturn $vars;\n\n\t}",
"function setup_vars() {\r\n\t\t$this->post_type = get_current_screen()->post_type;\r\n\t\t$this->taxonomies = array_diff(get_object_taxonomies($this->post_type), get_taxonomies(array('show_admin_column' => 'false')));\r\n\t}",
"public static function variables(): array\n {\n return [ \n Variable::make('method', __('Login form method')), \n Variable::make('action', __('Login form action')), \n Variable::make('token_field', __('Name of the csrf_token field')), \n Variable::make('token_value', __('The csrf_token field value')), \n Variable::make('widget_field', __('Name of the widget field')), \n Variable::make('widget_value', __('The widget field value')), \n\n Variable::make('username_field', __('Name of the username/email field')), \n Variable::make('username_error', __('The username/email field error')), \n Variable::make('username_value', __('The username/email field old value')), \n\n Variable::make('password_field', __('Name of the password field')), \n Variable::make('password_error', __('The password field error')), \n\n Variable::make('remember_field', __('Name of the remember field')), \n Variable::make('remember_checked', __('The remember field checked status')), \n Variable::make('registration_page', __('The registration page url')), \n ];\n }",
"public function gen_section(){\n $data = array(\n \"txtinicio\"=>\"Inicio\",\n \"rutainicio\" => \"/admin/inicio\",\n \"txtmodulo\" => \"CONTABILIDAD\",\n \"section\" => \"Contabilidad\",\n \"rutamodulo\" => \"/admin/tipocuenta\",\n \"ventana\" => \"Niveles\"\n );\n\n return $data;\n }",
"function getTemplateVars() {\n return array();\n }",
"public function setSectionVars($sectionVars) {\n $this->sectionVars = $sectionVars;\n }",
"private static function printAll() {\r\n\t\tforeach (self::$global as $type) {\r\n\t\t\t$type->dump();\r\n\t\t}\r\n\t}",
"public static function fromGlobals() {}",
"public function getVars()\n\t{\n\t\treturn $this->vars;\n\t}",
"public function getGlobals()\n {\n return array();\n }",
"public function getGlobals()\n {\n return array();\n }",
"function processGetVars()\n {\n //assignGetIfExists ( $fullList, NULL, 'full' );\n //$this->fullList = (bool) $fullList;\n self::dumpThis();\n }",
"protected function variables()\n {\n $this->variables['grid'] = $this;\n\n return $this->variables;\n }",
"public function clearVars() {\n\t\t$this->_engine->clearAllAssign();\n\t}",
"function asp_parse_options() {\r\r\n foreach ( wd_asp()->o as $def_k => $o ) {\r\r\n if ( preg_match(\"/\\_def$/\", $def_k) ) {\r\r\n $ok = preg_replace(\"/\\_def$/\", '', $def_k);\r\r\n\r\r\n // Dang, I messed up this elegant solution..\r\r\n if ( $ok == \"asp_it\")\r\r\n $ok = \"asp_it_options\";\r\r\n\r\r\n wd_asp()->o[$ok] = asp_decode_params( get_option($ok, wd_asp()->o[$def_k]) );\r\r\n wd_asp()->o[$ok] = array_merge(wd_asp()->o[$def_k], wd_asp()->o[$ok]);\r\r\n }\r\r\n }\r\r\n // Long previous version compatibility\r\r\n if ( wd_asp()->o['asp_caching'] === false )\r\r\n wd_asp()->o['asp_caching'] = wd_asp()->o['asp_caching_def'];\r\r\n\r\r\n // The globals are a sitewide options\r\r\n wd_asp()->o['asp_glob'] = get_site_option('asp_glob', wd_asp()->o['asp_glob_d']);\r\r\n wd_asp()->o['asp_glob'] = array_merge(wd_asp()->o['asp_glob_d'], wd_asp()->o['asp_glob']);\r\r\n}",
"public function getCookieVariables();",
"static function get_all() {\r\n\t\t\treturn array(\r\n\t\t\t\tself::PAGES_POSTS => array(__('Access List of Posts','seo-pressor'),__('Access to the list of Posts and Pages with SEOPressor information','seo-pressor'))\r\n\t\t\t\t, self::SEO_EDIT_BOX => array(__('Access Score Box','seo-pressor'),__('Access to SEOPressor Box in Post add and edit page','seo-pressor'))\r\n\t\t\t\t, self::ADMIN => array(__('Full Access','seo-pressor'),__('Full Access, including administrative options','seo-pressor'))\r\n\t\t\t\t, self::SET_MIN_SCORE => array(__('Access Settings and set Minimum Score','seo-pressor'),__('Permission to access to global Settings including the access to set the Minimum Score on Advanced Settings tab','seo-pressor'))\r\n\t\t\t\t, self::SET_NOT_MIN_SCORE => array(__('Access Settings without access to set Minimum Score','seo-pressor'),__('Permission to access to global Settings without permission to set the Minimum Score on Advanced Settings tab','seo-pressor'))\r\n\t\t\t\t, self::SETTINGS_TAB => array(__('Access SEOPressor Menu','seo-pressor'),__('Permission to access SEOPressor menu in backend','seo-pressor'))\r\n\t\t\t);\r\n\t\t}",
"public function getVars()\n {\n return $this->vars;\n }",
"public function sections()\n {\n }",
"function runkit_superglobals()\n{\n}",
"public function provideVariables()\n {\n return [\n 'first test' => [\n 'variables' => [\n 'var1' => 'val1',\n 'var2' => 'val2',\n 'var3' => 'val3',\n ],\n ]\n ];\n }",
"public function getAssignedVars()\n {\n return $this->_vars;\n }",
"function import_record_vars() {\r\n while (list($key, $val) = each($this->Record))\r\n if (ereg(\"[A-Za-z][A-Za-z0-9_]*\", $key)) {\r\n $field_name = strtoupper($key); \r\n\t global $$field_name;\r\n\t $$field_name=$val;\r\n }; \r\n }",
"public function getTemplateVariables(): array;",
"public function _js_vars()\n {\n }",
"function get_assigned_variables() {\n\n $assigns = array();\n $protected = get_class_vars(get_class($this));\n\n foreach (get_object_vars($this) as $var => $value) {\n if (!array_key_exists($var, $protected)) {\n $assigns[$var] =& $this->$var;\n }\n }\n\n $assigns['controller'] = $this;\n\n return $assigns;\n }",
"public function getVars(){\n return $this->getClassVars()->getValues();\n }",
"function repeatVars(){\n\n\n\n\treturn FALSE;\n\n}",
"public function __allSections()\n\t{\n\t\t//current user course\n\t\t$userCourse = $this->Session->read('UserData.usersCourses');\n\t\t$user_course_section = $userCourse[0];\n\t\t//get Course and section name\n\t\t$course_info = $this->getCourseNameOfUser($user_course_section);\n\t\t$course_name = $course_info->course_name;\n\t\t$course_section = $course_info->section_name;\n\t\t$sectionList = array();\n\t\t//getting the course in section/all section setting(changed on 16 April, 2014)\n\t $setting = $this->__getDbSetting($user_course_section);\n\t\tif ($setting == 2) {\n\t\t\t$sections = $this->PleSetting->find('all',array('conditions'=>array('PleSetting.course'=>$course_name,'PleSetting.setting_value'=>2),'fields'=>array('section')));\n\t\t\tforeach ($sections as $section) {\n\t\t\t\t$sectionList[] = trim($section['PleSetting']['section']);\n\t\t\t}\n\t\t\t$sectionList[] = $course_section;\n\t } else {\n\t\t\t//add current user login section\n\t\t\t$sectionList[] = $course_section;\n\t }\n\t\t$tz = array_unique($sectionList);\n\t\treturn $tz;\n\t}",
"function _getSectionTypes()\n {\n return array(\n ST_NORMAL => \"Běžná sekce\",\n ST_TASKS => \"Úkoly (česky)\",\n ST_TASKS_EN => \"Úkoly (anglicky)\",\n ST_URLS => \"Odkazy\",\n ST_DOWNLOAD => \"Download\",\n ST_EXCLIST => \"Seznam cvičení\",\n ST_PHYLAB => \"Laboratorní cvičení\"\n );\n }",
"public function getVariables()\n {\n $variables = $this->getVariablesForPart($this->tempDocumentMainPart);\n\n foreach ($this->tempDocumentHeaders as $headerXML) {\n $variables = array_merge($variables, $this->getVariablesForPart($headerXML));\n }\n\n foreach ($this->tempDocumentFooters as $footerXML) {\n $variables = array_merge($variables, $this->getVariablesForPart($footerXML));\n }\n\n return array_unique($variables);\n }",
"public function read($section) {\n $values = parent::read($section);\n\n switch ($section) {\n case 'smarty':\n if (!array_key_exists('compile', $values)) {\n $values['compile'] = array();\n }\n\n $values['compile']['directory'] = Module::getTempDirectory('smarty')->getPath();\n\n break;\n case 'system':\n if (!array_key_exists('session', $values)) {\n $values['session'] = array();\n }\n\n $values['session']['path'] = Module::getTempDirectory('session')->getPath();\n\n break;\n }\n\n return $values;\n }",
"protected function getVars()\n {\n return array_merge(parent::getVars(),get_object_vars($this));\n }"
]
| [
"0.64037246",
"0.6156868",
"0.6054236",
"0.5944303",
"0.5928813",
"0.58267266",
"0.58267266",
"0.5817624",
"0.57504004",
"0.5694989",
"0.55645",
"0.5540699",
"0.5513652",
"0.5509266",
"0.550325",
"0.5500928",
"0.54632753",
"0.54389477",
"0.54296577",
"0.53964216",
"0.53936875",
"0.5366915",
"0.5366555",
"0.5366555",
"0.5358691",
"0.53551257",
"0.5321449",
"0.53213847",
"0.5303938",
"0.52876174",
"0.5284769",
"0.52816415",
"0.5267964",
"0.5253172",
"0.52447003",
"0.5242797",
"0.52396274",
"0.5233487",
"0.52266014",
"0.52090997",
"0.5195678",
"0.5187363",
"0.51859856",
"0.5183369",
"0.51720095",
"0.51610816",
"0.51562506",
"0.51464975",
"0.51286453",
"0.5116065",
"0.5104122",
"0.50932634",
"0.50874263",
"0.5083408",
"0.50817114",
"0.50780463",
"0.50533867",
"0.50529164",
"0.50492424",
"0.5043212",
"0.5042407",
"0.50421363",
"0.50413865",
"0.5036074",
"0.5026501",
"0.5020956",
"0.5014705",
"0.5006277",
"0.5005187",
"0.50010836",
"0.50007",
"0.49974295",
"0.49941602",
"0.49938887",
"0.49931702",
"0.49917036",
"0.49789575",
"0.49789575",
"0.49772137",
"0.49705186",
"0.49647614",
"0.49595475",
"0.49574375",
"0.49502695",
"0.49492034",
"0.49487722",
"0.49468905",
"0.4946509",
"0.49458086",
"0.4944851",
"0.49316704",
"0.49303427",
"0.49271354",
"0.492325",
"0.49197155",
"0.4910938",
"0.4906985",
"0.48985836",
"0.48945552",
"0.48938435"
]
| 0.5172209 | 44 |
/ / Set variables identifiers to their values / | public function HandleVariables($value, $replaces)
{
$result = $value;
if (!is_array($result)) {
if (preg_match_all("/%%([A-Z0-9_:]+)%%/", $result, $match) !== false) {
if (is_array($match) && is_array($match[0])) {
foreach ($match[0] as $k => $v) {
$var = str_replace("%%", "", $v);
$var = strtolower($var);
list($section, $key) = explode(":", $var);
$varValue = null;
if ($section == "var") {
if (array_key_exists($key, $replaces)) {
$varValue = $replaces[$key];
}
}
if (!isset($varValue)) {
$varValue = $this->Get($section, $key, "");
}
$result = str_replace($v, $varValue, $result);
}
}
}
}
return $result;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function set($variables) {\n foreach ($variables as $key => $value) {\n $this->vars[$key] = $value;\n }\n }",
"function values( $vars ) {\n foreach($vars as $k=>$v) {\n $this->_vars[\"$k\"] = $v;\n }\n }",
"public function setVariables(array $variables);",
"public function getSetVariables() {}",
"public function set(string $variableName, $value): void;",
"public function setVariables( $variables ) {\n\t\t$this->variables = $variables;\n\t}",
"function drush_variable_realm_set($realm_name, $realm_key, $variable_name, $value) {\n variable_realm_set($realm_name, $realm_key, $variable_name, $value);\n drush_print('Variable set.');\n}",
"function set_var($var_name, $var_value)\r\n\t{\r\n\t\tif (is_array($var_value)) \r\n\t\t{\r\n\t\t\tforeach($var_value as $key=>$value)\r\n\t\t\t{\r\n\t\t\t\t$this->set_var($var_name . '.' . $key, $value); // recursion for array branches\r\n\t\t\t}\r\n\t\t}\r\n\t\telse // normal variable\r\n\t\t{\r\n\t\t\t$this->vars[$var_name] = $var_value;\r\n\t\t}\r\n\t}",
"protected function remebmer_variable( $name, $value ){\n\t\tstatic::$instance->variables[$name] = $value;\n\t}",
"public function assignVars($values) {\n\t\tforeach ($this->_vars as $key => $var) {\n\t\t\t$value = (!isset($values[$key]))?null:$values[$key];\n\t\t\t$this->_vars[$key]->set($value);\n\t\t}\n\t}",
"function associateVariablesWithBlocks() {\n $varRefNo = 0;\n $activeBlockNo = 0;\n $nextBlockNo = 1;\n while ($varRefNo < $this->varRefTabCnt) {\n $vrtr =& $this->varRefTab[$varRefNo];\n $varRefTPos = $vrtr['tPosBegin'];\n $varNo = $vrtr['varNo'];\n if ($varRefTPos >= $this->blockTab[$activeBlockNo]['tPosEnd']) {\n $activeBlockNo = $this->blockTab[$activeBlockNo]['parentBlockNo'];\n continue; }\n if ($nextBlockNo < $this->blockTabCnt) {\n if ($varRefTPos >= $this->blockTab[$nextBlockNo]['tPosBegin']) {\n $activeBlockNo = $nextBlockNo;\n $nextBlockNo += 1;\n continue; }}\n $btr =& $this->blockTab[$activeBlockNo];\n if ($varRefTPos < $btr['tPosBegin'])\n $this->programLogicError(1);\n $blockVarNo = $btr['blockVarCnt']++;\n $btr['blockVarNoToVarNoMap'][$blockVarNo] = $varNo;\n if ($btr['firstVarRefNo'] == -1)\n $btr['firstVarRefNo'] = $varRefNo;\n $vrtr['blockNo'] = $activeBlockNo;\n $vrtr['blockVarNo'] = $blockVarNo;\n $varRefNo += 1; }}",
"public function __set ($variableName, $value) {\n // write\n }",
"public function setVar($key, $value);",
"function setVar() {\n\t\t\n\t\t$_argv = func_get_args();\n\t\t$_argc = func_num_args();\n\t\t\n\t\t// load vars\n\t\t$vars = getVars();\n\t\tif (!$_GET[\"__shared__\"][\"vars\"]) {\n\t\t\t$_GET[\"__shared__\"][\"vars\"] = array();\n\t\t}\n\t\tforeach ($vars as $varNamespace => $varArray) {\n\t\t\t$_GET[\"__shared__\"][\"vars\"][$varNamespace] = $varArray;\n\t\t}\n\t\t\n\t\t// Register namespace if not existing\n\t\tif (!$_GET[\"__shared__\"][\"vars\"][$_argv[0]]) {\n\t\t\t$_GET[\"__shared__\"][\"vars\"][$_argv[0]] = array();\n\t\t}\n\t\tif ($_argc == 2) {\n\t\t\tif (is_array($_argv[1])) {\n\t\t\t\tforeach ($_argv[1] as $var => $val) {\n\t\t\t\t\t$_GET[\"__shared__\"][\"vars\"][$_argv[0]][$var] = $val;\n\t\t\t\t}\n\t\t\t}\n\t\t} elseif ($_argc == 3) {\n\t\t\t$_GET[\"__shared__\"][\"vars\"][$_argv[0]][$_argv[1]] = $_argv[2];\n\t\t}\n\t\t\n\t\t// save vars\n\t\t\n\t\tsaveVars();\n\t}",
"function set($name, $value){\n\t\t$this->vars[$name] = $value;\n\t}",
"public function assign_variables($variables = array())\n\t{\n\t\tif (is_array($variables))\n\t\t{\n\t\t\tforeach ($variables as $name => $val)\n\t\t\t{\n\t\t\t\t$this->assign($name, $val);\n\t\t\t}\n\t\t}\n\t}",
"public function setVariables(array $variables)\n {\n // get them into a serializable state\n $data = array();\n foreach ($variables as $variableName => $variable) {\n if (is_scalar($variable)) {\n $data[$variableName] = $variable;\n } else if (is_array($variable)) {\n $data[$variableName] = array_keys($variable);\n } else if (is_object($variable)) {\n $data[$variableName] = get_class($variable);\n } else {\n $data[$variableName] = (string)$variable;\n }\n }\n\n $this->variables = $data;\n }",
"public function updateVaribles(){\n foreach( $this->globalVars as $key=>$val ){\n $this->template = str_replace( '%'. $key .'%', $val, $this->template );\n }\n }",
"public function set_vars($vars)\n\t{\n\t\t$this->vars = array_merge($this->vars, $vars);\n\t}",
"protected function initVars() {\n\n\t\t}",
"public function set($variable, $value);",
"public function clearVars() {\n\t\t$this->_engine->clearAllAssign();\n\t}",
"public function setVariables(array $variables)\n {\n foreach ($this->variables as $k => $v) {\n $this->setVariable($k, $v);\n }\n }",
"public function variable_set($name, $value) {\n // TODO\n variable_set($name, $value);\n }",
"public function setVariables(array $vars)\r\n {\r\n // Assign the variables into the Smarty machine\r\n require_once APPLICATION_PATH . '/../library/Smarty/Smarty.class.php';\r\n $smarty = new Smarty();\r\n foreach ($vars as $key => $value) {\r\n $smarty->assign($key, $value);\r\n }\r\n }",
"protected function assign_variables($vars) {\n $this->out->assign_vars($vars);\n }",
"public function assign($name, $value){\r\n\t\t$this->vars[$name] = $value; \r\n\t}",
"function set($name, $value) {\r\n $this->vars[$name] = $value;\r\n }",
"public function setValues(){\n if($this->getType() == \"var\"){\n $this->setValue($this->getArg());\n }else if($this->getType() == \"int\"){\n $pos = strpos($this->getArg(), \"@\");\n $this->setValue(substr($this->getArg(), $pos+1));\n }else if($this->getType() == \"bool\"){\n $pos = strpos($this->getArg(), \"@\");\n $this->setValue(substr($this->getArg(), $pos+1));\n }else if($this->getType() == \"string\"){\n $pos = strpos($this->getArg(), \"@\");\n $this->setValue(substr($this->getArg(), $pos+1));\n }else if($this->getType() == \"nil\"){\n $pos = strpos($this->getArg(), \"@\");\n $this->setValue(substr($this->getArg(), $pos+1));\n }else if($this->getType() == \"label\"){\n $this->setValue($this->getArg());\n }else if($this->getType() == \"type\"){\n $this->setValue($this->getArg());\n }else{\n $this->setValue(\"CHYBA\");\n }\n }",
"function setVariable($v) {\n ecrire_meta('antispam_'.$v, $_POST[$v]);\n}",
"public function setVars( array $vars ) {\n $this->vars += $vars;\n }",
"function __set($name, $value) {\n\t\t\t\t\tif (!empty($name)) {\n\t\t\t\t\t\t$this->vars[$name] = $value;\n\t\t\t\t\t}\n\t\t\t\t}",
"function set_var($name, $value){ // set the template variable\n\tif (func_num_args()> 2){\n\t\tif (!$this->in_vars($name)) $this->vars[$name] = array();\n\t\t$this->vars[$name][func_get_arg(2)] = $value;\n\t} else $this->vars[$name] = $value;\n}",
"function set($name, $value) {\n $this->vars[$name] = $value; //is_object($value) ? $value->fetch() : $value;\n }",
"function __set($name, $value) {\n $this->vars[$name] = $value;\n }",
"function assign($var,$val) {\n\t\t$this->_viewVars[$var]=$val;\n\t}",
"protected function init()\n {\n $arVariablesExtend = Event::fire(self::EVENT_EXTEND_VARIABLES, []);\n\n foreach ($arVariablesExtend as $iIndex => $arExtend)\n {\n foreach ($arExtend as $sKey => $arVariable) {\n if (in_array($sKey, $this->arVariables)) {\n continue;\n }\n\n // Add to variables\n $this->arVariables[$sKey] = $arVariable;\n }\n }\n }",
"function import_record_vars() {\r\n while (list($key, $val) = each($this->Record))\r\n if (ereg(\"[A-Za-z][A-Za-z0-9_]*\", $key)) {\r\n $field_name = strtoupper($key); \r\n\t global $$field_name;\r\n\t $$field_name=$val;\r\n }; \r\n }",
"function _set( $varname, $value, $scope='' ){\n if( $scope=='global' ){\n $this->ctx[0]['_scope_'][$varname] = $value;\n return;\n }\n\n if( $scope=='parent' ){\n for( $x=count($this->ctx)-1; $x>=0; $x-- ){\n if( isset($this->ctx[$x]['_scope_']) && isset($this->ctx[$x]['_scope_'][$varname]) ){\n $this->ctx[$x]['_scope_'][$varname] = $value;\n return;\n }\n }\n }\n\n for( $x=count($this->ctx)-1; $x>=0; $x-- ){\n if( isset($this->ctx[$x]['_scope_']) ){\n $this->ctx[$x]['_scope_'][$varname] = $value;\n return;\n }\n }\n\n }",
"public function assign($variable , $value)\n {\n $this->data[$variable] = $value;\n }",
"public function assignVars(array $args)\n {\n $this->vars = array_merge( $this->vars , $args );\n }",
"public function assign($name,$value);",
"function setIdentifier($val) {\n $this->identifier = $this->updateDB('identifier', $val);\n }",
"public function __set($varName, $value) {\n\t\t$this->add($varName, $value);\n\t}",
"public function bindVariables() {\n foreach($this->response as $key => $val) {\n $this->response_source->bindVariable($key, $val);\n }\n }",
"public function __set($key, $var){\n\t\t$this->vars[$key] = $var;\n\t}",
"function assign_var($varname, $varval)\n\t{\n\t\t$this->vars[$varname] = $varval;\n\n\t\treturn true;\n\t}",
"public function setVar($name, $value)\n {\n $this->var_holder->set($name, $value);\n }",
"public function assignNames($names);",
"function dbSetVars() {\n\n foreach ($this->fields() as $f) {\n if ($this->$f === false) continue;\n $this->db->set($f,$this->$f);\n }\n\n }",
"public function setVariables($variables = [])\n {\n $this->variables = $this->getVariables($variables);\n }",
"public function set_vars($args)\n\t{\n\t\tforeach ($args as $key => $value) {\n\t\t\t$key = lc(str_replace(\"post_\", \"\", trim($key)));\n\t\t\t$this->$key = $value;\n\t\t}\n\t\t\n\t\t$this->category = element(\"name\", $this->_cat->get_cat($this->category));\n\t}",
"public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n $this->vars['value'] = $this->getLoadValue();\n $this->vars['model'] = $this->model;\n }",
"abstract protected function prepareVars(array $data);",
"public function setVariable($key, $value)\n {\n $key = strtolower($key);\n $this->variables[$key] = $value;\n }",
"function e($var_nm)\n{\n\tglobal $$var_nm ;\n\n\treturn '$' . $var_nm . ' = ' . $$var_nm . ' ' ;\n}",
"public function set($identifier, $variable) {\n\t\t$this->storage[$identifier] = $variable;\n\t\treturn $this;\n\t}",
"public function change_one_global() {\n $var_name = $GLOBALS['test_var'];\n $GLOBALS[ $var_name ] = rand_str();\n }",
"public static function loadVars(){\n\t\tif(!self::$vars){\n\t\t\tself::$vars = self::getDefaultVars();\n\t\t}\n\t\tforeach(func_get_args() as $arg){\n\t\t\tforeach($arg as $key=> $value){\n\t\t\t\tself::$vars[$key] = self::fillTokens($value);\n\t\t\t}\n\t\t}\n\t\treturn self::$vars;\n\t}",
"public function doVariable($name, &$value): void\n {\n switch ($name) {\n case 'b':\n $value = 4;\n break;\n }\n }",
"public function addVariable($name, $value);",
"private function resetVars()\n {\n $this->response = $this->calls = array();\n $this->hasCalls = $this->isBatchCall = false;\n }",
"public function prepareVars()\n {\n $this->vars['name'] = $this->formField->getName();\n\n $this->vars['model'] = $this->model;\n $this->vars['category'] = Kategory::where(\"is_active\", \"1\")->lists('name', 'id');\n if (!empty($this->getLoadValue())) {\n $a= $this->vars['value'] = $this->getLoadValue();\n } else {\n $a= $this->vars['value'] = [];\n }\n }",
"function addVar($varName,$value)\n {\n $this->VARS[${'varName'}][0] = $varName;\n $this->VARS[${'varName'}][1] = $value;\n }",
"public function addVariables($tvs = array());",
"public function setVar($name, $value) {\n\t\t$this->vars[$name] = $value;\n\t}",
"public function __set($name, $value)\n {\n $this->variables[$name] = $value;\n }",
"private static function getVariableIdentifier($namespace, $valueid)\r\n {\r\n return $namespace.'__'.$valueid;\r\n }",
"public function __set($key, $value)\n\t{\n\t\tswitch ($key) {\n\t\t\tcase 'variables':\n\t\t\t\t$this->vars['variables'] = array_merge($this->vars['variables'], $value);\n\t\t\tbreak;\n\t\t\tcase 'css':\n\t\t\tcase 'js':\n\t\t\t\tif (!empty($this->vars[$key])) {\n\t\t\t\t\t$this->vars[$key] .= ', '.$value;\n\t\t\t\t} else {\n\t\t\t\t\t$this->vars[$key] = $value;\n\t\t\t\t}\t\t \n\t\t\tbreak;\n\t\t\tdefault:\n\t\t\t\t$this->vars[$key] = $value;\n\t\t}\t\n\t}",
"public function __set($name, $value)\n {\n $this->__variables[(string) $name] = $value;\n }",
"function assign_var_from_handle($varname, $handle)\n\t{\n\t\tob_start();\n\t\t$res = $this->pparse($handle);\n\t\t$this->vars[$varname] = ob_get_contents();\n\t\tob_end_clean();\n\t\treturn $res;\n\t}",
"public function setVariable($key, $value, & $data) {\n\n if (strpos($key, $this->scopeGlue) === false) {\n $parts = explode('.', $key);\n } else {\n $parts = explode($this->scopeGlue, $key);\n }\n\n $i = 0;\n $count = count($parts);\n $d = & $data;\n\n while ($i < $count) {\n\n $key_part = $parts[$i];\n $key_part_int = filter_var($key_part, FILTER_VALIDATE_INT);\n $key_part_is_int = $key_part_int !== false;\n $set_value = ($i + 1) == $count;\n\n if ($key_part_is_int && is_object($d)) {\n $d = (array) $d;\n }\n\n if (!is_array($d) && !is_object($d)) {\n $d = array();\n }\n\n if (is_array($d)) {\n\n if ($key_part_is_int && !array_key_exists($key_part, $d)) {\n $key_part = $key_part_int;\n }\n\n if ($set_value) {\n\n $d[$key_part] = $value;\n\n } else {\n\n if (!isset($d[$key_part])) {\n $d[$key_part] = array();\n }\n\n $d = & $d[$key_part];\n }\n\n } else {\n\n if ($set_value) {\n\n $d->{$key_part} = $value;\n\n } else {\n\n if (!property_exists($d, $key_part)) {\n $d->{$key_part} = array();\n }\n\n $d = & $d->{$key_part};\n }\n }\n\n $i++;\n }\n }",
"protected function parseVariable(): void\n {\n $sBaseUrl = $this->sBaseUrl;\n\n /**\n * $getCurrentTplName is used in \"variables.inc.php\" file\n */\n $getCurrentTplName = static function () use ($sBaseUrl) {\n $aDirs = explode('/', $sBaseUrl);\n return !empty($aDirs[2]) ? $aDirs[2] : PH7_DEFAULT_THEME;\n };\n\n $this->setVariables(include('variables.inc.php'));\n }",
"public function prepareVars()\n {\n $this->vars['value'] = $this->getKeyValue();\n $this->vars['field'] = $this->formField;\n $this->vars['nameValue'] = $this->getNameValue();\n $this->vars['descriptionValue'] = $this->getDescriptionValue();\n $this->vars['addresses'] = $this->getAddresses();\n $this->vars['listWidget'] = $this->listWidget;\n $this->vars['searchWidget'] = $this->searchWidget;\n\n $this->vars['title'] = $this->title;\n $this->vars['prompt'] = str_replace('%s', '<i class=\"icon-th-list\"></i>', e(trans($this->prompt)));\n\n }",
"function assign_vars($vararray)\n\t{\n\t\tforeach($vararray as $key => $val)\n\t\t{\n\t\t\t$this->vars[$key] = $val;\n\t\t}\n\t\treturn true;\n\t}",
"public function __set(string $name, $value)\n {\n self::$variables[$name] = $value;\n }",
"function cps_changeset_publish_batch_variables(&$context) {\n $item = $context['results']['entity'];\n foreach ($item->variables as $name => $value) {\n db_merge('variable')->key(array('name' => $name))->fields(array('value' => serialize($value)))->execute();\n }\n cache_clear_all('variables', 'cache_bootstrap');\n $context['message'] = t('Publishing variables');\n}",
"public function setVars($var_arr, $not_gpc = false) {\n\t\tforeach ($var_arr as $key => $value) {\n\t\t\t$this->setVar($key, $value, $not_gpc);\n\t\t}\n\t}",
"public function __set(string $name, $value): void\n {\n $this->variables[$name] = $value;\n }",
"function addVars($node, $vars) {\n\tforeach ($vars as $name=>$val) {\n\t\t$var = $node->data->addChild('var', $val);\n\t\t$var->addAttribute('name', $name);\n\t}\n}",
"public function set()\n {\n // to reflect the current bar.\n\n // Why?\n\n // Otherwise the bar count gets repeated. And that people notice.\n\n $this->variables->setVariable(\"count\", $this->bar_count);\n $this->variables->setVariable(\"max_bar_count\", $this->max_bar_count);\n\n $this->variables->setVariable(\"refreshed_at\", $this->current_time);\n }",
"function set($name, $value) {\n $args = func_get_args();\n $cnt = count($args);\n // we check for odd number of args => missing values...\n if ($cnt % 2 == 0 && $cnt >= 2 ) {\n for ($i=0; $i < $cnt; $i += 2) {\n $name = $args[$i];\n $value = $args[$i + 1];\n $this->vars[$name] = ($value instanceof Template) ? $value->fetch() : $value;\n }\n } \n }",
"public static function setVar($varname, $varvalue){\n $_SESSION[sha1(Engine::getAppName())][$varname] = $varvalue;\n }",
"public function assignTemplateVariable($varName, $varValue);",
"public function insertVars($vars) {\n\t\t$this->vars = array_merge($this->vars, $vars);\n\t}",
"protected function setVarToTemplates()\n {\n $this->templates->set_tpl($this->varName, $this->checkNewCommondaty());\n }",
"public function __set($name, $value) {\n\t\t$this->_vars[$name]->set($value);\n\t}",
"public function prepareVars()\n {\n if ($this->showLogRelations !== null) {\n $this->showLogRelations = (array) $this->showLogRelations;\n }\n\n $this->vars['name'] = $this->formField->getName();\n $this->vars['model'] = $this->model;\n $this->vars['showUndoChangesButton'] = $this->showUndoChangesButton;\n }",
"public function setVarsNames(array $varsNames)\n {\n $this->varsNames = $varsNames;\n }",
"function SetVar( $var, $value )\r\n {\r\n $this->_vars[$var] = $value;\r\n }",
"private function loadSesionVars() {\r\n\r\n $this->VARS = array(); \r\n\r\n $this->updateSessionExpireTime();\r\n\r\n $dati = $this->selectSessionVars();\r\n\r\n foreach($dati as $infos) { \r\n $this->VARS[$infos[\"name\"]]=unserialize($infos[\"value\"]);\r\n }\r\n\r\n }",
"public function assignVar($key, &$value) {\n\t\t$this->_vars[$key]->value = $value;\n\t}",
"function getVariableContainer() ;",
"private function _setClassVars(){\n $this->_classVars = new Vars($this);\n }",
"private function load_variables() : void {\n\t\t$this->today = new \\DateTime( 'NOW' );\n\t\t$this->start_date = new \\DateTime( FTW_START_DATE );\n\t\t$this->completion_date = new \\DateTime( FTW_COMPLETION_DATE );\n\t}",
"function assign_vars_array($name, $value)\n\t{\n\t\t$this->_vars[$name][] = $value;\n\t}",
"public function SetCustomVars()\n\t\t{\n\t\t\t$this->_variables['displayname'] = array(\"name\" => GetLang($this->_languagePrefix.'DisplayName'),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang('DisplayNameHelp'),\n\t\t\t \"default\" => $this->GetName(),\n\t\t\t \"required\" => true\n\t\t\t);\n\n\t\t\t$this->_variables['productid'] = array(\"name\" => GetLang($this->_languagePrefix.'ProductId'),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang($this->_languagePrefix.'ProductIdHelp'),\n\t\t\t \"default\" => \"\",\n\t\t\t \"required\" => true\n\t\t\t);\n\n\t\t\t$this->_variables['sharedsecret'] = array(\"name\" => GetLang($this->_languagePrefix.'SharedSecret'),\n\t\t\t \"type\" => \"textbox\",\n\t\t\t \"help\" => GetLang($this->_languagePrefix.'SharedSecretHelp'),\n\t\t\t \"default\" => \"\",\n\t\t\t \"required\" => true\n\t\t\t);\n\t\t}",
"public function setIdentifiers($identifiers)\n {\n $this->identifiers = $identifiers;\n }",
"public function setVariable($name, $var)\n {\n $this->vars[$name] = $var;\n }",
"public function assign($variable, $value)\n\t{\n\t\t$this->data[$variable] = $value;\n\t}",
"public function assignVar($name, $value) {\n $this->tpl_vars[$name] = $value;\n }"
]
| [
"0.68203837",
"0.6311686",
"0.6256787",
"0.6154357",
"0.6037132",
"0.59880847",
"0.5987253",
"0.5950732",
"0.5947951",
"0.59316796",
"0.59084207",
"0.589317",
"0.5891044",
"0.5886939",
"0.5861121",
"0.58610904",
"0.5860567",
"0.5794206",
"0.5784444",
"0.5777445",
"0.577512",
"0.57676864",
"0.57619846",
"0.5754686",
"0.57410353",
"0.5713693",
"0.5713509",
"0.56898206",
"0.5686813",
"0.5674637",
"0.5671313",
"0.56632036",
"0.56499875",
"0.56361043",
"0.56116635",
"0.5607685",
"0.5594534",
"0.55834246",
"0.5574293",
"0.5572924",
"0.5522411",
"0.55141664",
"0.5511364",
"0.549503",
"0.54607314",
"0.5443448",
"0.5443329",
"0.544137",
"0.5440303",
"0.5437007",
"0.54348946",
"0.54269385",
"0.54258245",
"0.54081506",
"0.53989756",
"0.538694",
"0.5386754",
"0.5384831",
"0.53705984",
"0.53695863",
"0.53509116",
"0.53406936",
"0.5337802",
"0.5330981",
"0.5329493",
"0.5321465",
"0.5304795",
"0.53045726",
"0.5293037",
"0.5289638",
"0.52816844",
"0.52784306",
"0.52775687",
"0.52645904",
"0.52617013",
"0.52526784",
"0.52520144",
"0.5247018",
"0.5246468",
"0.5241408",
"0.52285224",
"0.5227881",
"0.5227052",
"0.52181023",
"0.5207947",
"0.5202817",
"0.51929903",
"0.5179149",
"0.5177619",
"0.5176013",
"0.51701176",
"0.5168636",
"0.5168228",
"0.51640207",
"0.51631683",
"0.51606",
"0.5158829",
"0.5153386",
"0.5152607",
"0.51514566",
"0.5148256"
]
| 0.0 | -1 |
Determine if the user is authorized to make this request. | public function authorize()
{
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function authorize()\n {\n if ($this->user() !== null) {\n return true;\n }\n return false;\n }",
"public function authorize()\n {\n return $this->user() !== null;\n }",
"public function authorize()\n {\n return $this->user() !== null;\n }",
"public function authorize()\n {\n return $this->user() != null;\n }",
"public function authorize(): bool\n {\n return $this->user() !== null;\n }",
"public function authorize(): bool\n {\n return $this->isUserAuthorised();\n }",
"public function authorize()\n {\n return !is_null($this->user());\n }",
"public function authorize()\n {\n return request()->user() != null;\n }",
"public function authorize()\n\t{\n\t\t// if user is updating his profile or a user is an admin\n\t\tif( $this->user()->isSuperAdmin() || !$this->route('user') ){\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function authorize()\n {\n // this was my best guess\n return $this->user()->id === $this->route('user')->id;\n }",
"public function isAuthorized()\n {\n return $this->cookieHelper->requestCookieExists('auth');\n }",
"public function authorize()\n {\n return !empty(Auth::user()) && ($this->user()->isAnAdmin() || $this->user()->hasRole('user'));\n }",
"public function authorize()\n {\n $originAccount = Account::find($this->get('origin_account_id'));\n return $originAccount->user_id == auth()->id();\n }",
"public function authorize()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default:\n return $this->user()->type == 'App\\\\Staff' ? true : false;\n break;\n }\n\n return false;\n }",
"public function authorize()\n {\n if($this->user()->role == \"admin\" || $this->user()->id == $this->request->get('author_id')) return true;\n else return false;\n }",
"public function authorize()\n {\n if(\\Auth::guest())\n {\n return false;\n } else {\n // Action 1 - Check if authenticated user is a superadmin\n if(\\Auth::User()->hasRole('superadmin'))\n return true;\n\n // Action 2 - Find UUID from request and compare to authenticated user\n $user = User::where('uuid', $this->user_uuid)->firstOrFail();\n if($user->id == \\Auth::User()->id)\n return true;\n\n // Action 3 - Fail request\n return false;\n }\n }",
"public function authorize()\n {\n $this->model = $this->route('user');\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }",
"public function isAuthorized(): bool\n {\n // TODO: implement authorization check\n\n return true;\n }",
"public function isAuthorized() {}",
"public function authorize()\n {\n return request()->loggedin_role === 1;\n }",
"public function authorize()\n {\n $this->model = $this->route('user');\n\n if ($this->isEdit() && !is_null($this->model)) {\n if (!user()->hasPermissionTo('Administrations::admin.user') && $this->model->id != user()->id) {\n return false;\n }\n }\n\n $this->model = is_null($this->model) ? User::class : $this->model;\n\n return $this->isAuthorized();\n }",
"public function authorize()\n {\n $accessor = $this->user();\n\n return $accessor->isAdmin() || $accessor->hasKey('post-users');\n }",
"public function authorize()\n {\n $user = \\Auth::getUser();\n\n return $user->user_type == 1;\n }",
"public function authorize()\n {\n return auth()->check() ? true : false;\n }",
"public function authorize()\n {\n return auth()->check() ? true : false;\n }",
"public function authorize()\n {\n /**\n * @var User $user\n * @var Document $document\n */\n $user = Auth::user();\n $document = $this->route('document');\n\n return (int)$user->id === (int)$document->user_id;\n }",
"public function authorize()\n {\n switch (true) {\n case $this->wantsToList():\n case $this->wantsToShow():\n if ($this->hasRoles(['owner', 'administrator'])) {\n return true;\n }\n break;\n case $this->wantsToStore():\n case $this->wantsToUpdate():\n case $this->wantsToDestroy():\n if ($this->hasRoles(['owner'])) {\n return true;\n }\n break;\n }\n\n return false;\n }",
"public function authorize()\n {\n $user = JWTAuth::parseToken()->authenticate();\n $organisation = Organization::findOrFail($this->route('organizations'));\n return $organisation->admin_id == $user->id;\n }",
"public function authorize()\n {\n if($this->user()->isAdmin())\n return true;\n\n return false;\n }",
"function isAuthorized()\n {\n $authorized = parent::isAuthorized();\n return $authorized;\n }",
"public function authorize()\n {\n $user = auth('web')->user();\n if ($user && $user->active) {\n return true;\n }\n\n return false;\n }",
"public function authorize()\n {\n $this->user = User::query()->find($this->route()->parameter('user'));\n $this->merge(['verified' => $this->get('verified') ? 1 : 0]);\n\n return true;\n }",
"public function authorize()\n {\n $user = request()->user('api');\n return $user->isSenior();\n }",
"public function authorize()\n {\n return is_client_or_staff();\n }",
"public function isAuthorized() {\n\t\treturn true;\n\t}",
"public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }",
"public function authorize()\n {\n switch ($this->method()) {\n case 'POST':\n return true;\n case 'GET':\n default:\n {\n return false;\n }\n }\n }",
"public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin'])) {\n return true;\n } else {\n return false;\n }\n }",
"public function isAuthorized()\n\t{\n\t\t$sessionVal = Yii::$app->session->get($this->sessionParam);\n\t\treturn (!empty($sessionVal));\n\t}",
"public function authorize() {\n\n return auth()->user() && auth()->user()->username === $this->user->username;\n }",
"public function authorize()\n {\n return session('storefront_key') || request()->session()->has('api_credential');\n }",
"public function authorize()\n {\n if ($this->user()->isAdmin($this->route('organization'))) {\n return true;\n }\n\n return false;\n\n }",
"public function authorize()\n {\n return $this->user() && $this->user()->role === Constants::USER_ROLE_ADMIN;\n }",
"public function authorized()\n {\n return $this->accepted && ! $this->test_mode;\n }",
"public function authorize()\n {\n if (!auth()->check()) {\n return false;\n }\n return true;\n }",
"public function hasAuthorized() {\n return $this->_has(1);\n }",
"public function authorize()\n {\n $resource = Resource::find($this->route('id'));\n\n if (!$resource) {\n return true;\n }\n\n return $resource && $this->user()->can('access', $resource);\n }",
"public function authorize()\n {\n /*\n if ($this->loan_id && is_numeric($this->loan_id) && $loan = Loan::whereId($this->loan_id)->first()) {\n // loan_id belongs to requesting user\n return $loan && $this->user()->id == $loan->user_id;\n }\n */\n return true; // let rules handle it\n }",
"public function authorize()\n {\n //TODO Authorice Request (without Controller)\n return auth()->user()->role_id === 1;\n }",
"public function authorize(): bool\n {\n return $this->user()->id === $this->article->user->id;\n }",
"public function isAuth()\n {\n return $this->session->hasAuthorisation();\n }",
"public function authorize()\n {\n return $this->user()->rol == 'admin' ? true : false;\n }",
"public function authorize()\n {\n if(Auth::user())\n {\n return true;\n }\n else\n {\n return false;\n }\n }",
"public function authorize()\n {\n //Check if user is authorized to access this page\n if($this->user()->authorizeRoles(['admin', 'hrmanager', 'hruser'])) {\n return true;\n } else {\n return false;\n }\n }",
"public function authorize()\n {\n return \\Auth::check() ? true : false;\n }",
"public function authorize()\n\t{\n\t\treturn true; //no user checking\n\t}",
"public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }",
"public function authorize()\n {\n return $this->user()->id === $this->route('report')->user_id;\n }",
"public function authorize()\n {\n return !empty(Auth::user());\n }",
"public function authorize()\n {\n return $this->groupHasUser() || $this->hasSeller();\n }",
"public function isAuthorized() {\n\t\t\n\t}",
"public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}",
"public function authorize()\n\t{\n\t\t//@todo check with perissions\n\t\treturn (request()->user()->user_type == ADMIN_USER);\n\t}",
"public function authorize()\n {\n if(Auth::check())\n {\n return (Auth::user()->has_world_admin_access);\n }\n return false;\n }",
"public function authorize()\n {\n if (!\\Auth::guest()) {\n $user = \\Auth::getUser();\n if ($user->type == User::USER_TYPE_ADMIN) {\n return true;\n }\n }\n\n return false;\n }",
"public function authorize()\n {\n if (auth()->user()->is_admin) {\n return true;\n }\n return false;\n }",
"public function authorize()\n {\n if ($this->user()->is_admin){\n return true;\n }\n else if ($this->method == \"PUT\"){\n if ($this->user()->id == $this->input('id')){\n return true;\n }\n }\n return false;\n }",
"public function authorize(): bool\n {\n return parent::authorize() && (int)$this->playList->user_id === auth()->user()->id;\n }",
"public function authorize() {\n\t\treturn $this->user()->is_admin;\n\t}",
"public function authorize()\n {\n if (Auth::check()) {\n \n return true;\n \n }\n return false;\n }",
"public function authorize()\n {\n $user = Auth::user();\n return $user && $user->rol == 'admin';\n }",
"public function authorize()\n\t{\n\t\t// Nutzern akzeptiert werden\n\t\tif(Auth::check())\n\t\t{\n\t\t\treturn true;\n\t\t}\n\t\treturn false;\n\t}",
"public function authorize()\n {\n // TODO: Check if has business\n return session()->has('id');\n }",
"public function authorize()\n {\n return $this->auth->check();\n }",
"public function authorize()\n {\n if (auth()->check() && auth()->user()->isAdmin()) {\n return true;\n }\n\n return false;\n }",
"public function authorize() {\n\t\t$user = \\Auth::user();\n\n\t\tif ( $user->isAdmin() ) {\n\t\t\treturn true;\n\t\t}\n\n\t\treturn false;\n\t}",
"public function authorize()\n {\n if (auth()->user()->isAdmin() || auth()->user()->isCustomer()) {\n return true;\n }\n return false;\n }",
"public function authorize()\n {\n return $this->container['auth']->check();\n }",
"function isAuthorized($request) {\n return true;\n }",
"public function authorize()\n {\n return Auth::guest() || isMember();\n }",
"public function authorize()\n {\n return auth()->user() && auth()->user()->isCeo();\n }",
"public function authorize(): bool\n {\n $deckId = $this->request->get('deck_id');\n $userId = Deck::whereKey($deckId)->value('user_id');\n\n return $userId === user()->id;\n }",
"public function authorize()\n {\n return Auth::check() && Auth::user()->is_contractor;\n }",
"public function authorize()\n {\n return TRUE;\n }",
"public function authorize()\n {\n $user = User::find($this->id);\n\n if (!$user) {\n $user = User::where('no_ahli', $this->no_ahli)->first();\n }\n if ($user && $user->id == auth()->user()->id) return true;\n if (auth()->user()->is('admin')) return true;\n\n return false;\n }",
"public function authorize()\n {\n # if it's false, it will rejected\n return true;\n }",
"public function authorize()\n {\n $isValid = auth()->user()->is($this->route('task')->attempt->checklist->owner);\n\n return $isValid;\n }",
"public function authorize()\n {\n $user = Auth::user();\n\n return ($user->getRole() == 'admin');\n }",
"public function is_authorized() {\n\t\t$authorized = true;\n\t\tif ( $this->is_access_token_expired() ) {\n\t\t\t$authorized = false;\n\t\t}\n\n\t\treturn $authorized;\n\t}",
"public function authorize()\n {\n $user = User::findOrFail($this->route('id'));\n\n return $user->hasRole('admin') || $user->hasRole('teacher');\n }",
"public function authorize()\n {\n $project = \\App\\Project::find($this->request->get('project'));\n return $project && $project->isManager($this->user()->name);\n }",
"public function isAuthorized() {\n\t\treturn (bool)$this->_storage->hasData();\n\t}",
"public function authorize()\n {\n // User system not implemented\n return true;\n }",
"public function authorize() : bool\n {\n // TODO check request to xhr in middleware\n return true;\n }",
"public function authorize()\n {\n $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.839992",
"0.8375952",
"0.8375952",
"0.8342815",
"0.8252745",
"0.82473254",
"0.8211478",
"0.81453574",
"0.810956",
"0.80823004",
"0.79912364",
"0.7989508",
"0.7982261",
"0.7959524",
"0.79507357",
"0.7948338",
"0.79256135",
"0.79145455",
"0.79002494",
"0.7893071",
"0.7889318",
"0.7889047",
"0.7859889",
"0.78410757",
"0.78410757",
"0.783742",
"0.7823091",
"0.7812151",
"0.7807754",
"0.77919126",
"0.7786674",
"0.7781593",
"0.7780777",
"0.7762826",
"0.7753834",
"0.77178144",
"0.77178144",
"0.771564",
"0.77118343",
"0.77043885",
"0.7693797",
"0.7691735",
"0.76900935",
"0.76898056",
"0.76733977",
"0.76662993",
"0.7664653",
"0.76545596",
"0.764996",
"0.7642534",
"0.764228",
"0.7641884",
"0.7634402",
"0.762985",
"0.76291037",
"0.7626811",
"0.76197964",
"0.76197964",
"0.76127744",
"0.76032645",
"0.7603009",
"0.7601598",
"0.7601598",
"0.7600797",
"0.7598501",
"0.75954676",
"0.75872594",
"0.7584999",
"0.7580122",
"0.756261",
"0.7553521",
"0.7551973",
"0.75506663",
"0.7544154",
"0.754182",
"0.7538652",
"0.7537086",
"0.7529288",
"0.75156945",
"0.7513393",
"0.74994284",
"0.74953514",
"0.7494652",
"0.7491306",
"0.7486971",
"0.74858564",
"0.74782985",
"0.74769115",
"0.7471861",
"0.7470534",
"0.7463947",
"0.74632055",
"0.74620247",
"0.7461856",
"0.7460523",
"0.7448737",
"0.7438837",
"0.7435204",
"0.74337536",
"0.7430899",
"0.74234605"
]
| 0.0 | -1 |
Get the validation rules that apply to the request. | public function rules()
{
$input = $this->all();
if (isset($input['tipopessoa']) && $input['tipopessoa'] == '1') {
return [
'usuario_operacao_id' => 'required',
'titulo' => 'required|max:30',
'data_criacao' => 'required',
'cep' => 'required|max:8',
'rua' => 'required|max:68',
'numero' => 'required|max:20',
'bairro' => 'required|max:40',
'municipio' => 'required|max:50',
'uf' => 'required|max:2',
'nome' => 'required|max:50',
'telefone' => 'required|max:11',
'email' => 'required|max:60',
'itens' => 'required|min:5'
];
} else {
return [
'usuario_operacao_id' => 'required',
'titulo' => 'required|max:30',
'data_criacao' => 'required',
'cep' => 'required|max:8',
'rua' => 'required|max:68',
'numero' => 'required|max:20',
'bairro' => 'required|max:40',
'municipio' => 'required|max:50',
'uf' => 'required|max:2',
'nome' => 'required|max:50',
'telefone' => 'required|max:11',
'email' => 'required|max:60',
'itens' => 'required|min:5',
'faturamento_id' => 'required'
];
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function rules()\n {\n $commons = [\n\n ];\n return get_request_rules($this, $commons);\n }",
"public function getRules()\n {\n return $this->validator->getRules();\n }",
"public function getValidationRules()\n {\n $rules = [];\n\n // Get the schema\n $schema = $this->getSchema();\n\n return $schema->getRules($this);\n }",
"public function rules()\n {\n return $this->validationRules;\n }",
"public function rules()\n {\n $rules = [];\n switch ($this->getMethod()):\n case \"POST\":\n $rules = [\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"PUT\":\n $rules = [\n 'id' => 'required|numeric',\n 'course_id' => 'required|numeric',\n 'questions' => 'required|array',\n ];\n break;\n case \"DELETE\":\n $rules = [\n 'id' => 'required|numeric'\n ];\n break;\n endswitch;\n return $rules;\n }",
"public static function getRules()\n {\n return (new static)->getValidationRules();\n }",
"public function getRules()\n {\n return $this->validation_rules;\n }",
"public function getValidationRules()\n {\n return [];\n }",
"public function getValidationRules() {\n return [\n 'email' => 'required|email',\n 'name' => 'required|min:3',\n 'password' => 'required',\n ];\n }",
"public function rules()\n {\n if($this->isMethod('post')){\n return $this->post_rules();\n }\n if($this->isMethod('put')){\n return $this->put_rules();\n }\n }",
"public function rules()\n {\n $rules = [];\n\n // Validation request for stripe keys for stripe if stripe status in active\n if($this->has('stripe_status')){\n $rules[\"api_key\"] = \"required\";\n $rules[\"api_secret\"] = \"required\";\n $rules[\"webhook_key\"] = \"required\";\n }\n\n if($this->has('razorpay_status')){\n $rules[\"razorpay_key\"] = \"required\";\n $rules[\"razorpay_secret\"] = \"required\";\n $rules[\"razorpay_webhook_secret\"] = \"required\";\n }\n\n // Validation request for paypal keys for paypal if paypal status in active\n if($this->has('paypal_status')){\n $rules[\"paypal_client_id\"] = \"required\";\n $rules[\"paypal_secret\"] = \"required\";\n $rules[\"paypal_mode\"] = \"required_if:paypal_status,on|in:sandbox,live\";\n }\n\n\n return $rules;\n }",
"protected function getValidationRules()\n {\n $rules = [\n 'title' => 'required|min:3|max:255',\n ];\n\n return $rules;\n }",
"public function getRules()\n\t{\n\t\t$rules['user_id'] = ['required', 'exists:' . app()->make(User::class)->getTable() . ',id'];\n\t\t$rules['org_id'] = ['required', 'exists:' . app()->make(Org::class)->getTable() . ',id'];\n\t\t$rules['role'] = ['required', 'string', 'in:' . implode(',', Static::ROLES)];\n\t\t$rules['scopes'] = ['nullable', 'array'];\n\t\t$rules['ended_at'] = ['nullable', 'date'];\n\t\t$rules['photo_url'] = ['nullable', 'string'];\n\n\t\treturn $rules;\n\t}",
"public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n case 'PUT':\n return [\n 'username' => 'required|max:255',\n 'user_id' => 'required',\n 'mobile' => 'required|regex:/^1[34578][0-9]{9}$/',\n 'birthday' => 'required',\n 'cycle_id' => 'required',\n 'expired_at' => 'required',\n 'card_price' => 'required',\n ];\n }\n }",
"public function rules()\n {\n\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'min:6|same:password',\n 'role_id' => 'required'\n ];\n break;\n case 'PUT':\n case 'PATCH':\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n\n default:\n $rules = [\n 'name' => 'required|max:255',\n 'email' => 'required|email|max:255|unique:users,email,'.$this->id,\n ];\n break;\n }\n return $rules;\n }",
"public function rules()\n {\n return $this->rules;\n }",
"public function rules()\n {\n return $this->rules;\n }",
"public function rules()\n {\n return $this->rules;\n }",
"public function rules()\n {\n return $this->rules;\n }",
"public function rules()\n {\n return $this->rules;\n }",
"public function rules()\n {\n return $this->rules;\n }",
"public function rules()\n {\n switch($this->method()) {\n case 'GET':\n return [];\n case 'POST':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'name' => 'required|max:50',\n 'company' => 'required|max:100',\n 'position' => 'required|max:50',\n 'email' => 'required|email|max:150',\n 'phone' => 'required|max:25',\n 'description' => 'nullable|max:500',\n ];\n case 'DELETE':\n return [];\n default:break;\n }\n \n }",
"public function rules($request) {\n $function = explode(\"@\", $request->route()[1]['uses'])[1];\n return $this->getRouteValidateRule($this->rules, $function);\n // // 获取请求验证的函数名\n // // ltrim(strstr($a,'@'),'@')\n // if (count(explode(\"@\", Request::route()->getActionName())) >= 2) {\n // $actionFunctionName = explode(\"@\", Request::route()->getActionName()) [1];\n // }\n\n // // 取配置并返回\n // if (isset($this->rules[$actionFunctionName])) {\n // if (is_array($this->rules[$actionFunctionName])) {\n // return $this->rules[$actionFunctionName];\n // }\n // else {\n // return $this->rules[$this->rules[$actionFunctionName]];\n // }\n // }\n // else {\n // return [];\n // }\n }",
"function getValidationRules() {\n\t\treturn array(\n\t\t\t'_MovieID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CountryID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_BroadCastDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t\t'_CreatedDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}",
"public function rules()\n {\n if ($this->method() === 'POST') {\n return $this->rulesForCreating();\n }\n\n return $this->rulesForUpdating();\n }",
"public function rules()\n {\n $validation = [];\n if ($this->method() == \"POST\") {\n $validation = [\n 'name' => 'required|unique:users',\n 'email' => 'required|unique:users|email',\n 'password' => 'required|min:6|confirmed',\n 'password_confirmation' => 'required|min:6',\n 'roles' => 'required',\n ];\n } elseif ($this->method() == \"PUT\") {\n $validation = [\n 'name' => 'required|unique:users,name,' . $this->route()->parameter('id') . ',id',\n 'email' => 'required|unique:users,email,' . $this->route()->parameter('id') . ',id|email',\n 'roles' => 'required',\n ];\n\n if ($this->request->get('change_password') == true) {\n $validation['password'] = 'required|min:6|confirmed';\n $validation['password_confirmation'] = 'required|min:6';\n }\n }\n\n return $validation;\n }",
"protected function getValidationRules()\n {\n $class = $this->model;\n\n return $class::$rules;\n }",
"public function rules()\n {\n $data = $this->request->all();\n $rules['username'] = 'required|email';\n $rules['password'] = 'required'; \n\n return $rules;\n }",
"public function rules()\n {\n $rules = $this->rules;\n\n $rules['fee'] = 'required|integer';\n $rules['phone'] = 'required|min:8|max:20';\n $rules['facebook'] = 'required|url';\n $rules['youtube'] = 'required|url';\n $rules['web'] = 'url';\n\n $rules['requestgender'] = 'required';\n $rules['serviceaddress'] = 'required|max:150';\n $rules['servicetime'] = 'required|max:150';\n $rules['language'] = 'required|max:150';\n $rules['bust'] = 'required|max:100|integer';\n $rules['waistline'] = 'required|max:100|integer';\n $rules['hips'] = 'required|max:100|integer';\n $rules['motto'] = 'max:50';\n\n return $rules;\n }",
"protected function getValidRules()\n {\n return $this->validRules;\n }",
"public function rules()\n {\n switch($this->method())\n {\n case 'GET':\n case 'DELETE':\n {\n return [];\n }\n case 'POST':\n case 'PUT':\n {\n return [\n 'name' => 'required',\n ];\n }\n default:break;\n }\n }",
"public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'POST':\n {\n return [\n 'mobile' => ['required','max:11','min:11'],\n 'code' => ['required','max:6','min:6'],\n 'avatar' => ['required'],\n 'wx_oauth' => ['required'],\n 'password' => ['nullable','min:6','max:20']\n ];\n }\n case 'PUT':\n case 'PATCH':\n case 'DELETE':\n default: {\n return [];\n }\n }\n }",
"public function rules()\n {\n switch ($this->getRequestMethod()) {\n case 'index':\n return [\n 'full_name' => 'nullable|string',\n 'phone' => 'nullable|string',\n ];\n break;\n case 'store':\n return [\n 'crm_resource_id' => 'required|exists:crm_resources,id',\n 'channel' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$channel),\n 'call_status' => 'required|in:' . get_validate_in_string(CrmResourceCallLog::$call_statuses),\n ];\n break;\n default:\n return [];\n break;\n }\n }",
"public function rules()\n {\n //With password\n if(request('password') || request('password_confirmation')) {\n return array_merge($this->passwordRules(), $this->defaultRules());\n }\n //Without password\n return $this->defaultRules();\n }",
"public function rules()\n {\n $rules = [\n '_token' => 'required'\n ];\n\n foreach($this->request->get('emails') as $key => $val) {\n $rules['emails.'.$key] = 'required|email';\n }\n\n return $rules;\n }",
"function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CoverImageID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_TrackID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Status' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_Rank' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_CreateDate' => array(\n\t\t\t\t'dateTime' => array(),\n\t\t\t),\n\t\t);\n\t}",
"public function rules()\n { \n return $this->rules;\n }",
"public function getValidationRules()\n {\n if (method_exists($this, 'rules')) {\n return $this->rules();\n }\n\n $table = $this->getTable();\n $cacheKey = 'validate.' . $table;\n\n if (config('validate.cache') && Cache::has($cacheKey)) {\n return Cache::get($cacheKey);\n }\n\n // Get table info for model and generate rules\n $manager = DB::connection()->getDoctrineSchemaManager();\n $details = $manager->listTableDetails($table);\n $foreignKeys = $manager->listTableForeignKeys($table);\n\n $this->generateRules($details, $foreignKeys);\n\n if (config('validate.cache')) {\n Cache::forever($cacheKey, $this->rules);\n }\n\n return $this->rules;\n }",
"public function getValidationRules()\n {\n $rules = $this->getBasicValidationRules();\n\n if (in_array($this->type, ['char', 'string', 'text', 'enum'])) {\n $rules[] = 'string';\n if (in_array($this->type, ['char', 'string']) && isset($this->arguments[0])) {\n $rules[] = 'max:' . $this->arguments[0];\n }\n } elseif (in_array($this->type, ['timestamp', 'date', 'dateTime', 'dateTimeTz'])) {\n $rules[] = 'date';\n } elseif (str_contains(strtolower($this->type), 'integer')) {\n $rules[] = 'integer';\n } elseif (str_contains(strtolower($this->type), 'decimal')) {\n $rules[] = 'numeric';\n } elseif (in_array($this->type, ['boolean'])) {\n $rules[] = 'boolean';\n } elseif ($this->type == 'enum' && count($this->arguments)) {\n $rules[] = 'in:' . join(',', $this->arguments);\n }\n\n return [$this->name => join('|', $rules)];\n }",
"public function rules()\n {\n $rules = [];\n if ($this->isMethod('post')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n } elseif ($this->isMethod('put')) {\n $rules = [\n 'vacancy_name' => 'required|string|min:4|max:20',\n 'workers_amount' => 'required|integer|min:1|max:10',\n 'organization_id'=> 'required|integer|exists:organizations,id',\n 'salary' => 'required|integer|min:1|max:10000000',\n ];\n }\n return $rules;\n }",
"public function validationRules()\n {\n return [];\n }",
"public function rules()\n {\n $rules = $this->rules;\n if(Request::isMethod('PATCH')){\n $rules['mg_name'] = 'required|min:2,max:16';\n }\n return $rules;\n }",
"function getValidationRules() {\n\t\treturn array(\n\t\t\t'_ID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_EventID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_SourceID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_UserID' => array(\n\t\t\t\t'number' => array(),\n\t\t\t),\n\t\t\t'_HasEvent' => array(\n\t\t\t\t'inArray' => array('values' => array(self::HASEVENT_0, self::HASEVENT_1),),\n\t\t\t),\n\t\t);\n\t}",
"public function rules()\n {\n $rules = [];\n switch ($this->method()){\n case 'GET':\n $rules['mobile'] = ['required', 'regex:/^1[3456789]\\d{9}$/'];\n break;\n case 'POST':\n if($this->route()->getActionMethod() == 'sms') {\n $rules['area_code'] = ['digits_between:1,6'];\n if(in_array($this->get('type'), ['signup', 'reset_pay_pwd'])) {\n $rules['mobile'] = ['required', 'digits_between:5,20'];\n if($this->get('type') == 'signup' && !$this->get('area_code')) {\n $this->error('请选择区号');\n }\n }\n $rules['type'] = ['required', Rule::in(\\App\\Models\\Captcha::getSmsType())];\n }\n break;\n }\n return $rules;\n }",
"public function rules()\n {\n if ($this->isMethod('post')) {\n return $this->createRules();\n } elseif ($this->isMethod('put')) {\n return $this->updateRules();\n }\n }",
"public function rules()\n {\n $rules = [\n 'first_name' => ['required'],\n 'birthdate' => ['required', 'date', 'before:today'],\n ];\n\n if (is_international_session()) {\n $rules['email'] = ['required', 'email'];\n }\n\n if (should_collect_international_phone()) {\n $rules['phone'] = ['phone'];\n }\n\n if (is_domestic_session()) {\n $rules['phone'] = ['required', 'phone'];\n }\n\n return $rules;\n }",
"public function rules()\n {\n dd($this->request->get('answer'));\n foreach ($this->request->get('answer') as $key => $val)\n {\n $rules['answer.'.$key] = 'required';\n }\n\n return $rules;\n }",
"public function rules()\n {\n return static::$rules;\n }",
"function getRules() {\n\t\t$fields = $this->getFields();\n\t\t$allRules = array();\n\n\t\tforeach ($fields as $field) {\n\t\t\t$fieldRules = $field->getValidationRules();\n\t\t\t$allRules[$field->getName()] = $fieldRules;\n\t\t}\n\n\t\treturn $allRules;\n\t}",
"public static function getValidationRules(): array\n {\n return [\n 'name' => 'required|string|min:1|max:255',\n 'version' => 'required|float',\n 'type' => 'required|string',\n ];\n }",
"public function rules()\n {\n $rules = [\n 'name' => 'required',\n 'phone' => 'required|numeric',\n 'subject' => 'required',\n 'message' => 'required',\n 'email' => 'required|email',\n ];\n\n return $rules;\n }",
"public function getValidationRules(): array\n {\n return [\n 'email_address' => 'required|email',\n 'email_type' => 'nullable|in:html,text',\n 'status' => 'required|in:subscribed,unsubscribed,cleaned,pending',\n 'merge_fields' => 'nullable|array',\n 'interests' => 'nullable|array',\n 'language' => 'nullable|string',\n 'vip' => 'nullable|boolean',\n 'location' => 'nullable|array',\n 'location.latitude' => ['regex:/^[-]?(([0-8]?[0-9])\\.(\\d+))|(90(\\.0+)?)$/'], \n 'location.longitude' => ['regex:/^[-]?((((1[0-7][0-9])|([0-9]?[0-9]))\\.(\\d+))|180(\\.0+)?)$/'],\n 'marketing_permissions' => 'nullable|array',\n 'tags' => 'nullable|array'\n ];\n }",
"protected function getValidationRules()\n {\n return [\n 'first_name' => 'required|max:255',\n 'last_name' => 'required|max:255',\n 'email' => 'required|email|max:255',\n 'new_password' => 'required_with:current_password|confirmed|regex:' . config('security.password_policy'),\n ];\n }",
"public function rules()\n {\n // get 直接放行\n if( request()->isMethod('get') ){\n return []; // 规则为空\n }\n\n // 只在post的时候做验证\n return [\n 'username' => 'required|min:2|max:10', \n 'password' => 'required|min:2|max:10', \n 'email' => 'required|min:2|max:10|email', \n 'phoneNumber' => 'required|min:2|max:10', \n\n ];\n }",
"public function rules()\n {\n\n $rules = [\n 'id_tecnico_mantenimiento' => 'required',\n 'id_equipo_mantenimiento' => 'required'\n ];\n\n if ($this->request->has('status')) {\n $rules['status'] = 'required';\n }\n\n if ($this->request->has('log_mantenimiento')) {\n $rules['log_mantenimiento'] = 'required';\n }\n\n return $rules;\n }",
"public function rules()\n {\n $this->buildRules();\n return $this->rules;\n }",
"public function rules()\n {\n $rules = [];\n\n if ($this->isUpdate() || $this->isStore()) {\n $rules = array_merge($rules, [\n 'name' => 'required|string',\n 'email' => 'email',\n 'password' => 'confirmed|min:6',\n\n ]);\n }\n\n if ($this->isStore()) {\n $rules = array_merge($rules, [\n\n ]);\n }\n\n if ($this->isUpdate()) {\n $rules = array_merge($rules, [\n ]);\n }\n\n return $rules;\n }",
"public function rules()\n {\n switch (true) {\n case $this->wantsToList():\n $rules = $this->listRules;\n break;\n case $this->wantsToStore():\n $rules = $this->storeRules;\n break;\n case $this->wantsToUpdate():\n $this->storeRules['email'] = 'required|email|between:5,100|unique:users,email,' . $this->route('administrators');\n\n $rules = $this->storeRules;\n break;\n default:\n $rules = [];\n }\n\n return $rules;\n }",
"public function rules()\n {\n if($this->isMethod('post')) {\n return $this->storeRules();\n }\n else if($this->isMethod('put') || $this->isMethod('patch')){\n return $this->updateRules();\n }\n }",
"abstract protected function getValidationRules();",
"public function rules()\n\t{\n\t\treturn ModelHelper::getRules($this);\n\t}",
"public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return $this->getPostRules();\n case 'PUT':\n return $this->getPutRules();\n }\n }",
"public function rules()\n {\n $rules = [\n 'name' => 'required|string|min:2',\n 'email' => \"required|email|unique:users,email, {$this->request->get('user_id')}\",\n 'role_id' => 'required|numeric',\n 'group_id' => 'required|numeric',\n ];\n\n if ($this->request->has('password')){\n $rules['password'] = 'required|min:6';\n }\n\n return $rules;\n }",
"public function rules()\n {\n if($this->method() == 'POST')\n {\n return [\n 'reason'=>'required',\n 'date_from'=>'required',\n 'date_to'=>'required',\n 'attachment'=>'required',\n ];\n }\n }",
"public function rules()\n {\n $method = $this->method();\n if ($this->get('_method', null) !== null) {\n $method = $this->get('_method');\n }\n // $this->offsetUnset('_method');\n switch ($method) {\n case 'DELETE':\n case 'GET':\n break; \n case 'POST':\n $mailRules = \\Config::get('database.default').'.users';\n break;\n case 'PUT':\n $user = $this->authService->authJWTUserForm();\n $mailRules = \\Config::get('database.default').'.users,email,'.$user->getKey();\n break;\n case 'PATCH':\n break;\n default:\n break;\n }\n \n return [\n 'name' => 'required|string|max:256',\n 'email' => 'required|string|email|max:255|unique:'.$mailRules,\n 'password' => 'required|string|min:3',\n ];\n }",
"public function rules() {\n $rule = [\n 'value' => 'bail|required',\n ];\n if ($this->getMethod() == 'POST') {\n $rule += ['type' => 'bail|required'];\n }\n return $rule;\n }",
"public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n case 'PUT':\n case 'PATCH': {\n return [\n 'from' => 'required|max:100',\n 'to' => 'required|max:500',\n 'day' => 'required|max:500',\n ];\n }\n default:\n break;\n }\n\n return [\n //\n ];\n }",
"public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE': {\n return [];\n }\n case 'POST':\n case 'PUT':\n case 'PATCH': {\n return [\n 'name' => 'required|string|max:255',\n 'iso_code_2' => 'required|string|size:2',\n 'iso_code_3' => 'required|string|size:3',\n ];\n }\n default:\n return [];\n }\n }",
"public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n return [];\n case 'POST':\n return [\n 'name' => 'required|string',\n 'lastName' => 'string',\n 'gender' => 'boolean',\n 'avatar' => 'sometimes|mimes:jpg,png,jpeg|max:3048'\n ];\n case 'PUT':\n case 'PATCH':\n return [\n 'oldPassword' => 'required|string',\n 'newPassword' => 'required|string',\n ];\n default:\n break;\n }\n }",
"public function rules()\n {\n switch ($this->method()) {\n case 'GET':\n case 'DELETE':\n {\n return [\n 'validation' => [\n 'accepted'\n ]\n ];\n }\n case 'POST':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'published_at_time' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n 'unpublished_time' => [\n 'nullable',\n ],\n ];\n }\n case 'PUT':\n {\n return [\n 'title' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250'\n ],\n 'body' => [\n 'required',\n 'string',\n 'min:3',\n 'max:250000'\n ],\n 'online' => [\n 'required',\n ],\n 'indexable' => [\n 'required',\n ],\n 'published_at' => [\n 'required',\n ],\n 'unpublished_at' => [\n 'nullable',\n ],\n ];\n }\n case 'PATCH':\n {\n return [];\n }\n default:\n break;\n }\n }",
"public function rules()\n {\n if (in_array($this->method(), ['PUT', 'PATCH'])) {\n $user = User::findOrFail(\\Request::input('id'))->first();\n\n array_forget($this->rules, 'email');\n $this->rules = array_add($this->rules, 'email', 'required|email|max:255|unique:users,email,' . $user->id);\n }\n\n return $this->rules;\n }",
"public function rules()\n {\n $method = explode('@', $this->route()->getActionName())[1];\n return $this->get_rules_arr($method);\n }",
"public function rules()\n {\n $rules = parent::rules();\n $extra_rules = [];\n $rules = array_merge($rules, $extra_rules);\n return $rules;\n }",
"public function rules()\n {\n\t\tswitch($this->method()) {\n\t\t\tcase 'POST':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tcase 'PUT':\n\t\t\t\t{\n\t\t\t\t\treturn [\n\t\t\t\t\t\t'field_id' => 'integer|required',\n\t\t\t\t\t\t'label' => 'string|required',\n\t\t\t\t\t\t'value' => 'alpha_dash|required',\n\t\t\t\t\t\t'selected' => 'boolean',\n\t\t\t\t\t\t'actif' => 'boolean',\n\t\t\t\t\t];\n\t\t\t\t}\n\t\t\tdefault:break;\n\t\t}\n }",
"public function rules()\n {\n $this->sanitize();\n return [\n 'event_id' => 'required',\n 'member_id' => 'required',\n 'guild_pts' => 'required',\n 'position' => 'required',\n 'solo_pts' => 'required',\n 'league_id' => 'required',\n 'solo_rank' => 'required',\n 'global_rank' => 'required',\n ];\n }",
"public function rules()\n {\n $this->rules['email'] = ['required', 'min:6', 'max:60', 'email'];\n $this->rules['password'] = ['required', 'min:6', 'max:60'];\n\n return $this->rules;\n }",
"public function getValidatorRules()\n {\n if ($validator = $this->getValidator()) {\n return $validator->getRulesForField($this->owner);\n }\n \n return [];\n }",
"public function getValidationRules() : array;",
"public function rules()\n {\n switch ($this->route()->getActionMethod()) {\n case 'login': {\n if ($this->request->has('access_token')) {\n return [\n 'access_token' => 'required',\n 'driver' => 'required|in:facebook,github,google',\n ];\n }\n return [\n 'email' => 'required|email',\n 'password' => 'required|min:6',\n ];\n }\n case 'register': {\n return [\n 'email' => 'required|email|unique:users,email',\n 'password' => 'required|min:6',\n 'name' => 'required',\n ];\n }\n default: return [];\n }\n }",
"public function rules()\n {\n Validator::extend('mail_address_available', function($attribute, $value, $parameters, $validator){\n return MailAddressSpec::isAvailable($value);\n });\n Validator::extend('password_available', function($attribute, $value, $parameters, $validator){\n return PassWordSpec::isAvailable($value);\n });\n\n return [\n 'mail_address' => [\n 'required',\n 'mail_address_available'\n ],\n 'password' => [\n 'required',\n 'password_available',\n ],\n ];\n }",
"public function rules()\n {\n switch (strtolower($this->method())) {\n case 'get':\n return $this->getMethodRules();\n case 'post':\n return $this->postMethodRules();\n case 'put':\n return $this->putMethodRules();\n case 'patch':\n return $this->patchMethodRules();\n case 'delete':\n return $this->deleteMethodRules();\n }\n }",
"public function rules()\n {\n /**\n * This is the original way, expecting post params for each user value\n */\n return [\n 'firstName' => 'required|min:2|max:255',\n 'lastName' => 'required|min:2|max:255',\n 'phone' => 'min:9|max:25',\n 'gender' => 'in:M,V',\n 'dateOfBirth' => 'before:today|after:1890-01-01',\n 'email' => 'email|min:12|max:255',\n ];\n }",
"public function getValidationRules(): array {\n\t\t$result = [];\n\t\t\n\t\tforeach ($this->getSections() as $section) {\n\t\t\t$result = array_merge($result, $section->getValidationRules());\n\t\t}\n\t\t\n\t\treturn $result;\n\t}",
"public function rules()\n\t{\n\t\t$rule = [];\n\t\tif(Request::path() == 'api/utility/upload-image'){\n\t\t\t$rule = [\n\t\t\t\t'imagePath' => 'required',\n\t\t\t];\n\t\t}else if(Request::path() == 'api/utility/check-transaction'){\n\t\t\t$rule = [\n\t\t\t\t'countNumber' => 'required',\n\t\t\t];\n\t\t}\n\t\treturn $rule;\n\t}",
"public function rules()\n {\n $rules = array();\n return $rules;\n }",
"public function rules()\n {\n $this->setValidator($this->operation_type);\n return $this->validator;\n }",
"public function rules()\n {\n switch($this->method()){\n case 'POST':\n return [\n 'name' => 'required',\n 'app_id' => 'required',\n 'account_id' => 'required',\n 'start_at' => 'required',\n 'end_at' => 'required',\n 'content' => 'required',\n ];\n break;\n default:\n return [];\n break;\n }\n\n }",
"protected function get_validation_rules()\n {\n }",
"public function rules()\n {\n $rules = [\n 'users' => 'required|array',\n ];\n\n foreach($this->request->get('users') as $key => $user) {\n $rules['users.'. $key . '.name'] = 'required|string|min:3|max:255';\n $rules['users.'. $key . '.phone'] = 'required|regex:/^[0-9\\+\\s]+$/|min:10|max:17';\n $rules['users.'. $key . '.country'] = 'required|string|min:2:max:3';\n }\n\n return $rules;\n }",
"public function rules()\n {\n $rules = [\n 'mail_driver' => 'required',\n 'mail_name' => 'required',\n 'mail_email' => 'required',\n ];\n\n $newRules = [];\n\n if($this->mail_driver == 'smtp') {\n $newRules = [\n 'mail_host' => 'required',\n 'mail_port' => 'required|numeric',\n 'mail_username' => 'required',\n 'mail_password' => 'required',\n 'mail_encryption' => 'required',\n ];\n }\n\n return array_merge($rules, $newRules);\n }",
"public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n $rules['location'] = 'required';\n $rules['end_recruit_date'] = 'required';\n $rules['time_taken'] = 'required';\n $rules['payment'] = 'required';\n $rules['objective'] = 'required';\n $rules['method_desc'] = 'required';\n $rules['health_condition'] = 'required';\n $rules['required_applicant'] = 'required|integer';\n $rules['applicant'] = 'nullable';\n $rules['datetime'] = 'required';\n\n return $rules;\n }",
"public function rules()\n {\n switch($this->method()) {\n\n case 'PUT':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n case 'POST':\n {\n return [\n 'company_name' => 'required',\n 'status' => 'required|integer',\n 'notify_url' => 'required',\n 'name' => 'required'\n ];\n }\n default:\n return [];\n }\n\n }",
"public function rules()\n {\n $rules['name'] = 'required';\n $rules['poa'] = 'required';\n $rules['background'] = 'required';\n $rules['tester_name'] = 'required';\n\n return $rules;\n }",
"public function rules()\n {\n switch(Route::currentRouteName()){\n case 'adminBinding' :\n return [\n 'order_id' => 'required|integer',\n 'money' => 'required|numeric',\n ];\n case 'adminUnbinding' :\n return [\n 'order_id' => 'required|integer',\n 'pivot_id' => 'required|integer',\n ];\n case 'adminReceiptSave' :\n case 'adminReceiptUpdate' :\n return [\n 'customer_id' => 'required',\n 'receiptcorp' => 'required',\n 'account' => 'required',\n 'account_id' => 'required',\n 'bank' => 'required',\n 'currency_id' => 'required',\n 'advance_amount' => 'required|numeric',\n 'picture' => 'required',\n 'business_type' => 'required|in:1,2,3,4,5',\n 'exchange_type' => 'required_unless:currency_id,354|in:1,2',\n 'expected_received_at' => 'required|date_format:Y-m-d',\n ];\n case 'adminReceiptExchange' :\n return [\n 'rate' => 'required|numeric',\n ];\n default :\n return [];\n }\n }",
"public function rules()\n {\n $rules = [];\n $method = $this->getMethod();\n switch ($method) {\n case 'GET':\n if (Route::currentRouteName() === 'schoolActivity.getSchoolActivity') {\n $rules = [\n ];\n }\n break;\n }\n return $rules;\n }",
"public function rules()\n {\n $rules = new Collection();\n\n if (!$this->user() or !$this->user()->addresses()->count()) {\n $rules = $rules->merge($this->addressRules('billing'));\n if ($this->has('different_shipping_address')) {\n $rules = $rules->merge($this->addressRules('shipping'));\n }\n\n return $rules->toArray();\n }\n\n return $rules->merge([\n 'billing_address_id' => 'required|numeric',\n 'shipping_address_id' => 'required|numeric',\n ])->toArray();\n }",
"public function rules(): array\n {\n switch ($this->method()) {\n case 'POST':\n return $this->__rules() + $this->__post();\n case 'PUT':\n return $this->__rules() + $this->__put();\n default:\n return [];\n }\n }",
"public function defineValidationRules()\n {\n return [];\n }",
"public function rules(Request $request)\n {\n return Qc::$rules;\n }",
"public function rules()\n {\n switch ($this->method()) {\n case 'POST':\n return [\n 'user_name' => 'nullable|string',\n 'excel' => 'nullable|file|mimes:xlsx',\n 'category' => 'required|int|in:' . implode(',', array_keys(UserMessage::$categories)),\n 'content' => 'required|string|max:500',\n 'member_status' => 'required|int|in:' . implode(',', array_keys(User::$statuses)),\n ];\n break;\n }\n }",
"public function rules()\n {\n return [\n 'lead_id' => [\n 'required', 'string',\n ],\n 'api_version' => [\n 'required', 'string',\n ],\n 'form_id' => [\n 'required', 'int',\n ],\n 'campaign_id' => [\n 'required', 'int',\n ],\n 'google_key' => [\n 'required', 'string', new GoogleKeyRule,\n ],\n ];\n }"
]
| [
"0.8342703",
"0.80143493",
"0.7937251",
"0.79264987",
"0.79233825",
"0.79048395",
"0.78603816",
"0.7790699",
"0.77842164",
"0.77628785",
"0.7737272",
"0.7733618",
"0.7710535",
"0.7691693",
"0.76849866",
"0.7683038",
"0.7683038",
"0.7683038",
"0.7683038",
"0.7683038",
"0.7683038",
"0.7675849",
"0.76724476",
"0.76665044",
"0.7657698",
"0.7641827",
"0.7630892",
"0.76293766",
"0.7617708",
"0.76102096",
"0.7607475",
"0.7602442",
"0.7598732",
"0.7597544",
"0.75924",
"0.75915384",
"0.7588146",
"0.7581354",
"0.7555758",
"0.755526",
"0.7551423",
"0.7546329",
"0.7541439",
"0.75366044",
"0.75363225",
"0.7530296",
"0.7517988",
"0.75155175",
"0.7508439",
"0.75069886",
"0.7505724",
"0.749979",
"0.7495976",
"0.74949056",
"0.7492888",
"0.7491117",
"0.74901396",
"0.7489651",
"0.7486808",
"0.7486108",
"0.7479687",
"0.7478561",
"0.7469412",
"0.74635684",
"0.74619836",
"0.7461325",
"0.74591017",
"0.7455279",
"0.745352",
"0.7453257",
"0.7449877",
"0.74486",
"0.7441391",
"0.7440429",
"0.7435489",
"0.7435326",
"0.74341524",
"0.7430354",
"0.7429103",
"0.7423808",
"0.741936",
"0.74152505",
"0.7414828",
"0.741382",
"0.74126065",
"0.74105227",
"0.740555",
"0.7404385",
"0.74040926",
"0.74015605",
"0.73905706",
"0.73837525",
"0.73732615",
"0.7371123",
"0.7369176",
"0.73619753",
"0.73554605",
"0.73448825",
"0.7344659",
"0.73427117",
"0.73357755"
]
| 0.0 | -1 |
Returns an instance of this class. | public static function getInstance()
{
return Doctrine_Core::getTable('Slozeni');
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function instance() {\n\t\treturn new self;\n\t}",
"public function getInstance()\n {\n return $this;\n }",
"public function instance() {\n\t\n\t\treturn $this;\n\t\n\t}",
"public function getInstance(): self\n {\n return $this;\n }",
"public static function getInstance() {\n return new self();\n }",
"public function get_instance()\n\t{\n\t\treturn $this;\n\t}",
"public function get_instance()\n\t{\n\t\treturn $this;\n\t}",
"public static function getInstance()\n {\n return new self();\n }",
"public static function instance() {\n\n\t\t\tif ( is_null( self::$instance ) ) {\n\t\t\t\tself::$instance = new self();\n\t\t\t}\n\n\t\t\treturn self::$instance;\n\n\t\t}",
"public static function get()\n\t{\n\t\tif(null == self::$_instance)\n\t\t{\n\t\t\treturn new self();\n\t\t}\n\n\t\treturn self::$_instance;\n\t}",
"public static function get()\n {\n if (is_null(self::$instance)) {\n self::$instance = new self();\n }\n return self::$instance;\n }",
"public static function instance() {\n\t\t\tif ( is_null( self::$_instance ) )\n\t\t\t\tself::$_instance = new self();\n\n\t\t\treturn self::$_instance;\n\t\t}",
"public function newInstance()\n {\n return new self();\n }",
"public static function instance() {\n\t\t\tif ( is_null( self::$_instance ) ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\t\t\treturn self::$_instance;\n\t\t}",
"public static function instance() {\n\t\t\tif ( is_null( self::$_instance ) ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\t\t\treturn self::$_instance;\n\t\t}",
"public static function instance() {\n\t\t\tif ( is_null( self::$_instance ) ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\t\t\treturn self::$_instance;\n\t\t}",
"public static function instance() {\n\t\t\tif ( is_null( self::$_instance ) ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\t\t\treturn self::$_instance;\n\t\t}",
"public static function instance() {\n\t\t\tif ( is_null( self::$_instance ) ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\t\t\treturn self::$_instance;\n\t\t}",
"public static function instance() {\n\t\t\tif ( is_null( self::$_instance ) ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\t\t\treturn self::$_instance;\n\t\t}",
"public static function get() \n {\n if (!isset(self::$instance)) {\n self::$instance = new self;\n }\n\n return self::$instance;\n }",
"public static function get() {\n\t\tif ( self::$instance === null )\n\t\t\tself::$instance = new self();\n\n\t\treturn self::$instance;\n\t}",
"public static function self() {\n\n\t\treturn self::factory( 'self' );\n\t}",
"public static function instance() {\n\t\t\tif ( is_null( self::$instance ) ) {\n\t\t\t\tself::$instance = new self();\n\t\t\t}\n\n\t\t\treturn self::$instance;\n\t\t}",
"public static function instance() {\n\t\t\tif ( is_null( self::$instance ) ) {\n\t\t\t\tself::$instance = new self();\n\t\t\t}\n\n\t\t\treturn self::$instance;\n\t\t}",
"public static function instance() {\n\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\n\t\treturn self::$_instance;\n\n\t}",
"public static function get() {\r\n\r\n\t\tif ( self::$instance == null ) {\r\n\t\t\tself::$instance = new self();\r\n\t\t}\r\n\r\n\t\treturn self::$instance;\r\n\r\n\t}",
"public static function instance() {\n\t\t\tif ( ! self::$_instance ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\n\t\t\treturn self::$_instance;\n\t\t}",
"public static function instance () {\n if ( is_null( self::$_instance ) ) {\n self::$_instance = new self();\n }\n return self::$_instance;\n }",
"public static function instance() {\n\t if ( !isset( self::$instance ) ) {\n\t $className = __CLASS__;\n\t self::$instance = new $className;\n\t }\n\t return self::$instance;\n\t }",
"public static function self() {\n\n\t\treturn self::factory( 'self' );\n\n\t}",
"public static function instance()\n {\n global $container;\n return $container->getByType(self::class);\n }",
"public static function instance() {\n return new static();\n }",
"public static function get() {\n\t\tif ( self::$instance == null ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\t\treturn self::$instance;\n\t}",
"public static function instance () {\n\t\tif ( is_null( self::$_instance ) )\n\t\t\tself::$_instance = new self();\n\t\treturn self::$_instance;\n\t}",
"public static function newInstance()\n {\n $instance = new self;\n return $instance;\n }",
"public static function getInstance()\n {\n return GeneralUtility::makeInstance(self::class);\n }",
"public static function getInstance()\n {\n return GeneralUtility::makeInstance(self::class);\n }",
"public static function instance()\n {\n return new static();\n }",
"public static function instance()\n {\n return new static();\n }",
"public static function get_instance()\n {\n if (true === empty(self::$instance)) {\n $instance = new self();\n }\n return $instance;\n }",
"public static function instance() {\n\t\tstatic $instance;\n\n\t\tif ( empty( $instance ) ) {\n\t\t\t$instance = new self();\n\t\t}\n\n\t\treturn $instance;\n\t}",
"public static function get_instance() {\n\n if ( ! self::$instance instanceof self ) {\n self::$instance = new self;\n }\n\n return self::$instance;\n\n }",
"public function __construct ()\n {\n return this;\n }",
"public function __construct() {\n return $this;\n }",
"public static function get_instance() {\n $self = __CLASS__;\n\n if ( is_null( $self::$instance ) ) {\n $self::$instance = new $self;\n }\n\n return $self::$instance;\n }",
"public static function instance() {\n\t\t\tif ( null === self::$_instance ) {\n\t\t\t\tself::$_instance = new self();\n\t\t\t}\n\t\t\treturn self::$_instance;\n\t\t}",
"public static function instance() {\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\n\t\treturn self::$_instance;\n\t}",
"public static function instance() {\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\n\t\treturn self::$_instance;\n\t}",
"public static function instance() {\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\n\t\treturn self::$_instance;\n\t}",
"public static function instance() {\n if ( is_null( self::$_instance ) ) {\n self::$_instance = new self();\n }\n return self::$_instance;\n }",
"public static function instance() {\n if ( is_null( self::$_instance ) ) {\n self::$_instance = new self();\n }\n return self::$_instance;\n }",
"public function instance();",
"public static function instance() {\n\t\tif ( !isset( self::$instance ) ) {\n\t\t\t$class_name = __CLASS__;\n\t\t\tself::$instance = new $class_name;\n\t\t}\n\t\treturn self::$instance;\n\t}",
"public static function instance() {\r\n if ( is_null( self::$_instance ) ) {\r\n self::$_instance = new self();\r\n }\r\n return self::$_instance;\r\n }",
"public static function instance() {\r\n if ( is_null( self::$_instance ) ) {\r\n self::$_instance = new self();\r\n }\r\n return self::$_instance;\r\n }",
"public static function instance() {\n\t\tif ( is_null( self::$_instance ) )\n\t\t\tself::$_instance = new self();\n\t\treturn self::$_instance;\n\t}",
"public static function instance()\n {\n if (is_null(self::$_instance)) {\n self::$_instance = new self();\n }\n\n return self::$_instance;\n }",
"public static function instance() {\n\t\tif ( ! isset( self::$instance ) ) {\n\t\t\t$class_name = __CLASS__;\n\t\t\tself::$instance = new $class_name;\n\t\t}\n\t\treturn self::$instance;\n\t}",
"public static function instance()\r\n\t\t{\r\n\t\t\t\r\n\t\t\tif ( ! self::$instance instanceof self )\r\n\t\t\t{\r\n\t\t\t\tself::$instance = new self;\r\n\t\t\t}\r\n\t\t\t\r\n\t\t\treturn self::$instance;\r\n\t\t}",
"public function getInstance()\n {\n return $this->instance;\n }",
"public function getInstance()\n {\n return $this->instance;\n }",
"public function getInstance()\n {\n return $this->instance;\n }",
"public function getInstance()\n {\n return $this->instance;\n }",
"public static function instance() {\r\n\t\tif ( is_null( self::$_instance ) ) {\r\n\t\t\tself::$_instance = new self();\r\n\t\t}\r\n\t\treturn self::$_instance;\r\n\t}",
"public static function instance() {\r\n\t\tif ( is_null( self::$_instance ) ) {\r\n\t\t\tself::$_instance = new self();\r\n\t\t}\r\n\t\treturn self::$_instance;\r\n\t}",
"public static function instance() {\n if(is_null( self::$_instance)){\n self::$_instance = new self();\n }\n return self::$_instance;\n }",
"public static function instance() {\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\t\treturn self::$_instance;\n\t}",
"public static function instance() {\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\t\treturn self::$_instance;\n\t}",
"public static function instance() {\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\t\treturn self::$_instance;\n\t}",
"public static function instance() {\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\t\treturn self::$_instance;\n\t}",
"public static function instance() {\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\t\treturn self::$_instance;\n\t}",
"public static function instance() {\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\t\treturn self::$_instance;\n\t}",
"public static function instance() {\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\t\treturn self::$_instance;\n\t}",
"public static function instance() {\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\t\treturn self::$_instance;\n\t}",
"public static function instance() {\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\t\treturn self::$_instance;\n\t}",
"public static function instance() {\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\t\treturn self::$_instance;\n\t}",
"public static function instance() {\n\t\tif ( is_null( self::$_instance ) ) {\n\t\t\tself::$_instance = new self();\n\t\t}\n\t\treturn self::$_instance;\n\t}",
"public static function instance() {\n if ( is_null( self::$_instance ) ) {\n self::$_instance = new self();\n }\n return self::$_instance;\n }",
"public static function instance() {\n\n\t\tif (!self::$instance) {\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}",
"public static function get_instance() {\n\t\t\tif ( is_null( self::$instance ) ) {\n\t\t\t\tself::$instance = new self();\n\t\t\t}\n\n\t\t\treturn self::$instance;\n\t\t}",
"public static function get_instance() {\n\n if ( null == self::$instance ) {\n self::$instance = new self;\n }\n\n return self::$instance;\n\n }",
"public static function get_instance(){\n\t\t\tif( is_null( self::$instance ) ){\n\t\t\t\tself::$instance = new self();\n\t\t\t}\n\n\t\t\treturn self::$instance;\n\t\t}",
"public static function instance() {\n\t\tif ( ! isset( self::$instance ) ) {\n\t\t\t$className = __CLASS__;\n\t\t\tself::$instance = new $className;\n\t\t}\n\t\treturn self::$instance;\n\t}",
"public static function instance() {\n\t\tif ( is_null( self::$instance ) ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}",
"public static function instance() {\n if ( empty( self::$instance ) ) {\n self::$instance = new self;\n }\n\n return self::$instance;\n }",
"public function get_instance() {\n if ( null == self::$instance ) {\n self::$instance = new self;\n }\n return self::$instance;\n }",
"public static function getInstance() {\n\t\treturn parent::getInstance(__CLASS__);\n\t}",
"public static function instance() {\n\t\tif ( empty( self::$instance ) ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}",
"public function getInstance() {\n\t\treturn $this->instance;\n\t}",
"public static function getInstance() {\n\n static $instance;\n //If the class was already instantiated, just return it\n if (isset($instance))\n return $instance;\n\n $instance = new self;\n\n return $instance;\n }",
"public static function make() {\n return new self();\n }",
"public static function getInstance() {\n\t\treturn parent::getInstance(__CLASS__); \n\t}",
"public static function instance()\n {\n return new static;\n }",
"public static function instance()\n {\n return new static;\n }",
"public static function instance()\n {\n if (is_null(self::$_instance)) {\n self::$_instance = new self();\n }\n return self::$_instance;\n }",
"public static function instance(): self\n {\n return self::$instance ??= new self();\n }",
"public static function instance() {\n\t\tif ( is_null( self::$instance ) ) {\n\t\t\tself::$instance = new self;\n\t\t}\n\t\treturn self::$instance;\n\t}",
"public static function instance() {\n\t\tif ( is_null( ( self::$instance ) ) ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}",
"public static function instance() {\n\t\tif ( ! ( self::$instance instanceof self ) ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\n\t\treturn self::$instance;\n\t}",
"public static function instance() {\n\t\tif ( is_null( self::$instance ) ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\t\treturn self::$instance;\n\t}",
"public static function instance() {\n\t\tif ( is_null( self::$instance ) ) {\n\t\t\tself::$instance = new self();\n\t\t}\n\t\treturn self::$instance;\n\t}"
]
| [
"0.8422614",
"0.8295301",
"0.8285811",
"0.81871045",
"0.8143881",
"0.8063351",
"0.8063351",
"0.8055489",
"0.7950293",
"0.793865",
"0.7891774",
"0.7880838",
"0.7830038",
"0.7828412",
"0.7828412",
"0.7828412",
"0.7828412",
"0.7828412",
"0.7828412",
"0.7825756",
"0.780587",
"0.78047556",
"0.78043765",
"0.78043765",
"0.7802583",
"0.77903754",
"0.7787871",
"0.7781021",
"0.7768605",
"0.7767898",
"0.7766817",
"0.77595675",
"0.7730926",
"0.7728104",
"0.7716915",
"0.77152646",
"0.77152646",
"0.7707343",
"0.7707343",
"0.7706665",
"0.7706133",
"0.76993066",
"0.7692347",
"0.76880157",
"0.76840293",
"0.7683914",
"0.768212",
"0.768212",
"0.768212",
"0.7679454",
"0.7679454",
"0.7674896",
"0.7660284",
"0.7655069",
"0.7655069",
"0.7650083",
"0.76476485",
"0.764636",
"0.76457775",
"0.76406676",
"0.76406676",
"0.76406676",
"0.76406676",
"0.76387274",
"0.76387274",
"0.7634482",
"0.7629432",
"0.7629432",
"0.7629432",
"0.7629432",
"0.7629432",
"0.7629432",
"0.7629432",
"0.7629432",
"0.7629432",
"0.7629432",
"0.7629432",
"0.76287067",
"0.76266134",
"0.76259387",
"0.7623459",
"0.7622886",
"0.76228714",
"0.76201046",
"0.76195866",
"0.76164865",
"0.7616179",
"0.7598447",
"0.7595922",
"0.7586314",
"0.75831777",
"0.75813985",
"0.75811917",
"0.75811917",
"0.7580553",
"0.7576247",
"0.7574785",
"0.75714004",
"0.7571144",
"0.75662637",
"0.75662637"
]
| 0.0 | -1 |
Database Call to friends table | public function index()
{
$obj = new Friend($this->db);
$friends = $obj->all_friends();
// Load View File
require './application/views/friends.php';
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function friends() {\n $user = UserQuery::create()->findPK($_SESSION['uid']);\n $profile = ProfileQuery::create()->findPK($_SESSION['uid']);\n $friends = FriendQuery::create()->findByUserid($_SESSION['uid']);\n $friendgroups = FriendQuery::create()->findOneByFriendid($_SESSION['uid']);\n $buckets = BucketQuery::create()->findByUserid($_SESSION['uid']);\n $hasbuckets = BucketQuery::create()->findOneByUserid($_SESSION['uid']);\n $nbFriends = FriendQuery::create()->filterByUserid($_SESSION['uid'])->count($con);\n\n\t\tif ($user) {\n\t\t\t$profile = ProfileQuery::create()->findPK($user->getId());\n\t\t\t$nbFriends = FriendQuery::create()->filterByUserid($user->getId())->count($con);\n\t\t\n\t\t\tif ($userid != $user->getId() && $userid && $user->getId()) {\n\t\t\t\t$friends = FriendQuery::create()\n\t\t\t\t->filterByUserid($_SESSION['uid'])\n\t\t\t\t->filterByFriendid($user->getId())\n\t\t\t\t->findOne();\n\t\t\n\t\t\t\tif ($friends) {\n\t\t\t\t$bucket = FriendBucketQuery::create()\n\t\t\t\t->filterByUserid($friends->getUserid())\n\t\t\t\t->findOne();\n\t\t\t\t}\n\t\t\t}\n\t\t\tif ($nbFriends > 0) {\n\t\t\t\t$friendslist = FriendQuery::create()\n\t\t\t\t\t->filterByUserid($user->getId())\n\t\t\t\t\t->find();\n\t\t\t\t\t\t\t\n\t\t\t\t// Load friends Userid's into array, include logged in user.\n\t\t\t\tforeach ($friendslist as $friendlist) {\n\t\t\t\t\t$friendid = $friendlist->getFriendid();\n\t\t\t\t\t$groupid = $friendlist->getGroupid();\n\t\t\t\t\t$aFriends[$groupid] = $friendid;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tforeach ($aFriends as $aFriend) {\n\t\t\t\t\t$myfriend = UserQuery::create()\n\t\t\t\t\t\t->findPK($aFriend);\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t$friendList[] = array (\n\t\t\t\t\t\t\t\"username\" => $myfriend->getUsername(),\n\t\t\t\t\t\t\t\"firstname\" => $myfriend->getFirstname(),\n\t\t\t\t\t\t\t\"lastname\" => $myfriend->getLastname(),\n\t\t\t\t\t\t);\n\t\t\t\t\t\t\n\t\t\t\t\n\t\t\t\t\tif ($_SESSION['uid']) {\n\t\t\t\t\t\tif ($aFriend === $_SESSION['uid'] || $user->getId() === $_SESSION['uid']) {\n\t\t\t\t\t\t\t$showfriend = 1;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t$notfound = 1;\n\t\t}\n \n $info = array (\n \"user\" => $user,\n \"profile\" => $profile,\n \"friends\" => $friends,\n \"friendgroups\" => $friendgroups,\n \"buckets\" => $buckets,\n \"hasbuckets\" => $hasbuckets,\n \"nbFriends\" => $nbFriends,\n \"friendlist\" => $friendList,\n \"showfriend\" => $showfriend,\n \"notfound\" => $notfound,\n \n ); \n return $info; \n }",
"function friends_using()\n{\n $me = fb::me();\n $uid = ! empty($me['id']) ? $me['id'] : -1;\n\n $args = func_get_args();\n $what = $args ? join(',', $args) : 'name';\n\n return fb::query(\"SELECT $what FROM user WHERE has_added_app=1 and uid IN (SELECT uid2 FROM friend WHERE uid1=$uid)\");\n}",
"function getSuggestFriend() {\n return getAll(\"SELECT a.id, a.name,a.email \n FROM member a \n WHERE a.id != ? AND a.id NOT IN (\n SELECT friend_id \n FROM member_friend \n WHERE member_id =? ) \n AND a.id NOT IN (\n SELECT apply_member_id \n FROM member_friend_apply \n WHERE status = \\\"\\\" \n AND member_id = ?) \n LIMIT 5\",\n [getLogin()['mid'],getLogin()['mid'],getLogin()['mid']]);\n}",
"function createFriendListRecord($user_id, $friend_id, $connection_id) {\n //get both user rows\n $friend_user_row = getUserRow($friend_id, \"user_loging\");\n if ($friend_user_row) {\n $user_row = getUserRow($user_id, \"user_loging\");\n //create friend_list record for user\n createListRecord($user_id, $friend_id, $friend_user_row['l_name'], $connection_id, 'friend_list');\n //create friend_list for friend\n createListRecord($friend_id, $user_id, $user_row['l_name'], $connection_id, 'friend_list');\n }\n}",
"public function getFriends(){\r\n\t\t$fql = 'SELECT uid, name, sex FROM user WHERE uid IN (SELECT uid2 FROM friend WHERE uid1 = '.$this->getFacebookUid().')';\r\n\t\t$fql_result = $this->runFQL($fql, 'fql_get_friends');\r\n\t\treturn $fql_result;\r\n\t}",
"function becomeFriendsWith($person) {\n $query = \"INSERT INTO friends (friend_id, user_id) VALUES ('{$person}','\".$this->data['id'].\"')\";\n $query2 = \"INSERT INTO friends (friend_id, user_id) VALUES ('\".$this->data['id'].\"','{$person}')\";\n mysql_query($query);\n mysql_query($query2);\n\n header('location: home.php');\n }",
"function getMemberFriendInfo() {\n return getAll(\"SELECT a.id, b.name FROM member_friend a INNER JOIN member b ON a.friend_id = b.id WHERE a.member_id=?\", [getLogin()['mid']]);\n}",
"function friendRequestFetch(){\n\n $friendRequest=mysql_query(\"SELECT user,friend FROM Friend\n WHERE user=(SELECT user_id FROM Account WHERE user_email='$_SESSION[friend_email]')\n AND friend=(SELECT user_id FROM Account WHERE user_email='$_SESSION[user_email]')\") \n or die(\"<p>Friend request failed</p>\");\n\n $friendRequestFetch=mysql_fetch_array($friendRequest);\n\n return $friendRequestFetch;;\n }",
"private function fetchFriends() {\n $url = $this->getBaseUrl() . '/friends?xml=1';\n\n $this->friends = array();\n $friendsData = new SimpleXMLElement(file_get_contents($url));\n foreach($friendsData->friends->friend as $friend) {\n $this->friends[] = SteamId::create((string) $friend, false);\n }\n }",
"function out_friends(){\n $this->start_session();\n $id = $_SESSION['id'];\n $query = \"SELECT * FROM users U INNER JOIN friends F ON U.id = F.is_friend_with WHERE U.id = '$id';\";\n $result = $this->conn->query($query);\n if (!$result) die (\"Database access failed: \" . $this->conn->error);\n return $result;\n }",
"function user_add_friend($user_id, $friend_username) {\n $db = connectDB();\n \n // Look up user\n $friend_user_id = user_find_id($friend_username);\n \n if ($friend_user_id === NULL) {\n return \"No such user.\";\n }\n \n if ($friend_user_id == $user_id) {\n return \"You cannot send a friend request to yourself.\";\n }\n \n // Check they're not already friends\n $stmt = $db->prepare('\n SELECT\n user_id_1, user_id_2, provisional\n FROM\n friendships\n WHERE\n (user_id_1 = :user_id_1 AND user_id_2 = :user_id_2)\n OR (user_id_1 = :user_id_2 AND user_id_2 = :user_id_1)\n LIMIT\n 1\n ;\n ');\n $stmt->execute([\n ':user_id_1' => $user_id,\n ':user_id_2' => $friend_user_id\n ]);\n $rows = $stmt->fetchAll(PDO::FETCH_ASSOC);\n if (!empty($rows)) {\n $row = $rows[0];\n if ($row['provisional']) {\n if ($row['user_id_1'] == $user_id) {\n return \"You already sent a friend request to that user.\";\n } else {\n return \"That user already sent you a friend request.\";\n }\n } else {\n return \"You are already friends with that user.\";\n }\n }\n \n // Actually send the request\n $db->beginTransaction();\n $stmt = $db->prepare('\n INSERT INTO\n friendships(user_id_1, user_id_2, timestamp, provisional)\n VALUES\n (:user_id_1, :user_id_2, datetime(\\'now\\'), 1)\n ;\n ');\n $stmt->execute([\n ':user_id_1' => $user_id,\n ':user_id_2' => $friend_user_id\n ]);\n $db->commit();\n\n return TRUE;\n}",
"public function send_friend_request()\n {\n //insert into db;\n $this->Friend_model->send_friend_request_model();\n }",
"private function getFriend(){\n\t\t$id = $this->id;\n\t\t$query_friend = $GLOBALS['db']->prepare(\"SELECT Pers.id FROM Pers, Friend WHERE (Pers.id = Friend.idpers AND Friend.idfrd = :id) OR (Pers.id = Friend.idfrd AND Friend.idpers = :id)\");\n\t\t$query_friend->bindParam(\":id\", $id);\n\t\t\n\t\t$query_friend->execute();\n\t\t\n\t\twhile($e = $query_friend->fetch(PDO::FETCH_ASSOC)){\n\t\t\tif (!isset($this->referenced[$e[\"id\"]]))\n\t\t\t\t$this->referenced[$e[\"id\"]] = new Ref($e[\"id\"]);\n\t\t\t\t\n\t\t\t$this->referenced[$e[\"id\"]]->setFriend(1);\n\t\t}\n\t}",
"function manageFriends()\n\t{\n\t\t//init variable\n\t\t$app = JFactory::getApplication();\n\t\t$log_user = JFactory::getUser($this->plugin->get('user')->id);\n\t\t$db = JFactory::getDbo();\n\t\t$frnd_id = $app->input->get('target_userid',0,'INT');\n\t\t$userid = $log_user->id;\n\t\t$res = new stdClass();\n\t\t\n\t\tif(!$frnd_id)\n\t\t{\n\t\t\treturn 'Friend id not found';\n\t\t}\n\n\t\t$frnds_obj = new EasySocialModelFriends();\n\t\t$result = $frnds_obj->request($userid,$frnd_id);\n\t\t\n\t\tif($result->id)\n\t\t{\n\t\t\t$res->status = 1;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$res->status = 0;\n\t\t}\n\t\treturn $res;\n\t}",
"public function lookupFriends() {\n\t\t\n\t\t//if id is integer\n\t\tif(is_int($this->_query['user_id'])) {\n\t\t\t$id = explode(',', $this->_query['user_id']);\n\t\t\t//at this point id will be an array\n\t\t\t$id = array();\n\t\t\t//lets put it in query\n\t\t\t$this->_query['user_id'] = $id;\n\t\t}\n\t\t\n\t\t//if name is string\n\t\tif(is_string($this->_query['screen_name'])) {\n\t\t\t$name = explode(',', $this->_query['screen_name']);\n\t\t\t//at this point id will be an array\n\t\t\t$name = array();\n\t\t\t$this->_query['screen_name'] = $name;\n\t\t}\n\t\t\n\t\treturn $this->_getResponse(self::URL_LOOK_UP, $this->_query);\n\t}",
"public function u_friendlist( $user_id ){\n\t\t$sql =\t\"SELECT c_users.user_id, c_friends.friend_id, firstname, lastname, middlename, be_friends,request_to FROM cool_users AS c_users\n\t\t\t\tINNER JOIN cool_users_friends AS c_friends ON c_users.user_id =\n\t\t\t\t(\n\t\t\t\t CASE WHEN c_users.user_id IN (SELECT friend_id \n\t\t\t\tFROM cool_users_friends WHERE user_id = $user_id ) then c_users.user_id\n\t\t\t\t WHEN c_users.user_id IN (SELECT user_id \n\t\t\t\tFROM cool_users_friends WHERE friend_id = $user_id ) then c_users.user_id end\n\t\t\t\t)\n\t\t\t\tWHERE c_friends.friend_id= \n\t\t\t\t(\n\n\t\t\t\tCASE WHEN c_users.user_id IN (SELECT friend_id \n\t\t\t\tFROM cool_users_friends WHERE user_id = $user_id ) then c_users.user_id\n\t\t\t\tWHEN c_users.user_id IN (SELECT user_id\n\t\t\t\tFROM cool_users_friends WHERE friend_id = $user_id ) then $user_id end\n\t\t\t\t) AND c_friends.user_id = \n\t\t\t\t( \n\t\t\t\tCASE WHEN c_users.user_id IN (SELECT user_id\n\t\t\t\tFROM cool_users_friends WHERE friend_id = $user_id ) then c_users.user_id\n\t\t\t\tWHEN c_users.user_id IN (SELECT friend_id\n\t\t\t\tFROM cool_users_friends WHERE user_id = $user_id ) then $user_id \n\t\t\t\tend\n\t\t\t\t)\";\n\t\t\t\treturn $this->query($sql);\n\t}",
"function user_get_friend_requests($user_id) {\n $db = connectDB();\n $stmt = $db->prepare('\n SELECT\n friendships.user_id_1 AS user_id,\n users.username AS username\n FROM\n friendships\n LEFT JOIN\n users\n ON\n friendships.user_id_1 = users.user_id\n WHERE\n friendships.user_id_2 = :user_id_2\n AND friendships.provisional = 1\n ORDER BY\n friendships.timestamp DESC\n ;\n ');\n $stmt->execute([\n ':user_id_2' => $user_id\n ]);\n $requests = $stmt->fetchAll(PDO::FETCH_ASSOC);\n return $requests; \n}",
"function getFriendsFriend($friendsFriendID){\n\n $friendsFriend=mysql_query(\"SELECT user_firstname,user_surname,user_study,user_work,user_email FROM user,Account\n WHERE User.user_id=Account.user_id AND User.user_id=$friendsFriendID\") or die(\"Friend's friend fetch failed.\");\n\n $friendsFriendFetch=mysql_fetch_array($friendsFriend);\n\n return $friendsFriendFetch;\n\n }",
"public function sTellFriend()\n {\n $checkMail = $this->sUserData['additional']['user']['email'];\n\n $tmpSQL = '\n SELECT * FROM s_emarketing_tellafriend WHERE confirmed=0 AND recipient=?\n ';\n $checkIfUserFound = $this->db->fetchRow($tmpSQL, [$checkMail]);\n if ($checkIfUserFound) {\n $this->db->executeUpdate('\n UPDATE s_emarketing_tellafriend SET confirmed=1 WHERE recipient=?\n ', [$checkMail]);\n\n $advertiser = $this->db->fetchRow('\n SELECT email, firstname, lastname FROM s_user\n WHERE s_user.id=?\n ', [$checkIfUserFound['sender']]);\n\n if (!$advertiser) {\n return;\n }\n\n $context = [\n 'customer' => $advertiser['firstname'] . ' ' . $advertiser['lastname'],\n 'user' => $this->sUserData['billingaddress']['firstname'] . ' ' . $this->sUserData['billingaddress']['lastname'],\n 'voucherValue' => $this->config->get('sVOUCHERTELLFRIENDVALUE'),\n 'voucherCode' => $this->config->get('sVOUCHERTELLFRIENDCODE'),\n ];\n\n $mail = Shopware()->TemplateMail()->createMail('sVOUCHER', $context);\n $mail->addTo($advertiser['email']);\n $mail->send();\n } // - if user found\n }",
"function _sql_friends()\n\t{\n\t\t$sql\t= array();\n\n\t\t//\t----------------------------------------\n\t\t//\tTable exists?\n\t\t//\t----------------------------------------\n\n\t\tif ( ee()->db->table_exists( 'exp_friends' ) )\n\t\t{\n\t\t\tif ( ! $this->column_exists( 'referrer_id', 'exp_friends' ) )\n\t\t\t{\n\t\t\t\t$sql[]\t= \"ALTER TABLE \texp_friends\n\t\t\t\t\t\t ADD \t\t\treferrer_id int(10) unsigned NOT NULL DEFAULT '0'\n\t\t\t\t\t\t AFTER \t\tfriend_id\";\n\t\t\t}\n\n\t\t\tif ( ! $this->column_exists( 'group_id', 'exp_friends' ) )\n\t\t\t{\n\t\t\t\t$sql[]\t= \"ALTER TABLE \texp_friends\n\t\t\t\t\t\t ADD \t\t\tgroup_id varchar(132) NOT NULL DEFAULT ''\n\t\t\t\t\t\t AFTER \t\treferrer_id\";\n\t\t\t}\n\t\t}\n\n\t\treturn $sql;\n\t}",
"public function getFriends($userInfo)\r\n {\r\n \t$user_id = $userInfo->getUserIdInfo();\r\n \t$user_id=$user_id['id'];\r\n $this->db->Fields(array('u.id','u.first_name','u.middle_name','u.last_name','u.gender','u.email_primary','u.profile_image','f.status',));\r\n $this->db->From('users u,friends f');\r\n \r\n $this->db->Where(array(\"user_id=\".$user_id.\" AND friend_id=u.id AND f.status='F' AND u.status='A'\"),true);\r\n $this->db->Select();\r\n\t\t$result = $this->db->resultArray();\r\n\t\treturn($result); \r\n }",
"public function getMyFriend() {\n\t\t$conn = new mysqli ( $GLOBALS ['dbservername'], $GLOBALS ['dbusername'], $GLOBALS ['dbpassword'], $GLOBALS ['dbname'] );\n\t\t$sql = \"SELECT that FROM friend WHERE this=$this->userID\";\n\t\t// echo $sql . \"<br>\";\n\t\t$result = $conn->query ( $sql ); // select all the colume number in user\n\t\t$newsql = 'SELECT * FROM user where ';\n\t\twhile ( $row = mysqli_fetch_assoc ( $result ) ) {\n\t\t\t$newsql .= \"id=\";\n\t\t\t$newsql .= $row ['that'];\n\t\t\t$newsql .= \" or \";\n\t\t}\n\t\t// echo $newsql . \"<br>\";\n\t\t$newsql = substr ( $newsql, 0, - 3 ); // this line remove the last two character \"or\"\n\t\t$returnvalue = $conn->query ( $newsql );\n\t\t\n\t\t$conn->close ();\n\t\treturn $returnvalue;\n\t}",
"public function friendOf() {\n return $this->belongsToMany('Social\\Models\\User', 'friends', 'friend_id', 'user_id' );\n }",
"public function friendsOfMine() {\n return $this->belongsToMany('App\\Models\\User', 'friends', 'user_id', 'friend_id');\n }",
"function agreeFriendHandler() {\n global $inputs;\n\n $res = getOne('SELECT * FROM member_friend_apply WHERE id = ?',[$inputs['id']]);\n\n insert('member_friend',[\n 'member_id' => getLogin()['mid'],\n 'friend_id' => $res['member_id']\n ]);\n\n insert('member_friend',[\n 'member_id' => $res['member_id'],\n 'friend_id' =>getLogin()['mid']\n ]);\n\n $sql = \"DELETE FROM `member_friend_apply` WHERE id = \" . $inputs['id'];\n execSql($sql);\n\n formatOutput(true, 'option success');\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 userRequestFetch(){\n\n $userRequest=mysql_query(\"SELECT user,friend FROM Friend\n WHERE user=(SELECT user_id FROM Account WHERE user_email='$_SESSION[user_email]')\n AND friend=(SELECT user_id FROM Account WHERE user_email='$_SESSION[friend_email]')\") \n or die(\"<p>user request failed.</p>\");\n\n $userRequestFetch=mysql_fetch_array($userRequest);\n\n return $userRequestFetch;\n }",
"public function friendsOfMine() {\n // One user can have many friends\n\n return $this->belongsToMany('Social\\Models\\User', 'friends', 'user_id', 'friend_id');\n\n }",
"function view(){\n\n $view=mysql_query(\"CREATE VIEW FriendsFriend AS\n SELECT user AS id FROM Friend WHERE\n (friend=(SELECT user_id FROM Account WHERE user_email='$_SESSION[friend_email]')\n AND NOT user=(SELECT user_id FROM Account WHERE user_email='$_SESSION[user_email]'))\n UNION ALL\n SELECT friend AS id FROM Friend WHERE \n (user=(SELECT user_id FROM Account WHERE user_email='$_SESSION[friend_email]')\n AND NOT friend=(SELECT user_id FROM Account WHERE user_email='$_SESSION[user_email]'))\")\n or die(\"Your friend is a hermit!\");\n \n return $view;\n }",
"public function friendOf() {\n return $this->belongsToMany('App\\Models\\User', 'friends', 'friend_id', 'user_id');\n }",
"public function friends()\n\t {\n\t\treturn $this->belongsToMany('User', 'friend_user', 'user_id', 'friend_id');\n\t }",
"function getNewFriendApply() {\n return getAll(\"SELECT a.id,\n b.name as applier_name ,\n a.member_id as applier_id ,\n a.create_time\n FROM member_friend_apply a , `member` b\n WHERE a.apply_member_id = ? \n AND a.member_id = b.id \n AND a.status = \\\"\\\"\", [getLogin()['mid']]);\n}",
"public function follow_user(){\n\n\t\t$follow_user_data=array(\n\t\t\t'user_id'=>$this->session->userdata('usr_id'),\n\t\t\t'follow_user_id' => $this->input->post('id')\n\t\t);\n\n\t\treturn $this->db->insert('friends', $follow_user_data);\n\n\t}",
"public function friends_get()\n {\n $results = $this->User->getFriends($_SESSION['id']);\n // Check if the games data store contains games (in case the database result returns NULL)\n if ($results)\n {\n // Set the response and exit\n $this->response($results, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code\n }\n else\n {\n // Set the response and exit\n $this->response([\n 'status' => FALSE,\n 'message' => 'No Friends'\n ], REST_Controller::HTTP_OK); // NOT_FOUND (404) being the HTTP response code\n }\n }",
"public function loadFriendsList() {\n\t\t$this -> template = TemplateManager::load(\"StyledTable\");\n\t\t$this -> template -> insert(\"title\", \"Friends List\");\n\t\t$friends = $this -> user -> getContactManager() -> getFriends();\n\t\t$table = \"\";\n\t\t$online = array();\n\t\t$offline = array();\n\t\tforeach($friends as $friend) {\n\t\t\t$owner = User::getByName($friend);\n\t\t\tif (!$owner) {\n\t\t\t\tcontinue;\n\t\t\t}\n\t\t\tif (!$owner -> isOnline()) {\n\t\t\t\t$offline[$owner -> getUid()] = $owner;\n\t\t\t} else {\n\t\t\t\t$online[$owner -> getUid()] = $owner;\n\t\t\t}\n\t\t}\n\t\tforeach ($online as $owner) {\n\t\t\t$table .= \"<tr class=\\\"online\\\">\n\t\t\t<td class=\\\"name\\\"><span class='username' style=''>\" . $owner -> getModule(\"UserTools\") -> getFormatUsername(true) . \"</span></td>\n\t\t\t<td class=\\\"world\\\"> World \" . $owner -> getLastWorld() . \"</td></tr>\";\n\t\t}\n\t\tforeach ($offline as $owner) {\n\t\t\t$table .= \"<tr class=\\\"offline\\\">\n\t\t\t<td class=\\\"name\\\"><span class='username' style='color: #9fabbf; '>\" . $owner -> getModule(\"UserTools\") -> getFormatUsername(true) . \"</span></td>\n\t\t\t<td class=\\\"world\\\">Offline</td></tr>\";\n\t\t}\n\t\tif ($table == \"\") {\n\t\t$table = \"You don't have any friends in your contact list. Add friends in-game for them to appear here.\";\n\t\t}\n\t\t$this -> template ->insert(\"icon\", \"user\");\n\t\t$this -> template -> insert(\"table\", $table);\n\t\t$this -> display();\n\t}",
"public function accept_friend_request()\n {\n //update status to 1;\n $this->Friend_model->accept_friend_request_model();\n //two (perhaps more in the future) data rows are inserted into checked_on table where each one corresponds to the time the user has seen the other user's messages\n $this->Friend_model->insert_notifications_model();\n }",
"function friend($IDUser,$ToUser) {\r\n $db = connect(); //Datenbank verbindung\r\n \r\n $sql = \"SELECT count(FromUser_ID) from kollegen where FromUser_ID = ? and ToUser_ID = ?;\";\r\n $statement = $db->prepare($sql);\r\n $statement->bind_param(\"ii\", $IDUser, $ToUser);\r\n $statement->execute();\r\n $statement->bind_result($result);\r\n\r\n \r\n while($statement->fetch()){\r\n $alreadyFriends = $result;\r\n }\r\n \r\n //Wen er mit dem User schon befreundet ist, wird true zurück gegeben\r\n if ($alreadyFriends == 1) {\r\n return true;\r\n }\r\n else{ //Wen er mit dem User nohc nicht befreundet ist, wird false zurück gegeben\r\n return false;\r\n }\r\n\r\n }",
"public function friends()\n {\n return $this->belongsToMany('App\\User', 'friends', 'user_id', 'friend_id');\n }",
"function friendFetch(){\n\n $friend=mysql_query(\"SELECT user_firstname,user_surname,user_birthday,user_gender,user_study,user_work,user_email FROM User,Account\n WHERE User.user_id=(SELECT user_id FROM Account WHERE user_email='$_SESSION[friend_email]')\n AND user_email='$_SESSION[friend_email]'\") or die(\"<p>Friend fetch failed.</p>\");\n\n $friendFetch=mysql_fetch_array($friend);\n\n return $friendFetch;\n}",
"public function allFriends()\n\t {\n\t\treturn Friend::where('accept', '=', 1)->where('friend_id', '=', $this->id)->Orwhere('user_id', '=', $this->id)->where('accept', '=', 1);\n\t }",
"public function addFriend($friend_guid);",
"function fetch_friends($email) {\n\tglobal $cxn;\n\t// Initialize variables\n\t$friends=NULL;\n\n\t$errArr=init_errArr(__FUNCTION__); \n\ttry\n\t{\n\t\t// Sql String\n\t\t$sqlString = \n\t\t \"SELECT users.ID, users.firstName, users.lastName,\n\t\t\t\t users.email, users.d_o_b, users.gender, users.status\n\t\t\t\t FROM users as users0 JOIN friends\n\t\t\t\t ON users0.ID = friends.user_id1\n\t\t\t\t JOIN users\n\t\t\t\t ON friends.user_id2=users.ID\n\t\t\t\t WHERE users0.email = ?\n\t\t\t\tUNION\n\t\t\t\t SELECT users.ID, users.firstName, users.lastName,\n\t\t\t \t users.email, users.d_o_b, users.gender, users.status\n\t\t FROM users as users0 JOIN friends\n\t\t\t\t ON users0.ID = friends.user_id2\t\n\t\t JOIN users\t\n\t\t\t\t ON friends.user_id1=users.ID\n\t\t\t\t WHERE users0.email = ?\n\t\t\t\t ORDER BY ID\";\n\t\t// Bind variables\n\t\t$stmt = $cxn->prepare($sqlString);\n\t\t$stmt->bind_param(\"ss\", $email, $email );\n\n\t\t$stmt->execute();\n\n\t\t// Store result\n\t\t// Bind results to variables \n\t\tbind_array($stmt, $row);\n\t\twhile ($stmt->fetch()) {\n\t\t\t$friends[]=cvt_to_key_values($row);\n\t\t}\n\t}\n\tcatch (mysqli_sql_exception\t$err)\n\t{\n\t\t// Error settings\n\t\t$err_code=1;\n\t\t$err_descr=\"Error selecting from friends, users with email: \" . $email ;\n\t\tset_errArr($err, $err_code, $err_descr, $errArr);\n\t}\n\t// Return Error code\n\t$errArr[ERR_AFFECTED_ROWS] = $cxn->affected_rows;\n\t$errArr[ERR_SQLSTATE] = $cxn->sqlstate;\n\t$errArr[ERR_SQLSTATE_MSG] = $cxn->error;\n\treturn array($errArr, $friends);\n}",
"public function FriendList(){\n if ($this->get_request_method() != \"POST\") {\n $this->response('', 406);\n }\n $discussion_id = $_POST['discussion_id'];\n $user_id = $_POST['user_id'];\n $authkey = $_POST['authkey'];\n $status = $_POST['status'];// 0 for declined, 1 for accept, 9 for pending\n $format = $_POST['format'];\n $this->dbConnect();\n $conn = $this->db;\n $res = new getService();\n if(!empty($user_id) && !empty($authkey)){\n $result = $res->CheckAuthentication($user_id, $authkey, $conn);\n if($result!=false){\n $result=$res->get_friend_list($discussion_id, $user_id, $status, $conn);\n }\n else{\n $error = array('status' => \"0\",\"msg\" => \"Not authorised to do this\");\n ($_REQUEST['format'] == 'xml') ? $this->response($this->xml($error), 200) : $this->response($this->json($error), 200);\n }\n }\n else{\n $error = array('status' => \"0\", \"msg\" => \"Fill All Fields\");\n ($_REQUEST['format']=='xml')?$this->response($this->xml($error), 200):$this->response($this->json($error), 200);\n }\n }",
"function queryFriends($user1, $user2, $irreversible = 0) {\n\n\t$data = DB::getInstance()->query('\n\t\tSELECT * FROM nl2_friends\n\t\tWHERE user_id = ' . $user1 . ' AND friend_id = ' . $user2\n\t, array())->results();\n\n\tif ($irreversible !== 1 && !count($data)) {\n\t\t$data = DB::getInstance()->query('\n\t\t\tSELECT * FROM nl2_friends\n\t\t\tWHERE user_id = ' . $user2 . ' AND friend_id = ' . $user1\n\t\t, array())->results();\n\t}\n\n\treturn $data;\n}",
"public function addAction(Request $request)\n {\n if ($selectedFriends = $request->get('friends_id')) {\n $currentUser = $this->getUser();\n $userRepository = $this->getDoctrine()->getRepository('KibokoSocialNetworkBundle:User');\n $friendshipRepository = $this->getDoctrine()->getRepository('KibokoSocialNetworkBundle:UserFriendship');\n $em = $this->getDoctrine()->getEntityManager();\n foreach ($selectedFriends as $selectedFriendId) {\n $mayBeFriend = $userRepository->findOneById($selectedFriendId);\n if ($usersFriendship = $friendshipRepository->findByUserAndFriendUser($currentUser, $mayBeFriend)) {\n if ($usersFriendship[0]->getUserSrc() === $currentUser) {\n if ($usersFriendship[0]->getNbRefusals() >= $this->container->getParameter('kiboko_social_network.friendship.nb_refusals')) {\n continue;\n }\n $friendship = $usersFriendship[0];\n $friendship2 = $usersFriendship[1];\n } else {\n if ($usersFriendship[1]->getNbRefusals() >= $this->container->getParameter('kiboko_social_network.friendship.nb_refusals')) {\n continue;\n }\n $friendship = $usersFriendship[1];\n $friendship2 = $usersFriendship[0];\n }\n } else {\n $friendship = new UserFriendship();\n $friendship->setUserSrc($currentUser);\n $friendship->setUserTgt($mayBeFriend);\n $friendship2 = new UserFriendship();\n $friendship2->setUserSrc($mayBeFriend);\n $friendship2->setUserTgt($currentUser);\n }\n $friendship->setStatus(UserFriendship::PENDING_STATUS);\n $friendship2->setStatus(UserFriendship::ASKING_STATUS);\n $em->persist($friendship);\n $em->persist($friendship2);\n $this->get('kiboko_social_network.friendship_mailer')->sendInvitMessage($mayBeFriend);\n }\n $em->persist($currentUser);\n $em->flush();\n $this->get('session')->setFlash('notice',\n $this->get('translator')->trans(\n 'kiboko_social.socialnetwork.invitation.success_msg',\n [],\n 'friendship'\n ));\n }\n\n return $this->redirect($this->generateUrl('kiboko_social_network_friendship_list'));\n }",
"public function friends() {\n\n // This method is to return all friends of a current user ($this->user)\n // where on pivot table 'friends' boolien field accepted is true\n // and from a friend perspective you need to accept him or her too so it need to be\n // both ways acceptence to be able to be a friends\n\n return $this->friendsOfMine()->wherePivot('accepted', true)->get()\n ->merge( $this->friendOf()->wherePivot('accepted', true)->get() );\n }",
"public function friends()\n {\n return $this->hasMany(Models\\AccountFriend::class, 'account_id');\n }",
"function getFriends()\n\t{\n\t\t//init variable\n\t\t$app = JFactory::getApplication();\n\t\t$user = JFactory::getUser($this->plugin->get('user')->id);\n\t\t$userid = $app->input->get('target_user',$this->plugin->get('user')->id,'INT');\n\t\t\n\t\t$search = $app->input->get('search','','STRING');\n\t\t\n\t\t$mapp = new EasySocialApiMappingHelper();\n\t\t\n\t\tif($userid == 0)\n\t\t$userid = $user->id;\n\t\t\n\t\t$frnd_mod = new EasySocialModelFriends();\n\t\t\n\t\t// if search word present then search user as per term and given id\n\t\tif(empty($search))\n\t\t{\n\t\t\t$ttl_list = $frnd_mod->getFriends($userid); \n\t\t}\n\t\telse\n\t\t{\n\t\t\t$ttl_list = $frnd_mod->search($userid,$search,'username');\n\t\t}\n\n\t\t$frnd_list = $mapp->mapItem( $ttl_list,'user',$userid);\n\n\t //get other data\n\t foreach($frnd_list as $ky=>$lval)\n\t {\t\t\t\n\t\t\t$lval->mutual = $frnd_mod->getMutualFriendCount($user->id,$lval->id);\n\t\t\t$lval->isFriend = $frnd_mod->isFriends($user->id,$lval->id);\n\t\t}\n\t\treturn( $frnd_list );\n\t}",
"function lookup_user_friend($friendid)\r\n\t{\r\n\t\t$this->load->database();\r\n\t\t$str = \"SELECT m_identity FROM videochat_registrations \r\n\t\t\t\tWHERE uid=?;\";\r\n\t\t\t\t\r\n\t\t$data = array($friendid);\r\n\t\t\r\n\t\t$query = $this->db->query($str, $data);\r\n\t\t\r\n\t\t// return the single record with this user's identity, \r\n\t\t// or return NULL if user is not found\r\n\t\tif ($query->num_rows() > 0)\r\n\t\t\treturn $query->row();\r\n\t\telse\r\n\t\t\treturn NULL;\t\t\r\n\t}",
"public function friends()\n\t{\n\t\treturn $this->friendsOfMine()->wherePivot('accepted',true)->get()->merge($this->friendsOf()->wherePivot('accepted',true)->get());\n\t}",
"public function getIdFriends()\n {\n $friendsTo = Friend::model()->findAll(array('select' => 'idUserTo','condition'=>'idUserFrom=:idUser and accepted=1','params'=>array(':idUser'=>$this->idUser))); \n $friendsFrom = Friend::model()->findAll(array('select' => 'idUserFrom','condition'=>'idUserTo=:idUser and accepted=1','params'=>array(':idUser'=>$this->idUser))); \n $friends = array();\n foreach($friendsTo as $row)\n $friends[] = $row->idUserTo;\n foreach($friendsFrom as $row)\n $friends[] = $row->idUserFrom;\n return $friends;\n }",
"public function getfriendsAction()\r\n {\r\n $User = $this->getUser();\r\n $data = $User->getFriends();\r\n return $data;\r\n }",
"public function getfriendsoffriendAction()\r\n {\r\n $User = $this->getUser();\r\n $data = $User->getFriendsOfFriends();\r\n return $data;\r\n }",
"function getAllFriends() {\n $query = \"SELECT id, concat(t1.first_name,' ' , t1.last_name) as name, t1.email\n FROM users as t1\n LEFT JOIN friends as t2\n on t1.id = t2.friend_id\n WHERE t2.user_id =\".$this->data['id'];\n $people = $this->connection->fetch_all($query);\n return array_map(function($data) { return new Person($data); }, $people);\n }",
"function userconnection_frnd_relationship($path_array) {\r\n\tglobal $setting, $database;\r\n\t$temp =-1;\r\n\tforeach ($path_array as $key) {\r\n\t\t$query = $database->database_query(\"SELECT friend_type FROM se_friends WHERE friend_user_id1 = $temp AND friend_user_id2 = $key \");\r\n\t\t $temp = $key;\r\n\t\t while($ee = $database->database_fetch_assoc($query)) {\r\n\t\t \t$relation[] = $ee['friend_type'];\r\n\t\t }\r\n\t}\r\n return $relation;\r\n}",
"function requestFriends() {\n $username = $_GET['username'];\n\n $response = retrieveFriends($username);\n\n if ($response['status'] == 'SUCCESS') {\n echo json_encode($response['response']);\n } else {\n errorHandler($response['status'], $response['code']);\n }\n }",
"public function myfriends()\n {\n $uid = Auth::user()->id;\n //display data to requester side user_requested Info\n $friend1 = DB::table('friendships as f')->leftjoin('users as u','u.id','=','f.user_requested')\n ->where('status',1)\n ->where('requester',$uid)\n ->get();\n\n //display data to user_requested side requester Info \n $friend2 = DB::table('friendships as f')->leftjoin('users as u','u.id','=','f.requester')\n ->where('status',1)\n ->where('user_requested',$uid)\n ->get();\n // dd($friend2);\n $friends = array_merge($friend1->toArray(),$friend2->toArray());\n return view('friendships.myfriendlist',compact('friends'));\n }",
"function friendList($settings, $user_id)\r\n{\r\n$url = \"https://api.twitter.com/1.1/friends/list.json\";\r\n$requestMethod = \"GET\";\r\n$getfield = \"?user_id=\".$user_id;\r\n$twitter = new TwitterAPIExchange($settings);\r\n$string = json_decode($twitter->setGetfield($getfield)\r\n->buildOauth($url, $requestMethod)\r\n->performRequest(),$assoc = TRUE);\t\r\necho \"<b><u>\" . \"Get Friend List of user ID \" . $user_id . \"</u></b>\";\r\necho \"<br>\";\r\n$i = 0;\r\nforeach($string[\"users\"] as $items)\r\n{\r\n$i++;\r\necho \"Friend: \" . $i . \"<br>\";\r\necho \"Profile Picture : \" . \"<img src=\" . $items['profile_image_url_https'] . \"/>\" . \"<br />\";\r\necho \"Name : \" . $items[\"name\"] . \"<br />\";\r\necho \"Screen name: \". $items[\"screen_name\"].\"<br />\";\r\necho \"<br><br>\";\r\n}\r\necho \"<hr>\";\r\n}",
"function friendRequestSent($user_id, $friend_id)\n{\n if(!$user_id || !$friend_id || $user_id==$friend_id )\n return false;\n \n $sql=\"select * from `friend` where `user_id` = {$user_id} and `friend_id` = {$friend_id} and `verify_code` != '' \";\n $rc=mysql_query($sql);\n if(mysql_num_rows($rc))\n {\n $row=mysql_fetch_assoc($rc);\n ///my/func.php?f=verifyfriend&code=\".$code\n return $row['verify_code'];\n }\n \n return false;\n}",
"public static function get_friends_ids()\n\t{\n\t\t// get current user's id\n\t\t$my_id = Auth::user()->id;\n\t\t// get user id's from the 2nd column of the table\n\t\t$friends_ids_right = parent::where('UserID1', '=', $my_id)\n\t\t\t\t\t\t\t\t\t->where('Type', '=', 'friend')\n\t\t\t\t\t\t\t\t\t->get();\n\t\t// get user id's from the 1st column of the table\n\t\t$friends_ids_left = parent::where('UserID2', '=', $my_id)\n\t\t\t\t\t\t\t\t\t->where('Type', '=', 'friend')\n\t\t\t\t\t\t\t\t\t->get();\n\t\t// merge objects\n\t\t$friends_ids = object_merge($friends_ids_right, $friends_ids_left);\n\t\t// return false if no objects found\n\t\tif(empty($friends_ids)) {\n\t\t\treturn false;\n\t\t}\n\t\treturn $friends_ids;\n\t}",
"public function TableFriends($con,$id){\n $cmd = \"SELECT * from friends where id_response = $id \";\n $id_friends = array();\n $rst = mysqli_query($con,$cmd);\n while($row = mysqli_fetch_row($rst)) $id_friends[] = $row[1];\n $cmd = \"SELECT * from friends where id_request = $id \";\n $rst = mysqli_query($con,$cmd);\n while($row = mysqli_fetch_row($rst)) $id_friends[] = $row[2];\n return $id_friends;\n }",
"function listAll() {\n //$limit = 1000;\n //$offset = (max(1, $page) - 1) * $limit;\n $uid = userInfo('uid');\n $model = Model::load('FriendModel');\n $friends = $model->getAll($uid);\n// $db = Database::create();\n// $r = $db->read(\"select * from Users limit $offset, $limit\");\n// $c = $db->read(\"select count(*) as c from Users\");\n// $total = intval($c[0]['c']);\n//\n// $r = array_map([User::class, 'mapper_user_list'], $r);\n\n View::load('user_list', [\n 'total' => count($friends),\n //'total_page' => ceil($total / $limit),\n 'friend_list' => $friends\n ]);\n }",
"public function addToFriendsAction()\n {\n $model = $this->getCurrentUser();\n $friendId = $this->getRequest()->getBodyParams('id');\n\n try\n {\n $friend = $this->getUserService()->addToFriends($model->getId(), $friendId);\n } catch (\\InvalidArgumentException $e)\n {\n return $this->sendErrorResponse([$e->getMessage()]);\n } catch (NotFoundException $e)\n {\n return $this->sendErrorResponse([$e->getMessage()]);\n }\n\n $map = $this->getMapService()->renderMapWithMarker($friend->getLatlng(), $friend->getLocationName());\n\n $this->sendResponse(\n [\n 'id' => $friend->getId(),\n 'type' => User::class,\n 'properties' => [\n 'user' => $friend,\n 'isFriend' => true,\n 'location' => [\n 'html' => htmlentities($map['html']),\n 'js' => htmlentities(trim($map['js'])),\n ],\n ],\n ]\n );\n }",
"public function run()\n\t{\n\t\tDB::table('friendsonline')->delete();\n\t\t// buat data \n\t\t\\App\\Models\\FriendOnline::create(array(\n\t\t'id' => Uuid::generate(),\n\t\t'user1' => DB::table('users')->where('email', '[email protected]')->first()->id,\n\t\t'user2' => DB::table('users')->where('email', '[email protected]')->first()->id,\n\t\t'status' => 'ACCEPTED',\n\t\t'isfavorite' => 1,\n\t\t));\n\n\t\t/*\\App\\Models\\FriendOnline::create(array(\n\t\t'id' => Uuid::generate(),\n\t\t'user1' => DB::table('users')->where('email', '[email protected]')->first()->id,\n\t\t'user2' => DB::table('users')->where('email', '[email protected]')->first()->id,\n\t\t'status' => 'ACCEPTED',\n\t\t'isfavorite' => 1,\n\t\t));\n\n\t\t\\App\\Models\\FriendOnline::create(array(\n\t\t'id' => Uuid::generate(),\n\t\t'user1' => DB::table('users')->where('email', '[email protected]')->first()->id,\n\t\t'user2' => DB::table('users')->where('email', '[email protected]')->first()->id,\n\t\t'status' => 'DECLINED',\n\t\t));*/\n\t}",
"function createListRecord($user_id, $friend_id, $friend_l_name, $connection_id, $table) {\n $hn = 'db715263433.db.1and1.com';\n $db = 'db715263433';\n $un = 'dbo715263433';\n $pw = '1Lovecandy!';\n $conn = new mysqli($hn, $un, $pw, $db);\n if ($conn->connect_error) die($conn->connect_error);\n $query = \"INSERT INTO $table VALUES($user_id, $friend_id, '$friend_l_name', $connection_id, now());\";\n $res = $conn->query($query);\n return $res;\n}",
"function updateFriends($user) {\n if ($user==null)\n return;\n $this->load->model('facebook_model');\n $facebook_friends = $this->facebook_model->getFriends();\n if (count($facebook_friends)==0)\n return;\n // filter users in DB\n $friends = $this->getUsersByFacebookIds($facebook_friends);\n if (count($friends)==0) {\n echo 'no friends left :(';\n return;\n }\n // prepare list\n $values = '';\n $userId = $user->id;\n foreach ($friends as $friend) {\n $friendId = $friend->id;\n $values .= '(\"' . $userId . '\", \"' . $friendId . '\"), ';\n $values .= '(\"' . $friendId . '\", \"' . $userId . '\"), ';\n }\n // delete current friendships and insert the updated ones\n $queryStr = 'DELETE FROM users_friends WHERE user_id='.$userId.' OR friend_id='.$userId.';';\n $this->runQuery($queryStr);\n $queryStr = 'INSERT INTO users_friends (user_id, friend_id) VALUES ' . substr($values, 0, -2) . ';';\n $this->runQuery($queryStr);\n }",
"public function friends($user_id){\r\n\t\tif(preg_match('/[^a-zA-Z0-9-_@]/', $user_id )){\r\n\t\t\tKohana::show_404();\t\r\n\t\t}\r\n\t\t\r\n\t\t$user = ORM::factory('user', $user_id);\r\n\t\t\r\n\t\tif(empty($user->id)){\r\n\t\t\tKohana::show_404();\r\n\t\t}\r\n\t\t\r\n\t\tstylesheet::add(array('friends', 'facebox','edit_style'));\r\n\t\tjavascript::add(array('friendship', 'facebox', 'jquery.form'));\r\n\t\t\r\n\t\t$view = new View('friends');\r\n\t\t\r\n\t\t//friend requests\r\n\t\t$view->friend_req = ORM::factory('friendship')\r\n\t\t\t\t\t\t\t->select(\"users.*\")\r\n\t\t\t\t\t\t\t->join(\"users\",\"users.id\", \"friendships.user_id\", \"left\")\r\n\t\t\t\t\t\t\t->where(array('friendships.friend_id' => $user->id, 'friendships.status' => 1))\r\n\t\t\t\t\t\t\t->find_all();\r\n\r\n\t\t//all friends\r\n\t\t$view->friends = ORM::factory('friendship')\r\n\t\t\t\t\t\t\t->select(\"users.*\")//, events.id as event_id, events.name as eventname\")\r\n\t\t\t\t\t\t\t->join(\"users\",\"users.id\", \"friendships.user_id\", \"LEFT\")\r\n\t\t\t\t\t\t\t//->join('events_users', 'users.id', 'events_users.user_id','LEFT')\r\n\t\t\t\t\t\t\t//->join('events', 'events.id = events_users.event_id and events.start_date > ' .time() , '','LEFT')\r\n\t\t\t\t\t\t\t//->groupby('users.id')\r\n\t\t\t\t\t\t\t->where(array('friendships.friend_id' => $user->id, 'friendships.status' => 2))\r\n\t\t\t\t\t\t\t->find_all();\r\n\t\t$user_ids = array();\r\n\t\t$users_vs_events = array();\r\n\t\tforeach($view->friends as $fr){\r\n\t\t\t$user_ids[] = $fr->id;\r\n\t\t\t$users_vs_events[$fr->id] = array('event_id'=>null, 'event_name'=>null); \t\r\n\t\t}\r\n\t\t\r\n\t\t//friens future events\r\n\t\tif(count($user_ids) > 0) {\r\n\t\t\t$events = Database::instance()->query(' SELECT e.user_id, e.id, e.name\r\n\t\t\t\t\t\t\t\t\t\t\t\tFROM (SELECT e.id, e.name, eu.user_id FROM `events` e \r\n\t\t\t\t\t\t\t\t\t\t\t\t\tINNER JOIN events_users eu ON eu.event_id = e.id\r\n\t\t\t\t\t\t\t\t\t\t\t\t WHERE eu.user_id IN (' . implode(', ',$user_ids) . ') AND e.start_date > ' . time() . ' \r\n\t\t\t\t\t\t\t\t\t\t\t\t ORDER BY e.start_date ASC) AS e \r\n\t\t\t\t\t\t\t\t\t\t\t\tGROUP BY user_id');\r\n\t\t}else {\r\n\t\t\t$events = array();\r\n\t\t}\r\n\t\tforeach($events as $ev){\r\n\t\t\t$users_vs_events[$ev->user_id] = array('event_id'=>$ev->id, 'event_name'=>$ev->name); \r\n\t\t}\t\t\r\n\t\t\r\n\t\t$view->users_vs_events = $users_vs_events;\r\n\t\t\t\t\t\t\t\r\n\t\t\t\t\t\t\t\r\n\t\t//online users count\t\t\t\t\t\r\n\t\t$view->online_count = ORM::factory('friendship')\r\n\t\t\t\t\t\t\t->join(\"users\",\"users.id\", \"friendships.user_id\", \"left\")\r\n\t\t\t\t\t\t\t->where(array('friendships.friend_id' => $user->id, 'friendships.status' => 2, 'users.last_login < '=>time() + 60*15 ))\r\n\t\t\t\t\t\t\t->count_all();\r\n\r\n\t\t\r\n\t\t//events where most friends goes\r\n\t\t$view->most_events = ORM::factory('friendship')\r\n\t\t\t\t\t\t\t ->select('events.*', 'categories.id as catid', 'categories.name as catname', 'users.username', 'events_users.type',\r\n\t\t\t\t\t\t\t \t\t '(SELECT type FROM events_users WHERE user_id = 6 AND event_id = events.id )AS type')\r\n\t\t\t\t\t\t\t ->join('events_users', 'events_users.user_id', 'friendships.friend_id','INNER')\r\n\t\t\t\t\t\t\t ->join('events', 'events_users.event_id', 'events.id','INNER')\r\n\t\t\t\t\t\t\t ->join('categories', 'categories.id', 'events.category_id','INNER')\r\n\t\t\t\t\t\t\t ->join('users', 'users.id', 'events.author_id','INNER')\r\n\t\t\t\t\t\t\t ->where( array('friendships.user_id'=>$user->id,\r\n\t\t\t\t\t\t\t \t\t\t\t'events.start_date >'=>time() ) )\r\n\t\t\t\t\t\t\t ->groupby('events_users.id')\r\n\t\t\t\t\t\t\t ->orderby('COUNT(events_users.id)','desc')\r\n\t\t\t\t\t\t\t ->find_all(5);\r\n\t\tif($this->logged_in && $this->user->id == $user->id){\r\n\t\t\t$view->my_friends = true;\r\n\t\t}else {\r\n\t\t\t$view->my_friends = false;\r\n\t\t}\r\n\t\t\t\r\n\t\t$view->owner = $user;\r\n\t\t$view->render(true);\r\n\t}",
"function addFriend($mysqli, $userID1, $userID2, $requesterID, $timestamp){\r\n $user1 = ($userID1 < $userID2) ? $userID1 : $userID2;\r\n $user2 = ($userID1 < $userID2) ? $userID2 : $userID1;\r\n\r\n $result = $mysqli->query('SELECT * FROM `friends` WHERE userID1 = '.$userID1.' AND userID2 = '.$userID2.'');\r\n\r\n if($result){\r\n if($result->num_rows == 0){\r\n $mysqli->query('INSERT INTO `friends` VALUES (NULL,'.$userID1.','.$userID2.','.$requesterID.',0,'.$timestamp.')');\r\n return 1;//dont need to return result for this method just boolean because result isn't used when this method is called in ajax_add_friend.php\r\n }else{\r\n return 0;//this else block should never be triggered because button will be disabled if pending, but just incase\r\n }\r\n }else{\r\n return 2;//this means there was an error\r\n }\r\n }",
"public function friendReq($id)\n {\n $this->db->select('users.id,users.first_name,users.last_name,users.img_name,users.modified,relationship.friend_id as my_id, relationship.user_id as u_id, relationship.status as r_status, relationship.id as r_id, relationship.modified as r_mod');\n $this->db->from('users');\n $this->db->join('relationship', 'users.id = relationship.user_id', 'left');\n // $this->db->or_where('relationship.user_id = '.$id);\n $this->db->where('relationship.friend_id = '.$id);\n $this->db->where('relationship.status = \"pending\" OR relationship.status = \"seen\"');\n $query = $this->db->get();\n \n return $query->result_array();\n }",
"function insert_friend( $con, $user_id, $id ){\n\n\t\t$res = insert_friend_query( $con, $user_id, $id ); \n\t\tfree_result($res);\n\t\t//return $res; \t\n\t}",
"function chat_friends ($user_guid) {\n\t$user = get_user($user_guid);\n\tif (!$user) {\n\t\tforward('chat/all');\n\t}\n\n\t$params = array();\n\t$params['filter_context'] = 'friends';\n\t$params['title'] = elgg_echo('chat:title:friends');\n\n\t$crumbs_title = $user->name;\n\telgg_push_breadcrumb($crumbs_title, \"chat/owner/{$user->username}\");\n\telgg_push_breadcrumb(elgg_echo('friends'));\n\n\telgg_register_title_button();\n\n\t$options = array(\n\t\t'type' => 'object',\n\t\t'subtype' => 'chat',\n\t\t'relationship' => 'member',\n\t\t'relationship_guid' => $user_guid,\n\t\t'inverse_relationship' => false,\n\t\t'limit' => 10,\n\t\t'pagination' => true,\n\t\t'full_view' => false,\n\t);\n\n\tif ($friends = get_user_friends($user_guid, ELGG_ENTITIES_ANY_VALUE, 0)) {\n\t\tforeach ($friends as $friend) {\n\t\t\t$options['container_guids'][] = $friend->getGUID();\n\t\t}\n\t\t$params['content'] = elgg_list_entities_from_relationship($options);\n\t}\n\n\tif (empty($params['content'])) {\n\t\t$params['content'] = elgg_echo('chat:none');\n\t}\n\n\treturn $params;\n}",
"protected function addUserAndFriend(Request $request){\n $username = Auth::user()->name;\n $friendname = $request->name;\n\n $userAndfriend = new userfriends;\n\n $userAndfriend->user = $username;\n $userAndfriend->friends = $friendname;\n\n $userAndfriend->save();\n }",
"public function myPendingFriends()\n {\n $args = array();\n\n return $this->_request('user/pending', $args, true);\n }",
"public function find_friend_to_invite($where1,$where2) {\n\t\t$this->db->select('*');\n\t\t$this->db->from(\"relationship\");\n\t\t$this->db->where($where1);\n\t\t$this->db->or_where($where2);\n\t\t$this->db->join('user','user.id_user = relationship.id_user_2');\n\t\treturn $this->db->get();\n\t}",
"public function getFriendsList(Request $request)\n {\n $sender = auth()->user()->id;\n\n $friends = Channel::where('type', 'dm')->with([\"users\" => function ($query) use ($sender) {\n // Removes user data object from the users array that \n // matches the id in $sender \n $query->where(\"id\", \"!=\", $sender); \n }])->whereHas('users', function ($q) use ($sender) {\n // Only returns the channels that $sender has participated in\n $q->where('user_id', $sender);\n })->get();\n\n // Checks for Online status of Users\n $friends = $this->listOnlineUsers($friends);\n\n // Sets the Avatar URL for all friends\n foreach( $friends as $friend) {\n\n $user = $friend->users[0]->id;\n $avatar = null;\n\n // If avatar is found, send it over, else send the default image\n if(User::find($user)->details) {\n $avatar = User::find($user)->details->avatar;\n } else {\n $avatar = 'avatars/defaultuser.png';\n }\n\n $friend->users[0]->avatar = $avatar;\n }\n return response()->json($friends);\n }",
"function user_add_friend_notification($logged_user_id)\n\t{\n\t\t$this->db->select('users.user_file,users.sex,users.first_name,,users.last_name,friend_request.uid_to,friend_request.uid_from,friend_request.requested_as');\n\t\t$this->db->from('users');\n\t\t$this->db->join('friend_request', 'friend_request.uid_from=users.id');\n\t\t$this->db->where('friend_request.uid_to' , $logged_user_id);\n\t\t$this->db->where('friend_request.status' , 0);\n\t\t$query = $this->db->get();\n\t\t//echo $this->db->last_query();\n\t\t\n\n\t\tif ($query->num_rows() > 0)\n\t\t{\n\t\t\treturn $query->result_array();\n\t\t}\n\t\telse\n\t\t{\n\t\t\treturn false;\n\t\t}\n\t}",
"public function getFriends($subtype = \"\", $limit = 10, $offset = 0);",
"public function getFriendsOf($subtype = \"\", $limit = 10, $offset = 0);",
"public function index()\n {\n $uid = Auth::user()->uid;\n $lid = DB::table(\"block_memb\") \n ->where([\n ['uid', '=', $uid],\n ['active', '=', 'valid']\n ])\n ->whereNull('leavetime')\n ->distinct()\n ->value(\"bid\");\n $lid = isset($lid)? $lid : -1;\n $blockstranger = DB::table(\"block_memb as bm\") \n ->where([\n ['bm.uid', '!=', $uid],\n ['bm.bid', '=', $lid],\n ['bm.active', '=', 'valid'],\n ])\n ->join(\"locality as l\", \"l.lid\", \"=\", \"bm.bid\")\n ->join(\"user as u\", \"bm.uid\", '=', \"u.uid\")\n ->join(\"profile as p\", \"p.uid\", \"=\", \"u.uid\")\n ->select('bm.uid', 'l.ltype', 'l.name as lname', 'u.name as uname', 'u.email', \"p.phone\", \"p.description\")\n ->get();\n $friendreq = DB::table(\"friend as f\")\n ->where([\n ['uid1', '=', $uid],\n ['status', '=', 'valid']\n ])\n ->join(\"user as u\", \"u.uid\", \"uid2\")\n ->join(\"profile as p\", \"p.uid\", \"=\", \"u.uid\")\n ->leftjoin(\"block_memb as bm\", \"bm.uid\", \"=\", \"u.uid\")\n ->leftjoin(\"locality as l\", \"l.lid\", \"=\", \"bm.bid\")\n ->select('bm.uid', 'l.ltype', 'l.name as lname', 'u.name as uname', 'u.email', \"p.phone\", \"p.description\");\n $friendall = DB::table(\"friend as f\")\n ->where([\n ['uid2', '=', $uid],\n ['status', '=', 'valid']\n ])\n ->join(\"user as u\", \"u.uid\", \"uid1\")\n ->join(\"profile as p\", \"p.uid\", \"=\", \"u.uid\")\n ->leftjoin(\"block_memb as bm\", \"bm.uid\", \"=\", \"u.uid\")\n ->leftjoin(\"locality as l\", \"l.lid\", \"=\", \"bm.bid\")\n ->select('bm.uid', 'l.ltype', 'l.name as lname', 'u.name as uname', 'u.email', \"p.phone\", \"p.description\")\n ->unionAll($friendreq)\n ->get();\n $neighbor = DB::table(\"neighbor as n\")\n ->where([\n ['uid1', '=', $uid]\n ])\n ->join(\"user as u\", \"n.uid2\", \"=\", \"u.uid\")\n ->join(\"profile as p\", \"p.uid\", \"=\", \"u.uid\")\n ->select('u.uid', 'u.name as uname', 'u.email', \"p.phone\", \"p.description\")\n ->get();\n $neighborof = DB::table(\"neighbor as n\")\n ->where([\n ['uid2', '=', $uid]\n ])\n ->join(\"user as u\", \"n.uid1\", \"=\", \"u.uid\")\n ->join(\"profile as p\", \"p.uid\", \"=\", \"u.uid\")\n ->select('u.uid', 'u.name as uname', 'u.email', \"p.phone\", \"p.description\")\n ->get();\n $myfriendreq = DB::table(\"friend as f\")\n ->where([\n ['uid1', '=', $uid],\n ['status', '=', 'processing']\n ])\n ->join(\"user as u\", \"u.uid\", '=',\"f.uid2\")\n ->select('u.name as uname', 'u.email', \"u.uid\")\n ->get();\n $recvreq = DB::table(\"friend as f\")\n ->where([\n ['uid2', '=', $uid],\n ['status', '=', 'processing']\n ])\n ->join(\"user as u\", \"u.uid\", '=',\"f.uid1\")\n ->select('u.name as uname', 'u.email', \"u.uid\")\n ->get(); \n return view('home', ['lid' => $lid, 'blockstranger' => $blockstranger, 'friend' => $friendall,\n 'neighbor' => $neighbor, 'neighborof' => $neighborof,'myfriendreq' => $myfriendreq, 'recvreq' => $recvreq\n ]);\n }",
"function getFriendID($user_id, $connection_id, $table) {\n $conn = new my_mysql();\n $query = '';\n switch($table) {\n case 0:\n $query = \"SELECT * FROM connection WHERE id=$connection_id;\";\n $res = $conn->readQuery($query)->fetch_assoc();\n if ($res['id_one'] == $user_id) {\n return $res['id_two'];\n } else {\n return $res['id_one'];\n }\n break;\n case 1:\n $query = \"SELECT * from connection_request WHERE id=$connection_id;\";\n $res = $conn->readQuery($query)->fetch_assoc();\n if ($res['user_id'] == $user_id) {\n return $res['request_id'];\n } else {\n return $res['user_id'];\n }\n break;\n }\n}",
"function relation(){\n\n $relation=mysql_query(\"SELECT user,friend FROM Friend\n WHERE (user=(SELECT user_id FROM Account WHERE user_email='$_SESSION[user_email]')\n AND friend=(SELECT user_id FROM Account WHERE user_email='$_SESSION[friend_email]'))\n OR (user=(SELECT user_id FROM Account WHERE user_email='$_SESSION[friend_email]')\n AND friend=(SELECT user_id FROM Account WHERE user_email='$_SESSION[user_email]'))\") \n or die(\"<p>Find relation failed</p>\");\n\n $relationNum=mysql_num_rows($relation);\n\n return $relationNum;\n }",
"protected function addFriend($user, $partner)\r\n\t{\r\n\t\t\r\n\t\t/* SEND REQUEST */\r\n\t\t\r\n\t\t$count = 1;\r\n \r\n $count = Db::dbSQL_action(SQL_SELECT_FRIENDS, array('[user]','[partner]'), array($user,$partner));\r\n \r\n\r\n \r\n\t\tif ( $count < 1 )\r\n {\r\n\t\t \r\n //debug line\r\n\t\t //var_dump(str_replace(array('[user]','[partner]'), array($user,$partner), SQL_SELECT_BLOCKS));\r\n switch (CMS)\r\n {\r\n case \"SocialEngine\":\r\n $count = Db::dbSQL_action(SQL_SELECT_BLOCKS, array('[user]','[partner]'), array($partner, $user));\r\n if ($count < 1)\r\n {\r\n Db::dbSQL_action(SQL_INSERT_FRIENDS, array('[user]','[partner]', '[accepted_r]', '[accepted_u]', '[created]'), array($user, $partner, 0, 1, date(\"Y-m-d h:i:s\")));\r\n Db::dbSQL_action(SQL_INSERT_FRIENDS, array('[user]','[partner]', '[accepted_r]', '[accepted_u]', '[created]'), array($partner, $user, 1, 0, date(\"Y-m-d h:i:s\")));\r\n Db::dbSQL_action(SOCIAL_ENGINE_FRIEND_REQUEST_ADD, array('[user]','[partner]', '[created]'), array($user, $partner, date(\"Y-m-d h:i:s\")));\r\n }\r\n break;\r\n \r\n case \"PHPFox\":\r\n $count = Db::dbSQL_action(SQL_SELECT_BLOCKS, array('[user]','[partner]'), array($partner, $user));\r\n if ($count < 1)\r\n {\r\n Db::dbSQL_action(SQL_INSERT_FRIENDS, array('[user]','[partner]'), array($user, $partner));\r\n Db::dbSQL_action(PHPFOX_FRIEND_REQUEST_ADD, array('[user]','[partner]'), array($user, $partner));\r\n }\r\n break;\r\n \r\n default:\r\n if ((Db::dbSQL_action(SQL_SELECT_BLOCKS, array('[user]','[partner]'), array($user,$partner)) > 0) && FB_SAME_TABLE )\r\n {\r\n Db::dbSQL_action(SQL_UPDATE_FRIENDS, array('[user]','[partner]'), array($user,$partner));\r\n }\r\n else\r\n {\r\n //debug line\r\n \t\t //var_dump(str_replace(array('[partner]','[user]'), array($user,$partner), SQL_SELECT_BLOCKS));\r\n \r\n if (Db::dbSQL_action(SQL_SELECT_BLOCKS, array('[partner]','[user]'), array($user,$partner)) == 0)\r\n {\r\n \t Db::dbSQL_action(SQL_INSERT_FRIENDS, array('[user]','[partner]', '[accepted]', '[pending]', '[created]', '[created Y-m-d]'), array($user, $partner, 0, 0, mktime(), date(\"Y-m-d\")));\r\n }\r\n //debug line\r\n \t\t //var_dump(str_replace(array('[user]','[partner]'), array($user,$partner), SQL_INSERT_FRIENDS));\r\n \r\n }\r\n break;\r\n }\r\n \r\n echo \"<\".$this->_action.\"_partner_add />\";\r\n\t\t\t\r\n\t\t}\r\n\t\telse echo \"<\".$this->_action.\"_partner_exists />\";\r\n\t}",
"public static function friends ( $req ) {\n\t\n\t\t$req['section'] = \"home\";\n\t\t$req['sub_section'] = \"friends\";\n\t\t$req['get_public'] = false;\n\t\t$req['only_people'] = true;\n\t\t\n\t\tself::_default( $req );\n\t\t\n\t}",
"function getFriendVitals($user_id) {\n $conn = new my_mysql();\n $query = \"SELECT id, f_name, l_name, username, ppid FROM user_logging WHERE id=$user_id\";\n $res = $conn->readQuery($query);\n if ($res) {\n return $res->fetch_assoc();\n }\n}",
"public function acceptFR($id)\n {\n $data = array(\n 'status' => 'friend',\n 'modified' => $this->today,\n );\n $this->db->where(\"(`user_id` =\". $id.\" AND `friend_id` =\".$this->session->Auth['id'].\")\");\n $this->db->or_where(\"(`user_id` =\".$this->session->Auth['id'].\" AND `friend_id` = \".$id.\")\");\n if($this->db->update('relationship',$data)){\n return true;\n } else{\n return false;\n }\n }",
"public function worker_email_vc_user_friends($oauth_uid = \"504405294\"){\n\t\t\n\t\t\n\t\t$this->db->where(array('oauth_uid' => $oauth_uid));\n\t\t$query = $this->db->get('users');\n\t\t$result = $query->row();\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t/*\t\n\t\t$this->load->helper('run_gearman_job');\n\t\t$arguments = array(\n\t\t\t'user_oauth_uid'\t=> $result->oauth_uid,\n\t\t\t'access_token'\t\t=> $result->access_token\n\t\t);\n\t\t\n\t\trun_gearman_job('gearman_email_friends_new_user', $arguments, false);\n\t\t\n\t\t*/\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t\t//user just logged in, notify friends\n\t\t$this->load->helper('run_gearman_job');\n\t\t$arguments = array('access_token' => $result->access_token,\n\t\t\t\t\t\t\t\t'user_oauth_uid' => $result->oauth_uid);\n\t\trun_gearman_job('gearman_vc_user_notify_friends_online', $arguments, false);\n\t\t\n\t\treturn;\n\t\t\t\t\n\t}",
"public function get_friend_count() {\n\t\treturn (int)ORM::factory('friend')->where('user_id', '=', $this->id)->count_all();\n\t}",
"function browseUserFriends($userID, $page = 1, $limit = 25) {\n $selectFrom = ($page - 1) * $limit;\n $sql = 'SELECT Users.id, Users.name\n FROM Users\n LEFT OUTER JOIN Friends On Friends.friendID = Users.id\n WHERE Friends.userID = \\'' . $userID . '\\'\n ORDER BY Users.name\n LIMIT ' . $selectFrom . ', ' . $limit;\n $db = new Database();\n $results = $db->select($sql);\n return $results;\n }",
"public function addAsFriend($id)\n {\n \n\n $query = $this->db->get_where('relationship',array(\n 'friend_id' => $id,\n 'user_id' => $this->session->Auth['id'],\n ));\n\n\n if(empty($query->result_array())){\n $insert = array(\n 'user_id' => $this->session->Auth['id'],\n 'friend_id' => $id,\n 'status' => 'pending',\n 'created' => $this->today,\n 'modified' => $this->today,\n );\n if($this->db->insert('relationship',$insert)){\n return true;\n }else{\n return false;\n }\n }\n }",
"public function get_friends_by_user_id($id) {\n // FROM friends\n // INNER JOIN users u1\n // ON friends.from_id = u1.id\n // INNER JOIN users u2\n // ON friends.to_id = u2.id\n // WHERE u1.id = ? OR u2.id = ?';\n $query = 'SELECT\n CASE\n WHEN friends.from_id = ? THEN friends.to_id\n WHEN friends.to_id = ? THEN friends.from_id\n END AS \"friend_id\",\n CASE\n WHEN friends.from_id = ? THEN CONCAT(u2.first_name, \" \", u2.last_name)\n WHEN friends.to_id = ? THEN CONCAT(u1.first_name, \" \", u1.last_name)\n END AS \"friend_name\",\n status\n FROM friends\n INNER JOIN users u1\n ON friends.from_id = u1.id\n INNER JOIN users u2\n ON friends.to_id = u2.id\n WHERE (u1.id = ? OR u2.id = ?) AND status = 2';\n return $this->db->query($query, array($id, $id, $id, $id, $id, $id))->result_array();\n }",
"public function friendsOfFriends($userId, $n, $i = 1)\n {\n if ($i == 1) {\n $this->friendsOfFriends = Redis::sMembers('uid:' . $userId . ':friendslist');\n $this->friendsOfFriends[] = $userId;\n $this->currentLevelUniqueFriends = $this->friendsOfFriends;\n } else {\n foreach ($this->currentLevelUniqueFriends as $friend) {\n $currentLevelFriends = Redis::sMembers('uid:' . $friend . ':friendslist');\n foreach ($currentLevelFriends as $currentLevelFriend) {\n if (!in_array($currentLevelFriend, $this->friendsOfFriends)) {\n $this->friendsOfFriends[] = $currentLevelFriend;\n $uniqueFriends[] = $currentLevelFriend;\n }\n }\n }\n if (isset($uniqueFriends)) {\n $this->currentLevelUniqueFriends = $uniqueFriends;\n }\n }\n if (empty($this->currentLevelUniqueFriends)) {\n return response($this->friendsOfFriends, 200);\n }\n if ($n == $i) {\n return response($this->friendsOfFriends, 200);\n }\n return $this->friendsOfFriends($userId, $n, $i + 1);\n }",
"function hasChat($user_id, $friend_id) {\n $conn = new my_mysql();\n $query = \"SELECT COUNT(*) AS numRecords, id FROM chat\n WHERE id IN \n (SELECT id FROM chat WHERE owner_id=$friend_id)\n AND owner_id=$user_id;\";\n $res = $conn->readQuery($query)->fetch_assoc();\n if ($res['numRecords'] != 0) {\n return $res['id'];\n } else {\n return False;\n }\n}",
"public function getFriends() {\n $ret = $this->get('users/self/friends');\n return $ret['friends']['items'];\n }",
"public function _friendadd() {\n\t\t$this->history = false;\n\n\t\t// for authenticated only\n\t\tif ($this->user && csrf::valid()) {\n\n\t\t\t// require valid user\n\t\t\t$this->member = new User_Model($username);\n\t\t\tif ($this->member->id) {\n\t\t\t\t$this->user->add_friend($this->member);\n\n\t\t\t\t// News feed event\n\t\t\t\tnewsfeeditem_user::friend($this->user, $this->member);\n\n\t\t\t}\n\t\t}\n\n\t\turl::back('members');\n\t}",
"function friendable($user1ID, $user2ID) {\n if($user1ID == $user2ID) {\n return false;\n }\n $db = new DataBase();\n\n $sql = 'SELECT COUNT(*) as count FROM Friends WHERE userID = \\'' . $user1ID . '\\' AND friendID = \\'' . $user2ID . '\\'';\n $result = $db->select($sql);\n\n if($result['count'] == 0) {\n return true;\n }\n\n return false;\n }",
"function findFriends($name)\n\t{\t\n\t\t$arr = explode(\" \", trim(mysql_real_escape_string($name)));\n\t\t\n\t\tif (sizeof($arr) == 0)\n\t\t{\n\t\t\t$GLOBALS[\"_PLATFORM\"]->sandboxHeader('HTTP/1.1 404 Not Found');\n\t\t\tdie();\n\t\t}\n\t\t\n\t\t$uid = getUserId();\n\t\t\n\t\t$cond = implode(\"|\", $arr);\n\t\t\n\t\t$res = getDBResultsArray(\n\t\t\t\"SELECT user_id AS id, first_name, last_name, img_url \n\t\t\tFROM user_table \n\t\t\tWHERE user_id <> $uid\n\t\t\tAND (first_name REGEXP '$cond' OR last_name REGEXP '$cond')\n\t\t\tAND user_id NOT IN (\n\t\t\t\tSELECT user_a\n\t\t\t\tFROM friend_map\n\t\t\t\tWHERE user_b = $uid\n\t\t\t\tUNION SELECT user_b\n\t\t\t\tFROM friend_map\n\t\t\t\tWHERE user_a = $uid\n\t\t\t);\"\n\t\t);\n\t\t\n\t\techo json_encode($res);\n\t}",
"function saveUserDataToDB(){\n\t\n\t\trequire(realpath(dirname(__FILE__) . \"/../config.php\"));\t\t\n\t\t\t$servername = $config[\"db\"][\"fanbot\"][\"host\"];\n\t\t\t$username = $config[\"db\"][\"fanbot\"][\"username\"];\n\t\t\t$password = $config[\"db\"][\"fanbot\"][\"password\"];\n\t\t\t$dbname = $config[\"db\"][\"fanbot\"][\"dbname\"];\n\n\n\t\t\t\t// Create connection\n\t\t\t\t$conn = new mysqli($servername, $username, $password, $dbname);\n\t\t\t\t// Check connection\n\t\t\t\tif ($conn->connect_error) {\n\t\t\t\t die(\"Connection failed: \" . $conn->connect_error);\n\t\t\t\t} \n\t\t\t\t\n\t\t$sql = \"SELECT * FROM users WHERE fbID = '\". $_SESSION['fbUser']['id']. \"'\";\n\t\t$result = $conn->query($sql);\n\t\t\n\t\tif ($result->num_rows > 0) {\t\t \n\t\t\t\t$sql = \"UPDATE users\n\t\t\t\t\t\t\tSET friends='\". $_SESSION['fbUser']['friends'] .\"'\n\t\t\t\t\t\t\tWHERE fbID = '\". $_SESSION['fbUser']['id']. \"'\";\n\t\t\t} else {\n\t\t\t\t$sql = \"INSERT INTO users (fbID, fbName, firstName, lastName, email, gender, friends) \n\t\t\t\t\t\t\tVALUES ( '\". $_SESSION['fbUser']['id']. \"',\n\t\t\t\t\t\t\t\t\t '\". $_SESSION['fbUser']['name']. \"',\n\t\t\t\t\t\t\t\t\t '\". $_SESSION['fbUser']['firstName']. \"',\n\t\t\t\t\t\t\t\t\t '\". $_SESSION['fbUser']['lastName']. \"',\n\t\t\t\t\t\t\t\t\t '\". $_SESSION['fbUser']['email'] .\"',\n\t\t\t\t\t\t\t\t\t '\". $_SESSION['fbUser']['gender'].\"',\n\t\t\t\t\t\t\t\t\t '\". $_SESSION['fbUser']['friends'].\"')\";\n\t\t\t\t\n\t\t\t\tif ($conn->query($sql) === TRUE) {\n\t\t\t\t} else {\n\t\t\t\t echo \"Error\";\n\t\t\t\t}\n\t\t}\n\t\t\t\t$conn->close();\n\t\t}",
"public function index()\n {\n // Get Users in random order excempting this user\n // select * from users where id not in (select from_id from friends where from_id = 7 or to_id = 7) and id not in (select to_id from friends where from_id = 7 or to_id = 7)\n $users = DB::table('users')\n ->whereNotIn('id', function ($query) {\n $query->select(DB::raw('from_id'))\n ->from('friends')\n ->where('from_id', Auth::id())\n ->orWhere('to_id', Auth::id());\n })\n ->whereNotIn('id', function ($query) {\n $query->select(DB::raw('to_id'))\n ->from('friends')\n ->where('from_id', Auth::id())\n ->orWhere('to_id', Auth::id());\n })\n ->where('id', '<>', Auth::id())\n ->get();\n\n // Get Friends in random order\n // select * from users u where id in (select from_id from friends where to_id = 7 and status = 1) or id in (select to_id from friends where from_id = 7 and status = 1)\n $friends = DB::table('users')\n ->whereIn('id', function ($query) {\n $query->select(DB::raw('from_id'))\n ->from('friends')\n ->where('to_id', Auth::id())\n ->where('status', 1);\n })\n ->orWhereIn('id', function ($query) {\n $query->select(DB::raw('to_id'))\n ->from('friends')\n ->where('from_id', Auth::id())\n ->where('status', 1);\n })\n ->inRandomOrder()\n ->get();\n\n // Get pending friend requests for this user in random order\n $outgoingRequests = DB::table('users')\n ->join('friends', 'users.id', '=', 'friends.to_id')\n ->where('friends.from_id', Auth::id())\n ->select('users.*')\n ->where('friends.status', 0)\n ->inRandomOrder()\n ->get();\n\n // Incoming Friend Request to User\n $incomingRequests = DB::table('users')\n ->join('friends', 'users.id', '=', 'friends.from_id')\n ->where('friends.to_id', Auth::id())\n ->where('friends.status', 0)\n ->select('users.*')\n ->inRandomOrder()\n ->get();\n\n return view('friends', ['users' => $users, 'friends' => $friends, 'outgoing' => $outgoingRequests, 'incoming' => $incomingRequests]);\n }",
"public function insertFriend($data) {\n\t\t$insert_sql = \"insert into friend \tvalues ( \" . $data[\"account_id\"] . \"\n\t\t,\" . $data[\"friend_id\"] . \");\";\n\n\t\tif ($this->db->simple_query($insert_sql)) {\n//\t\t\techo \"insert friend success!\";\n\t\t\treturn true;\n\t\t} else {\n\t\t\terror_log(\"model->friend_model->insertfriend get result failed!\", 3, \"/logs/my-errors.log\");\n\t\t\treturn false;\n\t\t}\n\t}",
"public static function getFriends()\n {\n $friends = Auth::user()->friends;\n foreach ($friends as $friend)\n {\n if($friend->pivot->is_friend == 1)\n {\n $fr[] = $friend;\n }\n }\n if(isset($fr))\n {\n return new \\Illuminate\\Database\\Eloquent\\Collection($fr);\n }\n else\n {\n return new \\Illuminate\\Database\\Eloquent\\Collection();\n }\n }",
"public function run()\n {\n $stamp= new DateTime;\n $data = [\n 'own_id' => 1,\n 'user_id' => 1,\n 'status' => 0,\n 'created_at' => $stamp,\n ];\n DB::table('friends')->insert($data);\n }"
]
| [
"0.6890723",
"0.6817044",
"0.6494695",
"0.64644825",
"0.6454942",
"0.6367634",
"0.63571763",
"0.63291913",
"0.62610775",
"0.62553513",
"0.6203262",
"0.61949253",
"0.616189",
"0.6121147",
"0.6109535",
"0.60581887",
"0.6055478",
"0.60378003",
"0.6037005",
"0.6016766",
"0.6011935",
"0.59985036",
"0.59815",
"0.59743655",
"0.5971561",
"0.5954802",
"0.5925953",
"0.59157324",
"0.5912899",
"0.5912869",
"0.59094554",
"0.58863634",
"0.58782405",
"0.5859869",
"0.5851549",
"0.58434147",
"0.58410025",
"0.58286244",
"0.5815048",
"0.58140725",
"0.5808545",
"0.58030045",
"0.5790786",
"0.57801896",
"0.57747257",
"0.5752395",
"0.57410026",
"0.5736068",
"0.57352674",
"0.57303154",
"0.572741",
"0.5718619",
"0.5713588",
"0.5689284",
"0.5675487",
"0.56751925",
"0.56619316",
"0.5659065",
"0.5656867",
"0.5656577",
"0.56467265",
"0.5640052",
"0.56387955",
"0.5631492",
"0.5630428",
"0.5617421",
"0.5602433",
"0.5586914",
"0.55662584",
"0.55577534",
"0.5557367",
"0.55468225",
"0.55437404",
"0.55430716",
"0.5540567",
"0.55381274",
"0.55369407",
"0.5536784",
"0.55223197",
"0.5519959",
"0.5516009",
"0.5512519",
"0.55071247",
"0.54999554",
"0.54963243",
"0.5496229",
"0.5495024",
"0.54880786",
"0.54853386",
"0.54806006",
"0.54805744",
"0.54760057",
"0.54727304",
"0.54712653",
"0.5462374",
"0.54599905",
"0.5450857",
"0.544987",
"0.5446695",
"0.5442986",
"0.5430735"
]
| 0.0 | -1 |
Add City ID to error message | protected function getErrorWithCityId(FreeShippingInterface $city, $errorText)
{
return '[City ID: ' . $city->getCityId() . '] ' . $errorText;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function message()\n {\n return 'The Category id is invalid.';\n }",
"public function message()\n {\n return 'The report location is invalid because there is an active existing report already in the area. Please don\\'t create duplicate reports.';\n }",
"public function message()\n {\n return 'Invalid Category Id';\n }",
"protected function getErrorWithTermId(\\Formax\\MortgageSimulator\\Model\\Term $term, $errorText)\n {\n return '[FormCrud ID: ' . $term->getId() . '] ' . $errorText;\n }",
"public function message()\n {\n return 'Town already exist.';\n }",
"public function cityname_validation($city) {\n $this->form_validation->set_message('cityname_validation', 'The %s field is not valid City or Destination Code');\n\n preg_match_all('/\\(([A-Za-z0-9 ]+?)\\)/', $city, $out);\n $cityCode = $out[1];\n\n if (!empty($cityCode))\n return TRUE;\n else\n return FALSE;\n }",
"public function __construct($city_id)\n {\n $this->city_id = $city_id;\n }",
"public function message()\n {\n return 'The postcode not valid';\n }",
"public function message()\n {\n return trans('validation.custom.phone.error');\n }",
"public function message()\n {\n return 'Given term id is not a role id.';\n }",
"function error_label($errors, $name) {\n //create span for the error message to appear (of class 'error_message')\n echo \"<br> <span id=\\\"$name\\\" class=\\\"error_message\\\">\";\n\n //Check if an error has occurred for the field\n if (isset($errors[$name])) {\n //input code of error message if error had occurred for the field\n echo $errors[$name];\n }\n echo '</span>';\n}",
"public function message()\n {\n return 'Wrong Address';\n }",
"protected function createValidationErrorMessage() {}",
"private function errorMessages()\n {\n return [\n 'question_category_id.required' => 'Atleast one question-category '.\n 'is required',\n ];\n }",
"public function message()\n {\n return 'Errores en plantilla<li>'.join('</li><li>',$this->invalid);\n }",
"protected function getErrorFlashMessage() {\n\t\treturn $this->translate('tx_placements.error'.'.organization.'. $this->actionMethodName);\n\t }",
"function add_id_to_invoice_errors( $message, $order_id ) {\n\n\t\t$ids_db = get_option('wmbr_auto_invoice_errors');\n\t\t$nfes = get_post_meta( $order_id, 'nfe', true );\n\n\t\tif ( !empty($nfes) && is_array($nfes) ) {\n\t\t\tforeach ( $nfes as $nfe ) {\n\t\t\t\tif ( $nfe['status'] == 'aprovado' ) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t$ids_db[$order_id] = array(\n\t\t\t'datetime' => current_time(\"d-m-Y H:i:s\"),\n\t\t\t'error' => $message\n\t\t);\n\n\t\tupdate_option( 'wmbr_auto_invoice_errors', $ids_db );\n\n\t}",
"public function addError($field_id, $message)\n {\n if ($field_id) {\n $this->errors[$field_id] = $message;\n } else {\n $this->errors[] = $message;\n }\n }",
"public static function error($id) \n {\n $language = $_SESSION['language'];\n $layout = 'layouts/polyglot/errors.php';\n $errors = require 'configs/errors.php';\n\n if (array_key_exists($id, $errors))\n {\n if (array_key_exists($language, $errors[$id]))\n {\n $title = $errors[$id][$language]['title'];\n $cause = $errors[$id][$language]['cause'];\n $advice = $errors[$id][$language]['advice'];\n } \n else\n {\n $title = $errors[$id]['en']['title'];\n $cause = $errors[$id]['en']['cause'];\n $advice = $errors[$id]['en']['advice'];\n }\n }\n else\n {\n $title = $errors['404']['en']['title'];\n $cause = $errors['404']['en']['cause'];\n $advice = $errors['404']['en']['advice'];\n }\n\n if (is_numeric($id))\n {\n http_response_code($id);\n } \n\n require $layout;\n exit; \n }",
"private function errorMessages()\n {\n return [\n 'name.unique' => 'A category with the same name exists',\n ];\n }",
"protected function _getErrorNumber()\n {\n return '';\n }",
"function addErrorMessage($start, $end, $description, &$message){\n\t$message = \"- Please enter data in: \";\n\t\n\tif($start == \"\")\n\t\t$message = $message . \"Start Date field - \";\n\tif($end == \"\")\n\t\t$message = $message . \"End Date field - \";\n\tif($description == \"\")\n\t\t$message = $message . \"Description field - \";\n\tif($message == \"- Please enter data in: \") \n\t\t$message = \"\";\n}",
"public function message()\n {\n return 'The fields [Team ID, Phone and Sticky Phone Number ID] are required';\n }",
"protected function giveCity()\n {\n return \"Luanda minha CIDADE\";\n }",
"function errorStatic($formId, $errors)\n\t{\n\t\t//vd($errors);\n\t\tdie(('\n\t\t\t<script>\n\t\t\t\twindow.top.showError(\"'.$errors[0]['msg'].'\", \"'.$formId.' .info\");\n\t\t\t\twindow.top.loading(0, \"'.$formId.' .loading\", \"fast\");\n\t\t\t\twindow.top.$(\"#'.$formId.' input, #'.$formId.' select\").each(function(n,element){\n\t\t\t\t\twindow.top.$(element).removeClass(\"error\")\n\t\t\t\t});\n\t\t\t\terrors = '.json_encode($errors).';\n\t\t\t\tfor(var i in errors)\n\t\t\t\t{\n\t\t\t\t\twindow.top.$(\\'#'.$formId.' input[name=\"\\'+errors[i].name+\\'\"]\\').addClass(\\'error\\');\n\t\t\t\t}\n\t\t\t</script>'));\n\t}",
"public function errorText()\n\t{\n\t\t$list = str_replace(',', ', ', str_replace(\"'\", '', $this->column->constraint));\n\t\t$last = strrpos($list, ', ');\n\t\t$replace = substr($list, $last, strlen($list)-$last);\n\t\t$list = str_replace($replace, str_replace(', ', ' or ', $replace), $list);\n\n\t\treturn \"%s may only be set to $list\";\n\t}",
"function build(): string\n {\n return 'not_have_city';\n }",
"public function message()\n {\n return \"The :attribute is not same has parent: {$this->town->short_postcode}\";\n }",
"public function renderGlobalErrorMessage()\n {\n $message = \"\";\n $nberror = count($this->getErrorSchema());\n if ($nberror > 0) {\n $tmp = $this->getErrorSchema()->getErrors();\n $message = \"<div class='alert alert-danger'>Please check your form, $nberror field(s) seem(s) not correctly filled </br>\";\n foreach ($tmp as $key => $e) {\n if ($key == 'Description'){\n $message .= \"- Problem description field is too long (4000 characters max): Please use verbose mode and reduce this field.\";\n }\n\n }\n $message .= \"</div>\";\n }\n return $message;\n }",
"protected function addErrorProductId($id)\n {\n return $this->messageManager->addErrorMessage(__('[Product ID: %1] Cannot add this product to the warehouse',$id));\n }",
"public function message()\n {\n return 'validation-phone-unique';\n }",
"public function message()\n {\n return 'The :attribute must have valid mobile numbers. Ex: ( +63 + 10 digit number ) OR ( 09 + 9 digit number ).';\n }",
"public function getCityAddress() {\n\t\t$address = '';\n\t\tif(!empty($this->address)){\n\t\t\t$address.=$this->address.\" \";\n\t\t}\n\t\tif(!empty($this->city))\n\t\t\t$address .= $this->city . ', ';\n\t\t\n\t\tif(!empty($this->state))\n\t\t\t$address .= $this->state . ' ';\n\t\t\n\t\tif(!empty($this->zipcode))\n\t\t\t$address .= $this->zipcode . ' ';\n\t\t\t\n\t\tif(!empty($this->country))\n\t\t\t$address .= $this->country;\n\t\t\t\n\t\treturn $address;\n\t}",
"public function message()\n {\n return 'Phone number is invalid';\n }",
"public function getErrorText(){\n return $this->error;\n }",
"protected function setErrorMessage($errors)\n {\n $return = \"\";\n foreach ($errors as $key => $data) {\n $return .= $key . \": \" . $data['0'] . '<br>';\n }\n return $return;\n }",
"public function message()\n {\n return __(\"validation.{$this->error}\", ['attribute' => 'nomor sampel']);\n }",
"public function message()\n {\n return trans('validation.geoapi');\n }",
"public function getErrorMessage($field);",
"protected function setErrorMessage($errors){\n $return = \"\";\n foreach($errors as $data){\n $return .= $data['0'].'<br>';\n }\n return $return;\n }",
"public function messages()\n {\n return [\n //'order_number'=>'required|unique:jobs|min:10|max:11',\n 'contact_id.exists'=>'Please select a contact from the company',\n ];\n }",
"public function message()\n {\n return trans('main.uniqueness_of_fields_violated') .\n ': ' . trans('main.serial_number') .\n ', ' . trans('main.line_number') .\n ', ' . trans('main.link_from') .\n ', ' . trans('main.link_to') . '.';\n }",
"public function getErrorMessage()\n {\n // then re-apply the error code:\n if(($this->error_code !== 0) && empty($this->error_msg))\n {\n $this->setError($this->error_code);\n }\n return $this->error_msg;\n }",
"public function message()\n {\n return 'The :attribute field must have valid ip addresses.';\n }",
"public function add_error( $post_id )\n\t{\n\t\techo '<div id=\"message\" class=\"error\">';\n\t\tforeach ( $this->errors as $key => $error ) {\n\t\t\techo \"<p class=\\\"$key\\\">$error</p>\";\n\t\t}\n\t\techo '</div>';\n\n\t\treturn $post_id;\n\t}",
"public function message()\n {\n return 'Address Must be end with \"Street\".';\n }",
"public function message()\n {\n if(in_array(self::IS_EXIST_NUMBER,$this->code)){\n return \"le numero de telephone :attribute existe déja\";\n }\n elseif(in_array(self::IS_NOT_NUMERIC,$this->code)){\n return \"les champs de :attribute doit être numerique\";\n }\n else{\n return \"numero de telephone invalide\";\n }\n }",
"public function message()\n {\n if ($this->age > 0)\n return '请提供年满'.$this->age.'岁的合法身份证号';\n return '请提供合法的身份证号';\n }",
"protected function messages()\n {\n return [\n 'id.required' => HttpAttributeInvalidCode::ID_REQUIRED\n ];\n }",
"public function message () \n {\n return \"Mohon maaf data {$this->attributes_alias} yang di inputkan sudah tersedia. Mohon ganti dengan yang lain\";\n }",
"public function message()\n {\n return 'Invalid phone number format.';\n }",
"function _uc_parsian_error_translate($code) {\n switch ($code) {\n case 20:\n case 22:\n return t('@code - Invalid PIN or IP.', array(\n '@code' => $code,\n ));\n\n case 30:\n return t('@code - The operation has been done previously.', array(\n '@code' => $code,\n ));\n\n case 34:\n return t('@code - Invalid transaction number.', array(\n '@code' => $code,\n ));\n\n default:\n return t('@code - Unknown status code. Refer to your technical documentation or contact Parsian bank support.', array(\n '@code' => $code,\n ));\n }\n}",
"public function errorMessage() {\r\n\t\tif ($this->hasError()) {\r\n\t\t\treturn \"Query:\\n{$this->sql}\\nAnswer:\\n{$this->errorString}\";\r\n\t\t}\r\n\r\n\t\treturn 'No error occurred.';\r\n\t}",
"public function errorInfo();",
"public function errorInfo();",
"public function message()\n {\n return 'O Titulo de eleitor digitado é invalido';\n }",
"public function message()\n {\n return trans('validation.unique_items');\n }",
"public function message()\n {\n return 'This is not a valid Phone number';\n }",
"public function message()\n {\n if ($this->wasRedeemed) {\n return trans('vouchers::validation.code_redeemed');\n }\n if ($this->isExpired) {\n return trans('vouchers::validation.code_expired');\n }\n return trans('vouchers::validation.code_invalid');\n }",
"private static function apply_error_template($error, $fieldname) {\n if (empty($error))\n return '';\n global $indicia_templates;\n if (empty($error)) return '';\n $template = str_replace('{class}', $indicia_templates['error_class'], $indicia_templates['validation_message']);\n $template = str_replace('{for}', $fieldname, $template);\n return str_replace('{error}', lang::get($error), $template);\n }",
"public function message(): string\n {\n return 'El número de seguro social es invalido.';\n }",
"public function message()\n {\n return 'Je potrebné vybrať práve jedno ID z polí: Byt/Dom/Pozemok.';\n }",
"public function getMessage()\n {\n return sprintf('The field `%s` should be a valid url!', $this->inputName);\n }",
"public function message()\n {\n return 'The address may only alphabetic characters';\n }",
"public function messages()\n {\n return [\n 'location.required' => 'Location Name Is Required',\n 'location.unique:locations' => 'Location Name Is already exists'\n ];\n }",
"public function check_city()\n {\n if (!in_array(ucwords(sanitize_text_field($_POST['billing_city'])), $this->business_area)) {\n throw new Exception(__('Your city is not within our business area', 'woocommerce'));\n }\n }",
"public function getErrorMessage();",
"public function getErrorMessage();",
"public function message()\n {\n return trans('validation.phone');\n }",
"public function message()\n {\n return trans('validation.phone');\n }",
"public function message()\n {\n return 'The Phone Number does not match the expected format';\n }",
"public function errorInfo() {}",
"public function display_error_holder() {\r\n\t\tprintf( '<div id=\"nyp-error-%s\" class=\"woocommerce-nyp-message\" aria-live=\"assertive\" style=\"display: none\"><ul class=\"woocommerce-error\"></ul></div>', esc_attr( WC_Name_Your_Price_Helpers::get_counter() ) );\r\n\t}",
"public function transform($city)\n {\n if (null === $city)\n return \"\";\n\n return $city->getId();\n }",
"public function toString()\n {\n return 'Correct error message is displayed.';\n }",
"function makeErrorText( $fieldNames, $errorType, $options ) {\n\t\t\t// split up multiple fields\n\t\t$fieldNames = explode(',',$fieldNames);\n\n\t\t\t// check for each field if there is an error of this type\n\t\t$isError = FALSE;\n\t\tforeach( $fieldNames as $field ) {\n\t\t\t$isError = $isError || $this->errors[$field][$errorType];\n\t\t\tif ($isError) {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t\t$this->addMarker('ERROR_CLASS','formError-type-' . $errorType);\n\t\t$this->addMarker('ERROR_MESSAGE',$this->pi_getLL('formError_' . $errorType, '*error label not defined*'));\n\t\t$errorLabel = $isError ? $this->parseTemplate('ERROR_MESSAGE_WRAP') : '';\n\t\treturn $errorLabel;\n\t}",
"public function message(): string\n {\n return trans('The :attribute is not a valid domain.');\n }",
"function get_error_message() {\n return $this->error_msg;\n }",
"protected function wrongData($id)\n {\n//\td.addClass('error-field');\n }",
"public function getErrorMessage() {\n return '';\n }",
"function wrapper_error($link_id = null) {\n\t\t$last_msg = trim(@$this->functions['error']());\n\n\t\tif (strpos(strtolower($last_msg), '(severity') !== false) {\n\t\t\treturn $last_msg;\n\t\t}\n\n\t\treturn '';\n\t}",
"public function message()\n {\n return 'wrong comment id';\n }",
"public function message()\n {\n return \"Route '$this->value' does not exist.'\";\n }",
"public function getErrorMessage()\n\t\t{\n\t\t\t$error = $this->statement->errorInfo();\n\t\t\t$errorText \t= '<h6>Something happened ... :(</h6>';\n\t\t\t$errorText .= 'Error code : '.$error[0].'<br>';\n\t\t\t$errorText .= 'Driver error code : '.$error[1].'<br>';\n\t\t\t$errorText .= 'Error Message : '.$error[2].'<br>';\n\t\t\treturn $errorText;\n\t\t}",
"public function getErrorMessage($input) {\n\t\treturn $input . ' is invalid.';\n\t}",
"function __construct($cityId)\n {\n }",
"public function getMessage(): string\n {\n return \"The $this->name field must be an integer.\";\n }",
"public function getCity(): string\n {\n return $this->result->city_name;\n }",
"static function error($error)\n {\n global $template_vars;\n $template_vars['errors'][] = $error;\n }",
"public function message(): ?string\n {\n return Lang::get('validation.postal_code');\n }",
"public function getMessage()\n {\n return \"Are you sure you want to import user roles data from M3?\";\n }",
"public function message()\n {\n return trans('validation.field_not_exists_in_table', [\n 'field' => $this->notFoundField,\n 'table' => $this->table\n ]);\n }",
"public function errorMessage() {\n\t\t\treturn $this->strError; \n\t\t}",
"public function message()\n {\n return 'تعداد مورد درخواست بیشتر از باقیمانده است.' . $this->inventory_code_qty;\n }",
"public function message()\n {\n return 'The same data already exist.';\n }",
"function ErrorMsg()\n\t{\n\t\t\treturn '';\n\t}",
"public function getErrorMessage() {\n\t\tswitch( $this->error ) {\n\t\t\tcase TAN_NOT_FOUND : return \"Die TAN wurde nicht gefunden\";\n case REGISTRATION_USER_EXISTS : return \"Dieser Nutzer Existiert bereits\";\n\t\t}\n\t}",
"public function message()\n {\n return 'Invalid message mark up.';\n }",
"public function message()\n {\n return \"You already have a client with an email of $this->value\";\n }",
"public function message()\n {\n return 'The :attribute must be a valid GeoJSON Point or a type (Place ID) that can be resolved to a Point.';\n }"
]
| [
"0.59879893",
"0.5731379",
"0.5701401",
"0.5597393",
"0.55355686",
"0.54918677",
"0.5469727",
"0.5438394",
"0.5365454",
"0.53522265",
"0.5349465",
"0.53309846",
"0.5321003",
"0.53204316",
"0.5296143",
"0.52917516",
"0.52876145",
"0.5279534",
"0.5278833",
"0.5271116",
"0.52514106",
"0.5248696",
"0.5245955",
"0.52292407",
"0.52147776",
"0.5202128",
"0.51894844",
"0.5182701",
"0.5167433",
"0.51602626",
"0.51580864",
"0.5154645",
"0.5122455",
"0.51121193",
"0.5109931",
"0.5105795",
"0.5100419",
"0.5095466",
"0.5089357",
"0.5086441",
"0.5085722",
"0.5085623",
"0.5070717",
"0.5067765",
"0.5056544",
"0.5052988",
"0.50517297",
"0.50448966",
"0.50403005",
"0.50370693",
"0.503086",
"0.502559",
"0.50188375",
"0.50165004",
"0.50165004",
"0.50139105",
"0.50072134",
"0.50062245",
"0.4981566",
"0.4973111",
"0.49721095",
"0.4967795",
"0.49516222",
"0.49514797",
"0.49502006",
"0.49490112",
"0.49483576",
"0.49483576",
"0.49480194",
"0.49480194",
"0.49478468",
"0.4946229",
"0.494274",
"0.4915781",
"0.4915575",
"0.49101615",
"0.48993966",
"0.4893272",
"0.48901802",
"0.48826635",
"0.4881167",
"0.48796198",
"0.48774588",
"0.48765838",
"0.48718995",
"0.48704702",
"0.48672447",
"0.48628098",
"0.48627964",
"0.4862137",
"0.48616612",
"0.48584622",
"0.48507625",
"0.4846944",
"0.48418593",
"0.4841671",
"0.48391443",
"0.48371592",
"0.483522",
"0.48316023"
]
| 0.7037821 | 0 |
Use singular form for zero (see bug 7309) | function convertPlural( $count, $w1, $w2, $w3, $w4, $w5) {
return $count <= '1' ? $w1 : $w2;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function isSingular()\n {\n return false;\n }",
"public function testDoubleIfZero(){\n\t\t$this->assertEquals(0, \\Grafikart\\Math::double(0));\n\t}",
"function singularize($x) {\n\n if (substr($x, -1) != 's') {\n return $x;\n }\n\n $x = preg_replace('/ies$/i', 'y', $x, 1, $count);\n if ($count) return $x;\n\n return substr($x, 0, strlen($x) - 1);\n }",
"function singularize(){\n\t\treturn $this->_copy(_Inflect::singularize((string)$this));\n\t}",
"abstract protected function singularLabel(): string;",
"public function singular( $value ) {\n\t\treturn Pluralizer::singular( $value );\n\t}",
"public function singularize($word);",
"public function normINF(): int|float {\n return core\\lapack::slange('i', $this);\n }",
"function noZero()\n {\n static::remove(0);\n return $this;\n }",
"public function infinityNorm() : float\n {\n return $this->abs()->sum()->max();\n }",
"public static function singularLabel()\n {\n return Str::singular(static::label());\n }",
"public static function singularLabel()\n {\n return Str::singular(static::label());\n }",
"public static function singular($str)\n {\n // Shortcut references (readability)\n $sp = &self::$singular;\n $pp = &self::$plural;\n $sm = &$sp['merged'];\n $sd = &self::$data['singular'];\n\n // Check the internal cache (performance)\n if (isset($sd[$str])) {\n\n // Return matches from the cache\n return $sd[$str];\n }\n\n // Check against irregular singulars\n if (preg_match('/(.*)\\\\b('.$sp['cacheIrregular'].')$/i', $str, $regs)) {\n\n // Return match while also setting the internal cache (faster next time this word is referenced)\n return $sd[$str] = $regs[1].substr($str, 0, 1).substr($sm['irregular'][strtolower($regs[2])], 1);\n }\n\n // Check against the uninflected singulars\n if (preg_match('/^('.$sp['cacheUninflected'].')$/i', $str, $regs)) {\n\n // Return and cache\n return $sd[$str] = $str;\n }\n\n // Normal word (not irregular or uninflected)\n foreach ($sp['rules'] as $rule => $replacement) {\n\n // Find a matching rule\n if (preg_match($rule, $str)) {\n\n // Cache the word for next time and return the inflected\n return preg_replace($rule, $replacement, $str);\n }\n }\n\n return $sd[$str] = $str;\n }",
"public static function singular($str)\n {\n if (strlen($str) > 0 && $str[strlen($str) - 1] === 's') {\n if (strlen($str) > 2 && substr($str, -3) == 'ses') {\n return substr($str, 0, -2);\n }\n return substr($str, 0, -1);\n }\n return $str;\n }",
"function ToZero($str)\n{\n if( empty($str)){\n return '0';\n }\n return $str;\n}",
"public static function singularize( $string )\n{\n\tif ( in_array( strtolower( $string ), self::$uncountable ) )\n\t\treturn $string;\n\n // check for irregular plural forms\n\tforeach ( self::$irregular as $result => $pattern )\n\t{\n\t\t$pattern = '/' . $pattern . '$/i';\n\n\t\tif ( preg_match( $pattern, $string ) )\n\t\t\treturn preg_replace( $pattern, $result, $string);\n\t}\n\n // check for matches using regular expressions\n\tforeach ( self::$singular as $pattern => $result )\n\t{\n\t\tif ( preg_match( $pattern, $string ) )\n\t\t\treturn preg_replace( $pattern, $result, $string );\n\t}\n\n\treturn $string;\n}",
"function __return_zero()\n {\n }",
"public function isZero ()\n {\n return $this->value === 0.0;\n }",
"function singularize($noun){\n $lowercased_noun = strtolower($noun);\n\n foreach($_ENV['INFLECTION_EXCEPTIONS']['uncountable'] as $uncountable){\n if(substr($lowercased_noun,(-1*strlen($uncountable))) == $uncountable){\n return $noun;\n }\n }\n\n foreach($_ENV['INFLECTION_EXCEPTIONS']['irregular'] as $plural => $singular){\n if (preg_match('/('.$singular.')$/i', $noun, $arr)){\n return preg_replace('/('.$singular.')$/i', substr($arr[0],0,1).substr($plural,1), $noun);\n }\n }\n\n foreach($_ENV['INFLECTION_EXCEPTIONS']['singular'] as $rule => $replacement){\n if (preg_match($rule, $noun)){\n return preg_replace($rule, $replacement, $noun);\n }\n }\n\n return $noun;\n}",
"public function testMultZero()\n {\n $this\n ->given(\n $zero = $this->fromNative(0),\n $number = $this->fromNative($this->randomNativeNumber())\n )\n ->then\n ->boolean(\n $number->mult($zero)->equals($zero)\n )->isTrue()\n ->boolean(\n $zero->mult($number)->equals($zero)\n )->isTrue()\n ;\n }",
"public function getS() {\n// return new Matrix($this->s);\n $S = array();\n for ($i = 0; $i < $this->n; ++$i) {\n for ($j = 0; $j < $this->n; ++$j) {\n $S[$i][$j] = 0.0;\n }\n $S[$i][$i] = $this->s[$i];\n }\n return new Matrix($S);\n }",
"public static function zero() { return self::$manager->zero(); }",
"public function singularize($word)\n { \n static $rules = NULL;\n if ($rules == NULL)\n $rules = $this->getSingularRules();\n return $this->transform($word, $rules);\n }",
"public static function singular(string $value): string\n {\n return Pluralizer::singular($value);\n }",
"#[@test]\n public function selectFloatZero() {\n $this->assertEquals(0.0, $this->db()->query('select 0.0 as value')->next('value'));\n }",
"function K0($SFR){ return (Eps*ESN*NSNrate($SFR)*(Chi-2))/((gammap0**(2.-Chi))*((mp*(c**2)**2))); }",
"public function invalidFloats() {}",
"public static function singularLabel()\n {\n return 'Buker';\n }",
"public function isZero(): bool;",
"public static function getHideDoubleZeros()\n {\n return Currency::get('hide_double_zeros', false);\n }",
"public static function float() {}",
"public function isMatriculationSIVNormal(): bool\n {\n $pattern = '^(?!SS|WW)[A-HJ-NP-TV-Z]{2}(?:\\s|-)?(?!000)[0-9]{3}(?:\\s|-)?(?!SS)[A-HJ-NP-TV-Z]{2}$';\n\n return 1 === preg_match('/'.$pattern.'/i', $this->matriculation);\n }",
"function sigaloneval($origerr,$numplaces){\n\n\t\t$x=round($origerr*(pow(10,(($numplaces-1)-floor(log10($origerr)))))) * pow(10,(floor(log10($origerr)))-($numplaces-1));\n\t\n\t\treturn($x);\n\n\t}",
"function str_singular($value)\n {\n return Str::singular($value);\n }",
"public function getSingular()\n\t{\n\t\treturn empty($this->singular) ? strtolower($this->getClass()) : $this->singular;\n\t}",
"function is_schinteger($number) {\n return is_zero($number->imaginary);\n}",
"public static function singularize( $string )\n {\n if ( in_array( strtolower( $string ), self::$uncountable ) )\n return $string;\n\n // check for irregular plural forms\n foreach ( self::$irregular as $result => $pattern )\n {\n $pattern = '/' . $pattern . '$/i';\n\n if ( preg_match( $pattern, $string ) )\n return preg_replace( $pattern, $result, $string);\n }\n\n // check for matches using regular expressions\n foreach ( self::$singular as $pattern => $result )\n {\n if ( preg_match( $pattern, $string ) )\n return preg_replace( $pattern, $result, $string );\n }\n\n return $string;\n }",
"protected function zeroCurrencyFloat($decimal)\n {\n if ($decimal == 0)\n {\n return 0;\n } elseif ($decimal == 1)\n {\n return 0.0;\n }\n\n return 0.00;\n }",
"function is_not_zero($num){\n\tif($num <= 0){\n\t\treturn 1;\n\t}\n\t\n\treturn $num;\t\n}",
"public static function singular($value)\n\t{\n\t\treturn static::pluralizer()->singular($value);\n\t}",
"public function singular() {\n return substr($this->tipoEntidad,strrpos($this->tipoEntidad,'\\\\')+1);\n }",
"public function isZeroFill();",
"public function testIsEvenPassZERO()\n {\n \t$this->assertTrue(isEven(0));\n }",
"protected function _formatPluralToSingular($string) {\n\t\t\t$response = substr_replace($string, ($consonantPlural = (substr($string, -3) === 'ies')) ? 'y' : '', $consonantPlural ? -3 : -1);\n\t\t\treturn $response;\n\t\t}",
"public function sign() : self\n {\n $b = [];\n\n foreach ($this->a as $rowA) {\n $rowB = [];\n\n foreach ($rowA as $valueA) {\n if ($valueA > 0) {\n $rowB[] = 1.0;\n } elseif ($valueA < 0) {\n $rowB[] = -1.0;\n } else {\n $rowB[] = 0.0;\n }\n }\n\n $b[] = $rowB;\n }\n\n return self::quick($b);\n }",
"public function str_singular()\n {\n throw new Exception('Not implemented');\n }",
"function GpsData_Walk_Replace_Zero(&$value, $key, $newValueForZeros) {\n\tif ($value <= 0)\n\t\t$value = $newValueForZeros;\n}",
"function variant_abs($val) {}",
"public function isZero(): bool\n {\n return $this->integralPart === '0' && $this->isInteger();\n }",
"function log1p() { # :: Num -> Float\n return new Num\\Float(log1p($this->value));\n }",
"function zeroise($number, $threshold)\n {\n }",
"function str_singular($value)\n\t{\n\t\treturn Illuminate\\Support\\Str::singular($value);\n\t}",
"function yourls_n_noop( $singular, $plural, $domain = null ) {\n\treturn array(\n\t\t0 => $singular,\n\t\t1 => $plural,\n\t\t'singular' => $singular,\n\t\t'plural' => $plural,\n\t\t'context' => null,\n\t\t'domain' => $domain\n\t);\n}",
"function simpson1($x0,$xf){\n\t\t$i=0;\n\t\t$hh=0; $S=0; $xi=0;\n\t\tif (nsteps % 2 == 0 ){\n\t\t\t$hh=($xf-$x0)/nsteps;\n\t\t\t$S=integrand1($x0) + integrand1($xf);\n\t\t\t$i=1;\t\n\t\t\twhile ($i <= (nsteps-1)){\n\t\t\t\t$xi=$x0+$hh*$i;\n\t\t\t\tif($i%2 == 0){\n\t\t\t\t\t$S=$S+2*integrand1($xi);\n\t\t\t\t}else{\n\t\t\t\t\t$S=$S+4*integrand1($xi);\n\t\t\t\t}\n\t\t\t\t$i++;\n\t\t\t}\n\t\treturn $hh/3*$S;\n\t\t}\t\n\t}",
"public function l1Norm() : float\n {\n return $this->transpose()->abs()->sum()->max();\n }",
"public function getSingularValues() {\n return $this->s;\n }",
"function isNormal()\n\t\t{\n\t\t\t$this->value = 0;\n\t\t\tif($this->normalValue === $this->value)\n\t\t\t\treturn true;\n\t\t\telse\n\t\t\t\treturn false;\n\t\t}",
"function aquamin_is_truty_or_zero( $mixed ) {\n\treturn ( !! $mixed || is_int( $mixed ) || is_float( $mixed ) || '0' === $mixed );\n}",
"function sNumber( $value )\r\n\t\t{\r\n\t\t\t#return filter_var($value, FILTER_SANITIZE_NUMBER_FLOAT); // float\r\n\t\t\treturn filter_var( $value, FILTER_SANITIZE_NUMBER_INT ); # int\r\n\t\t\t\r\n\t\t}",
"function satoshitrim($satoshitrim) {\n return rtrim(rtrim($satoshitrim, \"0\"), \".\");\n}",
"function _sp($count,$singular,$plural){\n\treturn App::getLocale()->isPlural((int)$count)?$plural:$singular;\n}",
"function _v( $str ) { return (float) substr($str,1); }",
"private function pluralise($singular) {\n\n $last_letter = strtolower($singular[strlen($singular)-1]);\n switch($last_letter) {\n case 'y':\n return substr($singular,0,-1).'ies';\n case 's':\n return $singular.'es';\n default:\n return $singular.'s';\n }\n\n}",
"public function testSingularize() {\n // irregular\n $this->assertEquals('atlas', Inflector::singularize('atlases'));\n $this->assertEquals('corpus', Inflector::singularize('corpuses'));\n $this->assertEquals('octopus', Inflector::singularize('octopuses'));\n $this->assertEquals('ox', Inflector::singularize('oxen'));\n $this->assertEquals('goose', Inflector::singularize('geese'));\n\n // uninflected\n $this->assertEquals('money', Inflector::singularize('money'));\n $this->assertEquals('flounder', Inflector::singularize('flounder'));\n $this->assertEquals('moose', Inflector::singularize('moose'));\n $this->assertEquals('species', Inflector::singularize('species'));\n $this->assertEquals('wildebeest', Inflector::singularize('wildebeest'));\n\n // singular\n $this->assertEquals('quiz', Inflector::singularize('quizzes'));\n $this->assertEquals('alias', Inflector::singularize('aliases'));\n $this->assertEquals('shoe', Inflector::singularize('shoes'));\n $this->assertEquals('person', Inflector::singularize('people'));\n $this->assertEquals('apple', Inflector::singularize('apples'));\n\n // already singular\n $this->assertEquals('atlas', Inflector::singularize('atlas'));\n $this->assertEquals('corpus', Inflector::singularize('corpus'));\n $this->assertEquals('octopus', Inflector::singularize('octopus'));\n $this->assertEquals('ox', Inflector::singularize('ox'));\n $this->assertEquals('goose', Inflector::singularize('goose'));\n }",
"public function randomMemberNOZero();",
"private function random_0_1()\n\t\t\t{ \n\t\t\t\treturn (float)rand()/(float)getrandmax();\n\t\t\t}",
"function get_nice_equation($equation)\r\n{\r\n \r\n $equation = str_replace(' ' , '' ,$equation);\r\n \r\n $first_char = first_char($equation);\r\n $pos_f_char = strpos($equation,$first_char);\r\n \r\n \r\n if($pos_f_char == 0)\r\n {\r\n $equation1 = '1' . $equation;\r\n }\r\n else if(is_sign($equation[$pos_f_char - 1]) && $pos_f_char == 1)\r\n {\r\n $equation1 = $equation[0] . '1' . substr($equation , 1);\r\n }\r\n else\r\n {\r\n $equation1 = $equation;\r\n }\r\n \r\n \r\n $new_equation = '';\r\n if(filter_var($equation1[$pos_f_char - 1] , FILTER_VALIDATE_INT) || $equation1[$pos_f_char -1] == \"0\")\r\n {\r\n $new_equation = $equation1;\r\n \r\n }\r\n else\r\n {\r\n for($i=0;$i<strlen($equation1);$i++)\r\n {\r\n if($i == $pos_f_char)\r\n $new_equation .= '1';\r\n \r\n $new_equation .= $equation1[$i];\r\n }\r\n }\r\n $arr = secand_char($new_equation);\r\n $secand_char = $arr[0];\r\n $pos_s_char = $arr[1];\r\n \r\n \r\n $new_equation2 = '';\r\n if(filter_var($new_equation[$pos_s_char - 1] , FILTER_VALIDATE_INT) || $new_equation[$pos_s_char -1] == \"0\")\r\n {\r\n $new_equation2 = $new_equation;\r\n \r\n }\r\n else\r\n {\r\n for($i=0;$i<strlen($new_equation);$i++)\r\n {\r\n if($i == $pos_s_char)\r\n $new_equation2 .= '1';\r\n \r\n $new_equation2 .= $new_equation[$i];\r\n }\r\n }\r\n /*\r\n * if the equation written like this x^2-x+3 = 1\r\n * we want change the standard to be like this x^2 - x + 3 -1 = 0 \r\n */\r\n \r\n $fourth_factor = fourth_factor($new_equation2);\r\n $sign_fourth = sign_fourth_factor($new_equation2);\r\n \r\n $t_arr = third_factor($new_equation2);\r\n $third_factor = $t_arr[0];\r\n $pos_third = $t_arr[1];\r\n \r\n $sign_third = sign_third_factor($new_equation2);\r\n \r\n if($fourth_factor != 0)\r\n {\r\n //here we want to know the sign of fourth factor \r\n \r\n if($sign_fourth == \"+\")\r\n {\r\n //here we want Subtraction the third factor from fourth factor \r\n \r\n if($sign_third == \"+\")\r\n {\r\n $new_third = $third_factor - $fourth_factor;\r\n }\r\n else if($sign_third == \"-\")\r\n {\r\n $new_third = get_m($third_factor) - $fourth_factor;\r\n }\r\n }\r\n else if($sign_fourth == \"-\")\r\n {\r\n //here we want sum the third factor with fourth factor\r\n if($sign_third == \"+\")\r\n {\r\n \r\n $new_third = $third_factor + $fourth_factor;\r\n }\r\n else\r\n {\r\n $new_third = get_m($third_factor) + $fourth_factor;\r\n }\r\n }\r\n else\r\n {\r\n //there no probability to come here\r\n return \"fuck\";\r\n }\r\n //we want to know the sign of new third factor\r\n if($new_third > 0)\r\n {\r\n //so the sign is +\r\n //if sign is + so we will put + sign to equation on the place of old third factor\r\n if($pos_third == 0)//so he write the third factor on first\r\n {\r\n $substr = substr($new_equation2 , ($pos_third + strlen($third_factor) - 1));\r\n $new_equation3 = $new_third . $substr;\r\n }\r\n else\r\n {\r\n if($sign_third == \"+\" || $sign_third == \"-\")\r\n {\r\n //so we will just change the number\r\n \r\n \r\n $test_equation = '';\r\n for($i=0;$i<strlen($new_equation2);$i++)\r\n {\r\n if($i == $pos_third -1)\r\n {\r\n $test_equation .= \"+\" . $new_third;\r\n $i = $pos_third + strlen($third_factor) -1 ;\r\n }\r\n else\r\n {\r\n $test_equation .= $new_equation2[$i];\r\n }\r\n }\r\n \r\n $new_equation3 = $test_equation;\r\n }\r\n \r\n \r\n }\r\n }\r\n else\r\n {\r\n //so the sign of new third -\r\n \r\n if($pos_third == 0)//so he write the third factor on first\r\n {\r\n $substr = substr($new_equation2 , ($pos_third + strlen($third_factor) - 1));\r\n $new_equation3 = \"-\" . $new_third . $substr;\r\n }\r\n else\r\n {\r\n if($sign_third == \"+\" || $sign_third == \"-\")\r\n {\r\n //in + and in - we will change it with \r\n \r\n $test_equation = '';\r\n for($i=0;$i<strlen($new_equation2);$i++)\r\n {\r\n if($i == $pos_third -1)\r\n {\r\n $test_equation .= $new_third;\r\n $i = $pos_third + strlen($third_factor) -1 ;\r\n }\r\n else\r\n {\r\n $test_equation .= $new_equation2[$i];\r\n }\r\n }\r\n \r\n $new_equation3 = $test_equation;\r\n }\r\n \r\n }\r\n }\r\n }\r\n else if($fourth_factor == 0)\r\n {\r\n //nothing will change\r\n $new_equation3 = $new_equation2;\r\n }\r\n //we want change the old fourth factor to be zero\r\n $arr = explode(\"=\" , $new_equation3);\r\n \r\n $first_part = $arr[0];\r\n \r\n $new_equation4 = $first_part . \"=0\";\r\n \r\n \r\n \r\n /*\r\n * if the q_factor has nagative sign we will reverse all equation signs \r\n * like this -x^2+4x-12=0\r\n * will be like this x^2-4x+12=0\r\n */\r\n $q = q_factor($new_equation4);\r\n $pos_sign_q = $q[1] - 1;\r\n \r\n \r\n $s = s_factor($new_equation4);\r\n $pos_sign_s = $s[1] -1;\r\n if($pos_sign_s == -1)\r\n {\r\n $pos_sign_s++;\r\n }\r\n $sign_s_factor = sign_s_factor($new_equation4); \r\n \r\n $t = third_factor($new_equation4);\r\n $pos_sign_t = $t[1] -1;\r\n if($pos_sign_t == -1)\r\n {\r\n $pos_sign_t++;\r\n }\r\n $sign_t_factor = sign_third_factor($new_equation4);\r\n \r\n $sign_q_factor = sign_q_factor($new_equation4);\r\n if($sign_q_factor == \"-\")\r\n {\r\n $new_equation5 = '';\r\n for($i=0;$i<strlen($new_equation4);$i++)\r\n {\r\n if($i == $pos_sign_q)\r\n {\r\n $new_equation5 .= \"+\";\r\n }\r\n else if($i == $pos_sign_s)\r\n {\r\n \r\n if($sign_s_factor == \"+\")\r\n $new_equation5 .= \"-\";\r\n else \r\n $new_equation5 .= \"+\";\r\n \r\n if($pos_sign_s == 0)\r\n {\r\n $new_equation5 .= $new_equation4[$i]; \r\n }\r\n }\r\n else if($i == $pos_sign_t)\r\n {\r\n if($sign_t_factor == \"+\")\r\n $new_equation5 .= \"-\";\r\n else\r\n $new_equation5 .= \"+\";\r\n \r\n if($pos_sign_t == 0)\r\n $new_equation5 .= $new_equation4[$i];\r\n }\r\n else\r\n $new_equation5 .= $new_equation4[$i];\r\n }\r\n }\r\n else\r\n {\r\n //nothing will be change\r\n $new_equation5 = $new_equation4;\r\n }\r\n \r\n return $new_equation5;\r\n}",
"public function testWidenWithZeroInput()\n {\n $box = $this->box->widen(0);\n static::assertEquals(0, $box->getHeight());\n static::assertEquals(0, $box->getWidth());\n }",
"function it_translates_an_empty_string_into_zero()\n {\n $this->add('')->shouldEqual(0);\n }",
"function it_translates_an_empty_string_into_zero()\n {\n $this->add('')->shouldEqual(0);\n }",
"public static function singularize($word) {\n $original = $word;\n foreach(self::$singular_rules as $rule => $replacement) {\n $word = preg_replace($rule,$replacement,$word);\n if($original != $word) break;\n }\n return $word;\n }",
"public static function simplePluralize($num, $thing)\n {\n return sprintf('%s%s', $thing, $num == 1 ? '' : 's');\n }",
"function s_factor($equation)\r\n{\r\n \r\n $first_char = first_char($equation);\r\n $pos_f_char = strpos($equation , $first_char);\r\n \r\n $arr = secand_char($equation);\r\n $secand_char = $arr[0];\r\n $pos_s_char = $arr[1];\r\n \r\n \r\n if($equation[$pos_f_char + 1] == \"^\")\r\n {\r\n $pos = $pos_s_char;\r\n }\r\n else\r\n {\r\n $pos = $pos_f_char;\r\n }\r\n \r\n $number1 = '';\r\n for($i = $pos-1;$i >= 0 ; $i--)\r\n {\r\n if(filter_var($equation[$i] , FILTER_VALIDATE_INT) || $equation[$i] == \"0\")\r\n {\r\n $number1 .= $equation[$i];\r\n \r\n }\r\n else\r\n break;\r\n }\r\n $number = '' ;\r\n for($i=strlen($number1)-1 ;$i >=0 ; $i--)\r\n {\r\n $number .= $number1[$i];\r\n }\r\n \r\n $pos_num = $pos - strlen($number);\r\n return array((int)$number , $pos_num);\r\n \r\n \r\n}",
"public static function singularLabel()\n {\n return __('Attribute');\n }",
"function index()\r\n\t{\r\n\t\t//\techo number_format(0, 2, '.', '');\r\n\t}",
"public function isVariableNumerica(){ return false; }",
"public function testAddZero()\n {\n $this\n ->given(\n $zero = $this->fromNative(0),\n $number = $this->fromNative($this->randomNativeNumber())\n )\n ->then\n ->boolean(\n $number->add($zero)->equals($number)\n )->isTrue()\n ->boolean(\n $zero->add($number)->equals($number)\n )->isTrue()\n ;\n }",
"function multiDimentialToSingular($array)\n{\n $singular = array();\n foreach ($array as $key => $val) {\n foreach ($val as $key2 => $val2) {\n $singular[] = $val2;\n }\n }\n\n return $singular;\n}",
"function sqrt() { # :: Num -> Float\n return new Num\\Float(sqrt($this->value));\n }",
"function sigorigval($origval,$origerr,$numplaces){\n\n\t\t//Math from Noah McLean at MIT\n\n\t\t$x=round($origval*pow(10,(($numplaces-1)-floor(log10(2*$origerr))))) * pow(10,((floor(log10(2*$origerr))))-($numplaces-1));\n\t\n\t\treturn($x);\n\n\t}",
"public function positiveOrZero(string|int|float $message): self\n {\n return $this->addMessage(new PositiveOrZero($message));\n }",
"function numberformat($qwe,$asd)\r\n{\r\n if($qwe==0)$zxc='0'; \r\n else{\r\n $zxc=number_format($qwe,$asd);\r\n }\r\n return $zxc;\r\n}",
"public function singular()\n\t{\n\t\treturn _('Document');\n\t}",
"public static function singularize($str){\n\t\treturn ActiveRecord\\Utils::singularize($str);\n\t}",
"public static function singularise ($pluralWord)\r\n\t{\r\n\t\t# Singularise\r\n\t\tswitch (true) {\r\n\t\t\tcase preg_match ('/(.+)ies$/', $pluralWord, $matches):\r\n\t\t\t\treturn $matches[1] . 'y';\r\n\t\t\tcase preg_match ('/(.+)s\\'$/', $pluralWord, $matches):\r\n\t\t\t\treturn $matches[1] . 's';\r\n\t\t\tcase preg_match ('/(.+)s$/', $pluralWord, $matches):\r\n\t\t\t\treturn $matches[1];\r\n\t\t}\r\n\t\t\r\n\t\t# Return unmodified if no match found\r\n\t\treturn $pluralWord;\r\n\t}",
"function change_negative_numeric($numeric) {\n\t\treturn $numeric * (-1);\n\t}",
"public function normL1(): int|float {\n return core\\lapack::slange('1', $this);\n }",
"public function singular()\n {\n return $this->getNameInstance()->singular();\n }",
"function numfix($var){\n if(is_numeric($var)){\n if($var<0){\n return null;\n }else{\n return $var;\n }\n }else {\n return null;\n }\n}",
"public function getSingularName()\n {\n return str_singular(lcfirst(ucwords($this->getClass())));\n }",
"public function getSingularName()\n {\n return str_singular(lcfirst(ucwords($this->getClass())));\n }",
"public function testDecimalToRoman0()\n {\n $this->assertEquals(\"\", RomanNumber::decimalToRoman(0));\n }",
"public function equalsZero(): bool\r\n {\r\n return $this->getValue() == 0;\r\n }",
"public function getSingularName()\n {\n return $this->singularName;\n }",
"public function getSingularName()\n {\n return $this->singularName;\n }",
"function MyMod_Data_Group_Singular($single=FALSE)\n {\n if (($this->Singular || $single) && count($this->ItemDataSGroups)>0)\n {\n return True;\n }\n else\n {\n return False;\n }\n }",
"public function svd() : SVD\n {\n return SVD::decompose($this);\n }",
"public function validFloats() {}",
"function toigian_ps()\n {\n $uscln = $this->USCLN($this->tuso, $this->mauso);\n $this->tuso = $this->tuso/$uscln;\n $this->mauso = $this->mauso/$uscln;\n }",
"public function testFilterWithZero()\n {\n $this->assertSame('N', $this->filter->filter(0));\n }",
"public function testDivideByZeroArray()\n {\n $this->expectException(\\InvalidArgumentException::class);\n\n np::ar([[1, 2, 3, 0]])->reciprocal();\n }"
]
| [
"0.6189822",
"0.5868154",
"0.58473176",
"0.58406645",
"0.57985735",
"0.5665874",
"0.56216633",
"0.56171244",
"0.54503804",
"0.5439913",
"0.5412757",
"0.5412757",
"0.5280513",
"0.5267398",
"0.52254397",
"0.5194812",
"0.5192889",
"0.5179273",
"0.51729745",
"0.5135004",
"0.5121026",
"0.50688726",
"0.5065453",
"0.5050193",
"0.5047665",
"0.50412726",
"0.50339025",
"0.5029527",
"0.50287324",
"0.5020615",
"0.50112814",
"0.50099623",
"0.5009519",
"0.50037915",
"0.49947536",
"0.49934033",
"0.4983036",
"0.49714088",
"0.49659783",
"0.49631232",
"0.4958466",
"0.4954645",
"0.49507275",
"0.49436808",
"0.49356374",
"0.49321508",
"0.49181217",
"0.4911387",
"0.49050957",
"0.4903692",
"0.48918805",
"0.4887906",
"0.48854372",
"0.48851046",
"0.4884728",
"0.48810506",
"0.4868364",
"0.48671687",
"0.48655534",
"0.48621503",
"0.4856368",
"0.4831935",
"0.48218578",
"0.48117548",
"0.4809494",
"0.48093662",
"0.480176",
"0.47837216",
"0.47800454",
"0.47800454",
"0.47712663",
"0.4768993",
"0.47661296",
"0.4763518",
"0.47626096",
"0.47582722",
"0.47380412",
"0.4735657",
"0.47353867",
"0.47348738",
"0.47335875",
"0.472717",
"0.47222495",
"0.47087982",
"0.47020647",
"0.46986568",
"0.46962276",
"0.46871227",
"0.46870172",
"0.46783194",
"0.46783194",
"0.46770704",
"0.46765953",
"0.46653557",
"0.46653557",
"0.4660237",
"0.4652856",
"0.4640605",
"0.46390554",
"0.4636948",
"0.46320882"
]
| 0.0 | -1 |
Converts a hash in hex form to binary form | public static function hexToBin($hash)
{
// If using PHP 5.4, there is a native function to convert from hex to binary
static $useNative;
if ($useNative === null) {
$useNative = function_exists('hex2bin');
}
if (!$useNative && strlen($hash) % 2 !== 0) {
$hash = '0' . $hash;
}
return $useNative ? hex2bin($hash) : pack("H*", $hash);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function binToHex($hash)\n {\n return bin2hex($hash);\n }",
"function sha1_bin($hex)\r\n{\r\n return pack('H40', $hex);\r\n}",
"function hextobin($hexString) \n { \n $length = strlen($hexString); \n $binString=\"\"; \n $count=0; \n while($count<$length) \n { \n $subString =substr($hexString,$count,2); \n $packedString = pack(\"H*\",$subString); \n if ($count==0)\n {\n $binString=$packedString;\n } \n \n else \n {\n $binString.=$packedString;\n } \n \n $count+=2; \n } \n return $binString; \n }",
"static public function hexToBin(string $hex): string\n {\n $code = \"0123456789abcdef\";\n $bin = \"\";\n for ($i = strlen($hex) - 1; $i >= 0; $i--) {\n $char = $hex[$i];\n $dec = strpos($code, $char);\n $binpart = decbin($dec);\n $bin = self::prependBin($binpart, 4) . $bin;\n }\n\n return $bin;\n }",
"public static function hex2bin(string $str): string {\n return hex2bin(strlen($str) % 2 == 1 ? \"0\" . $str : $str);\n }",
"function blake2bHex($input, $key, $outlen = 64) {\n\t\t$output = $this->blake2b($input, $key, $outlen);\n\t\treturn $this->toHex($output);\n\t}",
"function bstr2bin($input)\r\n\t{\r\n\t\tif (!is_string($input)) return null; // Sanity check\r\n\t\t// Unpack as a hexadecimal string\r\n\t\t$value = unpack('H*', $input);\r\n\t\t// Output binary representation\r\n\t\t$value = str_split($value[1], 1);\r\n\t\t$bin = '';\r\n\t\tforeach ($value as $v){\r\n\t\t\t$b = str_pad(base_convert($v, 16, 2), 4, '0', STR_PAD_LEFT);\r\n\t\t\t$bin .= $b;\r\n\t\t}\r\n\t\treturn $bin;\r\n\t}",
"public static function hex2str($hex) {}",
"private function _hex2bin ($data)\r\n\t{\r\n\t\t$len = strlen ($data);\r\n\t\treturn pack (\"H\" . $len, $data);\r\n\t}",
"private function hex2bin($data){\n $encoded = '';\n $data_arr = str_split($data, 2);\n\n foreach($data_arr as $val){\n $binary = base_convert($val, 16, 2);\n $encoded .= str_pad($binary, 8, '0', STR_PAD_LEFT);\n }\n return $encoded;\n }",
"public static function gmpBinconv($hex)\n {\n $rem = '';\n $dv = '';\n $byte = '';\n $digits = array();\n\n for ($x = 0; $x < 256; $x++) {\n $digits[$x] = chr($x);\n }\n\n if (substr(strtolower($hex), 0, 2) != '0x') {\n $hex = '0x'.strtolower($hex);\n }\n\n while (gmp_cmp($hex, 0) > 0) {\n $dv = gmp_div($hex, 256);\n $rem = gmp_strval(gmp_mod($hex, 256));\n $hex = $dv;\n $byte = $byte.$digits[$rem];\n }\n\n return strrev($byte);\n }",
"private function filter(string $hash): string\n {\n $RSA_SHA256prefix = [\n 0x30,\n 0x31,\n 0x30,\n 0x0D,\n 0x06,\n 0x09,\n 0x60,\n 0x86,\n 0x48,\n 0x01,\n 0x65,\n 0x03,\n 0x04,\n 0x02,\n 0x01,\n 0x05,\n 0x00,\n 0x04,\n 0x20,\n ];\n $unpHash = $this->binToArray($hash);\n $signedInfoDigest = array_values($unpHash);\n $digestToSign = [];\n $this->systemArrayCopy($RSA_SHA256prefix, 0, $digestToSign, 0, count($RSA_SHA256prefix));\n $this->systemArrayCopy($signedInfoDigest, 0, $digestToSign, count($RSA_SHA256prefix), count($signedInfoDigest));\n\n return $this->arrayToBin($digestToSign);\n }",
"function bin2bstr($input)\r\n\t{\r\n\t\tif (!is_string($input)) return null; // Sanity check\r\n\t\t// Pack into a string\r\n\t\t$input = str_split($input, 2);\r\n\t\t$str = '';\r\n\t\tforeach ($input as $v){\r\n\t\t\t$str .= base_convert($v, 2, 16);\r\n\t\t}\r\n\t\t$str = pack('H*', $str);\r\n\t\treturn $str;\r\n\t}",
"public static function str2hex($str) {}",
"public static function tohex($data, $bin2hex=true) {\n $data = (is_object($data) || is_array($data)) ? json_encode($data) : $data;\n if (! is_string($data)) return 0;\n\n if($bin2hex) return bin2hex(gzcompress($data));\n else\n {\n $len = strlen($data);\n if ($len % 2) return 0;\n else if (strspn($data, '0123456789abcdefABCDEF') != $len) return 0;\n $data = pack('H*', $data);\n return gzuncompress($data);\n }\n }",
"protected function packConvertHexStringToRawBinary($hex_string){\n\t\treturn pack('h*', $hex_string);\n\t}",
"function toBin($str){\n $str = (string)$str;\n $l = strlen($str);\n $result = '';\n while($l--){\n $result = str_pad(decbin(ord($str[$l])),8,\"0\",STR_PAD_LEFT).$result;\n }\n return $result;\n }",
"public function toHex()\n {\n if (!$this->internalBin) return false;\n return self::binTohex($this->internalBin);\n }",
"private static function hexToBase62(string $hex) : string\n {\n $hex = strrev($hex);\n \n return gmp_strval(gmp_init($hex, 16), 62);\n }",
"public function hash();",
"static public function binToHex(string $bin): string\n {\n $code = \"0123456789abcdef\";\n\n // check the length\n $rest = strlen($bin) % 4;\n if ($rest > 0) {\n // we need to prepend 0's....\n $newLength = strlen($bin) + (4 - $rest);\n $bin = self::prependBin($bin, $newLength);\n }\n\n $parts = str_split($bin, 4);\n $res = \"\";\n foreach ($parts as $p) {\n $dec = bindec($p);\n $res .= $code[$dec];\n }\n\n return $res;\n }",
"public function base58_encode_checksum($hex) { \n\n\t// SHA256 Hash\n\t$checksum = hash('sha256', hash('sha256', pack('H*', $hex), true));\n\t$hash = $hex . substr($checksum, 0, 8);\n\n\t// Return\n\treturn $this->base58_encode($hash);\n\n}",
"function _foaf_normalize_hex($hex) {\n return strtoupper(preg_replace('/[^a-zA-Z0-9]/', '', $hex));\n}",
"public function getCodeHash() {\n $date = new \\DateTime();\n return hexdec($date->format('d-m-y his'));\n }",
"public function getHash();",
"public function hash(): string;",
"function replaceHashHex($hex) {\n\tglobal $base;\n\t$oldHex = $hex;\n\t$baseHex = $base->hex2RGB( str_replace('#', '', $oldHex) );\n\techo $baseHex[0] . ', ' . $baseHex[1] . ', ' . $baseHex[2] ;\n}",
"final public function getHash() {}",
"public function getHash(): string;",
"public function getHash(): string;",
"public function getHash(): string;",
"public function getHash(): string;",
"function hex_to_base64($str_to_conv) {\n\n\t$bin_cod = '';\n\n\t$bit = 4;\n\n\tfor($i=0; $i<strlen($str_to_conv); $i++) {\n\t\tforeach ($base16_code as $key => $value) {\n\t\t\tif ($str_to_conv[$i]==$value) {\n\t\t\t\t$result = $key;\n\t\t\t\t$byte = '';\n\t\t\t\tfor ($j=0; $j<$bit; $j++) {\n\t\t\t\t\t$byte = ($result%2).$byte;\n\t\t\t\t\t$result = floor($result/2);\n\t\t\t\t}\n\t\t\t\t$bin_cod .= $byte;\n\t\t\t}\n\t\t}\n\t}\n\n\t$str_ecoded = '';\n\tfor ($p=1; $p<=strlen($bin_cod); $p++){\n\t\tif ($p%6==0) {\n\t\t\t$seibit = substr($bin_cod, $p-6, 6);\n\t\t\t$key_for_base64_code = 0;\n\t\t\tfor ($q=0; $q<strlen($seibit); $q++){\n\t\t\t\t$key_for_base64_code = $key_for_base64_code + $seibit[$q]*pow(2,(5-$q));\n\t\t\t}\n\t\t\t$str_ecoded .= $base64_code[$key_for_base64_code];\n\t\t}\n\t}\n\n\treturn $str_ecoded;\n}",
"public function getHash() {}",
"function base64_to_hex($str_to_conv) {\n\n\t$bin_cod = '';\n\n\t$bin_string = '';\n\tfor ($i=0; $i<strlen($str_to_conv); $i++) { \n\t\t$base_64_key = array_search($str_to_conv[$i], $base64_code);\n\t\t$bin_string .= sprintf(\"%06d\", decbin($base_64_key));\n\t}\n\n\t$hex_string = '';\n\tfor ($i=0; $i < strlen($bin_string); $i += 4) { \n\t\t$hex_string .= base_convert(substr($bin_string, $i, 4), 2, 16);\n\t}\n\n\treturn $hex_string;\n}",
"function toHex($bytes) {\n\t\treturn implode('', array_map(function ($n){return ($n < 16 ? \"0\" : \"\") . dechex($n);}, $bytes));\n\t}",
"public static function hashObject($obj) : string\n {\n return sodium_bin2hex(sodium_crypto_generichash($obj));\n }",
"public static function applySHA256($input){\n\n\t\ttry {\n\t\t\t$output = hash(\"sha256\",$input,true);\n\n\t\t\t# our output is of type string, we convert it to a HexaDecimal String as follows\n\n\t\t\t$HexaDecimal = '';\n\n\t\t\tfor ($i=0; $i < strlen($output); $i++) { \n\t\t\t\t\n\t\t\t\t$HexaDecimal .= dechex(ord($output[$i]));\n\t\t\t}\n\t\t\treturn $HexaDecimal;\n\n\t\t} catch (Exception $e) {\n\t\t\tthrow new Exception($e, 1);\n\t\t}\n\n\t\t\n\t}",
"public static function hexToStr($hex) {\r\n $string = '';\r\n for ($i=0; $i < strlen($hex)-1; $i+=2) {\r\n $string .= chr(hexdec($hex[$i].$hex[$i+1]));\r\n }\r\n return base64_decode($string);\r\n }",
"function hash_unbox($hash, $key)\n{\n $nonce = mb_substr($hash, 0, SODIUM_CRYPTO_SECRETBOX_NONCEBYTES, '8bit');\n $ciphertext = mb_substr($hash, SODIUM_CRYPTO_SECRETBOX_NONCEBYTES, null, '8bit');\n return sodium_crypto_secretbox_open($ciphertext, $nonce, $key);\n}",
"static protected function DigestHex( $strHex, $strH0, $strH1, $strH2, $strH3, $strH4 )\n\t{\n\t\t$strK[ 0 ] = \"5A827999\";\n\t\t$strK[ 1 ] = \"6ED9EBA1\";\n\t\t$strK[ 2 ] = \"8F1BBCDC\";\n\t\t$strK[ 3 ] = \"CA62C1D6\";\n\t\t\n\t\t//Hex words are used in the encryption process, these can be any valid 8 digit hex value\n\t\t$strH[ 0 ] = $strH0;\n\t\t$strH[ 1 ] = $strH1;\n\t\t$strH[ 2 ] = $strH2;\n\t\t$strH[ 3 ] = $strH3;\n\t\t$strH[ 4 ] = $strH4;\n\t\t\n\t\t//divide the Hex block into 16 hex words\n\t\tfor( $intPos = 0 ; $intPos <= ( \\strlen( $strHex ) / 8 ) - 1 ; $intPos = $intPos + 1 )\n\t\t{\n\t\t\t$strWords[ intval( $intPos ) ] = substr( $strHex, ( intval( $intPos ) * 8 ) + 1 - 1, 8 );\n\t\t}\n\t\t\n\t\t//encode the Hex words using the constants above\n\t\t//innitialize 80 hex word positions\n\t\tfor( $intPos = 16 ; $intPos <= 79 ; $intPos = $intPos + 1 )\n\t\t{\n\t\t\t$strTemp = $strWords[ intval( $intPos ) - 3 ];\n\t\t\t$strTemp1 = self::HexBlockToBinary( $strTemp );\n\t\t\t$strTemp = $strWords[ intval( $intPos ) - 8 ];\n\t\t\t$strTemp2 = self::HexBlockToBinary( $strTemp );\n\t\t\t$strTemp = $strWords[ intval( $intPos ) - 14 ];\n\t\t\t$strTemp3 = self::HexBlockToBinary( $strTemp );\n\t\t\t$strTemp = $strWords[ intval( $intPos ) - 16 ];\n\t\t\t$strTemp4 = self::HexBlockToBinary( $strTemp );\n\t\t\t$strTemp = self::BinaryXOR( $strTemp1, $strTemp2 );\n\t\t\t$strTemp = self::BinaryXOR( $strTemp, $strTemp3 );\n\t\t\t$strTemp = self::BinaryXOR( $strTemp, $strTemp4 );\n\t\t\t$strWords[ intval( $intPos ) ] = self::BlockToHex( self::BinaryShift( $strTemp, 1 ) );\n\t\t}\n\t\t\n\t\t//initialize the changing word variables with the initial word variables\n\t\t$strA[ 0 ] = $strH[ 0 ];\n\t\t$strA[ 1 ] = $strH[ 1 ];\n\t\t$strA[ 2 ] = $strH[ 2 ];\n\t\t$strA[ 3 ] = $strH[ 3 ];\n\t\t$strA[ 4 ] = $strH[ 4 ];\n\t\t\n\t\t//Main encryption loop on all 80 hex word positions\n\t\tfor( $intPos = 0 ; $intPos <= 79 ; $intPos = $intPos + 1 )\n\t\t{\n\t\t\t$strTemp = self::BinaryShift( self::HexBlockToBinary( $strA[ 0 ] ), 5 );\n\t\t\t$strTemp1 = self::HexBlockToBinary( $strA[ 3 ] );\n\t\t\t$strTemp2 = self::HexBlockToBinary( $strWords[ intval( $intPos ) ] );\n\t\t\t\n\t\t\tswitch( $intPos )\n\t\t\t{\n\t\t\t\tcase 0 :\n\t\t\t\tcase 1 :\n\t\t\t\tcase 2 :\n\t\t\t\tcase 3 :\n\t\t\t\tcase 4 :\n\t\t\t\tcase 5 :\n\t\t\t\tcase 6 :\n\t\t\t\tcase 7 :\n\t\t\t\tcase 8 :\n\t\t\t\tcase 9 :\n\t\t\t\tcase 10 :\n\t\t\t\tcase 11 :\n\t\t\t\tcase 12 :\n\t\t\t\tcase 13 :\n\t\t\t\tcase 14 :\n\t\t\t\tcase 15 :\n\t\t\t\tcase 16 :\n\t\t\t\tcase 17 :\n\t\t\t\tcase 18 :\n\t\t\t\tcase 19 :\n\t\t\t\t\t$strTemp3 = self::HexBlockToBinary( $strK[ 0 ] );\n\t\t\t\t\t$strTemp4 = self::BinaryOR( self::BinaryAND( self::HexBlockToBinary( $strA[ 1 ] ), self::HexBlockToBinary( $strA[ 2 ] ) ), self::BinaryAND( self::BinaryNOT( self::HexBlockToBinary( $strA[ 1 ] ) ), self::HexBlockToBinary( $strA[ 3 ] ) ) );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 20 :\n\t\t\t\tcase 21 :\n\t\t\t\tcase 22 :\n\t\t\t\tcase 23 :\n\t\t\t\tcase 24 :\n\t\t\t\tcase 25 :\n\t\t\t\tcase 26 :\n\t\t\t\tcase 27 :\n\t\t\t\tcase 28 :\n\t\t\t\tcase 29 :\n\t\t\t\tcase 30 :\n\t\t\t\tcase 31 :\n\t\t\t\tcase 32 :\n\t\t\t\tcase 33 :\n\t\t\t\tcase 34 :\n\t\t\t\tcase 35 :\n\t\t\t\tcase 36 :\n\t\t\t\tcase 37 :\n\t\t\t\tcase 38 :\n\t\t\t\tcase 39 :\n\t\t\t\t\t$strTemp3 = self::HexBlockToBinary( $strK[ 1 ] );\n\t\t\t\t\t$strTemp4 = self::BinaryXOR( self::BinaryXOR( self::HexBlockToBinary( $strA[ 1 ] ), self::HexBlockToBinary( $strA[ 2 ] ) ), self::HexBlockToBinary( $strA[ 3 ] ) );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 40 :\n\t\t\t\tcase 41 :\n\t\t\t\tcase 42 :\n\t\t\t\tcase 43 :\n\t\t\t\tcase 44 :\n\t\t\t\tcase 45 :\n\t\t\t\tcase 46 :\n\t\t\t\tcase 47 :\n\t\t\t\tcase 48 :\n\t\t\t\tcase 49 :\n\t\t\t\tcase 50 :\n\t\t\t\tcase 51 :\n\t\t\t\tcase 52 :\n\t\t\t\tcase 53 :\n\t\t\t\tcase 54 :\n\t\t\t\tcase 55 :\n\t\t\t\tcase 56 :\n\t\t\t\tcase 57 :\n\t\t\t\tcase 58 :\n\t\t\t\tcase 59 :\n\t\t\t\t\t$strTemp3 = self::HexBlockToBinary( $strK[ 2 ] );\n\t\t\t\t\t$strTemp4 = self::BinaryOR( self::BinaryOR( self::BinaryAND( self::HexBlockToBinary( $strA[ 1 ] ), self::HexBlockToBinary( $strA[ 2 ] ) ), self::BinaryAND( self::HexBlockToBinary( $strA[ 1 ] ), self::HexBlockToBinary( $strA[ 3 ] ) ) ), self::BinaryAND( self::HexBlockToBinary( $strA[ 2 ] ), self::HexBlockToBinary( $strA[ 3 ] ) ) );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 60 :\n\t\t\t\tcase 61 :\n\t\t\t\tcase 62 :\n\t\t\t\tcase 63 :\n\t\t\t\tcase 64 :\n\t\t\t\tcase 65 :\n\t\t\t\tcase 66 :\n\t\t\t\tcase 67 :\n\t\t\t\tcase 68 :\n\t\t\t\tcase 69 :\n\t\t\t\tcase 70 :\n\t\t\t\tcase 71 :\n\t\t\t\tcase 72 :\n\t\t\t\tcase 73 :\n\t\t\t\tcase 74 :\n\t\t\t\tcase 75 :\n\t\t\t\tcase 76 :\n\t\t\t\tcase 77 :\n\t\t\t\tcase 78 :\n\t\t\t\tcase 79 :\n\t\t\t\t\t$strTemp3 = self::HexBlockToBinary( $strK[ 3 ] );\n\t\t\t\t\t$strTemp4 = self::BinaryXOR( self::BinaryXOR( self::HexBlockToBinary( $strA[ 1 ] ), self::HexBlockToBinary( $strA[ 2 ] ) ), self::HexBlockToBinary( $strA[ 3 ] ) );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t$strTemp = self::BlockToHex( $strTemp );\n\t\t\t$strTemp1 = self::BlockToHex( $strTemp1 );\n\t\t\t$strTemp2 = self::BlockToHex( $strTemp2 );\n\t\t\t$strTemp3 = self::BlockToHex( $strTemp3 );\n\t\t\t$strTemp4 = self::BlockToHex( $strTemp4 );\n\t\t\t\n\t\t\t$strTemp = self::HexAdd( $strTemp, $strTemp1 );\n\t\t\t$strTemp = self::HexAdd( $strTemp, $strTemp2 );\n\t\t\t$strTemp = self::HexAdd( $strTemp, $strTemp3 );\n\t\t\t$strTemp = self::HexAdd( $strTemp, $strTemp4 );\n\t\t\t\n\t\t\t$strA[ 4 ] = $strA[ 3 ];\n\t\t\t$strA[ 3 ] = $strA[ 2 ];\n\t\t\t$strA[ 2 ] = self::BlockToHex( self::BinaryShift( self::HexBlockToBinary( $strA[ 1 ] ), 30 ) );\n\t\t\t$strA[ 1 ] = $strA[ 0 ];\n\t\t\t$strA[ 0 ] = $strTemp;\n\t\t}\n\t\t\n\t\t//Concatenate the final Hex Digest\n\t\treturn $strA[ 0 ] . $strA[ 1 ] . $strA[ 2 ] . $strA[ 3 ] . $strA[ 4 ];\n\t}",
"static protected function HexBlockToBinary( $strHex )\n\t{\n\t\t$strTemp = '';\n\t\tfor( $intPos = 1 ; $intPos <= \\strlen( $strHex ) ; $intPos = $intPos + 1 )\n\t\t{\n\t\t\t$strTemp = $strTemp . self::HexToBinary( substr( $strHex, intval( $intPos ) - 1, 1 ) );\n\t\t}\n\t\t\n\t\treturn $strTemp;\n\t}",
"function setHash($hash) {\n $this->h = pack('H*', $hash);\n }",
"private function strtohex($input) {\n\n $output = '';\n\n foreach (str_split($input) as $c)\n $output.=sprintf(\"%02X\", ord($c));\n\n return $output;\n }",
"function hex2str($hex) {\n $str = '';\n for($i=0;$i<strlen($hex);$i+=2) $str .= chr(hexdec(substr($hex,$i,2)));\n return $str;\n}",
"function hex2str($hex) {\n $str = '';\n for($i=0;$i<strlen($hex);$i+=2) $str .= chr(hexdec(substr($hex,$i,2)));\n return $str;\n}",
"static function toLittleEndian( $hex ){\n // input : 12 96 7\n\n //step 1: str reverse\n // input : 12 96 7\n // output : 76 92 1\n $hex = strrev($hex);\n $hex = self::pad($hex, 4 + (2 % strlen($hex)));\n\n //step 1: flip bytes\n // input : 76 92 10\n // output : 67 29 01\n\n $split = str_split($hex, 2);\n\n foreach ($split as &$item) {\n $item = strrev($item);\n }\n\n return join('', $split);\n }",
"function littleEndian($hex)\n\t{\n\t\tfor ($x=dol_strlen($hex)-2; $x >= 0; $x=$x-2) {\n\t\t\t$result .= substr($hex,$x,2);\n\t\t}\n\t\treturn $result;\n\t}",
"function str2bin($str)\n {\n $out = '';\n\n foreach (str_split($str) as $char) {\n //determine symbol ASCII-code\n $dec = ord($char);\n //convert to binary representation and add leading zeros\n $bin = sprintf('%08d', base_convert($dec, 10, 2));\n $out .= $bin;\n }\n\n return $out;\n }",
"protected function unpackConvertRawBinaryToHexString($raw){\n\t\treturn unpack('h*', $raw);\n\t}",
"private function hexToByteArray($hex) {\n\t if ($hex == null || count($hex) == 0) {\n\t return null;\n\t }\n\t \t\t$hexlen=strlen($hex)/2;\n\n\t \t\t$ba=array();\n\t for ($i = 0; $i < $hexlen; $i++) {\n\t \t//$ba[i] = Integer.parseInt(hex.substring(2 * i, 2 * i + 2), 16);\n\t \t$ba[$i] = $this->ConvertByte(hexdec(substr($hex, 2 * $i, 2)));\n\t }\n\t return $ba;\n\t}",
"function nthash($password = \"\") {\n return strtoupper(bin2hex(mhash(MHASH_MD4, iconv(\"UTF-8\", \"UTF-16LE\", $password))));\n }",
"protected function IP2Bin($ip)\n {\n return sprintf(\"%032s\",base_convert($this->convertIp2Long($ip),10,2));\n }",
"public static function unhash($hash) {\n Object::tracert(__FILE__,__CLASS__,__METHOD__, self::UKEY);\n $len = strlen($hash);\n $ceil = bcpow(self::$range, $len);\n $mmiprimes = array_values(self::$range === 36 ? self::$goldenPrimes36 : self::$goldenPrimes62);\n $mmi = $mmiprimes[$len];\n $num = self::unbaseX($hash);\n $dec = bcmod(bcmul($num, $mmi), $ceil);\n return $dec;\n }",
"public function quoteBinary(?string $value): string\n {\n if ($value===null || $value==='') return 'null';\n\n return '0x'.bin2hex($value);\n }",
"private function hMac($key, $data) {\n return (bin2hex(mhash(MHASH_MD5, $data, $key)));\n }",
"function hex_to_ascii($hex)\n{\n\t$ascii = '';\n\n\tif (strlen($hex) % 2 == 1)\n\t{\n\t\t$hex = '0'.$hex;\n\t}\n\n\tfor($i = 0; $i < strlen($hex); $i += 2)\n\t{\n\t\t$ascii .= chr(base_convert(substr($hex, $i, 2), 16, 10));\n\t}\n\treturn $ascii;\n}",
"public static function _awesomeHash($a) {\n $b = 16909125; for ($c=0; $c<strlen($a); $c++) {\n $b ^= (GTB_Helper::charCodeAt(self::HASH_SEED, ($c%87))) ^ (GTB_Helper::charCodeAt($a, $c));\n $b = GTB_Helper::unsignedRightShift($b, 23) | $b << 9;\n }\n return '8'. GTB_Helper::hexEncodeU32($b);\n }",
"function getId($hash) {\n\t\treturn base_convert($hash, 36, 10);\n\t}",
"function hex2str($hex)\n {\n $string = '';\n\n // process each pair of bytes\n for ($i = 0; $i < strlen($hex) - 1; $i += 2) {\n // pick 2 bytes, convert via hexdec to chr\n $string .= chr(hexdec($hex[$i].$hex[$i + 1]));\n }\n\n return $string;\n }",
"public function setHash($var)\n {\n GPBUtil::checkString($var, True);\n $this->hash = $var;\n\n return $this;\n }",
"public function setHash($var)\n {\n GPBUtil::checkString($var, True);\n $this->hash = $var;\n\n return $this;\n }",
"function asc2hex ($temp)\n{\n $len = strlen($temp);\n $data = \"\";\n for ($i=0; $i<$len; $i++) $data.=sprintf(\"%02x\",ord(substr($temp,$i,1)));\n return $data;\n}",
"function _hash($string) {\n\t\t\t// Use sha1() if possible, php versions >= 4.3.0 and 5\n\t\t\tif(function_exists('sha1')) {\n\t\t\t\t$hash = sha1($string);\n\t\t\t} else {\n\t\t\t\t// Fall back to md5(), php versions 3, 4, 5\n\t\t\t\t$hash = md5($string);\n\t\t\t}\n\t\t\t$out ='';\n\t\t\t// Convert hexadecimal hash value to binary string\n\t\t\tfor($c=0;$c<strlen($hash);$c+=2) {\n\t\t\t\t$out .= $this->_hex2chr($hash[$c] . $hash[$c+1]);\n\t\t\t}\n\t\t\treturn $out;\n\t\t}",
"function bin2str($binary)\n {\n // 8 bits\n $binary = chunk_split($binary, 8, ' ');\n if(substr($binary, -1) === ' ') {\n $binary = substr($binary, 0, -1);\n }\n\n $binaryArray = explode(' ', $binary);\n\n $string = '';\n foreach ($binaryArray as $bin) {\n $bin = str_pad($bin, 8, 0, STR_PAD_RIGHT);\n $string .= chr(bindec($bin));\n }\n\n return $string;\n }",
"final public function toHex() : Hex\n {\n return $this->hex;\n }",
"protected function little_endian($hex) {\n $result = '';\n for ($x = strlen($hex) - 2; $x >= 0; $x = $x - 2) {\n $result .= substr($hex, $x, 2);\n }\n return $result;\n }",
"function hashing($s){\r\n $letters = \"acdegilmnoprstuw\";\r\n $h = 7;\r\n if(!empty($s)){\r\n $chars = str_split($s);\r\n foreach($chars as $char){\r\n $h = bcadd(bcmul($h,37), stripos($letters,$char));\r\n }\r\n return $h;\r\n }\r\n }",
"function f2($a){\n\n $b=hash('sha256',$a);\n\n return $b;\n\n\n\n }",
"public function getBinary();",
"function hex_to_str($hex)\n{\n $string='';\n\n for ($i=0; $i < strlen($hex)-1; $i+=2)\n {\n $d = hexdec($hex[$i].$hex[$i+1]);\n\n //Show only if number of alphabet\n if( ($d >= 48 and $d <= 57) or ($d >= 65 and $d <= 90) or ($d >= 97 and $d <= 122) )\n {\n $string .= chr(hexdec($hex[$i].$hex[$i+1]));\n }\n else\n {\n $string .= '.';\n }\n }\n\n return $string;\n}",
"public function getHash(): string\n {\n return $this->data->hash;\n }",
"public function getHashAttribute()\n {\n return Hashids::encode($this->attributes['id']);\n }",
"public function hashSSHA($password) {\n \n $salt = sha1(rand());\n $salt = substr($salt, 0, 10);\n $encrypted = base64_encode(sha1($password . $salt, true) . $salt);\n $hash = array(\"salt\" => $salt, \"encrypted\" => $encrypted);\n return $hash;\n }",
"public static function calculateTxHash($rawHexData)\n {\n $reversedHash = hash('sha256', hash('sha256', pack(\"H*\", trim($rawHexData)), true));\n $unpacked = unpack('H*', strrev(pack('H*', $reversedHash)));\n return reset($unpacked);\n }",
"function encriptarContrasena($contrasena) {\n\t#The first argument specifies the \"base-2 logarithm of the iteration count used for password stretching\" and the second argument specifies the use of portable hashes\n $t_hasher = new PasswordHash(8, FALSE);\n return $t_hasher->HashPassword($contrasena);\n}",
"public function GetPasswordHash ();",
"public static function bin2hex($length = 32): string\n {\n return bin2hex(random_bytes($length));\n }",
"function hashSSHA($password) {\n\n $salt = sha1(rand());\n $salt = substr($salt, 0, 10);\n $encrypted = base64_encode(sha1($password . $salt, true) . $salt);\n $hash = array(\"salt\" => $salt, \"encrypted\" => $encrypted);\n return $hash;\n }",
"function javascript_to_binary ($texte) {\n\twhile (ereg(\"%([0-9A-F][0-9A-F])\", $texte, $regs))\n\t\t$texte = str_replace($regs[0],chr(hexdec($regs[1])), $texte);\n\treturn $texte;\n}",
"private static function hash($str) {\n $hash = 0;\n\n for ($i = 0, $l = strlen($str); $i < $l; $i++) {\n $hash += ord($str[$i]);\n $hash += $hash << 10;\n $hash ^= $hash >> 6;\n }\n\n $hash += $hash << 3;\n $hash ^= $hash >> 6;\n $hash += $hash << 16;\n\n return $hash;\n }",
"function ascii_to_hex($ascii)\n{\n\t$hex = '';\n\n\tfor($i = 0; $i < strlen($ascii); $i++)\n\t{\n\t\t$hex .= str_pad(base_convert(ord($ascii[$i]), 10, 16), 2, '0', STR_PAD_LEFT);\n\t}\n\treturn $hex;\n}",
"private function convertHexStringToByteString($hexString) {\n\t\t$result = \"\";\n\t\tfor($i=0;$i<strlen($hexString);$i += 2) $result .= chr(hexdec($hexString[$i].$hexString[$i+1]));\n\t\treturn $result;\n\t}",
"public function encode($hex)\n {\n $this->paramsCheck(array($hex));\n\n try {\n\n if (strlen($hex) % 2 != 0) {\n throw new \\Exception('Error in Base58::encode(): Uneven number of hex characters passed to function. Value received was \"' . var_export($hex, true) . '\".');\n }\n\n $orighex = $hex;\n $new = '';\n\n while (bccomp($hex, '0') > 0) {\n $qq = bcdiv($hex, '58');\n $rem = bcmod($hex, '58');\n $val = $qq;\n $new = $new . $this->b58_chars[$rem];\n }\n\n $return = strrev($return);\n\n for ($i = 0; $i < strlen($orighex) && substr($orighex, $i, 2) == '00'; $i += 2) {\n $return = '1' . $return;\n }\n\n return $return;\n\n } catch (\\Exception $e) {\n throw $e;\n }\n }",
"public function getHash()\n {\n return $this->getData(self::HASH);\n }",
"public function payToScriptHash(ScriptInterface $script)\n {\n return ScriptFactory::create()\n ->op('OP_HASH160')\n ->push($script->getScriptHash())\n ->op('OP_EQUAL');\n }",
"function maybe_hash_hex_color($color)\n {\n }",
"public function getHash() : string {\n\t\t// sha256 = 64 characters\n\t\treturn hash_hmac('sha256', $this->token, getenv('ENCRYPTION_KEY'));\n\t}",
"function hashSSHA($password) {\n $salt = sha1(rand());\n $salt = substr($salt, 0, 10);\n $encrypted = base64_encode(sha1($password . $salt, true) . $salt);\n $hash = array(\"salt\" => $salt, \"encrypted\" => $encrypted);\n return $hash;\n}",
"public function get_hash($username) {\n $this->db->select('password')\n ->from('user')\n ->where(\"username='$username'\");\n $result = $this->db->get()->row_array();\n return $result;\n }",
"function checkhashSSHA($salt, $password) {\n\n $hash = base64_encode(sha1($password . $salt, true) . $salt);\n\n return $hash;\n}",
"function hash_decode($id) {\n $decode = Hashids::decode($id);\n return $decode ? $decode[0] : false;\n}",
"public function checkhashSSHA($salt, $password)\r\n {\r\n \r\n $hash = base64_encode(sha1($password . $salt, true) . $salt);\r\n \r\n return $hash;\r\n }",
"public function getHash()\n\t{\n\t\tif (!$this->hash)\n\t\t{\n\t\t\t$this->createHash();\n\t\t\t$this->getFromDB($this->hash);\n\t\t}\n\n\t\treturn $this->hash;\n\t}",
"public function getHashIdentifier() : string;",
"private function hashing() {\n\t\t$data = md5($this->name.$this->date);\n\t\t$data = md5($data);\n\t\t$data = strrev($data);\n\t\t//$data = md5($data);\n\t\t$data = strtoupper($data);\n\t\t//$data = strrev($data);\n\n\t\t$datatemp = NULL;\n\t\tfor($i=0; $i<=strlen($data); $i++) {\n\t\t\t$arr = substr($data, $i, 1);\n\t\t\tif($i == '4' || $i == '8' || $i == '12' || $i == '16' || $i == '20' || $i == '24' || $i == '28' || $i == '32') {\n\t\t\t\t$datatemp .= substr($this->strfinger, ($i/4)-1, 1);\t\n\t\t\t}\n\t\t\t$datatemp .= \"/%\".$this->combine[$arr];\n\t\t}\n\n\t\t$this->resulthashcode = substr($datatemp, 1, strlen($datatemp)-6);\n\t\t$this->result = true;\n\t}",
"public function hash($token,$hash)\n {\n $controller = new SignaBlockController;\n $response = $controller->hash($token,$hash); \n if($response)\n {\n if($response->result == \"OK\")\n {\n return $response->data->tx_hash;\n }\n }\n return response()->json($this->jsonError);\n }",
"public function toHex(bool $twosCompliment = false);",
"private static function CheckHash($Hashnum)\n\t{\n\t\t$CheckByte = 0;\n\t\t$Flag = 0;\n\t\t$HashStr = sprintf('%u', $Hashnum);\n\t\t$length = strlen($HashStr);\n\t\tfor ($i = $length - 1; $i >= 0; $i --)\n\t\t{\n\t\t\t$Re = $HashStr{$i};\n\t\t\tif (1 === ($Flag % 2))\n\t\t\t{\n\t\t\t\t$Re += $Re;\n\t\t\t\t$Re = (int)($Re / 10) + ($Re % 10);\n\t\t\t}\n\t\t\t$CheckByte += $Re;\n\t\t\t$Flag ++;\n\t\t}\n\t\t$CheckByte %= 10;\n\t\tif (0 !== $CheckByte)\n\t\t{\n\t\t\t$CheckByte = 10 - $CheckByte;\n\t\t\tif (1 === ($Flag % 2) )\n\t\t\t{\n\t\t\t\tif (1 === ($CheckByte % 2))\n\t\t\t\t{\n\t\t\t\t\t$CheckByte += 9;\n\t\t\t\t}\n\t\t\t\t$CheckByte >>= 1;\n\t\t\t}\n\t\t}\n\t\treturn '7'.$CheckByte.$HashStr;\n\t}",
"public function getHash($plaintext, $salt = false);"
]
| [
"0.7451742",
"0.6904995",
"0.6477196",
"0.6408912",
"0.63023025",
"0.6293589",
"0.6181585",
"0.6171403",
"0.6148444",
"0.61452526",
"0.6131103",
"0.59920394",
"0.59887",
"0.59275705",
"0.5838102",
"0.58224994",
"0.5807395",
"0.58048457",
"0.5736268",
"0.57354736",
"0.57052416",
"0.56896",
"0.5679689",
"0.5662763",
"0.5608325",
"0.5595422",
"0.55806583",
"0.55395496",
"0.5529414",
"0.5529414",
"0.5529414",
"0.5529414",
"0.5501812",
"0.54870844",
"0.54836255",
"0.5481909",
"0.54807496",
"0.54340154",
"0.5427481",
"0.54141676",
"0.5399577",
"0.53895354",
"0.5365982",
"0.5361379",
"0.5355353",
"0.5355353",
"0.53517264",
"0.5321034",
"0.5303925",
"0.52990603",
"0.529861",
"0.5296762",
"0.5255466",
"0.5248591",
"0.52481836",
"0.5244557",
"0.5225757",
"0.5210677",
"0.5205445",
"0.5178271",
"0.5173302",
"0.5173302",
"0.5165632",
"0.51540405",
"0.5148008",
"0.5147519",
"0.5123376",
"0.5123271",
"0.5122712",
"0.51118964",
"0.5110567",
"0.5099466",
"0.5090296",
"0.5044475",
"0.5040381",
"0.5031784",
"0.503141",
"0.50251645",
"0.50175196",
"0.501603",
"0.5013009",
"0.50057",
"0.498944",
"0.49893782",
"0.498563",
"0.49853984",
"0.4978161",
"0.4975982",
"0.49726978",
"0.49701056",
"0.49685535",
"0.49634412",
"0.49630824",
"0.4962222",
"0.4953927",
"0.4948854",
"0.49384955",
"0.4937165",
"0.49359068",
"0.4928105"
]
| 0.76573384 | 0 |
Converts a hash in binary form to hex form | public static function binToHex($hash)
{
return bin2hex($hash);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public static function hexToBin($hash)\n {\n // If using PHP 5.4, there is a native function to convert from hex to binary\n static $useNative;\n if ($useNative === null) {\n $useNative = function_exists('hex2bin');\n }\n\n if (!$useNative && strlen($hash) % 2 !== 0) {\n $hash = '0' . $hash;\n }\n\n return $useNative ? hex2bin($hash) : pack(\"H*\", $hash);\n }",
"function sha1_bin($hex)\r\n{\r\n return pack('H40', $hex);\r\n}",
"public static function str2hex($str) {}",
"public static function hex2str($hex) {}",
"function toHex($bytes) {\n\t\treturn implode('', array_map(function ($n){return ($n < 16 ? \"0\" : \"\") . dechex($n);}, $bytes));\n\t}",
"function blake2bHex($input, $key, $outlen = 64) {\n\t\t$output = $this->blake2b($input, $key, $outlen);\n\t\treturn $this->toHex($output);\n\t}",
"public function toHex()\n {\n if (!$this->internalBin) return false;\n return self::binTohex($this->internalBin);\n }",
"public static function tohex($data, $bin2hex=true) {\n $data = (is_object($data) || is_array($data)) ? json_encode($data) : $data;\n if (! is_string($data)) return 0;\n\n if($bin2hex) return bin2hex(gzcompress($data));\n else\n {\n $len = strlen($data);\n if ($len % 2) return 0;\n else if (strspn($data, '0123456789abcdefABCDEF') != $len) return 0;\n $data = pack('H*', $data);\n return gzuncompress($data);\n }\n }",
"function replaceHashHex($hex) {\n\tglobal $base;\n\t$oldHex = $hex;\n\t$baseHex = $base->hex2RGB( str_replace('#', '', $oldHex) );\n\techo $baseHex[0] . ', ' . $baseHex[1] . ', ' . $baseHex[2] ;\n}",
"static public function binToHex(string $bin): string\n {\n $code = \"0123456789abcdef\";\n\n // check the length\n $rest = strlen($bin) % 4;\n if ($rest > 0) {\n // we need to prepend 0's....\n $newLength = strlen($bin) + (4 - $rest);\n $bin = self::prependBin($bin, $newLength);\n }\n\n $parts = str_split($bin, 4);\n $res = \"\";\n foreach ($parts as $p) {\n $dec = bindec($p);\n $res .= $code[$dec];\n }\n\n return $res;\n }",
"function _foaf_normalize_hex($hex) {\n return strtoupper(preg_replace('/[^a-zA-Z0-9]/', '', $hex));\n}",
"function asc2hex ($temp)\n{\n $len = strlen($temp);\n $data = \"\";\n for ($i=0; $i<$len; $i++) $data.=sprintf(\"%02x\",ord(substr($temp,$i,1)));\n return $data;\n}",
"function hextobin($hexString) \n { \n $length = strlen($hexString); \n $binString=\"\"; \n $count=0; \n while($count<$length) \n { \n $subString =substr($hexString,$count,2); \n $packedString = pack(\"H*\",$subString); \n if ($count==0)\n {\n $binString=$packedString;\n } \n \n else \n {\n $binString.=$packedString;\n } \n \n $count+=2; \n } \n return $binString; \n }",
"public function hash();",
"final public function toHex() : Hex\n {\n return $this->hex;\n }",
"private function strtohex($input) {\n\n $output = '';\n\n foreach (str_split($input) as $c)\n $output.=sprintf(\"%02X\", ord($c));\n\n return $output;\n }",
"public static function hashObject($obj) : string\n {\n return sodium_bin2hex(sodium_crypto_generichash($obj));\n }",
"private function filter(string $hash): string\n {\n $RSA_SHA256prefix = [\n 0x30,\n 0x31,\n 0x30,\n 0x0D,\n 0x06,\n 0x09,\n 0x60,\n 0x86,\n 0x48,\n 0x01,\n 0x65,\n 0x03,\n 0x04,\n 0x02,\n 0x01,\n 0x05,\n 0x00,\n 0x04,\n 0x20,\n ];\n $unpHash = $this->binToArray($hash);\n $signedInfoDigest = array_values($unpHash);\n $digestToSign = [];\n $this->systemArrayCopy($RSA_SHA256prefix, 0, $digestToSign, 0, count($RSA_SHA256prefix));\n $this->systemArrayCopy($signedInfoDigest, 0, $digestToSign, count($RSA_SHA256prefix), count($signedInfoDigest));\n\n return $this->arrayToBin($digestToSign);\n }",
"function base64_to_hex($str_to_conv) {\n\n\t$bin_cod = '';\n\n\t$bin_string = '';\n\tfor ($i=0; $i<strlen($str_to_conv); $i++) { \n\t\t$base_64_key = array_search($str_to_conv[$i], $base64_code);\n\t\t$bin_string .= sprintf(\"%06d\", decbin($base_64_key));\n\t}\n\n\t$hex_string = '';\n\tfor ($i=0; $i < strlen($bin_string); $i += 4) { \n\t\t$hex_string .= base_convert(substr($bin_string, $i, 4), 2, 16);\n\t}\n\n\treturn $hex_string;\n}",
"public static function bin2hex($length = 32): string\n {\n return bin2hex(random_bytes($length));\n }",
"public function hash(): string;",
"public function toHex()\n\t{\n\t\treturn sprintf('#%s%s%s', Strings::padLeft(dechex($this->r), 2, '0'), Strings::padLeft(dechex($this->g), 2, '0'), Strings::padLeft(dechex($this->b), 2, '0'));\n\t}",
"function ascii_to_hex($ascii)\n{\n\t$hex = '';\n\n\tfor($i = 0; $i < strlen($ascii); $i++)\n\t{\n\t\t$hex .= str_pad(base_convert(ord($ascii[$i]), 10, 16), 2, '0', STR_PAD_LEFT);\n\t}\n\treturn $hex;\n}",
"protected function unpackConvertRawBinaryToHexString($raw){\n\t\treturn unpack('h*', $raw);\n\t}",
"public function toHex()\n {\n return $this->toRGB()->toHex();\n }",
"public static function hex2bin(string $str): string {\n return hex2bin(strlen($str) % 2 == 1 ? \"0\" . $str : $str);\n }",
"static protected function DigestHex( $strHex, $strH0, $strH1, $strH2, $strH3, $strH4 )\n\t{\n\t\t$strK[ 0 ] = \"5A827999\";\n\t\t$strK[ 1 ] = \"6ED9EBA1\";\n\t\t$strK[ 2 ] = \"8F1BBCDC\";\n\t\t$strK[ 3 ] = \"CA62C1D6\";\n\t\t\n\t\t//Hex words are used in the encryption process, these can be any valid 8 digit hex value\n\t\t$strH[ 0 ] = $strH0;\n\t\t$strH[ 1 ] = $strH1;\n\t\t$strH[ 2 ] = $strH2;\n\t\t$strH[ 3 ] = $strH3;\n\t\t$strH[ 4 ] = $strH4;\n\t\t\n\t\t//divide the Hex block into 16 hex words\n\t\tfor( $intPos = 0 ; $intPos <= ( \\strlen( $strHex ) / 8 ) - 1 ; $intPos = $intPos + 1 )\n\t\t{\n\t\t\t$strWords[ intval( $intPos ) ] = substr( $strHex, ( intval( $intPos ) * 8 ) + 1 - 1, 8 );\n\t\t}\n\t\t\n\t\t//encode the Hex words using the constants above\n\t\t//innitialize 80 hex word positions\n\t\tfor( $intPos = 16 ; $intPos <= 79 ; $intPos = $intPos + 1 )\n\t\t{\n\t\t\t$strTemp = $strWords[ intval( $intPos ) - 3 ];\n\t\t\t$strTemp1 = self::HexBlockToBinary( $strTemp );\n\t\t\t$strTemp = $strWords[ intval( $intPos ) - 8 ];\n\t\t\t$strTemp2 = self::HexBlockToBinary( $strTemp );\n\t\t\t$strTemp = $strWords[ intval( $intPos ) - 14 ];\n\t\t\t$strTemp3 = self::HexBlockToBinary( $strTemp );\n\t\t\t$strTemp = $strWords[ intval( $intPos ) - 16 ];\n\t\t\t$strTemp4 = self::HexBlockToBinary( $strTemp );\n\t\t\t$strTemp = self::BinaryXOR( $strTemp1, $strTemp2 );\n\t\t\t$strTemp = self::BinaryXOR( $strTemp, $strTemp3 );\n\t\t\t$strTemp = self::BinaryXOR( $strTemp, $strTemp4 );\n\t\t\t$strWords[ intval( $intPos ) ] = self::BlockToHex( self::BinaryShift( $strTemp, 1 ) );\n\t\t}\n\t\t\n\t\t//initialize the changing word variables with the initial word variables\n\t\t$strA[ 0 ] = $strH[ 0 ];\n\t\t$strA[ 1 ] = $strH[ 1 ];\n\t\t$strA[ 2 ] = $strH[ 2 ];\n\t\t$strA[ 3 ] = $strH[ 3 ];\n\t\t$strA[ 4 ] = $strH[ 4 ];\n\t\t\n\t\t//Main encryption loop on all 80 hex word positions\n\t\tfor( $intPos = 0 ; $intPos <= 79 ; $intPos = $intPos + 1 )\n\t\t{\n\t\t\t$strTemp = self::BinaryShift( self::HexBlockToBinary( $strA[ 0 ] ), 5 );\n\t\t\t$strTemp1 = self::HexBlockToBinary( $strA[ 3 ] );\n\t\t\t$strTemp2 = self::HexBlockToBinary( $strWords[ intval( $intPos ) ] );\n\t\t\t\n\t\t\tswitch( $intPos )\n\t\t\t{\n\t\t\t\tcase 0 :\n\t\t\t\tcase 1 :\n\t\t\t\tcase 2 :\n\t\t\t\tcase 3 :\n\t\t\t\tcase 4 :\n\t\t\t\tcase 5 :\n\t\t\t\tcase 6 :\n\t\t\t\tcase 7 :\n\t\t\t\tcase 8 :\n\t\t\t\tcase 9 :\n\t\t\t\tcase 10 :\n\t\t\t\tcase 11 :\n\t\t\t\tcase 12 :\n\t\t\t\tcase 13 :\n\t\t\t\tcase 14 :\n\t\t\t\tcase 15 :\n\t\t\t\tcase 16 :\n\t\t\t\tcase 17 :\n\t\t\t\tcase 18 :\n\t\t\t\tcase 19 :\n\t\t\t\t\t$strTemp3 = self::HexBlockToBinary( $strK[ 0 ] );\n\t\t\t\t\t$strTemp4 = self::BinaryOR( self::BinaryAND( self::HexBlockToBinary( $strA[ 1 ] ), self::HexBlockToBinary( $strA[ 2 ] ) ), self::BinaryAND( self::BinaryNOT( self::HexBlockToBinary( $strA[ 1 ] ) ), self::HexBlockToBinary( $strA[ 3 ] ) ) );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 20 :\n\t\t\t\tcase 21 :\n\t\t\t\tcase 22 :\n\t\t\t\tcase 23 :\n\t\t\t\tcase 24 :\n\t\t\t\tcase 25 :\n\t\t\t\tcase 26 :\n\t\t\t\tcase 27 :\n\t\t\t\tcase 28 :\n\t\t\t\tcase 29 :\n\t\t\t\tcase 30 :\n\t\t\t\tcase 31 :\n\t\t\t\tcase 32 :\n\t\t\t\tcase 33 :\n\t\t\t\tcase 34 :\n\t\t\t\tcase 35 :\n\t\t\t\tcase 36 :\n\t\t\t\tcase 37 :\n\t\t\t\tcase 38 :\n\t\t\t\tcase 39 :\n\t\t\t\t\t$strTemp3 = self::HexBlockToBinary( $strK[ 1 ] );\n\t\t\t\t\t$strTemp4 = self::BinaryXOR( self::BinaryXOR( self::HexBlockToBinary( $strA[ 1 ] ), self::HexBlockToBinary( $strA[ 2 ] ) ), self::HexBlockToBinary( $strA[ 3 ] ) );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 40 :\n\t\t\t\tcase 41 :\n\t\t\t\tcase 42 :\n\t\t\t\tcase 43 :\n\t\t\t\tcase 44 :\n\t\t\t\tcase 45 :\n\t\t\t\tcase 46 :\n\t\t\t\tcase 47 :\n\t\t\t\tcase 48 :\n\t\t\t\tcase 49 :\n\t\t\t\tcase 50 :\n\t\t\t\tcase 51 :\n\t\t\t\tcase 52 :\n\t\t\t\tcase 53 :\n\t\t\t\tcase 54 :\n\t\t\t\tcase 55 :\n\t\t\t\tcase 56 :\n\t\t\t\tcase 57 :\n\t\t\t\tcase 58 :\n\t\t\t\tcase 59 :\n\t\t\t\t\t$strTemp3 = self::HexBlockToBinary( $strK[ 2 ] );\n\t\t\t\t\t$strTemp4 = self::BinaryOR( self::BinaryOR( self::BinaryAND( self::HexBlockToBinary( $strA[ 1 ] ), self::HexBlockToBinary( $strA[ 2 ] ) ), self::BinaryAND( self::HexBlockToBinary( $strA[ 1 ] ), self::HexBlockToBinary( $strA[ 3 ] ) ) ), self::BinaryAND( self::HexBlockToBinary( $strA[ 2 ] ), self::HexBlockToBinary( $strA[ 3 ] ) ) );\n\t\t\t\t\tbreak;\n\t\t\t\tcase 60 :\n\t\t\t\tcase 61 :\n\t\t\t\tcase 62 :\n\t\t\t\tcase 63 :\n\t\t\t\tcase 64 :\n\t\t\t\tcase 65 :\n\t\t\t\tcase 66 :\n\t\t\t\tcase 67 :\n\t\t\t\tcase 68 :\n\t\t\t\tcase 69 :\n\t\t\t\tcase 70 :\n\t\t\t\tcase 71 :\n\t\t\t\tcase 72 :\n\t\t\t\tcase 73 :\n\t\t\t\tcase 74 :\n\t\t\t\tcase 75 :\n\t\t\t\tcase 76 :\n\t\t\t\tcase 77 :\n\t\t\t\tcase 78 :\n\t\t\t\tcase 79 :\n\t\t\t\t\t$strTemp3 = self::HexBlockToBinary( $strK[ 3 ] );\n\t\t\t\t\t$strTemp4 = self::BinaryXOR( self::BinaryXOR( self::HexBlockToBinary( $strA[ 1 ] ), self::HexBlockToBinary( $strA[ 2 ] ) ), self::HexBlockToBinary( $strA[ 3 ] ) );\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\t\n\t\t\t$strTemp = self::BlockToHex( $strTemp );\n\t\t\t$strTemp1 = self::BlockToHex( $strTemp1 );\n\t\t\t$strTemp2 = self::BlockToHex( $strTemp2 );\n\t\t\t$strTemp3 = self::BlockToHex( $strTemp3 );\n\t\t\t$strTemp4 = self::BlockToHex( $strTemp4 );\n\t\t\t\n\t\t\t$strTemp = self::HexAdd( $strTemp, $strTemp1 );\n\t\t\t$strTemp = self::HexAdd( $strTemp, $strTemp2 );\n\t\t\t$strTemp = self::HexAdd( $strTemp, $strTemp3 );\n\t\t\t$strTemp = self::HexAdd( $strTemp, $strTemp4 );\n\t\t\t\n\t\t\t$strA[ 4 ] = $strA[ 3 ];\n\t\t\t$strA[ 3 ] = $strA[ 2 ];\n\t\t\t$strA[ 2 ] = self::BlockToHex( self::BinaryShift( self::HexBlockToBinary( $strA[ 1 ] ), 30 ) );\n\t\t\t$strA[ 1 ] = $strA[ 0 ];\n\t\t\t$strA[ 0 ] = $strTemp;\n\t\t}\n\t\t\n\t\t//Concatenate the final Hex Digest\n\t\treturn $strA[ 0 ] . $strA[ 1 ] . $strA[ 2 ] . $strA[ 3 ] . $strA[ 4 ];\n\t}",
"public function getHash();",
"function hex_to_ascii($hex)\n{\n\t$ascii = '';\n\n\tif (strlen($hex) % 2 == 1)\n\t{\n\t\t$hex = '0'.$hex;\n\t}\n\n\tfor($i = 0; $i < strlen($hex); $i += 2)\n\t{\n\t\t$ascii .= chr(base_convert(substr($hex, $i, 2), 16, 10));\n\t}\n\treturn $ascii;\n}",
"function nthash($password = \"\") {\n return strtoupper(bin2hex(mhash(MHASH_MD4, iconv(\"UTF-8\", \"UTF-16LE\", $password))));\n }",
"function ascii2hex($ascii) {\n\t$hex = '';\n\tfor ($i = 0; $i < strlen($ascii); $i++) {\n\t\t$byte = strtoupper(dechex(ord($ascii{$i})));\n\t\t$byte = str_repeat('0', 2 - strlen($byte)).$byte;\n\t\t$hex.=$byte.\" \";\n\t\t}\n\t\t$hex=str_replace(\" \", \"\", $hex);\n\t\treturn $hex;\n}",
"public function weiToHex($q) {\n\t\treturn '0x' . dechex($q);\n\t}",
"public static function hsv2hex($h, $s = NULL, $v = NULL)\n\t{\n\t\t$rgb = self::hsv2rgb($h, $s, $v);\n\t\treturn self::rgb2hex($rgb);\n\t}",
"final public function getHash() {}",
"public function getHash(): string;",
"public function getHash(): string;",
"public function getHash(): string;",
"public function getHash(): string;",
"private function _hex2bin ($data)\r\n\t{\r\n\t\t$len = strlen ($data);\r\n\t\treturn pack (\"H\" . $len, $data);\r\n\t}",
"private function hex2bin($data){\n $encoded = '';\n $data_arr = str_split($data, 2);\n\n foreach($data_arr as $val){\n $binary = base_convert($val, 16, 2);\n $encoded .= str_pad($binary, 8, '0', STR_PAD_LEFT);\n }\n return $encoded;\n }",
"private static function hexToBase62(string $hex) : string\n {\n $hex = strrev($hex);\n \n return gmp_strval(gmp_init($hex, 16), 62);\n }",
"public static function _awesomeHash($a) {\n $b = 16909125; for ($c=0; $c<strlen($a); $c++) {\n $b ^= (GTB_Helper::charCodeAt(self::HASH_SEED, ($c%87))) ^ (GTB_Helper::charCodeAt($a, $c));\n $b = GTB_Helper::unsignedRightShift($b, 23) | $b << 9;\n }\n return '8'. GTB_Helper::hexEncodeU32($b);\n }",
"public function base58_encode_checksum($hex) { \n\n\t// SHA256 Hash\n\t$checksum = hash('sha256', hash('sha256', pack('H*', $hex), true));\n\t$hash = $hex . substr($checksum, 0, 8);\n\n\t// Return\n\treturn $this->base58_encode($hash);\n\n}",
"public function getCodeHash() {\n $date = new \\DateTime();\n return hexdec($date->format('d-m-y his'));\n }",
"static public function hexToBin(string $hex): string\n {\n $code = \"0123456789abcdef\";\n $bin = \"\";\n for ($i = strlen($hex) - 1; $i >= 0; $i--) {\n $char = $hex[$i];\n $dec = strpos($code, $char);\n $binpart = decbin($dec);\n $bin = self::prependBin($binpart, 4) . $bin;\n }\n\n return $bin;\n }",
"public static function applySHA256($input){\n\n\t\ttry {\n\t\t\t$output = hash(\"sha256\",$input,true);\n\n\t\t\t# our output is of type string, we convert it to a HexaDecimal String as follows\n\n\t\t\t$HexaDecimal = '';\n\n\t\t\tfor ($i=0; $i < strlen($output); $i++) { \n\t\t\t\t\n\t\t\t\t$HexaDecimal .= dechex(ord($output[$i]));\n\t\t\t}\n\t\t\treturn $HexaDecimal;\n\n\t\t} catch (Exception $e) {\n\t\t\tthrow new Exception($e, 1);\n\t\t}\n\n\t\t\n\t}",
"public function getHash() {}",
"function pl_hashify( $color ){\n\t\n\t$clean_hex = str_replace('#', '', $color);\n\t\n\treturn sprintf('#%s', $clean_hex);\n}",
"function asciihex($ascii){\n $length = strlen($ascii);\n $hex = '';\n for ($i = 0; $i < $length; $i++){\n $hex .= sprintf(\"%02x\", ord(substr($ascii, $i, 1)));\n }\n return $hex;\n}",
"function maybe_hash_hex_color($color)\n {\n }",
"public static function gmpBinconv($hex)\n {\n $rem = '';\n $dv = '';\n $byte = '';\n $digits = array();\n\n for ($x = 0; $x < 256; $x++) {\n $digits[$x] = chr($x);\n }\n\n if (substr(strtolower($hex), 0, 2) != '0x') {\n $hex = '0x'.strtolower($hex);\n }\n\n while (gmp_cmp($hex, 0) > 0) {\n $dv = gmp_div($hex, 256);\n $rem = gmp_strval(gmp_mod($hex, 256));\n $hex = $dv;\n $byte = $byte.$digits[$rem];\n }\n\n return strrev($byte);\n }",
"function setHash($hash) {\n $this->h = pack('H*', $hash);\n }",
"public static function hex($length)\n {\n\t\treturn self::getRandomData($length, ceil($length / 2), 'h*');\n\t}",
"function hex2str($hex) {\n $str = '';\n for($i=0;$i<strlen($hex);$i+=2) $str .= chr(hexdec(substr($hex,$i,2)));\n return $str;\n}",
"function hex2str($hex) {\n $str = '';\n for($i=0;$i<strlen($hex);$i+=2) $str .= chr(hexdec(substr($hex,$i,2)));\n return $str;\n}",
"function htmlent_to_hex ($str) {\n\treturn preg_replace (\"/&#([0-9A-z]+);/e\", \"'\\\\\\u'.decimal_to_hex('\\\\1')\" , $str);\n}",
"function hex_to_str($hex)\n{\n $string='';\n\n for ($i=0; $i < strlen($hex)-1; $i+=2)\n {\n $d = hexdec($hex[$i].$hex[$i+1]);\n\n //Show only if number of alphabet\n if( ($d >= 48 and $d <= 57) or ($d >= 65 and $d <= 90) or ($d >= 97 and $d <= 122) )\n {\n $string .= chr(hexdec($hex[$i].$hex[$i+1]));\n }\n else\n {\n $string .= '.';\n }\n }\n\n return $string;\n}",
"function carton_format_hex( $hex ) {\n\n\t $hex = trim( str_replace( '#', '', $hex ) );\n\n\t if ( strlen( $hex ) == 3 ) {\n\t\t\t$hex = $hex[0] . $hex[0] . $hex[1] . $hex[1] . $hex[2] . $hex[2];\n\t }\n\n\t if ( $hex ) return '#' . $hex;\n\t}",
"public static function toHex( $ip ) {\n if ( self::isIPv6( $ip ) ) {\n $n = 'v6-' . self::IPv6ToRawHex( $ip );\n } else {\n $n = self::toUnsigned( $ip );\n if ( $n !== false ) {\n $n = wfBaseConvert( $n, 10, 16, 8, false );\n }\n }\n return $n;\n }",
"public function setHash($var)\n {\n GPBUtil::checkString($var, True);\n $this->hash = $var;\n\n return $this;\n }",
"public function setHash($var)\n {\n GPBUtil::checkString($var, True);\n $this->hash = $var;\n\n return $this;\n }",
"function hex($string){\n\t$hex='';\n\tfor ($i=0; $i < strlen($string); $i++){\n\t\t$hex .= dechex(ord($string[$i]));\n\t}\n\treturn $hex;\n}",
"public function hex($len=null){ }",
"private static function hash($str) {\n $hash = 0;\n\n for ($i = 0, $l = strlen($str); $i < $l; $i++) {\n $hash += ord($str[$i]);\n $hash += $hash << 10;\n $hash ^= $hash >> 6;\n }\n\n $hash += $hash << 3;\n $hash ^= $hash >> 6;\n $hash += $hash << 16;\n\n return $hash;\n }",
"public function toHex()\n {\n return new Hex($this->getRed() << 16 | $this->getGreen() << 8 | $this->getBlue());\n }",
"function decimal_to_hex($decimal) {\n\treturn sprintf('%X', $decimal);\n}",
"function bin2bstr($input)\r\n\t{\r\n\t\tif (!is_string($input)) return null; // Sanity check\r\n\t\t// Pack into a string\r\n\t\t$input = str_split($input, 2);\r\n\t\t$str = '';\r\n\t\tforeach ($input as $v){\r\n\t\t\t$str .= base_convert($v, 2, 16);\r\n\t\t}\r\n\t\t$str = pack('H*', $str);\r\n\t\treturn $str;\r\n\t}",
"static function toLittleEndian( $hex ){\n // input : 12 96 7\n\n //step 1: str reverse\n // input : 12 96 7\n // output : 76 92 1\n $hex = strrev($hex);\n $hex = self::pad($hex, 4 + (2 % strlen($hex)));\n\n //step 1: flip bytes\n // input : 76 92 10\n // output : 67 29 01\n\n $split = str_split($hex, 2);\n\n foreach ($split as &$item) {\n $item = strrev($item);\n }\n\n return join('', $split);\n }",
"function hexascii($hex){\n $length = strlen($hex);\n $ascii = '';\n for ($i = 0; $i < $length; $i+=2){\n $ascii .= chr(hexdec(substr($hex, $i, 2)));\n }\n return $ascii;\n}",
"private function hMac($key, $data) {\n return (bin2hex(mhash(MHASH_MD5, $data, $key)));\n }",
"public function getHashAttribute()\n {\n return Hashids::encode($this->attributes['id']);\n }",
"function bstr2bin($input)\r\n\t{\r\n\t\tif (!is_string($input)) return null; // Sanity check\r\n\t\t// Unpack as a hexadecimal string\r\n\t\t$value = unpack('H*', $input);\r\n\t\t// Output binary representation\r\n\t\t$value = str_split($value[1], 1);\r\n\t\t$bin = '';\r\n\t\tforeach ($value as $v){\r\n\t\t\t$b = str_pad(base_convert($v, 16, 2), 4, '0', STR_PAD_LEFT);\r\n\t\t\t$bin .= $b;\r\n\t\t}\r\n\t\treturn $bin;\r\n\t}",
"function hex2str($hex) \r\n{\r\n $str = '';\r\n for($i=0;$i<strlen($hex);$i+=2) $str .= chr(hexdec(substr($hex,$i,2)));\r\n return $str;\r\n //echo \"My Name is \".$str;\r\n}",
"private function byteArrayToHex($ba) {\n\n\t if ($ba == null || count($ba) == 0) {\n\t return null;\n\t }\n\n\t $sb='';\n\t for ($x = 0; $x < count($ba); $x++) {\n\t \t\t\t\t$hexNumber = \"0\".dechex(0xff & $ba[$x]);\n\t \t\t\t\t$sb.=substr($hexNumber,-2);\n\t }\n\t return strval($sb);\n\t}",
"function hashing($s){\r\n $letters = \"acdegilmnoprstuw\";\r\n $h = 7;\r\n if(!empty($s)){\r\n $chars = str_split($s);\r\n foreach($chars as $char){\r\n $h = bcadd(bcmul($h,37), stripos($letters,$char));\r\n }\r\n return $h;\r\n }\r\n }",
"protected function packConvertHexStringToRawBinary($hex_string){\n\t\treturn pack('h*', $hex_string);\n\t}",
"public static function hexToStr($hex) {\r\n $string = '';\r\n for ($i=0; $i < strlen($hex)-1; $i+=2) {\r\n $string .= chr(hexdec($hex[$i].$hex[$i+1]));\r\n }\r\n return base64_decode($string);\r\n }",
"public static function convertDecToHexa($nbr) {\n $map_hexa = [\"0\", \"1\", \"2\", \"3\", \"4\", \"5\", \"6\", \"7\", \"8\", \"9\", \"A\", \"B\", \"C\", \"D\", \"E\", \"F\"];\n\n $hexa = '';\n while ($nbr >= 16) {\n $hexa = $map_hexa[$nbr % 16] . $hexa;\n $nbr = intdiv($nbr, 16);\n }\n $hexa = $map_hexa[$nbr] . $hexa;\n return $hexa;\n }",
"protected function strtohex($str) \n\t{\n\t\t$strout = \"\";\n\n\t\tfor ( $i = 0; $i < strlen($str); $i++ ) \n\t\t{\n\t\t\t$strout .= ( ord($str[$i]) < 16 ) ? \"0\" . dechex(ord($str[$i])) : dechex(ord($str[$i]));\n\t\t\t$strout .= \" \";\n\n\t\t\tif ( $i%32 == 7 ) \n\t\t\t\t$strout .= \": \";\n\n\t\t\tif ( $i%32 == 15 ) \n\t\t\t\t$strout .= \": \";\n\n\t\t\tif ( $i%32 == 23 ) \n\t\t\t\t$strout .= \": \";\n\n\t\t\tif ( $i%32 == 31 ) \n\t\t\t\t$strout .= \"\\n\";\n\t\t}\n\n\t\treturn $strout . \"\\n\";\n\t}",
"public static function hexToHsv($hex)\n {\n return (new static)->fromHexToHsv($hex);\n }",
"public static function encodeHex($input) {\n\n if (is_numeric($input)) {\n $hex_str = EthereumStatic::large_dechex($input);\n }\n elseif (is_string($input)) {\n $hex_str = EthereumStatic::strToHex($input);\n }\n else {\n throw new \\InvalidArgumentException($input . ' is not a string or number.');\n }\n return '0x' . $hex_str;\n }",
"function hashSSHA($password) {\n\n $salt = sha1(rand());\n $salt = substr($salt, 0, 10);\n $encrypted = base64_encode(sha1($password . $salt, true) . $salt);\n $hash = array(\"salt\" => $salt, \"encrypted\" => $encrypted);\n return $hash;\n }",
"public function hashSSHA($password) {\n \n $salt = sha1(rand());\n $salt = substr($salt, 0, 10);\n $encrypted = base64_encode(sha1($password . $salt, true) . $salt);\n $hash = array(\"salt\" => $salt, \"encrypted\" => $encrypted);\n return $hash;\n }",
"function _hash($string) {\n\t\t\t// Use sha1() if possible, php versions >= 4.3.0 and 5\n\t\t\tif(function_exists('sha1')) {\n\t\t\t\t$hash = sha1($string);\n\t\t\t} else {\n\t\t\t\t// Fall back to md5(), php versions 3, 4, 5\n\t\t\t\t$hash = md5($string);\n\t\t\t}\n\t\t\t$out ='';\n\t\t\t// Convert hexadecimal hash value to binary string\n\t\t\tfor($c=0;$c<strlen($hash);$c+=2) {\n\t\t\t\t$out .= $this->_hex2chr($hash[$c] . $hash[$c+1]);\n\t\t\t}\n\t\t\treturn $out;\n\t\t}",
"function hex_to_base64($str_to_conv) {\n\n\t$bin_cod = '';\n\n\t$bit = 4;\n\n\tfor($i=0; $i<strlen($str_to_conv); $i++) {\n\t\tforeach ($base16_code as $key => $value) {\n\t\t\tif ($str_to_conv[$i]==$value) {\n\t\t\t\t$result = $key;\n\t\t\t\t$byte = '';\n\t\t\t\tfor ($j=0; $j<$bit; $j++) {\n\t\t\t\t\t$byte = ($result%2).$byte;\n\t\t\t\t\t$result = floor($result/2);\n\t\t\t\t}\n\t\t\t\t$bin_cod .= $byte;\n\t\t\t}\n\t\t}\n\t}\n\n\t$str_ecoded = '';\n\tfor ($p=1; $p<=strlen($bin_cod); $p++){\n\t\tif ($p%6==0) {\n\t\t\t$seibit = substr($bin_cod, $p-6, 6);\n\t\t\t$key_for_base64_code = 0;\n\t\t\tfor ($q=0; $q<strlen($seibit); $q++){\n\t\t\t\t$key_for_base64_code = $key_for_base64_code + $seibit[$q]*pow(2,(5-$q));\n\t\t\t}\n\t\t\t$str_ecoded .= $base64_code[$key_for_base64_code];\n\t\t}\n\t}\n\n\treturn $str_ecoded;\n}",
"function getId($hash) {\n\t\treturn base_convert($hash, 36, 10);\n\t}",
"public static function calculateTxHash($rawHexData)\n {\n $reversedHash = hash('sha256', hash('sha256', pack(\"H*\", trim($rawHexData)), true));\n $unpacked = unpack('H*', strrev(pack('H*', $reversedHash)));\n return reset($unpacked);\n }",
"function kernel_hash_handle($value) {\r\n\r\n return sprintf(\"%u\", crc32($value . HEX));\r\n\r\n}",
"function hashSSHA($password) {\n $salt = sha1(rand());\n $salt = substr($salt, 0, 10);\n $encrypted = base64_encode(sha1($password . $salt, true) . $salt);\n $hash = array(\"salt\" => $salt, \"encrypted\" => $encrypted);\n return $hash;\n}",
"public function getHash(): string\n {\n return $this->data->hash;\n }",
"function littleEndian($hex)\n\t{\n\t\tfor ($x=dol_strlen($hex)-2; $x >= 0; $x=$x-2) {\n\t\t\t$result .= substr($hex,$x,2);\n\t\t}\n\t\treturn $result;\n\t}",
"function stringToHex (s) {\r\n var r = \"0x\";\r\n var hexes = new Array (\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\",\"a\",\"b\",\"c\",\"d\",\"e\",\"f\");\r\n for (var i=0; i<s.length; i++) {r += hexes [s.charCodeAt(i) >> 4] + hexes [s.charCodeAt(i) & 0xf];}\r\n return r;\r\n}",
"public function toHex(bool $twosCompliment = false);",
"function hex2str($hex)\n {\n $string = '';\n\n // process each pair of bytes\n for ($i = 0; $i < strlen($hex) - 1; $i += 2) {\n // pick 2 bytes, convert via hexdec to chr\n $string .= chr(hexdec($hex[$i].$hex[$i + 1]));\n }\n\n return $string;\n }",
"function hash_unbox($hash, $key)\n{\n $nonce = mb_substr($hash, 0, SODIUM_CRYPTO_SECRETBOX_NONCEBYTES, '8bit');\n $ciphertext = mb_substr($hash, SODIUM_CRYPTO_SECRETBOX_NONCEBYTES, null, '8bit');\n return sodium_crypto_secretbox_open($ciphertext, $nonce, $key);\n}",
"public function hash($value);",
"private function readhex($length)\n {\n return bin2hex(fread($this->f, $length));\n }",
"public function getHashIdentifier() : string;",
"public function calculateHash(string $text)\n {\n return hash('haval160,4', $text);\n }",
"public static function hexEncodeU32 ($a) {\n $b = self::toHex8(self::unsignedRightShift($a, 24));\n $b .= self::toHex8(self::unsignedRightShift($a, 16) & 255);\n $b .= self::toHex8(self::unsignedRightShift($a, 8) & 255);\n return $b . self::toHex8($a & 255);\n }"
]
| [
"0.7061621",
"0.6726149",
"0.66637397",
"0.637879",
"0.63669884",
"0.627641",
"0.62530893",
"0.6201719",
"0.61720675",
"0.6148772",
"0.61055416",
"0.60956055",
"0.60699683",
"0.59929836",
"0.59890974",
"0.59841913",
"0.59590477",
"0.5954503",
"0.5944585",
"0.59282887",
"0.5887245",
"0.58797103",
"0.58727",
"0.58325326",
"0.5812588",
"0.5799866",
"0.5787102",
"0.57656413",
"0.57395",
"0.5737163",
"0.5734257",
"0.5720811",
"0.5719429",
"0.5700465",
"0.5694705",
"0.5694705",
"0.5694705",
"0.5694705",
"0.5692034",
"0.5688862",
"0.5686006",
"0.5683309",
"0.5675094",
"0.5672009",
"0.56467205",
"0.56304604",
"0.56261706",
"0.56061643",
"0.5603137",
"0.56020355",
"0.5591087",
"0.5588839",
"0.5587793",
"0.557185",
"0.557185",
"0.55685234",
"0.5549323",
"0.55294317",
"0.55205864",
"0.54906905",
"0.54906905",
"0.54830444",
"0.54657376",
"0.54646665",
"0.54606336",
"0.5450695",
"0.5438576",
"0.5429649",
"0.5423091",
"0.54068387",
"0.53968626",
"0.5386734",
"0.53749907",
"0.53747964",
"0.5371249",
"0.5371249",
"0.5369165",
"0.5368875",
"0.53687596",
"0.5364373",
"0.5357037",
"0.53501195",
"0.534148",
"0.534078",
"0.53362423",
"0.5334902",
"0.53256667",
"0.5316096",
"0.5298738",
"0.52742803",
"0.5260536",
"0.52575433",
"0.5250128",
"0.522455",
"0.5208354",
"0.52069193",
"0.5203101",
"0.52008766",
"0.51943713",
"0.5191582"
]
| 0.80508184 | 0 |
Checks if the algorithm specified exists and throws an exception if it does not | public static function validateAlgorithm($algorithm)
{
if (!in_array($algorithm, hash_algos(), true)) {
throw new InvalidArgumentException("The hashing algorithm specified ({$algorithm}) does not exist.");
}
return true;
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"function existsAlgorithm() {\n $response = save_pde_algorithm_command::UNDEFINED_ALGORITHM_NAME_CODE;\n if (array_key_exists(save_pde_algorithm_command::ALGORITHM_NAME_PARAM, $this->params)) {\n $fileName = $this->params[save_pde_algorithm_command::ALGORITHM_NAME_PARAM]; //fitxer pde\n $className = ucfirst(substr($fileName, 0, -4)); //Li treu la extensio .pde i capitalitza el string\n $response = $this->xmlManager->existsAlgorithm($className);\n }\n return $response;\n }",
"public static function checkAlgorithmSupported(string $algorithm)\n {\n if (strtolower($algorithm) === 'none') {\n throw new InsecureTokenException('Unsecure token are not supported: none algorithm provided');\n }\n \n if (! array_key_exists($algorithm, JWT::ALGORITHMS)) {\n throw new UnsupportedAlgorithmException('Invalid algorithm');\n }\n }",
"abstract public function getAlgorithm();",
"abstract protected function getAlgorithm();",
"function existsAlgorithm($className) {\n $response = \"\";\n $xmlFile = $this->getXmlFile();\n $doc = new DOMDocument;\n $stringXml = file_get_contents($xmlFile);\n $doc->loadXML($stringXml);\n $valid = $doc->validate();\n if ($valid) {\n $node = $doc->getElementById($className);\n }\n if ($valid && $node) {\n $response = save_pde_algorithm_command::ALGORITHM_EXISTS_CODE;\n } else {\n $response = save_pde_algorithm_command::ALGORITHM_NOT_EXISTS_CODE;\n }\n return $response;\n }",
"public static function getAlgorithm();",
"abstract protected function fetchAlgorithmMethodName();",
"public static function validateHashingAlgorithm($algorithm) {\n $algorithm = strtolower(trim($algorithm));\n if (!in_array($algorithm, Base32::$supportedAlgorithms))\n throw new TwoFactorAuthenticationException('Unsupported Algorithm: ' . $algorithm);\n return $algorithm;\n }",
"public function getAlgorithm();",
"public function checkOperationality()\n {\n if (!extension_loaded('gd')) {\n throw new SystemRequirementsNotMetException('Required Gd extension is not available.');\n }\n\n if (!function_exists('imagewebp')) {\n throw new SystemRequirementsNotMetException(\n 'Gd has been compiled without webp support.'\n );\n }\n }",
"public function alternativeExists()\n {\n }",
"public function hasAlgorithmParameter(): bool\n {\n return $this->has(Parameter\\JWKParameter::P_ALG);\n }",
"private function check_compatibility()\n\t{\n\t\tif ( ! extension_loaded( 'curl' ) || ! extension_loaded( 'json' ) )\n\t\t{\n\t\t\tthrow new CentrifugeException('There is missing dependant extensions - please ensure both cURL and JSON modules are installed');\n\t\t}\n\n\t\tif ( ! in_array( 'md5', hash_algos() ) )\n\t\t{\n\t\t\tthrow new CentrifugeException('md5 appears to be unsupported - make sure you have support for it, or upgrade your version of PHP.');\n\t\t}\n\n\t}",
"public function checkOperationality()\n {\n if (!extension_loaded('vips')) {\n throw new SystemRequirementsNotMetException('Required Vips extension is not available.');\n }\n\n if (!function_exists('vips_image_new_from_file')) {\n throw new SystemRequirementsNotMetException(\n 'Vips extension seems to be installed, however something is not right: ' .\n 'the function \"vips_image_new_from_file\" is not available.'\n );\n }\n\n // TODO: Should we also test if webp is available? (It seems not to be neccessary - it seems\n // that webp be well intergrated part of vips)\n }",
"protected function check() {\n\n // check for a valid GD lib installation \n if(!function_exists('gd_info')) raise('GD Lib is not installed');\n\n }",
"abstract public function getAlgorithmType(): string;",
"public function testInvalidSigningAlgorithm()\n {\n $this->expectException(\\UnexpectedValueException::class);\n $this->jsc->setSigningAlgorithm(\"none\");\n }",
"private final function CheckMhash()\r\n\t\t{\r\n\t\t\tif (!function_exists(\"mhash\"))\r\n\t\t\t\tCore::ThrowException(\"Cannot call mhash(). Mhash extension not installed?\", E_ERROR);\r\n\t\t}",
"abstract protected static function getHashAlgorithm() : string;",
"public static function check();",
"abstract function check();",
"abstract public function check();",
"protected function checkSomePhpOpcodeCacheIsLoaded() {}",
"public static function isValidEngine(): bool\n {\n return extension_loaded('openssl') && static::class != __CLASS__;\n }",
"public function checkOperationality()\n {\n $this->checkOperationalityExecTrait();\n\n if (!$this->isInstalled()) {\n throw new SystemRequirementsNotMetException('gmagick is not installed');\n }\n if (!$this->isWebPDelegateInstalled()) {\n throw new SystemRequirementsNotMetException('webp delegate missing');\n }\n }",
"public function loadAlgorithm($algorithmName){\n $algorithmsDir = Config::$algorithmsDir;\n $algorithmSufix = Config::$algorithmSufix;\n $algorithmFile = \"$algorithmsDir/$algorithmName.$algorithmSufix\";\n if(!file_exists($algorithmFile)) die(\"Oops! ALGORITHM NOT EXISTS '$algorithmFile'\\n\");\n \n require_once $algorithmFile;\n if(!class_exists($algorithmName)) die(\"Oops! Algorithm class should be named as '$algorithmName'\");\n $this->algorithm = new $algorithmName($this->map);\n }",
"protected function getValidAlgorithms()\n {\n return [\n Constants::SHA1,\n Constants::SHA256,\n Constants::SHA512,\n ];\n }",
"protected function check() {\n if (empty($this->method_map)\n || empty($this->service_url)\n ) {\n throw new Exception('Param or method map is empty');\n }\n }",
"public function getAlgorithm()\n {\n return $this->algorithm;\n }",
"public function getAlgorithm()\n {\n return $this->algorithm;\n }",
"public function testValidationCaseForInvalidRemotePublicKeyUsedForComputingOfSharedKey()\n {\n $protocol = $this->getCryptographicProtocolForTesting();\n\n $exchangeInformation = $protocol->generateExchangeRequestInformation();\n\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\RuntimeException::class);\n\n $protocol->computeSharedSecret($exchangeInformation->private, $exchangeInformation->private);\n } else {\n $hasThrown = null;\n\n try {\n $protocol->computeSharedSecret($exchangeInformation->private, $exchangeInformation->private);\n } catch (\\RuntimeException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }",
"protected function checkOperationality()\n {\n if (!function_exists('exec')) {\n throw new SystemRequirementsNotMetException('exec() is not enabled.');\n }\n }",
"public function testNotOperational1()\r\n {\r\n global $pretend;\r\n\r\n $gd = $this->createGd('test.png');\r\n self::resetPretending();\r\n\r\n $pretend['functionsNotExisting'] = ['imagewebp'];\r\n $this->expectException(SystemRequirementsNotMetException::class);\r\n $gd->checkOperationality();\r\n }",
"private function getHashAlgorithm(string $algorithm) : string\n {\n switch ($algorithm) {\n case Algorithms::SHA256:\n return 'sha256';\n case Algorithms::SHA384:\n return 'sha384';\n case Algorithms::SHA512:\n return 'sha512';\n default:\n throw new InvalidArgumentException(\"Algorithm \\\"$algorithm\\\" is not a hash algorithm\");\n }\n }",
"private function check()\n {\n $valid = true;\n\n // @todo Use manifest ?\n // - Check mains layout exists (home + page?)\n\n if (! $valid) {\n // @todo Create an explained Exception\n throw new \\Exception(sprintf('%s named \"%s\" is not valid', __CLASS__, $this->getName()));\n }\n }",
"public function hasException(): bool;",
"public function checkOperationality()\n {\n if (!extension_loaded('Gmagick')) {\n throw new SystemRequirementsNotMetException('Required Gmagick extension is not available.');\n }\n\n if (!class_exists('Gmagick')) {\n throw new SystemRequirementsNotMetException(\n 'Gmagick is installed, but not correctly. The class Gmagick is not available'\n );\n }\n\n $im = new \\Gmagick($this->source);\n\n if (!in_array('WEBP', $im->queryformats())) {\n throw new SystemRequirementsNotMetException('Gmagick was compiled without WebP support.');\n }\n }",
"function check_implementation() {\r\n\r\n\t\t$xtea = new XTEA(\"\");\r\n\t\t$vectors = array(\r\n\t\t\tarray(array(0x00000000,0x00000000,0x00000000,0x00000000), array(0x41414141,0x41414141), array(0xed23375a,0x821a8c2d)),\r\n\t\t\tarray(array(0x00010203,0x04050607,0x08090a0b,0x0c0d0e0f), array(0x41424344,0x45464748), array(0x497df3d0,0x72612cb5)),\r\n\r\n\t\t);\r\n\r\n\t\t//Correct implementation?\r\n\t\t$correct = true;\r\n\t\t//Test vectors, see http://www.schneier.com/code/vectors.txt\r\n\t\tforeach($vectors AS $vector) {\r\n \t$key = $vector[0];\r\n\t\t\t$plain = $vector[1];\r\n\t\t\t$cipher = $vector[2];\r\n\r\n\t\t\t$xtea->key_setup($key);\r\n\t\t\t$return = $xtea->block_encrypt($vector[1][0],$vector[1][1]);\r\n\r\n\t\t\tif((int)$return[0] != (int)$cipher[0] || (int)$return[1] != (int)$cipher[1])\r\n\t\t\t\t$correct = false;\r\n\r\n\t\t}\r\n\r\n\t\treturn $correct;\r\n\r\n\t}",
"public function getAlgorithm()\n {\n return $this->_algorithm;\n }",
"public function getAlgorithm() {\n $signer = $this->header->getSigner();\n if ($signer !== false) {\n return $signer->getAlgorithm();\n }\n return false;\n }",
"function hashExists($hash);",
"public function check();",
"public function check();",
"public function check();",
"public function check();",
"public function check();",
"public function checkOperationality()\n {\n $this->checkOperationalityExecTrait();\n\n if (!$this->isInstalled()) {\n throw new SystemRequirementsNotMetException(\n 'imagemagick is not installed (cannot execute: \"' . $this->getPath() . '\")'\n );\n }\n if (!$this->isWebPDelegateInstalled()) {\n throw new SystemRequirementsNotMetException('webp delegate missing');\n }\n }",
"public function check()\n\t{\n\t\t$output = false;\n\n\t\tif($this->storage == self::STORAGE_FILE)\n\t\t{\n\n\t\t}\n\t\telseif($this->storage == self::STORAGE_APC)\n\t\t{\n\t\t\t$output = apc_exists($this->key);\n\t\t}\n\t\telseif($this->storage == self::STORAGE_REDIS)\n\t\t{\n\t\t\tif(self::$redis != null)\n\t\t\t\t$output = self::$redis->exists($key);\n\t\t}\n\t\telseif($this->storage == self::STORAGE_MEMCACHED)\n\t\t{\n\t\t\tif(self::$memcached != null)\n\t\t\t\t$output = self::$memcached->get($key) !== false;\n\t\t}\n\t\telse\n\t\t{\n\t\t\t$this->storageException();\n\t\t}\n\n\t\treturn $output;\n\t}",
"public function checkIfEssentialConfigurationExists() {}",
"public function testGetKeyUriWithOptionHasOtherAlgorithm() {\n // the options have the algorithm key.\n $this->assertEquals(\n 'otpauth://hotp/[email protected]?secret=secret&counter=123&algorithm=SHA2',\n GoogleAuthenticator::getKeyUri('hotp', '[email protected]', 'secret', 123, ['algorithm' => 'SHA2'])\n );\n }",
"public function testNonExistentSystem()\n {\n $result = DALBaker::loadQueriesXml('InvalidSystem');\n PHPUnit_Framework_Assert::assertNull($result);\n\n }",
"private function checkForModuleOrFunctionException():void\n {\n // check for module and function error\n if ($this->hasError()) {\n //check for bad module\n $this->moduleExceptionChecker();\n\n //check for bad function\n $this->functionExceptionChecker();\n }\n }",
"public function checkOperationality()\n {\n\n $apiKey = $this->getKey();\n\n if ($apiKey === false) {\n if (isset($this->options['key'])) {\n throw new InvalidApiKeyException(\n 'The \"key\" option has been renamed to \"api-key\" in webp-convert 2.0. ' .\n 'You must change the configuration accordingly.'\n );\n }\n\n throw new InvalidApiKeyException('Missing API key.');\n }\n\n if (strlen($apiKey) < 20) {\n throw new InvalidApiKeyException(\n 'Api key is invalid. Api keys are supposed to be 32 characters long - ' .\n 'the provided api key is much shorter'\n );\n }\n\n // Check for curl requirements\n $this->checkOperationalityForCurlTrait();\n\n $keyStatus = self::getKeyStatus($apiKey);\n switch ($keyStatus) {\n case 'great':\n break;\n case 'exceeded':\n throw new ConverterNotOperationalException('Quota has exceeded');\n break;\n case 'invalid':\n throw new InvalidApiKeyException('Api key is invalid');\n break;\n }\n }",
"private function check() {\n\t\t$module = $this->packageService->getModule();\n\t\tif ($module === null) {\n\t\t\tthrow new \\DomainException('No module definition found in composer.json - please run `keeko init`.');\n\t\t}\n\t}",
"private function check() {\n\t\t$module = $this->packageService->getModule();\n\t\tif ($module === null) {\n\t\t\tthrow new \\DomainException('No module definition found in composer.json - please run `keeko init`.');\n\t\t}\n\t}",
"protected function check() {\n if (empty($this->method_map)\n || empty($this->param)\n || empty($this->service_url)\n ) {\n throw new Exception('Param or method map is empty');\n }\n }",
"function hpcman_hash($algo, $p) {\n switch($algo) {\n case'cleartext':\n return $p;\n break;\n case 'crypt':\n return base64_encode(crypt($p, $p));\n break;\n case 'md5':\n return md5($p);\n break;\n case 'ssha':\n $salt = \"CCCC\";\n return base64_encode(pack(\"H*\", sha1($p.$salt)).$salt);\n break;\n case 'sha256':\n $crypt_salt = '$5$' . gen_salt('crypt-sha256') . '$';\n return base64_encode(crypt($p, $crypt_salt));\n }\n\n return false;\n}",
"private final function CheckMcrypt()\r\n\t\t{\r\n\t\t\tif (!function_exists(\"mcrypt_module_open\"))\r\n\t\t\t\tCore::ThrowException(\"Cannot call mcrypt_module_open(). Mcrypt extension not installed?\", E_ERROR);\r\n\t\t}",
"private function getOpenSslDigestAlgo(int $algo): string\n {\n switch ($algo) {\n case OPENSSL_ALGO_SHA1:\n return 'sha1';\n case OPENSSL_ALGO_SHA224:\n return 'sha224';\n case OPENSSL_ALGO_SHA256:\n return 'sha256';\n case OPENSSL_ALGO_SHA384:\n return 'sha384';\n case OPENSSL_ALGO_SHA512:\n return 'sha512';\n default:\n throw new XmlSignatureValidatorException(\n \"Cannot verify: Unsupported Algorithm <$algo>\"\n );\n }\n }",
"function exists()\n {\n return false;\n }",
"public function check() {}",
"abstract public function exists();",
"abstract public function exists();",
"public function checkFunctionExists($function): bool\n {\n return function_exists($function);\n }",
"function isCompilable() ;",
"public static function check_required_ext() {\r\n $shmop = extension_loaded('shmop');\r\n $sysvsem = extension_loaded('sysvsem');\r\n if ($shmop && $sysvsem) {\r\n return true;\r\n }\r\n $missing = array();\r\n if (!$shmop) {\r\n array_push($missing, 'shmop');\r\n }\r\n if (!$sysvsem) {\r\n array_push($missing, 'sysvsem');\r\n }\r\n if (count($missing) == 1) {\r\n throw new Exception('The PHP extension ' . $missing[0] . ' required by class ' . __CLASS__ . ' is not loaded or built into PHP.');\r\n }\r\n throw new Exception('The PHP extensions ' . implode(' and ', $missing) . ' required by class ' . __CLASS__ . ' are not loaded or built into PHP.');\r\n }",
"abstract public function getAlgorithmWithUnit(): AlgorithmWithUnit;",
"public function checkOperationality()\n {\n if (!extension_loaded('imagick')) {\n throw new SystemRequirementsNotMetException('Required iMagick extension is not available.');\n }\n\n if (!class_exists('\\\\Imagick')) {\n throw new SystemRequirementsNotMetException(\n 'iMagick is installed, but not correctly. The class Imagick is not available'\n );\n }\n\n $im = new \\Imagick();\n if (!in_array('WEBP', $im->queryFormats('WEBP'))) {\n throw new SystemRequirementsNotMetException('iMagick was compiled without WebP support.');\n }\n }",
"function inputExists(string $inputName): bool\n{\n return false;\n}",
"public function testThrowsExceptionWhenMethodDoesNotExist()\n {\n $method = self::NONEXISTENT_METHOD;\n\n $this->decapsulator->$method(4);\n }",
"public function getHash(string $algorithm): string\n {\n if ($this->exists()) {\n return hash_file($algorithm, $this->getPath());\n }\n\n return hash($algorithm, $this->getPath());\n }",
"public function getAlgorithm() : string\n {\n return self::ALGORITHM;\n }",
"protected function getHashAlgo()\n {\n return self::INTERNAL_ALGORITHM;\n }",
"public function checkIfPackageExists()\n {\n if (is_dir($this->packagePath())) {\n throw new RuntimeException('Package already exists');\n }\n }",
"public function checkOperationality()\n {\n }",
"protected function checkIfLanguagesExist() {}",
"public function test_mod_lti_create_tool_type_nonexistant_file() {\n $this->expectException('moodle_exception');\n $type = mod_lti_external::create_tool_type($this->getExternalTestFileUrl('/doesntexist.xml'), '', '');\n }",
"public function Exists();",
"public function hasError();",
"public function hasError();",
"public function hasError();",
"public function hasError();",
"public function testValidationCaseForInvalidAsymmetricKeyPairAlgorithmType()\n {\n $generator = $this->getTokenGeneratorForTesting();\n\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n $generator->getAsymmetricKeyPair(512, ['wrong']);\n } else {\n $hasThrown = null;\n\n try {\n $generator->getAsymmetricKeyPair(512, ['wrong']);\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }",
"public function checkFunctionExists($function)\n\t{\n\t\treturn function_exists($function);\n\t}",
"public function getHashFile($algorithm, $path, $cache = false);",
"public function check() {\n\t\treturn file_exists($this->getFilePath());\n\t}",
"abstract function isSupported(): bool;",
"public static function scriptCanBeDecoded($packagename=\"Professional\"){\n\t\t\n//\t\tif(!empty(self::$ioncubeWorks)){\n//\t\t\treturn true;\n//\t\t}\n\t\t\n\t\t\n\n\t\t$majorVersion = GO::config()->getMajorVersion();\n\t\n\t\tswitch($packagename){\n\t\t\tcase 'Billing':\n\t\t\t\t$className = 'LicenseBilling';\n\t\t\t\t$licenseFile = 'billing-'.$majorVersion.'-license.txt';\n\t\t\t\tbreak;\n\n\t\t\tcase 'Documents':\n\t\t\t\t$className = 'LicenseDocuments';\n\t\t\t\t$licenseFile = 'documents-'.$majorVersion.'-license.txt';\n\t\t\t\tbreak;\n\n\t\t\tdefault:\n\n\t\t\t\t$className = 'License';\n\t\t\t\t$licenseFile = 'groupoffice-pro-'.$majorVersion.'-license.txt';\n\t\t\t\t\n\t\t\t\t\n\t\t\tbreak;\n\t\t\n//\t\t\tdefault:\n//\t\t\t\tthrow new Exception(\"Unknown package \".$packagename);\n\t\t}\n\t\t\n\t\tif(isset(self::$ioncubeChecks[$className])) {\n\t\t\treturn self::$ioncubeChecks[$className];\n\t\t}\n\n\t\t$path = GO::config()->root_path.'modules/professional/'.$className.'.php';\n\t\t\n\t\t\n\t\tif(!file_exists($path)){\n\t\t\tself::$ioncubeChecks[$className] = false;\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t//echo $path;\n\n\t\t//check data for presence of ionCube in code.\n\t\t$data= file_get_contents($path, false, null, 0, 100);\t\t\n\t\tif(strpos($data, 'ionCube')===false){\t\t\n\t\t\tself::$ioncubeChecks[$className] = true;\n\t\t\treturn true;\n\t\t}\n\n\t\tif(!extension_loaded('ionCube Loader')){\n\t\t\tself::$ioncubeChecks[$className] = false;\n\t\t\treturn false;\n\t\t}\n\n\n//\t\t$lf = self::getLicenseFile();\n\t\t\n\t\t$file = new \\GO\\Base\\Fs\\File(GO::config()->root_path.$licenseFile);\n\t\t\n\t\t//Empty license file is provided in download so we must check the size.\n\t\tif(!$file->exists()){\n\t\t\tself::$ioncubeChecks[$className] = false;\n\t\t\treturn false;\n\t\t}\n\t\t\n\t\t$fullClassName = \"\\\\GO\\\\Professional\\\\\".$className;\n\n\t\t$check = self::$ioncubeChecks[$className] = $fullClassName::check();\n\t\t\n//\t\tvar_dump($check);\n\t\t\n\t\treturn $check;\n\t\t\n//\t\tself::$ioncubeWorks = true;\n\t\t\n//\t\treturn self::$ioncubeWorks;\n\t\t\n\t}",
"public function hash($algorithm) {\n try {\n if ( in_array($algorithm, hash_algos()) ) {\n $this->_value = hash($algorithm, $this->_value);\n \n return $this;\n }\n throw new \\Exception(\"Algorithm \\\"$algorithm\\\" not found!\");\n } catch (\\Exception $e) {\n print 'Exception detected! '. $e->getMessage();\n }\n \n return $this;\n }",
"public function checkIfCompletelyResolved(): void;",
"protected function exists() {}",
"public static function installToolEnableFileExists() {}",
"private function validate_exists() {\n\t\tif ( ! $this->exists ) {\n\t\t\tthrow new Exception( self::E_WC_COUPON_NOT_EXIST );\n\t\t}\n\t}",
"public function check(): void;",
"public function check(): void;",
"public function testValidationCaseForNonStringSecretKeyPassedForEncryption()\n {\n // Backward compatible for different versions of PHPUnit\n if (method_exists($this, 'expectException')) {\n $this->expectException(\\InvalidArgumentException::class);\n\n NativeRc4::encryptData(['wrong'], '');\n } else {\n $hasThrown = null;\n\n try {\n NativeRc4::encryptData(['wrong'], '');\n } catch (\\InvalidArgumentException $exception) {\n $hasThrown = !empty($exception->getMessage());\n } catch (\\Exception $exception) {\n $hasThrown = $exception->getMessage();\n }\n\n $this->assertTrue($hasThrown);\n\n return;\n }\n }",
"static function unittest_functionExists () {\n PhlintTest::assertIssues('\n if (function_exists(\"foo\"))\n foo();\n foo();\n ', [\n 'Unable to invoke undefined *foo()* on line 3.',\n ]);\n }",
"protected function checkIfNoConflictingExtensionIsInstalled() {}",
"protected function checkIfDbalExtensionIsInstalled() {}",
"public function checkConvertability()\n {\n $mimeType = $this->getMimeTypeOfSource();\n switch ($mimeType) {\n case 'image/png':\n if (!function_exists('imagecreatefrompng')) {\n throw new SystemRequirementsNotMetException(\n 'Gd has been compiled without PNG support and can therefore not convert this PNG image.'\n );\n }\n break;\n\n case 'image/jpeg':\n if (!function_exists('imagecreatefromjpeg')) {\n throw new SystemRequirementsNotMetException(\n 'Gd has been compiled without Jpeg support and can therefore not convert this jpeg image.'\n );\n }\n }\n }"
]
| [
"0.6767224",
"0.6246885",
"0.5884927",
"0.58649874",
"0.5799624",
"0.5699917",
"0.55791867",
"0.5575128",
"0.54741436",
"0.54621595",
"0.5425891",
"0.5391576",
"0.5338973",
"0.52869576",
"0.5239073",
"0.52157265",
"0.5211193",
"0.5199265",
"0.5195935",
"0.5158558",
"0.5131345",
"0.5123556",
"0.51057416",
"0.5100654",
"0.50935125",
"0.5092218",
"0.5071865",
"0.5052312",
"0.50382245",
"0.50382245",
"0.5017119",
"0.5006479",
"0.5005477",
"0.4986109",
"0.49860975",
"0.49857444",
"0.49807423",
"0.49717107",
"0.49608484",
"0.4955041",
"0.4948031",
"0.49408847",
"0.49408847",
"0.49408847",
"0.49408847",
"0.49408847",
"0.49340442",
"0.49158055",
"0.4908912",
"0.49052635",
"0.48888642",
"0.48787454",
"0.486725",
"0.4845372",
"0.4845372",
"0.4844918",
"0.48409647",
"0.4839506",
"0.48306438",
"0.48071456",
"0.4801958",
"0.480006",
"0.480006",
"0.47738078",
"0.476562",
"0.47588938",
"0.47544265",
"0.47415262",
"0.47381395",
"0.47305164",
"0.47265828",
"0.47233444",
"0.46969852",
"0.46946305",
"0.4690763",
"0.46906412",
"0.46878195",
"0.46864182",
"0.46863666",
"0.46863666",
"0.46863666",
"0.46863666",
"0.46780574",
"0.4676089",
"0.46745312",
"0.4650419",
"0.4648687",
"0.46457446",
"0.46438947",
"0.46431404",
"0.46339837",
"0.46308717",
"0.46287373",
"0.462155",
"0.462155",
"0.4617877",
"0.4617169",
"0.46081242",
"0.46067783",
"0.46058968"
]
| 0.5802941 | 4 |
Implementation specific tests here | public function testPreventsCRLFAttackViaFromString()
{
$this->expectException(InvalidArgumentException::class);
UserAgent::fromString("User-Agent: xxx\r\n\r\nevilContent");
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected abstract function test();",
"protected abstract function test();",
"protected function testObjects() {\n }",
"abstract public function test();",
"abstract public function test();",
"protected function test9() {\n\n }",
"public function testSpecial(): void {\n\t}",
"protected function testObject() {\n }",
"abstract protected function setup();",
"public function testGetOrderPackData()\n {\n }",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"protected function setUp() {}",
"abstract protected function constructTestHelper();",
"abstract public function testConstructorAndProperties(): void;"
]
| [
"0.69990027",
"0.69990027",
"0.6522529",
"0.6476858",
"0.6476858",
"0.639919",
"0.6389799",
"0.6386777",
"0.63197017",
"0.626224",
"0.6260342",
"0.6260342",
"0.6260342",
"0.6260342",
"0.6260342",
"0.6260342",
"0.6260342",
"0.6260342",
"0.6260342",
"0.6260342",
"0.6260342",
"0.6260342",
"0.6260342",
"0.6260342",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.62584573",
"0.6257411",
"0.6257411",
"0.6256996",
"0.6256996",
"0.6256996",
"0.6256996",
"0.6256996",
"0.6256996",
"0.6256996",
"0.6256996",
"0.6256996",
"0.6256996",
"0.6256996",
"0.6256996",
"0.6256996",
"0.6256996",
"0.6256996",
"0.62459296",
"0.6224441"
]
| 0.0 | -1 |
Bind data to the view. | public function compose(View $view): void
{
$view->with('socials', $this->socialRepository->getSorted());
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"protected function getViewData() {\n\n }",
"protected function renderData()\n {\n $this->view->baseUrl = $this->_baseUrl;\n $this->view->staticUrl = Zend_Registry::get('static');\n $this->view->version = Zend_Registry::get('version');\n $this->view->hostUrl = Zend_Registry::get('host');\n $this->view->photoUrl = Zend_Registry::get('photo');\n $this->view->adminUser = $this->_user;\n\n $this->view->isSuperUser = $this->_isSuperUser;\n $this->view->isViewer = $this->_isViewer;\n $this->view->isWatcher = $this->_isWatcher;\n $this->view->isEditor = $this->_isEditor;\n }",
"public function dataBind(&$dataSource);",
"protected function renderData()\n {\n $data = $this->loadData();\n\n $rows = $data->getRows() ?: [];\n $limit = $this->property('limit') ?: 0;\n $this->vars['rows'] = $limit > 0\n ? array_slice($rows, 0, $limit)\n : $data->getRows();\n\n $this->vars['total'] = $data->getTotals();\n }",
"public function render()\n {\n $tempData = $this->getData();\n $this->listData = $tempData;\n\n $data = get_object_vars($this);\n $this->appData = $data;\n\n //report via ray() if turned on\n if ($this->debugWithRay) {\n $this->showDebugOutput();\n }\n\n //make list view up internally\n return view('lwcrud::layouts.lw-base', ['listData' => $this->listData, 'appData' => $this->appData]);\n }",
"protected function commonViewData() {\n //print \"Hello\";\n $this->viewModel->set(\"mainMenu\", array(\"Home\" => \"home\", \"Help\" => \"help\"));\n $this->viewModel->set(\"Basepath\", \"http://localhost/~georginfanger/georginfanger/\");\n }",
"public function initializeView() {}",
"public function initializeView() {}",
"function run() {\r\n $this->view->data=$this->model->run();\r\n }",
"protected function renderData()\n {\n $data = $this->loadData();\n\n $rows = $data->getRows() ?: [];\n $number = $this->property('number') ?: 0;\n $this->vars['rows'] = $number > 0\n ? array_slice($rows, 0, $number)\n : $data->getRows();\n\n $this->vars['total'] = $data->getTotalsForAllResults()[$this->property('metric')];\n }",
"protected function initialize()\n {\n $this->viewData['list_sb'] = $this->list_sb = SkeletalBone::orderBy('name', 'asc')->pluck('name', 'id');\n $this->viewData['list_side'] = $this->list_side = SkeletalElement::$side;\n $this->viewData['list_completeness'] = $this->list_completeness = SkeletalElement::$completeness;\n $this->viewData['list_lab'] = $this->list_lab = Lab::where('type', 'Isotope')->get()->pluck('full_name', 'id');\n $this->viewData['list_status'] = $this->list_status = IsotopeBatch::$status;\n $this->viewData['batchStatus'] = $this->batchStatus = 'Open';\n $this->viewData['initialshow'] = $this->initialshow = false;\n }",
"public function view(){\n\t\t$this->buildListing();\n\t}",
"public function display() {\n $data = $this->container->get('data');\n $people = $data->load('people');\n $this->render('people', ['people' => $people]);\n }",
"public function renderData();",
"protected function tblProjects_Bind() {\n\t\t// We load the data source, and set it to the datagrid's DataSource parameter\n\t\t$this->tblProjects->DataSource = Project::LoadAll();\n\t}",
"function bindObjects()\r\n\t{\r\n\t $this->bindEventObject();\r\n\t $this->bindRecurringObject();\r\n\t $this->bindSeriesObject();\r\n\t $this->bindVenueObject();\r\n\t\t$this->image_src = $this->getImage('src');\r\n\t\t$this->link_view = 'index.php?option=com_calendar&view=events&task=view&id=' . $this->event_id . '&instance_id=' . $this->eventinstance_id;\r\n\t\t$this->bindPrimaryCategoryObject();\r\n\t\t$this->bindActionButtonObject();\r\n\t}",
"protected function initializeView() {\n\t}",
"public function getViewVars();",
"public function getViewVars();",
"public function bindToController()\n {\n if ($this->controller->widget === null) {\n $this->controller->widget = new stdClass;\n }\n\n $this->controller->widget->{$this->alias} = $this;\n }",
"public function bindData($data = array()) {\r\n\t\tparent::bindData($data);\r\n\r\n\t\t// add size to data\r\n $this->_updateFileSize();\r\n\t}",
"public function getView() {}",
"public function getView() {}",
"public function view() {\n\n // Only allow AJAX requests\n if (!$this->input->is_ajax_request()) {\n return show_404();\n }\n\n // Retrieve request\n $gridIO = (new GridHelper())\n ->parseRequest($this->input);\n\n // Load requested data\n $articles = (new ExtArticlesModel())->init()\n ->set($gridIO->getRequest())\n ->load();\n\n // Prepare response ...\n $gridIO->setTotal($articles->getTotalCount($gridIO));\n foreach ($articles->toArray() as $article) {\n\n $gridIO->addRow([\n \"id\" => $article->get(\"id\"),\n \"title\" => $article->get(\"title\"),\n \"author\" => $article->getAuthor()->get(\"username\"),\n \"published\" => PermitHelper::validPermitExists(PermitTypes::ARTICLE, $article->get(\"id\"))\n ]);\n\n }\n\n // ... and output it\n $gridIO->generateResponse($this->output);\n\n }",
"public function getViewData()\n {\n return $this->modelVar;\n }",
"protected function render(){\n //render view\n \n }",
"public function viewData(array $arguments = []);",
"public function dtgClassVariable_Bind() {\n\t\t\t$this->dtgClassVariable->TotalItemCount = ClassVariable::CountAll();\n\n\t\t\t$objClauses = array();\n\t\t\tif ($objClause = $this->dtgClassVariable->OrderByClause)\n\t\t\t\tarray_push($objClauses, $objClause);\n\t\t\tif ($objClause = $this->dtgClassVariable->LimitClause)\n\t\t\t\tarray_push($objClauses, $objClause);\n\t\t\t$this->dtgClassVariable->DataSource = ClassVariable::LoadAll($objClauses);\n\t\t}",
"private function init()\n\t{\n\t\tif(! $this->authUser = $this->auth->check_login()){\n\t\t\t$this->authUser->logged = false;\n\t\t}\n\t\t// Fill user object in view \n\t\t$this->data['authUser'] = $this->authUser;\n\n\t\t$this->data['menugang'] = $this->recipesModel->menugang();\n\t\t$this->data['hoofdgroup'] = $this->recipesModel->hoofdgroup();\n\t\t$this->data['technique'] = $this->recipesModel->technique();\n\t\t$this->data['kitchen'] = $this->recipesModel->kitchen();\n\t\t$this->data['opening'] = $this->recipesModel->opening();\n\t\t$this->data['dieten'] = $this->recipesModel->dieten();\n\t}",
"public function bind (array $data) : TemplateInterface\n {\n $this->data = array_merge($this->data, $data);\n return $this;\n }",
"protected function buildView()\n {\n $table = $this->columns;\n\n $columns = $table->map(function ($column) {\n return $column->column.':'.$column->method.','.$column->caption;\n })->implode('|');\n\n $dropdown = $table->filter(function ($column) {\n return true == $column->is_foreign;\n })->transform(function ($column) {\n return $column->column.':'.$column->table_foreign;\n })->implode('|');\n\n $this->view = [\n 'name' => $this->module->name,\n '--columns' => $columns,\n '--controller' => $this->class,\n '--request' => $this->class,\n '--module' => $this->module->id,\n '--dropdown' => $dropdown,\n '--icon' => $this->module->icon,\n ];\n }",
"function dataBind($arr){\n\t\t// set the fields to nothing\n\t\t$this->fields = array();\n\t\t// loop the field names and add them\n\t\tforeach($arr as $key => $value){\n $this->addField($key);\n }\n // set the rows to nothing\n $this->rows = array();\n // loop each row and add it\n\t\tfor ($r=0; $r<count($arr); $r++){\n\t\t\t$this->addRow($arr[$r]);\n\t\t}\n\t}",
"public function dtgParameter_Bind() {\n\t\t\t$this->dtgParameter->TotalItemCount = Parameter::CountAll();\n\n\t\t\t$objClauses = array();\n\t\t\tif ($objClause = $this->dtgParameter->OrderByClause)\n\t\t\t\tarray_push($objClauses, $objClause);\n\t\t\tif ($objClause = $this->dtgParameter->LimitClause)\n\t\t\t\tarray_push($objClauses, $objClause);\n\t\t\t$this->dtgParameter->DataSource = Parameter::LoadAll($objClauses);\n\t\t}",
"public function bindVariables() {\n foreach($this->response as $key => $val) {\n $this->response_source->bindVariable($key, $val);\n }\n }",
"public function bind()\n {\n foreach ($this->columns as $column) {\n $column->bind();\n }\n }",
"public function refresh() {\n \tif( $this->fetchData ) {\n \t\t\n \t\t// send data to view\n \t\t$this->set(array(\n \t\t\t'data' => $this->Reading->find('all'),\n \t\t\t'_serialize', array('data')));\n \t}\n\n }",
"public function data()\n {\n return view('site_preparation.data');\n }",
"function render(){\r\n $productos2 = $this->model->get();\r\n $this->view->productos = $productos;\r\n $this->view->render('burger/index');\r\n }",
"abstract protected function renderView();",
"public function compose(View $view)\n {\n $view->with('data', [\n 'listOfUsers' => $this->userRepository->listAllUsers(true),\n // 'userFriends' => $this->user->friends(),\n ]);\n }",
"public function viewAction()\n {\n $id = $this->_getPrimaryId();\n $row = $this->_getRow($id);\n\n $this->view->row = $row;\n }",
"public function index() {\r\n $data['data'] = $this->MemberModel->getData(3); //executes function from model returns rexcord set\r\n $this->load->view('MemberView', $data); //directs and passes data from the databse to the view\r\n }",
"protected function setView()\n {\n $view = 'Src\\Modules\\\\' . $this->module_name . '\\Views\\\\' . $this->class . 'View';\n $this->view = new $view;\n \n $this->view->setData( $this->model->getData() );\n \n $this->view->run();\n }",
"function render(){\n $productos = $this->model->get();\n $this->view->productos = $productos;\n $this->view->render('ayuda/index');\n }",
"public function display()\n \t{\n \t\t$this->assign(\"__view\", $this->_view);\n \t\tparent::display();\n \t}",
"public function loadData()\n\t{\n\t\t$this->load->view('data_page');\n\t}",
"public function bind($data)\r\n {\r\n if ($data) {\r\n foreach ($data as $key => $value) {\r\n $this->$key = $value;\r\n }\r\n }\r\n }",
"public function getView(){ }",
"public function loadView ()\n {\n $data['category'][0] = $this->utility->getFieldsCategory('Programming model');\n $data['category'][1] = $this->utility->getFieldsCategory('General testing characteristics');\n $data['category'][2] = $this->utility->getFieldsCategory('Concurrent testing characteristics');\n $data['category'][3] = $this->utility->getFieldsCategory('Testing tool support');\n\n $data['name'][0] = 'Study identification';\n $data['name'][1] = 'Programming model';\n $data['name'][2] = 'General testing characteristics';\n $data['name'][3] = 'Concurrent testing characteristics';\n $data['name'][4] = 'Testing tool support';\n\n $count = 0;\n foreach($data['category'] as $fields) {\n $count2 = 0;\n foreach($fields as $field) {\n $data['category'][$count][$count2]['typeheadJS'] = $this->technique->singleTableInfo (ucfirst($field['html_id']));\n\n $tempExample = $this->technique->singleTableInfo (ucfirst($field['html_id']));\n $countExample = 0;\n $example = \"\";\n\n foreach ($tempExample as $value) {\n if (strcasecmp($value, \"No Information\") != 0 && strcasecmp($value, \"Not informed\") != 0) {\n $example .= ucfirst($value) . ', ';\n if ($countExample++ >= 3) break;\n }\n }\n $data['category'][$count][$count2]['example']=rtrim($example,\", \");\n\n $count2++;\n }\n $count++;\n }\n // echo \"<pre>\";\n // print_r($data);\n // echo \"</pre>\";\n \n $this->load->view('insert/insert_page', $data);\n }",
"public function _dados_para_view() {\n $data = get_object_vars($this);\n unset($data['controller']);\n unset($data['components']);\n unset($data['Session']);\n unset($data['RequestHandler']);\n $this->controller->set('seguranca_data', $data);\n }",
"public function render() {\n\n\t\t$context = $this->options;\n\t\t$context = $this->load($context);\n\n\t\textract($context);\n\n\t\tinclude __DIR__ . '/../views/' . $this->template();\n\t}",
"public function updateView()\n {\n \n }",
"public function getView()\n {\n }",
"function display() {\n\t\t$view = &$this->getView();\n\t\t$view->display();\n\t}",
"public function render()\n {\n return view('components.data-table');\n }",
"public function generateView()\n {\n foreach ($this->cds as $cd)\n {\n $view = new View('CdItem');\n $view->setValue('TITLE', $cd->getTitle());\n $view->setValue('ARTIST', $cd->getArtist());\n $view->setValue('GENRE', $cd->getGenre());\n $view->setValue('CREATION_YEAR', $cd->getCreationYear());\n $view->display();\n }\n }",
"public function render()\n\t{\n\t\t$template = $this->template;\n\t\t$template->setFile( __DIR__ . '/dataGrid.latte' );\n\n\t\t$template->grid = $this;\n\t\t$template->stencils = $this->stencils;\n\t\t$template->actionWidth = $this->actionWidth;\n\t\t$template->actitle = $this->actitle;\n\t\t$template->acfooter = $this->acfooter;\n\t\t$template->cmd = self::CMD;\n\t\t$template->labels = $this->labels;\n\t\t$template->columns = $this->columns;\n\t\t$template->key = $this->key;\n\t\t$template->isSorting = $this->isSorting();\n\t\t$template->isFiltering = $this->isFiltering();\n\t\t$template->isAdding = $this->isAdding();\n\t\t$template->isRemoving = $this->isRemoving();\n\t\t$template->isEditing = $this->isEditing();\n\t\t$template->hasActions = $this->hasActions();\n\t\t$template->sortable = $this->sortable;\n\t\t$template->sorting = $this->sorting;\n\t\t$template->filtering = $this->filtering;\n\t\t$template->id = $this->id;\n\t\t$template->pgbtn = $this->getPagerButtons();\n\t\t$template->currentPage = $this->getCurrentPage();\n\t\t$template->rowsPerPage = $this->getRowsPerPage();\n\t\t$template->pageCount = $this->getPageCount();\n\n\t\tif ( count( $this->dataSnippet ) ) $template->data = $this->dataSnippet;\n\t\telse $template->data = $this->getData();\n\n\t\t$template->render();\n\t}",
"public function getView();",
"public function compose(View $view)\n {\n $view->with('plantas', $this->plantaRepository->getArrayParaSelect());\n }",
"public function get_data() {\n return $this->_view;\n }",
"public function index()\n {\n $data['row'] = $this->items_m->get();\n $this->template->load('template', 'product/item/item_data', $data);\n }",
"public function index() {\n $data = $this->Post->find('all');\n $this->set('data', $data);\n }",
"function View($id)\r\n\t\t{\r\n\t\t\t$this->data[$this->name] = $this->controller_model->Get($id);\r\n\t\t}",
"function bind($tag_name, $data)\r\n {\r\n if (is_array($data)) {\r\n foreach ($data as $name => $val) {\r\n $this->set($name, $val);\r\n }\r\n } else {\r\n $this->set($tag_name, $data);\r\n\r\n }\r\n }",
"function view_items () {\r\n if ($this->ShouldUseAjax()) {\r\n if (!isset($this->params['form']['type']) || !isset($this->params['form']['typeId'])) {\r\n $this->autoRender = false;\r\n IERR('Form data incomplete.');\r\n return AJAX_ERROR_CODE;\r\n }\r\n\r\n $type = $this->params['form']['type'];\r\n $typeId = $this->params['form']['typeId'];\r\n\r\n if ($type == 'weapon')\r\n $typeName = $this->Item->WeaponType->GetWeaponTypeName($typeId);\r\n elseif ($type == 'armor')\r\n $typeName = $this->Item->ArmorType->GetArmorTypeName($typeId);\r\n\r\n\r\n $userItemIds = $this->Item->UserItem->ItemCatalogEntry->GetUserItemIdsByType($type, $typeId);\r\n $items = $this->Item->UserItem->ItemCatalogEntry->GetItemEntries($userItemIds);\r\n\r\n $this->set('items', $items);\r\n $this->set('itemType', $type);\r\n $this->set('typeName', $typeName);\r\n $this->set('itemTypeId', $typeId);\r\n return;\r\n }\r\n $this->fof();\r\n }",
"function render()\n {\n return $this->viewModel->render();\n }",
"public function index() {\n $this->viewModel->set(\"pageTitle\", \"MyCPD Hub\");\n $this->viewModel->set(\"heading1\", \"Mandatory & Contractual Training\");\n return $this->viewModel;\n }",
"function render()\n {\n return array(\n 'init' => $this->__init,\n 'data' => $this->__items\n );\n }",
"protected function initView()\n {\n $view = $this->objectProviderService->get($this->resolveViewClassName());\n\n if (!$view instanceof ViewInterface) {\n throw new \\UnexpectedValueException(\n 'View \"' . get_class($view) . '\" does not implement Signature\\Mvc\\View\\ViewInterface.'\n );\n }\n\n $this->view = $view;\n\n // Assign basic view data\n $this->view->setViewData([\n 'moduleContext' => $this->getModuleContext(),\n 'config' => $this->configurationService->getConfig($this->getModuleContext()),\n 'resourceDir' => $this->getResourceDir(),\n 'templateDir' => $this->getTemplateDir(),\n ]);\n }",
"function index(){\r\n \r\n $all = $this->model->selectAll();\r\n $this->data('all', $all);\r\n $this->loadView();\r\n }",
"public function run() {\n $this->render('dataSaved', array());\n }",
"public function getViewData()\n {\n return $this->__viewData;\n }",
"public function index()\n {\n $this->context['data'] = $this->usersRepo->getAll();\n $this->render($this->context);\n }",
"public function renderView()\n {\n // Is valid record\n $result = $this->prepareRecord();\n if ($result instanceof \\Illuminate\\Http\\RedirectResponse) {\n $this->redirect($result);\n }\n if ($this->contentType == \"json\") {\n $record = $this->Model->toArray();\n // Hook Filter viewModifyRecord\n $record = $this->doFilter(\"viewModifyRecord\", $record);\n // Send Response\n $JsonResponse = new JsonResponse($record, 200);\n $JsonResponse->send();\n exit;\n }\n // Render View\n $parameters = array(\n \"Scaffolding\" => $this,\n );\n $content = view($this->template . \".view\", $parameters)->render();\n return $content;\n }",
"public function view($id) {\n \t$this->layout = false;\n $bowler = $this->Bowler->findById($id);\n\n $bowlerData['bowlers']['bowler'][] = $bowler['Bowler'];\n\n $this->set('bowlerData', $bowlerData);\n }",
"abstract protected function getView();",
"public function compose(View $view)\n {\n $view->with(['employeesCombo' => $this->employees]);\n }",
"public function bindFields()\n {\n // TODO: Implement bindFields() method.\n }",
"public function renderView(){\n $current_slider = get_the_author_meta( $this->model->getOptionName(), $this->user->data->ID );\n if($current_slider)\n $this->model->import($current_slider);\n else\n $this->model->import(null);\n\n $args = array(\n 'elements' => array(\n array(\n 'type' => 'header',\n 'title' => __('Halo8 Full Screen Slider Options', $this->plugin_slug)\n ),\n array(\n 'type' => 'nonce',\n 'nonce_phrase' => $this->nonce_phrase,\n 'prefix' => $this->prefix\n ),\n array(\n 'type' => 'select',\n 'id' => 'slider',\n 'prefix' => $this->prefix,\n 'name' => $this->model->getOptionName(),\n 'label' => __('Slider', $this->plugin_slug),\n 'elements' => $this->generateSlidersSelectElements(array('sliders' => $this->model->getSliders(), 'current' => $this->model->getSlider())),\n 'message' => __('Select the slider for this user.', $this->plugin_slug),\n 'enabled' => true\n ),\n array(\n 'type' => 'footer'\n )\n )\n );\n $this->view->render($args);\n }",
"public function render()\n {\n return view('components.frontend.components.hostels-list-grid.item');\n }",
"public function init()\n {\n return $this->getView();\n }",
"public function render()\n {\n return view('components.slider-home', [\n // 'slider' => Slider::where('active', true)->orderBy('seq_no')->get()\n 'sliders' => WpRevsliderSlide::orderBy('slide_order')->get()\n ]);\n }",
"public function index()\n {\n load_datatable($this->data);\n load_daterangepicker($this->data);\n echo $this->blade->view()->make('page/page', $this->data)->render();\n }",
"public function __invoke()\n {\n //$data = [\"listeproduit\"=>config(\"app.listeproduit\")];\n $db = Produit::query()->select(\"nom\",'image','quantite','id')->get();// au lieu de \"Produit::all()\" pour pouvoir choisir quelle donne envoyé\n $tableaffichage=[]; //pour avoir un tableau vide pour pourvoir stocker des string et non des objets\n foreach($db as $yuumi){\n\n array_push($tableaffichage, $yuumi->getAttributes());//insere la valeur dans le tableau\n }\n return view('liste',[\"db\"=>$db]);//[\"db\"=>$db] tableau associatif pour pouvoir lui donner un nom et l'appeler dans le blade\n }",
"public function form()\n {\n $this->setData();\n }",
"public function run()\n {\n\n // Try to get current field value, when model & attribute attributes are specified.\n $currentValue = \"\";\n if ($this->model != null && $this->attribute != null) {\n $attribute = $this->attribute;\n $currentValue = $this->model->$attribute;\n }\n\n return $this->render('userPicker', [\n 'userSearchUrl' => $this->userSearchUrl,\n 'maxUsers' => $this->maxUsers,\n 'currentValue' => $currentValue,\n 'inputId' => $this->inputId,\n 'focus' => $this->focus,\n 'userGuid' => $this->userGuid,\n 'userRole' => $this->userRole,\n 'data' => json_encode($this->data),\n 'placeholderText' => $this->placeholderText,\n ]);\n }",
"public function compose()\n {\n view()->composer('intern.ikm.statistik.index', function ($view){\n\n $view->with('id', static::$data->id); \n\n $view->with('questions', Question::all());\n\n $view->with('ikm', Jadwal::select('id', 'keterangan')->get());\n\n $view->with('ikm_ket', Jadwal::select('keterangan')->whereId(static::$data->id)->first()); \n \n }); \n }",
"protected function _respond($bind)\n {\n echo json_encode($bind);\n }",
"function render() \n {\n return View::factory($this->template_path . get_class($this))\n ->set('grid', $this)\n ->render();\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 view() {\n\n $options = array(\n 'fields' => array(\n 'Produto.id',\n 'Produto.nome',\n 'Produto.codigo',\n 'Produto.descricao',\n 'Produto.preco',\n 'Produto.quantidade',\n 'Produto.promocao',\n 'Produto.data_cadastro',\n 'Produto.id_marcas',\n 'Produto.id_sub_departamentos'\n ),\n 'limit' => 10,\n 'recursive' => 0\n );\n\n $this->paginate = $options;\n\n // Roda a consulta, já trazendo os resultados paginados\n $produtos = $this->paginate('Produto');\n\n // Envia os dados pra view\n $this->set('produtos', $produtos);\n }",
"public function init()\n {\n parent::init();\n\n // Retrieving a field from the controller container and layout into this view.\n $this->add($this->fieldCtrl->getField('label'));\n }",
"protected function loadView()\n {\n }",
"protected function loadView()\n {\n }",
"function index() {\n\n $this->view->render();\n\n }",
"public function updateView(): void\n {\n if (!$this->special) {\n $this->_builder->submitUpdate();\n }\n $this->_data = $this->_entity->fetch($_GET['id'])[0];\n\n require VF . \"{$this->route}/update.php\";\n }",
"public function run()\n { \n if(isset($_GET['nombre'])){\n\t\t\t$nombre = $_GET['nombre'];\n\t\t}\n\t\telse{\n\t\t\t$nombre = '';\n\t\t}\n\t\t\n\t\tif(isset($_GET['tipo'])){\n\t\t\t$tipo = $_GET['tipo'];\n\t\t}\n\t\telse{\n\t\t\t$tipo = '';\n\t\t}\n\t\t\n\t\t$model = new Variables;\n\t\t$criteria = new CDbCriteria;\n\t\t$criteria->addCondition('descripcion_tipo_variable LIKE \"%'. $nombre . '%\"');\n\t\tif($tipo != '')\n\t\t\t$criteria->compare('id_tipo_variable', $tipo);\n\t\t$criteria->order = 'id_tipo_variable DESC';\n\t\t\n\t\t$tipos_variable = CHtml::listData(TiposVariable::model()->findAll(), 'id', 'nombre_tipo_variable');\n\t\t$tipos_variable[\"\"] = \"Todos los tipos de variable\";\n\t\tksort($tipos_variable);\n\n\t\t\n\t\t$reporte = new CActiveDataProvider($model, array('criteria' => $criteria));\n\t\t$errores = \"\";\n\n $this->controller->render('lista_variables',array(\n\t\t\t'nombre' => $nombre,\n\t\t\t'tipo' => $tipo,\n\t\t\t'errores' => $errores,\n\t\t\t'tipos_variable' => $tipos_variable,\n\t\t\t'dataProvider' => $reporte,\n ));\n }",
"private function shareModelPropsToView(): void\n {\n $model = static::${'modelClass'};\n View::share('props', (new $model())->getEditableProperties());\n }",
"public function render() {\n\t\textract($this->data);\n\t\trequire($this->path);\n\t}",
"function index() {\n \n $this->view->set('textData', $this->model->textData());\n\t\t$this->view->render('index/index');\n\t}",
"public function processBind()\n {\n $bind = [];\n\n foreach ($this->fields as $field)\n {\n\n if($field == $this->tablePK)\n {\n $bind[\":id\"] = $this->data[$field];\n }\n else\n {\n $bind[\":$field\"] = $this->data[$field];\n }\n }\n $this->bind = $bind;\n }"
]
| [
"0.61339086",
"0.61310345",
"0.59993374",
"0.5867929",
"0.586505",
"0.5776678",
"0.577045",
"0.577045",
"0.5706446",
"0.56945896",
"0.5682643",
"0.5656571",
"0.56261563",
"0.5613869",
"0.5564696",
"0.5548768",
"0.5456597",
"0.54286546",
"0.54286546",
"0.54203165",
"0.54105294",
"0.5404953",
"0.5404953",
"0.54015255",
"0.538498",
"0.53554785",
"0.53381425",
"0.5320655",
"0.5311813",
"0.5295755",
"0.528356",
"0.52801794",
"0.52671415",
"0.5259487",
"0.5256512",
"0.52519387",
"0.5249141",
"0.52456796",
"0.5237716",
"0.52339",
"0.5222657",
"0.5220371",
"0.5201195",
"0.51661694",
"0.5165896",
"0.5160078",
"0.51534396",
"0.5148666",
"0.51433015",
"0.51299834",
"0.51261425",
"0.5125569",
"0.511756",
"0.51024634",
"0.5101026",
"0.50897104",
"0.50895846",
"0.50841737",
"0.5061956",
"0.50611895",
"0.5059557",
"0.5059522",
"0.50569814",
"0.5053701",
"0.50524175",
"0.50474364",
"0.5046302",
"0.50385565",
"0.5028679",
"0.5025033",
"0.5017596",
"0.5016362",
"0.5009159",
"0.500519",
"0.5003744",
"0.49999967",
"0.49901608",
"0.49870262",
"0.49861282",
"0.4986077",
"0.49774903",
"0.4976459",
"0.49703124",
"0.4970028",
"0.496689",
"0.4962904",
"0.49628672",
"0.49476227",
"0.49464965",
"0.49459285",
"0.49449113",
"0.49394917",
"0.49393624",
"0.49393624",
"0.4935192",
"0.49283582",
"0.49275556",
"0.49274275",
"0.4915317",
"0.49099383",
"0.4909905"
]
| 0.0 | -1 |
Lists all DollInfo models. | public function actionIndex()
{
$searchModel = new DollInfoSearch();
$dataProvider = $searchModel->search(Yii::$app->request->queryParams);
return $this->render('index', [
'searchModel' => $searchModel,
'dataProvider' => $dataProvider,
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function liste()\n {\n $discs = $this->LoadModel('Disc');\n $discDetail = $discs->info_record();\n $this->render('liste', [\n 'discs' => $discDetail\n ]);\n }",
"public function getModels();",
"public function getModels();",
"public function listModels() {\n\n $config = $this->initConfig($version = AnalyzeModel::VERSION);\n\n $config->setQuery( [ 'version' => $version ] );\n\n $config->setMethod(HttpClientConfiguration::METHOD_GET);\n $config->setType(HttpClientConfiguration::DATA_TYPE_JSON);\n $config->setURL(self::BASE_URL.\"/models\");\n\n return $this->sendRequest($config);\n }",
"public function listar() {\n $rs = $this->model->listar();\n\n echo $this->toJson($rs);\n }",
"public function getList()\n {\n $this->db->order_by(\"id\", 'desc');\n $this->db->where('status', 1);\n return $this->db->get($this->model);\n }",
"public function index()\n {\n return $this->showList(ObjectMuseum::where('deleted','=',ObjectMuseum::ACTIVE)->get());\n }",
"public function index()\n {\n return $this->model->all();\n }",
"public function index()\n {\n return $this->model->getAll();\n }",
"public function fetch_all_models() {\n global $pdo;\n\n $query = $pdo->prepare(\"SELECT * FROM talents\");\n $query -> execute();\n return $query->fetchAll(\\PDO::FETCH_ASSOC);\n }",
"public function getAll()\n {\n return $this->model->orderBy('id', 'DESC')->get();\n }",
"public function index(){\n return $this->model->all();\n }",
"public function getList()\n {\n \treturn $this->model->where('is_base', '=', 0)->get();\n }",
"public function GetAll()\n {\n return $this->model->all();\n }",
"public function getAll()\n {\n return DB::table('product_models')->get()->all();\n }",
"public function actionList()\r\n {\r\n $this->_userAutehntication();\r\n switch($_GET['model'])\r\n {\r\n case 'posts': \r\n $models = Post::model()->findAll();\r\n break; \r\n default: \r\n $this->_sendResponse(501, sprintf('Error: Mode <b>list</b> is not implemented for model <b>%s</b>',$_GET['model']) );\r\n exit; \r\n }\r\n if(is_null($models)) {\r\n $this->_sendResponse(200, sprintf('No Post found for model <b>%s</b>', $_GET['model']) );\r\n } else {\r\n $rows = array();\r\n foreach($models as $model)\r\n $rows[] = $model->attributes;\r\n\r\n $this->_sendResponse(200, CJSON::encode($rows));\r\n }\r\n }",
"public static function getList()\n {\n $models = self::find()->all();\n $list = ArrayHelper::map($models, 'id', 'name');\n return $list;\n }",
"private function getAllModels()\n {\n return (object)ModelRegistry::getAllObjects();\n }",
"public function getList()\n {\n return $this->model->getList();\n }",
"public function modelList(){\n \t$data = DB::table(\"categories\")->orderBy(\"id\",\"desc\")->paginate(4);\n \treturn $data;\n }",
"public function getAll()\n {\n return $this->model->all();\n }",
"public function getAll()\n {\n return $this->model->all();\n }",
"public function getAll()\n {\n return $this->model->all();\n }",
"public static function getListado(){\n return Dispositivo::model()->findAll();\n }",
"public static function all() {\n\t\t$classe = get_called_class();\n\t\t$table = str_replace(\"db_\", \"\", $classe);\n\t\t$liste = db::findAll(db::table($table));\n\t\treturn $liste;\n\t}",
"public function viewallunitmodelsAction() {\n\n\t\t$model = new Unit_Model_UnitModel();\n\t\t$this->view->records = $model->fetchAll( 'name','ASC' );\n \n\t\tif( $this->view->records ) {\n $attached = $model->getAttachedModels();\n $this->view->attached = $attached;\n\t\t $this->view->paginator = $this->paginate( $this->view->records );\n }\n\t}",
"public function index()\n\t{\n\t\treturn Lense::all();\n\t}",
"public function actionIndex()\n {\n\n $query = Daodien::find();\n $pagination = new Pagination([\n 'defaultPageSize' => 5,\n 'totalCount' => $query->count(),\n ]);\n $listDaoDien = $query->orderBy(['created_at' => SORT_DESC])\n ->offset($pagination->offset)\n ->limit($pagination->limit)->all();\n $data = ObjDaoDien::getListObject($listDaoDien);\n return $this->render('index',[\n 'listDaoDien' => $data,\n 'pagination' => $pagination]);\n }",
"function lists()\n {\n $data[\"data\"] = $this->RapatModel->get();\n $this->load->view('rapat/lists', $data);\n }",
"public function all()\n {\n return $this->model->get();\n }",
"public function models()\n {\n $this->_display('models');\n }",
"public function all()\n {\n return $this->model->get();\n }",
"public function index()\n {\n $detalles = Detalle::orderBy('id', 'desc')->get();\n return DetalleResource::collection($detalles);\n }",
"function index(){\r\n \r\n $all = $this->model->selectAll();\r\n $this->data('all', $all);\r\n $this->loadView();\r\n }",
"public function alls()\r\n {\r\n $all = ShopCatalog::find()\r\n ->where([\r\n 'id' => 12355\r\n ])\r\n ->asArray()\r\n ->all();\r\n\r\n vd($all);\r\n }",
"public function index()\n {\n return InfografiResources::collection(\n Infografi::orderBy('date', 'desc')->get()\n );\n }",
"public function actionList() {\n header(\"Content-type: application/json\");\n $verb = $_SERVER[\"REQUEST_METHOD\"];\n\n if ($verb === 'GET') {\n echo \"{\\\"data\\\":\" . CJSON::encode(Donneur::model()->findAll()) . \"}\";\n } else if ($verb == 'POST') {\n if (Donneur::model()->exists('id' === $_POST['id'])) {\n $this->actionListUpdate($_POST);\n } else {\n $this->actionListPost();\n }\n } else if ($verb == 'DELETE') {\n $this->actionListDelete();\n }\n }",
"public function modelFetchAll(){\n\t\t\t//lay bien ket noi de thao tac csdl\n\t\t\t$conn = Connection::getInstance();\n\t\t\t//thuc hien truy van, tra ket qua ve mot object\n\t\t\t$query = $conn->query(\"select * from phongban\");\n\t\t\t//tra ve tat ca cac ban ghi\n\t\t\treturn $query->fetchAll();\n\t\t}",
"public function actionList() {\n $criteria = new CDbCriteria();\n //$criteria->index = \"id\";\n $criteria->order = \"id desc\";\n $count = EpcModelTemp::model()->count($criteria);\n $pages = new CPagination($count);\n $pages->pageSize = $_GET['rows'];\n $pages->applyLimit($criteria);\n //EpcModelTemp::model()->scenario='list';\n $models = EpcModelTemp::model()->findAll($criteria);\n // 转换成数组\n $rows = array();\n foreach ($models as $model) {\n $rows[] = $model->attributes;\n }\n $rs = array('total' => $count, 'rows' => $rows);\n echo CJSON::encode($rs);\n }",
"public function index()\n {\n return $this->findModel()->toArray();\n }",
"public function index()\n {\n return Model::all();\n }",
"public function actionList() {\n $this->_getList();\n }",
"public static function list_deals() {\n\t\t$msg = '';\n\t\t$query = self::getDeals();\n\t\tinclude 'views/_list_deals.php';\n\t}",
"public function Allplanlist($model);",
"function listaAll() {\n require ROOT . \"config/bootstrap.php\";\n return $em->getRepository('models\\Equipamentos')->findby(array(), array(\"id\" => \"DESC\"));\n $em->flush();\n }",
"public function all() {\n return $this->model->orderBy('created_at', 'ASC')->get();\n }",
"public static function all()\n {\n $list = [];\n $db = Db::initDB();\n $req = $db->query('SELECT * FROM alcool');\n\n // on créer une list des objets Alcool depuis le résultat de la base de données\n foreach ($req->fetchAll() as $alcools) {\n $list[] = new Alcool($alcools['id'], $alcools['name'], $alcools['degree'], $alcools['dose']);\n }\n\n return $list;\n }",
"public function index()\n {\n $conductores =Conductor::all();\n\n return $this->showAll($conductores);\n }",
"public static function index()\n {\n return Comida::all();\n }",
"public function listAll()\n\t{\n\t\t$data['auditorias'] = $this->relatorio_model->listaAuditorias(1);\n\n\t\t$data['ncs'] = $this->relatorio_model->listaNCs(1);\n\n\t\t$data['acs'] = $this->relatorio_model->listaACs(1);\n\n\t\t$data['main_content'] = 'relatorio/relatorio_view';\n\t\t\n\t\t// Envia todas as informações para tela //\n\t\t$this->parser->parse('template', $data);\n\t}",
"public function getList()\n\t{\n\t\treturn $this->crud->orderby('id DESC')\n\t\t\t\t\t->read(10)\n\t\t;\t\n\t}",
"public function index() {\n $data['manufacturers'] = Manufacturer::getManufacturers();\n return view('models.models')->with($data);\n }",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function getAll();",
"public function index()\n {\n // Entrega las Comunas, Provincias y Regiones\n\n $comunas= ComunasModel::all();\n\n return $this->showAll($comunas);\n }",
"public function admin_index() {\r\n\t\t$this->data = $this->{$this->modelClass}->find('all');\r\n }",
"public function listAction()\n {\n $sql = 'SELECT DISTINCT '.$this->fields.' FROM '.$this->db->quoteIdentifier($this->table).($this->criteria ?: '').' ORDER BY '.$this->order;\n $objects = $this->db->fetchAll($sql, $this->criteria_values);\n\n return new JsonResponse($objects);\n }",
"public function listAll()\n {\n return $this->contractor->all()->pluck('name', 'id')->all();\n }",
"public function index()\n {\n return Drink::all();\n }",
"public function list()\n {\n return $this->repo->getAll();\n ;\n }",
"public function getList()\n {\n return ArrayHelper::map(Competency::find()->all(), 'com_id', 'com_name');\n }",
"public function listing() {\n $this->aConfigs = $this->oLegalNotice->select();\n }",
"public function actionList() {\n switch ($_GET['model']) {\n case 'Product':\n $models = Product::model()->findAll();\n break;\n case 'Vendor':\n $models = Vendor::model()->findAll();\n break;\n case 'FavoriteProduct':\n $models = FavoriteProduct::model()->findAll();\n break;\n case 'Order':\n $models = Order::model()->findAll();\n break;\n case 'Rating':\n $models = Rating::model()->findAll();\n break;\n case 'Review':\n $models = Review::model()->findAll();\n break;\n case 'UserAddress':\n $models = UserAddress::model()->findAll();\n break;\n case 'OrderDetail':\n $models = OrderDetail::model()->findAll();\n break;\n default:\n $this->_sendResponse(0, 'You have pass invalid modal name');\n Yii::app()->end();\n }\n // Did we get some results?\n if (empty($models)) {\n // No\n $this->_sendResponse(0, 'No Record found ');\n } else {\n // Prepare response\n $rows = array();\n $i = 0;\n foreach ($models as $model) {\n $rows[] = $model->attributes;\n if ($_GET['model'] == 'Order') {\n $rows[$i]['cart_items'] = Product::model()->getProducts($model->product_id);\n $rows[$i]['order_detail'] = OrderDetail::model()->findAll(array('condition' => 'order_id ='.$model->id));\n }\n $i = $i + 1;\n }\n // Send the response\n $this->_sendResponse(1, '', $rows);\n }\n }",
"public function index(){\n $model = new InternetSpeedModel(); \n return view('list');\n }",
"public function actionList() {\n $models = Post::model()->findAll();\n $rows = array();\n foreach($models as $model) \n $rows[] = $model->attributes;\n\t\t$data_response = array(\n\t\t\t'error'=> array('status'=>200, 'message'=>''),\n\t\t\t'datas'=>$rows\n\t\t);\n $this->response($data_response);\n }",
"public function lists1()\n {\n return $this->model->lists('name', 'id');\n }",
"public static function getList(){\n return self::all();\n }",
"public function index()\n\t{\n\t\treturn Bycycle::all();\n\t}",
"public function list() {\n $this->data = ['noticias_0', 'noticias_1', 'noticias_2'];\n // ejemplo:\n // http://mvc-todo.io/noticias/list\n // muestra:\n // SALIDA GENERAL noticias_1---noticias_2---noticias_3\n\n // EJEMPLOS\n /*\n ModelNoticias::getNoticias();\n ModelNoticias::getNoticias($page=1);\n ModelNoticias::getNoticiasPublicadas();\n\n $noticia = ModelNoticias::getNoticiaById(2);\n $noticia = ModelNoticias::getNoticiaByAuthor('Jorge');\n\n $noticia = new ModelNoticias();\n\n $noticia->setTitle('Lanzamiento de mi MVC.');\n $noticia->setAuthor('Sergio');\n\n $noticia->getContent();\n $noticia->save();\n\n ModelNoticias::deleteNoticiaById(7);\n $noticia->delete();\n */\n }",
"public function index() {\n return view('admin.dorp.dcrud', ['dorpen' => Dorp::all()]);\n }",
"public function findAll()\n {\n return $this->model->all();\n }",
"public function list()\n {\n $data = Model::with('user')->get()->toArray();\n return $this->responseData($data);\n }",
"public function index()\n {\n $models= Carmodal::latest()->paginate(10);\n return view('models.index',compact('models'));\n }",
"public function index()\n {\n return Listing::all();\n }",
"public function getList($params = [])\n {\n $model = $this->prepareModel();\n return $model::all();\n }",
"public function liste(){\n $clientMdb = new clientMoralRepository();\n \n $data['clientsM'] = $clientMdb->liste();\n return $this->view->load(\"clientMoral/liste\", $data);\n }",
"public function all()\n {\n return Model::all();\n }",
"public function all()\n {\n return Model::all();\n }",
"public function get_models() {\n if (userLogedIn()) {\n $result = $this->admin_model->get_models();\n echo json_encode($result);\n \n } else {\n $this->load->view('admin/login');\n }\n }",
"public function actionIndex()\n {\n $searchModel = new InfoSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }"
]
| [
"0.64438814",
"0.6298668",
"0.6298668",
"0.62913895",
"0.62639356",
"0.6258607",
"0.61507505",
"0.61457294",
"0.6141489",
"0.611133",
"0.60787356",
"0.60374194",
"0.60351723",
"0.60313755",
"0.60252273",
"0.60233015",
"0.6013212",
"0.6010859",
"0.5968535",
"0.5959769",
"0.59231067",
"0.59231067",
"0.59231067",
"0.59055114",
"0.5895789",
"0.5895661",
"0.58702326",
"0.58362705",
"0.58179444",
"0.581476",
"0.58114976",
"0.5794303",
"0.5792615",
"0.57878816",
"0.57839787",
"0.57718176",
"0.57643795",
"0.57643634",
"0.5760956",
"0.5750928",
"0.5749786",
"0.57430893",
"0.57332397",
"0.5731414",
"0.57193166",
"0.5695681",
"0.56944275",
"0.5693667",
"0.56890774",
"0.56821513",
"0.5674991",
"0.5666784",
"0.56582457",
"0.56582457",
"0.56582457",
"0.56582457",
"0.56582457",
"0.56582457",
"0.56582457",
"0.56582457",
"0.56582457",
"0.56582457",
"0.56582457",
"0.56582457",
"0.56582457",
"0.56582457",
"0.56582457",
"0.56582457",
"0.56582457",
"0.56582457",
"0.56582457",
"0.56582457",
"0.56582457",
"0.56582457",
"0.56555194",
"0.565443",
"0.56531745",
"0.5652572",
"0.5647701",
"0.5646285",
"0.56446546",
"0.56444275",
"0.56419003",
"0.56357414",
"0.56330776",
"0.56329554",
"0.56282306",
"0.5627827",
"0.56243634",
"0.56240624",
"0.562228",
"0.56167954",
"0.56158715",
"0.56154484",
"0.56129277",
"0.56094867",
"0.56069994",
"0.56069994",
"0.55881876",
"0.5586623"
]
| 0.71787024 | 0 |
Displays a single DollInfo model. | public function actionView($id)
{
return $this->render('view', [
'model' => $this->findModel($id),
]);
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionIndex()\n {\n $searchModel = new DollInfoSearch();\n $dataProvider = $searchModel->search(Yii::$app->request->queryParams);\n\n return $this->render('index', [\n 'searchModel' => $searchModel,\n 'dataProvider' => $dataProvider,\n ]);\n }",
"public function detail()\n {\n $vereinRepository = new VereinRepository();\n\n $view = new View('verein_detail');\n $view->heading = \"\";\n $view->verein = $vereinRepository->readById($_GET['id']);\n $view->title = $view->verein->name;\n $view->display();\n }",
"function viewInfo() {\n\t$view = new viewModel();\n\t$view->showInfo();\t\n}",
"public function actionView($id) {\n $desarrollo = new Desarrollo;\n $this->render('view', array(\n 'model' => $this->loadModel($id),\n 'desarrollo' => $desarrollo,\n ));\n }",
"public function info(){\n $this->display('Main/Person/info') ;\n }",
"public function show($id)\n {\n // return view('dicom/edit',['lista'=>DICOM\\DicomModel::])\n }",
"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 detail(){\n\t\t\t$id = isset($_GET[\"id\"]) ? $_GET[\"id\"] : 0;\n\t\t\t$record = $this->modelGetRecord($id);\n\t\t\t//load view\n\t\t\tinclude \"Views/BlogsDetailView.php\";\n\t\t}",
"public function actionView($id)\n\t{\n\t\tLogin::UserAuth('Bills','View');\t\t\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel($id),\n\t\t));\n\t}",
"public function showAction() {\n $model = new Application_Model_Compromisso();\n //busco o id que eu quero ver\n $comp = $model->find($this->_getParam('id'));\n //crio uma view para o id referente;\n $this->view->assign(\"compromisso\", $comp);\n }",
"public function detailAction() {\n\n //GET THE LIST ITEM\n $this->view->listDetail = Engine_Api::_()->getItem('list_listing',(int) $this->_getParam('id'));\n }",
"public function liste()\n {\n $discs = $this->LoadModel('Disc');\n $discDetail = $discs->info_record();\n $this->render('liste', [\n 'discs' => $discDetail\n ]);\n }",
"public function show(Info $info)\n {\n //\n }",
"public function show(Info $info)\n {\n //\n }",
"public function actionView($id)\n {\n\t\t $model = $this->findModel($id);\n\t\t \n\t\t Yii::$app->view->title = Yii::t('app', 'Detail').' : '.$model->id.' - '.Yii::t('app', Yii::$app->controller->module->params['title']);\n\t\t \n return $this->render('view', [\n 'model' => $model,\n ]);\n }",
"public function actionView()\n {\n $id=(int)Yii::$app->request->get('id');\n return $this->render('view', [\n 'model' => $this->findModel($id),\n ]);\n }",
"public function actionView() {\n $this->active_menu = \"gpu2\";\n $this->open_class = \"factory\";\n $this->active_class = \"create\";\n $model = Itemstock::model()->findByPk(Yii::app()->request->getParam('id'));\n $this->render('view', array(\n 'model' => $model,\n ));\n }",
"public function actionView($id= null)\n {\n \n \n $request = Yii::$app->request;\n return $this->render('view', [\n 'model' => $this->findModel($id),\n 'const' => $this->const,\n ]);\n \n }",
"public function show( $id ) {\n\t\t//\n\t}",
"public function show( $id ) {\n\t\t//\n\t}",
"public function showAction() {\n $docId = $this->getParam('id');\n\n // TODO verify parameter\n\n $document = new Opus_Document($docId);\n\n $this->_helper->layout()->disableLayout();\n\n $this->view->doc = $document;\n $this->view->document = new Application_Util_DocumentAdapter($this->view, $document);\n }",
"public function showSingle($id);",
"function show(int $id);",
"public function show($id)\n\t{\n \n\t}",
"public function viewAction()\n {\n $id = $this->_getPrimaryId();\n $row = $this->_getRow($id);\n\n $this->view->row = $row;\n }",
"public function detailAction()\r\n {\r\n $typeId = $this->_getParam('citypeId');\r\n\r\n $citypeServiceGet = new Service_Citype_Get($this->translator, $this->logger, parent::getUserInformation()->getThemeId());\r\n $currentCiType = $citypeServiceGet->getCiType($typeId);\r\n\r\n if ($currentCiType[Db_CiType::PARENT_CI_TYPE_ID])\r\n $parent = $citypeServiceGet->getCiType($currentCiType[Db_CiType::PARENT_CI_TYPE_ID]);\r\n if ($currentCiType[Db_CiType::DEFAULT_PROJECT_ID])\r\n $defaultProject = $citypeServiceGet->getProject($currentCiType[Db_CiType::DEFAULT_PROJECT_ID]);\r\n if ($currentCiType[Db_CiType::DEFAULT_ATTRIBUTE_ID])\r\n $defaultAttribute = $citypeServiceGet->getAttribute($currentCiType[Db_CiType::DEFAULT_ATTRIBUTE_ID]);\r\n if ($currentCiType[Db_CiType::DEFAULT_SORT_ATTRIBUTE_ID])\r\n $defaultSortAttribute = $citypeServiceGet->getAttribute($currentCiType[Db_CiType::DEFAULT_SORT_ATTRIBUTE_ID]);\r\n\r\n $attributes = $citypeServiceGet->getAttributes($typeId);\r\n $relations = $citypeServiceGet->getRelations($typeId);\r\n\r\n $this->view->attributes = $attributes;\r\n $this->view->relations = $relations;\r\n $this->view->parent = $parent;\r\n $this->view->defaultProject = $defaultProject;\r\n $this->view->defaultAttribute = $defaultAttribute;\r\n $this->view->defaultSortAttribute = $defaultSortAttribute;\r\n //$this->view->iconPath = APPLICATION_PUBLIC.$path;\r\n $this->view->icon = $currentCiType[Db_CiType::ICON];\r\n $this->view->ciType = $currentCiType;\r\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 actionView($id)\n\t{\n\t\t$this->render('view',array(\n\t\t\t'model'\t\t=>$this->loadModel($id),\n\t\t\t'dokter'\t=>$this->loadModelDetailDokter($id),\n\t\t\t'perawat'\t=>$this->loadModelDetailPerawat($id),\n\t\t\t'obat'\t\t=>$this->loadModelDetailObat($id),\n\t\t\t'perawatan'\t=>$this->loadModelDetailPerawatan($id),\n\t\t));\n\t}",
"public function actionView($id)\n { \n return $this->findModel($id);\n \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 actionView($id) {\n\t\t$model = $this->loadModel($id);\n\t\t\n\t\t$this->render('view', array(\n\t\t\t'model'\t\t\t\t\t\t\t\t\t\t\t\t\t\t=> $model,\n\t\t));\n\t}",
"public function show($id)\r\n\t{\r\n\t\t//\r\n\r\n\r\n\r\n\t}",
"function view_one()\n\t{\n\t\t$data = filter_forwarded_data($this);\n\t\t$data['bid'] = $this->_bid->details(array('bid_id'=>$data['d']));\n\t\tif(empty($data['bid'])) $data['msg'] = \"ERROR: No bid information could be resolved.\";\n\t\t\n\t\t$this->load->view('bids/bid_details', $data);\n\t}",
"public function show(Comida $comida)\n {\n //\n }",
"public function show($id)\n\t{\t\n\n\t}",
"public function show($id) {}",
"public function show($id)\n\t{\n\t}",
"public function show($id)\n\t{\n\t}",
"public function show($id)\n\t{\n\t}",
"public function show($id)\n {\n //$this->_DetailItem();\n }",
"public function actionView($id)\n {\n $this->render('_view', array(\n 'data' => $this->loadModel($id),\n ));\n }",
"public function showAction() {\n\t\t$contentObject = $this->configurationManager->getContentObject()->data;\n\t\t$config = $this->configurationManager->getConfiguration(Tx_Extbase_Configuration_ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);\n\n\t\t/** @var $dce Tx_Dce_Domain_Model_Dce */\n\t\t$dce = $this->dceRepository->findAndBuildOneByUid(\n\t\t\t$this->dceRepository->extractUidFromCType($config['pluginName']),\n\t\t\t$this->settings,\n\t\t\t$contentObject\n\t\t);\n\n\t\tif ($dce->getEnableDetailpage() && intval($contentObject['uid']) === intval(t3lib_div::_GP($dce->getDetailpageIdentifier()))) {\n\t\t\treturn $dce->renderDetailpage();\n\t\t} else {\n\t\t\treturn $dce->render();\n\t\t}\n\t}",
"public function show($id)\n\t{\n\n\t}",
"public function show($id)\n\t{\n\n\t}",
"public function show($id)\n\t{\n\n\t}",
"public function show($id)\n\t{\n\n\t}",
"public function show($id)\n\t{\n\n\t}",
"public function show($id)\n\t{\n\n\t}",
"public function show($id)\n\t {\n\t //\n\t }",
"public function show( $id )\n {\n //\n }",
"public function show( $id )\n {\n //\n }",
"public function show( $id ) {\n //\n }",
"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 actionDetails()\n\t{\n\t\t$this->render('details',array('model'=>$this->loadarticles()));\n\t}",
"public function show($id)\n\t{\n\n\t\t\n\t}",
"public function show($id)\n\t{\n\n\t\t\n\t}",
"public function show(cr $cr)\n {\n //\n }",
"public function show(cr $cr)\n {\n //\n }",
"public function show(cr $cr)\n {\n //\n }",
"public function show(cr $cr)\n {\n //\n }",
"public function show($id)\n {\n //\n $disty = Disty::find($id);\n return View('master-data.Distributors.show' , [ 'disty'=>$disty ]);\n }",
"public function actionView($id) {\n\t\t$this->render('view', array(\n\t\t\t'model' => $this->loadModel($id),\n\t\t));\n\t}",
"public function show($id) {\n\t\t\t//\n\t\t}",
"public function show($id){\n $modelName = $this->model;\n $list = $modelName::find($id);\n $view = view('api-demo::methods.view' , array(\n 'list' => $list,\n 'fields' => $this->getAllColumnsNames($list),\n 'controller' => $this->getClassName(true),\n ));\n\n if (isset($this->layout) && $this->layout){\n return View($this->layout , array('content' => $view));\n }else{\n return $view;\n }\n \n }",
"public function show($id)\n\t{ \n\t\t//\n\t}",
"public function actionView()\n\t{\n\t\t$this->layout='';\n\t\t$model=$this->loadModel();\n\t\t$user = User::model()->findbyPk($model->user_id);\n\n\t\t$model->contract = $user->contract; \n\t\t$model->username = $user->username;\n\t\t$model->number = $model->id;\n\t\t\n\t\t$this->render('view',array(\n\t\t\t'model'=>$this->loadModel(),\n\t\t));\n\t}",
"public function show($id) {\n\n\t}",
"public function show($id)\r\n {\r\n \r\n }",
"public function show( $id )\n {\n //\n }",
"public function actionView() {\n $this->render('view', array(\n 'model' => $this->loadModel(),\n ));\n }",
"public function actionView($id)\n {\n\t\t$this->titulo = 'Detalhar Contato';\n\t\t$this->subTitulo = '';\n\t\t\t\n return $this->render('view', [\n 'model' => $this->findModel($id),\n ]);\n }",
"public function show($id)\r\n\t{\r\n\t\t//\r\n\t}",
"public function show($id)\r\n\t{\r\n\t\t//\r\n\t}",
"public function show($id){\n\t\t//\n\t}",
"public function show($id){\n\t\t//\n\t}",
"public function show(){\r\r\n $news = $this->New->find($_GET['id']);\r\r\n $this->render('news.show', compact('news'));\r\r\n }",
"public function actionView($id) {\n $model = $this->findModel($id);\n return $this->render('view', [\n 'model' => $model,\n 'modelDetails' => $model->creditDetails\n ]);\n }",
"public function viewdetailsAction()\n {\n $productId = $this->_getParam('product_id');\n $product = $this->_model->setId($productId);\n $this->view->product = $product->fetch(); \n \n }",
"public function show($id)\n\t{\n\t//\n\t}",
"public function show($id)\n\t{\n\t//\n\t}",
"public function actionView($id) {\n\n\n return $this->render('view', [\n 'model' => $this->findModel($id),\n ]);\n }",
"public function actionView()\n\t{\n\t\t$model = $this->loadModel();\n\t\t$this->render('view',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function display(){}",
"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 actionView($id)\n {\n\t\t$model = $this->findModel($id);\n\t\t\n\t\tif($model->cut_price > 0){\n\t\t\t$soodus = true;\n\t\t} else {\n\t\t\t$soodus = false;\n\t\t}\t\n\t\t\n return $this->render('view', [\n 'model' => $model,\n\t\t\t'soodus' => $soodus,\n ]);\n }",
"public function actionView($id)\n\t{\n Url::remember();\n return $this->render('view', [\n\t\t\t'model' => $this->findModel($id),\n 'owner' => Owner::find()->all(),\n 'years' => $this->getYears(),\n\t\t]);\n\t}",
"public function actionView($id)\r\n\t{\r\n\t\t$this->render('view',array(\r\n\t\t\t'model'=>$this->loadModel($id),\r\n\t\t));\r\n\t}",
"public function actionView($id)\r\n\t{\r\n\t\t$this->render('view',array(\r\n\t\t\t'model'=>$this->loadModel($id),\r\n\t\t));\r\n\t}"
]
| [
"0.68554443",
"0.6778433",
"0.6529211",
"0.64459765",
"0.64005643",
"0.63452446",
"0.6324975",
"0.6301189",
"0.6289894",
"0.62859505",
"0.6228806",
"0.6223613",
"0.6208574",
"0.6208574",
"0.620265",
"0.61999035",
"0.6196101",
"0.61952084",
"0.61756825",
"0.61756825",
"0.6167007",
"0.6156701",
"0.61284655",
"0.612446",
"0.61131245",
"0.6112024",
"0.6108254",
"0.6108254",
"0.6108254",
"0.60885817",
"0.6082098",
"0.6077018",
"0.6070795",
"0.6069116",
"0.60689306",
"0.6067434",
"0.60515743",
"0.60492635",
"0.6045818",
"0.6045818",
"0.6045818",
"0.6044697",
"0.60433614",
"0.6043131",
"0.6042896",
"0.6042896",
"0.6042896",
"0.6042896",
"0.6042896",
"0.6042896",
"0.60428023",
"0.60380703",
"0.60380703",
"0.6037056",
"0.6035613",
"0.6035613",
"0.6035613",
"0.6035613",
"0.6035613",
"0.6035613",
"0.6035613",
"0.6035613",
"0.6035613",
"0.6035613",
"0.60349774",
"0.6031877",
"0.6031877",
"0.60302776",
"0.60302776",
"0.60302776",
"0.60302776",
"0.6026704",
"0.60255605",
"0.60255474",
"0.602303",
"0.6018478",
"0.60169864",
"0.60128844",
"0.6012671",
"0.601229",
"0.6012213",
"0.60119945",
"0.6011435",
"0.6011435",
"0.6010967",
"0.6010967",
"0.6010541",
"0.6010238",
"0.60072047",
"0.6005595",
"0.6005595",
"0.60052145",
"0.60027635",
"0.59989214",
"0.599705",
"0.599705",
"0.599705",
"0.5996631",
"0.59947306",
"0.5986945",
"0.5986945"
]
| 0.0 | -1 |
Updates an existing DollInfo model. If update is successful, the browser will be redirected to the 'view' page. | public function actionUpdate($id)
{
$model = $this->findModel($id);
$data = $this->object2array($model);
$img__url = $data['img_url'];
$addTime = $data['addTime'];
if ($model->load(Yii::$app->request->post())) {
$id = $model->id;
$dollName = $model->dollName;
$dollTotal = $model->dollTotal;
$dollCode = $model->dollCode;
$agency = $model->agency;
$size = $model->size;
$type = $model->type;
$note = $model->note;
$dollCoins = $model->dollCoins;
$deliverCoins = $model->deliverCoins;
$redeemCoins = $model->redeemCoins;
$img = $model->img_url=UploadedFile::getInstance($model, 'img_url');
if($img){
$accessKeyId = "LTAIiRG3VWVjAIpU";
$accessKeySecret = "W78XeKUnB6Er9mFRPTIi1x1wjFCXiX";
$endpoint = "http://oss-cn-shanghai.aliyuncs.com/";
$bucket = "zww-image-dev";
$ossClient = new OssClient($accessKeyId,$accessKeySecret,$endpoint);
$object = "dolls/".date('HiiHsHis').'.jpg';
$imgInfo = $this->object2array($img);
$img_url = $imgInfo['tempName'];
$content = file_get_contents($img_url);
$ossClient->putObject($bucket, $object, $content);
$img_url = "http://zww-image-dev.oss-cn-shanghai.aliyuncs.com/dolls/".date('HiiHsHis').'.jpg';
}else{
$img_url = $data['img_url'];
}
$myfunction = new MyFunction();
$myfunction->updateDollInfo($id,$dollName,$dollTotal,$img_url,$addTime,$dollCode,$agency,$size,$type,$note,$dollCoins,$deliverCoins,$redeemCoins);
return $this->redirect(['view', 'id' => $model->id]);
} else {
return $this->render('update', [
'model' => $model,
'img_url' => $img__url,
]);
}
} | {
"objective": {
"self": [],
"paired": [],
"triplet": [
[
"query",
"document",
"negatives"
]
]
}
} | [
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->DE_NRODEVOL]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate()\n {\n\t\t\t$id=7;\n $model = $this->findModel($id);\n $model->slug = \"asuransi\";\n $model->waktu_update = date(\"Y-m-d H:i:s\");\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['update']);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function updateAction() {\n $model = new Application_Model_Compromisso();\n //passo para a model os dados a serem upados\n $model->update($this->_getAllParams());\n //redireciono para a view\n $this->_redirect('compromisso/index');\n }",
"public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\t\t\n\t\tif(isset($_POST['name']))\n\t\t{\n\t\t\t$model->fCatalogueName=$_POST['name'];\n\t\t\t$model->fStatus=$_POST['statu'];\n\t\t\t$model->fIsDownLoad=$_POST['down'];\n\t\t\t$model->fUpdateUser=Yii::app()->params->loginuser->fUserName;\n\t\t\t$model->fUpdateDate=time();\n\t\t\tif($model->save())\n\t\t\t{\n\t\t\t\t$this->renderPartial('update',array(\n\t\t\t\t\t\t'data'=>UFSBaseUtil::printJson(array(\n\t\t\t\t\t\t\t\t'fCatalogueName'=>CHtml::encode($model->fCatalogueName),\n\t\t\t\t\t\t\t\t'fIsDownLoad'=>CHtml::encode($model->fIsDownLoad),\n\t\t\t\t\t\t\t\t'fStatus'=>CHtml::encode($model->fStatus),\n\t\t\t\t\t\t\t\t'fUpdateDate'=>CHtml::encode(empty($model->fUpdateDate)?'':date('Y-m-d',$model->fUpdateDate)),\n\t\t\t\t\t\t\t\t'fUpdateUser'=>CHtml::encode($model->fUpdateUser),\n\t\t\t\t\t\t\t\t'msg'=>$this->FrameInfo(Yii::app()->params['layouttype']['top'],Yii::t('message','Update Success'),Yii::app()->params['notytype']['success']),\n\t\t\t\t\t\t))\n\t\t\t\t));\n\t\t\t}\n\t\t}\n\t}",
"public function actionUpdate($id)\n {\n if(isset(Yii::$app->user->identity->id)){\n if(SiteController::findCom(17)){\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->ADepId]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n else {\n $this->redirect(['site/error']);\n }\n }else {\n $this->redirect(['site/login']);\n }\n}",
"public function actionUpdate($id)\n\t{\n $this->layout='admin';\n \n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Bet']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Bet'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionUpdate($id)\r\n {\r\n $model = $this->findModel($id);\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('up-date', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n // check active diet\n if($model->status_del) throw new NotFoundHttpException('The requested page does not exist.');//return $this->redirect(['index']);\n \n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->RA_NUM]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\r\n {\r\n $model = $this->findModel($id);\r\n\t\t//print_r(\"update mode\");exit;\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n // return $this->redirect(['view', 'id' => $model->id]);\r\n\t\t return $this->redirect(['index']);\r\n }\r\n\r\n return $this->renderAjax('update', [\r\n 'model' => $model,\r\n ]);\r\n }",
"public function actionUpdate($id)\n\t{\n\t\t$model = $this->findModel($id);\n\n\t\tif ($model->load($_POST) && $model->save()) {\n // return $this->redirect(Url::previous());\n\t\t}\n return $this->render('update', [\n 'model' => $model,\n 'owner' => Owner::find()->all(),\n 'years' => $this->getYears(),\n ]);\n\t}",
"public function actionUpdate($id)\n {\n\n // p($id);die;\n $model = $this->findModel($id);\n // p($model);die;\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n if(Yii::$app->user->can('site-clerk'))\n {\n $model = $this->findModel($id);\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }else \n {\n $this->redirect(\\Yii::$app->urlManager->createURL(\"site/login\"));\n }\n }",
"public function actionUpdate($id) {\n\t\t$model = $this->findModel ( $id );\n\t\t\n\t\tif ($model->load ( Yii::$app->request->post () ) && $model->save ()) {\n\t\t\treturn $this->redirect ( [ \n\t\t\t\t\t'view',\n\t\t\t\t\t'id' => $model->id \n\t\t\t] );\n\t\t}\n\t\t\n\t\treturn $this->render ( 'update', [ \n\t\t\t\t'model' => $model \n\t\t] );\n\t}",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n //$locationModel = Location::find()->where(['location_id' => $this->location->id])->one();\n $locationModel = $model->location ? $model->location : new Location;\n //TODO: проверить, рефакторинг\n $locationModel->save();\n //$locationModel->link('debtor', $model);\n $model->link('location', $locationModel);\n $locationModel->load(Yii::$app->request->post());\n $locationModel->save();\n\n //$nameModel = Name::find()->where(['name_id' => $this->name->id])->one();\n $nameModel = $model->name ? $model->name : new Name;\n //TODO: проверить, рефакторинг\n $nameModel->save();\n $nameModel->link('debtor', $model);\n $nameModel->load(Yii::$app->request->post());\n $nameModel->save();\n\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n if (Yii::$app->request->isAjax) {\n return $this->renderAjax('update', [\n 'model' => $model,\n ]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }\n }",
"public function actionUpdate()\n {\n if (!$model = $this->findModel()) {\n Yii::$app->session->setFlash(\"error\", Yii::t('modules/user', \"You are not logged in.\"));\n $this->goHome();\n } else if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash(\"success\", Yii::t('modules/user', \"Changes has been saved.\"));\n $this->refresh();\n } else {\n return $this->render('update', ['model' => $model,]);\n }\n }",
"public function actionUpdate($id) {\n $model = $this->loadModel($id);\n\n// Uncomment the following line if AJAX validation is needed\n// $this->performAjaxValidation($model);\n\n if (isset($_POST['EbayPriceMonitor'])) {\n $model->attributes = $_POST['EbayPriceMonitor'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n // if ($model->load(Yii::$app->request->post()) && $model->save()) {\n // return $this->redirect(['view', 'id' => $model->kamar_id]);\n // }\n if ($model->load(Yii::$app->request->post())) {\n // Yii::$app->creator->update($model);\n $model->updated_by = Yii::$app->user->identity->username;\n \t $model->updated_date = date(\"Y-m-d\");\n $model->save();\n return $this->redirect(['view', 'id' => $model->kamar_id]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->validate()) {\n \t$model->updatedBy=Yii::$app->user->id;\n \t$model->updatedDate=date('Y-m-d H:i:s');\n \t$model->save();\n // return $this->redirect(['view', 'id' => $model->planetId]);\n \treturn $this->redirect(['index']);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index' ,'id' => $model->inmueble_id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['adviser/view', 'id' => $model->adviser_id]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Clap']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Clap'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('clap/update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save())\n {\n return $this->redirect(['index']);\n }\n else\n {\n //var_dump($model);\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $this -> layout = 'blankLayout';\n\n $model = $this->findModel($id);\n\n $model->updated_date = date('Y-m-d H:i:s');\n $model->updated_by = Yii::$app->user->getId(); \n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', \"Saved successful\");\n return $this->redirect(Yii::$app->request->referrer);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->No_]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n// return $this->redirect(['view', 'id' => $model->id]);\n return $this->redirect('/content-menu');\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate()\n\t{\n\t\t$model=$this->loadModel();\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Residencebaseinfo']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Residencebaseinfo'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->rbi_id));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('update', 'Your Info Has Been Update');\n return $this->redirect(['update', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate()\n {\n $model = $this->findModel(Yii::$app->request->post('id'));\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $model;\n }\n return $model->errors;\n }",
"public function actionUpdate($id){\n //$id=getOrganisationID();\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n Yii::$app->session->setFlash('success', 'Saved successfully.');\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->no]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n $this->layout=\"main\";\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function actionUpdate($id)\n { \n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->a_id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id) {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post())) {\n\n if ($model->save()) {\n return $this->redirect(['rooms/index']);\n }\n\n //return $this->goBack();\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function actionUpdate($id)\n {\n $model = ComingForm::find()\n ->where(['id' => $id])\n ->andWhere(['user_id' => Yii::$app->user->identity->id])\n ->andWhere(['status' => ComingsRepository::STATUS_ACTIVE])\n ->one();\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\r\n {\r\n $model = $this->findModel($id);\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) \r\n {\r\n return $this->redirect(['view', 'id' => $model->idapresentacao]);\r\n } else {\r\n return $this->render('update', [\r\n 'model' => $model,\r\n\r\n ]);\r\n }\r\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\t\t\n\t\t$idInstitucion = $_SESSION['instituciones'][0]; \n\t\t\n\t\t\n\t\t$sedes = $this->obtenerSedes($idInstitucion);\n\t\t$estados = $this->obtenerEstados();\n\t\t\n\t\t\n\t\t\n return $this->render('update', [\n 'model' => $model,\n\t\t\t'sedes'=> $sedes,\n\t\t\t'estados'=>$estados,\n\t\t\t'idInstitucion'=>$idInstitucion,\n ]);\n }",
"public function actionUpdate($id) {\n\t\t$model = $this->findModel ( $id );\n\t\t\n\t\tif ($model->load ( Yii::$app->request->post () ) && $model->save ()) {\n\t\t\treturn $this->redirect ( [ \n\t\t\t\t\t'view','id' => $model->weid \n\t\t\t] );\n\t\t} else {\n\t\t\treturn $this->render ( 'update', [ \n\t\t\t\t\t'model' => $model \n\t\t\t] );\n\t\t}\n\t}",
"public function actionUpdate($id) {\n $model = $this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['MissionCarers'])) {\n $model->attributes = $_POST['MissionCarers'];\n if ($model->save())\n //$this->redirect(array('view', 'id' => $model->id));\n $this->redirect(array('admin'));\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n //return $this->redirect(['view', 'id' => $model->id]);\n\t return $this->redirect(['index']);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function actionUpdate($id)\n {\n\t\tif(!$this->IsAdmin())\n\t\t{\n\t\t\treturn $this->render('error', ['name' => 'Not Found (#404)', 'message' => 'Puuduvad piisavad õigused.']);\n\t\t}\n $model = $this->findModel($id);\n\t\t\n\t\tif($model->getAttribute('cut_price') == null){\n\t\t\t$model->setAttribute('cut_price', '0.00');\n\t\t}\n\t\t\n\t\t$model->load(Yii::$app->request->post());\n\t\t$model->save();\n return $this->render('update', ['model' => $model]);\n }",
"public function actionUpdate() {\n $model = $this->loadModel();\n $modelAmbienteUso = new Ambiente_Uso;\n $modelUsuario = new Usuario();\n $modelAmbiente = new Ambiente();\n $modelPredio = new Predio();\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Alocacao'])) {\n $model->attributes = $_POST['Alocacao'];\n $a = $model->DT_DIA;\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->ID_ALOCACAO));\n }\n\n $this->render('update', array(\n 'model' => $model,\n 'modelAU' => $modelAmbienteUso,\n 'modelU' => $modelAmbienteUso,\n 'modelA' => $modelAmbiente,\n 'modelP' => $modelPredio\n ));\n }",
"public function actionUpdate($id) {\n $model = $this->findModel($id);\n\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()))\n {\n if($model->save())\n return $this->redirect(['view', 'id' => $model->id]);\n else\n var_dump($model->errors); die;\n }\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n if (empty($model->advertPrice)) {\n $advertPriceModel = new AdvertPrice();\n } else {\n $advertPriceModel = $model->advertPrice;\n }\n\n\n if (empty($model->advertAddress)) {\n $advertAddressModel = new AdvertAddress();\n } else {\n $advertAddressModel = $model->advertAddress;\n }\n\n $models_loaded = false;\n if ($model->load(Yii::$app->request->post())\n && $advertPriceModel->load(Yii::$app->request->post())\n && $advertAddressModel->load(Yii::$app->request->post())\n ) {\n $models_loaded = true;\n }\n $model->tutorid = intval(Yii::$app->user->id);\n\n if ($models_loaded && $model->save()) {\n\n $advertPriceModel->advertid = $model->id;\n $advertAddressModel->advertid = $model->id;\n if ($advertPriceModel->save() && $advertAddressModel->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'advertPriceModel' => $advertPriceModel,\n 'advertAddressModel' => $advertAddressModel\n ]);\n }\n\n } else {\n return $this->render('update', [\n 'model' => $model,\n 'advertPriceModel' => $advertPriceModel,\n 'advertAddressModel' => $advertAddressModel\n ]);\n }\n }",
"public function actionUpdate($id) {\n $model = $this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (isset($_POST['Plantel'])) {\n $model->attributes = $_POST['Plantel'];\n if ($model->save())\n $this->redirect(array('view', 'id' => $model->id));\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }",
"public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['OperaPlanes']))\n\t\t{\n\t\t\t$model->attributes=$_POST['OperaPlanes'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n$this->layout='//layouts/column2';\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t$this->render('update',array('model'=>$model, 'url'=>$_GET['url'], 'field_id'=>$_GET['field_id']));\n\t}",
"public function actionUpdate($id) {\r\n $model = $this->findModel($id);\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('update', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if (Yii::$app->request->post()) {\n $model->load(Yii::$app->request->post());\n $model->save();\n return $this->redirect(['site/view', 'id' => $model->id]);\n } else {\n return $this->render('knpr/update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n\n {\n \n $model = new Main();\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n return $this->redirect(['view', 'id' => $model->id]);\n\n } else {\n\n return $this->render('update', [\n\n 'model' => $model,\n\n ]);\n\n }\n \n \n\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $model->user_id = Yii::$app->getUser()->id;\n $currency_list = Yii::$app->params['currency_list'];\n\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['index']);\n } else {\n return $this->render('update', [\n 'currency_list' => $currency_list,\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->ora_id]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"function update(){\n\t\t$this->model->update();\n\t}",
"public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel(crypt::Decrypt($id));\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Consegne']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Consegne'];\n\t\t\t$tmp = explode(\"/\",$model->data);\n\t\t\t$model->data = strtotime($tmp[2].'-'.$tmp[1].'-'.$tmp[0]);\n\t\t\t$model->id_user = Yii::app()->user->objUser['id_user'];\n\t\t\t$model->codfisc = strtoupper($model->codfisc);\n\t\t\t$model->nome = strtoupper($model->nome);\n\t\t\t$model->cognome = strtoupper($model->cognome);\n\t\t\t$model->indirizzo = strtoupper($model->indirizzo);\n\t\t\t$model->note = strtoupper($model->note);\n\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>crypt::Encrypt($model->id_archive)));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionUpdate($id)\n {\n date_default_timezone_set('America/Sao_Paulo');\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n if($model->status_chegada == 1){\n $model->data_chegada = date('Y-m-d');\n $model->save();\n }\n if ($model->status_entrega == 1){\n $model->data_pronto = date('Y-m-d');\n $model->save();\n }elseif ($model->status_entrega == 2 && !$model->data_pronto) {\n $model->data_entregue = date('Y-m-d');\n $model->data_pronto = date('Y-m-d');\n $model->save();\n }elseif ($model->status_entrega == 2){\n $model->data_entregue = date('Y-m-d');\n $model->save();\n }\n\n return $this->redirect(['index']);\n\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n \tMsgUtils::success();\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n \t'vipList' => $this->findVipList(),\n \t'vipBlogList'=>$this->findVipBlogList(),\n \t'yesNoList' => SysParameterType::getSysParametersById(SysParameterType::YES_NO),\n ]);\n }\n }",
"public function actionUpdate($id)\n\t{\n\t\t$model=Cooperativepartner::model()->with('company')->findByPk($id);\n\t\tif(isset($_POST['Cooperativepartner']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Cooperativepartner'];\n\t\t\t$model->fUpdateUser=Yii::app()->params->loginuser->fUserName;\n\t\t\t$model->fUpdateDate=time();\n\t\t\tif(!empty($_POST['fCooperativeCompanyID'])) \n\t\t\t\t$model->fCooperativeCompanyID= $_POST['fCooperativeCompanyID'];\n\t\t\telse $model->fCooperativeCompanyID=$this->loadModel($id)->fCooperativeCompanyID;\n\t\t\t$model->fEducationalLevel= $_POST['EducationalLevel'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->fCooperativePartnerID));\n\t\t}\n\t\t$model->fCooperativeCompanyID=empty($model->company->fCooperativeCompanyID)?'':$model->company->fCooperativeCompanyName;\n\t\t$model->fEducationalLevel=array_key_exists($model->fEducationalLevel,adminSettings::$EducationLevel)?adminSettings::$EducationLevel[$model->fEducationalLevel]:'';\n\t\t$model->fCreateDate=empty($model->fCreateDate)?'':date('Y-m-d',$model->fCreateDate);\n\t\t$model->fUpdateDate=empty($model->fUpdateDate)?'':date('Y-m-d',$model->fUpdateDate);\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t\t'keyid'=>$id,'EducationLevel'=>adminSettings::$EducationLevel,'Sex'=>adminSettings::$Sex\n\t\t));\n\t}",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n 'users' => User::find()->orderBy('username')->all(),\n 'departments' => Department::find()->orderBy('longName')->all(),\n ]);\n }",
"public function actionUpdate($id)\n\t{\n //if(!Yii::app()->user->checkAccess(Params::DEFAULT_UPDATE)){throw new CHttpException(401,Yii::t('mds','You are prohibited to access this page. Contact Super Administrator'));}\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t\n\n\t\tif(isset($_POST['RKInfoPasienLamaV']))\n\t\t{\n\t\t\t$model->attributes=$_POST['RKInfoPasienLamaV'];\n\t\t\tif($model->save()){\n Yii::app()->user->setFlash('success', '<strong>Berhasil!</strong> Data berhasil disimpan.');\n\t\t\t\t$this->redirect(array('view','id'=>$model->pendaftaran_id));\n }\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionUpdate($id) {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->bonification_id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n\t{\n\t\t$model = $this->findModel($id);\n\n\t\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\treturn $this->redirect(['view', 'id' => $model->name]);\n\t\t} else {\n\t\t\treturn $this->render('update', [\n\t\t\t\t'model' => $model,\n\t\t\t]);\n\t\t}\n\t}",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->U_ID]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->code]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\r\n {\r\n $model = $this->findModel($id);\r\n\r\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\r\n return $this->redirect(['view', 'id' => $model->id]);\r\n } else {\r\n return $this->render('update', [\r\n 'model' => $model,\r\n ]);\r\n }\r\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_hasil_konsultasi]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n if ($model->save()){\n flash('success','Data Sasaran Eselon IV Berhasil Diubah');\n return $this->redirect(['index']);\n }\n \n flash('error','Data Sasaran Eselon IV Gagal Diubah');\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\tif(isset($_POST['buttonCancel']))\n {\n $this->redirect(Yii::app()->homeUrl);\n }\n\t\t\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Organisation']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Organisation'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->orgId));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionUpdate($id)\n {\n\t\t $model = $this->findModel($id);\n\t\t \n\t\t Yii::$app->view->title = Yii::t('app', 'Update {modelClass}: ', [\n 'modelClass' => 'Invt Check',\n]) . $model->id.' - '.Yii::t('app', Yii::$app->controller->module->params['title']);\n\t\t \n if ($model->load(Yii::$app->request->post())) {\n\t\t\tif($model->save()){\n AdzpireComponent::succalert('edtflsh', 'ปรับปรุงรายการเรียบร้อย');\n\t\t\t return $this->redirect(['view', 'id' => $model->id]);\n\t\t\t}else{\n AdzpireComponent::dangalert('edtflsh', 'ปรับปรุงรายการไม่ได้');\n\t\t\t}\n return $this->redirect(['view', 'id' => $model->id]);\n } \n\n return $this->render('update', [\n 'model' => $model,\n ]);\n \n\n }",
"public function actionUpdate($id) {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $this->layout = 'headbar';\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['TDespachoCabecera']))\n\t\t{\n\t\t\t$model->attributes=$_POST['TDespachoCabecera'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id_despacho));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n if($model->creator_id==Yii::$app->user->identity->id){\n \n if ($model->load(Yii::$app->request->post()) && $model->save()){\n return $this->redirect(['view', 'id' => $model->id]);\n }\n return $this->render('update', ['model' => $model,]);\n }\n\n else{\n return $this->redirect(['index']); \n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n if($model->creator_id==Yii::$app->user->identity->id){\n \n if ($model->load(Yii::$app->request->post()) && $model->save()){\n return $this->redirect(['view', 'id' => $model->id]);\n }\n return $this->render('update', ['model' => $model,]);\n }\n\n else{\n return $this->redirect(['index']); \n }\n }",
"public function actionUpdate($id)\n\t{\n\t\t$model = $this->findModel($id);\n\n\t\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\treturn $this->redirect(['view', 'id' => $model->id]);\n\t\t} else {\n\t\t\treturn $this->render('update', [\n\t\t\t\t\t'model' => $model,\n\t\t\t]);\n\t\t}\n\t}",
"public function update ()\n {\n $vereinRepository = new VereinRepository();\n\n $view = new View('verein_update');\n $view->title = \"Verein\";\n $view->heading = \"Verein bearbeiten\";\n $view->verein = $vereinRepository->readById($_GET['id']);\n $view->display();\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) ){\n $model->doctor_id_from = Yii::$app->user->id;\n //$date = Yii::$app->request->post('Alerts');\n ///print_r($date); exit;\n //$model->date = strtotime($date['date']);\n if(!$model->save()) print_r($model->getErrors());\n\n return $this->redirect(['index']);\n } else {\n $model->read_status = 1; // прочитано, как только просмотрен\n if(!$model->save()) print_r($model->getErrors());\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['RequestFuel']))\n\t\t{\n\t\t\t$model->attributes=$_POST['RequestFuel'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->requestFuelId));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n $model->scenario = 'update';\n\n if ($model->load(Yii::$app->request->post())) {\n if ($model->validate() ){ \n \n $connection = \\Yii::$app->db;\n $transaction = $connection->beginTransaction();\n\n try {\n //Se guarda encabezado Vale deposito_central\n if ($model->save()){\n $this->deshacer_renglones($model);\n $this->guardar_renglones($model);\n }\n $transaction->commit();\n return $this->redirect(['view', 'id' => $model->PE_NROREM]);\n }\n catch (\\Exception $e) {\n $transaction->rollBack();\n throw $e;\n }\n }\n else{\n return $this->render('update', [\n 'model' => $model,\n \n ]);\n }\n \n } else {\n \n\n $renglones = $this->agrupar_medicamentos($model->renglones);\n \n foreach ($renglones as $key => $renglon) {\n $renglones[$key]->descripcion = $renglon->articulo->AG_NOMBRE;\n $renglon->PR_FECVTO = Yii::$app->formatter->asDate($renglon->PR_FECVTO,'php:d-m-Y');\n }\n\n $model->renglones = $renglones;\n\n \n return $this->render('update', [\n 'model' => $model,\n \n ]);\n \n }\n }",
"public function actionUpdate($id)\n {\n \n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id_persyaratan]);\n }\n\n return $this->render('update', [\n 'model' => $model,\n ]);\n }",
"public function actionUpdate($id)\n\t{\n\t\t$model = $this->findModel($id);\n\n\t\tif ($model->load(Yii::$app->request->post()) && $model->save()) {\n\t\t\treturn $this->redirect(['view', 'id' => $model->id]);\n\t\t} else {\n\t\t\treturn $this->render('update', [\n\t\t\t\t'model' => $model,\n\t\t\t]);\n\t\t}\n\t}",
"public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Preferences']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Preferences'];\n\t\t\tif($model->save())\n\t\t\t\tYii::app()->user->setFlash('success', \"Nama Aplikasi was updated !\");\n\t\t\t\t$this->redirect(array('update','id'=>$id));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->aid]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\r\n\t{\r\n\t\t$model=$this->loadModel($id);\r\n\r\n\t\t// Uncomment the following line if AJAX validation is needed\r\n\t\t// $this->performAjaxValidation($model);\r\n\r\n\t\tif(isset($_POST['MoneyTransfer']))\r\n\t\t{\r\n\t\t\t$model->attributes=$_POST['MoneyTransfer'];\r\n\t\t\tif($model->save())\r\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\r\n\t\t}\r\n\r\n\t\t$this->render('update',array(\r\n\t\t\t'model'=>$model,\r\n\t\t));\r\n\t}",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n if ($model->load(Yii::$app->getRequest()->post(),'') && $model->save()) {\n return $this->redirect(['view', 'id' => $model->name]);\n }\n\n return $this->render('update', ['model' => $model]);\n }",
"public function actionUpdate($id)\n\t{ \n //echo \"<pre>\";print_r($_POST);die;\n $uid = Yii::app()->user->getId(); \n if($uid != 1){\n $value = ComSpry::getUnserilizedata($uid);\n if(empty($value) || !isset($value)){\n throw new CHttpException(403,'You are not authorized to perform this action.');\n }\n if(!in_array(37, $value)){\n throw new CHttpException(403,'You are not authorized to perform this action.');\n }\n }\n\t\t$model=$this->loadModel($id);\n $priceopt=array('p'=>'Per Pc','c'=>'Per Ct');\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n $oldcost=$model->curcost;\n /* ---- SPry manish dec 31 2012 start-----*/\n if($model->weight != 0){\n $cost_price = round($model->curcost/$model->weight,2);\n }\n else{\n $cost_price = 0;\n }\n /* ---- SPry manish dec 31 2012 End-----*/\n\t\tif(isset($_POST['Stone']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Stone'];\n $model->prevcost=$oldcost;\n if($_POST['priceopt']=='c'){\n $model->curcost=$model->weight*$_POST['Stone']['curcost'];\n }\n\t\t\tif($model->save()){\n $stonecostlog=new Stonecostlog('insert');\n $stonecostlog->cdate=$model->cdate;\n $stonecostlog->mdate=$model->mdate;\n $stonecostlog->updby=$model->updby;\n $stonecostlog->cost=$model->curcost;\n $stonecostlog->idstone=$model->idstone;\n if($stonecostlog->save()){\n\t\t\t\t$this->redirect(array('view','id'=>$model->idstone));\n }\n \n }\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,'priceopt'=>$priceopt,'cost_price'=>$cost_price\n\t\t));\n \n\t}",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->name]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->loadModel($id);\n $model->car_price_buy = number_format($model->car_price_buy, 2);\n $model->car_price_sale = number_format($model->car_price_sale, 2);\n // Uncomment the following line if AJAX validation is needed\n $this->performAjaxValidation($model);\n if (isset($_POST['InfonCar'])) {\n $model->attributes = $_POST['InfonCar'];\n $model->user_id = Yii::app()->user->id;\n $model->date_in = date('Y-m-d', strtotime($model->date_in));\n $model->status = \"Approve\";\n if ($model->car_or_spare_status_id == 1) {\n $model->branch_from_share = NULL;\n }\n if ($model->car_or_spare_status_id == 2 && empty($model->branch_from_share)) {\n Yii::app()->user->setFlash('error', \"ກະລຸນາເລືອກສາຂາ\");\n } else {\n if ($model->save()) {\n if (isset(Yii::app()->session['admin_sale_branch'])) {\n $this->redirect(array('index', 'branc_id' => Yii::app()->session['admin_sale_branch']));\n } else {\n $this->redirect(array('index'));\n }\n }\n }\n }\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post())) {\n $model->saldoactual=0;\n if($model->save()){\n $model::getDb()->createCommand(\"call actualizarSaldoActual();\")->execute();\n return $this->redirect(['view', 'id' => $model->id]);}else{\n return $this->render('update', [\n 'model' => $model,'fecha'=>$model->fecha,'descripcion'=>$model->descripcion,'entra'=>3,\n ]); \n }\n } else {\n return $this->render('update', [\n 'model' => $model,'fecha'=>$model->fecha,'descripcion'=>$model->descripcion,'entra'=>0,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n\t$model = static::findModel($id);\n\n\t$viewFolder = '/';\n\t$viewName = 'update';\n\t$viewExtension = '.php';\n\t$viewFile = $this->getViewPath().$viewFolder.$viewName.$viewExtension;\n\t$viewPath = file_exists($viewFile) ? '' : $this->getDefaultViewPath(false);\n\n\tif ($model->load(Yii::$app->request->post())) {\n\t\t$this->processData($model, 'update');\n\t\treturn $this->redirect(['view', 'id' => $model->getPrimaryKey()]);\n\t} else {\n\t\treturn $this->render($viewPath.$viewName, array_merge($this->commonViewData(), [\n\t\t\t'model' => $model,\n\t]));\n\t}\n }",
"public function actionUpdate($id)\n {\n $model = $this->loadModel($id);\n\n // Uncomment the following line if AJAX validation is needed\n // $this->performAjaxValidation($model);\n\n if (Yii::app()->request->isPostRequest && isset($_POST['BookingItemsPosition'])) {\n $model->setAttributes(Yii::app()->request->getPost('BookingItemsPosition'));\n\n if ($model->save()) {\n if (Yii::app()->request->isAjaxRequest) {\n echo Yii::t('BookingModule.booking', 'Объект бронирования обновлен!');\n Yii::app()->end();\n } else {\n Yii::app()->user->setFlash(\n YFlashMessages::NOTICE_MESSAGE, Yii::t('BookingModule.booking', 'Объект бронирования обновлен!')\n );\n if (!isset($_POST['submit-type']))\n $this->redirect(array('update', 'id' => $model->id));\n else\n $this->redirect(array($_POST['submit-type']));\n\n $this->redirect(array('view', 'id' => $model->id));\n }\n } else {\n if (Yii::app()->request->isAjaxRequest) {\n var_dump($model->getError());\n Yii::app()->end();\n } else {\n $this->render('update', array(\n 'model' => $model,\n ));\n }\n }\n }\n\n $model->date = date('d.m.Y');\n\n $this->render('update', array(\n 'model' => $model,\n ));\n }",
"public function actionUpdate($id)\n\t{\n\t\t$model=$this->loadModel($id);\n\n\t\t// Uncomment the following line if AJAX validation is needed\n\t\t// $this->performAjaxValidation($model);\n\n\t\tif(isset($_POST['Solicitudes']))\n\t\t{\n\t\t\t$model->attributes=$_POST['Solicitudes'];\n\t\t\tif($model->save())\n\t\t\t\t$this->redirect(array('view','id'=>$model->id));\n\t\t}\n\n\t\t$this->render('update',array(\n\t\t\t'model'=>$model,\n\t\t));\n\t}",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->ID]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->ID]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id)\n {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->US_ID]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id) {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id) {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id) {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id) {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }",
"public function actionUpdate($id) {\n $model = $this->findModel($id);\n\n if ($model->load(Yii::$app->request->post()) && $model->save()) {\n return $this->redirect(['view', 'id' => $model->id]);\n } else {\n return $this->render('update', [\n 'model' => $model,\n ]);\n }\n }"
]
| [
"0.7138898",
"0.6956029",
"0.6944433",
"0.694049",
"0.68806237",
"0.68288785",
"0.6827409",
"0.6812045",
"0.6802215",
"0.6793345",
"0.67577565",
"0.6718361",
"0.6715885",
"0.6711902",
"0.6708441",
"0.6702812",
"0.6693259",
"0.66879815",
"0.66828",
"0.66615796",
"0.6658599",
"0.6651961",
"0.6641242",
"0.6636157",
"0.66346145",
"0.6631818",
"0.6629318",
"0.66211456",
"0.6616015",
"0.6614615",
"0.6610612",
"0.6600559",
"0.66005385",
"0.6598112",
"0.6595046",
"0.65892",
"0.65890354",
"0.6588884",
"0.65840584",
"0.65823495",
"0.6580651",
"0.657867",
"0.65781605",
"0.6570531",
"0.65659165",
"0.65576315",
"0.655582",
"0.6552192",
"0.6548309",
"0.6548115",
"0.6547626",
"0.6547261",
"0.65429455",
"0.65426725",
"0.6542344",
"0.6537233",
"0.6536751",
"0.65362996",
"0.6530284",
"0.6526647",
"0.65254015",
"0.6518362",
"0.65146357",
"0.65082747",
"0.6506223",
"0.65057486",
"0.6501897",
"0.6500377",
"0.64992404",
"0.64973664",
"0.64965117",
"0.64944005",
"0.6490551",
"0.6490551",
"0.64899683",
"0.6489731",
"0.64888084",
"0.648514",
"0.64845914",
"0.64834654",
"0.64815015",
"0.64813244",
"0.64792913",
"0.6477403",
"0.6475701",
"0.64726883",
"0.64702415",
"0.64654654",
"0.6465339",
"0.6465107",
"0.64648896",
"0.64633226",
"0.64628565",
"0.6458246",
"0.6458246",
"0.6456312",
"0.6456104",
"0.6456104",
"0.6456104",
"0.6456104",
"0.6456104"
]
| 0.0 | -1 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.